2 // Copyright (C) 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
4 // This program is free software; you can redistribute it and/or modify
5 // it under the terms of the GNU General Public License as published by
6 // the Free Software Foundation; either version 3 of the License, or
7 // (at your option) any later version.
9 // This program is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU General Public License for more details.
14 // You should have received a copy of the GNU General Public License
15 // along with this program; if not, write to the Free Software
16 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18 #ifndef _RTMP_CLIENT_H_
19 #define _RTMP_CLIENT_H_
22 #include <boost/cstdint.hpp>
23 #include <boost/shared_ptr.hpp>
31 // #include "handler.h"
40 class DSOEXPORT RTMPClient
: public RTMP
43 DSOEXPORT
RTMPClient();
44 DSOEXPORT
~RTMPClient();
47 // bool handShakeResponse();
48 boost::shared_ptr
<cygnal::Buffer
> clientFinish();
49 DSOEXPORT
boost::shared_ptr
<cygnal::Buffer
> clientFinish(cygnal::Buffer
&data
);
50 DSOEXPORT
boost::shared_ptr
<cygnal::Buffer
> handShakeRequest();
52 // These are used for creating the primary objects
53 // Create the initial object sent to the server, which
54 // is NetConnection::connect()
55 DSOEXPORT
boost::shared_ptr
<cygnal::Buffer
> encodeConnect();
56 DSOEXPORT
boost::shared_ptr
<cygnal::Buffer
> encodeConnect(const char *uri
);
57 DSOEXPORT
boost::shared_ptr
<cygnal::Buffer
> encodeConnect(const char *uri
, double audioCodecs
, double videoCodecs
,
58 double videoFunction
);
59 DSOEXPORT
boost::shared_ptr
<cygnal::Buffer
> encodeConnect(const char *app
,
60 const char *swfUrl
, const char *tcUrl
,
61 double audioCodecs
, double videoCodecs
, double videoFunction
,
64 DSOEXPORT
bool connectToServer(const std::string
&url
);
66 // Create the second object sent to the server, which is NetStream():;NetStream()
67 DSOEXPORT
boost::shared_ptr
<cygnal::Buffer
> encodeStream(double id
);
68 boost::shared_ptr
<cygnal::Buffer
> encodeStreamOp(double id
, rtmp_op_e op
, bool flag
);
69 boost::shared_ptr
<cygnal::Buffer
> encodeStreamOp(double id
, rtmp_op_e op
, bool flag
, double pos
);
70 DSOEXPORT
boost::shared_ptr
<cygnal::Buffer
> encodeStreamOp(double id
, rtmp_op_e op
, bool flag
, const std::string
&name
);
71 boost::shared_ptr
<cygnal::Buffer
> encodeStreamOp(double id
, rtmp_op_e op
, bool flag
, const std::string
&name
, double pos
);
73 bool isConnected() { return _connected
; };
75 std::string
&getPath() { return _path
; };
76 void setPath(std::string
&x
) { _path
= x
; };
78 DSOEXPORT
boost::shared_ptr
<cygnal::Buffer
> encodeEchoRequest(const std::string
&method
, double id
, cygnal::Element
&el
);
80 typedef std::deque
<boost::shared_ptr
<RTMPMsg
> > msgque_t
;
81 msgque_t
recvResponse();
91 // This is the thread for all incoming RTMP connections
92 void rtmp_handler(Network::thread_params_t
*args
);
95 } // end of gnash namespace
96 // end of _RTMP_CLIENT_H_
101 // indent-tabs-mode: t