[gst-devel] How to correctly reuse elements?
wl2776 at gmail.com
Wed Apr 21 11:25:31 CEST 2010
Please, correct if I am wrong.
> I am building an embedded player, capable to play audio and video from
> separate files.
> Create playbin2
> 7. Catch that application message in the bus watch and call the function
> dorender() which:
> 7.1. Destroys playbin2
with the gst_object_unref(playbin2)
> 7.2. Unparents the created videosink.
was done using gst_object_unparent().
This function seems to just zeroing the parent field of an element, but its
parent still thinks that it is an element's parent.
Is it correct?
I also tried gst_bin_remove(GST_BIN(m_player),GST_ELEMENT(m_videosink)), but
it returned false - the bin doesn't want to remove the videosink.
> 7.3. Creates new empty pipeline
> 7.4. Destroys old message bus
> 7.5. Creates new bus and connect bus watch and bus-sync-handler
> 7.6. Puts two uridecodebin2's in the pipeline
> 7.7. Creates an audio bin and puts it in the pipeline
> 7.8. Creates a video bin reusing the existing videosink and puts it in the
> The problem is - everything is created and linked, but soon after the
> function dorender() exits, the videosink looses its link to its sink pad
> and goes to the NULL state.
> However, when the pipeline was creating, graphviz dumps showed that it was
> linked and was in the READY and in the PAUSED states.
> Why does it go to the NULL state?
As a result, by the end of 7.8, I was still having one more background
thread running, that was removing the previously created playbin2 instance,
and also setting my videosink to the NULL state.
And the playbin2 didn't want to leave the videosink alone.
How can I make to remove the videosink?
I really need it in the other place, since it still has a frame displayed,
and I want it frame to be on the window all the time, the pipeline
reconstruction takes place.
The pipeline (playbin2) was sent to the NULL state before the games with the
View this message in context: http://n4.nabble.com/How-to-correctly-reuse-elements-tp2017352p2018646.html
Sent from the GStreamer-devel mailing list archive at Nabble.com.
More information about the gstreamer-devel