@@ -91,9 +91,16 @@ PipelineHandlerUVC::streamConfiguration(Camera *camera,
UVCCameraData *data = cameraData(camera);
CameraConfiguration config;
StreamConfiguration cfg{};
+ V4L2DeviceFormat format;
- cfg.pixelFormat = V4L2_PIX_FMT_YUYV;
- cfg.size = { 640, 480 };
+ format.fourcc = V4L2_PIX_FMT_YUYV;
+ format.size = { 1920, 1080 };
+
+ /* Ask the video device to confirm a suitable default configuration. */
+ data->video_->tryFormat(&format);
+
+ cfg.size = format.size;
+ cfg.pixelFormat = format.fourcc;
cfg.bufferCount = 4;
config[&data->stream_] = cfg;
We can not predict a suitable default for a UVC camera as they are so varied. Take a starting point as a default configuration and test it against the device with the tryFormat call. The camera will return the closest supported format from that configuration. Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com> --- src/libcamera/pipeline/uvcvideo.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-)