From: Christian P. <cp...@us...> - 2005-01-16 00:05:12
|
Update of /cvsroot/pclasses/pclasses2/include/pclasses/Net In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24693/include/pclasses/Net Modified Files: RTSPSocket.h Log Message: Some RTSP parts are rewritten. Index: RTSPSocket.h =================================================================== RCS file: /cvsroot/pclasses/pclasses2/include/pclasses/Net/RTSPSocket.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- RTSPSocket.h 14 Jan 2005 14:56:01 -0000 1.1 +++ RTSPSocket.h 16 Jan 2005 00:05:00 -0000 1.2 @@ -32,6 +32,7 @@ public: //! RTSP Request methods enum Method { + UNKNOWN, DESCRIBE, ANNOUNCE, GET_PARAMETER, @@ -45,6 +46,7 @@ TEARDOWN }; + RTSPRequest(); RTSPRequest(Method m); RTSPRequest(Method m, const IO::URL& url); ~RTSPRequest() throw(); @@ -57,14 +59,17 @@ bool hasUrl() const throw(); const IO::URL& url() const throw(); - const RTSPRequestHeader& header() const throw(); + void setProtocolVersion(const std::string& protoVer); + const std::string& protocolVersion() const throw(); + const RTSPRequestHeader& header() const throw(); RTSPRequestHeader& header() throw(); private: Method _method; IO::URL _url; bool _urlValid; + std::string _protoVer; RTSPRequestHeader _header; }; @@ -73,6 +78,9 @@ //! RTSP response class class RTSPResponse: public IO::IODevice { public: + RTSPResponse(const std::string& protoVer, + int code, const std::string& reason); + RTSPResponse(RTSPSocket& socket, const std::string& protoVer, int code, const std::string& reason); @@ -112,8 +120,18 @@ void open(Domain d) throw(IO::IOError); - void sendRequest(RTSPRequest& req) throw(IO::IOError); + void sendRequest(const RTSPRequest& req) throw(IO::IOError); + RTSPRequest readRequest() throw(IO::IOError); + + void sendResponse(const RTSPResponse& resp) throw(IO::IOError); RTSPResponse readResponse() throw(IO::IOError); + + private: + void readHeader(RTSPHeader& header) throw(IO::IOError); + void sendHeader(const RTSPHeader& header) throw(IO::IOError); + + unsigned int _cSeqInNext; + unsigned int _cSeqOutNext; }; |