mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-23 08:46:40 +00:00
ges: Make space in the GESTracks to be able to add mixing elements later
And update the tests
This commit is contained in:
parent
d6a2f90a17
commit
55b7628382
18 changed files with 92 additions and 62 deletions
|
@ -41,8 +41,8 @@ neighbour_changed_cb (GESClip * clip, GParamSpec * arg G_GNUC_UNUSED,
|
||||||
{
|
{
|
||||||
gint64 new_duration;
|
gint64 new_duration;
|
||||||
|
|
||||||
if (_PRIORITY (self->next_source) / LAYER_HEIGHT !=
|
if (_ges_track_element_get_layer_priority (self->next_source) !=
|
||||||
_PRIORITY (self->previous_source) / LAYER_HEIGHT) {
|
_ges_track_element_get_layer_priority (self->previous_source)) {
|
||||||
GST_DEBUG_OBJECT (self, "Destroy changed layer");
|
GST_DEBUG_OBJECT (self, "Destroy changed layer");
|
||||||
g_signal_emit (self, auto_transition_signals[DESTROY_ME], 0);
|
g_signal_emit (self, auto_transition_signals[DESTROY_ME], 0);
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -148,7 +148,8 @@ _add_child (GESContainer * container, GESTimelineElement * element)
|
||||||
|
|
||||||
GST_DEBUG_OBJECT (container, "Adding %ith effect: %" GST_PTR_FORMAT
|
GST_DEBUG_OBJECT (container, "Adding %ith effect: %" GST_PTR_FORMAT
|
||||||
" Priority %i", priv->nb_effects + 1, element,
|
" Priority %i", priv->nb_effects + 1, element,
|
||||||
GES_TIMELINE_ELEMENT_PRIORITY (container) + priv->nb_effects);
|
min_prio + GES_TIMELINE_ELEMENT_PRIORITY (container) +
|
||||||
|
priv->nb_effects);
|
||||||
|
|
||||||
tmp = g_list_nth (GES_CONTAINER_CHILDREN (container), priv->nb_effects);
|
tmp = g_list_nth (GES_CONTAINER_CHILDREN (container), priv->nb_effects);
|
||||||
for (; tmp; tmp = tmp->next)
|
for (; tmp; tmp = tmp->next)
|
||||||
|
@ -909,18 +910,20 @@ ges_clip_set_top_effect_priority (GESClip * clip,
|
||||||
track_element = GES_TRACK_ELEMENT (effect);
|
track_element = GES_TRACK_ELEMENT (effect);
|
||||||
current_prio = _PRIORITY (track_element);
|
current_prio = _PRIORITY (track_element);
|
||||||
|
|
||||||
|
/* FIXME, do we actually want to change what the user is telling us to do? */
|
||||||
|
newpriority = newpriority + MIN_GNL_PRIO;
|
||||||
/* We don't change the priority */
|
/* We don't change the priority */
|
||||||
if (current_prio == newpriority ||
|
if (current_prio == newpriority ||
|
||||||
(G_UNLIKELY (GES_CLIP (GES_TIMELINE_ELEMENT_PARENT (track_element)) !=
|
(G_UNLIKELY (GES_CLIP (GES_TIMELINE_ELEMENT_PARENT (track_element)) !=
|
||||||
clip)))
|
clip)))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
if (newpriority > (clip->priv->nb_effects - 1)) {
|
if (newpriority > (clip->priv->nb_effects - 1 + MIN_GNL_PRIO)) {
|
||||||
GST_DEBUG ("You are trying to make %p not a top effect", effect);
|
GST_DEBUG ("You are trying to make %p not a top effect", effect);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (current_prio > clip->priv->nb_effects) {
|
if (current_prio > clip->priv->nb_effects + MIN_GNL_PRIO) {
|
||||||
GST_DEBUG ("%p is not a top effect", effect);
|
GST_DEBUG ("%p is not a top effect", effect);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
|
@ -34,6 +34,11 @@
|
||||||
GST_DEBUG_CATEGORY_EXTERN (_ges_debug);
|
GST_DEBUG_CATEGORY_EXTERN (_ges_debug);
|
||||||
#define GST_CAT_DEFAULT _ges_debug
|
#define GST_CAT_DEFAULT _ges_debug
|
||||||
|
|
||||||
|
/* The first 2 GNL priorities are used for:
|
||||||
|
* 0- The Mixing element
|
||||||
|
* 1- The Gaps
|
||||||
|
*/
|
||||||
|
#define MIN_GNL_PRIO 2
|
||||||
#define LAYER_HEIGHT 1000
|
#define LAYER_HEIGHT 1000
|
||||||
|
|
||||||
#define _START(obj) GES_TIMELINE_ELEMENT_START (obj)
|
#define _START(obj) GES_TIMELINE_ELEMENT_START (obj)
|
||||||
|
@ -257,6 +262,7 @@ GList* ges_clip_create_track_elements (GESClip *clip, GESTrackType t
|
||||||
/****************************************************
|
/****************************************************
|
||||||
* GESTrackElement *
|
* GESTrackElement *
|
||||||
****************************************************/
|
****************************************************/
|
||||||
gboolean ges_track_element_set_track (GESTrackElement * object, GESTrack * track);
|
G_GNUC_INTERNAL gboolean ges_track_element_set_track (GESTrackElement * object, GESTrack * track);
|
||||||
|
G_GNUC_INTERNAL guint32 _ges_track_element_get_layer_priority (GESTrackElement * element);
|
||||||
|
|
||||||
#endif /* __GES_INTERNAL_H__ */
|
#endif /* __GES_INTERNAL_H__ */
|
||||||
|
|
|
@ -200,8 +200,8 @@ ges_layer_init (GESLayer * self)
|
||||||
|
|
||||||
self->priv->priority = 0;
|
self->priv->priority = 0;
|
||||||
self->priv->auto_transition = FALSE;
|
self->priv->auto_transition = FALSE;
|
||||||
self->min_gnl_priority = 0;
|
self->min_gnl_priority = MIN_GNL_PRIO;
|
||||||
self->max_gnl_priority = LAYER_HEIGHT;
|
self->max_gnl_priority = LAYER_HEIGHT + MIN_GNL_PRIO;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -343,8 +343,8 @@ ges_layer_set_priority (GESLayer * layer, guint priority)
|
||||||
|
|
||||||
if (priority != layer->priv->priority) {
|
if (priority != layer->priv->priority) {
|
||||||
layer->priv->priority = priority;
|
layer->priv->priority = priority;
|
||||||
layer->min_gnl_priority = (priority * LAYER_HEIGHT);
|
layer->min_gnl_priority = (priority * LAYER_HEIGHT) + MIN_GNL_PRIO;
|
||||||
layer->max_gnl_priority = ((priority + 1) * LAYER_HEIGHT) - 1;
|
layer->max_gnl_priority = ((priority + 1) * LAYER_HEIGHT) + MIN_GNL_PRIO;
|
||||||
|
|
||||||
ges_layer_resync_priorities (layer);
|
ges_layer_resync_priorities (layer);
|
||||||
}
|
}
|
||||||
|
|
|
@ -165,7 +165,7 @@ gstl_recalculate (GESSimpleLayer * self)
|
||||||
gboolean valid = TRUE;
|
gboolean valid = TRUE;
|
||||||
GESSimpleLayerPrivate *priv = self->priv;
|
GESSimpleLayerPrivate *priv = self->priv;
|
||||||
|
|
||||||
priority = GES_LAYER (self)->min_gnl_priority + 2;
|
priority = GES_LAYER (self)->min_gnl_priority;
|
||||||
|
|
||||||
GST_DEBUG ("recalculating values");
|
GST_DEBUG ("recalculating values");
|
||||||
|
|
||||||
|
|
|
@ -809,7 +809,7 @@ _create_transitions_on_layer (GESTimeline * timeline, GESLayer * layer,
|
||||||
start_or_end);
|
start_or_end);
|
||||||
|
|
||||||
/* Only object that are in that layer and track */
|
/* Only object that are in that layer and track */
|
||||||
if ((_PRIORITY (next) / LAYER_HEIGHT) != layer_prio ||
|
if (_ges_track_element_get_layer_priority (next) != layer_prio ||
|
||||||
(track && track != ges_track_element_get_track (next)))
|
(track && track != ges_track_element_get_track (next)))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
@ -870,7 +870,7 @@ create_transitions (GESTimeline * timeline, GESTrackElement * track_element)
|
||||||
|
|
||||||
track = ges_track_element_get_track (track_element);
|
track = ges_track_element_get_track (track_element);
|
||||||
layer_node = g_list_find_custom (timeline->layers,
|
layer_node = g_list_find_custom (timeline->layers,
|
||||||
GINT_TO_POINTER (_PRIORITY (track_element) / LAYER_HEIGHT),
|
GINT_TO_POINTER (_ges_track_element_get_layer_priority (track_element)),
|
||||||
(GCompareFunc) find_layer_by_prio);
|
(GCompareFunc) find_layer_by_prio);
|
||||||
|
|
||||||
_create_transitions_on_layer (timeline,
|
_create_transitions_on_layer (timeline,
|
||||||
|
@ -945,7 +945,7 @@ start_tracking_track_element (GESTimeline * timeline,
|
||||||
TrackObjIters *iters;
|
TrackObjIters *iters;
|
||||||
GESTimelinePrivate *priv = timeline->priv;
|
GESTimelinePrivate *priv = timeline->priv;
|
||||||
|
|
||||||
guint layer_prio = _PRIORITY (trackelement) / LAYER_HEIGHT;
|
guint layer_prio = _ges_track_element_get_layer_priority (trackelement);
|
||||||
GList *layer_node = g_list_find_custom (timeline->layers,
|
GList *layer_node = g_list_find_custom (timeline->layers,
|
||||||
GINT_TO_POINTER (layer_prio), (GCompareFunc) find_layer_by_prio);
|
GINT_TO_POINTER (layer_prio), (GCompareFunc) find_layer_by_prio);
|
||||||
GESLayer *layer = layer_node ? layer_node->data : NULL;
|
GESLayer *layer = layer_node ? layer_node->data : NULL;
|
||||||
|
@ -2012,7 +2012,7 @@ trackelement_priority_changed_cb (GESTrackElement * child,
|
||||||
GESTimelinePrivate *priv = timeline->priv;
|
GESTimelinePrivate *priv = timeline->priv;
|
||||||
|
|
||||||
GList *layer_node = g_list_find_custom (timeline->layers,
|
GList *layer_node = g_list_find_custom (timeline->layers,
|
||||||
GINT_TO_POINTER (_PRIORITY (child) / LAYER_HEIGHT),
|
GINT_TO_POINTER (_ges_track_element_get_layer_priority (child)),
|
||||||
(GCompareFunc) find_layer_by_prio);
|
(GCompareFunc) find_layer_by_prio);
|
||||||
GESLayer *layer = layer_node ? layer_node->data : NULL;
|
GESLayer *layer = layer_node ? layer_node->data : NULL;
|
||||||
TrackObjIters *iters = g_hash_table_lookup (priv->obj_iters,
|
TrackObjIters *iters = g_hash_table_lookup (priv->obj_iters,
|
||||||
|
|
|
@ -274,7 +274,7 @@ ges_track_element_init (GESTrackElement * self)
|
||||||
priv->pending_start = 0;
|
priv->pending_start = 0;
|
||||||
priv->pending_inpoint = 0;
|
priv->pending_inpoint = 0;
|
||||||
priv->pending_duration = GST_SECOND;
|
priv->pending_duration = GST_SECOND;
|
||||||
priv->pending_priority = 1;
|
priv->pending_priority = MIN_GNL_PRIO;
|
||||||
priv->pending_active = TRUE;
|
priv->pending_active = TRUE;
|
||||||
priv->properties_hashtable = NULL;
|
priv->properties_hashtable = NULL;
|
||||||
priv->bindings_hashtable = g_hash_table_new_full (g_str_hash, g_str_equal,
|
priv->bindings_hashtable = g_hash_table_new_full (g_str_hash, g_str_equal,
|
||||||
|
@ -340,6 +340,12 @@ _set_priority (GESTimelineElement * element, guint32 priority)
|
||||||
{
|
{
|
||||||
GESTrackElement *object = GES_TRACK_ELEMENT (element);
|
GESTrackElement *object = GES_TRACK_ELEMENT (element);
|
||||||
|
|
||||||
|
if (priority <= MIN_GNL_PRIO) {
|
||||||
|
GST_INFO_OBJECT (element, "Priority (%d) < MIN_GNL_PRIO, setting it to %d",
|
||||||
|
priority, MIN_GNL_PRIO);
|
||||||
|
priority = MIN_GNL_PRIO;
|
||||||
|
}
|
||||||
|
|
||||||
GST_DEBUG ("object:%p, priority:%" G_GUINT32_FORMAT, object, priority);
|
GST_DEBUG ("object:%p, priority:%" G_GUINT32_FORMAT, object, priority);
|
||||||
|
|
||||||
if (object->priv->gnlobject != NULL) {
|
if (object->priv->gnlobject != NULL) {
|
||||||
|
@ -663,6 +669,15 @@ ges_track_element_get_bindings_hashtable (GESTrackElement * trackelement)
|
||||||
return priv->bindings_hashtable;
|
return priv->bindings_hashtable;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
guint32
|
||||||
|
_ges_track_element_get_layer_priority (GESTrackElement * element)
|
||||||
|
{
|
||||||
|
if (_PRIORITY (element) < LAYER_HEIGHT + MIN_GNL_PRIO)
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
return (_PRIORITY (element) - MIN_GNL_PRIO) / LAYER_HEIGHT;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ges_track_element_get_track:
|
* ges_track_element_get_track:
|
||||||
* @object: a #GESTrackElement
|
* @object: a #GESTrackElement
|
||||||
|
|
|
@ -143,7 +143,7 @@ gap_new (GESTrack * track, GstClockTime start, GstClockTime duration)
|
||||||
|
|
||||||
|
|
||||||
g_object_set (gnlsrc, "start", new_gap->start, "duration", new_gap->duration,
|
g_object_set (gnlsrc, "start", new_gap->start, "duration", new_gap->duration,
|
||||||
"priority", 0, NULL);
|
"priority", 1, NULL);
|
||||||
|
|
||||||
GST_DEBUG_OBJECT (track,
|
GST_DEBUG_OBJECT (track,
|
||||||
"Created gap with start %" GST_TIME_FORMAT " duration %" GST_TIME_FORMAT,
|
"Created gap with start %" GST_TIME_FORMAT " duration %" GST_TIME_FORMAT,
|
||||||
|
|
|
@ -85,7 +85,7 @@ GST_START_TEST (test_test_source_properties)
|
||||||
fail_unless (ges_timeline_commit (timeline));
|
fail_unless (ges_timeline_commit (timeline));
|
||||||
/* And let's also check that it propagated correctly to GNonLin */
|
/* And let's also check that it propagated correctly to GNonLin */
|
||||||
gnl_object_check (ges_track_element_get_gnlobject (trackelement), 42, 51, 12,
|
gnl_object_check (ges_track_element_get_gnlobject (trackelement), 42, 51, 12,
|
||||||
51, 0, TRUE);
|
51, MIN_GNL_PRIO, TRUE);
|
||||||
|
|
||||||
/* Change more properties, see if they propagate */
|
/* Change more properties, see if they propagate */
|
||||||
g_object_set (clip, "start", (guint64) 420, "duration", (guint64) 510,
|
g_object_set (clip, "start", (guint64) 420, "duration", (guint64) 510,
|
||||||
|
@ -100,17 +100,17 @@ GST_START_TEST (test_test_source_properties)
|
||||||
fail_unless (ges_timeline_commit (timeline));
|
fail_unless (ges_timeline_commit (timeline));
|
||||||
/* And let's also check that it propagated correctly to GNonLin */
|
/* And let's also check that it propagated correctly to GNonLin */
|
||||||
gnl_object_check (ges_track_element_get_gnlobject (trackelement), 420, 510,
|
gnl_object_check (ges_track_element_get_gnlobject (trackelement), 420, 510,
|
||||||
120, 510, 0, TRUE);
|
120, 510, MIN_GNL_PRIO + 0, TRUE);
|
||||||
|
|
||||||
/* Test mute support */
|
/* Test mute support */
|
||||||
g_object_set (clip, "mute", TRUE, NULL);
|
g_object_set (clip, "mute", TRUE, NULL);
|
||||||
fail_unless (ges_timeline_commit (timeline));
|
fail_unless (ges_timeline_commit (timeline));
|
||||||
gnl_object_check (ges_track_element_get_gnlobject (trackelement), 420, 510,
|
gnl_object_check (ges_track_element_get_gnlobject (trackelement), 420, 510,
|
||||||
120, 510, 0, FALSE);
|
120, 510, MIN_GNL_PRIO + 0, FALSE);
|
||||||
g_object_set (clip, "mute", FALSE, NULL);
|
g_object_set (clip, "mute", FALSE, NULL);
|
||||||
fail_unless (ges_timeline_commit (timeline));
|
fail_unless (ges_timeline_commit (timeline));
|
||||||
gnl_object_check (ges_track_element_get_gnlobject (trackelement), 420, 510,
|
gnl_object_check (ges_track_element_get_gnlobject (trackelement), 420, 510,
|
||||||
120, 510, 0, TRUE);
|
120, 510, MIN_GNL_PRIO + 0, TRUE);
|
||||||
|
|
||||||
ges_container_remove (GES_CONTAINER (clip),
|
ges_container_remove (GES_CONTAINER (clip),
|
||||||
GES_TIMELINE_ELEMENT (trackelement));
|
GES_TIMELINE_ELEMENT (trackelement));
|
||||||
|
|
|
@ -85,7 +85,7 @@ GST_START_TEST (test_object_properties)
|
||||||
|
|
||||||
/* And let's also check that it propagated correctly to GNonLin */
|
/* And let's also check that it propagated correctly to GNonLin */
|
||||||
gnl_object_check (ges_track_element_get_gnlobject (trackelement), 42, 51, 12,
|
gnl_object_check (ges_track_element_get_gnlobject (trackelement), 42, 51, 12,
|
||||||
51, 0, TRUE);
|
51, MIN_GNL_PRIO, TRUE);
|
||||||
|
|
||||||
/* Change more properties, see if they propagate */
|
/* Change more properties, see if they propagate */
|
||||||
g_object_set (clip, "start", (guint64) 420, "duration", (guint64) 510,
|
g_object_set (clip, "start", (guint64) 420, "duration", (guint64) 510,
|
||||||
|
@ -100,7 +100,7 @@ GST_START_TEST (test_object_properties)
|
||||||
/* And let's also check that it propagated correctly to GNonLin */
|
/* And let's also check that it propagated correctly to GNonLin */
|
||||||
ges_timeline_commit (timeline);
|
ges_timeline_commit (timeline);
|
||||||
gnl_object_check (ges_track_element_get_gnlobject (trackelement), 420, 510,
|
gnl_object_check (ges_track_element_get_gnlobject (trackelement), 420, 510,
|
||||||
120, 510, 0, TRUE);
|
120, 510, MIN_GNL_PRIO + 0, TRUE);
|
||||||
|
|
||||||
|
|
||||||
/* This time, we move the trackelement to see if the changes move
|
/* This time, we move the trackelement to see if the changes move
|
||||||
|
@ -110,7 +110,7 @@ GST_START_TEST (test_object_properties)
|
||||||
assert_equals_uint64 (_START (clip), 400);
|
assert_equals_uint64 (_START (clip), 400);
|
||||||
assert_equals_uint64 (_START (trackelement), 400);
|
assert_equals_uint64 (_START (trackelement), 400);
|
||||||
gnl_object_check (ges_track_element_get_gnlobject (trackelement), 400, 510,
|
gnl_object_check (ges_track_element_get_gnlobject (trackelement), 400, 510,
|
||||||
120, 510, 0, TRUE);
|
120, 510, MIN_GNL_PRIO + 0, TRUE);
|
||||||
|
|
||||||
ges_container_remove (GES_CONTAINER (clip),
|
ges_container_remove (GES_CONTAINER (clip),
|
||||||
GES_TIMELINE_ELEMENT (trackelement));
|
GES_TIMELINE_ELEMENT (trackelement));
|
||||||
|
@ -164,7 +164,7 @@ GST_START_TEST (test_split_object)
|
||||||
|
|
||||||
/* And let's also check that it propagated correctly to GNonLin */
|
/* And let's also check that it propagated correctly to GNonLin */
|
||||||
gnl_object_check (ges_track_element_get_gnlobject (trackelement), 42, 50, 12,
|
gnl_object_check (ges_track_element_get_gnlobject (trackelement), 42, 50, 12,
|
||||||
50, 0, TRUE);
|
50, MIN_GNL_PRIO, TRUE);
|
||||||
|
|
||||||
splitclip = ges_clip_split (clip, 67);
|
splitclip = ges_clip_split (clip, 67);
|
||||||
fail_unless (GES_IS_CLIP (splitclip));
|
fail_unless (GES_IS_CLIP (splitclip));
|
||||||
|
|
|
@ -112,7 +112,7 @@ GST_START_TEST (test_get_effects_from_tl)
|
||||||
assert_equals_int (g_list_length (GES_CONTAINER_CHILDREN (source)), 1);
|
assert_equals_int (g_list_length (GES_CONTAINER_CHILDREN (source)), 1);
|
||||||
video_source = GES_CONTAINER_CHILDREN (source)->data;
|
video_source = GES_CONTAINER_CHILDREN (source)->data;
|
||||||
fail_unless (GES_IS_VIDEO_TEST_SOURCE (video_source));
|
fail_unless (GES_IS_VIDEO_TEST_SOURCE (video_source));
|
||||||
assert_equals_int (_PRIORITY (video_source), 2);
|
assert_equals_int (_PRIORITY (video_source), MIN_GNL_PRIO);
|
||||||
|
|
||||||
GST_DEBUG ("Create effect");
|
GST_DEBUG ("Create effect");
|
||||||
effect = ges_effect_new ("agingtv");
|
effect = ges_effect_new ("agingtv");
|
||||||
|
@ -128,17 +128,17 @@ GST_START_TEST (test_get_effects_from_tl)
|
||||||
GES_TIMELINE_ELEMENT (effect)));
|
GES_TIMELINE_ELEMENT (effect)));
|
||||||
fail_unless (ges_track_element_get_track (GES_TRACK_ELEMENT (effect)) ==
|
fail_unless (ges_track_element_get_track (GES_TRACK_ELEMENT (effect)) ==
|
||||||
track_video);
|
track_video);
|
||||||
assert_equals_int (_PRIORITY (effect), 2);
|
assert_equals_int (_PRIORITY (effect), MIN_GNL_PRIO + 0);
|
||||||
assert_equals_int (_PRIORITY (video_source), 3);
|
assert_equals_int (_PRIORITY (video_source), MIN_GNL_PRIO + 1);
|
||||||
|
|
||||||
GST_DEBUG ("Adding effect 1");
|
GST_DEBUG ("Adding effect 1");
|
||||||
fail_unless (ges_container_add (GES_CONTAINER (source),
|
fail_unless (ges_container_add (GES_CONTAINER (source),
|
||||||
GES_TIMELINE_ELEMENT (effect1)));
|
GES_TIMELINE_ELEMENT (effect1)));
|
||||||
fail_unless (ges_track_element_get_track (GES_TRACK_ELEMENT (effect1)) ==
|
fail_unless (ges_track_element_get_track (GES_TRACK_ELEMENT (effect1)) ==
|
||||||
track_video);
|
track_video);
|
||||||
assert_equals_int (_PRIORITY (effect), 2);
|
assert_equals_int (_PRIORITY (effect), MIN_GNL_PRIO);
|
||||||
assert_equals_int (_PRIORITY (effect1), 3);
|
assert_equals_int (_PRIORITY (effect1), MIN_GNL_PRIO + 1);
|
||||||
assert_equals_int (_PRIORITY (video_source), 4);
|
assert_equals_int (_PRIORITY (video_source), MIN_GNL_PRIO + 2);
|
||||||
|
|
||||||
GST_DEBUG ("Adding effect 2");
|
GST_DEBUG ("Adding effect 2");
|
||||||
fail_unless (ges_container_add (GES_CONTAINER (source),
|
fail_unless (ges_container_add (GES_CONTAINER (source),
|
||||||
|
@ -286,8 +286,8 @@ GST_START_TEST (test_priorities_clip)
|
||||||
fail_unless (GES_IS_EFFECT (video_effect));
|
fail_unless (GES_IS_EFFECT (video_effect));
|
||||||
|
|
||||||
/* FIXME This is ridiculus, both effects should have the same priority (0) */
|
/* FIXME This is ridiculus, both effects should have the same priority (0) */
|
||||||
assert_equals_int (_PRIORITY (audio_effect), 0);
|
assert_equals_int (_PRIORITY (audio_effect), MIN_GNL_PRIO);
|
||||||
assert_equals_int (_PRIORITY (video_effect), 1);
|
assert_equals_int (_PRIORITY (video_effect), MIN_GNL_PRIO + 1);
|
||||||
assert_equals_int (GES_CONTAINER_HEIGHT (effect_clip), 2);
|
assert_equals_int (GES_CONTAINER_HEIGHT (effect_clip), 2);
|
||||||
|
|
||||||
effect = ges_effect_new ("agingtv");
|
effect = ges_effect_new ("agingtv");
|
||||||
|
@ -307,14 +307,14 @@ GST_START_TEST (test_priorities_clip)
|
||||||
|
|
||||||
fail_unless (ges_clip_set_top_effect_priority (GES_CLIP (effect_clip),
|
fail_unless (ges_clip_set_top_effect_priority (GES_CLIP (effect_clip),
|
||||||
GES_BASE_EFFECT (effect1), 0));
|
GES_BASE_EFFECT (effect1), 0));
|
||||||
assert_equals_int (_PRIORITY (effect), 3);
|
assert_equals_int (_PRIORITY (effect), 3 + MIN_GNL_PRIO);
|
||||||
assert_equals_int (_PRIORITY (effect1), 0);
|
assert_equals_int (_PRIORITY (effect1), 0 + MIN_GNL_PRIO);
|
||||||
assert_equals_int (GES_CONTAINER_HEIGHT (effect_clip), 4);
|
assert_equals_int (GES_CONTAINER_HEIGHT (effect_clip), 4);
|
||||||
|
|
||||||
fail_unless (ges_clip_set_top_effect_priority (GES_CLIP (effect_clip),
|
fail_unless (ges_clip_set_top_effect_priority (GES_CLIP (effect_clip),
|
||||||
GES_BASE_EFFECT (effect1), 3));
|
GES_BASE_EFFECT (effect1), 3));
|
||||||
assert_equals_int (_PRIORITY (effect), 2);
|
assert_equals_int (_PRIORITY (effect), 2 + MIN_GNL_PRIO);
|
||||||
assert_equals_int (_PRIORITY (effect1), 3);
|
assert_equals_int (_PRIORITY (effect1), 3 + MIN_GNL_PRIO);
|
||||||
assert_equals_int (GES_CONTAINER_HEIGHT (effect_clip), 4);
|
assert_equals_int (GES_CONTAINER_HEIGHT (effect_clip), 4);
|
||||||
|
|
||||||
effects = ges_clip_get_top_effects (GES_CLIP (effect_clip));
|
effects = ges_clip_get_top_effects (GES_CLIP (effect_clip));
|
||||||
|
|
|
@ -94,7 +94,7 @@ GST_START_TEST (test_layer_properties)
|
||||||
assert_equals_uint64 (_PRIORITY (clip), 0);
|
assert_equals_uint64 (_PRIORITY (clip), 0);
|
||||||
ges_timeline_commit (timeline);
|
ges_timeline_commit (timeline);
|
||||||
gnl_object_check (ges_track_element_get_gnlobject (trackelement), 42, 51, 12,
|
gnl_object_check (ges_track_element_get_gnlobject (trackelement), 42, 51, 12,
|
||||||
51, 0, TRUE);
|
51, MIN_GNL_PRIO, TRUE);
|
||||||
|
|
||||||
/* Change the priority of the layer */
|
/* Change the priority of the layer */
|
||||||
g_object_set (layer, "priority", 1, NULL);
|
g_object_set (layer, "priority", 1, NULL);
|
||||||
|
@ -102,7 +102,7 @@ GST_START_TEST (test_layer_properties)
|
||||||
assert_equals_uint64 (_PRIORITY (clip), 0);
|
assert_equals_uint64 (_PRIORITY (clip), 0);
|
||||||
ges_timeline_commit (timeline);
|
ges_timeline_commit (timeline);
|
||||||
gnl_object_check (ges_track_element_get_gnlobject (trackelement), 42, 51, 12,
|
gnl_object_check (ges_track_element_get_gnlobject (trackelement), 42, 51, 12,
|
||||||
51, LAYER_HEIGHT, TRUE);
|
51, LAYER_HEIGHT + MIN_GNL_PRIO, TRUE);
|
||||||
|
|
||||||
/* Change it to an insanely high value */
|
/* Change it to an insanely high value */
|
||||||
g_object_set (layer, "priority", 31, NULL);
|
g_object_set (layer, "priority", 31, NULL);
|
||||||
|
@ -110,7 +110,7 @@ GST_START_TEST (test_layer_properties)
|
||||||
assert_equals_uint64 (_PRIORITY (clip), 0);
|
assert_equals_uint64 (_PRIORITY (clip), 0);
|
||||||
ges_timeline_commit (timeline);
|
ges_timeline_commit (timeline);
|
||||||
gnl_object_check (ges_track_element_get_gnlobject (trackelement), 42, 51, 12,
|
gnl_object_check (ges_track_element_get_gnlobject (trackelement), 42, 51, 12,
|
||||||
51, LAYER_HEIGHT * 31, TRUE);
|
51, MIN_GNL_PRIO + LAYER_HEIGHT * 31, TRUE);
|
||||||
|
|
||||||
/* and back to 0 */
|
/* and back to 0 */
|
||||||
g_object_set (layer, "priority", 0, NULL);
|
g_object_set (layer, "priority", 0, NULL);
|
||||||
|
@ -118,7 +118,7 @@ GST_START_TEST (test_layer_properties)
|
||||||
assert_equals_uint64 (_PRIORITY (clip), 0);
|
assert_equals_uint64 (_PRIORITY (clip), 0);
|
||||||
ges_timeline_commit (timeline);
|
ges_timeline_commit (timeline);
|
||||||
gnl_object_check (ges_track_element_get_gnlobject (trackelement), 42, 51, 12,
|
gnl_object_check (ges_track_element_get_gnlobject (trackelement), 42, 51, 12,
|
||||||
51, 0, TRUE);
|
51, MIN_GNL_PRIO + 0, TRUE);
|
||||||
|
|
||||||
gst_object_unref (trackelement);
|
gst_object_unref (trackelement);
|
||||||
fail_unless (ges_layer_remove_clip (layer, clip));
|
fail_unless (ges_layer_remove_clip (layer, clip));
|
||||||
|
@ -201,14 +201,14 @@ GST_START_TEST (test_layer_priorities)
|
||||||
gnlobj1 = ges_track_element_get_gnlobject (trackelement1);
|
gnlobj1 = ges_track_element_get_gnlobject (trackelement1);
|
||||||
fail_unless (gnlobj1 != NULL);
|
fail_unless (gnlobj1 != NULL);
|
||||||
g_object_get (gnlobj1, "priority", &prio1, NULL);
|
g_object_get (gnlobj1, "priority", &prio1, NULL);
|
||||||
assert_equals_int (prio1, 0);
|
assert_equals_int (prio1, MIN_GNL_PRIO);
|
||||||
|
|
||||||
assert_equals_int (_PRIORITY (clip2), 1);
|
assert_equals_int (_PRIORITY (clip2), 1);
|
||||||
gnlobj2 = ges_track_element_get_gnlobject (trackelement2);
|
gnlobj2 = ges_track_element_get_gnlobject (trackelement2);
|
||||||
fail_unless (gnlobj2 != NULL);
|
fail_unless (gnlobj2 != NULL);
|
||||||
g_object_get (gnlobj2, "priority", &prio2, NULL);
|
g_object_get (gnlobj2, "priority", &prio2, NULL);
|
||||||
/* clip2 is on the second layer and has a priority of 1 */
|
/* clip2 is on the second layer and has a priority of 1 */
|
||||||
assert_equals_int (prio2, LAYER_HEIGHT + 1);
|
assert_equals_int (prio2, MIN_GNL_PRIO + LAYER_HEIGHT + 1);
|
||||||
|
|
||||||
assert_equals_int (_PRIORITY (clip3), LAYER_HEIGHT - 1);
|
assert_equals_int (_PRIORITY (clip3), LAYER_HEIGHT - 1);
|
||||||
gnlobj3 = ges_track_element_get_gnlobject (trackelement3);
|
gnlobj3 = ges_track_element_get_gnlobject (trackelement3);
|
||||||
|
@ -216,7 +216,7 @@ GST_START_TEST (test_layer_priorities)
|
||||||
/* clip3 is on the third layer and has a priority of LAYER_HEIGHT + 1
|
/* clip3 is on the third layer and has a priority of LAYER_HEIGHT + 1
|
||||||
* it priority must have the maximum priority of this layer*/
|
* it priority must have the maximum priority of this layer*/
|
||||||
g_object_get (gnlobj3, "priority", &prio3, NULL);
|
g_object_get (gnlobj3, "priority", &prio3, NULL);
|
||||||
assert_equals_int (prio3, LAYER_HEIGHT * 3 - 1);
|
assert_equals_int (prio3, MIN_GNL_PRIO + LAYER_HEIGHT * 3 - 1);
|
||||||
|
|
||||||
/* Move layers around */
|
/* Move layers around */
|
||||||
g_object_set (layer1, "priority", 2, NULL);
|
g_object_set (layer1, "priority", 2, NULL);
|
||||||
|
@ -234,9 +234,9 @@ GST_START_TEST (test_layer_priorities)
|
||||||
g_object_get (gnlobj1, "priority", &prio1, NULL);
|
g_object_get (gnlobj1, "priority", &prio1, NULL);
|
||||||
g_object_get (gnlobj2, "priority", &prio2, NULL);
|
g_object_get (gnlobj2, "priority", &prio2, NULL);
|
||||||
g_object_get (gnlobj3, "priority", &prio3, NULL);
|
g_object_get (gnlobj3, "priority", &prio3, NULL);
|
||||||
assert_equals_int (prio1, 2 * LAYER_HEIGHT);
|
assert_equals_int (prio1, 2 * LAYER_HEIGHT + MIN_GNL_PRIO);
|
||||||
assert_equals_int (prio2, 1);
|
assert_equals_int (prio2, MIN_GNL_PRIO + 1);
|
||||||
assert_equals_int (prio3, LAYER_HEIGHT * 2 - 1);
|
assert_equals_int (prio3, LAYER_HEIGHT * 2 - 1 + MIN_GNL_PRIO);
|
||||||
|
|
||||||
/* And move objects around */
|
/* And move objects around */
|
||||||
fail_unless (ges_clip_move_to_layer (clip2, layer1));
|
fail_unless (ges_clip_move_to_layer (clip2, layer1));
|
||||||
|
@ -260,9 +260,9 @@ GST_START_TEST (test_layer_priorities)
|
||||||
g_object_get (gnlobj1, "priority", &prio1, NULL);
|
g_object_get (gnlobj1, "priority", &prio1, NULL);
|
||||||
g_object_get (gnlobj2, "priority", &prio2, NULL);
|
g_object_get (gnlobj2, "priority", &prio2, NULL);
|
||||||
g_object_get (gnlobj3, "priority", &prio3, NULL);
|
g_object_get (gnlobj3, "priority", &prio3, NULL);
|
||||||
assert_equals_int (prio1, 2 * LAYER_HEIGHT);
|
assert_equals_int (prio1, 2 * LAYER_HEIGHT + MIN_GNL_PRIO);
|
||||||
assert_equals_int (prio2, 2 * LAYER_HEIGHT + 1);
|
assert_equals_int (prio2, 2 * LAYER_HEIGHT + 1 + MIN_GNL_PRIO);
|
||||||
assert_equals_int (prio3, LAYER_HEIGHT * 3 - 1);
|
assert_equals_int (prio3, LAYER_HEIGHT * 3 - 1 + MIN_GNL_PRIO);
|
||||||
|
|
||||||
/* And change TrackElement-s priorities and check that changes are not
|
/* And change TrackElement-s priorities and check that changes are not
|
||||||
* refected on it containing Clip */
|
* refected on it containing Clip */
|
||||||
|
|
|
@ -81,7 +81,7 @@ GST_START_TEST (test_overlay_properties)
|
||||||
|
|
||||||
/* And let's also check that it propagated correctly to GNonLin */
|
/* And let's also check that it propagated correctly to GNonLin */
|
||||||
gnl_object_check (ges_track_element_get_gnlobject (trackelement), 42, 51, 12,
|
gnl_object_check (ges_track_element_get_gnlobject (trackelement), 42, 51, 12,
|
||||||
51, 0, TRUE);
|
51, MIN_GNL_PRIO, TRUE);
|
||||||
|
|
||||||
/* Change more properties, see if they propagate */
|
/* Change more properties, see if they propagate */
|
||||||
g_object_set (clip, "start", (guint64) 420, "duration", (guint64) 510,
|
g_object_set (clip, "start", (guint64) 420, "duration", (guint64) 510,
|
||||||
|
@ -96,7 +96,7 @@ GST_START_TEST (test_overlay_properties)
|
||||||
|
|
||||||
/* And let's also check that it propagated correctly to GNonLin */
|
/* And let's also check that it propagated correctly to GNonLin */
|
||||||
gnl_object_check (ges_track_element_get_gnlobject (trackelement), 420, 510,
|
gnl_object_check (ges_track_element_get_gnlobject (trackelement), 420, 510,
|
||||||
120, 510, 0, TRUE);
|
120, 510, MIN_GNL_PRIO + 0, TRUE);
|
||||||
|
|
||||||
ges_container_remove (GES_CONTAINER (clip),
|
ges_container_remove (GES_CONTAINER (clip),
|
||||||
GES_TIMELINE_ELEMENT (trackelement));
|
GES_TIMELINE_ELEMENT (trackelement));
|
||||||
|
|
|
@ -242,10 +242,10 @@ _test_project (GESProject * project, GESTimeline * timeline)
|
||||||
assert_equals_int (nb_scratch_lines, 12);
|
assert_equals_int (nb_scratch_lines, 12);
|
||||||
|
|
||||||
gnl_object_check (ges_track_element_get_gnlobject (trackelement),
|
gnl_object_check (ges_track_element_get_gnlobject (trackelement),
|
||||||
0, 1000000000, 0, 1000000000, 0, TRUE);
|
0, 1000000000, 0, 1000000000, MIN_GNL_PRIO, TRUE);
|
||||||
} else {
|
} else {
|
||||||
gnl_object_check (ges_track_element_get_gnlobject (trackelement),
|
gnl_object_check (ges_track_element_get_gnlobject (trackelement),
|
||||||
0, 1000000000, 0, 1000000000, 1, TRUE);
|
0, 1000000000, 0, 1000000000, MIN_GNL_PRIO + 1, TRUE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -26,6 +26,12 @@
|
||||||
#include <gst/check/gstcheck.h>
|
#include <gst/check/gstcheck.h>
|
||||||
|
|
||||||
GESTimelinePipeline * ges_test_create_pipeline (GESTimeline *timeline);
|
GESTimelinePipeline * ges_test_create_pipeline (GESTimeline *timeline);
|
||||||
|
/* The first 2 GNL priorities are used for:
|
||||||
|
* 0- The Mixing element
|
||||||
|
* 1- The Gaps
|
||||||
|
*/
|
||||||
|
#define MIN_GNL_PRIO 2
|
||||||
|
|
||||||
gchar * ges_test_get_audio_only_uri (void);
|
gchar * ges_test_get_audio_only_uri (void);
|
||||||
gchar * ges_test_get_audio_video_uri (void);
|
gchar * ges_test_get_audio_video_uri (void);
|
||||||
gchar * ges_test_get_image_uri (void);
|
gchar * ges_test_get_image_uri (void);
|
||||||
|
|
|
@ -81,7 +81,7 @@ GST_START_TEST (test_title_source_properties)
|
||||||
|
|
||||||
/* And let's also check that it propagated correctly to GNonLin */
|
/* And let's also check that it propagated correctly to GNonLin */
|
||||||
gnl_object_check (ges_track_element_get_gnlobject (trackelement), 42, 51, 12,
|
gnl_object_check (ges_track_element_get_gnlobject (trackelement), 42, 51, 12,
|
||||||
51, 0, TRUE);
|
51, MIN_GNL_PRIO, TRUE);
|
||||||
|
|
||||||
/* Change more properties, see if they propagate */
|
/* Change more properties, see if they propagate */
|
||||||
g_object_set (clip, "start", (guint64) 420, "duration", (guint64) 510,
|
g_object_set (clip, "start", (guint64) 420, "duration", (guint64) 510,
|
||||||
|
@ -96,7 +96,7 @@ GST_START_TEST (test_title_source_properties)
|
||||||
|
|
||||||
/* And let's also check that it propagated correctly to GNonLin */
|
/* And let's also check that it propagated correctly to GNonLin */
|
||||||
gnl_object_check (ges_track_element_get_gnlobject (trackelement), 420, 510,
|
gnl_object_check (ges_track_element_get_gnlobject (trackelement), 420, 510,
|
||||||
120, 510, 0, TRUE);
|
120, 510, MIN_GNL_PRIO + 0, TRUE);
|
||||||
|
|
||||||
ges_container_remove (GES_CONTAINER (clip),
|
ges_container_remove (GES_CONTAINER (clip),
|
||||||
GES_TIMELINE_ELEMENT (trackelement));
|
GES_TIMELINE_ELEMENT (trackelement));
|
||||||
|
|
|
@ -110,7 +110,7 @@ GST_START_TEST (test_transition_properties)
|
||||||
|
|
||||||
/* And let's also check that it propagated correctly to GNonLin */
|
/* And let's also check that it propagated correctly to GNonLin */
|
||||||
gnl_object_check (ges_track_element_get_gnlobject (trackelement), 42, 51, 12,
|
gnl_object_check (ges_track_element_get_gnlobject (trackelement), 42, 51, 12,
|
||||||
51, 0, TRUE);
|
51, MIN_GNL_PRIO, TRUE);
|
||||||
|
|
||||||
/* Change more properties, see if they propagate */
|
/* Change more properties, see if they propagate */
|
||||||
g_object_set (clip, "start", (guint64) 420, "duration", (guint64) 510,
|
g_object_set (clip, "start", (guint64) 420, "duration", (guint64) 510,
|
||||||
|
@ -125,7 +125,7 @@ GST_START_TEST (test_transition_properties)
|
||||||
|
|
||||||
/* And let's also check that it propagated correctly to GNonLin */
|
/* And let's also check that it propagated correctly to GNonLin */
|
||||||
gnl_object_check (ges_track_element_get_gnlobject (trackelement), 420, 510,
|
gnl_object_check (ges_track_element_get_gnlobject (trackelement), 420, 510,
|
||||||
120, 510, 0, TRUE);
|
120, 510, MIN_GNL_PRIO + 0, TRUE);
|
||||||
|
|
||||||
/* test changing vtype */
|
/* test changing vtype */
|
||||||
GST_DEBUG ("Setting to crossfade");
|
GST_DEBUG ("Setting to crossfade");
|
||||||
|
|
|
@ -166,7 +166,7 @@ GST_START_TEST (test_filesource_properties)
|
||||||
|
|
||||||
/* And let's also check that it propagated correctly to GNonLin */
|
/* And let's also check that it propagated correctly to GNonLin */
|
||||||
gnl_object_check (ges_track_element_get_gnlobject (trackelement), 42, 51, 12,
|
gnl_object_check (ges_track_element_get_gnlobject (trackelement), 42, 51, 12,
|
||||||
51, 0, TRUE);
|
51, MIN_GNL_PRIO, TRUE);
|
||||||
|
|
||||||
/* Change more properties, see if they propagate */
|
/* Change more properties, see if they propagate */
|
||||||
g_object_set (clip, "start", (guint64) 420, "duration", (guint64) 510,
|
g_object_set (clip, "start", (guint64) 420, "duration", (guint64) 510,
|
||||||
|
@ -181,17 +181,17 @@ GST_START_TEST (test_filesource_properties)
|
||||||
|
|
||||||
/* And let's also check that it propagated correctly to GNonLin */
|
/* And let's also check that it propagated correctly to GNonLin */
|
||||||
gnl_object_check (ges_track_element_get_gnlobject (trackelement), 420, 510,
|
gnl_object_check (ges_track_element_get_gnlobject (trackelement), 420, 510,
|
||||||
120, 510, 0, TRUE);
|
120, 510, MIN_GNL_PRIO + 0, TRUE);
|
||||||
|
|
||||||
/* Test mute support */
|
/* Test mute support */
|
||||||
g_object_set (clip, "mute", TRUE, NULL);
|
g_object_set (clip, "mute", TRUE, NULL);
|
||||||
ges_timeline_commit (timeline);
|
ges_timeline_commit (timeline);
|
||||||
gnl_object_check (ges_track_element_get_gnlobject (trackelement), 420, 510,
|
gnl_object_check (ges_track_element_get_gnlobject (trackelement), 420, 510,
|
||||||
120, 510, 0, FALSE);
|
120, 510, MIN_GNL_PRIO + 0, FALSE);
|
||||||
g_object_set (clip, "mute", FALSE, NULL);
|
g_object_set (clip, "mute", FALSE, NULL);
|
||||||
ges_timeline_commit (timeline);
|
ges_timeline_commit (timeline);
|
||||||
gnl_object_check (ges_track_element_get_gnlobject (trackelement), 420, 510,
|
gnl_object_check (ges_track_element_get_gnlobject (trackelement), 420, 510,
|
||||||
120, 510, 0, TRUE);
|
120, 510, MIN_GNL_PRIO + 0, TRUE);
|
||||||
|
|
||||||
ges_container_remove (GES_CONTAINER (clip),
|
ges_container_remove (GES_CONTAINER (clip),
|
||||||
GES_TIMELINE_ELEMENT (trackelement));
|
GES_TIMELINE_ELEMENT (trackelement));
|
||||||
|
|
Loading…
Reference in a new issue