mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-11 18:05:37 +00:00
timeline: Avoid to recalculate the moving context unecessarly
This commit is contained in:
parent
5a29478c2d
commit
9913d48e5c
1 changed files with 13 additions and 16 deletions
|
@ -1587,7 +1587,6 @@ layer_object_added_cb (GESTimelineLayer * layer, GESTimelineObject * object,
|
||||||
if (ges_timeline_object_is_moving_from_layer (object)) {
|
if (ges_timeline_object_is_moving_from_layer (object)) {
|
||||||
GST_DEBUG ("TimelineObject %p is moving from a layer to another, not doing"
|
GST_DEBUG ("TimelineObject %p is moving from a layer to another, not doing"
|
||||||
" anything on it", object);
|
" anything on it", object);
|
||||||
if (!timeline->priv->movecontext.ignore_needs_ctx)
|
|
||||||
timeline->priv->movecontext.needs_move_ctx = TRUE;
|
timeline->priv->movecontext.needs_move_ctx = TRUE;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -1691,7 +1690,12 @@ trackobj_start_changed_cb (GESTrackObject * child,
|
||||||
sort_starts_ends_start (timeline, child);
|
sort_starts_ends_start (timeline, child);
|
||||||
sort_starts_ends_end (timeline, child);
|
sort_starts_ends_end (timeline, child);
|
||||||
|
|
||||||
if (!timeline->priv->movecontext.ignore_needs_ctx)
|
/* If the timeline is set to snap objects together, we
|
||||||
|
* are sure that all movement of TrackObject-s are done within
|
||||||
|
* the moving context, so we do not need to recalculate the
|
||||||
|
* move context as often */
|
||||||
|
if (timeline->priv->movecontext.ignore_needs_ctx &&
|
||||||
|
timeline->priv->snapping_distance == 0)
|
||||||
timeline->priv->movecontext.needs_move_ctx = TRUE;
|
timeline->priv->movecontext.needs_move_ctx = TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1701,15 +1705,12 @@ trackobj_duration_changed_cb (GESTrackObject * child,
|
||||||
{
|
{
|
||||||
sort_starts_ends_end (timeline, child);
|
sort_starts_ends_end (timeline, child);
|
||||||
|
|
||||||
if (!timeline->priv->movecontext.ignore_needs_ctx)
|
/* If the timeline is set to snap objects together, we
|
||||||
timeline->priv->movecontext.needs_move_ctx = TRUE;
|
* are sure that all movement of TrackObject-s are done within
|
||||||
}
|
* the moving context, so we do not need to recalculate the
|
||||||
|
* move context as often */
|
||||||
static void
|
if (timeline->priv->movecontext.ignore_needs_ctx &&
|
||||||
trackobj_inpoint_changed_cb (GESTrackObject * child,
|
timeline->priv->snapping_distance == 0)
|
||||||
GParamSpec * arg G_GNUC_UNUSED, GESTimeline * timeline)
|
|
||||||
{
|
|
||||||
if (!timeline->priv->movecontext.ignore_needs_ctx)
|
|
||||||
timeline->priv->movecontext.needs_move_ctx = TRUE;
|
timeline->priv->movecontext.needs_move_ctx = TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1725,8 +1726,6 @@ track_object_added_cb (GESTrack * track, GESTrackObject * object,
|
||||||
G_CALLBACK (trackobj_start_changed_cb), timeline);
|
G_CALLBACK (trackobj_start_changed_cb), timeline);
|
||||||
g_signal_connect (GES_TRACK_OBJECT (object), "notify::duration",
|
g_signal_connect (GES_TRACK_OBJECT (object), "notify::duration",
|
||||||
G_CALLBACK (trackobj_duration_changed_cb), timeline);
|
G_CALLBACK (trackobj_duration_changed_cb), timeline);
|
||||||
g_signal_connect (GES_TRACK_OBJECT (object), "notify::in-point",
|
|
||||||
G_CALLBACK (trackobj_inpoint_changed_cb), timeline);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1740,8 +1739,6 @@ track_object_removed_cb (GESTrack * track, GESTrackObject * object,
|
||||||
NULL);
|
NULL);
|
||||||
g_signal_handlers_disconnect_by_func (object, trackobj_duration_changed_cb,
|
g_signal_handlers_disconnect_by_func (object, trackobj_duration_changed_cb,
|
||||||
NULL);
|
NULL);
|
||||||
g_signal_handlers_disconnect_by_func (object, trackobj_inpoint_changed_cb,
|
|
||||||
NULL);
|
|
||||||
|
|
||||||
/* Make sure to reinitialise the moving context next time */
|
/* Make sure to reinitialise the moving context next time */
|
||||||
timeline->priv->movecontext.needs_move_ctx = TRUE;
|
timeline->priv->movecontext.needs_move_ctx = TRUE;
|
||||||
|
|
Loading…
Reference in a new issue