[gst-devel] 2 questions: threading and faad
msmith at xiph.org
Wed Sep 10 18:39:41 CEST 2008
On Wed, Sep 10, 2008 at 8:39 AM, Wim Taymans <wim.taymans at gmail.com> wrote:
> On Wed, 2008-09-10 at 08:28 -0700, Michael Smith wrote:
>> On Wed, Sep 10, 2008 at 12:50 AM, franchan <francis.meyvis at gmail.com> wrote:
>> > Hello,
>> > I'm using a playbin base pipeline.
>> > Initially I thought gstreamer was running in its own thread context.
>> > But after setting the state to GST_STATE_PLAYING from the main thread context,
>> > I get the impression that I only return from the call,
>> > when the typefinding procedure has finished.
>> This is incorrect, typefinding is never done from the main thread.
>> It's possible, of course, for buggy plugins to make setting the
>> pipeline state block - some of the http sources have bugs like that.
>> Since you're writing your own source, I'd guess the problem is there.
> The typefind element does typefinding in the state-change to PAUSED.
> This is arguably the wrong thing to do but it's currently done like that
> because we otherwise would need a scheduling mode switch from the
> streaming thread. I'm not quite sure how that would work...
Ah, you're right. Sorry about that, franchan. Wim: we should think
about a fix for that, though probably for 0.11?
So: yes, apparently we do typefinding from the main thread, if we're
in pull mode. That's unfortunate. However, it doesn't work this way in
push mode. Since I recommended using push mode _anyway_, that's not
too bad - you'll just need to change your plugin to work in push mode.
There are a number of other network sources that operate in push mode
and support streaming (e.g. the http sources), those might be useful
examples for you.
More information about the gstreamer-devel