summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNiklas Söderlund <niklas.soderlund@ragnatech.se>2020-07-18 16:13:21 +0200
committerNiklas Söderlund <niklas.soderlund@ragnatech.se>2020-07-21 14:19:09 +0200
commit7855dc922f789a30930f777b062d630d38391ba0 (patch)
tree57ff1f4b9ff7dec6ce633e2ca3f94d433543ffa1
parent3e7aa49344ad5233f644703559898572b57f9613 (diff)
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>
-rw-r--r--src/libcamera/formats.cpp10
-rw-r--r--src/libcamera/formats.yaml2
-rw-r--r--src/libcamera/v4l2_pixelformat.cpp1
3 files changed, 13 insertions, 0 deletions
diff --git a/src/libcamera/formats.cpp b/src/libcamera/formats.cpp
index 3f895a7c..8f9bdafe 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 ce06dbc4..6b5f084b 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 6745d17d..2ebc1f18 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. */