[telepathy-gabble/master] Pass the GabbleConnection on to CallStream objects

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


---
 src/call-content.c |    2 ++
 src/call-stream.c  |   20 ++++++++++++++++++++
 2 files changed, 22 insertions(+), 0 deletions(-)

diff --git a/src/call-content.c b/src/call-content.c
index 115c66e..20f3bbf 100644
--- a/src/call-content.c
+++ b/src/call-content.c
@@ -34,6 +34,7 @@
 #include "call-content-codecoffer.h"
 #include "call-stream.h"
 #include "jingle-content.h"
+#include "jingle-session.h"
 #include "jingle-media-rtp.h"
 #include "connection.h"
 #include "util.h"
@@ -283,6 +284,7 @@ gabble_call_content_constructed (GObject *obj)
       path = g_strdup_printf ("%s/Stream%p", priv->object_path, priv->content);
       stream = g_object_new (GABBLE_TYPE_CALL_STREAM,
         "object-path", path,
+        "connection", priv->conn,
         "jingle-content", priv->content,
         NULL);
       g_free (path);
diff --git a/src/call-stream.c b/src/call-stream.c
index 34b8871..b52ec64 100644
--- a/src/call-stream.c
+++ b/src/call-stream.c
@@ -56,6 +56,7 @@ enum
 {
   PROP_OBJECT_PATH = 1,
   PROP_JINGLE_CONTENT,
+  PROP_CONNECTION,
 
   /* Media interface properties */
   PROP_LOCAL_CANDIDATES,
@@ -83,6 +84,7 @@ struct _GabbleCallStreamPrivate
   gboolean dispose_has_run;
 
   gchar *object_path;
+  GabbleConnection *conn;
   GabbleJingleContent *content;
   GList *endpoints;
   GPtrArray *relay_info;
@@ -113,6 +115,9 @@ gabble_call_stream_get_property (GObject    *object,
 
   switch (property_id)
     {
+      case PROP_CONNECTION:
+        g_value_set_object (value, priv->conn);
+        break;
       case PROP_OBJECT_PATH:
         g_value_set_string (value, priv->object_path);
         break;
@@ -244,6 +249,10 @@ gabble_call_stream_set_property (GObject *object,
 
   switch (property_id)
     {
+      case PROP_CONNECTION:
+        priv->conn = g_value_get_object (value);
+        g_assert (priv->conn != NULL);
+        break;
       case PROP_OBJECT_PATH:
         g_free (priv->object_path);
         priv->object_path = g_value_dup_string (value);
@@ -379,6 +388,12 @@ gabble_call_stream_class_init (GabbleCallStreamClass *gabble_call_stream_class)
       G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
   g_object_class_install_property (object_class, PROP_OBJECT_PATH, param_spec);
 
+  param_spec = g_param_spec_object ("connection", "GabbleConnection object",
+      "Gabble connection object that owns this call content",
+      GABBLE_TYPE_CONNECTION,
+      G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
+  g_object_class_install_property (object_class, PROP_CONNECTION, param_spec);
+
   param_spec = g_param_spec_object ("jingle-content", "Jingle Content",
       "The Jingle Content related to this content object",
       GABBLE_TYPE_JINGLE_CONTENT,
@@ -451,6 +466,11 @@ gabble_call_stream_dispose (GObject *object)
 
   priv->content = NULL;
 
+  if (priv->conn != NULL)
+    g_object_unref (priv->conn);
+
+  priv->conn = NULL;
+
   if (G_OBJECT_CLASS (gabble_call_stream_parent_class)->dispose)
     G_OBJECT_CLASS (gabble_call_stream_parent_class)->dispose (object);
 }
-- 
1.5.6.5




More information about the telepathy-commits mailing list