#include <RTPSenderInfo.h>
Public Member Functions | |
RTPSenderInfo (uint32 ssrc=0) | |
RTPSenderInfo (const RTPSenderInfo &senderInfo) | |
virtual | ~RTPSenderInfo () |
RTPSenderInfo & | operator= (const RTPSenderInfo &senderInfo) |
virtual RTPSenderInfo * | dup () const |
virtual void | processRTPPacket (RTPPacket *packet, int id, simtime_t arrivalTime) |
virtual void | processReceptionReport (ReceptionReport *report, simtime_t arrivalTime) |
virtual SenderReport * | senderReport (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 |
The class RTPSenderInfo is used by an rtp end system for storing information about itself. With the stored information it can create a SenderReport.
Definition at line 35 of file RTPSenderInfo.h.
RTPSenderInfo::RTPSenderInfo | ( | uint32 | ssrc = 0 |
) |
Default constructor.
Definition at line 28 of file RTPSenderInfo.cc.
Referenced by dup().
: RTPParticipantInfo(ssrc) { _startTime = 0.0; _clockRate = 0; _timeStampBase = 0; _sequenceNumberBase = 0; _packetsSent = 0; _bytesSent = 0; }
RTPSenderInfo::RTPSenderInfo | ( | const RTPSenderInfo & | senderInfo | ) |
Copy constructor.
Definition at line 39 of file RTPSenderInfo.cc.
: RTPParticipantInfo() { operator=(senderInfo); }
RTPSenderInfo::~RTPSenderInfo | ( | ) | [virtual] |
RTPSenderInfo * RTPSenderInfo::dup | ( | ) | const [virtual] |
Duplicates this RTPSenderInfo by calling the copy constructor.
Reimplemented from RTPParticipantInfo.
Definition at line 64 of file RTPSenderInfo.cc.
{ return new RTPSenderInfo(*this); }
RTPSenderInfo & RTPSenderInfo::operator= | ( | const RTPSenderInfo & | senderInfo | ) |
Assignment operator.
Definition at line 51 of file RTPSenderInfo.cc.
Referenced by RTPSenderInfo().
{ RTPParticipantInfo::operator=(senderInfo); _startTime = senderInfo._startTime; _clockRate = senderInfo._clockRate; _timeStampBase = senderInfo._timeStampBase; _sequenceNumberBase = senderInfo._sequenceNumberBase; _packetsSent = senderInfo._packetsSent; _bytesSent = senderInfo._bytesSent; return *this; }
void RTPSenderInfo::processReceptionReport | ( | ReceptionReport * | report, | |
simtime_t | arrivalTime | |||
) | [virtual] |
Processes an incoming ReceptionReport for this sender.
Reimplemented from RTPParticipantInfo.
Definition at line 82 of file RTPSenderInfo.cc.
Referenced by RTCP::processIncomingRTCPPacket().
{
delete report;
}
void RTPSenderInfo::processRTPPacket | ( | RTPPacket * | packet, | |
int | id, | |||
simtime_t | arrivalTime | |||
) | [virtual] |
Stores information about this outgoing RTPPacket.
Reimplemented from RTPParticipantInfo.
Definition at line 70 of file RTPSenderInfo.cc.
Referenced by RTCP::processOutgoingRTPPacket().
{ _packetsSent++; _bytesSent = _bytesSent + packet->getPayloadLength(); // call corresponding method of superclass // for setting _silentIntervals // it deletes the packet !!! RTPParticipantInfo::processRTPPacket(packet, id, arrivalTime); }
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.
Definition at line 88 of file RTPSenderInfo.cc.
Referenced by RTCP::createPacket().
{ if (isSender()) { SenderReport *senderReport = new SenderReport(); // ntp time stamp is 64 bit integer uint64 ntpSeconds = (uint64)SIMTIME_DBL(now); uint64 ntpFraction = (uint64)( (SIMTIME_DBL(now) - ntpSeconds*65536.0) * 65536.0); senderReport->setNTPTimeStamp((uint64)(ntpSeconds << 32) + ntpFraction); senderReport->setRTPTimeStamp(SIMTIME_DBL(now - _startTime) * _clockRate); senderReport->setPacketCount(_packetsSent); senderReport->setByteCount(_bytesSent); return senderReport; } else { return NULL; } }
void RTPSenderInfo::setClockRate | ( | int | clockRate | ) | [virtual] |
Sets the clock rate (in ticks per second) this sender increases the rtp time stamp.
Definition at line 115 of file RTPSenderInfo.cc.
Referenced by RTCP::senderModuleInitialized().
{ _clockRate = clockRate; }
void RTPSenderInfo::setSequenceNumberBase | ( | uint16 | sequenceNumberBase | ) | [virtual] |
Sets the initial sequence number.
Definition at line 127 of file RTPSenderInfo.cc.
Referenced by RTCP::senderModuleInitialized().
{ _sequenceNumberBase = sequenceNumberBase; }
void RTPSenderInfo::setStartTime | ( | simtime_t | startTime | ) | [virtual] |
Sets the time (simTime) when this endsystem has started sending rtp packets.
Definition at line 109 of file RTPSenderInfo.cc.
Referenced by RTCP::senderModuleInitialized().
{ _startTime = startTime; }
void RTPSenderInfo::setTimeStampBase | ( | uint32 | timeStampBase | ) | [virtual] |
Sets the initial rtp time stamp.
Definition at line 121 of file RTPSenderInfo.cc.
Referenced by RTCP::senderModuleInitialized().
{ _timeStampBase = timeStampBase; }
bool RTPSenderInfo::toBeDeleted | ( | simtime_t | now | ) | [virtual] |
A sender info shall never be deleted!
Reimplemented from RTPParticipantInfo.
Definition at line 133 of file RTPSenderInfo.cc.
{ return false; }
uint32 RTPSenderInfo::_bytesSent [protected] |
The number of data bytes this sender has sent.
Definition at line 139 of file RTPSenderInfo.h.
Referenced by operator=(), processRTPPacket(), RTPSenderInfo(), and senderReport().
int RTPSenderInfo::_clockRate [protected] |
The clock rate this sender increases the rtp time stamp.
Definition at line 119 of file RTPSenderInfo.h.
Referenced by operator=(), RTPSenderInfo(), senderReport(), and setClockRate().
uint32 RTPSenderInfo::_packetsSent [protected] |
The number of rtp data packets this sender has sent.
Definition at line 134 of file RTPSenderInfo.h.
Referenced by operator=(), processRTPPacket(), RTPSenderInfo(), and senderReport().
uint16 RTPSenderInfo::_sequenceNumberBase [protected] |
The initial sequence number.
Definition at line 129 of file RTPSenderInfo.h.
Referenced by operator=(), RTPSenderInfo(), and setSequenceNumberBase().
simtime_t RTPSenderInfo::_startTime [protected] |
The time when the transmission was started.
Definition at line 114 of file RTPSenderInfo.h.
Referenced by operator=(), RTPSenderInfo(), senderReport(), and setStartTime().
uint32 RTPSenderInfo::_timeStampBase [protected] |
The initial rtp time stamp.
Definition at line 124 of file RTPSenderInfo.h.
Referenced by operator=(), RTPSenderInfo(), and setTimeStampBase().