[Telepathy-commits] [telepathy-glib/master] ExampleCallableMediaStream: add stream-info property containing part of a ListStreams result

Simon McVittie simon.mcvittie at collabora.co.uk
Wed Mar 11 06:57:36 PDT 2009


---
 examples/cm/callable/media-stream.c |   30 ++++++++++++++++++++++++++++++
 1 files changed, 30 insertions(+), 0 deletions(-)

diff --git a/examples/cm/callable/media-stream.c b/examples/cm/callable/media-stream.c
index 744ad57..aa1afbb 100644
--- a/examples/cm/callable/media-stream.c
+++ b/examples/cm/callable/media-stream.c
@@ -26,6 +26,7 @@
 #include "media-stream.h"
 
 #include <telepathy-glib/base-connection.h>
+#include <telepathy-glib/gtypes.h>
 
 #include "media-channel.h"
 
@@ -42,6 +43,7 @@ enum
   PROP_STATE,
   PROP_PENDING_SEND,
   PROP_DIRECTION,
+  PROP_STREAM_INFO,
   N_PROPS
 };
 
@@ -144,6 +146,28 @@ get_property (GObject *object,
       g_value_set_object (value, self->priv->channel);
       break;
 
+    case PROP_STREAM_INFO:
+        {
+          GValueArray *va = g_value_array_new (6);
+          guint i;
+
+          for (i = 0; i < 6; i++)
+            {
+              g_value_array_append (va, NULL);
+              g_value_init (va->values + i, G_TYPE_UINT);
+            }
+
+          g_value_set_uint (va->values + 0, self->priv->id);
+          g_value_set_uint (va->values + 1, self->priv->handle);
+          g_value_set_uint (va->values + 2, self->priv->type);
+          g_value_set_uint (va->values + 3, self->priv->state);
+          g_value_set_uint (va->values + 4, self->priv->direction);
+          g_value_set_uint (va->values + 5, self->priv->pending_send);
+
+          g_value_take_boxed (value, va);
+        }
+      break;
+
     default:
       G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
       break;
@@ -269,6 +293,12 @@ example_callable_media_stream_class_init (ExampleCallableMediaStreamClass *klass
       G_PARAM_READABLE | G_PARAM_STATIC_STRINGS);
   g_object_class_install_property (object_class, PROP_PENDING_SEND, param_spec);
 
+  param_spec = g_param_spec_boxed ("stream-info", "Stream info",
+      "6-entry GValueArray as returned by ListStreams and RequestStreams",
+      TP_STRUCT_TYPE_MEDIA_STREAM_INFO,
+      G_PARAM_READABLE | G_PARAM_STATIC_STRINGS);
+  g_object_class_install_property (object_class, PROP_STREAM_INFO, param_spec);
+
   signals[SIGNAL_REMOVED] = g_signal_new ("removed",
       G_TYPE_FROM_CLASS (klass), G_SIGNAL_RUN_LAST, 0, NULL, NULL,
       g_cclosure_marshal_VOID__VOID,
-- 
1.5.6.5




More information about the telepathy-commits mailing list