libcamera  v0.2.0+85-1c5830a9
Supporting cameras in Linux since 2019
Public Member Functions | Public Attributes | List of all members
libcamera::V4L2SubdeviceFormat Struct Reference

The V4L2 sub-device image format and sizes. More...

Collaboration diagram for libcamera::V4L2SubdeviceFormat:
Collaboration graph

Public Member Functions

const std::string toString () const
 Assemble and return a string describing the format. More...

Public Attributes

uint32_t code
 The image format bus code.
Size size
 The image size in pixels.
std::optional< ColorSpacecolorSpace
 The color space of the pixels. More...

Detailed Description

The V4L2 sub-device image format and sizes.

This structure describes the format of images when transported between separate components connected through a physical bus, such as image sensor and image receiver or between components part of the same System-on-Chip that realize an image transformation pipeline.

The format of images when transported on physical interconnections is known as the "media bus format", and it is identified by a resolution and a pixel format identification code, known as the "media bus code", not to be confused with the fourcc code that identify the format of images when stored in memory (see V4L2VideoDevice::V4L2DeviceFormat).

Media Bus formats supported by the V4L2 APIs are described in Section of the "Part I - Video for Linux API" chapter of the "Linux Media Infrastructure userspace API", part of the Linux kernel documentation.

Image media bus formats are properties of the subdev pads. When images are transported between two media pads identified by a 0-indexed number, the image bus format configured on the two pads should match (according to the underlying driver format matching criteria) in order to prepare for a successful streaming operation. For a more detailed description of the image format negotiation process when performed between V4L2 subdevices, refer to Section of the above mentioned Linux kernel documentation section.

Member Function Documentation

◆ toString()

const std::string libcamera::V4L2SubdeviceFormat::toString ( ) const

Assemble and return a string describing the format.

A string describing the V4L2SubdeviceFormat

Member Data Documentation

◆ colorSpace


The color space of the pixels.

The color space of the image. When setting the format this may be unset, in which case the driver gets to use its default color space. After being set, this value should contain the color space that was actually used. If this value is unset, then the color space chosen by the driver could not be represented by the ColorSpace class (and should probably be added).

It is up to the pipeline handler or application to check if the resulting color space is acceptable.

The documentation for this struct was generated from the following files: