public class RTPUtils extends Object
| Modifier and Type | Field and Description |
|---|---|
static Comparator<? super Integer> |
sequenceNumberComparator
Deprecated.
A
Comparator implementation for unsigned 16-bit Integers. |
| Constructor and Description |
|---|
RTPUtils()
Deprecated.
|
| Modifier and Type | Method and Description |
|---|---|
static int |
applySequenceNumberDelta(int startingSequenceNumber,
int delta)
Deprecated.
Apply a delta to a given sequence number and return the result (taking
rollover into account)
|
static int |
as16Bits(int value)
Deprecated.
Returns the given integer masked to 16 bits
|
static long |
as32Bits(long value)
Deprecated.
Returns the given integer masked to 32 bits
|
static int |
getSequenceNumberDelta(int a,
int b)
Deprecated.
Returns the delta between two RTP sequence numbers, taking into account
rollover.
|
static boolean |
isNewerTimestampThan(long a,
long b)
Deprecated.
Returns whether or not the first given timestamp is newer than the second
|
static boolean |
isOlderSequenceNumberThan(int seqNumOne,
int seqNumTwo)
Deprecated.
Returns whether or not seqNumOne is 'older' than seqNumTwo, taking
rollover into account
|
static int |
readInt(byte[] buf,
int off)
Deprecated.
Read an integer from a buffer at a specified offset.
|
static int |
readInt16AsInt(byte[] buf,
int off)
Deprecated.
Read a signed short at a specified offset as an int.
|
static int |
readUint16AsInt(byte[] buf,
int off)
Deprecated.
Read an unsigned short at a specified offset as an int.
|
static int |
readUint24AsInt(byte[] buf,
int off)
Deprecated.
Read an unsigned short at specified offset as a int
|
static long |
readUint32AsLong(byte[] buf,
int off)
Deprecated.
Reads a 32-bit unsigned integer from the given buffer at the given
offset and returns its
long representation. |
static long |
rtpTimestampDiff(long a,
long b)
Deprecated.
Returns the difference between two RTP timestamps.
|
static int |
subtractNumber(int a,
int b)
Deprecated.
Returns result of the subtraction of one RTP sequence number from another
(modulo 2^16).
|
static String |
toHexString(byte[] buf)
Deprecated.
Return a string containing the hex string version of the given bytes
|
static String |
toHexString(byte[] buf,
int off,
int len)
Deprecated.
Return a string containing the hex string version of the given byte
|
static String |
toHexString(byte[] buf,
int off,
int len,
boolean format)
Deprecated.
Return a string containing the hex string version of the given byte
|
static int |
writeInt(byte[] buf,
int off,
int data)
Deprecated.
Set an integer at specified offset in network order.
|
static int |
writeShort(byte[] buf,
int off,
short data)
Deprecated.
Set an integer at specified offset in network order.
|
static int |
writeUint24(byte[] buf,
int off,
int data)
Deprecated.
Writes the least significant 24 bits from the given integer into the
given byte array at the given offset.
|
public static final Comparator<? super Integer> sequenceNumberComparator
Comparator implementation for unsigned 16-bit Integers.
Compares a and b inside the [0, 2^16] ring;
a is considered smaller than b if it takes a smaller
number to reach from a to b than the other way round.
IMPORTANT: This is a valid Comparator implementation only when
used for subsets of [0, 2^16) which don't span more than 2^15 elements.
E.g. it works for: [0, 2^15-1] and ([50000, 2^16) u [0, 10000])
Doesn't work for: [0, 2^15] and ([0, 2^15-1] u {2^16-1}) and [0, 2^16)public static int getSequenceNumberDelta(int a,
int b)
public static boolean isOlderSequenceNumberThan(int seqNumOne,
int seqNumTwo)
seqNumOne - seqNumTwo - public static int subtractNumber(int a,
int b)
public static int applySequenceNumberDelta(int startingSequenceNumber,
int delta)
startingSequenceNumber - the starting sequence numberdelta - the delta to be appliedpublic static int writeInt(byte[] buf,
int off,
int data)
off - Offset into the bufferdata - The integer to store in the packetpublic static int writeUint24(byte[] buf,
int off,
int data)
buf - the buffer into which to write.off - the offset at which to write.data - the integer to write.public static int writeShort(byte[] buf,
int off,
short data)
off - Offset into the bufferdata - The integer to store in the packetpublic static int readInt(byte[] buf,
int off)
buf - the buffer.off - start offset of the integer to be read.public static long readUint32AsLong(byte[] buf,
int off)
long representation.buf - the buffer.off - start offset of the integer to be read.public static int readUint16AsInt(byte[] buf,
int off)
buf - the buffer from which to read.off - start offset of the unsigned shortpublic static int readInt16AsInt(byte[] buf,
int off)
buf - the buffer from which to read.off - start offset of the unsigned shortpublic static int readUint24AsInt(byte[] buf,
int off)
buf - off - start offset of the unsigned shortpublic static int as16Bits(int value)
value - the integer to maskpublic static long as32Bits(long value)
value - the integer to maskpublic static long rtpTimestampDiff(long a,
long b)
public static boolean isNewerTimestampThan(long a,
long b)
a - b - public static String toHexString(byte[] buf)
buf - public static String toHexString(byte[] buf, int off, int len)
buf - off - len - public static String toHexString(byte[] buf, int off, int len, boolean format)
buf - off - len - format - a boolean that indicates whether or not to format the hex
string.Copyright © 2021 jitsi.org. All rights reserved.