org.ow2.clif.probe.rtp
Class ByePacket

java.lang.Object
  extended by org.ow2.clif.probe.rtp.RTCPPacket
      extended by org.ow2.clif.probe.rtp.ByePacket

public class ByePacket
extends RTCPPacket

Create a RTCP BYE packet. 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| SC | PT=BYE=203 | length | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | SSRC/CSRC | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ : ... : +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+ (opt) | length | reason for leaving ... +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ Cf. RFC 3550 for details about construction of BYE packet.

Author:
Rémi Druilhe

Constructor Summary
ByePacket()
          Contructor
 
Method Summary
 void addSsrc(java.lang.Long ssrc, java.lang.String reason)
          Create an element of BYE packet.
 byte[] createPacket()
          Method to create a BYE packet.
static java.util.ArrayList<java.lang.Long> decodeSsrc(byte[] data, java.lang.Integer offset)
          List all SSRC present in a RTCP BYE.
 java.lang.Integer getPacketType()
          Returns the packet type.
 
Methods inherited from class org.ow2.clif.probe.rtp.RTCPPacket
createRtcpPacket, decodeCount, decodeLength, decodePacketType, decodePadding, decodeTwoComplement, decodeTwoComplement, decodeVersion, getRtcpPackets, packetTypeAvailable
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ByePacket

public ByePacket()
Contructor

Method Detail

createPacket

public byte[] createPacket()
Method to create a BYE packet.

Specified by:
createPacket in class RTCPPacket
Returns:
the BYE packet in bytes.

addSsrc

public void addSsrc(java.lang.Long ssrc,
                    java.lang.String reason)
Create an element of BYE packet.

Parameters:
ssrc - : the SSRC associated to the report.
reason - : the reason for leaving the session (optional). Can be empty.

getPacketType

public java.lang.Integer getPacketType()
Returns the packet type. Here it is 203.

Specified by:
getPacketType in class RTCPPacket
Returns:
the packet type.

decodeSsrc

public static java.util.ArrayList<java.lang.Long> decodeSsrc(byte[] data,
                                                             java.lang.Integer offset)
List all SSRC present in a RTCP BYE.

Parameters:
data - : the data to decode.
offset - : the beginning of the report.
Returns:
a list of all SSRC.