AVBlocks for C++  1.13
Audio and Video Software Development Kit
MediaSocketList Class Referenceabstract

MediaSocketList represents the inputs or outputs of a Transcoder. More...

Public Member Functions

virtual void add (MediaSocket *item)=0
 Adds a socket to the collection. More...
 
virtual bool_t remove (int32_t itemIndex)=0
 Removes a socket from the collection. More...
 
virtual void clear ()=0
 Removes all sockets from the collection. More...
 
virtual int32_t count () const =0
 Returns the number of sockets in the collection. More...
 
virtual MediaSocketat (int32_t itemIndex) const =0
 Returns a media socket specified by index. More...
 
virtual bool_t setAt (int32_t itemIndex, MediaSocket *item)=0
 Sets a new socket at the specified index. More...
 
virtual bool_t insert (int32_t itemIndex, MediaSocket *item)=0
 Inserts a socket at the specified index. More...
 

Protected Member Functions

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

Detailed Description

MediaSocketList represents the inputs or outputs of a Transcoder.

It contains one or more media sockets (MediaSocket objects). The collection is modifiable and indexable. It exists only in the context of a Transcoder and cannot be created separately from it, nor detached.

Member Function Documentation

virtual void add ( MediaSocket item)
pure virtual

Adds a socket to the collection.

Parameters
item[in] A pointer to a MediaSocket object that should be added to the collection. It is allowed to add a NULL value to the collection. Internally the MediaSocket object is retained (if not NULL), so it is safe to release it after this method returns.
See Also
Library::createMediaSocket
Object Management
virtual MediaSocket* at ( int32_t  itemIndex) const
pure virtual

Returns a media socket specified by index.

Parameters
itemIndex[in] The index of the socket to be returned. Indexing starts from 0.
Returns
A pointer to the MediaSocket object specified by itemIndex. Can be NULL.

The caller is not required to release the returned object.

See Also
Object Management
virtual void clear ( )
pure virtual

Removes all sockets from the collection.

When removed from the collection each MediaSocket object is released.

See Also
Object Management
virtual int32_t count ( ) const
pure virtual

Returns the number of sockets in the collection.

Returns
number of items in the collection.
virtual bool_t insert ( int32_t  itemIndex,
MediaSocket item 
)
pure virtual

Inserts a socket at the specified index.

Parameters
itemIndex[in] The index in the collection where the new item shall be inserted. This must be a valid index in the collection. Indexing starts from 0. After the new item is inserted in the collection its index is the value of the itemIndex param.
item[in] A pointer to the MediaSocket object that shall be inserted. It is allowed to insert a NULL value in the collection. Internally the new socket is retained (if not NULL), so it is safe to release it after this method returns.
Returns
TRUE The item is set, FALSE otherwise.
See Also
Object Management
virtual bool_t remove ( int32_t  itemIndex)
pure virtual

Removes a socket from the collection.

Parameters
itemIndex[in] The index of the socket that should be removed from the collection. Indexing starts from 0.
Returns
TRUE if the specified item is removed from the collection, otherwise FALSE.

When a MediaSocket object is removed from the collection it is also released.

See Also
Object Management
virtual bool_t setAt ( int32_t  itemIndex,
MediaSocket item 
)
pure virtual

Sets a new socket at the specified index.

Parameters
itemIndex[in] The index in the collection where the new item shall be set. This must be a valid index in the collection. Indexing starts from 0.
item[in] A pointer to the MediaSocket object that shall be set. It is allowed to set a NULL value to the collection. Internally the new socket is retained (if not NULL), so it is safe to release it after this method returns. The old socket is released (if not NULL).
Returns
TRUE The item is set, FALSE otherwise.
See Also
Object Management