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

RTSPFillBuffer.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_RTSP_FILLBUFFER_H 00025 #define MN_RTSP_FILLBUFFER_H 00026 00027 #include "ControlBase.h" 00028 #include "MNSelector.h" 00029 #include "MNTCPSocket.h" 00030 #include "MNRope.h" 00031 #include "MNMutex.h" 00032 #include "dictionary.h" 00033 00034 class RTSPParser; 00035 // class RTSPSocket; 00036 00037 class RTSPFillBuffer : public ControlBase 00038 , public MNTCPSocket 00039 { 00040 MNRope _rope; 00041 00045 MNSelector& _selector; 00046 00048 friend class TestCachingFillBuffer; 00049 00054 bool _char_mode; 00055 long _read_size; 00056 00057 // RTSPSocket* _sock; 00058 00059 bool _connect_fail_is_fatal; 00060 00064 MNMutex _sendMutex; 00065 00070 dictionary<int,MNString> _messages; 00071 00077 int __next_cseq_to_assign; 00078 int next_cseq_to_assign() const; 00079 void inc_next_cseq_to_assign(); 00080 int _bandwidth; 00081 00089 int __next_cseq_to_send; 00090 int next_cseq_to_send() const; 00091 void inc_next_cseq_to_send(); 00092 00098 void writeQueue( int cseq, MNString msg ); 00099 00103 int getCSeq( MNString text ); 00104 00105 private: 00106 const char* _rc_text( int code ); 00107 00108 RTSPFillBuffer& operator=( const RTSPFillBuffer& ); 00109 RTSPFillBuffer( const RTSPFillBuffer& ); 00110 00111 public: 00112 RTSPFillBuffer( MNSelector& slct ); 00113 RTSPFillBuffer( MNSelector& slct, int fd ); 00114 virtual ~RTSPFillBuffer( ); 00115 00122 virtual MNTCPSocket::Fail connect( int port, const char* hostname ); 00123 00124 // void setParser( RTSPSocket* RTSPSock ); 00125 00126 void setConnectFailIsFatal(); // called by the proxy server 00127 00128 virtual void callback( MNSelector* slct, int fd ); 00129 void reader( ); 00130 00146 virtual void receiveIt( uchar_t* buffer, 00147 int bufsz, 00148 int fd ); 00149 00153 virtual void MsgOut( int errNo, 00154 const MNString& headers, 00155 const MNString& body, 00156 int seq ); 00157 00161 virtual void MsgOut( const MNString& text, 00162 int seq ); 00163 00166 virtual void MsgOut( const MNString& text); 00167 00170 virtual void MsgOutNoEOL( const MNString& text ); 00171 void MsgOut( MNString text, 00172 int seq, 00173 MNString body ); 00174 int MsgOut2LibServer( MNString text ); 00175 00176 void CreateCSeqAnswer( MNString &Answer, int seq ); 00177 // inline RTSPSocket* getServerSocket() const { return _sock; } 00178 00179 virtual MNString getClientHostname(); 00180 virtual MNString getMulticastAddress(); 00181 00182 MNString Rope2MNString( MNRope& rope ); 00183 MNString getLastHeaderString ( ) ; 00184 MNString getLastSDPString ( ) ; 00185 00186 void deleteHeaderLine( MNString, MNString, MNString&, MNString&); 00187 00193 virtual int getNextCSeq( ); 00194 void setBandwidth( int bw ); 00195 int getBandwidth( ) const; 00196 }; 00197 00198 #endif /* MN_RTSP_FILLBUFFER_H */ 00199

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