From patchwork Wed Aug 28 01:17:00 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: 1868 Return-Path: Received: from vsp-unauthed02.binero.net (vsp-unauthed02.binero.net [195.74.38.227]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 9D53760C42 for ; Wed, 28 Aug 2019 03:17:39 +0200 (CEST) X-Halon-ID: 96621487-c931-11e9-bdc3-005056917a89 Authorized-sender: niklas@soderlund.pp.se Received: from bismarck.berto.se (unknown [95.195.154.80]) by bin-vsp-out-01.atm.binero.net (Halon) with ESMTPA id 96621487-c931-11e9-bdc3-005056917a89; Wed, 28 Aug 2019 03:17:23 +0200 (CEST) From: =?utf-8?q?Niklas_S=C3=B6derlund?= To: libcamera-devel@lists.libcamera.org Date: Wed, 28 Aug 2019 03:17:00 +0200 Message-Id: <20190828011710.32128-4-niklas.soderlund@ragnatech.se> X-Mailer: git-send-email 2.22.1 In-Reply-To: <20190828011710.32128-1-niklas.soderlund@ragnatech.se> References: <20190828011710.32128-1-niklas.soderlund@ragnatech.se> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 03/13] libcamera: pipeline: Add method to prepare buffer for IPA 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: Wed, 28 Aug 2019 01:17:39 -0000 The pipeline handlers dealing with buffers outside the request coming from an application needs to prepare Buffer objects before they can be used by other the libcamera functions. For objects coming from the user this is done by the Camera before the Buffers reach the pipeline handler. Add a new method prepareInternalBuffer() to aid with this preparation. Signed-off-by: Niklas Söderlund --- src/libcamera/include/pipeline_handler.h | 2 ++ src/libcamera/pipeline_handler.cpp | 18 ++++++++++++++++++ 2 files changed, 20 insertions(+) diff --git a/src/libcamera/include/pipeline_handler.h b/src/libcamera/include/pipeline_handler.h index ffc7adb802215313..91d40ef40a465c4e 100644 --- a/src/libcamera/include/pipeline_handler.h +++ b/src/libcamera/include/pipeline_handler.h @@ -98,6 +98,8 @@ protected: CameraData *cameraData(const Camera *camera); + void prepareInternalBuffer(Buffer *buffer, Request *request, + BufferMemory *mem); CameraManager *manager_; private: diff --git a/src/libcamera/pipeline_handler.cpp b/src/libcamera/pipeline_handler.cpp index 89b67806597728f9..766fd496306ece9c 100644 --- a/src/libcamera/pipeline_handler.cpp +++ b/src/libcamera/pipeline_handler.cpp @@ -484,6 +484,24 @@ void PipelineHandler::hotplugMediaDevice(MediaDevice *media) media->disconnected.connect(this, &PipelineHandler::mediaDeviceDisconnected); } +/** + * \brief Prepare buffer for internal usage by a pipeline handler + * \param[in,out] buffer The buffer to prepare + * \param[in] request The request to associate the \a buffer with + * \param[in] mem The memory to associate the \a buffer with + * + * Pipeline handlers creating internal buffers to facilitate data flow in the + * pipeline need to prepare the buffers by setting up the buffer object state. + * This function help pipeline handler implementations to perform this + * preparation. + */ +void PipelineHandler::prepareInternalBuffer(Buffer *buffer, Request *request, + BufferMemory *mem) +{ + buffer->request_ = request; + buffer->mem_ = mem; +} + /** * \brief Slot for the MediaDevice disconnected signal */