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 720023 - [pitivi] GStreamer effect properties are received in random order
[pitivi] GStreamer effect properties are received in random order
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-editing-services
git master
Other Linux
: Normal normal
: 1.3.90
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks: 682886
 
 
Reported: 2013-12-07 01:47 UTC by Jean-François Fortin Tam
Modified: 2014-09-23 09:15 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
trackelement: Sort paramspec by name in list_children_properties (1.45 KB, patch)
2014-03-20 16:10 UTC, Thibault Saunier
committed Details | Review

Description Jean-François Fortin Tam 2013-12-07 01:47:48 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 :)
Comment 1 Jean-François Fortin Tam 2013-12-07 04:40:36 UTC
For now I'll venture a guess that this is a bug in pygobject rather than gstreamer...
Comment 2 Christoph Reiter (lazka) 2013-12-07 07:28:32 UTC
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.
Comment 3 Christoph Reiter (lazka) 2013-12-07 10:04:58 UTC
s/GObject.Object.list_properties/GObject.list_properties/
Comment 4 Nicolas Dufresne (ndufresne) 2013-12-07 15:15:59 UTC
Ok, then it seems logical to sort the list in PiTiVi, isn't it trivial in Python ? Or I'm missing something ...
Comment 5 Simon Feltman 2013-12-08 09:08:40 UTC
Jean-François,

Are you controlling the property creation or are the properties coming from Gst objects? Also is this using GObject.list_properties?
Comment 6 Jean-François Fortin Tam 2013-12-08 19:33:58 UTC
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...
Comment 7 Nicolas Dufresne (ndufresne) 2013-12-08 23:39:27 UTC
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 ?
Comment 8 Jean-François Fortin Tam 2013-12-09 01:02:24 UTC
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
Comment 9 Thibault Saunier 2014-03-20 16:10:01 UTC
Created attachment 272495 [details] [review]
trackelement: Sort paramspec by name in list_children_properties
Comment 10 Mathieu Duponchelle 2014-06-06 14:32:23 UTC
Review of attachment 272495 [details] [review]:

OK
Comment 11 Thibault Saunier 2014-06-09 14:16:49 UTC
Attachment 272495 [details] pushed as edd95cf - trackelement: Sort paramspec by name in list_children_properties