From 9f2bf7ba1e3e2647605da8bbc23d63fc0a4fb1c2 Mon Sep 17 00:00:00 2001 From: Jacopo Mondi Date: Tue, 19 Mar 2019 16:27:14 +0100 Subject: libcamera: ipu3: Queue requests for multiple streams Add support for queueing requests for multiple streams in the IPU3 pipeline handler class. Reviewed-by: Laurent Pinchart Signed-off-by: Jacopo Mondi --- 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 fad7f140..73e06a91 100644 --- a/src/libcamera/pipeline/ipu3/ipu3.cpp +++ b/src/libcamera/pipeline/ipu3/ipu3.cpp @@ -577,25 +577,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(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) -- cgit v1.2.1