Public Types | Public Member Functions | Protected Attributes

RTPInterfacePacket Class Reference

#include <RTPInterfacePacket.h>

List of all members.

Public Types

enum  RTP_IFP_TYPE {
  RTP_IFP_UNDEF, RTP_IFP_ENTER_SESSION, RTP_IFP_SESSION_ENTERED, RTP_IFP_CREATE_SENDER_MODULE,
  RTP_IFP_SENDER_MODULE_CREATED, RTP_IFP_DELETE_SENDER_MODULE, RTP_IFP_SENDER_MODULE_DELETED, RTP_IFP_SENDER_CONTROL,
  RTP_IFP_SENDER_STATUS, RTP_IFP_LEAVE_SESSION, RTP_IFP_SESSION_LEFT
}

Public Member Functions

 RTPInterfacePacket (const char *name=NULL)
 RTPInterfacePacket (const RTPInterfacePacket &rifp)
virtual ~RTPInterfacePacket ()
RTPInterfacePacketoperator= (const RTPInterfacePacket &rifp)
virtual RTPInterfacePacketdup () const
virtual std::string info ()
virtual void dump (std::ostream &os)
virtual void enterSession (const char *commonName, const char *profileName, int bandwidth, IPAddress destinationAddress, int port)
virtual void sessionEntered (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 senderModuleControl (uint32 ssrc, RTPSenderControlMessage *msg)
virtual void senderModuleStatus (uint32 ssrc, RTPSenderStatusMessage *msg)
virtual void leaveSession ()
virtual void sessionLeft ()
virtual RTP_IFP_TYPE getType ()
virtual const char * getCommonName ()
virtual const char * getProfileName ()
virtual int getBandwidth ()
virtual IPAddress getDestinationAddress ()
virtual int getPort ()
virtual uint32 getSSRC ()
virtual int getPayloadType ()
virtual const char * getFileName ()

Protected Attributes

RTP_IFP_TYPE _type
const char * _commonName
const char * _profileName
int _bandwidth
IPAddress _destinationAddress
int _port
uint32 _ssrc
int _payloadType
const char * _fileName

Detailed Description

The class RTPInterfacePacket is used for communication between an RTPApplication and an RTPLayer module. Its offers functionality for starting and stopping of an rtp session, transmission of files and feedback about the success of the operations.

Definition at line 40 of file RTPInterfacePacket.h.


Member Enumeration Documentation

An enumeration to distinguish the different functions of the RTPInterfacePacket.

Enumerator:
RTP_IFP_UNDEF 
RTP_IFP_ENTER_SESSION 
RTP_IFP_SESSION_ENTERED 
RTP_IFP_CREATE_SENDER_MODULE 
RTP_IFP_SENDER_MODULE_CREATED 
RTP_IFP_DELETE_SENDER_MODULE 
RTP_IFP_SENDER_MODULE_DELETED 
RTP_IFP_SENDER_CONTROL 
RTP_IFP_SENDER_STATUS 
RTP_IFP_LEAVE_SESSION 
RTP_IFP_SESSION_LEFT 

Definition at line 49 of file RTPInterfacePacket.h.

                          {
            RTP_IFP_UNDEF,
            RTP_IFP_ENTER_SESSION,
            RTP_IFP_SESSION_ENTERED,
            RTP_IFP_CREATE_SENDER_MODULE,
            RTP_IFP_SENDER_MODULE_CREATED,
            RTP_IFP_DELETE_SENDER_MODULE,
            RTP_IFP_SENDER_MODULE_DELETED,
            RTP_IFP_SENDER_CONTROL,
            RTP_IFP_SENDER_STATUS,
            RTP_IFP_LEAVE_SESSION,
            RTP_IFP_SESSION_LEFT
        };


Constructor & Destructor Documentation

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

Default constructor.

Definition at line 27 of file RTPInterfacePacket.cc.

Referenced by dup().

                                                       : cPacket(name)
{
    _type = RTP_IFP_UNDEF;
    _commonName = NULL;
    _profileName = NULL;
    _bandwidth = 0;
    _destinationAddress = IPAddress::UNSPECIFIED_ADDRESS;
    _port = PORT_UNDEF;
    _ssrc = 0;
    _payloadType = 0;
    _fileName = NULL;
}

RTPInterfacePacket::RTPInterfacePacket ( const RTPInterfacePacket rifp  ) 

Copy constructor.

Definition at line 41 of file RTPInterfacePacket.cc.

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

RTPInterfacePacket::~RTPInterfacePacket (  )  [virtual]

Destructor.

Definition at line 48 of file RTPInterfacePacket.cc.

{
    if (opp_strcmp(_commonName, ""))
        delete _commonName;
    if (opp_strcmp(_profileName, ""))
        delete _profileName;
    if (opp_strcmp(_fileName, ""))
        delete _fileName;
}


Member Function Documentation

void RTPInterfacePacket::createSenderModule ( uint32  ssrc,
int  payloadType,
const char *  fileName 
) [virtual]

Definition at line 122 of file RTPInterfacePacket.cc.

Referenced by RTPApplication::activity().

{
    _type = RTP_IFP_CREATE_SENDER_MODULE;
    _ssrc = ssrc;
    _payloadType =payloadType;
    _fileName = fileName;
}

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

Definition at line 138 of file RTPInterfacePacket.cc.

{
    _type = RTP_IFP_DELETE_SENDER_MODULE;
    _ssrc = ssrc;
}

void RTPInterfacePacket::dump ( std::ostream &  os  )  [virtual]

Writes a longer info about this RTPInterfacePacket into the given stream.

Definition at line 89 of file RTPInterfacePacket.cc.

{
    os << "RTPInterfacePacket:" << endl;
    os << "  type = " << _type << endl;
    os << "  commonName = " << _commonName << endl;
    os << "  profileName = " << _profileName << endl;
    os << "  bandwidth = " << _bandwidth << endl;
    os << "  destinationAddress = " << _destinationAddress << endl;
    os << "  port = " << _port << endl;
    os << "  ssrc = " << _ssrc << endl;
    os << "  payloadType = " << _payloadType << endl;
    os << "  fileName = " << _fileName << endl;
}

RTPInterfacePacket * RTPInterfacePacket::dup (  )  const [virtual]

Duplicates the RTPInterfacePacket by calling the copy constructor.

Definition at line 75 of file RTPInterfacePacket.cc.

{
    return new RTPInterfacePacket(*this);
}

void RTPInterfacePacket::enterSession ( const char *  commonName,
const char *  profileName,
int  bandwidth,
IPAddress  destinationAddress,
int  port 
) [virtual]

Called by the rtp application to make the rtp layer enter an rtp session with the given parameters.

Definition at line 104 of file RTPInterfacePacket.cc.

Referenced by RTPApplication::activity().

{
    _type = RTP_IFP_ENTER_SESSION;
    _commonName = commonName;
    _profileName = profileName;
    _bandwidth = bandwidth;
    _destinationAddress = destinationAddress;
    _port = port;
}

int RTPInterfacePacket::getBandwidth (  )  [virtual]

Returns the bandidth stored in this RTPInterfacePacket.

Definition at line 254 of file RTPInterfacePacket.cc.

Referenced by RTP::enterSession().

{
    return _bandwidth;
}

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

Returns the CNAME stored in this RTPInterfacePacket.

Definition at line 224 of file RTPInterfacePacket.cc.

Referenced by RTP::enterSession().

{
    return opp_strdup(_commonName);
}

IPAddress RTPInterfacePacket::getDestinationAddress (  )  [virtual]

Returns the address stored in this RTPInterfacePacket.

Definition at line 260 of file RTPInterfacePacket.cc.

Referenced by RTP::enterSession().

{
    return _destinationAddress;
}

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

Returns the file name stored in this RTPInterfacePacket.

Definition at line 248 of file RTPInterfacePacket.cc.

Referenced by RTP::createSenderModule().

{
    return opp_strdup(_fileName);
}

int RTPInterfacePacket::getPayloadType (  )  [virtual]

Returns the payload type stored in this RTPInterfacePacket.

Definition at line 242 of file RTPInterfacePacket.cc.

Referenced by RTP::createSenderModule().

{
    return _payloadType;
}

int RTPInterfacePacket::getPort (  )  [virtual]

Returns the port stored in this RTPInterfacePacket.

Definition at line 266 of file RTPInterfacePacket.cc.

Referenced by RTP::enterSession().

{
    return _port;
}

const char * RTPInterfacePacket::getProfileName (  )  [virtual]

Returns the profile name stored in this RTPInterfacePacket.

Definition at line 230 of file RTPInterfacePacket.cc.

Referenced by RTP::enterSession().

{
    return opp_strdup(_profileName);
}

uint32 RTPInterfacePacket::getSSRC (  )  [virtual]

Returns the ssrc identifier stored in this RTPInterfacePacket.

Definition at line 236 of file RTPInterfacePacket.cc.

Referenced by RTPApplication::activity(), RTP::createSenderModule(), and RTP::deleteSenderModule().

{
    return _ssrc;
}

RTPInterfacePacket::RTP_IFP_TYPE RTPInterfacePacket::getType (  )  [virtual]

Returns the type of this RTPInterfacePacket.

Definition at line 218 of file RTPInterfacePacket.cc.

Referenced by RTPApplication::activity(), and RTP::handleMessageFromApp().

{
    return _type;
}

std::string RTPInterfacePacket::info (  )  [virtual]

Writes a one line info about this RTPInterfacePacket into the given string.

Definition at line 81 of file RTPInterfacePacket.cc.

{
    std::stringstream out;
    out << "RTPInterfacePacket: type=" << _type;
    return out.str();
}

void RTPInterfacePacket::leaveSession (  )  [virtual]

Called by the application to order the rtp layer to start transmitting a file. Called by the rtp module to inform the application that the transmitting has begun. Called by the rtp module to inform the application that the transmission has been finished because the end of the file has been reached. Called by the application to order the rtp layer to stop transmitting. Called by the rtp module to inform the application that the transmission has been stopped as ordered. Called by the application to order the rtp layer to stop participating in this rtp session.

Definition at line 206 of file RTPInterfacePacket.cc.

Referenced by RTPApplication::activity().

{
    _type = RTP_IFP_LEAVE_SESSION;
}

RTPInterfacePacket & RTPInterfacePacket::operator= ( const RTPInterfacePacket rifp  ) 

Assignment operator.

Definition at line 59 of file RTPInterfacePacket.cc.

Referenced by RTPInterfacePacket().

{
    cPacket::operator=(rifp);
    _type = rifp._type;
    _commonName = opp_strdup(rifp._commonName);
    _profileName = opp_strdup(rifp._profileName);
    _bandwidth = rifp._bandwidth;
    _destinationAddress = rifp._destinationAddress;
    _port = rifp._port;
    _ssrc = rifp._ssrc;
    _payloadType = rifp._payloadType;
    _fileName = opp_strdup(rifp._fileName);
    return *this;
}

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

Definition at line 152 of file RTPInterfacePacket.cc.

Referenced by RTPApplication::activity().

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

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

Definition at line 131 of file RTPInterfacePacket.cc.

Referenced by RTP::senderModuleCreated().

{
    _type = RTP_IFP_SENDER_MODULE_CREATED;
    _ssrc = ssrc;
}

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

Definition at line 145 of file RTPInterfacePacket.cc.

Referenced by RTP::senderModuleDeleted().

{
    _type = RTP_IFP_SENDER_MODULE_DELETED;
    _ssrc = ssrc;
}

void RTPInterfacePacket::senderModuleStatus ( uint32  ssrc,
RTPSenderStatusMessage *  msg 
) [virtual]

Definition at line 160 of file RTPInterfacePacket.cc.

Referenced by RTP::senderModuleStatus().

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

void RTPInterfacePacket::sessionEntered ( uint32  ssrc  )  [virtual]

Called by the rtp module to inform the application that the rtp session has been entered.

Definition at line 115 of file RTPInterfacePacket.cc.

Referenced by RTP::rtcpInitialized().

{
    _type = RTP_IFP_SESSION_ENTERED;
    _ssrc = ssrc;
}

void RTPInterfacePacket::sessionLeft (  )  [virtual]

Called by the rtp module to inform the application that this end system stop participating in this rtp session.

Definition at line 212 of file RTPInterfacePacket.cc.

Referenced by RTP::sessionLeft().

{
    _type = RTP_IFP_SESSION_LEFT;
}


Member Data Documentation

The bandwidth stored in this RTPInterfacePacket.

Definition at line 227 of file RTPInterfacePacket.h.

Referenced by dump(), enterSession(), getBandwidth(), operator=(), and RTPInterfacePacket().

const char* RTPInterfacePacket::_commonName [protected]

The CNAME stored in this RTPInterfacePacket.

Definition at line 217 of file RTPInterfacePacket.h.

Referenced by dump(), enterSession(), getCommonName(), operator=(), RTPInterfacePacket(), and ~RTPInterfacePacket().

The address stored in this RTPInterfacePacket.

Definition at line 232 of file RTPInterfacePacket.h.

Referenced by dump(), enterSession(), getDestinationAddress(), operator=(), and RTPInterfacePacket().

const char* RTPInterfacePacket::_fileName [protected]

The file name stored in this RTPInterfacePacket.

Definition at line 252 of file RTPInterfacePacket.h.

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

The payload type stored in this RTPInterfacePacket.

Definition at line 247 of file RTPInterfacePacket.h.

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

int RTPInterfacePacket::_port [protected]

The port stored in this RTPInterfacePacket.

Definition at line 237 of file RTPInterfacePacket.h.

Referenced by dump(), enterSession(), getPort(), operator=(), and RTPInterfacePacket().

const char* RTPInterfacePacket::_profileName [protected]

The profile name stored in this RTPInterfacePacket.

Definition at line 222 of file RTPInterfacePacket.h.

Referenced by dump(), enterSession(), getProfileName(), operator=(), RTPInterfacePacket(), and ~RTPInterfacePacket().

uint32 RTPInterfacePacket::_ssrc [protected]

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