{"id":13673,"url":"https://patchwork.libcamera.org/api/1.1/patches/13673/?format=json","web_url":"https://patchwork.libcamera.org/patch/13673/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/1.1/projects/1/?format=json","name":"libcamera","link_name":"libcamera","list_id":"libcamera_core","list_email":"libcamera-devel@lists.libcamera.org","web_url":"","scm_url":"","webscm_url":""},"msgid":"<20210906225636.14683-7-laurent.pinchart@ideasonboard.com>","date":"2021-09-06T22:56:13","name":"[libcamera-devel,v3,07/30] libcamera: formats: Support V4L2 non-contiguous formats","commit_ref":null,"pull_url":null,"state":"accepted","archived":false,"hash":"74191884d3cd70aba2462882abb3f2386912d95e","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/1.1/people/2/?format=json","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/13673/mbox/","series":[{"id":2482,"url":"https://patchwork.libcamera.org/api/1.1/series/2482/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=2482","date":"2021-09-06T22:54:20","name":"libcamera: Handle fallout of FrameBuffer offset support","version":3,"mbox":"https://patchwork.libcamera.org/series/2482/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/13673/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/13673/checks/","tags":{},"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 618DABE175\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon,  6 Sep 2021 22:57:10 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 7C89669181;\n\tTue,  7 Sep 2021 00:57:09 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id D9E7569168\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue,  7 Sep 2021 00:57:01 +0200 (CEST)","from pendragon.lan (62-78-145-57.bb.dnainternet.fi [62.78.145.57])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id D4AF3993;\n\tTue,  7 Sep 2021 00:57:00 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"EgIFEEOE\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1630969021;\n\tbh=y3efOrE2gmByasjOZMIQivO7wSsltS2IB1+OKsbLtcM=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=EgIFEEOE/S64joWy90qwU2gmB6fU6aHkyHAL0svDdQIjxPZtjrziC/7IvNTbd5CEi\n\tiz6BBi7Dt4M467zg8BXtIfGFm9pl+3m8d6SLbzcWXzUn/o7MKuyknxn9LLKGHcrGWI\n\tAF/tTLhKVyE6bcHKFY0T/nQMB/oQy7VRHGNj6XMQ=","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"libcamera-devel@lists.libcamera.org","Date":"Tue,  7 Sep 2021 01:56:13 +0300","Message-Id":"<20210906225636.14683-7-laurent.pinchart@ideasonboard.com>","X-Mailer":"git-send-email 2.32.0","In-Reply-To":"<20210906225420.13275-1-laurent.pinchart@ideasonboard.com>","References":"<20210906225420.13275-1-laurent.pinchart@ideasonboard.com>","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","Subject":"[libcamera-devel] [PATCH v3 07/30] libcamera: formats: Support V4L2\n\tnon-contiguous 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>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"},"content":"V4L2 describes multi-planar formats with different 4CCs depending on\nwhether or not the planes are stored contiguously in memory. Support\nthis when translating between PixelFormat and V4L2PixelFormat.\n\nSigned-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\nReviewed-by: Hirokazu Honda <hiroh@chromium.org>\nReviewed-by: Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com>\n---\nChanges since v1:\n\n- Replace the v4l2Format array with a structure\n---\n include/libcamera/internal/formats.h |   5 +-\n src/libcamera/formats.cpp            | 284 +++++++++++++++++++++------\n src/libcamera/v4l2_pixelformat.cpp   |  11 +-\n 3 files changed, 240 insertions(+), 60 deletions(-)","diff":"diff --git a/include/libcamera/internal/formats.h b/include/libcamera/internal/formats.h\nindex b2869c93e960..5ebc68f91cda 100644\n--- a/include/libcamera/internal/formats.h\n+++ b/include/libcamera/internal/formats.h\n@@ -54,7 +54,10 @@ public:\n \t/* \\todo Add support for non-contiguous memory planes */\n \tconst char *name;\n \tPixelFormat format;\n-\tV4L2PixelFormat v4l2Format;\n+\tstruct {\n+\t\tV4L2PixelFormat single;\n+\t\tV4L2PixelFormat multi;\n+\t} v4l2Formats;\n \tunsigned int bitsPerPixel;\n \tenum ColourEncoding colourEncoding;\n \tbool packed;\ndiff --git a/src/libcamera/formats.cpp b/src/libcamera/formats.cpp\nindex ce0081a8a3d1..5bbb12347ac8 100644\n--- a/src/libcamera/formats.cpp\n+++ b/src/libcamera/formats.cpp\n@@ -55,8 +55,15 @@ LOG_DEFINE_CATEGORY(Formats)\n  * \\var PixelFormatInfo::format\n  * \\brief The PixelFormat described by this instance\n  *\n- * \\var PixelFormatInfo::v4l2Format\n- * \\brief The V4L2 pixel format corresponding to the PixelFormat\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  *\n  * \\var PixelFormatInfo::bitsPerPixel\n  * \\brief The average number of bits per pixel\n@@ -149,7 +156,10 @@ const std::map<PixelFormat, PixelFormatInfo> pixelFormatInfo{\n \t{ formats::RGB565, {\n \t\t.name = \"RGB565\",\n \t\t.format = formats::RGB565,\n-\t\t.v4l2Format = V4L2PixelFormat(V4L2_PIX_FMT_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.bitsPerPixel = 16,\n \t\t.colourEncoding = PixelFormatInfo::ColourEncodingRGB,\n \t\t.packed = false,\n@@ -159,7 +169,10 @@ 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.v4l2Format = V4L2PixelFormat(V4L2_PIX_FMT_RGB565X),\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.bitsPerPixel = 16,\n \t\t.colourEncoding = PixelFormatInfo::ColourEncodingRGB,\n \t\t.packed = false,\n@@ -169,7 +182,10 @@ const std::map<PixelFormat, PixelFormatInfo> pixelFormatInfo{\n \t{ formats::BGR888, {\n \t\t.name = \"BGR888\",\n \t\t.format = formats::BGR888,\n-\t\t.v4l2Format = V4L2PixelFormat(V4L2_PIX_FMT_RGB24),\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.bitsPerPixel = 24,\n \t\t.colourEncoding = PixelFormatInfo::ColourEncodingRGB,\n \t\t.packed = false,\n@@ -179,7 +195,10 @@ const std::map<PixelFormat, PixelFormatInfo> pixelFormatInfo{\n \t{ formats::RGB888, {\n \t\t.name = \"RGB888\",\n \t\t.format = formats::RGB888,\n-\t\t.v4l2Format = V4L2PixelFormat(V4L2_PIX_FMT_BGR24),\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.bitsPerPixel = 24,\n \t\t.colourEncoding = PixelFormatInfo::ColourEncodingRGB,\n \t\t.packed = false,\n@@ -189,7 +208,10 @@ const std::map<PixelFormat, PixelFormatInfo> pixelFormatInfo{\n \t{ formats::XRGB8888, {\n \t\t.name = \"XRGB8888\",\n \t\t.format = formats::XRGB8888,\n-\t\t.v4l2Format = V4L2PixelFormat(V4L2_PIX_FMT_XBGR32),\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.bitsPerPixel = 32,\n \t\t.colourEncoding = PixelFormatInfo::ColourEncodingRGB,\n \t\t.packed = false,\n@@ -199,7 +221,10 @@ const std::map<PixelFormat, PixelFormatInfo> pixelFormatInfo{\n \t{ formats::XBGR8888, {\n \t\t.name = \"XBGR8888\",\n \t\t.format = formats::XBGR8888,\n-\t\t.v4l2Format = V4L2PixelFormat(V4L2_PIX_FMT_RGBX32),\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.bitsPerPixel = 32,\n \t\t.colourEncoding = PixelFormatInfo::ColourEncodingRGB,\n \t\t.packed = false,\n@@ -209,7 +234,10 @@ const std::map<PixelFormat, PixelFormatInfo> pixelFormatInfo{\n \t{ formats::BGRX8888, {\n \t\t.name = \"BGRX8888\",\n \t\t.format = formats::BGRX8888,\n-\t\t.v4l2Format = V4L2PixelFormat(V4L2_PIX_FMT_XRGB32),\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.bitsPerPixel = 32,\n \t\t.colourEncoding = PixelFormatInfo::ColourEncodingRGB,\n \t\t.packed = false,\n@@ -219,7 +247,10 @@ const std::map<PixelFormat, PixelFormatInfo> pixelFormatInfo{\n \t{ formats::ABGR8888, {\n \t\t.name = \"ABGR8888\",\n \t\t.format = formats::ABGR8888,\n-\t\t.v4l2Format = V4L2PixelFormat(V4L2_PIX_FMT_RGBA32),\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.bitsPerPixel = 32,\n \t\t.colourEncoding = PixelFormatInfo::ColourEncodingRGB,\n \t\t.packed = false,\n@@ -229,7 +260,10 @@ const std::map<PixelFormat, PixelFormatInfo> pixelFormatInfo{\n \t{ formats::ARGB8888, {\n \t\t.name = \"ARGB8888\",\n \t\t.format = formats::ARGB8888,\n-\t\t.v4l2Format = V4L2PixelFormat(V4L2_PIX_FMT_ABGR32),\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.bitsPerPixel = 32,\n \t\t.colourEncoding = PixelFormatInfo::ColourEncodingRGB,\n \t\t.packed = false,\n@@ -239,7 +273,10 @@ const std::map<PixelFormat, PixelFormatInfo> pixelFormatInfo{\n \t{ formats::BGRA8888, {\n \t\t.name = \"BGRA8888\",\n \t\t.format = formats::BGRA8888,\n-\t\t.v4l2Format = V4L2PixelFormat(V4L2_PIX_FMT_ARGB32),\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.bitsPerPixel = 32,\n \t\t.colourEncoding = PixelFormatInfo::ColourEncodingRGB,\n \t\t.packed = false,\n@@ -249,7 +286,10 @@ const std::map<PixelFormat, PixelFormatInfo> pixelFormatInfo{\n \t{ formats::RGBA8888, {\n \t\t.name = \"RGBA8888\",\n \t\t.format = formats::RGBA8888,\n-\t\t.v4l2Format = V4L2PixelFormat(V4L2_PIX_FMT_BGRA32),\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.bitsPerPixel = 32,\n \t\t.colourEncoding = PixelFormatInfo::ColourEncodingRGB,\n \t\t.packed = false,\n@@ -261,7 +301,10 @@ const std::map<PixelFormat, PixelFormatInfo> pixelFormatInfo{\n \t{ formats::YUYV, {\n \t\t.name = \"YUYV\",\n \t\t.format = formats::YUYV,\n-\t\t.v4l2Format = V4L2PixelFormat(V4L2_PIX_FMT_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.bitsPerPixel = 16,\n \t\t.colourEncoding = PixelFormatInfo::ColourEncodingYUV,\n \t\t.packed = false,\n@@ -271,7 +314,10 @@ const std::map<PixelFormat, PixelFormatInfo> pixelFormatInfo{\n \t{ formats::YVYU, {\n \t\t.name = \"YVYU\",\n \t\t.format = formats::YVYU,\n-\t\t.v4l2Format = V4L2PixelFormat(V4L2_PIX_FMT_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.bitsPerPixel = 16,\n \t\t.colourEncoding = PixelFormatInfo::ColourEncodingYUV,\n \t\t.packed = false,\n@@ -281,7 +327,10 @@ const std::map<PixelFormat, PixelFormatInfo> pixelFormatInfo{\n \t{ formats::UYVY, {\n \t\t.name = \"UYVY\",\n \t\t.format = formats::UYVY,\n-\t\t.v4l2Format = V4L2PixelFormat(V4L2_PIX_FMT_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.bitsPerPixel = 16,\n \t\t.colourEncoding = PixelFormatInfo::ColourEncodingYUV,\n \t\t.packed = false,\n@@ -291,7 +340,10 @@ const std::map<PixelFormat, PixelFormatInfo> pixelFormatInfo{\n \t{ formats::VYUY, {\n \t\t.name = \"VYUY\",\n \t\t.format = formats::VYUY,\n-\t\t.v4l2Format = V4L2PixelFormat(V4L2_PIX_FMT_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.bitsPerPixel = 16,\n \t\t.colourEncoding = PixelFormatInfo::ColourEncodingYUV,\n \t\t.packed = false,\n@@ -303,7 +355,10 @@ const std::map<PixelFormat, PixelFormatInfo> pixelFormatInfo{\n \t{ formats::NV12, {\n \t\t.name = \"NV12\",\n \t\t.format = formats::NV12,\n-\t\t.v4l2Format = V4L2PixelFormat(V4L2_PIX_FMT_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},\n \t\t.bitsPerPixel = 12,\n \t\t.colourEncoding = PixelFormatInfo::ColourEncodingYUV,\n \t\t.packed = false,\n@@ -313,7 +368,10 @@ const std::map<PixelFormat, PixelFormatInfo> pixelFormatInfo{\n \t{ formats::NV21, {\n \t\t.name = \"NV21\",\n \t\t.format = formats::NV21,\n-\t\t.v4l2Format = V4L2PixelFormat(V4L2_PIX_FMT_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},\n \t\t.bitsPerPixel = 12,\n \t\t.colourEncoding = PixelFormatInfo::ColourEncodingYUV,\n \t\t.packed = false,\n@@ -323,7 +381,10 @@ const std::map<PixelFormat, PixelFormatInfo> pixelFormatInfo{\n \t{ formats::NV16, {\n \t\t.name = \"NV16\",\n \t\t.format = formats::NV16,\n-\t\t.v4l2Format = V4L2PixelFormat(V4L2_PIX_FMT_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},\n \t\t.bitsPerPixel = 16,\n \t\t.colourEncoding = PixelFormatInfo::ColourEncodingYUV,\n \t\t.packed = false,\n@@ -333,7 +394,10 @@ const std::map<PixelFormat, PixelFormatInfo> pixelFormatInfo{\n \t{ formats::NV61, {\n \t\t.name = \"NV61\",\n \t\t.format = formats::NV61,\n-\t\t.v4l2Format = V4L2PixelFormat(V4L2_PIX_FMT_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},\n \t\t.bitsPerPixel = 16,\n \t\t.colourEncoding = PixelFormatInfo::ColourEncodingYUV,\n \t\t.packed = false,\n@@ -343,7 +407,10 @@ const std::map<PixelFormat, PixelFormatInfo> pixelFormatInfo{\n \t{ formats::NV24, {\n \t\t.name = \"NV24\",\n \t\t.format = formats::NV24,\n-\t\t.v4l2Format = V4L2PixelFormat(V4L2_PIX_FMT_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.bitsPerPixel = 24,\n \t\t.colourEncoding = PixelFormatInfo::ColourEncodingYUV,\n \t\t.packed = false,\n@@ -353,7 +420,10 @@ const std::map<PixelFormat, PixelFormatInfo> pixelFormatInfo{\n \t{ formats::NV42, {\n \t\t.name = \"NV42\",\n \t\t.format = formats::NV42,\n-\t\t.v4l2Format = V4L2PixelFormat(V4L2_PIX_FMT_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.bitsPerPixel = 24,\n \t\t.colourEncoding = PixelFormatInfo::ColourEncodingYUV,\n \t\t.packed = false,\n@@ -363,7 +433,10 @@ const std::map<PixelFormat, PixelFormatInfo> pixelFormatInfo{\n \t{ formats::YUV420, {\n \t\t.name = \"YUV420\",\n \t\t.format = formats::YUV420,\n-\t\t.v4l2Format = V4L2PixelFormat(V4L2_PIX_FMT_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},\n \t\t.bitsPerPixel = 12,\n \t\t.colourEncoding = PixelFormatInfo::ColourEncodingYUV,\n \t\t.packed = false,\n@@ -373,7 +446,10 @@ const std::map<PixelFormat, PixelFormatInfo> pixelFormatInfo{\n \t{ formats::YVU420, {\n \t\t.name = \"YVU420\",\n \t\t.format = formats::YVU420,\n-\t\t.v4l2Format = V4L2PixelFormat(V4L2_PIX_FMT_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},\n \t\t.bitsPerPixel = 12,\n \t\t.colourEncoding = PixelFormatInfo::ColourEncodingYUV,\n \t\t.packed = false,\n@@ -383,7 +459,10 @@ const std::map<PixelFormat, PixelFormatInfo> pixelFormatInfo{\n \t{ formats::YUV422, {\n \t\t.name = \"YUV422\",\n \t\t.format = formats::YUV422,\n-\t\t.v4l2Format = V4L2PixelFormat(V4L2_PIX_FMT_YUV422P),\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},\n \t\t.bitsPerPixel = 16,\n \t\t.colourEncoding = PixelFormatInfo::ColourEncodingYUV,\n \t\t.packed = false,\n@@ -395,7 +474,10 @@ const std::map<PixelFormat, PixelFormatInfo> pixelFormatInfo{\n \t{ formats::R8, {\n \t\t.name = \"R8\",\n \t\t.format = formats::R8,\n-\t\t.v4l2Format = V4L2PixelFormat(V4L2_PIX_FMT_GREY),\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.bitsPerPixel = 8,\n \t\t.colourEncoding = PixelFormatInfo::ColourEncodingYUV,\n \t\t.packed = false,\n@@ -407,7 +489,10 @@ const std::map<PixelFormat, PixelFormatInfo> pixelFormatInfo{\n \t{ formats::SBGGR8, {\n \t\t.name = \"SBGGR8\",\n \t\t.format = formats::SBGGR8,\n-\t\t.v4l2Format = V4L2PixelFormat(V4L2_PIX_FMT_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.bitsPerPixel = 8,\n \t\t.colourEncoding = PixelFormatInfo::ColourEncodingRAW,\n \t\t.packed = false,\n@@ -417,7 +502,10 @@ const std::map<PixelFormat, PixelFormatInfo> pixelFormatInfo{\n \t{ formats::SGBRG8, {\n \t\t.name = \"SGBRG8\",\n \t\t.format = formats::SGBRG8,\n-\t\t.v4l2Format = V4L2PixelFormat(V4L2_PIX_FMT_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.bitsPerPixel = 8,\n \t\t.colourEncoding = PixelFormatInfo::ColourEncodingRAW,\n \t\t.packed = false,\n@@ -427,7 +515,10 @@ const std::map<PixelFormat, PixelFormatInfo> pixelFormatInfo{\n \t{ formats::SGRBG8, {\n \t\t.name = \"SGRBG8\",\n \t\t.format = formats::SGRBG8,\n-\t\t.v4l2Format = V4L2PixelFormat(V4L2_PIX_FMT_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.bitsPerPixel = 8,\n \t\t.colourEncoding = PixelFormatInfo::ColourEncodingRAW,\n \t\t.packed = false,\n@@ -437,7 +528,10 @@ const std::map<PixelFormat, PixelFormatInfo> pixelFormatInfo{\n \t{ formats::SRGGB8, {\n \t\t.name = \"SRGGB8\",\n \t\t.format = formats::SRGGB8,\n-\t\t.v4l2Format = V4L2PixelFormat(V4L2_PIX_FMT_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.bitsPerPixel = 8,\n \t\t.colourEncoding = PixelFormatInfo::ColourEncodingRAW,\n \t\t.packed = false,\n@@ -447,7 +541,10 @@ const std::map<PixelFormat, PixelFormatInfo> pixelFormatInfo{\n \t{ formats::SBGGR10, {\n \t\t.name = \"SBGGR10\",\n \t\t.format = formats::SBGGR10,\n-\t\t.v4l2Format = V4L2PixelFormat(V4L2_PIX_FMT_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.bitsPerPixel = 10,\n \t\t.colourEncoding = PixelFormatInfo::ColourEncodingRAW,\n \t\t.packed = false,\n@@ -457,7 +554,10 @@ const std::map<PixelFormat, PixelFormatInfo> pixelFormatInfo{\n \t{ formats::SGBRG10, {\n \t\t.name = \"SGBRG10\",\n \t\t.format = formats::SGBRG10,\n-\t\t.v4l2Format = V4L2PixelFormat(V4L2_PIX_FMT_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.bitsPerPixel = 10,\n \t\t.colourEncoding = PixelFormatInfo::ColourEncodingRAW,\n \t\t.packed = false,\n@@ -467,7 +567,10 @@ const std::map<PixelFormat, PixelFormatInfo> pixelFormatInfo{\n \t{ formats::SGRBG10, {\n \t\t.name = \"SGRBG10\",\n \t\t.format = formats::SGRBG10,\n-\t\t.v4l2Format = V4L2PixelFormat(V4L2_PIX_FMT_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.bitsPerPixel = 10,\n \t\t.colourEncoding = PixelFormatInfo::ColourEncodingRAW,\n \t\t.packed = false,\n@@ -477,7 +580,10 @@ const std::map<PixelFormat, PixelFormatInfo> pixelFormatInfo{\n \t{ formats::SRGGB10, {\n \t\t.name = \"SRGGB10\",\n \t\t.format = formats::SRGGB10,\n-\t\t.v4l2Format = V4L2PixelFormat(V4L2_PIX_FMT_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.bitsPerPixel = 10,\n \t\t.colourEncoding = PixelFormatInfo::ColourEncodingRAW,\n \t\t.packed = false,\n@@ -487,7 +593,10 @@ 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.v4l2Format = V4L2PixelFormat(V4L2_PIX_FMT_SBGGR10P),\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.bitsPerPixel = 10,\n \t\t.colourEncoding = PixelFormatInfo::ColourEncodingRAW,\n \t\t.packed = true,\n@@ -497,7 +606,10 @@ 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.v4l2Format = V4L2PixelFormat(V4L2_PIX_FMT_SGBRG10P),\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.bitsPerPixel = 10,\n \t\t.colourEncoding = PixelFormatInfo::ColourEncodingRAW,\n \t\t.packed = true,\n@@ -507,7 +619,10 @@ 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.v4l2Format = V4L2PixelFormat(V4L2_PIX_FMT_SGRBG10P),\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.bitsPerPixel = 10,\n \t\t.colourEncoding = PixelFormatInfo::ColourEncodingRAW,\n \t\t.packed = true,\n@@ -517,7 +632,10 @@ 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.v4l2Format = V4L2PixelFormat(V4L2_PIX_FMT_SRGGB10P),\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.bitsPerPixel = 10,\n \t\t.colourEncoding = PixelFormatInfo::ColourEncodingRAW,\n \t\t.packed = true,\n@@ -527,7 +645,10 @@ const std::map<PixelFormat, PixelFormatInfo> pixelFormatInfo{\n \t{ formats::SBGGR12, {\n \t\t.name = \"SBGGR12\",\n \t\t.format = formats::SBGGR12,\n-\t\t.v4l2Format = V4L2PixelFormat(V4L2_PIX_FMT_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.bitsPerPixel = 12,\n \t\t.colourEncoding = PixelFormatInfo::ColourEncodingRAW,\n \t\t.packed = false,\n@@ -537,7 +658,10 @@ const std::map<PixelFormat, PixelFormatInfo> pixelFormatInfo{\n \t{ formats::SGBRG12, {\n \t\t.name = \"SGBRG12\",\n \t\t.format = formats::SGBRG12,\n-\t\t.v4l2Format = V4L2PixelFormat(V4L2_PIX_FMT_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.bitsPerPixel = 12,\n \t\t.colourEncoding = PixelFormatInfo::ColourEncodingRAW,\n \t\t.packed = false,\n@@ -547,7 +671,10 @@ const std::map<PixelFormat, PixelFormatInfo> pixelFormatInfo{\n \t{ formats::SGRBG12, {\n \t\t.name = \"SGRBG12\",\n \t\t.format = formats::SGRBG12,\n-\t\t.v4l2Format = V4L2PixelFormat(V4L2_PIX_FMT_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.bitsPerPixel = 12,\n \t\t.colourEncoding = PixelFormatInfo::ColourEncodingRAW,\n \t\t.packed = false,\n@@ -557,7 +684,10 @@ const std::map<PixelFormat, PixelFormatInfo> pixelFormatInfo{\n \t{ formats::SRGGB12, {\n \t\t.name = \"SRGGB12\",\n \t\t.format = formats::SRGGB12,\n-\t\t.v4l2Format = V4L2PixelFormat(V4L2_PIX_FMT_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.bitsPerPixel = 12,\n \t\t.colourEncoding = PixelFormatInfo::ColourEncodingRAW,\n \t\t.packed = false,\n@@ -567,7 +697,10 @@ 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.v4l2Format = V4L2PixelFormat(V4L2_PIX_FMT_SBGGR12P),\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.bitsPerPixel = 12,\n \t\t.colourEncoding = PixelFormatInfo::ColourEncodingRAW,\n \t\t.packed = true,\n@@ -577,7 +710,10 @@ 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.v4l2Format = V4L2PixelFormat(V4L2_PIX_FMT_SGBRG12P),\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.bitsPerPixel = 12,\n \t\t.colourEncoding = PixelFormatInfo::ColourEncodingRAW,\n \t\t.packed = true,\n@@ -587,7 +723,10 @@ 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.v4l2Format = V4L2PixelFormat(V4L2_PIX_FMT_SGRBG12P),\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.bitsPerPixel = 12,\n \t\t.colourEncoding = PixelFormatInfo::ColourEncodingRAW,\n \t\t.packed = true,\n@@ -597,7 +736,10 @@ 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.v4l2Format = V4L2PixelFormat(V4L2_PIX_FMT_SRGGB12P),\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.bitsPerPixel = 12,\n \t\t.colourEncoding = PixelFormatInfo::ColourEncodingRAW,\n \t\t.packed = true,\n@@ -607,7 +749,10 @@ const std::map<PixelFormat, PixelFormatInfo> pixelFormatInfo{\n \t{ formats::SBGGR16, {\n \t\t.name = \"SBGGR16\",\n \t\t.format = formats::SBGGR16,\n-\t\t.v4l2Format = V4L2PixelFormat(V4L2_PIX_FMT_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.bitsPerPixel = 16,\n \t\t.colourEncoding = PixelFormatInfo::ColourEncodingRAW,\n \t\t.packed = false,\n@@ -617,7 +762,10 @@ const std::map<PixelFormat, PixelFormatInfo> pixelFormatInfo{\n \t{ formats::SGBRG16, {\n \t\t.name = \"SGBRG16\",\n \t\t.format = formats::SGBRG16,\n-\t\t.v4l2Format = V4L2PixelFormat(V4L2_PIX_FMT_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.bitsPerPixel = 16,\n \t\t.colourEncoding = PixelFormatInfo::ColourEncodingRAW,\n \t\t.packed = false,\n@@ -627,7 +775,10 @@ const std::map<PixelFormat, PixelFormatInfo> pixelFormatInfo{\n \t{ formats::SGRBG16, {\n \t\t.name = \"SGRBG16\",\n \t\t.format = formats::SGRBG16,\n-\t\t.v4l2Format = V4L2PixelFormat(V4L2_PIX_FMT_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.bitsPerPixel = 16,\n \t\t.colourEncoding = PixelFormatInfo::ColourEncodingRAW,\n \t\t.packed = false,\n@@ -637,7 +788,10 @@ const std::map<PixelFormat, PixelFormatInfo> pixelFormatInfo{\n \t{ formats::SRGGB16, {\n \t\t.name = \"SRGGB16\",\n \t\t.format = formats::SRGGB16,\n-\t\t.v4l2Format = V4L2PixelFormat(V4L2_PIX_FMT_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.bitsPerPixel = 16,\n \t\t.colourEncoding = PixelFormatInfo::ColourEncodingRAW,\n \t\t.packed = false,\n@@ -647,7 +801,10 @@ 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.v4l2Format = V4L2PixelFormat(V4L2_PIX_FMT_IPU3_SBGGR10),\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.bitsPerPixel = 10,\n \t\t.colourEncoding = PixelFormatInfo::ColourEncodingRAW,\n \t\t.packed = true,\n@@ -658,7 +815,10 @@ 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.v4l2Format = V4L2PixelFormat(V4L2_PIX_FMT_IPU3_SGBRG10),\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.bitsPerPixel = 10,\n \t\t.colourEncoding = PixelFormatInfo::ColourEncodingRAW,\n \t\t.packed = true,\n@@ -668,7 +828,10 @@ 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.v4l2Format = V4L2PixelFormat(V4L2_PIX_FMT_IPU3_SGRBG10),\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.bitsPerPixel = 10,\n \t\t.colourEncoding = PixelFormatInfo::ColourEncodingRAW,\n \t\t.packed = true,\n@@ -678,7 +841,10 @@ 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.v4l2Format = V4L2PixelFormat(V4L2_PIX_FMT_IPU3_SRGGB10),\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.bitsPerPixel = 10,\n \t\t.colourEncoding = PixelFormatInfo::ColourEncodingRAW,\n \t\t.packed = true,\n@@ -690,7 +856,10 @@ const std::map<PixelFormat, PixelFormatInfo> pixelFormatInfo{\n \t{ formats::MJPEG, {\n \t\t.name = \"MJPEG\",\n \t\t.format = formats::MJPEG,\n-\t\t.v4l2Format = V4L2PixelFormat(V4L2_PIX_FMT_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.bitsPerPixel = 0,\n \t\t.colourEncoding = PixelFormatInfo::ColourEncodingYUV,\n \t\t.packed = false,\n@@ -736,7 +905,8 @@ 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.v4l2Format == format;\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});\n \tif (info == pixelFormatInfo.end())\n \t\treturn pixelFormatInfoInvalid;\ndiff --git a/src/libcamera/v4l2_pixelformat.cpp b/src/libcamera/v4l2_pixelformat.cpp\nindex 93fc4446cc64..d1f3a42f3de2 100644\n--- a/src/libcamera/v4l2_pixelformat.cpp\n+++ b/src/libcamera/v4l2_pixelformat.cpp\n@@ -67,12 +67,19 @@ const std::map<V4L2PixelFormat, PixelFormat> vpf2pf{\n \n \t/* YUV planar formats. */\n \t{ V4L2PixelFormat(V4L2_PIX_FMT_NV16), formats::NV16 },\n+\t{ V4L2PixelFormat(V4L2_PIX_FMT_NV16M), formats::NV16 },\n \t{ V4L2PixelFormat(V4L2_PIX_FMT_NV61), formats::NV61 },\n+\t{ V4L2PixelFormat(V4L2_PIX_FMT_NV61M), formats::NV61 },\n \t{ V4L2PixelFormat(V4L2_PIX_FMT_NV12), formats::NV12 },\n+\t{ V4L2PixelFormat(V4L2_PIX_FMT_NV12M), formats::NV12 },\n \t{ V4L2PixelFormat(V4L2_PIX_FMT_NV21), formats::NV21 },\n+\t{ V4L2PixelFormat(V4L2_PIX_FMT_NV21M), formats::NV21 },\n \t{ V4L2PixelFormat(V4L2_PIX_FMT_YUV420), formats::YUV420 },\n+\t{ V4L2PixelFormat(V4L2_PIX_FMT_YUV420M), formats::YUV420 },\n \t{ V4L2PixelFormat(V4L2_PIX_FMT_YVU420), formats::YVU420 },\n+\t{ V4L2PixelFormat(V4L2_PIX_FMT_YVU420M), formats::YVU420 },\n \t{ V4L2PixelFormat(V4L2_PIX_FMT_YUV422P), formats::YUV422 },\n+\t{ V4L2PixelFormat(V4L2_PIX_FMT_YUV422M), formats::YUV422 },\n \n \t/* Greyscale formats. */\n \t{ V4L2PixelFormat(V4L2_PIX_FMT_GREY), formats::R8 },\n@@ -202,13 +209,13 @@ PixelFormat V4L2PixelFormat::toPixelFormat() const\n  * \\return The V4L2PixelFormat corresponding to \\a pixelFormat\n  */\n V4L2PixelFormat V4L2PixelFormat::fromPixelFormat(const PixelFormat &pixelFormat,\n-\t\t\t\t\t\t [[maybe_unused]] bool multiplanar)\n+\t\t\t\t\t\t bool multiplanar)\n {\n \tconst PixelFormatInfo &info = PixelFormatInfo::info(pixelFormat);\n \tif (!info.isValid())\n \t\treturn V4L2PixelFormat();\n \n-\treturn info.v4l2Format;\n+\treturn multiplanar ? info.v4l2Formats.multi : info.v4l2Formats.single;\n }\n \n } /* namespace libcamera */\n","prefixes":["libcamera-devel","v3","07/30"]}