Class AppPacket


  • public class AppPacket
    extends RTCPPacket
    Create a RTCP APP 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| subtype | PT=APP=204 | length | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | SSRC/CSRC | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | name (ASCII) | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | application-dependent data ... +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ Cf. RFC 3550 for details about construction of APP packet.
    Author:
    Rémi Druilhe
    • Constructor Detail

      • AppPacket

        public AppPacket​(java.lang.Integer subtype,
                         java.lang.Long ssrc,
                         java.lang.String name,
                         java.lang.String data)
        Constructor
        Parameters:
        subtype - : the subtype of the packet.
        ssrc - : the SSRC of the packet.
        name - : the name of the packet.
        data - : the data to transmit in the packet (must be less than 500 bytes).
    • Method Detail

      • createPacket

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

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

        public java.lang.Long decodeSsrc​(byte[] data,
                                         java.lang.Integer offset)
        Decode SSRC from a APP packet.
        Parameters:
        data - : the data to decode.
        offset - : the beginning of the report.
        Returns:
        SSRC of the packet.
      • decodeName

        public java.lang.Long decodeName​(byte[] data,
                                         java.lang.Integer offset)
        Decode Name from a APP packet.
        Parameters:
        data - : the data to decode.
        offset - : the beginning of the report.
        Returns:
        name of the packet.