From: <tp...@ke...> - 2008-06-20 10:20:13
|
CVS Root: /cvs/gstreamer Module: gstreamer Changes by: tpm Date: Fri Jun 20 2008 10:20:22 UTC Log message: * gst/gstbus.c: Make it known that gst_bus_poll() is pure evil (fixes #538810). Modified files: . : ChangeLog gst : gstbus.c Links: http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/ChangeLog.diff?r1=1.3923&r2=1.3924 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/gst/gstbus.c.diff?r1=1.65&r2=1.66 ====Begin Diffs==== Index: ChangeLog =================================================================== RCS file: /cvs/gstreamer/gstreamer/ChangeLog,v retrieving revision 1.3923 retrieving revision 1.3924 diff -u -d -r1.3923 -r1.3924 --- ChangeLog 20 Jun 2008 10:14:50 -0000 1.3923 +++ ChangeLog 20 Jun 2008 10:20:05 -0000 1.3924 @@ -1,3 +1,8 @@ +2008-06-20 Tim-Philipp Müller <tim.muller at collabora co uk> + + * gst/gstbus.c: + Make it known that gst_bus_poll() is pure evil (fixes #538810). 2008-06-20 Stefan Kost <en...@us...> * plugins/elements/gstcapsfilter.c: Index: gstbus.c RCS file: /cvs/gstreamer/gstreamer/gst/gstbus.c,v retrieving revision 1.65 retrieving revision 1.66 diff -u -d -r1.65 -r1.66 --- gstbus.c 5 May 2008 16:47:29 -0000 1.65 +++ gstbus.c 20 Jun 2008 10:20:08 -0000 1.66 @@ -972,7 +972,8 @@ * @bus: a #GstBus * @events: a mask of #GstMessageType, representing the set of message types to * poll for. - * @timeout: the poll timeout, as a #GstClockTimeDiff, or -1 to poll indefinitely. + * @timeout: the poll timeout, as a #GstClockTimeDiff, or -1 to poll + * indefinitely. * * Poll the bus for messages. Will block while waiting for messages to come. * You can specify a maximum time to poll with the @timeout parameter. If @@ -989,6 +990,23 @@ * This function will run a main loop from the default main context when * polling. + * You should never use this function, since it is pure evil. This is + * especially true for GUI applications based on Gtk+ or Qt, but also for any + * other non-trivial application that uses the GLib main loop. As this function + * runs a GLib main loop, any callback attached to the default GLib main + * context may be invoked. This could be timeouts, GUI events, I/O events etc.; + * even if gst_bus_poll() is called with a 0 timeout. Any of these callbacks + * may do things you do not expect, e.g. destroy the main application window or + * some other resource; change other application state; display a dialog and + * run another main loop until the user clicks it away. In short, using this + * function may add a lot of complexity to your code through unexpected + * re-entrancy and unexpected changes to your application's state. + * + * For 0 timeouts use gst_bus_pop_filtered() instead of this function; for + * other short timeouts use gst_bus_timed_pop_filtered(); everything else is + * better handled by setting up an asynchronous bus watch and doing things + * from there. * Returns: The message that was received, or NULL if the poll timed out. * The message is taken from the bus and needs to be unreffed with * gst_message_unref() after usage. |