org.ow2.clif.probe.rtp
Class RTPPacket

java.lang.Object
  extended by org.ow2.clif.probe.rtp.RTPPacket

public class RTPPacket
extends java.lang.Object

This class is used to create a RTP packet.

Author:
Remi Druilhe

Constructor Summary
RTPPacket(java.lang.Integer payloadType, java.lang.Integer sequenceNumber, java.lang.Long timestamp, java.lang.Long ssrc, byte[] payload)
           
 
Method Summary
 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)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RTPPacket

public RTPPacket(java.lang.Integer payloadType,
                 java.lang.Integer sequenceNumber,
                 java.lang.Long timestamp,
                 java.lang.Long ssrc,
                 byte[] payload)
Parameters:
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.
Method Detail

createRtpPacket

public byte[] createRtpPacket()
Create a RTP packet in bytes.

Returns:
the packet formatted in bytes.

createHeader

public byte[] createHeader()
Convert every information of the header in bytes.

Returns:
the header formatted in bytes.

getPayloadType

public static java.lang.Integer getPayloadType(byte[] data)
Get the payload type from the RTP packet

Parameters:
data - : the packet
Returns:
the PayloadType of the packet

getSequenceNumber

public static java.lang.Integer getSequenceNumber(byte[] data)
Get the sequence number from the RTP packet

Parameters:
data - : the packet
Returns:
the Sequence Number of the packet

getTimestamp

public static java.lang.Long getTimestamp(byte[] data)
Get the timestamp from the RTP packet

Parameters:
data - : the packet
Returns:
the Timestamp of the packet

getSsrc

public static java.lang.Long getSsrc(byte[] data)
Get the ssrc from the RTP packet

Parameters:
data - : the packet
Returns:
the SSRC of the packet

getSampling

public static java.lang.Double getSampling(java.lang.Integer payloadType)
Returns the frequency associated to this payload type

Parameters:
payloadType - : the payload type
Returns:
the frequency

getVersion

public java.lang.Integer getVersion()

getPadding

public java.lang.Integer getPadding()

getExtension

public java.lang.Integer getExtension()

getCsrcCount

public java.lang.Integer getCsrcCount()

getMarker

public java.lang.Integer getMarker()

getPayloadType

public java.lang.Integer getPayloadType()

getSequenceNumber

public java.lang.Integer getSequenceNumber()

getTimestamp

public java.lang.Long getTimestamp()

getSsrc

public java.lang.Long getSsrc()

getPayload

public byte[] getPayload()

setVersion

public void setVersion(java.lang.Integer version)

setPadding

public void setPadding(java.lang.Integer padding)

setExtension

public void setExtension(java.lang.Integer extension)

setCsrcCount

public void setCsrcCount(java.lang.Integer csrcCount)

setMarker

public void setMarker(java.lang.Integer marker)

setPayloadType

public void setPayloadType(java.lang.Integer payloadType)

setSequenceNumber

public void setSequenceNumber(java.lang.Integer sequenceNumber)

setTimestamp

public void setTimestamp(java.lang.Long timestamp)

setSSRC

public void setSSRC(java.lang.Long ssrc)

setPayload

public void setPayload(byte[] tempPayload)