[gstreamer-bugs] [Bug 596078] Playbin2 takes ref of audio-/video-sink parameter

GStreamer (bugzilla.gnome.org) bugzilla at gnome.org
Tue Sep 29 02:14:21 PDT 2009


https://bugzilla.gnome.org/show_bug.cgi?id=596078
  GStreamer | gst-plugins-base | git

Sebastian Dröge <slomo> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|FIXED                       |

--- Comment #10 from Sebastian Dröge <slomo at circular-chaos.org> 2009-09-29 09:14:16 UTC ---
(In reply to comment #9)
> (In reply to comment #8)
> 
> > The problem is, that _get_object is called (meaning, you don't own the
> > reference). This is then reffed and sinked later (refcount += 1 and the
> > refcount -= 1). So in the end playbin/playsink don't own any reference to the
> > passed object (only the GValue owns one reference, GLib owns another reference
> > internally and the caller owns the remaining reference).
> 
> This is where the disparity arises - when playbin2 refs and sinks the passed
> element (as playbin1 does) the caller *doesn't* own their reference any more -
> they gave it away when they set the element onto playbin.
> 
> If an application wants to keep a reference, they need to add a ref before
> passing the element into the audio/video-sink

That's not good for bindings. GObject properties should never steal the
reference from the caller, that would be a problem for bindings. so playbin2
should either
a) get_object + ref (aka dup_object) or
b) get_object + ref (or dup) + ref + sink

> > So right, either playbin/playsink shouldn't sink the object and only ref it. Or
> > it should be as with my current patch ;)
> > 
> > I don't know if playbin/playsink should sink the object, it probably makes
> > sense because they "own" the object.
> > 
> > Jan, do you think we should fix that for 0.10.25 already?
> > 
> > (In reply to comment #6)
> > > Camerabin add refcounts. Its probably good to ref. It would be nice to cover
> > > that in our unit tests too.
> > > 
> > > The problem with the unref is that it causes a leak for apps that used custom
> > > elements so already. So I agree with Arnout that we need to point that out very
> > > clearly.
> > 
> > Yes, should definitely be in the release notes (although we don't give any API
> > guarantees for playbin2 yet).
> 
> It should be clarified in the playbin2 docs. I am marking this as a blocker
> bug, because a) we need to resolve the reference counting policy and b) I think
> the playbin2 behaviour has changed since 0.10.24 - it still sinks the ref on
> the visualisation element, but no longer on the audio/video/subpic/text sinks.

Hm, it still sinks audio/video/subpic/text sinks (playbin2) and the vis element
(playsink).

-- 
Configure bugmail: https://bugzilla.gnome.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.



More information about the Gstreamer-bugs mailing list