AVBlocks for C++  3.0
Audio and Video Software Development Kit
Loading...
Searching...
No Matches
MediaPin Class Referenceabstract

MediaPin represents an elementary media stream. More...

#include <avb.h>

Inheritance diagram for MediaPin:
Reference

Public Member Functions

virtual MediaPinclone () const =0
 Creates a deep copy of this object.
 
virtual int32_t connection () const =0
 Returns the Pin connection ID.
 
virtual bool_t immutable () const =0
 Returns whether the object is immutable.
 
virtual ParameterListparams () const =0
 Returns a collection of pin parameters.
 
virtual bool_t setConnection (int32_t connectionID)=0
 Sets the Pin connection ID.
 
virtual bool_t setParams (ParameterList *params)=0
 Sets the filter parameters for the pin.
 
virtual bool_t setStreamInfo (primo::codecs::StreamInfo *streamInfo)=0
 Sets the stream information for the pin.
 
virtual primo::codecs::StreamInfostreamInfo () const =0
 Returns information about the elementary stream represented by this pin.
 
- Public Member Functions inherited from Reference
virtual int32_t release () const =0
 Releases the instance.
 
virtual int32_t retain () const =0
 Retains the instance.
 
virtual int32_t retainCount () const =0
 Returns the current reference count.
 

Protected Member Functions

 ~MediaPin ()
 This object can be destroyed only by the AVBlocks library.
 

Detailed Description

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.

See also
Library::createMediaPin
Object Management

Member Function Documentation

◆ clone()

virtual MediaPin * clone ( ) const
pure virtual

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.
NULL if there is not enough memory to clone the object.
Remarks
This method uses the StreamInfo::clone and primo::avblocks::ParameterList::clone ParameterList::clone methods to clone the streamInfo and the params members. When cloned an immutable object becomes mutable. object_management "Object Management"

◆ connection()

virtual int32_t connection ( ) const
pure virtual

Returns the Pin connection ID.

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

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

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
PinConnection::Enum
Transcoder

◆ immutable()

virtual bool_t immutable ( ) const
pure virtual

Returns whether the object is immutable.

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

Returns
TRUE if the object is immutable, FALSE otherwise.
Remarks
An immutable object can be modified by the AVBlocks library.
Object immutability spreads to all nested objects. Therefore it is not possible to add/set an immutable object to a mutable object.
When cloned an immutable object becomes mutable.

◆ params()

virtual ParameterList * params ( ) const
pure virtual

Returns a collection of pin parameters.

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

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

The caller is not required to release the returned object.

See also
Object Management

◆ setConnection()

virtual bool_t setConnection ( int32_t  connectionID)
pure virtual

Sets the Pin connection ID.

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

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

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.
Returns
TRUE if the connection ID is successfully set, otherwise FALSE.
See also
PinConnection::Enum
Transcoder

◆ setParams()

virtual bool_t setParams ( ParameterList params)
pure virtual

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.
See also
Object Management

◆ setStreamInfo()

virtual bool_t setStreamInfo ( primo::codecs::StreamInfo streamInfo)
pure virtual

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.
See also
MediaPin::streamInfo
Object Management

◆ streamInfo()

virtual primo::codecs::StreamInfo * streamInfo ( ) const
pure virtual

Returns information about the elementary stream represented by this pin.

Returns
A StreamInfo object.

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.

See also
Object Management