TMediaPin

primo::avblocks::modern::TMediaPin

class TMediaPin : public primo::avblocks::modern::TParamsMixin<TMediaPin>

Fluent wrapper for primo::avblocks::MediaPin, which represents an elementary media stream.

A pin can exist for audio, video or any other kind of stream, but AVBlocks processes only audio and video streams. Pins are the inputs and outputs of a TMediaSocketT. A transcoder matches input and output pins by their connection ID (see connection()). Codec parameters are added with addParam().

Owns the raw object through a primo::ref. Not copyable, movable.

Unnamed Group

TMediaPin(TMediaPin&&) = default
TMediaPin &operator=(TMediaPin&&) = default

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

Unnamed Group

inline TMediaPin &&streamInfo(const TAudioStreamInfo &info) &&
inline TMediaPin &streamInfo(const TAudioStreamInfo &info) &
inline TMediaPin &&streamInfo(const TVideoStreamInfo &info) &&
inline TMediaPin &streamInfo(const TVideoStreamInfo &info) &

Sets the stream info of the pin.

The pin retains the stream info object, so the pin and info share it.

Parameters:

info – Audio or video stream info.

Returns:

This object, for chaining. On a temporary the rvalue overload returns the object by rvalue reference.

Unnamed Group

inline TMediaPin &&connection(int32_t connectionID) &&
inline TMediaPin &connection(int32_t connectionID) &

Sets the connection ID of the pin.

A transcoder matches and connects input and output pins by their connection ID. Do not confuse it with the stream ID defined for certain stream types.

Parameters:

connectionID – PinConnection::Disabled to exclude the pin, PinConnection::Auto for automatic matching, or any positive integer to match with an output pin that has the same ID.

Returns:

This object, for chaining. On a temporary the rvalue overload returns the object by rvalue reference.

Public Functions

inline TMediaPin()

Creates an empty media pin.

inline explicit TMediaPin(primo::ref<primo::avblocks::MediaPin> pin)

Takes ownership of an existing MediaPin reference.

inline explicit TMediaPin(primo::avblocks::MediaPin *pin)

Wraps a non-owned MediaPin pointer, retaining it. Used by TMediaSocketT::pin().

TMediaPin(const TMediaPin&) = delete
TMediaPin &operator=(const TMediaPin&) = delete
inline TAudioStreamInfo audioStreamInfo() const

Returns the pin’s stream info cast to TAudioStreamInfo, wrapping the existing pointer.

inline TVideoStreamInfo videoStreamInfo() const

Returns the pin’s stream info cast to TVideoStreamInfo, wrapping the existing pointer.

inline TDataStreamInfo streamInfo() const

Returns the pin’s stream info as a TDataStreamInfo (base StreamInfo view), wrapping the existing pointer.

Use to access mediaType(), streamType(), ID(), programNumber() without knowing the concrete media type.

inline int32_t connection() const

Returns the pin’s current connection ID.

inline primo::avblocks::MediaPin *get() const

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