From 5239f6e656d77bdbc66a93714b5a0b31a879c0cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niklas=20S=C3=B6derlund?= Date: Wed, 23 Jan 2019 20:11:34 +0100 Subject: libcamera: pipeline_handler: Extend the interface to support capture MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In order to support capture, the pipeline handler needs methods to allocate and free buffers, to start and stop the capture and to queue requests. Define those interfaces in the PipelineHandler class and implement them as stubs in the existing pipeline handlers. This initial implementation only considers the allocation of new buffers. Future work would need to expand this to also cover importing buffers from an external source. Signed-off-by: Niklas Söderlund Signed-off-by: Jacopo Mondi Signed-off-by: Kieran Bingham Signed-off-by: Laurent Pinchart --- src/libcamera/pipeline_handler.cpp | 67 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) (limited to 'src/libcamera/pipeline_handler.cpp') diff --git a/src/libcamera/pipeline_handler.cpp b/src/libcamera/pipeline_handler.cpp index 3a560e10..cc2d4643 100644 --- a/src/libcamera/pipeline_handler.cpp +++ b/src/libcamera/pipeline_handler.cpp @@ -109,6 +109,73 @@ PipelineHandler::~PipelineHandler() * \return 0 on success or a negative error code on error. */ +/** + * \fn PipelineHandler::allocateBuffers() + * \brief Allocate buffers for a stream + * \param[in] camera The camera the \a stream belongs to + * \param[in] stream The stream to allocate buffers for + * + * This method allocates buffers internally in the pipeline handler and + * associates them with the stream's buffer pool. + * + * The intended caller of this method is the Camera class. + * + * \return 0 on success or a negative error code on error + */ + +/** + * \fn PipelineHandler::freeBuffers() + * \brief Free all buffers associated with a stream + * \param[in] camera The camera the \a stream belongs to + * \param[in] stream The stream to free buffers from + * + * After a capture session has been stopped all buffers associated with the + * stream shall be freed. + * + * The intended caller of this method is the Camera class. + * + * \return 0 on success or a negative error code on error + */ + +/** + * \fn PipelineHandler::start() + * \brief Start capturing from a group of streams + * \param[in] camera The camera to start + * + * Start the group of streams that have been configured for capture by + * \a configureStreams(). The intended caller of this method is the Camera + * class which will in turn be called from the application to indicate that it + * has configured the streams and is ready to capture. + * + * \return 0 on success or a negative error code on error + */ + +/** + * \fn PipelineHandler::stop() + * \brief Stop capturing from all running streams + * \param[in] camera The camera to stop + * + * This method stops capturing and processing requests immediately. All pending + * requests are cancelled and complete immediately in an error state. + * + * \todo Complete the pending requests immediately + */ + +/** + * \fn PipelineHandler::queueRequest() + * \brief Queue a request to the camera + * \param[in] camera The camera to queue the request to + * \param[in] request The request to queue + * + * This method queues a capture request to the pipeline handler for processing. + * The request contains a set of buffers associated with streams and a set of + * parameters. The pipeline handler shall program the device to ensure that the + * parameters will be applied to the frames captured in the buffers provided in + * the request. + * + * \return 0 on success or a negative error code on error + */ + /** * \fn PipelineHandler::match(DeviceEnumerator *enumerator) * \brief Match media devices and create camera instances -- cgit v1.2.1