TVideoStreamInfo

primo::avblocks::modern::TVideoStreamInfo

class TVideoStreamInfo : public primo::avblocks::modern::TStreamInfo<TVideoStreamInfo, primo::codecs::VideoStreamInfo>

Fluent wrapper for primo::codecs::VideoStreamInfo, which describes an elementary video stream.

The properties common to all streams are inherited from TStreamInfo. The setters can be chained; on a temporary they return the object by rvalue reference so that the chain can be returned or moved:

TVideoStreamInfo video = TVideoStreamInfo().frameWidth(352).frameHeight(288).frameRate(25.0);
Owns the raw object through a primo::ref. Not copyable, movable.

Unnamed Group

TVideoStreamInfo(TVideoStreamInfo&&) = default
TVideoStreamInfo &operator=(TVideoStreamInfo&&) = default

Move construction/assignment transfers ownership of the underlying object. The moved-from object no longer wraps anything.

Unnamed Group

inline TVideoStreamInfo &colorFormat(primo::codecs::ColorFormat::Enum format) &
inline TVideoStreamInfo &&colorFormat(primo::codecs::ColorFormat::Enum format) &&

Sets the video color format.

Parameters:

format – A primo::codecs::ColorFormat::Enum constant.

Returns:

This object, for chaining.

Unnamed Group

inline TVideoStreamInfo &frameWidth(int32_t width) &
inline TVideoStreamInfo &&frameWidth(int32_t width) &&

Sets the video frame width.

Parameters:

width – Width in pixels.

Returns:

This object, for chaining.

Unnamed Group

inline TVideoStreamInfo &frameHeight(int32_t height) &
inline TVideoStreamInfo &&frameHeight(int32_t height) &&

Sets the video frame height.

Parameters:

height – Height in pixels.

Returns:

This object, for chaining.

Unnamed Group

inline TVideoStreamInfo &displayRatioWidth(int32_t width) &
inline TVideoStreamInfo &&displayRatioWidth(int32_t width) &&

Sets the horizontal dimension of the display aspect ratio.

The value has no meaning on its own; together with displayRatioHeight() it expresses the ratio.

Parameters:

width – Horizontal ratio.

Returns:

This object, for chaining.

Unnamed Group

inline TVideoStreamInfo &displayRatioHeight(int32_t height) &
inline TVideoStreamInfo &&displayRatioHeight(int32_t height) &&

Sets the vertical dimension of the display aspect ratio.

The value has no meaning on its own; together with displayRatioWidth() it expresses the ratio.

Parameters:

height – Vertical ratio.

Returns:

This object, for chaining.

Unnamed Group

inline TVideoStreamInfo &frameRate(double fps) &
inline TVideoStreamInfo &&frameRate(double fps) &&

Sets the video frame rate.

Parameters:

fps – Frames per second.

Returns:

This object, for chaining.

Unnamed Group

inline TVideoStreamInfo &scanType(primo::codecs::ScanType::Enum scan) &
inline TVideoStreamInfo &&scanType(primo::codecs::ScanType::Enum scan) &&

Sets the scan type of the video frame.

Parameters:

scan – A primo::codecs::ScanType::Enum constant.

Returns:

This object, for chaining.

Unnamed Group

inline TVideoStreamInfo &stride(int32_t stride) &
inline TVideoStreamInfo &&stride(int32_t stride) &&

Sets the image stride (pitch): the distance in bytes from the start of one row of pixels in memory to the start of the next row.

Parameters:

stride – Stride in bytes.

Returns:

This object, for chaining.

Unnamed Group

inline TVideoStreamInfo &frameBottomUp(bool bottomUp) &
inline TVideoStreamInfo &&frameBottomUp(bool bottomUp) &&

Sets whether the frame is stored upside down in memory, as is typical for bitmaps.

Parameters:

bottomUp – true if the frame is stored upside down, false if the top row is first in memory.

Returns:

This object, for chaining.

Public Functions

inline TVideoStreamInfo()

Creates a video stream info with default values.

inline explicit TVideoStreamInfo(primo::ref<primo::codecs::VideoStreamInfo> info)

Takes ownership of an existing VideoStreamInfo reference.

inline explicit TVideoStreamInfo(primo::codecs::VideoStreamInfo *info)

Wraps a non-owned VideoStreamInfo pointer, retaining it. Used by TMediaPin::videoStreamInfo().

TVideoStreamInfo(const TVideoStreamInfo&) = delete
TVideoStreamInfo &operator=(const TVideoStreamInfo&) = delete
inline primo::codecs::ColorFormat::Enum colorFormat() const

Returns the video color format.

inline int32_t frameWidth() const

Returns the video frame width in pixels.

inline int32_t frameHeight() const

Returns the video frame height in pixels.

inline int32_t displayRatioWidth() const

Returns the horizontal dimension of the display aspect ratio.

inline int32_t displayRatioHeight() const

Returns the vertical dimension of the display aspect ratio.

inline double frameRate() const

Returns the video frame rate in frames per second.

inline primo::codecs::ScanType::Enum scanType() const

Returns the scan type of the video frame.

inline int32_t stride() const

Returns the image stride (pitch) in bytes.

inline bool frameBottomUp() const

Returns true if the frame is stored upside down in memory.

inline TVideoStreamInfo clone() const

Creates a full independent clone. The returned object is always mutable.

inline bool copyTo(TVideoStreamInfo &dst) const

Copies all fields to dst. Returns false if dst is null.