Main Page | Class Hierarchy | Class List | Directories | File List | Class Members | File Members

RTPPayloadSender Class Reference

#include <RTPPayloadSender.h>

Inheritance diagram for RTPPayloadSender:

RTPAVProfilePayload32Sender RTPAVProfileSampleBasedAudioSender RTPAVProfilePayload10Sender List of all members.

Public Types

enum  SenderStatus { STOPPED, PLAYING }

Public Member Functions

virtual void initialize ()
virtual void activity ()

Protected Member Functions

virtual void initializeSenderModule (RTPInnerPacket *)
virtual void openSourceFile (const char *fileName)
virtual void closeSourceFile ()
virtual void play ()
virtual void playUntilTime (simtime_t moment)
virtual void playUntilByte (int position)
virtual void pause ()
virtual void seekTime (simtime_t moment)
virtual void seekByte (int position)
virtual void stop ()
virtual void endOfFile ()
virtual bool sendPacket ()

Protected Attributes

ifstream _inputFileStream
int _mtu
u_int32 _ssrc
int _payloadType
int _clockRate
u_int32 _timeStampBase
u_int32 _timeStamp
u_int16 _sequenceNumberBase
u_int16 _sequenceNumber
SenderStatus _status
cMessage * _reminderMessage

Detailed Description

The class RTPPayloadSender is the base class for all modules creating rtp data packets. It provides functionality needed by every rtp data packet sender like opening and closing the data file and choosing sequence number and time stamp start values.


Member Enumeration Documentation

enum RTPPayloadSender::SenderStatus
 

A sender module's transmission can be in different states.

Enumeration values:
STOPPED  No transmission.
PLAYING  Data is being sent.


Member Function Documentation

void RTPPayloadSender::activity  )  [virtual]
 

void RTPPayloadSender::closeSourceFile  )  [protected, virtual]
 

This method is called by the destructor and closes the data file.

Reimplemented in RTPAVProfileSampleBasedAudioSender.

void RTPPayloadSender::endOfFile  )  [protected, virtual]
 

This method gets called when the sender module reaches the end of file. For the transmission it has the same effect like stop().

void RTPPayloadSender::initialize  )  [virtual]
 

Chooses sequence number and time stamp base values and reads the omnet parameter "mtu".

void RTPPayloadSender::initializeSenderModule RTPInnerPacket  )  [protected, virtual]
 

This method is called when a newly create sender module received its initialization message from profile module. It returns an RTP_INP_SENDER_MODULE_INITIALIZED message which contains information needed by the rtcp module.

Reimplemented in RTPAVProfilePayload32Sender, and RTPAVProfileSampleBasedAudioSender.

void RTPPayloadSender::openSourceFile const char *  fileName  )  [protected, virtual]
 

This method is called by initializeSenderModule and opens the source data file as an inputFileStream stored in member variable _inputFileStream. Most data formats can use this method directly, but when using a library for a certain data format which offers an own open routine this method must be overwritten.

Reimplemented in RTPAVProfileSampleBasedAudioSender.

void RTPPayloadSender::pause  )  [protected, virtual]
 

When data is being transmitted this methods suspends till a new PLAY command. Implementation in sender modules is optional.

void RTPPayloadSender::play  )  [protected, virtual]
 

Starts data transmission. Every sender module must implement this method.

Reimplemented in RTPAVProfileSampleBasedAudioSender.

void RTPPayloadSender::playUntilByte int  position  )  [protected, virtual]
 

Starts transmission from the current file position and plays until given byte position (excluding file header) is reached. Implementation in sender modules is optional.

void RTPPayloadSender::playUntilTime simtime_t  moment  )  [protected, virtual]
 

Starts transmission from the current file position and plays until given time (relative to start of file) is reached. Implementation in sender modules is optional.

void RTPPayloadSender::seekByte int  position  )  [protected, virtual]
 

When the data transmission is paused the current position is changed to this byte position (excluding file header). Implementation in sender modules is optional.

Reimplemented in RTPAVProfileSampleBasedAudioSender.

void RTPPayloadSender::seekTime simtime_t  moment  )  [protected, virtual]
 

When the data transmission is paused the current position is changed to this time (relative to start of file). Implementation in sender modules is optional.

Reimplemented in RTPAVProfileSampleBasedAudioSender.

bool RTPPayloadSender::sendPacket  )  [protected, virtual]
 

This method gets called when one (or more) rtp data packets have to be sent. Subclasses must overwrite this method to do something useful. This implementation doesn't send packets it just returns false which means end of file reached.

Reimplemented in RTPAVProfilePayload32Sender, and RTPAVProfileSampleBasedAudioSender.

void RTPPayloadSender::stop  )  [protected, virtual]
 

This method stop data transmission and resets the sender module so that a following PLAY command would start the transmission at the beginning again. Every sender module should implement this method.

Reimplemented in RTPAVProfileSampleBasedAudioSender.


Member Data Documentation

int RTPPayloadSender::_clockRate [protected]
 

The clock rate in ticks per second this sender uses.

ifstream RTPPayloadSender::_inputFileStream [protected]
 

The input file stream for the data file.

int RTPPayloadSender::_mtu [protected]
 

The maximum size of an RTPPacket.

int RTPPayloadSender::_payloadType [protected]
 

The payload type this sender creates.

cMessage* RTPPayloadSender::_reminderMessage [protected]
 

A self message used as timer for the moment the next packet must be sent. It's a member variable because when playing gets paused or stopped the timer must be cancelled.

u_int16 RTPPayloadSender::_sequenceNumber [protected]
 

The current sequence number.

u_int16 RTPPayloadSender::_sequenceNumberBase [protected]
 

The first sequence number used for created rtp data packets. The value is chosen randomly.

u_int32 RTPPayloadSender::_ssrc [protected]
 

The ssrc identifier of this sender module.

SenderStatus RTPPayloadSender::_status [protected]
 

The current state of data transmission.

u_int32 RTPPayloadSender::_timeStamp [protected]
 

The current rtp time stamp.

u_int32 RTPPayloadSender::_timeStampBase [protected]
 

The first rtp time stamp used for created rtp data packets. The value is chosen randomly.


The documentation for this class was generated from the following files:
Generated on Tue Sep 12 12:20:21 2006 for RTP model for OMNeT++ by  doxygen 1.4.2