INET Framework for OMNeT++/OMNEST
|
The class RTPPayloadSender is the base class for all modules creating RTP data packets. More...
#include <RTPPayloadSender.h>
Public Member Functions | |
RTPPayloadSender () | |
Constructor. More... | |
virtual | ~RTPPayloadSender () |
Destructor. More... | |
Protected Types | |
enum | SenderStatus { STOPPED, PLAYING } |
A sender module's transmission can be in different states. More... | |
Protected Member Functions | |
virtual void | initialize () override |
Chooses sequence number and time stamp base values and reads the omnet parameter "mtu". More... | |
virtual void | handleMessage (cMessage *msg) override |
virtual void | initializeSenderModule (RTPInnerPacket *) |
This method is called when a newly create sender module received its initialization message from profile module. More... | |
virtual void | openSourceFile (const char *fileName) |
This method is called by initializeSenderModule and opens the source data file as an inputFileStream stored in member variable _inputFileStream. More... | |
virtual void | closeSourceFile () |
This method is called by the destructor and closes the data file. More... | |
virtual void | play () |
Starts data transmission. More... | |
virtual void | playUntilTime (simtime_t moment) |
Starts transmission from the current file position and plays until given time (relative to start of file) is reached. More... | |
virtual void | playUntilByte (int position) |
Starts transmission from the current file position and plays until given byte position (excluding file header) is reached. More... | |
virtual void | pause () |
When data is being transmitted this methods suspends till a new PLAY command. More... | |
virtual void | seekTime (simtime_t moment) |
When the data transmission is paused the current position is changed to this time (relative to start of file). More... | |
virtual void | seekByte (int position) |
When the data transmission is paused the current position is changed to this byte position (excluding file header). More... | |
virtual void | stop () |
This method stop data transmission and resets the sender module so that a following PLAY command would start the transmission at the beginning again. More... | |
virtual void | endOfFile () |
This method gets called when the sender module reaches the end of file. More... | |
virtual bool | sendPacket () |
This method gets called when one (or more) rtp data packets have to be sent. More... | |
Protected Attributes | |
std::ifstream | _inputFileStream |
The input file stream for the data file. More... | |
int | _mtu = 0 |
The maximum size of an RTPPacket. More... | |
uint32 | _ssrc = 0 |
The ssrc identifier of this sender module. More... | |
int | _payloadType = -1 |
The payload type this sender creates. More... | |
int | _clockRate = 0 |
The clock rate in ticks per second this sender uses. More... | |
uint32 | _timeStampBase = 0 |
The first rtp time stamp used for created rtp data packets. More... | |
uint32 | _timeStamp = 0 |
The current rtp time stamp. More... | |
uint16 | _sequenceNumberBase = 0 |
The first sequence number used for created rtp data packets. More... | |
uint16 | _sequenceNumber = 0 |
The current sequence number. More... | |
SenderStatus | _status = (SenderStatus)-1 |
The current state of data transmission. More... | |
cMessage * | _reminderMessage = nullptr |
A self message used as timer for the moment the next packet must be sent. More... | |
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.
|
protected |
|
virtual |
Destructor.
Calls closeSourceFile.
|
protectedvirtual |
This method is called by the destructor and closes the data file.
Referenced by ~RTPPayloadSender().
|
protectedvirtual |
This method gets called when the sender module reaches the end of file.
For the transmission it has the same effect like stop().
Referenced by handleMessage(), and play().
|
overrideprotectedvirtual |
|
overrideprotectedvirtual |
Chooses sequence number and time stamp base values and reads the omnet parameter "mtu".
Reimplemented in inet::rtp::RTPAVProfilePayload32Sender.
Referenced by inet::rtp::RTPAVProfilePayload32Sender::initialize().
|
protectedvirtual |
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
Reimplemented in inet::rtp::RTPAVProfilePayload32Sender.
Referenced by handleMessage(), and inet::rtp::RTPAVProfilePayload32Sender::initializeSenderModule().
|
protectedvirtual |
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.
Referenced by initializeSenderModule().
|
protectedvirtual |
When data is being transmitted this methods suspends till a new PLAY command.
Implementation in sender modules is optional.
Referenced by handleMessage().
|
protectedvirtual |
Starts data transmission.
Every sender module must implement this method.
Referenced by handleMessage().
|
protectedvirtual |
Starts transmission from the current file position and plays until given byte position (excluding file header) is reached.
Implementation in sender modules is optional.
Referenced by handleMessage().
|
protectedvirtual |
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.
Referenced by handleMessage().
|
protectedvirtual |
When the data transmission is paused the current position is changed to this byte position (excluding file header).
Implementation in sender modules is optional.
Referenced by handleMessage().
|
protectedvirtual |
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.
Referenced by handleMessage().
|
protectedvirtual |
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
Reimplemented in inet::rtp::RTPAVProfilePayload32Sender.
Referenced by handleMessage(), and play().
|
protectedvirtual |
This method stop data transmission and resets the sender module so that a following PLAY command would start the transmission at the beginning again.
Referenced by handleMessage().
|
protected |
The clock rate in ticks per second this sender uses.
Referenced by inet::rtp::RTPAVProfilePayload32Sender::initialize(), initialize(), initializeSenderModule(), and inet::rtp::RTPAVProfilePayload32Sender::sendPacket().
|
protected |
The input file stream for the data file.
Referenced by closeSourceFile(), inet::rtp::RTPAVProfilePayload32Sender::initializeSenderModule(), openSourceFile(), and inet::rtp::RTPAVProfilePayload32Sender::sendPacket().
|
protected |
The maximum size of an RTPPacket.
Referenced by initialize(), initializeSenderModule(), and inet::rtp::RTPAVProfilePayload32Sender::sendPacket().
|
protected |
The payload type this sender creates.
Referenced by inet::rtp::RTPAVProfilePayload32Sender::initialize(), initialize(), initializeSenderModule(), and inet::rtp::RTPAVProfilePayload32Sender::sendPacket().
|
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.
Referenced by handleMessage(), initialize(), pause(), inet::rtp::RTPAVProfilePayload32Sender::sendPacket(), stop(), and ~RTPPayloadSender().
|
protected |
The current sequence number.
Referenced by initialize(), and inet::rtp::RTPAVProfilePayload32Sender::sendPacket().
|
protected |
The first sequence number used for created rtp data packets.
The value is chosen randomly.
Referenced by initialize(), and initializeSenderModule().
|
protected |
The ssrc identifier of this sender module.
Referenced by endOfFile(), initialize(), initializeSenderModule(), pause(), play(), inet::rtp::RTPAVProfilePayload32Sender::sendPacket(), and stop().
|
protected |
The current state of data transmission.
Referenced by endOfFile(), initializeSenderModule(), pause(), play(), and stop().
|
protected |
The current rtp time stamp.
Referenced by initialize(), and play().
|
protected |
The first rtp time stamp used for created rtp data packets.
The value is chosen randomly.
Referenced by initialize(), initializeSenderModule(), and inet::rtp::RTPAVProfilePayload32Sender::sendPacket().