From: <th...@ke...> - 2007-01-31 15:59:17
|
CVS Root: /cvs/gstreamer Module: gst-plugins-base Changes by: thaytan Date: Wed Jan 31 2007 15:59:05 UTC Log message: * gst/playback/gstplaybin.c: (gen_vis_element): Add audioresample+audioconvert in front of the visualisation element, so that elements like libvisual 0.4 that don't support all samplerates can work. Fixes: #402505 Modified files: . : ChangeLog gst/playback : gstplaybin.c Links: http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins-base/ChangeLog.diff?r1=1.3121&r2=1.3122 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins-base/gst/playback/gstplaybin.c.diff?r1=1.103&r2=1.104 ====Begin Diffs==== Index: ChangeLog =================================================================== RCS file: /cvs/gstreamer/gst-plugins-base/ChangeLog,v retrieving revision 1.3121 retrieving revision 1.3122 diff -u -d -r1.3121 -r1.3122 --- ChangeLog 30 Jan 2007 19:19:37 -0000 1.3121 +++ ChangeLog 31 Jan 2007 15:58:52 -0000 1.3122 @@ -1,3 +1,12 @@ +2007-01-31 Jan Schmidt <th...@ma...> + + * gst/playback/gstplaybin.c: (gen_vis_element): + Add audioresample+audioconvert in front of the visualisation + element, so that elements like libvisual 0.4 that don't support all + samplerates can work. + Fixes: #402505 2007-01-30 Tim-Philipp Müller <tim at centricular dot net> * gst/playback/gstplaybasebin.c: (gst_play_base_bin_get_property), Index: gstplaybin.c RCS file: /cvs/gstreamer/gst-plugins-base/gst/playback/gstplaybin.c,v retrieving revision 1.103 retrieving revision 1.104 diff -u -d -r1.103 -r1.104 --- gstplaybin.c 25 Jan 2007 12:24:18 -0000 1.103 +++ gstplaybin.c 31 Jan 2007 15:58:53 -0000 1.104 @@ -1129,21 +1129,21 @@ * normal video bin. The video bin is run in a thread to make sure it does * not block the audio playback pipeline. * - * +--------------------------------------------------------------------+ - * | visbin | - * | +------+ +--------+ +----------------+ | - * | | tee | | aqueue | | abin ... | | - * | +-sink src-sink src-sink | | - * | | | | +--------+ +----------------+ | - * | | | | | - * | | | | +------+ +---------+ +------+ +-----------+ | - * | | | | |vqueue| |audioconv| | vis | | vbin ... | | - * | | | src-sink src-sink src-sink src-sink | | - * | | +------+ | - * sink-+ | - +---------------------------------------------------------------------+ + * +-----------------------------------------------------------------------+ + * | visbin | + * | +------+ +--------+ +----------------+ | + * | | tee | | aqueue | | abin ... | | + * | +-sink src-sink src-sink | | + * | | | | +--------+ +----------------+ | + * | | | | | + * | | | | +------+ +------------+ +------+ +-----------+ | + * | | | | |vqueue| | audioconv | | vis | | vbin ... | | + * | | | src-sink src-sink + samp src-sink src-sink | | + * | | +------+ | + * sink-+ | + +------------------------------------------------------------------------+ */ static GstElement * gen_vis_element (GstPlayBin * play_bin) @@ -1154,6 +1154,8 @@ GstElement *asink; GstElement *vsink; GstElement *conv; + GstElement *resamp; + GstElement *conv2; GstElement *vis; GstElement *vqueue, *aqueue; GstPad *pad, *rpad; @@ -1185,6 +1187,16 @@ goto no_audioconvert; gst_bin_add (GST_BIN_CAST (element), conv); + resamp = gst_element_factory_make ("audioresample", "aresamp"); + if (resamp == NULL) + goto no_audioresample; + gst_bin_add (GST_BIN_CAST (element), resamp); + conv2 = gst_element_factory_make ("audioconvert", "aconv2"); + if (conv2 == NULL) + goto no_audioconvert; + gst_bin_add (GST_BIN_CAST (element), conv2); if (play_bin->visualisation) { gst_object_ref (play_bin->visualisation); vis = play_bin->visualisation; @@ -1196,7 +1208,9 @@ gst_bin_add (GST_BIN_CAST (element), vis); res = gst_element_link_pads (vqueue, "src", conv, "sink"); - res &= gst_element_link_pads (conv, "src", vis, "sink"); + res &= gst_element_link_pads (conv, "src", resamp, "sink"); + res &= gst_element_link_pads (resamp, "src", conv2, "sink"); + res &= gst_element_link_pads (conv2, "src", vis, "sink"); res &= gst_element_link_pads (vis, "src", vsink, "sink"); if (!res) goto link_failed; @@ -1230,6 +1244,15 @@ gst_object_unref (element); return NULL; } +no_audioresample: + { + post_missing_element_message (play_bin, "audioresample"); + GST_ELEMENT_ERROR (play_bin, CORE, MISSING_PLUGIN, + (_("Missing element '%s' - check your GStreamer installation."), + "audioresample"), (NULL)); + gst_object_unref (element); + return NULL; + } no_goom: { post_missing_element_message (play_bin, "goom"); |