[Bug 707605] Need "reverse-funnel" element
GStreamer (bugzilla.gnome.org)
bugzilla at gnome.org
Tue Oct 8 14:54:13 CEST 2013
https://bugzilla.gnome.org/show_bug.cgi?id=707605
GStreamer | gstreamer (core) | git
--- Comment #40 from Sebastian Dröge (slomo) <slomo at circular-chaos.org> 2013-10-08 12:54:09 UTC ---
(In reply to comment #39)
> (In reply to comment #38)
> > @@ +311,3 @@
> > + if (srcpad != NULL) {
> > + if (GST_OBJECT_REFCOUNT_VALUE (srcpad) > 0)
> > + gst_object_unref (srcpad);
> >
> > Never do something like this, if you need it you get the refcounting wrong
> > elsewhere.
> > => Could you tell me why i am not using GST_OBJECT_REFCOUNT_VALUE() ?
> > I think that if I could know refcount of srcpad, then I could call
> > gst_object_unref(srcpad)
> > Is there any idea for this?
>
> Read about the concepts of refcounting. Either you own a reference and need to
> unref or give it away, or you don't and then don't unref or give it away.
>
> => I am a little bit confusing.
> you means that if I have refcount, then I need to unref and give it away?
> and if I don't have refcount, then I don't need to unref and give it away?
No, I really meant it with "or" :) Example: You own a reference to a pad. If
you don't give that reference away to other code (e.g. return it from a
callback or pass it to gst_element_add_pad()) you'll have to unref it at some
point, otherwise you'll leak memory.
--
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