From patchwork Fri Apr 3 14:53:01 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Naushir Patuck X-Patchwork-Id: 3371 Return-Path: Received: from mail-wr1-x42c.google.com (mail-wr1-x42c.google.com [IPv6:2a00:1450:4864:20::42c]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 30B9D600FA for ; Fri, 3 Apr 2020 16:53:29 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=raspberrypi.com header.i=@raspberrypi.com header.b="XPybDtKL"; dkim-atps=neutral Received: by mail-wr1-x42c.google.com with SMTP id c7so8851756wrx.5 for ; Fri, 03 Apr 2020 07:53:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raspberrypi.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=qm2VzOK8kBM1KF0dCYHY80QGq25ZUHsY21ENsg6U3bs=; b=XPybDtKL5XmuwS+p0paiak0gnNm3zcIMIg6xf+p483momuoqNalQx2p1kjwi9UcKao Qb8gWr1UKT9bA+oNm/yta0brPf0uWIiVBkdGdrzI5CsyaNANAzJCBRow2tZJ44tn/S4F 7F+dYN0VM0L9pxmDO/EfdmQN17dEHQ2Lfo1n5KtRl7idMgsp/fbEbYBZ3RNU49dZX1eQ t02xu3gLsdfHdO7iS7dbrPvNJYN+hJImp5xeE5IyLdQJXHjtkjboKjUWYwSmjjPyE54/ 6Zuq8C6w6dnWWcEGWpY5xT/cl99D7Kv39bAJjchrk54wcwkaUiX9l8jaUHLBUcGbDmp5 Afog== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=qm2VzOK8kBM1KF0dCYHY80QGq25ZUHsY21ENsg6U3bs=; b=QlRL79bf306Y4gM/cBNUp0H4g1h6v90ojro9cQvn9atYjMSit8eP4ltvWqizX8d6Af DSBw7dbISc6DuaHhyxp1jRDVn9DXuWMNNkfcF6whvj+azEkOYnSbPbw3PuiuQKKFnLJe FP4RCIyaR8B+d5w1xvyZcD2otHfmt4t2gcfVfNW6hifrc9QUX6sYiNb9+GXZ9K4kF5mj cndNRyLRNHuv8dCW8SEnko5bBFSN/Dp/zDB+32Cy4vte+vYkSlbUs5Kukvf14iFR6RAm GFlWWN91odK2o7AZqRqPSgumT7SWH1UIraPBI3h0yPv/KJO64TGPXYP86lep6Jc0kIKW XOgw== X-Gm-Message-State: AGi0Pua/Y0VQX8qcHiGoq8gfzq1EwAkaa1rX9LGKKAQBYRjkKI70V/3v rgiYoEgXSe3XvCtPmiVaeoUPctdOSQbPwA== X-Google-Smtp-Source: APiQypL8s/a1lgZIZGlrLxLmCOiuu3bfpGnMM9vnRnSNOABoDeReZLkdfvHd0ZAS2jIb2dgE+rRPSA== X-Received: by 2002:adf:e50c:: with SMTP id j12mr9655954wrm.154.1585925608750; Fri, 03 Apr 2020 07:53:28 -0700 (PDT) Received: from naushir-VirtualBox.patuck.local ([88.97.76.4]) by smtp.gmail.com with ESMTPSA id u5sm13559469wrp.81.2020.04.03.07.53.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Apr 2020 07:53:28 -0700 (PDT) From: Naushir Patuck To: libcamera-devel@lists.libcamera.org Date: Fri, 3 Apr 2020 15:53:01 +0100 Message-Id: <20200403145305.10288-2-naush@raspberrypi.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200403145305.10288-1-naush@raspberrypi.com> References: <20200403145305.10288-1-naush@raspberrypi.com> Subject: [libcamera-devel] [PATCH v3 1/5] libcamera: controls: Updates to gain and exposure controls X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Apr 2020 14:53:29 -0000 Rename: ManualExposure -> ExposureTime ManualGain -> AnalogueGain Use micro-seconds units for ExposureTime. This is changed from milli- seconds. The latter would not allow very low exposure times. AnalogueGain switch to use a float to allow fractional gain adjustments. Signed-off-by: Naushir Patuck Reviewed-by: Laurent Pinchart --- src/libcamera/control_ids.yaml | 20 ++++++++++++++------ src/libcamera/pipeline/uvcvideo/uvcvideo.cpp | 8 ++++---- 2 files changed, 18 insertions(+), 10 deletions(-) diff --git a/src/libcamera/control_ids.yaml b/src/libcamera/control_ids.yaml index 4befec74..839eea76 100644 --- a/src/libcamera/control_ids.yaml +++ b/src/libcamera/control_ids.yaml @@ -10,7 +10,7 @@ controls: description: | Enable or disable the AE. - \sa ManualExposure + \sa ExposureTime AnalogueGain - AeLocked: type: bool @@ -42,12 +42,20 @@ controls: type: int32_t description: Specify a fixed saturation parameter - - ManualExposure: + - ExposureTime: type: int32_t - description: Specify a fixed exposure time in milli-seconds + description: | + Exposure time (shutter speed) for the frame applied in the sensor + device. This value is specified in micro-seconds. - - ManualGain: - type: int32_t - description: Specify a fixed gain parameter + \sa AnalogueGain AeEnable + + - AnalogueGain: + type: float + description: | + Analogue gain value applied in the sensor device. + The value of the control specifies the gain multiplier applied to all + colour channels. This value cannot be lower than 1.0. + \sa ExposureTime AeEnable ... diff --git a/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp b/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp index ffbddf27..d7df95e4 100644 --- a/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp +++ b/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp @@ -251,10 +251,10 @@ int PipelineHandlerUVC::processControls(UVCCameraData *data, Request *request) controls.set(V4L2_CID_CONTRAST, value); } else if (id == controls::Saturation) { controls.set(V4L2_CID_SATURATION, value); - } else if (id == controls::ManualExposure) { + } else if (id == controls::ExposureTime) { controls.set(V4L2_CID_EXPOSURE_AUTO, static_cast(1)); controls.set(V4L2_CID_EXPOSURE_ABSOLUTE, value); - } else if (id == controls::ManualGain) { + } else if (id == controls::AnalogueGain) { controls.set(V4L2_CID_GAIN, value); } } @@ -364,10 +364,10 @@ int UVCCameraData::init(MediaEntity *entity) id = &controls::Saturation; break; case V4L2_CID_EXPOSURE_ABSOLUTE: - id = &controls::ManualExposure; + id = &controls::ExposureTime; break; case V4L2_CID_GAIN: - id = &controls::ManualGain; + id = &controls::AnalogueGain; break; default: continue;