mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-28 19:20:35 +00:00
clip: make auto-transitions less expensive when adding to track
Only check the overlaps with the actual track element that was just added to the track. This reduces the tree traversal by one order. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-editing-services/-/merge_requests/169>
This commit is contained in:
parent
cdac205db6
commit
30a821e136
3 changed files with 16 additions and 2 deletions
|
@ -2611,8 +2611,8 @@ ges_clip_add_child_to_track (GESClip * clip, GESTrackElement * child,
|
|||
}
|
||||
|
||||
if (GES_IS_SOURCE (el))
|
||||
timeline_tree_create_transitions (timeline_get_tree (timeline),
|
||||
ges_timeline_find_auto_transition);
|
||||
timeline_tree_create_transitions_for_track_element (timeline_get_tree
|
||||
(timeline), el, ges_timeline_find_auto_transition);
|
||||
|
||||
return el;
|
||||
}
|
||||
|
|
|
@ -2079,6 +2079,16 @@ create_transitions (GNode * node,
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
void
|
||||
timeline_tree_create_transitions_for_track_element (GNode * root,
|
||||
GESTrackElement * element, GESTreeGetAutoTransitionFunc get_auto_transition)
|
||||
{
|
||||
GNode *node = find_node (root, element);
|
||||
g_assert (node);
|
||||
|
||||
create_transitions (node, get_auto_transition);
|
||||
}
|
||||
|
||||
void
|
||||
timeline_tree_create_transitions (GNode * root,
|
||||
GESTreeGetAutoTransitionFunc get_auto_transition)
|
||||
|
|
|
@ -54,6 +54,10 @@ typedef GESAutoTransition *
|
|||
GESTrackElement * next,
|
||||
GstClockTime transition_duration);
|
||||
|
||||
void
|
||||
timeline_tree_create_transitions_for_track_element (GNode * root,
|
||||
GESTrackElement * element,
|
||||
GESTreeGetAutoTransitionFunc get_auto_transition);
|
||||
void timeline_tree_create_transitions (GNode *root,
|
||||
GESTreeGetAutoTransitionFunc get_auto_transition);
|
||||
|
||||
|
|
Loading…
Reference in a new issue