summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacopo Mondi <jacopo@jmondi.org>2022-07-15 14:23:59 +0200
committerJacopo Mondi <jacopo@jmondi.org>2022-07-23 11:41:20 +0200
commitbeec73a0fa5fc8d8ba0dcad5fdb32422084c5451 (patch)
tree35866716ab7542db8a30e51aeb2686138a9063ea
parent6aa6d57e8166ab8698ec43e62a271a5da9ce72d9 (diff)
libcamera: formats: Map V4L2_PIX_FMT_JPEG to formats::MJPEG
The V4L2_PIX_FMT_JPEG and V4L2_PIX_FMT_MJPEG formats are under-specified and are used interchangeably by kernel drivers. Map both of them to formats::MJPEG and use the newly re-introduced V4L2VideoDevice::toV4L2PixelFormat() to map to the one actually used by the video device. Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
-rw-r--r--src/libcamera/formats.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/libcamera/formats.cpp b/src/libcamera/formats.cpp
index 86fc698a..564ccc1b 100644
--- a/src/libcamera/formats.cpp
+++ b/src/libcamera/formats.cpp
@@ -948,7 +948,10 @@ const std::map<PixelFormat, PixelFormatInfo> pixelFormatInfo{
.name = "MJPEG",
.format = formats::MJPEG,
.v4l2Formats = {
- .single = { V4L2PixelFormat(V4L2_PIX_FMT_MJPEG) },
+ .single = {
+ V4L2PixelFormat(V4L2_PIX_FMT_MJPEG),
+ V4L2PixelFormat(V4L2_PIX_FMT_JPEG),
+ },
.multi = { V4L2PixelFormat() },
},
.bitsPerPixel = 0,