]> git.0d.be Git - empathy.git/blobdiff - src/empathy-audio-src.c
remove released flag
[empathy.git] / src / empathy-audio-src.c
index deff297d07d1b7dfb75df7362ee9ff2ea400b312..d77968b0d39dc62a2bf5ff0ccda0c5abdde4ceaa 100644 (file)
  */
 
 #include "config.h"
+#include "empathy-audio-src.h"
 
-#include <stdio.h>
-#include <stdlib.h>
+#include <tp-account-widgets/tpaw-utils.h>
 
-#include <gst/interfaces/streamvolume.h>
+#include <gst/audio/streamvolume.h>
 
-#include <libempathy/empathy-utils.h>
 #include "empathy-audio-utils.h"
-
-#include "empathy-audio-src.h"
-
 #include "empathy-mic-monitor.h"
+#include "empathy-utils.h"
 
 #define DEBUG_FLAG EMPATHY_DEBUG_VOIP
-#include <libempathy/empathy-debug.h>
+#include "empathy-debug.h"
 
 G_DEFINE_TYPE(EmpathyGstAudioSrc, empathy_audio_src, GST_TYPE_BIN)
 
@@ -248,7 +245,10 @@ create_src (void)
   /* Use pulsesrc as default */
   src = gst_element_factory_make ("pulsesrc", NULL);
   if (src == NULL)
-    return NULL;
+    {
+      g_warning ("Missing 'pulsesrc' element");
+      return NULL;
+    }
 
   empathy_audio_set_stream_properties (src, TRUE);
 
@@ -263,8 +263,6 @@ empathy_audio_src_init (EmpathyGstAudioSrc *obj)
 {
   EmpathyGstAudioSrcPrivate *priv = EMPATHY_GST_AUDIO_SRC_GET_PRIVATE (obj);
   GstPad *ghost, *src;
-  GstElement *capsfilter;
-  GstCaps *caps;
 
   obj->priv = priv;
   g_mutex_init (&priv->lock);
@@ -309,25 +307,30 @@ empathy_audio_src_init (EmpathyGstAudioSrc *obj)
 
   gst_bin_add (GST_BIN (obj), priv->src);
 
-  /* Explicitly state what format we want from pulsesrc. This pushes resampling
-   * and format conversion as early as possible, lowering the amount of data
-   * transferred and thus improving performance. When moving to GStreamer
-   * 0.11/1.0, this should change so that we actually request what the encoder
-   * wants downstream. */
-  caps = gst_caps_new_simple ("audio/x-raw-int",
-      "channels", G_TYPE_INT, 1,
-      "width", G_TYPE_INT, 16,
-      "depth", G_TYPE_INT, 16,
-      "rate", G_TYPE_INT, 32000,
-      NULL);
-  capsfilter = gst_element_factory_make ("capsfilter", NULL);
-  g_object_set (G_OBJECT (capsfilter), "caps", caps, NULL);
-  gst_bin_add (GST_BIN (obj), capsfilter);
-  gst_element_link (priv->src, capsfilter);
-
   priv->volume_element = gst_element_factory_make ("volume", NULL);
   gst_bin_add (GST_BIN (obj), priv->volume_element);
-  gst_element_link (priv->src, priv->volume_element);
+
+  {
+    GstElement *capsfilter;
+    GstCaps *caps;
+
+    /* Explicitly state what format we want from pulsesrc. This pushes resampling
+     * and format conversion as early as possible, lowering the amount of data
+     * transferred and thus improving performance. When moving to GStreamer
+     * 0.11/1.0, this should change so that we actually request what the encoder
+     * wants downstream. */
+    caps = gst_caps_new_simple ("audio/x-raw",
+        "channels", G_TYPE_INT, 1,
+        "width", G_TYPE_INT, 16,
+        "depth", G_TYPE_INT, 16,
+        "rate", G_TYPE_INT, 32000,
+        NULL);
+    capsfilter = gst_element_factory_make ("capsfilter", NULL);
+    g_object_set (G_OBJECT (capsfilter), "caps", caps, NULL);
+    gst_bin_add (GST_BIN (obj), capsfilter);
+    gst_element_link (priv->src, capsfilter);
+    gst_element_link (capsfilter, priv->volume_element);
+  }
 
   src = gst_element_get_static_pad (priv->volume_element, "src");
 
@@ -614,7 +617,7 @@ empathy_audio_src_change_microphone_finish (EmpathyGstAudioSrc *src,
     GAsyncResult *result,
     GError **error)
 {
-  empathy_implement_finish_void (src,
+  tpaw_implement_finish_void (src,
       empathy_audio_src_change_microphone_async);
 }