From 33fedea818e2b6a9ed68ac86acf194b1a2da8828 Mon Sep 17 00:00:00 2001 From: Laurent Pinchart Date: Sat, 14 Mar 2020 16:14:27 +0200 Subject: libcamera: pipeline_handler: Fold buffer management with start/stop MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit There's no need anymore to have the Camera object control how and when pipeline handlers allocate and free the buffers for the application-facing video devices. Fold those operations, currently performed by importFrameBuffers() and freeFrameBuffers(), into the start() and stop() functions. This simplifies the pipeline handler API, its implementation, and the implementation of the Camera class. Signed-off-by: Laurent Pinchart Reviewed-by: Niklas Söderlund --- src/libcamera/pipeline_handler.cpp | 41 +------------------------------------- 1 file changed, 1 insertion(+), 40 deletions(-) (limited to 'src/libcamera/pipeline_handler.cpp') diff --git a/src/libcamera/pipeline_handler.cpp b/src/libcamera/pipeline_handler.cpp index e5034c54..254d341f 100644 --- a/src/libcamera/pipeline_handler.cpp +++ b/src/libcamera/pipeline_handler.cpp @@ -325,7 +325,7 @@ const ControlList &PipelineHandler::properties(Camera *camera) /** * \fn PipelineHandler::exportFrameBuffers() - * \brief Allocate buffers for \a stream + * \brief Allocate and export buffers for \a stream * \param[in] camera The camera * \param[in] stream The stream to allocate buffers for * \param[out] buffers Array of buffers successfully allocated @@ -347,45 +347,6 @@ const ControlList &PipelineHandler::properties(Camera *camera) * otherwise */ -/** - * \fn PipelineHandler::importFrameBuffers() - * \brief Prepare \a stream to use external buffers - * \param[in] camera The camera - * \param[in] stream The stream to prepare for import - * - * This method prepares the pipeline handler to use buffers provided by the - * application for the \a stream. - * - * The method may only be called after the Camera has been configured and before - * it gets started, or after it gets stopped. It shall be called only for - * streams that are part of the active camera configuration, and at most once - * per stream until buffers for the stream are freed with freeFrameBuffers(). - * - * importFrameBuffers() shall also allocate all other resources required by the - * pipeline handler for the stream to prepare for starting the Camera. - * - * The only intended caller is Camera::start(). - * - * \context This function is called from the CameraManager thread. - * - * \return 0 on success or a negative error code otherwise - */ - -/** - * \fn PipelineHandler::freeFrameBuffers() - * \brief Free buffers allocated from the stream - * \param[in] camera The camera - * \param[in] stream The stream to free buffers for - * - * This method shall release all resources allocated for the \a stream by - * importFrameBuffers(). It shall be called only after a successful call that - * method, and only once per stream. - * - * The only intended callers are Camera::stop() and Camera::freeFrameBuffers(). - * - * \context This function is called from the CameraManager thread. - */ - /** * \fn PipelineHandler::start() * \brief Start capturing from a group of streams -- cgit v1.2.1