[Bug 631580] Race in all the pad functions that don't require the pad to be active

GStreamer (bugzilla.gnome.org) bugzilla at gnome.org
Mon Apr 11 07:27:23 PDT 2011


https://bugzilla.gnome.org/show_bug.cgi?id=631580
  GStreamer | gstreamer (core) | git

--- Comment #8 from Olivier Crete (Tester) <olivier.crete at ocrete.ca> 2011-04-11 14:27:19 UTC ---
Created an attachment (id=185705)
 View: https://bugzilla.gnome.org/attachment.cgi?id=185705
 Review: https://bugzilla.gnome.org/review?bug=631580&attachment=185705

pad: Pass the parent to callback functions

This patch is 0.11 material, although there are different solutions that we
could use in 0.10:

1. Rename the function prototypes to ...Full and add a set of
gst_pad_set_xfunc_full methods to set it and make the current ones just
wrappers that typecast the parent-less methods into the parented ones. Then we
just need to update all the plugins to take the parent from the parameter
instead of fetching it.

2. We could add a GPrivate (thread local storage) and store the current parent
inside it at the beginning of a callback (and keep a ref until we return from
the callback). Then modify gst_object_get_parent() to return the value from the
TLS if it's set.. That said, this wouldnt work with people using
GST_{PAD,OBJECT}_PARENT .. and about half of the current plugins do

3. We could add some kind of queue for gst_object_set_parent() and "lock" the
parent into place until all callbacks returns and only then actually set it.
This would require zero changes to the current plugins, but I'm afraid of the
side-effects (and it's also quite an ugly solution).

-- 
Configure bugmail: https://bugzilla.gnome.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.


More information about the gstreamer-bugs mailing list