From patchwork Tue Nov 23 10:40:36 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Elder X-Patchwork-Id: 14697 X-Patchwork-Delegate: paul.elder@ideasonboard.com 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 D9CA3C324F for ; Tue, 23 Nov 2021 10:41:02 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 7D8D860394; Tue, 23 Nov 2021 11:41:02 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="MwBcgTGF"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 8F5186033C for ; Tue, 23 Nov 2021 11:41:00 +0100 (CET) Received: from pyrite.rasen.tech (unknown [IPv6:2400:4051:61:600:2c71:1b79:d06d:5032]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 4CD31A1B; Tue, 23 Nov 2021 11:40:59 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1637664060; bh=t4RUVxeVdVYoiqMHi4fkaZISziFoTj0ag0m+o0uaYEc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=MwBcgTGFsd/hGpSt/T1PmwR8zx6GMTAerBYfakzXMlaYFQuzFUnMD6+c8A+af0+Cn 3e1bEKpzcXvq7Nwo1iV9lYqlM++hrKVyTFagAD41JvP/p6Pea4XYxYVI9KfHxAy28j JFNHEL0YnyMmGyf3zHkvVXwRaaJv7imOh1J33N+Q= From: Paul Elder To: libcamera-devel@lists.libcamera.org Date: Tue, 23 Nov 2021 19:40:36 +0900 Message-Id: <20211123104042.3100902-2-paul.elder@ideasonboard.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20211123104042.3100902-1-paul.elder@ideasonboard.com> References: <20211123104042.3100902-1-paul.elder@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 1/7] android: camera_capabilities: Add messages for lack of FULL support 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" Print messages when some feature is missing that causes hardware level FULL to not be supported. Signed-off-by: Paul Elder --- src/android/camera_capabilities.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/android/camera_capabilities.cpp b/src/android/camera_capabilities.cpp index f357902e..8c138df4 100644 --- a/src/android/camera_capabilities.cpp +++ b/src/android/camera_capabilities.cpp @@ -359,6 +359,9 @@ void CameraCapabilities::computeHwLevel( { camera_metadata_ro_entry_t entry; bool found; + + const char *noFull = "Hardware level FULL unavailable: "; + camera_metadata_enum_android_info_supported_hardware_level hwLevel = ANDROID_INFO_SUPPORTED_HARDWARE_LEVEL_FULL; @@ -372,8 +375,10 @@ void CameraCapabilities::computeHwLevel( hwLevel = ANDROID_INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED; found = staticMetadata_->getEntry(ANDROID_SYNC_MAX_LATENCY, &entry); - if (!found || *entry.data.i32 != 0) + if (!found || *entry.data.i32 != 0) { + LOG(HAL, Info) << noFull << "missing or invalid max sync latency"; hwLevel = ANDROID_INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED; + } hwLevel_ = hwLevel; } From patchwork Tue Nov 23 10:40:37 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Elder X-Patchwork-Id: 14698 X-Patchwork-Delegate: paul.elder@ideasonboard.com 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 5A7BBBDB13 for ; Tue, 23 Nov 2021 10:41:05 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 11DB6603B5; Tue, 23 Nov 2021 11:41:05 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="hgYwBa/U"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 5D91B6036F for ; Tue, 23 Nov 2021 11:41:02 +0100 (CET) Received: from pyrite.rasen.tech (unknown [IPv6:2400:4051:61:600:2c71:1b79:d06d:5032]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 0D9B6A1B; Tue, 23 Nov 2021 11:41:00 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1637664062; bh=CJD5x6M4weR20THOR6nxP34C+ecoxO2KD5FLtWtNmRA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=hgYwBa/UtggcpY8e9Q5ex46deEGuattITj65YBjvCOUADaWWF7FauEb4jv3a5qTpy wbAhkVE8lhlFhQ7H1aFoU/VW0MZV7NEEzEvIN0r8P1Y0rz5mBSUuQ8AdkptnS5OFBq +eo0UiMojTLxoIsO77WlsGWM4QYdPTlIunyzDNDU= From: Paul Elder To: libcamera-devel@lists.libcamera.org Date: Tue, 23 Nov 2021 19:40:37 +0900 Message-Id: <20211123104042.3100902-3-paul.elder@ideasonboard.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20211123104042.3100902-1-paul.elder@ideasonboard.com> References: <20211123104042.3100902-1-paul.elder@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 2/7] android: camera_capabilities: Set read sensor settings capability 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" A libcamera camera that supports the manual sensor capability also satisfies all the requirements for the read sensor settings capability. Set it. Signed-off-by: Paul Elder Reviewed-by: Kieran Bingham --- src/android/camera_capabilities.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/android/camera_capabilities.cpp b/src/android/camera_capabilities.cpp index 8c138df4..8484c682 100644 --- a/src/android/camera_capabilities.cpp +++ b/src/android/camera_capabilities.cpp @@ -339,8 +339,11 @@ CameraCapabilities::computeCapabilities() capabilities.insert(ANDROID_REQUEST_AVAILABLE_CAPABILITIES_BACKWARD_COMPATIBLE); - if (validateManualSensorCapability()) + if (validateManualSensorCapability()) { capabilities.insert(ANDROID_REQUEST_AVAILABLE_CAPABILITIES_MANUAL_SENSOR); + /* The libcamera requirements cover this */ + capabilities.insert(ANDROID_REQUEST_AVAILABLE_CAPABILITIES_READ_SENSOR_SETTINGS); + } if (validateManualPostProcessingCapability()) capabilities.insert(ANDROID_REQUEST_AVAILABLE_CAPABILITIES_MANUAL_POST_PROCESSING); From patchwork Tue Nov 23 10:40:38 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Elder X-Patchwork-Id: 14699 X-Patchwork-Delegate: paul.elder@ideasonboard.com 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 DCFB3BDB13 for ; Tue, 23 Nov 2021 10:41:07 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 96B1860398; Tue, 23 Nov 2021 11:41:07 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="qQbBa1Lx"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 2AED06033C for ; Tue, 23 Nov 2021 11:41:04 +0100 (CET) Received: from pyrite.rasen.tech (unknown [IPv6:2400:4051:61:600:2c71:1b79:d06d:5032]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id C292DA1B; Tue, 23 Nov 2021 11:41:02 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1637664064; bh=s9Rs+u6OhvJblp2sk0T3CF3w3kgC5jPMWV7ntWkFZkU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qQbBa1Lx50RnHHTpIGiEfHTc8lwI8kIS88bX50LLrAyQG5aMhusgS0PjfD77zmTpt yJjPePmbpwe/iGsgQR1Gsaj6tllKHLm44gE8KoSKxG8hYBURTITbVvlMrQkqJNjysu cfFJZuVGbNDPDTf5cZEHPrGorgNIluua8flRWeBw= From: Paul Elder To: libcamera-devel@lists.libcamera.org Date: Tue, 23 Nov 2021 19:40:38 +0900 Message-Id: <20211123104042.3100902-4-paul.elder@ideasonboard.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20211123104042.3100902-1-paul.elder@ideasonboard.com> References: <20211123104042.3100902-1-paul.elder@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 3/7] android: camera_metadata: Add appendEntry helper 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" Add appendEntry() helper, that automatically detects if updateEntry() or addEntry() should be used. For now only implement it for enums and arithmetic values, as they will mainly be used in populating templates, where the preview template generator may or may not have (based on capabilities) already added a key. Signed-off-by: Paul Elder Reviewed-by: Kieran Bingham --- src/android/camera_metadata.h | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/android/camera_metadata.h b/src/android/camera_metadata.h index 8555c7c3..cca14d6c 100644 --- a/src/android/camera_metadata.h +++ b/src/android/camera_metadata.h @@ -33,6 +33,17 @@ public: bool hasEntry(uint32_t tag) const; + template || + std::is_enum_v> * = nullptr> + bool appendEntry(uint32_t tag, const T &data) + { + if (hasEntry(tag)) + return updateEntry(tag, &data, 1, sizeof(T)); + else + return addEntry(tag, &data, 1, sizeof(T)); + } + template || std::is_enum_v> * = nullptr> From patchwork Tue Nov 23 10:40:39 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Elder X-Patchwork-Id: 14700 X-Patchwork-Delegate: paul.elder@ideasonboard.com 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 7DCC4C324F for ; Tue, 23 Nov 2021 10:41:08 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 251E26038B; Tue, 23 Nov 2021 11:41:08 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="SUOAdKUU"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 0029E6033C for ; Tue, 23 Nov 2021 11:41:05 +0100 (CET) Received: from pyrite.rasen.tech (unknown [IPv6:2400:4051:61:600:2c71:1b79:d06d:5032]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 93BF4A1B; Tue, 23 Nov 2021 11:41:04 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1637664065; bh=ZUkNXUnz2bmlUyd22jZRxTz/qfGZO9eVWitwIwL/U4o=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SUOAdKUUr9SbsVDx5lAYziQ6r1hMGTOi81WrdGuY2n4K2sJ0Z97Lb5w332WEFR4cY zQx80HyxS87NWAZluvFZ/WUxthRiZI5cxjSady8IvOtVUIRHBaioeJqpYqqvTGoOS2 G5kO3QfuGZlVLFyvxY6Xh3PRAjUQWYuMBpJBGppc= From: Paul Elder To: libcamera-devel@lists.libcamera.org Date: Tue, 23 Nov 2021 19:40:39 +0900 Message-Id: <20211123104042.3100902-5-paul.elder@ideasonboard.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20211123104042.3100902-1-paul.elder@ideasonboard.com> References: <20211123104042.3100902-1-paul.elder@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 4/7] android: camera_capabilities: Fix the type of the capability vector 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 type of elements of the capability vector that is set in the static metadata must be uint8_t. The enum will not suffice, as it is int32_t. Fix this. Signed-off-by: Paul Elder Reviewed-by: Kieran Bingham --- src/android/camera_capabilities.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/android/camera_capabilities.cpp b/src/android/camera_capabilities.cpp index 8484c682..875d38da 100644 --- a/src/android/camera_capabilities.cpp +++ b/src/android/camera_capabilities.cpp @@ -1379,7 +1379,8 @@ int CameraCapabilities::initializeStaticMetadata() /* Check capabilities */ capabilities_ = computeCapabilities(); - std::vector + /* This *must* uint8_t. */ + std::vector capsVec(capabilities_.begin(), capabilities_.end()); staticMetadata_->addEntry(ANDROID_REQUEST_AVAILABLE_CAPABILITIES, capsVec); From patchwork Tue Nov 23 10:40:40 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Elder X-Patchwork-Id: 14701 X-Patchwork-Delegate: paul.elder@ideasonboard.com 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 446D5BDB13 for ; Tue, 23 Nov 2021 10:41:11 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id C1C56603F9; Tue, 23 Nov 2021 11:41:10 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="spS3SksT"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id E55046036F for ; Tue, 23 Nov 2021 11:41:08 +0100 (CET) Received: from pyrite.rasen.tech (unknown [IPv6:2400:4051:61:600:2c71:1b79:d06d:5032]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 6C08FA1B; Tue, 23 Nov 2021 11:41:06 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1637664068; bh=OMfyWBDclxYp2KVuXBXDCu92O7xnEaOG5SVc6pfggOM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=spS3SksT253nipKD7gLmzQWfyse5k/DwNZvu4JNt2FC/DW0yLRuZwCnpnL+qKByNr 7QMLJZ0wT8ilKEKmUPHHhSnWDRrYBB2XeitYOH+o8BwOVj8D3dyZSRIMcQIeNsez/W 7oOLfPSsoIahG1rZU4+u15Hd0n0RByype3tsnA50= From: Paul Elder To: libcamera-devel@lists.libcamera.org Date: Tue, 23 Nov 2021 19:40:40 +0900 Message-Id: <20211123104042.3100902-6-paul.elder@ideasonboard.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20211123104042.3100902-1-paul.elder@ideasonboard.com> References: <20211123104042.3100902-1-paul.elder@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v4 5/7] android: Check exposure time range for manual sensor capability 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" In the manual sensor capability validator, add a check for the presence of the exposure time range key, and for the maximum exposure time. The minimum exposure time is a requirement for adding the key in the first place; add a check for this as well. If either requirement is not met, the manual sensor capability validation will fail, therefore disabling the FULL hardware level. The exposure time range key is optional in non-FULL hardware levels. Signed-off-by: Paul Elder Reviewed-by: Laurent Pinchart Reviewed-by: Jean-Michel Hautbois Reviewed-by: Kieran Bingham Reviewed-by: Umang Jain --- Changes in v4: - s/i32/i64 Changes in v3: - squash "android: capabilities: Add exposure time keys only if available" - fix the minumum exposure time check - only make the exposure time range key available if this check passes. additionally, if the max exposure time passes its check, tick the box for manual sensor and FULL - update commit message accordingly Changes in v2: - fix comparator order (cosmetic) - change comparators and comments to "equal or", as that is what is specificied in the hal docs - add check for minimum exposure time when initializing static metadata --- src/android/camera_capabilities.cpp | 33 +++++++++++++++++++++++++---- 1 file changed, 29 insertions(+), 4 deletions(-) diff --git a/src/android/camera_capabilities.cpp b/src/android/camera_capabilities.cpp index 875d38da..f7397d27 100644 --- a/src/android/camera_capabilities.cpp +++ b/src/android/camera_capabilities.cpp @@ -217,6 +217,8 @@ std::vector setMetadata(CameraMetadata *metadata, uint32_t tag, bool CameraCapabilities::validateManualSensorCapability() { + camera_metadata_ro_entry_t entry; + const char *noMode = "Manual sensor capability unavailable: "; if (!staticMetadata_->entryContains(ANDROID_CONTROL_AE_AVAILABLE_MODES, @@ -231,6 +233,19 @@ bool CameraCapabilities::validateManualSensorCapability() return false; } + if (!staticMetadata_->hasEntry(ANDROID_SENSOR_INFO_EXPOSURE_TIME_RANGE)) { + LOG(HAL, Info) << noMode << "missing exposure time range"; + return false; + } + + staticMetadata_->getEntry(ANDROID_SENSOR_INFO_EXPOSURE_TIME_RANGE, &entry); + if (entry.data.i64[1] <= 100000000) { + LOG(HAL, Info) + << noMode + << "exposure time range maximum must be larger than 100ms"; + return false; + } + /* * \todo Return true here after we satisfy all the requirements: * https://developer.android.com/reference/android/hardware/camera2/CameraMetadata#REQUEST_AVAILABLE_CAPABILITIES_MANUAL_SENSOR @@ -798,7 +813,6 @@ int CameraCapabilities::initializeStaticMetadata() ANDROID_SENSOR_AVAILABLE_TEST_PATTERN_MODES, ANDROID_SENSOR_INFO_ACTIVE_ARRAY_SIZE, ANDROID_SENSOR_INFO_COLOR_FILTER_ARRANGEMENT, - ANDROID_SENSOR_INFO_EXPOSURE_TIME_RANGE, ANDROID_SENSOR_INFO_MAX_FRAME_DURATION, ANDROID_SENSOR_INFO_PHYSICAL_SIZE, ANDROID_SENSOR_INFO_PIXEL_ARRAY_SIZE, @@ -876,7 +890,6 @@ int CameraCapabilities::initializeStaticMetadata() ANDROID_NOISE_REDUCTION_MODE, ANDROID_REQUEST_PIPELINE_DEPTH, ANDROID_SCALER_CROP_REGION, - ANDROID_SENSOR_EXPOSURE_TIME, ANDROID_SENSOR_FRAME_DURATION, ANDROID_SENSOR_ROLLING_SHUTTER_SKEW, ANDROID_SENSOR_TEST_PATTERN_MODE, @@ -1082,8 +1095,20 @@ int CameraCapabilities::initializeStaticMetadata() exposureInfo->second.min().get() * 1000LL, exposureInfo->second.max().get() * 1000LL, }; - staticMetadata_->addEntry(ANDROID_SENSOR_INFO_EXPOSURE_TIME_RANGE, - exposureTimeRange, 2); + + if (exposureTimeRange[0] < 100000) { + staticMetadata_->addEntry(ANDROID_SENSOR_INFO_EXPOSURE_TIME_RANGE, + exposureTimeRange, 2); + + availableCharacteristicsKeys_.insert(ANDROID_SENSOR_INFO_EXPOSURE_TIME_RANGE); + availableRequestKeys_.insert(ANDROID_SENSOR_EXPOSURE_TIME); + availableResultKeys_.insert(ANDROID_SENSOR_EXPOSURE_TIME); + } else { + LOG(HAL, Info) + << "Minimum exposure time " + << exposureTimeRange[0] + << "ns is too big (should be smaller than 100us)"; + } } staticMetadata_->addEntry(ANDROID_SENSOR_ORIENTATION, orientation_); From patchwork Tue Nov 23 10:40:41 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Elder X-Patchwork-Id: 14702 X-Patchwork-Delegate: paul.elder@ideasonboard.com 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 4AD49BDB13 for ; Tue, 23 Nov 2021 10:41:13 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 05304603C4; Tue, 23 Nov 2021 11:41:13 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="enyuqhcV"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 97BC460398 for ; Tue, 23 Nov 2021 11:41:10 +0100 (CET) Received: from pyrite.rasen.tech (unknown [IPv6:2400:4051:61:600:2c71:1b79:d06d:5032]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 480D7A1B; Tue, 23 Nov 2021 11:41:09 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1637664070; bh=Q1qf/qQzidbSOo288itMtrjo7Z8ayqdhwaKFDj4waoo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=enyuqhcVdBowMUdwSN3hNueSaycB3MUl4PPGgzc5qJI4Sl6vitLhMJgglc5qYu7ct PjThPGycq0fiv99HI2mngacTuUgv58vcdl9bRCUPpDPh5ejXACEGy5rUjg4vObklYt /705jdLPygKPDjkg4GCuueCKuQrbFp0etDbWBldY= From: Paul Elder To: libcamera-devel@lists.libcamera.org Date: Tue, 23 Nov 2021 19:40:41 +0900 Message-Id: <20211123104042.3100902-7-paul.elder@ideasonboard.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20211123104042.3100902-1-paul.elder@ideasonboard.com> References: <20211123104042.3100902-1-paul.elder@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 6/7] android: Increase result metadata size 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" Increase the initial size of the result metadata, as we will be adding more entries in the near future. Signed-off-by: Paul Elder Reviewed-by: Kieran Bingham --- src/android/camera_device.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/android/camera_device.cpp b/src/android/camera_device.cpp index f2e0bdbd..3b588bdb 100644 --- a/src/android/camera_device.cpp +++ b/src/android/camera_device.cpp @@ -1296,7 +1296,7 @@ CameraDevice::getResultMetadata(const Camera3RequestDescriptor &descriptor) cons * Total bytes for JPEG metadata: 82 */ std::unique_ptr resultMetadata = - std::make_unique(44, 166); + std::make_unique(88, 166); if (!resultMetadata->isValid()) { LOG(HAL, Error) << "Failed to allocate result metadata"; return nullptr; From patchwork Tue Nov 23 10:40:42 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Elder X-Patchwork-Id: 14703 X-Patchwork-Delegate: paul.elder@ideasonboard.com 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 EA4F1BDB13 for ; Tue, 23 Nov 2021 10:41:15 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 995E7603B5; Tue, 23 Nov 2021 11:41:15 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="Cdt7ow6x"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 783C76038B for ; Tue, 23 Nov 2021 11:41:12 +0100 (CET) Received: from pyrite.rasen.tech (unknown [IPv6:2400:4051:61:600:2c71:1b79:d06d:5032]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 16224A1B; Tue, 23 Nov 2021 11:41:10 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1637664072; bh=GKCvOUTPtAJtH2PrVBIZzx00BdEkJ/HDjfxt+dPzseg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Cdt7ow6xffjXx2MWVQLbUoE+6HQu0w6ZrqZZII8arfu7bbJuHq0dVNt3dbHMUoTP7 tNTUyaj99DHfd/8EkGm2GNhNA+nEbhHWE2IMLZtIEm+amEvFf0rR9I4y5GB2BRV0oE 0qOsBtt9wdAmUfYRPVKowdO1e6tSSih/vEV4OO8I= From: Paul Elder To: libcamera-devel@lists.libcamera.org Date: Tue, 23 Nov 2021 19:40:42 +0900 Message-Id: <20211123104042.3100902-8-paul.elder@ideasonboard.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20211123104042.3100902-1-paul.elder@ideasonboard.com> References: <20211123104042.3100902-1-paul.elder@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 7/7] android: Add CONTROL_MODE_OFF in template and static metadata 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" Add CONTROL_MODE_OFF to the available control modes in static metadata, if both AE off and AWB off are available. Also set CONTROL_MODE_OFF in the manual template. Signed-off-by: Paul Elder Reviewed-by: Kieran Bingham --- src/android/camera_capabilities.cpp | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/android/camera_capabilities.cpp b/src/android/camera_capabilities.cpp index f7397d27..5d90047b 100644 --- a/src/android/camera_capabilities.cpp +++ b/src/android/camera_capabilities.cpp @@ -999,7 +999,17 @@ int CameraCapabilities::initializeStaticMetadata() staticMetadata_->addEntry(ANDROID_CONTROL_AWB_LOCK_AVAILABLE, awbLockAvailable); - char availableControlModes = ANDROID_CONTROL_MODE_AUTO; + /* + * \todo Get this from some combination of the available AE and AWB + * modes + */ + std::vector availableControlModes = { ANDROID_CONTROL_MODE_AUTO }; + if (staticMetadata_->entryContains(ANDROID_CONTROL_AE_AVAILABLE_MODES, + ANDROID_CONTROL_AE_MODE_OFF) && + staticMetadata_->entryContains(ANDROID_CONTROL_AWB_AVAILABLE_MODES, + ANDROID_CONTROL_AWB_MODE_OFF)) { + availableControlModes.push_back(ANDROID_CONTROL_MODE_OFF); + } staticMetadata_->addEntry(ANDROID_CONTROL_AVAILABLE_MODES, availableControlModes); @@ -1467,6 +1477,12 @@ std::unique_ptr CameraCapabilities::requestTemplateManual() cons if (!manualTemplate) return nullptr; + if (staticMetadata_->entryContains(ANDROID_CONTROL_AVAILABLE_MODES, + ANDROID_CONTROL_MODE_OFF)) { + uint8_t mode = ANDROID_CONTROL_MODE_OFF; + manualTemplate->appendEntry(ANDROID_CONTROL_MODE, mode); + } + return manualTemplate; }