From f9df0779b7e47fb350b88557d6891b1e8cbb9046 Mon Sep 17 00:00:00 2001 From: Fabrice Bellet Date: Thu, 30 Jun 2016 13:22:28 +0200 Subject: [PATCH] call-stream: fix endpoint and jingle transport states mapping Telepathy stream endpoint state and wocky jingle transport state are not equivalent, and should be translated. This fixes a bug where the media stream starts flowing late when the endpoints are fully connected, instead of earlier when the first connection candidates are found. --- src/call-stream.c | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/src/call-stream.c b/src/call-stream.c index 236f662..a167c38 100644 --- a/src/call-stream.c +++ b/src/call-stream.c @@ -253,10 +253,25 @@ _endpoint_state_changed_cb ( GParamSpec *spec, WockyJingleContent *content) { - TpMediaStreamState state; + WockyJingleTransportState state; /* We only care about connecting RTP, RTCP is optional */ - state = tp_call_stream_endpoint_get_state (endpoint, 1); + switch (tp_call_stream_endpoint_get_state (endpoint, 1)) + { + case TP_STREAM_ENDPOINT_STATE_CONNECTING: + state = WOCKY_JINGLE_TRANSPORT_STATE_CONNECTING; + break; + case TP_STREAM_ENDPOINT_STATE_PROVISIONALLY_CONNECTED: + case TP_STREAM_ENDPOINT_STATE_FULLY_CONNECTED: + state = WOCKY_JINGLE_TRANSPORT_STATE_CONNECTED; + break; + case TP_STREAM_ENDPOINT_STATE_EXHAUSTED_CANDIDATES: + case TP_STREAM_ENDPOINT_STATE_FAILED: + state = WOCKY_JINGLE_TRANSPORT_STATE_DISCONNECTED; + break; + default: + g_assert_not_reached (); + } wocky_jingle_content_set_transport_state (content, state); } -- 2.5.5