From ac54f2ac6dede6a4d8ed761660c3f74b42a497a3 Mon Sep 17 00:00:00 2001 From: Jacopo Mondi Date: Fri, 15 Jul 2022 14:23:59 +0200 Subject: 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 Reviewed-by: Laurent Pinchart Tested-by: Paul Elder --- src/libcamera/formats.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/libcamera/formats.cpp') diff --git a/src/libcamera/formats.cpp b/src/libcamera/formats.cpp index b760ec0e..4746d38c 100644 --- a/src/libcamera/formats.cpp +++ b/src/libcamera/formats.cpp @@ -785,7 +785,10 @@ const std::map pixelFormatInfo{ { formats::MJPEG, { .name = "MJPEG", .format = formats::MJPEG, - .v4l2Formats = { V4L2PixelFormat(V4L2_PIX_FMT_MJPEG), }, + .v4l2Formats = { + V4L2PixelFormat(V4L2_PIX_FMT_MJPEG), + V4L2PixelFormat(V4L2_PIX_FMT_JPEG), + }, .bitsPerPixel = 0, .colourEncoding = PixelFormatInfo::ColourEncodingYUV, .packed = false, -- cgit v1.2.1