From 6b3f8a78750fb6ad87f15fdecba5c5a49ceaf6e5 Mon Sep 17 00:00:00 2001 From: Laurent Pinchart Date: Sun, 28 Aug 2022 04:42:12 +0300 Subject: pipeline: uvcvideo: Add color space support Add support for color space to the uvcvideo pipeline handler. UVC devices have a fixed color space per format, so only the validate() function needs to be extended to retrieve the color space from the kernel. There is no need to pass the value back to the driver in configure(). Signed-off-by: Laurent Pinchart Reviewed-by: Umang Jain --- src/libcamera/pipeline/uvcvideo/uvcvideo.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src') diff --git a/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp b/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp index 9cbf126a..2ae640a3 100644 --- a/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp +++ b/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp @@ -159,6 +159,11 @@ CameraConfiguration::Status UVCCameraConfiguration::validate() cfg.stride = format.planes[0].bpl; cfg.frameSize = format.planes[0].size; + if (cfg.colorSpace != format.colorSpace) { + cfg.colorSpace = format.colorSpace; + status = Adjusted; + } + return status; } -- cgit v1.2.1