public class RTPPacket
extends java.lang.Object
Constructor and Description |
---|
RTPPacket(java.lang.Integer payloadType,
java.lang.Integer sequenceNumber,
java.lang.Long timestamp,
java.lang.Long ssrc,
byte[] payload) |
Modifier and Type | Method and Description |
---|---|
byte[] |
createHeader()
Convert every information of the header in bytes.
|
byte[] |
createRtpPacket()
Create a RTP packet in bytes.
|
java.lang.Integer |
getCsrcCount() |
java.lang.Integer |
getExtension() |
java.lang.Integer |
getMarker() |
java.lang.Integer |
getPadding() |
byte[] |
getPayload() |
java.lang.Integer |
getPayloadType() |
static java.lang.Integer |
getPayloadType(byte[] data)
Get the payload type from the RTP packet
|
static java.lang.Double |
getSampling(java.lang.Integer payloadType)
Returns the frequency associated to this payload type
|
java.lang.Integer |
getSequenceNumber() |
static java.lang.Integer |
getSequenceNumber(byte[] data)
Get the sequence number from the RTP packet
|
java.lang.Long |
getSsrc() |
static java.lang.Long |
getSsrc(byte[] data)
Get the ssrc from the RTP packet
|
java.lang.Long |
getTimestamp() |
static java.lang.Long |
getTimestamp(byte[] data)
Get the timestamp from the RTP packet
|
java.lang.Integer |
getVersion() |
void |
setCsrcCount(java.lang.Integer csrcCount) |
void |
setExtension(java.lang.Integer extension) |
void |
setMarker(java.lang.Integer marker) |
void |
setPadding(java.lang.Integer padding) |
void |
setPayload(byte[] tempPayload) |
void |
setPayloadType(java.lang.Integer payloadType) |
void |
setSequenceNumber(java.lang.Integer sequenceNumber) |
void |
setSSRC(java.lang.Long ssrc) |
void |
setTimestamp(java.lang.Long timestamp) |
void |
setVersion(java.lang.Integer version) |
public RTPPacket(java.lang.Integer payloadType, java.lang.Integer sequenceNumber, java.lang.Long timestamp, java.lang.Long ssrc, byte[] payload)
payloadType
- the payload type of the RTP packet.sequenceNumber
- the sequence number of the RTP packet.timestamp
- the timestamp of the RTP packet.ssrc
- the SSRC of the RTP packet.payload
- the payload of the RTP packet.public byte[] createRtpPacket()
public byte[] createHeader()
public static java.lang.Integer getPayloadType(byte[] data)
data
- : the packetpublic static java.lang.Integer getSequenceNumber(byte[] data)
data
- : the packetpublic static java.lang.Long getTimestamp(byte[] data)
data
- : the packetpublic static java.lang.Long getSsrc(byte[] data)
data
- : the packetpublic static java.lang.Double getSampling(java.lang.Integer payloadType)
payloadType
- : the payload typepublic java.lang.Integer getVersion()
public java.lang.Integer getPadding()
public java.lang.Integer getExtension()
public java.lang.Integer getCsrcCount()
public java.lang.Integer getMarker()
public java.lang.Integer getPayloadType()
public java.lang.Integer getSequenceNumber()
public java.lang.Long getTimestamp()
public java.lang.Long getSsrc()
public byte[] getPayload()
public void setVersion(java.lang.Integer version)
public void setPadding(java.lang.Integer padding)
public void setExtension(java.lang.Integer extension)
public void setCsrcCount(java.lang.Integer csrcCount)
public void setMarker(java.lang.Integer marker)
public void setPayloadType(java.lang.Integer payloadType)
public void setSequenceNumber(java.lang.Integer sequenceNumber)
public void setTimestamp(java.lang.Long timestamp)
public void setSSRC(java.lang.Long ssrc)
public void setPayload(byte[] tempPayload)