Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
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
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
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
00053
00054
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
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
00092 void rtmp_handler(Network::thread_params_t *args);
00093 #endif
00094
00095 }
00096
00097 #endif
00098
00099
00100
00101
00102
00103