[0.10] gst-editing-services: ges-track-object: Make possible to add a track already containing a gnlobject to a track
Thibault Saunier
tsaunier at kemper.freedesktop.org
Wed Apr 25 14:37:14 PDT 2012
Module: gst-editing-services
Branch: 0.10
Commit: 7b0797c992ab7f6cba5e085b67c2622a236affb9
URL: http://cgit.freedesktop.org/gstreamer/gst-editing-services/commit/?id=7b0797c992ab7f6cba5e085b67c2622a236affb9
Author: Thibault Saunier <thibault.saunier at collabora.com>
Date: Tue Apr 17 18:42:41 2012 -0400
ges-track-object: Make possible to add a track already containing a gnlobject to a track
---
ges/ges-track-object.c | 40 ++++++++++++++++++++++++++--------------
ges/ges-track.c | 8 --------
2 files changed, 26 insertions(+), 22 deletions(-)
diff --git a/ges/ges-track-object.c b/ges/ges-track-object.c
index 3fb0cc9..7318f96 100644
--- a/ges/ges-track-object.c
+++ b/ges/ges-track-object.c
@@ -766,20 +766,21 @@ ensure_gnl_object (GESTrackObject * object)
GST_DEBUG ("Calling virtual method");
- /* call the create_gnl_object virtual method */
- gnlobject = class->create_gnl_object (object);
+ /* 2. Fill in the GnlObject */
+ if (object->priv->gnlobject == NULL) {
- if (G_UNLIKELY (gnlobject == NULL)) {
- GST_ERROR
- ("'create_gnl_object' implementation returned TRUE but no GnlObject is available");
- goto done;
- }
+ /* call the create_gnl_object virtual method */
+ gnlobject = class->create_gnl_object (object);
- object->priv->gnlobject = gnlobject;
+ if (G_UNLIKELY (gnlobject == NULL)) {
+ GST_ERROR
+ ("'create_gnl_object' implementation returned TRUE but no GnlObject is available");
+ goto done;
+ }
- /* 2. Fill in the GnlObject */
- if (gnlobject) {
- GST_DEBUG ("Got a valid GnlObject, now filling it in");
+ GST_DEBUG_OBJECT (object, "Got a valid GnlObject, now filling it in");
+
+ object->priv->gnlobject = gnlobject;
if (object->priv->timelineobj)
res = ges_timeline_object_fill_track_object (object->priv->timelineobj,
@@ -803,7 +804,6 @@ ensure_gnl_object (GESTrackObject * object)
/* Set some properties on the GnlObject */
g_object_set (object->priv->gnlobject,
- "caps", ges_track_get_caps (object->priv->track),
"duration", object->priv->pending_duration,
"media-duration", object->priv->pending_duration,
"start", object->priv->pending_start,
@@ -811,6 +811,10 @@ ensure_gnl_object (GESTrackObject * object)
"priority", object->priv->pending_priority,
"active", object->priv->pending_active, NULL);
+ if (object->priv->track != NULL)
+ g_object_set (object->priv->gnlobject,
+ "caps", ges_track_get_caps (object->priv->track), NULL);
+
/* We feed up the props_hashtable if possible */
if (class->get_props_hastable) {
props_hash = class->get_props_hastable (object);
@@ -842,8 +846,16 @@ ges_track_object_set_track (GESTrackObject * object, GESTrack * track)
object->priv->track = track;
- if (object->priv->track)
- return ensure_gnl_object (object);
+ if (object->priv->track) {
+ /* If we already have a gnlobject, we just set its caps properly */
+ if (object->priv->gnlobject) {
+ g_object_set (object->priv->gnlobject,
+ "caps", ges_track_get_caps (object->priv->track), NULL);
+ return TRUE;
+ } else {
+ return ensure_gnl_object (object);
+ }
+ }
return TRUE;
}
diff --git a/ges/ges-track.c b/ges/ges-track.c
index bff638a..30eb881 100644
--- a/ges/ges-track.c
+++ b/ges/ges-track.c
@@ -456,14 +456,6 @@ ges_track_add_object (GESTrack * track, GESTrackObject * object)
return FALSE;
}
- /* At this point, the track object shouldn't have any gnlobject since
- * it hasn't been added to a track yet.
- * FIXME : This check seems a bit obsolete */
- if (G_UNLIKELY (ges_track_object_get_gnlobject (object) != NULL)) {
- GST_ERROR ("TrackObject already controls a gnlobject !");
- return FALSE;
- }
-
if (G_UNLIKELY (!ges_track_object_set_track (object, track))) {
GST_ERROR ("Couldn't properly add the object to the Track");
return FALSE;
More information about the gstreamer-commits
mailing list