[gst-devel] decodebin problem (gst 0.8.9; gentoo linux)

Stefan Bambach stefanb at bambach.intra
Mon Jul 11 08:24:23 CEST 2005


Hi Ronald,

> Mistake 1. This won't work. You cannot have a queue between decodebin
> and filesrc. It just doesn't work. In all examples, you will always find
> decodebin and filesrc in the same thread, I recommend you continue doing
> that.
> 
> > My app configuration:
> > - main app
> >   - starts pipeline, and other gst stuff
> >   - my own pthread iterates over elements (gst_bin_iterate())
> >     -> not blocking main app
> 
> This is *way* worse. You hereby remove all threadsafety, for as far as
> it exists, by manually threading one pipeline. Do not ever do that. :).
> You can make the main pipeline a thread to get the same effect, and that
> may actually work. However, your own pthread iterating a pipeline will
> not work, it will cause random thread failures.

Ok. 

1. I will use "gst_thread_new" instead of "gst_pipeline_new"
2. and ... link decodebin to this thread

Do I need to iterate this new main thread ?

> > Can I break the gst_bin_iterate() method ? (states?)
> 
> No. 2 seconds is too much, but implies a pipeline that can be optimized
> (scheduling-wise). Are all your bins/threads separate entities? Or does
> one bin own the others? What's the exact setup of your pipeline?

main pipeline was the master, linked all elements together and added the 
threads to the pipeline. I think this is wrong !

FUTURE plans:
gst_bin_add_many(GST_BIN(bin_sink), sink_queue, sink_conv, sink_scale, sink_out, NULL);
gst_element_link_many(sink_queue, sink_conv, sink_scale, sink_out, NULL);

gst_bin_add_many(GST_BIN(bin_main), main_src, decoderbin, NULL);
gst_element_link_many(main_src, decoderbin, NULL);

gst_element_set_state(bin_sink, GST_STATE_PAUSED);
gst_element_set_state(bin_main, GST_STATE_PLAYING);

"new_decoded_pad" callback will add "sink" to "main" later.

Right ?

> > To which element should I send seek, getposition, pause "events" ?
> 
> To the (audio)sinks. This is explained in more detail in the application
> development manual on our website. Pause events are not events, so you
> just set a state on the all-containing pipeline.

Ok. So "seek" + "getposition" calls use "sink" element. So that's right... :-)
And "pause" state use main thread. Fine.


ciao. Stefan




More information about the gstreamer-devel mailing list