[vlc-commits] chromecast: pass const references to buildMessage()

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


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

chromecast: pass const references to buildMessage()

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

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

 modules/stream_out/chromecast/chromecast.h        |    7 ++++---
 modules/stream_out/chromecast/chromecast_ctrl.cpp |    9 +++++----
 2 files changed, 9 insertions(+), 7 deletions(-)

diff --git a/modules/stream_out/chromecast/chromecast.h b/modules/stream_out/chromecast/chromecast.h
index fe1656d..7f186da 100644
--- a/modules/stream_out/chromecast/chromecast.h
+++ b/modules/stream_out/chromecast/chromecast.h
@@ -114,9 +114,10 @@ struct intf_sys_t
 private:
     int sendMessage(castchannel::CastMessage &msg);
 
-    castchannel::CastMessage buildMessage(std::string namespace_,
-                                         castchannel::CastMessage_PayloadType payloadType,
-                                         std::string payload, std::string destinationId = DEFAULT_CHOMECAST_RECEIVER);
+    castchannel::CastMessage buildMessage(const std::string & namespace_,
+                                          castchannel::CastMessage_PayloadType payloadType,
+                                          const std::string & payload,
+                                          const std::string & destinationId = DEFAULT_CHOMECAST_RECEIVER);
 
     enum connection_status conn_status;
 
diff --git a/modules/stream_out/chromecast/chromecast_ctrl.cpp b/modules/stream_out/chromecast/chromecast_ctrl.cpp
index d775173..8734f9e 100644
--- a/modules/stream_out/chromecast/chromecast_ctrl.cpp
+++ b/modules/stream_out/chromecast/chromecast_ctrl.cpp
@@ -52,9 +52,10 @@
  * @param destinationId the destination idenifier
  * @return the generated CastMessage
  */
-castchannel::CastMessage intf_sys_t::buildMessage(std::string namespace_,
-                                                 castchannel::CastMessage_PayloadType payloadType,
-                                                 std::string payload, std::string destinationId)
+castchannel::CastMessage intf_sys_t::buildMessage(const std::string & namespace_,
+                                                  castchannel::CastMessage_PayloadType payloadType,
+                                                  const std::string & payload,
+                                                  const std::string & destinationId)
 {
     castchannel::CastMessage msg;
 
@@ -348,7 +349,7 @@ void intf_sys_t::msgPlayerLoad()
 
     free(psz_mime);
 
-    castchannel::CastMessage msg = buildMessage("urn:x-cast:com.google.cast.media",
+    castchannel::CastMessage msg = buildMessage(NAMESPACE_MEDIA,
         castchannel::CastMessage_PayloadType_STRING, ss.str(), appTransportId);
 
     messagesToSend.push(msg);



More information about the vlc-commits mailing list