]> git.0d.be Git - empathy.git/commitdiff
Enable echo cancellation if needed
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Mon, 15 Aug 2011 10:27:22 +0000 (12:27 +0200)
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Mon, 15 Aug 2011 12:39:44 +0000 (14:39 +0200)
libempathy-gtk/empathy-call-utils.c

index 333d9026768e464b13acb6f62b2c260bcce131a9..c5e88ec80b634f88d7d5e9bb2607eeddf82456a9 100644 (file)
@@ -30,6 +30,7 @@
 
 #include "empathy-call-utils.h"
 
+#include <libempathy/empathy-gsettings.h>
 #include <libempathy/empathy-request-util.h>
 
 #define DEBUG_FLAG EMPATHY_DEBUG_OTHER
@@ -197,9 +198,22 @@ void
 empathy_call_set_stream_properties (GstElement *element)
 {
   GstStructure *props;
+  GSettings *gsettings_call;
+  gboolean echo_cancellation;
+  gchar *tmp;
 
-  props = gst_structure_from_string (
-      "props,media.role=phone", NULL);
+  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_from_string (tmp, NULL);
   g_object_set (element, "stream-properties", props, NULL);
   gst_structure_free (props);
+
+  g_free (tmp);
+  g_object_unref (gsettings_call);
 }