|
1 /** |
|
2 * Java RTP Library (jlibrtp) |
|
3 * Copyright (C) 2006 Arne Kepp |
|
4 * |
|
5 * This library is free software; you can redistribute it and/or |
|
6 * modify it under the terms of the GNU Lesser General Public |
|
7 * License as published by the Free Software Foundation; either |
|
8 * version 2.1 of the License, or (at your option) any later version. |
|
9 * |
|
10 * This library is distributed in the hope that it will be useful, |
|
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
|
13 * Lesser General Public License for more details. |
|
14 * |
|
15 * You should have received a copy of the GNU Lesser General Public |
|
16 * License along with this library; if not, write to the Free Software |
|
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
|
18 */ |
|
19 package jlibrtp; |
|
20 |
|
21 /** |
|
22 * This is a four-directional data structures used for the frame buffer, i.e. |
|
23 * buffer for pkts that need to be assimilated into complete frames. |
|
24 * |
|
25 * All the actual work is done by PktBuffer. |
|
26 * |
|
27 * @author Arne Kepp |
|
28 * |
|
29 */ |
|
30 public class PktBufNode { |
|
31 /** The next node (RTP Timestamp), looking from the back -> next means older */ |
|
32 protected PktBufNode nextFrameQueueNode = null; |
|
33 /** |
|
34 * The previous node (RTP Timestmap), looking from the back -> prev means |
|
35 * newer |
|
36 */ |
|
37 protected PktBufNode prevFrameQueueNode = null; |
|
38 /** |
|
39 * The next node within the frame, i.e. higher sequence number, same RTP |
|
40 * timestamp |
|
41 */ |
|
42 protected PktBufNode nextFrameNode = null; |
|
43 /** Number of packets with the same RTP timestamp */ |
|
44 protected int pktCount; |
|
45 /** The RTP timeStamp associated with this node */ |
|
46 protected long timeStamp; |
|
47 /** The sequence number associated with this node */ |
|
48 protected int seqNum; |
|
49 /** The payload, a parsed RTP Packet */ |
|
50 protected RtpPkt pkt = null; |
|
51 |
|
52 /** |
|
53 * Create a new packet buffer node based on a packet |
|
54 * |
|
55 * @param aPkt |
|
56 * the packet |
|
57 */ |
|
58 protected PktBufNode(RtpPkt aPkt) { |
|
59 initPktBufNode(aPkt); |
|
60 } |
|
61 |
|
62 public PktBufNode(){ |
|
63 } |
|
64 |
|
65 public void initPktBufNode(RtpPkt aPkt) { |
|
66 pkt = aPkt; |
|
67 timeStamp = aPkt.getTimeStamp(); |
|
68 seqNum = aPkt.getSeqNumber(); |
|
69 pktCount = 1; |
|
70 } |
|
71 } |