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 (u_int32 ssrc=0)
 RTPSenderInfo (const RTPSenderInfo &senderInfo)
virtual ~RTPSenderInfo ()
RTPSenderInfooperator= (const RTPSenderInfo &senderInfo)
virtual cObject * dup () const
virtual const char * className () const
virtual void processRTPPacket (RTPPacket *packet, 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 (u_int32 timeStampBase)
virtual void setSequenceNumberBase (u_int16 sequenceNumberBase)
virtual bool toBeDeleted (simtime_t now)

Private Attributes

simtime_t _startTime
int _clockRate
u_int32 _timeStampBase
u_int16 _sequenceNumberBase
u_int32 _packetsSent
u_int32 _bytesSent


Constructor & Destructor Documentation

RTPSenderInfo::RTPSenderInfo ( u_int32  ssrc = 0  ) 

Default constructor.

00031                                          : RTPParticipantInfo(ssrc) {
00032     _startTime = 0.0;
00033     _clockRate = 0;
00034     _timeStampBase = 0;
00035     _sequenceNumberBase = 0;
00036     _packetsSent = 0;
00037     _bytesSent = 0;
00038 
00039 };

RTPSenderInfo::RTPSenderInfo ( const RTPSenderInfo senderInfo  ) 

Copy constructor.

00042                                                             : RTPParticipantInfo() {
00043     setName(senderInfo.name());
00044     operator=(senderInfo);
00045 };

RTPSenderInfo::~RTPSenderInfo (  )  [virtual]

Destructor.

00048                               {
00049 
00050 };


Member Function Documentation

const char * RTPSenderInfo::className (  )  const [virtual]

Returns the class name "RTPSenderInfo".

Reimplemented from RTPParticipantInfo.

00070                                            {
00071     return "RTPSenderInfo";
00072 };

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

Duplicates this RTPSenderInfo by calling the copy constructor.

Reimplemented from RTPParticipantInfo.

00065                                   {
00066     return new RTPSenderInfo(*this);
00067 };

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

Assignment operator.

00053                                                                        {
00054     RTPParticipantInfo::operator=(senderInfo);
00055     _startTime = senderInfo._startTime;
00056     _clockRate = senderInfo._clockRate;
00057     _timeStampBase = senderInfo._timeStampBase;
00058     _sequenceNumberBase = senderInfo._sequenceNumberBase;
00059     _packetsSent = senderInfo._packetsSent;
00060     _bytesSent = senderInfo._bytesSent;
00061     return *this;
00062 };

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

Processes an incoming ReceptionReport for this sender.

Reimplemented from RTPParticipantInfo.

00086                                                                                          {
00087     delete report;
00088 };

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

Stores information about this outgoing RTPPacket.

Reimplemented from RTPParticipantInfo.

00075                                                                              {
00076     _packetsSent++;
00077     _bytesSent = _bytesSent + packet->payloadLength();
00078 
00079     // call corresponding method of superclass
00080     // for setting _silentIntervals
00081     // it deletes the packet !!!
00082     RTPParticipantInfo::processRTPPacket(packet, arrivalTime);
00083 };

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.

00091                                                        {
00092     if (isSender()) {
00093         SenderReport *senderReport = new SenderReport("SenderReport");
00094         // ntp time stamp is 64 bit integer
00095 
00096         u_int64 ntpSeconds = (u_int64)now;
00097         u_int64 ntpFraction = (u_int64)((now - (simtime_t)ntpSeconds) * 65536.0 * 65536.0);
00098 
00099         senderReport->setNTPTimeStamp((u_int64)(ntpSeconds << 32) + ntpFraction);
00100         senderReport->setRTPTimeStamp((now - _startTime) * _clockRate);
00101         senderReport->setPacketCount(_packetsSent);
00102         senderReport->setByteCount(_bytesSent);
00103         return senderReport;
00104     }
00105     else {
00106         return NULL;
00107     };
00108 };

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

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

00116                                               {
00117     _clockRate = clockRate;
00118 };

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

Sets the initial sequence number.

00126                                                                     {
00127     _sequenceNumberBase = sequenceNumberBase;
00128 };

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

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

00111                                                     {
00112     _startTime = startTime;
00113 };

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

Sets the initial rtp time stamp.

00121                                                           {
00122     _timeStampBase = timeStampBase;
00123 };

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

A sender info shall never be deleted!

Reimplemented from RTPParticipantInfo.

00131                                              {
00132     return false;
00133 }


Member Data Documentation

u_int32 RTPSenderInfo::_bytesSent [private]

The number of data bytes this sender has sent.

int RTPSenderInfo::_clockRate [private]

The clock rate this sender increases the rtp time stamp.

u_int32 RTPSenderInfo::_packetsSent [private]

The number of rtp data packets this sender has sent.

u_int16 RTPSenderInfo::_sequenceNumberBase [private]

The initial sequence number.

simtime_t RTPSenderInfo::_startTime [private]

The time when the transmission was started.

u_int32 RTPSenderInfo::_timeStampBase [private]

The initial rtp time stamp.


The documentation for this class was generated from the following files:
Generated on Wed Apr 4 13:20:24 2007 for INET Framework for OMNeT++/OMNEST by  doxygen 1.4.7