Telematics SDK - API Reference
v1.63.4
|
Data Structures | |
class | telux::audio::ITranscodeListener |
class | telux::audio::ITranscoder |
Typedefs | |
using | telux::audio::TranscoderReadResponseCb = std::function< void(std::shared_ptr< IAudioBuffer > buffer, uint32_t isLastBuffer, telux::common::ErrorCode error)> |
using | telux::audio::TranscoderWriteResponseCb = std::function< void(std::shared_ptr< IAudioBuffer > buffer, uint32_t bytesWritten, telux::common::ErrorCode error)> |
This section contains APIs related to Audio Transcoder operation.
class telux::audio::ITranscodeListener |
Listener for events during transcoding.
Public Member Functions | |
virtual void | onReadyForWrite () |
virtual | ~ITranscodeListener () |
|
virtual |
Destructor of ITranscodeListener.
|
virtual |
Called when the audio pipeline is ready to accept the next buffer containing data to transcode.
class telux::audio::ITranscoder |
Provides the methods for transcoding the compressed audio data.
Public Member Functions | |
virtual std::shared_ptr< IAudioBuffer > | getWriteBuffer ()=0 |
virtual std::shared_ptr< IAudioBuffer > | getReadBuffer ()=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 |
virtual | ~ITranscoder () |
|
virtual |
Destructor of the ITranscoder.
|
pure virtual |
Gets a buffer for sending the data for transcoding.
|
pure virtual |
Gets a buffer that will contain the transcoded data.
|
pure virtual |
Sends the compressed data for transcoding. First write starts the transcoding operation.
Internally, a pipeline is maintained for the data to transcode. The application should send the next data for transcoding only when the pipeline can accomodate more data. This readiness is indicated by calling the ITranscodeListener::onReadyForWrite() method.
[in] | buffer | Contains the data to transcode |
[in] | isLastBuffer | Marks that this is the last chunk of the data to transcode |
[in] | callback | Optional, invoked to pass the status of pushing the data in the pipeline |
|
pure virtual |
Destroys the ITranscoder instance created with IAudioManager::createTranscoder(). This must be called after the transcoding is finished.
[in] | callback | Optional, invoked to pass the result of the destruction |
|
pure virtual |
Initiates a read request to fetch the transcoded data. Transcoded data will be by the TranscoderReadResponseCb callback.
[in] | buffer | Buffer that will contain the transcoded data |
[in] | bytesToRead | Length of the data to fetch |
[in] | callback | Optional, invoked to pass the transcoded data |
|
pure virtual |
Registers the given listener to know 'when the pipeline is ready to accept the next buffer' for transcoding. Event is received by the ITranscodeListener::onReadyForWrite() method.
[in] | listener | Receives the events during transcoding |
|
pure virtual |
Unregisters the given listener registered with ITranscoder::registerListener().
[in] | listener | Listener to unregister |
using telux::audio::TranscoderReadResponseCb = typedef std::function<void(std::shared_ptr<IAudioBuffer> buffer, uint32_t isLastBuffer, telux::common::ErrorCode error)> |
Called to pass the transcoded audio data. Used with ITranscoder::read().
[in] | buffer | Contains the transcoded data with IAudioBuffer::getDataSize() giving the actual number of data bytes in this buffer. Should be cleared using IAudioBuffer::reset() before reusing it for sending the next compressed data for transcoding. |
[in] | isLastBuffer | Indicates that this is the last chunk of the transcoded data |
[in] | error | telux::common::ErrorCode::SUCCESS if the transcoding was successful, an appropriate error code otherwise |
using telux::audio::TranscoderWriteResponseCb = typedef std::function<void(std::shared_ptr<IAudioBuffer> buffer, uint32_t bytesWritten, telux::common::ErrorCode error)> |
Called when the compressed data has been sent for transcoding. Used with ITranscoder::write().
[in] | buffer | Buffer that is passed to ITranscoder::write(). To reuse it for sending the next compressed data for transcoding, clear it using IAudioBuffer::reset(). |
[in] | bytesWritten | Number of data bytes sent for transcoding |
[in] | error | telux::common::ErrorCode::SUCCESS if the data was sent successfully, an appropriate error code otherwise |