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

FileStreamerGM.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 00025 #ifndef MN_FileStreamerGM_H 00026 #define MN_FileStreamerGM_H 00027 00028 #include <sys/types.h> 00029 #include "var_type.h" 00030 00031 #include "ServerGM.h" 00032 #include "MNFileSourceSH.h" 00033 #include "MNSem.h" 00034 #include "MNMutex.h" 00035 #include "MNRTPutildefs.h" 00036 00037 #define min(a, b) (((a) < (b))? (a): (b)) 00038 00039 namespace SH 00040 { 00041 class Base; 00042 class RTPEncoderSH; 00043 class DummyLayerSourceSH; 00044 }; 00045 00046 class MNUDPSocket; 00047 00052 class FileStreamerGM : public ServerGM 00053 { 00054 struct timeval* _tv; 00055 00056 union 00057 { 00058 SH::Base* a; 00059 SH::FileSourceSH* f; 00060 SH::DummyLayerSourceSH* d; 00061 } _fsh; 00062 SH::RTPEncoderSH* _esh; 00063 SH::Base* _ssh; 00064 MNString _client; 00065 00066 MediaState _streamer_state; 00067 MNSem _eof_sig; 00068 MNMutex _eof_lock; 00069 bool _initialized; 00070 00073 bool _udl; 00074 00075 MNSocket* _local_down_rtp; 00076 MNSocket* _local_down_rtcp; 00077 int _DistantPortDown; 00078 00079 RTSP::TransportTypes _requested_transport; 00080 00081 public: 00099 FileStreamerGM( GMUser* user, 00100 MNSelector& sel, 00101 bool useDummyLayerSource = false, 00102 RTSP::TransportTypes requested_transport = RTSP::RTP_AVP_UDP ); 00103 00107 virtual ~FileStreamerGM(); 00108 00114 virtual void init(int idx); 00115 00118 virtual void uninit(); 00119 00120 virtual u_int32 getSsrc(); 00121 00126 virtual void start(); 00127 00136 virtual void set_hostnames( const MNString& client, const MNString& server ); 00137 virtual void set_ports( int idx, 00138 MNSocket* locDownRtp, 00139 MNSocket* locDownRtcp, 00140 int distDown, 00141 MNSocket* locUpRtp, 00142 MNSocket* locUpRtcp, 00143 int distUp ); 00144 virtual bool graphManNotify( int idx, SH::Base* caller, SH::Notification attribute, void* msg ); 00145 00146 private: 00147 virtual int start_streamer( int idx, int bandwidth ); 00148 00149 public: 00150 00173 virtual int open_file( int idx, 00174 const char* name, 00175 int rtp_pt, 00176 SDP::PayloadTypes int_pt, 00177 u_int32 bw, 00178 SDP::RetransTypes int_rt, 00179 int packetsize ); 00180 virtual int play( int startp, int stopp ); 00181 virtual int stop( ); 00182 virtual int pause( ); 00183 virtual int jump ( long pos ); 00184 virtual long getFilePos(); 00185 00198 void send_forced( size_t timeout, size_t packetsize ); 00199 00203 void stop_forced( ); 00204 00208 void recv_forced( ); 00209 00211 virtual bool synchronousGet( GetValue what, u_int32& outVar ); 00212 00213 // new requirements due to the integration of LCFtpSend, 00214 // dummies right now 00215 00221 void set_repeat_times( u_int32 /*lc_max_loop*/ ) { } 00222 }; 00223 00225 00226 #endif /* MN_FileStreamerGM_H */ 00227

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