ucc::audiocodec Class Reference

Convert audio media. More...

#include <audio.h>

Inheritance diagram for ucc::audiocodec:
Inheritance graph
[legend]
Collaboration diagram for ucc::audiocodec:
Collaboration graph
[legend]

Public Member Functions

virtual unsigned autype (void)
 Get autype number for .au files, if exists.
virtual audiocodecbasetype (void)=0
 Basic codec type we are derived from.
virtual audiocodeccreate (caddr_t destination=((void *) 0), timeout_t framing=0)=0
 Derived copy operation.
virtual unsigned decode (encoded_t encoded, linear_t linear)
 Convert codec to linear data format.
virtual unsigned encode (linear_t linear, encoded_t encoded)
 Convert linear data to codec format.
virtual unsigned getActual (audio::encoded_t encoded)=0
 Get actual size of frame from frame header data.
virtual unsigned getAlignment (void)
 Get data alignment requirements for direct i/o operations.
virtual unsigned getBuffered (void)=0
 Get constant frame size if fixed, otherwise 0 if variable framing.
virtual unsigned getBuffering (void)
 Get the buffer size we use.
virtual unsigned getChannels (void)
 Get channel count for format.
virtual unsigned long getClock (void)
 Get the effective clock speed.
virtual timeout_t getFraming (void)
 Get time impulse of frame.
virtual unsigned getMaximum (void)=0
 Get maximum frame size for a given frame time.
virtual unsigned getMinimum (void)
 Get minimum i/o transfer size to determine frame size when variable framing is used.
virtual char * getName (void)=0
 Get codec name.
virtual unsigned getSize (void)=0
 Get effective size of codec, including any additional buffering needed to support the object if staged buffering is needed.
virtual void reset (void)
 Reset state information.
virtual bool test (char *name)=0
 Test by name or extension matching.

Static Public Member Functions

static audiocodecfind (char *name, audiocodec *channel=((void *) 0))
 Find codec by family name.
static audiocodecfirst (void)
 Get a listing of installed plugins.
static audiocodecget (char *name, audiocodec *channel=((void *) 0))
 Get an instance of a audiocodec by family name.

Data Fields

type_t type

Protected Member Functions

 audiocodec (audiocodec *original)

Protected Attributes

timeout_t framing
unsigned long rate

Friends

class audiobuffer

Detailed Description

Convert audio media.

This class is derived into media encoding format specific derived codec classes to support transcoding audio, usually to and from ulaw or linear audio frames.

Author:
David Sugar <dyfet@gnutelephony.org>

Definition at line 115 of file audio.h.


Member Function Documentation

virtual unsigned ucc::audiocodec::autype ( void   )  [virtual]

Get autype number for .au files, if exists.

Returns:
autype or 0 if not valid for au files.
virtual audiocodec* ucc::audiocodec::basetype ( void   )  [pure virtual]

Basic codec type we are derived from.

This is a pointer to a static object and is a kind of "type" system.

Returns:
base object type pointer.
virtual audiocodec* ucc::audiocodec::create ( caddr_t  destination = ((void *) 0),
timeout_t  framing = 0 
) [pure virtual]

Derived copy operation.

This is used to create a new local instance with initialized state inside another object. Commonly used to embed a codec into an audio buffer.

Parameters:
destination address to create object in, NULL if new.
framing to use if inserting a streaming codec.
Returns:
address of object created.
virtual unsigned ucc::audiocodec::decode ( encoded_t  encoded,
linear_t  linear 
) [virtual]

Convert codec to linear data format.

Parameters:
encoded samples to convert.
linear result.
Returns:
bytes encoded out.
virtual unsigned ucc::audiocodec::encode ( linear_t  linear,
encoded_t  encoded 
) [virtual]

Convert linear data to codec format.

Parameters:
linear samples to convert.
encoded result.
Returns:
bytes encoded out.
static audiocodec* ucc::audiocodec::find ( char *  name,
audiocodec channel = ((void *) 0) 
) [static]

Find codec by family name.

Parameters:
name or extension to search for.
channel codec property to optionally match with.
Returns:
codec object to use.
static audiocodec* ucc::audiocodec::first ( void   )  [static]

Get a listing of installed plugins.

This can be walked with the linked_pointer<> template.

Returns:
list of plugins.
static audiocodec* ucc::audiocodec::get ( char *  name,
audiocodec channel = ((void *) 0) 
) [static]

Get an instance of a audiocodec by family name.

Parameters:
name or extension to search for.
channel codec property to optionally match with.
Returns:
codec instance to use.
virtual unsigned ucc::audiocodec::getActual ( audio::encoded_t  encoded  )  [pure virtual]

Get actual size of frame from frame header data.

Parameters:
encoded audio frame.
Returns:
size of encoded frame.
virtual unsigned ucc::audiocodec::getAlignment ( void   )  [virtual]

Get data alignment requirements for direct i/o operations.

Returns:
data alignment or 0.
virtual unsigned ucc::audiocodec::getBuffered ( void   )  [pure virtual]

Get constant frame size if fixed, otherwise 0 if variable framing.

Returns:
constant frame size or 0.
virtual unsigned ucc::audiocodec::getBuffering ( void   )  [virtual]

Get the buffer size we use.

Returns:
size of buffer.
virtual unsigned ucc::audiocodec::getChannels ( void   )  [virtual]

Get channel count for format.

Returns:
number of channels.
virtual unsigned long ucc::audiocodec::getClock ( void   )  [virtual]

Get the effective clock speed.

Returns:
effective clock rate.
virtual timeout_t ucc::audiocodec::getFraming ( void   )  [virtual]

Get time impulse of frame.

Returns:
actual framing that will be used.
virtual unsigned ucc::audiocodec::getMaximum ( void   )  [pure virtual]

Get maximum frame size for a given frame time.

Returns:
maximum size of frame for framing, or 0 if invalid.
virtual unsigned ucc::audiocodec::getMinimum ( void   )  [virtual]

Get minimum i/o transfer size to determine frame size when variable framing is used.

Returns:
same as maximum if fixed framing, else minimum io.
virtual char* ucc::audiocodec::getName ( void   )  [pure virtual]

Get codec name.

Returns:
name of codec.
virtual unsigned ucc::audiocodec::getSize ( void   )  [pure virtual]

Get effective size of codec, including any additional buffering needed to support the object if staged buffering is needed.

Returns:
size of object + buffer.
virtual void ucc::audiocodec::reset ( void   )  [virtual]

Reset state information.

This is used to clear lookahead states when switching files or streams.

virtual bool ucc::audiocodec::test ( char *  name  )  [pure virtual]

Test by name or extension matching.

Parameters:
name to check.
Returns:
true if this is us.

The documentation for this class was generated from the following file:
Generated by  doxygen 1.6.2-20100208