GNOME Bugzilla – Bug 784960
caps: Using gst_caps_fixate with PyGobject lead to refcount issues
Last modified: 2018-01-10 20:59:37 UTC
And crash since: commit cce18426f756c0a17410020b0e5db06e7546257c Author: Tim-Philipp Müller <tim@centricular.com> Date: Mon Jul 3 09:03:24 2017 +0100 miniobject: make refcount tracing and debug logging reliable Tracing of the refcounts wasn't thread-safe, and log output of the refcount values before/after wasn't reliable. https://bugzilla.gnome.org/show_bug.cgi?id=784383 It is annoted as input caps are (transfer full) and return caps are also (transfer full). Basically in the case where make_writable simply return, we gave our ref and got it back in the return value, otherwise the input caps is unreffed (in make_writable) and we get a copy of the caps as a return value, so to me the annotation look good but I am not 100% certain. If you also think it is correct we should move that bug to PyGObject itself. I also attach here a simple test to be applied to gst-python and showing the issue.
Created attachment 355618 [details] [review] tests: Add a test for GstCaps.fixate()
The annotation is correct. gst_caps_truncate() is basically the same situation
What I thought, moving to PyGObject.
Is gst_caps_make_writable() equally broken? Maybe the problem is with things that are (transfer full) -> (transfer full). Unrelated, I think (transfer move) which does not exist would be better here. Bindings will make all these functions as is rather useless: it will basically boil down to gst_caps_make_writable(gst_caps_ref(caps)), so always a copy is made.
make_writable is not introspectable, truncate() fails the same way. I am not sure I get how movable would work in python?
I don't know, probably impossible. Why is make_writable() not introspectable? It's important for working with caps and other mini objects
(In reply to Sebastian Dröge (slomo) from comment #6) > I don't know, probably impossible. Why is make_writable() not > introspectable? It's important for working with caps and other mini objects It is a macro.
Sure, gst_mini_object_make_writable() :)
-- GitLab Migration Automatic Message -- This bug has been migrated to GNOME's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/pygobject/issues/137.