Class ByePacket


  • public class ByePacket
    extends RTCPPacket
    Create a RTCP BYE packet. 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| SC | PT=BYE=203 | length | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | SSRC/CSRC | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ : ... : +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+ (opt) | length | reason for leaving ... +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ Cf. RFC 3550 for details about construction of BYE packet.
    Author:
    Rémi Druilhe
    • Constructor Detail

      • ByePacket

        public ByePacket()
        Contructor
    • Method Detail

      • createPacket

        public byte[] createPacket()
        Method to create a BYE packet.
        Specified by:
        createPacket in class RTCPPacket
        Returns:
        the BYE packet in bytes.
      • addSsrc

        public void addSsrc​(java.lang.Long ssrc,
                            java.lang.String reason)
        Create an element of BYE packet.
        Parameters:
        ssrc - : the SSRC associated to the report.
        reason - : the reason for leaving the session (optional). Can be empty.
      • getPacketType

        public java.lang.Integer getPacketType()
        Returns the packet type. Here it is 203.
        Specified by:
        getPacketType in class RTCPPacket
        Returns:
        the packet type.
      • decodeSsrc

        public static java.util.ArrayList<java.lang.Long> decodeSsrc​(byte[] data,
                                                                     java.lang.Integer offset)
        List all SSRC present in a RTCP BYE.
        Parameters:
        data - : the data to decode.
        offset - : the beginning of the report.
        Returns:
        a list of all SSRC.