summaryrefslogtreecommitdiff
path: root/src/v4l2
diff options
context:
space:
mode:
authorPaul Elder <paul.elder@ideasonboard.com>2021-09-08 16:51:15 +0900
committerPaul Elder <paul.elder@ideasonboard.com>2021-09-10 10:32:57 +0900
commit69cffe70127e3d0e7ba17a9aa24bed4b88992dbf (patch)
treedb53cd99a796d362f2566192edf6bd4654bf02fb /src/v4l2
parent9f9c224c7bb91e0123b75901a7ccf54d1226504d (diff)
v4l2: v4l2_camera_proxy: Report the proper format name in enum_fmt
Now that libcamera has the V4L2 format names, retrieve and report those names in ENUM_FMT. While at it, refactor the code slightly with PixelFormatInfo. This fixes the test failures on v4l2-compliance with the v4l2 compatilibity layer that were observed in version v4l2-compliance version 1.21.0-4838. Signed-off-by: Paul Elder <paul.elder@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com>
Diffstat (limited to 'src/v4l2')
-rw-r--r--src/v4l2/v4l2_camera_proxy.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/v4l2/v4l2_camera_proxy.cpp b/src/v4l2/v4l2_camera_proxy.cpp
index aeffef26..abb30820 100644
--- a/src/v4l2/v4l2_camera_proxy.cpp
+++ b/src/v4l2/v4l2_camera_proxy.cpp
@@ -274,13 +274,13 @@ int V4L2CameraProxy::vidioc_enum_fmt(V4L2CameraFile *file, struct v4l2_fmtdesc *
return -EINVAL;
PixelFormat format = streamConfig_.formats().pixelformats()[arg->index];
+ V4L2PixelFormat v4l2Format = V4L2PixelFormat::fromPixelFormat(format);
/* \todo Set V4L2_FMT_FLAG_COMPRESSED for compressed formats. */
arg->flags = 0;
- /* \todo Add map from format to description. */
utils::strlcpy(reinterpret_cast<char *>(arg->description),
- "Video Format Description", sizeof(arg->description));
- arg->pixelformat = V4L2PixelFormat::fromPixelFormat(format);
+ v4l2Format.description(), sizeof(arg->description));
+ arg->pixelformat = v4l2Format;
memset(arg->reserved, 0, sizeof(arg->reserved));