org.ow2.clif.probe.rtp
Class RTCPPacket

java.lang.Object
  extended by org.ow2.clif.probe.rtp.RTCPPacket
Direct Known Subclasses:
AppPacket, ByePacket, ReportPacket, SDESPacket

public abstract class RTCPPacket
extends java.lang.Object

Create a RTCP packet. Packet type available for CLIF : 200, 201, 202, 203, 204.

Author:
Rémi Druilhe

Constructor Summary
RTCPPacket()
           
 
Method Summary
abstract  byte[] createPacket()
          Create a RTCP packet.
 byte[] createRtcpPacket(java.util.LinkedList<byte[]> reports)
          Create a RTCP packet with each reports created previously.
static java.lang.Integer decodeCount(byte[] data, java.lang.Integer offset)
          Returns the count header (RC, SC or Subtype).
static java.lang.Integer decodeLength(byte[] data, java.lang.Integer offset)
          Returns the length header.
static java.lang.Integer decodePacketType(byte[] data, java.lang.Integer offset)
          Returns the packet type header.
static java.lang.Integer decodePadding(byte[] data, java.lang.Integer offset)
          Returns the padding.
static java.lang.Integer decodeTwoComplement(java.lang.Integer value)
          Decode the value (RTP use two's complement)
static java.lang.Long decodeTwoComplement(java.lang.Long value)
          Decode the value (RTP use two's complement)
static java.lang.Integer decodeVersion(byte[] data, java.lang.Integer offset)
          Returns the version.
abstract  java.lang.Integer getPacketType()
          Returns the packet type of the RTCP packet.
static java.util.LinkedList<RTCPInformation> getRtcpPackets(byte[] data, java.lang.Long time)
          Method to separate RTCP report.
static boolean packetTypeAvailable(java.lang.Integer packetType)
          Tells if the packet type is supported by CLIF.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RTCPPacket

public RTCPPacket()
Method Detail

createPacket

public abstract byte[] createPacket()
Create a RTCP packet.

Returns:
the packet in bytes.

getPacketType

public abstract java.lang.Integer getPacketType()
Returns the packet type of the RTCP packet.

Returns:
the packet type.

createRtcpPacket

public byte[] createRtcpPacket(java.util.LinkedList<byte[]> reports)
Create a RTCP packet with each reports created previously.

Parameters:
reports - : the report to add to the packet.
Returns:
the RTCP packet with each reports.

getRtcpPackets

public static java.util.LinkedList<RTCPInformation> getRtcpPackets(byte[] data,
                                                                   java.lang.Long time)
Method to separate RTCP report.

Parameters:
data - : the data to decode.
time - : the arrival time of the packet.
Returns:
a list of RTCP reports.

decodeVersion

public static java.lang.Integer decodeVersion(byte[] data,
                                              java.lang.Integer offset)
Returns the version.

Parameters:
data - : the raw RTCP packet.
offset - : the offset to start to decode.
Returns:
the version.

decodePadding

public static java.lang.Integer decodePadding(byte[] data,
                                              java.lang.Integer offset)
Returns the padding.

Parameters:
data - : the raw RTCP packet.
offset - : the offset to start to decode.
Returns:
the padding.

decodeCount

public static java.lang.Integer decodeCount(byte[] data,
                                            java.lang.Integer offset)
Returns the count header (RC, SC or Subtype).

Parameters:
data - : the raw RTCP packet.
offset - : the offset to start to decode.
Returns:
the count.

decodePacketType

public static java.lang.Integer decodePacketType(byte[] data,
                                                 java.lang.Integer offset)
Returns the packet type header.

Parameters:
data - : the raw RTCP packet.
offset - : the offset to start to decode.
Returns:
the packet type.

decodeLength

public static java.lang.Integer decodeLength(byte[] data,
                                             java.lang.Integer offset)
Returns the length header.

Parameters:
data - : the raw RTCP packet.
offset - : the offset to start to decode.
Returns:
the length.

decodeTwoComplement

public static java.lang.Long decodeTwoComplement(java.lang.Long value)
Decode the value (RTP use two's complement)

Parameters:
value - : the value to convert (include between -128 and 127)
Returns:
a value include between 0 and 256

decodeTwoComplement

public static java.lang.Integer decodeTwoComplement(java.lang.Integer value)
Decode the value (RTP use two's complement)

Parameters:
value - : the value to convert (include between -128 and 127)
Returns:
a value include between 0 and 256

packetTypeAvailable

public static boolean packetTypeAvailable(java.lang.Integer packetType)
Tells if the packet type is supported by CLIF.

Parameters:
packetType - : the packet type to test.
Returns:
true if packet type is supported by CLIF.