AVBlocks for C++  2.1
Audio and Video Software Development Kit
Block Class Referenceabstract

A Block is a unit that can produce, consume or transform media samples from/to multiple inputs/outputs. More...

Inheritance diagram for Block:
Reference MediaInfo Transcoder

Public Member Functions

virtual void close ()=0
 Closes the block. More...
 
virtual bool_t endOfStream (int32_t inputIndex)=0
 Tells the block that there's no more data for the specified input socket. More...
 
virtual const
primo::error::ErrorInfo
error () const =0
 Returns the error information for the last operation. More...
 
virtual bool_t flush ()=0
 Flushes the data buffered in the block to the output. More...
 
virtual MediaSocketListinputs () const =0
 Returns a modifiable collection of MediaSocket objects which describe the input data of the block. More...
 
virtual bool_t open ()=0
 Initializes the block based on the specified inputs and outputs. More...
 
virtual MediaSocketListoutputs () const =0
 Returns a modifiable collection of MediaSocket objects which describe the output data of the block. More...
 
virtual bool_t pull (int32_t &outputIndex, primo::codecs::MediaSample *outputData)=0
 Pulls output data from the block. More...
 
virtual bool_t push (int32_t inputIndex, primo::codecs::MediaSample *inputSample)=0
 Pushes input data to the block. More...
 
- Public Member Functions inherited from Reference
virtual int32_t release () const =0
 Releases the instance. More...
 
virtual int32_t retain () const =0
 Retains the instance. More...
 
virtual int32_t retainCount () const =0
 Returns the current reference count. More...
 

Detailed Description

A Block is a unit that can produce, consume or transform media samples from/to multiple inputs/outputs.

Member Function Documentation

virtual void close ( )
pure virtual

Closes the block.

When closed it can neither accept, nor deliver data.

Implemented in Transcoder.

virtual bool_t endOfStream ( int32_t  inputIndex)
pure virtual

Tells the block that there's no more data for the specified input socket.

This method can be used only in push mode.

Parameters
inputIndex[in] specifies the index of the input socket for which there's no more data.
Returns
TRUE if the operation is successful, otherwise FALSE.

Implemented in Transcoder.

virtual const primo::error::ErrorInfo* error ( ) const
pure virtual

Returns the error information for the last operation.

Returns
A pointer to an ErrorInfo object.

Implemented in Transcoder.

virtual bool_t flush ( )
pure virtual

Flushes the data buffered in the block to the output.

This method can be used only in push mode.

Returns
TRUE if the buffered data is successfully flushed, otherwise FALSE.
Remarks
This method also marks the end-of-stream for all inputs. No data should be pushed to the block after it is flushed.

Implemented in Transcoder.

virtual MediaSocketList* inputs ( ) const
pure virtual

Returns a modifiable collection of MediaSocket objects which describe the input data of the block.

Returns
A pointer to a collection of input sockets. Cannot be NULL.

Implemented in Transcoder, and MediaInfo.

virtual bool_t open ( )
pure virtual

Initializes the block based on the specified inputs and outputs.

Returns
TRU The block is successfully initialized and is ready to process data, otherwise FALSE.

Implemented in Transcoder, and MediaInfo.

virtual MediaSocketList* outputs ( ) const
pure virtual

Returns a modifiable collection of MediaSocket objects which describe the output data of the block.

Returns
A pointer to a collection of output sockets. Cannot be NULL.

Implemented in Transcoder, and MediaInfo.

virtual bool_t pull ( int32_t &  outputIndex,
primo::codecs::MediaSample outputData 
)
pure virtual

Pulls output data from the block.

Parameters
outputIndex[out] contains the index of the output socket to which the data belongs.
outputData[out] A pointer to a MediaSample object that receives the output data.
Returns
TRUE The block has successfully generated output, otherwise FALSE.

Implemented in Transcoder.

virtual bool_t push ( int32_t  inputIndex,
primo::codecs::MediaSample inputSample 
)
pure virtual

Pushes input data to the block.

Parameters
inputIndex[in] Specifies the index of the input socket whose data is pushed to the block.
inputSample[in] A pointer to a MediaSample object that contains the input data.
Returns
TRUE The block has successfully processed the input data, otherwise FALSE.

Implemented in Transcoder, and MediaInfo.