mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-23 16:50:47 +00:00
layer: Make sure to resync priorities on commit
In case effects have been added priorites might become wrong, but until the timeline is not commited, it does not matter. Make sure all priorities are correct before commiting compositions Differential Revision: https://phabricator.freedesktop.org/D1277
This commit is contained in:
parent
3daf8bd788
commit
564bd8d473
3 changed files with 12 additions and 6 deletions
|
@ -331,6 +331,10 @@ G_GNUC_INTERNAL void ges_clip_set_moving_from_layer (GESClip *clip
|
|||
G_GNUC_INTERNAL GESTrackElement* ges_clip_create_track_element (GESClip *clip, GESTrackType type);
|
||||
G_GNUC_INTERNAL GList* ges_clip_create_track_elements (GESClip *clip, GESTrackType type);
|
||||
|
||||
/****************************************************
|
||||
* GESLayer *
|
||||
****************************************************/
|
||||
G_GNUC_INTERNAL gboolean ges_layer_resync_priorities (GESLayer * layer);
|
||||
|
||||
/****************************************************
|
||||
* GESTrackElement *
|
||||
|
|
|
@ -225,7 +225,7 @@ ges_layer_init (GESLayer * self)
|
|||
* Resyncs the priorities of the clips controlled by @layer.
|
||||
* This method
|
||||
*/
|
||||
static gboolean
|
||||
gboolean
|
||||
ges_layer_resync_priorities (GESLayer * layer)
|
||||
{
|
||||
GstClockTime next_reset = 0;
|
||||
|
@ -398,7 +398,6 @@ ges_layer_set_priority (GESLayer * layer, guint priority)
|
|||
layer->priv->priority = priority;
|
||||
layer->min_nle_priority = (priority * LAYER_HEIGHT) + MIN_NLE_PRIO;
|
||||
layer->max_nle_priority = ((priority + 1) * LAYER_HEIGHT) + MIN_NLE_PRIO;
|
||||
|
||||
ges_layer_resync_priorities (layer);
|
||||
}
|
||||
|
||||
|
@ -599,8 +598,6 @@ ges_layer_add_clip (GESLayer * layer, GESClip * clip)
|
|||
_set_priority0 (GES_TIMELINE_ELEMENT (clip), LAYER_HEIGHT - 1);
|
||||
}
|
||||
|
||||
/* If the clip has an acceptable priority, we just let it with its current
|
||||
* priority */
|
||||
ges_layer_resync_priorities (layer);
|
||||
ges_timeline_element_set_timeline (GES_TIMELINE_ELEMENT (clip),
|
||||
layer->timeline);
|
||||
|
|
|
@ -3388,8 +3388,13 @@ ges_timeline_commit_unlocked (GESTimeline * timeline)
|
|||
GST_DEBUG_OBJECT (timeline, "commiting changes");
|
||||
|
||||
for (tmp = timeline->layers; tmp; tmp = tmp->next) {
|
||||
_create_transitions_on_layer (timeline, GES_LAYER (tmp->data),
|
||||
NULL, NULL, _find_transition_from_auto_transitions);
|
||||
GESLayer *layer = tmp->data;
|
||||
|
||||
_create_transitions_on_layer (timeline, layer, NULL, NULL,
|
||||
_find_transition_from_auto_transitions);
|
||||
|
||||
/* Ensure clip priorities are correct after an edit */
|
||||
ges_layer_resync_priorities (layer);
|
||||
}
|
||||
|
||||
timeline->priv->expected_commited =
|
||||
|
|
Loading…
Reference in a new issue