[Bug 684809] proxypad don't hold a ref to their internal pad while streaming through it

GStreamer (bugzilla.gnome.org) bugzilla at gnome.org
Wed Sep 26 02:14:31 PDT 2012


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

--- Comment #6 from Wim Taymans <wim.taymans at gmail.com> 2012-09-26 09:14:27 UTC ---
This should be the rule I think:

 1) callers of gst_pad_push() must make sure the pad never disappears while
    inside the push function. They must, for example, take a ref or make sure
    the lifecycle of the pad is tied to that of the element. 

 2) The same rule goes for gst_pad_chain(). Normally, the peer pad calls the
   chain function with an extra ref to the pad so there is no problem.

 3) same rules for query and event functions.

Elements with request srcpads, like tee, ref the pad before pushing. 

Some problem cases:

 - Ghostpads don't ref the internal pad before gst_pad_psuh(), this is what
   the patch adds among other cases.

 - Most elements with static pads want to stop the dataflow before disposing
   and destroying the pads. I think there can still be a problem if you
   unref the last ref on an element from a padprobe.

 - If an app calls gst_pad_chain() without extra ref, a probe could destroy
   the sinkpad and crash.

One option would be to add ref/unref pairs when entering/leaving the
push/chain/event/query functions. I don't like the overhead of this.

Another option would be to only ref when doing a probe. doing the unref is
trickier as it needs to be dome after the lock was released.

-- 
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