net.sf.fmj.media.rtp
Class RTPJitterBuffer

java.lang.Object
  extended by net.sf.fmj.media.rtp.RTPJitterBuffer

public class RTPJitterBuffer
extends java.lang.Object

Implements a RTP Jitter Buffer

Version:
1-1-alpha3
Author:
Andrew G D Rowley, Christian Vincenot

Constructor Summary
RTPJitterBuffer(int size)
          Creates a new RTPJitterBuffer
 
Method Summary
 boolean add(Buffer data)
          Adds a buffer of data to the buffer
 long peekFollowingTimeStamp()
          Returns the timestamp of the next element in the buffer array without removing it.
 long peekTimeStamp()
          Returns the timestamp of first buffer sequence in the queue without removing it.
 Buffer remove()
          Removes the first buffer from the queue
 void setStatistics(RTPReceptionStats statistics)
          Sets the statistics to be added to by this buffer
 int size()
          Returns the current number of elements on the queue.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RTPJitterBuffer

public RTPJitterBuffer(int size)
Creates a new RTPJitterBuffer

Parameters:
size - The size of the buffer
Method Detail

setStatistics

public void setStatistics(RTPReceptionStats statistics)
Sets the statistics to be added to by this buffer

Parameters:
statistics - The statistics to add to

add

public boolean add(Buffer data)
Adds a buffer of data to the buffer

Parameters:
data - The data to add
Returns:
true if the item was added, false if it was dropped

remove

public Buffer remove()
Removes the first buffer from the queue

Returns:
the buffer removed

peekTimeStamp

public long peekTimeStamp()
Returns the timestamp of first buffer sequence in the queue without removing it.

Returns:
the timestamp of first buffer sequence in the queue without removing it

peekFollowingTimeStamp

public long peekFollowingTimeStamp()
Returns the timestamp of the next element in the buffer array without removing it.

Returns:
the timestamp of the next element in the queue without removing it

size

public int size()
Returns the current number of elements on the queue.

Returns:
the current number of elements on the queue