• Main Page
  • Related Pages
  • Namespaces
  • Classes
  • Files
  • Examples
  • File List
  • File Members

rtmp_client.h

Go to the documentation of this file.
00001 // 
00002 //   Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc.
00003 // 
00004 // This program is free software; you can redistribute it and/or modify
00005 // it under the terms of the GNU General Public License as published by
00006 // the Free Software Foundation; either version 3 of the License, or
00007 // (at your option) any later version.
00008 // 
00009 // This program is distributed in the hope that it will be useful,
00010 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00011 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012 // GNU General Public License for more details.
00013 // 
00014 // You should have received a copy of the GNU General Public License
00015 // along with this program; if not, write to the Free Software
00016 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
00017 
00018 #ifndef _RTMP_CLIENT_H_
00019 #define _RTMP_CLIENT_H_
00020 
00021 #include <deque>
00022 #include <boost/cstdint.hpp>
00023 #include <boost/shared_ptr.hpp>
00024 #include <string>
00025 #include <time.h>
00026 
00027 #include "rtmp.h"
00028 #include "rtmp_msg.h"
00029 #include "amf.h"
00030 #include "element.h"
00031 // #include "handler.h"
00032 #include "network.h"
00033 #include "buffer.h"
00034 #include "dsodefs.h"
00035 #include "URL.h"
00036 
00037 namespace gnash
00038 {
00039 
00040 class DSOEXPORT RTMPClient : public RTMP
00041 {
00042 public:
00043     DSOEXPORT RTMPClient();
00044     DSOEXPORT ~RTMPClient();
00045 
00046     bool handShakeWait();
00047 //    bool handShakeResponse();
00048     boost::shared_ptr<cygnal::Buffer> clientFinish();
00049     DSOEXPORT  boost::shared_ptr<cygnal::Buffer> clientFinish(cygnal::Buffer &data);
00050     DSOEXPORT boost::shared_ptr<cygnal::Buffer> handShakeRequest();
00051     
00052     // These are used for creating the primary objects
00053     // Create the initial object sent to the server, which
00054     // is NetConnection::connect()
00055     DSOEXPORT boost::shared_ptr<cygnal::Buffer> encodeConnect();
00056     DSOEXPORT boost::shared_ptr<cygnal::Buffer> encodeConnect(const char *uri);
00057     DSOEXPORT boost::shared_ptr<cygnal::Buffer> encodeConnect(const char *uri, double audioCodecs, double videoCodecs,
00058                    double videoFunction);
00059     DSOEXPORT boost::shared_ptr<cygnal::Buffer> encodeConnect(const char *app,
00060                    const char *swfUrl, const char *tcUrl,
00061                    double audioCodecs, double videoCodecs, double videoFunction,
00062                     const char *pageUrl);
00063     
00064     DSOEXPORT bool connectToServer(const std::string &url);
00065 
00066     // Create the second object sent to the server, which is NetStream():;NetStream()
00067     DSOEXPORT boost::shared_ptr<cygnal::Buffer> encodeStream(double id);
00068     boost::shared_ptr<cygnal::Buffer> encodeStreamOp(double id, rtmp_op_e op, bool flag);
00069     boost::shared_ptr<cygnal::Buffer> encodeStreamOp(double id, rtmp_op_e op, bool flag, double pos);
00070     DSOEXPORT boost::shared_ptr<cygnal::Buffer> encodeStreamOp(double id, rtmp_op_e op, bool flag, const std::string &name);
00071     boost::shared_ptr<cygnal::Buffer> encodeStreamOp(double id, rtmp_op_e op, bool flag, const std::string &name, double pos);
00072 
00073     bool isConnected() { return _connected; };
00074 
00075     std::string &getPath() { return _path; };
00076     void setPath(std::string &x) { _path = x; };
00077 
00078     DSOEXPORT boost::shared_ptr<cygnal::Buffer> encodeEchoRequest(const std::string &method, double id, cygnal::Element &el);
00079 
00080     typedef std::deque<boost::shared_ptr<RTMPMsg> > msgque_t;
00081     msgque_t recvResponse();
00082 
00083     void dump();
00084   private:
00085     std::string _path;
00086     bool   _connected;
00087     double _connections;
00088 };
00089 
00090 #if 0
00091 // This is the thread for all incoming RTMP connections
00092 void rtmp_handler(Network::thread_params_t *args);
00093 #endif
00094 
00095 } // end of gnash namespace
00096 // end of _RTMP_CLIENT_H_
00097 #endif
00098 
00099 // local Variables:
00100 // mode: C++
00101 // indent-tabs-mode: t
00102 // End:
00103 

Generated on Fri Mar 16 2012 15:46:12 for Gnash by  doxygen 1.7.1