GNOME Bugzilla – Bug 668817
[0.11] - problem with creating a structure
Last modified: 2012-01-31 11:04:39 UTC
Getting weird errors when creating a structure from String, even with Edwards annotation fixes. Below are output from ipython demonstrating the issue. In [1]: from gi.repository import Gst In [2]: remuxcaps = Gst.Caps() In [3]: remuxcaps.append_structure(Gst.Structure.from_string("video/x-raw")) --------------------------------------------------------------------------- TypeError Traceback (most recent call last) /home/cschalle/devel/transmageddon/src/<ipython-input-3-c70b3a36a28d> in <module>() ----> 1 remuxcaps.append_structure(Gst.Structure.from_string("video/x-raw")) /usr/lib/python2.7/site-packages/gi/types.pyc in function(*args, **kwargs) 41 42 def function(*args, **kwargs): ---> 43 return info.invoke(*args, **kwargs) 44 function.__info__ = info 45 function.__name__ = info.get_name() TypeError: Expected Gst.Structure, but got StructMeta In [4]: test=Gst.Str Gst.StreamError Gst.Structure Gst.StructureForeachFunc Gst.StreamStatusType Gst.StructureChangeType Gst.StructureMapFunc In [4]: test=Gst.Structure.from_string("video/x-raw") In [5]: print test (<GstStructure at 0xa21ec00>, '') In [6]: remuxcaps.ap remuxcaps.append remuxcaps.append_structure In [6]: remuxcaps.append_structure(test) --------------------------------------------------------------------------- TypeError Traceback (most recent call last) /home/cschalle/devel/transmageddon/src/<ipython-input-6-c5b3a04c305f> in <module>() ----> 1 remuxcaps.append_structure(test) /usr/lib/python2.7/site-packages/gi/types.pyc in function(*args, **kwargs) 41 42 def function(*args, **kwargs): ---> 43 return info.invoke(*args, **kwargs) 44 function.__info__ = info 45 function.__name__ = info.get_name() TypeError: Expected Gst.Structure, but got StructMeta
This is not a bug, but just how the GI API works, giving a tupple instead of the actual value. Have GI bug filed asking for an annotation to avoid it.