TStreamInfo

primo::avblocks::modern::TStreamInfo

template<typename Derived, typename RawT>
class TStreamInfo

CRTP base for TAudioStreamInfo, TVideoStreamInfo, and TDataStreamInfo.

Holds the primo::ref<RawT> and exposes all properties defined on the raw primo::codecs::StreamInfo interface, with fluent setters that return Derived& (on lvalues) or Derived&& (on temporaries) so chaining works naturally on the concrete subclass. The rvalue overloads let a chained temporary be returned or moved, e.g. return TVideoStreamInfo().frameWidth(352).frameHeight(288);

Unnamed Group

inline Derived &streamType(primo::codecs::StreamType::Enum type) &
inline Derived &&streamType(primo::codecs::StreamType::Enum type) &&

Sets the stream type.

Parameters:

type – Major stream type.

Returns:

This object, for chaining.

Unnamed Group

inline Derived &streamSubType(primo::codecs::StreamSubType::Enum subType) &
inline Derived &&streamSubType(primo::codecs::StreamSubType::Enum subType) &&

Sets the stream subtype.

Parameters:

subType – Stream subtype.

Returns:

This object, for chaining.

Unnamed Group

inline Derived &duration(double d) &
inline Derived &&duration(double d) &&

Sets the stream duration.

Parameters:

d – Duration in seconds.

Returns:

This object, for chaining.

Unnamed Group

inline Derived &bitrate(int32_t bps) &
inline Derived &&bitrate(int32_t bps) &&

Sets the stream bitrate.

Parameters:

bps – Bitrate in bits per second.

Returns:

This object, for chaining.

Unnamed Group

inline Derived &bitrateMode(int32_t mode) &
inline Derived &&bitrateMode(int32_t mode) &&

Sets the stream bitrate mode.

Parameters:

mode – A primo::codecs::BitrateMode::Enum constant.

Returns:

This object, for chaining.

Unnamed Group

inline Derived &ID(int32_t id) &
inline Derived &&ID(int32_t id) &&

Sets the ID of the elementary stream.

Parameters:

id – Elementary stream ID.

Returns:

This object, for chaining.

Unnamed Group

inline Derived &programNumber(int32_t num) &
inline Derived &&programNumber(int32_t num) &&

Sets the program to which the elementary stream belongs.

Parameters:

num – Program number.

Returns:

This object, for chaining.

Unnamed Group

inline Derived &configData(primo::codecs::MediaBuffer *buf) &
inline Derived &&configData(primo::codecs::MediaBuffer *buf) &&

Sets decoder specific configuration data.

It is typically obtained from a demuxer and is required to decode certain stream types.

Parameters:

buf – Buffer with the configuration data. Can be nullptr.

Returns:

This object, for chaining.

Public Functions

inline primo::codecs::MediaType::Enum mediaType() const

Returns the media type of the stream. It cannot be changed.

inline primo::codecs::StreamType::Enum streamType() const

Returns the stream type.

inline primo::codecs::StreamSubType::Enum streamSubType() const

Returns the stream subtype.

inline double duration() const

Returns the stream duration in seconds.

inline int32_t bitrate() const

Returns the stream bitrate in bits per second.

inline int32_t bitrateMode() const

Returns the stream bitrate mode, a primo::codecs::BitrateMode::Enum constant.

inline int32_t ID() const

Returns the ID of the elementary stream.

inline int32_t programNumber() const

Returns the number of the program to which the elementary stream belongs.

inline bool immutable() const

Returns true if the object is immutable.

An immutable object cannot be modified.

inline primo::codecs::MediaBuffer *configData() const

Returns the decoder specific configuration data, or nullptr if not set.

inline bool reset()

Resets all fields to their defaults. Returns false if the object is immutable.

inline Derived clone() const

Returns a mutable deep copy.

The cloned object is always mutable regardless of whether the source was immutable.

inline RawT *get() const

Returns the raw underlying pointer. For interop with the C API only.