libcamera
v0.3.2+116-83c5ad0f
Supporting cameras in Linux since 2019
|
Configuration parameters for a stream. More...
Public Member Functions | |
StreamConfiguration () | |
StreamConfiguration (const StreamFormats &formats) | |
Construct a configuration with stream formats. | |
Stream * | stream () const |
Retrieve the stream associated with the configuration. More... | |
void | setStream (Stream *stream) |
Associate a stream with a configuration. More... | |
const StreamFormats & | formats () 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< ColorSpace > | colorSpace |
The ColorSpace for this stream. More... | |
Configuration parameters for a stream.
The StreamConfiguration structure models all information which can be configured for a single video stream.
libcamera::StreamConfiguration::StreamConfiguration | ( | ) |
|
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().
|
inline |
Associate a stream with a configuration.
This function is meant for the PipelineHandler::configure() function and shall not be called by applications.
[in] | stream | The stream |
|
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().
std::string libcamera::StreamConfiguration::toString | ( | ) | const |
Assemble and return a string describing the configuration.
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.
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().
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.