libcamera: libcamera::V4L2SubdeviceFormat Struct Reference

libcamera v0.7.2 Supporting cameras in Linux since 2019

Loading...
Searching...
No Matches
libcamera::V4L2SubdeviceFormat Struct Reference

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

Collaboration diagram for libcamera::V4L2SubdeviceFormat:
[legend]

## Public Member Functions
std::string | toString () const
| Assemble and return a string describing the format.

## Public Attributes
uint32_t | code
| The image format bus code.
Size | size
| The image size in pixels.
std::optional< ColorSpace > | colorSpace
| The color space of the pixels.

## 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 4.15.3.4.1 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 4.15.3.1 of the above mentioned Linux kernel documentation section.

## Member Function Documentation

## ◆ toString()

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

Assemble and return a string describing the format.

Returns
  A string describing the V4L2SubdeviceFormat

## Member Data Documentation

## ◆ colorSpace

std::optional<ColorSpace> libcamera::V4L2SubdeviceFormat::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:

- include/libcamera/internal/v4l2_subdevice.h
- src/libcamera/v4l2_subdevice.cpp