OpalJitterBuffer Class Reference

`#include <jitter.h>`

Inheritance diagram for OpalJitterBuffer:

## Public Member Functions

Construction
| OpalJitterBuffer (unsigned minJitterDelay, unsigned maxJitterDelay, unsigned timeUnits=8, PINDEX packetSize=2048)
virtual | ~OpalJitterBuffer ()
Overrides from PObject
void | PrintOn (ostream &strm) const
Operations
void | SetDelay (unsigned minJitterDelay, unsigned maxJitterDelay, PINDEX packetSize=2048)
void | Reset ()
virtual PBoolean | WriteData (const RTP_DataFrame &frame, const PTimeInterval &tick=0)
virtual PBoolean | ReadData (RTP_DataFrame &frame, const PTimeInterval &tick=0)
DWORD | GetCurrentJitterDelay () const
DWORD | GetMinJitterDelay () const
DWORD | GetMaxJitterDelay () const
unsigned | GetTimeUnits () const
DWORD | GetPacketsTooLate () const
DWORD | GetBufferOverruns () const
DWORD | GetMaxConsecutiveMarkerBits () const
void | SetMaxConsecutiveMarkerBits (DWORD max)

## Protected Types

enum | { e_SynchronisationStart, e_SynchronisationFill, e_SynchronisationShrink, e_SynchronisationDone }
typedef std::map< DWORD, RTP_DataFrame > | FrameMap

## Protected Member Functions

DWORD | CalculateRequiredTimestamp (DWORD playOutTimestamp) const
bool | AdjustCurrentJitterDelay (int delta)

## Protected Attributes

unsigned | m_timeUnits
PINDEX | m_packetSize
DWORD | m_minJitterDelay
| Minimum jitter delay in timestamp units. More...
DWORD | m_maxJitterDelay
| Maximum jitter delay in timestamp units. More...
int | m_jitterGrowTime
| Amaint to increase jitter delay by when get "late" packet. More...
DWORD | m_jitterShrinkPeriod
int | m_jitterShrinkTime
| Amount to shrink jitter delay by if consistently filled. More...
DWORD | m_silenceShrinkPeriod
| Reduce jitter delay is silent for this long. More...
int | m_silenceShrinkTime
| Amount to shrink jitter delay by if consistently silent. More...
DWORD | m_jitterDriftPeriod
int | m_currentJitterDelay
DWORD | m_packetsTooLate
DWORD | m_bufferOverruns
DWORD | m_consecutiveMarkerBits
DWORD | m_maxConsecutiveMarkerBits
DWORD | m_consecutiveLatePackets
DWORD | m_averageFrameTime
DWORD | m_lastTimestamp
DWORD | m_lastSyncSource
DWORD | m_bufferFilledTime
DWORD | m_bufferLowTime
DWORD | m_bufferEmptiedTime
int | m_timestampDelta
enum OpalJitterBuffer:: { ... } | m_synchronisationState
FrameMap | m_frames
PMutex | m_bufferMutex
RTP_JitterBufferAnalyser * | m_analyser

## Detailed Description

This is an Abstract jitter buffer, which can be used simply in any application. The user is required to use a descendant of this class, and provide a "OnReadPacket" method, so that network packets can be placed in this class instance

## Member Typedef Documentation

typedef std::map<DWORD, RTP_DataFrame> OpalJitterBuffer::FrameMap

protected

## Member Enumeration Documentation

anonymous enum

protected

Enumerator
e_SynchronisationStart |
e_SynchronisationFill |
e_SynchronisationShrink |
e_SynchronisationDone |

## Constructor & Destructor Documentation

OpalJitterBuffer::OpalJitterBuffer | ( | unsigned | minJitterDelay,
|  | unsigned | maxJitterDelay,
|  | unsigned | timeUnits = `8`,
|  | PINDEX | packetSize = `2048`
| ) |  |

Constructor for this jitter buffer. The size of this buffer can be altered later with the SetDelay method

Parameters

  minJitterDelay | Minimum delay in RTP timestamp units
  maxJitterDelay | Maximum delay in RTP timestamp units
  timeUnits | Time units, usually 8 or 16
  packetSize | Max RTP packet size

virtual OpalJitterBuffer::~OpalJitterBuffer | ( |  | ) |

virtual

Destructor, which closes this down and deletes the internal list of frames

## Member Function Documentation

bool OpalJitterBuffer::AdjustCurrentJitterDelay | ( | int | delta | ) |

protected

DWORD OpalJitterBuffer::CalculateRequiredTimestamp | ( | DWORD | playOutTimestamp | ) | const

protected

DWORD OpalJitterBuffer::GetBufferOverruns | ( |  | ) | const

inline

Get total number received packets that overran the jitter buffer.

References m_bufferOverruns.

DWORD OpalJitterBuffer::GetCurrentJitterDelay | ( |  | ) | const

inline

Get current delay for jitter buffer.

References m_currentJitterDelay.

DWORD OpalJitterBuffer::GetMaxConsecutiveMarkerBits | ( |  | ) | const

inline

Get maximum consecutive marker bits before buffer starts to ignore them.

References m_maxConsecutiveMarkerBits.

DWORD OpalJitterBuffer::GetMaxJitterDelay | ( |  | ) | const

inline

Get maximum delay for jitter buffer.

References m_maxJitterDelay.

DWORD OpalJitterBuffer::GetMinJitterDelay | ( |  | ) | const

inline

Get minimum delay for jitter buffer.

References m_minJitterDelay.

DWORD OpalJitterBuffer::GetPacketsTooLate | ( |  | ) | const

inline

Get total number received packets too late to go into jitter buffer.

References m_packetsTooLate.

unsigned OpalJitterBuffer::GetTimeUnits | ( |  | ) | const

inline

Get time units.

References m_timeUnits.

void OpalJitterBuffer::PrintOn | ( | ostream & | strm | ) | const

Report the statistics for this jitter instance

virtual PBoolean OpalJitterBuffer::ReadData | ( | RTP_DataFrame & | frame,
|  | const PTimeInterval & | tick = `0`
| ) |  |

virtual

Read a data frame from the jitter buffer. This function never blocks. If no data is available, an RTP packet with zero payload size is returned.

Parameters

  frame | Frame to extract from jitter buffer
  tick | Real time tick for packet removal

void OpalJitterBuffer::Reset | ( |  | ) |

Reset jitter buffer.

void OpalJitterBuffer::SetDelay | ( | unsigned | minJitterDelay,
|  | unsigned | maxJitterDelay,
|  | PINDEX | packetSize = `2048`
| ) |  |

Set the maximum delay the jitter buffer will operate to.

Parameters

  minJitterDelay | Minimum delay in RTP timestamp units
  maxJitterDelay | Maximum delay in RTP timestamp units
  packetSize | Max RTP packet size

void OpalJitterBuffer::SetMaxConsecutiveMarkerBits | ( | DWORD | max | ) |

inline

Set maximum consecutive marker bits before buffer starts to ignore them.

References m_maxConsecutiveMarkerBits.

virtual PBoolean OpalJitterBuffer::WriteData | ( | const RTP_DataFrame & | frame,
|  | const PTimeInterval & | tick = `0`
| ) |  |

virtual

Write data frame from the RTP channel.

Parameters

  frame | Frame to feed into jitter buffer
  tick | Real time tick for packet arrival

## Field Documentation

RTP_JitterBufferAnalyser* OpalJitterBuffer::m_analyser

protected

DWORD OpalJitterBuffer::m_averageFrameTime

protected

DWORD OpalJitterBuffer::m_bufferEmptiedTime

protected

DWORD OpalJitterBuffer::m_bufferFilledTime

protected

DWORD OpalJitterBuffer::m_bufferLowTime

protected

PMutex OpalJitterBuffer::m_bufferMutex

protected

DWORD OpalJitterBuffer::m_bufferOverruns

protected

Referenced by GetBufferOverruns().

DWORD OpalJitterBuffer::m_consecutiveLatePackets

protected

DWORD OpalJitterBuffer::m_consecutiveMarkerBits

protected

int OpalJitterBuffer::m_currentJitterDelay

protected

Referenced by GetCurrentJitterDelay().

FrameMap OpalJitterBuffer::m_frames

protected

DWORD OpalJitterBuffer::m_jitterDriftPeriod

protected

int OpalJitterBuffer::m_jitterGrowTime

protected

Amaint to increase jitter delay by when get "late" packet.

DWORD OpalJitterBuffer::m_jitterShrinkPeriod

protected

Period (in timestamp units) over which buffer is consistently filled before shrinking

int OpalJitterBuffer::m_jitterShrinkTime

protected

Amount to shrink jitter delay by if consistently filled.

DWORD OpalJitterBuffer::m_lastSyncSource

protected

DWORD OpalJitterBuffer::m_lastTimestamp

protected

DWORD OpalJitterBuffer::m_maxConsecutiveMarkerBits

protected

Referenced by GetMaxConsecutiveMarkerBits(), and SetMaxConsecutiveMarkerBits().

DWORD OpalJitterBuffer::m_maxJitterDelay

protected

Maximum jitter delay in timestamp units.

Referenced by GetMaxJitterDelay().

DWORD OpalJitterBuffer::m_minJitterDelay

protected

Minimum jitter delay in timestamp units.

Referenced by GetMinJitterDelay().

PINDEX OpalJitterBuffer::m_packetSize

protected

DWORD OpalJitterBuffer::m_packetsTooLate

protected

Referenced by GetPacketsTooLate().

DWORD OpalJitterBuffer::m_silenceShrinkPeriod

protected

Reduce jitter delay is silent for this long.

int OpalJitterBuffer::m_silenceShrinkTime

protected

Amount to shrink jitter delay by if consistently silent.

enum { ... } OpalJitterBuffer::m_synchronisationState

int OpalJitterBuffer::m_timestampDelta

protected

unsigned OpalJitterBuffer::m_timeUnits

protected

Referenced by GetTimeUnits().

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

- jitter.h