From 5575d9cb0287feb57d11f61046c448606f2adc8c Mon Sep 17 00:00:00 2001 From: Thibault Saunier Date: Tue, 20 Jun 2023 16:36:38 -0400 Subject: [PATCH] ges: launcher: Make +effect stack effects from source to last effect added Until now when doing `+test-clip blue +effect effect1 + effect effect2` leaded to the following pseudo pipeline videotestsrc ! effect2 ! effect1 given the `ges-launch` syntax this is quite unexpected and this needed fixing Part-of: --- .../ges/ges-structured-interface.c | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/subprojects/gst-editing-services/ges/ges-structured-interface.c b/subprojects/gst-editing-services/ges/ges-structured-interface.c index c3b090c7ea..9b9515be56 100644 --- a/subprojects/gst-editing-services/ges/ges-structured-interface.c +++ b/subprojects/gst-editing-services/ges/ges-structured-interface.c @@ -987,9 +987,23 @@ _ges_container_add_child_from_struct (GESTimeline * timeline, } - res = ges_container_add (container, child); + if (GES_IS_CLIP (container) && GES_IS_BASE_EFFECT (child)) { + GList *effects = ges_clip_get_top_effects (GES_CLIP (container)); + + res = + ges_clip_add_top_effect (GES_CLIP (container), GES_BASE_EFFECT (child), + 0, error); + + g_list_free_full (effects, gst_object_unref); + } else { + res = ges_container_add (container, child); + } + if (res == FALSE) { - g_error_new (GES_ERROR, 0, "Could not add child to container"); + if (!*error) + *error = g_error_new (GES_ERROR, 0, "Could not add child to container"); + + goto beach; } else { g_object_set_qdata (G_OBJECT (timeline), LAST_CHILD_QDATA, child); }