GNOME Bugzilla – Bug 746329
Queries should always be writable when passed in the Gst.Pad.do_query 'vmethod'
Last modified: 2015-04-24 09:28:55 UTC
Created attachment 299569 [details] Simple program demonstrating the issue query.type: <enum GST_QUERY_CAPS of type GstQueryType> (python3:2997): GStreamer-CRITICAL **: gst_query_set_caps_result: assertion 'gst_query_is_writable (query)' failed done (python3:2997): GStreamer-CRITICAL **: gst_mini_object_ref: assertion 'mini_object != NULL' failed (python3:2997): GStreamer-CRITICAL **: gst_caps_can_intersect: assertion 'GST_IS_CAPS (caps1)' failed (python3:2997): GStreamer-CRITICAL **: gst_mini_object_unref: assertion 'mini_object != NULL' failed query.type: <enum GST_QUERY_CAPS of type GstQueryType> (python3:2997): GStreamer-CRITICAL **: gst_query_set_caps_result: assertion 'gst_query_is_writable (query)' failed done (python3:2997): GStreamer-CRITICAL **: gst_mini_object_ref: assertion 'mini_object != NULL' failed (python3:2997): GStreamer-CRITICAL **: gst_caps_can_intersect: assertion 'GST_IS_CAPS (caps2)' failed (python3:2997): GStreamer-CRITICAL **: gst_mini_object_unref: assertion 'mini_object != NULL' failed query.type: <enum GST_QUERY_CAPS of type GstQueryType> (python3:2997): GStreamer-CRITICAL **: gst_query_set_caps_result: assertion 'gst_query_is_writable (query)' failed done (python3:2997): GStreamer-CRITICAL **: gst_mini_object_ref: assertion 'mini_object != NULL' failed (python3:2997): GStreamer-CRITICAL **: gst_pad_template_new: assertion 'caps != NULL' failed (python3:2997): GStreamer-CRITICAL **: gst_mini_object_unref: assertion 'mini_object != NULL' failed (python3:2997): GStreamer-CRITICAL **: gst_element_request_compatible_pad: assertion 'GST_IS_PAD_TEMPLATE (templ)' failed (python3:2997): GStreamer-CRITICAL **: gst_object_unref: assertion 'object != NULL' failed (GLib.Error('Internal data flow error.', 'gst-stream-error-quark', 1), 'gstbasesrc.c(2933): gst_base_src_loop (): /GstPipeline:pipeline0/GstVideoTestSrc:videotestsrc0:\nstreaming task paused, reason not-linked (-1)') Setting the PROXY_CAPS flag is not currently possible, see #746320
Compiled 1.4.0, doesn't fix the issue Running on debian sid python3 3.4.2-2 python3-gi 3.14.0-1 gstreamer1.0 1.4.4-2
Workaround, works by setting the refcount manually (courtesy of thiblahute on freenode) def _sink_query(self, pad, parent, query): query.mini_object.refcount = 1 if query.type == Gst.QueryType.CAPS: res = pad.proxy_query_caps(query) else: res = pad.query_default(parent, query) query.mini_object.refcount = 2 return res
We might want to go this way: http://phabricator.freedesktop.org/D41 I can not think of a cleaner solution actually.
commit 3d19875eb7c20cedb4ab64e295c338ebd32f4b04 Author: Thibault Saunier <tsaunier@gnome.org> Date: Wed Mar 18 13:53:55 2015 +0100 overrides: Try hard to make the query writable in the pad query function Summary: We know that the bindings will get an extra ref but we know that it is not actually needed, so we are safe to decrease the refcount by one in that particular context making sure we give PyGI its ref back when we are done. Reviewers: Mathieu_Du Differential Revision: http://phabricator.freedesktop.org/D41 https://bugzilla.gnome.org/show_bug.cgi?id=746329
This breaks under Python 2. "from inspect import signature" is Python 3 only.
commit 74f7ffbb24ceaa122c36248419faa76a6afadffc Author: Thibault Saunier <tsaunier@gnome.org> Date: Fri Apr 24 10:27:47 2015 +0200 overrides: Do not use inspect.signature as it is not available in python2 Fix regression from https://bugzilla.gnome.org/show_bug.cgi?id=746329