After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 166371 - GstBin derived classes not notified of state change
GstBin derived classes not notified of state change
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gstreamer (core)
git master
Other Linux
: Urgent normal
: 0.8.9
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2005-02-05 13:55 UTC by Ronald Bultje
Modified: 2005-02-08 09:49 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Ronald Bultje 2005-02-05 13:55:52 UTC
Dno't know where to put this, so adding to bugzilla then. Just close when the
release notes have been written.

"Some fixes in this release change (fix) behaviour for derived classes of
GstBin. This may cause problems for projects using derived classes of GstBin.
This is *not* a bug. This is a fix for a bug. Projects using workarounds for
this bug may see this hitting back now. That *is* a bug in those projects. This
note is here to help them track the problem.

Documented behaviour:
A GstBin, and any derived class of a GstBin, is defined to have the state of the
contained child with the highest state. Adding new children with a higher state
than the current bin's state, or changing state of children to a state higher
than the current state of the bin, will change the state of the bin itself.
Changing state of a kid or adding a kid with a higher state will do a
non-recursive state-change on the bin (i.e. it changes the state of the bin, but
does not touch other contained children). Likewise, changing state of a bin
non-recursively changes state on the contained children (i.e. the kids do not
notify their parents of the state-change). This non-recursive behaviour is to
prevent recursive (infinite) loops.

The bug:
Non-recursive state changes on the bin after a kid state change (or addition,
which is essentially the same) would force a call to
GstElementClass->change_state(bin) instead of calling the correct virtual
function implementation on the bin. This means that derived classes would not be
notified of the state change. Derived classes requiring work in the state_change
virtual function would not see this work being done when their state changed
because children state changed. This behaviour was fixed.

The problem for derived classes:
Derived classes could work around this problem by keenly keeping track of
children's states and forcing states on children all the time. It needs to be
said that *this is not correct behaviour*, it merely works around this bug.
Likewise, changing state of kids in the change_state handler (or anything called
by that) *is recursive behaviour*. Doing that is fine, but the derived class
either needs to keep track of recursive behaviour and do the right thing, or not
do recursive behaviour at all.

In case of doubt or problems as an effect of these changes, feel free to ask us.
It probably reflects a bug in your application not exposed by the bug in core
until now. We will try to help you fix it."

I just helped Edward (bilboed) fix gnonlin, who was hit by the above. The fix
was easy for me, but not for him. Please add this to the release notes.
Comment 1 Thomas Vander Stichele 2005-02-07 14:43:59 UTC
I can add a pointer to a mail or something, but we don't put this detailed info
in the release notes.