[gst-devel] Question about and appsink pipeline

Tim-Philipp Müller t.i.m at zen.co.uk
Sun Feb 1 19:04:00 CET 2009


On Sun, 2009-02-01 at 03:56 -0500, W. Michael Petullo wrote:

Hi,

> I have two ways to initialize my pipeline. One works and the other does
> not. Could someone tell me why?
>
> This does not work:
> 
>   (...)
>
>         gst_element_link_many (stream->priv->src,
>                                stream->priv->decode,
>                                stream->priv->convert,
>                                stream->priv->encode,
>                                stream->priv->sink,
>                                NULL);

This will fail, because decodebin does not have any source pads yet at
this point, so you can't link decodebin to audioconvert yet. Decodebin
has 'dynamic pads' which are created only once data flows through the
pipline, so you need to defer linking decodebin to audioconvert to the
new-decoded-pad callback. Have a look at the application developer's
manual and/or
http://www.jonobacon.org/2006/11/03/gstreamer-dynamic-pads-explained/
for more info.


> This does work:
> 
>         string = g_strdup_printf ("giosrc location=\"%s\" ! decodebin !
> audioconvert ! lame ! appsink name=\"sink\"", uri);
>         stream->priv->pipeline = gst_parse_launch (string, NULL);
>         g_free (string);
> 
> I do not understand why they would be different.

gst_parse_launch() handles dynamic pads automagically for you, which can
be great, but can also backfire at times, e.g. if you make it wait for
pads that'll never be created.

Cheers
 -Tim






More information about the gstreamer-devel mailing list