From 4e3d152d1e68d68b5254668ac8113d7e72adc590 Mon Sep 17 00:00:00 2001 From: Paul Elder Date: Wed, 8 Sep 2021 16:53:23 +0900 Subject: v4l2: v4l2_camera_proxy: Set the compressed flag in enum_fmt Set the compressed flag in ENUM_FMT if the format is MJPEG. As the only compressed format that libcamera currently supports is MJPEG, this should be sufficient. Signed-off-by: Paul Elder Reviewed-by: Laurent Pinchart Reviewed-by: Jean-Michel Hautbois --- src/v4l2/v4l2_camera_proxy.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/v4l2/v4l2_camera_proxy.cpp') diff --git a/src/v4l2/v4l2_camera_proxy.cpp b/src/v4l2/v4l2_camera_proxy.cpp index abb30820..3610e63c 100644 --- a/src/v4l2/v4l2_camera_proxy.cpp +++ b/src/v4l2/v4l2_camera_proxy.cpp @@ -276,8 +276,7 @@ int V4L2CameraProxy::vidioc_enum_fmt(V4L2CameraFile *file, struct v4l2_fmtdesc * PixelFormat format = streamConfig_.formats().pixelformats()[arg->index]; V4L2PixelFormat v4l2Format = V4L2PixelFormat::fromPixelFormat(format); - /* \todo Set V4L2_FMT_FLAG_COMPRESSED for compressed formats. */ - arg->flags = 0; + arg->flags = format == formats::MJPEG ? V4L2_FMT_FLAG_COMPRESSED : 0; utils::strlcpy(reinterpret_cast(arg->description), v4l2Format.description(), sizeof(arg->description)); arg->pixelformat = v4l2Format; -- cgit v1.2.1