From patchwork Fri Sep 27 02:44:09 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Niklas_S=C3=B6derlund?= X-Patchwork-Id: 2029 Return-Path: Received: from bin-mail-out-06.binero.net (bin-mail-out-06.binero.net [195.74.38.229]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 4AE3261917 for ; Fri, 27 Sep 2019 04:45:28 +0200 (CEST) X-Halon-ID: cd96051e-e0d0-11e9-bdc3-005056917a89 Authorized-sender: niklas@soderlund.pp.se Received: from bismarck.berto.se (unknown [84.172.88.101]) by bin-vsp-out-01.atm.binero.net (Halon) with ESMTPA id cd96051e-e0d0-11e9-bdc3-005056917a89; Fri, 27 Sep 2019 04:45:02 +0200 (CEST) From: =?utf-8?q?Niklas_S=C3=B6derlund?= To: libcamera-devel@lists.libcamera.org Date: Fri, 27 Sep 2019 04:44:09 +0200 Message-Id: <20190927024417.725906-6-niklas.soderlund@ragnatech.se> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20190927024417.725906-1-niklas.soderlund@ragnatech.se> References: <20190927024417.725906-1-niklas.soderlund@ragnatech.se> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v3 05/13] libcamera: request: Add IPAMetaData X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Sep 2019 02:45:28 -0000 Add a new structure to hold meta data coming out of the IPA. The structure will grow over time but for now only add information about the auto exposure state as it can be directly used by the rkisp1 IPA, which is capable of controlling exposure. Signed-off-by: Niklas Söderlund --- include/libcamera/request.h | 12 +++++++++++ src/libcamera/request.cpp | 42 ++++++++++++++++++++++++++++++++++++- 2 files changed, 53 insertions(+), 1 deletion(-) diff --git a/include/libcamera/request.h b/include/libcamera/request.h index 5eb012e41b4a377b..38a6f008d53dc53a 100644 --- a/include/libcamera/request.h +++ b/include/libcamera/request.h @@ -21,6 +21,16 @@ class Buffer; class Camera; class Stream; +enum AeState { + Inactive, + Searching, + Converged, +}; + +struct IPAMetaData { + AeState aeState; + bool ready; +}; class Request { @@ -41,6 +51,7 @@ public: const std::map &buffers() const { return bufferMap_; } int addBuffer(std::unique_ptr buffer); Buffer *findBuffer(Stream *stream) const; + const IPAMetaData &metaData() const { return metaData_; }; uint64_t cookie() const { return cookie_; } Status status() const { return status_; } @@ -60,6 +71,7 @@ private: ControlList controls_; std::map bufferMap_; std::unordered_set pending_; + IPAMetaData metaData_; const uint64_t cookie_; Status status_; diff --git a/src/libcamera/request.cpp b/src/libcamera/request.cpp index ebae99b07c696512..226a10b6a3c048c5 100644 --- a/src/libcamera/request.cpp +++ b/src/libcamera/request.cpp @@ -24,6 +24,40 @@ namespace libcamera { LOG_DEFINE_CATEGORY(Request) +/** + * \enum AeState + * State of Auto Exposure algorithm + * \var AeState::Inactive + * AE not running + * \var AeState::Searching + * AE is not converged to a good value and is adjusting exposure parameters. + * \var AeState::Converged + * AE has found good exposure values for the current scene. + */ + +/** + * \struct IPAMetaData + * \brief Meta data describing the state of the IPA + * + * Container for IPA meta data. The intended creator of this object is an IPA + * and the intended consumer is applications. Applications access the object + * thru the Request object that corresponds to the specific capture event + * that generated the meta data. + */ + +/** + * \var IPAMetaData::aeState + * \brief Holds the state of the Auto Exposure algorithm + */ + +/** + * \var IPAMetaData::ready + * \brief Flag to indicate the pipeline have validated the meta data + * + * The meta data should not be returned to the application by the specific + * pipeline handler implementation before this flag is set to true. + */ + /** * \enum Request::Status * Request completion status @@ -55,7 +89,7 @@ LOG_DEFINE_CATEGORY(Request) * */ Request::Request(Camera *camera, uint64_t cookie) - : camera_(camera), controls_(camera), cookie_(cookie), + : camera_(camera), controls_(camera), metaData_({}), cookie_(cookie), status_(RequestPending), cancelled_(false) { } @@ -157,6 +191,12 @@ Buffer *Request::findBuffer(Stream *stream) const return it->second; } +/** + * \fn Request::metaData() + * \brief Retrieve the request's meta data + * \return The meta data associated with the request + */ + /** * \fn Request::cookie() * \brief Retrieve the cookie set when the request was created