GNOME Bugzilla – Bug 688804
Getting error trying to add a pad_probe
Last modified: 2012-11-24 14:01:37 UTC
I got a uridecodebin element and are listening in for the pad-added signal. On the pad I check that it is an audio pad and then I try to create a pad_probe so I can get at the stream_id. Using the following Python code: src_pad.add_probe(Gst.PAD_PROBE_TYPE_EVENT_BOTH, self.padprobe, "user data") This gives me the error: (transmageddon.py:20021): GStreamer-CRITICAL **: gst_pad_add_probe: assertion `mask != 0' failed Slomo suggested it might be a bindings error.
Does it work with Gst.PAD_PROBE_TYPE_EVENT_DOWNSTREAM ? Might it be because _BOTH is a #define and not part of the enum?
I am getting this error: Traceback (most recent call last):
+ Trace 231215
src_pad.add_probe(Gst.PAD_PROBE_TYPE_EVENT_DOWNSTREAM, self.padprobe, "user data")
return getattr(self._introspection_module, name)
self.__name__, name))
Also looking in ipython I see this: Gst.PA Gst.PAD_PROBE_TYPE_ALL_BOTH Gst.PAD_PROBE_TYPE_QUERY_BOTH Gst.PAD_PROBE_TYPE_BLOCKING Gst.PAD_PROBE_TYPE_SCHEDULING Gst.PAD_PROBE_TYPE_BLOCK_DOWNSTREAM Gst.PARAM_CONTROLLABLE Gst.PAD_PROBE_TYPE_BLOCK_UPSTREAM Gst.PARAM_MUTABLE_PAUSED Gst.PAD_PROBE_TYPE_DATA_BOTH Gst.PARAM_MUTABLE_PLAYING Gst.PAD_PROBE_TYPE_DATA_DOWNSTREAM Gst.PARAM_MUTABLE_READY Gst.PAD_PROBE_TYPE_EVENT_BOTH Gst.PARAM_USER_SHIFT So it seems, EVENT_DOWNSTREAM is not bound at all in the bindings?
No it's Gst.PadProbeType.DOWNSTREAM I had the same problem earlier. I expect that the bindings only accept values registered in the GEnum so we probably need to put the combinations inside the enum also. As a work around, you can use a combination of the basic types.
Ok, the API name is Gst.PadProbeType.EVENT_DOWNSTREAM in case someone ends up here due to googling. Should I close this as Notabug or should we keep it open to deal with Gst.PAD_PROBE_TYPE_ALL_BOTH not being acessible?
Let's leave it open for now.
Created attachment 229710 [details] [review] pad: Put all of the probe types in the enum so they work with bindings You have to put them all in the enum otherwise the bindings complain.
commit fba984c3506882993065356eeef322df077d14f1 Author: Olivier Crête <olivier.crete@collabora.com> Date: Fri Nov 23 10:58:25 2012 +0100 pad: Put all of the probe types in the enum so they work with bindings https://bugzilla.gnome.org/show_bug.cgi?id=688804
sigh: GEN gstenumtypes.c /usr/bin/glib-mkenums: gstpad.h:476: Failed to parse ` GST_PAD_PROBE_TYPE_BLOCK), ' /usr/bin/glib-mkenums: gstpad.h:478: Failed to parse ` GST_PAD_PROBE_TYPE_BUFFER_LIST | GST_PAD_PROBE_TYPE_EVENT_DOWNSTREAM), ' /usr/bin/glib-mkenums: gstpad.h:481: Failed to parse ` GST_PAD_PROBE_TYPE_DATA_UPSTREAM), ' /usr/bin/glib-mkenums: gstpad.h:483: Failed to parse ` GST_PAD_PROBE_TYPE_DATA_DOWNSTREAM), ' /usr/bin/glib-mkenums: gstpad.h:485: Failed to parse ` GST_PAD_PROBE_TYPE_DATA_UPSTREAM), ' /usr/bin/glib-mkenums: gstpad.h:487: Failed to parse ` GST_PAD_PROBE_TYPE_EVENT_UPSTREAM), ' /usr/bin/glib-mkenums: gstpad.h:489: Failed to parse ` GST_PAD_PROBE_TYPE_QUERY_UPSTREAM), ' /usr/bin/glib-mkenums: gstpad.h:491: Failed to parse ` GST_PAD_PROBE_TYPE_QUERY_BOTH), ' /usr/bin/glib-mkenums: gstpad.h:493: Failed to parse ` GST_PAD_PROBE_TYPE_PULL) ' /usr/bin/glib-mkenums: gstpad.h:476: Failed to parse ` GST_PAD_PROBE_TYPE_BLOCK), ' /usr/bin/glib-mkenums: gstpad.h:478: Failed to parse ` GST_PAD_PROBE_TYPE_BUFFER_LIST | GST_PAD_PROBE_TYPE_EVENT_DOWNSTREAM), ' /usr/bin/glib-mkenums: gstpad.h:481: Failed to parse ` GST_PAD_PROBE_TYPE_DATA_UPSTREAM), ' /usr/bin/glib-mkenums: gstpad.h:483: Failed to parse ` GST_PAD_PROBE_TYPE_DATA_DOWNSTREAM), ' /usr/bin/glib-mkenums: gstpad.h:485: Failed to parse ` GST_PAD_PROBE_TYPE_DATA_UPSTREAM), ' /usr/bin/glib-mkenums: gstpad.h:487: Failed to parse ` GST_PAD_PROBE_TYPE_EVENT_UPSTREAM), ' /usr/bin/glib-mkenums: gstpad.h:489: Failed to parse ` GST_PAD_PROBE_TYPE_QUERY_UPSTREAM), ' /usr/bin/glib-mkenums: gstpad.h:491: Failed to parse ` GST_PAD_PROBE_TYPE_QUERY_BOTH), ' /usr/bin/glib-mkenums: gstpad.h:493: Failed to parse ` GST_PAD_PROBE_TYPE_PULL) ' make all-recursive
commit 32f96b922b56a0facdc55d8d21518d7994c8236d Author: Tim-Philipp Müller <tim@centricular.net> Date: Fri Nov 23 12:47:25 2012 +0000 pad: don't use parenthesis for ORed pad probe flag enums glib-mkenum doesn't like them for some reason. https://bugzilla.gnome.org/show_bug.cgi?id=688804