public class NACKPacket extends RTCPFBPacket
0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|V=2|P| FMT=1 | PT=205 | length |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| SSRC of packet sender |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| SSRC of media source |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| FCI |
| [...] |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
The Feedback Control Information (FCI) field consists of one or more
32-bit words, each with the following structure:
0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| PID | BLP |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Modifier and Type | Field and Description |
---|---|
static int |
FMT
The value of the "fmt" field for a NACK packet.
|
fci, fmt, PSFB, RTPFB, senderSSRC, sourceSSRC
Constructor and Description |
---|
NACKPacket(long senderSSRC,
long sourceSSRC,
java.util.Collection<java.lang.Integer> lostPackets)
Initializes a new NACKPacket instance with specific "packet
sender SSRC" and "media source SSRC" values and which describes a
specific set of sequence numbers.
|
NACKPacket(net.sf.fmj.media.rtp.RTCPCompoundPacket base)
Initializes a new NACKPacket instance.
|
Modifier and Type | Method and Description |
---|---|
java.util.Collection<java.lang.Integer> |
getLostPackets() |
static java.util.Collection<java.lang.Integer> |
getLostPackets(ByteArrayBuffer baf) |
static java.util.Collection<java.lang.Integer> |
getLostPacketsFci(ByteArrayBuffer fciBuffer) |
static boolean |
isNACKPacket(ByteArrayBuffer baf)
Gets a boolean indicating whether or not the RTCP packet specified in the
ByteArrayBuffer that is passed as an argument is a NACK packet or
not. |
java.lang.String |
toString() |
assemble, calcLength, getFCI, getSenderSSRC, getSourceSSRC, getSourceSSRC, isPSFBPacket, isRTCPFBPacket, isRTPFBPacket, toRawPacket
public static final int FMT
public NACKPacket(net.sf.fmj.media.rtp.RTCPCompoundPacket base)
base
- public NACKPacket(long senderSSRC, long sourceSSRC, java.util.Collection<java.lang.Integer> lostPackets)
senderSSRC
- the value to use for the "packet sender SSRC" field.sourceSSRC
- the value to use for the "media source SSRC" field.lostPackets
- the set of RTP sequence numbers which this NACK
packet is to describe.
Note that this implementation is not optimized and might not always use
the minimal possible number of bytes to describe a given set of packets.
Specifically, it does not take into account that sequence numbers wrap
at 2^16 and fails to pack numbers close to 2^16 with those close to 0.public static boolean isNACKPacket(ByteArrayBuffer baf)
ByteArrayBuffer
that is passed as an argument is a NACK packet or
not.baf
- the ByteArrayBuffer
public static java.util.Collection<java.lang.Integer> getLostPackets(ByteArrayBuffer baf)
baf
- the NACK packet.ByteArrayBuffer
.public static java.util.Collection<java.lang.Integer> getLostPacketsFci(ByteArrayBuffer fciBuffer)
fciBuffer
- the ByteArrayBuffer
which represents the FCI
field of a NACK packet.ByteArrayBuffer
.public java.util.Collection<java.lang.Integer> getLostPackets()
public java.lang.String toString()
toString
in class RTCPFBPacket
Jitsi, the OpenSource Java VoIP and Instant Messaging client.
Distributable under Apache license.