RTPSenderInfo Class Reference

#include <RTPSenderInfo.h>

Inheritance diagram for RTPSenderInfo:

RTPParticipantInfo

List of all members.


Detailed Description

The class RTPSenderInfo is used by an rtp end system for storing information about itself. With the stored information it can create a SenderReport.

Public Member Functions

 RTPSenderInfo (uint32 ssrc=0)
 RTPSenderInfo (const RTPSenderInfo &senderInfo)
virtual ~RTPSenderInfo ()
RTPSenderInfooperator= (const RTPSenderInfo &senderInfo)
virtual RTPSenderInfodup () const
virtual void processRTPPacket (RTPPacket *packet, int id, simtime_t arrivalTime)
virtual void processReceptionReport (ReceptionReport *report, simtime_t arrivalTime)
virtual SenderReportsenderReport (simtime_t now)
virtual void setStartTime (simtime_t startTime)
virtual void setClockRate (int clockRate)
virtual void setTimeStampBase (uint32 timeStampBase)
virtual void setSequenceNumberBase (uint16 sequenceNumberBase)
virtual bool toBeDeleted (simtime_t now)

Protected Attributes

simtime_t _startTime
int _clockRate
uint32 _timeStampBase
uint16 _sequenceNumberBase
uint32 _packetsSent
uint32 _bytesSent

Constructor & Destructor Documentation

RTPSenderInfo::RTPSenderInfo ( uint32  ssrc = 0  ) 

Default constructor.

Referenced by dup().

00028                                         : RTPParticipantInfo(ssrc) {
00029     _startTime = 0.0;
00030     _clockRate = 0;
00031     _timeStampBase = 0;
00032     _sequenceNumberBase = 0;
00033     _packetsSent = 0;
00034     _bytesSent = 0;
00035 
00036 };

RTPSenderInfo::RTPSenderInfo ( const RTPSenderInfo senderInfo  ) 

Copy constructor.

00039                                                             : RTPParticipantInfo() {
00040     operator=(senderInfo);
00041 };

RTPSenderInfo::~RTPSenderInfo (  )  [virtual]

Destructor.

00044                               {
00045 
00046 };


Member Function Documentation

RTPSenderInfo & RTPSenderInfo::operator= ( const RTPSenderInfo senderInfo  ) 

Assignment operator.

Referenced by RTPSenderInfo().

00049                                                                        {
00050     RTPParticipantInfo::operator=(senderInfo);
00051     _startTime = senderInfo._startTime;
00052     _clockRate = senderInfo._clockRate;
00053     _timeStampBase = senderInfo._timeStampBase;
00054     _sequenceNumberBase = senderInfo._sequenceNumberBase;
00055     _packetsSent = senderInfo._packetsSent;
00056     _bytesSent = senderInfo._bytesSent;
00057     return *this;
00058 };

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

Duplicates this RTPSenderInfo by calling the copy constructor.

Reimplemented from RTPParticipantInfo.

00061                                         {
00062     return new RTPSenderInfo(*this);
00063 };

void RTPSenderInfo::processRTPPacket ( RTPPacket packet,
int  id,
simtime_t  arrivalTime 
) [virtual]

Stores information about this outgoing RTPPacket.

Reimplemented from RTPParticipantInfo.

Referenced by RTCP::processOutgoingRTPPacket().

00066                                                                                       {
00067     _packetsSent++;
00068     _bytesSent = _bytesSent + packet->getPayloadLength();
00069 
00070     // call corresponding method of superclass
00071     // for setting _silentIntervals
00072     // it deletes the packet !!!
00073     RTPParticipantInfo::processRTPPacket(packet, id, arrivalTime);
00074 };

void RTPSenderInfo::processReceptionReport ( ReceptionReport report,
simtime_t  arrivalTime 
) [virtual]

Processes an incoming ReceptionReport for this sender.

Reimplemented from RTPParticipantInfo.

Referenced by RTCP::processIncomingRTCPPacket().

00077                                                                                          {
00078     delete report;
00079 };

SenderReport * RTPSenderInfo::senderReport ( simtime_t  now  )  [virtual]

Returns a SenderReport for this rtp endsystem. If it hasn't sent rtp data packets during the last 2 rtcp intervals, it returns NULL.

Reimplemented from RTPParticipantInfo.

Referenced by RTCP::createPacket().

00082                                                        {
00083     if (isSender()) {
00084         SenderReport *senderReport = new SenderReport();
00085         // ntp time stamp is 64 bit integer
00086 
00087         uint64 ntpSeconds = (uint64)SIMTIME_DBL(now);
00088         uint64 ntpFraction = (uint64)( (SIMTIME_DBL(now) - ntpSeconds*65536.0) * 65536.0);
00089 
00090         senderReport->setNTPTimeStamp((uint64)(ntpSeconds << 32) + ntpFraction);
00091         senderReport->setRTPTimeStamp(SIMTIME_DBL(now - _startTime) * _clockRate);
00092         senderReport->setPacketCount(_packetsSent);
00093         senderReport->setByteCount(_bytesSent);
00094         return senderReport;
00095     }
00096     else {
00097         return NULL;
00098     };
00099 };

void RTPSenderInfo::setStartTime ( simtime_t  startTime  )  [virtual]

Sets the time (simTime) when this endsystem has started sending rtp packets.

Referenced by RTCP::senderModuleInitialized().

00102                                                     {
00103     _startTime = startTime;
00104 };

void RTPSenderInfo::setClockRate ( int  clockRate  )  [virtual]

Sets the clock rate (in ticks per second) this sender increases the rtp time stamp.

Referenced by RTCP::senderModuleInitialized().

00107                                               {
00108     _clockRate = clockRate;
00109 };

void RTPSenderInfo::setTimeStampBase ( uint32  timeStampBase  )  [virtual]

Sets the initial rtp time stamp.

Referenced by RTCP::senderModuleInitialized().

00112                                                          {
00113     _timeStampBase = timeStampBase;
00114 };

void RTPSenderInfo::setSequenceNumberBase ( uint16  sequenceNumberBase  )  [virtual]

Sets the initial sequence number.

Referenced by RTCP::senderModuleInitialized().

00117                                                                    {
00118     _sequenceNumberBase = sequenceNumberBase;
00119 };

bool RTPSenderInfo::toBeDeleted ( simtime_t  now  )  [virtual]

A sender info shall never be deleted!

Reimplemented from RTPParticipantInfo.

00122                                              {
00123     return false;
00124 }


Member Data Documentation

simtime_t RTPSenderInfo::_startTime [protected]

The time when the transmission was started.

Referenced by operator=(), RTPSenderInfo(), senderReport(), and setStartTime().

int RTPSenderInfo::_clockRate [protected]

The clock rate this sender increases the rtp time stamp.

Referenced by operator=(), RTPSenderInfo(), senderReport(), and setClockRate().

uint32 RTPSenderInfo::_timeStampBase [protected]

The initial rtp time stamp.

Referenced by operator=(), RTPSenderInfo(), and setTimeStampBase().

The initial sequence number.

Referenced by operator=(), RTPSenderInfo(), and setSequenceNumberBase().

uint32 RTPSenderInfo::_packetsSent [protected]

The number of rtp data packets this sender has sent.

Referenced by operator=(), processRTPPacket(), RTPSenderInfo(), and senderReport().

uint32 RTPSenderInfo::_bytesSent [protected]

The number of data bytes this sender has sent.

Referenced by operator=(), processRTPPacket(), RTPSenderInfo(), and senderReport().


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

Generated on Fri Mar 20 18:51:21 2009 for INET Framework for OMNeT++/OMNEST by  doxygen 1.5.5