[vlc-devel] [PATCH 04/33] chromecast: rename msg methods according to the receiver
Steve Lhomme
robux4 at videolabs.io
Wed Dec 23 12:58:23 CET 2015
---
modules/stream_out/chromecast/cast.cpp | 14 +++++++-------
modules/stream_out/chromecast/chromecast.h | 10 ++++++----
modules/stream_out/chromecast/chromecast_ctrl.cpp | 8 ++++----
3 files changed, 17 insertions(+), 15 deletions(-)
diff --git a/modules/stream_out/chromecast/cast.cpp b/modules/stream_out/chromecast/cast.cpp
index 52b0325..a7af449 100644
--- a/modules/stream_out/chromecast/cast.cpp
+++ b/modules/stream_out/chromecast/cast.cpp
@@ -314,10 +314,10 @@ static void Close(vlc_object_t *p_this)
case CHROMECAST_MEDIA_LOAD_SENT:
case CHROMECAST_APP_STARTED:
// Generate the close messages.
- p_sys->p_intf->msgClose(p_sys->p_intf->appTransportId);
+ p_sys->p_intf->msgReceiverClose(p_sys->p_intf->appTransportId);
// ft
case CHROMECAST_AUTHENTICATED:
- p_sys->p_intf->msgClose("receiver-0");
+ p_sys->p_intf->msgReceiverClose("receiver-0");
// Send the just added close messages.
sendMessages(p_stream);
// ft
@@ -597,7 +597,7 @@ static int processMessage(sout_stream_t *p_stream, const castchannel::CastMessag
vlc_mutex_locker locker(&p_sys->lock);
p_sys->i_status = CHROMECAST_AUTHENTICATED;
p_sys->p_intf->msgConnect("receiver-0");
- p_sys->p_intf->msgLaunch();
+ p_sys->p_intf->msgReceiverLaunchApp();
}
}
else if (namespace_ == "urn:x-cast:com.google.cast.tp.heartbeat")
@@ -653,7 +653,7 @@ static int processMessage(sout_stream_t *p_stream, const castchannel::CastMessag
{
p_sys->i_status = CHROMECAST_APP_STARTED;
p_sys->p_intf->msgConnect(p_sys->p_intf->appTransportId);
- p_sys->p_intf->msgLoad();
+ p_sys->p_intf->msgPlayerLoad();
p_sys->i_status = CHROMECAST_MEDIA_LOAD_SENT;
vlc_cond_signal(&p_sys->loadCommandCond);
}
@@ -666,7 +666,7 @@ static int processMessage(sout_stream_t *p_stream, const castchannel::CastMessag
case CHROMECAST_APP_STARTED:
case CHROMECAST_MEDIA_LOAD_SENT:
msg_Warn(p_stream, "app is no longer present. closing");
- p_sys->p_intf->msgClose(p_sys->p_intf->appTransportId);
+ p_sys->p_intf->msgReceiverClose(p_sys->p_intf->appTransportId);
p_sys->i_status = CHROMECAST_CONNECTION_DEAD;
// ft
default:
@@ -699,7 +699,7 @@ static int processMessage(sout_stream_t *p_stream, const castchannel::CastMessag
else if (type == "LOAD_FAILED")
{
msg_Err(p_stream, "Media load failed");
- p_sys->p_intf->msgClose(p_sys->p_intf->appTransportId);
+ p_sys->p_intf->msgReceiverClose(p_sys->p_intf->appTransportId);
vlc_mutex_lock(&p_sys->lock);
p_sys->i_status = CHROMECAST_CONNECTION_DEAD;
vlc_mutex_unlock(&p_sys->lock);
@@ -791,7 +791,7 @@ static void* chromecastThread(void* p_data)
if (b_pingTimeout)
{
p_sys->p_intf->msgPing();
- p_sys->p_intf->msgStatus();
+ p_sys->p_intf->msgReceiverGetStatus();
}
if (b_msgReceived)
diff --git a/modules/stream_out/chromecast/chromecast.h b/modules/stream_out/chromecast/chromecast.h
index aaf8497..7c35e33 100644
--- a/modules/stream_out/chromecast/chromecast.h
+++ b/modules/stream_out/chromecast/chromecast.h
@@ -57,13 +57,15 @@ struct intf_sys_t
std::string appTransportId;
void msgAuth();
- void msgClose(std::string destinationId);
+ void msgReceiverClose(std::string destinationId);
void msgPing();
void msgPong();
void msgConnect(std::string destinationId);
- void msgLaunch();
- void msgLoad();
- void msgStatus();
+
+ void msgReceiverLaunchApp();
+ void msgReceiverGetStatus();
+
+ void msgPlayerLoad();
std::queue<castchannel::CastMessage> messagesToSend;
unsigned i_requestId;
diff --git a/modules/stream_out/chromecast/chromecast_ctrl.cpp b/modules/stream_out/chromecast/chromecast_ctrl.cpp
index 5c7e3d9..0a5e506 100644
--- a/modules/stream_out/chromecast/chromecast_ctrl.cpp
+++ b/modules/stream_out/chromecast/chromecast_ctrl.cpp
@@ -126,7 +126,7 @@ void intf_sys_t::msgConnect(std::string destinationId)
}
-void intf_sys_t::msgClose(std::string destinationId)
+void intf_sys_t::msgReceiverClose(std::string destinationId)
{
std::string s("{\"type\":\"CLOSE\"}");
castchannel::CastMessage msg = buildMessage("urn:x-cast:com.google.cast.tp.connection",
@@ -135,7 +135,7 @@ void intf_sys_t::msgClose(std::string destinationId)
messagesToSend.push(msg);
}
-void intf_sys_t::msgStatus()
+void intf_sys_t::msgReceiverGetStatus()
{
std::stringstream ss;
ss << "{\"type\":\"GET_STATUS\"}";
@@ -146,7 +146,7 @@ void intf_sys_t::msgStatus()
messagesToSend.push(msg);
}
-void intf_sys_t::msgLaunch()
+void intf_sys_t::msgReceiverLaunchApp()
{
std::stringstream ss;
ss << "{\"type\":\"LAUNCH\","
@@ -160,7 +160,7 @@ void intf_sys_t::msgLaunch()
}
-void intf_sys_t::msgLoad()
+void intf_sys_t::msgPlayerLoad()
{
char *psz_mime = var_GetNonEmptyString(p_stream, SOUT_CFG_PREFIX "mime");
if (psz_mime == NULL)
--
2.6.3
More information about the vlc-devel
mailing list