Main Page | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | File Members

AacEncoder Class Reference

#include <AacEncoder.h>

Inheritance diagram for AacEncoder:

Inheritance graph
[legend]
Collaboration diagram for AacEncoder:

Collaboration graph
[legend]
List of all members.

Detailed Description

A class representing faac AAC encoder.

Author:
$Author$
Version:
$Revision$

Definition at line 71 of file AacEncoder.h.

Public Member Functions

 AacEncoder (Sink *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) throw ( Exception )
 Constructor.
 AacEncoder (Sink *sink, const AudioSource *as, BitrateMode outBitrateMode, unsigned int outBitrate, double outQuality, unsigned int outSampleRate=0, unsigned int outChannel=0) throw ( Exception )
 Constructor.
 AacEncoder (const AacEncoder &encoder) throw ( Exception )
 Copy constructor.
virtual ~AacEncoder (void) throw ( Exception )
 Destructor.
virtual AacEncoderoperator= (const AacEncoder &encoder) throw ( Exception )
 Assignment operator.
const char * getFaacVersion (void)
 Get the version string of the underlying faac library.
virtual bool isRunning (void) const throw ()
 Check wether encoding is in progress.
virtual bool start (void) throw ( Exception )
 Start encoding.
virtual void stop (void) throw ( Exception )
 Stop encoding.
virtual bool open (void) throw ( Exception )
 Open an encoding session.
virtual bool isOpen (void) const throw ()
 Check if the encoding session is open.
virtual bool canWrite (unsigned int sec, unsigned int usec) throw ( Exception )
 Check if the encoder is ready to accept data.
virtual unsigned int write (const void *buf, unsigned int len) throw ( Exception )
 Write data to the encoder.
virtual void flush (void) throw ( Exception )
 Flush all data that was written to the encoder to the underlying connection.
virtual void close (void) throw ( Exception )
 Close the encoding session.

Protected Member Functions

 AacEncoder (void) throw ( Exception )
 Default constructor.


Constructor & Destructor Documentation

AacEncoder::AacEncoder void   )  throw ( Exception ) [inline, protected]
 

Default constructor.

Always throws an Exception.

Exceptions:
Exception 

Definition at line 152 of file AacEncoder.h.

AacEncoder::AacEncoder Sink 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
throw ( Exception ) [inline]
 

Constructor.

Parameters:
sink the sink to send mp3 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.
outChannel number of channels of the output. If 0, inChannel is used.
Exceptions:
Exception 

Definition at line 178 of file AacEncoder.h.

AacEncoder::AacEncoder Sink sink,
const AudioSource as,
BitrateMode  outBitrateMode,
unsigned int  outBitrate,
double  outQuality,
unsigned int  outSampleRate = 0,
unsigned int  outChannel = 0
throw ( Exception ) [inline]
 

Constructor.

Parameters:
sink the sink to send mp3 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.
outChannel number of channels of the output. If 0, input channel is used.
Exceptions:
Exception 

Definition at line 219 of file AacEncoder.h.

AacEncoder::AacEncoder const AacEncoder encoder  )  throw ( Exception ) [inline]
 

Copy constructor.

Parameters:
encoder the AacEncoder to copy.

Definition at line 244 of file AacEncoder.h.

virtual AacEncoder::~AacEncoder void   )  throw ( Exception ) [inline, virtual]
 

Destructor.

Exceptions:
Exception 

Definition at line 258 of file AacEncoder.h.

References close(), and isOpen().


Member Function Documentation

virtual bool AacEncoder::canWrite unsigned int  sec,
unsigned int  usec
throw ( Exception ) [inline, 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.
Exceptions:
Exception 

Implements Sink.

Definition at line 365 of file AacEncoder.h.

References isOpen().

virtual void AacEncoder::close void   )  throw ( Exception ) [virtual]
 

Close the encoding session.

Exceptions:
Exception 

Implements Sink.

Referenced by stop(), and ~AacEncoder().

virtual void AacEncoder::flush void   )  throw ( Exception ) [virtual]
 

Flush all data that was written to the encoder to the underlying connection.

Exceptions:
Exception 

Implements Sink.

const char* AacEncoder::getFaacVersion void   )  [inline]
 

Get the version string of the underlying faac library.

Returns:
the version string of the underlying faac library.

Definition at line 291 of file AacEncoder.h.

virtual bool AacEncoder::isOpen void   )  const throw () [inline, virtual]
 

Check if the encoding session is open.

Returns:
true if the encoding session is open, false otherwise.

Implements Sink.

Definition at line 350 of file AacEncoder.h.

Referenced by canWrite(), isRunning(), and ~AacEncoder().

virtual bool AacEncoder::isRunning void   )  const throw () [inline, virtual]
 

Check wether encoding is in progress.

Returns:
true if encoding is in progress, false otherwise.

Implements AudioEncoder.

Definition at line 306 of file AacEncoder.h.

References isOpen().

virtual bool AacEncoder::open void   )  throw ( Exception ) [virtual]
 

Open an encoding session.

Returns:
true if opening was successfull, false otherwise.
Exceptions:
Exception 

Implements Sink.

Referenced by start().

virtual AacEncoder& AacEncoder::operator= const AacEncoder encoder  )  throw ( Exception ) [inline, virtual]
 

Assignment operator.

Parameters:
encoder the AacEncoder to assign this to.
Returns:
a reference to this AacEncoder.
Exceptions:
Exception 

Definition at line 274 of file AacEncoder.h.

References AudioEncoder::operator=().

virtual bool AacEncoder::start void   )  throw ( Exception ) [inline, virtual]
 

Start encoding.

This function returns as soon as possible, with encoding started in the background.

Returns:
true if encoding has started, false otherwise.
Exceptions:
Exception 

Implements AudioEncoder.

Definition at line 319 of file AacEncoder.h.

References open().

virtual void AacEncoder::stop void   )  throw ( Exception ) [inline, virtual]
 

Stop encoding.

Stops the encoding running in the background.

Exceptions:
Exception 

Implements AudioEncoder.

Definition at line 330 of file AacEncoder.h.

References close().

virtual unsigned int AacEncoder::write const void *  buf,
unsigned int  len
throw ( Exception ) [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).
Exceptions:
Exception 

Implements Sink.


The documentation for this class was generated from the following file:
Generated on Sat Apr 16 22:06:22 2005 for DarkIce by  doxygen 1.4.1