Package org.jitsi.impl.neomedia.rtcp
Class RTCPSenderInfoUtils
- java.lang.Object
-
- org.jitsi.impl.neomedia.rtcp.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
-
-
Constructor Summary
Constructors Constructor Description RTCPSenderInfoUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static longgetTimestamp(byte[] buf, int off, int len)Gets the RTP timestamp from an SR.static longgetTimestamp(org.jitsi.utils.ByteArrayBuffer baf)Gets the RTP timestamp from an SR.static booleanisValid(byte[] buf, int off, int len)static intsetOctetCount(org.jitsi.utils.ByteArrayBuffer baf, int octetCount)Sets the octet count in the SR that is specified in the arguments.static intsetPacketCount(org.jitsi.utils.ByteArrayBuffer baf, int packetCount)Sets the packet count in the SR that is specified in the arguments.static intsetTimestamp(byte[] buf, int off, int len, int ts)Sets the RTP timestamp in an SR.static intsetTimestamp(org.jitsi.utils.ByteArrayBuffer baf, int ts)Sets the RTP timestamp in an SR.
-
-
-
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- theByteArrayBufferthat 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- theByteArrayBufferthat 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- theByteArrayBufferthat 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- theByteArrayBufferthat holds the SR.- Returns:
- the number of bytes that were written, otherwise -1.
-
-