From patchwork Tue Jan 19 14:37:05 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jacopo Mondi X-Patchwork-Id: 10893 X-Patchwork-Delegate: jacopo@jmondi.org Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id 7B670BD808 for ; Tue, 19 Jan 2021 14:37:03 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 328D268169; Tue, 19 Jan 2021 15:37:03 +0100 (CET) Received: from relay6-d.mail.gandi.net (relay6-d.mail.gandi.net [217.70.183.198]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 497676814B for ; Tue, 19 Jan 2021 15:36:59 +0100 (CET) X-Originating-IP: 93.61.96.190 Received: from uno.LocalDomain (93-61-96-190.ip145.fastwebnet.it [93.61.96.190]) (Authenticated sender: jacopo@jmondi.org) by relay6-d.mail.gandi.net (Postfix) with ESMTPSA id 0A1CAC0007 for ; Tue, 19 Jan 2021 14:36:58 +0000 (UTC) From: Jacopo Mondi To: libcamera-devel@lists.libcamera.org Date: Tue, 19 Jan 2021 15:37:05 +0100 Message-Id: <20210119143711.153517-6-jacopo@jmondi.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210119143711.153517-1-jacopo@jmondi.org> References: <20210119143711.153517-1-jacopo@jmondi.org> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v2 05/11] android: camera_device: Report EXPOSURE_TIME 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: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" Instead of reporting a fake value in the dynamic metadata for the EXPOSURE_TIME control, use the value provided by the pipeline. The metadata is only meaningfull in FULL mode. Reviewed-by: Laurent Pinchart Signed-off-by: Jacopo Mondi --- src/android/camera_device.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/android/camera_device.cpp b/src/android/camera_device.cpp index d22142337d04..0484bb9a6557 100644 --- a/src/android/camera_device.cpp +++ b/src/android/camera_device.cpp @@ -1871,11 +1871,6 @@ CameraDevice::getResultMetadata(Camera3RequestDescriptor *descriptor, resultMetadata->addEntry(ANDROID_SENSOR_ROLLING_SHUTTER_SKEW, &rolling_shutter_skew, 1); - /* 16.6 msec */ - const int64_t exposure_time = 16600000; - resultMetadata->addEntry(ANDROID_SENSOR_EXPOSURE_TIME, - &exposure_time, 1); - const uint8_t lens_shading_map_mode = ANDROID_STATISTICS_LENS_SHADING_MAP_MODE_OFF; resultMetadata->addEntry(ANDROID_STATISTICS_LENS_SHADING_MAP_MODE, @@ -1893,6 +1888,12 @@ CameraDevice::getResultMetadata(Camera3RequestDescriptor *descriptor, &pipeline_depth, 1); } + if (metadata.contains(controls::ExposureTime)) { + int32_t exposure = metadata.get(controls::ExposureTime); + resultMetadata->addEntry(ANDROID_SENSOR_EXPOSURE_TIME, + &exposure, 1); + } + /* * Return the result metadata pack even is not valid: get() will return * nullptr.