Async 1.8.0
|
Base class for an audio decoder. More...
#include <AsyncAudioDecoder.h>
Public Member Functions | |
AudioDecoder (void) | |
Default constuctor. | |
virtual | ~AudioDecoder (void) |
Destructor. | |
virtual const char * | name (void) const =0 |
Get the name of the codec. | |
virtual void | setOption (const std::string &name, const std::string &value) |
Set an option for the decoder. | |
virtual void | printCodecParams (void) const |
Print codec parameter settings. | |
virtual void | writeEncodedSamples (void *buf, int size)=0 |
Write encoded samples into the decoder. | |
virtual void | flushEncodedSamples (void) |
Call this function when all encoded samples have been received. | |
virtual void | resumeOutput (void) |
Resume audio output to the sink. | |
![]() | |
AudioSource (void) | |
Default constuctor. | |
virtual | ~AudioSource (void) |
Destructor. | |
bool | registerSink (AudioSink *sink, bool managed=false) |
Register an audio sink to provide samples to. | |
void | unregisterSink (void) |
Unregister the previously registered audio sink. | |
bool | isRegistered (void) const |
Check if an audio sink has been registered. | |
AudioSink * | sink (void) const |
Get the registered audio sink. | |
bool | sinkManaged (void) const |
Check if the sink is managed or not. | |
void | handleAllSamplesFlushed (void) |
The registered sink has flushed all samples. | |
Static Public Member Functions | |
static bool | isAvailable (const std::string &name) |
Check if a specific decoder is available. | |
static AudioDecoder * | create (const std::string &name) |
Create a new decoder of the specified type. | |
Public Attributes | |
sigc::signal< void > | allEncodedSamplesFlushed |
This signal is emitted when all encoded samples have been flushed. | |
Protected Member Functions | |
virtual void | allSamplesFlushed (void) |
The registered sink has flushed all samples. | |
![]() | |
int | sinkWriteSamples (const float *samples, int len) |
void | sinkFlushSamples (void) |
bool | setHandler (AudioSource *handler) |
Setup another source to handle the outgoing audio. | |
AudioSource * | handler (void) const |
void | clearHandler (void) |
Clear a handler that was previously setup with setHandler. | |
Base class for an audio decoder.
This is the base class for an audio decoder.
Definition at line 113 of file AsyncAudioDecoder.h.
|
inline |
Default constuctor.
Definition at line 131 of file AsyncAudioDecoder.h.
|
inlinevirtual |
Destructor.
Definition at line 136 of file AsyncAudioDecoder.h.
|
inlineprotectedvirtual |
The registered sink has flushed all samples.
This function will be called when all samples have been flushed in the registered sink. This function is normally only called from a connected sink object.
Reimplemented from Async::AudioSource.
Definition at line 191 of file AsyncAudioDecoder.h.
References allEncodedSamplesFlushed.
|
static |
Create a new decoder of the specified type.
name | The name of the decoder to create |
|
inlinevirtual |
Call this function when all encoded samples have been received.
Definition at line 166 of file AsyncAudioDecoder.h.
References Async::AudioSource::sinkFlushSamples().
|
static |
Check if a specific decoder is available.
name | The name of the decoder to look for |
|
pure virtual |
Get the name of the codec.
|
inlinevirtual |
Print codec parameter settings.
Definition at line 154 of file AsyncAudioDecoder.h.
|
inlinevirtual |
Resume audio output to the sink.
This function will be called when the registered audio sink is ready to accept more samples. This function is normally only called from a connected sink object.
Reimplemented from Async::AudioSource.
Definition at line 175 of file AsyncAudioDecoder.h.
|
inlinevirtual |
Set an option for the decoder.
name | The name of the option |
value | The value of the option |
Definition at line 149 of file AsyncAudioDecoder.h.
|
pure virtual |
Write encoded samples into the decoder.
buf | Buffer containing encoded samples |
size | The size of the buffer |
sigc::signal<void> Async::AudioDecoder::allEncodedSamplesFlushed |
This signal is emitted when all encoded samples have been flushed.
Definition at line 180 of file AsyncAudioDecoder.h.
Referenced by allSamplesFlushed().