}
static void
+_timeline_track_added_cb (GESTimeline *timeline, GESTrack *track, GESPipeline *pipeline)
+{
+ _link_track (pipeline, track);
+}
+
+static void
+_timeline_track_removed_cb (GESTimeline *timeline, GESTrack *track, GESPipeline *pipeline)
+{
+ _unlink_track (pipeline, track);
+}
+
+static void
ges_pipeline_dispose (GObject * object)
{
GESPipeline *self = GES_PIPELINE (object);
self->priv->profile = NULL;
}
+ if (self->priv->timeline) {
+ g_signal_handlers_disconnect_by_func (self->priv->timeline,
+ _timeline_track_added_cb, self);
+ g_signal_handlers_disconnect_by_func (self->priv->timeline,
+ _timeline_track_removed_cb, self);
+ }
+
G_OBJECT_CLASS (ges_pipeline_parent_class)->dispose (object);
}
gst_object_unref (chain->playsinkpad);
}
- /* Unlike/remove tee */
peer = gst_element_get_static_pad (chain->tee, "sink");
gst_pad_unlink (pad, peer);
gst_object_unref (peer);
}
pipeline->priv->timeline = timeline;
+ g_signal_connect (timeline, "track-added",
+ G_CALLBACK (_timeline_track_added_cb), pipeline);
+ g_signal_connect (timeline, "track-removed",
+ G_CALLBACK (_timeline_track_removed_cb), pipeline);
/* FIXME Check if we should rollback if we can't sync state */
gst_element_sync_state_with_parent (GST_ELEMENT (timeline));
GST_DEBUG ("Done adding track, emitting 'track-added' signal");
+ _ghost_track_srcpad (tr_priv);
+
/* emit 'track-added' */
g_signal_emit (timeline, ges_timeline_signals[TRACK_ADDED], 0, track);
g_list_free (objects);
}
- _ghost_track_srcpad (tr_priv);
-
/* FIXME Check if we should rollback if we can't sync state */
gst_element_sync_state_with_parent (GST_ELEMENT (track));
g_object_set (track, "message-forward", TRUE, NULL);