|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjlibrtp.PktBuffer
public class PktBuffer
A PktBuffer stores packets either for buffering purposes, or because they need to be assimilated to create a complete frame. This behavior can be controlled through rtpSession.pktBufBehavior() It optionally drops duplicate packets. Note that newest is the most recently received, i.e. highest timeStamp Next means new to old (from recently received to previously received)
Field Summary | |
---|---|
(package private) int |
lastSeqNumber
The last sequence number received |
(package private) long |
lastTimestamp
The last timestamp |
(package private) int |
length
The length of the buffer |
(package private) PktBufNode |
newest
The newest, most recently received, packet |
(package private) PktBufNode |
oldest
The oldest, least recently received, packet |
(package private) Participant |
p
The parent participant |
(package private) RTPSession |
rtpSession
The RTPSession holds information common to all packetBuffers, such as max size |
(package private) long |
SSRC
SSRC of the the participant that this buffer is for |
Constructor Summary | |
---|---|
protected |
PktBuffer(RTPSession rtpSession,
Participant p,
RtpPkt aPkt)
Creates a new PktBuffer, a linked list of PktBufNode |
Method Summary | |
---|---|
protected int |
addPkt(RtpPkt aPkt)
Adds a packet, this happens in constant time if they arrive in order. |
private int |
addToFrame(PktBufNode frameNode,
PktBufNode newNode)
|
private int |
bufferedAddPkt(PktBufNode newNode)
Does most of the packet organization for the application. |
private DataFrame |
bufferedPopFrame()
Only returns if the buffer is full, i.e. |
protected void |
debugPrint()
Prints out the packet buffer, oldest node first (on top). |
private int |
filteredAddPkt(PktBufNode newNode)
Takes care of duplicate packets |
protected int |
getLength()
Returns the length of the packetbuffer. |
protected boolean |
pktOnTime(long timeStamp,
int seqNum)
Checks whether a packet is not too late, i.e. |
private void |
popFrameQueueCleanup(PktBufNode retNode,
int highestSeq)
Cleans the packet buffer before returning the frame, i.e. |
protected DataFrame |
popOldestFrame()
Checks the oldest frame, if there is one, sees whether it is complete. |
private DataFrame |
unbufferedPopFrame()
Will return the oldest frame without checking whether it is in the right order, or whether we should wate for late arrivals. |
private int |
unfilteredAddPkt(PktBufNode newNode)
Adds packets in the same order that they arrive, doesn't do any filering or processing. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
RTPSession rtpSession
long SSRC
Participant p
int length
PktBufNode oldest
PktBufNode newest
int lastSeqNumber
long lastTimestamp
Constructor Detail |
---|
protected PktBuffer(RTPSession rtpSession, Participant p, RtpPkt aPkt)
rtpSession
- the parent RTPSessionp
- the participant to which this packetbuffer belongs.aPkt
- The first RTP packet, to be added to the bufferMethod Detail |
---|
protected int addPkt(RtpPkt aPkt)
aPkt
- the packet to be added to the buffer.
private int unfilteredAddPkt(PktBufNode newNode)
newNode
- the node to add to the packet buffer
private int filteredAddPkt(PktBufNode newNode)
newNode
- the node to add to the packet buffer
private int bufferedAddPkt(PktBufNode newNode)
newNode
- the node to add to the packet buffer
private int addToFrame(PktBufNode frameNode, PktBufNode newNode)
frameNode
- the node currently representing the frame in the packet buffernewNode
- the new node to be added to the frame
protected DataFrame popOldestFrame()
private DataFrame unbufferedPopFrame()
private DataFrame bufferedPopFrame()
private void popFrameQueueCleanup(PktBufNode retNode, int highestSeq)
retNode
- the node that is about to be poppedhighestSeq
- the highest sequence number returned to the applicationprotected int getLength()
protected boolean pktOnTime(long timeStamp, int seqNum)
timeStamp
- the RTP timestamp of the packet under considerationseqNum
- the sequence number of the packet under consideration
protected void debugPrint()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |