# IAX2JitterBuffer Class Reference

`#include <iax2jitter.h>`

Inheritance diagram for IAX2JitterBuffer:

List of all members.

## Public Member Functions

| IAX2JitterBuffer ()
| ~IAX2JitterBuffer ()
virtual PBoolean | OnReadPacket (RTP_DataFrame &frame, PBoolean loop)
void | NewFrameFromNetwork (RTP_DataFrame *newFrame)
void | CloseDown ()

## Protected Attributes

PendingRtpDataFrames | receivedFrames

## Detailed Description

This class maintains a list of RTP_DataFrame instances, that is filled from the IAX2MediaStream class. The Jitter thread periodically grabs on frame and jitter corrects the frame

## Constructor & Destructor Documentation

IAX2JitterBuffer::IAX2JitterBuffer | ( |  | ) |

Build a jitter buffer for this connection, which defaults to 8khz

IAX2JitterBuffer::~IAX2JitterBuffer | ( |  | ) |

Stop the jitter buffer thread in this class, which allows the jitter buffer to close down nicely

## Member Function Documentation

virtual PBoolean IAX2JitterBuffer::OnReadPacket | ( | RTP_DataFrame & | frame,
|  | PBoolean | loop |
| ) |  |  | `[virtual]`

This class instance collects data from the outside world in 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

Implements OpalJitterBuffer.

void IAX2JitterBuffer::NewFrameFromNetwork | ( | RTP_DataFrame * | newFrame | ) | `[inline]`

Have receive a new frame from the network. Place it on the internal list

void IAX2JitterBuffer::CloseDown | ( |  | ) | `[inline]`

Terminate this intance of the jitter buffer permanently, which is required prior to destruction. This closedown mechanism is a bit different to that used in this libraries SIP/H.323 rtp code. However, that code has one socket per media stream. IAX2 and its use of one socket for all streams makes life difficult - we cannot just close that one main socket and close this stream.

## Member Data Documentation

PendingRtpDataFrames IAX2JitterBuffer::receivedFrames `[protected]`

The list of frames just read from the network

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

- iax2jitter.h