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 362390 - [0.11] [basetransform] derived elements cannot filter events
[0.11] [basetransform] derived elements cannot filter events
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gstreamer (core)
git master
Other All
: Normal blocker
: 0.11.x
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2006-10-15 15:02 UTC by René Stadler
Modified: 2011-10-27 14:25 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description René Stadler 2006-10-15 15:02:18 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.
Comment 1 Sebastian Dröge (slomo) 2007-09-21 18:17:19 UTC
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 :)
Comment 2 Tim-Philipp Müller 2011-10-27 14:25:48 UTC
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.