From patchwork Tue Mar 24 15:51:43 2020 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: 3304 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 B2ABA62D18 for ; Tue, 24 Mar 2020 16:51:55 +0100 (CET) X-Halon-ID: 609056eb-6de7-11ea-b7d8-005056917a89 Authorized-sender: niklas@soderlund.pp.se Received: from bismarck.berto.se (p4fca2392.dip0.t-ipconnect.de [79.202.35.146]) by bin-vsp-out-01.atm.binero.net (Halon) with ESMTPA id 609056eb-6de7-11ea-b7d8-005056917a89; Tue, 24 Mar 2020 16:51:51 +0100 (CET) From: =?utf-8?q?Niklas_S=C3=B6derlund?= To: libcamera-devel@lists.libcamera.org Date: Tue, 24 Mar 2020 16:51:43 +0100 Message-Id: <20200324155145.3896183-6-niklas.soderlund@ragnatech.se> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200324155145.3896183-1-niklas.soderlund@ragnatech.se> References: <20200324155145.3896183-1-niklas.soderlund@ragnatech.se> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 5/7] libcamera: FrameBuffer: Add a setRequest() interface 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, 24 Mar 2020 15:51:58 -0000 Add the ability to set the Request a buffer is associated with. This is needed for buffers that live inside a pipeline handler and is temporarily associated with a request as it's being processed inside the pipeline. While we are at it delete a stray semicolon. Signed-off-by: Niklas Söderlund Reviewed-by: Laurent Pinchart --- include/libcamera/buffer.h | 3 ++- src/libcamera/buffer.cpp | 11 +++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/include/libcamera/buffer.h b/include/libcamera/buffer.h index ef3a3b36cd4e4e17..6bb2e4f8558f03ac 100644 --- a/include/libcamera/buffer.h +++ b/include/libcamera/buffer.h @@ -52,7 +52,8 @@ public: const std::vector &planes() const { return planes_; } Request *request() const { return request_; } - const FrameMetadata &metadata() const { return metadata_; }; + void setRequest(Request *request) { request_ = request; } + const FrameMetadata &metadata() const { return metadata_; } unsigned int cookie() const { return cookie_; } void setCookie(unsigned int cookie) { cookie_ = cookie; } diff --git a/src/libcamera/buffer.cpp b/src/libcamera/buffer.cpp index 0352917e9f2a3202..e9ee4debbf33bdf6 100644 --- a/src/libcamera/buffer.cpp +++ b/src/libcamera/buffer.cpp @@ -182,6 +182,17 @@ FrameBuffer::FrameBuffer(const std::vector &planes, unsigned int cookie) * not associated with a request */ +/** + * \fn FrameBuffer::setRequest() + * \brief Set the request this buffer belongs to + * \param[in] request Request to set + * + * The intended callers of this method are pipeline handlers and only for + * buffers that are internal to the pipeline. + * + * \todo Shall be hidden from applications with a d-pointer design. + */ + /** * \fn FrameBuffer::metadata() * \brief Retrieve the dynamic metadata