From patchwork Tue Feb 5 00:07:01 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Niklas_S=C3=B6derlund?= X-Patchwork-Id: 509 X-Patchwork-Delegate: niklas.soderlund@ragnatech.se Return-Path: Received: from vsp-unauthed02.binero.net (vsp-unauthed02.binero.net [195.74.38.227]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id BEAFA60DCB for ; Tue, 5 Feb 2019 01:07:59 +0100 (CET) X-Halon-ID: 1708876c-28da-11e9-b530-005056917a89 Authorized-sender: niklas@soderlund.pp.se Received: from localhost.localdomain (unknown [81.164.19.127]) by bin-vsp-out-01.atm.binero.net (Halon) with ESMTPA id 1708876c-28da-11e9-b530-005056917a89; Tue, 05 Feb 2019 01:07:56 +0100 (CET) From: =?utf-8?q?Niklas_S=C3=B6derlund?= To: libcamera-devel@lists.libcamera.org Date: Tue, 5 Feb 2019 01:07:01 +0100 Message-Id: <20190205000702.15370-7-niklas.soderlund@ragnatech.se> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190205000702.15370-1-niklas.soderlund@ragnatech.se> References: <20190205000702.15370-1-niklas.soderlund@ragnatech.se> MIME-Version: 1.0 Subject: [libcamera-devel] [RFC 6/7] libcamera: pipeline: uvcvideo: Add queueRequest support X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Feb 2019 00:08:00 -0000 From: Kieran Bingham Extract the buffer from the Request bufferMap. The uvcvideo only supports a single stream and so expects only a single buffer to queue. Queue the retrieved buffer with the video device for processing. Signed-off-by: Kieran Bingham --- src/libcamera/pipeline/uvcvideo.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/libcamera/pipeline/uvcvideo.cpp b/src/libcamera/pipeline/uvcvideo.cpp index 3685dbf9d19c3d7d..632a4b4b09189240 100644 --- a/src/libcamera/pipeline/uvcvideo.cpp +++ b/src/libcamera/pipeline/uvcvideo.cpp @@ -6,6 +6,7 @@ */ #include +#include #include #include "device_enumerator.h" @@ -126,6 +127,19 @@ void PipelineHandlerUVC::stop(const Camera *camera) int PipelineHandlerUVC::queueRequest(const Camera *camera, Request *request) { + /* Set any controls, queue any buffers */ + + if (request->bufferMap.find(&stream_) == request->bufferMap.end()) { + LOG(UVC, Error) + << "Attempt to queue request with invalid stream"; + + return -ENOENT; + } + + Buffer *buffer = request->bufferMap[&stream_]; + + video_->queueBuffer(buffer); + return 0; }