[v2,02/14] libcamera: v4l2_subdevice: Add code member to MediaBusFormatInfo
diff mbox series

Message ID 20240315001613.2033-3-laurent.pinchart@ideasonboard.com
State Accepted
Commit 1a1cf4a2c13a04f23593419ce93e97f9a5bb22d1
Headers show
Series
  • libcamera: Prepare for new camera sensor class
Related show

Commit Message

Laurent Pinchart March 15, 2024, 12:16 a.m. UTC
To prepare for exposing the MediaBusFormatInfo structure as an internal
API, add a code member to the structure to store the media bus code.
This makes MediaBusFormatInfo usable standalone, without having to
externally associate the code related to the info.

The entries in the mediaBusFormatInfo map are becoming too long, so
split them on multiple lines.

While at it, swap the order of the members to match the PixelFormatInfo
class for consistency.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
---
Changes since combined RFC:

- Rebase on addition oa 14-bit bayer formats
---
 src/libcamera/v4l2_subdevice.cpp | 582 ++++++++++++++++++++++++++-----
 1 file changed, 497 insertions(+), 85 deletions(-)

Comments

Kieran Bingham March 15, 2024, 12:30 a.m. UTC | #1
Quoting Laurent Pinchart (2024-03-15 00:16:01)
> To prepare for exposing the MediaBusFormatInfo structure as an internal
> API, add a code member to the structure to store the media bus code.
> This makes MediaBusFormatInfo usable standalone, without having to
> externally associate the code related to the info.
> 
> The entries in the mediaBusFormatInfo map are becoming too long, so
> split them on multiple lines.
> 
> While at it, swap the order of the members to match the PixelFormatInfo
> class for consistency.
> 
> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>

That's a big change. But probably worthwhile.
I've tried to scan through and everything I've checked is consistent so:


Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>

> ---
> Changes since combined RFC:
> 
> - Rebase on addition oa 14-bit bayer formats
> ---
>  src/libcamera/v4l2_subdevice.cpp | 582 ++++++++++++++++++++++++++-----
>  1 file changed, 497 insertions(+), 85 deletions(-)
> 
> diff --git a/src/libcamera/v4l2_subdevice.cpp b/src/libcamera/v4l2_subdevice.cpp
> index b6a25e25230b..1286e7c385c4 100644
> --- a/src/libcamera/v4l2_subdevice.cpp
> +++ b/src/libcamera/v4l2_subdevice.cpp
> @@ -41,13 +41,15 @@ namespace {
>  /*
>   * \struct MediaBusFormatInfo
>   * \brief Information about media bus formats
> - * \param bitsPerPixel Bits per pixel
>   * \param name Name of MBUS format
> + * \param code The media bus format code
> + * \param bitsPerPixel Bits per pixel
>   * \param colourEncoding Type of colour encoding
>   */
>  struct MediaBusFormatInfo {
> -       unsigned int bitsPerPixel;
>         const char *name;
> +       uint32_t code;
> +       unsigned int bitsPerPixel;
>         PixelFormatInfo::ColourEncoding colourEncoding;
>  };
>  
> @@ -56,91 +58,501 @@ struct MediaBusFormatInfo {
>   * \brief A map that associates MediaBusFormatInfo struct to V4L2 media
>   * bus codes
>   */
> -const std::map<uint32_t, MediaBusFormatInfo> mediaBusFormatInfo = {
> +const std::map<uint32_t, MediaBusFormatInfo> mediaBusFormatInfo{
>         /* This table is sorted to match the order in linux/media-bus-format.h */
> -       { MEDIA_BUS_FMT_RGB444_2X8_PADHI_BE, { 16, "RGB444_2X8_PADHI_BE", PixelFormatInfo::ColourEncodingRGB } },
> -       { MEDIA_BUS_FMT_RGB444_2X8_PADHI_LE, { 16, "RGB444_2X8_PADHI_LE", PixelFormatInfo::ColourEncodingRGB } },
> -       { MEDIA_BUS_FMT_RGB555_2X8_PADHI_BE, { 16, "RGB555_2X8_PADHI_BE", PixelFormatInfo::ColourEncodingRGB } },
> -       { MEDIA_BUS_FMT_RGB555_2X8_PADHI_LE, { 16, "RGB555_2X8_PADHI_LE", PixelFormatInfo::ColourEncodingRGB } },
> -       { MEDIA_BUS_FMT_RGB565_1X16, { 16, "RGB565_1X16", PixelFormatInfo::ColourEncodingRGB } },
> -       { MEDIA_BUS_FMT_BGR565_2X8_BE, { 16, "BGR565_2X8_BE", PixelFormatInfo::ColourEncodingRGB } },
> -       { MEDIA_BUS_FMT_BGR565_2X8_LE, { 16, "BGR565_2X8_LE", PixelFormatInfo::ColourEncodingRGB } },
> -       { MEDIA_BUS_FMT_RGB565_2X8_BE, { 16, "RGB565_2X8_BE", PixelFormatInfo::ColourEncodingRGB } },
> -       { MEDIA_BUS_FMT_RGB565_2X8_LE, { 16, "RGB565_2X8_LE", PixelFormatInfo::ColourEncodingRGB } },
> -       { MEDIA_BUS_FMT_RGB666_1X18, { 18, "RGB666_1X18", PixelFormatInfo::ColourEncodingRGB } },
> -       { MEDIA_BUS_FMT_BGR888_1X24, { 24, "BGR888_1X24", PixelFormatInfo::ColourEncodingRGB } },
> -       { MEDIA_BUS_FMT_RGB888_1X24, { 24, "RGB888_1X24", PixelFormatInfo::ColourEncodingRGB } },
> -       { MEDIA_BUS_FMT_RGB888_2X12_BE, { 24, "RGB888_2X12_BE", PixelFormatInfo::ColourEncodingRGB } },
> -       { MEDIA_BUS_FMT_RGB888_2X12_LE, { 24, "RGB888_2X12_LE", PixelFormatInfo::ColourEncodingRGB } },
> -       { MEDIA_BUS_FMT_ARGB8888_1X32, { 32, "ARGB8888_1X32", PixelFormatInfo::ColourEncodingRGB } },
> -       { MEDIA_BUS_FMT_Y8_1X8, { 8, "Y8_1X8", PixelFormatInfo::ColourEncodingYUV } },
> -       { MEDIA_BUS_FMT_UV8_1X8, { 8, "UV8_1X8", PixelFormatInfo::ColourEncodingYUV } },
> -       { MEDIA_BUS_FMT_UYVY8_1_5X8, { 12, "UYVY8_1_5X8", PixelFormatInfo::ColourEncodingYUV } },
> -       { MEDIA_BUS_FMT_VYUY8_1_5X8, { 12, "VYUY8_1_5X8", PixelFormatInfo::ColourEncodingYUV } },
> -       { MEDIA_BUS_FMT_YUYV8_1_5X8, { 12, "YUYV8_1_5X8", PixelFormatInfo::ColourEncodingYUV } },
> -       { MEDIA_BUS_FMT_YVYU8_1_5X8, { 12, "YVYU8_1_5X8", PixelFormatInfo::ColourEncodingYUV } },
> -       { MEDIA_BUS_FMT_UYVY8_2X8, { 16, "UYVY8_2X8", PixelFormatInfo::ColourEncodingYUV } },
> -       { MEDIA_BUS_FMT_VYUY8_2X8, { 16, "VYUY8_2X8", PixelFormatInfo::ColourEncodingYUV } },
> -       { MEDIA_BUS_FMT_YUYV8_2X8, { 16, "YUYV8_2X8", PixelFormatInfo::ColourEncodingYUV } },
> -       { MEDIA_BUS_FMT_YVYU8_2X8, { 16, "YVYU8_2X8", PixelFormatInfo::ColourEncodingYUV } },
> -       { MEDIA_BUS_FMT_Y10_1X10, { 10, "Y10_1X10", PixelFormatInfo::ColourEncodingYUV } },
> -       { MEDIA_BUS_FMT_UYVY10_2X10, { 20, "UYVY10_2X10", PixelFormatInfo::ColourEncodingYUV } },
> -       { MEDIA_BUS_FMT_VYUY10_2X10, { 20, "VYUY10_2X10", PixelFormatInfo::ColourEncodingYUV } },
> -       { MEDIA_BUS_FMT_YUYV10_2X10, { 20, "YUYV10_2X10", PixelFormatInfo::ColourEncodingYUV } },
> -       { MEDIA_BUS_FMT_YVYU10_2X10, { 20, "YVYU10_2X10", PixelFormatInfo::ColourEncodingYUV } },
> -       { MEDIA_BUS_FMT_Y12_1X12, { 12, "Y12_1X12", PixelFormatInfo::ColourEncodingYUV } },
> -       { MEDIA_BUS_FMT_Y16_1X16, { 16, "Y16_1X16", PixelFormatInfo::ColourEncodingYUV } },
> -       { MEDIA_BUS_FMT_UYVY8_1X16, { 16, "UYVY8_1X16", PixelFormatInfo::ColourEncodingYUV } },
> -       { MEDIA_BUS_FMT_VYUY8_1X16, { 16, "VYUY8_1X16", PixelFormatInfo::ColourEncodingYUV } },
> -       { MEDIA_BUS_FMT_YUYV8_1X16, { 16, "YUYV8_1X16", PixelFormatInfo::ColourEncodingYUV } },
> -       { MEDIA_BUS_FMT_YVYU8_1X16, { 16, "YVYU8_1X16", PixelFormatInfo::ColourEncodingYUV } },
> -       { MEDIA_BUS_FMT_YDYUYDYV8_1X16, { 16, "YDYUYDYV8_1X16", PixelFormatInfo::ColourEncodingYUV } },
> -       { MEDIA_BUS_FMT_UYVY10_1X20, { 20, "UYVY10_1X20", PixelFormatInfo::ColourEncodingYUV } },
> -       { MEDIA_BUS_FMT_VYUY10_1X20, { 20, "VYUY10_1X20", PixelFormatInfo::ColourEncodingYUV } },
> -       { MEDIA_BUS_FMT_YUYV10_1X20, { 20, "YUYV10_1X20", PixelFormatInfo::ColourEncodingYUV } },
> -       { MEDIA_BUS_FMT_YVYU10_1X20, { 20, "YVYU10_1X20", PixelFormatInfo::ColourEncodingYUV } },
> -       { MEDIA_BUS_FMT_YUV8_1X24, { 24, "YUV8_1X24", PixelFormatInfo::ColourEncodingYUV } },
> -       { MEDIA_BUS_FMT_YUV10_1X30, { 30, "YUV10_1X30", PixelFormatInfo::ColourEncodingYUV } },
> -       { MEDIA_BUS_FMT_AYUV8_1X32, { 32, "AYUV8_1X32", PixelFormatInfo::ColourEncodingYUV } },
> -       { MEDIA_BUS_FMT_UYVY12_2X12, { 24, "UYVY12_2X12", PixelFormatInfo::ColourEncodingYUV } },
> -       { MEDIA_BUS_FMT_VYUY12_2X12, { 24, "VYUY12_2X12", PixelFormatInfo::ColourEncodingYUV } },
> -       { MEDIA_BUS_FMT_YUYV12_2X12, { 24, "YUYV12_2X12", PixelFormatInfo::ColourEncodingYUV } },
> -       { MEDIA_BUS_FMT_YVYU12_2X12, { 24, "YVYU12_2X12", PixelFormatInfo::ColourEncodingYUV } },
> -       { MEDIA_BUS_FMT_UYVY12_1X24, { 24, "UYVY12_1X24", PixelFormatInfo::ColourEncodingYUV } },
> -       { MEDIA_BUS_FMT_VYUY12_1X24, { 24, "VYUY12_1X24", PixelFormatInfo::ColourEncodingYUV } },
> -       { MEDIA_BUS_FMT_YUYV12_1X24, { 24, "YUYV12_1X24", PixelFormatInfo::ColourEncodingYUV } },
> -       { MEDIA_BUS_FMT_YVYU12_1X24, { 24, "YVYU12_1X24", PixelFormatInfo::ColourEncodingYUV } },
> -       { MEDIA_BUS_FMT_SBGGR8_1X8, { 8, "SBGGR8_1X8", PixelFormatInfo::ColourEncodingRAW } },
> -       { MEDIA_BUS_FMT_SGBRG8_1X8, { 8, "SGBRG8_1X8", PixelFormatInfo::ColourEncodingRAW } },
> -       { MEDIA_BUS_FMT_SGRBG8_1X8, { 8, "SGRBG8_1X8", PixelFormatInfo::ColourEncodingRAW } },
> -       { MEDIA_BUS_FMT_SRGGB8_1X8, { 8, "SRGGB8_1X8", PixelFormatInfo::ColourEncodingRAW } },
> -       { MEDIA_BUS_FMT_SBGGR10_ALAW8_1X8, { 8, "SBGGR10_ALAW8_1X8", PixelFormatInfo::ColourEncodingRAW } },
> -       { MEDIA_BUS_FMT_SGBRG10_ALAW8_1X8, { 8, "SGBRG10_ALAW8_1X8", PixelFormatInfo::ColourEncodingRAW } },
> -       { MEDIA_BUS_FMT_SGRBG10_ALAW8_1X8, { 8, "SGRBG10_ALAW8_1X8", PixelFormatInfo::ColourEncodingRAW } },
> -       { MEDIA_BUS_FMT_SRGGB10_ALAW8_1X8, { 8, "SRGGB10_ALAW8_1X8", PixelFormatInfo::ColourEncodingRAW } },
> -       { MEDIA_BUS_FMT_SBGGR10_DPCM8_1X8, { 8, "SBGGR10_DPCM8_1X8", PixelFormatInfo::ColourEncodingRAW } },
> -       { MEDIA_BUS_FMT_SGBRG10_DPCM8_1X8, { 8, "SGBRG10_DPCM8_1X8", PixelFormatInfo::ColourEncodingRAW } },
> -       { MEDIA_BUS_FMT_SGRBG10_DPCM8_1X8, { 8, "SGRBG10_DPCM8_1X8", PixelFormatInfo::ColourEncodingRAW } },
> -       { MEDIA_BUS_FMT_SRGGB10_DPCM8_1X8, { 8, "SRGGB10_DPCM8_1X8", PixelFormatInfo::ColourEncodingRAW } },
> -       { MEDIA_BUS_FMT_SBGGR10_2X8_PADHI_BE, { 16, "SBGGR10_2X8_PADHI_BE", PixelFormatInfo::ColourEncodingRAW } },
> -       { MEDIA_BUS_FMT_SBGGR10_2X8_PADHI_LE, { 16, "SBGGR10_2X8_PADHI_LE", PixelFormatInfo::ColourEncodingRAW } },
> -       { MEDIA_BUS_FMT_SBGGR10_2X8_PADLO_BE, { 16, "SBGGR10_2X8_PADLO_BE", PixelFormatInfo::ColourEncodingRAW } },
> -       { MEDIA_BUS_FMT_SBGGR10_2X8_PADLO_LE, { 16, "SBGGR10_2X8_PADLO_LE", PixelFormatInfo::ColourEncodingRAW } },
> -       { MEDIA_BUS_FMT_SBGGR10_1X10, { 10, "SBGGR10_1X10", PixelFormatInfo::ColourEncodingRAW } },
> -       { MEDIA_BUS_FMT_SGBRG10_1X10, { 10, "SGBRG10_1X10", PixelFormatInfo::ColourEncodingRAW } },
> -       { MEDIA_BUS_FMT_SGRBG10_1X10, { 10, "SGRBG10_1X10", PixelFormatInfo::ColourEncodingRAW } },
> -       { MEDIA_BUS_FMT_SRGGB10_1X10, { 10, "SRGGB10_1X10", PixelFormatInfo::ColourEncodingRAW } },
> -       { MEDIA_BUS_FMT_SBGGR12_1X12, { 12, "SBGGR12_1X12", PixelFormatInfo::ColourEncodingRAW } },
> -       { MEDIA_BUS_FMT_SGBRG12_1X12, { 12, "SGBRG12_1X12", PixelFormatInfo::ColourEncodingRAW } },
> -       { MEDIA_BUS_FMT_SGRBG12_1X12, { 12, "SGRBG12_1X12", PixelFormatInfo::ColourEncodingRAW } },
> -       { MEDIA_BUS_FMT_SRGGB12_1X12, { 12, "SRGGB12_1X12", PixelFormatInfo::ColourEncodingRAW } },
> -       { MEDIA_BUS_FMT_SBGGR14_1X14, { 14, "SBGGR14_1X14", PixelFormatInfo::ColourEncodingRAW } },
> -       { MEDIA_BUS_FMT_SGBRG14_1X14, { 14, "SGBRG14_1X14", PixelFormatInfo::ColourEncodingRAW } },
> -       { MEDIA_BUS_FMT_SGRBG14_1X14, { 14, "SGRBG14_1X14", PixelFormatInfo::ColourEncodingRAW } },
> -       { MEDIA_BUS_FMT_SRGGB14_1X14, { 14, "SRGGB14_1X14", PixelFormatInfo::ColourEncodingRAW } },
> +       { MEDIA_BUS_FMT_RGB444_2X8_PADHI_BE, {
> +               .name = "RGB444_2X8_PADHI_BE",
> +               .code = MEDIA_BUS_FMT_RGB444_2X8_PADHI_BE,
> +               .bitsPerPixel = 16,
> +               .colourEncoding = PixelFormatInfo::ColourEncodingRGB,
> +       } },
> +       { MEDIA_BUS_FMT_RGB444_2X8_PADHI_LE, {
> +               .name = "RGB444_2X8_PADHI_LE",
> +               .code = MEDIA_BUS_FMT_RGB444_2X8_PADHI_LE,
> +               .bitsPerPixel = 16,
> +               .colourEncoding = PixelFormatInfo::ColourEncodingRGB,
> +       } },
> +       { MEDIA_BUS_FMT_RGB555_2X8_PADHI_BE, {
> +               .name = "RGB555_2X8_PADHI_BE",
> +               .code = MEDIA_BUS_FMT_RGB555_2X8_PADHI_BE,
> +               .bitsPerPixel = 16,
> +               .colourEncoding = PixelFormatInfo::ColourEncodingRGB,
> +       } },
> +       { MEDIA_BUS_FMT_RGB555_2X8_PADHI_LE, {
> +               .name = "RGB555_2X8_PADHI_LE",
> +               .code = MEDIA_BUS_FMT_RGB555_2X8_PADHI_LE,
> +               .bitsPerPixel = 16,
> +               .colourEncoding = PixelFormatInfo::ColourEncodingRGB,
> +       } },
> +       { MEDIA_BUS_FMT_RGB565_1X16, {
> +               .name = "RGB565_1X16",
> +               .code = MEDIA_BUS_FMT_RGB565_1X16,
> +               .bitsPerPixel = 16,
> +               .colourEncoding = PixelFormatInfo::ColourEncodingRGB,
> +       } },
> +       { MEDIA_BUS_FMT_BGR565_2X8_BE, {
> +               .name = "BGR565_2X8_BE",
> +               .code = MEDIA_BUS_FMT_BGR565_2X8_BE,
> +               .bitsPerPixel = 16,
> +               .colourEncoding = PixelFormatInfo::ColourEncodingRGB,
> +       } },
> +       { MEDIA_BUS_FMT_BGR565_2X8_LE, {
> +               .name = "BGR565_2X8_LE",
> +               .code = MEDIA_BUS_FMT_BGR565_2X8_LE,
> +               .bitsPerPixel = 16,
> +               .colourEncoding = PixelFormatInfo::ColourEncodingRGB,
> +       } },
> +       { MEDIA_BUS_FMT_RGB565_2X8_BE, {
> +               .name = "RGB565_2X8_BE",
> +               .code = MEDIA_BUS_FMT_RGB565_2X8_BE,
> +               .bitsPerPixel = 16,
> +               .colourEncoding = PixelFormatInfo::ColourEncodingRGB,
> +       } },
> +       { MEDIA_BUS_FMT_RGB565_2X8_LE, {
> +               .name = "RGB565_2X8_LE",
> +               .code = MEDIA_BUS_FMT_RGB565_2X8_LE,
> +               .bitsPerPixel = 16,
> +               .colourEncoding = PixelFormatInfo::ColourEncodingRGB,
> +       } },
> +       { MEDIA_BUS_FMT_RGB666_1X18, {
> +               .name = "RGB666_1X18",
> +               .code = MEDIA_BUS_FMT_RGB666_1X18,
> +               .bitsPerPixel = 18,
> +               .colourEncoding = PixelFormatInfo::ColourEncodingRGB,
> +       } },
> +       { MEDIA_BUS_FMT_BGR888_1X24, {
> +               .name = "BGR888_1X24",
> +               .code = MEDIA_BUS_FMT_BGR888_1X24,
> +               .bitsPerPixel = 24,
> +               .colourEncoding = PixelFormatInfo::ColourEncodingRGB,
> +       } },
> +       { MEDIA_BUS_FMT_RGB888_1X24, {
> +               .name = "RGB888_1X24",
> +               .code = MEDIA_BUS_FMT_RGB888_1X24,
> +               .bitsPerPixel = 24,
> +               .colourEncoding = PixelFormatInfo::ColourEncodingRGB,
> +       } },
> +       { MEDIA_BUS_FMT_RGB888_2X12_BE, {
> +               .name = "RGB888_2X12_BE",
> +               .code = MEDIA_BUS_FMT_RGB888_2X12_BE,
> +               .bitsPerPixel = 24,
> +               .colourEncoding = PixelFormatInfo::ColourEncodingRGB,
> +       } },
> +       { MEDIA_BUS_FMT_RGB888_2X12_LE, {
> +               .name = "RGB888_2X12_LE",
> +               .code = MEDIA_BUS_FMT_RGB888_2X12_LE,
> +               .bitsPerPixel = 24,
> +               .colourEncoding = PixelFormatInfo::ColourEncodingRGB,
> +       } },
> +       { MEDIA_BUS_FMT_ARGB8888_1X32, {
> +               .name = "ARGB8888_1X32",
> +               .code = MEDIA_BUS_FMT_ARGB8888_1X32,
> +               .bitsPerPixel = 32,
> +               .colourEncoding = PixelFormatInfo::ColourEncodingRGB,
> +       } },
> +       { MEDIA_BUS_FMT_Y8_1X8, {
> +               .name = "Y8_1X8",
> +               .code = MEDIA_BUS_FMT_Y8_1X8,
> +               .bitsPerPixel = 8,
> +               .colourEncoding = PixelFormatInfo::ColourEncodingYUV,
> +       } },
> +       { MEDIA_BUS_FMT_UV8_1X8, {
> +               .name = "UV8_1X8",
> +               .code = MEDIA_BUS_FMT_UV8_1X8,
> +               .bitsPerPixel = 8,
> +               .colourEncoding = PixelFormatInfo::ColourEncodingYUV,
> +       } },
> +       { MEDIA_BUS_FMT_UYVY8_1_5X8, {
> +               .name = "UYVY8_1_5X8",
> +               .code = MEDIA_BUS_FMT_UYVY8_1_5X8,
> +               .bitsPerPixel = 12,
> +               .colourEncoding = PixelFormatInfo::ColourEncodingYUV,
> +       } },
> +       { MEDIA_BUS_FMT_VYUY8_1_5X8, {
> +               .name = "VYUY8_1_5X8",
> +               .code = MEDIA_BUS_FMT_VYUY8_1_5X8,
> +               .bitsPerPixel = 12,
> +               .colourEncoding = PixelFormatInfo::ColourEncodingYUV,
> +       } },
> +       { MEDIA_BUS_FMT_YUYV8_1_5X8, {
> +               .name = "YUYV8_1_5X8",
> +               .code = MEDIA_BUS_FMT_YUYV8_1_5X8,
> +               .bitsPerPixel = 12,
> +               .colourEncoding = PixelFormatInfo::ColourEncodingYUV,
> +       } },
> +       { MEDIA_BUS_FMT_YVYU8_1_5X8, {
> +               .name = "YVYU8_1_5X8",
> +               .code = MEDIA_BUS_FMT_YVYU8_1_5X8,
> +               .bitsPerPixel = 12,
> +               .colourEncoding = PixelFormatInfo::ColourEncodingYUV,
> +       } },
> +       { MEDIA_BUS_FMT_UYVY8_2X8, {
> +               .name = "UYVY8_2X8",
> +               .code = MEDIA_BUS_FMT_UYVY8_2X8,
> +               .bitsPerPixel = 16,
> +               .colourEncoding = PixelFormatInfo::ColourEncodingYUV,
> +       } },
> +       { MEDIA_BUS_FMT_VYUY8_2X8, {
> +               .name = "VYUY8_2X8",
> +               .code = MEDIA_BUS_FMT_VYUY8_2X8,
> +               .bitsPerPixel = 16,
> +               .colourEncoding = PixelFormatInfo::ColourEncodingYUV,
> +       } },
> +       { MEDIA_BUS_FMT_YUYV8_2X8, {
> +               .name = "YUYV8_2X8",
> +               .code = MEDIA_BUS_FMT_YUYV8_2X8,
> +               .bitsPerPixel = 16,
> +               .colourEncoding = PixelFormatInfo::ColourEncodingYUV,
> +       } },
> +       { MEDIA_BUS_FMT_YVYU8_2X8, {
> +               .name = "YVYU8_2X8",
> +               .code = MEDIA_BUS_FMT_YVYU8_2X8,
> +               .bitsPerPixel = 16,
> +               .colourEncoding = PixelFormatInfo::ColourEncodingYUV,
> +       } },
> +       { MEDIA_BUS_FMT_Y10_1X10, {
> +               .name = "Y10_1X10",
> +               .code = MEDIA_BUS_FMT_Y10_1X10,
> +               .bitsPerPixel = 10,
> +               .colourEncoding = PixelFormatInfo::ColourEncodingYUV,
> +       } },
> +       { MEDIA_BUS_FMT_UYVY10_2X10, {
> +               .name = "UYVY10_2X10",
> +               .code = MEDIA_BUS_FMT_UYVY10_2X10,
> +               .bitsPerPixel = 20,
> +               .colourEncoding = PixelFormatInfo::ColourEncodingYUV,
> +       } },
> +       { MEDIA_BUS_FMT_VYUY10_2X10, {
> +               .name = "VYUY10_2X10",
> +               .code = MEDIA_BUS_FMT_VYUY10_2X10,
> +               .bitsPerPixel = 20,
> +               .colourEncoding = PixelFormatInfo::ColourEncodingYUV,
> +       } },
> +       { MEDIA_BUS_FMT_YUYV10_2X10, {
> +               .name = "YUYV10_2X10",
> +               .code = MEDIA_BUS_FMT_YUYV10_2X10,
> +               .bitsPerPixel = 20,
> +               .colourEncoding = PixelFormatInfo::ColourEncodingYUV,
> +       } },
> +       { MEDIA_BUS_FMT_YVYU10_2X10, {
> +               .name = "YVYU10_2X10",
> +               .code = MEDIA_BUS_FMT_YVYU10_2X10,
> +               .bitsPerPixel = 20,
> +               .colourEncoding = PixelFormatInfo::ColourEncodingYUV,
> +       } },
> +       { MEDIA_BUS_FMT_Y12_1X12, {
> +               .name = "Y12_1X12",
> +               .code = MEDIA_BUS_FMT_Y12_1X12,
> +               .bitsPerPixel = 12,
> +               .colourEncoding = PixelFormatInfo::ColourEncodingYUV,
> +       } },
> +       { MEDIA_BUS_FMT_Y16_1X16, {
> +               .name = "Y16_1X16",
> +               .code = MEDIA_BUS_FMT_Y16_1X16,
> +               .bitsPerPixel = 16,
> +               .colourEncoding = PixelFormatInfo::ColourEncodingYUV,
> +       } },
> +       { MEDIA_BUS_FMT_UYVY8_1X16, {
> +               .name = "UYVY8_1X16",
> +               .code = MEDIA_BUS_FMT_UYVY8_1X16,
> +               .bitsPerPixel = 16,
> +               .colourEncoding = PixelFormatInfo::ColourEncodingYUV,
> +       } },
> +       { MEDIA_BUS_FMT_VYUY8_1X16, {
> +               .name = "VYUY8_1X16",
> +               .code = MEDIA_BUS_FMT_VYUY8_1X16,
> +               .bitsPerPixel = 16,
> +               .colourEncoding = PixelFormatInfo::ColourEncodingYUV,
> +       } },
> +       { MEDIA_BUS_FMT_YUYV8_1X16, {
> +               .name = "YUYV8_1X16",
> +               .code = MEDIA_BUS_FMT_YUYV8_1X16,
> +               .bitsPerPixel = 16,
> +               .colourEncoding = PixelFormatInfo::ColourEncodingYUV,
> +       } },
> +       { MEDIA_BUS_FMT_YVYU8_1X16, {
> +               .name = "YVYU8_1X16",
> +               .code = MEDIA_BUS_FMT_YVYU8_1X16,
> +               .bitsPerPixel = 16,
> +               .colourEncoding = PixelFormatInfo::ColourEncodingYUV,
> +       } },
> +       { MEDIA_BUS_FMT_YDYUYDYV8_1X16, {
> +               .name = "YDYUYDYV8_1X16",
> +               .code = MEDIA_BUS_FMT_YDYUYDYV8_1X16,
> +               .bitsPerPixel = 16,
> +               .colourEncoding = PixelFormatInfo::ColourEncodingYUV,
> +       } },
> +       { MEDIA_BUS_FMT_UYVY10_1X20, {
> +               .name = "UYVY10_1X20",
> +               .code = MEDIA_BUS_FMT_UYVY10_1X20,
> +               .bitsPerPixel = 20,
> +               .colourEncoding = PixelFormatInfo::ColourEncodingYUV,
> +       } },
> +       { MEDIA_BUS_FMT_VYUY10_1X20, {
> +               .name = "VYUY10_1X20",
> +               .code = MEDIA_BUS_FMT_VYUY10_1X20,
> +               .bitsPerPixel = 20,
> +               .colourEncoding = PixelFormatInfo::ColourEncodingYUV,
> +       } },
> +       { MEDIA_BUS_FMT_YUYV10_1X20, {
> +               .name = "YUYV10_1X20",
> +               .code = MEDIA_BUS_FMT_YUYV10_1X20,
> +               .bitsPerPixel = 20,
> +               .colourEncoding = PixelFormatInfo::ColourEncodingYUV,
> +       } },
> +       { MEDIA_BUS_FMT_YVYU10_1X20, {
> +               .name = "YVYU10_1X20",
> +               .code = MEDIA_BUS_FMT_YVYU10_1X20,
> +               .bitsPerPixel = 20,
> +               .colourEncoding = PixelFormatInfo::ColourEncodingYUV,
> +       } },
> +       { MEDIA_BUS_FMT_YUV8_1X24, {
> +               .name = "YUV8_1X24",
> +               .code = MEDIA_BUS_FMT_YUV8_1X24,
> +               .bitsPerPixel = 24,
> +               .colourEncoding = PixelFormatInfo::ColourEncodingYUV,
> +       } },
> +       { MEDIA_BUS_FMT_YUV10_1X30, {
> +               .name = "YUV10_1X30",
> +               .code = MEDIA_BUS_FMT_YUV10_1X30,
> +               .bitsPerPixel = 30,
> +               .colourEncoding = PixelFormatInfo::ColourEncodingYUV,
> +       } },
> +       { MEDIA_BUS_FMT_AYUV8_1X32, {
> +               .name = "AYUV8_1X32",
> +               .code = MEDIA_BUS_FMT_AYUV8_1X32,
> +               .bitsPerPixel = 32,
> +               .colourEncoding = PixelFormatInfo::ColourEncodingYUV,
> +       } },
> +       { MEDIA_BUS_FMT_UYVY12_2X12, {
> +               .name = "UYVY12_2X12",
> +               .code = MEDIA_BUS_FMT_UYVY12_2X12,
> +               .bitsPerPixel = 24,
> +               .colourEncoding = PixelFormatInfo::ColourEncodingYUV,
> +       } },
> +       { MEDIA_BUS_FMT_VYUY12_2X12, {
> +               .name = "VYUY12_2X12",
> +               .code = MEDIA_BUS_FMT_VYUY12_2X12,
> +               .bitsPerPixel = 24,
> +               .colourEncoding = PixelFormatInfo::ColourEncodingYUV,
> +       } },
> +       { MEDIA_BUS_FMT_YUYV12_2X12, {
> +               .name = "YUYV12_2X12",
> +               .code = MEDIA_BUS_FMT_YUYV12_2X12,
> +               .bitsPerPixel = 24,
> +               .colourEncoding = PixelFormatInfo::ColourEncodingYUV,
> +       } },
> +       { MEDIA_BUS_FMT_YVYU12_2X12, {
> +               .name = "YVYU12_2X12",
> +               .code = MEDIA_BUS_FMT_YVYU12_2X12,
> +               .bitsPerPixel = 24,
> +               .colourEncoding = PixelFormatInfo::ColourEncodingYUV,
> +       } },
> +       { MEDIA_BUS_FMT_UYVY12_1X24, {
> +               .name = "UYVY12_1X24",
> +               .code = MEDIA_BUS_FMT_UYVY12_1X24,
> +               .bitsPerPixel = 24,
> +               .colourEncoding = PixelFormatInfo::ColourEncodingYUV,
> +       } },
> +       { MEDIA_BUS_FMT_VYUY12_1X24, {
> +               .name = "VYUY12_1X24",
> +               .code = MEDIA_BUS_FMT_VYUY12_1X24,
> +               .bitsPerPixel = 24,
> +               .colourEncoding = PixelFormatInfo::ColourEncodingYUV,
> +       } },
> +       { MEDIA_BUS_FMT_YUYV12_1X24, {
> +               .name = "YUYV12_1X24",
> +               .code = MEDIA_BUS_FMT_YUYV12_1X24,
> +               .bitsPerPixel = 24,
> +               .colourEncoding = PixelFormatInfo::ColourEncodingYUV,
> +       } },
> +       { MEDIA_BUS_FMT_YVYU12_1X24, {
> +               .name = "YVYU12_1X24",
> +               .code = MEDIA_BUS_FMT_YVYU12_1X24,
> +               .bitsPerPixel = 24,
> +               .colourEncoding = PixelFormatInfo::ColourEncodingYUV,
> +       } },
> +       { MEDIA_BUS_FMT_SBGGR8_1X8, {
> +               .name = "SBGGR8_1X8",
> +               .code = MEDIA_BUS_FMT_SBGGR8_1X8,
> +               .bitsPerPixel = 8,
> +               .colourEncoding = PixelFormatInfo::ColourEncodingRAW,
> +       } },
> +       { MEDIA_BUS_FMT_SGBRG8_1X8, {
> +               .name = "SGBRG8_1X8",
> +               .code = MEDIA_BUS_FMT_SGBRG8_1X8,
> +               .bitsPerPixel = 8,
> +               .colourEncoding = PixelFormatInfo::ColourEncodingRAW,
> +       } },
> +       { MEDIA_BUS_FMT_SGRBG8_1X8, {
> +               .name = "SGRBG8_1X8",
> +               .code = MEDIA_BUS_FMT_SGRBG8_1X8,
> +               .bitsPerPixel = 8,
> +               .colourEncoding = PixelFormatInfo::ColourEncodingRAW,
> +       } },
> +       { MEDIA_BUS_FMT_SRGGB8_1X8, {
> +               .name = "SRGGB8_1X8",
> +               .code = MEDIA_BUS_FMT_SRGGB8_1X8,
> +               .bitsPerPixel = 8,
> +               .colourEncoding = PixelFormatInfo::ColourEncodingRAW,
> +       } },
> +       { MEDIA_BUS_FMT_SBGGR10_ALAW8_1X8, {
> +               .name = "SBGGR10_ALAW8_1X8",
> +               .code = MEDIA_BUS_FMT_SBGGR10_ALAW8_1X8,
> +               .bitsPerPixel = 8,
> +               .colourEncoding = PixelFormatInfo::ColourEncodingRAW,
> +       } },
> +       { MEDIA_BUS_FMT_SGBRG10_ALAW8_1X8, {
> +               .name = "SGBRG10_ALAW8_1X8",
> +               .code = MEDIA_BUS_FMT_SGBRG10_ALAW8_1X8,
> +               .bitsPerPixel = 8,
> +               .colourEncoding = PixelFormatInfo::ColourEncodingRAW,
> +       } },
> +       { MEDIA_BUS_FMT_SGRBG10_ALAW8_1X8, {
> +               .name = "SGRBG10_ALAW8_1X8",
> +               .code = MEDIA_BUS_FMT_SGRBG10_ALAW8_1X8,
> +               .bitsPerPixel = 8,
> +               .colourEncoding = PixelFormatInfo::ColourEncodingRAW,
> +       } },
> +       { MEDIA_BUS_FMT_SRGGB10_ALAW8_1X8, {
> +               .name = "SRGGB10_ALAW8_1X8",
> +               .code = MEDIA_BUS_FMT_SRGGB10_ALAW8_1X8,
> +               .bitsPerPixel = 8,
> +               .colourEncoding = PixelFormatInfo::ColourEncodingRAW,
> +       } },
> +       { MEDIA_BUS_FMT_SBGGR10_DPCM8_1X8, {
> +               .name = "SBGGR10_DPCM8_1X8",
> +               .code = MEDIA_BUS_FMT_SBGGR10_DPCM8_1X8,
> +               .bitsPerPixel = 8,
> +               .colourEncoding = PixelFormatInfo::ColourEncodingRAW,
> +       } },
> +       { MEDIA_BUS_FMT_SGBRG10_DPCM8_1X8, {
> +               .name = "SGBRG10_DPCM8_1X8",
> +               .code = MEDIA_BUS_FMT_SGBRG10_DPCM8_1X8,
> +               .bitsPerPixel = 8,
> +               .colourEncoding = PixelFormatInfo::ColourEncodingRAW,
> +       } },
> +       { MEDIA_BUS_FMT_SGRBG10_DPCM8_1X8, {
> +               .name = "SGRBG10_DPCM8_1X8",
> +               .code = MEDIA_BUS_FMT_SGRBG10_DPCM8_1X8,
> +               .bitsPerPixel = 8,
> +               .colourEncoding = PixelFormatInfo::ColourEncodingRAW,
> +       } },
> +       { MEDIA_BUS_FMT_SRGGB10_DPCM8_1X8, {
> +               .name = "SRGGB10_DPCM8_1X8",
> +               .code = MEDIA_BUS_FMT_SRGGB10_DPCM8_1X8,
> +               .bitsPerPixel = 8,
> +               .colourEncoding = PixelFormatInfo::ColourEncodingRAW,
> +       } },
> +       { MEDIA_BUS_FMT_SBGGR10_2X8_PADHI_BE, {
> +               .name = "SBGGR10_2X8_PADHI_BE",
> +               .code = MEDIA_BUS_FMT_SBGGR10_2X8_PADHI_BE,
> +               .bitsPerPixel = 16,
> +               .colourEncoding = PixelFormatInfo::ColourEncodingRAW,
> +       } },
> +       { MEDIA_BUS_FMT_SBGGR10_2X8_PADHI_LE, {
> +               .name = "SBGGR10_2X8_PADHI_LE",
> +               .code = MEDIA_BUS_FMT_SBGGR10_2X8_PADHI_LE,
> +               .bitsPerPixel = 16,
> +               .colourEncoding = PixelFormatInfo::ColourEncodingRAW,
> +       } },
> +       { MEDIA_BUS_FMT_SBGGR10_2X8_PADLO_BE, {
> +               .name = "SBGGR10_2X8_PADLO_BE",
> +               .code = MEDIA_BUS_FMT_SBGGR10_2X8_PADLO_BE,
> +               .bitsPerPixel = 16,
> +               .colourEncoding = PixelFormatInfo::ColourEncodingRAW,
> +       } },
> +       { MEDIA_BUS_FMT_SBGGR10_2X8_PADLO_LE, {
> +               .name = "SBGGR10_2X8_PADLO_LE",
> +               .code = MEDIA_BUS_FMT_SBGGR10_2X8_PADLO_LE,
> +               .bitsPerPixel = 16,
> +               .colourEncoding = PixelFormatInfo::ColourEncodingRAW,
> +       } },
> +       { MEDIA_BUS_FMT_SBGGR10_1X10, {
> +               .name = "SBGGR10_1X10",
> +               .code = MEDIA_BUS_FMT_SBGGR10_1X10,
> +               .bitsPerPixel = 10,
> +               .colourEncoding = PixelFormatInfo::ColourEncodingRAW,
> +       } },
> +       { MEDIA_BUS_FMT_SGBRG10_1X10, {
> +               .name = "SGBRG10_1X10",
> +               .code = MEDIA_BUS_FMT_SGBRG10_1X10,
> +               .bitsPerPixel = 10,
> +               .colourEncoding = PixelFormatInfo::ColourEncodingRAW,
> +       } },
> +       { MEDIA_BUS_FMT_SGRBG10_1X10, {
> +               .name = "SGRBG10_1X10",
> +               .code = MEDIA_BUS_FMT_SGRBG10_1X10,
> +               .bitsPerPixel = 10,
> +               .colourEncoding = PixelFormatInfo::ColourEncodingRAW,
> +       } },
> +       { MEDIA_BUS_FMT_SRGGB10_1X10, {
> +               .name = "SRGGB10_1X10",
> +               .code = MEDIA_BUS_FMT_SRGGB10_1X10,
> +               .bitsPerPixel = 10,
> +               .colourEncoding = PixelFormatInfo::ColourEncodingRAW,
> +       } },
> +       { MEDIA_BUS_FMT_SBGGR12_1X12, {
> +               .name = "SBGGR12_1X12",
> +               .code = MEDIA_BUS_FMT_SBGGR12_1X12,
> +               .bitsPerPixel = 12,
> +               .colourEncoding = PixelFormatInfo::ColourEncodingRAW,
> +       } },
> +       { MEDIA_BUS_FMT_SGBRG12_1X12, {
> +               .name = "SGBRG12_1X12",
> +               .code = MEDIA_BUS_FMT_SGBRG12_1X12,
> +               .bitsPerPixel = 12,
> +               .colourEncoding = PixelFormatInfo::ColourEncodingRAW,
> +       } },
> +       { MEDIA_BUS_FMT_SGRBG12_1X12, {
> +               .name = "SGRBG12_1X12",
> +               .code = MEDIA_BUS_FMT_SGRBG12_1X12,
> +               .bitsPerPixel = 12,
> +               .colourEncoding = PixelFormatInfo::ColourEncodingRAW,
> +       } },
> +       { MEDIA_BUS_FMT_SRGGB12_1X12, {
> +               .name = "SRGGB12_1X12",
> +               .code = MEDIA_BUS_FMT_SRGGB12_1X12,
> +               .bitsPerPixel = 12,
> +               .colourEncoding = PixelFormatInfo::ColourEncodingRAW,
> +       } },
> +       { MEDIA_BUS_FMT_SBGGR14_1X14, {
> +               .name = "SBGGR14_1X14",
> +               .code = MEDIA_BUS_FMT_SBGGR14_1X14,
> +               .bitsPerPixel = 14,
> +               .colourEncoding = PixelFormatInfo::ColourEncodingRAW,
> +       } },
> +       { MEDIA_BUS_FMT_SGBRG14_1X14, {
> +               .name = "SGBRG14_1X14",
> +               .code = MEDIA_BUS_FMT_SGBRG14_1X14,
> +               .bitsPerPixel = 14,
> +               .colourEncoding = PixelFormatInfo::ColourEncodingRAW,
> +       } },
> +       { MEDIA_BUS_FMT_SGRBG14_1X14, {
> +               .name = "SGRBG14_1X14",
> +               .code = MEDIA_BUS_FMT_SGRBG14_1X14,
> +               .bitsPerPixel = 14,
> +               .colourEncoding = PixelFormatInfo::ColourEncodingRAW,
> +       } },
> +       { MEDIA_BUS_FMT_SRGGB14_1X14, {
> +               .name = "SRGGB14_1X14",
> +               .code = MEDIA_BUS_FMT_SRGGB14_1X14,
> +               .bitsPerPixel = 14,
> +               .colourEncoding = PixelFormatInfo::ColourEncodingRAW,
> +       } },
>         /* \todo Clarify colour encoding for HSV formats */
> -       { MEDIA_BUS_FMT_AHSV8888_1X32, { 32, "AHSV8888_1X32", PixelFormatInfo::ColourEncodingRGB } },
> -       { MEDIA_BUS_FMT_JPEG_1X8, { 8, "JPEG_1X8", PixelFormatInfo::ColourEncodingYUV } },
> +       { MEDIA_BUS_FMT_AHSV8888_1X32, {
> +               .name = "AHSV8888_1X32",
> +               .code = MEDIA_BUS_FMT_AHSV8888_1X32,
> +               .bitsPerPixel = 32,
> +               .colourEncoding = PixelFormatInfo::ColourEncodingRGB,
> +       } },
> +       { MEDIA_BUS_FMT_JPEG_1X8, {
> +               .name = "JPEG_1X8",
> +               .code = MEDIA_BUS_FMT_JPEG_1X8,
> +               .bitsPerPixel = 8,
> +               .colourEncoding = PixelFormatInfo::ColourEncodingYUV,
> +       } },
>  };
>  
>  } /* namespace */
> -- 
> Regards,
> 
> Laurent Pinchart
>
Laurent Pinchart March 15, 2024, 12:31 a.m. UTC | #2
On Fri, Mar 15, 2024 at 12:30:08AM +0000, Kieran Bingham wrote:
> Quoting Laurent Pinchart (2024-03-15 00:16:01)
> > To prepare for exposing the MediaBusFormatInfo structure as an internal
> > API, add a code member to the structure to store the media bus code.
> > This makes MediaBusFormatInfo usable standalone, without having to
> > externally associate the code related to the info.
> > 
> > The entries in the mediaBusFormatInfo map are becoming too long, so
> > split them on multiple lines.
> > 
> > While at it, swap the order of the members to match the PixelFormatInfo
> > class for consistency.
> > 
> > Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> > Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
> 
> That's a big change. But probably worthwhile.
> I've tried to scan through and everything I've checked is consistent so:

I've automated it with a vim regex, so it should be safe :-)

> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
> 
> > ---
> > Changes since combined RFC:
> > 
> > - Rebase on addition oa 14-bit bayer formats
> > ---
> >  src/libcamera/v4l2_subdevice.cpp | 582 ++++++++++++++++++++++++++-----
> >  1 file changed, 497 insertions(+), 85 deletions(-)
> > 
> > diff --git a/src/libcamera/v4l2_subdevice.cpp b/src/libcamera/v4l2_subdevice.cpp
> > index b6a25e25230b..1286e7c385c4 100644
> > --- a/src/libcamera/v4l2_subdevice.cpp
> > +++ b/src/libcamera/v4l2_subdevice.cpp
> > @@ -41,13 +41,15 @@ namespace {
> >  /*
> >   * \struct MediaBusFormatInfo
> >   * \brief Information about media bus formats
> > - * \param bitsPerPixel Bits per pixel
> >   * \param name Name of MBUS format
> > + * \param code The media bus format code
> > + * \param bitsPerPixel Bits per pixel
> >   * \param colourEncoding Type of colour encoding
> >   */
> >  struct MediaBusFormatInfo {
> > -       unsigned int bitsPerPixel;
> >         const char *name;
> > +       uint32_t code;
> > +       unsigned int bitsPerPixel;
> >         PixelFormatInfo::ColourEncoding colourEncoding;
> >  };
> >  
> > @@ -56,91 +58,501 @@ struct MediaBusFormatInfo {
> >   * \brief A map that associates MediaBusFormatInfo struct to V4L2 media
> >   * bus codes
> >   */
> > -const std::map<uint32_t, MediaBusFormatInfo> mediaBusFormatInfo = {
> > +const std::map<uint32_t, MediaBusFormatInfo> mediaBusFormatInfo{
> >         /* This table is sorted to match the order in linux/media-bus-format.h */
> > -       { MEDIA_BUS_FMT_RGB444_2X8_PADHI_BE, { 16, "RGB444_2X8_PADHI_BE", PixelFormatInfo::ColourEncodingRGB } },
> > -       { MEDIA_BUS_FMT_RGB444_2X8_PADHI_LE, { 16, "RGB444_2X8_PADHI_LE", PixelFormatInfo::ColourEncodingRGB } },
> > -       { MEDIA_BUS_FMT_RGB555_2X8_PADHI_BE, { 16, "RGB555_2X8_PADHI_BE", PixelFormatInfo::ColourEncodingRGB } },
> > -       { MEDIA_BUS_FMT_RGB555_2X8_PADHI_LE, { 16, "RGB555_2X8_PADHI_LE", PixelFormatInfo::ColourEncodingRGB } },
> > -       { MEDIA_BUS_FMT_RGB565_1X16, { 16, "RGB565_1X16", PixelFormatInfo::ColourEncodingRGB } },
> > -       { MEDIA_BUS_FMT_BGR565_2X8_BE, { 16, "BGR565_2X8_BE", PixelFormatInfo::ColourEncodingRGB } },
> > -       { MEDIA_BUS_FMT_BGR565_2X8_LE, { 16, "BGR565_2X8_LE", PixelFormatInfo::ColourEncodingRGB } },
> > -       { MEDIA_BUS_FMT_RGB565_2X8_BE, { 16, "RGB565_2X8_BE", PixelFormatInfo::ColourEncodingRGB } },
> > -       { MEDIA_BUS_FMT_RGB565_2X8_LE, { 16, "RGB565_2X8_LE", PixelFormatInfo::ColourEncodingRGB } },
> > -       { MEDIA_BUS_FMT_RGB666_1X18, { 18, "RGB666_1X18", PixelFormatInfo::ColourEncodingRGB } },
> > -       { MEDIA_BUS_FMT_BGR888_1X24, { 24, "BGR888_1X24", PixelFormatInfo::ColourEncodingRGB } },
> > -       { MEDIA_BUS_FMT_RGB888_1X24, { 24, "RGB888_1X24", PixelFormatInfo::ColourEncodingRGB } },
> > -       { MEDIA_BUS_FMT_RGB888_2X12_BE, { 24, "RGB888_2X12_BE", PixelFormatInfo::ColourEncodingRGB } },
> > -       { MEDIA_BUS_FMT_RGB888_2X12_LE, { 24, "RGB888_2X12_LE", PixelFormatInfo::ColourEncodingRGB } },
> > -       { MEDIA_BUS_FMT_ARGB8888_1X32, { 32, "ARGB8888_1X32", PixelFormatInfo::ColourEncodingRGB } },
> > -       { MEDIA_BUS_FMT_Y8_1X8, { 8, "Y8_1X8", PixelFormatInfo::ColourEncodingYUV } },
> > -       { MEDIA_BUS_FMT_UV8_1X8, { 8, "UV8_1X8", PixelFormatInfo::ColourEncodingYUV } },
> > -       { MEDIA_BUS_FMT_UYVY8_1_5X8, { 12, "UYVY8_1_5X8", PixelFormatInfo::ColourEncodingYUV } },
> > -       { MEDIA_BUS_FMT_VYUY8_1_5X8, { 12, "VYUY8_1_5X8", PixelFormatInfo::ColourEncodingYUV } },
> > -       { MEDIA_BUS_FMT_YUYV8_1_5X8, { 12, "YUYV8_1_5X8", PixelFormatInfo::ColourEncodingYUV } },
> > -       { MEDIA_BUS_FMT_YVYU8_1_5X8, { 12, "YVYU8_1_5X8", PixelFormatInfo::ColourEncodingYUV } },
> > -       { MEDIA_BUS_FMT_UYVY8_2X8, { 16, "UYVY8_2X8", PixelFormatInfo::ColourEncodingYUV } },
> > -       { MEDIA_BUS_FMT_VYUY8_2X8, { 16, "VYUY8_2X8", PixelFormatInfo::ColourEncodingYUV } },
> > -       { MEDIA_BUS_FMT_YUYV8_2X8, { 16, "YUYV8_2X8", PixelFormatInfo::ColourEncodingYUV } },
> > -       { MEDIA_BUS_FMT_YVYU8_2X8, { 16, "YVYU8_2X8", PixelFormatInfo::ColourEncodingYUV } },
> > -       { MEDIA_BUS_FMT_Y10_1X10, { 10, "Y10_1X10", PixelFormatInfo::ColourEncodingYUV } },
> > -       { MEDIA_BUS_FMT_UYVY10_2X10, { 20, "UYVY10_2X10", PixelFormatInfo::ColourEncodingYUV } },
> > -       { MEDIA_BUS_FMT_VYUY10_2X10, { 20, "VYUY10_2X10", PixelFormatInfo::ColourEncodingYUV } },
> > -       { MEDIA_BUS_FMT_YUYV10_2X10, { 20, "YUYV10_2X10", PixelFormatInfo::ColourEncodingYUV } },
> > -       { MEDIA_BUS_FMT_YVYU10_2X10, { 20, "YVYU10_2X10", PixelFormatInfo::ColourEncodingYUV } },
> > -       { MEDIA_BUS_FMT_Y12_1X12, { 12, "Y12_1X12", PixelFormatInfo::ColourEncodingYUV } },
> > -       { MEDIA_BUS_FMT_Y16_1X16, { 16, "Y16_1X16", PixelFormatInfo::ColourEncodingYUV } },
> > -       { MEDIA_BUS_FMT_UYVY8_1X16, { 16, "UYVY8_1X16", PixelFormatInfo::ColourEncodingYUV } },
> > -       { MEDIA_BUS_FMT_VYUY8_1X16, { 16, "VYUY8_1X16", PixelFormatInfo::ColourEncodingYUV } },
> > -       { MEDIA_BUS_FMT_YUYV8_1X16, { 16, "YUYV8_1X16", PixelFormatInfo::ColourEncodingYUV } },
> > -       { MEDIA_BUS_FMT_YVYU8_1X16, { 16, "YVYU8_1X16", PixelFormatInfo::ColourEncodingYUV } },
> > -       { MEDIA_BUS_FMT_YDYUYDYV8_1X16, { 16, "YDYUYDYV8_1X16", PixelFormatInfo::ColourEncodingYUV } },
> > -       { MEDIA_BUS_FMT_UYVY10_1X20, { 20, "UYVY10_1X20", PixelFormatInfo::ColourEncodingYUV } },
> > -       { MEDIA_BUS_FMT_VYUY10_1X20, { 20, "VYUY10_1X20", PixelFormatInfo::ColourEncodingYUV } },
> > -       { MEDIA_BUS_FMT_YUYV10_1X20, { 20, "YUYV10_1X20", PixelFormatInfo::ColourEncodingYUV } },
> > -       { MEDIA_BUS_FMT_YVYU10_1X20, { 20, "YVYU10_1X20", PixelFormatInfo::ColourEncodingYUV } },
> > -       { MEDIA_BUS_FMT_YUV8_1X24, { 24, "YUV8_1X24", PixelFormatInfo::ColourEncodingYUV } },
> > -       { MEDIA_BUS_FMT_YUV10_1X30, { 30, "YUV10_1X30", PixelFormatInfo::ColourEncodingYUV } },
> > -       { MEDIA_BUS_FMT_AYUV8_1X32, { 32, "AYUV8_1X32", PixelFormatInfo::ColourEncodingYUV } },
> > -       { MEDIA_BUS_FMT_UYVY12_2X12, { 24, "UYVY12_2X12", PixelFormatInfo::ColourEncodingYUV } },
> > -       { MEDIA_BUS_FMT_VYUY12_2X12, { 24, "VYUY12_2X12", PixelFormatInfo::ColourEncodingYUV } },
> > -       { MEDIA_BUS_FMT_YUYV12_2X12, { 24, "YUYV12_2X12", PixelFormatInfo::ColourEncodingYUV } },
> > -       { MEDIA_BUS_FMT_YVYU12_2X12, { 24, "YVYU12_2X12", PixelFormatInfo::ColourEncodingYUV } },
> > -       { MEDIA_BUS_FMT_UYVY12_1X24, { 24, "UYVY12_1X24", PixelFormatInfo::ColourEncodingYUV } },
> > -       { MEDIA_BUS_FMT_VYUY12_1X24, { 24, "VYUY12_1X24", PixelFormatInfo::ColourEncodingYUV } },
> > -       { MEDIA_BUS_FMT_YUYV12_1X24, { 24, "YUYV12_1X24", PixelFormatInfo::ColourEncodingYUV } },
> > -       { MEDIA_BUS_FMT_YVYU12_1X24, { 24, "YVYU12_1X24", PixelFormatInfo::ColourEncodingYUV } },
> > -       { MEDIA_BUS_FMT_SBGGR8_1X8, { 8, "SBGGR8_1X8", PixelFormatInfo::ColourEncodingRAW } },
> > -       { MEDIA_BUS_FMT_SGBRG8_1X8, { 8, "SGBRG8_1X8", PixelFormatInfo::ColourEncodingRAW } },
> > -       { MEDIA_BUS_FMT_SGRBG8_1X8, { 8, "SGRBG8_1X8", PixelFormatInfo::ColourEncodingRAW } },
> > -       { MEDIA_BUS_FMT_SRGGB8_1X8, { 8, "SRGGB8_1X8", PixelFormatInfo::ColourEncodingRAW } },
> > -       { MEDIA_BUS_FMT_SBGGR10_ALAW8_1X8, { 8, "SBGGR10_ALAW8_1X8", PixelFormatInfo::ColourEncodingRAW } },
> > -       { MEDIA_BUS_FMT_SGBRG10_ALAW8_1X8, { 8, "SGBRG10_ALAW8_1X8", PixelFormatInfo::ColourEncodingRAW } },
> > -       { MEDIA_BUS_FMT_SGRBG10_ALAW8_1X8, { 8, "SGRBG10_ALAW8_1X8", PixelFormatInfo::ColourEncodingRAW } },
> > -       { MEDIA_BUS_FMT_SRGGB10_ALAW8_1X8, { 8, "SRGGB10_ALAW8_1X8", PixelFormatInfo::ColourEncodingRAW } },
> > -       { MEDIA_BUS_FMT_SBGGR10_DPCM8_1X8, { 8, "SBGGR10_DPCM8_1X8", PixelFormatInfo::ColourEncodingRAW } },
> > -       { MEDIA_BUS_FMT_SGBRG10_DPCM8_1X8, { 8, "SGBRG10_DPCM8_1X8", PixelFormatInfo::ColourEncodingRAW } },
> > -       { MEDIA_BUS_FMT_SGRBG10_DPCM8_1X8, { 8, "SGRBG10_DPCM8_1X8", PixelFormatInfo::ColourEncodingRAW } },
> > -       { MEDIA_BUS_FMT_SRGGB10_DPCM8_1X8, { 8, "SRGGB10_DPCM8_1X8", PixelFormatInfo::ColourEncodingRAW } },
> > -       { MEDIA_BUS_FMT_SBGGR10_2X8_PADHI_BE, { 16, "SBGGR10_2X8_PADHI_BE", PixelFormatInfo::ColourEncodingRAW } },
> > -       { MEDIA_BUS_FMT_SBGGR10_2X8_PADHI_LE, { 16, "SBGGR10_2X8_PADHI_LE", PixelFormatInfo::ColourEncodingRAW } },
> > -       { MEDIA_BUS_FMT_SBGGR10_2X8_PADLO_BE, { 16, "SBGGR10_2X8_PADLO_BE", PixelFormatInfo::ColourEncodingRAW } },
> > -       { MEDIA_BUS_FMT_SBGGR10_2X8_PADLO_LE, { 16, "SBGGR10_2X8_PADLO_LE", PixelFormatInfo::ColourEncodingRAW } },
> > -       { MEDIA_BUS_FMT_SBGGR10_1X10, { 10, "SBGGR10_1X10", PixelFormatInfo::ColourEncodingRAW } },
> > -       { MEDIA_BUS_FMT_SGBRG10_1X10, { 10, "SGBRG10_1X10", PixelFormatInfo::ColourEncodingRAW } },
> > -       { MEDIA_BUS_FMT_SGRBG10_1X10, { 10, "SGRBG10_1X10", PixelFormatInfo::ColourEncodingRAW } },
> > -       { MEDIA_BUS_FMT_SRGGB10_1X10, { 10, "SRGGB10_1X10", PixelFormatInfo::ColourEncodingRAW } },
> > -       { MEDIA_BUS_FMT_SBGGR12_1X12, { 12, "SBGGR12_1X12", PixelFormatInfo::ColourEncodingRAW } },
> > -       { MEDIA_BUS_FMT_SGBRG12_1X12, { 12, "SGBRG12_1X12", PixelFormatInfo::ColourEncodingRAW } },
> > -       { MEDIA_BUS_FMT_SGRBG12_1X12, { 12, "SGRBG12_1X12", PixelFormatInfo::ColourEncodingRAW } },
> > -       { MEDIA_BUS_FMT_SRGGB12_1X12, { 12, "SRGGB12_1X12", PixelFormatInfo::ColourEncodingRAW } },
> > -       { MEDIA_BUS_FMT_SBGGR14_1X14, { 14, "SBGGR14_1X14", PixelFormatInfo::ColourEncodingRAW } },
> > -       { MEDIA_BUS_FMT_SGBRG14_1X14, { 14, "SGBRG14_1X14", PixelFormatInfo::ColourEncodingRAW } },
> > -       { MEDIA_BUS_FMT_SGRBG14_1X14, { 14, "SGRBG14_1X14", PixelFormatInfo::ColourEncodingRAW } },
> > -       { MEDIA_BUS_FMT_SRGGB14_1X14, { 14, "SRGGB14_1X14", PixelFormatInfo::ColourEncodingRAW } },
> > +       { MEDIA_BUS_FMT_RGB444_2X8_PADHI_BE, {
> > +               .name = "RGB444_2X8_PADHI_BE",
> > +               .code = MEDIA_BUS_FMT_RGB444_2X8_PADHI_BE,
> > +               .bitsPerPixel = 16,
> > +               .colourEncoding = PixelFormatInfo::ColourEncodingRGB,
> > +       } },
> > +       { MEDIA_BUS_FMT_RGB444_2X8_PADHI_LE, {
> > +               .name = "RGB444_2X8_PADHI_LE",
> > +               .code = MEDIA_BUS_FMT_RGB444_2X8_PADHI_LE,
> > +               .bitsPerPixel = 16,
> > +               .colourEncoding = PixelFormatInfo::ColourEncodingRGB,
> > +       } },
> > +       { MEDIA_BUS_FMT_RGB555_2X8_PADHI_BE, {
> > +               .name = "RGB555_2X8_PADHI_BE",
> > +               .code = MEDIA_BUS_FMT_RGB555_2X8_PADHI_BE,
> > +               .bitsPerPixel = 16,
> > +               .colourEncoding = PixelFormatInfo::ColourEncodingRGB,
> > +       } },
> > +       { MEDIA_BUS_FMT_RGB555_2X8_PADHI_LE, {
> > +               .name = "RGB555_2X8_PADHI_LE",
> > +               .code = MEDIA_BUS_FMT_RGB555_2X8_PADHI_LE,
> > +               .bitsPerPixel = 16,
> > +               .colourEncoding = PixelFormatInfo::ColourEncodingRGB,
> > +       } },
> > +       { MEDIA_BUS_FMT_RGB565_1X16, {
> > +               .name = "RGB565_1X16",
> > +               .code = MEDIA_BUS_FMT_RGB565_1X16,
> > +               .bitsPerPixel = 16,
> > +               .colourEncoding = PixelFormatInfo::ColourEncodingRGB,
> > +       } },
> > +       { MEDIA_BUS_FMT_BGR565_2X8_BE, {
> > +               .name = "BGR565_2X8_BE",
> > +               .code = MEDIA_BUS_FMT_BGR565_2X8_BE,
> > +               .bitsPerPixel = 16,
> > +               .colourEncoding = PixelFormatInfo::ColourEncodingRGB,
> > +       } },
> > +       { MEDIA_BUS_FMT_BGR565_2X8_LE, {
> > +               .name = "BGR565_2X8_LE",
> > +               .code = MEDIA_BUS_FMT_BGR565_2X8_LE,
> > +               .bitsPerPixel = 16,
> > +               .colourEncoding = PixelFormatInfo::ColourEncodingRGB,
> > +       } },
> > +       { MEDIA_BUS_FMT_RGB565_2X8_BE, {
> > +               .name = "RGB565_2X8_BE",
> > +               .code = MEDIA_BUS_FMT_RGB565_2X8_BE,
> > +               .bitsPerPixel = 16,
> > +               .colourEncoding = PixelFormatInfo::ColourEncodingRGB,
> > +       } },
> > +       { MEDIA_BUS_FMT_RGB565_2X8_LE, {
> > +               .name = "RGB565_2X8_LE",
> > +               .code = MEDIA_BUS_FMT_RGB565_2X8_LE,
> > +               .bitsPerPixel = 16,
> > +               .colourEncoding = PixelFormatInfo::ColourEncodingRGB,
> > +       } },
> > +       { MEDIA_BUS_FMT_RGB666_1X18, {
> > +               .name = "RGB666_1X18",
> > +               .code = MEDIA_BUS_FMT_RGB666_1X18,
> > +               .bitsPerPixel = 18,
> > +               .colourEncoding = PixelFormatInfo::ColourEncodingRGB,
> > +       } },
> > +       { MEDIA_BUS_FMT_BGR888_1X24, {
> > +               .name = "BGR888_1X24",
> > +               .code = MEDIA_BUS_FMT_BGR888_1X24,
> > +               .bitsPerPixel = 24,
> > +               .colourEncoding = PixelFormatInfo::ColourEncodingRGB,
> > +       } },
> > +       { MEDIA_BUS_FMT_RGB888_1X24, {
> > +               .name = "RGB888_1X24",
> > +               .code = MEDIA_BUS_FMT_RGB888_1X24,
> > +               .bitsPerPixel = 24,
> > +               .colourEncoding = PixelFormatInfo::ColourEncodingRGB,
> > +       } },
> > +       { MEDIA_BUS_FMT_RGB888_2X12_BE, {
> > +               .name = "RGB888_2X12_BE",
> > +               .code = MEDIA_BUS_FMT_RGB888_2X12_BE,
> > +               .bitsPerPixel = 24,
> > +               .colourEncoding = PixelFormatInfo::ColourEncodingRGB,
> > +       } },
> > +       { MEDIA_BUS_FMT_RGB888_2X12_LE, {
> > +               .name = "RGB888_2X12_LE",
> > +               .code = MEDIA_BUS_FMT_RGB888_2X12_LE,
> > +               .bitsPerPixel = 24,
> > +               .colourEncoding = PixelFormatInfo::ColourEncodingRGB,
> > +       } },
> > +       { MEDIA_BUS_FMT_ARGB8888_1X32, {
> > +               .name = "ARGB8888_1X32",
> > +               .code = MEDIA_BUS_FMT_ARGB8888_1X32,
> > +               .bitsPerPixel = 32,
> > +               .colourEncoding = PixelFormatInfo::ColourEncodingRGB,
> > +       } },
> > +       { MEDIA_BUS_FMT_Y8_1X8, {
> > +               .name = "Y8_1X8",
> > +               .code = MEDIA_BUS_FMT_Y8_1X8,
> > +               .bitsPerPixel = 8,
> > +               .colourEncoding = PixelFormatInfo::ColourEncodingYUV,
> > +       } },
> > +       { MEDIA_BUS_FMT_UV8_1X8, {
> > +               .name = "UV8_1X8",
> > +               .code = MEDIA_BUS_FMT_UV8_1X8,
> > +               .bitsPerPixel = 8,
> > +               .colourEncoding = PixelFormatInfo::ColourEncodingYUV,
> > +       } },
> > +       { MEDIA_BUS_FMT_UYVY8_1_5X8, {
> > +               .name = "UYVY8_1_5X8",
> > +               .code = MEDIA_BUS_FMT_UYVY8_1_5X8,
> > +               .bitsPerPixel = 12,
> > +               .colourEncoding = PixelFormatInfo::ColourEncodingYUV,
> > +       } },
> > +       { MEDIA_BUS_FMT_VYUY8_1_5X8, {
> > +               .name = "VYUY8_1_5X8",
> > +               .code = MEDIA_BUS_FMT_VYUY8_1_5X8,
> > +               .bitsPerPixel = 12,
> > +               .colourEncoding = PixelFormatInfo::ColourEncodingYUV,
> > +       } },
> > +       { MEDIA_BUS_FMT_YUYV8_1_5X8, {
> > +               .name = "YUYV8_1_5X8",
> > +               .code = MEDIA_BUS_FMT_YUYV8_1_5X8,
> > +               .bitsPerPixel = 12,
> > +               .colourEncoding = PixelFormatInfo::ColourEncodingYUV,
> > +       } },
> > +       { MEDIA_BUS_FMT_YVYU8_1_5X8, {
> > +               .name = "YVYU8_1_5X8",
> > +               .code = MEDIA_BUS_FMT_YVYU8_1_5X8,
> > +               .bitsPerPixel = 12,
> > +               .colourEncoding = PixelFormatInfo::ColourEncodingYUV,
> > +       } },
> > +       { MEDIA_BUS_FMT_UYVY8_2X8, {
> > +               .name = "UYVY8_2X8",
> > +               .code = MEDIA_BUS_FMT_UYVY8_2X8,
> > +               .bitsPerPixel = 16,
> > +               .colourEncoding = PixelFormatInfo::ColourEncodingYUV,
> > +       } },
> > +       { MEDIA_BUS_FMT_VYUY8_2X8, {
> > +               .name = "VYUY8_2X8",
> > +               .code = MEDIA_BUS_FMT_VYUY8_2X8,
> > +               .bitsPerPixel = 16,
> > +               .colourEncoding = PixelFormatInfo::ColourEncodingYUV,
> > +       } },
> > +       { MEDIA_BUS_FMT_YUYV8_2X8, {
> > +               .name = "YUYV8_2X8",
> > +               .code = MEDIA_BUS_FMT_YUYV8_2X8,
> > +               .bitsPerPixel = 16,
> > +               .colourEncoding = PixelFormatInfo::ColourEncodingYUV,
> > +       } },
> > +       { MEDIA_BUS_FMT_YVYU8_2X8, {
> > +               .name = "YVYU8_2X8",
> > +               .code = MEDIA_BUS_FMT_YVYU8_2X8,
> > +               .bitsPerPixel = 16,
> > +               .colourEncoding = PixelFormatInfo::ColourEncodingYUV,
> > +       } },
> > +       { MEDIA_BUS_FMT_Y10_1X10, {
> > +               .name = "Y10_1X10",
> > +               .code = MEDIA_BUS_FMT_Y10_1X10,
> > +               .bitsPerPixel = 10,
> > +               .colourEncoding = PixelFormatInfo::ColourEncodingYUV,
> > +       } },
> > +       { MEDIA_BUS_FMT_UYVY10_2X10, {
> > +               .name = "UYVY10_2X10",
> > +               .code = MEDIA_BUS_FMT_UYVY10_2X10,
> > +               .bitsPerPixel = 20,
> > +               .colourEncoding = PixelFormatInfo::ColourEncodingYUV,
> > +       } },
> > +       { MEDIA_BUS_FMT_VYUY10_2X10, {
> > +               .name = "VYUY10_2X10",
> > +               .code = MEDIA_BUS_FMT_VYUY10_2X10,
> > +               .bitsPerPixel = 20,
> > +               .colourEncoding = PixelFormatInfo::ColourEncodingYUV,
> > +       } },
> > +       { MEDIA_BUS_FMT_YUYV10_2X10, {
> > +               .name = "YUYV10_2X10",
> > +               .code = MEDIA_BUS_FMT_YUYV10_2X10,
> > +               .bitsPerPixel = 20,
> > +               .colourEncoding = PixelFormatInfo::ColourEncodingYUV,
> > +       } },
> > +       { MEDIA_BUS_FMT_YVYU10_2X10, {
> > +               .name = "YVYU10_2X10",
> > +               .code = MEDIA_BUS_FMT_YVYU10_2X10,
> > +               .bitsPerPixel = 20,
> > +               .colourEncoding = PixelFormatInfo::ColourEncodingYUV,
> > +       } },
> > +       { MEDIA_BUS_FMT_Y12_1X12, {
> > +               .name = "Y12_1X12",
> > +               .code = MEDIA_BUS_FMT_Y12_1X12,
> > +               .bitsPerPixel = 12,
> > +               .colourEncoding = PixelFormatInfo::ColourEncodingYUV,
> > +       } },
> > +       { MEDIA_BUS_FMT_Y16_1X16, {
> > +               .name = "Y16_1X16",
> > +               .code = MEDIA_BUS_FMT_Y16_1X16,
> > +               .bitsPerPixel = 16,
> > +               .colourEncoding = PixelFormatInfo::ColourEncodingYUV,
> > +       } },
> > +       { MEDIA_BUS_FMT_UYVY8_1X16, {
> > +               .name = "UYVY8_1X16",
> > +               .code = MEDIA_BUS_FMT_UYVY8_1X16,
> > +               .bitsPerPixel = 16,
> > +               .colourEncoding = PixelFormatInfo::ColourEncodingYUV,
> > +       } },
> > +       { MEDIA_BUS_FMT_VYUY8_1X16, {
> > +               .name = "VYUY8_1X16",
> > +               .code = MEDIA_BUS_FMT_VYUY8_1X16,
> > +               .bitsPerPixel = 16,
> > +               .colourEncoding = PixelFormatInfo::ColourEncodingYUV,
> > +       } },
> > +       { MEDIA_BUS_FMT_YUYV8_1X16, {
> > +               .name = "YUYV8_1X16",
> > +               .code = MEDIA_BUS_FMT_YUYV8_1X16,
> > +               .bitsPerPixel = 16,
> > +               .colourEncoding = PixelFormatInfo::ColourEncodingYUV,
> > +       } },
> > +       { MEDIA_BUS_FMT_YVYU8_1X16, {
> > +               .name = "YVYU8_1X16",
> > +               .code = MEDIA_BUS_FMT_YVYU8_1X16,
> > +               .bitsPerPixel = 16,
> > +               .colourEncoding = PixelFormatInfo::ColourEncodingYUV,
> > +       } },
> > +       { MEDIA_BUS_FMT_YDYUYDYV8_1X16, {
> > +               .name = "YDYUYDYV8_1X16",
> > +               .code = MEDIA_BUS_FMT_YDYUYDYV8_1X16,
> > +               .bitsPerPixel = 16,
> > +               .colourEncoding = PixelFormatInfo::ColourEncodingYUV,
> > +       } },
> > +       { MEDIA_BUS_FMT_UYVY10_1X20, {
> > +               .name = "UYVY10_1X20",
> > +               .code = MEDIA_BUS_FMT_UYVY10_1X20,
> > +               .bitsPerPixel = 20,
> > +               .colourEncoding = PixelFormatInfo::ColourEncodingYUV,
> > +       } },
> > +       { MEDIA_BUS_FMT_VYUY10_1X20, {
> > +               .name = "VYUY10_1X20",
> > +               .code = MEDIA_BUS_FMT_VYUY10_1X20,
> > +               .bitsPerPixel = 20,
> > +               .colourEncoding = PixelFormatInfo::ColourEncodingYUV,
> > +       } },
> > +       { MEDIA_BUS_FMT_YUYV10_1X20, {
> > +               .name = "YUYV10_1X20",
> > +               .code = MEDIA_BUS_FMT_YUYV10_1X20,
> > +               .bitsPerPixel = 20,
> > +               .colourEncoding = PixelFormatInfo::ColourEncodingYUV,
> > +       } },
> > +       { MEDIA_BUS_FMT_YVYU10_1X20, {
> > +               .name = "YVYU10_1X20",
> > +               .code = MEDIA_BUS_FMT_YVYU10_1X20,
> > +               .bitsPerPixel = 20,
> > +               .colourEncoding = PixelFormatInfo::ColourEncodingYUV,
> > +       } },
> > +       { MEDIA_BUS_FMT_YUV8_1X24, {
> > +               .name = "YUV8_1X24",
> > +               .code = MEDIA_BUS_FMT_YUV8_1X24,
> > +               .bitsPerPixel = 24,
> > +               .colourEncoding = PixelFormatInfo::ColourEncodingYUV,
> > +       } },
> > +       { MEDIA_BUS_FMT_YUV10_1X30, {
> > +               .name = "YUV10_1X30",
> > +               .code = MEDIA_BUS_FMT_YUV10_1X30,
> > +               .bitsPerPixel = 30,
> > +               .colourEncoding = PixelFormatInfo::ColourEncodingYUV,
> > +       } },
> > +       { MEDIA_BUS_FMT_AYUV8_1X32, {
> > +               .name = "AYUV8_1X32",
> > +               .code = MEDIA_BUS_FMT_AYUV8_1X32,
> > +               .bitsPerPixel = 32,
> > +               .colourEncoding = PixelFormatInfo::ColourEncodingYUV,
> > +       } },
> > +       { MEDIA_BUS_FMT_UYVY12_2X12, {
> > +               .name = "UYVY12_2X12",
> > +               .code = MEDIA_BUS_FMT_UYVY12_2X12,
> > +               .bitsPerPixel = 24,
> > +               .colourEncoding = PixelFormatInfo::ColourEncodingYUV,
> > +       } },
> > +       { MEDIA_BUS_FMT_VYUY12_2X12, {
> > +               .name = "VYUY12_2X12",
> > +               .code = MEDIA_BUS_FMT_VYUY12_2X12,
> > +               .bitsPerPixel = 24,
> > +               .colourEncoding = PixelFormatInfo::ColourEncodingYUV,
> > +       } },
> > +       { MEDIA_BUS_FMT_YUYV12_2X12, {
> > +               .name = "YUYV12_2X12",
> > +               .code = MEDIA_BUS_FMT_YUYV12_2X12,
> > +               .bitsPerPixel = 24,
> > +               .colourEncoding = PixelFormatInfo::ColourEncodingYUV,
> > +       } },
> > +       { MEDIA_BUS_FMT_YVYU12_2X12, {
> > +               .name = "YVYU12_2X12",
> > +               .code = MEDIA_BUS_FMT_YVYU12_2X12,
> > +               .bitsPerPixel = 24,
> > +               .colourEncoding = PixelFormatInfo::ColourEncodingYUV,
> > +       } },
> > +       { MEDIA_BUS_FMT_UYVY12_1X24, {
> > +               .name = "UYVY12_1X24",
> > +               .code = MEDIA_BUS_FMT_UYVY12_1X24,
> > +               .bitsPerPixel = 24,
> > +               .colourEncoding = PixelFormatInfo::ColourEncodingYUV,
> > +       } },
> > +       { MEDIA_BUS_FMT_VYUY12_1X24, {
> > +               .name = "VYUY12_1X24",
> > +               .code = MEDIA_BUS_FMT_VYUY12_1X24,
> > +               .bitsPerPixel = 24,
> > +               .colourEncoding = PixelFormatInfo::ColourEncodingYUV,
> > +       } },
> > +       { MEDIA_BUS_FMT_YUYV12_1X24, {
> > +               .name = "YUYV12_1X24",
> > +               .code = MEDIA_BUS_FMT_YUYV12_1X24,
> > +               .bitsPerPixel = 24,
> > +               .colourEncoding = PixelFormatInfo::ColourEncodingYUV,
> > +       } },
> > +       { MEDIA_BUS_FMT_YVYU12_1X24, {
> > +               .name = "YVYU12_1X24",
> > +               .code = MEDIA_BUS_FMT_YVYU12_1X24,
> > +               .bitsPerPixel = 24,
> > +               .colourEncoding = PixelFormatInfo::ColourEncodingYUV,
> > +       } },
> > +       { MEDIA_BUS_FMT_SBGGR8_1X8, {
> > +               .name = "SBGGR8_1X8",
> > +               .code = MEDIA_BUS_FMT_SBGGR8_1X8,
> > +               .bitsPerPixel = 8,
> > +               .colourEncoding = PixelFormatInfo::ColourEncodingRAW,
> > +       } },
> > +       { MEDIA_BUS_FMT_SGBRG8_1X8, {
> > +               .name = "SGBRG8_1X8",
> > +               .code = MEDIA_BUS_FMT_SGBRG8_1X8,
> > +               .bitsPerPixel = 8,
> > +               .colourEncoding = PixelFormatInfo::ColourEncodingRAW,
> > +       } },
> > +       { MEDIA_BUS_FMT_SGRBG8_1X8, {
> > +               .name = "SGRBG8_1X8",
> > +               .code = MEDIA_BUS_FMT_SGRBG8_1X8,
> > +               .bitsPerPixel = 8,
> > +               .colourEncoding = PixelFormatInfo::ColourEncodingRAW,
> > +       } },
> > +       { MEDIA_BUS_FMT_SRGGB8_1X8, {
> > +               .name = "SRGGB8_1X8",
> > +               .code = MEDIA_BUS_FMT_SRGGB8_1X8,
> > +               .bitsPerPixel = 8,
> > +               .colourEncoding = PixelFormatInfo::ColourEncodingRAW,
> > +       } },
> > +       { MEDIA_BUS_FMT_SBGGR10_ALAW8_1X8, {
> > +               .name = "SBGGR10_ALAW8_1X8",
> > +               .code = MEDIA_BUS_FMT_SBGGR10_ALAW8_1X8,
> > +               .bitsPerPixel = 8,
> > +               .colourEncoding = PixelFormatInfo::ColourEncodingRAW,
> > +       } },
> > +       { MEDIA_BUS_FMT_SGBRG10_ALAW8_1X8, {
> > +               .name = "SGBRG10_ALAW8_1X8",
> > +               .code = MEDIA_BUS_FMT_SGBRG10_ALAW8_1X8,
> > +               .bitsPerPixel = 8,
> > +               .colourEncoding = PixelFormatInfo::ColourEncodingRAW,
> > +       } },
> > +       { MEDIA_BUS_FMT_SGRBG10_ALAW8_1X8, {
> > +               .name = "SGRBG10_ALAW8_1X8",
> > +               .code = MEDIA_BUS_FMT_SGRBG10_ALAW8_1X8,
> > +               .bitsPerPixel = 8,
> > +               .colourEncoding = PixelFormatInfo::ColourEncodingRAW,
> > +       } },
> > +       { MEDIA_BUS_FMT_SRGGB10_ALAW8_1X8, {
> > +               .name = "SRGGB10_ALAW8_1X8",
> > +               .code = MEDIA_BUS_FMT_SRGGB10_ALAW8_1X8,
> > +               .bitsPerPixel = 8,
> > +               .colourEncoding = PixelFormatInfo::ColourEncodingRAW,
> > +       } },
> > +       { MEDIA_BUS_FMT_SBGGR10_DPCM8_1X8, {
> > +               .name = "SBGGR10_DPCM8_1X8",
> > +               .code = MEDIA_BUS_FMT_SBGGR10_DPCM8_1X8,
> > +               .bitsPerPixel = 8,
> > +               .colourEncoding = PixelFormatInfo::ColourEncodingRAW,
> > +       } },
> > +       { MEDIA_BUS_FMT_SGBRG10_DPCM8_1X8, {
> > +               .name = "SGBRG10_DPCM8_1X8",
> > +               .code = MEDIA_BUS_FMT_SGBRG10_DPCM8_1X8,
> > +               .bitsPerPixel = 8,
> > +               .colourEncoding = PixelFormatInfo::ColourEncodingRAW,
> > +       } },
> > +       { MEDIA_BUS_FMT_SGRBG10_DPCM8_1X8, {
> > +               .name = "SGRBG10_DPCM8_1X8",
> > +               .code = MEDIA_BUS_FMT_SGRBG10_DPCM8_1X8,
> > +               .bitsPerPixel = 8,
> > +               .colourEncoding = PixelFormatInfo::ColourEncodingRAW,
> > +       } },
> > +       { MEDIA_BUS_FMT_SRGGB10_DPCM8_1X8, {
> > +               .name = "SRGGB10_DPCM8_1X8",
> > +               .code = MEDIA_BUS_FMT_SRGGB10_DPCM8_1X8,
> > +               .bitsPerPixel = 8,
> > +               .colourEncoding = PixelFormatInfo::ColourEncodingRAW,
> > +       } },
> > +       { MEDIA_BUS_FMT_SBGGR10_2X8_PADHI_BE, {
> > +               .name = "SBGGR10_2X8_PADHI_BE",
> > +               .code = MEDIA_BUS_FMT_SBGGR10_2X8_PADHI_BE,
> > +               .bitsPerPixel = 16,
> > +               .colourEncoding = PixelFormatInfo::ColourEncodingRAW,
> > +       } },
> > +       { MEDIA_BUS_FMT_SBGGR10_2X8_PADHI_LE, {
> > +               .name = "SBGGR10_2X8_PADHI_LE",
> > +               .code = MEDIA_BUS_FMT_SBGGR10_2X8_PADHI_LE,
> > +               .bitsPerPixel = 16,
> > +               .colourEncoding = PixelFormatInfo::ColourEncodingRAW,
> > +       } },
> > +       { MEDIA_BUS_FMT_SBGGR10_2X8_PADLO_BE, {
> > +               .name = "SBGGR10_2X8_PADLO_BE",
> > +               .code = MEDIA_BUS_FMT_SBGGR10_2X8_PADLO_BE,
> > +               .bitsPerPixel = 16,
> > +               .colourEncoding = PixelFormatInfo::ColourEncodingRAW,
> > +       } },
> > +       { MEDIA_BUS_FMT_SBGGR10_2X8_PADLO_LE, {
> > +               .name = "SBGGR10_2X8_PADLO_LE",
> > +               .code = MEDIA_BUS_FMT_SBGGR10_2X8_PADLO_LE,
> > +               .bitsPerPixel = 16,
> > +               .colourEncoding = PixelFormatInfo::ColourEncodingRAW,
> > +       } },
> > +       { MEDIA_BUS_FMT_SBGGR10_1X10, {
> > +               .name = "SBGGR10_1X10",
> > +               .code = MEDIA_BUS_FMT_SBGGR10_1X10,
> > +               .bitsPerPixel = 10,
> > +               .colourEncoding = PixelFormatInfo::ColourEncodingRAW,
> > +       } },
> > +       { MEDIA_BUS_FMT_SGBRG10_1X10, {
> > +               .name = "SGBRG10_1X10",
> > +               .code = MEDIA_BUS_FMT_SGBRG10_1X10,
> > +               .bitsPerPixel = 10,
> > +               .colourEncoding = PixelFormatInfo::ColourEncodingRAW,
> > +       } },
> > +       { MEDIA_BUS_FMT_SGRBG10_1X10, {
> > +               .name = "SGRBG10_1X10",
> > +               .code = MEDIA_BUS_FMT_SGRBG10_1X10,
> > +               .bitsPerPixel = 10,
> > +               .colourEncoding = PixelFormatInfo::ColourEncodingRAW,
> > +       } },
> > +       { MEDIA_BUS_FMT_SRGGB10_1X10, {
> > +               .name = "SRGGB10_1X10",
> > +               .code = MEDIA_BUS_FMT_SRGGB10_1X10,
> > +               .bitsPerPixel = 10,
> > +               .colourEncoding = PixelFormatInfo::ColourEncodingRAW,
> > +       } },
> > +       { MEDIA_BUS_FMT_SBGGR12_1X12, {
> > +               .name = "SBGGR12_1X12",
> > +               .code = MEDIA_BUS_FMT_SBGGR12_1X12,
> > +               .bitsPerPixel = 12,
> > +               .colourEncoding = PixelFormatInfo::ColourEncodingRAW,
> > +       } },
> > +       { MEDIA_BUS_FMT_SGBRG12_1X12, {
> > +               .name = "SGBRG12_1X12",
> > +               .code = MEDIA_BUS_FMT_SGBRG12_1X12,
> > +               .bitsPerPixel = 12,
> > +               .colourEncoding = PixelFormatInfo::ColourEncodingRAW,
> > +       } },
> > +       { MEDIA_BUS_FMT_SGRBG12_1X12, {
> > +               .name = "SGRBG12_1X12",
> > +               .code = MEDIA_BUS_FMT_SGRBG12_1X12,
> > +               .bitsPerPixel = 12,
> > +               .colourEncoding = PixelFormatInfo::ColourEncodingRAW,
> > +       } },
> > +       { MEDIA_BUS_FMT_SRGGB12_1X12, {
> > +               .name = "SRGGB12_1X12",
> > +               .code = MEDIA_BUS_FMT_SRGGB12_1X12,
> > +               .bitsPerPixel = 12,
> > +               .colourEncoding = PixelFormatInfo::ColourEncodingRAW,
> > +       } },
> > +       { MEDIA_BUS_FMT_SBGGR14_1X14, {
> > +               .name = "SBGGR14_1X14",
> > +               .code = MEDIA_BUS_FMT_SBGGR14_1X14,
> > +               .bitsPerPixel = 14,
> > +               .colourEncoding = PixelFormatInfo::ColourEncodingRAW,
> > +       } },
> > +       { MEDIA_BUS_FMT_SGBRG14_1X14, {
> > +               .name = "SGBRG14_1X14",
> > +               .code = MEDIA_BUS_FMT_SGBRG14_1X14,
> > +               .bitsPerPixel = 14,
> > +               .colourEncoding = PixelFormatInfo::ColourEncodingRAW,
> > +       } },
> > +       { MEDIA_BUS_FMT_SGRBG14_1X14, {
> > +               .name = "SGRBG14_1X14",
> > +               .code = MEDIA_BUS_FMT_SGRBG14_1X14,
> > +               .bitsPerPixel = 14,
> > +               .colourEncoding = PixelFormatInfo::ColourEncodingRAW,
> > +       } },
> > +       { MEDIA_BUS_FMT_SRGGB14_1X14, {
> > +               .name = "SRGGB14_1X14",
> > +               .code = MEDIA_BUS_FMT_SRGGB14_1X14,
> > +               .bitsPerPixel = 14,
> > +               .colourEncoding = PixelFormatInfo::ColourEncodingRAW,
> > +       } },
> >         /* \todo Clarify colour encoding for HSV formats */
> > -       { MEDIA_BUS_FMT_AHSV8888_1X32, { 32, "AHSV8888_1X32", PixelFormatInfo::ColourEncodingRGB } },
> > -       { MEDIA_BUS_FMT_JPEG_1X8, { 8, "JPEG_1X8", PixelFormatInfo::ColourEncodingYUV } },
> > +       { MEDIA_BUS_FMT_AHSV8888_1X32, {
> > +               .name = "AHSV8888_1X32",
> > +               .code = MEDIA_BUS_FMT_AHSV8888_1X32,
> > +               .bitsPerPixel = 32,
> > +               .colourEncoding = PixelFormatInfo::ColourEncodingRGB,
> > +       } },
> > +       { MEDIA_BUS_FMT_JPEG_1X8, {
> > +               .name = "JPEG_1X8",
> > +               .code = MEDIA_BUS_FMT_JPEG_1X8,
> > +               .bitsPerPixel = 8,
> > +               .colourEncoding = PixelFormatInfo::ColourEncodingYUV,
> > +       } },
> >  };
> >  
> >  } /* namespace */

Patch
diff mbox series

diff --git a/src/libcamera/v4l2_subdevice.cpp b/src/libcamera/v4l2_subdevice.cpp
index b6a25e25230b..1286e7c385c4 100644
--- a/src/libcamera/v4l2_subdevice.cpp
+++ b/src/libcamera/v4l2_subdevice.cpp
@@ -41,13 +41,15 @@  namespace {
 /*
  * \struct MediaBusFormatInfo
  * \brief Information about media bus formats
- * \param bitsPerPixel Bits per pixel
  * \param name Name of MBUS format
+ * \param code The media bus format code
+ * \param bitsPerPixel Bits per pixel
  * \param colourEncoding Type of colour encoding
  */
 struct MediaBusFormatInfo {
-	unsigned int bitsPerPixel;
 	const char *name;
+	uint32_t code;
+	unsigned int bitsPerPixel;
 	PixelFormatInfo::ColourEncoding colourEncoding;
 };
 
@@ -56,91 +58,501 @@  struct MediaBusFormatInfo {
  * \brief A map that associates MediaBusFormatInfo struct to V4L2 media
  * bus codes
  */
-const std::map<uint32_t, MediaBusFormatInfo> mediaBusFormatInfo = {
+const std::map<uint32_t, MediaBusFormatInfo> mediaBusFormatInfo{
 	/* This table is sorted to match the order in linux/media-bus-format.h */
-	{ MEDIA_BUS_FMT_RGB444_2X8_PADHI_BE, { 16, "RGB444_2X8_PADHI_BE", PixelFormatInfo::ColourEncodingRGB } },
-	{ MEDIA_BUS_FMT_RGB444_2X8_PADHI_LE, { 16, "RGB444_2X8_PADHI_LE", PixelFormatInfo::ColourEncodingRGB } },
-	{ MEDIA_BUS_FMT_RGB555_2X8_PADHI_BE, { 16, "RGB555_2X8_PADHI_BE", PixelFormatInfo::ColourEncodingRGB } },
-	{ MEDIA_BUS_FMT_RGB555_2X8_PADHI_LE, { 16, "RGB555_2X8_PADHI_LE", PixelFormatInfo::ColourEncodingRGB } },
-	{ MEDIA_BUS_FMT_RGB565_1X16, { 16, "RGB565_1X16", PixelFormatInfo::ColourEncodingRGB } },
-	{ MEDIA_BUS_FMT_BGR565_2X8_BE, { 16, "BGR565_2X8_BE", PixelFormatInfo::ColourEncodingRGB } },
-	{ MEDIA_BUS_FMT_BGR565_2X8_LE, { 16, "BGR565_2X8_LE", PixelFormatInfo::ColourEncodingRGB } },
-	{ MEDIA_BUS_FMT_RGB565_2X8_BE, { 16, "RGB565_2X8_BE", PixelFormatInfo::ColourEncodingRGB } },
-	{ MEDIA_BUS_FMT_RGB565_2X8_LE, { 16, "RGB565_2X8_LE", PixelFormatInfo::ColourEncodingRGB } },
-	{ MEDIA_BUS_FMT_RGB666_1X18, { 18, "RGB666_1X18", PixelFormatInfo::ColourEncodingRGB } },
-	{ MEDIA_BUS_FMT_BGR888_1X24, { 24, "BGR888_1X24", PixelFormatInfo::ColourEncodingRGB } },
-	{ MEDIA_BUS_FMT_RGB888_1X24, { 24, "RGB888_1X24", PixelFormatInfo::ColourEncodingRGB } },
-	{ MEDIA_BUS_FMT_RGB888_2X12_BE, { 24, "RGB888_2X12_BE", PixelFormatInfo::ColourEncodingRGB } },
-	{ MEDIA_BUS_FMT_RGB888_2X12_LE, { 24, "RGB888_2X12_LE", PixelFormatInfo::ColourEncodingRGB } },
-	{ MEDIA_BUS_FMT_ARGB8888_1X32, { 32, "ARGB8888_1X32", PixelFormatInfo::ColourEncodingRGB } },
-	{ MEDIA_BUS_FMT_Y8_1X8, { 8, "Y8_1X8", PixelFormatInfo::ColourEncodingYUV } },
-	{ MEDIA_BUS_FMT_UV8_1X8, { 8, "UV8_1X8", PixelFormatInfo::ColourEncodingYUV } },
-	{ MEDIA_BUS_FMT_UYVY8_1_5X8, { 12, "UYVY8_1_5X8", PixelFormatInfo::ColourEncodingYUV } },
-	{ MEDIA_BUS_FMT_VYUY8_1_5X8, { 12, "VYUY8_1_5X8", PixelFormatInfo::ColourEncodingYUV } },
-	{ MEDIA_BUS_FMT_YUYV8_1_5X8, { 12, "YUYV8_1_5X8", PixelFormatInfo::ColourEncodingYUV } },
-	{ MEDIA_BUS_FMT_YVYU8_1_5X8, { 12, "YVYU8_1_5X8", PixelFormatInfo::ColourEncodingYUV } },
-	{ MEDIA_BUS_FMT_UYVY8_2X8, { 16, "UYVY8_2X8", PixelFormatInfo::ColourEncodingYUV } },
-	{ MEDIA_BUS_FMT_VYUY8_2X8, { 16, "VYUY8_2X8", PixelFormatInfo::ColourEncodingYUV } },
-	{ MEDIA_BUS_FMT_YUYV8_2X8, { 16, "YUYV8_2X8", PixelFormatInfo::ColourEncodingYUV } },
-	{ MEDIA_BUS_FMT_YVYU8_2X8, { 16, "YVYU8_2X8", PixelFormatInfo::ColourEncodingYUV } },
-	{ MEDIA_BUS_FMT_Y10_1X10, { 10, "Y10_1X10", PixelFormatInfo::ColourEncodingYUV } },
-	{ MEDIA_BUS_FMT_UYVY10_2X10, { 20, "UYVY10_2X10", PixelFormatInfo::ColourEncodingYUV } },
-	{ MEDIA_BUS_FMT_VYUY10_2X10, { 20, "VYUY10_2X10", PixelFormatInfo::ColourEncodingYUV } },
-	{ MEDIA_BUS_FMT_YUYV10_2X10, { 20, "YUYV10_2X10", PixelFormatInfo::ColourEncodingYUV } },
-	{ MEDIA_BUS_FMT_YVYU10_2X10, { 20, "YVYU10_2X10", PixelFormatInfo::ColourEncodingYUV } },
-	{ MEDIA_BUS_FMT_Y12_1X12, { 12, "Y12_1X12", PixelFormatInfo::ColourEncodingYUV } },
-	{ MEDIA_BUS_FMT_Y16_1X16, { 16, "Y16_1X16", PixelFormatInfo::ColourEncodingYUV } },
-	{ MEDIA_BUS_FMT_UYVY8_1X16, { 16, "UYVY8_1X16", PixelFormatInfo::ColourEncodingYUV } },
-	{ MEDIA_BUS_FMT_VYUY8_1X16, { 16, "VYUY8_1X16", PixelFormatInfo::ColourEncodingYUV } },
-	{ MEDIA_BUS_FMT_YUYV8_1X16, { 16, "YUYV8_1X16", PixelFormatInfo::ColourEncodingYUV } },
-	{ MEDIA_BUS_FMT_YVYU8_1X16, { 16, "YVYU8_1X16", PixelFormatInfo::ColourEncodingYUV } },
-	{ MEDIA_BUS_FMT_YDYUYDYV8_1X16, { 16, "YDYUYDYV8_1X16", PixelFormatInfo::ColourEncodingYUV } },
-	{ MEDIA_BUS_FMT_UYVY10_1X20, { 20, "UYVY10_1X20", PixelFormatInfo::ColourEncodingYUV } },
-	{ MEDIA_BUS_FMT_VYUY10_1X20, { 20, "VYUY10_1X20", PixelFormatInfo::ColourEncodingYUV } },
-	{ MEDIA_BUS_FMT_YUYV10_1X20, { 20, "YUYV10_1X20", PixelFormatInfo::ColourEncodingYUV } },
-	{ MEDIA_BUS_FMT_YVYU10_1X20, { 20, "YVYU10_1X20", PixelFormatInfo::ColourEncodingYUV } },
-	{ MEDIA_BUS_FMT_YUV8_1X24, { 24, "YUV8_1X24", PixelFormatInfo::ColourEncodingYUV } },
-	{ MEDIA_BUS_FMT_YUV10_1X30, { 30, "YUV10_1X30", PixelFormatInfo::ColourEncodingYUV } },
-	{ MEDIA_BUS_FMT_AYUV8_1X32, { 32, "AYUV8_1X32", PixelFormatInfo::ColourEncodingYUV } },
-	{ MEDIA_BUS_FMT_UYVY12_2X12, { 24, "UYVY12_2X12", PixelFormatInfo::ColourEncodingYUV } },
-	{ MEDIA_BUS_FMT_VYUY12_2X12, { 24, "VYUY12_2X12", PixelFormatInfo::ColourEncodingYUV } },
-	{ MEDIA_BUS_FMT_YUYV12_2X12, { 24, "YUYV12_2X12", PixelFormatInfo::ColourEncodingYUV } },
-	{ MEDIA_BUS_FMT_YVYU12_2X12, { 24, "YVYU12_2X12", PixelFormatInfo::ColourEncodingYUV } },
-	{ MEDIA_BUS_FMT_UYVY12_1X24, { 24, "UYVY12_1X24", PixelFormatInfo::ColourEncodingYUV } },
-	{ MEDIA_BUS_FMT_VYUY12_1X24, { 24, "VYUY12_1X24", PixelFormatInfo::ColourEncodingYUV } },
-	{ MEDIA_BUS_FMT_YUYV12_1X24, { 24, "YUYV12_1X24", PixelFormatInfo::ColourEncodingYUV } },
-	{ MEDIA_BUS_FMT_YVYU12_1X24, { 24, "YVYU12_1X24", PixelFormatInfo::ColourEncodingYUV } },
-	{ MEDIA_BUS_FMT_SBGGR8_1X8, { 8, "SBGGR8_1X8", PixelFormatInfo::ColourEncodingRAW } },
-	{ MEDIA_BUS_FMT_SGBRG8_1X8, { 8, "SGBRG8_1X8", PixelFormatInfo::ColourEncodingRAW } },
-	{ MEDIA_BUS_FMT_SGRBG8_1X8, { 8, "SGRBG8_1X8", PixelFormatInfo::ColourEncodingRAW } },
-	{ MEDIA_BUS_FMT_SRGGB8_1X8, { 8, "SRGGB8_1X8", PixelFormatInfo::ColourEncodingRAW } },
-	{ MEDIA_BUS_FMT_SBGGR10_ALAW8_1X8, { 8, "SBGGR10_ALAW8_1X8", PixelFormatInfo::ColourEncodingRAW } },
-	{ MEDIA_BUS_FMT_SGBRG10_ALAW8_1X8, { 8, "SGBRG10_ALAW8_1X8", PixelFormatInfo::ColourEncodingRAW } },
-	{ MEDIA_BUS_FMT_SGRBG10_ALAW8_1X8, { 8, "SGRBG10_ALAW8_1X8", PixelFormatInfo::ColourEncodingRAW } },
-	{ MEDIA_BUS_FMT_SRGGB10_ALAW8_1X8, { 8, "SRGGB10_ALAW8_1X8", PixelFormatInfo::ColourEncodingRAW } },
-	{ MEDIA_BUS_FMT_SBGGR10_DPCM8_1X8, { 8, "SBGGR10_DPCM8_1X8", PixelFormatInfo::ColourEncodingRAW } },
-	{ MEDIA_BUS_FMT_SGBRG10_DPCM8_1X8, { 8, "SGBRG10_DPCM8_1X8", PixelFormatInfo::ColourEncodingRAW } },
-	{ MEDIA_BUS_FMT_SGRBG10_DPCM8_1X8, { 8, "SGRBG10_DPCM8_1X8", PixelFormatInfo::ColourEncodingRAW } },
-	{ MEDIA_BUS_FMT_SRGGB10_DPCM8_1X8, { 8, "SRGGB10_DPCM8_1X8", PixelFormatInfo::ColourEncodingRAW } },
-	{ MEDIA_BUS_FMT_SBGGR10_2X8_PADHI_BE, { 16, "SBGGR10_2X8_PADHI_BE", PixelFormatInfo::ColourEncodingRAW } },
-	{ MEDIA_BUS_FMT_SBGGR10_2X8_PADHI_LE, { 16, "SBGGR10_2X8_PADHI_LE", PixelFormatInfo::ColourEncodingRAW } },
-	{ MEDIA_BUS_FMT_SBGGR10_2X8_PADLO_BE, { 16, "SBGGR10_2X8_PADLO_BE", PixelFormatInfo::ColourEncodingRAW } },
-	{ MEDIA_BUS_FMT_SBGGR10_2X8_PADLO_LE, { 16, "SBGGR10_2X8_PADLO_LE", PixelFormatInfo::ColourEncodingRAW } },
-	{ MEDIA_BUS_FMT_SBGGR10_1X10, { 10, "SBGGR10_1X10", PixelFormatInfo::ColourEncodingRAW } },
-	{ MEDIA_BUS_FMT_SGBRG10_1X10, { 10, "SGBRG10_1X10", PixelFormatInfo::ColourEncodingRAW } },
-	{ MEDIA_BUS_FMT_SGRBG10_1X10, { 10, "SGRBG10_1X10", PixelFormatInfo::ColourEncodingRAW } },
-	{ MEDIA_BUS_FMT_SRGGB10_1X10, { 10, "SRGGB10_1X10", PixelFormatInfo::ColourEncodingRAW } },
-	{ MEDIA_BUS_FMT_SBGGR12_1X12, { 12, "SBGGR12_1X12", PixelFormatInfo::ColourEncodingRAW } },
-	{ MEDIA_BUS_FMT_SGBRG12_1X12, { 12, "SGBRG12_1X12", PixelFormatInfo::ColourEncodingRAW } },
-	{ MEDIA_BUS_FMT_SGRBG12_1X12, { 12, "SGRBG12_1X12", PixelFormatInfo::ColourEncodingRAW } },
-	{ MEDIA_BUS_FMT_SRGGB12_1X12, { 12, "SRGGB12_1X12", PixelFormatInfo::ColourEncodingRAW } },
-	{ MEDIA_BUS_FMT_SBGGR14_1X14, { 14, "SBGGR14_1X14", PixelFormatInfo::ColourEncodingRAW } },
-	{ MEDIA_BUS_FMT_SGBRG14_1X14, { 14, "SGBRG14_1X14", PixelFormatInfo::ColourEncodingRAW } },
-	{ MEDIA_BUS_FMT_SGRBG14_1X14, { 14, "SGRBG14_1X14", PixelFormatInfo::ColourEncodingRAW } },
-	{ MEDIA_BUS_FMT_SRGGB14_1X14, { 14, "SRGGB14_1X14", PixelFormatInfo::ColourEncodingRAW } },
+	{ MEDIA_BUS_FMT_RGB444_2X8_PADHI_BE, {
+		.name = "RGB444_2X8_PADHI_BE",
+		.code = MEDIA_BUS_FMT_RGB444_2X8_PADHI_BE,
+		.bitsPerPixel = 16,
+		.colourEncoding = PixelFormatInfo::ColourEncodingRGB,
+	} },
+	{ MEDIA_BUS_FMT_RGB444_2X8_PADHI_LE, {
+		.name = "RGB444_2X8_PADHI_LE",
+		.code = MEDIA_BUS_FMT_RGB444_2X8_PADHI_LE,
+		.bitsPerPixel = 16,
+		.colourEncoding = PixelFormatInfo::ColourEncodingRGB,
+	} },
+	{ MEDIA_BUS_FMT_RGB555_2X8_PADHI_BE, {
+		.name = "RGB555_2X8_PADHI_BE",
+		.code = MEDIA_BUS_FMT_RGB555_2X8_PADHI_BE,
+		.bitsPerPixel = 16,
+		.colourEncoding = PixelFormatInfo::ColourEncodingRGB,
+	} },
+	{ MEDIA_BUS_FMT_RGB555_2X8_PADHI_LE, {
+		.name = "RGB555_2X8_PADHI_LE",
+		.code = MEDIA_BUS_FMT_RGB555_2X8_PADHI_LE,
+		.bitsPerPixel = 16,
+		.colourEncoding = PixelFormatInfo::ColourEncodingRGB,
+	} },
+	{ MEDIA_BUS_FMT_RGB565_1X16, {
+		.name = "RGB565_1X16",
+		.code = MEDIA_BUS_FMT_RGB565_1X16,
+		.bitsPerPixel = 16,
+		.colourEncoding = PixelFormatInfo::ColourEncodingRGB,
+	} },
+	{ MEDIA_BUS_FMT_BGR565_2X8_BE, {
+		.name = "BGR565_2X8_BE",
+		.code = MEDIA_BUS_FMT_BGR565_2X8_BE,
+		.bitsPerPixel = 16,
+		.colourEncoding = PixelFormatInfo::ColourEncodingRGB,
+	} },
+	{ MEDIA_BUS_FMT_BGR565_2X8_LE, {
+		.name = "BGR565_2X8_LE",
+		.code = MEDIA_BUS_FMT_BGR565_2X8_LE,
+		.bitsPerPixel = 16,
+		.colourEncoding = PixelFormatInfo::ColourEncodingRGB,
+	} },
+	{ MEDIA_BUS_FMT_RGB565_2X8_BE, {
+		.name = "RGB565_2X8_BE",
+		.code = MEDIA_BUS_FMT_RGB565_2X8_BE,
+		.bitsPerPixel = 16,
+		.colourEncoding = PixelFormatInfo::ColourEncodingRGB,
+	} },
+	{ MEDIA_BUS_FMT_RGB565_2X8_LE, {
+		.name = "RGB565_2X8_LE",
+		.code = MEDIA_BUS_FMT_RGB565_2X8_LE,
+		.bitsPerPixel = 16,
+		.colourEncoding = PixelFormatInfo::ColourEncodingRGB,
+	} },
+	{ MEDIA_BUS_FMT_RGB666_1X18, {
+		.name = "RGB666_1X18",
+		.code = MEDIA_BUS_FMT_RGB666_1X18,
+		.bitsPerPixel = 18,
+		.colourEncoding = PixelFormatInfo::ColourEncodingRGB,
+	} },
+	{ MEDIA_BUS_FMT_BGR888_1X24, {
+		.name = "BGR888_1X24",
+		.code = MEDIA_BUS_FMT_BGR888_1X24,
+		.bitsPerPixel = 24,
+		.colourEncoding = PixelFormatInfo::ColourEncodingRGB,
+	} },
+	{ MEDIA_BUS_FMT_RGB888_1X24, {
+		.name = "RGB888_1X24",
+		.code = MEDIA_BUS_FMT_RGB888_1X24,
+		.bitsPerPixel = 24,
+		.colourEncoding = PixelFormatInfo::ColourEncodingRGB,
+	} },
+	{ MEDIA_BUS_FMT_RGB888_2X12_BE, {
+		.name = "RGB888_2X12_BE",
+		.code = MEDIA_BUS_FMT_RGB888_2X12_BE,
+		.bitsPerPixel = 24,
+		.colourEncoding = PixelFormatInfo::ColourEncodingRGB,
+	} },
+	{ MEDIA_BUS_FMT_RGB888_2X12_LE, {
+		.name = "RGB888_2X12_LE",
+		.code = MEDIA_BUS_FMT_RGB888_2X12_LE,
+		.bitsPerPixel = 24,
+		.colourEncoding = PixelFormatInfo::ColourEncodingRGB,
+	} },
+	{ MEDIA_BUS_FMT_ARGB8888_1X32, {
+		.name = "ARGB8888_1X32",
+		.code = MEDIA_BUS_FMT_ARGB8888_1X32,
+		.bitsPerPixel = 32,
+		.colourEncoding = PixelFormatInfo::ColourEncodingRGB,
+	} },
+	{ MEDIA_BUS_FMT_Y8_1X8, {
+		.name = "Y8_1X8",
+		.code = MEDIA_BUS_FMT_Y8_1X8,
+		.bitsPerPixel = 8,
+		.colourEncoding = PixelFormatInfo::ColourEncodingYUV,
+	} },
+	{ MEDIA_BUS_FMT_UV8_1X8, {
+		.name = "UV8_1X8",
+		.code = MEDIA_BUS_FMT_UV8_1X8,
+		.bitsPerPixel = 8,
+		.colourEncoding = PixelFormatInfo::ColourEncodingYUV,
+	} },
+	{ MEDIA_BUS_FMT_UYVY8_1_5X8, {
+		.name = "UYVY8_1_5X8",
+		.code = MEDIA_BUS_FMT_UYVY8_1_5X8,
+		.bitsPerPixel = 12,
+		.colourEncoding = PixelFormatInfo::ColourEncodingYUV,
+	} },
+	{ MEDIA_BUS_FMT_VYUY8_1_5X8, {
+		.name = "VYUY8_1_5X8",
+		.code = MEDIA_BUS_FMT_VYUY8_1_5X8,
+		.bitsPerPixel = 12,
+		.colourEncoding = PixelFormatInfo::ColourEncodingYUV,
+	} },
+	{ MEDIA_BUS_FMT_YUYV8_1_5X8, {
+		.name = "YUYV8_1_5X8",
+		.code = MEDIA_BUS_FMT_YUYV8_1_5X8,
+		.bitsPerPixel = 12,
+		.colourEncoding = PixelFormatInfo::ColourEncodingYUV,
+	} },
+	{ MEDIA_BUS_FMT_YVYU8_1_5X8, {
+		.name = "YVYU8_1_5X8",
+		.code = MEDIA_BUS_FMT_YVYU8_1_5X8,
+		.bitsPerPixel = 12,
+		.colourEncoding = PixelFormatInfo::ColourEncodingYUV,
+	} },
+	{ MEDIA_BUS_FMT_UYVY8_2X8, {
+		.name = "UYVY8_2X8",
+		.code = MEDIA_BUS_FMT_UYVY8_2X8,
+		.bitsPerPixel = 16,
+		.colourEncoding = PixelFormatInfo::ColourEncodingYUV,
+	} },
+	{ MEDIA_BUS_FMT_VYUY8_2X8, {
+		.name = "VYUY8_2X8",
+		.code = MEDIA_BUS_FMT_VYUY8_2X8,
+		.bitsPerPixel = 16,
+		.colourEncoding = PixelFormatInfo::ColourEncodingYUV,
+	} },
+	{ MEDIA_BUS_FMT_YUYV8_2X8, {
+		.name = "YUYV8_2X8",
+		.code = MEDIA_BUS_FMT_YUYV8_2X8,
+		.bitsPerPixel = 16,
+		.colourEncoding = PixelFormatInfo::ColourEncodingYUV,
+	} },
+	{ MEDIA_BUS_FMT_YVYU8_2X8, {
+		.name = "YVYU8_2X8",
+		.code = MEDIA_BUS_FMT_YVYU8_2X8,
+		.bitsPerPixel = 16,
+		.colourEncoding = PixelFormatInfo::ColourEncodingYUV,
+	} },
+	{ MEDIA_BUS_FMT_Y10_1X10, {
+		.name = "Y10_1X10",
+		.code = MEDIA_BUS_FMT_Y10_1X10,
+		.bitsPerPixel = 10,
+		.colourEncoding = PixelFormatInfo::ColourEncodingYUV,
+	} },
+	{ MEDIA_BUS_FMT_UYVY10_2X10, {
+		.name = "UYVY10_2X10",
+		.code = MEDIA_BUS_FMT_UYVY10_2X10,
+		.bitsPerPixel = 20,
+		.colourEncoding = PixelFormatInfo::ColourEncodingYUV,
+	} },
+	{ MEDIA_BUS_FMT_VYUY10_2X10, {
+		.name = "VYUY10_2X10",
+		.code = MEDIA_BUS_FMT_VYUY10_2X10,
+		.bitsPerPixel = 20,
+		.colourEncoding = PixelFormatInfo::ColourEncodingYUV,
+	} },
+	{ MEDIA_BUS_FMT_YUYV10_2X10, {
+		.name = "YUYV10_2X10",
+		.code = MEDIA_BUS_FMT_YUYV10_2X10,
+		.bitsPerPixel = 20,
+		.colourEncoding = PixelFormatInfo::ColourEncodingYUV,
+	} },
+	{ MEDIA_BUS_FMT_YVYU10_2X10, {
+		.name = "YVYU10_2X10",
+		.code = MEDIA_BUS_FMT_YVYU10_2X10,
+		.bitsPerPixel = 20,
+		.colourEncoding = PixelFormatInfo::ColourEncodingYUV,
+	} },
+	{ MEDIA_BUS_FMT_Y12_1X12, {
+		.name = "Y12_1X12",
+		.code = MEDIA_BUS_FMT_Y12_1X12,
+		.bitsPerPixel = 12,
+		.colourEncoding = PixelFormatInfo::ColourEncodingYUV,
+	} },
+	{ MEDIA_BUS_FMT_Y16_1X16, {
+		.name = "Y16_1X16",
+		.code = MEDIA_BUS_FMT_Y16_1X16,
+		.bitsPerPixel = 16,
+		.colourEncoding = PixelFormatInfo::ColourEncodingYUV,
+	} },
+	{ MEDIA_BUS_FMT_UYVY8_1X16, {
+		.name = "UYVY8_1X16",
+		.code = MEDIA_BUS_FMT_UYVY8_1X16,
+		.bitsPerPixel = 16,
+		.colourEncoding = PixelFormatInfo::ColourEncodingYUV,
+	} },
+	{ MEDIA_BUS_FMT_VYUY8_1X16, {
+		.name = "VYUY8_1X16",
+		.code = MEDIA_BUS_FMT_VYUY8_1X16,
+		.bitsPerPixel = 16,
+		.colourEncoding = PixelFormatInfo::ColourEncodingYUV,
+	} },
+	{ MEDIA_BUS_FMT_YUYV8_1X16, {
+		.name = "YUYV8_1X16",
+		.code = MEDIA_BUS_FMT_YUYV8_1X16,
+		.bitsPerPixel = 16,
+		.colourEncoding = PixelFormatInfo::ColourEncodingYUV,
+	} },
+	{ MEDIA_BUS_FMT_YVYU8_1X16, {
+		.name = "YVYU8_1X16",
+		.code = MEDIA_BUS_FMT_YVYU8_1X16,
+		.bitsPerPixel = 16,
+		.colourEncoding = PixelFormatInfo::ColourEncodingYUV,
+	} },
+	{ MEDIA_BUS_FMT_YDYUYDYV8_1X16, {
+		.name = "YDYUYDYV8_1X16",
+		.code = MEDIA_BUS_FMT_YDYUYDYV8_1X16,
+		.bitsPerPixel = 16,
+		.colourEncoding = PixelFormatInfo::ColourEncodingYUV,
+	} },
+	{ MEDIA_BUS_FMT_UYVY10_1X20, {
+		.name = "UYVY10_1X20",
+		.code = MEDIA_BUS_FMT_UYVY10_1X20,
+		.bitsPerPixel = 20,
+		.colourEncoding = PixelFormatInfo::ColourEncodingYUV,
+	} },
+	{ MEDIA_BUS_FMT_VYUY10_1X20, {
+		.name = "VYUY10_1X20",
+		.code = MEDIA_BUS_FMT_VYUY10_1X20,
+		.bitsPerPixel = 20,
+		.colourEncoding = PixelFormatInfo::ColourEncodingYUV,
+	} },
+	{ MEDIA_BUS_FMT_YUYV10_1X20, {
+		.name = "YUYV10_1X20",
+		.code = MEDIA_BUS_FMT_YUYV10_1X20,
+		.bitsPerPixel = 20,
+		.colourEncoding = PixelFormatInfo::ColourEncodingYUV,
+	} },
+	{ MEDIA_BUS_FMT_YVYU10_1X20, {
+		.name = "YVYU10_1X20",
+		.code = MEDIA_BUS_FMT_YVYU10_1X20,
+		.bitsPerPixel = 20,
+		.colourEncoding = PixelFormatInfo::ColourEncodingYUV,
+	} },
+	{ MEDIA_BUS_FMT_YUV8_1X24, {
+		.name = "YUV8_1X24",
+		.code = MEDIA_BUS_FMT_YUV8_1X24,
+		.bitsPerPixel = 24,
+		.colourEncoding = PixelFormatInfo::ColourEncodingYUV,
+	} },
+	{ MEDIA_BUS_FMT_YUV10_1X30, {
+		.name = "YUV10_1X30",
+		.code = MEDIA_BUS_FMT_YUV10_1X30,
+		.bitsPerPixel = 30,
+		.colourEncoding = PixelFormatInfo::ColourEncodingYUV,
+	} },
+	{ MEDIA_BUS_FMT_AYUV8_1X32, {
+		.name = "AYUV8_1X32",
+		.code = MEDIA_BUS_FMT_AYUV8_1X32,
+		.bitsPerPixel = 32,
+		.colourEncoding = PixelFormatInfo::ColourEncodingYUV,
+	} },
+	{ MEDIA_BUS_FMT_UYVY12_2X12, {
+		.name = "UYVY12_2X12",
+		.code = MEDIA_BUS_FMT_UYVY12_2X12,
+		.bitsPerPixel = 24,
+		.colourEncoding = PixelFormatInfo::ColourEncodingYUV,
+	} },
+	{ MEDIA_BUS_FMT_VYUY12_2X12, {
+		.name = "VYUY12_2X12",
+		.code = MEDIA_BUS_FMT_VYUY12_2X12,
+		.bitsPerPixel = 24,
+		.colourEncoding = PixelFormatInfo::ColourEncodingYUV,
+	} },
+	{ MEDIA_BUS_FMT_YUYV12_2X12, {
+		.name = "YUYV12_2X12",
+		.code = MEDIA_BUS_FMT_YUYV12_2X12,
+		.bitsPerPixel = 24,
+		.colourEncoding = PixelFormatInfo::ColourEncodingYUV,
+	} },
+	{ MEDIA_BUS_FMT_YVYU12_2X12, {
+		.name = "YVYU12_2X12",
+		.code = MEDIA_BUS_FMT_YVYU12_2X12,
+		.bitsPerPixel = 24,
+		.colourEncoding = PixelFormatInfo::ColourEncodingYUV,
+	} },
+	{ MEDIA_BUS_FMT_UYVY12_1X24, {
+		.name = "UYVY12_1X24",
+		.code = MEDIA_BUS_FMT_UYVY12_1X24,
+		.bitsPerPixel = 24,
+		.colourEncoding = PixelFormatInfo::ColourEncodingYUV,
+	} },
+	{ MEDIA_BUS_FMT_VYUY12_1X24, {
+		.name = "VYUY12_1X24",
+		.code = MEDIA_BUS_FMT_VYUY12_1X24,
+		.bitsPerPixel = 24,
+		.colourEncoding = PixelFormatInfo::ColourEncodingYUV,
+	} },
+	{ MEDIA_BUS_FMT_YUYV12_1X24, {
+		.name = "YUYV12_1X24",
+		.code = MEDIA_BUS_FMT_YUYV12_1X24,
+		.bitsPerPixel = 24,
+		.colourEncoding = PixelFormatInfo::ColourEncodingYUV,
+	} },
+	{ MEDIA_BUS_FMT_YVYU12_1X24, {
+		.name = "YVYU12_1X24",
+		.code = MEDIA_BUS_FMT_YVYU12_1X24,
+		.bitsPerPixel = 24,
+		.colourEncoding = PixelFormatInfo::ColourEncodingYUV,
+	} },
+	{ MEDIA_BUS_FMT_SBGGR8_1X8, {
+		.name = "SBGGR8_1X8",
+		.code = MEDIA_BUS_FMT_SBGGR8_1X8,
+		.bitsPerPixel = 8,
+		.colourEncoding = PixelFormatInfo::ColourEncodingRAW,
+	} },
+	{ MEDIA_BUS_FMT_SGBRG8_1X8, {
+		.name = "SGBRG8_1X8",
+		.code = MEDIA_BUS_FMT_SGBRG8_1X8,
+		.bitsPerPixel = 8,
+		.colourEncoding = PixelFormatInfo::ColourEncodingRAW,
+	} },
+	{ MEDIA_BUS_FMT_SGRBG8_1X8, {
+		.name = "SGRBG8_1X8",
+		.code = MEDIA_BUS_FMT_SGRBG8_1X8,
+		.bitsPerPixel = 8,
+		.colourEncoding = PixelFormatInfo::ColourEncodingRAW,
+	} },
+	{ MEDIA_BUS_FMT_SRGGB8_1X8, {
+		.name = "SRGGB8_1X8",
+		.code = MEDIA_BUS_FMT_SRGGB8_1X8,
+		.bitsPerPixel = 8,
+		.colourEncoding = PixelFormatInfo::ColourEncodingRAW,
+	} },
+	{ MEDIA_BUS_FMT_SBGGR10_ALAW8_1X8, {
+		.name = "SBGGR10_ALAW8_1X8",
+		.code = MEDIA_BUS_FMT_SBGGR10_ALAW8_1X8,
+		.bitsPerPixel = 8,
+		.colourEncoding = PixelFormatInfo::ColourEncodingRAW,
+	} },
+	{ MEDIA_BUS_FMT_SGBRG10_ALAW8_1X8, {
+		.name = "SGBRG10_ALAW8_1X8",
+		.code = MEDIA_BUS_FMT_SGBRG10_ALAW8_1X8,
+		.bitsPerPixel = 8,
+		.colourEncoding = PixelFormatInfo::ColourEncodingRAW,
+	} },
+	{ MEDIA_BUS_FMT_SGRBG10_ALAW8_1X8, {
+		.name = "SGRBG10_ALAW8_1X8",
+		.code = MEDIA_BUS_FMT_SGRBG10_ALAW8_1X8,
+		.bitsPerPixel = 8,
+		.colourEncoding = PixelFormatInfo::ColourEncodingRAW,
+	} },
+	{ MEDIA_BUS_FMT_SRGGB10_ALAW8_1X8, {
+		.name = "SRGGB10_ALAW8_1X8",
+		.code = MEDIA_BUS_FMT_SRGGB10_ALAW8_1X8,
+		.bitsPerPixel = 8,
+		.colourEncoding = PixelFormatInfo::ColourEncodingRAW,
+	} },
+	{ MEDIA_BUS_FMT_SBGGR10_DPCM8_1X8, {
+		.name = "SBGGR10_DPCM8_1X8",
+		.code = MEDIA_BUS_FMT_SBGGR10_DPCM8_1X8,
+		.bitsPerPixel = 8,
+		.colourEncoding = PixelFormatInfo::ColourEncodingRAW,
+	} },
+	{ MEDIA_BUS_FMT_SGBRG10_DPCM8_1X8, {
+		.name = "SGBRG10_DPCM8_1X8",
+		.code = MEDIA_BUS_FMT_SGBRG10_DPCM8_1X8,
+		.bitsPerPixel = 8,
+		.colourEncoding = PixelFormatInfo::ColourEncodingRAW,
+	} },
+	{ MEDIA_BUS_FMT_SGRBG10_DPCM8_1X8, {
+		.name = "SGRBG10_DPCM8_1X8",
+		.code = MEDIA_BUS_FMT_SGRBG10_DPCM8_1X8,
+		.bitsPerPixel = 8,
+		.colourEncoding = PixelFormatInfo::ColourEncodingRAW,
+	} },
+	{ MEDIA_BUS_FMT_SRGGB10_DPCM8_1X8, {
+		.name = "SRGGB10_DPCM8_1X8",
+		.code = MEDIA_BUS_FMT_SRGGB10_DPCM8_1X8,
+		.bitsPerPixel = 8,
+		.colourEncoding = PixelFormatInfo::ColourEncodingRAW,
+	} },
+	{ MEDIA_BUS_FMT_SBGGR10_2X8_PADHI_BE, {
+		.name = "SBGGR10_2X8_PADHI_BE",
+		.code = MEDIA_BUS_FMT_SBGGR10_2X8_PADHI_BE,
+		.bitsPerPixel = 16,
+		.colourEncoding = PixelFormatInfo::ColourEncodingRAW,
+	} },
+	{ MEDIA_BUS_FMT_SBGGR10_2X8_PADHI_LE, {
+		.name = "SBGGR10_2X8_PADHI_LE",
+		.code = MEDIA_BUS_FMT_SBGGR10_2X8_PADHI_LE,
+		.bitsPerPixel = 16,
+		.colourEncoding = PixelFormatInfo::ColourEncodingRAW,
+	} },
+	{ MEDIA_BUS_FMT_SBGGR10_2X8_PADLO_BE, {
+		.name = "SBGGR10_2X8_PADLO_BE",
+		.code = MEDIA_BUS_FMT_SBGGR10_2X8_PADLO_BE,
+		.bitsPerPixel = 16,
+		.colourEncoding = PixelFormatInfo::ColourEncodingRAW,
+	} },
+	{ MEDIA_BUS_FMT_SBGGR10_2X8_PADLO_LE, {
+		.name = "SBGGR10_2X8_PADLO_LE",
+		.code = MEDIA_BUS_FMT_SBGGR10_2X8_PADLO_LE,
+		.bitsPerPixel = 16,
+		.colourEncoding = PixelFormatInfo::ColourEncodingRAW,
+	} },
+	{ MEDIA_BUS_FMT_SBGGR10_1X10, {
+		.name = "SBGGR10_1X10",
+		.code = MEDIA_BUS_FMT_SBGGR10_1X10,
+		.bitsPerPixel = 10,
+		.colourEncoding = PixelFormatInfo::ColourEncodingRAW,
+	} },
+	{ MEDIA_BUS_FMT_SGBRG10_1X10, {
+		.name = "SGBRG10_1X10",
+		.code = MEDIA_BUS_FMT_SGBRG10_1X10,
+		.bitsPerPixel = 10,
+		.colourEncoding = PixelFormatInfo::ColourEncodingRAW,
+	} },
+	{ MEDIA_BUS_FMT_SGRBG10_1X10, {
+		.name = "SGRBG10_1X10",
+		.code = MEDIA_BUS_FMT_SGRBG10_1X10,
+		.bitsPerPixel = 10,
+		.colourEncoding = PixelFormatInfo::ColourEncodingRAW,
+	} },
+	{ MEDIA_BUS_FMT_SRGGB10_1X10, {
+		.name = "SRGGB10_1X10",
+		.code = MEDIA_BUS_FMT_SRGGB10_1X10,
+		.bitsPerPixel = 10,
+		.colourEncoding = PixelFormatInfo::ColourEncodingRAW,
+	} },
+	{ MEDIA_BUS_FMT_SBGGR12_1X12, {
+		.name = "SBGGR12_1X12",
+		.code = MEDIA_BUS_FMT_SBGGR12_1X12,
+		.bitsPerPixel = 12,
+		.colourEncoding = PixelFormatInfo::ColourEncodingRAW,
+	} },
+	{ MEDIA_BUS_FMT_SGBRG12_1X12, {
+		.name = "SGBRG12_1X12",
+		.code = MEDIA_BUS_FMT_SGBRG12_1X12,
+		.bitsPerPixel = 12,
+		.colourEncoding = PixelFormatInfo::ColourEncodingRAW,
+	} },
+	{ MEDIA_BUS_FMT_SGRBG12_1X12, {
+		.name = "SGRBG12_1X12",
+		.code = MEDIA_BUS_FMT_SGRBG12_1X12,
+		.bitsPerPixel = 12,
+		.colourEncoding = PixelFormatInfo::ColourEncodingRAW,
+	} },
+	{ MEDIA_BUS_FMT_SRGGB12_1X12, {
+		.name = "SRGGB12_1X12",
+		.code = MEDIA_BUS_FMT_SRGGB12_1X12,
+		.bitsPerPixel = 12,
+		.colourEncoding = PixelFormatInfo::ColourEncodingRAW,
+	} },
+	{ MEDIA_BUS_FMT_SBGGR14_1X14, {
+		.name = "SBGGR14_1X14",
+		.code = MEDIA_BUS_FMT_SBGGR14_1X14,
+		.bitsPerPixel = 14,
+		.colourEncoding = PixelFormatInfo::ColourEncodingRAW,
+	} },
+	{ MEDIA_BUS_FMT_SGBRG14_1X14, {
+		.name = "SGBRG14_1X14",
+		.code = MEDIA_BUS_FMT_SGBRG14_1X14,
+		.bitsPerPixel = 14,
+		.colourEncoding = PixelFormatInfo::ColourEncodingRAW,
+	} },
+	{ MEDIA_BUS_FMT_SGRBG14_1X14, {
+		.name = "SGRBG14_1X14",
+		.code = MEDIA_BUS_FMT_SGRBG14_1X14,
+		.bitsPerPixel = 14,
+		.colourEncoding = PixelFormatInfo::ColourEncodingRAW,
+	} },
+	{ MEDIA_BUS_FMT_SRGGB14_1X14, {
+		.name = "SRGGB14_1X14",
+		.code = MEDIA_BUS_FMT_SRGGB14_1X14,
+		.bitsPerPixel = 14,
+		.colourEncoding = PixelFormatInfo::ColourEncodingRAW,
+	} },
 	/* \todo Clarify colour encoding for HSV formats */
-	{ MEDIA_BUS_FMT_AHSV8888_1X32, { 32, "AHSV8888_1X32", PixelFormatInfo::ColourEncodingRGB } },
-	{ MEDIA_BUS_FMT_JPEG_1X8, { 8, "JPEG_1X8", PixelFormatInfo::ColourEncodingYUV } },
+	{ MEDIA_BUS_FMT_AHSV8888_1X32, {
+		.name = "AHSV8888_1X32",
+		.code = MEDIA_BUS_FMT_AHSV8888_1X32,
+		.bitsPerPixel = 32,
+		.colourEncoding = PixelFormatInfo::ColourEncodingRGB,
+	} },
+	{ MEDIA_BUS_FMT_JPEG_1X8, {
+		.name = "JPEG_1X8",
+		.code = MEDIA_BUS_FMT_JPEG_1X8,
+		.bitsPerPixel = 8,
+		.colourEncoding = PixelFormatInfo::ColourEncodingYUV,
+	} },
 };
 
 } /* namespace */