[libcamera-devel] [PATCH 1/2] libcamera: Add support for planar YVU420 format
Jacopo Mondi
jacopo at jmondi.org
Mon Jul 20 10:05:07 CEST 2020
Hi Niklas,
On Sat, Jul 18, 2020 at 04:34:27PM +0200, Niklas Söderlund wrote:
> Add support for planar YVU420.
>
> Signed-off-by: Niklas Söderlund <niklas.soderlund at ragnatech.se>
Looks good!
Reviewed-by: Jacopo Mondi <jacopo at jmondi.org>
Thanks
j
> ---
> src/libcamera/formats.cpp | 10 ++++++++++
> src/libcamera/formats.yaml | 2 ++
> src/libcamera/v4l2_pixelformat.cpp | 1 +
> 3 files changed, 13 insertions(+)
>
> diff --git a/src/libcamera/formats.cpp b/src/libcamera/formats.cpp
> index 3f895a7c2badc34a..8f9bdafe821b2e69 100644
> --- a/src/libcamera/formats.cpp
> +++ b/src/libcamera/formats.cpp
> @@ -407,6 +407,16 @@ const std::map<PixelFormat, PixelFormatInfo> pixelFormatInfo{
> .pixelsPerGroup = 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, {
> .name = "YUV422",
> .format = PixelFormat(formats::YUV422),
> diff --git a/src/libcamera/formats.yaml b/src/libcamera/formats.yaml
> index ce06dbc41aa13f5e..6b5f084bb2e4e970 100644
> --- a/src/libcamera/formats.yaml
> +++ b/src/libcamera/formats.yaml
> @@ -55,6 +55,8 @@ formats:
>
> - YUV420:
> fourcc: DRM_FORMAT_YUV420
> + - YVU420:
> + fourcc: DRM_FORMAT_YVU420
> - YUV422:
> fourcc: DRM_FORMAT_YUV422
>
> diff --git a/src/libcamera/v4l2_pixelformat.cpp b/src/libcamera/v4l2_pixelformat.cpp
> index 6745d17d49269bab..1609f8bb6370fa65 100644
> --- a/src/libcamera/v4l2_pixelformat.cpp
> +++ b/src/libcamera/v4l2_pixelformat.cpp
> @@ -64,6 +64,7 @@ const std::map<V4L2PixelFormat, PixelFormat> vpf2pf{
> { V4L2PixelFormat(V4L2_PIX_FMT_NV12), formats::NV12 },
> { V4L2PixelFormat(V4L2_PIX_FMT_NV21), formats::NV21 },
> { V4L2PixelFormat(V4L2_PIX_FMT_YUV420), formats::YUV420 },
> + { V4L2PixelFormat(V4L2_PIX_FMT_YVU420), formats::YVU420},
> { V4L2PixelFormat(V4L2_PIX_FMT_YUV422P), formats::YUV422 },
>
> /* Greyscale formats. */
> --
> 2.27.0
>
> _______________________________________________
> libcamera-devel mailing list
> libcamera-devel at lists.libcamera.org
> https://lists.libcamera.org/listinfo/libcamera-devel
More information about the libcamera-devel
mailing list