summaryrefslogtreecommitdiff
path: root/src/libcamera/pipeline_handler.cpp
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2020-03-14 16:14:27 +0200
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2020-03-18 19:15:18 +0200
commit9da27d5d844fa1378a4897a637c45ade275cc7e5 (patch)
tree712a781b2134e53130bed0477e6370ad65677ecc /src/libcamera/pipeline_handler.cpp
parent7d8604128ab0f11da459fdb43fd8366620afe7f5 (diff)
libcamera: pipeline_handler: Decouple buffer import and export
Use the V4L2 buffer orphaning feature, exposed through V4L2VideoDevice::exportBuffers(), to decouple buffer import and export. The PipelineHandler::importFrameBuffers() function is now called for all streams regardless of whether exportFrameBuffers() has been called or not. This simplifies the Camera implementation slightly, and opens the door to additional simplifications. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Diffstat (limited to 'src/libcamera/pipeline_handler.cpp')
-rw-r--r--src/libcamera/pipeline_handler.cpp25
1 files changed, 5 insertions, 20 deletions
diff --git a/src/libcamera/pipeline_handler.cpp b/src/libcamera/pipeline_handler.cpp
index 8d623f54..e5034c54 100644
--- a/src/libcamera/pipeline_handler.cpp
+++ b/src/libcamera/pipeline_handler.cpp
@@ -337,16 +337,7 @@ const ControlList &PipelineHandler::properties(Camera *camera)
*
* 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().
- *
- * exportFrameBuffers() shall also allocate all other resources required by
- * the pipeline handler for the stream to prepare for starting the Camera. This
- * responsibility is shared with importFrameBuffers(), and one and only one of
- * those two methods shall be called for each stream until the buffers are
- * freed. The pipeline handler shall support all combinations of
- * exportFrameBuffers() and importFrameBuffers() for the streams contained in
- * any camera configuration.
+ * streams that are part of the active camera configuration.
*
* The only intended caller is Camera::exportFrameBuffers().
*
@@ -371,12 +362,7 @@ const ControlList &PipelineHandler::properties(Camera *camera)
* 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. This
- * responsibility is shared with exportFrameBuffers(), and one and only one of
- * those two methods shall be called for each stream until the buffers are
- * freed. The pipeline handler shall support all combinations of
- * exportFrameBuffers() and importFrameBuffers() for the streams contained in
- * any camera configuration.
+ * pipeline handler for the stream to prepare for starting the Camera.
*
* The only intended caller is Camera::start().
*
@@ -391,10 +377,9 @@ const ControlList &PipelineHandler::properties(Camera *camera)
* \param[in] camera The camera
* \param[in] stream The stream to free buffers for
*
- * This method shall free all buffers and all other resources allocated for the
- * \a stream by exportFrameBuffers() or importFrameBuffers(). It shall be
- * called only after a successful call to either of these two methods, and only
- * once per stream.
+ * 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().
*