[gst-devel] "threadsafe" signals

Ronald Bultje rbultje at ronald.bitfreak.net
Sat Jan 10 03:00:00 CET 2004


Hi Benjamin,

On Sat, 2004-01-10 at 02:07, Benjamin Otte wrote:
> I'd like to not limit it to the main thread only. Especially because this
> allows to connect safely from any thread to any thread so you could even
> use it in applications to connect to signals from library threads and
> stuff like that.

Well, since every GstThread has a thread object, you can simply check
whether we (emission thread) is the same as the parent thread and handle
it, no?

I'd think that you would want hooks in bin and scheduler for this, and
simply call these hooks to let that handle what thread to emit the
signal too. From thread, send to parent bin thread (or, if no parent,
main thread). From pipeline/bin, send out directly. From element, send
to scheduler (which sends it from correct context for the (co)thread
this element runs in to its parent).

Bit simple, but you get the idea...

But in general: really cool(tm)!

Ronald

-- 
Ronald Bultje <rbultje at ronald.bitfreak.net>
Linux Video/Multimedia developer





More information about the gstreamer-devel mailing list