4.16. Metadata Interface

Metadata refers to any non-image data that supplements video frames with additional information. This may include statistics computed over the image or frame capture parameters supplied by the image source. This interface is intended for transfer of metadata to userspace and control of that operation.

The metadata interface is implemented on video capture device nodes. The device can be dedicated to metadata or can implement both video and metadata capture as specified in its reported capabilities.

4.16.1. Querying Capabilities

Device nodes supporting the metadata interface set the V4L2_CAP_META_CAPTURE flag in the device_caps field of the v4l2_capability structure returned by the VIDIOC_QUERYCAP() ioctl. That flag means the device can capture metadata to memory.

At least one of the read/write or streaming I/O methods must be supported.

4.16.2. Data Format Negotiation

The metadata device uses the Data Formats ioctls to select the capture format. The metadata buffer content format is bound to that selected format. In addition to the basic Data Formats ioctls, the VIDIOC_ENUM_FMT() ioctl must be supported as well.

To use the Data Formats ioctls applications set the type field of the v4l2_format structure to V4L2_BUF_TYPE_META_CAPTURE and use the v4l2_meta_format meta member of the fmt union as needed per the desired operation. Both drivers and applications must set the remainder of the v4l2_format structure to 0.

struct v4l2_meta_format
__u32 dataformat The data format, set by the application. This is a little endian four character code. V4L2 defines metadata formats in Metadata Formats.
__u32 buffersize Maximum buffer size in bytes required for data. The value is set by the driver.