From c3ed943c992a09c5fc19e25328dca7aa52691c36 Mon Sep 17 00:00:00 2001 From: David Plowman Date: Wed, 17 Jun 2020 17:44:42 +0100 Subject: libcamera: Add support for planar YUV422 and YUV420 formats These formats can be helpful when downstream applications or libraries support them natively (avoiding a costly conversion). Signed-off-by: David Plowman Signed-off-by: Laurent Pinchart Reviewed-by: David Plowman Tested-by: David Plowman Reviewed-by: Kieran Bingham --- src/libcamera/formats.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/libcamera/formats.cpp') diff --git a/src/libcamera/formats.cpp b/src/libcamera/formats.cpp index 97e98678..c0b53ce7 100644 --- a/src/libcamera/formats.cpp +++ b/src/libcamera/formats.cpp @@ -270,6 +270,20 @@ const std::map pixelFormatInfo{ .colourEncoding = PixelFormatInfo::ColourEncodingYUV, .packed = false, } }, + { formats::YUV420, { + .format = PixelFormat(formats::YUV420), + .v4l2Format = V4L2PixelFormat(V4L2_PIX_FMT_YUV420), + .bitsPerPixel = 12, + .colourEncoding = PixelFormatInfo::ColourEncodingYUV, + .packed = false, + } }, + { formats::YUV422, { + .format = PixelFormat(formats::YUV422), + .v4l2Format = V4L2PixelFormat(V4L2_PIX_FMT_YUV422P), + .bitsPerPixel = 16, + .colourEncoding = PixelFormatInfo::ColourEncodingYUV, + .packed = false, + } }, /* Greyscale formats. */ { formats::R8, { -- cgit v1.2.1