INET Framework for OMNeT++/OMNEST
inet::rtp::RTPSenderInfo Class Reference

The class RTPSenderInfo is used by an RTP end system for storing information about itself. More...

#include <RTPSenderInfo.h>

Inheritance diagram for inet::rtp::RTPSenderInfo:
inet::rtp::RTPParticipantInfo inet::rtp::RTPParticipantInfo_Base

Public Member Functions

 RTPSenderInfo (uint32 ssrc=0)
 Default constructor. More...
 
 RTPSenderInfo (const RTPSenderInfo &senderInfo)
 Copy constructor. More...
 
virtual ~RTPSenderInfo ()
 Destructor. More...
 
RTPSenderInfooperator= (const RTPSenderInfo &senderInfo)
 Assignment operator. More...
 
virtual RTPSenderInfodup () const override
 Duplicates this RTPSenderInfo by calling the copy constructor. More...
 
virtual void processRTPPacket (RTPPacket *packet, int id, simtime_t arrivalTime) override
 Stores information about this outgoing RTPPacket. More...
 
virtual void processReceptionReport (ReceptionReport *report, simtime_t arrivalTime)
 Processes an incoming ReceptionReport for this sender. More...
 
virtual SenderReportsenderReport (simtime_t now) override
 Returns a SenderReport for this rtp endsystem. More...
 
virtual void setStartTime (simtime_t startTime)
 Sets the time (simTime) when this endsystem has started sending rtp packets. More...
 
virtual void setClockRate (int clockRate)
 Sets the clock rate (in ticks per second) this sender increases the rtp time stamp. More...
 
virtual void setTimeStampBase (uint32 timeStampBase)
 Sets the initial rtp time stamp. More...
 
virtual void setSequenceNumberBase (uint16 sequenceNumberBase)
 Sets the initial sequence number. More...
 
- Public Member Functions inherited from inet::rtp::RTPParticipantInfo
 RTPParticipantInfo (uint32 ssrc=0)
 Default constructor. More...
 
 RTPParticipantInfo (const RTPParticipantInfo &participantInfo)
 Copy constructor. More...
 
virtual ~RTPParticipantInfo ()
 Destructor. More...
 
RTPParticipantInfooperator= (const RTPParticipantInfo &participantInfo)
 Assignment operator. More...
 
virtual void processSenderReport (SenderReport &report, simtime_t arrivalTime)
 This method extracts information about an RTP endsystem as provided by the given SenderReport. More...
 
virtual void processReceptionReport (ReceptionReport &report, simtime_t arrivalTime)
 This method extracts information of the given ReceptionReport. More...
 
virtual void processSDESChunk (SDESChunk *sdesChunk, simtime_t arrivalTime)
 This method extracts sdes information of the given sdes chunk.and stores it. More...
 
virtual SDESChunkgetSDESChunk () const
 Returns a copy of the sdes chunk used for storing source description items about this system. More...
 
virtual void addSDESItem (SDESItem *sdesItem)
 Adds this sdes item to the sdes chunk of this participant. More...
 
virtual ReceptionReportreceptionReport (simtime_t now)
 This method is intended to be overwritten by subclasses. More...
 
virtual void nextInterval (simtime_t now)
 This method should be called by the rtcp module which uses this class for storing information every time an rtcp packet is sent. More...
 
virtual bool toBeDeleted (simtime_t now)
 Returns true if the end system does no longer participate in the RTP session. More...
 
virtual bool isSender () const
 Returns true if this endsystem has sent at least one RTP data packet during the last two rtcp intervals (including the current one). More...
 
virtual uint32 getSsrc () const override
 Returns the ssrc identifier of the RTP endsystem. More...
 
virtual void setSsrc (uint32 ssrc) override
 Sets the ssrc identifier. More...
 
virtual void addSDESItem (SDESItem::SDES_ITEM_TYPE type, const char *content)
 Creates a new SDESItem and adds it to the SDESChunk stored in this RTPParticipantInfo. More...
 
virtual void parsimPack (cCommBuffer *b) const override
 
virtual void parsimUnpack (cCommBuffer *b) override
 
- Public Member Functions inherited from inet::rtp::RTPParticipantInfo_Base
virtual ~RTPParticipantInfo_Base ()
 
virtual void parsimPack (omnetpp::cCommBuffer *b) const override
 
virtual void parsimUnpack (omnetpp::cCommBuffer *b) override
 
virtual IPv4AddressgetAddress ()
 
virtual const IPv4AddressgetAddress () const
 
virtual void setAddress (const IPv4Address &address)
 
virtual int getRTPPort () const
 
virtual void setRTPPort (int RTPPort)
 
virtual int getRTCPPort () const
 
virtual void setRTCPPort (int RTCPPort)
 

Protected Attributes

simtime_t _startTime
 The time when the transmission was started. More...
 
int _clockRate
 The clock rate this sender increases the rtp time stamp. More...
 
uint32 _timeStampBase
 The initial rtp time stamp. More...
 
uint16 _sequenceNumberBase
 The initial sequence number. More...
 
uint32 _packetsSent
 The number of rtp data packets this sender has sent. More...
 
uint32 _bytesSent
 The number of data bytes this sender has sent. More...
 
- Protected Attributes inherited from inet::rtp::RTPParticipantInfo
SDESChunk _sdesChunk
 Used for storing sdes information about this RTP endsystem. More...
 
int _silentIntervals
 Stores the number of rtcp intervals (including the current one) during which this RTP endsystem hasn't sent any RTP data packets. More...
 
- Protected Attributes inherited from inet::rtp::RTPParticipantInfo_Base
IPv4Address address
 
int RTPPort
 
int RTCPPort
 

Private Member Functions

void copy (const RTPSenderInfo &other)
 

Additional Inherited Members

- Static Public Member Functions inherited from inet::rtp::RTPParticipantInfo
static std::string ssrcToName (uint32 ssrc)
 This method returns the given 32 bit ssrc identifier as an 8 character hexadecimal number which is used as name of an RTPParticipantInfo object. More...
 
- Protected Member Functions inherited from inet::rtp::RTPParticipantInfo_Base
bool operator== (const RTPParticipantInfo_Base &)
 
 RTPParticipantInfo_Base (const char *name=nullptr)
 
 RTPParticipantInfo_Base (const RTPParticipantInfo_Base &other)
 
RTPParticipantInfo_Baseoperator= (const RTPParticipantInfo_Base &other)
 

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.

Constructor & Destructor Documentation

inet::rtp::RTPSenderInfo::RTPSenderInfo ( uint32  ssrc = 0)

Default constructor.

Referenced by dup().

29  : RTPParticipantInfo(ssrc)
30 {
31  _startTime = 0.0;
32  _clockRate = 0;
33  _timeStampBase = 0;
35  _packetsSent = 0;
36  _bytesSent = 0;
37 }
uint16 _sequenceNumberBase
The initial sequence number.
Definition: RTPSenderInfo.h:122
simtime_t _startTime
The time when the transmission was started.
Definition: RTPSenderInfo.h:107
RTPParticipantInfo(uint32 ssrc=0)
Default constructor.
Definition: RTPParticipantInfo.cc:29
uint32 _timeStampBase
The initial rtp time stamp.
Definition: RTPSenderInfo.h:117
int _clockRate
The clock rate this sender increases the rtp time stamp.
Definition: RTPSenderInfo.h:112
uint32 _packetsSent
The number of rtp data packets this sender has sent.
Definition: RTPSenderInfo.h:127
uint32 _bytesSent
The number of data bytes this sender has sent.
Definition: RTPSenderInfo.h:132
inet::rtp::RTPSenderInfo::RTPSenderInfo ( const RTPSenderInfo senderInfo)

Copy constructor.

39  : RTPParticipantInfo(senderInfo)
40 {
41  copy(senderInfo);
42 }
RTPParticipantInfo(uint32 ssrc=0)
Default constructor.
Definition: RTPParticipantInfo.cc:29
void copy(const RTPSenderInfo &other)
Definition: RTPSenderInfo.cc:57
inet::rtp::RTPSenderInfo::~RTPSenderInfo ( )
virtual

Destructor.

45 {
46 }

Member Function Documentation

void inet::rtp::RTPSenderInfo::copy ( const RTPSenderInfo other)
private

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

58 {
60  _startTime = senderInfo._startTime;
61  _clockRate = senderInfo._clockRate;
62  _timeStampBase = senderInfo._timeStampBase;
63  _sequenceNumberBase = senderInfo._sequenceNumberBase;
64  _packetsSent = senderInfo._packetsSent;
65  _bytesSent = senderInfo._bytesSent;
66 }
uint16 _sequenceNumberBase
The initial sequence number.
Definition: RTPSenderInfo.h:122
simtime_t _startTime
The time when the transmission was started.
Definition: RTPSenderInfo.h:107
RTPParticipantInfo & operator=(const RTPParticipantInfo &participantInfo)
Assignment operator.
Definition: RTPParticipantInfo.cc:51
uint32 _timeStampBase
The initial rtp time stamp.
Definition: RTPSenderInfo.h:117
int _clockRate
The clock rate this sender increases the rtp time stamp.
Definition: RTPSenderInfo.h:112
uint32 _packetsSent
The number of rtp data packets this sender has sent.
Definition: RTPSenderInfo.h:127
uint32 _bytesSent
The number of data bytes this sender has sent.
Definition: RTPSenderInfo.h:132
RTPSenderInfo * inet::rtp::RTPSenderInfo::dup ( ) const
overridevirtual

Duplicates this RTPSenderInfo by calling the copy constructor.

Reimplemented from inet::rtp::RTPParticipantInfo.

69 {
70  return new RTPSenderInfo(*this);
71 }
RTPSenderInfo(uint32 ssrc=0)
Default constructor.
Definition: RTPSenderInfo.cc:29
RTPSenderInfo & inet::rtp::RTPSenderInfo::operator= ( const RTPSenderInfo senderInfo)

Assignment operator.

49 {
50  if (this == &senderInfo)
51  return *this;
53  copy(senderInfo);
54  return *this;
55 }
RTPParticipantInfo & operator=(const RTPParticipantInfo &participantInfo)
Assignment operator.
Definition: RTPParticipantInfo.cc:51
void copy(const RTPSenderInfo &other)
Definition: RTPSenderInfo.cc:57
void inet::rtp::RTPSenderInfo::processReceptionReport ( ReceptionReport report,
simtime_t  arrivalTime 
)
virtual

Processes an incoming ReceptionReport for this sender.

Referenced by inet::rtp::RTCP::processIncomingRTCPReceiverReportPacket(), and inet::rtp::RTCP::processIncomingRTCPSenderReportPacket().

85 {
86  delete report;
87 }
void inet::rtp::RTPSenderInfo::processRTPPacket ( RTPPacket packet,
int  id,
simtime_t  arrivalTime 
)
overridevirtual

Stores information about this outgoing RTPPacket.

Reimplemented from inet::rtp::RTPParticipantInfo.

Referenced by inet::rtp::RTCP::processOutgoingRTPPacket().

74 {
75  _packetsSent++;
76  _bytesSent = _bytesSent + packet->getPayloadLength();
77 
78  // call corresponding method of superclass
79  // for setting _silentIntervals
80  // it deletes the packet !!!
81  RTPParticipantInfo::processRTPPacket(packet, id, arrivalTime);
82 }
virtual void processRTPPacket(RTPPacket *packet, int id, simtime_t arrivalTime)
This method should be extended by a subclass for extracting information about the originating endsyst...
Definition: RTPParticipantInfo.cc:71
uint32 _packetsSent
The number of rtp data packets this sender has sent.
Definition: RTPSenderInfo.h:127
uint32 _bytesSent
The number of data bytes this sender has sent.
Definition: RTPSenderInfo.h:132
SenderReport * inet::rtp::RTPSenderInfo::senderReport ( simtime_t  now)
overridevirtual

Returns a SenderReport for this rtp endsystem.

If it hasn't sent rtp data packets during the last 2 rtcp intervals, it returns nullptr.

Reimplemented from inet::rtp::RTPParticipantInfo.

Referenced by inet::rtp::RTCP::createPacket().

90 {
91  if (isSender()) {
92  SenderReport *senderReport = new SenderReport();
93  // ntp time stamp is 64 bit integer
94 
95  uint64 ntpSeconds = (uint64)SIMTIME_DBL(now);
96  uint64 ntpFraction = (uint64)((SIMTIME_DBL(now) - ntpSeconds * 65536.0) * 65536.0);
97 
98  senderReport->setNTPTimeStamp((uint64)(ntpSeconds << 32) + ntpFraction);
99  senderReport->setRTPTimeStamp(SIMTIME_DBL(now - _startTime) * _clockRate);
100  senderReport->setPacketCount(_packetsSent);
101  senderReport->setByteCount(_bytesSent);
102  return senderReport;
103  }
104  else {
105  return nullptr;
106  }
107 }
simtime_t _startTime
The time when the transmission was started.
Definition: RTPSenderInfo.h:107
virtual SenderReport * senderReport(simtime_t now) override
Returns a SenderReport for this rtp endsystem.
Definition: RTPSenderInfo.cc:89
int _clockRate
The clock rate this sender increases the rtp time stamp.
Definition: RTPSenderInfo.h:112
uint64_t uint64
Definition: Compat.h:28
uint32 _packetsSent
The number of rtp data packets this sender has sent.
Definition: RTPSenderInfo.h:127
virtual bool isSender() const
Returns true if this endsystem has sent at least one RTP data packet during the last two rtcp interva...
Definition: RTPParticipantInfo.cc:108
uint32 _bytesSent
The number of data bytes this sender has sent.
Definition: RTPSenderInfo.h:132
void inet::rtp::RTPSenderInfo::setClockRate ( int  clockRate)
virtual

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

Referenced by inet::rtp::RTCP::handleSenderModuleInitialized().

115 {
116  _clockRate = clockRate;
117 }
int _clockRate
The clock rate this sender increases the rtp time stamp.
Definition: RTPSenderInfo.h:112
void inet::rtp::RTPSenderInfo::setSequenceNumberBase ( uint16  sequenceNumberBase)
virtual

Sets the initial sequence number.

Referenced by inet::rtp::RTCP::handleSenderModuleInitialized().

125 {
126  _sequenceNumberBase = sequenceNumberBase;
127 }
uint16 _sequenceNumberBase
The initial sequence number.
Definition: RTPSenderInfo.h:122
void inet::rtp::RTPSenderInfo::setStartTime ( simtime_t  startTime)
virtual

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

Referenced by inet::rtp::RTCP::handleSenderModuleInitialized().

110 {
111  _startTime = startTime;
112 }
simtime_t _startTime
The time when the transmission was started.
Definition: RTPSenderInfo.h:107
void inet::rtp::RTPSenderInfo::setTimeStampBase ( uint32  timeStampBase)
virtual

Sets the initial rtp time stamp.

Referenced by inet::rtp::RTCP::handleSenderModuleInitialized().

120 {
121  _timeStampBase = timeStampBase;
122 }
uint32 _timeStampBase
The initial rtp time stamp.
Definition: RTPSenderInfo.h:117

Member Data Documentation

uint32 inet::rtp::RTPSenderInfo::_bytesSent
protected

The number of data bytes this sender has sent.

Referenced by copy(), processRTPPacket(), RTPSenderInfo(), and senderReport().

int inet::rtp::RTPSenderInfo::_clockRate
protected

The clock rate this sender increases the rtp time stamp.

Referenced by copy(), RTPSenderInfo(), senderReport(), and setClockRate().

uint32 inet::rtp::RTPSenderInfo::_packetsSent
protected

The number of rtp data packets this sender has sent.

Referenced by copy(), processRTPPacket(), RTPSenderInfo(), and senderReport().

uint16 inet::rtp::RTPSenderInfo::_sequenceNumberBase
protected

The initial sequence number.

Referenced by copy(), RTPSenderInfo(), and setSequenceNumberBase().

simtime_t inet::rtp::RTPSenderInfo::_startTime
protected

The time when the transmission was started.

Referenced by copy(), RTPSenderInfo(), senderReport(), and setStartTime().

uint32 inet::rtp::RTPSenderInfo::_timeStampBase
protected

The initial rtp time stamp.

Referenced by copy(), RTPSenderInfo(), and setTimeStampBase().


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