public class RTCPUtils
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static int |
MIN_SIZE
The size in bytes of the smallest possible RTCP packet (e.g.
|
static int |
VERSION
The values of the Version field for RTCP packets.
|
Constructor and Description |
---|
RTCPUtils() |
Modifier and Type | Method and Description |
---|---|
static int |
getLength(byte[] buf,
int off,
int len)
Gets the RTCP packet length in bytes as specified by the length field
of the RTCP packet (does not verify that the buffer is actually large
enough).
|
static int |
getLength(ByteArrayBuffer baf)
Gets the RTCP packet length in bytes.
|
static int |
getPacketType(byte[] buf,
int off,
int len)
Gets the RTCP packet type.
|
static int |
getPacketType(ByteArrayBuffer baf)
Gets the RTCP packet type.
|
static int |
getReportCount(ByteArrayBuffer baf)
Gets the report count field of the RTCP packet specified in the
ByteArrayBuffer that is passed in as a parameter. |
static int |
getVersion(byte[] buf,
int off,
int len)
Gets the RTCP packet version.
|
static boolean |
isHeaderValid(byte[] buf,
int off,
int len)
Checks whether the RTCP header is valid or not (note that a valid header
does not necessarily imply a valid packet).
|
static boolean |
isRtcp(byte[] buf,
int off,
int len)
Checks whether the buffer described by the parameters looks like an
RTCP packet.
|
static int |
setSenderSSRC(ByteArrayBuffer baf,
int senderSSRC)
Sets the RTCP sender SSRC.
|
public static int VERSION
public static int MIN_SIZE
public static int getPacketType(byte[] buf, int off, int len)
buf
- the byte buffer that contains the RTCP header.off
- the offset in the byte buffer where the RTCP header starts.len
- the number of bytes in buffer which constitute the actual
data.public static int getPacketType(ByteArrayBuffer baf)
baf
- the ByteArrayBuffer
that contains the RTCP header.public static int getLength(byte[] buf, int off, int len)
buf
- the byte buffer that contains the RTCP header.off
- the offset in the byte buffer where the RTCP header starts.len
- the number of bytes in buffer which constitute the actual
data.public static int getVersion(byte[] buf, int off, int len)
buf
- the byte buffer that contains the RTCP header.off
- the offset in the byte buffer where the RTCP header starts.len
- the number of bytes in buffer which constitute the actual
data.public static boolean isHeaderValid(byte[] buf, int off, int len)
buf
- the byte buffer that contains the RTCP header.off
- the offset in the byte buffer where the RTCP header starts.len
- the number of bytes in buffer which constitute the actual
data.public static int setSenderSSRC(ByteArrayBuffer baf, int senderSSRC)
baf
- the ByteArrayBuffer
that contains the RTCP header.senderSSRC
- the sender SSRC to set.public static int getReportCount(ByteArrayBuffer baf)
ByteArrayBuffer
that is passed in as a parameter.baf
- the ByteArrayBuffer
that contains the RTCP header.ByteArrayBuffer
that is passed in as a parameter, or -1 in case
of an error.public static int getLength(ByteArrayBuffer baf)
baf
- the ByteArrayBuffer
that contains the RTCP header.public static boolean isRtcp(byte[] buf, int off, int len)
true
does not necessarily mean that the
given packet is a valid RTCP packet, but it should be parsed as RTCP
(as opposed to as e.g. RTP or STUN).buf
- off
- len
- true
if the described packet looks like RTCP.
Jitsi, the OpenSource Java VoIP and Instant Messaging client.
Distributable under Apache license.