mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-22 00:06:36 +00:00
gst/playback/gstplaybin.c: Add audioresample+audioconvert in front of the visualisation element, so that elements lik...
Original commit message from CVS: * 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
This commit is contained in:
parent
514c2d7610
commit
800cd83487
2 changed files with 48 additions and 16 deletions
|
@ -1,3 +1,12 @@
|
||||||
|
2007-01-31 Jan Schmidt <thaytan@mad.scientist.com>
|
||||||
|
|
||||||
|
* 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>
|
2007-01-30 Tim-Philipp Müller <tim at centricular dot net>
|
||||||
|
|
||||||
* gst/playback/gstplaybasebin.c: (gst_play_base_bin_get_property),
|
* gst/playback/gstplaybasebin.c: (gst_play_base_bin_get_property),
|
||||||
|
|
|
@ -1129,21 +1129,21 @@ link_failed:
|
||||||
* normal video bin. The video bin is run in a thread to make sure it does
|
* normal video bin. The video bin is run in a thread to make sure it does
|
||||||
* not block the audio playback pipeline.
|
* not block the audio playback pipeline.
|
||||||
*
|
*
|
||||||
* +--------------------------------------------------------------------+
|
* +-----------------------------------------------------------------------+
|
||||||
* | visbin |
|
* | visbin |
|
||||||
* | +------+ +--------+ +----------------+ |
|
* | +------+ +--------+ +----------------+ |
|
||||||
* | | tee | | aqueue | | abin ... | |
|
* | | tee | | aqueue | | abin ... | |
|
||||||
* | +-sink src-sink src-sink | |
|
* | +-sink src-sink src-sink | |
|
||||||
* | | | | +--------+ +----------------+ |
|
* | | | | +--------+ +----------------+ |
|
||||||
* | | | | |
|
* | | | | |
|
||||||
* | | | | +------+ +---------+ +------+ +-----------+ |
|
* | | | | +------+ +------------+ +------+ +-----------+ |
|
||||||
* | | | | |vqueue| |audioconv| | vis | | vbin ... | |
|
* | | | | |vqueue| | audioconv | | vis | | vbin ... | |
|
||||||
* | | | src-sink src-sink src-sink src-sink | |
|
* | | | src-sink src-sink + samp src-sink src-sink | |
|
||||||
* | | | | +------+ +---------+ +------+ +-----------+ |
|
* | | | | +------+ +------------+ +------+ +-----------+ |
|
||||||
* | | | | |
|
* | | | | |
|
||||||
* | | +------+ |
|
* | | +------+ |
|
||||||
* sink-+ |
|
* sink-+ |
|
||||||
+---------------------------------------------------------------------+
|
+------------------------------------------------------------------------+
|
||||||
*/
|
*/
|
||||||
static GstElement *
|
static GstElement *
|
||||||
gen_vis_element (GstPlayBin * play_bin)
|
gen_vis_element (GstPlayBin * play_bin)
|
||||||
|
@ -1154,6 +1154,8 @@ gen_vis_element (GstPlayBin * play_bin)
|
||||||
GstElement *asink;
|
GstElement *asink;
|
||||||
GstElement *vsink;
|
GstElement *vsink;
|
||||||
GstElement *conv;
|
GstElement *conv;
|
||||||
|
GstElement *resamp;
|
||||||
|
GstElement *conv2;
|
||||||
GstElement *vis;
|
GstElement *vis;
|
||||||
GstElement *vqueue, *aqueue;
|
GstElement *vqueue, *aqueue;
|
||||||
GstPad *pad, *rpad;
|
GstPad *pad, *rpad;
|
||||||
|
@ -1185,6 +1187,16 @@ gen_vis_element (GstPlayBin * play_bin)
|
||||||
goto no_audioconvert;
|
goto no_audioconvert;
|
||||||
gst_bin_add (GST_BIN_CAST (element), conv);
|
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) {
|
if (play_bin->visualisation) {
|
||||||
gst_object_ref (play_bin->visualisation);
|
gst_object_ref (play_bin->visualisation);
|
||||||
vis = play_bin->visualisation;
|
vis = play_bin->visualisation;
|
||||||
|
@ -1196,7 +1208,9 @@ gen_vis_element (GstPlayBin * play_bin)
|
||||||
gst_bin_add (GST_BIN_CAST (element), vis);
|
gst_bin_add (GST_BIN_CAST (element), vis);
|
||||||
|
|
||||||
res = gst_element_link_pads (vqueue, "src", conv, "sink");
|
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");
|
res &= gst_element_link_pads (vis, "src", vsink, "sink");
|
||||||
if (!res)
|
if (!res)
|
||||||
goto link_failed;
|
goto link_failed;
|
||||||
|
@ -1230,6 +1244,15 @@ no_audioconvert:
|
||||||
gst_object_unref (element);
|
gst_object_unref (element);
|
||||||
return NULL;
|
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:
|
no_goom:
|
||||||
{
|
{
|
||||||
post_missing_element_message (play_bin, "goom");
|
post_missing_element_message (play_bin, "goom");
|
||||||
|
|
Loading…
Reference in a new issue