GNOME Bugzilla – Bug 746320
Can't set flags on Gst.Pad
Last modified: 2018-11-03 12:26:08 UTC
There's no way to set flags on Gst.Pad. Gst.Pad.flags is also an int, not an instance of Gst.PadFlags
>>> 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):
+ Trace 234861
>>> >>> pad.flags |= Gst.PadFlags.PROXY_CAPS Traceback (most recent call last):
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.
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); ?
>>> pad.flags = pad.flags Traceback (most recent call last):
+ Trace 234862
Far as i can tell it's not possible to set any vale for flags on any Gst.Object
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>
For me [35] shows "32L" and [37] fails, while [36] shows the same. Also master with pygi 3.14 (as on debian sid)
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?
-- 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.