From 29fce0c5d9dc8860f0ee3f740f667ff024e07e70 Mon Sep 17 00:00:00 2001 From: Kieran Bingham Date: Mon, 13 Jul 2020 11:35:11 +0100 Subject: libcamera: pipeline: vivid: Queue requests When a request 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 --- 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 17c09b12..ed9baa04 100644 --- a/src/libcamera/pipeline/vivid/vivid.cpp +++ b/src/libcamera/pipeline/vivid/vivid.cpp @@ -216,7 +216,20 @@ void PipelineHandlerVivid::stopDevice(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) -- cgit v1.2.1