INET Framework for OMNeT++/OMNEST
|
#include <RTPInnerPacket.h>
Public Types | |
enum | RTP_INP_TYPE { RTP_INP_UNDEF, RTP_INP_INITIALIZE_PROFILE, RTP_INP_PROFILE_INITIALIZED, RTP_INP_INITIALIZE_RTCP, RTP_INP_RTCP_INITIALIZED, RTP_INP_CREATE_SENDER_MODULE, RTP_INP_SENDER_MODULE_CREATED, RTP_INP_DELETE_SENDER_MODULE, RTP_INP_SENDER_MODULE_DELETED, RTP_INP_INITIALIZE_SENDER_MODULE, RTP_INP_SENDER_MODULE_INITIALIZED, RTP_INP_SENDER_MODULE_CONTROL, RTP_INP_SENDER_MODULE_STATUS, RTP_INP_LEAVE_SESSION, RTP_INP_SESSION_LEFT, RTP_INP_DATA_OUT, RTP_INP_DATA_IN } |
Public Member Functions | |
RTPInnerPacket (const char *name=NULL) | |
RTPInnerPacket (const RTPInnerPacket &rinp) | |
virtual | ~RTPInnerPacket () |
RTPInnerPacket & | operator= (const RTPInnerPacket &rinp) |
virtual RTPInnerPacket * | dup () const |
virtual std::string | info () |
virtual void | dump (std::ostream &os) const |
virtual void | initializeProfile (int mtu) |
virtual void | profileInitialized (int rtcpPercentage, int port) |
virtual void | initializeRTCP (const char *commonName, int mtu, int bandwidth, int rtcpPercentage, IPAddress address, int port) |
virtual void | rtcpInitialized (uint32 ssrc) |
virtual void | createSenderModule (uint32 ssrc, int payloadType, const char *fileName) |
virtual void | senderModuleCreated (uint32 ssrc) |
virtual void | deleteSenderModule (uint32 ssrc) |
virtual void | senderModuleDeleted (uint32 ssrc) |
virtual void | initializeSenderModule (uint32 ssrc, const char *fileName, int mtu) |
virtual void | senderModuleInitialized (uint32 ssrc, int payloadType, int clockRate, int timeStampBase, int sequenceNumberBase) |
virtual void | senderModuleControl (uint32 ssrc, RTPSenderControlMessage *msg) |
virtual void | senderModuleStatus (uint32 ssrc, RTPSenderStatusMessage *msg) |
virtual void | leaveSession () |
virtual void | sessionLeft () |
virtual void | dataOut (RTPPacket *packet) |
virtual void | dataIn (RTPPacket *packet, IPAddress address, int port) |
virtual RTP_INP_TYPE | getType () |
virtual const char * | getCommonName () |
virtual int | getMTU () |
virtual int | getBandwidth () |
virtual int | getRtcpPercentage () |
virtual IPAddress | getAddress () |
virtual int | getPort () |
virtual uint32 | getSSRC () |
virtual int | getPayloadType () |
virtual const char * | getFileName () |
virtual int | getClockRate () |
virtual int | getTimeStampBase () |
virtual int | getSequenceNumberBase () |
Protected Attributes | |
RTP_INP_TYPE | _type |
const char * | _commonName |
int | _mtu |
int | _bandwidth |
int | _rtcpPercentage |
IPAddress | _address |
int | _port |
uint32 | _ssrc |
int | _payloadType |
const char * | _fileName |
int | _clockRate |
int | _timeStampBase |
int | _sequenceNumberBase |
This class is used for communication between submodules of the rtp layer module.
This enumeration is a list of all possibly types of an RTPInnerPacket.
{ RTP_INP_UNDEF, RTP_INP_INITIALIZE_PROFILE, RTP_INP_PROFILE_INITIALIZED, RTP_INP_INITIALIZE_RTCP, RTP_INP_RTCP_INITIALIZED, RTP_INP_CREATE_SENDER_MODULE, RTP_INP_SENDER_MODULE_CREATED, RTP_INP_DELETE_SENDER_MODULE, RTP_INP_SENDER_MODULE_DELETED, RTP_INP_INITIALIZE_SENDER_MODULE, RTP_INP_SENDER_MODULE_INITIALIZED, RTP_INP_SENDER_MODULE_CONTROL, RTP_INP_SENDER_MODULE_STATUS, RTP_INP_LEAVE_SESSION, RTP_INP_SESSION_LEFT, RTP_INP_DATA_OUT, RTP_INP_DATA_IN };
RTPInnerPacket::RTPInnerPacket | ( | const char * | name = NULL | ) |
Default constructor
Referenced by dup().
: cPacket(name) { _type = RTP_INP_UNDEF; _commonName = NULL; _mtu = 0; _bandwidth = 0; _rtcpPercentage = 0; _address = IPAddress::UNSPECIFIED_ADDRESS; _port = PORT_UNDEF; _ssrc = 0; _payloadType = 0; _fileName = NULL; _clockRate = 0; _timeStampBase = 0; _sequenceNumberBase = 0; }
RTPInnerPacket::RTPInnerPacket | ( | const RTPInnerPacket & | rinp | ) |
Copy constructor.
: cPacket() { setName(rinp.getName()); operator=(rinp); }
RTPInnerPacket::~RTPInnerPacket | ( | ) | [virtual] |
Destructor.
{ if (opp_strcmp(_commonName, "")) delete _commonName; if (opp_strcmp(_fileName, "")) delete _fileName; }
void RTPInnerPacket::createSenderModule | ( | uint32 | ssrc, |
int | payloadType, | ||
const char * | fileName | ||
) | [virtual] |
Referenced by RTP::createSenderModule().
{ _type = RTP_INP_CREATE_SENDER_MODULE; _ssrc = ssrc; _payloadType = payloadType; _fileName = fileName; }
Capsultes the incoming RTPPacket into this RTPInnerPacket to transport it within the rtp layer.
Referenced by RTP::readRet().
{ _type = RTP_INP_DATA_IN; _address = address; _port = port; encapsulate(packet); }
void RTPInnerPacket::dataOut | ( | RTPPacket * | packet | ) | [virtual] |
Capsulates the outgoing RTPPacket into this RTPInnerPacket to transport it within the rtp layer.
Referenced by RTPAVProfilePayload32Sender::sendPacket().
{ _type = RTP_INP_DATA_OUT; encapsulate(packet); }
void RTPInnerPacket::deleteSenderModule | ( | uint32 | ssrc | ) | [virtual] |
Referenced by RTP::deleteSenderModule().
{ _type = RTP_INP_DELETE_SENDER_MODULE; _ssrc = ssrc; }
void RTPInnerPacket::dump | ( | std::ostream & | os | ) | const [virtual] |
Writes a longer info about this RTPInnerPacket into the given output stream.
{ os << "RTPInnerPacket:" << endl; os << " type = " << _type << endl; os << " commonName = " << _commonName << endl; os << " mtu = " << _mtu << endl; os << " bandwidth = " << _bandwidth << endl; os << " rtcpPercentage = " << _rtcpPercentage << endl; os << " address = " << _address << endl; os << " port = " << _port << endl; os << " ssrc = " << _ssrc << endl; os << " payloadType = " << _payloadType << endl; os << " fileName = " << _fileName << endl; os << " clockRate = " << _clockRate << endl; os << " timeStampBase = " << _timeStampBase << endl; os << " sequenceNumberBase = " << _sequenceNumberBase << endl; }
RTPInnerPacket * RTPInnerPacket::dup | ( | ) | const [virtual] |
Duplicates the RTPInnerPacket by calling the copy constructor.
{ return new RTPInnerPacket(*this); }
IPAddress RTPInnerPacket::getAddress | ( | ) | [virtual] |
Returns the address stored in this RTPInnerPacket.
Referenced by RTCP::dataIn(), and RTCP::initializeRTCP().
{ return _address; }
int RTPInnerPacket::getBandwidth | ( | ) | [virtual] |
Returns the available bandwitdth as stored in this RTPInnerPacket.
Referenced by RTCP::initializeRTCP().
{ return _bandwidth; }
int RTPInnerPacket::getClockRate | ( | ) | [virtual] |
Returns the rtp clock rate stored in this RTPInnerPacket.
Referenced by RTCP::senderModuleInitialized().
{ return _clockRate; }
const char * RTPInnerPacket::getCommonName | ( | ) | [virtual] |
Returns the CNAME stored in this RTPInnerPacket.
Referenced by RTCP::initializeRTCP().
{ return opp_strdup(_commonName); }
const char * RTPInnerPacket::getFileName | ( | ) | [virtual] |
Returns the file name stored in this RTPInnerPacket.
Referenced by RTPProfile::createSenderModule(), and RTPPayloadSender::initializeSenderModule().
{ return opp_strdup(_fileName); }
int RTPInnerPacket::getMTU | ( | ) | [virtual] |
Returns the maximum transmission unit stored in this RTPInnerPacket.
Referenced by RTPProfile::initializeProfile(), RTCP::initializeRTCP(), and RTPPayloadSender::initializeSenderModule().
{ return _mtu; }
int RTPInnerPacket::getPayloadType | ( | ) | [virtual] |
Returns the payload type stored in this RTPInnerPacket.
Referenced by RTPProfile::createSenderModule().
{ return _payloadType; }
int RTPInnerPacket::getPort | ( | ) | [virtual] |
Returns the port stored in this RTPInnerPacket.
Referenced by RTCP::dataIn(), RTCP::initializeRTCP(), and RTP::profileInitialized().
{ return _port; }
int RTPInnerPacket::getRtcpPercentage | ( | ) | [virtual] |
Returns the percentage of bandwidth for rtcp as stored in this RTPInnerPacket.
Referenced by RTCP::initializeRTCP(), and RTP::profileInitialized().
{ return _rtcpPercentage; }
int RTPInnerPacket::getSequenceNumberBase | ( | ) | [virtual] |
Returns the rtp sequence number base stored in this RTPInnerPacket.
Referenced by RTCP::senderModuleInitialized().
{ return _sequenceNumberBase; }
uint32 RTPInnerPacket::getSSRC | ( | ) | [virtual] |
Returns the ssrc identifier stored in this RTPInnerPacket.
Referenced by RTPProfile::createSenderModule(), RTPProfile::deleteSenderModule(), RTPPayloadSender::initializeSenderModule(), RTP::rtcpInitialized(), RTP::senderModuleControl(), RTP::senderModuleCreated(), RTP::senderModuleDeleted(), and RTP::senderModuleStatus().
{ return _ssrc; }
int RTPInnerPacket::getTimeStampBase | ( | ) | [virtual] |
Returns the rtp time stamp base stored in this RTPInnerPacket.
Referenced by RTCP::senderModuleInitialized().
{ return _timeStampBase; }
RTPInnerPacket::RTP_INP_TYPE RTPInnerPacket::getType | ( | ) | [virtual] |
Returns the type of this RTPInnerPacket.
Referenced by RTPPayloadSender::activity(), RTPPayloadReceiver::handleMessage(), RTPProfile::handleMessageFromPayloadSender(), RTP::handleMessageFromProfile(), RTP::handleMessageFromRTCP(), RTPProfile::handleMessageFromRTP(), and RTCP::handleMessageFromRTP().
{ return _type; }
std::string RTPInnerPacket::info | ( | ) | [virtual] |
Writes a short info about this RTPInnerPacket into the given string.
{ std::stringstream out; out << "RTPInnerPacket: type=" << _type; return out.str(); }
void RTPInnerPacket::initializeProfile | ( | int | mtu | ) | [virtual] |
Called by the rtp module after creating the profile module. It informes the profile about the maximum size an rtp packet can have.
Referenced by RTP::initializeProfile().
{ _type = RTP_INP_INITIALIZE_PROFILE; _mtu = mtu; }
void RTPInnerPacket::initializeRTCP | ( | const char * | commonName, |
int | mtu, | ||
int | bandwidth, | ||
int | rtcpPercentage, | ||
IPAddress | address, | ||
int | port | ||
) | [virtual] |
Called by the rtp module to inform the rtcp module about mandatory information for starting the rtp session.
Referenced by RTP::initializeRTCP().
{ _type = RTP_INP_INITIALIZE_RTCP; _commonName = commonName; _mtu = mtu; _bandwidth = bandwidth; _rtcpPercentage = rtcpPercentage; _address = address; _port = port; }
void RTPInnerPacket::initializeSenderModule | ( | uint32 | ssrc, |
const char * | fileName, | ||
int | mtu | ||
) | [virtual] |
Referenced by RTPProfile::createSenderModule().
{ _type = RTP_INP_INITIALIZE_SENDER_MODULE; _ssrc = ssrc; _fileName = fileName; _mtu = mtu; }
void RTPInnerPacket::leaveSession | ( | ) | [virtual] |
Called by the rtp module to inform the rtcp module that the session should be left.
Referenced by RTP::leaveSession().
{ _type = RTP_INP_LEAVE_SESSION; }
RTPInnerPacket & RTPInnerPacket::operator= | ( | const RTPInnerPacket & | rinp | ) |
Assignment operator.
Referenced by RTPInnerPacket().
{ cPacket::operator=(rinp); _type = rinp._type; _commonName = opp_strdup(rinp._commonName); _mtu = rinp._mtu; _bandwidth = rinp._bandwidth; _rtcpPercentage = rinp._rtcpPercentage; _address = rinp._address; _port = rinp._port; _ssrc = rinp._ssrc; _payloadType = rinp._payloadType; _fileName = opp_strdup(rinp._fileName); _clockRate = rinp._clockRate; _timeStampBase = rinp._timeStampBase; _sequenceNumberBase = rinp._sequenceNumberBase; return *this; }
void RTPInnerPacket::profileInitialized | ( | int | rtcpPercentage, |
int | port | ||
) | [virtual] |
Called by the profile module after it has received the initializeProfile() message. It informs the rtp module about the percentage of the available bandwidth to be used by rtcp and the preferred port for this profile.
Referenced by RTPProfile::initializeProfile().
{ _type = RTP_INP_PROFILE_INITIALIZED; _rtcpPercentage = rtcpPercentage; _port = port; }
void RTPInnerPacket::rtcpInitialized | ( | uint32 | ssrc | ) | [virtual] |
Called by the rtcp module after it has waited for half an rtcp interval for incoming messages from other session participants. It informs the rtp module which later informs the rtp application about the ssrc identifier
Referenced by RTCP::handleSelfMessage().
{ _type = RTP_INP_RTCP_INITIALIZED; _ssrc = ssrc; }
void RTPInnerPacket::senderModuleControl | ( | uint32 | ssrc, |
RTPSenderControlMessage * | msg | ||
) | [virtual] |
Referenced by RTP::senderModuleControl().
{ _type = RTP_INP_SENDER_MODULE_CONTROL; _ssrc = ssrc; encapsulate(msg); }
void RTPInnerPacket::senderModuleCreated | ( | uint32 | ssrc | ) | [virtual] |
Referenced by RTPProfile::createSenderModule().
{ _type = RTP_INP_SENDER_MODULE_CREATED; _ssrc = ssrc; }
void RTPInnerPacket::senderModuleDeleted | ( | uint32 | ssrc | ) | [virtual] |
Referenced by RTPProfile::deleteSenderModule().
{ _type = RTP_INP_SENDER_MODULE_DELETED; _ssrc = ssrc; }
void RTPInnerPacket::senderModuleInitialized | ( | uint32 | ssrc, |
int | payloadType, | ||
int | clockRate, | ||
int | timeStampBase, | ||
int | sequenceNumberBase | ||
) | [virtual] |
Referenced by RTPPayloadSender::initializeSenderModule().
{ _type = RTP_INP_SENDER_MODULE_INITIALIZED; _ssrc = ssrc; _payloadType = payloadType; _clockRate = clockRate; _timeStampBase = timeStampBase; _sequenceNumberBase = sequenceNumberBase; }
void RTPInnerPacket::senderModuleStatus | ( | uint32 | ssrc, |
RTPSenderStatusMessage * | msg | ||
) | [virtual] |
Referenced by RTPPayloadSender::endOfFile(), RTPPayloadSender::pause(), RTPPayloadSender::play(), and RTPPayloadSender::stop().
{ _type = RTP_INP_SENDER_MODULE_STATUS; _ssrc = ssrc; encapsulate(msg); }
void RTPInnerPacket::sessionLeft | ( | ) | [virtual] |
Called by the rtcp module when the rtcp bye packet has been sent to the network.
Referenced by RTCP::createPacket().
{ _type = RTP_INP_SESSION_LEFT; }
IPAddress RTPInnerPacket::_address [protected] |
The address stored this RTPInnerPacket.
Referenced by dataIn(), dump(), getAddress(), initializeRTCP(), operator=(), and RTPInnerPacket().
int RTPInnerPacket::_bandwidth [protected] |
The bandwidth stored in this RTPInnerPacket.
Referenced by dump(), getBandwidth(), initializeRTCP(), operator=(), and RTPInnerPacket().
int RTPInnerPacket::_clockRate [protected] |
The clock rate stored in this RTPInnerPacket.
Referenced by dump(), getClockRate(), operator=(), RTPInnerPacket(), and senderModuleInitialized().
const char* RTPInnerPacket::_commonName [protected] |
The CNAME stored in this RTPInnerPacket.
Referenced by dump(), getCommonName(), initializeRTCP(), operator=(), RTPInnerPacket(), and ~RTPInnerPacket().
const char* RTPInnerPacket::_fileName [protected] |
The file name stored in this RTPInnerPacket.
Referenced by createSenderModule(), dump(), getFileName(), initializeSenderModule(), operator=(), RTPInnerPacket(), and ~RTPInnerPacket().
int RTPInnerPacket::_mtu [protected] |
The mtu stored in this RTPInnerPacket.
Referenced by dump(), getMTU(), initializeProfile(), initializeRTCP(), initializeSenderModule(), operator=(), and RTPInnerPacket().
int RTPInnerPacket::_payloadType [protected] |
The payload type stored in this RTPInnerPacket.
Referenced by createSenderModule(), dump(), getPayloadType(), operator=(), RTPInnerPacket(), and senderModuleInitialized().
int RTPInnerPacket::_port [protected] |
The port stored this RTPInnerPacket.
Referenced by dataIn(), dump(), getPort(), initializeRTCP(), operator=(), profileInitialized(), and RTPInnerPacket().
int RTPInnerPacket::_rtcpPercentage [protected] |
The rtcp percentage stored in this RTPInnerPacket.
Referenced by dump(), getRtcpPercentage(), initializeRTCP(), operator=(), profileInitialized(), and RTPInnerPacket().
int RTPInnerPacket::_sequenceNumberBase [protected] |
The rtp sequence number base stored in this RTPInnerPacket.
Referenced by dump(), getSequenceNumberBase(), operator=(), RTPInnerPacket(), and senderModuleInitialized().
uint32 RTPInnerPacket::_ssrc [protected] |
The ssrc identifier stored in this RTPInnerPacket.
Referenced by createSenderModule(), deleteSenderModule(), dump(), getSSRC(), initializeSenderModule(), operator=(), rtcpInitialized(), RTPInnerPacket(), senderModuleControl(), senderModuleCreated(), senderModuleDeleted(), senderModuleInitialized(), and senderModuleStatus().
int RTPInnerPacket::_timeStampBase [protected] |
The rtp time stamp base stored in this RTPInnerPacket.
Referenced by dump(), getTimeStampBase(), operator=(), RTPInnerPacket(), and senderModuleInitialized().
RTP_INP_TYPE RTPInnerPacket::_type [protected] |
The type of this RTPInnerPacket.
Referenced by createSenderModule(), dataIn(), dataOut(), deleteSenderModule(), dump(), getType(), info(), initializeProfile(), initializeRTCP(), initializeSenderModule(), leaveSession(), operator=(), profileInitialized(), rtcpInitialized(), RTPInnerPacket(), senderModuleControl(), senderModuleCreated(), senderModuleDeleted(), senderModuleInitialized(), senderModuleStatus(), and sessionLeft().