[libcamera-devel] [PATCH v8 6/8] libcamera: ipu3: Queue requests for multiple streams
Jacopo Mondi
jacopo at jmondi.org
Fri Apr 19 15:25:29 CEST 2019
Add support for queueing requests for multiple streams in the IPU3
pipeline handler class.
Reviewed-by: Laurent Pinchart <laurent.pinchart at ideasonboard.com>
Signed-off-by: Jacopo Mondi <jacopo at jmondi.org>
---
src/libcamera/pipeline/ipu3/ipu3.cpp | 23 +++++++++--------------
1 file changed, 9 insertions(+), 14 deletions(-)
diff --git a/src/libcamera/pipeline/ipu3/ipu3.cpp b/src/libcamera/pipeline/ipu3/ipu3.cpp
index 3f1f1bc8644f..f71227c6c408 100644
--- a/src/libcamera/pipeline/ipu3/ipu3.cpp
+++ b/src/libcamera/pipeline/ipu3/ipu3.cpp
@@ -576,25 +576,20 @@ void PipelineHandlerIPU3::stop(Camera *camera)
int PipelineHandlerIPU3::queueRequest(Camera *camera, Request *request)
{
- IPU3CameraData *data = cameraData(camera);
- V4L2Device *output = data->imgu_->output_.dev;
- IPU3Stream *stream = &data->outStream_;
+ int error = 0;
- /* Queue a buffer to the ImgU output for capture. */
- Buffer *buffer = request->findBuffer(stream);
- if (!buffer) {
- LOG(IPU3, Error)
- << "Attempt to queue request with invalid stream";
- return -ENOENT;
- }
+ for (auto it : request->buffers()) {
+ IPU3Stream *stream = static_cast<IPU3Stream *>(it.first);
+ Buffer *buffer = it.second;
- int ret = output->queueBuffer(buffer);
- if (ret < 0)
- return ret;
+ int ret = stream->device_->dev->queueBuffer(buffer);
+ if (ret < 0)
+ error = ret;
+ }
PipelineHandler::queueRequest(camera, request);
- return 0;
+ return error;
}
bool PipelineHandlerIPU3::match(DeviceEnumerator *enumerator)
--
2.21.0
More information about the libcamera-devel
mailing list