From 21ab9f29302c895179701edda2abd240c44964b3 Mon Sep 17 00:00:00 2001 From: mark Date: Thu, 26 Oct 2006 15:31:11 +0000 Subject: [PATCH] Removed the volume element from the pipeline. Its only purpose was to limit the volume to 80% (which was hardcoded). This limiting should not be required; in fact it reduced the dynamic range and should therefore be avoided. --- .../playlistExecutor/src/GstreamerPlayer.cxx | 22 ++++++------------- .../playlistExecutor/src/GstreamerPlayer.h | 9 ++------ 2 files changed, 9 insertions(+), 22 deletions(-) diff --git a/campcaster/src/modules/playlistExecutor/src/GstreamerPlayer.cxx b/campcaster/src/modules/playlistExecutor/src/GstreamerPlayer.cxx index 981cc6ce5..17730d049 100644 --- a/campcaster/src/modules/playlistExecutor/src/GstreamerPlayer.cxx +++ b/campcaster/src/modules/playlistExecutor/src/GstreamerPlayer.cxx @@ -242,6 +242,9 @@ GstreamerPlayer :: open(const std::string fileUrl) throw (std::invalid_argument, std::runtime_error) { + // GStreamer pipeline overview: + // filesrc -> decoder -> audioconvert -> audioscale -> audiosink + DEBUG_BLOCK std::string filePath; @@ -302,23 +305,17 @@ GstreamerPlayer :: open(const std::string fileUrl) // converts between different audio formats (e.g. bitrate) audioconvert = gst_element_factory_make("audioconvert", NULL); - // reduce the volume to 80% - volume = gst_element_factory_make("volume", NULL); - gst_element_set(volume, "volume", gdouble(0.8), NULL); - // scale the sampling rate, if necessary audioscale = gst_element_factory_make("audioscale", NULL); gst_element_link_many(decoder, audioconvert, - volume, audioscale, audiosink, NULL); gst_bin_add_many(GST_BIN(pipeline), filesrc, decoder, audioconvert, - volume, audioscale, audiosink, NULL); @@ -470,28 +467,24 @@ GstreamerPlayer :: close(void) throw (std::logic_error) gst_element_set_state(pipeline, GST_STATE_NULL); + // Unlink elements: if (filesrc && decoder) { gst_element_unlink(filesrc, decoder); } if (decoder && audioconvert) { gst_element_unlink(decoder, audioconvert); } - if (audioconvert && volume) { - gst_element_unlink(audioconvert, volume); - } - if (volume && audioscale) { - gst_element_unlink(volume, audioscale); + if (audioconvert && audioscale ) { + gst_element_unlink(audioconvert, audioscale); } if (audioscale && audiosink) { gst_element_unlink(audioscale, audiosink); } + // Remove elements from pipeline: if (audioscale) { gst_bin_remove(GST_BIN(pipeline), audioscale); } - if (volume) { - gst_bin_remove(GST_BIN(pipeline), volume); - } if (audioconvert) { gst_bin_remove(GST_BIN(pipeline), audioconvert); } @@ -505,7 +498,6 @@ GstreamerPlayer :: close(void) throw (std::logic_error) filesrc = 0; decoder = 0; audioconvert = 0; - volume = 0; audioscale = 0; } diff --git a/campcaster/src/modules/playlistExecutor/src/GstreamerPlayer.h b/campcaster/src/modules/playlistExecutor/src/GstreamerPlayer.h index c9acc521e..5d6976870 100644 --- a/campcaster/src/modules/playlistExecutor/src/GstreamerPlayer.h +++ b/campcaster/src/modules/playlistExecutor/src/GstreamerPlayer.h @@ -117,11 +117,6 @@ class GstreamerPlayer : virtual public Configurable, */ GstElement * audioconvert; - /** - * The volume element. - */ - GstElement * volume; - /** * The audioscale element. */ @@ -401,7 +396,7 @@ class GstreamerPlayer : virtual public Configurable, getPosition(void) throw (std::logic_error); /** - * Get the volume of the player. + * Get the volume of the player. *Unimplemented* * * @return the volume, from 1 to 100. */ @@ -409,7 +404,7 @@ class GstreamerPlayer : virtual public Configurable, getVolume(void) throw (); /** - * Set the volume of the player. + * Set the volume of the player. *Unimplemented* * * @param volume the new volume, from 1 to 100. */