RTPPayloadSender.h

Go to the documentation of this file.
00001 /***************************************************************************
00002                           RTPPayloadSender.h  -  description
00003                              -------------------
00004     begin                : Wed Nov 28 2001
00005     copyright            : (C) 2001 by Matthias Oppitz
00006     email                : Matthias.Oppitz@gmx.de
00007  ***************************************************************************/
00008 
00009 /***************************************************************************
00010  *                                                                         *
00011  *   This program is free software; you can redistribute it and/or modify  *
00012  *   it under the terms of the GNU General Public License as published by  *
00013  *   the Free Software Foundation; either version 2 of the License, or     *
00014  *   (at your option) any later version.                                   *
00015  *                                                                         *
00016  ***************************************************************************/
00017 
00018 
00023 #ifndef __INET_RTPPAYLOADSENDER_H
00024 #define __INET_RTPPAYLOADSENDER_H
00025 
00026 #include <fstream>
00027 #include "INETDefs.h"
00028 #include "RTPInnerPacket.h"
00029 
00030 
00037 class INET_API RTPPayloadSender : public cSimpleModule
00038 {
00039     public: //FIXME
00040     //protected:
00041 
00045         RTPPayloadSender() : cSimpleModule(32768) {}
00046 
00050         virtual ~RTPPayloadSender();
00051 
00056         virtual void initialize();
00057 
00058         virtual void activity();
00059 
00063         enum SenderStatus {
00064             STOPPED, //< No transmission.
00065             PLAYING  
00066         };
00067 
00068     protected:
00069 
00073         std::ifstream  _inputFileStream;
00074 
00078         int _mtu;
00079 
00083         uint32 _ssrc;
00084 
00088         int _payloadType;
00089 
00093         int _clockRate;
00094 
00099         uint32 _timeStampBase;
00100 
00104         uint32 _timeStamp;
00105 
00110         uint16 _sequenceNumberBase;
00111 
00115         uint16 _sequenceNumber;
00116 
00120         SenderStatus _status;
00121 
00127         cMessage *_reminderMessage;
00128 
00134         virtual void initializeSenderModule(RTPInnerPacket *);
00135 
00144         virtual void openSourceFile(const char *fileName);
00145 
00149         virtual void closeSourceFile();
00150 
00155         virtual void play();
00156 
00162         virtual void playUntilTime(simtime_t moment);
00163 
00169         virtual void playUntilByte(int position);
00170 
00176         virtual void pause();
00177 
00183         virtual void seekTime(simtime_t moment);
00184 
00190         virtual void seekByte(int position);
00191 
00197         virtual void stop();
00198 
00203         virtual void endOfFile();
00204 
00210         virtual bool sendPacket();
00211 };
00212 
00213 #endif
00214