static void
ges_track_dispose (GObject * object)
{
+ GESTrack *track = (GESTrack *) object;
+
+ /* FIXME : Remove all TrackObjects ! */
+
+ if (track->composition) {
+ g_object_unref (track->composition);
+ track->composition = NULL;
+ }
+
G_OBJECT_CLASS (ges_track_parent_class)->dispose (object);
}
static void
ges_track_init (GESTrack * self)
{
+ self->composition = gst_element_factory_make ("gnlcomposition", NULL);
}
GESTrack *
return FALSE;
}
- ges_track_object_set_track (object, track);
+ if (G_UNLIKELY (!ges_track_object_set_track (object, track))) {
+ GST_ERROR ("Couldn't properly add the object to the Track");
+ return FALSE;
+ }
GST_DEBUG ("Adding object to ourself");
return TRUE;
}
+
+gboolean
+ges_track_remove_object (GESTrack * track, GESTrackObject * object)
+{
+ GST_DEBUG ("track:%p, object:%p", track, object);
+
+ if (G_UNLIKELY (object->track != track)) {
+ GST_WARNING ("Object belongs to another track");
+ return FALSE;
+ }
+
+ if (G_LIKELY (object->gnlobject != NULL)) {
+ GST_DEBUG ("Removing GnlObject from composition");
+ if (!gst_bin_remove (GST_BIN (track->composition), object->gnlobject)) {
+ GST_WARNING ("Failed to remove gnlobject from composition");
+ return FALSE;
+ }
+ }
+
+ ges_track_object_set_track (object, NULL);
+
+ return TRUE;
+}
void ges_track_set_timeline (GESTrack * track, GESTimeline *timeline);
gboolean ges_track_add_object (GESTrack * track, GESTrackObject * object);
+gboolean ges_track_remove_object (GESTrack * track, GESTrackObject * object);
G_END_DECLS