summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2022-05-02 05:21:53 +0300
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2022-06-03 17:56:31 +0300
commit111f9f5af2d5c9bae8a93d52153f98242674458f (patch)
tree8c0baecf99b61b70b579b1ae306e186d667e5148
parentdfcf638a0a6d26dbfab5348e646e5cb3c45ec51e (diff)
libcamera: formats: Add YVU422 pixel format
The YVU422 pixel format is defined in both DRM and V4L2. libcamera already supports YUV422, add support for the opposite chroma order. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org> Reviewed-by: Umang Jain <umang.jain@ideasonboard.com>
-rw-r--r--src/libcamera/formats.cpp13
-rw-r--r--src/libcamera/formats.yaml2
-rw-r--r--src/libcamera/v4l2_pixelformat.cpp2
3 files changed, 17 insertions, 0 deletions
diff --git a/src/libcamera/formats.cpp b/src/libcamera/formats.cpp
index a4f27cd4..edfc852c 100644
--- a/src/libcamera/formats.cpp
+++ b/src/libcamera/formats.cpp
@@ -482,6 +482,19 @@ const std::map<PixelFormat, PixelFormatInfo> pixelFormatInfo{
.pixelsPerGroup = 2,
.planes = {{ { 2, 1 }, { 1, 1 }, { 1, 1 } }},
} },
+ { formats::YVU422, {
+ .name = "YVU422",
+ .format = formats::YVU422,
+ .v4l2Formats = {
+ .single = V4L2PixelFormat(),
+ .multi = V4L2PixelFormat(V4L2_PIX_FMT_YVU422M),
+ },
+ .bitsPerPixel = 16,
+ .colourEncoding = PixelFormatInfo::ColourEncodingYUV,
+ .packed = false,
+ .pixelsPerGroup = 2,
+ .planes = {{ { 2, 1 }, { 1, 1 }, { 1, 1 } }},
+ } },
/* Greyscale formats. */
{ formats::R8, {
diff --git a/src/libcamera/formats.yaml b/src/libcamera/formats.yaml
index 1f3f0433..0b527dbe 100644
--- a/src/libcamera/formats.yaml
+++ b/src/libcamera/formats.yaml
@@ -69,6 +69,8 @@ formats:
fourcc: DRM_FORMAT_YVU420
- YUV422:
fourcc: DRM_FORMAT_YUV422
+ - YVU422:
+ fourcc: DRM_FORMAT_YVU422
- MJPEG:
fourcc: DRM_FORMAT_MJPEG
diff --git a/src/libcamera/v4l2_pixelformat.cpp b/src/libcamera/v4l2_pixelformat.cpp
index 0b980a97..bbada052 100644
--- a/src/libcamera/v4l2_pixelformat.cpp
+++ b/src/libcamera/v4l2_pixelformat.cpp
@@ -115,6 +115,8 @@ const std::map<V4L2PixelFormat, V4L2PixelFormat::Info> vpf2pf{
{ formats::YUV422, "Planar YUV 4:2:2" } },
{ V4L2PixelFormat(V4L2_PIX_FMT_YUV422M),
{ formats::YUV422, "Planar YUV 4:2:2 (N-C)" } },
+ { V4L2PixelFormat(V4L2_PIX_FMT_YVU422M),
+ { formats::YVU422, "Planar YVU 4:2:2 (N-C)" } },
/* Greyscale formats. */
{ V4L2PixelFormat(V4L2_PIX_FMT_GREY),