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

fitcDemo.h

Go to the documentation of this file.
00001 // Red5 server side support for the fitcDemo_test via RTMP
00002 // 
00003 //   Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc.
00004 // 
00005 // This program is free software; you can redistribute it and/or modify
00006 // it under the terms of the GNU General Public License as published by
00007 // the Free Software Foundation; either version 3 of the License, or
00008 // (at your option) any later version.
00009 // 
00010 // This program is distributed in the hope that it will be useful,
00011 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00012 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013 // GNU General Public License for more details.
00014 // 
00015 // You should have received a copy of the GNU General Public License
00016 // along with this program; if not, write to the Free Software
00017 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
00018 
00019 #ifndef _FITCDEMO_H_
00020 #define _FITCDEMO_H_
00021 
00022 #include <vector>
00023 #include <boost/shared_ptr.hpp>
00024 #include <boost/shared_array.hpp>
00025 #include <boost/scoped_array.hpp>
00026 #include <sstream>
00027 
00028 // gnash headers
00029 #include "amf.h"
00030 #include "buffer.h"
00031 #include "element.h"
00032 #include "http.h"
00033 #include "cygnal.h"
00034 
00035 // cygnal headers
00036 #include "rtmp_server.h"
00037 
00038 namespace cygnal
00039 {
00040     
00041 class FitcDemoTest : public cygnal::RTMPServer
00042 {
00043 public:
00044     FitcDemoTest ();
00045     ~FitcDemoTest ();
00046   
00047     // Parse an FitcDemo Request message coming from the Red5 fitcDemo_test.
00048     std::vector<boost::shared_ptr<amf::Element > > parseFitcDemoRequest(amf::Buffer &buf)
00049         { return parseFitcDemoRequest(buf.reference(), buf.size()); };
00050     std::vector<boost::shared_ptr<amf::Element > > parseFitcDemoRequest(boost::uint8_t *buf, size_t size);
00051     
00052     // format a response to the 'fitcDemo' test used for testing Gnash.
00053     boost::shared_ptr<amf::Buffer> formatFitcDemoResponse(double num, amf::Element &el);
00054     boost::shared_ptr<amf::Buffer> formatFitcDemoResponse(double num, amf::Buffer &data);
00055     boost::shared_ptr<amf::Buffer> formatFitcDemoResponse(double num, boost::uint8_t *data, size_t size);
00056 
00057     boost::shared_ptr<amf::Buffer> getResponse() { return _response; };
00058     void setResponse(boost::shared_ptr<amf::Buffer> &x) { _response = x; };
00059 
00060 private:
00061     boost::shared_ptr<amf::Buffer> _response;    
00062 };  
00063 
00064 extern "C" {
00065     boost::shared_ptr<Handler::cygnal_init_t> fitcDemo_class_init(); 
00066     // the standard API
00067     size_t fitcDemo_read_func(boost::uint8_t *data, size_t size);
00068     size_t fitcDemo_write_func(boost::uint8_t *data, size_t size);
00069 }
00070 
00071 } // end of cygnal namespace
00072 #endif  // end of __FITCDEMO_H__
00073 
00074 // local Variables:
00075 // mode: C++
00076 // indent-tabs-mode: t
00077 // End:

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