From d641d0d903b9847864acae4a47aa948131aa50b0 Mon Sep 17 00:00:00 2001 From: Sjoerd Simons Date: Sun, 26 Aug 2012 19:23:06 +0200 Subject: Port to gstreamer 1.0 --- src/empathy-audio-src.c | 39 ++++++++++++++++++++++----------------- 1 file changed, 22 insertions(+), 17 deletions(-) (limited to 'src/empathy-audio-src.c') diff --git a/src/empathy-audio-src.c b/src/empathy-audio-src.c index deff297d0..c47b8dea7 100644 --- a/src/empathy-audio-src.c +++ b/src/empathy-audio-src.c @@ -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,21 +307,28 @@ 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); +#ifndef HAVE_GST1 + { + 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-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); + } +#endif priv->volume_element = gst_element_factory_make ("volume", NULL); gst_bin_add (GST_BIN (obj), priv->volume_element); -- cgit v1.2.3