OpalJitterBuffer Class Reference
#include <jitter.h>
List of all members.
Classes |
class | Entry |
class | FrameQueue |
Public Member Functions |
| OpalJitterBuffer (unsigned minJitterDelay, unsigned maxJitterDelay, unsigned timeUnits=8, PINDEX stackSize=30000) |
virtual | ~OpalJitterBuffer () |
void | PrintOn (ostream &strm) const |
virtual PBoolean | OnReadPacket (RTP_DataFrame &frame, PBoolean loop)=0 |
void | SetDelay (unsigned minJitterDelay, unsigned maxJitterDelay) |
void | UseImmediateReduction (PBoolean state) |
virtual PBoolean | ReadData (RTP_DataFrame &frame) |
DWORD | GetJitterTime () const |
unsigned | GetTimeUnits () const |
DWORD | GetPacketsTooLate () const |
DWORD | GetBufferOverruns () const |
DWORD | GetMaxConsecutiveMarkerBits () const |
void | SetMaxConsecutiveMarkerBits (DWORD max) |
virtual void | Resume () |
| PDECLARE_NOTIFIER (PThread, OpalJitterBuffer, JitterThreadMain) |
PBoolean | WaitForTermination (const PTimeInterval &t) |
bool | IsEmpty () |
Protected Member Functions |
void | Start (unsigned _minJitterTime, unsigned _maxJitterTime) |
Entry * | GetNewest (bool pop) |
Entry * | GetOldest (bool pop) |
PBoolean | Init (Entry *¤tReadFrame, PBoolean &markerWarning) |
PBoolean | PreRead (Entry *¤tReadFrame, PBoolean &markerWarning) |
PBoolean | OnRead (Entry *¤tReadFrame, PBoolean &markerWarning, PBoolean loop) |
void | DeInit (Entry *¤tReadFrame, PBoolean &markerWarning) |
Protected Attributes |
PINDEX | bufferSize |
DWORD | minJitterTime |
DWORD | maxJitterTime |
DWORD | maxConsecutiveMarkerBits |
unsigned | timeUnits |
DWORD | currentJitterTime |
DWORD | packetsTooLate |
unsigned | bufferOverruns |
unsigned | consecutiveBufferOverruns |
DWORD | consecutiveMarkerBits |
PTimeInterval | consecutiveEarlyPacketStartTime |
DWORD | lastWriteTimestamp |
PTimeInterval | lastWriteTick |
DWORD | jitterCalc |
DWORD | targetJitterTime |
unsigned | jitterCalcPacketCount |
bool | doJitterReductionImmediately |
FrameQueue | freeFrames |
FrameQueue | jitterBuffer |
Entry * | currentFrame |
PMutex | bufferMutex |
bool | shuttingDown |
bool | preBuffering |
bool | firstReadData |
RTP_JitterBufferAnalyser * | analyser |
PThread * | jitterThread |
PINDEX | jitterStackSize |
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
Constructor & Destructor Documentation
OpalJitterBuffer::OpalJitterBuffer |
( |
unsigned |
minJitterDelay, |
|
|
unsigned |
maxJitterDelay, |
|
|
unsigned |
timeUnits = 8 , |
|
|
PINDEX |
stackSize = 30000 | |
|
) |
| | |
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 |
| stackSize | Stack size for jitter thread |
virtual OpalJitterBuffer::~OpalJitterBuffer |
( |
|
) |
[virtual] |
Destructor, which closes this down and deletes the internal list of frames
Member Function Documentation
void OpalJitterBuffer::DeInit |
( |
Entry *& |
currentReadFrame, |
|
|
PBoolean & |
markerWarning | |
|
) |
| | [protected] |
DWORD OpalJitterBuffer::GetBufferOverruns |
( |
|
) |
const [inline] |
Get total number received packets that overran the jitter buffer.
References bufferOverruns.
DWORD OpalJitterBuffer::GetJitterTime |
( |
|
) |
const [inline] |
DWORD OpalJitterBuffer::GetMaxConsecutiveMarkerBits |
( |
|
) |
const [inline] |
Entry* OpalJitterBuffer::GetNewest |
( |
bool |
pop |
) |
[inline, protected] |
Entry* OpalJitterBuffer::GetOldest |
( |
bool |
pop |
) |
[inline, protected] |
DWORD OpalJitterBuffer::GetPacketsTooLate |
( |
|
) |
const [inline] |
Get total number received packets too late to go into jitter buffer.
References packetsTooLate.
unsigned OpalJitterBuffer::GetTimeUnits |
( |
|
) |
const [inline] |
PBoolean OpalJitterBuffer::Init |
( |
Entry *& |
currentReadFrame, |
|
|
PBoolean & |
markerWarning | |
|
) |
| | [protected] |
bool OpalJitterBuffer::IsEmpty |
( |
|
) |
[inline] |
PBoolean OpalJitterBuffer::OnRead |
( |
Entry *& |
currentReadFrame, |
|
|
PBoolean & |
markerWarning, |
|
|
PBoolean |
loop | |
|
) |
| | [protected] |
virtual PBoolean OpalJitterBuffer::OnReadPacket |
( |
RTP_DataFrame & |
frame, |
|
|
PBoolean |
loop | |
|
) |
| | [pure virtual] |
This method is where this OpalJitterBuffer collects data from the outside world. A descendant class of OpalJitterBuffer will override this method
- Returns:
- PTrue on successful read, PFalse on faulty read.
- Parameters:
-
| frame | Frame read from the RTP session |
| loop | If PTrue, loop as long as data is available, if PFalse, only process once |
Implemented in RTP_JitterBuffer.
OpalJitterBuffer::PDECLARE_NOTIFIER |
( |
PThread |
, |
|
|
OpalJitterBuffer |
, |
|
|
JitterThreadMain |
| |
|
) |
| | |
PBoolean OpalJitterBuffer::PreRead |
( |
Entry *& |
currentReadFrame, |
|
|
PBoolean & |
markerWarning | |
|
) |
| | [protected] |
void OpalJitterBuffer::PrintOn |
( |
ostream & |
strm |
) |
const |
Report the statistics for this jitter instance
virtual PBoolean OpalJitterBuffer::ReadData |
( |
RTP_DataFrame & |
frame |
) |
[virtual] |
Read a data frame from the RTP channel. Any control frames received are dispatched to callbacks and are not returned by this function. It will block until a data frame is available or an error occurs.
- Parameters:
-
| frame | Frame read from the RTP session |
virtual void OpalJitterBuffer::Resume |
( |
|
) |
[virtual] |
void OpalJitterBuffer::SetDelay |
( |
unsigned |
minJitterDelay, |
|
|
unsigned |
maxJitterDelay | |
|
) |
| | |
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 |
void OpalJitterBuffer::SetMaxConsecutiveMarkerBits |
( |
DWORD |
max |
) |
[inline] |
void OpalJitterBuffer::Start |
( |
unsigned |
_minJitterTime, |
|
|
unsigned |
_maxJitterTime | |
|
) |
| | [protected] |
void OpalJitterBuffer::UseImmediateReduction |
( |
PBoolean |
state |
) |
[inline] |
PBoolean OpalJitterBuffer::WaitForTermination |
( |
const PTimeInterval & |
t |
) |
[inline] |
Member Data Documentation
The documentation for this class was generated from the following file: