Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

Sender.h

Go to the documentation of this file.
00001 /* Copyright (C) 2000 KOM/Darmstadt University of Technology 00002 * 00003 * You are allowed to use all other parts of the code under the following terms: 00004 * 00005 * For non-commercial use, code may be used in unmodified form provided 00006 * that this copyright notice and this permission notice appear in 00007 * supporting documentation. 00008 * 00009 * This software is provided "as is" and without any express or implied 00010 * warranties, including, without limitation, the implied warranty of 00011 * fitness for a particular purpose. 00012 * 00013 * The code may be subjected to the GNU General Public License, Version 2, 00014 * and re-distributed under the terms of this license. 00015 * As a special exception, permission is granted to link this code 00016 * with the Qt library and distribute executables, as long as you 00017 * follow the requirements of the GNU GPL in regard to all of the 00018 * software in the executable aside from Qt. 00019 * 00020 * Commercial use other than under the terms of the GNU General Public 00021 * License is allowed only after express negotiation of conditions 00022 * with the authors. 00023 */ 00024 #ifndef SENDER_H 00025 #define SENDER_H 00026 00027 /* include some files */ 00028 #include <unistd.h> 00029 #include <string.h> 00030 #include "sh/FileStreamerGM.h" 00031 #include "sdp/PayloadTypeEntry.h" 00032 #include "MNMutex.h" 00033 #include "MNProtectedVar.h" 00034 #include "MNlogger.h" 00035 #include "MNRTPevent.h" 00036 #include "MNRTPcallback.h" 00037 #include "MNSelector.h" 00038 #include "MNPipeNotifier.h" 00039 00040 class Sender : public GMUser 00041 // , public MNRTP_RTCPbye_callback 00042 // , public MNRTPcallback 00043 { 00044 private: 00045 /* vars */ 00046 char* version_text; 00047 MNlogger logger; 00048 MNMutex initialized; 00049 00050 /* filestreamer vars */ 00051 FileStreamerGM* filestreamer; 00052 ProtectedVar<unsigned int> bandwidth; 00053 ProtectedVar<int> _port; 00054 ProtectedVar<int> id; 00055 char* target; 00056 MNMutex target_mutex; 00057 char* file_name; 00058 MNMutex file_name_mutex; 00059 ProtectedBool forced; 00060 ProtectedVar<unsigned int> forced_timeout; 00061 ProtectedVar<unsigned int> forced_packet_size; 00062 ProtectedVar<int> packetsize; 00063 ProtectedVar<int> ttl; 00064 00065 /* flags */ 00066 ProtectedBool verbose; 00067 ProtectedBool started; 00068 ProtectedBool ende; 00069 00070 /* pipe comm */ 00071 fd_set read_set, write_set, except_set; 00072 PipeNotifier<Sender> _notify_pipe; 00073 MNSelector _selector; 00074 00075 /* functions */ 00076 void wake( const char* text ); 00077 void init(); 00078 void selectIT(); 00079 00080 void wokenup( ); 00081 void closedDown( ); 00082 00083 /* callbacks */ 00084 virtual void StreamEvent(stream_event_t event, int fd); 00085 virtual void StreamError(int error, int fd); 00086 virtual void RTCPbye_cb(u_int32 ssrc, text_item_t *bye_text); 00087 00088 public: 00089 Sender(); 00090 virtual ~Sender(); 00091 00092 virtual const SDP::PayloadTypeTable* getPayloadTypes(); 00093 virtual SDP::PayloadTypes getInternalPayloadType(); 00094 virtual int getRTPPayloadType(); 00095 virtual const SDP::PayloadTypeTable* getPayloadTypes(int idx); 00096 virtual SDP::PayloadTypes getInternalPayloadType(int idx); 00097 virtual int getRTPPayloadType(int idx); 00098 virtual void fileComplete( const char* filename, bool comp ); 00099 00100 bool ParseCmdLine(int argc, char* argv[]); 00101 const char* GetVer(); 00102 const char* Usage(); 00103 void TzStart(); 00104 void Stop(); 00105 00106 /* options */ 00107 void SetVerbose(); 00108 void UnsetVerbose(); 00109 void SetBandwidth(unsigned int bw); 00110 unsigned int GetBandwidth(); 00111 void SetPort(int port_); 00112 int GetPort(); 00113 void SetId(int id_); 00114 int GetId(); 00115 void SetHost(const char* host); 00116 char* GetHost(); 00117 void SetForced(); 00118 void UnsetForced(); 00119 bool GetForced(); 00120 void SetFname(const char* text); 00121 char* GetFname(); 00122 void SetForcedPacketSize(unsigned int val); 00123 unsigned int GetForcedPacketSize(); 00124 void SetForcedTimeout(unsigned int val); 00125 unsigned int GetForcedTimeout(); 00126 void SetTtl(int val); 00127 int GetTtl(); 00128 void SetPacketSize(int val); 00129 int GetPacketSize(); 00130 00131 private: 00141 SDP::PayloadTypeTable _payloadTypes; 00142 }; 00143 00144 #endif 00145

Generated on Sun Mar 6 13:35:50 2005 for Komssys by doxygen 1.3.8