|
|
A class representing the ogg vorbis encoder linked as a shared object or as a static library.
bool encoderOpen | encoderOpen |
[private]
vorbis_info vorbisInfo | vorbisInfo |
[private]
vorbis_dsp_state vorbisDspState | vorbisDspState |
[private]
vorbis_block vorbisBlock | vorbisBlock |
[private]
vorbis_comment vorbisComment | vorbisComment |
[private]
ogg_stream_state oggStreamState | oggStreamState |
[private]
Ref<CastSink> sink | sink |
[private]
unsigned int outMaxBitrate | outMaxBitrate |
[private]
double resampleRatio | resampleRatio |
[private]
aflibConverter * converter | converter |
[private]
void
init ( CastSink * sink,
unsigned int outMaxBitrate )
throw ( Exception ) | init |
[private]
Initialize the object.
Parameters:
sink | the sink to send encoded output to |
the | maximum bit rate |
Throws: Exception
Reimplemented from AudioEncoder.
inline void
strip ( void )
throw ( Exception ) | strip |
[private]
De-initialize the object.
Throws: Exception
Reimplemented from AudioEncoder.
void
vorbisBlocksOut ( void )
throw ( Exception ) | vorbisBlocksOut |
[private]
Send pending Vorbis blocks to the underlying stream
inline
VorbisLibEncoder ( void )
throw ( Exception ) | VorbisLibEncoder |
[protected]
Default constructor. Always throws an Exception.
Throws: Exception
inline
VorbisLibEncoder ( CastSink * sink,
unsigned int inSampleRate,
unsigned int inBitsPerSample,
unsigned int inChannel,
bool inBigEndian,
BitrateMode outBitrateMode,
unsigned int outBitrate,
double outQuality,
unsigned int outSampleRate = 0,
unsigned int outChannel = 0,
unsigned int outMaxBitrate = 0 )
throw ( Exception ) | VorbisLibEncoder |
Constructor.
Parameters:
sink | the sink to send encoded output to |
inSampleRate | sample rate of the input. |
inBitsPerSample | number of bits per sample of the input. |
inChannel | number of channels of the input. |
inBigEndian | shows if the input is big or little endian |
outBitrateMode | the bit rate mode of the output. |
outBitrate | bit rate of the output (kbits/sec). |
outQuality | the quality of the stream. |
outSampleRate | sample rate of the output. If 0, inSampleRate is used. |
outMaxBitrate | maximum output bitrate. 0 if not used. |
outChannel | number of channels of the output. If 0, inChannel is used. |
Throws: Exception
inline
VorbisLibEncoder ( CastSink * sink,
const AudioSource * as,
BitrateMode outBitrateMode,
unsigned int outBitrate,
double outQuality,
unsigned int outSampleRate = 0,
unsigned int outChannel = 0,
unsigned int outMaxBitrate = 0 )
throw ( Exception ) | VorbisLibEncoder |
Constructor.
Parameters:
sink | the sink to send encoded output to |
as | get input sample rate, bits per sample and channels from this AudioSource. |
outBitrateMode | the bit rate mode of the output. |
outBitrate | bit rate of the output (kbits/sec). |
outQuality | the quality of the stream. |
outSampleRate | sample rate of the output. If 0, input sample rate is used. |
outMaxBitrate | maximum output bitrate. 0 if not used. |
outChannel | number of channels of the output. If 0, input channel is used. |
Throws: Exception
inline
VorbisLibEncoder ( const VorbisLibEncoder & encoder )
throw ( Exception ) | VorbisLibEncoder |
Copy constructor.
Parameters:
encoder | the VorbisLibEncoder to copy. |
inline
~VorbisLibEncoder ( void )
throw ( Exception ) | ~VorbisLibEncoder |
[virtual]
Destructor.
Throws: Exception
inline VorbisLibEncoder &
operator= ( const VorbisLibEncoder & encoder )
throw ( Exception ) | operator= |
[virtual]
Assignment operator.
Parameters:
encoder | the VorbisLibEncoder to assign this to. |
Returns: a reference to this VorbisLibEncoder.
Throws: Exception
Reimplemented from AudioEncoder.
inline unsigned int
getOutMaxBitrate ( void )
throw () | getOutMaxBitrate |
[const]
Get the maximum bit rate of the output in kbits/sec, for fixed / average bitrate encodings.
Returns: the maximum bit rate of the output, or 0 if not set.
inline bool
isRunning ( void )
throw () | isRunning |
[const virtual]
Check wether encoding is in progress.
Returns: true if encoding is in progress, false otherwise.
Reimplemented from AudioEncoder.
inline bool
start ( void )
throw ( Exception ) | start |
[virtual]
Start encoding. This function returns as soon as possible, with encoding started in the background.
Returns: true if encoding has started, false otherwise.
Throws: Exception
Reimplemented from AudioEncoder.
inline void
stop ( void )
throw ( Exception ) | stop |
[virtual]
Stop encoding. Stops the encoding running in the background.
Throws: Exception
Reimplemented from AudioEncoder.
bool
open ( void )
throw ( Exception ) | open |
[virtual]
Open an encoding session.
Returns: true if opening was successfull, false otherwise.
Throws: Exception
Reimplemented from Sink.
inline bool
isOpen ( void )
throw () | isOpen |
[const virtual]
Check if the encoding session is open.
Returns: true if the encoding session is open, false otherwise.
Reimplemented from Sink.
inline bool
canWrite ( unsigned int sec,
unsigned int usec )
throw ( Exception ) | canWrite |
[virtual]
Check if the encoder is ready to accept data.
Parameters:
sec | the maximum seconds to block. |
usec | micro seconds to block after the full seconds. |
Returns: true if the encoder is ready to accept data, false otherwise.
Throws: Exception
Reimplemented from Sink.
unsigned int
write ( const void * buf,
unsigned int len )
throw ( Exception ) | write |
[virtual]
Write data to the encoder. Buf is expected to be a sequence of big-endian 16 bit values, with left and right channels interleaved. Len is the number of bytes, must be a multiple of 4.
Parameters:
buf | the data to write. |
len | number of bytes to write from buf. |
Returns: the number of bytes written (may be less than len).
Throws: Exception
Reimplemented from Sink.
void
flush ( void )
throw ( Exception ) | flush |
[virtual]
Flush all data that was written to the encoder to the underlying connection.
Throws: Exception
Reimplemented from Sink.
void
close ( void )
throw ( Exception ) | close |
[virtual]
Close the encoding session.
Throws: Exception
Reimplemented from Sink.