diff options
author | Sjoerd Simons <sjoerd@luon.net> | 2012-08-27 01:23:06 +0800 |
---|---|---|
committer | Guillaume Desmottes <guillaume.desmottes@collabora.co.uk> | 2012-09-03 16:15:13 +0800 |
commit | d641d0d903b9847864acae4a47aa948131aa50b0 (patch) | |
tree | e089e935a5e5ad3efd1d175420fda9aa314706ba /src/empathy-audio-src.c | |
parent | 0af7f92b16f1d1b3527463906936fa0ea602ad57 (diff) | |
download | gsoc2013-empathy-d641d0d903b9847864acae4a47aa948131aa50b0.tar gsoc2013-empathy-d641d0d903b9847864acae4a47aa948131aa50b0.tar.gz gsoc2013-empathy-d641d0d903b9847864acae4a47aa948131aa50b0.tar.bz2 gsoc2013-empathy-d641d0d903b9847864acae4a47aa948131aa50b0.tar.lz gsoc2013-empathy-d641d0d903b9847864acae4a47aa948131aa50b0.tar.xz gsoc2013-empathy-d641d0d903b9847864acae4a47aa948131aa50b0.tar.zst gsoc2013-empathy-d641d0d903b9847864acae4a47aa948131aa50b0.zip |
Port to gstreamer 1.0
Diffstat (limited to 'src/empathy-audio-src.c')
-rw-r--r-- | src/empathy-audio-src.c | 39 |
1 files changed, 22 insertions, 17 deletions
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); |