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

Message ID 20190126151318.28087-4-jacopo@jmondi.org
State Superseded
Delegated to: Jacopo Mondi
Headers show
Series
  • v4l2-device: set and get format
Related show

Commit Message

Jacopo Mondi Jan. 26, 2019, 3:13 p.m. UTC
Set the requested format on V4L2 device
Force pixelformat as it is not set by the application.

Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
---
 src/libcamera/pipeline/uvcvideo.cpp | 3 +++
 1 file changed, 3 insertions(+)

Patch

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();