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

RTSPServerSession.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 _RTSPServerSession_h 00025 #define _RTSPServerSession_h 1 00026 00027 #include "MNString.h" 00028 #include "MNMutex.h" 00029 #include "MNValid.h" 00030 #include "StreamRequestHeader.h" 00031 00032 #include "Container.h" 00033 #include "ParseTransport.h" 00034 #include "RTSPParserBase.h" 00035 #include "ReqQueueEntry.h" 00036 #include "KomServer.h" 00037 00038 class ParseTimeRange; 00039 class MNRTSPSessionFactory; 00040 class ControlBase; 00041 class RTSPSetupHeader; 00042 class RTSPSetParameterHeader; 00043 class RTSPReplyHeader; 00044 00045 class RTSPServerSession : public KomServer 00046 { 00047 DECLARE_VALID 00048 00049 int _sessionID; 00050 int _rtsp_socket; 00051 Container* _container; 00052 MNRTSPSessionFactory* _factory; 00053 bool _firstSetup; 00054 bool _ismc; 00055 bool _streamnew; 00056 // bool _tfrc; 00057 int _mcport; 00058 MNString _mchost; 00059 00060 00061 RTSPParserBase* _lastCmd; 00062 RTSPParserBase* _lastReply; 00063 const MNString& _name; 00064 bool _isFormatswitchingDemanded; 00065 int _lastCSeq; 00066 StreamDescriptor* _streamdesc; 00067 00068 private: 00069 bool ChckContainerList(const MNString& path); 00070 00072 // Req Queues 00073 ReqQueueEntryDLList ImmReqQueue; 00074 ReqQueueEntryDLList DefReqQueue; 00075 // flag used to signal a chnage of the deferred request queue 00076 int DefReqChanged; 00077 00078 // saves data about all streams of actual session stream data 00079 StreamRequestHeader AboutStreams; 00080 00082 00083 public: 00112 RTSPServerSession( MNRTSPSessionFactory* factory, 00113 MNSelector& selector, 00114 int sessionId, 00115 int rtspSocket, 00116 const MNString& path ); 00117 00118 private: 00119 ~RTSPServerSession(); 00120 00121 public: 00122 int Setup( const MNString& StreamName, 00123 ParseTransport* Trans, 00124 int bw, 00125 RTSPSetupHeader* cmd ); 00126 int SetParameter( RTSPSetParameterHeader* cmd ); 00127 int Ok( RTSPReplyHeader* reply ); 00128 00129 00130 // cg 10nov2001 - are these functions unused? 00131 // int StreamEnded( const MNString& path); 00132 // int StreamStarted( const MNString& path ); 00133 00134 int LookQueuedReqs(); 00135 int InsertImmPlayRequest( const MNString& path, 00136 ParseTimeRange* range, 00137 RTSPParserBase* cmd ); 00138 int InsertDefPlayRequest( const MNString& StreamName, 00139 ParseTimeRange* range, 00140 RTSPParserBase* cmd ); 00141 int PauseReq( const MNString& path, 00142 MNList<MNString>& ContainerPaths, 00143 RTSPParserBase* cmd ); 00144 // int PlayRequestEnd( const MNString& StreamName, int ContNo); 00145 // if we don't declare it virtual we would have to define it 00146 void GetSecImmQueueAccess(); 00147 void RelSecImmQueueAccess(); 00148 void GetSecDefQueueAccess(); 00149 void RelSecDefQueueAccess(); 00150 void SendNow( int command, int mask,int nextState); 00151 00152 // cg 11nov2001 - the automaton provides ::stop() itself 00153 // void sessStop( ); 00154 00155 // to get run by HelpToRunThread timethread must be public 00156 void timethread(); 00157 00158 void QueueImm(); 00159 //misc functions 00160 int ChckContainerState(Container* HelpContainer); 00161 00162 virtual void streamerSetupResponse( bool success ); 00163 virtual void streamerResponse( int port, const char* msg ); 00164 virtual void sendSetParameterRequest( ); 00165 virtual void sendSetParameterOk( ); 00166 virtual void setDataPump( dataPump* pump ); 00167 virtual void sendAnnounce( int new_pt, 00168 long old_ssrc, 00169 long old_bytepos, 00170 long new_ssrc, 00171 long new_bytepos ); 00172 00173 const MNString& getSessionName( ); 00174 00179 int getRtspSocket( ) const; 00180 00181 bool mcStreamPlaying( ); 00182 bool isMc( ); 00183 bool isSessionMulticast(); 00184 int getMulticastInformation( MNString& mchost, int& mcport ); 00185 00186 inline const bool hasGui() const { return false; } 00187 inline bool isFormatswitchingDemanded() const { return _isFormatswitchingDemanded; } 00188 inline int getLastCSeq( ) const { return _lastCSeq; } 00189 00190 private: 00191 size_t _ref; 00192 public: 00193 void ref(); 00194 void deref(); 00195 }; 00196 00197 #endif 00198

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