INET Framework for OMNeT++/OMNEST
RTPInnerPacket Class Reference

#include <RTPInnerPacket.h>

List of all members.

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 ()
RTPInnerPacketoperator= (const RTPInnerPacket &rinp)
virtual RTPInnerPacketdup () 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

Detailed Description

This class is used for communication between submodules of the rtp layer module.


Member Enumeration Documentation

This enumeration is a list of all possibly types of an RTPInnerPacket.

Enumerator:
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 

Constructor & Destructor Documentation

RTPInnerPacket::RTPInnerPacket ( const char *  name = NULL)

Default constructor

Referenced by dup().

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;
}

Member Function Documentation

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;
}
void RTPInnerPacket::dataIn ( RTPPacket packet,
IPAddress  address,
int  port 
) [virtual]

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]
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;
}
int RTPInnerPacket::getTimeStampBase ( ) [virtual]

Returns the rtp time stamp base stored in this RTPInnerPacket.

Referenced by RTCP::senderModuleInitialized().

{
    return _timeStampBase;
}
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().

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]
void RTPInnerPacket::leaveSession ( ) [virtual]

Called by the rtp module to inform the rtcp module that the session should be left.

Referenced by RTP::leaveSession().

RTPInnerPacket & RTPInnerPacket::operator= ( const RTPInnerPacket rinp)

Assignment operator.

Referenced by RTPInnerPacket().

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().

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]
void RTPInnerPacket::senderModuleDeleted ( uint32  ssrc) [virtual]
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]
void RTPInnerPacket::sessionLeft ( ) [virtual]

Called by the rtcp module when the rtcp bye packet has been sent to the network.

Referenced by RTCP::createPacket().


Member Data Documentation

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 rtp sequence number base stored in this RTPInnerPacket.

Referenced by dump(), getSequenceNumberBase(), operator=(), RTPInnerPacket(), and senderModuleInitialized().

The rtp time stamp base stored in this RTPInnerPacket.

Referenced by dump(), getTimeStampBase(), operator=(), RTPInnerPacket(), and senderModuleInitialized().


The documentation for this class was generated from the following files: