Class RTCPSenderInfoUtils


  • public class RTCPSenderInfoUtils
    extends Object
    Utility class that contains static methods for RTCP sender info manipulation. TODO maybe merge into the RTCPSenderInfo class.
    Author:
    George Politis
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static long getTimestamp​(byte[] buf, int off, int len)
      Gets the RTP timestamp from an SR.
      static long getTimestamp​(org.jitsi.utils.ByteArrayBuffer baf)
      Gets the RTP timestamp from an SR.
      static boolean isValid​(byte[] buf, int off, int len)  
      static int setOctetCount​(org.jitsi.utils.ByteArrayBuffer baf, int octetCount)
      Sets the octet count in the SR that is specified in the arguments.
      static int setPacketCount​(org.jitsi.utils.ByteArrayBuffer baf, int packetCount)
      Sets the packet count in the SR that is specified in the arguments.
      static int setTimestamp​(byte[] buf, int off, int len, int ts)
      Sets the RTP timestamp in an SR.
      static int setTimestamp​(org.jitsi.utils.ByteArrayBuffer baf, int ts)
      Sets the RTP timestamp in an SR.
    • Constructor Detail

      • RTCPSenderInfoUtils

        public RTCPSenderInfoUtils()
    • Method Detail

      • getTimestamp

        public static long getTimestamp​(byte[] buf,
                                        int off,
                                        int len)
        Gets the RTP timestamp from an SR.
        Parameters:
        buf - the byte buffer that contains the RTCP sender report.
        off - the offset in the byte buffer where the RTCP sender report starts.
        len - the number of bytes in buffer which constitute the actual data.
        Returns:
        the RTP timestamp, or -1 in case of an error.
      • setTimestamp

        public static int setTimestamp​(byte[] buf,
                                       int off,
                                       int len,
                                       int ts)
        Sets the RTP timestamp in an SR.
        Parameters:
        buf - the byte buffer that contains the RTCP sender report.
        off - the offset in the byte buffer where the RTCP sender report starts.
        len - the number of bytes in buffer which constitute the actual data.
        ts - the new timestamp to be set.
        Returns:
        the number of bytes written.
      • isValid

        public static boolean isValid​(byte[] buf,
                                      int off,
                                      int len)
        Parameters:
        buf - the byte buffer that contains the RTCP sender info.
        off - the offset in the byte buffer where the RTCP sender info starts.
        len - the number of bytes in buffer which constitute the actual data.
        Returns:
        true if the RTCP sender info is valid, false otherwise.
      • setTimestamp

        public static int setTimestamp​(org.jitsi.utils.ByteArrayBuffer baf,
                                       int ts)
        Sets the RTP timestamp in an SR.
        Parameters:
        baf - the ByteArrayBuffer that holds the SR.
        ts - the new timestamp to be set.
        Returns:
        the number of bytes written.
      • getTimestamp

        public static long getTimestamp​(org.jitsi.utils.ByteArrayBuffer baf)
        Gets the RTP timestamp from an SR.
        Parameters:
        baf - the ByteArrayBuffer that holds the SR.
        Returns:
        the RTP timestamp, or -1 in case of an error.
      • setOctetCount

        public static int setOctetCount​(org.jitsi.utils.ByteArrayBuffer baf,
                                        int octetCount)
        Sets the octet count in the SR that is specified in the arguments.
        Parameters:
        baf - the ByteArrayBuffer that holds the SR.
        octetCount - the octet count ot set.
        Returns:
        the number of bytes that were written, otherwise -1.
      • setPacketCount

        public static int setPacketCount​(org.jitsi.utils.ByteArrayBuffer baf,
                                         int packetCount)
        Sets the packet count in the SR that is specified in the arguments.
        Parameters:
        packetCount - the packet count to set.
        baf - the ByteArrayBuffer that holds the SR.
        Returns:
        the number of bytes that were written, otherwise -1.