Public Member Functions | Protected Attributes

RTCPReceiverReportPacket Class Reference

#include <RTCPPacket.h>

Inheritance diagram for RTCPReceiverReportPacket:
RTCPPacket RTCPSenderReportPacket

List of all members.

Public Member Functions

 RTCPReceiverReportPacket (const char *name=NULL)
 RTCPReceiverReportPacket (const RTCPReceiverReportPacket &rtcpReceiverReportPacket)
virtual ~RTCPReceiverReportPacket ()
RTCPReceiverReportPacketoperator= (const RTCPReceiverReportPacket &rtcpReceiverReportPacket)
virtual RTCPReceiverReportPacketdup () const
virtual std::string info ()
virtual void dump (std::ostream &os) const
virtual uint32 getSSRC ()
virtual void setSSRC (uint32 ssrc)
virtual void addReceptionReport (ReceptionReport *report)
virtual cArray * getReceptionReports ()

Protected Attributes

uint32 _ssrc
cArray * _receptionReports

Detailed Description

This class represents rtcp receiver report packets. It can hold 0 to 31 ReceptionReports. Also the header field ssrc is included.

See also:
ReceptionReport

Definition at line 159 of file RTCPPacket.h.


Constructor & Destructor Documentation

RTCPReceiverReportPacket::RTCPReceiverReportPacket ( const char *  name = NULL  ) 

Default contructor.

Definition at line 129 of file RTCPPacket.cc.

Referenced by dup().

                                                                   : RTCPPacket(name) {
    _packetType = RTCP_PT_RR;
    _ssrc = 0;
    _receptionReports = new cArray("ReceptionReports");
    // an empty rtcp receiver report packet is 4 bytes
    // longer, the ssrc identifier is stored in it
    addByteLength(4);
};

RTCPReceiverReportPacket::RTCPReceiverReportPacket ( const RTCPReceiverReportPacket rtcpReceiverReportPacket  ) 

Copy constructor.

Definition at line 138 of file RTCPPacket.cc.

                                                                                                           : RTCPPacket() {
    _receptionReports = NULL;
    setName(rtcpReceiverReportPacket.getName());
    operator=(rtcpReceiverReportPacket);
};

RTCPReceiverReportPacket::~RTCPReceiverReportPacket (  )  [virtual]

Destructor.

Definition at line 145 of file RTCPPacket.cc.

                                                    {
    delete _receptionReports;
};


Member Function Documentation

void RTCPReceiverReportPacket::addReceptionReport ( ReceptionReport report  )  [virtual]

Adds a receiver report to this receiver report packet.

Definition at line 191 of file RTCPPacket.cc.

Referenced by RTCP::createPacket().

                                                                         {
    _receptionReports->add(report);
    _count++;
    // an rtcp receiver report is 24 bytes long
    addByteLength(24);
};

void RTCPReceiverReportPacket::dump ( std::ostream &  os  )  const [virtual]

Writes a report about the RTCPReceiverReportPacket into the stream.

Reimplemented from RTCPPacket.

Reimplemented in RTCPSenderReportPacket.

Definition at line 170 of file RTCPPacket.cc.

                                                        {
    os << "RTCPReceiverReportPacket:" << endl;
    for (int i = 0; i < _receptionReports->size(); i++) {
        if (_receptionReports->exist(i)) {
            ReceptionReport *rr = (ReceptionReport *)(_receptionReports->get(i));
            rr->dump(os);
        };
    };
};

RTCPReceiverReportPacket * RTCPReceiverReportPacket::dup (  )  const [virtual]

Duplicates the RTCPReceiverReportPacket by calling the copy constructor.

Reimplemented from RTCPPacket.

Reimplemented in RTCPSenderReportPacket.

Definition at line 158 of file RTCPPacket.cc.

                                                              {
    return new RTCPReceiverReportPacket(*this);
};

cArray * RTCPReceiverReportPacket::getReceptionReports (  )  [virtual]

Return a copy of the cArray of receiver reports stored in the object.

Definition at line 199 of file RTCPPacket.cc.

Referenced by RTCP::processIncomingRTCPPacket().

                                                      {
    return new cArray(*_receptionReports);
};

uint32 RTCPReceiverReportPacket::getSSRC (  )  [virtual]

Returns the ssrc indentifier of the source which has sent this rtcp receiver report packet.

Definition at line 181 of file RTCPPacket.cc.

Referenced by RTCP::processIncomingRTCPPacket().

                                         {
    return _ssrc;
};

std::string RTCPReceiverReportPacket::info (  )  [virtual]

Reports a one line info about the RTCPReceiverReportPacket.

Reimplemented from RTCPPacket.

Reimplemented in RTCPSenderReportPacket.

Definition at line 163 of file RTCPPacket.cc.

                                         {
    std::stringstream out;
    out << "RTCPReceiverReportPacket #rr=" << _count;
    return out.str();
};

RTCPReceiverReportPacket & RTCPReceiverReportPacket::operator= ( const RTCPReceiverReportPacket rtcpReceiverReportPacket  ) 

Assignment operator.

Definition at line 150 of file RTCPPacket.cc.

Referenced by RTCPReceiverReportPacket().

                                                                                                                      {
    RTCPPacket::operator=(rtcpReceiverReportPacket);
    _ssrc = rtcpReceiverReportPacket._ssrc;
    _receptionReports = new cArray(*(rtcpReceiverReportPacket._receptionReports));
    return *this;
};

void RTCPReceiverReportPacket::setSSRC ( uint32  ssrc  )  [virtual]

Sets the ssrc identifier for the rtcp receiver report packet.

Definition at line 186 of file RTCPPacket.cc.

Referenced by RTCP::createPacket().

                                                  {
    _ssrc = ssrc;
};


Member Data Documentation

The reception reports in this packet are stored here.

Definition at line 231 of file RTCPPacket.h.

Referenced by addReceptionReport(), RTCPSenderReportPacket::dump(), dump(), getReceptionReports(), operator=(), RTCPReceiverReportPacket(), and ~RTCPReceiverReportPacket().

uint32 RTCPReceiverReportPacket::_ssrc [protected]

The ssrc identifier of the source of this rtcp packet.

Definition at line 226 of file RTCPPacket.h.

Referenced by getSSRC(), RTCPSenderReportPacket::info(), operator=(), RTCPReceiverReportPacket(), and setSSRC().


The documentation for this class was generated from the following files: