[Bug 656205] New: Any static method who returns floating ref object should be marked as (transfer none)

GStreamer (bugzilla.gnome.org) bugzilla at gnome.org
Tue Aug 9 04:13:34 PDT 2011


https://bugzilla.gnome.org/show_bug.cgi?id=656205
  GStreamer | gstreamer (core) | 0.11.x

           Summary: Any static method who returns floating ref object
                    should be marked as (transfer none)
    Classification: Platform
           Product: GStreamer
           Version: 0.11.x
        OS/Version: Linux
            Status: UNCONFIRMED
          Severity: normal
          Priority: Normal
         Component: gstreamer (core)
        AssignedTo: gstreamer-bugs at lists.freedesktop.org
        ReportedBy: pecisk at gmail.com
         QAContact: gstreamer-bugs at lists.freedesktop.org
     GNOME version: ---


Problem: currently using lot of Gstreamer 0.11 classes methods which returns
GstObjects are not possible with Gobject Introspection because objects get
destroyed right after their creation. For example this Python script segfaults
because of this:

from gi.repository import Gst
Gst.init(None)
element = Gst.ElementFactory.make("audioconvert", "aconvert")
print element.name

Solution: all values which returns floating ref objects (GstObject for example)
should have transfer ownership set to none. Object has his floating reference
sinked in bindings (pygobject for example). See more
http://developer.gnome.org/gobject/unstable/gobject-The-Base-Object-Type.html#floating-ref

I might be wrong, but as far my research goes floating refs should be sinked
this way because it otherwise is left floating and therefore it goes away.
Transfer full means that Gstreamer leaves to itself to add ref, but it doesn't
work that way.

I add patch which changes transfer mode for Gst.ElementFactory.make() method.
With this element is accessible and aren't destroyed before time has come. I
have tried this successfully for Gst.Bin.new() and
Gst.parse_bin_from_description too, which both segfaulted with transfer full.

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