tests: Check ges_clip_set_position behaviour

+ Minor fix to handle properly the feature when clip is not in any layer

https://bugzilla.gnome.org/show_bug.cgi?id=731248
This commit is contained in:
Thibault Saunier 2014-06-05 03:48:12 +02:00
parent 6c717b27c6
commit 2db5368b9d
3 changed files with 12 additions and 11 deletions

View file

@ -95,7 +95,7 @@ _get_priority_range (GESContainer * container, guint32 * min_priority,
*min_priority = layer->min_gnl_priority;
*max_priority = layer->max_gnl_priority;
} else {
*min_priority = 0;
*min_priority = MIN_GNL_PRIO;
*max_priority = G_MAXUINT32;
}
}

View file

@ -2206,7 +2206,8 @@ trackelement_priority_changed_cb (GESTrackElement * child,
GST_ERROR_OBJECT (timeline,
"Changing a TrackElement prio, which would not "
"land in no layer we are controlling");
g_sequence_remove (iters->iter_by_layer);
if (iters->iter_by_layer)
g_sequence_remove (iters->iter_by_layer);
iters->iter_by_layer = NULL;
iters->layer = NULL;
} else {

View file

@ -460,21 +460,21 @@ GST_START_TEST (test_effects_priorities)
fail_unless (ges_container_add (GES_CONTAINER (clip),
GES_TIMELINE_ELEMENT (effect2)));
fail_unless_equals_int (0, _PRIORITY (effect));
fail_unless_equals_int (1, _PRIORITY (effect1));
fail_unless_equals_int (2, _PRIORITY (effect2));
fail_unless_equals_int (MIN_GNL_PRIO + 0, _PRIORITY (effect));
fail_unless_equals_int (MIN_GNL_PRIO + 1, _PRIORITY (effect1));
fail_unless_equals_int (MIN_GNL_PRIO + 2, _PRIORITY (effect2));
fail_unless (ges_clip_set_top_effect_priority (clip, GES_BASE_EFFECT (effect),
2));
fail_unless_equals_int (0, _PRIORITY (effect1));
fail_unless_equals_int (1, _PRIORITY (effect2));
fail_unless_equals_int (2, _PRIORITY (effect));
fail_unless_equals_int (MIN_GNL_PRIO + 0, _PRIORITY (effect1));
fail_unless_equals_int (MIN_GNL_PRIO + 1, _PRIORITY (effect2));
fail_unless_equals_int (MIN_GNL_PRIO + 2, _PRIORITY (effect));
fail_unless (ges_clip_set_top_effect_priority (clip, GES_BASE_EFFECT (effect),
0));
fail_unless_equals_int (0, _PRIORITY (effect));
fail_unless_equals_int (1, _PRIORITY (effect1));
fail_unless_equals_int (2, _PRIORITY (effect2));
fail_unless_equals_int (MIN_GNL_PRIO + 0, _PRIORITY (effect));
fail_unless_equals_int (MIN_GNL_PRIO + 1, _PRIORITY (effect1));
fail_unless_equals_int (MIN_GNL_PRIO + 2, _PRIORITY (effect2));
gst_object_unref (timeline);
}