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

GStreamer (bugzilla.gnome.org) bugzilla at gnome.org
Tue Sep 29 01:56:42 PDT 2009


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

--- Comment #9 from Jan Schmidt <thaytan at mad.scientist.com> 2009-09-29 08:56:36 UTC ---
(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

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

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