Class RTPPacket


  • public class RTPPacket
    extends java.lang.Object
    This class is used to create a RTP packet.
    Author:
    Remi Druilhe
    • Constructor Summary

      Constructors 
      Constructor Description
      RTPPacket​(java.lang.Integer payloadType, java.lang.Integer sequenceNumber, java.lang.Long timestamp, java.lang.Long ssrc, byte[] payload)  
    • Constructor Detail

      • RTPPacket

        public RTPPacket​(java.lang.Integer payloadType,
                         java.lang.Integer sequenceNumber,
                         java.lang.Long timestamp,
                         java.lang.Long ssrc,
                         byte[] payload)
        Parameters:
        payloadType - the payload type of the RTP packet.
        sequenceNumber - the sequence number of the RTP packet.
        timestamp - the timestamp of the RTP packet.
        ssrc - the SSRC of the RTP packet.
        payload - the payload of the RTP packet.
    • Method Detail

      • createRtpPacket

        public byte[] createRtpPacket()
        Create a RTP packet in bytes.
        Returns:
        the packet formatted in bytes.
      • createHeader

        public byte[] createHeader()
        Convert every information of the header in bytes.
        Returns:
        the header formatted in bytes.
      • getPayloadType

        public static java.lang.Integer getPayloadType​(byte[] data)
        Get the payload type from the RTP packet
        Parameters:
        data - : the packet
        Returns:
        the PayloadType of the packet
      • getSequenceNumber

        public static java.lang.Integer getSequenceNumber​(byte[] data)
        Get the sequence number from the RTP packet
        Parameters:
        data - : the packet
        Returns:
        the Sequence Number of the packet
      • getTimestamp

        public static java.lang.Long getTimestamp​(byte[] data)
        Get the timestamp from the RTP packet
        Parameters:
        data - : the packet
        Returns:
        the Timestamp of the packet
      • getSsrc

        public static java.lang.Long getSsrc​(byte[] data)
        Get the ssrc from the RTP packet
        Parameters:
        data - : the packet
        Returns:
        the SSRC of the packet
      • getSampling

        public static java.lang.Double getSampling​(java.lang.Integer payloadType)
        Returns the frequency associated to this payload type
        Parameters:
        payloadType - : the payload type
        Returns:
        the frequency
      • getVersion

        public java.lang.Integer getVersion()
      • getPadding

        public java.lang.Integer getPadding()
      • getExtension

        public java.lang.Integer getExtension()
      • getCsrcCount

        public java.lang.Integer getCsrcCount()
      • getMarker

        public java.lang.Integer getMarker()
      • getPayloadType

        public java.lang.Integer getPayloadType()
      • getSequenceNumber

        public java.lang.Integer getSequenceNumber()
      • getTimestamp

        public java.lang.Long getTimestamp()
      • getSsrc

        public java.lang.Long getSsrc()
      • getPayload

        public byte[] getPayload()
      • setVersion

        public void setVersion​(java.lang.Integer version)
      • setPadding

        public void setPadding​(java.lang.Integer padding)
      • setExtension

        public void setExtension​(java.lang.Integer extension)
      • setCsrcCount

        public void setCsrcCount​(java.lang.Integer csrcCount)
      • setMarker

        public void setMarker​(java.lang.Integer marker)
      • setPayloadType

        public void setPayloadType​(java.lang.Integer payloadType)
      • setSequenceNumber

        public void setSequenceNumber​(java.lang.Integer sequenceNumber)
      • setTimestamp

        public void setTimestamp​(java.lang.Long timestamp)
      • setSSRC

        public void setSSRC​(java.lang.Long ssrc)
      • setPayload

        public void setPayload​(byte[] tempPayload)