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_t 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 (Packet *packet, int id, simtime_t arrivalTime) override
 Stores information about this outgoing RtpPacket. More...
 
virtual void processReceptionReport (const 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_t timeStampBase)
 Sets the initial rtp time stamp. More...
 
virtual void setSequenceNumberBase (uint16_t sequenceNumberBase)
 Sets the initial sequence number. More...
 
- Public Member Functions inherited from inet::rtp::RtpParticipantInfo
 RtpParticipantInfo (uint32_t 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 (const SenderReport &report, simtime_t arrivalTime)
 This method extracts information about an RTP endsystem as provided by the given SenderReport. More...
 
virtual void processReceptionReport (const ReceptionReport &report, simtime_t arrivalTime)
 This method extracts information of the given ReceptionReport. More...
 
virtual void processSDESChunk (const 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_t getSsrc () const override
 Returns the ssrc identifier of the RTP endsystem. More...
 
virtual void setSsrc (uint32_t ssrc) override
 Sets the ssrc identifier. More...
 
virtual void addSDESItem (SdesItem::SdesItemType 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 const ::inet::Ipv4AddressgetAddress () const
 
virtual ::inet::Ipv4AddressgetAddressForUpdate ()
 
virtual void setAddress (const ::inet::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_t _timeStampBase
 The initial rtp time stamp. More...
 
uint16_t _sequenceNumberBase
 The initial sequence number. More...
 
uint32_t _packetsSent
 The number of rtp data packets this sender has sent. More...
 
uint32_t _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
::inet::Ipv4Address address = Ipv4Address::UNSPECIFIED_ADDRESS
 
int RTPPort = PORT_UNDEF
 
int RTCPPort = PORT_UNDEF
 

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_t 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 &)=delete
 
 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

◆ RtpSenderInfo() [1/2]

inet::rtp::RtpSenderInfo::RtpSenderInfo ( uint32_t  ssrc = 0)

Default constructor.

17  : RtpParticipantInfo(ssrc)
18 {
19  _startTime = 0.0;
20  _clockRate = 0;
21  _timeStampBase = 0;
23  _packetsSent = 0;
24  _bytesSent = 0;
25 }

Referenced by dup().

◆ RtpSenderInfo() [2/2]

inet::rtp::RtpSenderInfo::RtpSenderInfo ( const RtpSenderInfo senderInfo)

Copy constructor.

27  : RtpParticipantInfo(senderInfo)
28 {
29  copy(senderInfo);
30 }

◆ ~RtpSenderInfo()

inet::rtp::RtpSenderInfo::~RtpSenderInfo ( )
virtual

Destructor.

33 {
34 }

Member Function Documentation

◆ copy()

void inet::rtp::RtpSenderInfo::copy ( const RtpSenderInfo other)
private
46 {
48  _startTime = senderInfo._startTime;
49  _clockRate = senderInfo._clockRate;
50  _timeStampBase = senderInfo._timeStampBase;
51  _sequenceNumberBase = senderInfo._sequenceNumberBase;
52  _packetsSent = senderInfo._packetsSent;
53  _bytesSent = senderInfo._bytesSent;
54 }

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

◆ dup()

RtpSenderInfo * inet::rtp::RtpSenderInfo::dup ( ) const
overridevirtual

Duplicates this RtpSenderInfo by calling the copy constructor.

Reimplemented from inet::rtp::RtpParticipantInfo.

57 {
58  return new RtpSenderInfo(*this);
59 }

◆ operator=()

RtpSenderInfo & inet::rtp::RtpSenderInfo::operator= ( const RtpSenderInfo senderInfo)

Assignment operator.

37 {
38  if (this == &senderInfo)
39  return *this;
41  copy(senderInfo);
42  return *this;
43 }

◆ processReceptionReport()

void inet::rtp::RtpSenderInfo::processReceptionReport ( const ReceptionReport report,
simtime_t  arrivalTime 
)
virtual

◆ processRTPPacket()

void inet::rtp::RtpSenderInfo::processRTPPacket ( Packet packet,
int  id,
simtime_t  arrivalTime 
)
overridevirtual

Stores information about this outgoing RtpPacket.

Reimplemented from inet::rtp::RtpParticipantInfo.

62 {
63  const auto& rtpHeader = packet->peekAtFront<RtpHeader>();
64  _packetsSent++;
65  _bytesSent = _bytesSent + packet->getByteLength() - B(rtpHeader->getChunkLength()).get();
66 
67  // call corresponding method of superclass
68  // for setting _silentIntervals
69  // it deletes the packet !!!
70  RtpParticipantInfo::processRTPPacket(packet, id, arrivalTime);
71 }

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

◆ senderReport()

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.

78 {
79  if (isSender()) {
80  SenderReport *senderReport = new SenderReport();
81  // ntp time stamp is 64 bit integer
82 
83  uint64_t ntpSeconds = (uint64_t)SIMTIME_DBL(now);
84  uint64_t ntpFraction = (uint64_t)((SIMTIME_DBL(now) - ntpSeconds * 65536.0) * 65536.0);
85 
86  senderReport->setNTPTimeStamp((uint64_t)(ntpSeconds << 32) + ntpFraction);
87  senderReport->setRTPTimeStamp(SIMTIME_DBL(now - _startTime) * _clockRate);
90  return senderReport;
91  }
92  else {
93  return nullptr;
94  }
95 }

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

◆ setClockRate()

void inet::rtp::RtpSenderInfo::setClockRate ( int  clockRate)
virtual

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

103 {
104  _clockRate = clockRate;
105 }

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

◆ setSequenceNumberBase()

void inet::rtp::RtpSenderInfo::setSequenceNumberBase ( uint16_t  sequenceNumberBase)
virtual

Sets the initial sequence number.

113 {
114  _sequenceNumberBase = sequenceNumberBase;
115 }

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

◆ setStartTime()

void inet::rtp::RtpSenderInfo::setStartTime ( simtime_t  startTime)
virtual

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

98 {
99  _startTime = startTime;
100 }

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

◆ setTimeStampBase()

void inet::rtp::RtpSenderInfo::setTimeStampBase ( uint32_t  timeStampBase)
virtual

Sets the initial rtp time stamp.

108 {
109  _timeStampBase = timeStampBase;
110 }

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

Member Data Documentation

◆ _bytesSent

uint32_t inet::rtp::RtpSenderInfo::_bytesSent
protected

The number of data bytes this sender has sent.

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

◆ _clockRate

int inet::rtp::RtpSenderInfo::_clockRate
protected

The clock rate this sender increases the rtp time stamp.

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

◆ _packetsSent

uint32_t inet::rtp::RtpSenderInfo::_packetsSent
protected

The number of rtp data packets this sender has sent.

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

◆ _sequenceNumberBase

uint16_t inet::rtp::RtpSenderInfo::_sequenceNumberBase
protected

The initial sequence number.

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

◆ _startTime

simtime_t inet::rtp::RtpSenderInfo::_startTime
protected

The time when the transmission was started.

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

◆ _timeStampBase

uint32_t 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:
inet::rtp::RtpParticipantInfo::processRTPPacket
virtual void processRTPPacket(Packet *packet, int id, simtime_t arrivalTime)
This method should be extended by a subclass for extracting information about the originating endsyst...
Definition: RtpParticipantInfo.cc:60
inet::rtp::SenderReport::setRTPTimeStamp
virtual void setRTPTimeStamp(uint32_t RTPTimeStamp)
inet::rtp::RtpSenderInfo::_timeStampBase
uint32_t _timeStampBase
The initial rtp time stamp.
Definition: RtpSenderInfo.h:104
inet::rtp::RtpParticipantInfo::operator=
RtpParticipantInfo & operator=(const RtpParticipantInfo &participantInfo)
Assignment operator.
Definition: RtpParticipantInfo.cc:40
inet::rtp::RtpSenderInfo::copy
void copy(const RtpSenderInfo &other)
Definition: RtpSenderInfo.cc:45
inet::rtp::SenderReport::setPacketCount
virtual void setPacketCount(uint32_t packetCount)
inet::rtp::RtpSenderInfo::senderReport
virtual SenderReport * senderReport(simtime_t now) override
Returns a SenderReport for this rtp endsystem.
Definition: RtpSenderInfo.cc:77
inet::rtp::RtpSenderInfo::_sequenceNumberBase
uint16_t _sequenceNumberBase
The initial sequence number.
Definition: RtpSenderInfo.h:109
inet::units::units::B
intscale< b, 1, 8 > B
Definition: Units.h:1168
inet::rtp::RtpSenderInfo::_bytesSent
uint32_t _bytesSent
The number of data bytes this sender has sent.
Definition: RtpSenderInfo.h:119
inet::rtp::RtpParticipantInfo::RtpParticipantInfo
RtpParticipantInfo(uint32_t ssrc=0)
Default constructor.
Definition: RtpParticipantInfo.cc:18
inet::rtp::SenderReport::setNTPTimeStamp
virtual void setNTPTimeStamp(uint64_t NTPTimeStamp)
inet::rtp::RtpSenderInfo::_startTime
simtime_t _startTime
The time when the transmission was started.
Definition: RtpSenderInfo.h:94
inet::rtp::RtpSenderInfo::_clockRate
int _clockRate
The clock rate this sender increases the rtp time stamp.
Definition: RtpSenderInfo.h:99
inet::rtp::SenderReport::setByteCount
virtual void setByteCount(uint32_t byteCount)
inet::rtp::RtpSenderInfo::_packetsSent
uint32_t _packetsSent
The number of rtp data packets this sender has sent.
Definition: RtpSenderInfo.h:114
inet::rtp::RtpParticipantInfo::isSender
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:97
inet::rtp::RtpSenderInfo::RtpSenderInfo
RtpSenderInfo(uint32_t ssrc=0)
Default constructor.
Definition: RtpSenderInfo.cc:17