gst_bus_add_watch not calling buscall function

Tim-Philipp Müller t.i.m at zen.co.uk
Wed Nov 14 03:39:28 PST 2012


On Wed, 2012-11-14 at 03:30 -0800, deepthips wrote:

> I am not sure

If you're not sure, you're probably not running a main loop.

The GstBus watch functionality requires a running GLib main loop.

> Using 'gst_bus_set_sync_handler' instead of 'gst_bus_add_watch'
> solved the problem. Some kind of sync issue I guess.

This means the handler will be called from the thread that posts the
message, which is not what you want for a normal bus handler, and
there's a lot of things you can't do from those threads.

If you don't run a main loop, you can periodically check for messages on
the bus using gst_bus_pop() and friends. The important thing is to do
this from the application thread.

Cheers
 -Tim



More information about the gstreamer-devel mailing list