net.sf.fmj.media.rtp
Class RTCPHeader

java.lang.Object
  extended by net.sf.fmj.media.rtp.RTCPHeader

public class RTCPHeader
extends java.lang.Object

Represents and parses an RTCP header

Version:
1-1-alpha
Author:
Andrew G D Rowley

Field Summary
static int SDES_CNAME
          An SDES CNAME header
static int SDES_EMAIL
          An SDES EMAIL header
static int SDES_LOC
          An SDES LOC header
static int SDES_NAME
          An SDES NAME header
static int SDES_NOTE
          An SDES NOTE header
static int SDES_PHONE
          An SDES PHONE header
static int SDES_SKIP
          The number of bytes to skip for a SDES header
static int SDES_TOOL
          An SDES TOOL header
static int SIZE
          The size of the header in bytes
static int VERSION
          The current RTP version
 
Constructor Summary
RTCPHeader(byte[] data, int offset, int length)
          Creates a new RTCPHeader
RTCPHeader(java.net.DatagramPacket packet)
          Creates a new RTCPHeader
 
Method Summary
 int getFlags()
          Returns the RTCP header flags.
 int getLength()
          Returns the length of the RTCP packet
 short getPacketType()
          Returns the type of RTCP packet (SR || RR)
 short getPadding()
          Returns the value of the padding bit, indicating if this individual RTCP packet contains some additional padding octets at the end which are not part of the control information but are included in the length field
 short getReceptionCount()
          Returns the reception report count (RC).
 long getSsrc()
          Returns the SSRC being described by this packet.
 short getVersion()
          Returns the version of the RTCP packet
 void print()
          Displays the header
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

VERSION

public static final int VERSION
The current RTP version

See Also:
Constant Field Values

SDES_SKIP

public static final int SDES_SKIP
The number of bytes to skip for a SDES header

See Also:
Constant Field Values

SDES_CNAME

public static final int SDES_CNAME
An SDES CNAME header

See Also:
Constant Field Values

SDES_NAME

public static final int SDES_NAME
An SDES NAME header

See Also:
Constant Field Values

SDES_EMAIL

public static final int SDES_EMAIL
An SDES EMAIL header

See Also:
Constant Field Values

SDES_PHONE

public static final int SDES_PHONE
An SDES PHONE header

See Also:
Constant Field Values

SDES_LOC

public static final int SDES_LOC
An SDES LOC header

See Also:
Constant Field Values

SDES_TOOL

public static final int SDES_TOOL
An SDES TOOL header

See Also:
Constant Field Values

SDES_NOTE

public static final int SDES_NOTE
An SDES NOTE header

See Also:
Constant Field Values

SIZE

public static final int SIZE
The size of the header in bytes

See Also:
Constant Field Values
Constructor Detail

RTCPHeader

public RTCPHeader(java.net.DatagramPacket packet)
           throws java.io.IOException
Creates a new RTCPHeader

Parameters:
packet - The packet from which to parse the header
Throws:
java.io.IOException - I/O Exception

RTCPHeader

public RTCPHeader(byte[] data,
                  int offset,
                  int length)
           throws java.io.IOException
Creates a new RTCPHeader

Parameters:
data - The data to read the header from
offset - The offset in the data to start
length - The length of the data to read
Throws:
java.io.IOException - I/O Exception
Method Detail

getFlags

public int getFlags()
Returns the RTCP header flags. This is a 16 bits short integer composed by: . the version number: 2 bits . the padding bit . the reception report count (RC): 5 bits . the packet type (PT): 8 bits

Returns:
the header flags (version|P|RC|PT)

getVersion

public short getVersion()
Returns the version of the RTCP packet

Returns:
The RTP version implemented

getPadding

public short getPadding()
Returns the value of the padding bit, indicating if this individual RTCP packet contains some additional padding octets at the end which are not part of the control information but are included in the length field

Returns:
the padding value

getReceptionCount

public short getReceptionCount()
Returns the reception report count (RC). This represents the number of reception report blocks contained in this packet. A value of zero is valid.

Returns:
The number of reception blocks in the packet (0 is valid)

getPacketType

public short getPacketType()
Returns the type of RTCP packet (SR || RR)

Returns:
The type of the RTCP packet (SR or RR)

getLength

public int getLength()
Returns the length of the RTCP packet

Returns:
The length of the RTCP packet

getSsrc

public long getSsrc()
Returns the SSRC being described by this packet.

Returns:
The ssrc being described

print

public void print()
Displays the header