gnash-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gnash-commit] /srv/bzr/gnash/rtmp r9609: decode all onStatus, _error, a


From: rob
Subject: [Gnash-commit] /srv/bzr/gnash/rtmp r9609: decode all onStatus, _error, and _result message types.
Date: Wed, 27 Aug 2008 19:26:22 -0600
User-agent: Bazaar (1.5)

------------------------------------------------------------
revno: 9609
committer: address@hidden
branch nick: rtmp
timestamp: Wed 2008-08-27 19:26:22 -0600
message:
  decode all onStatus, _error, and _result message types.
modified:
  libnet/rtmp_msg.cpp
  libnet/rtmp_msg.h
=== modified file 'libnet/rtmp_msg.cpp'
--- a/libnet/rtmp_msg.cpp       2008-08-14 04:24:41 +0000
+++ b/libnet/rtmp_msg.cpp       2008-08-28 01:26:22 +0000
@@ -74,6 +74,10 @@
     
 }
 
+// All the result messages from the server are ASCII text, so they have to be 
parsed to
+// determine what really happened. We return the numerical equivalant for each 
_result,
+// error, or onStatus message, the actual data can be obtained from the 
Element.
+// 
 RTMPMsg::rtmp_status_e
 RTMPMsg::checkStatus(amf::Element * /* el */)
 {
@@ -97,18 +101,155 @@
                        value = child->to_string();
                        if (name == "code") {
 //                         log_debug("Name is: %s, Value is: %s", 
name.c_str(), value.c_str());
+                           // Error messages we get as the result of a 
NetConnection::connect()
                            if (value == "NetConnection.Connect.Success") {
                                _status = RTMPMsg::NC_CONNECT_SUCCESS;
                                return _status;
                            }
+                           if (value == "NetConnection.Call.Failed") {
+                               _status = RTMPMsg::NC_CALL_FAILED;
+                               return _status;
+                           }
+                           if (value == "NetConnection.Call.BadVersion") {
+                               _status = RTMPMsg::NC_CALL_BADVERSION;
+                               return _status;
+                           }
+                           if (value == "NetConnection.AppShutdown") {
+                               _status = RTMPMsg::NC_CONNECT_APPSHUTDOWN;
+                               return _status;
+                           }
                            if (value == "NetConnection.Connect.Failed") {
                                _status = RTMPMsg::NC_CONNECT_FAILED;
                                return _status;
                            }
-                           if (value == "NetConnection.Call.Failed") {
-                               _status = RTMPMsg::NC_CALL_FAILED;      
-                               return _status;
-                           }
+                           if (value == "NetConnection.Invalid.Application") {
+                               _status = 
RTMPMsg::NC_CONNECT_INVALID_APPLICATION;
+                               return _status;
+                           }
+                           if (value == "NetConnection.Connect.Rejected") {
+                               _status = RTMPMsg::NC_CONNECT_REJECTED;
+                               return _status;
+                           }
+                           
+                           // we get this and then the FLV file data is next
+                           if (value == "NetStream.Data.Start") {
+                               _status = RTMPMsg::NS_DATA_START;
+                               return _status;
+                           }
+                           // Error messages we get as the result of a 
NetStream::play()
+                           if (value == "NetStream.Pause.Notify") {
+                               _status = RTMPMsg::NS_PAUSE_NOTIFY;
+                               return _status;
+                           }
+                           if (value == "NetStream.Play.Complete") {
+                               _status = RTMPMsg::NS_PLAY_COMPLETE;
+                               return _status;
+                           }
+                           if (value == "NetStream.Play.Failed") {
+                               _status = RTMPMsg::NS_PLAY_FAILED;
+                               return _status;
+                           }
+                           if (value == 
"NetStream.Play.File.Structure.Invalid") {
+                               _status = 
RTMPMsg::NS_PLAY_FILE_STRUCTURE_INVALID;
+                               return _status;
+                           }
+                           if (value == "NetStream.Play.Insufficient.BW") {
+                               _status = RTMPMsg::NS_PLAY_INSUFFICIENT_BW;
+                               return _status;
+                           }
+                           if (value == 
"NetStream.Play.No.Supported.Track.Found") {
+                               _status = 
RTMPMsg::NS_PLAY_NO_SUPPORTED_TRACK_FOUND;
+                               return _status;
+                           }
+                           if (value == "NetStream.Play.PublishNotify") {
+                               _status = RTMPMsg::NS_PLAY_PUBLISHNOTIFY;
+                               return _status;
+                           }
+                           if (value == "NetStream.Play.StreamNotFound") {
+                               _status = RTMPMsg::NS_PLAY_STREAMNOTFOUND;
+                               return _status;
+                           }
+                           if (value == "NetStream.Play.SWITCH") {
+                               _status = RTMPMsg::NS_PLAY_SWITCH;
+                               return _status;
+                           }
+                           if (value == "NetStream.Play.UnpublishNotify") {
+                               _status = RTMPMsg::NS_PLAY_UNPUBLISHNOTIFY;
+                               return _status;
+                           }
+                           if (value == "NetStream.Play.Start") {
+                               _status = RTMPMsg::NS_PLAY_START;
+                               return _status;
+                           }
+                           if (value == "NetStream.Play.Stop") {
+                               _status = RTMPMsg::NS_PLAY_STOP;
+                               return _status;
+                           }
+                           if (value == "NetStream.Play.Reset") {
+                               _status = RTMPMsg::NS_PLAY_RESET;
+                               return _status;
+                           }
+                           if (value == "NetStream.Publish.Badname") {
+                               _status = RTMPMsg::NS_PUBLISH_BADNAME;
+                               return _status;
+                           }
+                           if (value == "NetStream.Publish.Start") {
+                               _status = RTMPMsg::NS_PUBLISH_START;
+                               return _status;
+                           }
+
+                           if (value == "NetStream.Record.Failed") {
+                               _status = RTMPMsg::NS_RECORD_FAILED;
+                               return _status;
+                           }
+                           if (value == "NetStream.Record.Noaccess") {
+                               _status = RTMPMsg::NS_RECORD_NOACCESS;
+                               return _status;
+                           }
+                           if (value == "NetStream.Record.Start") {
+                               _status = RTMPMsg::NS_RECORD_START;
+                               return _status;
+                           }
+                           if (value == "NetStream.Record.Stop") {
+                               _status = RTMPMsg::NS_RECORD_STOP;
+                               return _status;
+                           }
+                           if (value == "NetStream.Seek.Failed") {
+                               _status = RTMPMsg::NS_SEEK_FAILED;
+                               return _status;
+                           }
+                           if (value == "NetStream.Seek.NOTIFY") {
+                               _status = RTMPMsg::NS_SEEK_NOTIFY;
+                               return _status;
+                           }
+                           if (value == "NetStream.Unpause.Notify") {
+                               _status = RTMPMsg::NS_UNPAUSE_NOTIFY;
+                               return _status;
+                           }
+                           if (value == "NetStream.Unpublished.Success") {
+                               _status = RTMPMsg::NS_UNPUBLISHED_SUCCESS;
+                               return _status;
+                           }
+
+                           // Error messages we get as the result of a 
SharedObject operation
+                           if (value == "SharedObject.Creation.Failed") {
+                               _status = RTMPMsg::SO_CREATION_FAILED;
+                               return _status;
+                           }
+                           if (value == "SharedObject.No.Read.Access") {
+                               _status = RTMPMsg::SO_NO_READ_ACCESS;
+                               return _status;
+                           }
+                           if (value == "SharedObject.No.Write.Access") {
+                               _status = RTMPMsg::SO_NO_WRITE_ACCESS;
+                               return _status;
+                           }
+                           if (value == "SharedObject.Persistence.Mismatch") {
+                               _status = RTMPMsg::SO_PERSISTENCE_MISMATCH;
+                               return _status;
+                           }
+                           
+
                        }
                    }
                }
@@ -118,6 +259,17 @@
     return _status;
 }
 
+Element *
+RTMPMsg::operator[](size_t index)
+{
+//    GNASH_REPORT_FUNCTION;
+    if (index <= _amfobjs.size()) {
+       return _amfobjs[index];
+    }
+    
+    return 0;
+};
+
 void
 RTMPMsg::dump()
 {

=== modified file 'libnet/rtmp_msg.h'
--- a/libnet/rtmp_msg.h 2008-08-14 04:24:41 +0000
+++ b/libnet/rtmp_msg.h 2008-08-28 01:26:22 +0000
@@ -106,7 +106,8 @@
     void setChannel(Network::byte_t num) { _channel = num; };
     Network::byte_t getChannel()         { return _channel; } ;
 
-    
+    amf::Element *operator[](size_t x);
+
     // Dump internal status to the terminal
     void dump();
     


reply via email to

[Prev in Thread] Current Thread [Next in Thread]