[gst-devel] Dynamical pad -> no linking
Ronald S. Bultje
rbultje at ronald.bitfreak.net
Sat Oct 9 08:23:48 CEST 2004
On Tue, 2004-10-05 at 13:06, niac78 at free.fr wrote:
> /bin/gst-launch-0.8 filesrc <FILE> ! mpegdemux ! mpeg2dec ! ffmpegcolorspace !
(Do we have a fbsink?)
> No problem, this works. Now I create m'y pipeline in a .c file like
> shown below:
> GstElement *demux = gst_element_factory_make ("mpegdemux", "demux");
> GstElement *decoder = gst_element_factory_make ("mpeg2dec", "decoder");
> if (!gst_element_link_filtered(demux, decoder, NULL))
> The second link fails, probably because the video src pad is dynamical and it
> does not exist yet. Indeed, it's created once the pipeline is run but it's
> never linked (unlike when using the gst-launch binary).
Indeed. The best way to do this is to listen to the "new-pad" signal on
the demuxer and link when that signal has been fired. I've used that
myself successfully many times.
Ronald S. Bultje <rbultje at ronald.bitfreak.net>
More information about the gstreamer-devel