jlibrtp
Class CompRtcpPkt

java.lang.Object
  extended by jlibrtp.CompRtcpPkt

public class CompRtcpPkt
extends java.lang.Object

Compound RTCP packet class. It basically holds a list of packets. This list can either be constructed by providing a byte[] of a compound packet, or by adding individual packets. Upon encode(), the packet will call encode on all the added packets. problem == 0 indicates the parsing succeeded.

Author:
Arne Kepp

Field Summary
protected  int problem
          Problem indicator, negative values denote packet type that cause problem
protected  java.util.LinkedList<RtcpPkt> rtcpPkts
          Stores the different subclasses of RtcpPkt that make up the compound packet
 
Constructor Summary
protected CompRtcpPkt()
          Instantiates an empty Compound RTCP packet to which you can add RTCP packets
protected CompRtcpPkt(byte[] rawPkt, int packetSize, java.net.InetSocketAddress adr, RTPSession rtpSession)
          Picks a received Compound RTCP packet apart.
 
Method Summary
protected  void addPacket(RtcpPkt aPkt)
          Add a RTCP packet to the compound packet.
protected  byte[] encode()
          Encode combines the RTCP packets in this.rtcpPkts into a byte[] by calling the encode() function on each of them individually.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

problem

protected int problem
Problem indicator, negative values denote packet type that cause problem


rtcpPkts

protected java.util.LinkedList<RtcpPkt> rtcpPkts
Stores the different subclasses of RtcpPkt that make up the compound packet

Constructor Detail

CompRtcpPkt

protected CompRtcpPkt()
Instantiates an empty Compound RTCP packet to which you can add RTCP packets


CompRtcpPkt

protected CompRtcpPkt(byte[] rawPkt,
                      int packetSize,
                      java.net.InetSocketAddress adr,
                      RTPSession rtpSession)
Picks a received Compound RTCP packet apart. Only SDES packets are processed directly, other packets are parsed and put into aComptRtcpPkt.rtcpPkts, but not Check the aComptRtcpPkt.problem , if the value is non-zero the packets should probably be discarded.

Parameters:
rawPkt - the byte array received from the socket
packetSize - the actual number of used bytes
adr - the socket address from which the packet was received
rtpSession - the RTPSession with the participant database
Method Detail

addPacket

protected void addPacket(RtcpPkt aPkt)
Add a RTCP packet to the compound packet. Pakcets are added in order, so you have to ensure that a Sender Report or Receiver Report is added first.

Parameters:
aPkt - the packet to be added

encode

protected byte[] encode()
Encode combines the RTCP packets in this.rtcpPkts into a byte[] by calling the encode() function on each of them individually. The order of rtcpPkts is preserved, so a RR or SR packet must be first.

Returns:
the trimmed byte[] representation of the packet, ready to go into a UDP packet.