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 668817 - [0.11] - problem with creating a structure
[0.11] - problem with creating a structure
Status: RESOLVED NOTABUG
Product: GStreamer
Classification: Platform
Component: gstreamer (core)
0.11.x
Other Linux
: Normal normal
: git master
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2012-01-27 09:09 UTC by Christian Fredrik Kalager Schaller
Modified: 2012-01-31 11:04 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Christian Fredrik Kalager Schaller 2012-01-27 09:09:38 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
Comment 1 Christian Fredrik Kalager Schaller 2012-01-31 11:04:39 UTC
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.