[Bug 702960] gst_element_add_pad()'s pad parameter should be marked as transfer none

GStreamer (bugzilla.gnome.org) bugzilla at gnome.org
Tue Jul 2 12:48:12 PDT 2013


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

--- Comment #8 from Colin Walters <walters at verbum.org> 2013-07-02 14:14:02 UTC ---
Sorry, ignore comment #5 for now.

(In reply to comment #6)
> Not sure I understand what you mean, Colin. The function takes ownership of
> floating references, it does not take ownership of normal references. So the
> application really has to know that, otherwise there will be reference leaks or
> crashes.

There's two levels here:

1) The application
2) The binding machinery

The annotations are almost entirely for bindings to consume.  If I'm
programming with gjs, I shouldn't have to care whether a function return value
is (transfer full) or (transfer none).  It's just handled for me.

Now the annotations *are* nice for C programmers to read, and that's why I am
glad they're in the docs.  They're a much more regular and reliable description
than the previous English copy/paste text.

On this specific bug - it certainly is quite important for C programmers to
know which functions will internally reference their arguments, and thus
consume floating references.  But that concept is *not the same* as (transfer
full).

Most input (transfer full) parameters are for convenience of C authors; like
g_dbus_method_invocation_return_dbus_error (), where it frees the invocation
for you.  But most bindings don't want application authors to be able to crash
the process, so they generate an *extra reference* when invoking that function,
and then clean up the object via normal means of garbage collection.

So it isn't right for this GStreamer API to use (transfer full) for "will sink
floating refs", because that's just not what the annotation is for currently.

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