[{"id":28971,"web_url":"https://patchwork.libcamera.org/comment/28971/","msgid":"<171046323985.1913896.7202388999073782169@ping.linuxembedded.co.uk>","date":"2024-03-15T00:40:39","subject":"Re: [PATCH v2 04/14] libcamera: v4l2_subdevice: Extend\n\tMediaBusFormatInfo with metadata formats","submitter":{"id":4,"url":"https://patchwork.libcamera.org/api/people/4/","name":"Kieran Bingham","email":"kieran.bingham@ideasonboard.com"},"content":"Quoting Laurent Pinchart (2024-03-15 00:16:03)\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\nAnd thats fine with me!\n\n> \n> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n> Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>\n> ---\n> Changes since combined RFC:\n> \n> - Rebase on addition oa 14-bit bayer formats\n> ---\n>  include/libcamera/internal/v4l2_subdevice.h |   7 ++\n>  src/libcamera/v4l2_subdevice.cpp            | 110 +++++++++++++++++++-\n>  2 files changed, 116 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> +       enum class Type {\n> +               Image,\n> +               Metadata,\n> +               EmbeddedData,\n> +       };\n> +\n>         bool isValid() const { return code != 0; }\n>  \n>         static const MediaBusFormatInfo &info(uint32_t code);\n>  \n>         const char *name;\n>         uint32_t code;\n> +       Type type;\n>         unsigned int bitsPerPixel;\n>         PixelFormatInfo::ColourEncoding colourEncoding;\n>  };\n> diff --git a/src/libcamera/v4l2_subdevice.cpp b/src/libcamera/v4l2_subdevice.cpp\n> index 4918e28e5f18..a508cef4dcbb 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 (MEDIA_BUS_FMT_*)\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>   * \\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\nReviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n\n>   */\n>  \n>  namespace {\n> @@ -75,480 +94,560 @@ const std::map<uint32_t, MediaBusFormatInfo> mediaBusFormatInfo{\n>         { MEDIA_BUS_FMT_RGB444_2X8_PADHI_BE, {\n>                 .name = \"RGB444_2X8_PADHI_BE\",\n>                 .code = MEDIA_BUS_FMT_RGB444_2X8_PADHI_BE,\n> +               .type = MediaBusFormatInfo::Type::Image,\n>                 .bitsPerPixel = 16,\n>                 .colourEncoding = PixelFormatInfo::ColourEncodingRGB,\n>         } },\n>         { MEDIA_BUS_FMT_RGB444_2X8_PADHI_LE, {\n>                 .name = \"RGB444_2X8_PADHI_LE\",\n>                 .code = MEDIA_BUS_FMT_RGB444_2X8_PADHI_LE,\n> +               .type = MediaBusFormatInfo::Type::Image,\n>                 .bitsPerPixel = 16,\n>                 .colourEncoding = PixelFormatInfo::ColourEncodingRGB,\n>         } },\n>         { MEDIA_BUS_FMT_RGB555_2X8_PADHI_BE, {\n>                 .name = \"RGB555_2X8_PADHI_BE\",\n>                 .code = MEDIA_BUS_FMT_RGB555_2X8_PADHI_BE,\n> +               .type = MediaBusFormatInfo::Type::Image,\n>                 .bitsPerPixel = 16,\n>                 .colourEncoding = PixelFormatInfo::ColourEncodingRGB,\n>         } },\n>         { MEDIA_BUS_FMT_RGB555_2X8_PADHI_LE, {\n>                 .name = \"RGB555_2X8_PADHI_LE\",\n>                 .code = MEDIA_BUS_FMT_RGB555_2X8_PADHI_LE,\n> +               .type = MediaBusFormatInfo::Type::Image,\n>                 .bitsPerPixel = 16,\n>                 .colourEncoding = PixelFormatInfo::ColourEncodingRGB,\n>         } },\n>         { MEDIA_BUS_FMT_RGB565_1X16, {\n>                 .name = \"RGB565_1X16\",\n>                 .code = MEDIA_BUS_FMT_RGB565_1X16,\n> +               .type = MediaBusFormatInfo::Type::Image,\n>                 .bitsPerPixel = 16,\n>                 .colourEncoding = PixelFormatInfo::ColourEncodingRGB,\n>         } },\n>         { MEDIA_BUS_FMT_BGR565_2X8_BE, {\n>                 .name = \"BGR565_2X8_BE\",\n>                 .code = MEDIA_BUS_FMT_BGR565_2X8_BE,\n> +               .type = MediaBusFormatInfo::Type::Image,\n>                 .bitsPerPixel = 16,\n>                 .colourEncoding = PixelFormatInfo::ColourEncodingRGB,\n>         } },\n>         { MEDIA_BUS_FMT_BGR565_2X8_LE, {\n>                 .name = \"BGR565_2X8_LE\",\n>                 .code = MEDIA_BUS_FMT_BGR565_2X8_LE,\n> +               .type = MediaBusFormatInfo::Type::Image,\n>                 .bitsPerPixel = 16,\n>                 .colourEncoding = PixelFormatInfo::ColourEncodingRGB,\n>         } },\n>         { MEDIA_BUS_FMT_RGB565_2X8_BE, {\n>                 .name = \"RGB565_2X8_BE\",\n>                 .code = MEDIA_BUS_FMT_RGB565_2X8_BE,\n> +               .type = MediaBusFormatInfo::Type::Image,\n>                 .bitsPerPixel = 16,\n>                 .colourEncoding = PixelFormatInfo::ColourEncodingRGB,\n>         } },\n>         { MEDIA_BUS_FMT_RGB565_2X8_LE, {\n>                 .name = \"RGB565_2X8_LE\",\n>                 .code = MEDIA_BUS_FMT_RGB565_2X8_LE,\n> +               .type = MediaBusFormatInfo::Type::Image,\n>                 .bitsPerPixel = 16,\n>                 .colourEncoding = PixelFormatInfo::ColourEncodingRGB,\n>         } },\n>         { MEDIA_BUS_FMT_RGB666_1X18, {\n>                 .name = \"RGB666_1X18\",\n>                 .code = MEDIA_BUS_FMT_RGB666_1X18,\n> +               .type = MediaBusFormatInfo::Type::Image,\n>                 .bitsPerPixel = 18,\n>                 .colourEncoding = PixelFormatInfo::ColourEncodingRGB,\n>         } },\n>         { MEDIA_BUS_FMT_BGR888_1X24, {\n>                 .name = \"BGR888_1X24\",\n>                 .code = MEDIA_BUS_FMT_BGR888_1X24,\n> +               .type = MediaBusFormatInfo::Type::Image,\n>                 .bitsPerPixel = 24,\n>                 .colourEncoding = PixelFormatInfo::ColourEncodingRGB,\n>         } },\n>         { MEDIA_BUS_FMT_RGB888_1X24, {\n>                 .name = \"RGB888_1X24\",\n>                 .code = MEDIA_BUS_FMT_RGB888_1X24,\n> +               .type = MediaBusFormatInfo::Type::Image,\n>                 .bitsPerPixel = 24,\n>                 .colourEncoding = PixelFormatInfo::ColourEncodingRGB,\n>         } },\n>         { MEDIA_BUS_FMT_RGB888_2X12_BE, {\n>                 .name = \"RGB888_2X12_BE\",\n>                 .code = MEDIA_BUS_FMT_RGB888_2X12_BE,\n> +               .type = MediaBusFormatInfo::Type::Image,\n>                 .bitsPerPixel = 24,\n>                 .colourEncoding = PixelFormatInfo::ColourEncodingRGB,\n>         } },\n>         { MEDIA_BUS_FMT_RGB888_2X12_LE, {\n>                 .name = \"RGB888_2X12_LE\",\n>                 .code = MEDIA_BUS_FMT_RGB888_2X12_LE,\n> +               .type = MediaBusFormatInfo::Type::Image,\n>                 .bitsPerPixel = 24,\n>                 .colourEncoding = PixelFormatInfo::ColourEncodingRGB,\n>         } },\n>         { MEDIA_BUS_FMT_ARGB8888_1X32, {\n>                 .name = \"ARGB8888_1X32\",\n>                 .code = MEDIA_BUS_FMT_ARGB8888_1X32,\n> +               .type = MediaBusFormatInfo::Type::Image,\n>                 .bitsPerPixel = 32,\n>                 .colourEncoding = PixelFormatInfo::ColourEncodingRGB,\n>         } },\n>         { MEDIA_BUS_FMT_Y8_1X8, {\n>                 .name = \"Y8_1X8\",\n>                 .code = MEDIA_BUS_FMT_Y8_1X8,\n> +               .type = MediaBusFormatInfo::Type::Image,\n>                 .bitsPerPixel = 8,\n>                 .colourEncoding = PixelFormatInfo::ColourEncodingYUV,\n>         } },\n>         { MEDIA_BUS_FMT_UV8_1X8, {\n>                 .name = \"UV8_1X8\",\n>                 .code = MEDIA_BUS_FMT_UV8_1X8,\n> +               .type = MediaBusFormatInfo::Type::Image,\n>                 .bitsPerPixel = 8,\n>                 .colourEncoding = PixelFormatInfo::ColourEncodingYUV,\n>         } },\n>         { MEDIA_BUS_FMT_UYVY8_1_5X8, {\n>                 .name = \"UYVY8_1_5X8\",\n>                 .code = MEDIA_BUS_FMT_UYVY8_1_5X8,\n> +               .type = MediaBusFormatInfo::Type::Image,\n>                 .bitsPerPixel = 12,\n>                 .colourEncoding = PixelFormatInfo::ColourEncodingYUV,\n>         } },\n>         { MEDIA_BUS_FMT_VYUY8_1_5X8, {\n>                 .name = \"VYUY8_1_5X8\",\n>                 .code = MEDIA_BUS_FMT_VYUY8_1_5X8,\n> +               .type = MediaBusFormatInfo::Type::Image,\n>                 .bitsPerPixel = 12,\n>                 .colourEncoding = PixelFormatInfo::ColourEncodingYUV,\n>         } },\n>         { MEDIA_BUS_FMT_YUYV8_1_5X8, {\n>                 .name = \"YUYV8_1_5X8\",\n>                 .code = MEDIA_BUS_FMT_YUYV8_1_5X8,\n> +               .type = MediaBusFormatInfo::Type::Image,\n>                 .bitsPerPixel = 12,\n>                 .colourEncoding = PixelFormatInfo::ColourEncodingYUV,\n>         } },\n>         { MEDIA_BUS_FMT_YVYU8_1_5X8, {\n>                 .name = \"YVYU8_1_5X8\",\n>                 .code = MEDIA_BUS_FMT_YVYU8_1_5X8,\n> +               .type = MediaBusFormatInfo::Type::Image,\n>                 .bitsPerPixel = 12,\n>                 .colourEncoding = PixelFormatInfo::ColourEncodingYUV,\n>         } },\n>         { MEDIA_BUS_FMT_UYVY8_2X8, {\n>                 .name = \"UYVY8_2X8\",\n>                 .code = MEDIA_BUS_FMT_UYVY8_2X8,\n> +               .type = MediaBusFormatInfo::Type::Image,\n>                 .bitsPerPixel = 16,\n>                 .colourEncoding = PixelFormatInfo::ColourEncodingYUV,\n>         } },\n>         { MEDIA_BUS_FMT_VYUY8_2X8, {\n>                 .name = \"VYUY8_2X8\",\n>                 .code = MEDIA_BUS_FMT_VYUY8_2X8,\n> +               .type = MediaBusFormatInfo::Type::Image,\n>                 .bitsPerPixel = 16,\n>                 .colourEncoding = PixelFormatInfo::ColourEncodingYUV,\n>         } },\n>         { MEDIA_BUS_FMT_YUYV8_2X8, {\n>                 .name = \"YUYV8_2X8\",\n>                 .code = MEDIA_BUS_FMT_YUYV8_2X8,\n> +               .type = MediaBusFormatInfo::Type::Image,\n>                 .bitsPerPixel = 16,\n>                 .colourEncoding = PixelFormatInfo::ColourEncodingYUV,\n>         } },\n>         { MEDIA_BUS_FMT_YVYU8_2X8, {\n>                 .name = \"YVYU8_2X8\",\n>                 .code = MEDIA_BUS_FMT_YVYU8_2X8,\n> +               .type = MediaBusFormatInfo::Type::Image,\n>                 .bitsPerPixel = 16,\n>                 .colourEncoding = PixelFormatInfo::ColourEncodingYUV,\n>         } },\n>         { MEDIA_BUS_FMT_Y10_1X10, {\n>                 .name = \"Y10_1X10\",\n>                 .code = MEDIA_BUS_FMT_Y10_1X10,\n> +               .type = MediaBusFormatInfo::Type::Image,\n>                 .bitsPerPixel = 10,\n>                 .colourEncoding = PixelFormatInfo::ColourEncodingYUV,\n>         } },\n>         { MEDIA_BUS_FMT_UYVY10_2X10, {\n>                 .name = \"UYVY10_2X10\",\n>                 .code = MEDIA_BUS_FMT_UYVY10_2X10,\n> +               .type = MediaBusFormatInfo::Type::Image,\n>                 .bitsPerPixel = 20,\n>                 .colourEncoding = PixelFormatInfo::ColourEncodingYUV,\n>         } },\n>         { MEDIA_BUS_FMT_VYUY10_2X10, {\n>                 .name = \"VYUY10_2X10\",\n>                 .code = MEDIA_BUS_FMT_VYUY10_2X10,\n> +               .type = MediaBusFormatInfo::Type::Image,\n>                 .bitsPerPixel = 20,\n>                 .colourEncoding = PixelFormatInfo::ColourEncodingYUV,\n>         } },\n>         { MEDIA_BUS_FMT_YUYV10_2X10, {\n>                 .name = \"YUYV10_2X10\",\n>                 .code = MEDIA_BUS_FMT_YUYV10_2X10,\n> +               .type = MediaBusFormatInfo::Type::Image,\n>                 .bitsPerPixel = 20,\n>                 .colourEncoding = PixelFormatInfo::ColourEncodingYUV,\n>         } },\n>         { MEDIA_BUS_FMT_YVYU10_2X10, {\n>                 .name = \"YVYU10_2X10\",\n>                 .code = MEDIA_BUS_FMT_YVYU10_2X10,\n> +               .type = MediaBusFormatInfo::Type::Image,\n>                 .bitsPerPixel = 20,\n>                 .colourEncoding = PixelFormatInfo::ColourEncodingYUV,\n>         } },\n>         { MEDIA_BUS_FMT_Y12_1X12, {\n>                 .name = \"Y12_1X12\",\n>                 .code = MEDIA_BUS_FMT_Y12_1X12,\n> +               .type = MediaBusFormatInfo::Type::Image,\n>                 .bitsPerPixel = 12,\n>                 .colourEncoding = PixelFormatInfo::ColourEncodingYUV,\n>         } },\n>         { MEDIA_BUS_FMT_Y16_1X16, {\n>                 .name = \"Y16_1X16\",\n>                 .code = MEDIA_BUS_FMT_Y16_1X16,\n> +               .type = MediaBusFormatInfo::Type::Image,\n>                 .bitsPerPixel = 16,\n>                 .colourEncoding = PixelFormatInfo::ColourEncodingYUV,\n>         } },\n>         { MEDIA_BUS_FMT_UYVY8_1X16, {\n>                 .name = \"UYVY8_1X16\",\n>                 .code = MEDIA_BUS_FMT_UYVY8_1X16,\n> +               .type = MediaBusFormatInfo::Type::Image,\n>                 .bitsPerPixel = 16,\n>                 .colourEncoding = PixelFormatInfo::ColourEncodingYUV,\n>         } },\n>         { MEDIA_BUS_FMT_VYUY8_1X16, {\n>                 .name = \"VYUY8_1X16\",\n>                 .code = MEDIA_BUS_FMT_VYUY8_1X16,\n> +               .type = MediaBusFormatInfo::Type::Image,\n>                 .bitsPerPixel = 16,\n>                 .colourEncoding = PixelFormatInfo::ColourEncodingYUV,\n>         } },\n>         { MEDIA_BUS_FMT_YUYV8_1X16, {\n>                 .name = \"YUYV8_1X16\",\n>                 .code = MEDIA_BUS_FMT_YUYV8_1X16,\n> +               .type = MediaBusFormatInfo::Type::Image,\n>                 .bitsPerPixel = 16,\n>                 .colourEncoding = PixelFormatInfo::ColourEncodingYUV,\n>         } },\n>         { MEDIA_BUS_FMT_YVYU8_1X16, {\n>                 .name = \"YVYU8_1X16\",\n>                 .code = MEDIA_BUS_FMT_YVYU8_1X16,\n> +               .type = MediaBusFormatInfo::Type::Image,\n>                 .bitsPerPixel = 16,\n>                 .colourEncoding = PixelFormatInfo::ColourEncodingYUV,\n>         } },\n>         { MEDIA_BUS_FMT_YDYUYDYV8_1X16, {\n>                 .name = \"YDYUYDYV8_1X16\",\n>                 .code = MEDIA_BUS_FMT_YDYUYDYV8_1X16,\n> +               .type = MediaBusFormatInfo::Type::Image,\n>                 .bitsPerPixel = 16,\n>                 .colourEncoding = PixelFormatInfo::ColourEncodingYUV,\n>         } },\n>         { MEDIA_BUS_FMT_UYVY10_1X20, {\n>                 .name = \"UYVY10_1X20\",\n>                 .code = MEDIA_BUS_FMT_UYVY10_1X20,\n> +               .type = MediaBusFormatInfo::Type::Image,\n>                 .bitsPerPixel = 20,\n>                 .colourEncoding = PixelFormatInfo::ColourEncodingYUV,\n>         } },\n>         { MEDIA_BUS_FMT_VYUY10_1X20, {\n>                 .name = \"VYUY10_1X20\",\n>                 .code = MEDIA_BUS_FMT_VYUY10_1X20,\n> +               .type = MediaBusFormatInfo::Type::Image,\n>                 .bitsPerPixel = 20,\n>                 .colourEncoding = PixelFormatInfo::ColourEncodingYUV,\n>         } },\n>         { MEDIA_BUS_FMT_YUYV10_1X20, {\n>                 .name = \"YUYV10_1X20\",\n>                 .code = MEDIA_BUS_FMT_YUYV10_1X20,\n> +               .type = MediaBusFormatInfo::Type::Image,\n>                 .bitsPerPixel = 20,\n>                 .colourEncoding = PixelFormatInfo::ColourEncodingYUV,\n>         } },\n>         { MEDIA_BUS_FMT_YVYU10_1X20, {\n>                 .name = \"YVYU10_1X20\",\n>                 .code = MEDIA_BUS_FMT_YVYU10_1X20,\n> +               .type = MediaBusFormatInfo::Type::Image,\n>                 .bitsPerPixel = 20,\n>                 .colourEncoding = PixelFormatInfo::ColourEncodingYUV,\n>         } },\n>         { MEDIA_BUS_FMT_YUV8_1X24, {\n>                 .name = \"YUV8_1X24\",\n>                 .code = MEDIA_BUS_FMT_YUV8_1X24,\n> +               .type = MediaBusFormatInfo::Type::Image,\n>                 .bitsPerPixel = 24,\n>                 .colourEncoding = PixelFormatInfo::ColourEncodingYUV,\n>         } },\n>         { MEDIA_BUS_FMT_YUV10_1X30, {\n>                 .name = \"YUV10_1X30\",\n>                 .code = MEDIA_BUS_FMT_YUV10_1X30,\n> +               .type = MediaBusFormatInfo::Type::Image,\n>                 .bitsPerPixel = 30,\n>                 .colourEncoding = PixelFormatInfo::ColourEncodingYUV,\n>         } },\n>         { MEDIA_BUS_FMT_AYUV8_1X32, {\n>                 .name = \"AYUV8_1X32\",\n>                 .code = MEDIA_BUS_FMT_AYUV8_1X32,\n> +               .type = MediaBusFormatInfo::Type::Image,\n>                 .bitsPerPixel = 32,\n>                 .colourEncoding = PixelFormatInfo::ColourEncodingYUV,\n>         } },\n>         { MEDIA_BUS_FMT_UYVY12_2X12, {\n>                 .name = \"UYVY12_2X12\",\n>                 .code = MEDIA_BUS_FMT_UYVY12_2X12,\n> +               .type = MediaBusFormatInfo::Type::Image,\n>                 .bitsPerPixel = 24,\n>                 .colourEncoding = PixelFormatInfo::ColourEncodingYUV,\n>         } },\n>         { MEDIA_BUS_FMT_VYUY12_2X12, {\n>                 .name = \"VYUY12_2X12\",\n>                 .code = MEDIA_BUS_FMT_VYUY12_2X12,\n> +               .type = MediaBusFormatInfo::Type::Image,\n>                 .bitsPerPixel = 24,\n>                 .colourEncoding = PixelFormatInfo::ColourEncodingYUV,\n>         } },\n>         { MEDIA_BUS_FMT_YUYV12_2X12, {\n>                 .name = \"YUYV12_2X12\",\n>                 .code = MEDIA_BUS_FMT_YUYV12_2X12,\n> +               .type = MediaBusFormatInfo::Type::Image,\n>                 .bitsPerPixel = 24,\n>                 .colourEncoding = PixelFormatInfo::ColourEncodingYUV,\n>         } },\n>         { MEDIA_BUS_FMT_YVYU12_2X12, {\n>                 .name = \"YVYU12_2X12\",\n>                 .code = MEDIA_BUS_FMT_YVYU12_2X12,\n> +               .type = MediaBusFormatInfo::Type::Image,\n>                 .bitsPerPixel = 24,\n>                 .colourEncoding = PixelFormatInfo::ColourEncodingYUV,\n>         } },\n>         { MEDIA_BUS_FMT_UYVY12_1X24, {\n>                 .name = \"UYVY12_1X24\",\n>                 .code = MEDIA_BUS_FMT_UYVY12_1X24,\n> +               .type = MediaBusFormatInfo::Type::Image,\n>                 .bitsPerPixel = 24,\n>                 .colourEncoding = PixelFormatInfo::ColourEncodingYUV,\n>         } },\n>         { MEDIA_BUS_FMT_VYUY12_1X24, {\n>                 .name = \"VYUY12_1X24\",\n>                 .code = MEDIA_BUS_FMT_VYUY12_1X24,\n> +               .type = MediaBusFormatInfo::Type::Image,\n>                 .bitsPerPixel = 24,\n>                 .colourEncoding = PixelFormatInfo::ColourEncodingYUV,\n>         } },\n>         { MEDIA_BUS_FMT_YUYV12_1X24, {\n>                 .name = \"YUYV12_1X24\",\n>                 .code = MEDIA_BUS_FMT_YUYV12_1X24,\n> +               .type = MediaBusFormatInfo::Type::Image,\n>                 .bitsPerPixel = 24,\n>                 .colourEncoding = PixelFormatInfo::ColourEncodingYUV,\n>         } },\n>         { MEDIA_BUS_FMT_YVYU12_1X24, {\n>                 .name = \"YVYU12_1X24\",\n>                 .code = MEDIA_BUS_FMT_YVYU12_1X24,\n> +               .type = MediaBusFormatInfo::Type::Image,\n>                 .bitsPerPixel = 24,\n>                 .colourEncoding = PixelFormatInfo::ColourEncodingYUV,\n>         } },\n>         { MEDIA_BUS_FMT_SBGGR8_1X8, {\n>                 .name = \"SBGGR8_1X8\",\n>                 .code = MEDIA_BUS_FMT_SBGGR8_1X8,\n> +               .type = MediaBusFormatInfo::Type::Image,\n>                 .bitsPerPixel = 8,\n>                 .colourEncoding = PixelFormatInfo::ColourEncodingRAW,\n>         } },\n>         { MEDIA_BUS_FMT_SGBRG8_1X8, {\n>                 .name = \"SGBRG8_1X8\",\n>                 .code = MEDIA_BUS_FMT_SGBRG8_1X8,\n> +               .type = MediaBusFormatInfo::Type::Image,\n>                 .bitsPerPixel = 8,\n>                 .colourEncoding = PixelFormatInfo::ColourEncodingRAW,\n>         } },\n>         { MEDIA_BUS_FMT_SGRBG8_1X8, {\n>                 .name = \"SGRBG8_1X8\",\n>                 .code = MEDIA_BUS_FMT_SGRBG8_1X8,\n> +               .type = MediaBusFormatInfo::Type::Image,\n>                 .bitsPerPixel = 8,\n>                 .colourEncoding = PixelFormatInfo::ColourEncodingRAW,\n>         } },\n>         { MEDIA_BUS_FMT_SRGGB8_1X8, {\n>                 .name = \"SRGGB8_1X8\",\n>                 .code = MEDIA_BUS_FMT_SRGGB8_1X8,\n> +               .type = MediaBusFormatInfo::Type::Image,\n>                 .bitsPerPixel = 8,\n>                 .colourEncoding = PixelFormatInfo::ColourEncodingRAW,\n>         } },\n>         { MEDIA_BUS_FMT_SBGGR10_ALAW8_1X8, {\n>                 .name = \"SBGGR10_ALAW8_1X8\",\n>                 .code = MEDIA_BUS_FMT_SBGGR10_ALAW8_1X8,\n> +               .type = MediaBusFormatInfo::Type::Image,\n>                 .bitsPerPixel = 8,\n>                 .colourEncoding = PixelFormatInfo::ColourEncodingRAW,\n>         } },\n>         { MEDIA_BUS_FMT_SGBRG10_ALAW8_1X8, {\n>                 .name = \"SGBRG10_ALAW8_1X8\",\n>                 .code = MEDIA_BUS_FMT_SGBRG10_ALAW8_1X8,\n> +               .type = MediaBusFormatInfo::Type::Image,\n>                 .bitsPerPixel = 8,\n>                 .colourEncoding = PixelFormatInfo::ColourEncodingRAW,\n>         } },\n>         { MEDIA_BUS_FMT_SGRBG10_ALAW8_1X8, {\n>                 .name = \"SGRBG10_ALAW8_1X8\",\n>                 .code = MEDIA_BUS_FMT_SGRBG10_ALAW8_1X8,\n> +               .type = MediaBusFormatInfo::Type::Image,\n>                 .bitsPerPixel = 8,\n>                 .colourEncoding = PixelFormatInfo::ColourEncodingRAW,\n>         } },\n>         { MEDIA_BUS_FMT_SRGGB10_ALAW8_1X8, {\n>                 .name = \"SRGGB10_ALAW8_1X8\",\n>                 .code = MEDIA_BUS_FMT_SRGGB10_ALAW8_1X8,\n> +               .type = MediaBusFormatInfo::Type::Image,\n>                 .bitsPerPixel = 8,\n>                 .colourEncoding = PixelFormatInfo::ColourEncodingRAW,\n>         } },\n>         { MEDIA_BUS_FMT_SBGGR10_DPCM8_1X8, {\n>                 .name = \"SBGGR10_DPCM8_1X8\",\n>                 .code = MEDIA_BUS_FMT_SBGGR10_DPCM8_1X8,\n> +               .type = MediaBusFormatInfo::Type::Image,\n>                 .bitsPerPixel = 8,\n>                 .colourEncoding = PixelFormatInfo::ColourEncodingRAW,\n>         } },\n>         { MEDIA_BUS_FMT_SGBRG10_DPCM8_1X8, {\n>                 .name = \"SGBRG10_DPCM8_1X8\",\n>                 .code = MEDIA_BUS_FMT_SGBRG10_DPCM8_1X8,\n> +               .type = MediaBusFormatInfo::Type::Image,\n>                 .bitsPerPixel = 8,\n>                 .colourEncoding = PixelFormatInfo::ColourEncodingRAW,\n>         } },\n>         { MEDIA_BUS_FMT_SGRBG10_DPCM8_1X8, {\n>                 .name = \"SGRBG10_DPCM8_1X8\",\n>                 .code = MEDIA_BUS_FMT_SGRBG10_DPCM8_1X8,\n> +               .type = MediaBusFormatInfo::Type::Image,\n>                 .bitsPerPixel = 8,\n>                 .colourEncoding = PixelFormatInfo::ColourEncodingRAW,\n>         } },\n>         { MEDIA_BUS_FMT_SRGGB10_DPCM8_1X8, {\n>                 .name = \"SRGGB10_DPCM8_1X8\",\n>                 .code = MEDIA_BUS_FMT_SRGGB10_DPCM8_1X8,\n> +               .type = MediaBusFormatInfo::Type::Image,\n>                 .bitsPerPixel = 8,\n>                 .colourEncoding = PixelFormatInfo::ColourEncodingRAW,\n>         } },\n>         { MEDIA_BUS_FMT_SBGGR10_2X8_PADHI_BE, {\n>                 .name = \"SBGGR10_2X8_PADHI_BE\",\n>                 .code = MEDIA_BUS_FMT_SBGGR10_2X8_PADHI_BE,\n> +               .type = MediaBusFormatInfo::Type::Image,\n>                 .bitsPerPixel = 16,\n>                 .colourEncoding = PixelFormatInfo::ColourEncodingRAW,\n>         } },\n>         { MEDIA_BUS_FMT_SBGGR10_2X8_PADHI_LE, {\n>                 .name = \"SBGGR10_2X8_PADHI_LE\",\n>                 .code = MEDIA_BUS_FMT_SBGGR10_2X8_PADHI_LE,\n> +               .type = MediaBusFormatInfo::Type::Image,\n>                 .bitsPerPixel = 16,\n>                 .colourEncoding = PixelFormatInfo::ColourEncodingRAW,\n>         } },\n>         { MEDIA_BUS_FMT_SBGGR10_2X8_PADLO_BE, {\n>                 .name = \"SBGGR10_2X8_PADLO_BE\",\n>                 .code = MEDIA_BUS_FMT_SBGGR10_2X8_PADLO_BE,\n> +               .type = MediaBusFormatInfo::Type::Image,\n>                 .bitsPerPixel = 16,\n>                 .colourEncoding = PixelFormatInfo::ColourEncodingRAW,\n>         } },\n>         { MEDIA_BUS_FMT_SBGGR10_2X8_PADLO_LE, {\n>                 .name = \"SBGGR10_2X8_PADLO_LE\",\n>                 .code = MEDIA_BUS_FMT_SBGGR10_2X8_PADLO_LE,\n> +               .type = MediaBusFormatInfo::Type::Image,\n>                 .bitsPerPixel = 16,\n>                 .colourEncoding = PixelFormatInfo::ColourEncodingRAW,\n>         } },\n>         { MEDIA_BUS_FMT_SBGGR10_1X10, {\n>                 .name = \"SBGGR10_1X10\",\n>                 .code = MEDIA_BUS_FMT_SBGGR10_1X10,\n> +               .type = MediaBusFormatInfo::Type::Image,\n>                 .bitsPerPixel = 10,\n>                 .colourEncoding = PixelFormatInfo::ColourEncodingRAW,\n>         } },\n>         { MEDIA_BUS_FMT_SGBRG10_1X10, {\n>                 .name = \"SGBRG10_1X10\",\n>                 .code = MEDIA_BUS_FMT_SGBRG10_1X10,\n> +               .type = MediaBusFormatInfo::Type::Image,\n>                 .bitsPerPixel = 10,\n>                 .colourEncoding = PixelFormatInfo::ColourEncodingRAW,\n>         } },\n>         { MEDIA_BUS_FMT_SGRBG10_1X10, {\n>                 .name = \"SGRBG10_1X10\",\n>                 .code = MEDIA_BUS_FMT_SGRBG10_1X10,\n> +               .type = MediaBusFormatInfo::Type::Image,\n>                 .bitsPerPixel = 10,\n>                 .colourEncoding = PixelFormatInfo::ColourEncodingRAW,\n>         } },\n>         { MEDIA_BUS_FMT_SRGGB10_1X10, {\n>                 .name = \"SRGGB10_1X10\",\n>                 .code = MEDIA_BUS_FMT_SRGGB10_1X10,\n> +               .type = MediaBusFormatInfo::Type::Image,\n>                 .bitsPerPixel = 10,\n>                 .colourEncoding = PixelFormatInfo::ColourEncodingRAW,\n>         } },\n>         { MEDIA_BUS_FMT_SBGGR12_1X12, {\n>                 .name = \"SBGGR12_1X12\",\n>                 .code = MEDIA_BUS_FMT_SBGGR12_1X12,\n> +               .type = MediaBusFormatInfo::Type::Image,\n>                 .bitsPerPixel = 12,\n>                 .colourEncoding = PixelFormatInfo::ColourEncodingRAW,\n>         } },\n>         { MEDIA_BUS_FMT_SGBRG12_1X12, {\n>                 .name = \"SGBRG12_1X12\",\n>                 .code = MEDIA_BUS_FMT_SGBRG12_1X12,\n> +               .type = MediaBusFormatInfo::Type::Image,\n>                 .bitsPerPixel = 12,\n>                 .colourEncoding = PixelFormatInfo::ColourEncodingRAW,\n>         } },\n>         { MEDIA_BUS_FMT_SGRBG12_1X12, {\n>                 .name = \"SGRBG12_1X12\",\n>                 .code = MEDIA_BUS_FMT_SGRBG12_1X12,\n> +               .type = MediaBusFormatInfo::Type::Image,\n>                 .bitsPerPixel = 12,\n>                 .colourEncoding = PixelFormatInfo::ColourEncodingRAW,\n>         } },\n>         { MEDIA_BUS_FMT_SRGGB12_1X12, {\n>                 .name = \"SRGGB12_1X12\",\n>                 .code = MEDIA_BUS_FMT_SRGGB12_1X12,\n> +               .type = MediaBusFormatInfo::Type::Image,\n>                 .bitsPerPixel = 12,\n>                 .colourEncoding = PixelFormatInfo::ColourEncodingRAW,\n>         } },\n>         { MEDIA_BUS_FMT_SBGGR14_1X14, {\n>                 .name = \"SBGGR14_1X14\",\n>                 .code = MEDIA_BUS_FMT_SBGGR14_1X14,\n> +               .type = MediaBusFormatInfo::Type::Image,\n>                 .bitsPerPixel = 14,\n>                 .colourEncoding = PixelFormatInfo::ColourEncodingRAW,\n>         } },\n>         { MEDIA_BUS_FMT_SGBRG14_1X14, {\n>                 .name = \"SGBRG14_1X14\",\n>                 .code = MEDIA_BUS_FMT_SGBRG14_1X14,\n> +               .type = MediaBusFormatInfo::Type::Image,\n>                 .bitsPerPixel = 14,\n>                 .colourEncoding = PixelFormatInfo::ColourEncodingRAW,\n>         } },\n>         { MEDIA_BUS_FMT_SGRBG14_1X14, {\n>                 .name = \"SGRBG14_1X14\",\n>                 .code = MEDIA_BUS_FMT_SGRBG14_1X14,\n> +               .type = MediaBusFormatInfo::Type::Image,\n>                 .bitsPerPixel = 14,\n>                 .colourEncoding = PixelFormatInfo::ColourEncodingRAW,\n>         } },\n>         { MEDIA_BUS_FMT_SRGGB14_1X14, {\n>                 .name = \"SRGGB14_1X14\",\n>                 .code = MEDIA_BUS_FMT_SRGGB14_1X14,\n> +               .type = MediaBusFormatInfo::Type::Image,\n>                 .bitsPerPixel = 14,\n>                 .colourEncoding = PixelFormatInfo::ColourEncodingRAW,\n>         } },\n> @@ -556,15 +655,24 @@ const std::map<uint32_t, MediaBusFormatInfo> mediaBusFormatInfo{\n>         { MEDIA_BUS_FMT_AHSV8888_1X32, {\n>                 .name = \"AHSV8888_1X32\",\n>                 .code = MEDIA_BUS_FMT_AHSV8888_1X32,\n> +               .type = MediaBusFormatInfo::Type::Image,\n>                 .bitsPerPixel = 32,\n>                 .colourEncoding = PixelFormatInfo::ColourEncodingRGB,\n>         } },\n>         { MEDIA_BUS_FMT_JPEG_1X8, {\n>                 .name = \"JPEG_1X8\",\n>                 .code = MEDIA_BUS_FMT_JPEG_1X8,\n> +               .type = MediaBusFormatInfo::Type::Image,\n>                 .bitsPerPixel = 8,\n>                 .colourEncoding = PixelFormatInfo::ColourEncodingYUV,\n>         } },\n> +       { MEDIA_BUS_FMT_METADATA_FIXED, {\n> +               .name = \"METADATA_FIXED\",\n> +               .code = MEDIA_BUS_FMT_METADATA_FIXED,\n> +               .type = MediaBusFormatInfo::Type::Metadata,\n> +               .bitsPerPixel = 0,\n> +               .colourEncoding = PixelFormatInfo::ColourEncodingRAW,\n> +       } },\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 097ACBD160\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 15 Mar 2024 00:40:45 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 250C762C8F;\n\tFri, 15 Mar 2024 01:40:44 +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 5784C62C87\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 15 Mar 2024 01:40:43 +0100 (CET)","from pendragon.ideasonboard.com\n\t(aztw-30-b2-v4wan-166917-cust845.vm26.cable.virginm.net\n\t[82.37.23.78])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 92CEE667;\n\tFri, 15 Mar 2024 01:40:19 +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=\"e0UdR+ew\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1710463219;\n\tbh=3B0Gs3a7hiQ5yfe8ev+Wiy67HhRcVeXn1qQUOaLS7BM=;\n\th=In-Reply-To:References:Subject:From:To:Date:From;\n\tb=e0UdR+ewHw+qR/X0Ea4d3/iHQn5YDXNynFfXwNq30nBwLKmKQlwKvTLWUA7EoE7dT\n\txdHyPpyuWbvxCs+ZOud3LQnIPf7egmEwmaWcJMSB4S1NwXZGer5TFu/eiUqa49hImr\n\t557AWB6gMddujvJ8cZldfBa9uSMSWJ+yun3OJ6QM=","Content-Type":"text/plain; charset=\"utf-8\"","MIME-Version":"1.0","Content-Transfer-Encoding":"quoted-printable","In-Reply-To":"<20240315001613.2033-5-laurent.pinchart@ideasonboard.com>","References":"<20240315001613.2033-1-laurent.pinchart@ideasonboard.com>\n\t<20240315001613.2033-5-laurent.pinchart@ideasonboard.com>","Subject":"Re: [PATCH v2 04/14] libcamera: v4l2_subdevice: Extend\n\tMediaBusFormatInfo with metadata formats","From":"Kieran Bingham <kieran.bingham@ideasonboard.com>","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>,\n\tlibcamera-devel@lists.libcamera.org","Date":"Fri, 15 Mar 2024 00:40:39 +0000","Message-ID":"<171046323985.1913896.7202388999073782169@ping.linuxembedded.co.uk>","User-Agent":"alot/0.10","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>"}}]