|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.red5.server.net.rtp.RTPPacket
public class RTPPacket
This class wraps a RTP packet providing method to convert from and to a
IoBuffer.
A RTP packet is composed of an header and the subsequent payload.
The RTP header has the following format:
0 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 |
| .... |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
The first twelve octets are present in every RTP packet, while the list of
CSRC identifiers is present only when inserted by a mixer.
| Constructor Summary | |
|---|---|
protected |
RTPPacket()
|
|
RTPPacket(IoBuffer buffer)
Construct a new RTPPacket reading the fields from a IoBuffer |
| Method Summary | |
|---|---|
UnsignedInt[] |
getCsrc()
|
byte |
getCsrcCount()
|
byte[] |
getPayload()
|
UnsignedByte |
getPayloadType()
|
UnsignedShort |
getSequence()
|
UnsignedInt |
getSsrc()
|
UnsignedInt |
getTimestamp()
|
byte |
getVersion()
|
boolean |
isExtension()
|
boolean |
isMarker()
|
boolean |
isPadding()
|
void |
setCsrc(UnsignedInt[] csrc)
|
void |
setCsrcCount(byte csrcCount)
|
void |
setExtension(boolean extension)
|
void |
setMarker(boolean marker)
|
void |
setPadding(boolean padding)
|
void |
setPayload(byte[] payload)
|
void |
setPayloadType(UnsignedByte payloadType)
|
void |
setSequence(UnsignedShort sequence)
|
void |
setSsrc(UnsignedInt ssrc)
|
void |
setTimestamp(UnsignedInt timestamp)
|
void |
setVersion(byte version)
|
IoBuffer |
toByteBuffer()
Convert the packet instance into a IoBuffer ready to be sent. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public RTPPacket(IoBuffer buffer)
buffer - the buffer containing the packetprotected RTPPacket()
| Method Detail |
|---|
public IoBuffer toByteBuffer()
IoBuffer ready to be sent.
toByteBuffer in interface Packetpublic UnsignedInt[] getCsrc()
public void setCsrc(UnsignedInt[] csrc)
csrc - The csrc to set.public byte getCsrcCount()
public void setCsrcCount(byte csrcCount)
csrcCount - The csrcCount to set.public boolean isExtension()
public void setExtension(boolean extension)
extension - The extension to set.public boolean isMarker()
public void setMarker(boolean marker)
marker - The marker to set.public boolean isPadding()
public void setPadding(boolean padding)
padding - The padding to set.public byte[] getPayload()
public void setPayload(byte[] payload)
payload - The payload to set.public UnsignedByte getPayloadType()
public void setPayloadType(UnsignedByte payloadType)
payloadType - The payloadType to set.public UnsignedShort getSequence()
public void setSequence(UnsignedShort sequence)
sequence - The sequence to set.public UnsignedInt getSsrc()
public void setSsrc(UnsignedInt ssrc)
ssrc - The ssrc to set.public UnsignedInt getTimestamp()
public void setTimestamp(UnsignedInt timestamp)
timestamp - The timestamp to set.public byte getVersion()
public void setVersion(byte version)
version - The version to set.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||