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

rtmp_msg.h

Go to the documentation of this file.
00001 // 
00002 //   Copyright (C) 2006, 2007, 2008, 2009, 2010 Free Software
00003 //   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 _RTMPMSG_H_
00020 #define _RTMPMSG_H_
00021 
00022 #include <boost/cstdint.hpp>
00023 #include <string>
00024 #include <vector>
00025 
00026 #include "amf.h"
00027 #include "rtmp.h"
00028 #include "element.h"
00029 #include "network.h"
00030 #include "buffer.h"
00031 
00032 namespace gnash
00033 {
00034 
00035 class RTMPMsg
00036 {
00037 public:
00038     typedef enum {
00039         APP_GC,
00040         APP_RESOURCE_LOWMEMORY,
00041         APP_SCRIPT_ERROR,
00042         APP_SCRIPT_WARNING,
00043         APP_SHUTDOWN,
00044         NC_CALL_BADVERSION,
00045         NC_CALL_FAILED,
00046         NC_CONNECT_APPSHUTDOWN,
00047         NC_CONNECT_CLOSED,
00048         NC_CONNECT_FAILED,
00049         NC_CONNECT_INVALID_APPLICATION,
00050         NC_CONNECT_REJECTED,
00051         NC_CONNECT_SUCCESS,
00052         NS_CLEAR_FAILED,
00053         NS_CLEAR_SUCCESS,
00054         NS_DATA_START,
00055         NS_FAILED,
00056         NS_INVALID_ARGUMENT,
00057         NS_PAUSE_NOTIFY,
00058         NS_PLAY_COMPLETE,
00059         NS_PLAY_FAILED,
00060         NS_PLAY_FILE_STRUCTURE_INVALID,
00061         NS_PLAY_INSUFFICIENT_BW,
00062         NS_PLAY_NO_SUPPORTED_TRACK_FOUND,
00063         NS_PLAY_PUBLISHNOTIFY,
00064         NS_PLAY_RESET,
00065         NS_PLAY_START,
00066         NS_PLAY_STOP,
00067         NS_PLAY_STREAMNOTFOUND,
00068         NS_PLAY_SWITCH,
00069         NS_PLAY_UNPUBLISHNOTIFY,
00070         NS_PUBLISH_BADNAME,
00071         NS_PUBLISH_START,
00072         NS_RECORD_FAILED,
00073         NS_RECORD_NOACCESS,
00074         NS_RECORD_START,
00075         NS_RECORD_STOP,
00076         NS_SEEK_FAILED,
00077         NS_SEEK_NOTIFY,
00078         NS_UNPAUSE_NOTIFY,
00079         NS_UNPUBLISHED_SUCCESS,
00080         SO_CREATION_FAILED,
00081         SO_NO_READ_ACCESS,
00082         SO_NO_WRITE_ACCESS,
00083         SO_PERSISTENCE_MISMATCH,
00084         // Anything below here is specific to Gnash's implementation
00085         NS_CREATE_STREAM,
00086         NS_DELETE_STREAM
00087     } rtmp_status_e;
00088     typedef enum {
00089         FROM_CLIENT,                      // SWF player
00090         FROM_SERVER                      // Flash com server
00091     } rtmp_source_e;
00092     RTMPMsg();
00093     ~RTMPMsg();
00094     
00095     void addObject(boost::shared_ptr<cygnal::Element> el) { _amfobjs.push_back(el); };
00096     size_t size() { return _amfobjs.size(); };
00097     std::vector<boost::shared_ptr<cygnal::Element> > getElements() { return _amfobjs; };
00098 
00099     void setMethodName(const std::string &name) { _method = name; } ;
00100     std::string &getMethodName()         { return _method; };
00101 
00102     void setTransactionID(double num)         { _transid = num; };
00103     double getTransactionID()            { return _transid; };
00104 
00105     rtmp_status_e checkStatus(boost::shared_ptr<cygnal::Element> el);
00106     void setStatus(rtmp_status_e st)     { _status = st; };
00107     rtmp_status_e getStatus()            { return _status; };
00108 
00109     void setChannel(boost::uint8_t num) { _channel = num; };
00110     boost::uint8_t getChannel()         { return _channel; } ;
00111 
00112     boost::shared_ptr<cygnal::Element> operator[](size_t x);
00113     boost::shared_ptr<cygnal::Element> at(size_t x) { return _amfobjs[x]; };
00114 
00121     DSOEXPORT boost::shared_ptr<cygnal::Element> findProperty(const std::string &name);
00122 
00123 //    void setHeaderData(RTMP::rtmp_head_t &qhead);
00124                         
00125 // Dump internal status to the terminal
00126     DSOEXPORT void dump();
00127     
00128   protected:
00129     rtmp_source_e         _routing;
00130     rtmp_status_e         _status;
00131     std::string           _method;
00132     double                _transid;
00133     std::vector<boost::shared_ptr<cygnal::Element> > _amfobjs;
00134     boost::uint8_t       _channel;
00135 };
00136 
00137 } // end of gnash namespace
00138 // end of _RTMPMSG_H_
00139 #endif
00140 
00141 // local Variables:
00142 // mode: C++
00143 // indent-tabs-mode: t
00144 // End:
00145 

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