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

PatchGM.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 00026 #ifndef MN_PatchGM_H 00027 #define MN_PatchGM_H 00028 00029 #include <sys/types.h> 00030 #include "var_type.h" 00031 00032 #include "ServerGM.h" 00033 #include "MNSem.h" 00034 #include "MNMutex.h" 00035 #include "MNString.h" 00036 #include "MNRTPutildefs.h" 00037 #include "sdp/PayloadTypes.h" 00038 00039 namespace SH 00040 { 00041 class Base; 00042 class RTPSourceSH; 00043 class RTPSinkSH; 00044 class RTPDecoderSH; 00045 class RTPEncoderSH; 00046 class ConcatinizerSH; 00047 class FileSinkSH; 00048 class PushPullSH; 00049 }; 00050 00055 class PatchGM : public ServerGM 00056 { 00057 struct timeval* _tv; 00058 00059 SH::RTPSourceSH* _patchSource; 00060 SH::RTPDecoderSH* _patchDecoder; 00061 SH::PushPullSH* _patchQueue; 00062 SH::RTPSourceSH* _mainSource; 00063 SH::RTPDecoderSH* _mainDecoder; 00064 SH::PushPullSH* _mainQueue; 00065 SH::ConcatinizerSH* _concatinizer; 00066 SH::FileSinkSH* _fileCache; 00067 SH::PushPullSH* _netQueue; 00068 SH::RTPEncoderSH* _netEncoder; 00069 SH::RTPSinkSH* _netSink; 00070 00071 MediaState _streamer_state; 00072 MNSem _eof_sig; 00073 MNMutex _eof_lock; 00074 00075 MNMutex _notifyLock; 00076 00077 MNString _mainServer; // hostname of the server of the main multicast stream 00078 MNString _patchServer; // hostname of the server of the patch stream 00079 MNString _client; // hostname of the client 00080 00081 // int _MainPortUp; // server port of the main multicast stream 00082 int _DistantPortUp; // server port of the patch stream 00083 // int _LocalPortUp; // proxy port of the patch stream 00084 // int _LocalPortDown; // proxy port of the combined stream 00085 int _DistantPortDown; // client port 00086 00087 MNSocket* _local_upstream_main_rtp; 00088 MNSocket* _local_upstream_main_rtcp; 00089 MNSocket* _local_upstream_patch_rtp; 00090 MNSocket* _local_upstream_patch_rtcp; 00091 MNSocket* _local_down_rtp; 00092 MNSocket* _local_down_rtcp; 00093 00094 bool _cachingEnabled; 00095 bool _patchComplete; 00096 bool _mainComplete; 00097 bool _netComplete; 00098 00099 public: 00100 PatchGM( GMUser* user, MNSelector& sel, bool cachingEnabled ); 00101 00102 virtual ~PatchGM(); 00103 00104 virtual void init(int idx); 00105 00106 virtual void uninit(); 00107 virtual void start(); 00108 00109 virtual void set_hostnames( const MNString& Client, const MNString& Server ); 00110 virtual void set_ports( int idx, 00111 MNSocket* locDownRtp, 00112 MNSocket* locDownRtcp, 00113 int distDown, 00114 MNSocket* locUpRtp, 00115 MNSocket* locUpRtcp, 00116 int distUp ); 00117 00118 private: 00119 virtual int start_streamer(int idx, int bandwidth ); 00120 public: 00121 virtual int open_file( int idx, 00122 const char* name, 00123 int rtp_pt, 00124 SDP::PayloadTypes int_pt, 00125 u_int32 bw, 00126 SDP::RetransTypes int_rt, 00127 int packetsize ); 00128 virtual int play( int startp, int stopp ); 00129 virtual int stop( ); 00130 virtual int pause( ); 00131 virtual int jump ( long pos ); 00132 00133 virtual bool graphManNotify( int idx, 00134 SH::Base* caller, 00135 SH::Notification attribute, 00136 void* msg ); 00137 00138 void setMainSource( MNString hostname, 00139 MNSocket* mainRtp, 00140 MNSocket* mainRtcp ); 00141 void setBufferOptions( int threshold, int size); 00142 }; 00143 00145 00146 #endif /* MN_PatchGM_H */

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