#include <RTPPayloadReceiver.h>
Inheritance diagram for RTPPayloadReceiver:
Protected Member Functions | |
virtual | ~RTPPayloadReceiver () |
virtual void | initialize () |
virtual void | handleMessage (cMessage *msg) |
virtual void | processPacket (RTPPacket *packet) |
virtual void | openOutputFile (const char *fileName) |
virtual void | closeOutputFile () |
Protected Attributes | |
std::ofstream | _outputFileStream |
int | _payloadType |
cOutVector * | _packetArrival |
RTPPayloadReceiver::~RTPPayloadReceiver | ( | ) | [protected, virtual] |
Destructor. Disposes the queue object and closes the output file.
00032 { 00033 closeOutputFile(); 00034 delete _packetArrival; 00035 };
void RTPPayloadReceiver::closeOutputFile | ( | ) | [protected, virtual] |
Closes the output file stream.
Reimplemented in RTPAVProfileSampleBasedAudioReceiver.
00069 { 00070 _outputFileStream.close(); 00071 };
void RTPPayloadReceiver::handleMessage | ( | cMessage * | msg | ) | [protected, virtual] |
Method for handling incoming packets. At the moment only RTPInnerPackets containing an encapsulated RTPPacket are handled.
00045 { 00046 RTPInnerPacket *rinp = (RTPInnerPacket *)msg; 00047 if (rinp->type() == RTPInnerPacket::RTP_INP_DATA_IN) { 00048 RTPPacket *packet = (RTPPacket *)(rinp->decapsulate()); 00049 processPacket(packet); 00050 delete rinp; 00051 } 00052 else { 00053 EV << "receiver module: RTPInnerPacket of wrong type received" << endl; 00054 delete rinp; 00055 } 00056 };
void RTPPayloadReceiver::initialize | ( | ) | [protected, virtual] |
Initializes the receiver module, opens the output file and creates a queue for incoming packets. Subclasses must overwrite it (but should call this method too)
Reimplemented in RTPAVProfilePayload10Receiver, and RTPAVProfilePayload32Receiver.
00038 { 00039 const char *fileName = par("outputFileName"); 00040 openOutputFile(fileName); 00041 _packetArrival = new cOutVector("packet arrival"); 00042 };
void RTPPayloadReceiver::openOutputFile | ( | const char * | fileName | ) | [protected, virtual] |
This method is called by initialize and opens the output file stream. For most payload receivers this method works well, only when using a library for a payload type which provides an own open method it must
Reimplemented in RTPAVProfileSampleBasedAudioReceiver.
00064 { 00065 _outputFileStream.open(fileName); 00066 };
void RTPPayloadReceiver::processPacket | ( | RTPPacket * | packet | ) | [protected, virtual] |
Writes contents of this RTPPacket into the output file. Must be overwritten by subclasses.
Reimplemented in RTPAVProfilePayload32Receiver, and RTPAVProfileSampleBasedAudioReceiver.
00059 { 00060 _packetArrival->record((double)(packet->timeStamp())); 00061 };
std::ofstream RTPPayloadReceiver::_outputFileStream [protected] |
The output file stream.
cOutVector* RTPPayloadReceiver::_packetArrival [protected] |
An output vector used to store arrival of rtp data packets.
int RTPPayloadReceiver::_payloadType [protected] |
The payload type this RTPPayloadReceiver module processes.