libcamera  v0.2.0+110-fb74bb7d
Supporting cameras in Linux since 2019
Public Member Functions | Public Attributes | List of all members
libcamera::StreamConfiguration Struct Reference

Configuration parameters for a stream. More...

Collaboration diagram for libcamera::StreamConfiguration:
Collaboration graph
[legend]

Public Member Functions

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

Public Attributes

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

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()

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()

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]streamThe 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

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

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

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: