|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--cnrg.itx.datax.devices.RTPHeader
Class defining the RFC 1889 implementation of an RTP header. 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |V=2|P|X| CC |M| PT | sequence number | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | timestamp | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | synchronization source (SSRC) identifier | +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+ | contributing source (CSRC) identifiers | | .... | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Field Summary | |
private int[] |
csrc
Contributing source identifiers. |
static int |
G721_8000
|
private int |
marker
Marker bit. |
private int |
numCSources
Number of contributing sources. |
private int |
packetExtension
Packet header extension flag. |
private int |
padding
Padding flag. |
private int |
payloadType
Payload type. |
static int |
PCMA_8000
|
static int |
PCMU_8000
Constants defining some of the standard media formats for the RTP payload types. |
private short |
sequence
Packet sequence number. |
private int |
ssrc
Synchronization source. |
private int |
timeStamp
Packet timestamp. |
private int |
version
Attribute for the RTP packet version. |
Constructor Summary | |
RTPHeader(byte[] rtpData)
Constructor to extract the RTP header from a RTP byte array. |
|
RTPHeader(int ssrc,
int payloadType)
Constructor for an RTP header taking the 32 bit source identifier and the payload type. |
Method Summary | |
void |
copyHeader(byte[] packet)
Method to copy the RTP header into the byte array provided. |
int[] |
getCSRC()
Accessor to get the list of contributing sources. |
int |
getExtension()
Accessor to get the packet extension. |
int |
getHeaderSize()
Accessor for the current size of the header in bytes. |
private int |
getInt(byte[] packet,
int pos)
Method to get an integer(32 bit) value from a position in a byte array. |
int |
getMarker()
Accessor to get the packet marker. |
int |
getPadding()
Accessor for the current state of padding. |
int |
getPayLoadType()
Accessor for the current payloadtype. |
int |
getSequence()
Accessor to get the packet sequence number. |
private short |
getShort(byte[] packet,
int pos)
Method to get a short(16 bit) value from a position in a byte array. |
int |
getSSRC()
Accessor to get the current synchronization source. |
int |
getTimeStamp()
Accessor to get the current timestamp of the packet. |
int |
getVersion()
Accessor to get the version of the RTP header. |
private void |
setInt(byte[] packet,
int pos,
int value)
Method to put an integer(32 bits) value in the header. |
void |
setSequence(short sequence)
Mutator to set the sequence number of the packet. |
private void |
setShort(byte[] packet,
int pos,
short value)
Method to set a short(16 bit) value in a byte array. |
void |
setTimeStamp(int timeStamp)
Mutator to set the packet timestamp. |
Methods inherited from class java.lang.Object |
|
Field Detail |
public static final int PCMU_8000
public static final int G721_8000
public static final int PCMA_8000
private int version
private int padding
private int packetExtension
private int numCSources
private int marker
private int payloadType
private short sequence
private int timeStamp
private int ssrc
private int[] csrc
Constructor Detail |
public RTPHeader(int ssrc, int payloadType)
ssrc
- the 32 bit source IDpayloadType
- the kind of real time data contained in the packetpublic RTPHeader(byte[] rtpData)
rtpData
- the byte array of RTP dataMethod Detail |
public void copyHeader(byte[] packet)
packet
- the byte array to copy the header intopublic int getHeaderSize()
public int getVersion()
public int getPadding()
public int getExtension()
public int getMarker()
public int getSequence()
public void setSequence(short sequence)
sequence
- the packet sequence numberpublic int getTimeStamp()
public void setTimeStamp(int timeStamp)
timeStamp
- the timestamp of the packetpublic int[] getCSRC()
public int getSSRC()
public int getPayLoadType()
private void setInt(byte[] packet, int pos, int value)
packet
- the byte array to put the value inpos
- the position at which the bytes need to be putvalue
- the integer value to be putprivate int getInt(byte[] packet, int pos)
packet
- the byte array to get the value frompos
- the position from which to get the 32 bit valueprivate void setShort(byte[] packet, int pos, short value)
packet
- the byte array to put the value inpos
- the position at which the bytes need to be putvalue
- the short value to be putprivate short getShort(byte[] packet, int pos)
packet
- the byte array to get the value frompos
- the position from which to get the 16 bit value
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |