diff options
author | Xavier Claessens <xavier.claessens@collabora.co.uk> | 2012-02-13 13:01:27 +0100 |
---|---|---|
committer | Xavier Claessens <xavier.claessens@collabora.co.uk> | 2012-02-13 13:01:27 +0100 |
commit | 89a7c78224a47b81b6ebc12a3be33b366f787f77 (patch) | |
tree | 2a8f826399d1e85c11dc8365cc960959ad4c54ee /examples/cm | |
parent | 7cdf37e9c5407e66615a15e0988f20b2223eb704 (diff) | |
download | telepathy-glib-89a7c78224a47b81b6ebc12a3be33b366f787f77.tar.gz |
Call unit test: Use Media base classes
To make it work, example CM needs to create an Endpoint and we
have to wait for it to be connected to get to ACTIVE state.
Diffstat (limited to 'examples/cm')
-rw-r--r-- | examples/cm/call/call-channel.c | 2 | ||||
-rw-r--r-- | examples/cm/call/call-channel.h | 4 | ||||
-rw-r--r-- | examples/cm/call/call-content.c | 2 | ||||
-rw-r--r-- | examples/cm/call/call-content.h | 4 | ||||
-rw-r--r-- | examples/cm/call/call-stream.c | 21 | ||||
-rw-r--r-- | examples/cm/call/call-stream.h | 5 |
6 files changed, 28 insertions, 10 deletions
diff --git a/examples/cm/call/call-channel.c b/examples/cm/call/call-channel.c index 26e10e82e..a5361dd7f 100644 --- a/examples/cm/call/call-channel.c +++ b/examples/cm/call/call-channel.c @@ -53,7 +53,7 @@ static void hold_iface_init (gpointer iface, gpointer data); G_DEFINE_TYPE_WITH_CODE (ExampleCallChannel, example_call_channel, - TP_TYPE_BASE_CALL_CHANNEL, + TP_TYPE_BASE_MEDIA_CALL_CHANNEL, G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_CHANNEL_INTERFACE_HOLD, hold_iface_init)) diff --git a/examples/cm/call/call-channel.h b/examples/cm/call/call-channel.h index 0bf55f57f..58c1db34c 100644 --- a/examples/cm/call/call-channel.h +++ b/examples/cm/call/call-channel.h @@ -53,11 +53,11 @@ GType example_call_channel_get_type (void); ExampleCallChannelClass)) struct _ExampleCallChannelClass { - TpBaseCallChannelClass parent_class; + TpBaseMediaCallChannelClass parent_class; }; struct _ExampleCallChannel { - TpBaseCallChannel parent; + TpBaseMediaCallChannel parent; ExampleCallChannelPrivate *priv; }; diff --git a/examples/cm/call/call-content.c b/examples/cm/call/call-content.c index 601104c22..2f81835bb 100644 --- a/examples/cm/call/call-content.c +++ b/examples/cm/call/call-content.c @@ -27,7 +27,7 @@ G_DEFINE_TYPE (ExampleCallContent, example_call_content, - TP_TYPE_BASE_CALL_CONTENT) + TP_TYPE_BASE_MEDIA_CALL_CONTENT) struct _ExampleCallContentPrivate { diff --git a/examples/cm/call/call-content.h b/examples/cm/call/call-content.h index 0a380af35..06a5a5415 100644 --- a/examples/cm/call/call-content.h +++ b/examples/cm/call/call-content.h @@ -58,13 +58,13 @@ GType example_call_content_get_type (void); ExampleCallContentClass)) struct _ExampleCallContentClass { - TpBaseCallContentClass parent_class; + TpBaseMediaCallContentClass parent_class; ExampleCallContentClassPrivate *priv; }; struct _ExampleCallContent { - TpBaseCallContent parent; + TpBaseMediaCallContent parent; ExampleCallContentPrivate *priv; }; diff --git a/examples/cm/call/call-stream.c b/examples/cm/call/call-stream.c index 7cd4b221d..c8fe4f28d 100644 --- a/examples/cm/call/call-stream.c +++ b/examples/cm/call/call-stream.c @@ -27,7 +27,7 @@ G_DEFINE_TYPE (ExampleCallStream, example_call_stream, - TP_TYPE_BASE_CALL_STREAM) + TP_TYPE_BASE_MEDIA_CALL_STREAM) enum { @@ -64,10 +64,26 @@ constructed (GObject *object) ExampleCallStream *self = EXAMPLE_CALL_STREAM (object); void (*chain_up) (GObject *) = ((GObjectClass *) example_call_stream_parent_class)->constructed; + static guint count = 0; + TpBaseConnection *conn; + TpDBusDaemon *dbus; + gchar *object_path; + TpCallStreamEndpoint *endpoint; if (chain_up != NULL) chain_up (object); + conn = tp_base_call_stream_get_connection ((TpBaseCallStream *) self); + dbus = tp_base_connection_get_dbus_daemon (conn); + object_path = g_strdup_printf ("%s/Endpoint%d", + tp_base_call_stream_get_object_path ((TpBaseCallStream *) self), + count++); + endpoint = tp_call_stream_endpoint_new (dbus, object_path, + TP_STREAM_TRANSPORT_TYPE_RAW_UDP, FALSE); + + tp_base_media_call_stream_add_endpoint ((TpBaseMediaCallStream *) self, + endpoint); + if (self->priv->locally_requested) { example_call_stream_change_direction (self, TRUE, TRUE); @@ -76,6 +92,9 @@ constructed (GObject *object) { example_call_stream_receive_direction_request (self, TRUE, TRUE); } + + g_object_unref (endpoint); + g_free (object_path); } static void diff --git a/examples/cm/call/call-stream.h b/examples/cm/call/call-stream.h index 0d705da2f..0b8b08dc5 100644 --- a/examples/cm/call/call-stream.h +++ b/examples/cm/call/call-stream.h @@ -56,14 +56,13 @@ GType example_call_stream_get_type (void); ExampleCallStreamClass)) struct _ExampleCallStreamClass { - TpBaseCallStreamClass parent_class; - TpDBusPropertiesMixinClass dbus_properties_class; + TpBaseMediaCallStreamClass parent_class; ExampleCallStreamClassPrivate *priv; }; struct _ExampleCallStream { - TpBaseCallStream parent; + TpBaseMediaCallStream parent; ExampleCallStreamPrivate *priv; }; |