libcamera::V4L2SubdeviceFormat Struct Reference

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

## Public Member Functions

const std::string | toString () const
| Assemble and return a string describing the format. More...
uint8_t | bitsPerPixel () const
| Retrieve the number of bits per pixel for the V4L2 subdevice format. More...

## Public Attributes

uint32_t | mbus_code
| The image format bus code.
Size | size
| The image size in 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

## bitsPerPixel()

uint8_t libcamera::V4L2SubdeviceFormat::bitsPerPixel | ( |  | ) | const

Retrieve the number of bits per pixel for the V4L2 subdevice format.

Returns
  The number of bits per pixel for the format, or 0 if the format is not supported

## toString()

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

Assemble and return a string describing the format.

Returns
  A string describing the V4L2SubdeviceFormat

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

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