Async 1.8.0
|
Base class for an audio encoder. More...
#include <AsyncAudioEncoder.h>
Public Member Functions | |
AudioEncoder (void) | |
Default constuctor. | |
~AudioEncoder (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 encoder. | |
virtual void | printCodecParams (void) |
Print codec parameter settings. | |
void | allEncodedSamplesFlushed (void) |
Call this function when all encoded samples have been flushed. | |
virtual void | flushSamples (void) |
Tell the sink to flush the previously written samples. | |
![]() | |
AudioSink (void) | |
Default constuctor. | |
virtual | ~AudioSink (void) |
Destructor. | |
bool | registerSource (AudioSource *source) |
Register an audio source to provide samples to this sink. | |
void | unregisterSource (void) |
Unregister the previously registered audio source. | |
bool | isRegistered (void) const |
Check if an audio source has been registered. | |
AudioSource * | source (void) const |
Get the registered audio source. | |
virtual int | writeSamples (const float *samples, int count) |
Write samples into this audio sink. | |
Static Public Member Functions | |
static bool | isAvailable (const std::string &name) |
Check if a specific encoder is available. | |
static AudioEncoder * | create (const std::string &name) |
Create a new encoder of the specified type. | |
Public Attributes | |
sigc::signal< void, const void *, int > | writeEncodedSamples |
A signal emitted when encoded samples are available. | |
sigc::signal< void > | flushEncodedSamples |
This signal is emitted when the source calls flushSamples. | |
Additional Inherited Members | |
![]() | |
void | sourceResumeOutput (void) |
Tell the source that we are ready to accept more samples. | |
void | sourceAllSamplesFlushed (void) |
Tell the source that all samples have been flushed. | |
bool | setHandler (AudioSink *handler) |
Setup another sink to handle the incoming audio. | |
void | clearHandler (void) |
Clear a handler that was previously setup with setHandler. | |
AudioSink * | handler (void) const |
Base class for an audio encoder.
This is the base class for implementing an audio encoder.
Definition at line 113 of file AsyncAudioEncoder.h.
|
inline |
Default constuctor.
Definition at line 131 of file AsyncAudioEncoder.h.
|
inline |
Destructor.
Definition at line 136 of file AsyncAudioEncoder.h.
|
inline |
Call this function when all encoded samples have been flushed.
Definition at line 159 of file AsyncAudioEncoder.h.
References Async::AudioSink::sourceAllSamplesFlushed().
|
static |
Create a new encoder of the specified type.
name | The name of the encoder to create |
|
inlinevirtual |
Tell the sink to flush the previously written samples.
This function is used to tell the sink to flush previously written samples. When done flushing, the sink should call the sourceAllSamplesFlushed function. This function is normally only called from a connected source object.
Reimplemented from Async::AudioSink.
Definition at line 169 of file AsyncAudioEncoder.h.
References flushEncodedSamples.
|
static |
Check if a specific encoder is available.
name | The name of the encoder to look for |
|
pure virtual |
Get the name of the codec.
|
inlinevirtual |
Print codec parameter settings.
Definition at line 154 of file AsyncAudioEncoder.h.
|
inlinevirtual |
Set an option for the encoder.
name | The name of the option |
value | The value of the option |
Definition at line 149 of file AsyncAudioEncoder.h.
sigc::signal<void> Async::AudioEncoder::flushEncodedSamples |
This signal is emitted when the source calls flushSamples.
Definition at line 181 of file AsyncAudioEncoder.h.
Referenced by flushSamples().
sigc::signal<void,const void *,int> Async::AudioEncoder::writeEncodedSamples |
A signal emitted when encoded samples are available.
buf | Buffer containing encoded samples |
size | The size of the buffer |
Definition at line 176 of file AsyncAudioEncoder.h.