summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Elder <paul.elder@ideasonboard.com>2020-06-29 21:56:42 +0900
committerPaul Elder <paul.elder@ideasonboard.com>2020-07-10 16:10:50 +0900
commitf827c6363d19cf3514aa32e6604f9b3391a9a8dc (patch)
tree8373eeba962fd5b49b726e34c8027a5b10c09e3f
parent271d048b2d30291bb7c002f7064b0691028382bf (diff)
libcamera: formats: Add NV24 and NV42, and reorder NV formats
Add formats for NV24 and NV42. While at it, reorder the NV formats so that NV12 and NV21 come first, followed by NV16, NV61, NV24, and NV42. Signed-off-by: Paul Elder <paul.elder@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
-rw-r--r--src/libcamera/formats.cpp36
1 files changed, 26 insertions, 10 deletions
diff --git a/src/libcamera/formats.cpp b/src/libcamera/formats.cpp
index 436672e8..d3b722c2 100644
--- a/src/libcamera/formats.cpp
+++ b/src/libcamera/formats.cpp
@@ -256,6 +256,22 @@ const std::map<PixelFormat, PixelFormatInfo> pixelFormatInfo{
} },
/* YUV planar formats. */
+ { formats::NV12, {
+ .name = "NV12",
+ .format = formats::NV12,
+ .v4l2Format = V4L2PixelFormat(V4L2_PIX_FMT_NV12),
+ .bitsPerPixel = 12,
+ .colourEncoding = PixelFormatInfo::ColourEncodingYUV,
+ .packed = false,
+ } },
+ { formats::NV21, {
+ .name = "NV21",
+ .format = formats::NV21,
+ .v4l2Format = V4L2PixelFormat(V4L2_PIX_FMT_NV21),
+ .bitsPerPixel = 12,
+ .colourEncoding = PixelFormatInfo::ColourEncodingYUV,
+ .packed = false,
+ } },
{ formats::NV16, {
.name = "NV16",
.format = formats::NV16,
@@ -272,19 +288,19 @@ const std::map<PixelFormat, PixelFormatInfo> pixelFormatInfo{
.colourEncoding = PixelFormatInfo::ColourEncodingYUV,
.packed = false,
} },
- { formats::NV12, {
- .name = "NV12",
- .format = formats::NV12,
- .v4l2Format = V4L2PixelFormat(V4L2_PIX_FMT_NV12),
- .bitsPerPixel = 12,
+ { formats::NV24, {
+ .name = "NV24",
+ .format = formats::NV24,
+ .v4l2Format = V4L2PixelFormat(V4L2_PIX_FMT_NV24),
+ .bitsPerPixel = 24,
.colourEncoding = PixelFormatInfo::ColourEncodingYUV,
.packed = false,
} },
- { formats::NV21, {
- .name = "NV21",
- .format = formats::NV21,
- .v4l2Format = V4L2PixelFormat(V4L2_PIX_FMT_NV21),
- .bitsPerPixel = 12,
+ { formats::NV42, {
+ .name = "NV42",
+ .format = formats::NV42,
+ .v4l2Format = V4L2PixelFormat(V4L2_PIX_FMT_NV42),
+ .bitsPerPixel = 24,
.colourEncoding = PixelFormatInfo::ColourEncodingYUV,
.packed = false,
} },