Convert audio media. More...
#include <audio.h>
Public Member Functions | |
virtual unsigned | autype (void) const |
Get autype number for .au files, if exists. | |
virtual const audiocodec * | basetype (void) const =0 |
Basic codec type we are derived from. | |
virtual audiocodec * | create (caddr_t destination=NULL, timeout_t framing=0) const =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) const =0 |
Get actual size of frame from frame header data. | |
virtual unsigned | getAlignment (void) const |
Get data alignment requirements for direct i/o operations. | |
virtual unsigned | getBuffered (void) const =0 |
Get constant frame size if fixed, otherwise 0 if variable framing. | |
virtual unsigned | getBuffering (void) const |
Get the buffer size we use. | |
virtual unsigned | getChannels (void) const |
Get channel count for format. | |
virtual unsigned long | getClock (void) const |
Get the effective clock speed. | |
virtual timeout_t | getFraming (void) const |
Get time impulse of frame. | |
virtual unsigned | getMaximum (void) const =0 |
Get maximum frame size for a given frame time. | |
virtual unsigned | getMinimum (void) const |
Get minimum i/o transfer size to determine frame size when variable framing is used. | |
virtual const char * | getName (void) const =0 |
Get codec name. | |
virtual unsigned | getSize (void) const =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 (const char *name) const =0 |
Test by name or extension matching. | |
Static Public Member Functions | |
static const audiocodec * | find (const char *name, const audiocodec *channel=NULL) |
Find codec by family name. | |
static audiocodec * | first (void) |
Get a listing of installed plugins. | |
static audiocodec * | get (const char *name, const audiocodec *channel=NULL) |
Get an instance of a audiocodec by family name. | |
Data Fields | |
type_t | type |
Protected Member Functions | |
audiocodec (const audiocodec *original) | |
Protected Attributes | |
timeout_t | framing |
unsigned long | rate |
Friends | |
class | audiobuffer |
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.
Definition at line 115 of file audio.h.
virtual unsigned ucc::audiocodec::autype | ( | void | ) | const [virtual] |
Get autype number for .au files, if exists.
virtual const audiocodec* ucc::audiocodec::basetype | ( | void | ) | const [pure virtual] |
Basic codec type we are derived from.
This is a pointer to a static object and is a kind of "type" system.
virtual audiocodec* ucc::audiocodec::create | ( | caddr_t | destination = NULL , |
|
timeout_t | framing = 0 | |||
) | const [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.
destination | address to create object in, NULL if new. | |
framing | to use if inserting a streaming codec. |
virtual unsigned ucc::audiocodec::decode | ( | encoded_t | encoded, | |
linear_t | linear | |||
) | [virtual] |
Convert codec to linear data format.
encoded | samples to convert. | |
linear | result. |
virtual unsigned ucc::audiocodec::encode | ( | linear_t | linear, | |
encoded_t | encoded | |||
) | [virtual] |
Convert linear data to codec format.
linear | samples to convert. | |
encoded | result. |
static const audiocodec* ucc::audiocodec::find | ( | const char * | name, | |
const audiocodec * | channel = NULL | |||
) | [static] |
Find codec by family name.
name | or extension to search for. | |
channel | codec property to optionally match with. |
static audiocodec* ucc::audiocodec::first | ( | void | ) | [static] |
Get a listing of installed plugins.
This can be walked with the linked_pointer<> template.
static audiocodec* ucc::audiocodec::get | ( | const char * | name, | |
const audiocodec * | channel = NULL | |||
) | [static] |
Get an instance of a audiocodec by family name.
name | or extension to search for. | |
channel | codec property to optionally match with. |
virtual unsigned ucc::audiocodec::getActual | ( | audio::encoded_t | encoded | ) | const [pure virtual] |
Get actual size of frame from frame header data.
encoded | audio frame. |
virtual unsigned ucc::audiocodec::getAlignment | ( | void | ) | const [virtual] |
Get data alignment requirements for direct i/o operations.
virtual unsigned ucc::audiocodec::getBuffered | ( | void | ) | const [pure virtual] |
Get constant frame size if fixed, otherwise 0 if variable framing.
virtual unsigned ucc::audiocodec::getBuffering | ( | void | ) | const [virtual] |
Get the buffer size we use.
virtual unsigned ucc::audiocodec::getChannels | ( | void | ) | const [virtual] |
Get channel count for format.
virtual unsigned long ucc::audiocodec::getClock | ( | void | ) | const [virtual] |
Get the effective clock speed.
virtual timeout_t ucc::audiocodec::getFraming | ( | void | ) | const [virtual] |
Get time impulse of frame.
virtual unsigned ucc::audiocodec::getMaximum | ( | void | ) | const [pure virtual] |
Get maximum frame size for a given frame time.
virtual unsigned ucc::audiocodec::getMinimum | ( | void | ) | const [virtual] |
Get minimum i/o transfer size to determine frame size when variable framing is used.
virtual const char* ucc::audiocodec::getName | ( | void | ) | const [pure virtual] |
Get codec name.
virtual unsigned ucc::audiocodec::getSize | ( | void | ) | const [pure virtual] |
Get effective size of codec, including any additional buffering needed to support the object if staged buffering is needed.
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 | ( | const char * | name | ) | const [pure virtual] |
Test by name or extension matching.
name | to check. |