GNOME Bugzilla – Bug 720023
[pitivi] GStreamer effect properties are received in random order
Last modified: 2014-09-23 09:15:46 UTC
In Pitivi, we dynamically create UIs to display all the properties of a given effect. We use (as far as I know) the same kind of system for listing the properties of each codec/encoder. In the 0.15.x series using static Python bindings (GStreamer 0.10.x + the old gst-python), the properties were always provided to us (the application) in the exact same order. I have verified this recently with the old Pitivi. In the new Pitivi using (py)gobject introspection, the properties are given to us in a random order each time. To reproduce this in Pitivi git (or 0.91 and newer): 1. Put a clip in your timeline 2. Drag the "AgingTV" effect to its clip properties 3. Take note of the order of the properties 4. Close pitivi and start it again 5. Repeat steps 1-3 I'm not sure who's to blame for this one :)
For now I'll venture a guess that this is a bug in pygobject rather than gstreamer...
In case you're talking about GObject.Object.list_properties: this maps directly to either g_object_interface_list_properties or g_object_class_list_properties, and both don't specify any order afaics.
s/GObject.Object.list_properties/GObject.list_properties/
Ok, then it seems logical to sort the list in PiTiVi, isn't it trivial in Python ? Or I'm missing something ...
Jean-François, Are you controlling the property creation or are the properties coming from Gst objects? Also is this using GObject.list_properties?
Hi Simon, Christoph: in https://git.gnome.org/browse/pitivi/tree/pitivi/effects.py#n610 we do: for prop in element.list_children_properties(): self._current_element_values[prop.name] = element.get_child_property(prop.name) (pardon the 2nd line's length wrangling here) Here, element is an "Effect" object <GESEffect>. GES being C and based on GObject, I am supposing that this is using GObject.list_properties...
Arg, just look a bit at the code in GES, it seems it might be iterating on a GHashTable of props built internally. This will give random order. It might have nothing to do with GObject Introspection. Can you retest by doing a gst_element_factory_make ... of these element and see if you get better results ?
Ok, that absolves pygobject/g-i from suspicion; the blame is now to be pointed at GES :) While we're at it, would be good to check if there are other places in GES' code where we potentially mangle the order of properties like that. As far as I can tell (from looking at Pitivi's behavior), this doesn't seem to affect the properties of the encoders (whew). --------- <nekohayo> you could probably make [a proof-of-concept script] to demonstrate the randomness vs non-randomness of GESeffect vs creating the element directly... [but] since you've spotted the ghashtable, does this even need proof anyway? <stormer> I can confirm that GObject.list_properties() return the same order seen in gst-inspect, which is definition order
Created attachment 272495 [details] [review] trackelement: Sort paramspec by name in list_children_properties
Review of attachment 272495 [details] [review]: OK
Attachment 272495 [details] pushed as edd95cf - trackelement: Sort paramspec by name in list_children_properties