mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-19 06:46:38 +00:00
ges: Expand track background duration equal to timeline duration
This commit is contained in:
parent
ffd196d06a
commit
ef96f26e8a
1 changed files with 26 additions and 2 deletions
|
@ -75,6 +75,9 @@ static void
|
|||
sort_track_objects_cb (GESTrackObject * child,
|
||||
GParamSpec * arg G_GNUC_UNUSED, GESTrack * track);
|
||||
|
||||
static void timeline_duration_cb (GESTimeline * timeline,
|
||||
GParamSpec * arg G_GNUC_UNUSED, GESTrack * track);
|
||||
|
||||
static void
|
||||
ges_track_get_property (GObject * object, guint property_id,
|
||||
GValue * value, GParamSpec * pspec)
|
||||
|
@ -149,8 +152,7 @@ ges_track_constructed (GObject * object)
|
|||
GESTrackPrivate *priv = self->priv;
|
||||
|
||||
if ((priv->background = gst_element_factory_make ("gnlsource", "background"))) {
|
||||
g_object_set (G_OBJECT (self->priv->background), "expandable", TRUE,
|
||||
"priority", G_MAXINT, NULL);
|
||||
g_object_set (priv->background, "priority", G_MAXUINT, NULL);
|
||||
|
||||
switch (self->type) {
|
||||
case GES_TRACK_TYPE_VIDEO:
|
||||
|
@ -367,6 +369,14 @@ ges_track_set_timeline (GESTrack * track, GESTimeline * timeline)
|
|||
{
|
||||
GST_DEBUG ("track:%p, timeline:%p", track, timeline);
|
||||
|
||||
if (track->priv->timeline)
|
||||
g_signal_handlers_disconnect_by_func (track,
|
||||
timeline_duration_cb, track->priv->timeline);
|
||||
|
||||
if (timeline)
|
||||
g_signal_connect (G_OBJECT (timeline), "notify::duration",
|
||||
G_CALLBACK (timeline_duration_cb), track);
|
||||
|
||||
track->priv->timeline = timeline;
|
||||
}
|
||||
|
||||
|
@ -627,6 +637,20 @@ sort_track_objects_cb (GESTrackObject * child,
|
|||
(GCompareFunc) objects_start_compare);
|
||||
}
|
||||
|
||||
static void
|
||||
timeline_duration_cb (GESTimeline * timeline,
|
||||
GParamSpec * arg G_GNUC_UNUSED, GESTrack * track)
|
||||
{
|
||||
guint64 duration;
|
||||
|
||||
g_object_get (timeline, "duration", &duration, NULL);
|
||||
g_object_set (GES_TRACK (track)->priv->background, "duration", duration,
|
||||
NULL);
|
||||
|
||||
GST_DEBUG_OBJECT (track, "Updating background duration to %" GST_TIME_FORMAT,
|
||||
GST_TIME_ARGS (duration));
|
||||
}
|
||||
|
||||
/**
|
||||
* ges_track_get_caps:
|
||||
* @track: a #GESTrack
|
||||
|
|
Loading…
Reference in a new issue