diff options
author | David Plowman <david.plowman@raspberrypi.com> | 2020-06-17 17:44:42 +0100 |
---|---|---|
committer | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2020-06-23 01:39:28 +0300 |
commit | c3ed943c992a09c5fc19e25328dca7aa52691c36 (patch) | |
tree | 83b9846e4f2886d38c7d57b3662f02b5c83ff593 /src/v4l2/v4l2_camera_proxy.cpp | |
parent | 405ba5fd4ab7a53e57eeafe4a458e6db3edf042b (diff) |
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 <david.plowman@raspberrypi.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: David Plowman <david.plowman@raspberrypi.com>
Tested-by: David Plowman <david.plowman@raspberrypi.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Diffstat (limited to 'src/v4l2/v4l2_camera_proxy.cpp')
-rw-r--r-- | src/v4l2/v4l2_camera_proxy.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/v4l2/v4l2_camera_proxy.cpp b/src/v4l2/v4l2_camera_proxy.cpp index bf47aa7e..86b87e37 100644 --- a/src/v4l2/v4l2_camera_proxy.cpp +++ b/src/v4l2/v4l2_camera_proxy.cpp @@ -560,7 +560,7 @@ struct PixelFormatInfo { namespace { -static const std::array<PixelFormatInfo, 14> pixelFormatInfo = {{ +static const std::array<PixelFormatInfo, 16> pixelFormatInfo = {{ /* RGB formats. */ { formats::RGB888, V4L2_PIX_FMT_BGR24, 1, {{ { 24, 1, 1 }, { 0, 0, 0 }, { 0, 0, 0 } }} }, { formats::BGR888, V4L2_PIX_FMT_RGB24, 1, {{ { 24, 1, 1 }, { 0, 0, 0 }, { 0, 0, 0 } }} }, @@ -577,6 +577,8 @@ static const std::array<PixelFormatInfo, 14> pixelFormatInfo = {{ { formats::NV61, V4L2_PIX_FMT_NV61, 2, {{ { 8, 1, 1 }, { 16, 2, 1 }, { 0, 0, 0 } }} }, { formats::NV24, V4L2_PIX_FMT_NV24, 2, {{ { 8, 1, 1 }, { 16, 1, 1 }, { 0, 0, 0 } }} }, { formats::NV42, V4L2_PIX_FMT_NV42, 2, {{ { 8, 1, 1 }, { 16, 1, 1 }, { 0, 0, 0 } }} }, + { formats::YUV420, V4L2_PIX_FMT_YUV420, 3, {{ { 8, 1, 1 }, { 8, 2, 2 }, { 8, 2, 2 } }} }, + { formats::YUV422, V4L2_PIX_FMT_YUV422P, 3, {{ { 8, 1, 1 }, { 8, 2, 1 }, { 8, 2, 1 } }} }, /* Compressed formats. */ /* * \todo Get a better image size estimate for MJPEG, via |