libcamera: Add support for planar YVU420 format

Add support for planar YVU420.

Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
This commit is contained in:
Niklas Söderlund 2020-07-18 16:13:21 +02:00
parent 3e7aa49344
commit 7855dc922f
3 changed files with 13 additions and 0 deletions

View file

@ -407,6 +407,16 @@ const std::map<PixelFormat, PixelFormatInfo> pixelFormatInfo{
.pixelsPerGroup = 2, .pixelsPerGroup = 2,
.planes = {{ { 2, 1 }, { 1, 2 }, { 1, 2 } }}, .planes = {{ { 2, 1 }, { 1, 2 }, { 1, 2 } }},
} }, } },
{ formats::YVU420, {
.name = "YVU420",
.format = PixelFormat(formats::YVU420),
.v4l2Format = V4L2PixelFormat(V4L2_PIX_FMT_YVU420),
.bitsPerPixel = 12,
.colourEncoding = PixelFormatInfo::ColourEncodingYUV,
.packed = false,
.pixelsPerGroup = 2,
.planes = {{ { 2, 1 }, { 1, 2 }, { 1, 2 } }},
} },
{ formats::YUV422, { { formats::YUV422, {
.name = "YUV422", .name = "YUV422",
.format = PixelFormat(formats::YUV422), .format = PixelFormat(formats::YUV422),

View file

@ -55,6 +55,8 @@ formats:
- YUV420: - YUV420:
fourcc: DRM_FORMAT_YUV420 fourcc: DRM_FORMAT_YUV420
- YVU420:
fourcc: DRM_FORMAT_YVU420
- YUV422: - YUV422:
fourcc: DRM_FORMAT_YUV422 fourcc: DRM_FORMAT_YUV422

View file

@ -64,6 +64,7 @@ const std::map<V4L2PixelFormat, PixelFormat> vpf2pf{
{ V4L2PixelFormat(V4L2_PIX_FMT_NV12), formats::NV12 }, { V4L2PixelFormat(V4L2_PIX_FMT_NV12), formats::NV12 },
{ V4L2PixelFormat(V4L2_PIX_FMT_NV21), formats::NV21 }, { V4L2PixelFormat(V4L2_PIX_FMT_NV21), formats::NV21 },
{ V4L2PixelFormat(V4L2_PIX_FMT_YUV420), formats::YUV420 }, { V4L2PixelFormat(V4L2_PIX_FMT_YUV420), formats::YUV420 },
{ V4L2PixelFormat(V4L2_PIX_FMT_YVU420), formats::YVU420 },
{ V4L2PixelFormat(V4L2_PIX_FMT_YUV422P), formats::YUV422 }, { V4L2PixelFormat(V4L2_PIX_FMT_YUV422P), formats::YUV422 },
/* Greyscale formats. */ /* Greyscale formats. */