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

RTSPParserBase.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 MN_RTSPPARSERBASE_H 00025 #define MN_RTSPPARSERBASE_H 00026 00027 #include <sys/types.h> 00028 #include "var_type.h" 00029 00030 #include <stdio.h> 00031 #include "MNString.h" 00032 00033 class MNSelector; 00034 class ParseHeaderLines; 00035 class ControlBase; 00036 class RTSPSchemeClass; 00037 class SDPSessionDescription; 00038 00039 namespace RTSP 00040 { 00047 enum KindOfHeader 00048 { 00049 ANNOUNCE, 00050 DESCRIBE, 00051 GET_PARAMETER, 00052 SET_PARAMETER, 00053 OPTIONS, 00054 PAUSE, 00055 PLAY, 00056 REPLY, 00057 SETUP, 00058 TEARDOWN 00059 }; 00060 }; 00061 00062 class RTSPParserBase 00063 { 00064 private: 00065 int _cseq; 00066 int _code; 00067 ParseHeaderLines* _hdrLines; 00068 RTSP::KindOfHeader _kindOfHeader; 00069 MNString _ParsedText; 00070 RTSPSchemeClass* _rtsp_scheme; 00071 00080 int _rtsp_socket; 00081 00088 bool _post_processing_done; 00089 00090 protected: 00091 ControlBase* _rfb; 00092 SDPSessionDescription* _sdp; 00093 00094 public: 00095 00096 RTSPParserBase( int seq, 00097 ControlBase* rfb, 00098 RTSP::KindOfHeader kindOfHeader, 00099 const RTSPSchemeClass* scheme = NULL ); 00100 RTSPParserBase( int seq, 00101 int Code, 00102 ControlBase* rfb, 00103 RTSP::KindOfHeader kindOfHeader, 00104 const RTSPSchemeClass* scheme = NULL ); 00105 virtual ~RTSPParserBase(); 00106 00110 virtual void parsePostProcess( ); 00111 00115 bool postProcessingDone( ) const; 00116 00117 void getUrlPath( MNString& uri, MNString& url, MNString& path ); 00118 void addHeaderLines( ParseHeaderLines* headerLines ); 00119 int StreamExists( const char* StreamName ); 00120 00121 void MsgOut( int errorNum ); 00122 void MsgOut( int errorNum, 00123 MNString info, 00124 MNString body ); 00125 00126 ParseHeaderLines* getHeaderLines( ); 00127 bool isMulticastRequested( ); 00128 bool isHeaderCorrect( ); 00129 bool isDestinationSet(); 00130 int getHeaderErrorNum( ); 00131 int clientPortAnnouncement( ); 00132 int serverPortAnnouncement( ); 00133 const MNString& getHeaderErrorString( ); 00134 MNString getDestination(); 00135 const MNString& getSessionIdString( ); 00138 u_int64_t getSessionId( ); 00139 int getReplyCode( ); 00140 const MNString& getLastModified( ) ; 00141 bool hasLastModified( ) ; 00142 00143 bool hasRTPInfo(); 00144 u_int32 getRTPInfoRTPTime(int idx, bool& error); 00145 00146 int getCSeq( ); 00147 ControlBase* getFillBuffer( ); 00148 RTSP::KindOfHeader getKind( ) const; 00149 00150 #if 0 00151 MNString& toString( ); 00152 #endif 00153 00154 SDPSessionDescription* getSDPSessionDescription() { return _sdp; } 00155 void setSDPSessionDescription( SDPSessionDescription* ); 00156 00157 MNString* getParsedText() { return &_ParsedText; } 00158 00159 void setParsedText( const MNString& str ); 00160 void append2ParsedText( const MNString& text ); 00161 void getHeaderLine ( const MNString& HeaderName, MNString& Dest ); 00162 00163 MNString& getUrl(); 00164 MNString& getFullUrl(); 00165 MNString& getUri(); 00166 00167 virtual void call( MNSelector& slct ) = 0; 00168 00173 void setRtspSocket( int sock ); 00174 00178 int getRtspSocket( ) const; 00179 }; 00180 00181 #endif /*MN_RTSPPARSERBASE_H */ 00182

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