[telepathy-gabble/master] Support parsing of rtcp candidates

Sjoerd Simons sjoerd.simons at collabora.co.uk
Thu Jun 25 09:59:41 PDT 2009


---
 src/jingle-transport-google.c |   35 +++++++++++++++++++++++++++++++++--
 1 files changed, 33 insertions(+), 2 deletions(-)

diff --git a/src/jingle-transport-google.c b/src/jingle-transport-google.c
index 21212d9..da0e1e8 100644
--- a/src/jingle-transport-google.c
+++ b/src/jingle-transport-google.c
@@ -236,11 +236,16 @@ parse_candidates (GabbleJingleTransportIface *obj,
   GabbleJingleTransportGooglePrivate *priv = t->priv;
   GList *candidates = NULL;
   LmMessageNode *node;
+  JingleMediaType media_type;
+  JingleDialect dialect;
+
+  g_object_get (priv->content, "media-type", &media_type, NULL);
+  g_object_get (priv->content->session, "dialect", &dialect, NULL);
 
   for (node = transport_node->children; node; node = node->next)
     {
       const gchar *name, *address, *user, *pass, *str;
-      guint port, net, gen, component = 1;
+      guint port, net, gen, component;
       gdouble pref;
       JingleTransportProtocol proto;
       JingleCandidateType ctype;
@@ -250,9 +255,35 @@ parse_candidates (GabbleJingleTransportIface *obj,
           continue;
 
       name = lm_message_node_get_attribute (node, "name");
-      if (name == NULL || tp_strdiff (name, "rtp"))
+      if (name == NULL)
           break;
 
+      if (g_str_has_prefix (name, "video_"))
+        {
+          if (media_type != JINGLE_MEDIA_TYPE_VIDEO)
+            continue;
+
+          if (!tp_strdiff (name, "video_rtp"))
+            component = 1;
+          else if (!tp_strdiff (name, "video_rtcp"))
+            component = 2;
+          else
+            break;
+        }
+      else
+        {
+          if (media_type != JINGLE_MEDIA_TYPE_AUDIO
+              && JINGLE_IS_GOOGLE_DIALECT (dialect))
+            continue;
+
+          if (!tp_strdiff (name, "rtp"))
+            component = 1;
+          else if (!tp_strdiff (name, "rtcp"))
+            component = 2;
+          else
+            break;
+        }
+
       address = lm_message_node_get_attribute (node, "address");
       if (address == NULL)
           break;
-- 
1.5.6.5




More information about the telepathy-commits mailing list