#include <RTPSenderInfo.h>
Inheritance diagram for RTPSenderInfo:
Public Member Functions | |
RTPSenderInfo (u_int32 ssrc=0) | |
RTPSenderInfo (const RTPSenderInfo &senderInfo) | |
virtual | ~RTPSenderInfo () |
RTPSenderInfo & | operator= (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 SenderReport * | senderReport (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 |
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 };
const char * RTPSenderInfo::className | ( | ) | const [virtual] |
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] |
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] |
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] |
bool RTPSenderInfo::toBeDeleted | ( | simtime_t | now | ) | [virtual] |
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.