Question

I'm trying to write a GTK+ application in C that uses gstreamer.

GTK+ needs gtk_main() to execute.

gstreamer needs g_main_loop_run() to execute.

Both of them stall the execution flow.

What can I do that gtk_main() will also hold the GMainLoop that I created for gstreamer?

Thanks

Was it helpful?

Solution

Do not create a GMainLoop, gtk_main() internally creates one already which should suffice for any glib based library that uses events/signals.

See this question which quotes the gtk_main() source

OTHER TIPS

Likewise gtk can use the GMainLoop created by g_main_loop_new() as long as the default context is used (NULL).

Give a look at that tutorial for a simple C example of GTK and GStreamer in C.

Guitar Tuner in C

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top