[{"id":28778,"web_url":"https://patchwork.libcamera.org/comment/28778/","msgid":"<gp3kb64gzvanapli5i6kzh5322gy2idxezjvcy432aemea7z2g@pasllllygfvd>","date":"2024-02-28T08:35:11","subject":"Re: [PATCH 4/9] libcamera: v4l2_subdevice: Extend MediaBusFormatInfo\n\twith metadata formats","submitter":{"id":143,"url":"https://patchwork.libcamera.org/api/people/143/","name":"Jacopo Mondi","email":"jacopo.mondi@ideasonboard.com"},"content":"On Tue, Feb 27, 2024 at 04:09:48PM +0200, Laurent Pinchart wrote:\n> Not all media bus formats describe image formats. Extend the\n> MediaBusFormatInfo class with a type member to indicate if the format\n> corresponds to image data or metadata, and add the (only) metatdata\n> format supported by the kernel to the known mediaBusFormatInfo.\n>\n> The kernel doesn't (yet) have any metadata format specific to sensor\n> embedded data. This is being addressed in the V4L2 API. In preparation\n> for embedded data support, already introduce the EmbeddedData type here.\n> Corresponding formats will be added when available.\n>\n> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n> ---\n>  include/libcamera/internal/v4l2_subdevice.h |   7 ++\n>  src/libcamera/v4l2_subdevice.cpp            | 106 +++++++++++++++++++-\n>  2 files changed, 112 insertions(+), 1 deletion(-)\n>\n> diff --git a/include/libcamera/internal/v4l2_subdevice.h b/include/libcamera/internal/v4l2_subdevice.h\n> index a4df9ddfd322..c9aa90e00ec8 100644\n> --- a/include/libcamera/internal/v4l2_subdevice.h\n> +++ b/include/libcamera/internal/v4l2_subdevice.h\n> @@ -32,12 +32,19 @@ class MediaDevice;\n>  class MediaBusFormatInfo\n>  {\n>  public:\n> +\tenum class Type {\n> +\t\tImage,\n> +\t\tMetadata,\n> +\t\tEmbeddedData,\n> +\t};\n> +\n>  \tbool isValid() const { return code != 0; }\n>\n>  \tstatic const MediaBusFormatInfo &info(uint32_t code);\n>\n>  \tconst char *name;\n>  \tuint32_t code;\n> +\tType type;\n>  \tunsigned int bitsPerPixel;\n>  \tPixelFormatInfo::ColourEncoding colourEncoding;\n>  };\n> diff --git a/src/libcamera/v4l2_subdevice.cpp b/src/libcamera/v4l2_subdevice.cpp\n> index fd289ae9ae6f..a535bf63c332 100644\n> --- a/src/libcamera/v4l2_subdevice.cpp\n> +++ b/src/libcamera/v4l2_subdevice.cpp\n> @@ -51,6 +51,9 @@ LOG_DECLARE_CATEGORY(V4L2)\n>   * \\var MediaBusFormatInfo::code\n>   * \\brief The media bus format code described by this instance\n>   *\n> + * \\var MediaBusFormatInfo::type\n> + * \\brief The media bus format type\n> + *\n>   * \\var MediaBusFormatInfo::bitsPerPixel\n>   * \\brief The average number of bits per pixel\n>   *\n> @@ -62,10 +65,26 @@ LOG_DECLARE_CATEGORY(V4L2)\n>   * value will differ from the bus width.\n>   *\n>   * Formats that don't have a fixed number of bits per pixel, such as compressed\n> - * formats, report 0 in this field.\n> + * formats, or device-specific embedded data formats, report 0 in this field.\n\nNot only the device specific ones, but the generic metadata types too!\n\n>   *\n>   * \\var MediaBusFormatInfo::colourEncoding\n>   * \\brief The colour encoding type\n> + *\n> + * This field is valid for Type::Image formats only.\n> + */\n> +\n> +/**\n> + * \\enum MediaBusFormatInfo::Type\n> + * \\brief The format type\n> + *\n> + * \\var MediaBusFormatInfo::Type::Image\n> + * \\brief The format describes image data\n> + *\n> + * \\var MediaBusFormatInfo::Type::Metadata\n> + * \\brief The format describes generic metadata\n> + *\n> + * \\var MediaBusFormatInfo::Type::EmbeddedData\n> + * \\brief The format describes sensor embedded data\n>   */\n>\n>  namespace {\n> @@ -75,456 +94,532 @@ const std::map<uint32_t, MediaBusFormatInfo> mediaBusFormatInfo{\n>  \t{ MEDIA_BUS_FMT_RGB444_2X8_PADHI_BE, {\n>  \t\t.name = \"RGB444_2X8_PADHI_BE\",\n>  \t\t.code = MEDIA_BUS_FMT_RGB444_2X8_PADHI_BE,\n> +\t\t.type = MediaBusFormatInfo::Type::Image,\n>  \t\t.bitsPerPixel = 16,\n>  \t\t.colourEncoding = PixelFormatInfo::ColourEncodingRGB,\n>  \t} },\n>  \t{ MEDIA_BUS_FMT_RGB444_2X8_PADHI_LE, {\n>  \t\t.name = \"RGB444_2X8_PADHI_LE\",\n>  \t\t.code = MEDIA_BUS_FMT_RGB444_2X8_PADHI_LE,\n> +\t\t.type = MediaBusFormatInfo::Type::Image,\n>  \t\t.bitsPerPixel = 16,\n>  \t\t.colourEncoding = PixelFormatInfo::ColourEncodingRGB,\n>  \t} },\n>  \t{ MEDIA_BUS_FMT_RGB555_2X8_PADHI_BE, {\n>  \t\t.name = \"RGB555_2X8_PADHI_BE\",\n>  \t\t.code = MEDIA_BUS_FMT_RGB555_2X8_PADHI_BE,\n> +\t\t.type = MediaBusFormatInfo::Type::Image,\n>  \t\t.bitsPerPixel = 16,\n>  \t\t.colourEncoding = PixelFormatInfo::ColourEncodingRGB,\n>  \t} },\n>  \t{ MEDIA_BUS_FMT_RGB555_2X8_PADHI_LE, {\n>  \t\t.name = \"RGB555_2X8_PADHI_LE\",\n>  \t\t.code = MEDIA_BUS_FMT_RGB555_2X8_PADHI_LE,\n> +\t\t.type = MediaBusFormatInfo::Type::Image,\n>  \t\t.bitsPerPixel = 16,\n>  \t\t.colourEncoding = PixelFormatInfo::ColourEncodingRGB,\n>  \t} },\n>  \t{ MEDIA_BUS_FMT_RGB565_1X16, {\n>  \t\t.name = \"RGB565_1X16\",\n>  \t\t.code = MEDIA_BUS_FMT_RGB565_1X16,\n> +\t\t.type = MediaBusFormatInfo::Type::Image,\n>  \t\t.bitsPerPixel = 16,\n>  \t\t.colourEncoding = PixelFormatInfo::ColourEncodingRGB,\n>  \t} },\n>  \t{ MEDIA_BUS_FMT_BGR565_2X8_BE, {\n>  \t\t.name = \"BGR565_2X8_BE\",\n>  \t\t.code = MEDIA_BUS_FMT_BGR565_2X8_BE,\n> +\t\t.type = MediaBusFormatInfo::Type::Image,\n>  \t\t.bitsPerPixel = 16,\n>  \t\t.colourEncoding = PixelFormatInfo::ColourEncodingRGB,\n>  \t} },\n>  \t{ MEDIA_BUS_FMT_BGR565_2X8_LE, {\n>  \t\t.name = \"BGR565_2X8_LE\",\n>  \t\t.code = MEDIA_BUS_FMT_BGR565_2X8_LE,\n> +\t\t.type = MediaBusFormatInfo::Type::Image,\n>  \t\t.bitsPerPixel = 16,\n>  \t\t.colourEncoding = PixelFormatInfo::ColourEncodingRGB,\n>  \t} },\n>  \t{ MEDIA_BUS_FMT_RGB565_2X8_BE, {\n>  \t\t.name = \"RGB565_2X8_BE\",\n>  \t\t.code = MEDIA_BUS_FMT_RGB565_2X8_BE,\n> +\t\t.type = MediaBusFormatInfo::Type::Image,\n>  \t\t.bitsPerPixel = 16,\n>  \t\t.colourEncoding = PixelFormatInfo::ColourEncodingRGB,\n>  \t} },\n>  \t{ MEDIA_BUS_FMT_RGB565_2X8_LE, {\n>  \t\t.name = \"RGB565_2X8_LE\",\n>  \t\t.code = MEDIA_BUS_FMT_RGB565_2X8_LE,\n> +\t\t.type = MediaBusFormatInfo::Type::Image,\n>  \t\t.bitsPerPixel = 16,\n>  \t\t.colourEncoding = PixelFormatInfo::ColourEncodingRGB,\n>  \t} },\n>  \t{ MEDIA_BUS_FMT_RGB666_1X18, {\n>  \t\t.name = \"RGB666_1X18\",\n>  \t\t.code = MEDIA_BUS_FMT_RGB666_1X18,\n> +\t\t.type = MediaBusFormatInfo::Type::Image,\n>  \t\t.bitsPerPixel = 18,\n>  \t\t.colourEncoding = PixelFormatInfo::ColourEncodingRGB,\n>  \t} },\n>  \t{ MEDIA_BUS_FMT_BGR888_1X24, {\n>  \t\t.name = \"BGR888_1X24\",\n>  \t\t.code = MEDIA_BUS_FMT_BGR888_1X24,\n> +\t\t.type = MediaBusFormatInfo::Type::Image,\n>  \t\t.bitsPerPixel = 24,\n>  \t\t.colourEncoding = PixelFormatInfo::ColourEncodingRGB,\n>  \t} },\n>  \t{ MEDIA_BUS_FMT_RGB888_1X24, {\n>  \t\t.name = \"RGB888_1X24\",\n>  \t\t.code = MEDIA_BUS_FMT_RGB888_1X24,\n> +\t\t.type = MediaBusFormatInfo::Type::Image,\n>  \t\t.bitsPerPixel = 24,\n>  \t\t.colourEncoding = PixelFormatInfo::ColourEncodingRGB,\n>  \t} },\n>  \t{ MEDIA_BUS_FMT_RGB888_2X12_BE, {\n>  \t\t.name = \"RGB888_2X12_BE\",\n>  \t\t.code = MEDIA_BUS_FMT_RGB888_2X12_BE,\n> +\t\t.type = MediaBusFormatInfo::Type::Image,\n>  \t\t.bitsPerPixel = 24,\n>  \t\t.colourEncoding = PixelFormatInfo::ColourEncodingRGB,\n>  \t} },\n>  \t{ MEDIA_BUS_FMT_RGB888_2X12_LE, {\n>  \t\t.name = \"RGB888_2X12_LE\",\n>  \t\t.code = MEDIA_BUS_FMT_RGB888_2X12_LE,\n> +\t\t.type = MediaBusFormatInfo::Type::Image,\n>  \t\t.bitsPerPixel = 24,\n>  \t\t.colourEncoding = PixelFormatInfo::ColourEncodingRGB,\n>  \t} },\n>  \t{ MEDIA_BUS_FMT_ARGB8888_1X32, {\n>  \t\t.name = \"ARGB8888_1X32\",\n>  \t\t.code = MEDIA_BUS_FMT_ARGB8888_1X32,\n> +\t\t.type = MediaBusFormatInfo::Type::Image,\n>  \t\t.bitsPerPixel = 32,\n>  \t\t.colourEncoding = PixelFormatInfo::ColourEncodingRGB,\n>  \t} },\n>  \t{ MEDIA_BUS_FMT_Y8_1X8, {\n>  \t\t.name = \"Y8_1X8\",\n>  \t\t.code = MEDIA_BUS_FMT_Y8_1X8,\n> +\t\t.type = MediaBusFormatInfo::Type::Image,\n>  \t\t.bitsPerPixel = 8,\n>  \t\t.colourEncoding = PixelFormatInfo::ColourEncodingYUV,\n>  \t} },\n>  \t{ MEDIA_BUS_FMT_UV8_1X8, {\n>  \t\t.name = \"UV8_1X8\",\n>  \t\t.code = MEDIA_BUS_FMT_UV8_1X8,\n> +\t\t.type = MediaBusFormatInfo::Type::Image,\n>  \t\t.bitsPerPixel = 8,\n>  \t\t.colourEncoding = PixelFormatInfo::ColourEncodingYUV,\n>  \t} },\n>  \t{ MEDIA_BUS_FMT_UYVY8_1_5X8, {\n>  \t\t.name = \"UYVY8_1_5X8\",\n>  \t\t.code = MEDIA_BUS_FMT_UYVY8_1_5X8,\n> +\t\t.type = MediaBusFormatInfo::Type::Image,\n>  \t\t.bitsPerPixel = 12,\n>  \t\t.colourEncoding = PixelFormatInfo::ColourEncodingYUV,\n>  \t} },\n>  \t{ MEDIA_BUS_FMT_VYUY8_1_5X8, {\n>  \t\t.name = \"VYUY8_1_5X8\",\n>  \t\t.code = MEDIA_BUS_FMT_VYUY8_1_5X8,\n> +\t\t.type = MediaBusFormatInfo::Type::Image,\n>  \t\t.bitsPerPixel = 12,\n>  \t\t.colourEncoding = PixelFormatInfo::ColourEncodingYUV,\n>  \t} },\n>  \t{ MEDIA_BUS_FMT_YUYV8_1_5X8, {\n>  \t\t.name = \"YUYV8_1_5X8\",\n>  \t\t.code = MEDIA_BUS_FMT_YUYV8_1_5X8,\n> +\t\t.type = MediaBusFormatInfo::Type::Image,\n>  \t\t.bitsPerPixel = 12,\n>  \t\t.colourEncoding = PixelFormatInfo::ColourEncodingYUV,\n>  \t} },\n>  \t{ MEDIA_BUS_FMT_YVYU8_1_5X8, {\n>  \t\t.name = \"YVYU8_1_5X8\",\n>  \t\t.code = MEDIA_BUS_FMT_YVYU8_1_5X8,\n> +\t\t.type = MediaBusFormatInfo::Type::Image,\n>  \t\t.bitsPerPixel = 12,\n>  \t\t.colourEncoding = PixelFormatInfo::ColourEncodingYUV,\n>  \t} },\n>  \t{ MEDIA_BUS_FMT_UYVY8_2X8, {\n>  \t\t.name = \"UYVY8_2X8\",\n>  \t\t.code = MEDIA_BUS_FMT_UYVY8_2X8,\n> +\t\t.type = MediaBusFormatInfo::Type::Image,\n>  \t\t.bitsPerPixel = 16,\n>  \t\t.colourEncoding = PixelFormatInfo::ColourEncodingYUV,\n>  \t} },\n>  \t{ MEDIA_BUS_FMT_VYUY8_2X8, {\n>  \t\t.name = \"VYUY8_2X8\",\n>  \t\t.code = MEDIA_BUS_FMT_VYUY8_2X8,\n> +\t\t.type = MediaBusFormatInfo::Type::Image,\n>  \t\t.bitsPerPixel = 16,\n>  \t\t.colourEncoding = PixelFormatInfo::ColourEncodingYUV,\n>  \t} },\n>  \t{ MEDIA_BUS_FMT_YUYV8_2X8, {\n>  \t\t.name = \"YUYV8_2X8\",\n>  \t\t.code = MEDIA_BUS_FMT_YUYV8_2X8,\n> +\t\t.type = MediaBusFormatInfo::Type::Image,\n>  \t\t.bitsPerPixel = 16,\n>  \t\t.colourEncoding = PixelFormatInfo::ColourEncodingYUV,\n>  \t} },\n>  \t{ MEDIA_BUS_FMT_YVYU8_2X8, {\n>  \t\t.name = \"YVYU8_2X8\",\n>  \t\t.code = MEDIA_BUS_FMT_YVYU8_2X8,\n> +\t\t.type = MediaBusFormatInfo::Type::Image,\n>  \t\t.bitsPerPixel = 16,\n>  \t\t.colourEncoding = PixelFormatInfo::ColourEncodingYUV,\n>  \t} },\n>  \t{ MEDIA_BUS_FMT_Y10_1X10, {\n>  \t\t.name = \"Y10_1X10\",\n>  \t\t.code = MEDIA_BUS_FMT_Y10_1X10,\n> +\t\t.type = MediaBusFormatInfo::Type::Image,\n>  \t\t.bitsPerPixel = 10,\n>  \t\t.colourEncoding = PixelFormatInfo::ColourEncodingYUV,\n>  \t} },\n>  \t{ MEDIA_BUS_FMT_UYVY10_2X10, {\n>  \t\t.name = \"UYVY10_2X10\",\n>  \t\t.code = MEDIA_BUS_FMT_UYVY10_2X10,\n> +\t\t.type = MediaBusFormatInfo::Type::Image,\n>  \t\t.bitsPerPixel = 20,\n>  \t\t.colourEncoding = PixelFormatInfo::ColourEncodingYUV,\n>  \t} },\n>  \t{ MEDIA_BUS_FMT_VYUY10_2X10, {\n>  \t\t.name = \"VYUY10_2X10\",\n>  \t\t.code = MEDIA_BUS_FMT_VYUY10_2X10,\n> +\t\t.type = MediaBusFormatInfo::Type::Image,\n>  \t\t.bitsPerPixel = 20,\n>  \t\t.colourEncoding = PixelFormatInfo::ColourEncodingYUV,\n>  \t} },\n>  \t{ MEDIA_BUS_FMT_YUYV10_2X10, {\n>  \t\t.name = \"YUYV10_2X10\",\n>  \t\t.code = MEDIA_BUS_FMT_YUYV10_2X10,\n> +\t\t.type = MediaBusFormatInfo::Type::Image,\n>  \t\t.bitsPerPixel = 20,\n>  \t\t.colourEncoding = PixelFormatInfo::ColourEncodingYUV,\n>  \t} },\n>  \t{ MEDIA_BUS_FMT_YVYU10_2X10, {\n>  \t\t.name = \"YVYU10_2X10\",\n>  \t\t.code = MEDIA_BUS_FMT_YVYU10_2X10,\n> +\t\t.type = MediaBusFormatInfo::Type::Image,\n>  \t\t.bitsPerPixel = 20,\n>  \t\t.colourEncoding = PixelFormatInfo::ColourEncodingYUV,\n>  \t} },\n>  \t{ MEDIA_BUS_FMT_Y12_1X12, {\n>  \t\t.name = \"Y12_1X12\",\n>  \t\t.code = MEDIA_BUS_FMT_Y12_1X12,\n> +\t\t.type = MediaBusFormatInfo::Type::Image,\n>  \t\t.bitsPerPixel = 12,\n>  \t\t.colourEncoding = PixelFormatInfo::ColourEncodingYUV,\n>  \t} },\n>  \t{ MEDIA_BUS_FMT_Y16_1X16, {\n>  \t\t.name = \"Y16_1X16\",\n>  \t\t.code = MEDIA_BUS_FMT_Y16_1X16,\n> +\t\t.type = MediaBusFormatInfo::Type::Image,\n>  \t\t.bitsPerPixel = 16,\n>  \t\t.colourEncoding = PixelFormatInfo::ColourEncodingYUV,\n>  \t} },\n>  \t{ MEDIA_BUS_FMT_UYVY8_1X16, {\n>  \t\t.name = \"UYVY8_1X16\",\n>  \t\t.code = MEDIA_BUS_FMT_UYVY8_1X16,\n> +\t\t.type = MediaBusFormatInfo::Type::Image,\n>  \t\t.bitsPerPixel = 16,\n>  \t\t.colourEncoding = PixelFormatInfo::ColourEncodingYUV,\n>  \t} },\n>  \t{ MEDIA_BUS_FMT_VYUY8_1X16, {\n>  \t\t.name = \"VYUY8_1X16\",\n>  \t\t.code = MEDIA_BUS_FMT_VYUY8_1X16,\n> +\t\t.type = MediaBusFormatInfo::Type::Image,\n>  \t\t.bitsPerPixel = 16,\n>  \t\t.colourEncoding = PixelFormatInfo::ColourEncodingYUV,\n>  \t} },\n>  \t{ MEDIA_BUS_FMT_YUYV8_1X16, {\n>  \t\t.name = \"YUYV8_1X16\",\n>  \t\t.code = MEDIA_BUS_FMT_YUYV8_1X16,\n> +\t\t.type = MediaBusFormatInfo::Type::Image,\n>  \t\t.bitsPerPixel = 16,\n>  \t\t.colourEncoding = PixelFormatInfo::ColourEncodingYUV,\n>  \t} },\n>  \t{ MEDIA_BUS_FMT_YVYU8_1X16, {\n>  \t\t.name = \"YVYU8_1X16\",\n>  \t\t.code = MEDIA_BUS_FMT_YVYU8_1X16,\n> +\t\t.type = MediaBusFormatInfo::Type::Image,\n>  \t\t.bitsPerPixel = 16,\n>  \t\t.colourEncoding = PixelFormatInfo::ColourEncodingYUV,\n>  \t} },\n>  \t{ MEDIA_BUS_FMT_YDYUYDYV8_1X16, {\n>  \t\t.name = \"YDYUYDYV8_1X16\",\n>  \t\t.code = MEDIA_BUS_FMT_YDYUYDYV8_1X16,\n> +\t\t.type = MediaBusFormatInfo::Type::Image,\n>  \t\t.bitsPerPixel = 16,\n>  \t\t.colourEncoding = PixelFormatInfo::ColourEncodingYUV,\n>  \t} },\n>  \t{ MEDIA_BUS_FMT_UYVY10_1X20, {\n>  \t\t.name = \"UYVY10_1X20\",\n>  \t\t.code = MEDIA_BUS_FMT_UYVY10_1X20,\n> +\t\t.type = MediaBusFormatInfo::Type::Image,\n>  \t\t.bitsPerPixel = 20,\n>  \t\t.colourEncoding = PixelFormatInfo::ColourEncodingYUV,\n>  \t} },\n>  \t{ MEDIA_BUS_FMT_VYUY10_1X20, {\n>  \t\t.name = \"VYUY10_1X20\",\n>  \t\t.code = MEDIA_BUS_FMT_VYUY10_1X20,\n> +\t\t.type = MediaBusFormatInfo::Type::Image,\n>  \t\t.bitsPerPixel = 20,\n>  \t\t.colourEncoding = PixelFormatInfo::ColourEncodingYUV,\n>  \t} },\n>  \t{ MEDIA_BUS_FMT_YUYV10_1X20, {\n>  \t\t.name = \"YUYV10_1X20\",\n>  \t\t.code = MEDIA_BUS_FMT_YUYV10_1X20,\n> +\t\t.type = MediaBusFormatInfo::Type::Image,\n>  \t\t.bitsPerPixel = 20,\n>  \t\t.colourEncoding = PixelFormatInfo::ColourEncodingYUV,\n>  \t} },\n>  \t{ MEDIA_BUS_FMT_YVYU10_1X20, {\n>  \t\t.name = \"YVYU10_1X20\",\n>  \t\t.code = MEDIA_BUS_FMT_YVYU10_1X20,\n> +\t\t.type = MediaBusFormatInfo::Type::Image,\n>  \t\t.bitsPerPixel = 20,\n>  \t\t.colourEncoding = PixelFormatInfo::ColourEncodingYUV,\n>  \t} },\n>  \t{ MEDIA_BUS_FMT_YUV8_1X24, {\n>  \t\t.name = \"YUV8_1X24\",\n>  \t\t.code = MEDIA_BUS_FMT_YUV8_1X24,\n> +\t\t.type = MediaBusFormatInfo::Type::Image,\n>  \t\t.bitsPerPixel = 24,\n>  \t\t.colourEncoding = PixelFormatInfo::ColourEncodingYUV,\n>  \t} },\n>  \t{ MEDIA_BUS_FMT_YUV10_1X30, {\n>  \t\t.name = \"YUV10_1X30\",\n>  \t\t.code = MEDIA_BUS_FMT_YUV10_1X30,\n> +\t\t.type = MediaBusFormatInfo::Type::Image,\n>  \t\t.bitsPerPixel = 30,\n>  \t\t.colourEncoding = PixelFormatInfo::ColourEncodingYUV,\n>  \t} },\n>  \t{ MEDIA_BUS_FMT_AYUV8_1X32, {\n>  \t\t.name = \"AYUV8_1X32\",\n>  \t\t.code = MEDIA_BUS_FMT_AYUV8_1X32,\n> +\t\t.type = MediaBusFormatInfo::Type::Image,\n>  \t\t.bitsPerPixel = 32,\n>  \t\t.colourEncoding = PixelFormatInfo::ColourEncodingYUV,\n>  \t} },\n>  \t{ MEDIA_BUS_FMT_UYVY12_2X12, {\n>  \t\t.name = \"UYVY12_2X12\",\n>  \t\t.code = MEDIA_BUS_FMT_UYVY12_2X12,\n> +\t\t.type = MediaBusFormatInfo::Type::Image,\n>  \t\t.bitsPerPixel = 24,\n>  \t\t.colourEncoding = PixelFormatInfo::ColourEncodingYUV,\n>  \t} },\n>  \t{ MEDIA_BUS_FMT_VYUY12_2X12, {\n>  \t\t.name = \"VYUY12_2X12\",\n>  \t\t.code = MEDIA_BUS_FMT_VYUY12_2X12,\n> +\t\t.type = MediaBusFormatInfo::Type::Image,\n>  \t\t.bitsPerPixel = 24,\n>  \t\t.colourEncoding = PixelFormatInfo::ColourEncodingYUV,\n>  \t} },\n>  \t{ MEDIA_BUS_FMT_YUYV12_2X12, {\n>  \t\t.name = \"YUYV12_2X12\",\n>  \t\t.code = MEDIA_BUS_FMT_YUYV12_2X12,\n> +\t\t.type = MediaBusFormatInfo::Type::Image,\n>  \t\t.bitsPerPixel = 24,\n>  \t\t.colourEncoding = PixelFormatInfo::ColourEncodingYUV,\n>  \t} },\n>  \t{ MEDIA_BUS_FMT_YVYU12_2X12, {\n>  \t\t.name = \"YVYU12_2X12\",\n>  \t\t.code = MEDIA_BUS_FMT_YVYU12_2X12,\n> +\t\t.type = MediaBusFormatInfo::Type::Image,\n>  \t\t.bitsPerPixel = 24,\n>  \t\t.colourEncoding = PixelFormatInfo::ColourEncodingYUV,\n>  \t} },\n>  \t{ MEDIA_BUS_FMT_UYVY12_1X24, {\n>  \t\t.name = \"UYVY12_1X24\",\n>  \t\t.code = MEDIA_BUS_FMT_UYVY12_1X24,\n> +\t\t.type = MediaBusFormatInfo::Type::Image,\n>  \t\t.bitsPerPixel = 24,\n>  \t\t.colourEncoding = PixelFormatInfo::ColourEncodingYUV,\n>  \t} },\n>  \t{ MEDIA_BUS_FMT_VYUY12_1X24, {\n>  \t\t.name = \"VYUY12_1X24\",\n>  \t\t.code = MEDIA_BUS_FMT_VYUY12_1X24,\n> +\t\t.type = MediaBusFormatInfo::Type::Image,\n>  \t\t.bitsPerPixel = 24,\n>  \t\t.colourEncoding = PixelFormatInfo::ColourEncodingYUV,\n>  \t} },\n>  \t{ MEDIA_BUS_FMT_YUYV12_1X24, {\n>  \t\t.name = \"YUYV12_1X24\",\n>  \t\t.code = MEDIA_BUS_FMT_YUYV12_1X24,\n> +\t\t.type = MediaBusFormatInfo::Type::Image,\n>  \t\t.bitsPerPixel = 24,\n>  \t\t.colourEncoding = PixelFormatInfo::ColourEncodingYUV,\n>  \t} },\n>  \t{ MEDIA_BUS_FMT_YVYU12_1X24, {\n>  \t\t.name = \"YVYU12_1X24\",\n>  \t\t.code = MEDIA_BUS_FMT_YVYU12_1X24,\n> +\t\t.type = MediaBusFormatInfo::Type::Image,\n>  \t\t.bitsPerPixel = 24,\n>  \t\t.colourEncoding = PixelFormatInfo::ColourEncodingYUV,\n>  \t} },\n>  \t{ MEDIA_BUS_FMT_SBGGR8_1X8, {\n>  \t\t.name = \"SBGGR8_1X8\",\n>  \t\t.code = MEDIA_BUS_FMT_SBGGR8_1X8,\n> +\t\t.type = MediaBusFormatInfo::Type::Image,\n>  \t\t.bitsPerPixel = 8,\n>  \t\t.colourEncoding = PixelFormatInfo::ColourEncodingRAW,\n>  \t} },\n>  \t{ MEDIA_BUS_FMT_SGBRG8_1X8, {\n>  \t\t.name = \"SGBRG8_1X8\",\n>  \t\t.code = MEDIA_BUS_FMT_SGBRG8_1X8,\n> +\t\t.type = MediaBusFormatInfo::Type::Image,\n>  \t\t.bitsPerPixel = 8,\n>  \t\t.colourEncoding = PixelFormatInfo::ColourEncodingRAW,\n>  \t} },\n>  \t{ MEDIA_BUS_FMT_SGRBG8_1X8, {\n>  \t\t.name = \"SGRBG8_1X8\",\n>  \t\t.code = MEDIA_BUS_FMT_SGRBG8_1X8,\n> +\t\t.type = MediaBusFormatInfo::Type::Image,\n>  \t\t.bitsPerPixel = 8,\n>  \t\t.colourEncoding = PixelFormatInfo::ColourEncodingRAW,\n>  \t} },\n>  \t{ MEDIA_BUS_FMT_SRGGB8_1X8, {\n>  \t\t.name = \"SRGGB8_1X8\",\n>  \t\t.code = MEDIA_BUS_FMT_SRGGB8_1X8,\n> +\t\t.type = MediaBusFormatInfo::Type::Image,\n>  \t\t.bitsPerPixel = 8,\n>  \t\t.colourEncoding = PixelFormatInfo::ColourEncodingRAW,\n>  \t} },\n>  \t{ MEDIA_BUS_FMT_SBGGR10_ALAW8_1X8, {\n>  \t\t.name = \"SBGGR10_ALAW8_1X8\",\n>  \t\t.code = MEDIA_BUS_FMT_SBGGR10_ALAW8_1X8,\n> +\t\t.type = MediaBusFormatInfo::Type::Image,\n>  \t\t.bitsPerPixel = 8,\n>  \t\t.colourEncoding = PixelFormatInfo::ColourEncodingRAW,\n>  \t} },\n>  \t{ MEDIA_BUS_FMT_SGBRG10_ALAW8_1X8, {\n>  \t\t.name = \"SGBRG10_ALAW8_1X8\",\n>  \t\t.code = MEDIA_BUS_FMT_SGBRG10_ALAW8_1X8,\n> +\t\t.type = MediaBusFormatInfo::Type::Image,\n>  \t\t.bitsPerPixel = 8,\n>  \t\t.colourEncoding = PixelFormatInfo::ColourEncodingRAW,\n>  \t} },\n>  \t{ MEDIA_BUS_FMT_SGRBG10_ALAW8_1X8, {\n>  \t\t.name = \"SGRBG10_ALAW8_1X8\",\n>  \t\t.code = MEDIA_BUS_FMT_SGRBG10_ALAW8_1X8,\n> +\t\t.type = MediaBusFormatInfo::Type::Image,\n>  \t\t.bitsPerPixel = 8,\n>  \t\t.colourEncoding = PixelFormatInfo::ColourEncodingRAW,\n>  \t} },\n>  \t{ MEDIA_BUS_FMT_SRGGB10_ALAW8_1X8, {\n>  \t\t.name = \"SRGGB10_ALAW8_1X8\",\n>  \t\t.code = MEDIA_BUS_FMT_SRGGB10_ALAW8_1X8,\n> +\t\t.type = MediaBusFormatInfo::Type::Image,\n>  \t\t.bitsPerPixel = 8,\n>  \t\t.colourEncoding = PixelFormatInfo::ColourEncodingRAW,\n>  \t} },\n>  \t{ MEDIA_BUS_FMT_SBGGR10_DPCM8_1X8, {\n>  \t\t.name = \"SBGGR10_DPCM8_1X8\",\n>  \t\t.code = MEDIA_BUS_FMT_SBGGR10_DPCM8_1X8,\n> +\t\t.type = MediaBusFormatInfo::Type::Image,\n>  \t\t.bitsPerPixel = 8,\n>  \t\t.colourEncoding = PixelFormatInfo::ColourEncodingRAW,\n>  \t} },\n>  \t{ MEDIA_BUS_FMT_SGBRG10_DPCM8_1X8, {\n>  \t\t.name = \"SGBRG10_DPCM8_1X8\",\n>  \t\t.code = MEDIA_BUS_FMT_SGBRG10_DPCM8_1X8,\n> +\t\t.type = MediaBusFormatInfo::Type::Image,\n>  \t\t.bitsPerPixel = 8,\n>  \t\t.colourEncoding = PixelFormatInfo::ColourEncodingRAW,\n>  \t} },\n>  \t{ MEDIA_BUS_FMT_SGRBG10_DPCM8_1X8, {\n>  \t\t.name = \"SGRBG10_DPCM8_1X8\",\n>  \t\t.code = MEDIA_BUS_FMT_SGRBG10_DPCM8_1X8,\n> +\t\t.type = MediaBusFormatInfo::Type::Image,\n>  \t\t.bitsPerPixel = 8,\n>  \t\t.colourEncoding = PixelFormatInfo::ColourEncodingRAW,\n>  \t} },\n>  \t{ MEDIA_BUS_FMT_SRGGB10_DPCM8_1X8, {\n>  \t\t.name = \"SRGGB10_DPCM8_1X8\",\n>  \t\t.code = MEDIA_BUS_FMT_SRGGB10_DPCM8_1X8,\n> +\t\t.type = MediaBusFormatInfo::Type::Image,\n>  \t\t.bitsPerPixel = 8,\n>  \t\t.colourEncoding = PixelFormatInfo::ColourEncodingRAW,\n>  \t} },\n>  \t{ MEDIA_BUS_FMT_SBGGR10_2X8_PADHI_BE, {\n>  \t\t.name = \"SBGGR10_2X8_PADHI_BE\",\n>  \t\t.code = MEDIA_BUS_FMT_SBGGR10_2X8_PADHI_BE,\n> +\t\t.type = MediaBusFormatInfo::Type::Image,\n>  \t\t.bitsPerPixel = 16,\n>  \t\t.colourEncoding = PixelFormatInfo::ColourEncodingRAW,\n>  \t} },\n>  \t{ MEDIA_BUS_FMT_SBGGR10_2X8_PADHI_LE, {\n>  \t\t.name = \"SBGGR10_2X8_PADHI_LE\",\n>  \t\t.code = MEDIA_BUS_FMT_SBGGR10_2X8_PADHI_LE,\n> +\t\t.type = MediaBusFormatInfo::Type::Image,\n>  \t\t.bitsPerPixel = 16,\n>  \t\t.colourEncoding = PixelFormatInfo::ColourEncodingRAW,\n>  \t} },\n>  \t{ MEDIA_BUS_FMT_SBGGR10_2X8_PADLO_BE, {\n>  \t\t.name = \"SBGGR10_2X8_PADLO_BE\",\n>  \t\t.code = MEDIA_BUS_FMT_SBGGR10_2X8_PADLO_BE,\n> +\t\t.type = MediaBusFormatInfo::Type::Image,\n>  \t\t.bitsPerPixel = 16,\n>  \t\t.colourEncoding = PixelFormatInfo::ColourEncodingRAW,\n>  \t} },\n>  \t{ MEDIA_BUS_FMT_SBGGR10_2X8_PADLO_LE, {\n>  \t\t.name = \"SBGGR10_2X8_PADLO_LE\",\n>  \t\t.code = MEDIA_BUS_FMT_SBGGR10_2X8_PADLO_LE,\n> +\t\t.type = MediaBusFormatInfo::Type::Image,\n>  \t\t.bitsPerPixel = 16,\n>  \t\t.colourEncoding = PixelFormatInfo::ColourEncodingRAW,\n>  \t} },\n>  \t{ MEDIA_BUS_FMT_SBGGR10_1X10, {\n>  \t\t.name = \"SBGGR10_1X10\",\n>  \t\t.code = MEDIA_BUS_FMT_SBGGR10_1X10,\n> +\t\t.type = MediaBusFormatInfo::Type::Image,\n>  \t\t.bitsPerPixel = 10,\n>  \t\t.colourEncoding = PixelFormatInfo::ColourEncodingRAW,\n>  \t} },\n>  \t{ MEDIA_BUS_FMT_SGBRG10_1X10, {\n>  \t\t.name = \"SGBRG10_1X10\",\n>  \t\t.code = MEDIA_BUS_FMT_SGBRG10_1X10,\n> +\t\t.type = MediaBusFormatInfo::Type::Image,\n>  \t\t.bitsPerPixel = 10,\n>  \t\t.colourEncoding = PixelFormatInfo::ColourEncodingRAW,\n>  \t} },\n>  \t{ MEDIA_BUS_FMT_SGRBG10_1X10, {\n>  \t\t.name = \"SGRBG10_1X10\",\n>  \t\t.code = MEDIA_BUS_FMT_SGRBG10_1X10,\n> +\t\t.type = MediaBusFormatInfo::Type::Image,\n>  \t\t.bitsPerPixel = 10,\n>  \t\t.colourEncoding = PixelFormatInfo::ColourEncodingRAW,\n>  \t} },\n>  \t{ MEDIA_BUS_FMT_SRGGB10_1X10, {\n>  \t\t.name = \"SRGGB10_1X10\",\n>  \t\t.code = MEDIA_BUS_FMT_SRGGB10_1X10,\n> +\t\t.type = MediaBusFormatInfo::Type::Image,\n>  \t\t.bitsPerPixel = 10,\n>  \t\t.colourEncoding = PixelFormatInfo::ColourEncodingRAW,\n>  \t} },\n>  \t{ MEDIA_BUS_FMT_SBGGR12_1X12, {\n>  \t\t.name = \"SBGGR12_1X12\",\n>  \t\t.code = MEDIA_BUS_FMT_SBGGR12_1X12,\n> +\t\t.type = MediaBusFormatInfo::Type::Image,\n>  \t\t.bitsPerPixel = 12,\n>  \t\t.colourEncoding = PixelFormatInfo::ColourEncodingRAW,\n>  \t} },\n>  \t{ MEDIA_BUS_FMT_SGBRG12_1X12, {\n>  \t\t.name = \"SGBRG12_1X12\",\n>  \t\t.code = MEDIA_BUS_FMT_SGBRG12_1X12,\n> +\t\t.type = MediaBusFormatInfo::Type::Image,\n>  \t\t.bitsPerPixel = 12,\n>  \t\t.colourEncoding = PixelFormatInfo::ColourEncodingRAW,\n>  \t} },\n>  \t{ MEDIA_BUS_FMT_SGRBG12_1X12, {\n>  \t\t.name = \"SGRBG12_1X12\",\n>  \t\t.code = MEDIA_BUS_FMT_SGRBG12_1X12,\n> +\t\t.type = MediaBusFormatInfo::Type::Image,\n>  \t\t.bitsPerPixel = 12,\n>  \t\t.colourEncoding = PixelFormatInfo::ColourEncodingRAW,\n>  \t} },\n>  \t{ MEDIA_BUS_FMT_SRGGB12_1X12, {\n>  \t\t.name = \"SRGGB12_1X12\",\n>  \t\t.code = MEDIA_BUS_FMT_SRGGB12_1X12,\n> +\t\t.type = MediaBusFormatInfo::Type::Image,\n>  \t\t.bitsPerPixel = 12,\n>  \t\t.colourEncoding = PixelFormatInfo::ColourEncodingRAW,\n>  \t} },\n> @@ -532,15 +627,24 @@ const std::map<uint32_t, MediaBusFormatInfo> mediaBusFormatInfo{\n>  \t{ MEDIA_BUS_FMT_AHSV8888_1X32, {\n>  \t\t.name = \"AHSV8888_1X32\",\n>  \t\t.code = MEDIA_BUS_FMT_AHSV8888_1X32,\n> +\t\t.type = MediaBusFormatInfo::Type::Image,\n>  \t\t.bitsPerPixel = 32,\n>  \t\t.colourEncoding = PixelFormatInfo::ColourEncodingRGB,\n>  \t} },\n>  \t{ MEDIA_BUS_FMT_JPEG_1X8, {\n>  \t\t.name = \"JPEG_1X8\",\n>  \t\t.code = MEDIA_BUS_FMT_JPEG_1X8,\n> +\t\t.type = MediaBusFormatInfo::Type::Image,\n>  \t\t.bitsPerPixel = 8,\n>  \t\t.colourEncoding = PixelFormatInfo::ColourEncodingYUV,\n>  \t} },\n> +\t{ MEDIA_BUS_FMT_METADATA_FIXED, {\n> +\t\t.name = \"METADATA_FIXED\",\n> +\t\t.code = MEDIA_BUS_FMT_METADATA_FIXED,\n> +\t\t.type = MediaBusFormatInfo::Type::Metadata,\n> +\t\t.bitsPerPixel = 0,\n> +\t\t.colourEncoding = PixelFormatInfo::ColourEncodingRAW,\n\nIs it worth adding PixelFormatInfo::ColourEncodingNone or will it\ngenerate more issues ?\n\n> +\t} },\n>  };\n>\n>  } /* namespace */\n> --\n> Regards,\n>\n> Laurent Pinchart\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 3E455BD80A\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 28 Feb 2024 08:35:17 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 7FEF362871;\n\tWed, 28 Feb 2024 09:35:16 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id E0E63627F9\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 28 Feb 2024 09:35:14 +0100 (CET)","from ideasonboard.com (93-61-96-190.ip145.fastwebnet.it\n\t[93.61.96.190])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 41223673;\n\tWed, 28 Feb 2024 09:35:02 +0100 (CET)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"ds/9RfgH\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1709109302;\n\tbh=aAyX4uguHYvEgN/XfbSy+WVgBNGZBfwYlBizNUP3f/Y=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=ds/9RfgH9NjwIAmz3nOSzXh+zkdMxyNto80Sh9T8F3U3vUIRzbklHc9YWUXKmyPxi\n\tTQ6LlFWpT6kpopxGHyy2yUumqFCkEuhZ3JVNDINhfrV7y/MNvAGRwFwU470bOOr7Gf\n\tSxcdocJ92w7nnkYjcWwJcTxlS0eWpt91+vVqJPF0=","Date":"Wed, 28 Feb 2024 09:35:11 +0100","From":"Jacopo Mondi <jacopo.mondi@ideasonboard.com>","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Subject":"Re: [PATCH 4/9] libcamera: v4l2_subdevice: Extend MediaBusFormatInfo\n\twith metadata formats","Message-ID":"<gp3kb64gzvanapli5i6kzh5322gy2idxezjvcy432aemea7z2g@pasllllygfvd>","References":"<20240227140953.26093-1-laurent.pinchart@ideasonboard.com>\n\t<20240227140953.26093-5-laurent.pinchart@ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20240227140953.26093-5-laurent.pinchart@ideasonboard.com>","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>","Cc":"libcamera-devel@lists.libcamera.org","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":28784,"web_url":"https://patchwork.libcamera.org/comment/28784/","msgid":"<20240228104140.GG3419@pendragon.ideasonboard.com>","date":"2024-02-28T10:41:40","subject":"Re: [PATCH 4/9] libcamera: v4l2_subdevice: Extend MediaBusFormatInfo\n\twith metadata formats","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Jacopo,\n\nOn Wed, Feb 28, 2024 at 09:35:11AM +0100, Jacopo Mondi wrote:\n> On Tue, Feb 27, 2024 at 04:09:48PM +0200, Laurent Pinchart wrote:\n> > Not all media bus formats describe image formats. Extend the\n> > MediaBusFormatInfo class with a type member to indicate if the format\n> > corresponds to image data or metadata, and add the (only) metatdata\n> > format supported by the kernel to the known mediaBusFormatInfo.\n> >\n> > The kernel doesn't (yet) have any metadata format specific to sensor\n> > embedded data. This is being addressed in the V4L2 API. In preparation\n> > for embedded data support, already introduce the EmbeddedData type here.\n> > Corresponding formats will be added when available.\n> >\n> > Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n> > ---\n> >  include/libcamera/internal/v4l2_subdevice.h |   7 ++\n> >  src/libcamera/v4l2_subdevice.cpp            | 106 +++++++++++++++++++-\n> >  2 files changed, 112 insertions(+), 1 deletion(-)\n> >\n> > diff --git a/include/libcamera/internal/v4l2_subdevice.h b/include/libcamera/internal/v4l2_subdevice.h\n> > index a4df9ddfd322..c9aa90e00ec8 100644\n> > --- a/include/libcamera/internal/v4l2_subdevice.h\n> > +++ b/include/libcamera/internal/v4l2_subdevice.h\n> > @@ -32,12 +32,19 @@ class MediaDevice;\n> >  class MediaBusFormatInfo\n> >  {\n> >  public:\n> > +\tenum class Type {\n> > +\t\tImage,\n> > +\t\tMetadata,\n> > +\t\tEmbeddedData,\n> > +\t};\n> > +\n> >  \tbool isValid() const { return code != 0; }\n> >\n> >  \tstatic const MediaBusFormatInfo &info(uint32_t code);\n> >\n> >  \tconst char *name;\n> >  \tuint32_t code;\n> > +\tType type;\n> >  \tunsigned int bitsPerPixel;\n> >  \tPixelFormatInfo::ColourEncoding colourEncoding;\n> >  };\n> > diff --git a/src/libcamera/v4l2_subdevice.cpp b/src/libcamera/v4l2_subdevice.cpp\n> > index fd289ae9ae6f..a535bf63c332 100644\n> > --- a/src/libcamera/v4l2_subdevice.cpp\n> > +++ b/src/libcamera/v4l2_subdevice.cpp\n> > @@ -51,6 +51,9 @@ LOG_DECLARE_CATEGORY(V4L2)\n> >   * \\var MediaBusFormatInfo::code\n> >   * \\brief The media bus format code described by this instance\n> >   *\n> > + * \\var MediaBusFormatInfo::type\n> > + * \\brief The media bus format type\n> > + *\n> >   * \\var MediaBusFormatInfo::bitsPerPixel\n> >   * \\brief The average number of bits per pixel\n> >   *\n> > @@ -62,10 +65,26 @@ LOG_DECLARE_CATEGORY(V4L2)\n> >   * value will differ from the bus width.\n> >   *\n> >   * Formats that don't have a fixed number of bits per pixel, such as compressed\n> > - * formats, report 0 in this field.\n> > + * formats, or device-specific embedded data formats, report 0 in this field.\n> \n> Not only the device specific ones, but the generic metadata types too!\n\nThis is just an example :-) The future META_{8,10,...} formats will have\na non-zero bits per pixel value.\n\n> >   *\n> >   * \\var MediaBusFormatInfo::colourEncoding\n> >   * \\brief The colour encoding type\n> > + *\n> > + * This field is valid for Type::Image formats only.\n> > + */\n> > +\n> > +/**\n> > + * \\enum MediaBusFormatInfo::Type\n> > + * \\brief The format type\n> > + *\n> > + * \\var MediaBusFormatInfo::Type::Image\n> > + * \\brief The format describes image data\n> > + *\n> > + * \\var MediaBusFormatInfo::Type::Metadata\n> > + * \\brief The format describes generic metadata\n> > + *\n> > + * \\var MediaBusFormatInfo::Type::EmbeddedData\n> > + * \\brief The format describes sensor embedded data\n> >   */\n> >\n> >  namespace {\n> > @@ -75,456 +94,532 @@ const std::map<uint32_t, MediaBusFormatInfo> mediaBusFormatInfo{\n> >  \t{ MEDIA_BUS_FMT_RGB444_2X8_PADHI_BE, {\n> >  \t\t.name = \"RGB444_2X8_PADHI_BE\",\n> >  \t\t.code = MEDIA_BUS_FMT_RGB444_2X8_PADHI_BE,\n> > +\t\t.type = MediaBusFormatInfo::Type::Image,\n> >  \t\t.bitsPerPixel = 16,\n> >  \t\t.colourEncoding = PixelFormatInfo::ColourEncodingRGB,\n> >  \t} },\n> >  \t{ MEDIA_BUS_FMT_RGB444_2X8_PADHI_LE, {\n> >  \t\t.name = \"RGB444_2X8_PADHI_LE\",\n> >  \t\t.code = MEDIA_BUS_FMT_RGB444_2X8_PADHI_LE,\n> > +\t\t.type = MediaBusFormatInfo::Type::Image,\n> >  \t\t.bitsPerPixel = 16,\n> >  \t\t.colourEncoding = PixelFormatInfo::ColourEncodingRGB,\n> >  \t} },\n> >  \t{ MEDIA_BUS_FMT_RGB555_2X8_PADHI_BE, {\n> >  \t\t.name = \"RGB555_2X8_PADHI_BE\",\n> >  \t\t.code = MEDIA_BUS_FMT_RGB555_2X8_PADHI_BE,\n> > +\t\t.type = MediaBusFormatInfo::Type::Image,\n> >  \t\t.bitsPerPixel = 16,\n> >  \t\t.colourEncoding = PixelFormatInfo::ColourEncodingRGB,\n> >  \t} },\n> >  \t{ MEDIA_BUS_FMT_RGB555_2X8_PADHI_LE, {\n> >  \t\t.name = \"RGB555_2X8_PADHI_LE\",\n> >  \t\t.code = MEDIA_BUS_FMT_RGB555_2X8_PADHI_LE,\n> > +\t\t.type = MediaBusFormatInfo::Type::Image,\n> >  \t\t.bitsPerPixel = 16,\n> >  \t\t.colourEncoding = PixelFormatInfo::ColourEncodingRGB,\n> >  \t} },\n> >  \t{ MEDIA_BUS_FMT_RGB565_1X16, {\n> >  \t\t.name = \"RGB565_1X16\",\n> >  \t\t.code = MEDIA_BUS_FMT_RGB565_1X16,\n> > +\t\t.type = MediaBusFormatInfo::Type::Image,\n> >  \t\t.bitsPerPixel = 16,\n> >  \t\t.colourEncoding = PixelFormatInfo::ColourEncodingRGB,\n> >  \t} },\n> >  \t{ MEDIA_BUS_FMT_BGR565_2X8_BE, {\n> >  \t\t.name = \"BGR565_2X8_BE\",\n> >  \t\t.code = MEDIA_BUS_FMT_BGR565_2X8_BE,\n> > +\t\t.type = MediaBusFormatInfo::Type::Image,\n> >  \t\t.bitsPerPixel = 16,\n> >  \t\t.colourEncoding = PixelFormatInfo::ColourEncodingRGB,\n> >  \t} },\n> >  \t{ MEDIA_BUS_FMT_BGR565_2X8_LE, {\n> >  \t\t.name = \"BGR565_2X8_LE\",\n> >  \t\t.code = MEDIA_BUS_FMT_BGR565_2X8_LE,\n> > +\t\t.type = MediaBusFormatInfo::Type::Image,\n> >  \t\t.bitsPerPixel = 16,\n> >  \t\t.colourEncoding = PixelFormatInfo::ColourEncodingRGB,\n> >  \t} },\n> >  \t{ MEDIA_BUS_FMT_RGB565_2X8_BE, {\n> >  \t\t.name = \"RGB565_2X8_BE\",\n> >  \t\t.code = MEDIA_BUS_FMT_RGB565_2X8_BE,\n> > +\t\t.type = MediaBusFormatInfo::Type::Image,\n> >  \t\t.bitsPerPixel = 16,\n> >  \t\t.colourEncoding = PixelFormatInfo::ColourEncodingRGB,\n> >  \t} },\n> >  \t{ MEDIA_BUS_FMT_RGB565_2X8_LE, {\n> >  \t\t.name = \"RGB565_2X8_LE\",\n> >  \t\t.code = MEDIA_BUS_FMT_RGB565_2X8_LE,\n> > +\t\t.type = MediaBusFormatInfo::Type::Image,\n> >  \t\t.bitsPerPixel = 16,\n> >  \t\t.colourEncoding = PixelFormatInfo::ColourEncodingRGB,\n> >  \t} },\n> >  \t{ MEDIA_BUS_FMT_RGB666_1X18, {\n> >  \t\t.name = \"RGB666_1X18\",\n> >  \t\t.code = MEDIA_BUS_FMT_RGB666_1X18,\n> > +\t\t.type = MediaBusFormatInfo::Type::Image,\n> >  \t\t.bitsPerPixel = 18,\n> >  \t\t.colourEncoding = PixelFormatInfo::ColourEncodingRGB,\n> >  \t} },\n> >  \t{ MEDIA_BUS_FMT_BGR888_1X24, {\n> >  \t\t.name = \"BGR888_1X24\",\n> >  \t\t.code = MEDIA_BUS_FMT_BGR888_1X24,\n> > +\t\t.type = MediaBusFormatInfo::Type::Image,\n> >  \t\t.bitsPerPixel = 24,\n> >  \t\t.colourEncoding = PixelFormatInfo::ColourEncodingRGB,\n> >  \t} },\n> >  \t{ MEDIA_BUS_FMT_RGB888_1X24, {\n> >  \t\t.name = \"RGB888_1X24\",\n> >  \t\t.code = MEDIA_BUS_FMT_RGB888_1X24,\n> > +\t\t.type = MediaBusFormatInfo::Type::Image,\n> >  \t\t.bitsPerPixel = 24,\n> >  \t\t.colourEncoding = PixelFormatInfo::ColourEncodingRGB,\n> >  \t} },\n> >  \t{ MEDIA_BUS_FMT_RGB888_2X12_BE, {\n> >  \t\t.name = \"RGB888_2X12_BE\",\n> >  \t\t.code = MEDIA_BUS_FMT_RGB888_2X12_BE,\n> > +\t\t.type = MediaBusFormatInfo::Type::Image,\n> >  \t\t.bitsPerPixel = 24,\n> >  \t\t.colourEncoding = PixelFormatInfo::ColourEncodingRGB,\n> >  \t} },\n> >  \t{ MEDIA_BUS_FMT_RGB888_2X12_LE, {\n> >  \t\t.name = \"RGB888_2X12_LE\",\n> >  \t\t.code = MEDIA_BUS_FMT_RGB888_2X12_LE,\n> > +\t\t.type = MediaBusFormatInfo::Type::Image,\n> >  \t\t.bitsPerPixel = 24,\n> >  \t\t.colourEncoding = PixelFormatInfo::ColourEncodingRGB,\n> >  \t} },\n> >  \t{ MEDIA_BUS_FMT_ARGB8888_1X32, {\n> >  \t\t.name = \"ARGB8888_1X32\",\n> >  \t\t.code = MEDIA_BUS_FMT_ARGB8888_1X32,\n> > +\t\t.type = MediaBusFormatInfo::Type::Image,\n> >  \t\t.bitsPerPixel = 32,\n> >  \t\t.colourEncoding = PixelFormatInfo::ColourEncodingRGB,\n> >  \t} },\n> >  \t{ MEDIA_BUS_FMT_Y8_1X8, {\n> >  \t\t.name = \"Y8_1X8\",\n> >  \t\t.code = MEDIA_BUS_FMT_Y8_1X8,\n> > +\t\t.type = MediaBusFormatInfo::Type::Image,\n> >  \t\t.bitsPerPixel = 8,\n> >  \t\t.colourEncoding = PixelFormatInfo::ColourEncodingYUV,\n> >  \t} },\n> >  \t{ MEDIA_BUS_FMT_UV8_1X8, {\n> >  \t\t.name = \"UV8_1X8\",\n> >  \t\t.code = MEDIA_BUS_FMT_UV8_1X8,\n> > +\t\t.type = MediaBusFormatInfo::Type::Image,\n> >  \t\t.bitsPerPixel = 8,\n> >  \t\t.colourEncoding = PixelFormatInfo::ColourEncodingYUV,\n> >  \t} },\n> >  \t{ MEDIA_BUS_FMT_UYVY8_1_5X8, {\n> >  \t\t.name = \"UYVY8_1_5X8\",\n> >  \t\t.code = MEDIA_BUS_FMT_UYVY8_1_5X8,\n> > +\t\t.type = MediaBusFormatInfo::Type::Image,\n> >  \t\t.bitsPerPixel = 12,\n> >  \t\t.colourEncoding = PixelFormatInfo::ColourEncodingYUV,\n> >  \t} },\n> >  \t{ MEDIA_BUS_FMT_VYUY8_1_5X8, {\n> >  \t\t.name = \"VYUY8_1_5X8\",\n> >  \t\t.code = MEDIA_BUS_FMT_VYUY8_1_5X8,\n> > +\t\t.type = MediaBusFormatInfo::Type::Image,\n> >  \t\t.bitsPerPixel = 12,\n> >  \t\t.colourEncoding = PixelFormatInfo::ColourEncodingYUV,\n> >  \t} },\n> >  \t{ MEDIA_BUS_FMT_YUYV8_1_5X8, {\n> >  \t\t.name = \"YUYV8_1_5X8\",\n> >  \t\t.code = MEDIA_BUS_FMT_YUYV8_1_5X8,\n> > +\t\t.type = MediaBusFormatInfo::Type::Image,\n> >  \t\t.bitsPerPixel = 12,\n> >  \t\t.colourEncoding = PixelFormatInfo::ColourEncodingYUV,\n> >  \t} },\n> >  \t{ MEDIA_BUS_FMT_YVYU8_1_5X8, {\n> >  \t\t.name = \"YVYU8_1_5X8\",\n> >  \t\t.code = MEDIA_BUS_FMT_YVYU8_1_5X8,\n> > +\t\t.type = MediaBusFormatInfo::Type::Image,\n> >  \t\t.bitsPerPixel = 12,\n> >  \t\t.colourEncoding = PixelFormatInfo::ColourEncodingYUV,\n> >  \t} },\n> >  \t{ MEDIA_BUS_FMT_UYVY8_2X8, {\n> >  \t\t.name = \"UYVY8_2X8\",\n> >  \t\t.code = MEDIA_BUS_FMT_UYVY8_2X8,\n> > +\t\t.type = MediaBusFormatInfo::Type::Image,\n> >  \t\t.bitsPerPixel = 16,\n> >  \t\t.colourEncoding = PixelFormatInfo::ColourEncodingYUV,\n> >  \t} },\n> >  \t{ MEDIA_BUS_FMT_VYUY8_2X8, {\n> >  \t\t.name = \"VYUY8_2X8\",\n> >  \t\t.code = MEDIA_BUS_FMT_VYUY8_2X8,\n> > +\t\t.type = MediaBusFormatInfo::Type::Image,\n> >  \t\t.bitsPerPixel = 16,\n> >  \t\t.colourEncoding = PixelFormatInfo::ColourEncodingYUV,\n> >  \t} },\n> >  \t{ MEDIA_BUS_FMT_YUYV8_2X8, {\n> >  \t\t.name = \"YUYV8_2X8\",\n> >  \t\t.code = MEDIA_BUS_FMT_YUYV8_2X8,\n> > +\t\t.type = MediaBusFormatInfo::Type::Image,\n> >  \t\t.bitsPerPixel = 16,\n> >  \t\t.colourEncoding = PixelFormatInfo::ColourEncodingYUV,\n> >  \t} },\n> >  \t{ MEDIA_BUS_FMT_YVYU8_2X8, {\n> >  \t\t.name = \"YVYU8_2X8\",\n> >  \t\t.code = MEDIA_BUS_FMT_YVYU8_2X8,\n> > +\t\t.type = MediaBusFormatInfo::Type::Image,\n> >  \t\t.bitsPerPixel = 16,\n> >  \t\t.colourEncoding = PixelFormatInfo::ColourEncodingYUV,\n> >  \t} },\n> >  \t{ MEDIA_BUS_FMT_Y10_1X10, {\n> >  \t\t.name = \"Y10_1X10\",\n> >  \t\t.code = MEDIA_BUS_FMT_Y10_1X10,\n> > +\t\t.type = MediaBusFormatInfo::Type::Image,\n> >  \t\t.bitsPerPixel = 10,\n> >  \t\t.colourEncoding = PixelFormatInfo::ColourEncodingYUV,\n> >  \t} },\n> >  \t{ MEDIA_BUS_FMT_UYVY10_2X10, {\n> >  \t\t.name = \"UYVY10_2X10\",\n> >  \t\t.code = MEDIA_BUS_FMT_UYVY10_2X10,\n> > +\t\t.type = MediaBusFormatInfo::Type::Image,\n> >  \t\t.bitsPerPixel = 20,\n> >  \t\t.colourEncoding = PixelFormatInfo::ColourEncodingYUV,\n> >  \t} },\n> >  \t{ MEDIA_BUS_FMT_VYUY10_2X10, {\n> >  \t\t.name = \"VYUY10_2X10\",\n> >  \t\t.code = MEDIA_BUS_FMT_VYUY10_2X10,\n> > +\t\t.type = MediaBusFormatInfo::Type::Image,\n> >  \t\t.bitsPerPixel = 20,\n> >  \t\t.colourEncoding = PixelFormatInfo::ColourEncodingYUV,\n> >  \t} },\n> >  \t{ MEDIA_BUS_FMT_YUYV10_2X10, {\n> >  \t\t.name = \"YUYV10_2X10\",\n> >  \t\t.code = MEDIA_BUS_FMT_YUYV10_2X10,\n> > +\t\t.type = MediaBusFormatInfo::Type::Image,\n> >  \t\t.bitsPerPixel = 20,\n> >  \t\t.colourEncoding = PixelFormatInfo::ColourEncodingYUV,\n> >  \t} },\n> >  \t{ MEDIA_BUS_FMT_YVYU10_2X10, {\n> >  \t\t.name = \"YVYU10_2X10\",\n> >  \t\t.code = MEDIA_BUS_FMT_YVYU10_2X10,\n> > +\t\t.type = MediaBusFormatInfo::Type::Image,\n> >  \t\t.bitsPerPixel = 20,\n> >  \t\t.colourEncoding = PixelFormatInfo::ColourEncodingYUV,\n> >  \t} },\n> >  \t{ MEDIA_BUS_FMT_Y12_1X12, {\n> >  \t\t.name = \"Y12_1X12\",\n> >  \t\t.code = MEDIA_BUS_FMT_Y12_1X12,\n> > +\t\t.type = MediaBusFormatInfo::Type::Image,\n> >  \t\t.bitsPerPixel = 12,\n> >  \t\t.colourEncoding = PixelFormatInfo::ColourEncodingYUV,\n> >  \t} },\n> >  \t{ MEDIA_BUS_FMT_Y16_1X16, {\n> >  \t\t.name = \"Y16_1X16\",\n> >  \t\t.code = MEDIA_BUS_FMT_Y16_1X16,\n> > +\t\t.type = MediaBusFormatInfo::Type::Image,\n> >  \t\t.bitsPerPixel = 16,\n> >  \t\t.colourEncoding = PixelFormatInfo::ColourEncodingYUV,\n> >  \t} },\n> >  \t{ MEDIA_BUS_FMT_UYVY8_1X16, {\n> >  \t\t.name = \"UYVY8_1X16\",\n> >  \t\t.code = MEDIA_BUS_FMT_UYVY8_1X16,\n> > +\t\t.type = MediaBusFormatInfo::Type::Image,\n> >  \t\t.bitsPerPixel = 16,\n> >  \t\t.colourEncoding = PixelFormatInfo::ColourEncodingYUV,\n> >  \t} },\n> >  \t{ MEDIA_BUS_FMT_VYUY8_1X16, {\n> >  \t\t.name = \"VYUY8_1X16\",\n> >  \t\t.code = MEDIA_BUS_FMT_VYUY8_1X16,\n> > +\t\t.type = MediaBusFormatInfo::Type::Image,\n> >  \t\t.bitsPerPixel = 16,\n> >  \t\t.colourEncoding = PixelFormatInfo::ColourEncodingYUV,\n> >  \t} },\n> >  \t{ MEDIA_BUS_FMT_YUYV8_1X16, {\n> >  \t\t.name = \"YUYV8_1X16\",\n> >  \t\t.code = MEDIA_BUS_FMT_YUYV8_1X16,\n> > +\t\t.type = MediaBusFormatInfo::Type::Image,\n> >  \t\t.bitsPerPixel = 16,\n> >  \t\t.colourEncoding = PixelFormatInfo::ColourEncodingYUV,\n> >  \t} },\n> >  \t{ MEDIA_BUS_FMT_YVYU8_1X16, {\n> >  \t\t.name = \"YVYU8_1X16\",\n> >  \t\t.code = MEDIA_BUS_FMT_YVYU8_1X16,\n> > +\t\t.type = MediaBusFormatInfo::Type::Image,\n> >  \t\t.bitsPerPixel = 16,\n> >  \t\t.colourEncoding = PixelFormatInfo::ColourEncodingYUV,\n> >  \t} },\n> >  \t{ MEDIA_BUS_FMT_YDYUYDYV8_1X16, {\n> >  \t\t.name = \"YDYUYDYV8_1X16\",\n> >  \t\t.code = MEDIA_BUS_FMT_YDYUYDYV8_1X16,\n> > +\t\t.type = MediaBusFormatInfo::Type::Image,\n> >  \t\t.bitsPerPixel = 16,\n> >  \t\t.colourEncoding = PixelFormatInfo::ColourEncodingYUV,\n> >  \t} },\n> >  \t{ MEDIA_BUS_FMT_UYVY10_1X20, {\n> >  \t\t.name = \"UYVY10_1X20\",\n> >  \t\t.code = MEDIA_BUS_FMT_UYVY10_1X20,\n> > +\t\t.type = MediaBusFormatInfo::Type::Image,\n> >  \t\t.bitsPerPixel = 20,\n> >  \t\t.colourEncoding = PixelFormatInfo::ColourEncodingYUV,\n> >  \t} },\n> >  \t{ MEDIA_BUS_FMT_VYUY10_1X20, {\n> >  \t\t.name = \"VYUY10_1X20\",\n> >  \t\t.code = MEDIA_BUS_FMT_VYUY10_1X20,\n> > +\t\t.type = MediaBusFormatInfo::Type::Image,\n> >  \t\t.bitsPerPixel = 20,\n> >  \t\t.colourEncoding = PixelFormatInfo::ColourEncodingYUV,\n> >  \t} },\n> >  \t{ MEDIA_BUS_FMT_YUYV10_1X20, {\n> >  \t\t.name = \"YUYV10_1X20\",\n> >  \t\t.code = MEDIA_BUS_FMT_YUYV10_1X20,\n> > +\t\t.type = MediaBusFormatInfo::Type::Image,\n> >  \t\t.bitsPerPixel = 20,\n> >  \t\t.colourEncoding = PixelFormatInfo::ColourEncodingYUV,\n> >  \t} },\n> >  \t{ MEDIA_BUS_FMT_YVYU10_1X20, {\n> >  \t\t.name = \"YVYU10_1X20\",\n> >  \t\t.code = MEDIA_BUS_FMT_YVYU10_1X20,\n> > +\t\t.type = MediaBusFormatInfo::Type::Image,\n> >  \t\t.bitsPerPixel = 20,\n> >  \t\t.colourEncoding = PixelFormatInfo::ColourEncodingYUV,\n> >  \t} },\n> >  \t{ MEDIA_BUS_FMT_YUV8_1X24, {\n> >  \t\t.name = \"YUV8_1X24\",\n> >  \t\t.code = MEDIA_BUS_FMT_YUV8_1X24,\n> > +\t\t.type = MediaBusFormatInfo::Type::Image,\n> >  \t\t.bitsPerPixel = 24,\n> >  \t\t.colourEncoding = PixelFormatInfo::ColourEncodingYUV,\n> >  \t} },\n> >  \t{ MEDIA_BUS_FMT_YUV10_1X30, {\n> >  \t\t.name = \"YUV10_1X30\",\n> >  \t\t.code = MEDIA_BUS_FMT_YUV10_1X30,\n> > +\t\t.type = MediaBusFormatInfo::Type::Image,\n> >  \t\t.bitsPerPixel = 30,\n> >  \t\t.colourEncoding = PixelFormatInfo::ColourEncodingYUV,\n> >  \t} },\n> >  \t{ MEDIA_BUS_FMT_AYUV8_1X32, {\n> >  \t\t.name = \"AYUV8_1X32\",\n> >  \t\t.code = MEDIA_BUS_FMT_AYUV8_1X32,\n> > +\t\t.type = MediaBusFormatInfo::Type::Image,\n> >  \t\t.bitsPerPixel = 32,\n> >  \t\t.colourEncoding = PixelFormatInfo::ColourEncodingYUV,\n> >  \t} },\n> >  \t{ MEDIA_BUS_FMT_UYVY12_2X12, {\n> >  \t\t.name = \"UYVY12_2X12\",\n> >  \t\t.code = MEDIA_BUS_FMT_UYVY12_2X12,\n> > +\t\t.type = MediaBusFormatInfo::Type::Image,\n> >  \t\t.bitsPerPixel = 24,\n> >  \t\t.colourEncoding = PixelFormatInfo::ColourEncodingYUV,\n> >  \t} },\n> >  \t{ MEDIA_BUS_FMT_VYUY12_2X12, {\n> >  \t\t.name = \"VYUY12_2X12\",\n> >  \t\t.code = MEDIA_BUS_FMT_VYUY12_2X12,\n> > +\t\t.type = MediaBusFormatInfo::Type::Image,\n> >  \t\t.bitsPerPixel = 24,\n> >  \t\t.colourEncoding = PixelFormatInfo::ColourEncodingYUV,\n> >  \t} },\n> >  \t{ MEDIA_BUS_FMT_YUYV12_2X12, {\n> >  \t\t.name = \"YUYV12_2X12\",\n> >  \t\t.code = MEDIA_BUS_FMT_YUYV12_2X12,\n> > +\t\t.type = MediaBusFormatInfo::Type::Image,\n> >  \t\t.bitsPerPixel = 24,\n> >  \t\t.colourEncoding = PixelFormatInfo::ColourEncodingYUV,\n> >  \t} },\n> >  \t{ MEDIA_BUS_FMT_YVYU12_2X12, {\n> >  \t\t.name = \"YVYU12_2X12\",\n> >  \t\t.code = MEDIA_BUS_FMT_YVYU12_2X12,\n> > +\t\t.type = MediaBusFormatInfo::Type::Image,\n> >  \t\t.bitsPerPixel = 24,\n> >  \t\t.colourEncoding = PixelFormatInfo::ColourEncodingYUV,\n> >  \t} },\n> >  \t{ MEDIA_BUS_FMT_UYVY12_1X24, {\n> >  \t\t.name = \"UYVY12_1X24\",\n> >  \t\t.code = MEDIA_BUS_FMT_UYVY12_1X24,\n> > +\t\t.type = MediaBusFormatInfo::Type::Image,\n> >  \t\t.bitsPerPixel = 24,\n> >  \t\t.colourEncoding = PixelFormatInfo::ColourEncodingYUV,\n> >  \t} },\n> >  \t{ MEDIA_BUS_FMT_VYUY12_1X24, {\n> >  \t\t.name = \"VYUY12_1X24\",\n> >  \t\t.code = MEDIA_BUS_FMT_VYUY12_1X24,\n> > +\t\t.type = MediaBusFormatInfo::Type::Image,\n> >  \t\t.bitsPerPixel = 24,\n> >  \t\t.colourEncoding = PixelFormatInfo::ColourEncodingYUV,\n> >  \t} },\n> >  \t{ MEDIA_BUS_FMT_YUYV12_1X24, {\n> >  \t\t.name = \"YUYV12_1X24\",\n> >  \t\t.code = MEDIA_BUS_FMT_YUYV12_1X24,\n> > +\t\t.type = MediaBusFormatInfo::Type::Image,\n> >  \t\t.bitsPerPixel = 24,\n> >  \t\t.colourEncoding = PixelFormatInfo::ColourEncodingYUV,\n> >  \t} },\n> >  \t{ MEDIA_BUS_FMT_YVYU12_1X24, {\n> >  \t\t.name = \"YVYU12_1X24\",\n> >  \t\t.code = MEDIA_BUS_FMT_YVYU12_1X24,\n> > +\t\t.type = MediaBusFormatInfo::Type::Image,\n> >  \t\t.bitsPerPixel = 24,\n> >  \t\t.colourEncoding = PixelFormatInfo::ColourEncodingYUV,\n> >  \t} },\n> >  \t{ MEDIA_BUS_FMT_SBGGR8_1X8, {\n> >  \t\t.name = \"SBGGR8_1X8\",\n> >  \t\t.code = MEDIA_BUS_FMT_SBGGR8_1X8,\n> > +\t\t.type = MediaBusFormatInfo::Type::Image,\n> >  \t\t.bitsPerPixel = 8,\n> >  \t\t.colourEncoding = PixelFormatInfo::ColourEncodingRAW,\n> >  \t} },\n> >  \t{ MEDIA_BUS_FMT_SGBRG8_1X8, {\n> >  \t\t.name = \"SGBRG8_1X8\",\n> >  \t\t.code = MEDIA_BUS_FMT_SGBRG8_1X8,\n> > +\t\t.type = MediaBusFormatInfo::Type::Image,\n> >  \t\t.bitsPerPixel = 8,\n> >  \t\t.colourEncoding = PixelFormatInfo::ColourEncodingRAW,\n> >  \t} },\n> >  \t{ MEDIA_BUS_FMT_SGRBG8_1X8, {\n> >  \t\t.name = \"SGRBG8_1X8\",\n> >  \t\t.code = MEDIA_BUS_FMT_SGRBG8_1X8,\n> > +\t\t.type = MediaBusFormatInfo::Type::Image,\n> >  \t\t.bitsPerPixel = 8,\n> >  \t\t.colourEncoding = PixelFormatInfo::ColourEncodingRAW,\n> >  \t} },\n> >  \t{ MEDIA_BUS_FMT_SRGGB8_1X8, {\n> >  \t\t.name = \"SRGGB8_1X8\",\n> >  \t\t.code = MEDIA_BUS_FMT_SRGGB8_1X8,\n> > +\t\t.type = MediaBusFormatInfo::Type::Image,\n> >  \t\t.bitsPerPixel = 8,\n> >  \t\t.colourEncoding = PixelFormatInfo::ColourEncodingRAW,\n> >  \t} },\n> >  \t{ MEDIA_BUS_FMT_SBGGR10_ALAW8_1X8, {\n> >  \t\t.name = \"SBGGR10_ALAW8_1X8\",\n> >  \t\t.code = MEDIA_BUS_FMT_SBGGR10_ALAW8_1X8,\n> > +\t\t.type = MediaBusFormatInfo::Type::Image,\n> >  \t\t.bitsPerPixel = 8,\n> >  \t\t.colourEncoding = PixelFormatInfo::ColourEncodingRAW,\n> >  \t} },\n> >  \t{ MEDIA_BUS_FMT_SGBRG10_ALAW8_1X8, {\n> >  \t\t.name = \"SGBRG10_ALAW8_1X8\",\n> >  \t\t.code = MEDIA_BUS_FMT_SGBRG10_ALAW8_1X8,\n> > +\t\t.type = MediaBusFormatInfo::Type::Image,\n> >  \t\t.bitsPerPixel = 8,\n> >  \t\t.colourEncoding = PixelFormatInfo::ColourEncodingRAW,\n> >  \t} },\n> >  \t{ MEDIA_BUS_FMT_SGRBG10_ALAW8_1X8, {\n> >  \t\t.name = \"SGRBG10_ALAW8_1X8\",\n> >  \t\t.code = MEDIA_BUS_FMT_SGRBG10_ALAW8_1X8,\n> > +\t\t.type = MediaBusFormatInfo::Type::Image,\n> >  \t\t.bitsPerPixel = 8,\n> >  \t\t.colourEncoding = PixelFormatInfo::ColourEncodingRAW,\n> >  \t} },\n> >  \t{ MEDIA_BUS_FMT_SRGGB10_ALAW8_1X8, {\n> >  \t\t.name = \"SRGGB10_ALAW8_1X8\",\n> >  \t\t.code = MEDIA_BUS_FMT_SRGGB10_ALAW8_1X8,\n> > +\t\t.type = MediaBusFormatInfo::Type::Image,\n> >  \t\t.bitsPerPixel = 8,\n> >  \t\t.colourEncoding = PixelFormatInfo::ColourEncodingRAW,\n> >  \t} },\n> >  \t{ MEDIA_BUS_FMT_SBGGR10_DPCM8_1X8, {\n> >  \t\t.name = \"SBGGR10_DPCM8_1X8\",\n> >  \t\t.code = MEDIA_BUS_FMT_SBGGR10_DPCM8_1X8,\n> > +\t\t.type = MediaBusFormatInfo::Type::Image,\n> >  \t\t.bitsPerPixel = 8,\n> >  \t\t.colourEncoding = PixelFormatInfo::ColourEncodingRAW,\n> >  \t} },\n> >  \t{ MEDIA_BUS_FMT_SGBRG10_DPCM8_1X8, {\n> >  \t\t.name = \"SGBRG10_DPCM8_1X8\",\n> >  \t\t.code = MEDIA_BUS_FMT_SGBRG10_DPCM8_1X8,\n> > +\t\t.type = MediaBusFormatInfo::Type::Image,\n> >  \t\t.bitsPerPixel = 8,\n> >  \t\t.colourEncoding = PixelFormatInfo::ColourEncodingRAW,\n> >  \t} },\n> >  \t{ MEDIA_BUS_FMT_SGRBG10_DPCM8_1X8, {\n> >  \t\t.name = \"SGRBG10_DPCM8_1X8\",\n> >  \t\t.code = MEDIA_BUS_FMT_SGRBG10_DPCM8_1X8,\n> > +\t\t.type = MediaBusFormatInfo::Type::Image,\n> >  \t\t.bitsPerPixel = 8,\n> >  \t\t.colourEncoding = PixelFormatInfo::ColourEncodingRAW,\n> >  \t} },\n> >  \t{ MEDIA_BUS_FMT_SRGGB10_DPCM8_1X8, {\n> >  \t\t.name = \"SRGGB10_DPCM8_1X8\",\n> >  \t\t.code = MEDIA_BUS_FMT_SRGGB10_DPCM8_1X8,\n> > +\t\t.type = MediaBusFormatInfo::Type::Image,\n> >  \t\t.bitsPerPixel = 8,\n> >  \t\t.colourEncoding = PixelFormatInfo::ColourEncodingRAW,\n> >  \t} },\n> >  \t{ MEDIA_BUS_FMT_SBGGR10_2X8_PADHI_BE, {\n> >  \t\t.name = \"SBGGR10_2X8_PADHI_BE\",\n> >  \t\t.code = MEDIA_BUS_FMT_SBGGR10_2X8_PADHI_BE,\n> > +\t\t.type = MediaBusFormatInfo::Type::Image,\n> >  \t\t.bitsPerPixel = 16,\n> >  \t\t.colourEncoding = PixelFormatInfo::ColourEncodingRAW,\n> >  \t} },\n> >  \t{ MEDIA_BUS_FMT_SBGGR10_2X8_PADHI_LE, {\n> >  \t\t.name = \"SBGGR10_2X8_PADHI_LE\",\n> >  \t\t.code = MEDIA_BUS_FMT_SBGGR10_2X8_PADHI_LE,\n> > +\t\t.type = MediaBusFormatInfo::Type::Image,\n> >  \t\t.bitsPerPixel = 16,\n> >  \t\t.colourEncoding = PixelFormatInfo::ColourEncodingRAW,\n> >  \t} },\n> >  \t{ MEDIA_BUS_FMT_SBGGR10_2X8_PADLO_BE, {\n> >  \t\t.name = \"SBGGR10_2X8_PADLO_BE\",\n> >  \t\t.code = MEDIA_BUS_FMT_SBGGR10_2X8_PADLO_BE,\n> > +\t\t.type = MediaBusFormatInfo::Type::Image,\n> >  \t\t.bitsPerPixel = 16,\n> >  \t\t.colourEncoding = PixelFormatInfo::ColourEncodingRAW,\n> >  \t} },\n> >  \t{ MEDIA_BUS_FMT_SBGGR10_2X8_PADLO_LE, {\n> >  \t\t.name = \"SBGGR10_2X8_PADLO_LE\",\n> >  \t\t.code = MEDIA_BUS_FMT_SBGGR10_2X8_PADLO_LE,\n> > +\t\t.type = MediaBusFormatInfo::Type::Image,\n> >  \t\t.bitsPerPixel = 16,\n> >  \t\t.colourEncoding = PixelFormatInfo::ColourEncodingRAW,\n> >  \t} },\n> >  \t{ MEDIA_BUS_FMT_SBGGR10_1X10, {\n> >  \t\t.name = \"SBGGR10_1X10\",\n> >  \t\t.code = MEDIA_BUS_FMT_SBGGR10_1X10,\n> > +\t\t.type = MediaBusFormatInfo::Type::Image,\n> >  \t\t.bitsPerPixel = 10,\n> >  \t\t.colourEncoding = PixelFormatInfo::ColourEncodingRAW,\n> >  \t} },\n> >  \t{ MEDIA_BUS_FMT_SGBRG10_1X10, {\n> >  \t\t.name = \"SGBRG10_1X10\",\n> >  \t\t.code = MEDIA_BUS_FMT_SGBRG10_1X10,\n> > +\t\t.type = MediaBusFormatInfo::Type::Image,\n> >  \t\t.bitsPerPixel = 10,\n> >  \t\t.colourEncoding = PixelFormatInfo::ColourEncodingRAW,\n> >  \t} },\n> >  \t{ MEDIA_BUS_FMT_SGRBG10_1X10, {\n> >  \t\t.name = \"SGRBG10_1X10\",\n> >  \t\t.code = MEDIA_BUS_FMT_SGRBG10_1X10,\n> > +\t\t.type = MediaBusFormatInfo::Type::Image,\n> >  \t\t.bitsPerPixel = 10,\n> >  \t\t.colourEncoding = PixelFormatInfo::ColourEncodingRAW,\n> >  \t} },\n> >  \t{ MEDIA_BUS_FMT_SRGGB10_1X10, {\n> >  \t\t.name = \"SRGGB10_1X10\",\n> >  \t\t.code = MEDIA_BUS_FMT_SRGGB10_1X10,\n> > +\t\t.type = MediaBusFormatInfo::Type::Image,\n> >  \t\t.bitsPerPixel = 10,\n> >  \t\t.colourEncoding = PixelFormatInfo::ColourEncodingRAW,\n> >  \t} },\n> >  \t{ MEDIA_BUS_FMT_SBGGR12_1X12, {\n> >  \t\t.name = \"SBGGR12_1X12\",\n> >  \t\t.code = MEDIA_BUS_FMT_SBGGR12_1X12,\n> > +\t\t.type = MediaBusFormatInfo::Type::Image,\n> >  \t\t.bitsPerPixel = 12,\n> >  \t\t.colourEncoding = PixelFormatInfo::ColourEncodingRAW,\n> >  \t} },\n> >  \t{ MEDIA_BUS_FMT_SGBRG12_1X12, {\n> >  \t\t.name = \"SGBRG12_1X12\",\n> >  \t\t.code = MEDIA_BUS_FMT_SGBRG12_1X12,\n> > +\t\t.type = MediaBusFormatInfo::Type::Image,\n> >  \t\t.bitsPerPixel = 12,\n> >  \t\t.colourEncoding = PixelFormatInfo::ColourEncodingRAW,\n> >  \t} },\n> >  \t{ MEDIA_BUS_FMT_SGRBG12_1X12, {\n> >  \t\t.name = \"SGRBG12_1X12\",\n> >  \t\t.code = MEDIA_BUS_FMT_SGRBG12_1X12,\n> > +\t\t.type = MediaBusFormatInfo::Type::Image,\n> >  \t\t.bitsPerPixel = 12,\n> >  \t\t.colourEncoding = PixelFormatInfo::ColourEncodingRAW,\n> >  \t} },\n> >  \t{ MEDIA_BUS_FMT_SRGGB12_1X12, {\n> >  \t\t.name = \"SRGGB12_1X12\",\n> >  \t\t.code = MEDIA_BUS_FMT_SRGGB12_1X12,\n> > +\t\t.type = MediaBusFormatInfo::Type::Image,\n> >  \t\t.bitsPerPixel = 12,\n> >  \t\t.colourEncoding = PixelFormatInfo::ColourEncodingRAW,\n> >  \t} },\n> > @@ -532,15 +627,24 @@ const std::map<uint32_t, MediaBusFormatInfo> mediaBusFormatInfo{\n> >  \t{ MEDIA_BUS_FMT_AHSV8888_1X32, {\n> >  \t\t.name = \"AHSV8888_1X32\",\n> >  \t\t.code = MEDIA_BUS_FMT_AHSV8888_1X32,\n> > +\t\t.type = MediaBusFormatInfo::Type::Image,\n> >  \t\t.bitsPerPixel = 32,\n> >  \t\t.colourEncoding = PixelFormatInfo::ColourEncodingRGB,\n> >  \t} },\n> >  \t{ MEDIA_BUS_FMT_JPEG_1X8, {\n> >  \t\t.name = \"JPEG_1X8\",\n> >  \t\t.code = MEDIA_BUS_FMT_JPEG_1X8,\n> > +\t\t.type = MediaBusFormatInfo::Type::Image,\n> >  \t\t.bitsPerPixel = 8,\n> >  \t\t.colourEncoding = PixelFormatInfo::ColourEncodingYUV,\n> >  \t} },\n> > +\t{ MEDIA_BUS_FMT_METADATA_FIXED, {\n> > +\t\t.name = \"METADATA_FIXED\",\n> > +\t\t.code = MEDIA_BUS_FMT_METADATA_FIXED,\n> > +\t\t.type = MediaBusFormatInfo::Type::Metadata,\n> > +\t\t.bitsPerPixel = 0,\n> > +\t\t.colourEncoding = PixelFormatInfo::ColourEncodingRAW,\n> \n> Is it worth adding PixelFormatInfo::ColourEncodingNone or will it\n> generate more issues ?\n\nI considered it, but I decided not to do so yet, exactly because if the\nissues it could generate. Maybe I'll do so later, I'll see how this all\nfits together.\n\n> > +\t} },\n> >  };\n> >\n> >  } /* namespace */","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 32571BD160\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 28 Feb 2024 10:41:40 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 78E3762868;\n\tWed, 28 Feb 2024 11:41:39 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 67478627F9\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 28 Feb 2024 11:41:38 +0100 (CET)","from pendragon.ideasonboard.com (89-27-53-110.bb.dnainternet.fi\n\t[89.27.53.110])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 76978672;\n\tWed, 28 Feb 2024 11:41:25 +0100 (CET)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"mq9+K5nI\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1709116885;\n\tbh=ru7zRvbRi7O3geNXpTljleuUtwBQoR4KevOM+OKXHmo=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=mq9+K5nIdN19Xi+hze10tMnoFpVCqmdwFftvB9Bv0i7lz6jEGamTXSdhaBOmBeY8x\n\t+6or1aVsjAQTbJpCF4+pZeY4jHqr5Q4udkGzWvvjoA9cX0ryqvN7xpJbaS5URfvi9V\n\tp9sQR4/NvBLwHcQ01JSJSupIzet0+Rb/nob1ulEA=","Date":"Wed, 28 Feb 2024 12:41:40 +0200","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Jacopo Mondi <jacopo.mondi@ideasonboard.com>","Subject":"Re: [PATCH 4/9] libcamera: v4l2_subdevice: Extend MediaBusFormatInfo\n\twith metadata formats","Message-ID":"<20240228104140.GG3419@pendragon.ideasonboard.com>","References":"<20240227140953.26093-1-laurent.pinchart@ideasonboard.com>\n\t<20240227140953.26093-5-laurent.pinchart@ideasonboard.com>\n\t<gp3kb64gzvanapli5i6kzh5322gy2idxezjvcy432aemea7z2g@pasllllygfvd>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<gp3kb64gzvanapli5i6kzh5322gy2idxezjvcy432aemea7z2g@pasllllygfvd>","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>","Cc":"libcamera-devel@lists.libcamera.org","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]