ges: Allow setting children property using the set_object_arg format
authorThibault Saunier <tsaunier@igalia.com>
Thu, 20 Feb 2020 15:22:19 +0000 (12:22 -0300)
committerThibault Saunier <tsaunier@igalia.com>
Tue, 25 Feb 2020 20:44:51 +0000 (17:44 -0300)
This make it much simpler for the user to set enum values and should not cause any issue

ges/ges-timeline-element.c

index 4764cee..21ff79f 100644 (file)
@@ -119,7 +119,11 @@ static void
 _set_child_property (GESTimelineElement * self G_GNUC_UNUSED, GObject * child,
     GParamSpec * pspec, GValue * value)
 {
-  g_object_set_property (child, pspec->name, value);
+  if (G_VALUE_TYPE (value) != pspec->value_type
+      && G_VALUE_TYPE (value) == G_TYPE_STRING)
+    gst_util_set_object_arg (child, pspec->name, g_value_get_string (value));
+  else
+    g_object_set_property (child, pspec->name, value);
 }
 
 static gboolean