JitterBuffer: Adaptive jitter buffer


Classes

struct  _JitterBufferPacket

Defines

#define JITTER_BUFFER_OK   0
#define JITTER_BUFFER_MISSING   1
#define JITTER_BUFFER_INCOMPLETE   2
#define JITTER_BUFFER_INTERNAL_ERROR   -1
#define JITTER_BUFFER_BAD_ARGUMENT   -2
#define JITTER_BUFFER_SET_MARGIN   0
#define JITTER_BUFFER_GET_MARGIN   1
#define JITTER_BUFFER_GET_AVALIABLE_COUNT   3
#define JITTER_BUFFER_ADJUST_INTERPOLATE   -1
#define JITTER_BUFFER_ADJUST_OK   0
#define JITTER_BUFFER_ADJUST_DROP   1

Typedefs

typedef JitterBuffer_ JitterBuffer
typedef _JitterBufferPacket JitterBufferPacket

Functions

JitterBufferjitter_buffer_init (int tick)
void jitter_buffer_reset (JitterBuffer *jitter)
void jitter_buffer_destroy (JitterBuffer *jitter)
void jitter_buffer_put (JitterBuffer *jitter, const JitterBufferPacket *packet)
int jitter_buffer_get (JitterBuffer *jitter, JitterBufferPacket *packet, spx_int32_t *start_offset)
int jitter_buffer_get_pointer_timestamp (JitterBuffer *jitter)
void jitter_buffer_tick (JitterBuffer *jitter)
int jitter_buffer_ctl (JitterBuffer *jitter, int request, void *ptr)
int jitter_buffer_update_delay (JitterBuffer *jitter, JitterBufferPacket *packet, spx_int32_t *start_offset)

Detailed Description

This is the jitter buffer that reorders UDP/RTP packets and adjusts the buffer size to maintain good quality and low latency.

Define Documentation

#define JITTER_BUFFER_BAD_ARGUMENT   -2

Invalid argument

#define JITTER_BUFFER_GET_AVALIABLE_COUNT   3

Get the amount of avaliable packets currently buffered

#define JITTER_BUFFER_GET_MARGIN   1

Get minimum amount of extra buffering required (margin)

#define JITTER_BUFFER_INCOMPLETE   2

Packet is incomplete (does not cover the entive tick

#define JITTER_BUFFER_INTERNAL_ERROR   -1

There was an error in the jitter buffer

#define JITTER_BUFFER_MISSING   1

Packet is missing

#define JITTER_BUFFER_OK   0

Packet has been retrieved

#define JITTER_BUFFER_SET_MARGIN   0

Set minimum amount of extra buffering required (margin)


Typedef Documentation

typedef struct JitterBuffer_ JitterBuffer

Generic adaptive jitter buffer state

typedef struct _JitterBufferPacket JitterBufferPacket

Definition of an incoming packet


Function Documentation

int jitter_buffer_ctl ( JitterBuffer jitter,
int  request,
void *  ptr 
)

Used like the ioctl function to control the jitter buffer parameters

Parameters:
jitter Jitter buffer state
request ioctl-type request (one of the JITTER_BUFFER_* macros)
ptr Data exchanged to-from function
Returns:
0 if no error, -1 if request in unknown

void jitter_buffer_destroy ( JitterBuffer jitter  ) 

Destroys jitter buffer

Parameters:
jitter Jitter buffer state

int jitter_buffer_get ( JitterBuffer jitter,
JitterBufferPacket packet,
spx_int32_t *  start_offset 
)

Get one packet from the jitter buffer

Parameters:
jitter Jitter buffer state
packet Returned packet
current_timestamp Timestamp for the returned packet

int jitter_buffer_get_pointer_timestamp ( JitterBuffer jitter  ) 

Get pointer timestamp of jitter buffer

Parameters:
jitter Jitter buffer state

JitterBuffer* jitter_buffer_init ( int  tick  ) 

Initialises jitter buffer

Parameters:
tick Number of samples per "tick", i.e. the time period of the elements that will be retrieved
Returns:
Newly created jitter buffer state

void jitter_buffer_put ( JitterBuffer jitter,
const JitterBufferPacket packet 
)

Put one packet into the jitter buffer

Parameters:
jitter Jitter buffer state
packet Incoming packet

void jitter_buffer_reset ( JitterBuffer jitter  ) 

Restores jitter buffer to its original state

Parameters:
jitter Jitter buffer state

void jitter_buffer_tick ( JitterBuffer jitter  ) 

Advance by one tick

Parameters:
jitter Jitter buffer state


Generated on Wed May 23 00:53:16 2007 for Speex by  doxygen 1.5.1