[vlc-commits] chromecast: better and less logs

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


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

chromecast: better and less logs

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

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

 modules/stream_out/chromecast/chromecast_ctrl.cpp |   22 ++++++++++++++-------
 1 file changed, 15 insertions(+), 7 deletions(-)

diff --git a/modules/stream_out/chromecast/chromecast_ctrl.cpp b/modules/stream_out/chromecast/chromecast_ctrl.cpp
index d703ab7..de620d3 100644
--- a/modules/stream_out/chromecast/chromecast_ctrl.cpp
+++ b/modules/stream_out/chromecast/chromecast_ctrl.cpp
@@ -225,6 +225,10 @@ void intf_sys_t::processMessage(const castchannel::CastMessage &msg)
 {
     const std::string & namespace_ = msg.namespace_();
 
+#ifndef NDEBUG
+    msg_Dbg(p_stream,"processMessage: %s->%s %s", namespace_.c_str(), msg.destination_id().c_str(), msg.payload_utf8().c_str());
+#endif
+
     if (namespace_ == NAMESPACE_DEVICEAUTH)
     {
         castchannel::DeviceAuthMessage authMessage;
@@ -262,7 +266,7 @@ void intf_sys_t::processMessage(const castchannel::CastMessage &msg)
         }
         else
         {
-            msg_Err(p_stream, "Heartbeat command not supported: %s", type.c_str());
+            msg_Warn(p_stream, "Heartbeat command not supported: %s", type.c_str());
         }
 
         json_value_free(p_data);
@@ -337,7 +341,7 @@ void intf_sys_t::processMessage(const castchannel::CastMessage &msg)
         }
         else
         {
-            msg_Err(p_stream, "Receiver command not supported: %s",
+            msg_Warn(p_stream, "Receiver command not supported: %s",
                     msg.payload_utf8().c_str());
         }
 
@@ -351,8 +355,9 @@ void intf_sys_t::processMessage(const castchannel::CastMessage &msg)
         if (type == "MEDIA_STATUS")
         {
             json_value status = (*p_data)["status"];
-            msg_Dbg(p_stream, "Player state: %s",
-                    status[0]["playerState"].operator const char *());
+            msg_Dbg(p_stream, "Player state: %s sessionId:%d",
+                    status[0]["playerState"].operator const char *(),
+                    (int)(json_int_t) status[0]["mediaSessionId"]);
         }
         else if (type == "LOAD_FAILED")
         {
@@ -360,11 +365,14 @@ void intf_sys_t::processMessage(const castchannel::CastMessage &msg)
             msgReceiverClose(appTransportId);
             vlc_mutex_lock(&lock);
             setConnectionStatus(CHROMECAST_CONNECTION_DEAD);
-            vlc_mutex_unlock(&lock);
+        }
+        else if (type == "INVALID_REQUEST")
+        {
+            msg_Dbg(p_stream, "We sent an invalid request reason:%s", (*p_data)["reason"].operator const char *());
         }
         else
         {
-            msg_Err(p_stream, "Media command not supported: %s",
+            msg_Warn(p_stream, "Media command not supported: %s",
                     msg.payload_utf8().c_str());
         }
 
@@ -385,7 +393,7 @@ void intf_sys_t::processMessage(const castchannel::CastMessage &msg)
         }
         else
         {
-            msg_Err(p_stream, "Connection command not supported: %s",
+            msg_Warn(p_stream, "Connection command not supported: %s",
                     type.c_str());
         }
     }



More information about the vlc-commits mailing list