#include <RTPParticipantInfo.h>
Inheritance diagram for RTPParticipantInfo:
RTPSenderInformation
Public Member Functions | |
RTPParticipantInfo (u_int32 ssrc=0) | |
RTPParticipantInfo (const RTPParticipantInfo &participantInfo) | |
virtual | ~RTPParticipantInfo () |
RTPParticipantInfo & | operator= (const RTPParticipantInfo &participantInfo) |
virtual cObject * | dup () const |
virtual const char * | className () const |
virtual void | processRTPPacket (RTPPacket *packet, simtime_t arrivalTime) |
virtual void | processSenderReport (SenderReport *report, simtime_t arrivalTime) |
virtual void | processReceptionReport (ReceptionReport *report, simtime_t arrivalTime) |
virtual void | processSDESChunk (SDESChunk *sdesChunk, simtime_t arrivalTime) |
virtual SDESChunk * | sdesChunk () |
virtual void | addSDESItem (SDESItem *sdesItem) |
virtual ReceptionReport * | receptionReport (simtime_t now) |
virtual SenderReport * | senderReport (simtime_t now) |
virtual void | nextInterval (simtime_t now) |
virtual bool | toBeDeleted (simtime_t now) |
virtual bool | isSender () |
virtual u_int32 | ssrc () |
virtual void | setSSRC (u_int32 ssrc) |
virtual IN_Addr | address () |
virtual void | setAddress (IN_Addr address) |
virtual IN_Port | rtpPort () |
virtual void | setRTPPort (IN_Port rtpPort) |
virtual IN_Port | rtcpPort () |
virtual void | setRTCPPort (IN_Port rtpPort) |
Static Public Member Functions | |
static char * | ssrcToName (u_int32 ssrc) |
Protected Member Functions | |
virtual void | addSDESItem (SDESItem::SDES_ITEM_TYPE type, const char *content) |
Protected Attributes | |
SDESChunk * | _sdesChunk |
IN_Addr | _address |
IN_Port | _rtpPort |
IN_Port | _rtcpPort |
int | _silentIntervals |
|
Default constructor. 00033 : cObject() { 00034 setName(ssrcToName(ssrc)); 00035 _sdesChunk = new SDESChunk("SDESChunk", ssrc); 00036 // because there haven't been sent any rtp packets 00037 // by this endsystem at all, the number of silent 00038 // intervals would be undefined; to calculate with 00039 // it but not to regard this endsystem as a sender 00040 // it is set to 3; see isSender() for details 00041 _silentIntervals = 3; 00042 _address = IPADDRESS_UNDEF; 00043 _rtpPort = IPSuite_PORT_UNDEF; 00044 _rtcpPort = IPSuite_PORT_UNDEF; 00045 };
|
|
Copy constructor. 00048 : cObject() { 00049 setName(participantInfo.name()); 00050 operator=(participantInfo); 00051 };
|
|
Destructor. 00054 {
00055 //delete _sdesChunk;
00056 };
|
|
Returns the ip address of the rtp endsystem. 00160 { 00161 return _address; 00162 };
|
|
Creates a new SDESItem and adds it to the SDESChunk stored in this RTPParticipantInfo. 00155 { 00156 _sdesChunk->addSDESItem(new SDESItem(type, content)); 00157 };
|
|
Adds this sdes item to the sdes chunk of this participant. 00113 { 00114 _sdesChunk->addSDESItem(sdesItem); 00115 };
|
|
Returns the class name "RTPParticipantInfo". Reimplemented in RTPReceiverInfo, and RTPSenderInfo. 00074 { 00075 return "RTPParticipantInfo"; 00076 };
|
|
Duplicates this RTPParticipantInfo by calling the copy constructor. Reimplemented in RTPReceiverInfo, and RTPSenderInfo. 00069 { 00070 return new RTPParticipantInfo(*this); 00071 };
|
|
Returns true if this endsystem has sent at least one rtp data packet during the last two rtcp intervals (including the current one). 00118 {
00119 return (_silentIntervals <= 1);
00120 };
|
|
This method should be called by the rtcp module which uses this class for storing information every time an rtcp packet is sent. Some behaviour of rtp and rtcp (and this class) depend on how many rtcp intervals have passed, for example an rtp end system is marked as inactive if there haven't been received packets from it for a certain number of rtpc intervals. Call senderReport() and receptionReport() before calling this method.
Reimplemented in RTPReceiverInfo. 00134 { 00135 _silentIntervals++; 00136 };
|
|
Assignment operator. 00059 { 00060 cObject::operator=(participantInfo); 00061 _sdesChunk = new SDESChunk(*(participantInfo._sdesChunk)); 00062 _address = participantInfo._address; 00063 _rtpPort = participantInfo._rtpPort; 00064 _rtcpPort = participantInfo._rtcpPort; 00065 return *this; 00066 };
|
|
This method extracts information of the given ReceptionReport. Reimplemented in RTPSenderInfo. 00091 { 00092 // useful code can be found in subclasses 00093 delete report; 00094 };
|
|
This method should be extended by a subclass for extracting information about the originating endsystem of an rtp packet. This method sets _silentInterval to 0 so that the sender of this rtp packet is regarded as an active sender. Reimplemented in RTPReceiverInfo, and RTPSenderInfo. 00079 { 00080 _silentIntervals = 0; 00081 delete packet; 00082 };
|
|
This method extracts sdes information of the given sdes chunk.and stores it. Reimplemented in RTPReceiverInfo. 00097 { 00098 for (int i = 0; i < sdesChunk->items(); i++) { 00099 if (sdesChunk->exist(i)) { 00100 SDESItem *sdesItem = (SDESItem *)(sdesChunk->remove(i)); 00101 addSDESItem(sdesItem); 00102 } 00103 } 00104 delete sdesChunk; 00105 };
|
|
This method extracts information about an rtp endsystem as provided by the given SenderReport. Reimplemented in RTPReceiverInfo. 00085 { 00086 // useful code can be found in subclasses 00087 delete report; 00088 };
|
|
This method is intended to be overwritten by subclasses. It should return a receiver report if there have been received rtp packets from that endsystem and NULL otherwise. Reimplemented in RTPReceiverInfo. 00123 { 00124 opp_error("Returning NULL pointer results in segmentation fault"); 00125 return NULL; 00126 };
|
|
Returns the port used by this endsystem for transmitting rtcp packets. 00180 { 00181 return _rtcpPort; 00182 };
|
|
Returns the port used by this endsystem for transmitting rtp packets. 00170 { 00171 return _rtpPort; 00172 };
|
|
Returns a copy of the sdes chunk used for storing source description items about this system. 00108 { 00109 return new SDESChunk(*_sdesChunk); 00110 };
|
|
This method is intended to be overwritten by subclasses which are used for storing information about itself. It should return a sender report if there have been sent rtp packets recently or NULL otherwise. The implementation for this class always returns NULL. Reimplemented in RTPSenderInfo. 00129 {
00130 return NULL;
00131 };
|
|
Sets the ip address of the rtp endsystem. 00165 { 00166 _address = address; 00167 };
|
|
Sets the port used by the endsystem for transmitting rtcp packets. 00185 { 00186 _rtcpPort = rtcpPort; 00187 };
|
|
Sets the port used by the endsystem for transmitting rtp packets. 00175 { 00176 _rtpPort = rtpPort; 00177 };
|
|
Sets the ssrc identifier. 00149 { 00150 setName(ssrcToName(ssrc)); 00151 _sdesChunk->setSSRC(ssrc); 00152 };
|
|
Returns the ssrc identifier of the rtp endsystem. 00144 { 00145 return _sdesChunk->ssrc(); 00146 };
|
|
This method returns the given 32 bit ssrc identifier as an 8 character hexadecimal number which is used as name of an RTPParticipantInfo object. 00190 { 00191 char name[9]; 00192 sprintf(name, "%08x", ssrc); 00193 return opp_strdup(name); 00194 };
|
|
Returns true if the end system does no longer participate in the rtp session. The implementation in this class always returns false. Reimplemented in RTPReceiverInfo, and RTPSenderInfo. 00139 { 00140 return false; 00141 };
|
|
Used for storing the ip address of this endsystem. |
|
Used for storing the port for rtcp by this endsystem. |
|
Used for storing the port for rtp by this endsystem. |
|
Used for storing sdes information about this rtp endsystem. The ssrc identifier is also stored here. |
|
Stores the number of rtcp intervals (including the current one) during which this rtp endsystem hasn't sent any rtp data packets. When an rtp data packet is received it is reset to 0. |