GNOME Bugzilla – Bug 684307
playbin/playsink doesn't allow replacement of the sinks
Last modified: 2012-09-26 12:32:45 UTC
LibreOffice has been using an idiom in 0.10 where it prerolls playbin with fakesink configured as the video-sink in order to get the video width/height, and then replaces the video-sink (setting it to NULL) and sets playbin through PAUSED->READY->PAUSED to get it recreate the sink. With playsink in 1.0, the video chain never gets destroyed from the first time, so it continues to use fakesink.
In playsink the chains are only freed and new sinks can be used when going to NULL. playbin in theory could allow a new sink after every file, so even in READY. Is it still impossible to replace a sink when going back to NULL instead of READY?
Correct - setting it to NULL also didn't make it work. My reading of the code is that the chains are actually only freed in dispose.
In playsink they're destroyed in READY_TO_NULL, same for playbin (deactivate_group() removes the sinks from the groups).
Created attachment 225204 [details] Test for playbin sink replacement You're correct. I don't know what was going wrong for Michael in his LibreOffice testing. Here's a python script which demonstrates that replacing the sink in READY works fine.
Thanks for checking, no doubt some extreme badness in our gst code which is (for interest) here: http://cgit.freedesktop.org/libreoffice/core/tree/avmedia/source/gstreamer/gstplayer.cxx all bug-fix / cleanup patches gratefully received :-)