Public Types | Public Member Functions | Protected Attributes

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.

Definition at line 35 of file RTPInnerPacket.h.


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 

Definition at line 44 of file RTPInnerPacket.h.

                          {
            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

Definition at line 30 of file RTPInnerPacket.cc.

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.

Definition at line 48 of file RTPInnerPacket.cc.

                                                         : cPacket()
{
    setName(rinp.getName());
    operator=(rinp);
}

RTPInnerPacket::~RTPInnerPacket (  )  [virtual]

Destructor.

Definition at line 55 of file RTPInnerPacket.cc.

{
    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]

Definition at line 151 of file RTPInnerPacket.cc.

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.

Definition at line 235 of file RTPInnerPacket.cc.

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.

Definition at line 228 of file RTPInnerPacket.cc.

Referenced by RTPAVProfilePayload32Sender::sendPacket().

{
    _type = RTP_INP_DATA_OUT;
    encapsulate(packet);
}

void RTPInnerPacket::deleteSenderModule ( uint32  ssrc  )  [virtual]

Definition at line 167 of file RTPInnerPacket.cc.

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.

Definition at line 98 of file RTPInnerPacket.cc.

{
    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.

Definition at line 84 of file RTPInnerPacket.cc.

{
    return new RTPInnerPacket(*this);
}

IPAddress RTPInnerPacket::getAddress (  )  [virtual]

Returns the address stored in this RTPInnerPacket.

Definition at line 274 of file RTPInnerPacket.cc.

Referenced by RTCP::dataIn(), and RTCP::initializeRTCP().

{
    return _address;
}

int RTPInnerPacket::getBandwidth (  )  [virtual]

Returns the available bandwitdth as stored in this RTPInnerPacket.

Definition at line 262 of file RTPInnerPacket.cc.

Referenced by RTCP::initializeRTCP().

{
    return _bandwidth;
}

int RTPInnerPacket::getClockRate (  )  [virtual]

Returns the rtp clock rate stored in this RTPInnerPacket.

Definition at line 304 of file RTPInnerPacket.cc.

Referenced by RTCP::senderModuleInitialized().

{
    return _clockRate;
}

const char * RTPInnerPacket::getCommonName (  )  [virtual]

Returns the CNAME stored in this RTPInnerPacket.

Definition at line 250 of file RTPInnerPacket.cc.

Referenced by RTCP::initializeRTCP().

{
    return opp_strdup(_commonName);
}

const char * RTPInnerPacket::getFileName (  )  [virtual]

Returns the file name stored in this RTPInnerPacket.

Definition at line 292 of file RTPInnerPacket.cc.

Referenced by RTPProfile::createSenderModule(), and RTPPayloadSender::initializeSenderModule().

{
    return opp_strdup(_fileName);
}

int RTPInnerPacket::getMTU (  )  [virtual]

Returns the maximum transmission unit stored in this RTPInnerPacket.

Definition at line 256 of file RTPInnerPacket.cc.

Referenced by RTPProfile::initializeProfile(), RTCP::initializeRTCP(), and RTPPayloadSender::initializeSenderModule().

{
    return _mtu;
}

int RTPInnerPacket::getPayloadType (  )  [virtual]

Returns the payload type stored in this RTPInnerPacket.

Definition at line 298 of file RTPInnerPacket.cc.

Referenced by RTPProfile::createSenderModule().

{
    return _payloadType;
}

int RTPInnerPacket::getPort (  )  [virtual]

Returns the port stored in this RTPInnerPacket.

Definition at line 280 of file RTPInnerPacket.cc.

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.

Definition at line 268 of file RTPInnerPacket.cc.

Referenced by RTCP::initializeRTCP(), and RTP::profileInitialized().

{
    return _rtcpPercentage;
}

int RTPInnerPacket::getSequenceNumberBase (  )  [virtual]

Returns the rtp sequence number base stored in this RTPInnerPacket.

Definition at line 316 of file RTPInnerPacket.cc.

Referenced by RTCP::senderModuleInitialized().

{
    return _sequenceNumberBase;
}

uint32 RTPInnerPacket::getSSRC (  )  [virtual]
int RTPInnerPacket::getTimeStampBase (  )  [virtual]

Returns the rtp time stamp base stored in this RTPInnerPacket.

Definition at line 310 of file RTPInnerPacket.cc.

Referenced by RTCP::senderModuleInitialized().

{
    return _timeStampBase;
}

RTPInnerPacket::RTP_INP_TYPE RTPInnerPacket::getType (  )  [virtual]
std::string RTPInnerPacket::info (  )  [virtual]

Writes a short info about this RTPInnerPacket into the given string.

Definition at line 90 of file RTPInnerPacket.cc.

{
    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.

Definition at line 117 of file RTPInnerPacket.cc.

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.

Definition at line 132 of file RTPInnerPacket.cc.

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]

Definition at line 181 of file RTPInnerPacket.cc.

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.

Definition at line 216 of file RTPInnerPacket.cc.

Referenced by RTP::leaveSession().

{
    _type = RTP_INP_LEAVE_SESSION;
}

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

Assignment operator.

Definition at line 64 of file RTPInnerPacket.cc.

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.

Definition at line 124 of file RTPInnerPacket.cc.

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

Definition at line 144 of file RTPInnerPacket.cc.

Referenced by RTCP::handleSelfMessage().

{
    _type = RTP_INP_RTCP_INITIALIZED;
    _ssrc = ssrc;
}

void RTPInnerPacket::senderModuleControl ( uint32  ssrc,
RTPSenderControlMessage *  msg 
) [virtual]

Definition at line 200 of file RTPInnerPacket.cc.

Referenced by RTP::senderModuleControl().

{
    _type = RTP_INP_SENDER_MODULE_CONTROL;
    _ssrc = ssrc;
    encapsulate(msg);
}

void RTPInnerPacket::senderModuleCreated ( uint32  ssrc  )  [virtual]

Definition at line 160 of file RTPInnerPacket.cc.

Referenced by RTPProfile::createSenderModule().

{
    _type = RTP_INP_SENDER_MODULE_CREATED;
    _ssrc = ssrc;
}

void RTPInnerPacket::senderModuleDeleted ( uint32  ssrc  )  [virtual]

Definition at line 174 of file RTPInnerPacket.cc.

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]

Definition at line 190 of file RTPInnerPacket.cc.

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]

Definition at line 208 of file RTPInnerPacket.cc.

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.

Definition at line 222 of file RTPInnerPacket.cc.

Referenced by RTCP::createPacket().

{
    _type = RTP_INP_SESSION_LEFT;
}


Member Data Documentation

The address stored this RTPInnerPacket.

Definition at line 257 of file RTPInnerPacket.h.

Referenced by dataIn(), dump(), getAddress(), initializeRTCP(), operator=(), and RTPInnerPacket().

int RTPInnerPacket::_bandwidth [protected]

The bandwidth stored in this RTPInnerPacket.

Definition at line 247 of file RTPInnerPacket.h.

Referenced by dump(), getBandwidth(), initializeRTCP(), operator=(), and RTPInnerPacket().

int RTPInnerPacket::_clockRate [protected]

The clock rate stored in this RTPInnerPacket.

Definition at line 282 of file RTPInnerPacket.h.

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

const char* RTPInnerPacket::_commonName [protected]

The CNAME stored in this RTPInnerPacket.

Definition at line 237 of file RTPInnerPacket.h.

Referenced by dump(), getCommonName(), initializeRTCP(), operator=(), RTPInnerPacket(), and ~RTPInnerPacket().

const char* RTPInnerPacket::_fileName [protected]

The file name stored in this RTPInnerPacket.

Definition at line 277 of file RTPInnerPacket.h.

Referenced by createSenderModule(), dump(), getFileName(), initializeSenderModule(), operator=(), RTPInnerPacket(), and ~RTPInnerPacket().

int RTPInnerPacket::_mtu [protected]

The payload type stored in this RTPInnerPacket.

Definition at line 272 of file RTPInnerPacket.h.

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

int RTPInnerPacket::_port [protected]

The port stored this RTPInnerPacket.

Definition at line 262 of file RTPInnerPacket.h.

Referenced by dataIn(), dump(), getPort(), initializeRTCP(), operator=(), profileInitialized(), and RTPInnerPacket().

The rtcp percentage stored in this RTPInnerPacket.

Definition at line 252 of file RTPInnerPacket.h.

Referenced by dump(), getRtcpPercentage(), initializeRTCP(), operator=(), profileInitialized(), and RTPInnerPacket().

The rtp sequence number base stored in this RTPInnerPacket.

Definition at line 292 of file RTPInnerPacket.h.

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

uint32 RTPInnerPacket::_ssrc [protected]

The rtp time stamp base stored in this RTPInnerPacket.

Definition at line 287 of file RTPInnerPacket.h.

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


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