gnash-commit
[Top][All Lists]
Advanced

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

[Gnash-commit] /srv/bzr/gnash/rtmp r9981: create the responses for NetSt


From: rob
Subject: [Gnash-commit] /srv/bzr/gnash/rtmp r9981: create the responses for NetStream::Play() and NetStream::Reset().
Date: Tue, 10 Feb 2009 20:24:33 +0100
User-agent: Bazaar (1.5)

------------------------------------------------------------
revno: 9981
committer: address@hidden
branch nick: rtmp
timestamp: Tue 2009-02-10 20:24:33 +0100
message:
  create the responses for NetStream::Play() and NetStream::Reset().
modified:
  cygnal/rtmp_server.cpp
  cygnal/rtmp_server.h
=== modified file 'cygnal/rtmp_server.cpp'
--- a/cygnal/rtmp_server.cpp    2009-02-10 16:30:41 +0000
+++ b/cygnal/rtmp_server.cpp    2009-02-10 19:24:33 +0000
@@ -373,6 +373,13 @@
 }
     
 boost::shared_ptr<amf::Buffer> 
+RTMPServer::encodeResult(gnash::RTMPMsg::rtmp_status_e status, const 
std::string &filename)
+{
+//    GNASH_REPORT_FUNCTION;
+    return encodeResult(status, filename, 0.0);
+}
+
+boost::shared_ptr<amf::Buffer> 
 RTMPServer::encodeResult(gnash::RTMPMsg::rtmp_status_e status, const 
std::string &filename, double clientid)
 {
 //    GNASH_REPORT_FUNCTION;
@@ -483,24 +490,28 @@
          level->makeString("level", "status");
          top.addProperty(level);
 
-         boost::shared_ptr<amf::Element> description(new Element);
-         string field = "Started playing ";
-         if (!filename.empty()) {
-             field + filename;
-         }
-         description->makeString("description", "Started playing");
-         top.addProperty(description);
-         
-         boost::shared_ptr<amf::Element> details(new Element);
-         details->makeString("details", filename);
-         top.addProperty(details);
-         
          boost::shared_ptr<amf::Element> code(new Element);
          code->makeString("code", "NetStream.Play.Reset");
          top.addProperty(code);
+
+         boost::shared_ptr<amf::Element> description(new Element);
+         string field = "Started playing ";
+         if (!filename.empty()) {
+             field + filename;
+         }
+         description->makeString("description", "Started playing");
+         top.addProperty(description);
+         
+         boost::shared_ptr<amf::Element> details(new Element);
+         details->makeString("details", filename);
+         top.addProperty(details);
+         
+         boost::shared_ptr<amf::Element> cid(new Element);
+         code->makeNumber("clientid", clientid);
+         top.addProperty(cid);
+
          break;
       }
-         break;
       case RTMPMsg::NS_PLAY_START:
       {
          str->makeString("onStatus");
@@ -509,21 +520,26 @@
          level->makeString("level", "status");
          top.addProperty(level);
 
-         boost::shared_ptr<amf::Element> description(new Element);
-         string field = "Started playing ";
-         if (!filename.empty()) {
-             field + filename;
-         }
-         description->makeString("description", "Started playing");
-         top.addProperty(description);
-         
-         boost::shared_ptr<amf::Element> details(new Element);
-         details->makeString("details", filename);
-         top.addProperty(details);
-         
          boost::shared_ptr<amf::Element> code(new Element);
          code->makeString("code", "NetStream.Play.Start");
          top.addProperty(code);
+
+         boost::shared_ptr<amf::Element> description(new Element);
+         string field = "Started playing ";
+         if (!filename.empty()) {
+             field + filename;
+         }
+         description->makeString("description", "Started playing");
+         top.addProperty(description);
+         
+         boost::shared_ptr<amf::Element> details(new Element);
+         details->makeString("details", filename);
+         top.addProperty(details);
+         
+         boost::shared_ptr<amf::Element> cid(new Element);
+         code->makeNumber("clientid", clientid);
+         top.addProperty(cid);
+
          break;
       }
       case RTMPMsg::NS_PLAY_STOP:
@@ -984,8 +1000,9 @@
                                    if (body->getMethodName() == "play") {
                                        double streamid  = body->getStreamID();
                                        log_debug("The streamID from 
NetStream::plays: %d", streamid);
+                                       filespec = body->at(1)->to_string();
                                        response_head_size = RTMP::HEADER_8;
-                                       response = 
rtmp->encodeResult(RTMPMsg::NS_PLAY_START);
+                                       response = 
rtmp->encodeResult(RTMPMsg::NS_PLAY_START, filespec);
                                        body->dump();
                                    }
                                    if (body->getMethodName() == "recData") {

=== modified file 'cygnal/rtmp_server.h'
--- a/cygnal/rtmp_server.h      2009-02-10 16:30:41 +0000
+++ b/cygnal/rtmp_server.h      2009-02-10 19:24:33 +0000
@@ -47,6 +47,7 @@
     
     // These are handlers for the various types
     boost::shared_ptr<amf::Buffer> encodeResult(gnash::RTMPMsg::rtmp_status_e 
status);
+    boost::shared_ptr<amf::Buffer> encodeResult(gnash::RTMPMsg::rtmp_status_e 
status, const std::string &filename);
     boost::shared_ptr<amf::Buffer> encodeResult(gnash::RTMPMsg::rtmp_status_e 
status, const std::string &filename, double clientid);
     boost::shared_ptr<amf::Buffer> encodePing(rtmp_ping_e type, 
boost::uint32_t milliseconds);
     boost::shared_ptr<amf::Buffer> encodePing(rtmp_ping_e type);


reply via email to

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