From patchwork Sat Jan 26 15:13:18 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jacopo Mondi X-Patchwork-Id: 404 X-Patchwork-Delegate: jacopo@jmondi.org Return-Path: Received: from relay11.mail.gandi.net (relay11.mail.gandi.net [217.70.178.231]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id DD25060C80 for ; Sat, 26 Jan 2019 16:13:14 +0100 (CET) Received: from uno.homenet.telecomitalia.it (host20-49-dynamic.18-79-r.retail.telecomitalia.it [79.18.49.20]) (Authenticated sender: jacopo@jmondi.org) by relay11.mail.gandi.net (Postfix) with ESMTPSA id 54698100006; Sat, 26 Jan 2019 15:13:14 +0000 (UTC) From: Jacopo Mondi To: libcamera-devel@lists.libcamera.org Date: Sat, 26 Jan 2019 16:13:18 +0100 Message-Id: <20190126151318.28087-4-jacopo@jmondi.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190126151318.28087-1-jacopo@jmondi.org> References: <20190126151318.28087-1-jacopo@jmondi.org> MIME-Version: 1.0 Subject: [libcamera-devel] [RFC 3/3] [HACK] libcamera: uvc: set format on v4l2 device 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: Sat, 26 Jan 2019 15:13:15 -0000 Set the requested format on V4L2 device Force pixelformat as it is not set by the application. Signed-off-by: Jacopo Mondi --- src/libcamera/pipeline/uvcvideo.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/libcamera/pipeline/uvcvideo.cpp b/src/libcamera/pipeline/uvcvideo.cpp index ecc621e..2cf325b 100644 --- a/src/libcamera/pipeline/uvcvideo.cpp +++ b/src/libcamera/pipeline/uvcvideo.cpp @@ -78,6 +78,9 @@ int PipelineHandlerUVC::configure(const Camera *camera, if (!cfg || cfg->id() != 0) return -EINVAL; + cfg->setPixelFormat(V4L2_PIX_FMT_YUYV); + v4l2dev_->setFormat(cfg); + LOG(UVC, Info) << "TODO: Configure the camera for resolution " << cfg->width() << "x" << cfg->height();