mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-04-26 06:54:49 +00:00
timeline: create auto-transitions during track-element-added
Any time a track element is added to a track, we need to check whether we need to create a new corresponding auto-transition. This simply moves the code from ges-clip.c to ges-timeline.c, where it is more appropriate. Moreover, it technically opens the possibility for creating auto-transitions for track elements in the timeline that have no corresponding clip. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-editing-services/-/merge_requests/169>
This commit is contained in:
parent
b00c01ded7
commit
a4cfa6d1e1
2 changed files with 14 additions and 4 deletions
|
@ -2610,9 +2610,5 @@ ges_clip_add_child_to_track (GESClip * clip, GESTrackElement * child,
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (GES_IS_SOURCE (el))
|
|
||||||
timeline_tree_create_transitions_for_track_element (timeline_get_tree
|
|
||||||
(timeline), el, ges_timeline_find_auto_transition);
|
|
||||||
|
|
||||||
return el;
|
return el;
|
||||||
}
|
}
|
||||||
|
|
|
@ -181,6 +181,7 @@ typedef struct
|
||||||
GESTrack *track;
|
GESTrack *track;
|
||||||
GstPad *pad; /* Pad from the track */
|
GstPad *pad; /* Pad from the track */
|
||||||
GstPad *ghostpad;
|
GstPad *ghostpad;
|
||||||
|
gulong track_element_added_sigid;
|
||||||
|
|
||||||
gulong probe_id;
|
gulong probe_id;
|
||||||
GstStream *stream;
|
GstStream *stream;
|
||||||
|
@ -1523,6 +1524,15 @@ clip_track_element_removed_cb (GESClip * clip,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
track_element_added_cb (GESTrack * track, GESTrackElement * element,
|
||||||
|
GESTimeline * timeline)
|
||||||
|
{
|
||||||
|
if (GES_IS_SOURCE (element))
|
||||||
|
timeline_tree_create_transitions_for_track_element (timeline->priv->tree,
|
||||||
|
element, ges_timeline_find_auto_transition);
|
||||||
|
}
|
||||||
|
|
||||||
/* returns TRUE if no errors in adding to tracks */
|
/* returns TRUE if no errors in adding to tracks */
|
||||||
static gboolean
|
static gboolean
|
||||||
_add_clip_children_to_tracks (GESTimeline * timeline, GESClip * clip,
|
_add_clip_children_to_tracks (GESTimeline * timeline, GESClip * clip,
|
||||||
|
@ -2281,6 +2291,8 @@ ges_timeline_add_track (GESTimeline * timeline, GESTrack * track)
|
||||||
tr_priv = g_new0 (TrackPrivate, 1);
|
tr_priv = g_new0 (TrackPrivate, 1);
|
||||||
tr_priv->timeline = timeline;
|
tr_priv->timeline = timeline;
|
||||||
tr_priv->track = track;
|
tr_priv->track = track;
|
||||||
|
tr_priv->track_element_added_sigid = g_signal_connect (track,
|
||||||
|
"track-element-added", G_CALLBACK (track_element_added_cb), timeline);
|
||||||
|
|
||||||
update_stream_object (tr_priv);
|
update_stream_object (tr_priv);
|
||||||
gst_stream_collection_add_stream (timeline->priv->stream_collection,
|
gst_stream_collection_add_stream (timeline->priv->stream_collection,
|
||||||
|
@ -2399,6 +2411,8 @@ ges_timeline_remove_track (GESTimeline * timeline, GESTrack * track)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
g_signal_handler_disconnect (track, tr_priv->track_element_added_sigid);
|
||||||
|
|
||||||
/* set track state to NULL */
|
/* set track state to NULL */
|
||||||
gst_element_set_state (GST_ELEMENT (track), GST_STATE_NULL);
|
gst_element_set_state (GST_ELEMENT (track), GST_STATE_NULL);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue