OpalFramedTranscoder Class Reference

#include <transcoders.h>

Inheritance diagram for OpalFramedTranscoder:

OpalTranscoder OpalMediaFormatPair Opal_GSM0610 Opal_iLBC_Decoder Opal_iLBC_Encoder Opal_LPC10_PCM Opal_MSIMA_PCM Opal_PCM_LPC10 Opal_PCM_MSIMA Opal_Speex_Transcoder List of all members.

Public Member Functions

Construction
 OpalFramedTranscoder (const OpalMediaFormat &inputMediaFormat, const OpalMediaFormat &outputMediaFormat, PINDEX inputBytesPerFrame, PINDEX outputBytesPerFrame)
Operations
virtual PINDEX GetOptimalDataFrameSize (BOOL input) const
virtual BOOL Convert (const RTP_DataFrame &input, RTP_DataFrame &output)
virtual BOOL ConvertFrame (const BYTE *input, BYTE *output)
virtual BOOL ConvertFrame (const BYTE *input, PINDEX &consumed, BYTE *output, PINDEX &created)
virtual BOOL ConvertSilentFrame (BYTE *output)

Protected Attributes

PINDEX inputBytesPerFrame
PINDEX outputBytesPerFrame

Detailed Description

This class defines a transcoder implementation class that will encode/decode fixed sized blocks. That is each input block of n bytes is encoded to exactly m bytes of data, eg GSM etc.

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


Constructor & Destructor Documentation

OpalFramedTranscoder::OpalFramedTranscoder ( const OpalMediaFormat inputMediaFormat,
const OpalMediaFormat outputMediaFormat,
PINDEX  inputBytesPerFrame,
PINDEX  outputBytesPerFrame 
)

Create a new framed transcoder implementation.

Parameters:
inputMediaFormat  Input media format
outputMediaFormat  Output media format
inputBytesPerFrame  Number of bytes in an input frame
outputBytesPerFrame  Number of bytes in an output frame


Member Function Documentation

virtual BOOL OpalFramedTranscoder::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.

Reimplemented in Opal_GSM0610_PCM.

virtual BOOL OpalFramedTranscoder::ConvertFrame ( const BYTE *  input,
PINDEX &  consumed,
BYTE *  output,
PINDEX &  created 
) [virtual]

Parameters:
input  Input data
consumed  number of input bytes consumed
output  Output data
created  number of output bytes created

virtual BOOL OpalFramedTranscoder::ConvertFrame ( const BYTE *  input,
BYTE *  output 
) [virtual]

Convert a frame of data from one format to another. This function implicitly knows the input and output frame sizes.

Parameters:
input  Input data
output  Output data

Reimplemented in Opal_GSM0610_PCM, Opal_PCM_GSM0610, Opal_iLBC_Decoder, Opal_iLBC_Encoder, Opal_LPC10_PCM, Opal_PCM_LPC10, Opal_MSGSM_PCM, Opal_PCM_MSGSM, Opal_MSIMA_PCM, Opal_PCM_MSIMA, Opal_Speex_Decoder, and Opal_Speex_Encoder.

virtual BOOL OpalFramedTranscoder::ConvertSilentFrame ( BYTE *  output  )  [virtual]

Parameters:
output  Output data

Reimplemented in Opal_Speex_Decoder.

virtual PINDEX OpalFramedTranscoder::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.


Member Data Documentation

PINDEX OpalFramedTranscoder::inputBytesPerFrame [protected]

PINDEX OpalFramedTranscoder::outputBytesPerFrame [protected]


The documentation for this class was generated from the following file:
Generated on Mon Sep 25 16:21:51 2006 for OPAL by  doxygen 1.4.7