libcamera v0.6.0 Supporting cameras in Linux since 2019

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

Configuration parameters for a stream. More...

Collaboration diagram for libcamera::StreamConfiguration:
[legend]

## Public Member Functions
| StreamConfiguration ()
| StreamConfiguration (const StreamFormats &formats)
| Construct a configuration with stream formats.
Stream * | stream () const
| Retrieve the stream associated with the configuration.
void | setStream (Stream *stream)
| Associate a stream with a configuration.
const StreamFormats & | formats () const
| Retrieve advisory stream format information.
std::string | toString () const
| Assemble and return a string describing the configuration.

## Public Attributes
PixelFormat | pixelFormat
| Stream pixel format.
Size | size
| Stream size in pixels.
unsigned int | stride
| Image stride for the stream, in bytes.
unsigned int | frameSize
| Frame size for the stream, in bytes.
unsigned int | bufferCount
| Requested number of buffers to allocate for the stream.
std::optional< ColorSpace > | colorSpace
| The ColorSpace for this stream.

## Detailed Description

Configuration parameters for a stream.

The StreamConfiguration structure models all information which can be configured for a single video stream.

## Constructor & Destructor Documentation

## ◆ StreamConfiguration()

libcamera::StreamConfiguration::StreamConfiguration | ( |  | ) |

Todo
  This function is deprecated and should be removed once all pipeline handlers provide StreamFormats.

## Member Function Documentation

## ◆ formats()

const StreamFormats & libcamera::StreamConfiguration::formats | ( |  | ) | const
| inline

Retrieve advisory stream format information.

This function retrieves information about the pixel formats and sizes supported by the stream configuration. The sizes are advisory and not all of them are guaranteed to be supported by the stream. Users shall always inspect the size in the stream configuration after calling CameraConfiguration::validate().

Returns
  Stream formats information

## ◆ setStream()

void libcamera::StreamConfiguration::setStream | ( | Stream * | stream | ) |
| inline

Associate a stream with a configuration.

This function is meant for the PipelineHandler::configure() function and shall not be called by applications.

Parameters

  [in] | stream | The stream

## ◆ stream()

Stream * libcamera::StreamConfiguration::stream | ( |  | ) | const
| inline

Retrieve the stream associated with the configuration.

When a camera is configured with Camera::configure() Stream instances are associated with each stream configuration entry. This function retrieves the associated Stream, which remains valid until the next call to Camera::configure() or Camera::release().

Returns
  The stream associated with the configuration

## ◆ toString()

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

Assemble and return a string describing the configuration.

Returns
  A string describing the StreamConfiguration

## Member Data Documentation

## ◆ colorSpace

std::optional<ColorSpace> libcamera::StreamConfiguration::colorSpace

The ColorSpace for this stream.

This field allows a ColorSpace to be selected for this Stream.

The field is optional and an application can choose to leave it unset. Platforms that support the use of color spaces may provide default values through the generateConfiguration() method. An application can override these when necessary.

If a specific ColorSpace is requested but the Camera cannot deliver it, then the StreamConfiguration will be adjusted to a value that can be delivered. In this case the validate() method will indicate via its return value that the CameraConfiguration has been adjusted.

Note that platforms will typically have different constraints on what color spaces can be supported and in what combinations.

## ◆ frameSize

unsigned int libcamera::StreamConfiguration::frameSize

Frame size for the stream, in bytes.

The frameSize value reports the number of bytes necessary to contain one frame of an image buffer for this stream. This total includes the bytes required for all image planes. The value is valid after successfully validating the configuration with a call to CameraConfiguration::validate().

## ◆ stride

unsigned int libcamera::StreamConfiguration::stride

Image stride for the stream, in bytes.

The stride value reports the number of bytes between the beginning of successive lines in an image buffer for this stream. The value is valid after successfully validating the configuration with a call to CameraConfiguration::validate(). For compressed formats (such as MJPEG), this value will be zero.

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

- include/libcamera/stream.h
- src/libcamera/stream.cpp