[{"id":24247,"web_url":"https://patchwork.libcamera.org/comment/24247/","msgid":"<YuQTbsBlMGJekQEg@pendragon.ideasonboard.com>","date":"2022-07-29T17:05:50","subject":"Re: [libcamera-devel] [PATCH v3 1/6] libcamera: formats: Merge V4L2\n\tsingle and multi formats","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Jacopo,\n\nThank you for the patch.\n\nOn Fri, Jul 29, 2022 at 06:00:09PM +0200, Jacopo Mondi via libcamera-devel wrote:\n> To each libcamera PixelFormat two lists of V4L2 formats are associated,\n> the 'single' and 'multi' format variants.\n\nIt's not two lists, but two V4L2 pixel formats.\n\n> The two versions list plane contiguous and non-contiguous format\n> variants, and an optional argument to V4L2PixelFormat::fromPixelFormat()\n> was used to select which one to pick.\n> \n> In order to prepare to remove V4L2PixelFormat::fromPixelFormat(), and\n> considering that no caller in the codebase uses the non-contiguous\n> format variant, merge the two formats vectors in a single one and\n> default the selection to the first available one, which is functionally\n> equivalent to what is currently implemented.\n> \n> Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>\n> ---\n>  include/libcamera/internal/formats.h          |   5 +-\n>  include/libcamera/internal/v4l2_pixelformat.h |   3 +-\n>  src/libcamera/formats.cpp                     | 310 ++++--------------\n>  src/libcamera/v4l2_pixelformat.cpp            |  15 +-\n>  4 files changed, 80 insertions(+), 253 deletions(-)\n> \n> diff --git a/include/libcamera/internal/formats.h b/include/libcamera/internal/formats.h\n> index ee599765be47..5b16c0a8c071 100644\n> --- a/include/libcamera/internal/formats.h\n> +++ b/include/libcamera/internal/formats.h\n> @@ -53,10 +53,7 @@ public:\n>  \t/* \\todo Add support for non-contiguous memory planes */\n>  \tconst char *name;\n>  \tPixelFormat format;\n> -\tstruct {\n> -\t\tV4L2PixelFormat single;\n> -\t\tV4L2PixelFormat multi;\n> -\t} v4l2Formats;\n> +\tstd::vector<V4L2PixelFormat> v4l2Formats;\n>  \tunsigned int bitsPerPixel;\n>  \tenum ColourEncoding colourEncoding;\n>  \tbool packed;\n> diff --git a/include/libcamera/internal/v4l2_pixelformat.h b/include/libcamera/internal/v4l2_pixelformat.h\n> index 7bd3ea79428f..ed94baf92795 100644\n> --- a/include/libcamera/internal/v4l2_pixelformat.h\n> +++ b/include/libcamera/internal/v4l2_pixelformat.h\n> @@ -44,8 +44,7 @@ public:\n>  \tconst char *description() const;\n>  \n>  \tPixelFormat toPixelFormat() const;\n> -\tstatic V4L2PixelFormat fromPixelFormat(const PixelFormat &pixelFormat,\n> -\t\t\t\t\t       bool multiplanar = false);\n> +\tstatic V4L2PixelFormat fromPixelFormat(const PixelFormat &pixelFormat);\n>  \n>  private:\n>  \tuint32_t fourcc_;\n> diff --git a/src/libcamera/formats.cpp b/src/libcamera/formats.cpp\n> index 283ecb3d89d8..3c536722f375 100644\n> --- a/src/libcamera/formats.cpp\n> +++ b/src/libcamera/formats.cpp\n> @@ -42,12 +42,9 @@ LOG_DEFINE_CATEGORY(Formats)\n>   * \\var PixelFormatInfo::v4l2Formats\n>   * \\brief The V4L2 pixel formats corresponding to the PixelFormat\n>   *\n> - * Multiple V4L2 formats may exist for one PixelFormat when the format uses\n> - * multiple planes, as V4L2 defines separate 4CCs for contiguous and separate\n> - * planes formats. The two entries in the array store the contiguous and\n> - * non-contiguous V4L2 formats respectively. If the PixelFormat isn't a\n> - * multiplanar format, or if no corresponding non-contiguous V4L2 format\n> - * exists, the second entry is invalid.\n> + * Multiple V4L2 formats may exist for one PixelForma, as V4L2 defines\n\ns/PixelForma/PixelFormat.\n\n> + * separate 4CCs for contiguous and non-contiguous versions of the same image\n> + * format.\n>   *\n>   * \\var PixelFormatInfo::bitsPerPixel\n>   * \\brief The average number of bits per pixel\n> @@ -156,10 +153,7 @@ const std::map<PixelFormat, PixelFormatInfo> pixelFormatInfo{\n>  \t{ formats::RGB565, {\n>  \t\t.name = \"RGB565\",\n>  \t\t.format = formats::RGB565,\n> -\t\t.v4l2Formats = {\n> -\t\t\t.single = V4L2PixelFormat(V4L2_PIX_FMT_RGB565),\n> -\t\t\t.multi = V4L2PixelFormat(),\n> -\t\t},\n> +\t\t.v4l2Formats = { V4L2PixelFormat(V4L2_PIX_FMT_RGB565), },\n>  \t\t.bitsPerPixel = 16,\n>  \t\t.colourEncoding = PixelFormatInfo::ColourEncodingRGB,\n>  \t\t.packed = false,\n> @@ -169,10 +163,7 @@ const std::map<PixelFormat, PixelFormatInfo> pixelFormatInfo{\n>  \t{ formats::RGB565_BE, {\n>  \t\t.name = \"RGB565_BE\",\n>  \t\t.format = formats::RGB565_BE,\n> -\t\t.v4l2Formats = {\n> -\t\t\t.single = V4L2PixelFormat(V4L2_PIX_FMT_RGB565X),\n> -\t\t\t.multi = V4L2PixelFormat(),\n> -\t\t},\n> +\t\t.v4l2Formats = { V4L2PixelFormat(V4L2_PIX_FMT_RGB565X), },\n>  \t\t.bitsPerPixel = 16,\n>  \t\t.colourEncoding = PixelFormatInfo::ColourEncodingRGB,\n>  \t\t.packed = false,\n> @@ -182,10 +173,7 @@ const std::map<PixelFormat, PixelFormatInfo> pixelFormatInfo{\n>  \t{ formats::BGR888, {\n>  \t\t.name = \"BGR888\",\n>  \t\t.format = formats::BGR888,\n> -\t\t.v4l2Formats = {\n> -\t\t\t.single = V4L2PixelFormat(V4L2_PIX_FMT_RGB24),\n> -\t\t\t.multi = V4L2PixelFormat(),\n> -\t\t},\n> +\t\t.v4l2Formats = { V4L2PixelFormat(V4L2_PIX_FMT_RGB24), },\n>  \t\t.bitsPerPixel = 24,\n>  \t\t.colourEncoding = PixelFormatInfo::ColourEncodingRGB,\n>  \t\t.packed = false,\n> @@ -195,10 +183,7 @@ const std::map<PixelFormat, PixelFormatInfo> pixelFormatInfo{\n>  \t{ formats::RGB888, {\n>  \t\t.name = \"RGB888\",\n>  \t\t.format = formats::RGB888,\n> -\t\t.v4l2Formats = {\n> -\t\t\t.single = V4L2PixelFormat(V4L2_PIX_FMT_BGR24),\n> -\t\t\t.multi = V4L2PixelFormat(),\n> -\t\t},\n> +\t\t.v4l2Formats = { V4L2PixelFormat(V4L2_PIX_FMT_BGR24), },\n>  \t\t.bitsPerPixel = 24,\n>  \t\t.colourEncoding = PixelFormatInfo::ColourEncodingRGB,\n>  \t\t.packed = false,\n> @@ -208,10 +193,7 @@ const std::map<PixelFormat, PixelFormatInfo> pixelFormatInfo{\n>  \t{ formats::XRGB8888, {\n>  \t\t.name = \"XRGB8888\",\n>  \t\t.format = formats::XRGB8888,\n> -\t\t.v4l2Formats = {\n> -\t\t\t.single = V4L2PixelFormat(V4L2_PIX_FMT_XBGR32),\n> -\t\t\t.multi = V4L2PixelFormat(),\n> -\t\t},\n> +\t\t.v4l2Formats = { V4L2PixelFormat(V4L2_PIX_FMT_XBGR32), },\n>  \t\t.bitsPerPixel = 32,\n>  \t\t.colourEncoding = PixelFormatInfo::ColourEncodingRGB,\n>  \t\t.packed = false,\n> @@ -221,10 +203,7 @@ const std::map<PixelFormat, PixelFormatInfo> pixelFormatInfo{\n>  \t{ formats::XBGR8888, {\n>  \t\t.name = \"XBGR8888\",\n>  \t\t.format = formats::XBGR8888,\n> -\t\t.v4l2Formats = {\n> -\t\t\t.single = V4L2PixelFormat(V4L2_PIX_FMT_RGBX32),\n> -\t\t\t.multi = V4L2PixelFormat(),\n> -\t\t},\n> +\t\t.v4l2Formats = { V4L2PixelFormat(V4L2_PIX_FMT_RGBX32), },\n>  \t\t.bitsPerPixel = 32,\n>  \t\t.colourEncoding = PixelFormatInfo::ColourEncodingRGB,\n>  \t\t.packed = false,\n> @@ -234,10 +213,7 @@ const std::map<PixelFormat, PixelFormatInfo> pixelFormatInfo{\n>  \t{ formats::RGBX8888, {\n>  \t\t.name = \"RGBX8888\",\n>  \t\t.format = formats::RGBX8888,\n> -\t\t.v4l2Formats = {\n> -\t\t\t.single = V4L2PixelFormat(V4L2_PIX_FMT_BGRX32),\n> -\t\t\t.multi = V4L2PixelFormat(),\n> -\t\t},\n> +\t\t.v4l2Formats = { V4L2PixelFormat(V4L2_PIX_FMT_BGRX32), },\n>  \t\t.bitsPerPixel = 32,\n>  \t\t.colourEncoding = PixelFormatInfo::ColourEncodingRGB,\n>  \t\t.packed = false,\n> @@ -247,10 +223,7 @@ const std::map<PixelFormat, PixelFormatInfo> pixelFormatInfo{\n>  \t{ formats::BGRX8888, {\n>  \t\t.name = \"BGRX8888\",\n>  \t\t.format = formats::BGRX8888,\n> -\t\t.v4l2Formats = {\n> -\t\t\t.single = V4L2PixelFormat(V4L2_PIX_FMT_XRGB32),\n> -\t\t\t.multi = V4L2PixelFormat(),\n> -\t\t},\n> +\t\t.v4l2Formats = { V4L2PixelFormat(V4L2_PIX_FMT_XRGB32), },\n>  \t\t.bitsPerPixel = 32,\n>  \t\t.colourEncoding = PixelFormatInfo::ColourEncodingRGB,\n>  \t\t.packed = false,\n> @@ -260,10 +233,7 @@ const std::map<PixelFormat, PixelFormatInfo> pixelFormatInfo{\n>  \t{ formats::ABGR8888, {\n>  \t\t.name = \"ABGR8888\",\n>  \t\t.format = formats::ABGR8888,\n> -\t\t.v4l2Formats = {\n> -\t\t\t.single = V4L2PixelFormat(V4L2_PIX_FMT_RGBA32),\n> -\t\t\t.multi = V4L2PixelFormat(),\n> -\t\t},\n> +\t\t.v4l2Formats = { V4L2PixelFormat(V4L2_PIX_FMT_RGBA32), },\n>  \t\t.bitsPerPixel = 32,\n>  \t\t.colourEncoding = PixelFormatInfo::ColourEncodingRGB,\n>  \t\t.packed = false,\n> @@ -273,10 +243,7 @@ const std::map<PixelFormat, PixelFormatInfo> pixelFormatInfo{\n>  \t{ formats::ARGB8888, {\n>  \t\t.name = \"ARGB8888\",\n>  \t\t.format = formats::ARGB8888,\n> -\t\t.v4l2Formats = {\n> -\t\t\t.single = V4L2PixelFormat(V4L2_PIX_FMT_ABGR32),\n> -\t\t\t.multi = V4L2PixelFormat(),\n> -\t\t},\n> +\t\t.v4l2Formats = { V4L2PixelFormat(V4L2_PIX_FMT_ABGR32), },\n>  \t\t.bitsPerPixel = 32,\n>  \t\t.colourEncoding = PixelFormatInfo::ColourEncodingRGB,\n>  \t\t.packed = false,\n> @@ -286,10 +253,7 @@ const std::map<PixelFormat, PixelFormatInfo> pixelFormatInfo{\n>  \t{ formats::BGRA8888, {\n>  \t\t.name = \"BGRA8888\",\n>  \t\t.format = formats::BGRA8888,\n> -\t\t.v4l2Formats = {\n> -\t\t\t.single = V4L2PixelFormat(V4L2_PIX_FMT_ARGB32),\n> -\t\t\t.multi = V4L2PixelFormat(),\n> -\t\t},\n> +\t\t.v4l2Formats = { V4L2PixelFormat(V4L2_PIX_FMT_ARGB32), },\n>  \t\t.bitsPerPixel = 32,\n>  \t\t.colourEncoding = PixelFormatInfo::ColourEncodingRGB,\n>  \t\t.packed = false,\n> @@ -299,10 +263,7 @@ const std::map<PixelFormat, PixelFormatInfo> pixelFormatInfo{\n>  \t{ formats::RGBA8888, {\n>  \t\t.name = \"RGBA8888\",\n>  \t\t.format = formats::RGBA8888,\n> -\t\t.v4l2Formats = {\n> -\t\t\t.single = V4L2PixelFormat(V4L2_PIX_FMT_BGRA32),\n> -\t\t\t.multi = V4L2PixelFormat(),\n> -\t\t},\n> +\t\t.v4l2Formats = { V4L2PixelFormat(V4L2_PIX_FMT_BGRA32), },\n>  \t\t.bitsPerPixel = 32,\n>  \t\t.colourEncoding = PixelFormatInfo::ColourEncodingRGB,\n>  \t\t.packed = false,\n> @@ -314,10 +275,7 @@ const std::map<PixelFormat, PixelFormatInfo> pixelFormatInfo{\n>  \t{ formats::YUYV, {\n>  \t\t.name = \"YUYV\",\n>  \t\t.format = formats::YUYV,\n> -\t\t.v4l2Formats = {\n> -\t\t\t.single = V4L2PixelFormat(V4L2_PIX_FMT_YUYV),\n> -\t\t\t.multi = V4L2PixelFormat(),\n> -\t\t},\n> +\t\t.v4l2Formats = { V4L2PixelFormat(V4L2_PIX_FMT_YUYV), },\n>  \t\t.bitsPerPixel = 16,\n>  \t\t.colourEncoding = PixelFormatInfo::ColourEncodingYUV,\n>  \t\t.packed = false,\n> @@ -327,10 +285,7 @@ const std::map<PixelFormat, PixelFormatInfo> pixelFormatInfo{\n>  \t{ formats::YVYU, {\n>  \t\t.name = \"YVYU\",\n>  \t\t.format = formats::YVYU,\n> -\t\t.v4l2Formats = {\n> -\t\t\t.single = V4L2PixelFormat(V4L2_PIX_FMT_YVYU),\n> -\t\t\t.multi = V4L2PixelFormat(),\n> -\t\t},\n> +\t\t.v4l2Formats = { V4L2PixelFormat(V4L2_PIX_FMT_YVYU), },\n>  \t\t.bitsPerPixel = 16,\n>  \t\t.colourEncoding = PixelFormatInfo::ColourEncodingYUV,\n>  \t\t.packed = false,\n> @@ -340,10 +295,7 @@ const std::map<PixelFormat, PixelFormatInfo> pixelFormatInfo{\n>  \t{ formats::UYVY, {\n>  \t\t.name = \"UYVY\",\n>  \t\t.format = formats::UYVY,\n> -\t\t.v4l2Formats = {\n> -\t\t\t.single = V4L2PixelFormat(V4L2_PIX_FMT_UYVY),\n> -\t\t\t.multi = V4L2PixelFormat(),\n> -\t\t},\n> +\t\t.v4l2Formats = { V4L2PixelFormat(V4L2_PIX_FMT_UYVY), },\n>  \t\t.bitsPerPixel = 16,\n>  \t\t.colourEncoding = PixelFormatInfo::ColourEncodingYUV,\n>  \t\t.packed = false,\n> @@ -353,10 +305,7 @@ const std::map<PixelFormat, PixelFormatInfo> pixelFormatInfo{\n>  \t{ formats::VYUY, {\n>  \t\t.name = \"VYUY\",\n>  \t\t.format = formats::VYUY,\n> -\t\t.v4l2Formats = {\n> -\t\t\t.single = V4L2PixelFormat(V4L2_PIX_FMT_VYUY),\n> -\t\t\t.multi = V4L2PixelFormat(),\n> -\t\t},\n> +\t\t.v4l2Formats = { V4L2PixelFormat(V4L2_PIX_FMT_VYUY), },\n>  \t\t.bitsPerPixel = 16,\n>  \t\t.colourEncoding = PixelFormatInfo::ColourEncodingYUV,\n>  \t\t.packed = false,\n> @@ -369,8 +318,8 @@ const std::map<PixelFormat, PixelFormatInfo> pixelFormatInfo{\n>  \t\t.name = \"NV12\",\n>  \t\t.format = formats::NV12,\n>  \t\t.v4l2Formats = {\n> -\t\t\t.single = V4L2PixelFormat(V4L2_PIX_FMT_NV12),\n> -\t\t\t.multi = V4L2PixelFormat(V4L2_PIX_FMT_NV12M),\n> +\t\t\tV4L2PixelFormat(V4L2_PIX_FMT_NV12),\n> +\t\t\tV4L2PixelFormat(V4L2_PIX_FMT_NV12M),\n>  \t\t},\n>  \t\t.bitsPerPixel = 12,\n>  \t\t.colourEncoding = PixelFormatInfo::ColourEncodingYUV,\n> @@ -382,8 +331,8 @@ const std::map<PixelFormat, PixelFormatInfo> pixelFormatInfo{\n>  \t\t.name = \"NV21\",\n>  \t\t.format = formats::NV21,\n>  \t\t.v4l2Formats = {\n> -\t\t\t.single = V4L2PixelFormat(V4L2_PIX_FMT_NV21),\n> -\t\t\t.multi = V4L2PixelFormat(V4L2_PIX_FMT_NV21M),\n> +\t\t\tV4L2PixelFormat(V4L2_PIX_FMT_NV21),\n> +\t\t\tV4L2PixelFormat(V4L2_PIX_FMT_NV21M),\n>  \t\t},\n>  \t\t.bitsPerPixel = 12,\n>  \t\t.colourEncoding = PixelFormatInfo::ColourEncodingYUV,\n> @@ -395,8 +344,8 @@ const std::map<PixelFormat, PixelFormatInfo> pixelFormatInfo{\n>  \t\t.name = \"NV16\",\n>  \t\t.format = formats::NV16,\n>  \t\t.v4l2Formats = {\n> -\t\t\t.single = V4L2PixelFormat(V4L2_PIX_FMT_NV16),\n> -\t\t\t.multi = V4L2PixelFormat(V4L2_PIX_FMT_NV16M),\n> +\t\t\tV4L2PixelFormat(V4L2_PIX_FMT_NV16),\n> +\t\t\tV4L2PixelFormat(V4L2_PIX_FMT_NV16M),\n>  \t\t},\n>  \t\t.bitsPerPixel = 16,\n>  \t\t.colourEncoding = PixelFormatInfo::ColourEncodingYUV,\n> @@ -408,8 +357,8 @@ const std::map<PixelFormat, PixelFormatInfo> pixelFormatInfo{\n>  \t\t.name = \"NV61\",\n>  \t\t.format = formats::NV61,\n>  \t\t.v4l2Formats = {\n> -\t\t\t.single = V4L2PixelFormat(V4L2_PIX_FMT_NV61),\n> -\t\t\t.multi = V4L2PixelFormat(V4L2_PIX_FMT_NV61M),\n> +\t\t\tV4L2PixelFormat(V4L2_PIX_FMT_NV61),\n> +\t\t\tV4L2PixelFormat(V4L2_PIX_FMT_NV61M),\n>  \t\t},\n>  \t\t.bitsPerPixel = 16,\n>  \t\t.colourEncoding = PixelFormatInfo::ColourEncodingYUV,\n> @@ -420,10 +369,7 @@ const std::map<PixelFormat, PixelFormatInfo> pixelFormatInfo{\n>  \t{ formats::NV24, {\n>  \t\t.name = \"NV24\",\n>  \t\t.format = formats::NV24,\n> -\t\t.v4l2Formats = {\n> -\t\t\t.single = V4L2PixelFormat(V4L2_PIX_FMT_NV24),\n> -\t\t\t.multi = V4L2PixelFormat(),\n> -\t\t},\n> +\t\t.v4l2Formats = { V4L2PixelFormat(V4L2_PIX_FMT_NV24), },\n>  \t\t.bitsPerPixel = 24,\n>  \t\t.colourEncoding = PixelFormatInfo::ColourEncodingYUV,\n>  \t\t.packed = false,\n> @@ -433,10 +379,7 @@ const std::map<PixelFormat, PixelFormatInfo> pixelFormatInfo{\n>  \t{ formats::NV42, {\n>  \t\t.name = \"NV42\",\n>  \t\t.format = formats::NV42,\n> -\t\t.v4l2Formats = {\n> -\t\t\t.single = V4L2PixelFormat(V4L2_PIX_FMT_NV42),\n> -\t\t\t.multi = V4L2PixelFormat(),\n> -\t\t},\n> +\t\t.v4l2Formats = { V4L2PixelFormat(V4L2_PIX_FMT_NV42), },\n>  \t\t.bitsPerPixel = 24,\n>  \t\t.colourEncoding = PixelFormatInfo::ColourEncodingYUV,\n>  \t\t.packed = false,\n> @@ -447,8 +390,8 @@ const std::map<PixelFormat, PixelFormatInfo> pixelFormatInfo{\n>  \t\t.name = \"YUV420\",\n>  \t\t.format = formats::YUV420,\n>  \t\t.v4l2Formats = {\n> -\t\t\t.single = V4L2PixelFormat(V4L2_PIX_FMT_YUV420),\n> -\t\t\t.multi = V4L2PixelFormat(V4L2_PIX_FMT_YUV420M),\n> +\t\t\tV4L2PixelFormat(V4L2_PIX_FMT_YUV420),\n> +\t\t\tV4L2PixelFormat(V4L2_PIX_FMT_YUV420M),\n>  \t\t},\n>  \t\t.bitsPerPixel = 12,\n>  \t\t.colourEncoding = PixelFormatInfo::ColourEncodingYUV,\n> @@ -460,8 +403,8 @@ const std::map<PixelFormat, PixelFormatInfo> pixelFormatInfo{\n>  \t\t.name = \"YVU420\",\n>  \t\t.format = formats::YVU420,\n>  \t\t.v4l2Formats = {\n> -\t\t\t.single = V4L2PixelFormat(V4L2_PIX_FMT_YVU420),\n> -\t\t\t.multi = V4L2PixelFormat(V4L2_PIX_FMT_YVU420M),\n> +\t\t\tV4L2PixelFormat(V4L2_PIX_FMT_YVU420),\n> +\t\t\tV4L2PixelFormat(V4L2_PIX_FMT_YVU420M),\n>  \t\t},\n>  \t\t.bitsPerPixel = 12,\n>  \t\t.colourEncoding = PixelFormatInfo::ColourEncodingYUV,\n> @@ -473,8 +416,8 @@ const std::map<PixelFormat, PixelFormatInfo> pixelFormatInfo{\n>  \t\t.name = \"YUV422\",\n>  \t\t.format = formats::YUV422,\n>  \t\t.v4l2Formats = {\n> -\t\t\t.single = V4L2PixelFormat(V4L2_PIX_FMT_YUV422P),\n> -\t\t\t.multi = V4L2PixelFormat(V4L2_PIX_FMT_YUV422M),\n> +\t\t\tV4L2PixelFormat(V4L2_PIX_FMT_YUV422P),\n> +\t\t\tV4L2PixelFormat(V4L2_PIX_FMT_YUV422M),\n>  \t\t},\n>  \t\t.bitsPerPixel = 16,\n>  \t\t.colourEncoding = PixelFormatInfo::ColourEncodingYUV,\n> @@ -485,10 +428,7 @@ const std::map<PixelFormat, PixelFormatInfo> pixelFormatInfo{\n>  \t{ formats::YVU422, {\n>  \t\t.name = \"YVU422\",\n>  \t\t.format = formats::YVU422,\n> -\t\t.v4l2Formats = {\n> -\t\t\t.single = V4L2PixelFormat(),\n> -\t\t\t.multi = V4L2PixelFormat(V4L2_PIX_FMT_YVU422M),\n> -\t\t},\n> +\t\t.v4l2Formats = { V4L2PixelFormat(V4L2_PIX_FMT_YVU422M), },\n>  \t\t.bitsPerPixel = 16,\n>  \t\t.colourEncoding = PixelFormatInfo::ColourEncodingYUV,\n>  \t\t.packed = false,\n> @@ -498,10 +438,7 @@ const std::map<PixelFormat, PixelFormatInfo> pixelFormatInfo{\n>  \t{ formats::YUV444, {\n>  \t\t.name = \"YUV444\",\n>  \t\t.format = formats::YUV444,\n> -\t\t.v4l2Formats = {\n> -\t\t\t.single = V4L2PixelFormat(),\n> -\t\t\t.multi = V4L2PixelFormat(V4L2_PIX_FMT_YUV444M),\n> -\t\t},\n> +\t\t.v4l2Formats = { V4L2PixelFormat(V4L2_PIX_FMT_YUV444M), },\n>  \t\t.bitsPerPixel = 24,\n>  \t\t.colourEncoding = PixelFormatInfo::ColourEncodingYUV,\n>  \t\t.packed = false,\n> @@ -511,10 +448,7 @@ const std::map<PixelFormat, PixelFormatInfo> pixelFormatInfo{\n>  \t{ formats::YVU444, {\n>  \t\t.name = \"YVU444\",\n>  \t\t.format = formats::YVU444,\n> -\t\t.v4l2Formats = {\n> -\t\t\t.single = V4L2PixelFormat(),\n> -\t\t\t.multi = V4L2PixelFormat(V4L2_PIX_FMT_YVU444M),\n> -\t\t},\n> +\t\t.v4l2Formats = { V4L2PixelFormat(V4L2_PIX_FMT_YVU444M), },\n>  \t\t.bitsPerPixel = 24,\n>  \t\t.colourEncoding = PixelFormatInfo::ColourEncodingYUV,\n>  \t\t.packed = false,\n> @@ -526,10 +460,7 @@ const std::map<PixelFormat, PixelFormatInfo> pixelFormatInfo{\n>  \t{ formats::R8, {\n>  \t\t.name = \"R8\",\n>  \t\t.format = formats::R8,\n> -\t\t.v4l2Formats = {\n> -\t\t\t.single = V4L2PixelFormat(V4L2_PIX_FMT_GREY),\n> -\t\t\t.multi = V4L2PixelFormat(),\n> -\t\t},\n> +\t\t.v4l2Formats = { V4L2PixelFormat(V4L2_PIX_FMT_GREY), },\n>  \t\t.bitsPerPixel = 8,\n>  \t\t.colourEncoding = PixelFormatInfo::ColourEncodingYUV,\n>  \t\t.packed = false,\n> @@ -539,10 +470,7 @@ const std::map<PixelFormat, PixelFormatInfo> pixelFormatInfo{\n>  \t{ formats::R10, {\n>  \t\t.name = \"R10\",\n>  \t\t.format = formats::R10,\n> -\t\t.v4l2Formats = {\n> -\t\t\t.single = V4L2PixelFormat(V4L2_PIX_FMT_Y10),\n> -\t\t\t.multi = V4L2PixelFormat(),\n> -\t\t},\n> +\t\t.v4l2Formats = { V4L2PixelFormat(V4L2_PIX_FMT_Y10), },\n>  \t\t.bitsPerPixel = 10,\n>  \t\t.colourEncoding = PixelFormatInfo::ColourEncodingYUV,\n>  \t\t.packed = false,\n> @@ -552,10 +480,7 @@ const std::map<PixelFormat, PixelFormatInfo> pixelFormatInfo{\n>  \t{ formats::R12, {\n>  \t\t.name = \"R12\",\n>  \t\t.format = formats::R12,\n> -\t\t.v4l2Formats = {\n> -\t\t\t.single = V4L2PixelFormat(V4L2_PIX_FMT_Y12),\n> -\t\t\t.multi = V4L2PixelFormat(),\n> -\t\t},\n> +\t\t.v4l2Formats = { V4L2PixelFormat(V4L2_PIX_FMT_Y12), },\n>  \t\t.bitsPerPixel = 12,\n>  \t\t.colourEncoding = PixelFormatInfo::ColourEncodingYUV,\n>  \t\t.packed = false,\n> @@ -565,10 +490,7 @@ const std::map<PixelFormat, PixelFormatInfo> pixelFormatInfo{\n>  \t{ formats::R10_CSI2P, {\n>  \t\t.name = \"R10_CSI2P\",\n>  \t\t.format = formats::R10,\n> -\t\t.v4l2Formats = {\n> -\t\t\t.single = V4L2PixelFormat(V4L2_PIX_FMT_Y10P),\n> -\t\t\t.multi = V4L2PixelFormat(),\n> -\t\t},\n> +\t\t.v4l2Formats = { V4L2PixelFormat(V4L2_PIX_FMT_Y10P), },\n>  \t\t.bitsPerPixel = 10,\n>  \t\t.colourEncoding = PixelFormatInfo::ColourEncodingYUV,\n>  \t\t.packed = true,\n> @@ -580,10 +502,7 @@ const std::map<PixelFormat, PixelFormatInfo> pixelFormatInfo{\n>  \t{ formats::SBGGR8, {\n>  \t\t.name = \"SBGGR8\",\n>  \t\t.format = formats::SBGGR8,\n> -\t\t.v4l2Formats = {\n> -\t\t\t.single = V4L2PixelFormat(V4L2_PIX_FMT_SBGGR8),\n> -\t\t\t.multi = V4L2PixelFormat(),\n> -\t\t},\n> +\t\t.v4l2Formats = { V4L2PixelFormat(V4L2_PIX_FMT_SBGGR8), },\n>  \t\t.bitsPerPixel = 8,\n>  \t\t.colourEncoding = PixelFormatInfo::ColourEncodingRAW,\n>  \t\t.packed = false,\n> @@ -593,10 +512,7 @@ const std::map<PixelFormat, PixelFormatInfo> pixelFormatInfo{\n>  \t{ formats::SGBRG8, {\n>  \t\t.name = \"SGBRG8\",\n>  \t\t.format = formats::SGBRG8,\n> -\t\t.v4l2Formats = {\n> -\t\t\t.single = V4L2PixelFormat(V4L2_PIX_FMT_SGBRG8),\n> -\t\t\t.multi = V4L2PixelFormat(),\n> -\t\t},\n> +\t\t.v4l2Formats = { V4L2PixelFormat(V4L2_PIX_FMT_SGBRG8), },\n>  \t\t.bitsPerPixel = 8,\n>  \t\t.colourEncoding = PixelFormatInfo::ColourEncodingRAW,\n>  \t\t.packed = false,\n> @@ -606,10 +522,7 @@ const std::map<PixelFormat, PixelFormatInfo> pixelFormatInfo{\n>  \t{ formats::SGRBG8, {\n>  \t\t.name = \"SGRBG8\",\n>  \t\t.format = formats::SGRBG8,\n> -\t\t.v4l2Formats = {\n> -\t\t\t.single = V4L2PixelFormat(V4L2_PIX_FMT_SGRBG8),\n> -\t\t\t.multi = V4L2PixelFormat(),\n> -\t\t},\n> +\t\t.v4l2Formats = { V4L2PixelFormat(V4L2_PIX_FMT_SGRBG8), },\n>  \t\t.bitsPerPixel = 8,\n>  \t\t.colourEncoding = PixelFormatInfo::ColourEncodingRAW,\n>  \t\t.packed = false,\n> @@ -619,10 +532,7 @@ const std::map<PixelFormat, PixelFormatInfo> pixelFormatInfo{\n>  \t{ formats::SRGGB8, {\n>  \t\t.name = \"SRGGB8\",\n>  \t\t.format = formats::SRGGB8,\n> -\t\t.v4l2Formats = {\n> -\t\t\t.single = V4L2PixelFormat(V4L2_PIX_FMT_SRGGB8),\n> -\t\t\t.multi = V4L2PixelFormat(),\n> -\t\t},\n> +\t\t.v4l2Formats = { V4L2PixelFormat(V4L2_PIX_FMT_SRGGB8), },\n>  \t\t.bitsPerPixel = 8,\n>  \t\t.colourEncoding = PixelFormatInfo::ColourEncodingRAW,\n>  \t\t.packed = false,\n> @@ -632,10 +542,7 @@ const std::map<PixelFormat, PixelFormatInfo> pixelFormatInfo{\n>  \t{ formats::SBGGR10, {\n>  \t\t.name = \"SBGGR10\",\n>  \t\t.format = formats::SBGGR10,\n> -\t\t.v4l2Formats = {\n> -\t\t\t.single = V4L2PixelFormat(V4L2_PIX_FMT_SBGGR10),\n> -\t\t\t.multi = V4L2PixelFormat(),\n> -\t\t},\n> +\t\t.v4l2Formats = { V4L2PixelFormat(V4L2_PIX_FMT_SBGGR10), },\n>  \t\t.bitsPerPixel = 10,\n>  \t\t.colourEncoding = PixelFormatInfo::ColourEncodingRAW,\n>  \t\t.packed = false,\n> @@ -645,10 +552,7 @@ const std::map<PixelFormat, PixelFormatInfo> pixelFormatInfo{\n>  \t{ formats::SGBRG10, {\n>  \t\t.name = \"SGBRG10\",\n>  \t\t.format = formats::SGBRG10,\n> -\t\t.v4l2Formats = {\n> -\t\t\t.single = V4L2PixelFormat(V4L2_PIX_FMT_SGBRG10),\n> -\t\t\t.multi = V4L2PixelFormat(),\n> -\t\t},\n> +\t\t.v4l2Formats = { V4L2PixelFormat(V4L2_PIX_FMT_SGBRG10), },\n>  \t\t.bitsPerPixel = 10,\n>  \t\t.colourEncoding = PixelFormatInfo::ColourEncodingRAW,\n>  \t\t.packed = false,\n> @@ -658,10 +562,7 @@ const std::map<PixelFormat, PixelFormatInfo> pixelFormatInfo{\n>  \t{ formats::SGRBG10, {\n>  \t\t.name = \"SGRBG10\",\n>  \t\t.format = formats::SGRBG10,\n> -\t\t.v4l2Formats = {\n> -\t\t\t.single = V4L2PixelFormat(V4L2_PIX_FMT_SGRBG10),\n> -\t\t\t.multi = V4L2PixelFormat(),\n> -\t\t},\n> +\t\t.v4l2Formats = { V4L2PixelFormat(V4L2_PIX_FMT_SGRBG10), },\n>  \t\t.bitsPerPixel = 10,\n>  \t\t.colourEncoding = PixelFormatInfo::ColourEncodingRAW,\n>  \t\t.packed = false,\n> @@ -671,10 +572,7 @@ const std::map<PixelFormat, PixelFormatInfo> pixelFormatInfo{\n>  \t{ formats::SRGGB10, {\n>  \t\t.name = \"SRGGB10\",\n>  \t\t.format = formats::SRGGB10,\n> -\t\t.v4l2Formats = {\n> -\t\t\t.single = V4L2PixelFormat(V4L2_PIX_FMT_SRGGB10),\n> -\t\t\t.multi = V4L2PixelFormat(),\n> -\t\t},\n> +\t\t.v4l2Formats = { V4L2PixelFormat(V4L2_PIX_FMT_SRGGB10), },\n>  \t\t.bitsPerPixel = 10,\n>  \t\t.colourEncoding = PixelFormatInfo::ColourEncodingRAW,\n>  \t\t.packed = false,\n> @@ -684,10 +582,7 @@ const std::map<PixelFormat, PixelFormatInfo> pixelFormatInfo{\n>  \t{ formats::SBGGR10_CSI2P, {\n>  \t\t.name = \"SBGGR10_CSI2P\",\n>  \t\t.format = formats::SBGGR10_CSI2P,\n> -\t\t.v4l2Formats = {\n> -\t\t\t.single = V4L2PixelFormat(V4L2_PIX_FMT_SBGGR10P),\n> -\t\t\t.multi = V4L2PixelFormat(),\n> -\t\t},\n> +\t\t.v4l2Formats = { V4L2PixelFormat(V4L2_PIX_FMT_SBGGR10P), },\n>  \t\t.bitsPerPixel = 10,\n>  \t\t.colourEncoding = PixelFormatInfo::ColourEncodingRAW,\n>  \t\t.packed = true,\n> @@ -697,10 +592,7 @@ const std::map<PixelFormat, PixelFormatInfo> pixelFormatInfo{\n>  \t{ formats::SGBRG10_CSI2P, {\n>  \t\t.name = \"SGBRG10_CSI2P\",\n>  \t\t.format = formats::SGBRG10_CSI2P,\n> -\t\t.v4l2Formats = {\n> -\t\t\t.single = V4L2PixelFormat(V4L2_PIX_FMT_SGBRG10P),\n> -\t\t\t.multi = V4L2PixelFormat(),\n> -\t\t},\n> +\t\t.v4l2Formats = { V4L2PixelFormat(V4L2_PIX_FMT_SGBRG10P), },\n>  \t\t.bitsPerPixel = 10,\n>  \t\t.colourEncoding = PixelFormatInfo::ColourEncodingRAW,\n>  \t\t.packed = true,\n> @@ -710,10 +602,7 @@ const std::map<PixelFormat, PixelFormatInfo> pixelFormatInfo{\n>  \t{ formats::SGRBG10_CSI2P, {\n>  \t\t.name = \"SGRBG10_CSI2P\",\n>  \t\t.format = formats::SGRBG10_CSI2P,\n> -\t\t.v4l2Formats = {\n> -\t\t\t.single = V4L2PixelFormat(V4L2_PIX_FMT_SGRBG10P),\n> -\t\t\t.multi = V4L2PixelFormat(),\n> -\t\t},\n> +\t\t.v4l2Formats = { V4L2PixelFormat(V4L2_PIX_FMT_SGRBG10P), },\n>  \t\t.bitsPerPixel = 10,\n>  \t\t.colourEncoding = PixelFormatInfo::ColourEncodingRAW,\n>  \t\t.packed = true,\n> @@ -723,10 +612,7 @@ const std::map<PixelFormat, PixelFormatInfo> pixelFormatInfo{\n>  \t{ formats::SRGGB10_CSI2P, {\n>  \t\t.name = \"SRGGB10_CSI2P\",\n>  \t\t.format = formats::SRGGB10_CSI2P,\n> -\t\t.v4l2Formats = {\n> -\t\t\t.single = V4L2PixelFormat(V4L2_PIX_FMT_SRGGB10P),\n> -\t\t\t.multi = V4L2PixelFormat(),\n> -\t\t},\n> +\t\t.v4l2Formats = { V4L2PixelFormat(V4L2_PIX_FMT_SRGGB10P), },\n>  \t\t.bitsPerPixel = 10,\n>  \t\t.colourEncoding = PixelFormatInfo::ColourEncodingRAW,\n>  \t\t.packed = true,\n> @@ -736,10 +622,7 @@ const std::map<PixelFormat, PixelFormatInfo> pixelFormatInfo{\n>  \t{ formats::SBGGR12, {\n>  \t\t.name = \"SBGGR12\",\n>  \t\t.format = formats::SBGGR12,\n> -\t\t.v4l2Formats = {\n> -\t\t\t.single = V4L2PixelFormat(V4L2_PIX_FMT_SBGGR12),\n> -\t\t\t.multi = V4L2PixelFormat(),\n> -\t\t},\n> +\t\t.v4l2Formats = { V4L2PixelFormat(V4L2_PIX_FMT_SBGGR12), },\n>  \t\t.bitsPerPixel = 12,\n>  \t\t.colourEncoding = PixelFormatInfo::ColourEncodingRAW,\n>  \t\t.packed = false,\n> @@ -749,10 +632,7 @@ const std::map<PixelFormat, PixelFormatInfo> pixelFormatInfo{\n>  \t{ formats::SGBRG12, {\n>  \t\t.name = \"SGBRG12\",\n>  \t\t.format = formats::SGBRG12,\n> -\t\t.v4l2Formats = {\n> -\t\t\t.single = V4L2PixelFormat(V4L2_PIX_FMT_SGBRG12),\n> -\t\t\t.multi = V4L2PixelFormat(),\n> -\t\t},\n> +\t\t.v4l2Formats = { V4L2PixelFormat(V4L2_PIX_FMT_SGBRG12), },\n>  \t\t.bitsPerPixel = 12,\n>  \t\t.colourEncoding = PixelFormatInfo::ColourEncodingRAW,\n>  \t\t.packed = false,\n> @@ -762,10 +642,7 @@ const std::map<PixelFormat, PixelFormatInfo> pixelFormatInfo{\n>  \t{ formats::SGRBG12, {\n>  \t\t.name = \"SGRBG12\",\n>  \t\t.format = formats::SGRBG12,\n> -\t\t.v4l2Formats = {\n> -\t\t\t.single = V4L2PixelFormat(V4L2_PIX_FMT_SGRBG12),\n> -\t\t\t.multi = V4L2PixelFormat(),\n> -\t\t},\n> +\t\t.v4l2Formats = { V4L2PixelFormat(V4L2_PIX_FMT_SGRBG12), },\n>  \t\t.bitsPerPixel = 12,\n>  \t\t.colourEncoding = PixelFormatInfo::ColourEncodingRAW,\n>  \t\t.packed = false,\n> @@ -775,10 +652,7 @@ const std::map<PixelFormat, PixelFormatInfo> pixelFormatInfo{\n>  \t{ formats::SRGGB12, {\n>  \t\t.name = \"SRGGB12\",\n>  \t\t.format = formats::SRGGB12,\n> -\t\t.v4l2Formats = {\n> -\t\t\t.single = V4L2PixelFormat(V4L2_PIX_FMT_SRGGB12),\n> -\t\t\t.multi = V4L2PixelFormat(),\n> -\t\t},\n> +\t\t.v4l2Formats = { V4L2PixelFormat(V4L2_PIX_FMT_SRGGB12), },\n>  \t\t.bitsPerPixel = 12,\n>  \t\t.colourEncoding = PixelFormatInfo::ColourEncodingRAW,\n>  \t\t.packed = false,\n> @@ -788,10 +662,7 @@ const std::map<PixelFormat, PixelFormatInfo> pixelFormatInfo{\n>  \t{ formats::SBGGR12_CSI2P, {\n>  \t\t.name = \"SBGGR12_CSI2P\",\n>  \t\t.format = formats::SBGGR12_CSI2P,\n> -\t\t.v4l2Formats = {\n> -\t\t\t.single = V4L2PixelFormat(V4L2_PIX_FMT_SBGGR12P),\n> -\t\t\t.multi = V4L2PixelFormat(),\n> -\t\t},\n> +\t\t.v4l2Formats = { V4L2PixelFormat(V4L2_PIX_FMT_SBGGR12P), },\n>  \t\t.bitsPerPixel = 12,\n>  \t\t.colourEncoding = PixelFormatInfo::ColourEncodingRAW,\n>  \t\t.packed = true,\n> @@ -801,10 +672,7 @@ const std::map<PixelFormat, PixelFormatInfo> pixelFormatInfo{\n>  \t{ formats::SGBRG12_CSI2P, {\n>  \t\t.name = \"SGBRG12_CSI2P\",\n>  \t\t.format = formats::SGBRG12_CSI2P,\n> -\t\t.v4l2Formats = {\n> -\t\t\t.single = V4L2PixelFormat(V4L2_PIX_FMT_SGBRG12P),\n> -\t\t\t.multi = V4L2PixelFormat(),\n> -\t\t},\n> +\t\t.v4l2Formats = { V4L2PixelFormat(V4L2_PIX_FMT_SGBRG12P), },\n>  \t\t.bitsPerPixel = 12,\n>  \t\t.colourEncoding = PixelFormatInfo::ColourEncodingRAW,\n>  \t\t.packed = true,\n> @@ -814,10 +682,7 @@ const std::map<PixelFormat, PixelFormatInfo> pixelFormatInfo{\n>  \t{ formats::SGRBG12_CSI2P, {\n>  \t\t.name = \"SGRBG12_CSI2P\",\n>  \t\t.format = formats::SGRBG12_CSI2P,\n> -\t\t.v4l2Formats = {\n> -\t\t\t.single = V4L2PixelFormat(V4L2_PIX_FMT_SGRBG12P),\n> -\t\t\t.multi = V4L2PixelFormat(),\n> -\t\t},\n> +\t\t.v4l2Formats = { V4L2PixelFormat(V4L2_PIX_FMT_SGRBG12P), },\n>  \t\t.bitsPerPixel = 12,\n>  \t\t.colourEncoding = PixelFormatInfo::ColourEncodingRAW,\n>  \t\t.packed = true,\n> @@ -827,10 +692,7 @@ const std::map<PixelFormat, PixelFormatInfo> pixelFormatInfo{\n>  \t{ formats::SRGGB12_CSI2P, {\n>  \t\t.name = \"SRGGB12_CSI2P\",\n>  \t\t.format = formats::SRGGB12_CSI2P,\n> -\t\t.v4l2Formats = {\n> -\t\t\t.single = V4L2PixelFormat(V4L2_PIX_FMT_SRGGB12P),\n> -\t\t\t.multi = V4L2PixelFormat(),\n> -\t\t},\n> +\t\t.v4l2Formats = { V4L2PixelFormat(V4L2_PIX_FMT_SRGGB12P), },\n>  \t\t.bitsPerPixel = 12,\n>  \t\t.colourEncoding = PixelFormatInfo::ColourEncodingRAW,\n>  \t\t.packed = true,\n> @@ -840,10 +702,7 @@ const std::map<PixelFormat, PixelFormatInfo> pixelFormatInfo{\n>  \t{ formats::SBGGR16, {\n>  \t\t.name = \"SBGGR16\",\n>  \t\t.format = formats::SBGGR16,\n> -\t\t.v4l2Formats = {\n> -\t\t\t.single = V4L2PixelFormat(V4L2_PIX_FMT_SBGGR16),\n> -\t\t\t.multi = V4L2PixelFormat(),\n> -\t\t},\n> +\t\t.v4l2Formats = { V4L2PixelFormat(V4L2_PIX_FMT_SBGGR16), },\n>  \t\t.bitsPerPixel = 16,\n>  \t\t.colourEncoding = PixelFormatInfo::ColourEncodingRAW,\n>  \t\t.packed = false,\n> @@ -853,10 +712,7 @@ const std::map<PixelFormat, PixelFormatInfo> pixelFormatInfo{\n>  \t{ formats::SGBRG16, {\n>  \t\t.name = \"SGBRG16\",\n>  \t\t.format = formats::SGBRG16,\n> -\t\t.v4l2Formats = {\n> -\t\t\t.single = V4L2PixelFormat(V4L2_PIX_FMT_SGBRG16),\n> -\t\t\t.multi = V4L2PixelFormat(),\n> -\t\t},\n> +\t\t.v4l2Formats = { V4L2PixelFormat(V4L2_PIX_FMT_SGBRG16), },\n>  \t\t.bitsPerPixel = 16,\n>  \t\t.colourEncoding = PixelFormatInfo::ColourEncodingRAW,\n>  \t\t.packed = false,\n> @@ -866,10 +722,7 @@ const std::map<PixelFormat, PixelFormatInfo> pixelFormatInfo{\n>  \t{ formats::SGRBG16, {\n>  \t\t.name = \"SGRBG16\",\n>  \t\t.format = formats::SGRBG16,\n> -\t\t.v4l2Formats = {\n> -\t\t\t.single = V4L2PixelFormat(V4L2_PIX_FMT_SGRBG16),\n> -\t\t\t.multi = V4L2PixelFormat(),\n> -\t\t},\n> +\t\t.v4l2Formats = { V4L2PixelFormat(V4L2_PIX_FMT_SGRBG16), },\n>  \t\t.bitsPerPixel = 16,\n>  \t\t.colourEncoding = PixelFormatInfo::ColourEncodingRAW,\n>  \t\t.packed = false,\n> @@ -879,10 +732,7 @@ const std::map<PixelFormat, PixelFormatInfo> pixelFormatInfo{\n>  \t{ formats::SRGGB16, {\n>  \t\t.name = \"SRGGB16\",\n>  \t\t.format = formats::SRGGB16,\n> -\t\t.v4l2Formats = {\n> -\t\t\t.single = V4L2PixelFormat(V4L2_PIX_FMT_SRGGB16),\n> -\t\t\t.multi = V4L2PixelFormat(),\n> -\t\t},\n> +\t\t.v4l2Formats = { V4L2PixelFormat(V4L2_PIX_FMT_SRGGB16), },\n>  \t\t.bitsPerPixel = 16,\n>  \t\t.colourEncoding = PixelFormatInfo::ColourEncodingRAW,\n>  \t\t.packed = false,\n> @@ -892,10 +742,7 @@ const std::map<PixelFormat, PixelFormatInfo> pixelFormatInfo{\n>  \t{ formats::SBGGR10_IPU3, {\n>  \t\t.name = \"SBGGR10_IPU3\",\n>  \t\t.format = formats::SBGGR10_IPU3,\n> -\t\t.v4l2Formats = {\n> -\t\t\t.single = V4L2PixelFormat(V4L2_PIX_FMT_IPU3_SBGGR10),\n> -\t\t\t.multi = V4L2PixelFormat(),\n> -\t\t},\n> +\t\t.v4l2Formats = { V4L2PixelFormat(V4L2_PIX_FMT_IPU3_SBGGR10), },\n>  \t\t.bitsPerPixel = 10,\n>  \t\t.colourEncoding = PixelFormatInfo::ColourEncodingRAW,\n>  \t\t.packed = true,\n> @@ -906,10 +753,7 @@ const std::map<PixelFormat, PixelFormatInfo> pixelFormatInfo{\n>  \t{ formats::SGBRG10_IPU3, {\n>  \t\t.name = \"SGBRG10_IPU3\",\n>  \t\t.format = formats::SGBRG10_IPU3,\n> -\t\t.v4l2Formats = {\n> -\t\t\t.single = V4L2PixelFormat(V4L2_PIX_FMT_IPU3_SGBRG10),\n> -\t\t\t.multi = V4L2PixelFormat(),\n> -\t\t},\n> +\t\t.v4l2Formats = { V4L2PixelFormat(V4L2_PIX_FMT_IPU3_SGBRG10), },\n>  \t\t.bitsPerPixel = 10,\n>  \t\t.colourEncoding = PixelFormatInfo::ColourEncodingRAW,\n>  \t\t.packed = true,\n> @@ -919,10 +763,7 @@ const std::map<PixelFormat, PixelFormatInfo> pixelFormatInfo{\n>  \t{ formats::SGRBG10_IPU3, {\n>  \t\t.name = \"SGRBG10_IPU3\",\n>  \t\t.format = formats::SGRBG10_IPU3,\n> -\t\t.v4l2Formats = {\n> -\t\t\t.single = V4L2PixelFormat(V4L2_PIX_FMT_IPU3_SGRBG10),\n> -\t\t\t.multi = V4L2PixelFormat(),\n> -\t\t},\n> +\t\t.v4l2Formats = { V4L2PixelFormat(V4L2_PIX_FMT_IPU3_SGRBG10), },\n>  \t\t.bitsPerPixel = 10,\n>  \t\t.colourEncoding = PixelFormatInfo::ColourEncodingRAW,\n>  \t\t.packed = true,\n> @@ -932,10 +773,7 @@ const std::map<PixelFormat, PixelFormatInfo> pixelFormatInfo{\n>  \t{ formats::SRGGB10_IPU3, {\n>  \t\t.name = \"SRGGB10_IPU3\",\n>  \t\t.format = formats::SRGGB10_IPU3,\n> -\t\t.v4l2Formats = {\n> -\t\t\t.single = V4L2PixelFormat(V4L2_PIX_FMT_IPU3_SRGGB10),\n> -\t\t\t.multi = V4L2PixelFormat(),\n> -\t\t},\n> +\t\t.v4l2Formats = { V4L2PixelFormat(V4L2_PIX_FMT_IPU3_SRGGB10), },\n>  \t\t.bitsPerPixel = 10,\n>  \t\t.colourEncoding = PixelFormatInfo::ColourEncodingRAW,\n>  \t\t.packed = true,\n> @@ -947,10 +785,7 @@ const std::map<PixelFormat, PixelFormatInfo> pixelFormatInfo{\n>  \t{ formats::MJPEG, {\n>  \t\t.name = \"MJPEG\",\n>  \t\t.format = formats::MJPEG,\n> -\t\t.v4l2Formats = {\n> -\t\t\t.single = V4L2PixelFormat(V4L2_PIX_FMT_MJPEG),\n> -\t\t\t.multi = V4L2PixelFormat(),\n> -\t\t},\n> +\t\t.v4l2Formats = { V4L2PixelFormat(V4L2_PIX_FMT_MJPEG), },\n>  \t\t.bitsPerPixel = 0,\n>  \t\t.colourEncoding = PixelFormatInfo::ColourEncodingYUV,\n>  \t\t.packed = false,\n> @@ -996,8 +831,7 @@ const PixelFormatInfo &PixelFormatInfo::info(const V4L2PixelFormat &format)\n>  {\n>  \tconst auto &info = std::find_if(pixelFormatInfo.begin(), pixelFormatInfo.end(),\n>  \t\t\t\t\t[format](auto pair) {\n> -\t\t\t\t\t\treturn pair.second.v4l2Formats.single == format ||\n> -\t\t\t\t\t\t       pair.second.v4l2Formats.multi == format;\n> +\t\t\t\t\t\treturn pair.second.v4l2Formats[0] == format;\n\nThis should consider all the values in the vector. You do that in a\nsubsequent patch in the series, if it's not too much trouble, I'd move\nit to this one.\n\n>  \t\t\t\t\t});\n>  \tif (info == pixelFormatInfo.end())\n>  \t\treturn pixelFormatInfoInvalid;\n> diff --git a/src/libcamera/v4l2_pixelformat.cpp b/src/libcamera/v4l2_pixelformat.cpp\n> index bdcdc3be4e0c..91a882baa75b 100644\n> --- a/src/libcamera/v4l2_pixelformat.cpp\n> +++ b/src/libcamera/v4l2_pixelformat.cpp\n> @@ -304,24 +304,21 @@ PixelFormat V4L2PixelFormat::toPixelFormat() const\n>  /**\n>   * \\brief Convert \\a pixelFormat to its corresponding V4L2PixelFormat\n>   * \\param[in] pixelFormat The PixelFormat to convert\n> - * \\param[in] multiplanar V4L2 Multiplanar API support flag\n>   *\n> - * Multiple V4L2 formats may exist for one PixelFormat when the format uses\n> - * multiple planes, as V4L2 defines separate 4CCs for contiguous and separate\n> - * planes formats. Set the \\a multiplanar parameter to false to select a format\n> - * with contiguous planes, or to true to select a format with non-contiguous\n> - * planes.\n> + * Multiple V4L2 formats may exist for one PixelFormat as V4L2 defines separate\n> + * 4CCs for contiguous and non-contiguous versions of the same image format.\n> + *\n> + * Return the contiguous planes format version by default.\n\nThat's not true for formats::YVU422, formats::YUV444 and formats::YVU444\nas they have no contiguous variants. We can leave it as-is as the\nfunction is later removed, but it's easy to be accurate here:\n\n * Multiple V4L2 formats may exist for one PixelFormat as V4L2 defines separate\n * 4CCs for contiguous and non-contiguous versions of the same image format.\n * When that is the case, this function returns the contiguous planes format.\n\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\n>   *\n>   * \\return The V4L2PixelFormat corresponding to \\a pixelFormat\n>   */\n> -V4L2PixelFormat V4L2PixelFormat::fromPixelFormat(const PixelFormat &pixelFormat,\n> -\t\t\t\t\t\t bool multiplanar)\n> +V4L2PixelFormat V4L2PixelFormat::fromPixelFormat(const PixelFormat &pixelFormat)\n>  {\n>  \tconst PixelFormatInfo &info = PixelFormatInfo::info(pixelFormat);\n>  \tif (!info.isValid())\n>  \t\treturn V4L2PixelFormat();\n>  \n> -\treturn multiplanar ? info.v4l2Formats.multi : info.v4l2Formats.single;\n> +\treturn info.v4l2Formats[0];\n>  }\n>  \n>  /**","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 4A8BEBE173\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 29 Jul 2022 17:05:56 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 905F063312;\n\tFri, 29 Jul 2022 19:05:55 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 6C986603EC\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 29 Jul 2022 19:05:54 +0200 (CEST)","from pendragon.ideasonboard.com (62-78-145-57.bb.dnainternet.fi\n\t[62.78.145.57])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id BF53D6D4;\n\tFri, 29 Jul 2022 19:05:53 +0200 (CEST)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1659114355;\n\tbh=+CPVmG1Eh4xiLQtbm/3wYZL6BRGkPZDbS3azikmbENM=;\n\th=Date:To:References:In-Reply-To:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:\n\tFrom;\n\tb=JMyt9jstXASLkWc/lnnhzK1b21Xi/ByBrNYbJVtTWLZpml3kISC+bXWLxSC9RMw4N\n\t0hzhigAzA0G76LvoiTOVY9A/33Uw3AztEQKN+iqhIg3MJ+IHBV3z2yHAZ4dPnnngTH\n\tNogyvYaIhs99wRzieydDXVrn/HvB0qNNSWiUfUobQylBzh/XbmzerYCdS3poEvmrCk\n\tNpUyThUBxwsJYXFx7SYG2RxbpRfI/sC8w8j5/APrOI52994Q5cFBSy9wqT1OFQIYhr\n\tzdjmimj0x1ER7SdG5gOgrWX1oC7x9D1V8waiaw1uAo19gWMaAgLDOT+pFau9gXK1Qz\n\t8Esq17yZl9EPA==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1659114354;\n\tbh=+CPVmG1Eh4xiLQtbm/3wYZL6BRGkPZDbS3azikmbENM=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=ScRWaJ2Se3ZZVWt2N1HbVpzwwhL402lTDuQUGxrgG1RXRqIuxQV3Ch/2z2cEl2g25\n\tGh/Zv2mTinVIkEuE9KuUKaUr+Xllw2H5i7Z3qt7UWtCh//gvfXTGhnYboREavdrjOG\n\tu8jXNgEqviqcYyjHNTwvKVMeOhKPEs27pRi40NWo="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"ScRWaJ2S\"; dkim-atps=neutral","Date":"Fri, 29 Jul 2022 20:05:50 +0300","To":"Jacopo Mondi <jacopo@jmondi.org>","Message-ID":"<YuQTbsBlMGJekQEg@pendragon.ideasonboard.com>","References":"<20220729160014.101503-1-jacopo@jmondi.org>\n\t<20220729160014.101503-2-jacopo@jmondi.org>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20220729160014.101503-2-jacopo@jmondi.org>","Subject":"Re: [libcamera-devel] [PATCH v3 1/6] libcamera: formats: Merge V4L2\n\tsingle and multi formats","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","From":"Laurent Pinchart via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>","Reply-To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org, jozef@mlich.cz,\n\tPavel Machek <pavel@ucw.cz>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]