diff --git a/ges/ges-track-transition.c b/ges/ges-track-transition.c index 436f3ee556..de428bdb17 100644 --- a/ges/ges-track-transition.c +++ b/ges/ges-track-transition.c @@ -123,9 +123,22 @@ static void gnlobject_duration_cb (GstElement * gnlobject, GParamSpec * arg G_GNUC_UNUSED, GESTrackTransition * self) { - GESTrackType type = ((GESTrackObject *) self)->track->type; + GESTrackTransitionClass *klass; + + klass = GES_TRACK_TRANSITION_GET_CLASS (self); GST_LOG ("got duration changed signal"); + klass = GES_TRACK_TRANSITION_GET_CLASS (self); + klass->duration_changed (self, gnlobject); +} + +static void +ges_track_transition_duration_changed (GESTrackTransition * self, GstElement + * gnlobject) +{ + GESTrackType type; + type = ((GESTrackObject *) self)->track->type; + if (type == GES_TRACK_TYPE_VIDEO) ges_track_transition_update_vcontroller (self, gnlobject); else if (type == GES_TRACK_TYPE_AUDIO) { @@ -328,10 +341,6 @@ create_video_bin (GESTrackTransition * self) self->vcontroller = controller; self->vcontrol_source = control_source; - GST_LOG ("controller created, updating"); - ges_track_transition_update_vcontroller (self, - ((GESTrackObject *) self)->gnlobject); - return topbin; } @@ -410,11 +419,6 @@ create_audio_bin (GESTrackTransition * self) self->a_acontrol_source = acontrol_source; self->a_bcontrol_source = bcontrol_source; - GST_LOG ("controllers created, updating"); - - ges_track_transition_update_acontroller (self, - ((GESTrackObject *) self)->gnlobject); - return topbin; } @@ -443,6 +447,8 @@ ges_track_transition_create_gnl_object (GESTrackObject * object) return FALSE; gst_bin_add (GST_BIN (object->gnlobject), element); + + klass->duration_changed (self, object->gnlobject); return TRUE; } @@ -474,6 +480,7 @@ ges_track_transition_class_init (GESTrackTransitionClass * klass) track_class->create_gnl_object = ges_track_transition_create_gnl_object; klass->create_element = ges_track_transition_create_element; + klass->duration_changed = ges_track_transition_duration_changed; } static void diff --git a/ges/ges-track-transition.h b/ges/ges-track-transition.h index 0da0318402..7aa8d5fbbb 100644 --- a/ges/ges-track-transition.h +++ b/ges/ges-track-transition.h @@ -101,8 +101,11 @@ struct _GESTrackTransition struct _GESTrackTransitionClass { GESTrackObjectClass parent_class; + /* */ GstElement* (*create_element) (GESTrackTransition *self, GESTrack *track); + void (*duration_changed) (GESTrackTransition *self, GstElement + *gnlobj); }; GType ges_track_transition_get_type (void);