Class 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-01
    
      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=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
    • Field Detail

      • MAX_PACKET_COUNT

        public static final int MAX_PACKET_COUNT
        The maximum number of packets (including missing packets) to include in an RTCPTCCPacket being 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 new RTCPTCCPacket instance 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 - the DiagnosticContext to 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 the ByteArrayBuffer that is passed as an argument is a TCC packet or not.
        Parameters:
        baf - the ByteArrayBuffer
        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.
      • getFbPacketCount

        public int getFbPacketCount()
        Returns:
        the value of the "fb packet count" field of this packet, or -1.