From patchwork Tue Oct 8 00:45:29 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: 2143 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 BBFC361968 for ; Tue, 8 Oct 2019 02:46:44 +0200 (CEST) X-Halon-ID: f5565c09-e964-11e9-837a-0050569116f7 Authorized-sender: niklas@soderlund.pp.se Received: from bismarck.berto.se (unknown [84.172.88.101]) by bin-vsp-out-03.atm.binero.net (Halon) with ESMTPA id f5565c09-e964-11e9-837a-0050569116f7; Tue, 08 Oct 2019 02:45:43 +0200 (CEST) From: =?utf-8?q?Niklas_S=C3=B6derlund?= To: libcamera-devel@lists.libcamera.org Date: Tue, 8 Oct 2019 02:45:29 +0200 Message-Id: <20191008004534.1585142-6-niklas.soderlund@ragnatech.se> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191008004534.1585142-1-niklas.soderlund@ragnatech.se> References: <20191008004534.1585142-1-niklas.soderlund@ragnatech.se> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v5 05/10] libcamera: request: Add metadata information 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: Tue, 08 Oct 2019 00:46:45 -0000 A new ControlList container is needed to hold metadata coming out of the IPA. The list of supported controls in this list is expected to grow, so for now do not add a validator for the list. Signed-off-by: Niklas Söderlund Reviewed-by: Laurent Pinchart --- include/libcamera/request.h | 2 ++ src/libcamera/request.cpp | 14 ++++++++++++++ 2 files changed, 16 insertions(+) diff --git a/include/libcamera/request.h b/include/libcamera/request.h index e3db5243aaf3cf30..2d5a5964e99eb75f 100644 --- a/include/libcamera/request.h +++ b/include/libcamera/request.h @@ -37,6 +37,7 @@ public: ~Request(); ControlList &controls() { return *controls_; } + ControlList &metadata() { return *metadata_; } const std::map &buffers() const { return bufferMap_; } int addBuffer(std::unique_ptr buffer); Buffer *findBuffer(Stream *stream) const; @@ -58,6 +59,7 @@ private: Camera *camera_; CameraControlValidator *validator_; ControlList *controls_; + ControlList *metadata_; std::map bufferMap_; std::unordered_set pending_; diff --git a/src/libcamera/request.cpp b/src/libcamera/request.cpp index 19f6d0b9a0aeb03c..23d3ab6f422c406e 100644 --- a/src/libcamera/request.cpp +++ b/src/libcamera/request.cpp @@ -65,6 +65,11 @@ Request::Request(Camera *camera, uint64_t cookie) */ validator_ = new CameraControlValidator(camera); controls_ = new ControlList(validator_); + + /** + * \todo: Add a validator for metadata controls. + */ + metadata_ = new ControlList(nullptr); } Request::~Request() @@ -74,6 +79,7 @@ Request::~Request() delete buffer; } + delete metadata_; delete controls_; delete validator_; } @@ -161,6 +167,14 @@ Buffer *Request::findBuffer(Stream *stream) const return it->second; } +/** + * \fn Request::metadata() + * \brief Retrieve the request's metadata + * \todo Offer a read-only API towards applications while keeping a read/write + * API internally. + * \return The metadata associated with the request + */ + /** * \fn Request::cookie() * \brief Retrieve the cookie set when the request was created