From 953879a15d83704d86a0b054a06d8e2d4730a2cb Mon Sep 17 00:00:00 2001 From: Jacopo Mondi Date: Fri, 15 Jul 2022 14:53:43 +0200 Subject: libcamera: v4l2_pixelformat: Return a format list in fromPixelFormat() As we prepare to associate multiple V4L2 FourCC to a single libcamera format, make the V4L2PixelFormat::fromPixelFormat() return a list of formats and convert all its users to pick the first one. This change prepares to re-introduce V4L2VideoDevice::toV4L2PixelFormat() which will instead match the list of V4L2 FourCC against the formats supported by the video device. While at it, reword the V4L2PixelFormat::fromPixelFormat() documentation to distinguish between planar/multiplanar and contiguous/non-contiguous. Signed-off-by: Jacopo Mondi --- include/libcamera/internal/v4l2_pixelformat.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/libcamera/internal/v4l2_pixelformat.h b/include/libcamera/internal/v4l2_pixelformat.h index fb2d5d0b..750f31fc 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,8 +45,9 @@ public: const char *description() const; PixelFormat toPixelFormat() const; - static V4L2PixelFormat fromPixelFormat(const PixelFormat &pixelFormat, - bool multiplanar = false); + static std::vector + fromPixelFormat(const PixelFormat &pixelFormat, + bool multiplanar = false); private: uint32_t fourcc_; -- cgit v1.2.1