GNOME Bugzilla – Bug 433442
gst_element_link fails on playing elements in different bins.
Last modified: 2007-04-26 16:35:38 UTC
I have a bin in a pipeline. With a src inside the bin and the sink outside. If I try to link both with gst_element_link while the bin is playing, it doesn't work with 0.10.12 or CVS HEAD. It works fine with 0.10.11 and below. I think its linked with the patch from bug #339326. Is linking running elements even supposed to work? This small python script exhibits the problem: import pygtk, gtk, gobject import pygst pygst.require("0.10") import gst def linkelem(): src.link(sink) sink.set_state(gst.STATE_PLAYING) gtk.gdk.threads_init() pipeline = gst.Pipeline() bin = gst.Bin() src = gst.element_factory_make("videotestsrc") sink = gst.element_factory_make("ximagesink"); pipeline.add(bin) bin.add(src) pipeline.add(sink) # Works here #linkelem() pipeline.set_state(gst.STATE_PLAYING) # breaks here linkelem() gtk.main()
a pipeline.get_state(-1) is sometimes necessary after the set_state (otherwise there may be a race condition).
With libgst 0.10.12, I get the same behaviour even without the bin (works if linked before playing, doesn't if linked after playing).
Arg, having unlinked sinks is BAD... sorry