From b7ca378b65e8ba936bf3c5631e16534a3376aec9 Mon Sep 17 00:00:00 2001 From: Jacopo Mondi Date: Fri, 29 Jul 2022 12:37:29 +0200 Subject: libcamera: v4l2_pixelformat: Return the list of V4L2 formats Multiple V4L2 formats can be associated with a single PixelFormat. Now that users of V4L2PixelFormat::fromPixelFormat() have been converted to use V4L2VideoDevice::toV4L2PixelFormat(), return the full list of V4L2 formats in order to prepare to match them against the ones supported by the video device. The V4L2 compatibility layer, not having any video device to interact with, is converted to use the first returned format unconditionally. Signed-off-by: Jacopo Mondi Reviewed-by: Laurent Pinchart Tested-by: Paul Elder --- include/libcamera/internal/v4l2_pixelformat.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/libcamera/internal/v4l2_pixelformat.h b/include/libcamera/internal/v4l2_pixelformat.h index ed94baf9..d5400f90 100644 --- a/include/libcamera/internal/v4l2_pixelformat.h +++ b/include/libcamera/internal/v4l2_pixelformat.h @@ -11,6 +11,7 @@ #include #include #include +#include #include @@ -44,7 +45,8 @@ public: const char *description() const; PixelFormat toPixelFormat() const; - static V4L2PixelFormat fromPixelFormat(const PixelFormat &pixelFormat); + static const std::vector & + fromPixelFormat(const PixelFormat &pixelFormat); private: uint32_t fourcc_; -- cgit v1.2.1