Section: C Library Functions (3)Updated: 1 May 2009Local indexUp
NAME
ost::AudioCodec - The codec class is a virtual used for transcoding audio samples between linear frames (or other known format) and an encoded 'sample' buffer.
AudioCodec (const char *name, Encodingencoding)
Base for codecs, create a named coded of a specific encoding.
virtual ~AudioCodec ()
virtual LevelgetImpulse (void *buffer, unsigned number=0)
Get the impulse energy level of a frame of X samples in the specified codec format.
virtual LevelgetPeak (void *buffer, unsigned number=0)
Get the peak energy level within the frame of X samples.
virtual bool isSilent (Level threashold, void *buffer, unsigned number=0)
Signal if the current audio frame is silent.
virtual unsigned encode (Linear buffer, void *dest, unsigned number=0)=0
Encode a linear sample frame into the codec sample buffer.
virtual unsigned encodeBuffered (Linear Buffer, Encoded dest, unsigned number)
Encode linear samples buffered into the coded.
virtual unsigned decode (Linear buffer, void *source, unsigned number=0)=0
Decode the sample frame into linear samples.
virtual unsigned decodeBuffered (Linear buffer, Encoded source, unsigned len)
Buffer and decode data into linear samples.
virtual unsigned getEstimated (void)
Get estimated data required for buffered operations.
virtual unsigned getRequired (void)
get required samples for encoding.
virtual unsigned getPacket (Encoded destination, Encoded data, unsigned size)
Get a packet of data rather than decode. InfogetInfo (void)
Get an info description for this codec.
Static Public Member Functions
static void endCodec (AudioCodec *codec)
End use of a requested codec.
static AudioCodec * getCodec (Encodingencoding, const char *format=NULL, bool loaded=false)
Get the codec base class for accessing a specific derived codec identified by encoding type and optional spd info.
static AudioCodec * getCodec (Info &info, bool loaded=false)
Get the codec base class for accessing a specific derived codec identified by audio source descriptor.
static bool load (const char *name)
Load a named codec set into process memory.
static bool load (Encodingencoding)
Find and load a codec file by it's encoding type.
Protected Member Functions
AudioCodec ()
virtual AudioCodec * getByFormat (const char *format)
often used to create a 'new' codec of a subtype based on encoding format, default returns the current codec entity.
virtual AudioCodec * getByInfo (Info &info)
get a codec by audio source info descriptor.
Protected Attributes
AudioCodec * next
Encodingencoding
const char * name
Infoinfo
Static Protected Attributes
static AudioCodec * first
Detailed Description
The codec class is a virtual used for transcoding audio samples between linear frames (or other known format) and an encoded 'sample' buffer.
This class is only abstract and describes the core interface for loadable codec modules. This class is normally merged with AudioSample. A derived AudioCodecXXX will typically include a AudioRegisterXXX static class to automatically initialize and register the codec with the codec registry.