[libcamera-devel] [PATCH 7/9] libcamera: pipeline: vivid: Queue requeusts

Kieran Bingham kieran.bingham at ideasonboard.com
Mon Jul 13 15:24:49 CEST 2020


When a reqeust is given to a pipeline handler, it must parse the request
and identify what actions the pipeline handler should take to enact on hardware.

In the case of the VIVID pipeline handler, we identify the buffer from the only
supported stream, and queue it to the video capture device.

Signed-off-by: Kieran Bingham <kieran.bingham at ideasonboard.com>
---
 src/libcamera/pipeline/vivid/vivid.cpp | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

diff --git a/src/libcamera/pipeline/vivid/vivid.cpp b/src/libcamera/pipeline/vivid/vivid.cpp
index 1a945a744055..4362e73f49a5 100644
--- a/src/libcamera/pipeline/vivid/vivid.cpp
+++ b/src/libcamera/pipeline/vivid/vivid.cpp
@@ -210,7 +210,20 @@ void PipelineHandlerVivid::stop(Camera *camera)
 
 int PipelineHandlerVivid::queueRequestDevice(Camera *camera, Request *request)
 {
-	return -1;
+	VividCameraData *data = cameraData(camera);
+	FrameBuffer *buffer = request->findBuffer(&data->stream_);
+	if (!buffer) {
+		LOG(VIVID, Error)
+			<< "Attempt to queue request with invalid stream";
+
+		return -ENOENT;
+	}
+
+	int ret = data->video_->queueBuffer(buffer);
+	if (ret < 0)
+		return ret;
+
+	return 0;
 }
 
 bool PipelineHandlerVivid::match(DeviceEnumerator *enumerator)
-- 
2.25.1



More information about the libcamera-devel mailing list