1
// Red5 server side support for the oflaDemo_test via RTMP
3
// Copyright (C) 2008, 2009 Free Software Foundation, Inc.
5
// This program is free software; you can redistribute it and/or modify
6
// it under the terms of the GNU General Public License as published by
7
// the Free Software Foundation; either version 3 of the License, or
8
// (at your option) any later version.
10
// This program is distributed in the hope that it will be useful,
11
// but WITHOUT ANY WARRANTY; without even the implied warranty of
12
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
// GNU General Public License for more details.
15
// You should have received a copy of the GNU General Public License
16
// along with this program; if not, write to the Free Software
17
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
25
#include <boost/shared_ptr.hpp>
26
#include <boost/shared_array.hpp>
27
#include <boost/scoped_array.hpp>
38
#include "rtmp_server.h"
43
/// \var class demoService
44
/// This class support the Red5 server functions used by some
57
/// return the list of FLV files we've found
58
std::vector<boost::shared_ptr<filestats_t> > &getListOfAvailableFiles(const std::string &path);
60
/// return the list of FLV files we've found of the specified type
61
std::vector<boost::shared_ptr<filestats_t> > &getListOfAvailableFiles(const std::string &path,
62
const std::string &type);
63
std::vector<boost::shared_ptr<filestats_t> > &getFileStats() { return _stats; };
67
std::vector<boost::shared_ptr<filestats_t> > _stats;
70
class OflaDemoTest : public cygnal::RTMPServer
76
// Parse an OflaDemo Request message coming from the Red5 oflaDemo_test.
77
std::vector<boost::shared_ptr<amf::Element > > parseOflaDemoRequest(amf::Buffer &buf)
78
{ return parseOflaDemoRequest(buf.reference(), buf.size()); };
79
std::vector<boost::shared_ptr<amf::Element > > parseOflaDemoRequest(boost::uint8_t *buf, size_t size);
81
// format a response to the 'oflaDemo' test used for testing Gnash.
82
boost::shared_ptr<amf::Buffer> formatOflaDemoResponse(double num, amf::Element &el);
83
boost::shared_ptr<amf::Buffer> formatOflaDemoResponse(double num, amf::Buffer &data);
84
boost::shared_ptr<amf::Buffer> formatOflaDemoResponse(double num, boost::uint8_t *data, size_t size);
86
boost::shared_ptr<amf::Buffer> getResponse() { return _response; };
87
void setResponse(boost::shared_ptr<amf::Buffer> &x) { _response = x; };
89
void setNetConnection(gnash::RTMPMsg *msg) { _netconnect.reset(msg); };
90
void setNetConnection(boost::shared_ptr<gnash::RTMPMsg> msg) { _netconnect = msg; };
91
boost::shared_ptr<gnash::RTMPMsg> getNetConnection() { return _netconnect;};
94
/// This store the data from the NetConnection ActionScript
95
/// object we get as the final part of the handshake process
96
/// that is used to set up the connection. This has all the
97
/// file paths and other information needed by the server.
98
boost::shared_ptr<gnash::RTMPMsg> _netconnect;
100
boost::shared_ptr<amf::Buffer> _response;
101
boost::shared_ptr<Handler::cygnal_init_t> _info;
106
boost::shared_ptr<Handler::cygnal_init_t>oflaDemo_init_func(boost::shared_ptr<gnash::RTMPMsg> &msg);
108
boost::shared_ptr<amf::Buffer> oflaDemo_read_func();
109
size_t oflaDemo_write_func(boost::uint8_t *data, size_t size);
112
} // end of cygnal namespace
113
#endif // end of __FITCDEMO_H__
117
// indent-tabs-mode: t