[gst-devel] Specifying a different context for gst_bus_add_watch()

Karthik V karthikveeramani+gstreamer at gmail.com
Thu Nov 13 19:08:41 CET 2008

Hello All,
I would like to run my g_main_loop in a separate context, so did something
like this

GMainContext *c = g_main_context_new();
GMainLoop *l = g_main_loop_new(c, false);

My bus watch code goes like this:
GstBus *bus = gst_pipeline_get_bus(pipe);
gst_bus_add_watch(bus, BusHandler, NULL);

If I run my main loop in the default context (by passing NULL), I receive
call backs when there is an event on the bus. But after I moved it to a new
context, I don't get the events anymore. Looking into the documentation, it
looks like gst_bus_add_watch() adds watch only to the default context.

Could someone tell me how to add watch to my own context, please?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20081113/7df52af6/attachment.htm>

More information about the gstreamer-devel mailing list