[gst-devel] decodebin problem (gst 0.8.9; gentoo linux)
Stefan Bambach
sbambach at gmx.net
Sun Jul 10 14:36:03 CEST 2005
Hi,
I took the decodebin example code, but want to have another queueing.
I thought of 3 bins.
- bin pipeline
- thread decoding (decodebin)
- thread sink
bin_main = gst_pipeline_new("bin_main");
main_src = gst_element_factory_make("filesrc", "main_src");
g_object_set(G_OBJECT(main_src), "location", filename, NULL);
main_queue = gst_element_factory_make("queue", "main_queue");
bin_decoder = gst_thread_new("bin_decoder");
decoder_dec = gst_element_factory_make("decodebin", "decoder_dec");
g_signal_connect(G_OBJECT(decoder_dec), "new-decoded-pad",
G_CALLBACK(decoder_newpad), NULL);
decoder_queue = gst_element_factory_make("queue", "decoder_queue");
bin_sink = gst_thread_new("bin_sink");
sink_conv = gst_element_factory_make("audioconvert", "sink_conv");
sink_pad = gst_element_get_pad(sink_conv, "sink");
sink_scale = gst_element_factory_make("audioscale", "sink_scale");
sink_out = gst_element_factory_make("alsasink", "sink_out");
g_signal_connect(G_OBJECT(sink_out), "eos",
G_CALLBACK(sink_eos), pma);
I tried many combinations for "gst_bin_add_many" and
"gst_element_link_many" but none worked... Sometimes it won't even start
to play and sometimes the state changed from PAUSED to PLAYING and
direktly back to PAUSED (and I do not change this state!).
Why I want this:
The call to gst_bin_iterate() is too slow! When I want to shutdown my
own thread (which do the iterate() call), I set a variable
"thread_cancel=1" and loop in the thread code with
"while(thread_cancel==0) {...iterate...}". But the iterate() method can
need much time (~2sec) for iterating, and so my thread shutdown needs
this time, too. And setting the state to NULL/READY/PAUSE before
thread_cancel ends in core dumps at "..._get_state".
My app configuration:
- main app
- starts pipeline, and other gst stuff
- my own pthread iterates over elements (gst_bin_iterate())
-> not blocking main app
- other commands from main app (seek, pause, getposition, gettotal)
Can I break the gst_bin_iterate() method ? (states?)
Howto link and add elements for my example ?
What state should be set and when ?
To which element should I send seek, getposition, pause "events" ?
ciao. Stefan
More information about the gstreamer-devel
mailing list