From a03ce60cf969b7b26b25c785f64cb5662635b702 Mon Sep 17 00:00:00 2001 From: Laurent Pinchart Date: Sun, 4 Sep 2022 02:03:53 +0300 Subject: libcamera: v4l2_device: Map YCbCrEncoding::None to V4L2 The ycbcrEncodingToV4l2 map is missing the YCbCrEncoding::None encoding, which results in a failure of V4L2Device::fromColorSpace() to convert color spaces from libcamera to V4L2 for RGB formats. Fix it by adding the missing encoding. As V4L2 has no such encoding, use V4L2_YCBCR_ENC_DEFAULT as the value doesn't matter. Signed-off-by: Laurent Pinchart Reviewed-by: Paul Elder Reviewed-by: Umang Jain --- src/libcamera/v4l2_device.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/libcamera/v4l2_device.cpp') diff --git a/src/libcamera/v4l2_device.cpp b/src/libcamera/v4l2_device.cpp index 1d899657..7f251bd8 100644 --- a/src/libcamera/v4l2_device.cpp +++ b/src/libcamera/v4l2_device.cpp @@ -796,6 +796,8 @@ static const std::map transferFunc }; static const std::map ycbcrEncodingToV4l2 = { + /* V4L2 has no "none" encoding. */ + { ColorSpace::YcbcrEncoding::None, V4L2_YCBCR_ENC_DEFAULT }, { ColorSpace::YcbcrEncoding::Rec601, V4L2_YCBCR_ENC_601 }, { ColorSpace::YcbcrEncoding::Rec709, V4L2_YCBCR_ENC_709 }, { ColorSpace::YcbcrEncoding::Rec2020, V4L2_YCBCR_ENC_BT2020 }, -- cgit v1.2.1