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
00019 #ifndef _FITCDEMO_H_
00020 #define _FITCDEMO_H_
00021
00022 #include <string>
00023 #include <vector>
00024 #include <boost/shared_ptr.hpp>
00025 #include <boost/shared_array.hpp>
00026 #include <boost/scoped_array.hpp>
00027 #include <sstream>
00028
00029
00030 #include "amf.h"
00031 #include "buffer.h"
00032 #include "element.h"
00033 #include "http.h"
00034 #include "cygnal.h"
00035
00036
00037 #include "rtmp_server.h"
00038
00039 namespace cygnal
00040 {
00041
00045 class demoService {
00046 public:
00047
00048 typedef struct {
00049 std::string name;
00050 std::string last;
00051 std::string size;
00052 } filestats_t ;
00053 demoService();
00054 ~demoService();
00055
00057 std::vector<boost::shared_ptr<filestats_t> > &getListOfAvailableFiles(const std::string &path);
00058
00060 std::vector<boost::shared_ptr<filestats_t> > &getListOfAvailableFiles(const std::string &path,
00061 const std::string &type);
00062 std::vector<boost::shared_ptr<filestats_t> > &getFileStats() { return _stats; };
00063
00064 private:
00065 std::string _path;
00066 std::vector<boost::shared_ptr<filestats_t> > _stats;
00067 };
00068
00069 class OflaDemoTest : public cygnal::RTMPServer
00070 {
00071 public:
00072 OflaDemoTest ();
00073 ~OflaDemoTest ();
00074
00075
00076 std::vector<boost::shared_ptr<cygnal::Element > > parseOflaDemoRequest(cygnal::Buffer &buf)
00077 { return parseOflaDemoRequest(buf.reference(), buf.size()); };
00078 std::vector<boost::shared_ptr<cygnal::Element > > parseOflaDemoRequest(boost::uint8_t *buf, size_t size);
00079
00080
00081 boost::shared_ptr<cygnal::Buffer> formatOflaDemoResponse(double num, cygnal::Element &el);
00082 boost::shared_ptr<cygnal::Buffer> formatOflaDemoResponse(double num, cygnal::Buffer &data);
00083 boost::shared_ptr<cygnal::Buffer> formatOflaDemoResponse(double num, boost::uint8_t *data, size_t size);
00084
00085 boost::shared_ptr<cygnal::Buffer> getResponse() { return _response; };
00086 void setResponse(boost::shared_ptr<cygnal::Buffer> &x) { _response = x; };
00087
00088 void setNetConnection(gnash::RTMPMsg *msg) { _netconnect.reset(msg); };
00089 void setNetConnection(boost::shared_ptr<gnash::RTMPMsg> msg) { _netconnect = msg; };
00090 boost::shared_ptr<gnash::RTMPMsg> getNetConnection() { return _netconnect;};
00091
00097 boost::shared_ptr<gnash::RTMPMsg> _netconnect;
00098 private:
00099 boost::shared_ptr<cygnal::Buffer> _response;
00100 boost::shared_ptr<Handler::cygnal_init_t> _info;
00101 };
00102
00103
00104 extern "C" {
00105 boost::shared_ptr<Handler::cygnal_init_t>oflaDemo_init_func(boost::shared_ptr<gnash::RTMPMsg> &msg);
00106
00107 boost::shared_ptr<cygnal::Buffer> oflaDemo_read_func();
00108 size_t oflaDemo_write_func(boost::uint8_t *data, size_t size);
00109 }
00110
00111 }
00112 #endif // end of __FITCDEMO_H__
00113
00114
00115
00116
00117