class VorbisLibEncoder

A class representing the ogg vorbis encoder linked as a shared object or as a static library. More...

Definition#include <VorbisLibEncoder.h>
InheritsAudioEncoder [public ], Reporter [public virtual ]
List of all Methods
Annotated List
Files
Globals
Hierarchy
Index

Public Methods

Protected Methods

Private Methods

Private Members


Detailed Description

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:
sinkthe sink to send encoded output to
themaximum 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:
sinkthe sink to send encoded output to
inSampleRatesample rate of the input.
inBitsPerSamplenumber of bits per sample of the input.
inChannelnumber of channels of the input.
inBigEndianshows if the input is big or little endian
outBitrateModethe bit rate mode of the output.
outBitratebit rate of the output (kbits/sec).
outQualitythe quality of the stream.
outSampleRatesample rate of the output. If 0, inSampleRate is used.
outMaxBitratemaximum output bitrate. 0 if not used.
outChannelnumber 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:
sinkthe sink to send encoded output to
asget input sample rate, bits per sample and channels from this AudioSource.
outBitrateModethe bit rate mode of the output.
outBitratebit rate of the output (kbits/sec).
outQualitythe quality of the stream.
outSampleRatesample rate of the output. If 0, input sample rate is used.
outMaxBitratemaximum output bitrate. 0 if not used.
outChannelnumber of channels of the output. If 0, input channel is used.

Throws: Exception

inline  VorbisLibEncoder ( const VorbisLibEncoder & encoder )
throw ( Exception )

VorbisLibEncoder

Copy constructor.

Parameters:
encoderthe 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:
encoderthe 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:
secthe maximum seconds to block.
usecmicro 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:
bufthe data to write.
lennumber 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.