MediaPin

primo::avblocks::MediaPin

class MediaPin : public primo::Reference

MediaPin represents an elementary media stream.

MediaPin object can exist for audio, video or any other type of stream. However, AVBlocks can process only the audio and video streams. MediaPin objects are used as inputs and outputs of Transcoder.

Public Functions

virtual int32_t connection() const = 0

Returns the Pin connection ID.

This should not be confused with the stream ID that is defined for certain stream types.

A Transcoder object matches and connects input and output pins by their connection ID. The Transcoder processes the connected pins and ignores the unconnected pins.

Pins are connected to one another according to the following rules:

  • Input pins with connection ID greater than PinConnection::Auto are connected to output pins with the same connection ID. In this case the Transcoder requires that a single unique connection ID is used by exactly one input and one output pin.

  • Input and output pins with connection ID equal to PinConnection::Auto are connected automatically based on their media type (audio or video)

  • Input and output pins with connection ID equal to PinConnection::Disabled are ignored.

See also

Transcoder

Returns:

Connection ID which is either an unique value or a special value from the PinConnection::Enum.

virtual bool_t setConnection(int32_t connectionID) = 0

Sets the Pin connection ID.

This should not be confused with the stream ID that is defined for certain stream types.

A Transcoder object matches and connects input and output pins by their connection ID. The Transcoder processes the connected pins and ignores the unconnected pins.

Pins are connected to one another according to the following rules:

  • Input pins with connection ID greater than PinConnection::Auto are connected to output pins with the same connection ID. In this case the Transcoder requires that a single unique connection ID is used by exactly one input and one output pin.

  • Input and output pins with connection ID equal to PinConnection::Auto are connected automatically based on their media type (audio or video)

  • Input and output pins with connection ID equal to PinConnection::Disabled are ignored.

See also

Transcoder

Parameters:

connectionID – [in] Pin connection ID should be either an unique value or a special value from the PinConnection::Enum.

Returns:

TRUE if the connection ID is successfully set, otherwise FALSE.

virtual primo::codecs::StreamInfo *streamInfo() const = 0

Returns information about the elementary stream represented by this pin.

The Transcoder ignores pins that are not audio or video elementary streams.

If the media type of the returned StreamInfo object is MediaType::Audio, it is safe to cast it to AudioStreamInfo.

If the media type of the returned StreamInfo object is MediaType::Video, it is safe to cast it to VideoStreamInfo.

The caller is not required to release the returned object.

Returns:

A StreamInfo object.

virtual bool_t setStreamInfo(primo::codecs::StreamInfo *streamInfo) = 0

Sets the stream information for the pin.

Parameters:

streamInfo – [in] A pointer to a StreamInfo object. If NULL the stream info is cleared. Internally the StreamInfo object is retained by the MediaPin, so it is safe to release it after this method returns.

virtual ParameterList *params() const = 0

Returns a collection of pin parameters.

These parameters affect the processing of the elementary stream represented by this pin.

The caller is not required to release the returned object.

Returns:

A ParameterList object. Can be NULL if the collection is not set. The default value is an empty list.

virtual bool_t setParams(ParameterList *params) = 0

Sets the filter parameters for the pin.

Parameters:

params – [in] A pointer to a ParameterList object. If NULL the stored collection is reset to NULL. Internally the ParameterList object is retained by the MediaPin, so it is safe to release it after this method returns.

Returns:

TRUE if the parameter list is successfully set, otherwise FALSE.

virtual MediaPin *clone() const = 0

Creates a deep copy of this object.

Returns:

A new MediaPin object. The caller is responsible for releasing the new object when it is not needed anymore.

Returns:

NULL if there is not enough memory to clone the object.

virtual bool_t immutable() const = 0

Returns whether the object is immutable.

An immmutable object cannot be modified and all modifying methods fail to produce a result.

Remark

An immutable object can be modified by the AVBlocks library.

Remark

Object immutability spreads to all nested objects. Therefore it is not possible to add/set an immutable object to a mutable object.

Remark

When cloned an immutable object becomes mutable.

Returns:

TRUE if the object is immutable, FALSE otherwise.