[vlc-commits] chromecast: GET_STATUS and LAUNCH require a request ID

Steve Lhomme git at videolan.org
Wed Dec 23 20:28:25 CET 2015


vlc | branch: master | Steve Lhomme <robUx4 at videolabs.io> | Wed Dec 23 12:58:37 2015 +0100| [ad959d9071b92360bb17c59de5d8ce38e35219f6] | committer: Jean-Baptiste Kempf

chromecast: GET_STATUS and LAUNCH require a request ID

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=ad959d9071b92360bb17c59de5d8ce38e35219f6
---

 modules/stream_out/chromecast/chromecast.h        |    1 +
 modules/stream_out/chromecast/chromecast_ctrl.cpp |    8 +++++---
 2 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/modules/stream_out/chromecast/chromecast.h b/modules/stream_out/chromecast/chromecast.h
index 4db1f99..3a1087e 100644
--- a/modules/stream_out/chromecast/chromecast.h
+++ b/modules/stream_out/chromecast/chromecast.h
@@ -117,6 +117,7 @@ private:
 
     enum connection_status conn_status;
 
+    unsigned i_receiver_requestId;
     unsigned i_requestId;
 };
 
diff --git a/modules/stream_out/chromecast/chromecast_ctrl.cpp b/modules/stream_out/chromecast/chromecast_ctrl.cpp
index d29c1f9..3217e1f 100644
--- a/modules/stream_out/chromecast/chromecast_ctrl.cpp
+++ b/modules/stream_out/chromecast/chromecast_ctrl.cpp
@@ -39,7 +39,7 @@
 #include "../../misc/webservices/json.h"
 
 // Media player Chromecast app id
-#define APP_ID "CC1AD845" // Default media player
+#define APP_ID "CC1AD845" // Default media player aka DEFAULT_MEDIA_RECEIVER_APPLICATION_ID
 
 #define SOUT_CFG_PREFIX "sout-chromecast-"
 
@@ -81,6 +81,7 @@ intf_sys_t::intf_sys_t(sout_stream_t * const p_this)
  : p_stream(p_this)
  , p_tls(NULL)
  , conn_status(CHROMECAST_DISCONNECTED)
+ , i_receiver_requestId(0)
  , i_requestId(0)
 {
     vlc_mutex_init(&lock);
@@ -299,7 +300,8 @@ void intf_sys_t::msgReceiverClose(std::string destinationId)
 void intf_sys_t::msgReceiverGetStatus()
 {
     std::stringstream ss;
-    ss << "{\"type\":\"GET_STATUS\"}";
+    ss << "{\"type\":\"GET_STATUS\","
+       <<  "\"requestId\":" << i_receiver_requestId++ << "}";
 
     buildMessage(NAMESPACE_RECEIVER, ss.str());
 }
@@ -309,7 +311,7 @@ void intf_sys_t::msgReceiverLaunchApp()
     std::stringstream ss;
     ss << "{\"type\":\"LAUNCH\","
        <<  "\"appId\":\"" << APP_ID << "\","
-       <<  "\"requestId\":" << i_requestId++ << "}";
+       <<  "\"requestId\":" << i_receiver_requestId++ << "}";
 
     buildMessage(NAMESPACE_RECEIVER, ss.str());
 }



More information about the vlc-commits mailing list