summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorHenry Wilkes <hwilkes@igalia.com>2020-04-18 16:49:31 +0100
committerHenry Wilkes <hwilkes@igalia.com>2020-05-07 09:37:15 +0100
commita6b13ce61990f5b5e014b7bc294929beaa981815 (patch)
treeaa84f1279a8f78a71b1860f993d2d2cf367c2857 /tests
parent6617d7671036829e308273513eecb1869b37817c (diff)
group: fix priority setting
Stop moving the group if a child clip is being edited by timeline-tree, a child group is updating its own priority, or a layer that a clip is in has changed priority. A group should only move if a descendant moves layers outside of a timeline-tree edit, or the priority of the group is set by the user. Fixes https://gitlab.freedesktop.org/gstreamer/gst-editing-services/-/issues/89 Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-editing-services/-/merge_requests/169>
Diffstat (limited to 'tests')
-rw-r--r--tests/check/ges/group.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/tests/check/ges/group.c b/tests/check/ges/group.c
index 219d4899..c5dbc96c 100644
--- a/tests/check/ges/group.c
+++ b/tests/check/ges/group.c
@@ -516,13 +516,25 @@ GST_START_TEST (test_group_in_group_layer_moving)
CHECK_OBJECT_PROPS (group, 10, 0, 20);
assert_equals_int (GES_TIMELINE_ELEMENT_LAYER_PRIORITY (c), 0);
assert_equals_int (GES_TIMELINE_ELEMENT_LAYER_PRIORITY (c1), 1);
+ assert_equals_int (GES_TIMELINE_ELEMENT_LAYER_PRIORITY (group), 0);
ges_layer_set_priority (layer2, 0);
+ /* no change since none of the clips are in layer2 */
+ assert_equals_int (GES_TIMELINE_ELEMENT_LAYER_PRIORITY (c), 0);
+ assert_equals_int (GES_TIMELINE_ELEMENT_LAYER_PRIORITY (c1), 1);
+ assert_equals_int (GES_TIMELINE_ELEMENT_LAYER_PRIORITY (group), 0);
+
ges_layer_set_priority (layer, 1);
- ges_layer_set_priority (layer1, 2);
+ /* c's layer now has priority 1 (conflicts with layer1) */
+ assert_equals_int (GES_TIMELINE_ELEMENT_LAYER_PRIORITY (c), 1);
+ assert_equals_int (GES_TIMELINE_ELEMENT_LAYER_PRIORITY (c1), 1);
+ assert_equals_int (GES_TIMELINE_ELEMENT_LAYER_PRIORITY (group), 1);
+ ges_layer_set_priority (layer1, 2);
+ /* conflicting layer priorities now resolved */
assert_equals_int (GES_TIMELINE_ELEMENT_LAYER_PRIORITY (c), 1);
assert_equals_int (GES_TIMELINE_ELEMENT_LAYER_PRIORITY (c1), 2);
+ assert_equals_int (GES_TIMELINE_ELEMENT_LAYER_PRIORITY (group), 1);
/* Our timeline
*