From patchwork Fri Oct 11 03:22:12 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: 2154 Return-Path: Received: from bin-mail-out-05.binero.net (bin-mail-out-05.binero.net [195.74.38.228]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 5E2E26196D for ; Fri, 11 Oct 2019 05:22:54 +0200 (CEST) X-Halon-ID: 40622a49-ebd6-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 40622a49-ebd6-11e9-837a-0050569116f7; Fri, 11 Oct 2019 05:21:44 +0200 (CEST) From: =?utf-8?q?Niklas_S=C3=B6derlund?= To: libcamera-devel@lists.libcamera.org Date: Fri, 11 Oct 2019 05:22:12 +0200 Message-Id: <20191011032216.2175173-6-niklas.soderlund@ragnatech.se> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191011032216.2175173-1-niklas.soderlund@ragnatech.se> References: <20191011032216.2175173-1-niklas.soderlund@ragnatech.se> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v6 5/9] 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: Fri, 11 Oct 2019 03:22:55 -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