Help needed with RTSP streaming and g_main_loop

Sebastian Dröge sebastian at centricular.com
Sat Jan 11 02:47:14 PST 2014


On Fr, 2014-01-10 at 23:48 -0800, peter wrote:
> hi yoyosuper8,
> 
> thanks for your response.
> i don't want to try with a new thread.
> there is any way through which i can run multiple g_main_loop_run in a
> single thread.

That's not how GMainLoop or event loops in general work. A single thread
can run a single main loop, but you can attach multiple RTSP servers or
other things to that single main loop. And a main loop can only serve a
single main context.

See the documentation:
https://developer.gnome.org/glib/unstable/glib-The-Main-Event-Loop.html

For your example, if it should run in a single thread:
1. Create main context
2. Create all RTSP servers and attach them to that main context
3. Create main loop, attach to that main context
4. g_main_loop_run()

g_main_loop_run() will not return until the main loop is quit with
g_main_loop_quit().

-- 
Sebastian Dröge, Centricular Ltd - http://www.centricular.com
Expertise, Straight from the Source
-------------- 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: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20140111/6f7cdc0d/attachment.pgp>


More information about the gstreamer-devel mailing list