From 3bc8844808c5c72f9c83927ec0e93434d9d40e22 Mon Sep 17 00:00:00 2001 From: Jacopo Mondi Date: Fri, 29 Jul 2022 11:40:02 +0200 Subject: libcamera: formats: Merge V4L2 single and multi formats To each libcamera PixelFormat two V4L2 formats are associated, the 'single' and 'multi' format variants. The two versions list plane contiguous and non-contiguous format variants, and an optional argument to V4L2PixelFormat::fromPixelFormat() was used to select which one to pick. In order to prepare to remove V4L2PixelFormat::fromPixelFormat(), and considering that no caller in the codebase uses the non-contiguous format variant, merge the two formats vectors in a single one and default the selection to the first available one, which is functionally equivalent to what is currently implemented. Signed-off-by: Jacopo Mondi Reviewed-by: Laurent Pinchart Tested-by: Paul Elder --- include/libcamera/internal/formats.h | 5 +---- include/libcamera/internal/v4l2_pixelformat.h | 3 +-- 2 files changed, 2 insertions(+), 6 deletions(-) (limited to 'include') diff --git a/include/libcamera/internal/formats.h b/include/libcamera/internal/formats.h index ee599765..5b16c0a8 100644 --- a/include/libcamera/internal/formats.h +++ b/include/libcamera/internal/formats.h @@ -53,10 +53,7 @@ public: /* \todo Add support for non-contiguous memory planes */ const char *name; PixelFormat format; - struct { - V4L2PixelFormat single; - V4L2PixelFormat multi; - } v4l2Formats; + std::vector v4l2Formats; unsigned int bitsPerPixel; enum ColourEncoding colourEncoding; bool packed; diff --git a/include/libcamera/internal/v4l2_pixelformat.h b/include/libcamera/internal/v4l2_pixelformat.h index 7bd3ea79..ed94baf9 100644 --- a/include/libcamera/internal/v4l2_pixelformat.h +++ b/include/libcamera/internal/v4l2_pixelformat.h @@ -44,8 +44,7 @@ public: const char *description() const; PixelFormat toPixelFormat() const; - static V4L2PixelFormat fromPixelFormat(const PixelFormat &pixelFormat, - bool multiplanar = false); + static V4L2PixelFormat fromPixelFormat(const PixelFormat &pixelFormat); private: uint32_t fourcc_; -- cgit v1.2.1