[gst-devel] Problems with one threaded pipelines?
wingo at pobox.com
Sat Sep 4 05:05:11 CEST 2004
You'll understand if I copy my reply to the list -- I try to keep things
there, but sometimes switching between evolution and mutt trips me up ;)
On Thu, 2004-09-02 at 09:49 +0300, EXT-Tommi.Myohanen at nokia.com wrote:
> I'd say the kinds of pipelines you described are quite rare. :)
Benjamin might have some other cases, but yes.
> In addition, (correct me if I'm wrong) when using only one thread it's
> essential to have non-blocking operations. Some elements have blocking
> operations like tcpsrc and sometimes formats like MPEG require to do a
> non-blocking wait in video rendering. But how do you do a non-blocking
> wait in a one-threaded pipeline using wait_async? Are there any plugins
> implemented that use gst_clock_id_wait_async instead ofgst_element_wait?
Ah, so this is what the furor is about regarding wait_async! Personally,
I use it on the application level, where the app, running in the same
thread as the pipeline, waits for a notification after a certain time
has elapsed, for example. wait_async is implemented now by audio clocks,
via the GstAudioClock class.
Now, using wait_async for syncronization... that's a different beast
that I haven't thought about. I don't understand why you would want to
use it. It seems that there should be some way to recurse into the
scheduler, which would let the rest of the pipeline run, and then
which would return to the caller. But of course that doesn't give you
the necessary resolution. You need to have the ability to react to time
changes within a buffer, so perhaps you can make wait_async work
 Note to Ramon: this could be done either by running the scheduler
recursively, or by switching cothreads. With opt, this behaviour is
already implemented, by opt and optomega, respectively.
But that last bit is all theoretical. If you could make it work with gst
0.8, I would be surprised, because I don't think anyone was thinking
about single-threaded, synchronized audio+video. It does seem possible,
although other people know more about video than I do.
Andy Wingo <wingo at pobox.com>
More information about the gstreamer-devel