AttributeError: 'StructureWrapper' object has no attribute 'get_name'
I can see that python: Fix pulling events from appsink (!9148) · Merge requests · GStreamer / gstreamer · GitLab is related but I’m not sure what we should be doing. I couldn’t find anything in the 1.26.x release notes about this. Was this an accidental API breakage that we need a temporary (realistically, semi-permanent) workaround/hack for, or should we need to change more of our codeto support this going forward? We have to support a wide range of GStreamer versions so we need something compatible for how it used to work also.
To get the underlying structure instead of the wrapper you can write get_structure()._StructureWrapper__structure.get_name. I don’t know if that is fixed in the later versions, but the above workaround patched the problem for me.
Sorry for the delay, yes it looks to be fixed. Thanks. We’ll add a helper function to access the name which will try both ways as required. We have some places where we pass messages by creating a Structure with Gst.Structure.new_empty("foo") and send it as an Application message. When we later read these, regardless of the Gst version they are obviously Structure types, not StructureWrapper types like the other places in our event handler. So our helper can’t just look at the Gst version, we have to try the “old way”, and if that fails we fall-back to the context manager method. And that’s fine.