GObject.Mainloop daemonize

Sebastian Dröge sebastian at centricular.com
Thu Feb 25 07:14:33 UTC 2016


On Mi, 2016-02-24 at 14:38 +0300, Krutskikh Ivan wrote:
> Hi all,
> 
> I'm developing an ip video distributor/videorelay with python and
> gstreamer and I'm stuck with gstreamer internal threading. I've
> defined a number of classes with some gstreamer routines
> (GstRTSPServer and some multifdsinks for video over http) some of
> them use GObject.Mainloop for event handling. But when I start my
> server, the first instance to call loop.run() freezes my program
> until loop exists. What can I do to daemonize each class in his own
> thread? Maybe there is a more common way of dealing with gstreamer
> threads?

Just run g_main_loop_run() in a new thread. Alternatively you can also
let multiple things be handled by a single main loop.

But the point of it is exactly that it blocks until the loop is
stopped, and in the meantime it handles all events that arrive on its
associated main context.

-- 
Sebastian Dröge, Centricular Ltd · http://www.centricular.com

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 949 bytes
Desc: This is a digitally signed message part
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20160225/b104b3ee/attachment.sig>


More information about the gstreamer-devel mailing list