From 7941903d628a4511fc1cd63ab0df291d70c99bbd Mon Sep 17 00:00:00 2001 From: Laurent Pinchart Date: Mon, 26 Feb 2024 12:53:01 +0200 Subject: libcamera: v4l2_subdevice: Extend MediaBusFormatInfo with metadata formats Not all media bus formats describe image formats. Extend the MediaBusFormatInfo class with a type member to indicate if the format corresponds to image data or metadata, and add the (only) metatdata format supported by the kernel to the known mediaBusFormatInfo. The kernel doesn't (yet) have any metadata format specific to sensor embedded data. This is being addressed in the V4L2 API. In preparation for embedded data support, already introduce the EmbeddedData type here. Corresponding formats will be added when available. Signed-off-by: Laurent Pinchart Reviewed-by: Jacopo Mondi Reviewed-by: Kieran Bingham --- include/libcamera/internal/v4l2_subdevice.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'include') diff --git a/include/libcamera/internal/v4l2_subdevice.h b/include/libcamera/internal/v4l2_subdevice.h index a4df9ddf..c9aa90e0 100644 --- a/include/libcamera/internal/v4l2_subdevice.h +++ b/include/libcamera/internal/v4l2_subdevice.h @@ -32,12 +32,19 @@ class MediaDevice; class MediaBusFormatInfo { public: + enum class Type { + Image, + Metadata, + EmbeddedData, + }; + bool isValid() const { return code != 0; } static const MediaBusFormatInfo &info(uint32_t code); const char *name; uint32_t code; + Type type; unsigned int bitsPerPixel; PixelFormatInfo::ColourEncoding colourEncoding; }; -- cgit v1.2.1