From patchwork Fri Jul 16 10:56:11 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Elder X-Patchwork-Id: 13007 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 CBDB7C3228 for ; Fri, 16 Jul 2021 10:56:54 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 857D26853D; Fri, 16 Jul 2021 12:56:53 +0200 (CEST) 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="mxIudply"; 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 C09AA68521 for ; Fri, 16 Jul 2021 12:56:52 +0200 (CEST) Received: from pyrite.rasen.tech (unknown [IPv6:2400:4051:61:600:2c71:1b79:d06d:5032]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 4A6893F0; Fri, 16 Jul 2021 12:56:50 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1626433012; bh=BPZBq6x+H0sRnEkGXy/xXyY/8oWC14x3uxAaMyLQu1E=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=mxIudplyQTujPE7LdwSsNSa1jxiw7fF8f4odnbdj8xgW71UI0eZVusqr+Eb/PGmwI 9dVQXAzVu97EYu4PPxw4lHyf6Zgr+KU6PvyAQaMk1YyMGP9Cb0GZI0Qy4hrWEeO0ni VM7jQqS1ri+3pnYdZQNAfGsh64J9sSlhvnJaSRck= From: Paul Elder To: libcamera-devel@lists.libcamera.org Date: Fri, 16 Jul 2021 19:56:11 +0900 Message-Id: <20210716105631.158153-2-paul.elder@ideasonboard.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210716105631.158153-1-paul.elder@ideasonboard.com> References: <20210716105631.158153-1-paul.elder@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [RFC PATCH v4 01/21] controls: Add boolean constructor for ControlInfo 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" It would be convenient to be able to iterate over available boolean values, for example for controls that designate if some function can be enabled/disabled. The current min/max/def constructor is insufficient, as .values() is empty, so the values cannot be easily iterated over, and creating a Span of booleans does not work for the values constructor. Add a new constructor to ControlInfo that takes a set of booleans (to allow specifiying one or two available values), and a default. The default value is not optional, as it doesn't make sense to have a silent default for boolean values. Update the ControlInfo test accordingly. Signed-off-by: Paul Elder --- Changes in v2: - use set instead of span of bools - add assertion to make sure that the default is a valid value - update the test --- include/libcamera/controls.h | 2 ++ src/libcamera/controls.cpp | 28 ++++++++++++++++++++++++++++ test/controls/control_info.cpp | 33 +++++++++++++++++++++++++++++++++ 3 files changed, 63 insertions(+) diff --git a/include/libcamera/controls.h b/include/libcamera/controls.h index 1bc958a4..707dc335 100644 --- a/include/libcamera/controls.h +++ b/include/libcamera/controls.h @@ -9,6 +9,7 @@ #define __LIBCAMERA_CONTROLS_H__ #include +#include #include #include #include @@ -272,6 +273,7 @@ public: const ControlValue &def = 0); explicit ControlInfo(Span values, const ControlValue &def = {}); + explicit ControlInfo(std::set values, bool def); const ControlValue &min() const { return min_; } const ControlValue &max() const { return max_; } diff --git a/src/libcamera/controls.cpp b/src/libcamera/controls.cpp index 34317fa0..f6351c01 100644 --- a/src/libcamera/controls.cpp +++ b/src/libcamera/controls.cpp @@ -514,6 +514,34 @@ ControlInfo::ControlInfo(Span values, values_.push_back(value); } +/** + * \brief Construct a ControlInfo from a list of valid boolean values + * \param[in] values The control valid boolean vaalues + * \param[in] def The control default boolean value + * + * Construct a ControlInfo from a list of valid boolean values. The ControlInfo + * minimum and maximum values are set to the first and last members of the + * values list respectively. The default value is set to \a def. + */ +ControlInfo::ControlInfo(std::set values, bool def) + : def_(def) +{ + if (values.size() == 1) { + min_ = max_ = *values.begin(); + } else { + min_ = false; + max_ = true; + } + + def_ = def; + + assert(values.count(def)); + + values_.reserve(2); + for (const bool &value : values) + values_.push_back(value); +} + /** * \fn ControlInfo::min() * \brief Retrieve the minimum value of the control diff --git a/test/controls/control_info.cpp b/test/controls/control_info.cpp index 1e05e131..b3d2bd54 100644 --- a/test/controls/control_info.cpp +++ b/test/controls/control_info.cpp @@ -44,6 +44,39 @@ protected: return TestFail; } + /* + * Test information retrieval from a control with boolean + * values. + */ + ControlInfo aeEnable({ false, true }, false); + + if (aeEnable.min().get() != false || + aeEnable.def().get() != false || + aeEnable.max().get() != true) { + cout << "Invalid control range for AeEnable" << endl; + return TestFail; + } + + if (aeEnable.values()[0].get() != false || + aeEnable.values()[1].get() != true) { + cout << "Invalid control values for AeEnable" << endl; + return TestFail; + } + + ControlInfo awbEnable({ true }, true); + + if (awbEnable.min().get() != true || + awbEnable.def().get() != true || + awbEnable.max().get() != true) { + cout << "Invalid control range for AwbEnable" << endl; + return TestFail; + } + + if (awbEnable.values()[0].get() != true) { + cout << "Invalid control values for AwbEnable" << endl; + return TestFail; + } + return TestPass; } }; From patchwork Fri Jul 16 10:56:12 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Elder X-Patchwork-Id: 13008 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 833DAC3228 for ; Fri, 16 Jul 2021 10:56:56 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 3B10468537; Fri, 16 Jul 2021 12:56:56 +0200 (CEST) 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="GdJqTEtj"; 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 9350B68521 for ; Fri, 16 Jul 2021 12:56:54 +0200 (CEST) Received: from pyrite.rasen.tech (unknown [IPv6:2400:4051:61:600:2c71:1b79:d06d:5032]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 23C333F0; Fri, 16 Jul 2021 12:56:52 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1626433014; bh=wTrOrJis5wxjhdgzL3jXlxSybMOwZxmT0lt/34hBer4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=GdJqTEtjMbwdabVC5uh6KwF53f2IFVFIepcs03akL+u3lQd3bCoap/QCQb5kHGI6Z cHDVPBXfGZFSHpD+wWpfv+Swrtcr4P+QlXBiDZL4JQZD8optWL+0WMOKz5LejbEF2d fcbSfcKqS2BSxpYJae0pMwBS12fI0Oa1RW9EO/fs= From: Paul Elder To: libcamera-devel@lists.libcamera.org Date: Fri, 16 Jul 2021 19:56:12 +0900 Message-Id: <20210716105631.158153-3-paul.elder@ideasonboard.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210716105631.158153-1-paul.elder@ideasonboard.com> References: <20210716105631.158153-1-paul.elder@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [RFC PATCH v4 02/21] android: metadata: Add hasEntry and entryContains 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 convenience functions for checking if the an entry is present in a CameraMetadata instance, and to check if an array entry includes a specific value. Signed-off-by: Paul Elder --- New in v4 --- src/android/camera_metadata.cpp | 21 +++++++++++++++++++++ src/android/camera_metadata.h | 4 ++++ 2 files changed, 25 insertions(+) diff --git a/src/android/camera_metadata.cpp b/src/android/camera_metadata.cpp index 3fc7cf27..47199b68 100644 --- a/src/android/camera_metadata.cpp +++ b/src/android/camera_metadata.cpp @@ -121,6 +121,27 @@ bool CameraMetadata::resize(size_t count, size_t size) return true; } +template<> bool CameraMetadata::entryContains(uint32_t tag, uint8_t value) const +{ + camera_metadata_ro_entry_t entry; + + if (!getEntry(tag, &entry)) + return false; + + for (unsigned int i = 0; i < entry.count; i++) + if (entry.data.u8[i] == value) + return true; + + return false; +} + + +bool CameraMetadata::hasEntry(uint32_t tag) const +{ + camera_metadata_ro_entry_t entry; + return getEntry(tag, &entry); +} + bool CameraMetadata::addEntry(uint32_t tag, const void *data, size_t count, size_t elementSize) { diff --git a/src/android/camera_metadata.h b/src/android/camera_metadata.h index 3b7c9e24..03b3e701 100644 --- a/src/android/camera_metadata.h +++ b/src/android/camera_metadata.h @@ -29,6 +29,10 @@ public: bool isValid() const { return valid_; } bool getEntry(uint32_t tag, camera_metadata_ro_entry_t *entry) const; + template bool entryContains(uint32_t tag, T value) const; + + bool hasEntry(uint32_t tag) const; + template> * = nullptr> bool addEntry(uint32_t tag, const T &data) From patchwork Fri Jul 16 10:56:13 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Elder X-Patchwork-Id: 13009 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 042E1C3228 for ; Fri, 16 Jul 2021 10:56:58 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id B113268536; Fri, 16 Jul 2021 12:56:57 +0200 (CEST) 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="tM2BrXek"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 763F66853C for ; Fri, 16 Jul 2021 12:56:56 +0200 (CEST) Received: from pyrite.rasen.tech (unknown [IPv6:2400:4051:61:600:2c71:1b79:d06d:5032]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id EC1823F0; Fri, 16 Jul 2021 12:56:54 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1626433016; bh=O53ICVJfXcqoRU0MXQ6spCMHh3xxHMWwYTqpQcKJo4Q=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=tM2BrXekOXhYpa3lk5pnTjlLyUjQreX8e8gvp2mh1Zc42pXLZJcbIUszMv/AO89k5 ajROFqUheIhnionuMVIGFE1vaNb1shPQhueGDzPEUGF4X+T8XVlzzY0m37ncCJS6uU HvsxmWUpMZbnizS+ovytccQtAWSbbpWOdSGtQ8zo= From: Paul Elder To: libcamera-devel@lists.libcamera.org Date: Fri, 16 Jul 2021 19:56:13 +0900 Message-Id: <20210716105631.158153-4-paul.elder@ideasonboard.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210716105631.158153-1-paul.elder@ideasonboard.com> References: <20210716105631.158153-1-paul.elder@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [RFC PATCH v4 03/21] android: metadata: Fix addEntry template type 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" Since we set entries with android tags directly, which are enums and not arithmetic types, the addEntry template fails to match. Fix this by also allowing enum values in addEntry. Signed-off-by: Paul Elder Reviewed-by: Jacopo Mondi --- New in v4 --- src/android/camera_metadata.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/android/camera_metadata.h b/src/android/camera_metadata.h index 03b3e701..60be416c 100644 --- a/src/android/camera_metadata.h +++ b/src/android/camera_metadata.h @@ -34,7 +34,8 @@ public: bool hasEntry(uint32_t tag) const; template> * = nullptr> + std::enable_if_t || + std::is_enum_v> * = nullptr> bool addEntry(uint32_t tag, const T &data) { return addEntry(tag, &data, 1, sizeof(T)); From patchwork Fri Jul 16 10:56:14 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Elder X-Patchwork-Id: 13010 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 7F412C3228 for ; Fri, 16 Jul 2021 10:57:00 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 33E4F68541; Fri, 16 Jul 2021 12:57:00 +0200 (CEST) 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="nCAzRkYr"; 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 ABC046853B for ; Fri, 16 Jul 2021 12:56:58 +0200 (CEST) Received: from pyrite.rasen.tech (unknown [IPv6:2400:4051:61:600:2c71:1b79:d06d:5032]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id E5E2956B; Fri, 16 Jul 2021 12:56:56 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1626433018; bh=QhiD3FqC4kEpBOrnGngCJ3hXNccsIuDbK3ovrgFN/To=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=nCAzRkYr+y5fTjAvSdtwmjMlhO8Z6YKlMJoKh+NA7KMXItXM5poDrN1DBGKIiOZs6 YsokFLT5bPJFFkLY22jC6bJkOmt4Ml07CWNSmOCQ/hn6AoJVgrFtT3xUWZ2lx5oPKv i4fgTc7JZyRU8/KZhZr7dmEUlPwnrcZ9pfTTpQO0= From: Paul Elder To: libcamera-devel@lists.libcamera.org Date: Fri, 16 Jul 2021 19:56:14 +0900 Message-Id: <20210716105631.158153-5-paul.elder@ideasonboard.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210716105631.158153-1-paul.elder@ideasonboard.com> References: <20210716105631.158153-1-paul.elder@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [RFC PATCH v4 04/21] android: jpeg: get ISO from SENSOR_SENSITIVITY 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 data for the exif ISO tag needs to come from SENSOR_SENSITIVITY. Set it. Signed-off-by: Paul Elder Reviewed-by: Laurent Pinchart Reviewed-by: Jacopo Mondi --- This on its own doesn't fix any CTS tests, but it prevents a test failure later on when we add the proper static metadata for the FULL hardware level. --- src/android/jpeg/post_processor_jpeg.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/android/jpeg/post_processor_jpeg.cpp b/src/android/jpeg/post_processor_jpeg.cpp index 0e93f365..3160a784 100644 --- a/src/android/jpeg/post_processor_jpeg.cpp +++ b/src/android/jpeg/post_processor_jpeg.cpp @@ -119,7 +119,10 @@ int PostProcessorJpeg::process(const FrameBuffer &source, ret = requestMetadata.getEntry(ANDROID_LENS_APERTURE, &entry); if (ret) exif.setAperture(*entry.data.f); - exif.setISO(100); + + ret = resultMetadata->getEntry(ANDROID_SENSOR_SENSITIVITY, &entry); + exif.setISO(ret ? *entry.data.i32 : 100); + exif.setFlash(Exif::Flash::FlashNotPresent); exif.setWhiteBalance(Exif::WhiteBalance::Auto); From patchwork Fri Jul 16 10:56:15 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Elder X-Patchwork-Id: 13011 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 2B02CC3228 for ; Fri, 16 Jul 2021 10:57:02 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id D81E068545; Fri, 16 Jul 2021 12:57:01 +0200 (CEST) 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="dGWPEfN7"; 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 BA89C68543 for ; Fri, 16 Jul 2021 12:57:00 +0200 (CEST) Received: from pyrite.rasen.tech (unknown [IPv6:2400:4051:61:600:2c71:1b79:d06d:5032]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 2DE2E3F0; Fri, 16 Jul 2021 12:56:58 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1626433020; bh=N5v95TTSg/O1YB9cZ6FCEjhZFPkjc9A76PyEw3sgsyU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=dGWPEfN7ZPPzO7RQSDcPJtHdauYjcqFpmwwUOvvSkOJrm1bPafPUBOT3XUzOJYBUp Tf8z5TC79sRJNBdiBVWtttBklpyFusKn86MPO5PPJQwogMizxYQHFmjAtGERkuEAZQ J9jlrthPun/CjOBw64R68ltr7iDL8nJkIU2qa688= From: Paul Elder To: libcamera-devel@lists.libcamera.org Date: Fri, 16 Jul 2021 19:56:15 +0900 Message-Id: <20210716105631.158153-6-paul.elder@ideasonboard.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210716105631.158153-1-paul.elder@ideasonboard.com> References: <20210716105631.158153-1-paul.elder@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [RFC PATCH v4 05/21] android: Add infrastructure for determining capabilities and hardware level 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 the infrastructure for checking and reporting capabilities. Use these capabilities to determine the hardware level as well. Bug: https://bugs.libcamera.org/show_bug.cgi?id=55 Signed-off-by: Paul Elder --- Changes in v5: - change the whole thing to turn on capabilities after they are all confirmed, instead of disabling them as conditions are not met Changes in v4: - rebase on camera capabilities refactoring - switch to std::set from std::map - make hwlevel similar to capabilities Changes in v3: - fix some compiler errors - go ahead and initialize the capabilities to true, update the commit message accordingly Changes in v2: - add a flag for FULL, since there are a few requirements that are not obtained from capabilities alone - add burst capture capability, since that is required for FULL as well --- src/android/camera_capabilities.cpp | 172 +++++++++++++++++++++++++--- src/android/camera_capabilities.h | 13 +++ 2 files changed, 170 insertions(+), 15 deletions(-) diff --git a/src/android/camera_capabilities.cpp b/src/android/camera_capabilities.cpp index 9e2714f1..be55db88 100644 --- a/src/android/camera_capabilities.cpp +++ b/src/android/camera_capabilities.cpp @@ -9,6 +9,7 @@ #include #include +#include #include @@ -114,8 +115,148 @@ const std::map camera3FormatsMap = { }, }; +const std::map +hwLevelStrings = { + { ANDROID_INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED, "LIMITED" }, + { ANDROID_INFO_SUPPORTED_HARDWARE_LEVEL_FULL, "FULL" }, + { ANDROID_INFO_SUPPORTED_HARDWARE_LEVEL_LEGACY, "LEGACY" }, + { ANDROID_INFO_SUPPORTED_HARDWARE_LEVEL_3, "LEVEL_3" }, + { ANDROID_INFO_SUPPORTED_HARDWARE_LEVEL_EXTERNAL, "EXTERNAL" }, +}; + } /* namespace */ +bool CameraCapabilities::validateManualSensorCapability(CameraMetadata *staticMetadata) +{ + camera_metadata_ro_entry_t entry; + bool found; + + const char *noMode = "Manual sensor capability unavailable: "; + + if (!(found = staticMetadata->entryContains(ANDROID_CONTROL_AE_AVAILABLE_MODES, + ANDROID_CONTROL_AE_MODE_OFF))) { + LOG(HAL, Info) + << noMode << "missing AE mode off: " + << (found ? "not supported" : "not found"); + return false; + } + + found = staticMetadata->getEntry(ANDROID_CONTROL_AE_LOCK_AVAILABLE, + &entry); + if (!found || !(*entry.data.u8 == ANDROID_CONTROL_AE_LOCK_AVAILABLE_TRUE)) { + LOG(HAL, Info) << noMode << "missing AE lock"; + return false; + } + + return true; +} + +bool CameraCapabilities::validateManualPostProcessingCapability(CameraMetadata *staticMetadata) +{ + camera_metadata_ro_entry_t entry; + bool found; + + const char *noMode = "Manual post processing capability unavailable: "; + + if (!staticMetadata->entryContains(ANDROID_CONTROL_AWB_AVAILABLE_MODES, + ANDROID_CONTROL_AWB_MODE_OFF)) { + LOG(HAL, Info) << noMode << "missing AWB mode off"; + return false; + } + + found = staticMetadata->getEntry(ANDROID_CONTROL_AWB_LOCK_AVAILABLE, + &entry); + if (!found || !(*entry.data.u8 == ANDROID_CONTROL_AWB_LOCK_AVAILABLE_TRUE)) { + LOG(HAL, Info) << noMode << "missing AWB lock"; + return false; + } + + return true; +} + +bool CameraCapabilities::validateBurstCaptureCapability(CameraMetadata *staticMetadata) +{ + camera_metadata_ro_entry_t entry; + bool found; + + const char *noMode = "Burst capture capability unavailable: "; + + found = staticMetadata->getEntry(ANDROID_CONTROL_AE_LOCK_AVAILABLE, + &entry); + if (!found || !(*entry.data.u8 == ANDROID_CONTROL_AE_LOCK_AVAILABLE_TRUE)) { + LOG(HAL, Info) << noMode << "missing AE lock"; + return false; + } + + found = staticMetadata->getEntry(ANDROID_CONTROL_AWB_LOCK_AVAILABLE, + &entry); + if (!found || !(*entry.data.u8 == ANDROID_CONTROL_AWB_LOCK_AVAILABLE_TRUE)) { + LOG(HAL, Info) << noMode << "missing AWB lock"; + return false; + } + + found = staticMetadata->getEntry(ANDROID_SYNC_MAX_LATENCY, &entry); + if (!found || *entry.data.i32 < 0 || 4 < *entry.data.i32) { + LOG(HAL, Info) + << noMode << "max sync latency is " + << (found ? std::to_string(*entry.data.i32) : "not present"); + return false; + } + + return true; +} + +std::set +CameraCapabilities::computeCapabilities(CameraMetadata *staticMetadata, + std::set &existingCaps) +{ + std::set + capabilities = existingCaps; + + capabilities.insert(ANDROID_REQUEST_AVAILABLE_CAPABILITIES_BACKWARD_COMPATIBLE); + + if (validateManualSensorCapability(staticMetadata)) + capabilities.insert(ANDROID_REQUEST_AVAILABLE_CAPABILITIES_MANUAL_SENSOR); + + if (validateManualPostProcessingCapability(staticMetadata)) + capabilities.insert(ANDROID_REQUEST_AVAILABLE_CAPABILITIES_MANUAL_POST_PROCESSING); + + if (validateBurstCaptureCapability(staticMetadata)) + capabilities.insert(ANDROID_REQUEST_AVAILABLE_CAPABILITIES_BURST_CAPTURE); + + if (rawStreamAvailable_) + capabilities.insert(ANDROID_REQUEST_AVAILABLE_CAPABILITIES_RAW); + + return capabilities; +} + +camera_metadata_enum_android_info_supported_hardware_level +CameraCapabilities::computeHwLevel(CameraMetadata *staticMetadata, + std::set capabilities) +{ + camera_metadata_ro_entry_t entry; + bool found; + camera_metadata_enum_android_info_supported_hardware_level + hwLevel = ANDROID_INFO_SUPPORTED_HARDWARE_LEVEL_FULL; + + if (!capabilities.count(ANDROID_REQUEST_AVAILABLE_CAPABILITIES_MANUAL_SENSOR)) + hwLevel = ANDROID_INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED; + + if (!capabilities.count(ANDROID_REQUEST_AVAILABLE_CAPABILITIES_MANUAL_POST_PROCESSING)) + hwLevel = ANDROID_INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED; + + if (!capabilities.count(ANDROID_REQUEST_AVAILABLE_CAPABILITIES_BURST_CAPTURE)) + hwLevel = ANDROID_INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED; + + found = staticMetadata->getEntry(ANDROID_SYNC_MAX_LATENCY, &entry); + if (!found || *entry.data.i32 != 0) + hwLevel = ANDROID_INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED; + + hwLevel_ = hwLevel; + + return hwLevel; +} + int CameraCapabilities::initialize(std::shared_ptr camera, int orientation, int facing) { @@ -382,6 +523,9 @@ int CameraCapabilities::initializeStaticMetadata() const ControlInfoMap &controlsInfo = camera_->controls(); const ControlList &properties = camera_->properties(); + std::set + capabilities = {}; + /* Color correction static metadata. */ { std::vector data; @@ -840,11 +984,6 @@ int CameraCapabilities::initializeStaticMetadata() uint8_t croppingType = ANDROID_SCALER_CROPPING_TYPE_CENTER_ONLY; staticMetadata_->addEntry(ANDROID_SCALER_CROPPING_TYPE, croppingType); - /* Info static metadata. */ - uint8_t supportedHWLevel = ANDROID_INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED; - staticMetadata_->addEntry(ANDROID_INFO_SUPPORTED_HARDWARE_LEVEL, - supportedHWLevel); - /* Request static metadata. */ int32_t partialResultCount = 1; staticMetadata_->addEntry(ANDROID_REQUEST_PARTIAL_RESULT_COUNT, @@ -865,21 +1004,24 @@ int CameraCapabilities::initializeStaticMetadata() staticMetadata_->addEntry(ANDROID_REQUEST_MAX_NUM_INPUT_STREAMS, maxNumInputStreams); - std::vector availableCapabilities = { - ANDROID_REQUEST_AVAILABLE_CAPABILITIES_BACKWARD_COMPATIBLE, - }; - - /* Report if camera supports RAW. */ - if (rawStreamAvailable_) - availableCapabilities.push_back(ANDROID_REQUEST_AVAILABLE_CAPABILITIES_RAW); - /* Number of { RAW, YUV, JPEG } supported output streams */ int32_t numOutStreams[] = { rawStreamAvailable_, 2, 1 }; staticMetadata_->addEntry(ANDROID_REQUEST_MAX_NUM_OUTPUT_STREAMS, numOutStreams); - staticMetadata_->addEntry(ANDROID_REQUEST_AVAILABLE_CAPABILITIES, - availableCapabilities); + /* Check capabilities */ + capabilities = computeCapabilities(staticMetadata_.get(), capabilities); + std::vector + capsVec = std::vector(capabilities.begin(), capabilities.end()); + staticMetadata_->addEntry(ANDROID_REQUEST_AVAILABLE_CAPABILITIES, capsVec); + + camera_metadata_enum_android_info_supported_hardware_level hwLevel = + computeHwLevel(staticMetadata_.get(), capabilities); + staticMetadata_->addEntry(ANDROID_INFO_SUPPORTED_HARDWARE_LEVEL, hwLevel); + + LOG(HAL, Info) + << "Hardware level: " + << hwLevelStrings.find((camera_metadata_enum_android_info_supported_hardware_level)hwLevel)->second; std::vector availableCharacteristicsKeys = { ANDROID_COLOR_CORRECTION_AVAILABLE_ABERRATION_MODES, diff --git a/src/android/camera_capabilities.h b/src/android/camera_capabilities.h index 42a976d3..38ee97d0 100644 --- a/src/android/camera_capabilities.h +++ b/src/android/camera_capabilities.h @@ -42,6 +42,18 @@ private: int androidFormat; }; + bool validateManualSensorCapability(CameraMetadata *staticMetadata); + bool validateManualPostProcessingCapability(CameraMetadata *staticMetadata); + bool validateBurstCaptureCapability(CameraMetadata *staticMetadata); + + std::set + computeCapabilities(CameraMetadata *staticMetadata, + std::set &existingCaps); + + camera_metadata_enum_android_info_supported_hardware_level + computeHwLevel(CameraMetadata *staticMetadata, + std::set capabilities); + std::vector initializeYUVResolutions(const libcamera::PixelFormat &pixelFormat, const std::vector &resolutions); @@ -56,6 +68,7 @@ private: int facing_; int orientation_; bool rawStreamAvailable_; + camera_metadata_enum_android_info_supported_hardware_level hwLevel_; std::vector streamConfigurations_; std::map formatsMap_; From patchwork Fri Jul 16 10:56:16 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Elder X-Patchwork-Id: 13012 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 DCE2CC3228 for ; Fri, 16 Jul 2021 10:57:04 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 93FE068537; Fri, 16 Jul 2021 12:57:04 +0200 (CEST) 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="eYXy8mEJ"; 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 78C1C6853A for ; Fri, 16 Jul 2021 12:57:02 +0200 (CEST) Received: from pyrite.rasen.tech (unknown [IPv6:2400:4051:61:600:2c71:1b79:d06d:5032]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 0C15856B; Fri, 16 Jul 2021 12:57:00 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1626433022; bh=gSwEmtHz+C99G/hf5g/qzN8wzPrGpeD472GKue68h1o=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=eYXy8mEJywj1NhEcVJdep/j95UZgTEBhulLFlHPGKTm169qmMK1SNdZfwDOU6wmfw kuDP6cXUy1lAI/+IOQz0cdqrLWKXNAnd0I+f2rCMuAlBFnN2wD62Svl/f22ytkMvUU C4n/oIM+LitdEyFFW4nlEQgRedVd//BfLXJ6v8/s= From: Paul Elder To: libcamera-devel@lists.libcamera.org Date: Fri, 16 Jul 2021 19:56:16 +0900 Message-Id: <20210716105631.158153-7-paul.elder@ideasonboard.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210716105631.158153-1-paul.elder@ideasonboard.com> References: <20210716105631.158153-1-paul.elder@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [RFC PATCH v4 06/21] android: Add helpers for setting android metadata from libcamera 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: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" Add helpers for setting android metadata from libcamera controls. There are two versions, for scalars and collections, both of which take a default value to fill in the android control if the libcamera control is not found. A version for scalars exists for no default, to not set the android control at all if it is not found in libcamera. The functions take two template parameters, the first for the android type, and the second for the libcamera type of the control. They can be different, for example, if the former is an enum and the latter is a boolean, or if the former is an enum (uint8_t) and the latter is an enum (int32_t). The versions that take a default value return the value that was set in the android metadata. Signed-off-by: Paul Elder --- Changes in v4: - remove vector copy from the vector setter Changes in v3: - setMetadata for collection only works with vectors - change enum to enum class - add two template parameters for android type and libcamera type - add docs New in v2 TODO: make ControlList versions so that we can use them in result metadata --- src/android/camera_capabilities.cpp | 137 ++++++++++++++++++++++++++++ 1 file changed, 137 insertions(+) diff --git a/src/android/camera_capabilities.cpp b/src/android/camera_capabilities.cpp index be55db88..c7994800 100644 --- a/src/android/camera_capabilities.cpp +++ b/src/android/camera_capabilities.cpp @@ -10,6 +10,7 @@ #include #include #include +#include #include @@ -124,6 +125,142 @@ hwLevelStrings = { { ANDROID_INFO_SUPPORTED_HARDWARE_LEVEL_EXTERNAL, "EXTERNAL" }, }; +enum class ControlRange { + Min, + Def, + Max, +}; + +/** + * \brief Set android metadata from libcamera ControlInfo + * \tparam T Type of the control in android + * \tparam V Type of the control in libcamera + * \param[in] metadata Android metadata pack to add the control value to + * \param[in] tag Android metadata tag + * \param[in] controlsInfo libcamera ControlInfoMap from which to find the control info + * \param[in] control libcamera ControlId to find from \a controlsInfo + * \param[in] controlRange Whether to use the min, def, or max value from the control info + * + * Set the android metadata entry in \a metadata with tag \a tag based on the + * control info found for the libcamera control \a control in the libcamera + * ControlInfoMap \a controlsInfo. If no libcamera ControlInfo is found, then + * the function returns without modifying anything. + * + * This function is for scalar values. + */ +template> * = nullptr, + typename V> +void setMetadata(CameraMetadata *metadata, uint32_t tag, + const ControlInfoMap &controlsInfo, const ControlId *control, + enum ControlRange controlRange) +{ + const auto &info = controlsInfo.find(control); + if (info == controlsInfo.end()) + return; + + T ret; + switch (controlRange) { + case ControlRange::Min: + ret = info->second.min().get(); + break; + case ControlRange::Def: + ret = info->second.def().get(); + break; + case ControlRange::Max: + ret = info->second.max().get(); + break; + } + + metadata->addEntry(tag, ret); + return; +} + +/** + * \brief Set android metadata from libcamera ControlInfo or a default value + * \tparam T Type of the control in android + * \tparam U Type of the control in libcamera + * \param[in] metadata Android metadata pack to add the control value to + * \param[in] tag Android metadata tag + * \param[in] controlsInfo libcamera ControlInfoMap from which to find the control info + * \param[in] control libcamera ControlId to find from \a controlsInfo + * \param[in] controlRange Whether to use the min, def, or max value from the control info + * \param[in] defaultValue The value to set in \a metadata if \a control is not found + * + * Set the android metadata entry in \a metadata with tag \a tag based on the + * control info found for the libcamera control \a control in the libcamera + * ControlInfoMap \a controlsInfo. If no libcamera ControlInfo is found, then + * the android metadata entry is set to \a defaultValue. + * + * This function is for scalar values. + */ +template || + std::is_enum_v> * = nullptr> +T setMetadata(CameraMetadata *metadata, uint32_t tag, + const ControlInfoMap &controlsInfo, const ControlId *control, + enum ControlRange controlRange, const V defaultValue) +{ + T ret = defaultValue; + + const auto &info = controlsInfo.find(control); + if (info != controlsInfo.end()) { + switch (controlRange) { + case ControlRange::Min: + ret = info->second.min().get(); + break; + case ControlRange::Def: + ret = info->second.def().get(); + break; + case ControlRange::Max: + ret = info->second.max().get(); + break; + } + } + + metadata->addEntry(tag, ret); + return ret; +} + +/** + * \brief Set android metadata from libcamera ControlInfo or a default value + * \tparam T Type of the control in android + * \tparam V Type of the control in libcamera + * \param[in] metadata Android metadata pack to add the control value to + * \param[in] tag Android metadata tag + * \param[in] controlsInfo libcamera ControlInfoMap from which to find the control info + * \param[in] control libcamera ControlId to find from \a controlsInfo + * \param[in] defaultVector The value to set in \a metadata if \a control is not found + * + * Set the android metadata entry in \a metadata with tag \a tag based on the + * control info found for the libcamera control \a control in the libcamera + * ControlInfoMap \a controlsInfo. If no libcamera ControlInfo is found, then + * the android metadata entry is set to \a defaultVector. + * + * This function is for vector values. + */ +template +std::vector setMetadata(CameraMetadata *metadata, uint32_t tag, + const ControlInfoMap &controlsInfo, + const ControlId *control, + const std::vector &defaultVector) +{ + const auto &info = controlsInfo.find(control); + if (info == controlsInfo.end()) { + metadata->addEntry(tag, defaultVector); + return defaultVector; + } + + std::vector ret(info->second.values().size()); + for (const auto &value : info->second.values()) + ret.push_back(value.get()); + metadata->addEntry(tag, ret); + + return ret; +} + } /* namespace */ bool CameraCapabilities::validateManualSensorCapability(CameraMetadata *staticMetadata) From patchwork Fri Jul 16 10:56:17 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Elder X-Patchwork-Id: 13013 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 485BDC3228 for ; Fri, 16 Jul 2021 10:57:06 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id F1C476853F; Fri, 16 Jul 2021 12:57:05 +0200 (CEST) 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="s+ivnX9B"; 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 8597668536 for ; Fri, 16 Jul 2021 12:57:04 +0200 (CEST) Received: from pyrite.rasen.tech (unknown [IPv6:2400:4051:61:600:2c71:1b79:d06d:5032]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id EFF6E3F0; Fri, 16 Jul 2021 12:57:02 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1626433024; bh=jlaDmlvLCIec9tQZ6UqnHQXOe1lSfi+iQV1h8zEBzo0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=s+ivnX9BvD7uV42RD0WwevVthjrKG8FENuPfYp0y2D1E87jvYqPUfPerssuefEkCp VY6g/oTfz08Fa9Bvyl4Ql7e8OUu34+tJCf7H5kdDRrwfs+HY7hQqVNwxZGvpyuJaGT Yv/ZqOtRHfWMLTagE7H4TjZP6BV3+lmwdrkw8AFo= From: Paul Elder To: libcamera-devel@lists.libcamera.org Date: Fri, 16 Jul 2021 19:56:17 +0900 Message-Id: <20210716105631.158153-8-paul.elder@ideasonboard.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210716105631.158153-1-paul.elder@ideasonboard.com> References: <20210716105631.158153-1-paul.elder@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [RFC PATCH v4 07/21] android: capabilities: Make keys list into set and member variable 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" We need to be able to add additional characteristics/request/result keys into the corresponding list in the static metadata based on libcamera camera capabilities. We also need to be able to easily check if the lists have specific keys, for populating templates and result metadata. Turn the characteristics, requests, and results keys vectors into sets, and move them to member variables to achieve this. Signed-off-by: Paul Elder Reviewed-by: Jacopo Mondi --- src/android/camera_capabilities.cpp | 266 ++++++++++++++-------------- src/android/camera_capabilities.h | 5 + 2 files changed, 141 insertions(+), 130 deletions(-) diff --git a/src/android/camera_capabilities.cpp b/src/android/camera_capabilities.cpp index c7994800..09b3d82d 100644 --- a/src/android/camera_capabilities.cpp +++ b/src/android/camera_capabilities.cpp @@ -660,6 +660,136 @@ int CameraCapabilities::initializeStaticMetadata() const ControlInfoMap &controlsInfo = camera_->controls(); const ControlList &properties = camera_->properties(); + availableCharacteristicsKeys_ = { + ANDROID_COLOR_CORRECTION_AVAILABLE_ABERRATION_MODES, + ANDROID_CONTROL_AE_AVAILABLE_ANTIBANDING_MODES, + ANDROID_CONTROL_AE_AVAILABLE_MODES, + ANDROID_CONTROL_AE_AVAILABLE_TARGET_FPS_RANGES, + ANDROID_CONTROL_AE_COMPENSATION_RANGE, + ANDROID_CONTROL_AE_COMPENSATION_STEP, + ANDROID_CONTROL_AE_LOCK_AVAILABLE, + ANDROID_CONTROL_AF_AVAILABLE_MODES, + ANDROID_CONTROL_AVAILABLE_EFFECTS, + ANDROID_CONTROL_AVAILABLE_MODES, + ANDROID_CONTROL_AVAILABLE_SCENE_MODES, + ANDROID_CONTROL_AVAILABLE_VIDEO_STABILIZATION_MODES, + ANDROID_CONTROL_AWB_AVAILABLE_MODES, + ANDROID_CONTROL_AWB_LOCK_AVAILABLE, + ANDROID_CONTROL_MAX_REGIONS, + ANDROID_CONTROL_SCENE_MODE_OVERRIDES, + ANDROID_FLASH_INFO_AVAILABLE, + ANDROID_INFO_SUPPORTED_HARDWARE_LEVEL, + ANDROID_JPEG_AVAILABLE_THUMBNAIL_SIZES, + ANDROID_JPEG_MAX_SIZE, + ANDROID_LENS_FACING, + ANDROID_LENS_INFO_AVAILABLE_APERTURES, + ANDROID_LENS_INFO_AVAILABLE_FOCAL_LENGTHS, + ANDROID_LENS_INFO_AVAILABLE_OPTICAL_STABILIZATION, + ANDROID_LENS_INFO_HYPERFOCAL_DISTANCE, + ANDROID_LENS_INFO_MINIMUM_FOCUS_DISTANCE, + ANDROID_NOISE_REDUCTION_AVAILABLE_NOISE_REDUCTION_MODES, + ANDROID_REQUEST_AVAILABLE_CAPABILITIES, + ANDROID_REQUEST_MAX_NUM_INPUT_STREAMS, + ANDROID_REQUEST_MAX_NUM_OUTPUT_STREAMS, + ANDROID_REQUEST_PARTIAL_RESULT_COUNT, + ANDROID_REQUEST_PIPELINE_MAX_DEPTH, + ANDROID_SCALER_AVAILABLE_MAX_DIGITAL_ZOOM, + ANDROID_SCALER_AVAILABLE_MIN_FRAME_DURATIONS, + ANDROID_SCALER_AVAILABLE_STALL_DURATIONS, + ANDROID_SCALER_AVAILABLE_STREAM_CONFIGURATIONS, + ANDROID_SCALER_CROPPING_TYPE, + 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, + ANDROID_SENSOR_INFO_SENSITIVITY_RANGE, + ANDROID_SENSOR_INFO_TIMESTAMP_SOURCE, + ANDROID_SENSOR_ORIENTATION, + ANDROID_STATISTICS_INFO_AVAILABLE_FACE_DETECT_MODES, + ANDROID_STATISTICS_INFO_MAX_FACE_COUNT, + ANDROID_SYNC_MAX_LATENCY, + }; + + availableRequestKeys_ = { + 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, + ANDROID_CONTROL_AE_TARGET_FPS_RANGE, + ANDROID_CONTROL_AF_MODE, + ANDROID_CONTROL_AF_TRIGGER, + ANDROID_CONTROL_AWB_LOCK, + ANDROID_CONTROL_AWB_MODE, + ANDROID_CONTROL_CAPTURE_INTENT, + ANDROID_CONTROL_EFFECT_MODE, + ANDROID_CONTROL_MODE, + ANDROID_CONTROL_SCENE_MODE, + ANDROID_CONTROL_VIDEO_STABILIZATION_MODE, + ANDROID_FLASH_MODE, + ANDROID_JPEG_ORIENTATION, + ANDROID_JPEG_QUALITY, + ANDROID_JPEG_THUMBNAIL_QUALITY, + ANDROID_JPEG_THUMBNAIL_SIZE, + ANDROID_LENS_APERTURE, + ANDROID_LENS_OPTICAL_STABILIZATION_MODE, + ANDROID_NOISE_REDUCTION_MODE, + ANDROID_SCALER_CROP_REGION, + ANDROID_STATISTICS_FACE_DETECT_MODE + }; + + 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, + ANDROID_CONTROL_AE_STATE, + ANDROID_CONTROL_AE_TARGET_FPS_RANGE, + ANDROID_CONTROL_AF_MODE, + ANDROID_CONTROL_AF_STATE, + ANDROID_CONTROL_AF_TRIGGER, + ANDROID_CONTROL_AWB_LOCK, + ANDROID_CONTROL_AWB_MODE, + ANDROID_CONTROL_AWB_STATE, + ANDROID_CONTROL_CAPTURE_INTENT, + ANDROID_CONTROL_EFFECT_MODE, + ANDROID_CONTROL_MODE, + ANDROID_CONTROL_SCENE_MODE, + ANDROID_CONTROL_VIDEO_STABILIZATION_MODE, + ANDROID_FLASH_MODE, + ANDROID_FLASH_STATE, + ANDROID_JPEG_GPS_COORDINATES, + ANDROID_JPEG_GPS_PROCESSING_METHOD, + ANDROID_JPEG_GPS_TIMESTAMP, + ANDROID_JPEG_ORIENTATION, + ANDROID_JPEG_QUALITY, + ANDROID_JPEG_SIZE, + ANDROID_JPEG_THUMBNAIL_QUALITY, + ANDROID_JPEG_THUMBNAIL_SIZE, + ANDROID_LENS_APERTURE, + ANDROID_LENS_FOCAL_LENGTH, + ANDROID_LENS_OPTICAL_STABILIZATION_MODE, + ANDROID_LENS_STATE, + 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, + ANDROID_SENSOR_TIMESTAMP, + ANDROID_STATISTICS_FACE_DETECT_MODE, + ANDROID_STATISTICS_LENS_SHADING_MAP_MODE, + ANDROID_STATISTICS_HOT_PIXEL_MAP_MODE, + ANDROID_STATISTICS_SCENE_FLICKER, + }; + std::set capabilities = {}; @@ -1160,141 +1290,17 @@ int CameraCapabilities::initializeStaticMetadata() << "Hardware level: " << hwLevelStrings.find((camera_metadata_enum_android_info_supported_hardware_level)hwLevel)->second; - std::vector availableCharacteristicsKeys = { - ANDROID_COLOR_CORRECTION_AVAILABLE_ABERRATION_MODES, - ANDROID_CONTROL_AE_AVAILABLE_ANTIBANDING_MODES, - ANDROID_CONTROL_AE_AVAILABLE_MODES, - ANDROID_CONTROL_AE_AVAILABLE_TARGET_FPS_RANGES, - ANDROID_CONTROL_AE_COMPENSATION_RANGE, - ANDROID_CONTROL_AE_COMPENSATION_STEP, - ANDROID_CONTROL_AE_LOCK_AVAILABLE, - ANDROID_CONTROL_AF_AVAILABLE_MODES, - ANDROID_CONTROL_AVAILABLE_EFFECTS, - ANDROID_CONTROL_AVAILABLE_MODES, - ANDROID_CONTROL_AVAILABLE_SCENE_MODES, - ANDROID_CONTROL_AVAILABLE_VIDEO_STABILIZATION_MODES, - ANDROID_CONTROL_AWB_AVAILABLE_MODES, - ANDROID_CONTROL_AWB_LOCK_AVAILABLE, - ANDROID_CONTROL_MAX_REGIONS, - ANDROID_CONTROL_SCENE_MODE_OVERRIDES, - ANDROID_FLASH_INFO_AVAILABLE, - ANDROID_INFO_SUPPORTED_HARDWARE_LEVEL, - ANDROID_JPEG_AVAILABLE_THUMBNAIL_SIZES, - ANDROID_JPEG_MAX_SIZE, - ANDROID_LENS_FACING, - ANDROID_LENS_INFO_AVAILABLE_APERTURES, - ANDROID_LENS_INFO_AVAILABLE_FOCAL_LENGTHS, - ANDROID_LENS_INFO_AVAILABLE_OPTICAL_STABILIZATION, - ANDROID_LENS_INFO_HYPERFOCAL_DISTANCE, - ANDROID_LENS_INFO_MINIMUM_FOCUS_DISTANCE, - ANDROID_NOISE_REDUCTION_AVAILABLE_NOISE_REDUCTION_MODES, - ANDROID_REQUEST_AVAILABLE_CAPABILITIES, - ANDROID_REQUEST_MAX_NUM_INPUT_STREAMS, - ANDROID_REQUEST_MAX_NUM_OUTPUT_STREAMS, - ANDROID_REQUEST_PARTIAL_RESULT_COUNT, - ANDROID_REQUEST_PIPELINE_MAX_DEPTH, - ANDROID_SCALER_AVAILABLE_MAX_DIGITAL_ZOOM, - ANDROID_SCALER_AVAILABLE_MIN_FRAME_DURATIONS, - ANDROID_SCALER_AVAILABLE_STALL_DURATIONS, - ANDROID_SCALER_AVAILABLE_STREAM_CONFIGURATIONS, - ANDROID_SCALER_CROPPING_TYPE, - 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, - ANDROID_SENSOR_INFO_SENSITIVITY_RANGE, - ANDROID_SENSOR_INFO_TIMESTAMP_SOURCE, - ANDROID_SENSOR_ORIENTATION, - ANDROID_STATISTICS_INFO_AVAILABLE_FACE_DETECT_MODES, - ANDROID_STATISTICS_INFO_MAX_FACE_COUNT, - ANDROID_SYNC_MAX_LATENCY, - }; staticMetadata_->addEntry(ANDROID_REQUEST_AVAILABLE_CHARACTERISTICS_KEYS, - availableCharacteristicsKeys); + std::vector(availableCharacteristicsKeys_.begin(), + availableCharacteristicsKeys_.end())); - std::vector availableRequestKeys = { - 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, - ANDROID_CONTROL_AE_TARGET_FPS_RANGE, - ANDROID_CONTROL_AF_MODE, - ANDROID_CONTROL_AF_TRIGGER, - ANDROID_CONTROL_AWB_LOCK, - ANDROID_CONTROL_AWB_MODE, - ANDROID_CONTROL_CAPTURE_INTENT, - ANDROID_CONTROL_EFFECT_MODE, - ANDROID_CONTROL_MODE, - ANDROID_CONTROL_SCENE_MODE, - ANDROID_CONTROL_VIDEO_STABILIZATION_MODE, - ANDROID_FLASH_MODE, - ANDROID_JPEG_ORIENTATION, - ANDROID_JPEG_QUALITY, - ANDROID_JPEG_THUMBNAIL_QUALITY, - ANDROID_JPEG_THUMBNAIL_SIZE, - ANDROID_LENS_APERTURE, - ANDROID_LENS_OPTICAL_STABILIZATION_MODE, - ANDROID_NOISE_REDUCTION_MODE, - ANDROID_SCALER_CROP_REGION, - ANDROID_STATISTICS_FACE_DETECT_MODE - }; staticMetadata_->addEntry(ANDROID_REQUEST_AVAILABLE_REQUEST_KEYS, - availableRequestKeys); + std::vector(availableRequestKeys_.begin(), + availableRequestKeys_.end())); - 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, - ANDROID_CONTROL_AE_STATE, - ANDROID_CONTROL_AE_TARGET_FPS_RANGE, - ANDROID_CONTROL_AF_MODE, - ANDROID_CONTROL_AF_STATE, - ANDROID_CONTROL_AF_TRIGGER, - ANDROID_CONTROL_AWB_LOCK, - ANDROID_CONTROL_AWB_MODE, - ANDROID_CONTROL_AWB_STATE, - ANDROID_CONTROL_CAPTURE_INTENT, - ANDROID_CONTROL_EFFECT_MODE, - ANDROID_CONTROL_MODE, - ANDROID_CONTROL_SCENE_MODE, - ANDROID_CONTROL_VIDEO_STABILIZATION_MODE, - ANDROID_FLASH_MODE, - ANDROID_FLASH_STATE, - ANDROID_JPEG_GPS_COORDINATES, - ANDROID_JPEG_GPS_PROCESSING_METHOD, - ANDROID_JPEG_GPS_TIMESTAMP, - ANDROID_JPEG_ORIENTATION, - ANDROID_JPEG_QUALITY, - ANDROID_JPEG_SIZE, - ANDROID_JPEG_THUMBNAIL_QUALITY, - ANDROID_JPEG_THUMBNAIL_SIZE, - ANDROID_LENS_APERTURE, - ANDROID_LENS_FOCAL_LENGTH, - ANDROID_LENS_OPTICAL_STABILIZATION_MODE, - ANDROID_LENS_STATE, - 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, - ANDROID_SENSOR_TIMESTAMP, - ANDROID_STATISTICS_FACE_DETECT_MODE, - ANDROID_STATISTICS_LENS_SHADING_MAP_MODE, - ANDROID_STATISTICS_HOT_PIXEL_MAP_MODE, - ANDROID_STATISTICS_SCENE_FLICKER, - }; staticMetadata_->addEntry(ANDROID_REQUEST_AVAILABLE_RESULT_KEYS, - availableResultKeys); + std::vector(availableResultKeys_.begin(), + availableResultKeys_.end())); if (!staticMetadata_->isValid()) { LOG(HAL, Error) << "Failed to construct static metadata"; diff --git a/src/android/camera_capabilities.h b/src/android/camera_capabilities.h index 38ee97d0..cf68539b 100644 --- a/src/android/camera_capabilities.h +++ b/src/android/camera_capabilities.h @@ -9,6 +9,7 @@ #include #include +#include #include #include @@ -74,6 +75,10 @@ private: std::map formatsMap_; std::unique_ptr staticMetadata_; unsigned int maxJpegBufferSize_; + + std::set availableCharacteristicsKeys_; + std::set availableRequestKeys_; + std::set availableResultKeys_; }; #endif /* __ANDROID_CAMERA_CAPABILITIES_H__ */ From patchwork Fri Jul 16 10:56:18 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Elder X-Patchwork-Id: 13014 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 9E76FC3228 for ; Fri, 16 Jul 2021 10:57:08 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 5C1CA6853D; Fri, 16 Jul 2021 12:57:08 +0200 (CEST) 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="Q1N6giYu"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 7F95C6853A for ; Fri, 16 Jul 2021 12:57:06 +0200 (CEST) Received: from pyrite.rasen.tech (unknown [IPv6:2400:4051:61:600:2c71:1b79:d06d:5032]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 07DC83F0; Fri, 16 Jul 2021 12:57:04 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1626433026; bh=3RbJETW5PGgFg7hxMOjBAeCBimY7Ym+LYM1qtOabimQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Q1N6giYuuR+CtYPPeo97tA0NpV55ML6egEobNr69Nw96NrKZJsFZyJdkgslaQ6hZw oxUJAxujOwVsk8tQVHPLenAN3zHbxfggKqQzYFtTSvm7ioHM5xKcBznmp9qRpA56kx bL+VyZSR3VzCe1Ni12ITOWcQRzU9GU0fUSbVT0Ww= From: Paul Elder To: libcamera-devel@lists.libcamera.org Date: Fri, 16 Jul 2021 19:56:18 +0900 Message-Id: <20210716105631.158153-9-paul.elder@ideasonboard.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210716105631.158153-1-paul.elder@ideasonboard.com> References: <20210716105631.158153-1-paul.elder@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [RFC PATCH v4 08/21] android: Add skeletal still and manual request templates 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 skeletal still and manual request templates so that we can expand them for FULL support. Signed-off-by: Paul Elder Reviewed-by: Jacopo Mondi --- src/android/camera_capabilities.cpp | 18 ++++++++++++++++++ src/android/camera_capabilities.h | 2 ++ src/android/camera_device.cpp | 7 +++++-- 3 files changed, 25 insertions(+), 2 deletions(-) diff --git a/src/android/camera_capabilities.cpp b/src/android/camera_capabilities.cpp index 09b3d82d..21e31cf2 100644 --- a/src/android/camera_capabilities.cpp +++ b/src/android/camera_capabilities.cpp @@ -1443,3 +1443,21 @@ std::unique_ptr CameraCapabilities::requestTemplateVideo() const return previewTemplate; } + +std::unique_ptr CameraCapabilities::requestTemplateStill() const +{ + std::unique_ptr stillTemplate = requestTemplatePreview(); + if (!stillTemplate) + return nullptr; + + return stillTemplate; +} + +std::unique_ptr CameraCapabilities::requestTemplateManual() const +{ + std::unique_ptr manualTemplate = requestTemplatePreview(); + if (!manualTemplate) + return nullptr; + + return manualTemplate; +} diff --git a/src/android/camera_capabilities.h b/src/android/camera_capabilities.h index cf68539b..52a203c8 100644 --- a/src/android/camera_capabilities.h +++ b/src/android/camera_capabilities.h @@ -34,6 +34,8 @@ public: std::unique_ptr requestTemplatePreview() const; std::unique_ptr requestTemplateVideo() const; + std::unique_ptr requestTemplateStill() const; + std::unique_ptr requestTemplateManual() const; private: LIBCAMERA_DISABLE_COPY_AND_MOVE(CameraCapabilities) diff --git a/src/android/camera_device.cpp b/src/android/camera_device.cpp index 678cde23..692d0a5b 100644 --- a/src/android/camera_device.cpp +++ b/src/android/camera_device.cpp @@ -487,7 +487,7 @@ const camera_metadata_t *CameraDevice::constructDefaultRequestSettings(int type) * for the torch mode we currently do not support. */ captureIntent = ANDROID_CONTROL_CAPTURE_INTENT_STILL_CAPTURE; - requestTemplate = capabilities_.requestTemplatePreview(); + requestTemplate = capabilities_.requestTemplateStill(); break; case CAMERA3_TEMPLATE_VIDEO_RECORD: captureIntent = ANDROID_CONTROL_CAPTURE_INTENT_VIDEO_RECORD; @@ -497,9 +497,12 @@ const camera_metadata_t *CameraDevice::constructDefaultRequestSettings(int type) captureIntent = ANDROID_CONTROL_CAPTURE_INTENT_VIDEO_SNAPSHOT; requestTemplate = capabilities_.requestTemplateVideo(); break; + case CAMERA3_TEMPLATE_MANUAL: + captureIntent = ANDROID_CONTROL_CAPTURE_INTENT_MANUAL; + requestTemplate = capabilities_.requestTemplateManual(); + break; /* \todo Implement templates generation for the remaining use cases. */ case CAMERA3_TEMPLATE_ZERO_SHUTTER_LAG: - case CAMERA3_TEMPLATE_MANUAL: default: LOG(HAL, Error) << "Unsupported template request type: " << type; return nullptr; From patchwork Fri Jul 16 10:56:19 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Elder X-Patchwork-Id: 13015 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 BFB4EC3228 for ; Fri, 16 Jul 2021 10:57:11 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 7F8386853B; Fri, 16 Jul 2021 12:57:11 +0200 (CEST) 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="YVizAH5E"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id A5ED36853A for ; Fri, 16 Jul 2021 12:57:08 +0200 (CEST) Received: from pyrite.rasen.tech (unknown [IPv6:2400:4051:61:600:2c71:1b79:d06d:5032]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id EEC8C3F0; Fri, 16 Jul 2021 12:57:06 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1626433028; bh=JPhi8gsc1O9KCipSCk62rBUxQmfuxvdWJzFupeKUhTA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=YVizAH5EYzRahkCy1DnXTcc7jv+E4t9ifvB8X/NJyaROcXJBiSx0CW8oDaDFxNtj8 2fceC38vVkp09gRdrK3BDyunLG3/YBVElTZzag40l3IE64k5wOfEx6AajL0KwZ6QJ4 IrvRtfKcMpH0w3JdsUaMX8NXXNBTIlihs0Gc8c8E= From: Paul Elder To: libcamera-devel@lists.libcamera.org Date: Fri, 16 Jul 2021 19:56:19 +0900 Message-Id: <20210716105631.158153-10-paul.elder@ideasonboard.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210716105631.158153-1-paul.elder@ideasonboard.com> References: <20210716105631.158153-1-paul.elder@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [RFC PATCH v4 09/21] android, controls: Add and plumb MaxLatency control 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 a MaxLatency control, and plumb it into the HAL accordingly. Bug: https://bugs.libcamera.org/show_bug.cgi?id=50 Signed-off-by: Paul Elder Reviewed-by: Laurent Pinchart Reviewed-by: Jacopo Mondi --- Changes in v3: - use v3 setMetadata - add comment to explain 4 - remove todo Changes in v2: - use new setMetadata - rebase on camera capabilities refactor --- src/android/camera_capabilities.cpp | 7 +++++-- src/libcamera/control_ids.yaml | 10 ++++++++++ 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/src/android/camera_capabilities.cpp b/src/android/camera_capabilities.cpp index 21e31cf2..c333b329 100644 --- a/src/android/camera_capabilities.cpp +++ b/src/android/camera_capabilities.cpp @@ -1127,8 +1127,11 @@ int CameraCapabilities::initializeStaticMetadata() } /* Sync static metadata. */ - int32_t maxLatency = ANDROID_SYNC_MAX_LATENCY_UNKNOWN; - staticMetadata_->addEntry(ANDROID_SYNC_MAX_LATENCY, maxLatency); + setMetadata( + staticMetadata_.get(), ANDROID_SYNC_MAX_LATENCY, + controlsInfo, &controls::draft::MaxLatency, + ControlRange::Def, + ANDROID_SYNC_MAX_LATENCY_UNKNOWN); /* Flash static metadata. */ char flashAvailable = ANDROID_FLASH_INFO_AVAILABLE_FALSE; diff --git a/src/libcamera/control_ids.yaml b/src/libcamera/control_ids.yaml index d92f29f5..9d4638ae 100644 --- a/src/libcamera/control_ids.yaml +++ b/src/libcamera/control_ids.yaml @@ -622,6 +622,16 @@ controls: detection, additional format conversions etc) count as an additional pipeline stage. + - MaxLatency: + type: int32_t + draft: true + description: | + The maximum number of frames that can occur after a request (different + than the previous) has been submitted, and before the result's state + becomes synchronized. A value of -1 indicates unknown latency, and 0 + indicates per-frame control. Currently identical to + ANDROID_SYNC_MAX_LATENCY. + - TestPatternMode: type: int32_t draft: true From patchwork Fri Jul 16 10:56:20 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Elder X-Patchwork-Id: 13016 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 93FE2C3228 for ; Fri, 16 Jul 2021 10:57:13 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 492E668546; Fri, 16 Jul 2021 12:57:13 +0200 (CEST) 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="d976HGPx"; 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 8E6BE68537 for ; Fri, 16 Jul 2021 12:57:10 +0200 (CEST) Received: from pyrite.rasen.tech (unknown [IPv6:2400:4051:61:600:2c71:1b79:d06d:5032]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 1DD343F0; Fri, 16 Jul 2021 12:57:08 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1626433030; bh=LEGM86Y7GkbKMcxvbulKb2yV37LTGj/GOdzj1PrGHqM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=d976HGPxgdrACz7K9/UAVgfWSHaD8R1Ir3+zlHcAi0Xor503XQlnUmtqC5YMCFG/M Hw1NIRBiLmM6W4zhEqfkwjxfJkcg9pPyetvmBUMz0N9fOyw6pCsg2ysX7BGq0riekz yTn0Cea12sQHCEuxl2Qu3yiPm2uE2xHwamSV/u1s= From: Paul Elder To: libcamera-devel@lists.libcamera.org Date: Fri, 16 Jul 2021 19:56:20 +0900 Message-Id: <20210716105631.158153-11-paul.elder@ideasonboard.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210716105631.158153-1-paul.elder@ideasonboard.com> References: <20210716105631.158153-1-paul.elder@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [RFC PATCH v4 10/21] controls: Replace AeLocked with AeState, and add AeLock 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" AeLocked alone isn't sufficient for reporting the AE state, so replace it with AeState. Add an AeLock control for instructing the camera to lock the AE values. Update the current users of AeLocked accordingly. Signed-off-by: Paul Elder --- No change in v3 --- src/ipa/raspberrypi/raspberrypi.cpp | 5 +- src/ipa/rkisp1/rkisp1.cpp | 13 ++-- src/libcamera/control_ids.yaml | 96 ++++++++++++++++++----------- 3 files changed, 71 insertions(+), 43 deletions(-) diff --git a/src/ipa/raspberrypi/raspberrypi.cpp b/src/ipa/raspberrypi/raspberrypi.cpp index 5cd33304..2739db28 100644 --- a/src/ipa/raspberrypi/raspberrypi.cpp +++ b/src/ipa/raspberrypi/raspberrypi.cpp @@ -469,7 +469,10 @@ void IPARPi::reportMetadata() AgcStatus *agcStatus = rpiMetadata_.GetLocked("agc.status"); if (agcStatus) { - libcameraMetadata_.set(controls::AeLocked, agcStatus->locked); + libcameraMetadata_.set(controls::AeState, + agcStatus->locked ? + controls::AeStateLocked : + controls::AeStateSearching); libcameraMetadata_.set(controls::DigitalGain, agcStatus->digital_gain); } diff --git a/src/ipa/rkisp1/rkisp1.cpp b/src/ipa/rkisp1/rkisp1.cpp index b881d42e..9d7efade 100644 --- a/src/ipa/rkisp1/rkisp1.cpp +++ b/src/ipa/rkisp1/rkisp1.cpp @@ -51,7 +51,7 @@ private: const rkisp1_stat_buffer *stats); void setControls(unsigned int frame); - void metadataReady(unsigned int frame, unsigned int aeState); + void metadataReady(unsigned int frame, int aeState); std::map buffers_; std::map buffersMemory_; @@ -227,7 +227,7 @@ void IPARkISP1::updateStatistics(unsigned int frame, const rkisp1_stat_buffer *stats) { const rkisp1_cif_isp_stat *params = &stats->params; - unsigned int aeState = 0; + int aeState = controls::AeStateInactive; if (stats->meas_type & RKISP1_CIF_ISP_STAT_AUTOEXP) { const rkisp1_cif_isp_ae_stat *ae = ¶ms->ae; @@ -262,7 +262,9 @@ void IPARkISP1::updateStatistics(unsigned int frame, setControls(frame + 1); } - aeState = fabs(factor - 1.0f) < 0.05f ? 2 : 1; + aeState = fabs(factor - 1.0f) < 0.05f ? + controls::AeStateConverged : + controls::AeStateSearching; } metadataReady(frame, aeState); @@ -281,12 +283,11 @@ void IPARkISP1::setControls(unsigned int frame) queueFrameAction.emit(frame, op); } -void IPARkISP1::metadataReady(unsigned int frame, unsigned int aeState) +void IPARkISP1::metadataReady(unsigned int frame, int aeState) { ControlList ctrls(controls::controls); - if (aeState) - ctrls.set(controls::AeLocked, aeState == 2); + ctrls.set(controls::AeState, aeState); RkISP1Action op; op.op = ActionMetadata; diff --git a/src/libcamera/control_ids.yaml b/src/libcamera/control_ids.yaml index 9d4638ae..5717bc1f 100644 --- a/src/libcamera/control_ids.yaml +++ b/src/libcamera/control_ids.yaml @@ -14,16 +14,70 @@ controls: \sa ExposureTime AnalogueGain - - AeLocked: + - AeLock: type: bool description: | - Report the lock status of a running AE algorithm. + Control to lock the AE values. + When set to true, the AE algorithm is locked to its latest parameters, + and will not change exposure settings until set to false. + \sa AeState - If the AE algorithm is locked the value shall be set to true, if it's - converging it shall be set to false. If the AE algorithm is not - running the control shall not be present in the metadata control list. + - AeState: + type: int32_t + description: | + Control to report the current AE algorithm state. Enabling or disabling + AE (AeEnable) always resets the AeState to AeStateInactive. The camera + device can do several state transitions between two results, if it is + allowed by the state transition table. For example, AeStateInactive may + never actually be seen in a result. - \sa AeEnable + The state in the result is the state for this image (in sync with this + image). If AE state becomes AeStateConverged, then the image data + associated with the result should be good to use. + + The state transitions mentioned below assume that AeEnable is on. + + \sa AeLock + enum: + - name: AeStateInactive + value: 0 + description: | + The AE algorithm is inactive. + If the camera initiates an AE scan, the state shall go to Searching. + If AeLock is on, the state shall go to Locked. + - name: AeStateSearching + value: 1 + description: | + The AE algorithm has not converged yet. + If the camera finishes an AE scan, the state shall go to Converged. + If the camera finishes an AE scan, but flash is required, the state + shall go to FlashRequired. + If AeLock is on, the state shall go to Locked. + - name: AeStateConverged + value: 2 + description: | + The AE algorithm has converged. + If the camera initiates an AE scan, the state shall go to Searching. + If AeLock is on, the state shall go to Locked. + - name: AeStateLocked + value: 3 + description: | + The AE algorithm is locked. + If AeLock is off, the state can go to Searching, Converged, or + FlashRequired. + - name: AeStateFlashRequired + value: 4 + description: | + The AE algorithm would need a flash for good results + If the camera initiates an AE scan, the state shall go to Searching. + If AeLock is on, the state shall go to Locked. + - name: AeStatePrecapture + value: 5 + description: | + The AE algorithm has started a pre-capture metering session. + After the sequence is finished, the state shall go to Converged if + AeLock is off, and Locked if it is on. + \sa AePrecaptureTrigger # AeMeteringMode needs further attention: # - Auto-generate max enum value. @@ -477,36 +531,6 @@ controls: High quality aberration correction which might reduce the frame rate. - - AeState: - type: int32_t - draft: true - description: | - Control to report the current AE algorithm state. Currently identical to - ANDROID_CONTROL_AE_STATE. - - Current state of the AE algorithm. - enum: - - name: AeStateInactive - value: 0 - description: The AE algorithm is inactive. - - name: AeStateSearching - value: 1 - description: The AE algorithm has not converged yet. - - name: AeStateConverged - value: 2 - description: The AE algorithm has converged. - - name: AeStateLocked - value: 3 - description: The AE algorithm is locked. - - name: AeStateFlashRequired - value: 4 - description: The AE algorithm would need a flash for good results - - name: AeStatePrecapture - value: 5 - description: | - The AE algorithm has started a pre-capture metering session. - \sa AePrecaptureTrigger - - AfState: type: int32_t draft: true From patchwork Fri Jul 16 10:56:21 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Elder X-Patchwork-Id: 13017 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 0BD14C3229 for ; Fri, 16 Jul 2021 10:57:14 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id AB8A46854B; Fri, 16 Jul 2021 12:57:13 +0200 (CEST) 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="qBF1OQ++"; 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 943FE68539 for ; Fri, 16 Jul 2021 12:57:12 +0200 (CEST) Received: from pyrite.rasen.tech (unknown [IPv6:2400:4051:61:600:2c71:1b79:d06d:5032]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id ED04CA24; Fri, 16 Jul 2021 12:57:10 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1626433032; bh=dk7l7xi6vDH52evgCp+MC4f4IJnbO7xrCo9O70NbB+s=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qBF1OQ++TJEQYPhXnebzSw2RH500LvAPsYLYyVUMUF/mFiu7xQk8WOk0/7OqTaAdL doF6ysBAuo0NDuit529ndkX1XxIMX5QywLSyeKqvQnMDLNGkSQof0+E1TKwxAtE4yU BzktgHFGTOZyEbhKuPOAde0jstPKjsJx347hKhJo= From: Paul Elder To: libcamera-devel@lists.libcamera.org Date: Fri, 16 Jul 2021 19:56:21 +0900 Message-Id: <20210716105631.158153-12-paul.elder@ideasonboard.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210716105631.158153-1-paul.elder@ideasonboard.com> References: <20210716105631.158153-1-paul.elder@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [RFC PATCH v4 11/21] controls: Replace AwbEnable with AwbMode 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" Previously it was possible to have AwbEnable set to false, yet have AwbMode on anything. This caused a confusion situation, so merge the two into AwbMode. While at it, pull in the android AWB modes. Adjust the previous users of AwbEnable accordingly. Signed-off-by: Paul Elder --- Changes in v3: - resume raspberrypi awb on any non-off mode --- include/libcamera/ipa/raspberrypi.h | 1 - src/ipa/raspberrypi/raspberrypi.cpp | 27 ++++++++---------------- src/libcamera/control_ids.yaml | 32 +++++++++++++++-------------- test/controls/control_list.cpp | 6 +++--- 4 files changed, 29 insertions(+), 37 deletions(-) diff --git a/include/libcamera/ipa/raspberrypi.h b/include/libcamera/ipa/raspberrypi.h index a8790000..63392a26 100644 --- a/include/libcamera/ipa/raspberrypi.h +++ b/include/libcamera/ipa/raspberrypi.h @@ -35,7 +35,6 @@ static const ControlInfoMap Controls = { { &controls::AeConstraintMode, ControlInfo(controls::AeConstraintModeValues) }, { &controls::AeExposureMode, ControlInfo(controls::AeExposureModeValues) }, { &controls::ExposureValue, ControlInfo(0.0f, 16.0f) }, - { &controls::AwbEnable, ControlInfo(false, true) }, { &controls::ColourGains, ControlInfo(0.0f, 32.0f) }, { &controls::AwbMode, ControlInfo(controls::AwbModeValues) }, { &controls::Brightness, ControlInfo(-1.0f, 1.0f) }, diff --git a/src/ipa/raspberrypi/raspberrypi.cpp b/src/ipa/raspberrypi/raspberrypi.cpp index 2739db28..f80d6c66 100644 --- a/src/ipa/raspberrypi/raspberrypi.cpp +++ b/src/ipa/raspberrypi/raspberrypi.cpp @@ -746,24 +746,6 @@ void IPARPi::queueRequest(const ControlList &controls) break; } - case controls::AWB_ENABLE: { - RPiController::Algorithm *awb = controller_.GetAlgorithm("awb"); - if (!awb) { - LOG(IPARPI, Warning) - << "Could not set AWB_ENABLE - no AWB algorithm"; - break; - } - - if (ctrl.second.get() == false) - awb->Pause(); - else - awb->Resume(); - - libcameraMetadata_.set(controls::AwbEnable, - ctrl.second.get()); - break; - } - case controls::AWB_MODE: { RPiController::AwbAlgorithm *awb = dynamic_cast( controller_.GetAlgorithm("awb")); @@ -774,6 +756,15 @@ void IPARPi::queueRequest(const ControlList &controls) } int32_t idx = ctrl.second.get(); + + if (idx == controls::AwbOff) { + awb->Pause(); + break; + } + + if (awb->IsPaused()) + awb->Resume(); + if (AwbModeTable.count(idx)) { awb->SetMode(AwbModeTable.at(idx)); libcameraMetadata_.set(controls::AwbMode, idx); diff --git a/src/libcamera/control_ids.yaml b/src/libcamera/control_ids.yaml index 5717bc1f..2e62f61b 100644 --- a/src/libcamera/control_ids.yaml +++ b/src/libcamera/control_ids.yaml @@ -229,13 +229,6 @@ controls: Report an estimate of the current illuminance level in lux. The Lux control can only be returned in metadata. - - AwbEnable: - type: bool - description: | - Enable or disable the AWB. - - \sa ColourGains - # AwbMode needs further attention: # - Auto-generate max enum value. # - Better handling of custom types. @@ -245,29 +238,38 @@ controls: Specify the range of illuminants to use for the AWB algorithm. The modes supported are platform specific, and not all modes may be supported. enum: - - name: AwbAuto + - name: AwbOff value: 0 + description: The AWB routune is disabled. + - name: AwbAuto + value: 1 description: Search over the whole colour temperature range. - name: AwbIncandescent - value: 1 - description: Incandescent AWB lamp mode. - - name: AwbTungsten value: 2 - description: Tungsten AWB lamp mode. + description: Incandescent AWB lamp mode. - name: AwbFluorescent value: 3 description: Fluorescent AWB lamp mode. - - name: AwbIndoor + - name: AwbWarmFluorescent value: 4 - description: Indoor AWB lighting mode. + description: Warm fluorescent AWB lamp mode. - name: AwbDaylight value: 5 description: Daylight AWB lighting mode. - name: AwbCloudy value: 6 description: Cloudy AWB lighting mode. - - name: AwbCustom + - name: AwbTwilight value: 7 + description: Twilight AWB lamp mode. + - name: AwbTungsten + value: 8 + description: Tungsten AWB lamp mode. + - name: AwbIndoor + value: 9 + description: Indoor AWB lighting mode. + - name: AwbCustom + value: 10 description: Custom AWB mode. - AwbLocked: diff --git a/test/controls/control_list.cpp b/test/controls/control_list.cpp index 70cf61b8..ce55d09b 100644 --- a/test/controls/control_list.cpp +++ b/test/controls/control_list.cpp @@ -143,10 +143,10 @@ protected: * Attempt to set an invalid control and verify that the * operation failed. */ - list.set(controls::AwbEnable, true); + list.set(controls::AwbMode, true); - if (list.contains(controls::AwbEnable)) { - cout << "List shouldn't contain AwbEnable control" << endl; + if (list.contains(controls::AwbMode)) { + cout << "List shouldn't contain AwbMode control" << endl; return TestFail; } From patchwork Fri Jul 16 10:56:22 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Elder X-Patchwork-Id: 13018 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 C02D2C3228 for ; Fri, 16 Jul 2021 10:57:16 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 4BB7C6853A; Fri, 16 Jul 2021 12:57:16 +0200 (CEST) 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="nmnubKTG"; 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 459ED68545 for ; Fri, 16 Jul 2021 12:57:14 +0200 (CEST) Received: from pyrite.rasen.tech (unknown [IPv6:2400:4051:61:600:2c71:1b79:d06d:5032]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id C54003F0; Fri, 16 Jul 2021 12:57:12 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1626433034; bh=IrsC/FeWyfcL0Sh+EI8m4+rQeJYAHb7u7XqagunHW5k=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=nmnubKTGLuaQSq0xqpos9nU20xlG0jLPNTa8HLBoTHSW6iX4hhyjNqHIcQAiQ2zdw aju68LnNOq5XYLfl6chyiSHN3RFC5v9jsEqyflPOocMBx7SRaZVNTsZd8I9U7SYSUM PEyXhiBO7iklEVzpu+s7jfS/nni1Wtp6iPZkUsmg= From: Paul Elder To: libcamera-devel@lists.libcamera.org Date: Fri, 16 Jul 2021 19:56:22 +0900 Message-Id: <20210716105631.158153-13-paul.elder@ideasonboard.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210716105631.158153-1-paul.elder@ideasonboard.com> References: <20210716105631.158153-1-paul.elder@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [RFC PATCH v4 12/21] controls: Replace AwbLocked with AwbState, and add AwbLock 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" AwbLocked alone isn't sufficient for reporting the AWB state, so replace it with AwbState. Add an AwbLock control for instructing the camera to lock the AWB values. Signed-off-by: Paul Elder --- No change in v3 --- src/libcamera/control_ids.yaml | 82 ++++++++++++++++++++-------------- 1 file changed, 49 insertions(+), 33 deletions(-) diff --git a/src/libcamera/control_ids.yaml b/src/libcamera/control_ids.yaml index 2e62f61b..3a4f07cf 100644 --- a/src/libcamera/control_ids.yaml +++ b/src/libcamera/control_ids.yaml @@ -161,6 +161,55 @@ controls: value: 3 description: Custom exposure mode. + - AwbLock: + type: bool + description: | + Control to lock the AWB values. + When set to true, the AWB algorithm is locked to its latest parameters, + and will not change exposure settings until set to false. + \sa AwbState + + - AwbState: + type: int32_t + description: | + Control to report the current AWB algorithm state. Switching between or + enabling AWB modes (AwbMode) always resets the AwbState to + AwbStateInactive. The camera device can do several state transitions + between two results, if it is allowed by the state transition table. + For example, AwbStateInactive may never actually be seen in a result. + + The state in the result is the state for this image (in sync with this + image). If AWB state becomes AwbStateConverged, then the image data + associated with the result should be good to use. + + The state transitions mentioned below assume that AwbMode is auto. + + \sa AwbLock + enum: + - name: AwbStateInactive + value: 0 + description: | + The AWB algorithm is inactive. + If the camera initiates an AWB scan, the state shall go to Searching. + If AwbLock is on, the state shall go to Locked. + - name: AwbStateSearching + value: 1 + description: | + The AWB algorithm has not converged yet. + If the camera finishes an AWB scan, the state shall go to Converged. + If AwbLock is on, the state shall go to Locked. + - name: AwbStateConverged + value: 2 + description: | + The AWB algorithm has converged. + If the camera initiates an AWB scan, the state shall go to Searching. + If AwbLock is on, the state shall go to Locked. + - name: AwbStateLocked + value: 3 + description: | + The AWB algorithm is locked. + If AwbLock is off, the state shall go to Searching. + - ExposureValue: type: float description: | @@ -272,17 +321,6 @@ controls: value: 10 description: Custom AWB mode. - - AwbLocked: - type: bool - description: | - Report the lock status of a running AWB algorithm. - - If the AWB algorithm is locked the value shall be set to true, if it's - converging it shall be set to false. If the AWB algorithm is not - running the control shall not be present in the metadata control list. - - \sa AwbEnable - - ColourGains: type: float description: | @@ -572,28 +610,6 @@ controls: description: | AF has completed a passive scan without finding focus. - - AwbState: - type: int32_t - draft: true - description: | - Control to report the current AWB algorithm state. Currently identical - to ANDROID_CONTROL_AWB_STATE. - - Current state of the AWB algorithm. - enum: - - name: AwbStateInactive - value: 0 - description: The AWB algorithm is inactive. - - name: AwbStateSearching - value: 1 - description: The AWB algorithm has not converged yet. - - name: AwbConverged - value: 2 - description: The AWB algorithm has converged. - - name: AwbLocked - value: 3 - description: The AWB algorithm is locked. - - SensorRollingShutterSkew: type: int64_t draft: true From patchwork Fri Jul 16 10:56:23 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Elder X-Patchwork-Id: 13019 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 014B4C3228 for ; Fri, 16 Jul 2021 10:57:18 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id ACC706853D; Fri, 16 Jul 2021 12:57:17 +0200 (CEST) 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="j9RGkvMK"; 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 1E4A468521 for ; Fri, 16 Jul 2021 12:57:16 +0200 (CEST) Received: from pyrite.rasen.tech (unknown [IPv6:2400:4051:61:600:2c71:1b79:d06d:5032]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 9F36156B; Fri, 16 Jul 2021 12:57:14 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1626433035; bh=hVBLf9PxXZp7r73j9Bc4DcNsQ6C91IrmgB6P3Nlg+RQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=j9RGkvMKVSmU++dPpa9Js23XiwGJzcAqTWRbazOHHW7Cootke8nlLkb8QeO0h8fBs cMIG1cxDMQ7DKzCT8e6cO3idSGxEIQOCoN2f2KwkDSWF+b3Pob1/LeILWB45qBQUr+ ncRiJcSRKZzte1Kh1r+gcIsly/ndr9ydjSguHAEM= From: Paul Elder To: libcamera-devel@lists.libcamera.org Date: Fri, 16 Jul 2021 19:56:23 +0900 Message-Id: <20210716105631.158153-14-paul.elder@ideasonboard.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210716105631.158153-1-paul.elder@ideasonboard.com> References: <20210716105631.158153-1-paul.elder@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [RFC PATCH v4 13/21] android: Plumb AeEnable control 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" Plumb the AeEnable control into the HAL for CONTROL_AE_AVAILABLE_MODES for static metadata, and CONTROL_AE_MODE for result metadata. Bug: https://bugs.libcamera.org/show_bug.cgi?id=42 Signed-off-by: Paul Elder TODO: check templates --- Changes in v4: - remove capability check - plumb into processControls Changes in v3 - use new setMetadata - rebase on camera capabilities refactor --- src/android/camera_capabilities.cpp | 10 +++++----- src/android/camera_device.cpp | 9 +++++++-- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/src/android/camera_capabilities.cpp b/src/android/camera_capabilities.cpp index c333b329..fe81c665 100644 --- a/src/android/camera_capabilities.cpp +++ b/src/android/camera_capabilities.cpp @@ -818,11 +818,11 @@ int CameraCapabilities::initializeStaticMetadata() staticMetadata_->addEntry(ANDROID_CONTROL_AE_AVAILABLE_ANTIBANDING_MODES, aeAvailableAntiBandingModes); - std::vector aeAvailableModes = { - ANDROID_CONTROL_AE_MODE_ON, - }; - staticMetadata_->addEntry(ANDROID_CONTROL_AE_AVAILABLE_MODES, - aeAvailableModes); + setMetadata( + staticMetadata_.get(), + ANDROID_CONTROL_AE_AVAILABLE_MODES, + controlsInfo, &controls::AeEnable, + { ANDROID_CONTROL_AE_MODE_ON }); int64_t minFrameDurationNsec = -1; int64_t maxFrameDurationNsec = -1; diff --git a/src/android/camera_device.cpp b/src/android/camera_device.cpp index 692d0a5b..98a73b37 100644 --- a/src/android/camera_device.cpp +++ b/src/android/camera_device.cpp @@ -781,6 +781,9 @@ int CameraDevice::processControls(Camera3RequestDescriptor *descriptor) controls.set(controls::ScalerCrop, cropRegion); } + if (settings.getEntry(ANDROID_CONTROL_AE_MODE, &entry)) + controls.set(controls::AeEnable, *entry.data.u8); + return 0; } @@ -1205,8 +1208,10 @@ CameraDevice::getResultMetadata(const Camera3RequestDescriptor &descriptor) cons value = ANDROID_CONTROL_AE_LOCK_OFF; resultMetadata->addEntry(ANDROID_CONTROL_AE_LOCK, value); - value = ANDROID_CONTROL_AE_MODE_ON; - resultMetadata->addEntry(ANDROID_CONTROL_AE_MODE, value); + if (metadata.contains(controls::AeEnable)) { + uint8_t aeMode = metadata.get(controls::AeEnable); + resultMetadata->addEntry(ANDROID_CONTROL_AE_MODE, aeMode); + } if (settings.getEntry(ANDROID_CONTROL_AE_TARGET_FPS_RANGE, &entry)) /* From patchwork Fri Jul 16 10:56:24 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Elder X-Patchwork-Id: 13020 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 7C1E6C3228 for ; Fri, 16 Jul 2021 10:57:20 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 35D8668542; Fri, 16 Jul 2021 12:57:20 +0200 (CEST) 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="tK1MHHH0"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id F1BD968545 for ; Fri, 16 Jul 2021 12:57:17 +0200 (CEST) Received: from pyrite.rasen.tech (unknown [IPv6:2400:4051:61:600:2c71:1b79:d06d:5032]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 78D023F0; Fri, 16 Jul 2021 12:57:16 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1626433037; bh=kQNOmt7D2sHNsqsTtwPW/dV4KEhFjMPAOUTCQBJ0j0g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=tK1MHHH0RsPw8d/4K1cONjOae5nxIbvnkm37HMB6pt2k0147noxSGrbsYky07TmWD UEi1dFXypzn6HoBbu3WVpzhEmgx0O0RHEw7owu9SGCZuUCO8XERf1YwdUB5jF8xTAk ny/kc5hEsa9nr/IfCyeaL1XSqbY4lQNXR2TIKBy4= From: Paul Elder To: libcamera-devel@lists.libcamera.org Date: Fri, 16 Jul 2021 19:56:24 +0900 Message-Id: <20210716105631.158153-15-paul.elder@ideasonboard.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210716105631.158153-1-paul.elder@ideasonboard.com> References: <20210716105631.158153-1-paul.elder@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [RFC PATCH v4 14/21] android: Plumb AeLock control 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" Plumb the AeLock control into the HAL for CONTROL_AE_LOCK_AVAILABLE_MODES for static metadata. Bug: https://bugs.libcamera.org/show_bug.cgi?id=43 Signed-off-by: Paul Elder TODO: check templates --- Changes in v4: - remove capability check - plumb into processControls Changes in v3: - use new setMetadata - rebase on camera capabilities refactor --- src/android/camera_capabilities.cpp | 9 ++++++--- src/android/camera_device.cpp | 11 ++++++++--- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/src/android/camera_capabilities.cpp b/src/android/camera_capabilities.cpp index fe81c665..ac3d88b5 100644 --- a/src/android/camera_capabilities.cpp +++ b/src/android/camera_capabilities.cpp @@ -934,9 +934,12 @@ int CameraCapabilities::initializeStaticMetadata() staticMetadata_->addEntry(ANDROID_CONTROL_SCENE_MODE_OVERRIDES, sceneModesOverride); - uint8_t aeLockAvailable = ANDROID_CONTROL_AE_LOCK_AVAILABLE_FALSE; - staticMetadata_->addEntry(ANDROID_CONTROL_AE_LOCK_AVAILABLE, - aeLockAvailable); + setMetadata( + staticMetadata_.get(), + ANDROID_CONTROL_AE_LOCK_AVAILABLE, + controlsInfo, &controls::AeLock, + ControlRange::Max, + ANDROID_CONTROL_AE_LOCK_AVAILABLE_FALSE); uint8_t awbLockAvailable = ANDROID_CONTROL_AWB_LOCK_AVAILABLE_FALSE; staticMetadata_->addEntry(ANDROID_CONTROL_AWB_LOCK_AVAILABLE, diff --git a/src/android/camera_device.cpp b/src/android/camera_device.cpp index 98a73b37..1721e0e8 100644 --- a/src/android/camera_device.cpp +++ b/src/android/camera_device.cpp @@ -784,6 +784,9 @@ int CameraDevice::processControls(Camera3RequestDescriptor *descriptor) if (settings.getEntry(ANDROID_CONTROL_AE_MODE, &entry)) controls.set(controls::AeEnable, *entry.data.u8); + if (settings.getEntry(ANDROID_CONTROL_AE_LOCK, &entry)) + controls.set(controls::AeLock, *entry.data.u8); + return 0; } @@ -1205,14 +1208,16 @@ CameraDevice::getResultMetadata(const Camera3RequestDescriptor &descriptor) cons resultMetadata->addEntry(ANDROID_CONTROL_AE_EXPOSURE_COMPENSATION, value32); - value = ANDROID_CONTROL_AE_LOCK_OFF; - resultMetadata->addEntry(ANDROID_CONTROL_AE_LOCK, value); - if (metadata.contains(controls::AeEnable)) { uint8_t aeMode = metadata.get(controls::AeEnable); resultMetadata->addEntry(ANDROID_CONTROL_AE_MODE, aeMode); } + if (metadata.contains(controls::AeLock)) { + uint8_t aeLock = metadata.get(controls::AeLock); + resultMetadata->addEntry(ANDROID_CONTROL_AE_LOCK, aeLock); + } + if (settings.getEntry(ANDROID_CONTROL_AE_TARGET_FPS_RANGE, &entry)) /* * \todo Retrieve the AE FPS range from the libcamera metadata. From patchwork Fri Jul 16 10:56:25 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Elder X-Patchwork-Id: 13021 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 83561C3228 for ; Fri, 16 Jul 2021 10:57:22 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id DBAED68540; Fri, 16 Jul 2021 12:57:21 +0200 (CEST) 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="EkEbX1nH"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 00D7368521 for ; Fri, 16 Jul 2021 12:57:20 +0200 (CEST) Received: from pyrite.rasen.tech (unknown [IPv6:2400:4051:61:600:2c71:1b79:d06d:5032]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 849183F0; Fri, 16 Jul 2021 12:57:18 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1626433039; bh=+GHPT2mjYPJ3pKY6rXnGwybodMlwEQ2ig6IHAk7EeYw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=EkEbX1nHq/yz+wBnsZvF+aqfZDGqi1FutxpTQGKRMR+mMMDlcRxrs5M9V8ZU/Rc/v jg2ctLFOR6x2vPCDd2zXBDLDq/JmozABRFcM60RoGE9k/Kr95xkqtL58dpxyVlEVQK ErnjkHlEGVRSjGkhZd3l0WnIVxbL0Zi9HLdslZnA= From: Paul Elder To: libcamera-devel@lists.libcamera.org Date: Fri, 16 Jul 2021 19:56:25 +0900 Message-Id: <20210716105631.158153-16-paul.elder@ideasonboard.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210716105631.158153-1-paul.elder@ideasonboard.com> References: <20210716105631.158153-1-paul.elder@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [RFC PATCH v4 15/21] android: Plumb AwbMode control 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" Plumb the AwbMode control into the HAL for CONTROL_AWB_AVAILABLE_MODES for static metadata. Bug: https://bugs.libcamera.org/show_bug.cgi?id=44 Signed-off-by: Paul Elder TODO: check templates --- Changes in v4: - remove capability check - plumb into processControls Changes in v3: - use new setMetadata - rebase on camera capabilities refactor --- src/android/camera_capabilities.cpp | 14 +++++--------- src/android/camera_device.cpp | 9 +++++++-- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/src/android/camera_capabilities.cpp b/src/android/camera_capabilities.cpp index ac3d88b5..85c39498 100644 --- a/src/android/camera_capabilities.cpp +++ b/src/android/camera_capabilities.cpp @@ -910,15 +910,11 @@ int CameraCapabilities::initializeStaticMetadata() staticMetadata_->addEntry(ANDROID_CONTROL_AVAILABLE_VIDEO_STABILIZATION_MODES, availableStabilizationModes); - /* - * \todo Inspect the camera capabilities to report the available - * AWB modes. Default to AUTO as CTS tests require it. - */ - std::vector availableAwbModes = { - ANDROID_CONTROL_AWB_MODE_AUTO, - }; - staticMetadata_->addEntry(ANDROID_CONTROL_AWB_AVAILABLE_MODES, - availableAwbModes); + setMetadata( + staticMetadata_.get(), + ANDROID_CONTROL_AWB_AVAILABLE_MODES, + controlsInfo, &controls::AwbMode, + { ANDROID_CONTROL_AWB_MODE_AUTO }); std::vector availableMaxRegions = { 0, 0, 0, diff --git a/src/android/camera_device.cpp b/src/android/camera_device.cpp index 1721e0e8..8a9abd34 100644 --- a/src/android/camera_device.cpp +++ b/src/android/camera_device.cpp @@ -787,6 +787,9 @@ int CameraDevice::processControls(Camera3RequestDescriptor *descriptor) if (settings.getEntry(ANDROID_CONTROL_AE_LOCK, &entry)) controls.set(controls::AeLock, *entry.data.u8); + if (settings.getEntry(ANDROID_CONTROL_AWB_MODE, &entry)) + controls.set(controls::AwbMode, *entry.data.u8); + return 0; } @@ -1244,8 +1247,10 @@ CameraDevice::getResultMetadata(const Camera3RequestDescriptor &descriptor) cons value = ANDROID_CONTROL_AF_TRIGGER_IDLE; resultMetadata->addEntry(ANDROID_CONTROL_AF_TRIGGER, value); - value = ANDROID_CONTROL_AWB_MODE_AUTO; - resultMetadata->addEntry(ANDROID_CONTROL_AWB_MODE, value); + if (metadata.contains(controls::AwbMode)) { + uint8_t awbMode = metadata.get(controls::AwbMode); + resultMetadata->addEntry(ANDROID_CONTROL_AWB_MODE, awbMode); + } value = ANDROID_CONTROL_AWB_LOCK_OFF; resultMetadata->addEntry(ANDROID_CONTROL_AWB_LOCK, value); From patchwork Fri Jul 16 10:56:26 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Elder X-Patchwork-Id: 13022 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 A903BC3228 for ; Fri, 16 Jul 2021 10:57:24 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 4B8696853D; Fri, 16 Jul 2021 12:57:24 +0200 (CEST) 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="MViCT9bK"; 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 E151668544 for ; Fri, 16 Jul 2021 12:57:21 +0200 (CEST) Received: from pyrite.rasen.tech (unknown [IPv6:2400:4051:61:600:2c71:1b79:d06d:5032]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 775573F0; Fri, 16 Jul 2021 12:57:20 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1626433041; bh=WvvORGQ1EFoBPhCi9lV/+1rSWrbsnCEZI8jdCqFkjak=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=MViCT9bKpqRTTA+rAYJj7N4jq6+soeQuAl5ee8m8KhDwOKMOlhtp5faPT7alDO6D/ FEScWwZs97P5e3N8vtAKi8Br977Z4PjiJm96RoVK4CcSoWFB+OzP28J2S3j1QhJQMa wnjnRVXl0V/xHHFirNcSLzKuLxsJzbMAE362PkLU= From: Paul Elder To: libcamera-devel@lists.libcamera.org Date: Fri, 16 Jul 2021 19:56:26 +0900 Message-Id: <20210716105631.158153-17-paul.elder@ideasonboard.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210716105631.158153-1-paul.elder@ideasonboard.com> References: <20210716105631.158153-1-paul.elder@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [RFC PATCH v4 16/21] android: Plumb AwbLock control 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" Plumb the AwbLock control into the HAL for CONTROL_AWB_LOCK_AVAILABLE_MODES for static metadata. Bug: https://bugs.libcamera.org/show_bug.cgi?id=45 Signed-off-by: Paul Elder TODO: check templates --- Changes in v4: - remove capability check - plumb into processControls Changes in v3: - use new setMetadata - rebase on camera capabilities refactor --- src/android/camera_capabilities.cpp | 9 ++++++--- src/android/camera_device.cpp | 9 +++++++-- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/src/android/camera_capabilities.cpp b/src/android/camera_capabilities.cpp index 85c39498..8ec4d014 100644 --- a/src/android/camera_capabilities.cpp +++ b/src/android/camera_capabilities.cpp @@ -937,9 +937,12 @@ int CameraCapabilities::initializeStaticMetadata() ControlRange::Max, ANDROID_CONTROL_AE_LOCK_AVAILABLE_FALSE); - uint8_t awbLockAvailable = ANDROID_CONTROL_AWB_LOCK_AVAILABLE_FALSE; - staticMetadata_->addEntry(ANDROID_CONTROL_AWB_LOCK_AVAILABLE, - awbLockAvailable); + setMetadata( + staticMetadata_.get(), + ANDROID_CONTROL_AWB_LOCK_AVAILABLE, + controlsInfo, &controls::AwbLock, + ControlRange::Max, + ANDROID_CONTROL_AWB_LOCK_AVAILABLE_FALSE); char availableControlModes = ANDROID_CONTROL_MODE_AUTO; staticMetadata_->addEntry(ANDROID_CONTROL_AVAILABLE_MODES, diff --git a/src/android/camera_device.cpp b/src/android/camera_device.cpp index 8a9abd34..09ecbd59 100644 --- a/src/android/camera_device.cpp +++ b/src/android/camera_device.cpp @@ -790,6 +790,9 @@ int CameraDevice::processControls(Camera3RequestDescriptor *descriptor) if (settings.getEntry(ANDROID_CONTROL_AWB_MODE, &entry)) controls.set(controls::AwbMode, *entry.data.u8); + if (settings.getEntry(ANDROID_CONTROL_AWB_LOCK, &entry)) + controls.set(controls::AwbLock, *entry.data.u8); + return 0; } @@ -1252,8 +1255,10 @@ CameraDevice::getResultMetadata(const Camera3RequestDescriptor &descriptor) cons resultMetadata->addEntry(ANDROID_CONTROL_AWB_MODE, awbMode); } - value = ANDROID_CONTROL_AWB_LOCK_OFF; - resultMetadata->addEntry(ANDROID_CONTROL_AWB_LOCK, value); + if (metadata.contains(controls::AwbLock)) { + uint8_t awbLock = metadata.get(controls::AwbLock); + resultMetadata->addEntry(ANDROID_CONTROL_AWB_LOCK, awbLock); + } value = ANDROID_CONTROL_AWB_STATE_CONVERGED; resultMetadata->addEntry(ANDROID_CONTROL_AWB_STATE, value); From patchwork Fri Jul 16 10:56:27 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Elder X-Patchwork-Id: 13023 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 1759DC3228 for ; Fri, 16 Jul 2021 10:57:26 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id CA22868544; Fri, 16 Jul 2021 12:57:25 +0200 (CEST) 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="g4xsOcit"; 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 3066A68540 for ; Fri, 16 Jul 2021 12:57:24 +0200 (CEST) Received: from pyrite.rasen.tech (unknown [IPv6:2400:4051:61:600:2c71:1b79:d06d:5032]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 69FC756B; Fri, 16 Jul 2021 12:57:22 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1626433043; bh=zEWJ8a1HM1i/FAFgOPOvoL/2C5fEF2TjHFNVYzgUkeQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=g4xsOcithg5aBFHG91VHE7LiaL89AMQVrIhh6osdlSohKXxzD3fo9XVDk5mqHvG0w N5u0N91F0vxWHnhcsCvjZ86iZ9FYDIvWy0VggkvnbZEkKxBMAFO7mdp/kO1T8etVcC NbqAhz1DkY7ktM3TvTQuI4l7sSfwGWNrulxOCr6k= From: Paul Elder To: libcamera-devel@lists.libcamera.org Date: Fri, 16 Jul 2021 19:56:27 +0900 Message-Id: <20210716105631.158153-18-paul.elder@ideasonboard.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210716105631.158153-1-paul.elder@ideasonboard.com> References: <20210716105631.158153-1-paul.elder@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [RFC PATCH v4 17/21] pipeline: ipu3: Set MaxLatency ControlInfo 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" We want the IPU3 IPA to support setting MaxLatency, so initialize the MaxLatency ControlInfo in the IPU3 pipeline handler. Bug: https://bugs.libcamera.org/show_bug.cgi?id=50 Signed-off-by: Paul Elder Reviewed-by: Laurent Pinchart --- No change in v3 --- src/libcamera/pipeline/ipu3/ipu3.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/libcamera/pipeline/ipu3/ipu3.cpp b/src/libcamera/pipeline/ipu3/ipu3.cpp index 76c3bb3d..d3dafd98 100644 --- a/src/libcamera/pipeline/ipu3/ipu3.cpp +++ b/src/libcamera/pipeline/ipu3/ipu3.cpp @@ -49,6 +49,7 @@ static constexpr unsigned int IMGU_OUTPUT_HEIGHT_MARGIN = 32; static constexpr Size IPU3ViewfinderSize(1280, 720); static const ControlInfoMap::Map IPU3Controls = { + { &controls::draft::MaxLatency, ControlInfo(0, 0, 0) }, { &controls::draft::PipelineDepth, ControlInfo(2, 3) }, }; From patchwork Fri Jul 16 10:56:28 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Elder X-Patchwork-Id: 13024 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 83FB2C3228 for ; Fri, 16 Jul 2021 10:57:27 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 3E1A968542; Fri, 16 Jul 2021 12:57:27 +0200 (CEST) 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="pz5ZFpcK"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 1F9406854F for ; Fri, 16 Jul 2021 12:57:26 +0200 (CEST) Received: from pyrite.rasen.tech (unknown [IPv6:2400:4051:61:600:2c71:1b79:d06d:5032]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id A7B213F0; Fri, 16 Jul 2021 12:57:24 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1626433045; bh=689GpRHTcGieCMwZvgmguQSZpIdDimKjdEG9VkNldWU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pz5ZFpcKCHipAfXPifLXAiL6md/PkYey/5O/27rdDExciPmZlaPGL4TfZ5hjvatLh nSUymSW1pjvrvXSjf5grdusdsfs9Au/zo2oXVbmPrOe1rtdkI2xOfqU1DQWzgaHOfk fd2bJnzqeOqvAOZFv1mIMldZf0xB06qhuE9CqL9c= From: Paul Elder To: libcamera-devel@lists.libcamera.org Date: Fri, 16 Jul 2021 19:56:28 +0900 Message-Id: <20210716105631.158153-19-paul.elder@ideasonboard.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210716105631.158153-1-paul.elder@ideasonboard.com> References: <20210716105631.158153-1-paul.elder@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [RFC PATCH v4 18/21] pipeline: ipu3: Set AeEnable ControlInfo 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" We want the IPU3 IPA to support enabling and disabling AE, so initialize the AeEnable ControlInfo in the IPU3 pipeline handler. Bug: https://bugs.libcamera.org/show_bug.cgi?id=42 Signed-off-by: Paul Elder --- Changes in v4: - use the actual new boolean ControlInfo constructor Changes in v3: - use boolean ControlInfo constructor --- src/libcamera/pipeline/ipu3/ipu3.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/libcamera/pipeline/ipu3/ipu3.cpp b/src/libcamera/pipeline/ipu3/ipu3.cpp index d3dafd98..0057c250 100644 --- a/src/libcamera/pipeline/ipu3/ipu3.cpp +++ b/src/libcamera/pipeline/ipu3/ipu3.cpp @@ -49,6 +49,7 @@ static constexpr unsigned int IMGU_OUTPUT_HEIGHT_MARGIN = 32; static constexpr Size IPU3ViewfinderSize(1280, 720); static const ControlInfoMap::Map IPU3Controls = { + { &controls::AeEnable, ControlInfo({ false, true }, true) }, { &controls::draft::MaxLatency, ControlInfo(0, 0, 0) }, { &controls::draft::PipelineDepth, ControlInfo(2, 3) }, }; From patchwork Fri Jul 16 10:56:29 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Elder X-Patchwork-Id: 13025 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 DD17FC3228 for ; Fri, 16 Jul 2021 10:57:29 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 988CA6853F; Fri, 16 Jul 2021 12:57:29 +0200 (CEST) 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="SOZvE7ZK"; 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 166426853B for ; Fri, 16 Jul 2021 12:57:28 +0200 (CEST) Received: from pyrite.rasen.tech (unknown [IPv6:2400:4051:61:600:2c71:1b79:d06d:5032]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 9A6153F0; Fri, 16 Jul 2021 12:57:26 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1626433047; bh=OtzzaGrZKeM2kEYBYk7deKGmiymPsr8j8lBovCYl/pk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SOZvE7ZK7gyj5SrGAyMFflZLFdr3JINEYMYNNWOst1K4FO8QbT/K+8rdXiLximX2A hScaRLdpv9PrRNquxHMf4NZ5kvtjb67DT+Nj2atmiMh8bbm36i+mICTBJ9ZniJr2YH uaZ56l+lWXe1YyW3nr9TUWagh96RjnvgsW6k9YWY= From: Paul Elder To: libcamera-devel@lists.libcamera.org Date: Fri, 16 Jul 2021 19:56:29 +0900 Message-Id: <20210716105631.158153-20-paul.elder@ideasonboard.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210716105631.158153-1-paul.elder@ideasonboard.com> References: <20210716105631.158153-1-paul.elder@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [RFC PATCH v4 19/21] pipeline: ipu3: Set AeLock ControlInfo 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" We want the IPU3 IPA to support AeLock, so initialize the AeLock ControlInfo in the IPU3 pipeline handler. Bug: https://bugs.libcamera.org/show_bug.cgi?id=43 Signed-off-by: Paul Elder --- Changes in v4: - use the actual new boolean ControlInfo constructor Changes in v3: - use boolean ControlInfo constructor --- src/libcamera/pipeline/ipu3/ipu3.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/libcamera/pipeline/ipu3/ipu3.cpp b/src/libcamera/pipeline/ipu3/ipu3.cpp index 0057c250..2550ae03 100644 --- a/src/libcamera/pipeline/ipu3/ipu3.cpp +++ b/src/libcamera/pipeline/ipu3/ipu3.cpp @@ -50,6 +50,7 @@ static constexpr Size IPU3ViewfinderSize(1280, 720); static const ControlInfoMap::Map IPU3Controls = { { &controls::AeEnable, ControlInfo({ false, true }, true) }, + { &controls::AeLock, ControlInfo({ false, true }, false) }, { &controls::draft::MaxLatency, ControlInfo(0, 0, 0) }, { &controls::draft::PipelineDepth, ControlInfo(2, 3) }, }; From patchwork Fri Jul 16 10:56:30 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Elder X-Patchwork-Id: 13026 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 5E3B1C3228 for ; Fri, 16 Jul 2021 10:57:32 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 0FC326853A; Fri, 16 Jul 2021 12:57:32 +0200 (CEST) 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="oOfKFRwA"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 11EDC6853B for ; Fri, 16 Jul 2021 12:57:30 +0200 (CEST) Received: from pyrite.rasen.tech (unknown [IPv6:2400:4051:61:600:2c71:1b79:d06d:5032]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id A5F8F3F0; Fri, 16 Jul 2021 12:57:28 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1626433049; bh=gGGGEsX23Us3DRbijshbs6k2t4aF9aAzyjxkG8hxIeY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=oOfKFRwAzM3CTfdly8ZfOT5Evq9x1hhb1qSkxPXDxIUcRYFyp+FjFlyZWagpffWSh eVlnHHVdN/h/CyCBjNQ2TxQJbdT6MQO+hK5Kn/HPva8FA2VfK1/d/o5xvzm0jwI/Rf lxqq5y72GyjWpV6z1HMnkrmvhYbGX6RR+NFQovAs= From: Paul Elder To: libcamera-devel@lists.libcamera.org Date: Fri, 16 Jul 2021 19:56:30 +0900 Message-Id: <20210716105631.158153-21-paul.elder@ideasonboard.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210716105631.158153-1-paul.elder@ideasonboard.com> References: <20210716105631.158153-1-paul.elder@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [RFC PATCH v4 20/21] pipeline: ipu3: Set AwbMode ControlInfo 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" We want the IPU3 IPA to support setting the AWB mode, so initialize the AwbMode ControlInfo in the IPU3 pipeline handler. Bug: https://bugs.libcamera.org/show_bug.cgi?id=44 Signed-off-by: Paul Elder --- No change in v4 No change in v3 --- src/libcamera/pipeline/ipu3/ipu3.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/libcamera/pipeline/ipu3/ipu3.cpp b/src/libcamera/pipeline/ipu3/ipu3.cpp index 2550ae03..0c49e0f5 100644 --- a/src/libcamera/pipeline/ipu3/ipu3.cpp +++ b/src/libcamera/pipeline/ipu3/ipu3.cpp @@ -51,6 +51,7 @@ static constexpr Size IPU3ViewfinderSize(1280, 720); static const ControlInfoMap::Map IPU3Controls = { { &controls::AeEnable, ControlInfo({ false, true }, true) }, { &controls::AeLock, ControlInfo({ false, true }, false) }, + { &controls::AwbMode, ControlInfo(controls::AwbModeValues) }, { &controls::draft::MaxLatency, ControlInfo(0, 0, 0) }, { &controls::draft::PipelineDepth, ControlInfo(2, 3) }, }; From patchwork Fri Jul 16 10:56:31 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Elder X-Patchwork-Id: 13027 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 C6B98C3228 for ; Fri, 16 Jul 2021 10:57:33 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 839966853B; Fri, 16 Jul 2021 12:57:33 +0200 (CEST) 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="bg4RFEWm"; 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 174F96853F for ; Fri, 16 Jul 2021 12:57:32 +0200 (CEST) Received: from pyrite.rasen.tech (unknown [IPv6:2400:4051:61:600:2c71:1b79:d06d:5032]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 98DEC3F0; Fri, 16 Jul 2021 12:57:30 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1626433051; bh=MsiZANlauPKDFoRwXiVNxX+8L2BlZGUFV3Zp0xbUnws=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bg4RFEWmsNnAH7qGprogtdwDioiLLvuJMoITFTypKxpt44BMO22yviuczmlHRWZ9e bAHM12yjxxq43fKM0XRRj+Ygl972Fo6WutiJGSJLXuoo4qF5oFFNpIHvdsxpTojUWI TuLclVeEUgKcOd7T0E+C9EO0SaBKfLyoK/gYQoC8= From: Paul Elder To: libcamera-devel@lists.libcamera.org Date: Fri, 16 Jul 2021 19:56:31 +0900 Message-Id: <20210716105631.158153-22-paul.elder@ideasonboard.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210716105631.158153-1-paul.elder@ideasonboard.com> References: <20210716105631.158153-1-paul.elder@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [RFC PATCH v4 21/21] pipeline: ipu3: Set AwbLock ControlInfo 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" We want the IPU3 IPA to support AwbLock, so initialize the AwbLock ControlInfo in the IPU3 pipeline handler. Bug: https://bugs.libcamera.org/show_bug.cgi?id=45 Signed-off-by: Paul Elder --- Changes in v4: - use the actual new boolean ControlInfo constructor Changes in v3: - use boolean ControlInfo constructor --- src/libcamera/pipeline/ipu3/ipu3.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/libcamera/pipeline/ipu3/ipu3.cpp b/src/libcamera/pipeline/ipu3/ipu3.cpp index 0c49e0f5..1fd2ba17 100644 --- a/src/libcamera/pipeline/ipu3/ipu3.cpp +++ b/src/libcamera/pipeline/ipu3/ipu3.cpp @@ -51,6 +51,7 @@ static constexpr Size IPU3ViewfinderSize(1280, 720); static const ControlInfoMap::Map IPU3Controls = { { &controls::AeEnable, ControlInfo({ false, true }, true) }, { &controls::AeLock, ControlInfo({ false, true }, false) }, + { &controls::AwbLock, ControlInfo({ false, true }, false) }, { &controls::AwbMode, ControlInfo(controls::AwbModeValues) }, { &controls::draft::MaxLatency, ControlInfo(0, 0, 0) }, { &controls::draft::PipelineDepth, ControlInfo(2, 3) },