mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-30 05:31:15 +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))
|
if (GES_IS_SOURCE (el))
|
||||||
timeline_tree_create_transitions (timeline_get_tree (timeline),
|
timeline_tree_create_transitions_for_track_element (timeline_get_tree
|
||||||
ges_timeline_find_auto_transition);
|
(timeline), el, ges_timeline_find_auto_transition);
|
||||||
|
|
||||||
return el;
|
return el;
|
||||||
}
|
}
|
||||||
|
|
|
@ -2079,6 +2079,16 @@ create_transitions (GNode * node,
|
||||||
return FALSE;
|
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
|
void
|
||||||
timeline_tree_create_transitions (GNode * root,
|
timeline_tree_create_transitions (GNode * root,
|
||||||
GESTreeGetAutoTransitionFunc get_auto_transition)
|
GESTreeGetAutoTransitionFunc get_auto_transition)
|
||||||
|
|
|
@ -54,6 +54,10 @@ typedef GESAutoTransition *
|
||||||
GESTrackElement * next,
|
GESTrackElement * next,
|
||||||
GstClockTime transition_duration);
|
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,
|
void timeline_tree_create_transitions (GNode *root,
|
||||||
GESTreeGetAutoTransitionFunc get_auto_transition);
|
GESTreeGetAutoTransitionFunc get_auto_transition);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue