summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/libcamera/formats.cpp10
-rw-r--r--src/libcamera/formats.yaml3
-rw-r--r--src/libcamera/v4l2_pixelformat.cpp1
3 files changed, 14 insertions, 0 deletions
diff --git a/src/libcamera/formats.cpp b/src/libcamera/formats.cpp
index 8f9bdafe..af3996c9 100644
--- a/src/libcamera/formats.cpp
+++ b/src/libcamera/formats.cpp
@@ -233,6 +233,16 @@ const PixelFormatInfo pixelFormatInfoInvalid{};
const std::map<PixelFormat, PixelFormatInfo> pixelFormatInfo{
/* RGB formats. */
+ { formats::RGB565, {
+ .name = "RGB565",
+ .format = formats::RGB565,
+ .v4l2Format = V4L2PixelFormat(V4L2_PIX_FMT_RGB565),
+ .bitsPerPixel = 16,
+ .colourEncoding = PixelFormatInfo::ColourEncodingRGB,
+ .packed = false,
+ .pixelsPerGroup = 1,
+ .planes = {{ { 3, 1 }, { 0, 0 }, { 0, 0 } }},
+ } },
{ formats::BGR888, {
.name = "BGR888",
.format = formats::BGR888,
diff --git a/src/libcamera/formats.yaml b/src/libcamera/formats.yaml
index 6b5f084b..3a69c05f 100644
--- a/src/libcamera/formats.yaml
+++ b/src/libcamera/formats.yaml
@@ -8,6 +8,9 @@ formats:
- R8:
fourcc: DRM_FORMAT_R8
+ - RGB565:
+ fourcc: DRM_FORMAT_RGB565
+
- RGB888:
fourcc: DRM_FORMAT_RGB888
- BGR888:
diff --git a/src/libcamera/v4l2_pixelformat.cpp b/src/libcamera/v4l2_pixelformat.cpp
index 2ebc1f18..c8f69ee9 100644
--- a/src/libcamera/v4l2_pixelformat.cpp
+++ b/src/libcamera/v4l2_pixelformat.cpp
@@ -45,6 +45,7 @@ namespace {
const std::map<V4L2PixelFormat, PixelFormat> vpf2pf{
/* RGB formats. */
+ { V4L2PixelFormat(V4L2_PIX_FMT_RGB565), formats::RGB565 },
{ V4L2PixelFormat(V4L2_PIX_FMT_RGB24), formats::BGR888 },
{ V4L2PixelFormat(V4L2_PIX_FMT_BGR24), formats::RGB888 },
{ V4L2PixelFormat(V4L2_PIX_FMT_RGBA32), formats::ABGR8888 },