Package org.jitsi.impl.neomedia.rtcp
Class RTCPTCCPacket
- java.lang.Object
-
- net.sf.fmj.media.rtp.util.Packet
-
- net.sf.fmj.media.rtp.RTCPPacket
-
- org.jitsi.impl.neomedia.rtcp.RTCPFBPacket
-
- org.jitsi.impl.neomedia.rtcp.RTCPTCCPacket
-
public class RTCPTCCPacket extends RTCPFBPacket
A class which represents an RTCP packet carrying transport-wide congestion control (transport-cc) feedback information. The format is defined here: https://tools.ietf.org/html/draft-holmer-rmcat-transport-wide-cc-extensions-010 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=15 | PT=205 | length | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | SSRC of packet sender | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | SSRC of media source | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | base sequence number | packet status count | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | reference time | fb pkt. count | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | packet chunk | packet chunk | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ . . . . +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | packet chunk | recv delta | recv delta | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ . . . . +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | recv delta | recv delta | zero padding | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+- Author:
- Boris Grozev, George Politis
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classRTCPTCCPacket.PacketMapAn ordered collection which maps sequence numbers to timestamps, the order is by the sequence number.
-
Field Summary
Fields Modifier and Type Field Description static intFMTThe value of the "fmt" field for a transport-cc RTCP feedback packet.static intMAX_PACKET_COUNTThe maximum number of packets (including missing packets) to include in anRTCPTCCPacketbeing constructed for a list of packets.-
Fields inherited from class org.jitsi.impl.neomedia.rtcp.RTCPFBPacket
fci, fmt, PSFB, RTPFB, senderSSRC, sourceSSRC
-
-
Constructor Summary
Constructors Constructor Description RTCPTCCPacket(long senderSSRC, long sourceSSRC, RTCPTCCPacket.PacketMap packets, byte fbPacketCount, org.jitsi.utils.logging.DiagnosticContext diagnosticContext)Initializes a newRTCPTCCPacketinstance with a specific "packet sender SSRC" and "media source SSRC" values, and which describes a specific set of sequence numbers.RTCPTCCPacket(net.sf.fmj.media.rtp.RTCPCompoundPacket base)Initializes a new RTCPTCCPacket instance.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetFbPacketCount()RTCPTCCPacket.PacketMapgetPackets()static RTCPTCCPacket.PacketMapgetPackets(org.jitsi.utils.ByteArrayBuffer baf)static RTCPTCCPacket.PacketMapgetPacketsFromFci(org.jitsi.utils.ByteArrayBuffer fciBuffer)static longgetReferenceTime250us(org.jitsi.utils.ByteArrayBuffer fciBuffer)static booleanisTCCPacket(org.jitsi.utils.ByteArrayBuffer baf)Gets a boolean indicating whether or not the RTCP packet specified in theByteArrayBufferthat is passed as an argument is a TCC packet or not.StringtoString()-
Methods inherited from class org.jitsi.impl.neomedia.rtcp.RTCPFBPacket
assemble, calcLength, getFCI, getSenderSSRC, getSourceSSRC, getSourceSSRC, isPSFBPacket, isRTCPFBPacket, isRTPFBPacket, toRawPacket
-
-
-
-
Field Detail
-
MAX_PACKET_COUNT
public static final int MAX_PACKET_COUNT
The maximum number of packets (including missing packets) to include in anRTCPTCCPacketbeing constructed for a list of packets.- See Also:
- Constant Field Values
-
FMT
public static final int FMT
The value of the "fmt" field for a transport-cc RTCP feedback packet.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
RTCPTCCPacket
public RTCPTCCPacket(net.sf.fmj.media.rtp.RTCPCompoundPacket base)
Initializes a new RTCPTCCPacket instance.- Parameters:
base-
-
RTCPTCCPacket
public RTCPTCCPacket(long senderSSRC, long sourceSSRC, RTCPTCCPacket.PacketMap packets, byte fbPacketCount, org.jitsi.utils.logging.DiagnosticContext diagnosticContext)Initializes a newRTCPTCCPacketinstance with a specific "packet sender SSRC" and "media source SSRC" values, and which describes a specific set of sequence numbers.- Parameters:
senderSSRC- the value to use for the "packet sender SSRC" field.sourceSSRC- the value to use for the "media source SSRC" field.packets- the set of RTP sequence numbers and their reception timestamps which this packet is to describe. Note that missing sequence numbers, as well as those mapped to a negative will be interpreted as missing (not received) packets.fbPacketCount- the index of this feedback packet, to be used in the "fb pkt count" field.diagnosticContext- theDiagnosticContextto use to print diagnostic information. Warning: The timestamps for the packets are expected to be in millisecond increments, which is different than the output map produced after parsing a packet! Note: this implementation is not optimized and might not always use the minimal possible number of bytes to describe a given set of packets.
-
-
Method Detail
-
isTCCPacket
public static boolean isTCCPacket(org.jitsi.utils.ByteArrayBuffer baf)
Gets a boolean indicating whether or not the RTCP packet specified in theByteArrayBufferthat is passed as an argument is a TCC packet or not.- Parameters:
baf- theByteArrayBuffer- Returns:
- true if the byte array buffer holds a TCC packet, otherwise false.
-
getPackets
public static RTCPTCCPacket.PacketMap getPackets(org.jitsi.utils.ByteArrayBuffer baf)
- Parameters:
baf- the buffer which contains the RTCP packet.- Returns:
- the packets represented in an RTCP transport-cc feedback packet.
Warning: the timestamps are represented in the 250µs format used by the
on-the-wire format, and don't represent local time. This is different
than the timestamps expected as input when constructing a packet with
RTCPTCCPacket(long, long, PacketMap, byte, DiagnosticContext).
-
getReferenceTime250us
public static long getReferenceTime250us(org.jitsi.utils.ByteArrayBuffer fciBuffer)
- Returns:
- the reference time of the FCI buffer of an RTCP TCC packet. The format is 32 bits with 250µs resolution. Note that the format in the transport-wide cc draft is 24bit with 2^6ms resolution. The change in the unit facilitates the arrival time computations, as the deltas have 250µs resolution.
-
getPacketsFromFci
public static RTCPTCCPacket.PacketMap getPacketsFromFci(org.jitsi.utils.ByteArrayBuffer fciBuffer)
- Parameters:
fciBuffer- the buffer which contains the FCI portion of the RTCP feedback packet.- Returns:
- the packets represented in the FCI portion of an RTCP
transport-cc feedback packet.
Warning: the timestamps are represented in the 250µs format used by the
on-the-wire format, and don't represent local time. This is different
than the timestamps expected as input when constructing a packet with
RTCPTCCPacket(long, long, PacketMap, byte, DiagnosticContext). Note that packets described as lost are NOT included in the results.
-
getPackets
public RTCPTCCPacket.PacketMap getPackets()
- Returns:
- the map of packets represented by this
RTCPTCCPacket. Warning: the timestamps are represented in the 250µs format used by the on-the-wire format, and don't represent local time. This is different than the timestamps expected as input when constructing a packet withRTCPTCCPacket(long, long, PacketMap, byte, DiagnosticContext).
-
getFbPacketCount
public int getFbPacketCount()
- Returns:
- the value of the "fb packet count" field of this packet, or -1.
-
toString
public String toString()
- Overrides:
toStringin classRTCPFBPacket
-
-