Telematics SDK - Interface Specification  v1.26.3
telux::audio::ITranscoder Class Referenceabstract

ITranscoder is used to convert one audio format to another audio format using the transcoding operation. More...

Public Member Functions

virtual std::shared_ptr< IAudioBuffergetWriteBuffer ()=0
 
virtual std::shared_ptr< IAudioBuffergetReadBuffer ()=0
 
virtual telux::common::Status write (std::shared_ptr< IAudioBuffer > buffer, uint32_t isLastBuffer, TranscoderWriteResponseCb callback=nullptr)=0
 
virtual telux::common::Status tearDown (telux::common::ResponseCallback callback=nullptr)=0
 
virtual telux::common::Status read (std::shared_ptr< IAudioBuffer > buffer, uint32_t bytesToRead, TranscoderReadResponseCb callback=nullptr)=0
 
virtual telux::common::Status registerListener (std::weak_ptr< ITranscodeListener > listener)=0
 
virtual telux::common::Status deRegisterListener (std::weak_ptr< ITranscodeListener > listener)=0
 

Detailed Description

ITranscoder is used to convert one audio format to another audio format using the transcoding operation.

Member Function Documentation

virtual std::shared_ptr<IAudioBuffer> telux::audio::ITranscoder::getWriteBuffer ( )
pure virtual

Get a buffer to be used for writing samples for transcoding operation.

Returns
a buffer or nullptr in case of failure.
Note
Eval: This is a new API and is being evaluated. It is subject to change and could break backwards compatibility.
virtual std::shared_ptr<IAudioBuffer> telux::audio::ITranscoder::getReadBuffer ( )
pure virtual

Get a buffer to be used for reading samples from transcoding operation.

Returns
a buffer or nullptr in case of failure.
Note
Eval: This is a new API and is being evaluated. It is subject to change and could break backwards compatibility.
virtual telux::common::Status telux::audio::ITranscoder::write ( std::shared_ptr< IAudioBuffer buffer,
uint32_t  isLastBuffer,
TranscoderWriteResponseCb  callback = nullptr 
)
pure virtual

Write Samples/Frames to transcode stream. First write starts transcoding operation.

Write in case of compressed audio format maintains a pipeline, if the callback returns with same number of bytes written as requested and no error occured, user can send next buffer. If the number of bytes returned are not equal to the requested write size, then user needs to resend the buffer again from the leftover offset after waiting for the () event.

Parameters
[in]bufferbuffer that needs to be transcoded.
[in]isLastBufferrepresents whether this buffer is last buffer or not. Once last buffer is set no more write operations are required.
[in]callbackcallback to get the response of write.
Returns
Status of the request i.e. success or suitable status code.
Note
Eval: This is a new API and is being evaluated. It is subject to change and could break backwards compatibility.
virtual telux::common::Status telux::audio::ITranscoder::tearDown ( telux::common::ResponseCallback  callback = nullptr)
pure virtual

It is mandatory to call this API after the end of a transcode operation or to abort a transcode operation. After this API call the ITranscoder object is no longer usable.

Parameters
[in]callbackcallback to get the response of tearDown.
Returns
Status of the request i.e. success or suitable status code.
Note
Eval: This is a new API and is being evaluated. It is subject to change and could break backwards compatibility.
virtual telux::common::Status telux::audio::ITranscoder::read ( std::shared_ptr< IAudioBuffer buffer,
uint32_t  bytesToRead,
TranscoderReadResponseCb  callback = nullptr 
)
pure virtual

Reads samples/Frames from transcoder during transcoding operation.

Parameters
[in]bufferstream buffer for read.
[in]bytesToReadspecifying how many bytes to be read from stream.
[in]callbackcallback to get the response of read.
Returns
Status of the request i.e. success or suitable status code.
Note
Eval: This is a new API and is being evaluated. It is subject to change and could break backwards compatibility.
virtual telux::common::Status telux::audio::ITranscoder::registerListener ( std::weak_ptr< ITranscodeListener listener)
pure virtual

Register a listener to get notified for events of Transcoder.

Parameters
[in]listenerPointer of ITranscodeListener object that processes the notification.
Returns
Status of registerListener i.e success or suitable status code.
Note
Eval: This is a new API and is being evaluated.It is subject to change and could break backwards compatibility.
virtual telux::common::Status telux::audio::ITranscoder::deRegisterListener ( std::weak_ptr< ITranscodeListener listener)
pure virtual

Remove a previously registered listener.

Parameters
[in]listenerPreviously registered ITranscodeListener that needs to be removed.
Returns
Status of deRegisterListener, success or suitable status code.
Note
Eval: This is a new API and is being evaluated.It is subject to change and could break backwards compatibility.