OPAL Version 3.10.4

- Main Page
- Related Pages
- Namespaces
- Data Structures
- Files

- Data Structures
- Class Hierarchy
- Data Fields

Protected Attributes
OpalStreamedTranscoder Class Reference

`#include <transcoders.h>`

Inheritance diagram for OpalStreamedTranscoder:

## Public Member Functions

Construction
| OpalStreamedTranscoder (const OpalMediaFormat &inputMediaFormat, const OpalMediaFormat &outputMediaFormat, unsigned inputBits, unsigned outputBits)
Operations
virtual PINDEX | GetOptimalDataFrameSize (PBoolean input) const
virtual PBoolean | Convert (const RTP_DataFrame &input, RTP_DataFrame &output)
virtual int | ConvertOne (int sample) const =0
Public Member Functions inherited from OpalTranscoder
| OpalTranscoder (const OpalMediaFormat &inputMediaFormat, const OpalMediaFormat &outputMediaFormat)
virtual bool | UpdateMediaFormats (const OpalMediaFormat &inputMediaFormat, const OpalMediaFormat &outputMediaFormat)
virtual PBoolean | ExecuteCommand (const OpalMediaCommand &command)
virtual PBoolean | ConvertFrames (const RTP_DataFrame &input, RTP_DataFrameList &output)
PINDEX | GetMaxOutputSize () const
void | SetMaxOutputSize (PINDEX size)
void | SetCommandNotifier (const PNotifier &notifier)
const PNotifier & | GetCommandNotifier () const
void | NotifyCommand (const OpalMediaCommand &command) const
| Notify command notifier of command.
unsigned | GetSessionID () const
| Get session ID for the transcoder (from OpalMediaStream)
void | SetSessionID (unsigned id)
| Set session ID for the transcoder (from OpalMediaStream)
virtual void | SetInstanceID (const BYTE *instance, unsigned instanceLen)
RTP_DataFrame::PayloadTypes | GetPayloadType (PBoolean input) const
virtual bool | AcceptComfortNoise () const
virtual bool | AcceptEmptyPayload () const
virtual bool | AcceptOtherPayloads () const
virtual void | GetStatistics (OpalMediaStatistics &statistics) const
void | CopyTimestamp (RTP_DataFrame &dst, const RTP_DataFrame &src, bool inToOut) const
Public Member Functions inherited from OpalMediaFormatPair
| OpalMediaFormatPair (const OpalMediaFormat &inputMediaFormat, const OpalMediaFormat &outputMediaFormat)
void | PrintOn (ostream &strm) const
virtual Comparison | Compare (const PObject &obj) const
const OpalMediaFormat & | GetInputFormat () const
const OpalMediaFormat & | GetOutputFormat () const

## Protected Attributes

unsigned | inputBitsPerSample
unsigned | outputBitsPerSample
Protected Attributes inherited from OpalTranscoder
PINDEX | maxOutputSize
PNotifier | commandNotifier
PMutex | updateMutex
unsigned | m_sessionID
bool | outputIsRTP
bool | inputIsRTP
bool | acceptEmptyPayload
bool | acceptOtherPayloads
unsigned | m_inClockRate
unsigned | m_outClockRate
Protected Attributes inherited from OpalMediaFormatPair
OpalMediaFormat | inputMediaFormat
OpalMediaFormat | outputMediaFormat

## Additional Inherited Members

static OpalTranscoder * | Create (const OpalMediaFormat &srcFormat, const OpalMediaFormat &dstFormat, const BYTE *instance=NULL, unsigned instanceLen=0)
static bool | SelectFormats (const OpalMediaType &mediaType, const OpalMediaFormatList &srcFormats, const OpalMediaFormatList &dstFormats, const OpalMediaFormatList &allFormats, OpalMediaFormat &srcFormat, OpalMediaFormat &dstFormat)
static bool | FindIntermediateFormat (const OpalMediaFormat &srcFormat, const OpalMediaFormat &dstFormat, OpalMediaFormat &intermediateFormat)
static OpalMediaFormatList | GetDestinationFormats (const OpalMediaFormat &srcFormat)
static OpalMediaFormatList | GetSourceFormats (const OpalMediaFormat &dstFormat)
static OpalMediaFormatList | GetPossibleFormats (const OpalMediaFormatList &formats)

## 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
| ) |  |

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

## Member Function Documentation

virtual PBoolean 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.

Reimplemented in Opal_G711_PCM.

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_PCM_Linear16Mono, Opal_Linear16Mono_PCM, OpalPluginStreamedAudioTranscoder, Opal_PCM_G711_ALaw, Opal_G711_ALaw_PCM, Opal_PCM_G711_uLaw, and Opal_G711_uLaw_PCM.

virtual PINDEX OpalStreamedTranscoder::GetOptimalDataFrameSize | ( | PBoolean | 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.

## Field Documentation

unsigned OpalStreamedTranscoder::inputBitsPerSample

protected

unsigned OpalStreamedTranscoder::outputBitsPerSample

protected

The documentation for this class was generated from the following file:

- transcoders.h