diff options
author | Pekka Pessi <Pekka.Pessi@nokia.com> | 2011-01-27 13:51:52 +0200 |
---|---|---|
committer | Pekka Pessi <Pekka.Pessi@nokia.com> | 2011-02-01 19:13:17 +0200 |
commit | cebec8bb99a01106e86575385c2031c0ad08bacd (patch) | |
tree | 577229df97b6a71891770ba2c842ff20526c8141 | |
parent | 3d4b5f2fd3da0dee25d9b626f44a9d6bc3801876 (diff) |
Moved tp_asv_get_initial_audio and _video to ring-util
-rw-r--r-- | src/ring-media-manager.c | 27 | ||||
-rw-r--r-- | src/ring-util.c | 29 | ||||
-rw-r--r-- | src/ring-util.h | 8 |
3 files changed, 36 insertions, 28 deletions
diff --git a/src/ring-media-manager.c b/src/ring-media-manager.c index 71a9b11..2b7df39 100644 --- a/src/ring-media-manager.c +++ b/src/ring-media-manager.c @@ -498,33 +498,6 @@ ring_media_manager_add_capabilities(RingMediaManager *self, } /* ---------------------------------------------------------------------- */ -/* Initial media stuff */ - -static gboolean -tp_asv_get_initial_audio(GHashTable *properties, gboolean default_value) -{ - GValue *value = g_hash_table_lookup(properties, - TP_IFACE_CHANNEL_TYPE_STREAMED_MEDIA ".InitialAudio"); - - if (value && G_VALUE_HOLDS_BOOLEAN(value)) - return g_value_get_boolean(value); - else - return default_value; -} - -static gboolean -tp_asv_get_initial_video (GHashTable *properties, gboolean default_value) -{ - GValue *value = g_hash_table_lookup (properties, - TP_IFACE_CHANNEL_TYPE_STREAMED_MEDIA ".InitialVideo"); - - if (value && G_VALUE_HOLDS_BOOLEAN (value)) - return g_value_get_boolean (value); - else - return default_value; -} - -/* ---------------------------------------------------------------------- */ /* TpChannelManagerIface interface */ static GHashTable * diff --git a/src/ring-util.c b/src/ring-util.c index e143e41..e332fd3 100644 --- a/src/ring-util.c +++ b/src/ring-util.c @@ -29,6 +29,7 @@ #include <telepathy-glib/base-connection.h> #include <telepathy-glib/dbus-properties-mixin.h> #include <telepathy-glib/group-mixin.h> +#include <telepathy-glib/interfaces.h> #include <string.h> @@ -475,3 +476,31 @@ ring_channel_group_error_reason(GError *error) return TP_CHANNEL_GROUP_CHANGE_REASON_ERROR; } + +/* ---------------------------------------------------------------------- */ +/* Initial media stuff */ + +gboolean +tp_asv_get_initial_audio (GHashTable *properties, gboolean default_value) +{ + GValue *value = g_hash_table_lookup (properties, + TP_IFACE_CHANNEL_TYPE_STREAMED_MEDIA ".InitialAudio"); + + if (value && G_VALUE_HOLDS_BOOLEAN (value)) + return g_value_get_boolean (value); + else + return default_value; +} + +gboolean +tp_asv_get_initial_video (GHashTable *properties, gboolean default_value) +{ + GValue *value = g_hash_table_lookup (properties, + TP_IFACE_CHANNEL_TYPE_STREAMED_MEDIA ".InitialVideo"); + + if (value && G_VALUE_HOLDS_BOOLEAN (value)) + return g_value_get_boolean (value); + else + return default_value; +} + diff --git a/src/ring-util.h b/src/ring-util.h index cb1b4b9..df5c65c 100644 --- a/src/ring-util.h +++ b/src/ring-util.h @@ -1,5 +1,5 @@ /* - * ring-util.c - Miscellaneous utility functions +-util.c - Miscellaneous utility functions * * Copyright (C) 2007-2010 Nokia Corporation * @author Pekka Pessi <first.surname@nokia.com> @@ -93,6 +93,12 @@ ring_signal_disconnect (gpointer object, gulong id[1]) *id = 0; } +#define tp_asv_get_initial_audio ring_tp_asv_get_initial_audio +#define tp_asv_get_initial_video ring_tp_asv_get_initial_video + +gboolean tp_asv_get_initial_audio (GHashTable *asv, gboolean default_value); +gboolean tp_asv_get_initial_video (GHashTable *asv, gboolean default_value); + G_END_DECLS #endif /* #ifndef __RING_UTIL_H__*/ |