After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 688804 - Getting error trying to add a pad_probe
Getting error trying to add a pad_probe
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gstreamer (core)
1.x
Other Linux
: Normal normal
: 1.0.4
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2012-11-21 12:20 UTC by Christian Fredrik Kalager Schaller
Modified: 2012-11-24 14:01 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
pad: Put all of the probe types in the enum so they work with bindings (3.29 KB, patch)
2012-11-23 10:02 UTC, Olivier Crête
committed Details | Review

Description Christian Fredrik Kalager Schaller 2012-11-21 12:20:23 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.
Comment 1 Tim-Philipp Müller 2012-11-23 00:21:23 UTC
Does it work with Gst.PAD_PROBE_TYPE_EVENT_DOWNSTREAM ?

Might it be because _BOTH is a #define and not part of the enum?
Comment 2 Christian Fredrik Kalager Schaller 2012-11-23 08:15:32 UTC
I am getting this error:
Traceback (most recent call last):
  • File "/home/cschalle/devel/transmageddon/src/transcoder_engine.py", line 399 in OnDynamicPad
    src_pad.add_probe(Gst.PAD_PROBE_TYPE_EVENT_DOWNSTREAM, self.padprobe, "user data")
  • File "/usr/lib64/python3.2/site-packages/gi/module.py", line 243 in __getattr__
    return getattr(self._introspection_module, name)
  • File "/usr/lib64/python3.2/site-packages/gi/module.py", line 105 in __getattr__
    self.__name__, name))
AttributeError: 'gi.repository.Gst' object has no attribute 'PAD_PROBE_TYPE_EVENT_DOWNSTREAM'


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?
Comment 3 Olivier Crête 2012-11-23 08:21:03 UTC
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.
Comment 4 Christian Fredrik Kalager Schaller 2012-11-23 09:39:23 UTC
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?
Comment 5 Tim-Philipp Müller 2012-11-23 09:56:03 UTC
Let's leave it open for now.
Comment 6 Olivier Crête 2012-11-23 10:02:46 UTC
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.
Comment 7 Olivier Crête 2012-11-23 12:31:40 UTC
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
Comment 8 Tim-Philipp Müller 2012-11-23 12:41:42 UTC
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
Comment 9 Tim-Philipp Müller 2012-11-23 12:49:45 UTC
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