[empathy] manually build the GstStructure



commit f30d87c84aa426407521c619702277de754e4bb5
Author: Guillaume Desmottes <guillaume desmottes collabora co uk>
Date:   Mon Aug 15 15:13:27 2011 +0200

    manually build the GstStructure

 libempathy-gtk/empathy-call-utils.c |   16 +++++++++++-----
 1 files changed, 11 insertions(+), 5 deletions(-)
---
diff --git a/libempathy-gtk/empathy-call-utils.c b/libempathy-gtk/empathy-call-utils.c
index c5e88ec..eb01fe2 100644
--- a/libempathy-gtk/empathy-call-utils.c
+++ b/libempathy-gtk/empathy-call-utils.c
@@ -23,6 +23,7 @@
 #include <glib/gi18n.h>
 
 #include <gtk/gtk.h>
+#include <pulse/pulseaudio.h>
 
 #include <telepathy-glib/telepathy-glib.h>
 
@@ -200,20 +201,25 @@ empathy_call_set_stream_properties (GstElement *element)
   GstStructure *props;
   GSettings *gsettings_call;
   gboolean echo_cancellation;
-  gchar *tmp;
 
   gsettings_call = g_settings_new (EMPATHY_PREFS_CALL_SCHEMA);
 
   echo_cancellation = g_settings_get_boolean (gsettings_call,
       EMPATHY_PREFS_CALL_ECHO_CANCELLATION);
 
-  tmp = g_strdup_printf ("props,media.role=phone%s", echo_cancellation ?
-      ",filter.want=echo-cancel": "");
+  props = gst_structure_new ("props",
+      PA_PROP_MEDIA_ROLE, G_TYPE_STRING, "phone",
+      NULL);
+
+  if (echo_cancellation)
+    {
+      gst_structure_set (props,
+          "filter.want", G_TYPE_STRING, "echo-cancel",
+          NULL);
+    }
 
-  props = gst_structure_from_string (tmp, NULL);
   g_object_set (element, "stream-properties", props, NULL);
   gst_structure_free (props);
 
-  g_free (tmp);
   g_object_unref (gsettings_call);
 }



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]