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

RTSPProxySession.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 RTSP_PROXY_SESSION_H 00025 #define RTSP_PROXY_SESSION_H 00026 00027 #include "MNString.h" 00028 #include "MNList.h" 00029 #include "MNSem.h" 00030 #include "MNMutex.h" 00031 #include "MNValid.h" 00032 #include "MNSelector.h" 00033 #include "RTSPProxySessionFactory.h" 00034 #include <vector> 00035 00036 class ProxyServer; 00037 class ProxyClient; 00038 class ProxyClientWrapper; 00039 00040 class RTSPParserBase; 00041 // class MNRTSPEventInterface; 00042 class ControlBase; 00043 class RTSPProxySessionFactory; 00044 class dataPump; 00045 00046 class RTSPProxySession 00047 { 00048 DECLARE_VALID 00049 00050 static size_t _cnt; 00051 // typedef std::vector<dataPump*> dataPumpVector; 00052 00053 public: 00054 enum DynReflectionRepositioningMode 00055 { 00056 FORBIDDEN, 00057 SHARED, 00058 INDIVIDUAL 00059 }; 00060 private: 00061 DynReflectionRepositioningMode _repositioning; 00062 00063 ProxyClientWrapper* _proxyClientWrapper; 00064 ProxyServer* _ps_fsa; 00065 //MNList<ProxyClient*>* _pc_fsa; 00066 MNSelector& _selector; 00067 00068 RTSPProxySessionFactory* _factory; 00069 RTSPParserBase* _lastCmd; 00070 RTSPParserBase* _lastReply; 00071 ControlBase* _FBdownstream; 00072 //ControlBase* _FBupstream; 00073 00075 int _CSeq_down; 00076 00078 bool _ProxyStreaming; 00079 00081 bool _ProxyCaching; 00082 00084 bool _ProxyPatching; 00085 00086 // true if Servers return more than 1 Formattype in sdp-media-desc 00087 // bool _ProxyFormatswitching; 00088 00089 MNString _url; 00090 00091 bool _doDynReflection; 00092 00093 dataPump* _rtp; 00094 00095 00096 00097 int _sessionID; 00098 int _rtsp_socket_down; 00099 //int _rtsp_socket_up; 00100 00101 public: 00102 00119 RTSPProxySession( RTSPProxySessionFactory* factory, 00120 int sessionID, 00121 MNSelector& slct, 00122 int fd_down, 00123 MNString url, 00124 bool doDynReflection=false ); 00125 void ref( ); 00126 void deref( ); 00127 private: 00128 size_t _ref; 00129 00130 public: 00131 // private: 00132 ~RTSPProxySession(); 00133 00134 public: 00135 void setFillBuffers ( ControlBase* FBdown, ControlBase* FBup ); 00136 ControlBase* getUpstream(); 00137 ControlBase* getDownstream(); 00138 00139 MNString& getUrl(); 00140 00141 void start_fsa(); 00142 00146 void storePtr2RequestMsg ( RTSPParserBase* base ); 00147 00151 void storePtr2ReplyMsg ( RTSPParserBase* base ); 00152 00153 00156 void Setup ( RTSPParserBase* msg, int bw ); 00157 void Describe ( RTSPParserBase* msg ); 00158 void Play ( RTSPParserBase* msg ); 00159 void Teardown ( RTSPParserBase* msg ); 00160 void Pause ( RTSPParserBase* msg ); 00161 void Reply ( RTSPParserBase* msg ); 00162 void SetParameter ( RTSPParserBase* msg ); 00163 void Announce ( RTSPParserBase* msg ); 00164 00165 RTSPParserBase* get_lastCmd(); 00166 void set_lastCmd(RTSPParserBase* msg); 00167 RTSPParserBase* get_lastReply(); 00168 00169 ProxyServer* getProxyServerFSA(); 00170 MNList<ProxyClient*>* getProxyClientFSA(); 00171 int getCSeqDown(); 00172 void setCSeqDown( int cseq ); 00173 int getNextCSeqUp(); 00174 00175 void setProxyCaching( bool ); 00176 void setProxyStreaming( bool ); 00177 void setProxyPatching( bool ); 00178 // void setProxyFormatswitching( bool ); 00179 bool getProxyCaching() const; 00180 bool getProxyStreaming() const; 00181 bool getProxyPatching() const; 00182 // bool getProxyFormatswitching(); 00184 bool lookupProxyFormatswitching(); 00185 00186 ProxyClient* getCacheSessionPC( ); 00187 ProxyClient* getClientSessionPC( ); 00188 dataPump* getRTP( ); 00189 void setRTP( dataPump* ); 00190 00191 // to be removed 00192 //void setDynReflecting(bool b, ProxySessionPtr reflectingSess); 00193 00194 bool doesDynReflection(); 00195 void assignDownstreamSessionId(); 00196 ProxyClientWrapper* getProxyClientWrapper(); 00197 DynReflectionRepositioningMode getDynReflectionRepositioningMode(); 00198 unsigned int getDynReflectionSessionMemberCount(); 00199 bool searchAndSetupReflectionSession(int presentationTime); 00200 int getNptSeconds(); 00201 void setNptSeek(int npt); 00202 void forgetSession(); 00203 00204 00210 MNString getOwnHostName(); 00211 00216 int getRtspSocketDown( ) const; 00217 00220 u_int64_t getSessionID( ) const; 00221 00222 void closeRtspSocketDown(); 00226 void closeRtspSocketUp(); 00227 00228 private: 00230 RTSPProxySession( const RTSPProxySession& ); 00231 00233 RTSPProxySession& operator=( const RTSPProxySession& ); 00234 }; 00235 00236 #endif /* RTSP_PROXY_SESSION_H */ 00237

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