class H323_LIDCodec

This class is a LID codec that only converts data for playback on some other audio device

Inheritance:


Public Methods

[more] H323_LIDCodec ( const char* mediaFormat, Direction direction, unsigned numFrames, PINDEX codecTableIndex )
Create a new LID based codec.
[more]virtual BOOL Read ( BYTE* buffer, unsigned & length, RTP_DataFrame & rtpFrame )
Encode the data from the appropriate device.
[more]virtual BOOL Write ( const BYTE* buffer, unsigned length, const RTP_DataFrame & frame, unsigned & written )
Decode the data and output it to appropriate device.
[more]virtual BOOL IsRawDataChannelNative () const
Return flag indicating raw channel is native.
[more]virtual BOOL DetectSilence ()
Check frame for a talk burst.
[more]virtual unsigned GetAverageSignalLevel ()
Calculate the energy in the audio stream.


Inherited from H323AudioCodec:

Public Methods

ovirtual BOOL Open( H323Connection & connection )
ovirtual void Close()
ovirtual unsigned GetFrameRate() const
ovoid SetSilenceDetectionMode( SilenceDetectionMode mode, unsigned threshold = 0, unsigned signalDeadband = 80, unsigned silenceDeadband = 3200, unsigned adaptivePeriod = 4800 )
oSilenceDetectionMode GetSilenceDetectionMode( BOOL* isInTalkBurst = NULL, unsigned* currentThreshold = NULL ) const


Inherited from H323Codec:

Public Methods

ovirtual void OnFlowControl( long bitRateRestriction )
ovirtual void OnMiscellaneousCommand( const H245_MiscellaneousCommand_type & type )
ovirtual void OnMiscellaneousIndication( const H245_MiscellaneousIndication_type & type )
ovirtual BOOL AttachChannel( PChannel* channel, BOOL autoDelete = TRUE )
ovirtual PChannel* SwapChannel( PChannel* newChannel, BOOL autoDelete = TRUE )
ovirtual BOOL CloseRawDataChannel()
oPChannel* GetRawDataChannel()
oBOOL ReadRaw( void* data, PINDEX size, PINDEX & length )
oBOOL WriteRaw( void* data, PINDEX length )
oBOOL AttachLogicalChannel(H323Channel* channel)
ovoid AddFilter( const PNotifier & notifier )


Documentation

This class is a LID codec that only converts data for playback on some other audio device
o H323_LIDCodec( const char* mediaFormat, Direction direction, unsigned numFrames, PINDEX codecTableIndex )
Create a new LID based codec.
Parameters:
mediaFormat - Media format for codec
direction - Direction in which this instance runs
numFrames - Number of frames to transmit in packet
codecTableIndex - Type of codec to use

ovirtual BOOL Read( BYTE* buffer, unsigned & length, RTP_DataFrame & rtpFrame )
Encode the data from the appropriate device. This will encode a frame of data for transmission. The exact size and description of the data placed in the buffer is codec dependent but should be less than H323Capability::GetTxFramesInPacket() * OpalMediaFormat::GetFrameSize() in length.

The length parameter is filled with the actual length of the encoded data, often this will be the same as the size parameter.

This function is called every GetFrameRate() timestamp units, so MUST take less than (or equal to) that amount of time to complete!

Note that a returned length of zero indicates that time has passed but there is no data encoded. This is typically used for silence detection in an audio codec.

Parameters:
buffer - Buffer of encoded data
length - Actual length of encoded data buffer
rtpFrame - RTP data frame

ovirtual BOOL Write( const BYTE* buffer, unsigned length, const RTP_DataFrame & frame, unsigned & written )
Decode the data and output it to appropriate device. This will decode a single frame of received data. The exact size and description of the data required in the buffer is codec dependent but should be less than H323Capability::GetRxFramesInPacket() * OpalMediaFormat::GetFrameSize() in length.

It is expected this function anunciates the data. That is, for example with audio data, the sound is output on a speaker.

This function is called every GetFrameRate() timestamp units, so MUST take less than that amount of time to complete!

Parameters:
buffer - Buffer of encoded data
length - Length of encoded data buffer
frame - Entire RTP frame
written - Number of bytes used from data buffer

ovirtual BOOL IsRawDataChannelNative() const
Return flag indicating raw channel is native. For audio codecs, FALSE typically means that the format is PCM-16. For video codecs, FALSE typically means that the format is YUV411P.

The default behaviour returns TRUE.

ovirtual BOOL DetectSilence()
Check frame for a talk burst. This does the deadband calculations on the average signal levels returned by the GetAverageSignalLevel() function and based on the levelThreshold, signalDeadbandFrames and silenceDeadbandFrames member variables.

ovirtual unsigned GetAverageSignalLevel()
Calculate the energy in the audio stream. This is called from within DetectSilence() to calculate the average energy since the last call to DetectSilence().


This class has no child classes.

Alphabetic index HTML hierarchy of classes or Java



This page was generated with the help of DOC++.