From 15c7e9738cb242a0ec3d27e442776dad091b394b Mon Sep 17 00:00:00 2001 From: Mathieu Duponchelle Date: Wed, 2 May 2012 01:09:07 +0200 Subject: [PATCH] track-video-transition: expose the border property of smptealpha API: ges_track_video_transition_set_border --- ges/ges-track-video-transition.c | 21 +++++++++++++++++++++ ges/ges-track-video-transition.h | 4 ++++ 2 files changed, 25 insertions(+) diff --git a/ges/ges-track-video-transition.c b/ges/ges-track-video-transition.c index 04d078cc14..bfefc9b93a 100644 --- a/ges/ges-track-video-transition.c +++ b/ges/ges-track-video-transition.c @@ -53,6 +53,8 @@ struct _GESTrackVideoTransitionPrivate gdouble end_value; guint64 dur; + /* This is in case the smpte doesn't exist yet */ + gint pending_border_value; }; enum @@ -124,6 +126,7 @@ ges_track_video_transition_init (GESTrackVideoTransition * self) self->priv->start_value = 0.0; self->priv->end_value = 0.0; self->priv->dur = 42; + self->priv->pending_border_value = -1; } static void @@ -434,6 +437,11 @@ switch_to_smpte_cb (GstPad * sink, gboolean blocked, add_smpte_to_bin (priv->sinka, smptealpha, priv); add_smpte_to_bin (priv->sinkb, smptealphab, priv); + if (priv->pending_border_value != -1) { + g_object_set (smptealphab, "border", priv->pending_border_value, NULL); + priv->pending_border_value = -1; + } + replace_mixer (priv); priv->start_value = 1.0; @@ -599,6 +607,19 @@ ges_track_video_transition_duration_changed (GESTrackObject * object, GST_LOG ("done updating controller"); } +void +ges_track_video_transition_set_border (GESTrackVideoTransition * self, + gint value) +{ + GESTrackVideoTransitionPrivate *priv = self->priv; + + if (!priv->smpte) { + priv->pending_border_value = value; + return; + } + g_object_set (priv->smpte, "border", value, NULL); +} + /** * ges_track_video_transition_set_transition_type: * @self: a #GESTrackVideoTransition diff --git a/ges/ges-track-video-transition.h b/ges/ges-track-video-transition.h index fc051ac235..000ad4ed45 100644 --- a/ges/ges-track-video-transition.h +++ b/ges/ges-track-video-transition.h @@ -85,6 +85,10 @@ ges_track_video_transition_get_transition_type (GESTrackVideoTransition * trans) GESTrackVideoTransition* ges_track_video_transition_new (void); +void +ges_track_video_transition_set_border (GESTrackVideoTransition * self, + gint value); + G_END_DECLS #endif /* _GES_TRACK_VIDEO_transition */