[libcamera-devel] [RFC 3/3] [HACK] libcamera: uvc: set format on v4l2 device

Jacopo Mondi jacopo at jmondi.org
Sat Jan 26 16:13:18 CET 2019


Set the requested format on V4L2 device
Force pixelformat as it is not set by the application.

Signed-off-by: Jacopo Mondi <jacopo at jmondi.org>
---
 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();
 
-- 
2.20.1



More information about the libcamera-devel mailing list