[libcamera-devel] [PATCH 04/13] libcamera: formats: Add AVUY8888 and XVUY8888 formats
Laurent Pinchart
laurent.pinchart at ideasonboard.com
Mon Aug 1 02:05:34 CEST 2022
Add missing 32-bit packet YUV 4:4:4 formats. These formats are used by
the i.MX8 ISI driver.
Signed-off-by: Laurent Pinchart <laurent.pinchart at ideasonboard.com>
---
src/libcamera/formats.cpp | 26 ++++++++++++++++++++++++++
src/libcamera/formats.yaml | 4 ++++
src/libcamera/v4l2_pixelformat.cpp | 4 ++++
3 files changed, 34 insertions(+)
diff --git a/src/libcamera/formats.cpp b/src/libcamera/formats.cpp
index 283ecb3d89d8..24739c01c928 100644
--- a/src/libcamera/formats.cpp
+++ b/src/libcamera/formats.cpp
@@ -363,6 +363,32 @@ const std::map<PixelFormat, PixelFormatInfo> pixelFormatInfo{
.pixelsPerGroup = 2,
.planes = {{ { 4, 1 }, { 0, 0 }, { 0, 0 } }},
} },
+ { formats::AVUY8888, {
+ .name = "AVUY8888",
+ .format = formats::AVUY8888,
+ .v4l2Formats = {
+ .single = V4L2PixelFormat(V4L2_PIX_FMT_YUVA32),
+ .multi = V4L2PixelFormat(),
+ },
+ .bitsPerPixel = 32,
+ .colourEncoding = PixelFormatInfo::ColourEncodingYUV,
+ .packed = false,
+ .pixelsPerGroup = 1,
+ .planes = {{ { 4, 1 }, { 0, 0 }, { 0, 0 } }},
+ } },
+ { formats::XVUY8888, {
+ .name = "XVUY8888",
+ .format = formats::XVUY8888,
+ .v4l2Formats = {
+ .single = V4L2PixelFormat(V4L2_PIX_FMT_YUVX32),
+ .multi = V4L2PixelFormat(),
+ },
+ .bitsPerPixel = 32,
+ .colourEncoding = PixelFormatInfo::ColourEncodingYUV,
+ .packed = false,
+ .pixelsPerGroup = 1,
+ .planes = {{ { 4, 1 }, { 0, 0 }, { 0, 0 } }},
+ } },
/* YUV planar formats. */
{ formats::NV12, {
diff --git a/src/libcamera/formats.yaml b/src/libcamera/formats.yaml
index 7dda01325f33..d3fbf5f47211 100644
--- a/src/libcamera/formats.yaml
+++ b/src/libcamera/formats.yaml
@@ -49,6 +49,10 @@ formats:
fourcc: DRM_FORMAT_UYVY
- VYUY:
fourcc: DRM_FORMAT_VYUY
+ - AVUY8888:
+ fourcc: DRM_FORMAT_AVUY8888
+ - XVUY8888:
+ fourcc: DRM_FORMAT_XVUY8888
- NV12:
fourcc: DRM_FORMAT_NV12
diff --git a/src/libcamera/v4l2_pixelformat.cpp b/src/libcamera/v4l2_pixelformat.cpp
index bdcdc3be4e0c..53ac9399130a 100644
--- a/src/libcamera/v4l2_pixelformat.cpp
+++ b/src/libcamera/v4l2_pixelformat.cpp
@@ -81,6 +81,10 @@ const std::map<V4L2PixelFormat, V4L2PixelFormat::Info> vpf2pf{
{ formats::UYVY, "UYVY 4:2:2" } },
{ V4L2PixelFormat(V4L2_PIX_FMT_VYUY),
{ formats::VYUY, "VYUY 4:2:2" } },
+ { V4L2PixelFormat(V4L2_PIX_FMT_YUVA32),
+ { formats::AVUY8888, "32-bit YUVA 8-8-8-8" } },
+ { V4L2PixelFormat(V4L2_PIX_FMT_YUVX32),
+ { formats::XVUY8888, "32-bit YUVX 8-8-8-8" } },
/* YUV planar formats. */
{ V4L2PixelFormat(V4L2_PIX_FMT_NV16),
--
Regards,
Laurent Pinchart
More information about the libcamera-devel
mailing list