From patchwork Wed Feb 3 16:25:55 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jacopo Mondi X-Patchwork-Id: 11119 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 BD1EEBD161 for ; Wed, 3 Feb 2021 16:25:47 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 8361F68457; Wed, 3 Feb 2021 17:25:45 +0100 (CET) Received: from relay12.mail.gandi.net (relay12.mail.gandi.net [217.70.178.232]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 4E1AE683FE for ; Wed, 3 Feb 2021 17:25:44 +0100 (CET) Received: from uno.lan (93-34-118-233.ip49.fastwebnet.it [93.34.118.233]) (Authenticated sender: jacopo@jmondi.org) by relay12.mail.gandi.net (Postfix) with ESMTPSA id 18062200011 for ; Wed, 3 Feb 2021 16:25:43 +0000 (UTC) From: Jacopo Mondi To: libcamera-devel@lists.libcamera.org Date: Wed, 3 Feb 2021 17:25:55 +0100 Message-Id: <20210203162600.206297-3-jacopo@jmondi.org> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210203162600.206297-1-jacopo@jmondi.org> References: <20210203162600.206297-1-jacopo@jmondi.org> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 2/7] android: camera_device: Report AE_EXPOSURE_COMPENSATION 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" The CaptureResultTest#testCameraCaptureResultAllKeys enforces the presence of the ANDROID_CONTROL_AE_EXPOSURE_COMPENSATION result metadata. Report 0 as the current value for ANDROID_CONTROL_AE_EXPOSURE_COMPENSATION in the result metadata pack. Signed-off-by: Jacopo Mondi Reviewed-by: Niklas Söderlund Reviewed-by: Laurent Pinchart --- src/android/camera_device.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/android/camera_device.cpp b/src/android/camera_device.cpp index 02908beb867e..cdc75b949206 100644 --- a/src/android/camera_device.cpp +++ b/src/android/camera_device.cpp @@ -708,7 +708,7 @@ std::tuple CameraDevice::calculateStaticMetadataSize() * Currently: 53 entries, 846 bytes of static metadata */ uint32_t numEntries = 53; - uint32_t byteSize = 850; + uint32_t byteSize = 854; /* * Calculate space occupation in bytes for dynamically built metadata @@ -1245,6 +1245,7 @@ const camera_metadata_t *CameraDevice::getStaticMetadata() std::vector availableResultKeys = { ANDROID_COLOR_CORRECTION_ABERRATION_MODE, ANDROID_CONTROL_AE_ANTIBANDING_MODE, + ANDROID_CONTROL_AE_EXPOSURE_COMPENSATION, ANDROID_CONTROL_AE_LOCK, ANDROID_CONTROL_AE_MODE, ANDROID_CONTROL_AE_PRECAPTURE_TRIGGER, @@ -1961,7 +1962,7 @@ CameraDevice::getResultMetadata(Camera3RequestDescriptor *descriptor, * Total bytes for JPEG metadata: 82 */ std::unique_ptr resultMetadata = - std::make_unique(41, 157); + std::make_unique(42, 161); if (!resultMetadata->isValid()) { LOG(HAL, Error) << "Failed to allocate static metadata"; return nullptr; @@ -1980,6 +1981,10 @@ CameraDevice::getResultMetadata(Camera3RequestDescriptor *descriptor, value = ANDROID_CONTROL_AE_ANTIBANDING_MODE_OFF; resultMetadata->addEntry(ANDROID_CONTROL_AE_ANTIBANDING_MODE, &value, 1); + int32_t value32 = 0; + resultMetadata->addEntry(ANDROID_CONTROL_AE_EXPOSURE_COMPENSATION, + &value32, 1); + value = ANDROID_CONTROL_AE_LOCK_OFF; resultMetadata->addEntry(ANDROID_CONTROL_AE_LOCK, &value, 1);