[telepathy-gabble/master] Spawn a codec offer a result of an incoming call as well

Sjoerd Simons sjoerd.simons at collabora.co.uk
Tue Dec 29 05:34:50 PST 2009


---
 src/call-content.c |   28 +++++++++++++++++++++-------
 1 files changed, 21 insertions(+), 7 deletions(-)

diff --git a/src/call-content.c b/src/call-content.c
index 5f13598..ee902a4 100644
--- a/src/call-content.c
+++ b/src/call-content.c
@@ -238,11 +238,10 @@ gabble_call_content_set_property (GObject *object,
 static void
 gabble_call_content_constructed (GObject *obj)
 {
-  GabbleCallContentPrivate *priv;
+  GabbleCallContent *self = GABBLE_CALL_CONTENT (obj);
+  GabbleCallContentPrivate *priv = self->priv;
   DBusGConnection *bus;
 
-  priv = GABBLE_CALL_CONTENT (obj)->priv;
-
   /* register object on the bus */
   bus = tp_get_bus ();
   DEBUG ("Registering %s", priv->object_path);
@@ -262,6 +261,12 @@ gabble_call_content_constructed (GObject *obj)
 
       priv->streams = g_list_prepend (priv->streams, stream);
 
+      if (gabble_jingle_media_rtp_get_remote_codecs (
+          GABBLE_JINGLE_MEDIA_RTP (priv->content)) != NULL)
+        {
+          call_content_new_offer (self);
+        }
+
       gabble_signal_connect_weak (priv->content, "remote-codecs",
         G_CALLBACK (call_content_remote_codecs_cb),
         obj);
@@ -566,16 +571,17 @@ out:
 }
 
 static void
-call_content_remote_codecs_cb (GabbleJingleMediaRtp *media,
-    GList *codecs,
-    gpointer user_data)
+call_content_new_offer (GabbleCallContent *self)
 {
-  GabbleCallContent *self = GABBLE_CALL_CONTENT (user_data);
   GabbleCallContentPrivate *priv = self->priv;
+  GList *codecs;
   GHashTable *map;
   GPtrArray *arr;
   gchar *path;
 
+  codecs = gabble_jingle_media_rtp_get_remote_codecs (
+     GABBLE_JINGLE_MEDIA_RTP (priv->content));
+
   map = g_hash_table_new_full (g_direct_hash, g_direct_equal,
     NULL, (GDestroyNotify) g_ptr_array_unref);
 
@@ -597,3 +603,11 @@ call_content_remote_codecs_cb (GabbleJingleMediaRtp *media,
   g_hash_table_unref (map);
   g_free (path);
 }
+
+static void
+call_content_remote_codecs_cb (GabbleJingleMediaRtp *media,
+    GList *codecs,
+    gpointer user_data)
+{
+  call_content_new_offer (GABBLE_CALL_CONTENT (user_data));
+}
-- 
1.5.6.5




More information about the telepathy-commits mailing list