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 746320 - Can't set flags on Gst.Pad
Can't set flags on Gst.Pad
Status: RESOLVED OBSOLETE
Product: GStreamer
Classification: Platform
Component: gstreamer (core)
1.2.1
Other Linux
: Normal normal
: git master
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2015-03-17 00:04 UTC by Andrew
Modified: 2018-11-03 12:26 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Andrew 2015-03-17 00:04:04 UTC
There's no way to set flags on Gst.Pad.
Gst.Pad.flags is also an int, not an instance of Gst.PadFlags
Comment 1 Andrew 2015-03-17 00:04:17 UTC
>>> import gi
>>> gi.require_version('Gst', '1.0')
>>> from gi.repository import Gst
>>> 
>>> pad = Gst.Pad.new("in", Gst.PadDirection.SINK)
>>> pad.flags #not an instance of PadFlags?
32
>>> Gst.PadFlags(pad.flags)
<flags GST_PAD_FLAG_FLUSHING of type GstPadFlags>
>>> 
>>> pad.flags = Gst.PadFlags.PROXY_CAPS
Traceback (most recent call last):
  • File "<stdin>", line 1 in <module>
RuntimeError: unable to set value for field
>>> 
>>> pad.flags |= Gst.PadFlags.PROXY_CAPS
Traceback (most recent call last):
  • File "<stdin>", line 1 in <module>
RuntimeError: unable to set value for field

Comment 2 Jan Schmidt 2015-03-17 01:39:02 UTC
The problem here is the GstPadFlags are just an extended set of values for the GstObjectFlags, and get stored in the generic guint32 flags field of GstObject.

I guess this would have to be patched up in the python g-i overrides.
Comment 3 Olivier Crête 2015-03-17 01:41:07 UTC
The reason is that flags is not in the GstPad structure, it's in the base GstObject.

I though you'd have to do something like:
 pad.flags = pad.flags | int(Gst.PadFlags.PROXY_CAPS)

But that doesn't seem to work, we should probably add a real gst_pad_set_proxy_caps() function for bindings and for the other flags too. Or maybe just generic gst_pad_{set,unset,is_set]}_flags (GstPad *pad, GstPadFlags flags); ?
Comment 4 Andrew 2015-03-17 01:52:15 UTC
>>> pad.flags = pad.flags
Traceback (most recent call last):
  • File "<stdin>", line 1 in <module>
RuntimeError: unable to set value for field

Far as i can tell it's not possible to set any vale for flags on any Gst.Object
Comment 5 Thibault Saunier 2015-03-17 10:16:42 UTC
For what is worth that works just fine here (all gst on master, pygi 3.14.0):

In [34]: pad = Gst.Pad.new("in", Gst.PadDirection.SINK)

In [35]: pad.flags #not an instance of PadFlags?
Out[35]: <flags GST_PAD_FLAG_FLUSHING of type GstPadFlags>

In [36]: Gst.PadFlags(pad.flags)
Out[36]: <flags GST_PAD_FLAG_FLUSHING of type GstPadFlags>

In [37]: pad.flags = Gst.PadFlags.PROXY_CAPS

In [38]: pad.flags |= Gst.PadFlags.PROXY_CAPS

In [39]: pad.flags
Out[39]: <flags GST_PAD_FLAG_PROXY_CAPS of type GstPadFlags>
Comment 6 Tim-Philipp Müller 2015-03-17 10:46:12 UTC
For me [35] shows "32L" and [37] fails, while [36] shows the same. Also master with pygi 3.14 (as on debian sid)
Comment 7 Tim-Philipp Müller 2016-11-14 11:01:25 UTC
So what shall we do here?

> we should probably add a real gst_pad_set_proxy_caps()
> function for bindings and for the other flags too.

Yes, always hated those flag set macros.


> Or maybe just generic gst_pad_{set,unset,is_set]}_flags()

Maybe a gst_object_{set,unset}_flags() then? Or would that again not work because different enum types from a python pov?
Comment 8 GStreamer system administrator 2018-11-03 12:26:08 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org'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.freedesktop.org/gstreamer/gstreamer/issues/100.