[vlc-devel] [PATCH 13/33] chromecast: pass const references to buildMessage()

Steve Lhomme robux4 at videolabs.io
Wed Dec 23 12:58:32 CET 2015


---
 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 079d1c2..9f747df 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;
 
@@ -349,7 +350,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);
-- 
2.6.3



More information about the vlc-devel mailing list