[Bug 736896] [REGRESSION] pygobject 3.13 now copies the GstStructure when getting them from a GstCaps, making it impossible to properly modify structures from caps in place.

GStreamer (GNOME Bugzilla) bugzilla at gnome.org
Thu Jun 18 04:58:03 PDT 2015


https://bugzilla.gnome.org/show_bug.cgi?id=736896

--- Comment #23 from Will Manley <gnome at williammanley.net> ---
I think the fundamental problem is that GstMiniObject claims that:

     * Ref Func: gst_mini_object_ref
     * Unref Func: gst_mini_object_unref

But it's using a different definition of "ref" than Python uses.  Notably:
calling this function can actually mutate the object being referenced (e.g.
make it non-writable).

One option might be to add an override wrapping all GstMiniObjects with its own
reference count that actually conforms to Python's reference counting
expectations.  This could have a custom deleter, so then the Sample.get_buffer
override could look something like:

    GstMiniObjectWrapper * gst_sample_override_gst_get_buffer(GstSample*
sample)
    {
        return gst_mini_object_wrapper_new(
            gst_sample_get_buffer(gst_sample_ref(sample)),
            &gst_sample_unref,
            sample);
    }

Of course this naive approach would require overriding every place that a
GstMiniObject is returned by GStreamer, but maybe pygi has a way around this?

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