From patchwork Mon Jul 13 13:24:49 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kieran Bingham X-Patchwork-Id: 8768 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id 61AF4BD792 for ; Mon, 13 Jul 2020 13:25:04 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 2B8816073F; Mon, 13 Jul 2020 15:25:04 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="jRyBEv0l"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 02C67605A9 for ; Mon, 13 Jul 2020 15:24:58 +0200 (CEST) Received: from Q.local (cpc89242-aztw30-2-0-cust488.18-1.cable.virginm.net [86.31.129.233]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 83250C9; Mon, 13 Jul 2020 15:24:58 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1594646698; bh=FbRWsciGPZY8ETGVLpH4mHsCr8sdLC6Oh1CXcxMmp/M=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jRyBEv0lD45sKv+TkJ3tmnIN/OyTW4YZSigHQ3vuz3vlrOloi38xePYZt05JWmDkO Hpb0G3/Ow0Uzt1Ws0+/gBqpQSVA8sgEEPoxCA6oBN3LZ1yWKFysdisTCJVB5AnPtz6 /tiehav0mOJpgoiEQsqS3o/KIXNPDbW5u3whwEjo= From: Kieran Bingham To: libcamera devel Date: Mon, 13 Jul 2020 14:24:49 +0100 Message-Id: <20200713132451.2944673-8-kieran.bingham@ideasonboard.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200713132451.2944673-1-kieran.bingham@ideasonboard.com> References: <20200713132451.2944673-1-kieran.bingham@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 7/9] libcamera: pipeline: vivid: Queue requeusts X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Chris Ward Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" 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 --- 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)