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 <laurent.pinchart@ideasonboard.com>
Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
Reviewed-by: Umang Jain <umang.jain@ideasonboard.com>
This commit is contained in:
Laurent Pinchart 2022-09-04 02:03:53 +03:00
parent d182a99e7b
commit a03ce60cf9

View file

@ -796,6 +796,8 @@ static const std::map<ColorSpace::TransferFunction, v4l2_xfer_func> transferFunc
};
static const std::map<ColorSpace::YcbcrEncoding, v4l2_ycbcr_encoding> 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 },