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 <laurent.pinchart@ideasonboard.com>
Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
This commit is contained in:
Laurent Pinchart 2024-02-26 12:53:01 +02:00
parent d60fb23258
commit 7941903d62
2 changed files with 116 additions and 1 deletions

View file

@ -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;
};