sipxmedialib  Version 3.3
Static Protected Attributes | List of all members
MpAgcBase Class Referenceabstract

Base class for AGC algorithm. More...

#include <MpAgcBase.h>

Inheritance diagram for MpAgcBase:
Inheritance graph
[legend]

Static Protected Attributes

static UtlString smDefaultAlgorithm
 Name of algorithm to be used by default. More...
 

Creators

static MpAgcBasecreateAgc (const UtlString &name="")
 Factory method for VAD algorithms creation. More...
 
virtual OsStatus init (int samplerate)=0
 Initialize AGC with given sample rate. More...
 
virtual ~MpAgcBase ()
 Destructor. More...
 
virtual void reset ()=0
 Reset. More...
 

Manipulators

static void setDefaultAlgorithm (const UtlString &name)
 Set algorithm to be used by default. More...
 
virtual OsStatus processFrame (const MpAudioSample *data, int count)=0
 Calculate amplitude of the frame. More...
 

Accessors

virtual OsStatus getAmplitude (MpAudioSample &amp, UtlBoolean &isClipped)=0
 Get amplitude of the last processed frame. More...
 

Detailed Description

Base class for AGC algorithm.

Constructor & Destructor Documentation

virtual ~MpAgcBase ( )
inlinevirtual

Destructor.

Member Function Documentation

MpAgcBase * createAgc ( const UtlString &  name = "")
static

Factory method for VAD algorithms creation.

Parameters
[in]name- name of AGC algorithm to use. Use empty string to get default algorithm.
Returns
Method never returns NULL. If appropriate AGC algorithm is not found, default one is returned.
virtual OsStatus init ( int  samplerate)
pure virtual

Initialize AGC with given sample rate.

Should be called before any other class methods.

Implemented in MpAgcSimple.

virtual void reset ( )
pure virtual

Reset.

Implemented in MpAgcSimple.

virtual OsStatus processFrame ( const MpAudioSample data,
int  count 
)
pure virtual

Calculate amplitude of the frame.

Implemented in MpAgcSimple.

void setDefaultAlgorithm ( const UtlString &  name)
static

Set algorithm to be used by default.

Initially default algorithm is defined at compile time. Using this function you can change default algorithm at run-time or switch back to compile-time default.

Parameters
[in]name- name of algorithm to use by default. Reverts to compile-time default if empty.
virtual OsStatus getAmplitude ( MpAudioSample amp,
UtlBoolean &  isClipped 
)
pure virtual

Get amplitude of the last processed frame.

Implemented in MpAgcSimple.

Member Data Documentation

UtlString smDefaultAlgorithm
staticprotected

Name of algorithm to be used by default.