AVBlocks for C++
2.1
Audio and Video Software Development Kit
|
Provides functionality for audio and video encoding, decoding and transforming. More...
Public Member Functions | |
virtual bool_t | allowDemoMode () const =0 |
Returns whether the Transcoder allows demo mode (unlicensed transcoding). More... | |
virtual bool_t | autoConnect () const =0 |
Returns the autoConnect property of the transcoder. More... | |
virtual primo::avblocks::TranscoderCallback * | callback ()=0 |
Returns the TranscoderCallback object that is used by the Transcoder to send notifications and events while running. More... | |
virtual void | close ()=0 |
Closes the transcoder. More... | |
virtual bool_t | endOfStream (int32_t inputIndex)=0 |
Tells the transcoder 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 transcoder to the output. More... | |
virtual MediaSocketList * | inputs () const =0 |
Returns a modifiable collection of MediaSocket objects which describe the input data of the transcoder. More... | |
virtual bool_t | open ()=0 |
Initializes the transcoder based on the specified inputs and outputs. More... | |
virtual MediaSocketList * | outputs () const =0 |
Returns a modifiable collection of MediaSocket objects which describe the output data of the transcoder. More... | |
virtual bool_t | pull (int32_t &outputIndex, primo::codecs::MediaSample *outputData)=0 |
Pulls output data from the transcoder. More... | |
virtual bool_t | push (int32_t inputIndex, primo::codecs::MediaSample *inputSample)=0 |
Pushes input data to the Transcoder. More... | |
virtual bool_t | run ()=0 |
Runs an automatic transcoding. More... | |
virtual void | setAllowDemoMode (bool_t allowDemoMode)=0 |
Sets whether demo mode (unlicensed transcoding) should be allowed by the Transcoder. More... | |
virtual void | setAutoConnect (bool_t autoConnect)=0 |
Sets the autoConnect property of the transcoder. More... | |
virtual void | setCallback (primo::avblocks::TranscoderCallback *callback)=0 |
Sets a TranscoderCallback instance which is used to receive notifications from the transcoder. 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... | |
Protected Member Functions | |
~Transcoder () | |
This object can be destroyed only by the AVBlocks library. More... | |
Provides functionality for audio and video encoding, decoding and transforming.
|
protected |
This object can be destroyed only by the AVBlocks library.
The caller must use Reference::release.
|
pure virtual |
Returns whether the Transcoder allows demo mode (unlicensed transcoding).
|
pure virtual |
Returns the autoConnect property of the transcoder.
|
pure virtual |
Returns the TranscoderCallback object that is used by the Transcoder to send notifications and events while running.
|
pure virtual |
Closes the transcoder.
When closed it can neither accept, nor deliver data. Inputs and outputs are not modified.
Implements Block.
|
pure virtual |
Tells the transcoder that there's no more data for the specified input socket.
If the last input socket is stopped the transcoder flushes its internal buffers to the output. This method can be used only in push mode.
inputIndex | [in] specifies the index of the input socket for which there's no more data. |
Implements Block.
|
pure virtual |
Returns the error information for the last operation.
Implements Block.
|
pure virtual |
Flushes the data buffered in the transcoder to the output.
This method can be used only in push mode.
Implements Block.
|
pure virtual |
Returns a modifiable collection of MediaSocket objects which describe the input data of the transcoder.
Each socket in the collection represents an input point - it can be a container with one or more streams or just an elementary stream.
The returned collection exists only in the context of the transcoder. The caller cannot influence the lifetime of the returned object.
Implements Block.
|
pure virtual |
Initializes the transcoder based on the specified inputs and outputs.
If this method succeeds the transcoder is ready to process data. The data flow may be driven by the following methods:
However not all stream types can be used in push or pull mode. See transcoder_io for more info.
TRUE | The block is successfully initialized and is ready to process data. |
FALSE | The block cannot process the specified input and output data. |
Implements Block.
|
pure virtual |
Returns a modifiable collection of MediaSocket objects which describe the output data of the transcoder.
Each socket in the collection describes an output point - it can be a container with one or more streams or just an elementary stream.
The returned collection exists only in the context of transcoder. The caller cannot influence the lifetime of the returned object.
Implements Block.
|
pure virtual |
Pulls output data from the transcoder.
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. When the method returns successfully the outputData contains the output sample. |
Each time output data is generated a new MediaBuffer instance is created and attached to outputData. The new MediaBuffer instance belongs to the caller and must be released when it is not needed anymore.
Implements Block.
|
pure virtual |
Pushes input data to the Transcoder.
inputIndex | [in] Specifies the index of the input socket whose data is pushed to the Transcoder. |
inputSample | [in] A pointer to a MediaSample object that contains the input data. The MediaSample provided is used only within this method and the object is not retained by the Transcoder. It is not guaranteed that the whole input will be consumed (read) by the Transcoder after this method has returned. It's possible that the Transcoder may consume only part of the provided input data. In this case the Transcoder will increment the MediaBuffer::dataOffset with the number of bytes read and the free space in the buffer will become fragmented. This must be taken into consideration if more data should be appended for subsequent pushing. |
Implements Block.
|
pure virtual |
Runs an automatic transcoding.
In order to use the run mode all input and output sockets must be associated with files or user streams. The method returns when the transcoding is finished because there's no more input data to process or when there's an error.
|
pure virtual |
Sets whether demo mode (unlicensed transcoding) should be allowed by the Transcoder.
allowDemoMode | [in] specifies whether unlicensed transcoding is allowed. |
|
pure virtual |
Sets the autoConnect property of the transcoder.
If autoConnect is TRUE the transcoder automatically maps input to output pins when opened.
autoConnect | [in] specifies to auto connect input and output pins. |
|
pure virtual |
Sets a TranscoderCallback instance which is used to receive notifications from the transcoder.
The TranscoderCallback is used only when the transcoding is performed via Transcoder::run.
callback | [in] A pointer to TranscoderCallback object that will be invoked by the transcoder while running. It is allowed to set a NULL object. |
Internally the TranscoderCallback specified by setCallback is retained (if not NULL). The previous TranscoderCallback is released (if not NULL). The TranscoderCallback instance is released when the Transcoder itself is being destroyed.