GNOME Bugzilla – Bug 362390
[0.11] [basetransform] derived elements cannot filter events
Last modified: 2011-10-27 14:25:48 UTC
In gst_base_transform_sink_event (which is installed as the sink pad's event function): if (bclass->event) ret = bclass->event (trans, event); /* FIXME, do this in the default event handler so the subclass can do * something different. */ if (ret) ret = gst_pad_push_event (trans->srcpad, event); gst_object_unref (trans); return ret; This causes problems if a derived class instance wants to filter (eat) an event. To prevent basetransform from pushing on the event, the "event" vfunc has to return FALSE. Unfortunately, this also leads to the event function returning FALSE, which indicates to the sender of the event that it was not handled (gst_pad_send_event returns FALSE). A use case is the upcoming ReplayGain volume element, which should remove the gain and peak tags from tag events it receives. If this would empty the tag list because it contains no other tags, it makes more sense to drop the event instead of pushing it further. Currently, there seems to be no easy way to do this with basetransform.
Hm, IIRC Wim planned something like GstFlowReturn for events too... which could fix this for 0.11. Not sure how to fix this for 0.10 without introducing a basetransform->event_with_return(pad,event,return) which would be really ugly IMHO :)
I think this got fixed in all base classes in 0.11. the sub-class now always has to chain up to the parent class to pass on the event, so can drop it by not chaining up.