OpalStreamedTranscoder Class Reference

#include <transcoders.h>

Inheritance diagram for OpalStreamedTranscoder:

OpalTranscoder OpalMediaFormatPair Opal_G711_ALaw_PCM Opal_G711_uLaw_PCM Opal_Linear16Mono_PCM Opal_PCM_G711_ALaw Opal_PCM_G711_uLaw Opal_PCM_Linear16Mono List of all members.

Public Member Functions

Operations
virtual PINDEX GetOptimalDataFrameSize (BOOL input) const
virtual BOOL Convert (const RTP_DataFrame &input, RTP_DataFrame &output)
virtual int ConvertOne (int sample) const=0

Protected Attributes

unsigned inputBitsPerSample
unsigned outputBitsPerSample
PINDEX optimalSamples

Detailed Description

This class defines a transcoder implementation class where the encode/decode is streamed. That is each input n bit PCM sample is encoded to m bits of encoded data, eg G.711 etc.

An application may create a descendent off this class and override functions as required for descibing a specific transcoder.


Constructor & Destructor Documentation

OpalStreamedTranscoder::OpalStreamedTranscoder ( const OpalMediaFormat inputMediaFormat,
const OpalMediaFormat outputMediaFormat,
unsigned  inputBits,
unsigned  outputBits,
PINDEX  optimalSamples 
)

Create a new streamed transcoder implementation.

Parameters:
inputMediaFormat  Input media format
outputMediaFormat  Output media format
inputBits  Bits per sample in input data
outputBits  Bits per sample in output data
optimalSamples  Optimal number of samples for read

OpalStreamedTranscoder::OpalStreamedTranscoder ( const OpalMediaFormat inputMediaFormat,
const OpalMediaFormat outputMediaFormat,
unsigned  inputBits,
unsigned  outputBits,
PINDEX  optimalSamples 
)

Create a new streamed transcoder implementation.

Parameters:
inputMediaFormat  Input media format
outputMediaFormat  Output media format
inputBits  Bits per sample in input data
outputBits  Bits per sample in output data
optimalSamples  Optimal number of samples for read


Member Function Documentation

virtual PINDEX OpalStreamedTranscoder::GetOptimalDataFrameSize ( BOOL  input  )  const [virtual]

Get the optimal size for data frames to be converted. This function returns the size of frames that will be most efficient in conversion. A RTP_DataFrame will attempt to provide or use data in multiples of this size. Note that it may not do so, so the transcoder must be able to handle any sized packets.

Parameters:
input  Flag for input or output data size

Implements OpalTranscoder.

virtual BOOL OpalStreamedTranscoder::Convert ( const RTP_DataFrame input,
RTP_DataFrame output 
) [virtual]

Convert the data from one format to another. This function takes the input data as a RTP_DataFrame and converts it to its output format, placing it into the RTP_DataFrame provided.

Returns FALSE if the conversion fails.

Parameters:
input  Input data
output  Output data

Implements OpalTranscoder.

virtual int OpalStreamedTranscoder::ConvertOne ( int  sample  )  const [pure virtual]

Convert one sample from one format to another. This function takes the input data as a single sample value and converts it to its output format.

Returns converted value.

Implemented in Opal_G711_uLaw_PCM, Opal_PCM_G711_uLaw, Opal_G711_ALaw_PCM, Opal_PCM_G711_ALaw, Opal_Linear16Mono_PCM, and Opal_PCM_Linear16Mono.


Member Data Documentation

unsigned OpalStreamedTranscoder::inputBitsPerSample [protected]

unsigned OpalStreamedTranscoder::outputBitsPerSample [protected]

PINDEX OpalStreamedTranscoder::optimalSamples [protected]


The documentation for this class was generated from the following file:
Generated on Fri Mar 7 06:34:05 2008 for OPAL by  doxygen 1.5.1