summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOlivier Crête <olivier.crete@collabora.com>2012-09-25 20:57:49 (GMT)
committerOlivier Crête <olivier.crete@collabora.com>2012-09-25 20:57:49 (GMT)
commitcd002a7f723229450968f8ea2664fd173a5047ad (patch)
treee2a2a7367eb5cb830fe1f40513c11e5000de0294
parent7d487ccde03cefe7938affe4c0f98360cef7ba8d (diff)
downloadtelepathy-farstream-cd002a7f723229450968f8ea2664fd173a5047ad.tar.gz
telepathy-farstream-cd002a7f723229450968f8ea2664fd173a5047ad.tar.xz
The relay-info is now a GPtrArray instead of a GValueArray
-rw-r--r--configure.ac4
-rw-r--r--telepathy-farstream/call-stream.c19
-rw-r--r--telepathy-farstream/stream.c21
3 files changed, 19 insertions, 25 deletions
diff --git a/configure.ac b/configure.ac
index 0fdc4bd..a6a2251 100644
--- a/configure.ac
+++ b/configure.ac
@@ -86,9 +86,9 @@ fi
CFLAGS="$CFLAGS -DGST_USE_UNSTABLE_API"
dnl Check for Glib
-PKG_CHECK_MODULES(GLIB, gobject-2.0 >= 2.30 glib-2.0 >= 2.30 gio-2.0)
+PKG_CHECK_MODULES(GLIB, gobject-2.0 >= 2.32 glib-2.0 >= 2.32 gio-2.0)
AC_DEFINE(GLIB_VERSION_MIN_REQUIRED, GLIB_VERSION_2_30, [Ignore post 2.30 deprecations])
-AC_DEFINE(GLIB_VERSION_MAX_ALLOWED, GLIB_VERSION_2_30, [Prevent post 2.30 APIs])
+AC_DEFINE(GLIB_VERSION_MAX_ALLOWED, GLIB_VERSION_2_32, [Prevent post 2.32 APIs])
AC_SUBST(GLIB_CFLAGS)
AC_SUBST(GLIB_LIBS)
diff --git a/telepathy-farstream/call-stream.c b/telepathy-farstream/call-stream.c
index d95a19f..6d3ef02 100644
--- a/telepathy-farstream/call-stream.c
+++ b/telepathy-farstream/call-stream.c
@@ -467,9 +467,7 @@ tf_call_stream_try_adding_fsstream (TfCallStream *self)
if (self->relay_info->len)
{
- GValueArray *fs_relay_info = g_value_array_new (0);
- GValue val = {0};
- g_value_init (&val, GST_TYPE_STRUCTURE);
+ GPtrArray *fs_relay_info = NULL;
for (i = 0; i < self->relay_info->len; i++)
{
@@ -507,21 +505,20 @@ tf_call_stream_try_adding_fsstream (TfCallStream *self)
gst_structure_set (s, "component", G_TYPE_UINT, component, NULL);
- g_value_take_boxed (&val, s);
+ if (!fs_relay_info)
+ fs_relay_info = g_ptr_array_new_with_free_func (
+ (GDestroyNotify)gst_structure_free);
- g_value_array_append (fs_relay_info, &val);
- g_value_reset (&val);
+ g_ptr_array_add (fs_relay_info, s);
}
- if (fs_relay_info->n_values)
+ if (fs_relay_info)
{
params[n_params].name = "relay-info";
- g_value_init (&params[n_params].value, G_TYPE_VALUE_ARRAY);
- g_value_set_boxed (&params[n_params].value, fs_relay_info);
+ g_value_init (&params[n_params].value, G_TYPE_PTR_ARRAY);
+ g_value_take_boxed (&params[n_params].value, fs_relay_info);
n_params++;
}
-
- g_value_array_free (fs_relay_info);
}
if (self->receiving_state == TP_STREAM_FLOW_STATE_PENDING_START)
diff --git a/telepathy-farstream/stream.c b/telepathy-farstream/stream.c
index 7959c12..1ee9237 100644
--- a/telepathy-farstream/stream.c
+++ b/telepathy-farstream/stream.c
@@ -943,9 +943,7 @@ get_all_properties_cb (TpProxy *proxy,
if (dbus_relay_info && dbus_relay_info->len)
{
- GValueArray *fs_relay_info = g_value_array_new (0);
- GValue val = {0};
- g_value_init (&val, GST_TYPE_STRUCTURE);
+ GPtrArray *fs_relay_info = NULL;
for (i = 0; i < dbus_relay_info->len; i++)
{
@@ -968,6 +966,10 @@ get_all_properties_cb (TpProxy *proxy,
if (!ip || !port || !username || !password)
continue;
+ if (!fs_relay_info)
+ fs_relay_info = g_ptr_array_new_with_free_func (
+ (GDestroyNotify) gst_structure_free);
+
s = gst_structure_new ("relay-info",
"ip", G_TYPE_STRING, ip,
"port", G_TYPE_UINT, port,
@@ -987,21 +989,16 @@ get_all_properties_cb (TpProxy *proxy,
DEBUG (stream, "Adding relay (%s) %s:%u %s:%s %u",
type, ip, port, username, password, component);
- g_value_take_boxed (&val, s);
-
- g_value_array_append (fs_relay_info, &val);
- g_value_reset (&val);
+ g_ptr_array_add (fs_relay_info, s);
}
- if (fs_relay_info->n_values)
+ if (fs_relay_info)
{
params[n_args].name = "relay-info";
- g_value_init (&params[n_args].value, G_TYPE_VALUE_ARRAY);
- g_value_set_boxed (&params[n_args].value, fs_relay_info);
+ g_value_init (&params[n_args].value, G_TYPE_PTR_ARRAY);
+ g_value_take_boxed (&params[n_args].value, fs_relay_info);
n_args++;
}
-
- g_value_array_free (fs_relay_info);
}
if (out_Properties && do_controlling)