From patchwork Sat Aug 31 21:02:15 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: 1903 X-Patchwork-Delegate: niklas.soderlund@ragnatech.se Return-Path: Received: from vsp-unauthed02.binero.net (vsp-unauthed02.binero.net [195.74.38.227]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 9E30460C18 for ; Sat, 31 Aug 2019 23:02:59 +0200 (CEST) X-Halon-ID: b4de6b9b-cc32-11e9-903a-005056917f90 Authorized-sender: niklas@soderlund.pp.se Received: from bismarck.berto.se (unknown [84.172.84.18]) by bin-vsp-out-02.atm.binero.net (Halon) with ESMTPA id b4de6b9b-cc32-11e9-903a-005056917f90; Sat, 31 Aug 2019 23:02:57 +0200 (CEST) From: =?utf-8?q?Niklas_S=C3=B6derlund?= To: libcamera-devel@lists.libcamera.org Date: Sat, 31 Aug 2019 23:02:15 +0200 Message-Id: <20190831210220.29819-2-niklas.soderlund@ragnatech.se> X-Mailer: git-send-email 2.22.1 In-Reply-To: <20190831210220.29819-1-niklas.soderlund@ragnatech.se> References: <20190831210220.29819-1-niklas.soderlund@ragnatech.se> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 1/6] libcamera: request: Add IPAMetaData X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 31 Aug 2019 21:03:00 -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 | 13 +++++++++++ src/libcamera/request.cpp | 44 +++++++++++++++++++++++++++++++++++-- 2 files changed, 55 insertions(+), 2 deletions(-) diff --git a/include/libcamera/request.h b/include/libcamera/request.h index f5de5257bba3f2bb..6f75a59fb69a43d7 100644 --- a/include/libcamera/request.h +++ b/include/libcamera/request.h @@ -21,6 +21,17 @@ class Buffer; class Camera; class Stream; +enum AeState { + Inactive, + Searching, + Converged, +}; + +struct IPAMetaData { + AeState aeState; + bool ready; +}; + class RequestData { }; @@ -44,6 +55,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_; } @@ -65,6 +77,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 bdb4f908fb664ccf..f40cf5cac1f029a9 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,8 +89,8 @@ LOG_DEFINE_CATEGORY(Request) * */ Request::Request(Camera *camera, uint64_t cookie) - : data(nullptr), camera_(camera), controls_(camera), cookie_(cookie), - status_(RequestPending), cancelled_(false) + : data(nullptr), camera_(camera), controls_(camera), metaData_({}), + cookie_(cookie), status_(RequestPending), cancelled_(false) { } @@ -156,6 +190,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