ges_timeline_object_set_inpoint
ges_timeline_object_set_start
ges_timeline_object_set_duration
+ges_timeline_object_get_layer
ges_timeline_object_find_track_object
CreateTrackObjectsFunc
ges_timeline_object_add_track_object
ges_timeline_object_create_track_object
ges_timeline_object_fill_track_object
ges_timeline_object_release_track_object
+ges_timeline_object_get_track_objects
ges_timeline_object_set_layer
ges_timeline_object_set_priority
GES_IS_TIMELINE_OBJECT
{
gint idx;
GESSimpleTimelineLayerPrivate *priv = layer->priv;
+ GESTimelineLayer *tl_obj_layer;
GST_DEBUG ("layer:%p, object:%p, newposition:%d", layer, object, newposition);
- if (G_UNLIKELY (object->layer != (GESTimelineLayer *) layer)) {
+ tl_obj_layer = ges_timeline_object_get_layer (object);
+ if (G_UNLIKELY (tl_obj_layer != (GESTimelineLayer *) layer)) {
GST_WARNING ("TimelineObject doesn't belong to this layer");
+ if (tl_obj_layer != NULL)
+ g_object_unref (tl_obj_layer);
return FALSE;
}
+ if (tl_obj_layer != NULL)
+ g_object_unref (tl_obj_layer);
/* Find it's current position */
idx = g_list_index (priv->objects, object);
static void
ges_tl_filesource_set_mute (GESTimelineFileSource * self, gboolean mute)
{
- GList *tmp;
+ GList *tmp, *trackobjects;
GESTimelineObject *object = (GESTimelineObject *) self;
GST_DEBUG ("self:%p, mute:%d", self, mute);
self->mute = mute;
/* Go over tracked objects, and update 'active' status on all audio objects */
- for (tmp = object->trackobjects; tmp; tmp = tmp->next) {
+ trackobjects = ges_timeline_object_get_track_objects (object);
+ for (tmp = trackobjects; tmp; tmp = tmp->next) {
GESTrackObject *trackobject = (GESTrackObject *) tmp->data;
if (trackobject->track->type == GES_TRACK_TYPE_AUDIO)
ges_track_object_set_active (trackobject, !mute);
+
+ g_object_unref (GES_TRACK_OBJECT (tmp->data));
}
+ g_list_free (trackobjects);
}
static void
ges_timeline_layer_add_object (GESTimelineLayer * layer,
GESTimelineObject * object)
{
+ GESTimelineLayer *tl_obj_layer;
+
GST_DEBUG ("layer:%p, object:%p", layer, object);
- if (G_UNLIKELY (object->layer)) {
+ tl_obj_layer = ges_timeline_object_get_layer (object);
+ if (G_UNLIKELY (tl_obj_layer)) {
GST_WARNING ("TimelineObject %p already belongs to another layer");
+ g_object_unref (tl_obj_layer);
return FALSE;
}
ges_timeline_layer_remove_object (GESTimelineLayer * layer,
GESTimelineObject * object)
{
+ GESTimelineLayer *tl_obj_layer;
GST_DEBUG ("layer:%p, object:%p", layer, object);
- if (G_UNLIKELY (object->layer != layer)) {
+ tl_obj_layer = ges_timeline_object_get_layer (object);
+ if (G_UNLIKELY (tl_obj_layer != layer)) {
GST_WARNING ("TimelineObject doesn't belong to this layer");
+ if (tl_obj_layer != NULL)
+ g_object_unref (tl_obj_layer);
return FALSE;
}
+ g_object_unref (tl_obj_layer);
/* emit 'object-removed' */
g_signal_emit (layer, ges_timeline_layer_signals[OBJECT_REMOVED], 0, object);
G_DEFINE_TYPE (GESTimelineObject, ges_timeline_object, G_TYPE_OBJECT);
+struct _GESTimelineObjectPrivate
+{
+ /*< public > */
+ GESTimelineLayer *layer;
+
+ /*< private > */
+ /* A list of TrackObject controlled by this TimelineObject */
+ GList *trackobjects;
+
+};
+
enum
{
PROP_0,
PROP_DURATION,
PROP_PRIORITY,
PROP_HEIGHT,
+ PROP_LAYER,
};
static void
case PROP_HEIGHT:
g_value_set_uint (value, tobj->height);
break;
+ case PROP_LAYER:
+ g_value_set_object (value, tobj->priv->layer);
+ break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
}
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
+ g_type_class_add_private (klass, sizeof (GESTimelineObjectPrivate));
+
object_class->get_property = ges_timeline_object_get_property;
object_class->set_property = ges_timeline_object_set_property;
object_class->dispose = ges_timeline_object_dispose;
/**
* GESTimelineObject:priority
- *
+ *
* The layer priority of the timeline object.
*/
"The span of priorities this object occupies", 0, G_MAXUINT, 1,
G_PARAM_READABLE));
+ /* GESSimpleTimelineLayer:layer
+ *
+ * The GESTimelineLayer where this object is being used.
+ */
+
+ g_object_class_install_property (object_class, PROP_LAYER,
+ g_param_spec_object ("layer", "Layer",
+ "The GESTimelineLayer where this object is being used.",
+ GES_TYPE_TIMELINE_LAYER, G_PARAM_READABLE));
+
klass->need_fill_track = TRUE;
}
static void
ges_timeline_object_init (GESTimelineObject * self)
{
+ self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self,
+ GES_TYPE_TIMELINE_OBJECT, GESTimelineObjectPrivate);
self->duration = GST_SECOND;
self->height = 1;
+ self->priv->trackobjects = NULL;
+ self->priv->layer = NULL;
}
/**
* ges_timeline_object_add_track_object:
* @object: a #GESTimelineObject
* @trobj: the GESTrackObject
- *
+ *
* Add a track object to the timeline object. Should only be called by
* subclasses implementing the create_track_objects (plural) vmethod.
*
GST_DEBUG ("Adding TrackObject to the list of controlled track objects");
/* We steal the initial reference */
- object->trackobjects = g_list_append (object->trackobjects, trobj);
+ object->priv->trackobjects =
+ g_list_append (object->priv->trackobjects, trobj);
GST_DEBUG ("Setting properties on newly created TrackObject");
{
GST_DEBUG ("object:%p, trackobject:%p", object, trobj);
- if (!(g_list_find (object->trackobjects, trobj))) {
+ if (!(g_list_find (object->priv->trackobjects, trobj))) {
GST_WARNING ("TrackObject isn't controlled by this object");
return FALSE;
}
/* FIXME : Do we need to tell the subclasses ? If so, add a new virtual-method */
- object->trackobjects = g_list_remove (object->trackobjects, trobj);
+ object->priv->trackobjects =
+ g_list_remove (object->priv->trackobjects, trobj);
ges_track_object_set_timeline_object (trobj, NULL);
{
GST_DEBUG ("object:%p, layer:%p", object, layer);
- object->layer = layer;
+ object->priv->layer = layer;
}
gboolean
GST_DEBUG ("object:%p, start:%" GST_TIME_FORMAT,
object, GST_TIME_ARGS (start));
- if (G_LIKELY (object->trackobjects)) {
+ if (G_LIKELY (object->priv->trackobjects)) {
GList *tmp;
- for (tmp = object->trackobjects; tmp; tmp = g_list_next (tmp))
+ for (tmp = object->priv->trackobjects; tmp; tmp = g_list_next (tmp))
/* call set_start_internal on each trackobject */
ges_track_object_set_start_internal (GES_TRACK_OBJECT (tmp->data), start);
GST_DEBUG ("object:%p, inpoint:%" GST_TIME_FORMAT,
object, GST_TIME_ARGS (inpoint));
- if (G_LIKELY (object->trackobjects)) {
+ if (G_LIKELY (object->priv->trackobjects)) {
GList *tmp;
- for (tmp = object->trackobjects; tmp; tmp = g_list_next (tmp))
+ for (tmp = object->priv->trackobjects; tmp; tmp = g_list_next (tmp))
/* call set_inpoint_internal on each trackobject */
ges_track_object_set_inpoint_internal (GES_TRACK_OBJECT (tmp->data),
inpoint);
GST_DEBUG ("object:%p, duration:%" GST_TIME_FORMAT,
object, GST_TIME_ARGS (duration));
- if (G_LIKELY (object->trackobjects)) {
+ if (G_LIKELY (object->priv->trackobjects)) {
GList *tmp;
- for (tmp = object->trackobjects; tmp; tmp = g_list_next (tmp))
+ for (tmp = object->priv->trackobjects; tmp; tmp = g_list_next (tmp))
/* call set_duration_internal on each trackobject */
ges_track_object_set_duration_internal (GES_TRACK_OBJECT (tmp->data),
duration);
{
GST_DEBUG ("object:%p, priority:%d", object, priority);
- if (G_LIKELY (object->trackobjects)) {
+ if (G_LIKELY (object->priv->trackobjects)) {
GList *tmp;
- for (tmp = object->trackobjects; tmp; tmp = g_list_next (tmp))
+ for (tmp = object->priv->trackobjects; tmp; tmp = g_list_next (tmp))
/* call set_priority_internal on each trackobject */
ges_track_object_set_priority_internal (GES_TRACK_OBJECT (tmp->data),
priority);
{
GESTrackObject *ret = NULL;
- if (G_LIKELY (object->trackobjects)) {
+ if (G_LIKELY (object->priv->trackobjects)) {
GList *tmp;
- for (tmp = object->trackobjects; tmp; tmp = g_list_next (tmp))
+ for (tmp = object->priv->trackobjects; tmp; tmp = g_list_next (tmp))
if (GES_TRACK_OBJECT (tmp->data)->track == track) {
if ((type != G_TYPE_NONE) && !G_TYPE_CHECK_INSTANCE_TYPE (tmp->data,
type))
return ret;
}
+/**
+ * ges_timeline_object_get_layer:
+ * @object: a #GESTimelineObject
+ *
+ * Note: The reference count of the returned #GESTimelineLayer will be increased,
+ * The user is responsible for unreffing it.
+ *
+ * Returns: The #GESTimelineLayer where this @object is being used, #NULL if
+ * it is not used on any layer.
+ */
+GESTimelineLayer *
+ges_timeline_object_get_layer (GESTimelineObject * object)
+{
+ g_return_val_if_fail (GES_IS_TIMELINE_OBJECT (object), NULL);
+
+ if (object->priv->layer != NULL)
+ g_object_ref (G_OBJECT (object->priv->layer));
+
+ return object->priv->layer;
+}
+
+/**
+ * ges_timeline_object_get_track_objects:
+ * @obj: a #GESTimelineObject
+ *
+ * Returns: The list of trackobject contained in @object.
+ * The user is responsible for unreffing the contained objects
+ * and freeing the list.
+ */
+GList *
+ges_timeline_object_get_track_objects (GESTimelineObject * object)
+{
+ GList *ret;
+ GList *tmp;
+
+ g_return_val_if_fail (GES_IS_TIMELINE_OBJECT (object), NULL);
+
+ ret = g_list_copy (object->priv->trackobjects);
+
+ for (tmp = ret; tmp; tmp = tmp->next) {
+ g_object_ref (tmp->data);
+ }
+
+ return ret;
+}
+
static void
track_object_priority_offset_changed_cb (GESTrackObject * child,
GParamSpec * arg G_GNUC_UNUSED, GESTimelineObject * obj)
#define GES_TIMELINE_OBJECT_GET_CLASS(obj) \
(G_TYPE_INSTANCE_GET_CLASS ((obj), GES_TYPE_TIMELINE_OBJECT, GESTimelineObjectClass))
+typedef struct _GESTimelineObjectPrivate GESTimelineObjectPrivate;
+
/**
* FillTrackObjectFunc:
* @object: the #GESTimelineObject controlling the track object
* Returns: TRUE if the implementer succesfully filled the @gnlobj, else #FALSE.
*/
typedef gboolean (*FillTrackObjectFunc) (GESTimelineObject * object,
- GESTrackObject * trobject,
- GstElement * gnlobj);
+ GESTrackObject * trobject,
+ GstElement * gnlobj);
/**
* CreateTrackObjectFunc:
* @track: a #GESTrack
*
* Creates the 'primary track object for this @object.
- *
+ *
* Implementors should override this function if they only interested in
* creating a single custom track object per track.
*
* Returns: the #GESTrackObject to be used, or %NULL.
*/
typedef GESTrackObject* (*CreateTrackObjectFunc) (GESTimelineObject * object,
- GESTrack * track);
+ GESTrack * track);
/**
* CreateTrackObjectsFunc:
* @object: a #GESTimelineObject
* @track: a #GESTrack
- *
+ *
* Create all track objects this object handles for this type of track.
*
* Returns: %TRUE on success %FALSE on failure.
struct _GESTimelineObject {
GObject parent;
- /*< public >*/
- GESTimelineLayer * layer;
/*< private >*/
- GList *trackobjects; /* A list of TrackObject controlled by this TimelineObject */
- /* start, inpoint, duration and fullduration are in nanoseconds */
- guint64 start; /* position (in time) of the object in the layer */
- guint64 inpoint; /* in-point */
- guint64 duration; /* duration of the object used in the layer */
- guint32 priority; /* priority of the object in the layer (0:top priority) */
+ GESTimelineObjectPrivate *priv;
+
+ /* We don't add those properties to the priv struct for optimization purposes
+ * start, inpoint, duration and fullduration are in nanoseconds */
+ guint64 start; /* position (in time) of the object in the layer */
+ guint64 inpoint; /* in-point */
+ guint64 duration; /* duration of the object used in the layer */
+ guint32 priority; /* priority of the object in the layer (0:top priority) */
guint32 height; /* the span of priorities this object needs */
guint64 fullduration; /* Full usable duration of the object (-1: no duration) */
CreateTrackObjectsFunc create_track_objects;
/* FIXME : might need a release_track_object */
- FillTrackObjectFunc fill_track_object;
+ FillTrackObjectFunc fill_track_object;
gboolean need_fill_track;
/*< private >*/
void ges_timeline_object_set_priority (GESTimelineObject * object, guint priority);
void ges_timeline_object_set_layer (GESTimelineObject * object,
- GESTimelineLayer * layer);
+ GESTimelineLayer * layer);
GESTrackObject *
ges_timeline_object_create_track_object (GESTimelineObject * object,
- GESTrack * track);
+ GESTrack * track);
gboolean ges_timeline_object_create_track_objects (GESTimelineObject *
object, GESTrack * track);
gboolean
ges_timeline_object_release_track_object (GESTimelineObject * object,
- GESTrackObject * trackobject);
+ GESTrackObject * trackobject);
gboolean
ges_timeline_object_fill_track_object (GESTimelineObject * object,
- GESTrackObject * trackobj,
- GstElement * gnlobj);
+ GESTrackObject * trackobj,
+ GstElement * gnlobj);
GESTrackObject *
ges_timeline_object_find_track_object (GESTimelineObject * object,
- GESTrack * track,
- GType type);
+ GESTrack * track, GType type);
+
+GList *
+ges_timeline_object_get_track_objects (GESTimelineObject *object);
+
+GESTimelineLayer *
+ges_timeline_object_get_layer (GESTimelineObject *object);
gboolean
ges_timeline_object_add_track_object (GESTimelineObject *object, GESTrackObject
static void
ges_timeline_source_set_text (GESTimelineSource * self, const gchar * text)
{
- GList *tmp;
+ GList *tmp, *trackobjects;
GESTimelineObject *object = (GESTimelineObject *) self;
GST_DEBUG ("self:%p, text:%s", self, text);
self->text = g_strdup (text);
- for (tmp = object->trackobjects; tmp; tmp = tmp->next) {
+ trackobjects = ges_timeline_object_get_track_objects (object);
+ for (tmp = trackobjects; tmp; tmp = tmp->next) {
GESTrackObject *trackobject = (GESTrackObject *) tmp->data;
if (GES_IS_TRACK_TEXT_OVERLAY (trackobject)) {
ges_track_object_set_active (trackobject, (text && (*text)) ? TRUE :
FALSE);
}
+
+ g_object_unref (GES_TRACK_OBJECT (tmp->data));
}
+ g_list_free (trackobjects);
}
static void
ges_timeline_source_set_font_desc (GESTimelineSource * self, const gchar *
font_desc)
{
- GList *tmp;
+ GList *tmp, *trackobjects;
GESTimelineObject *object = (GESTimelineObject *) self;
GST_DEBUG ("self:%p, font_desc:%s", self, font_desc);
self->font_desc = g_strdup (font_desc);
- for (tmp = object->trackobjects; tmp; tmp = tmp->next) {
+ trackobjects = ges_timeline_object_get_track_objects (object);
+ for (tmp = trackobjects; tmp; tmp = tmp->next) {
GESTrackObject *trackobject = (GESTrackObject *) tmp->data;
if (GES_IS_TRACK_TEXT_OVERLAY (trackobject))
ges_track_text_overlay_set_font_desc ((GESTrackTextOverlay *)
(trackobject), self->font_desc);
+
+ g_object_unref (GES_TRACK_OBJECT (tmp->data));
}
+ g_list_free (trackobjects);
}
static void
ges_timeline_source_set_halign (GESTimelineSource * self, GESTextHAlign halign)
{
- GList *tmp;
+ GList *tmp, *trackobjects;
GESTimelineObject *object = (GESTimelineObject *) self;
GST_DEBUG ("self:%p, halign:%d", self, halign);
self->halign = halign;
- for (tmp = object->trackobjects; tmp; tmp = tmp->next) {
+ trackobjects = ges_timeline_object_get_track_objects (object);
+ for (tmp = trackobjects; tmp; tmp = tmp->next) {
GESTrackObject *trackobject = (GESTrackObject *) tmp->data;
if (GES_IS_TRACK_TEXT_OVERLAY (trackobject))
ges_track_text_overlay_set_halignment ((GESTrackTextOverlay *)
(trackobject), self->halign);
+
+ g_object_unref (GES_TRACK_OBJECT (tmp->data));
}
+ g_list_free (trackobjects);
}
static void
ges_timeline_source_set_valign (GESTimelineSource * self, GESTextVAlign valign)
{
- GList *tmp;
+ GList *tmp, *trackobjects;
GESTimelineObject *object = (GESTimelineObject *) self;
GST_DEBUG ("self:%p, valign:%d", self, valign);
self->valign = valign;
- for (tmp = object->trackobjects; tmp; tmp = tmp->next) {
+ trackobjects = ges_timeline_object_get_track_objects (object);
+ for (tmp = trackobjects; tmp; tmp = tmp->next) {
GESTrackObject *trackobject = (GESTrackObject *) tmp->data;
if (GES_IS_TRACK_TEXT_OVERLAY (trackobject))
ges_track_text_overlay_set_valignment ((GESTrackTextOverlay *)
(trackobject), self->valign);
+
+ g_object_unref (GES_TRACK_OBJECT (tmp->data));
}
+ g_list_free (trackobjects);
}
static void
ges_timeline_test_source_set_mute (GESTimelineTestSource * self, gboolean mute)
{
- GList *tmp;
+ GList *tmp, *trackobjects;
GESTimelineObject *object = (GESTimelineObject *) self;
GST_DEBUG ("self:%p, mute:%d", self, mute);
self->mute = mute;
/* Go over tracked objects, and update 'active' status on all audio objects */
- for (tmp = object->trackobjects; tmp; tmp = tmp->next) {
+ trackobjects = ges_timeline_object_get_track_objects (object);
+ for (tmp = trackobjects; tmp; tmp = tmp->next) {
GESTrackObject *trackobject = (GESTrackObject *) tmp->data;
if (trackobject->track->type == GES_TRACK_TYPE_AUDIO)
ges_track_object_set_active (trackobject, !mute);
+
+ g_object_unref (GES_TRACK_OBJECT (tmp->data));
}
+ g_list_free (trackobjects);
}
static void
ges_timeline_test_source_set_vpattern (GESTimelineTestSource * self,
GESVideoTestPattern vpattern)
{
- GList *tmp;
+ GList *tmp, *trackobjects;
GESTimelineObject *object = (GESTimelineObject *) self;
self->vpattern = vpattern;
- for (tmp = object->trackobjects; tmp; tmp = tmp->next) {
+ trackobjects = ges_timeline_object_get_track_objects (object);
+ for (tmp = trackobjects; tmp; tmp = tmp->next) {
GESTrackObject *trackobject = (GESTrackObject *) tmp->data;
if (GES_IS_TRACK_VIDEO_TEST_SOURCE (trackobject))
ges_track_video_test_source_set_pattern (
(GESTrackVideoTestSource *) trackobject, vpattern);
+
+ g_object_unref (GES_TRACK_OBJECT (tmp->data));
}
+ g_list_free (trackobjects);
}
static void
ges_timeline_test_source_set_freq (GESTimelineTestSource * self, gdouble freq)
{
- GList *tmp;
+ GList *tmp, *trackobjects;
GESTimelineObject *object = (GESTimelineObject *) self;
self->freq = freq;
- for (tmp = object->trackobjects; tmp; tmp = tmp->next) {
+ trackobjects = ges_timeline_object_get_track_objects (object);
+ for (tmp = trackobjects; tmp; tmp = tmp->next) {
GESTrackObject *trackobject = (GESTrackObject *) tmp->data;
if (GES_IS_TRACK_AUDIO_TEST_SOURCE (trackobject))
ges_track_audio_test_source_set_freq (
(GESTrackAudioTestSource *) trackobject, freq);
+
+ g_object_unref (GES_TRACK_OBJECT (tmp->data));
}
+ g_list_free (trackobjects);
}
static void
ges_timeline_test_source_set_volume (GESTimelineTestSource * self,
gdouble volume)
{
- GList *tmp;
+ GList *tmp, *trackobjects;
GESTimelineObject *object = (GESTimelineObject *) self;
self->volume = volume;
- for (tmp = object->trackobjects; tmp; tmp = tmp->next) {
+ trackobjects = ges_timeline_object_get_track_objects (object);
+ for (tmp = trackobjects; tmp; tmp = tmp->next) {
GESTrackObject *trackobject = (GESTrackObject *) tmp->data;
if (GES_IS_TRACK_AUDIO_TEST_SOURCE (trackobject))
ges_track_audio_test_source_set_volume (
(GESTrackAudioTestSource *) trackobject, volume);
+
+ g_object_unref (GES_TRACK_OBJECT (tmp->data));
}
+ g_list_free (trackobjects);
}
static GESTrackObject *
static void
ges_tl_text_overlay_set_text (GESTimelineTextOverlay * self, const gchar * text)
{
- GList *tmp;
+ GList *tmp, *trackobjects;
GESTimelineObject *object = (GESTimelineObject *) self;
GST_DEBUG ("self:%p, text:%s", self, text);
self->text = g_strdup (text);
- for (tmp = object->trackobjects; tmp; tmp = tmp->next) {
+ trackobjects = ges_timeline_object_get_track_objects (object);
+ for (tmp = trackobjects; tmp; tmp = tmp->next) {
GESTrackObject *trackobject = (GESTrackObject *) tmp->data;
if (trackobject->track->type == GES_TRACK_TYPE_VIDEO)
ges_track_text_overlay_set_text (GES_TRACK_TEXT_OVERLAY
(trackobject), self->text);
+
+ g_object_unref (GES_TRACK_OBJECT (tmp->data));
}
+ g_list_free (trackobjects);
}
static void
ges_tl_text_overlay_set_font_desc (GESTimelineTextOverlay * self, const gchar *
font_desc)
{
- GList *tmp;
+ GList *tmp, *trackobjects;
GESTimelineObject *object = (GESTimelineObject *) self;
GST_DEBUG ("self:%p, font_desc:%s", self, font_desc);
self->font_desc = g_strdup (font_desc);
- for (tmp = object->trackobjects; tmp; tmp = tmp->next) {
+ trackobjects = ges_timeline_object_get_track_objects (object);
+ for (tmp = trackobjects; tmp; tmp = tmp->next) {
GESTrackObject *trackobject = (GESTrackObject *) tmp->data;
if (trackobject->track->type == GES_TRACK_TYPE_VIDEO)
ges_track_text_overlay_set_font_desc (GES_TRACK_TEXT_OVERLAY
(trackobject), self->font_desc);
+
+ g_object_unref (GES_TRACK_OBJECT (tmp->data));
}
+ g_list_free (trackobjects);
}
ges_tl_text_overlay_set_halign (GESTimelineTextOverlay * self,
GESTextHAlign halign)
{
- GList *tmp;
+ GList *tmp, *trackobjects;
GESTimelineObject *object = (GESTimelineObject *) self;
GST_DEBUG ("self:%p, halign:%d", self, halign);
self->halign = halign;
- for (tmp = object->trackobjects; tmp; tmp = tmp->next) {
+ trackobjects = ges_timeline_object_get_track_objects (object);
+ for (tmp = trackobjects; tmp; tmp = tmp->next) {
GESTrackObject *trackobject = (GESTrackObject *) tmp->data;
if (trackobject->track->type == GES_TRACK_TYPE_VIDEO)
ges_track_text_overlay_set_halignment (GES_TRACK_TEXT_OVERLAY
(trackobject), self->halign);
+
+ g_object_unref (GES_TRACK_OBJECT (tmp->data));
}
+ g_list_free (trackobjects);
}
ges_tl_text_overlay_set_valign (GESTimelineTextOverlay * self,
GESTextVAlign valign)
{
- GList *tmp;
+ GList *tmp, *trackobjects;
GESTimelineObject *object = (GESTimelineObject *) self;
GST_DEBUG ("self:%p, valign:%d", self, valign);
self->valign = valign;
- for (tmp = object->trackobjects; tmp; tmp = tmp->next) {
+ trackobjects = ges_timeline_object_get_track_objects (object);
+ for (tmp = trackobjects; tmp; tmp = tmp->next) {
GESTrackObject *trackobject = (GESTrackObject *) tmp->data;
if (trackobject->track->type == GES_TRACK_TYPE_VIDEO)
ges_track_text_overlay_set_valignment (GES_TRACK_TEXT_OVERLAY
(trackobject), self->valign);
+
+ g_object_unref (GES_TRACK_OBJECT (tmp->data));
}
+ g_list_free (trackobjects);
}
static void
ges_tl_title_src_set_text (GESTimelineTitleSource * self, const gchar * text)
{
- GList *tmp;
+ GList *tmp, *trackobjects;
GESTimelineObject *object = (GESTimelineObject *) self;
GST_DEBUG ("self:%p, text:%s", self, text);
self->text = g_strdup (text);
- for (tmp = object->trackobjects; tmp; tmp = tmp->next) {
+ trackobjects = ges_timeline_object_get_track_objects (object);
+ for (tmp = trackobjects; tmp; tmp = tmp->next) {
GESTrackObject *trackobject = (GESTrackObject *) tmp->data;
if (GES_IS_TRACK_TITLE_SOURCE (trackobject))
ges_track_title_source_set_text (GES_TRACK_TITLE_SOURCE
(trackobject), self->text);
+
+ g_object_unref (GES_TRACK_OBJECT (tmp->data));
}
+ g_list_free (trackobjects);
}
static void
ges_tl_title_src_set_font_desc (GESTimelineTitleSource * self, const gchar *
font_desc)
{
- GList *tmp;
+ GList *tmp, *trackobjects;
GESTimelineObject *object = (GESTimelineObject *) self;
GST_DEBUG ("self:%p, font_desc:%s", self, font_desc);
self->font_desc = g_strdup (font_desc);
- for (tmp = object->trackobjects; tmp; tmp = tmp->next) {
+ trackobjects = ges_timeline_object_get_track_objects (object);
+ for (tmp = trackobjects; tmp; tmp = tmp->next) {
GESTrackObject *trackobject = (GESTrackObject *) tmp->data;
if (GES_IS_TRACK_TITLE_SOURCE (trackobject))
ges_track_title_source_set_font_desc (GES_TRACK_TITLE_SOURCE
(trackobject), self->font_desc);
+
+ g_object_unref (GES_TRACK_OBJECT (tmp->data));
}
+ g_list_free (trackobjects);
}
static void
ges_tl_title_src_set_halign (GESTimelineTitleSource * self,
GESTextHAlign halign)
{
- GList *tmp;
+ GList *tmp, *trackobjects;
GESTimelineObject *object = (GESTimelineObject *) self;
GST_DEBUG ("self:%p, halign:%d", self, halign);
self->halign = halign;
- for (tmp = object->trackobjects; tmp; tmp = tmp->next) {
+ trackobjects = ges_timeline_object_get_track_objects (object);
+ for (tmp = trackobjects; tmp; tmp = tmp->next) {
GESTrackObject *trackobject = (GESTrackObject *) tmp->data;
if (GES_IS_TRACK_TITLE_SOURCE (trackobject))
ges_track_title_source_set_halignment (GES_TRACK_TITLE_SOURCE
(trackobject), self->halign);
+
+ g_object_unref (GES_TRACK_OBJECT (tmp->data));
}
+ g_list_free (trackobjects);
}
static void
ges_tl_title_src_set_valign (GESTimelineTitleSource * self,
GESTextVAlign valign)
{
- GList *tmp;
+ GList *tmp, *trackobjects;
GESTimelineObject *object = (GESTimelineObject *) self;
GST_DEBUG ("self:%p, valign:%d", self, valign);
self->valign = valign;
- for (tmp = object->trackobjects; tmp; tmp = tmp->next) {
+ trackobjects = ges_timeline_object_get_track_objects (object);
+ for (tmp = trackobjects; tmp; tmp = tmp->next) {
GESTrackObject *trackobject = (GESTrackObject *) tmp->data;
if (GES_IS_TRACK_TITLE_SOURCE (trackobject))
ges_track_title_source_set_valignment (GES_TRACK_TITLE_SOURCE
(trackobject), self->valign);
+
+ g_object_unref (GES_TRACK_OBJECT (tmp->data));
}
}
static void
ges_tl_title_src_set_mute (GESTimelineTitleSource * self, gboolean mute)
{
- GList *tmp;
+ GList *tmp, *trackobjects;
GESTimelineObject *object = (GESTimelineObject *) self;
GST_DEBUG ("self:%p, mute:%d", self, mute);
self->mute = mute;
/* Go over tracked objects, and update 'active' status on all audio objects */
- for (tmp = object->trackobjects; tmp; tmp = tmp->next) {
+ trackobjects = ges_timeline_object_get_track_objects (object);
+ for (tmp = trackobjects; tmp; tmp = tmp->next) {
GESTrackObject *trackobject = (GESTrackObject *) tmp->data;
if (trackobject->track->type == GES_TRACK_TYPE_AUDIO)
ges_track_object_set_active (trackobject, !mute);
+
+ g_object_unref (GES_TRACK_OBJECT (tmp->data));
}
+ g_list_free (trackobjects);
}
static GESTrackObject *
ges_timeline_transition_update_vtype_internal (GESTimelineObject * self,
GESVideoTransitionType value)
{
- GList *tmp;
+ GList *tmp, *trackobjects;
GESTimelineTransition *trself = (GESTimelineTransition *) self;
- for (tmp = self->trackobjects; tmp; tmp = g_list_next (tmp)) {
+ trackobjects = ges_timeline_object_get_track_objects (self);
+ for (tmp = trackobjects; tmp; tmp = tmp->next) {
GESTrackVideoTransition *obj;
if (GES_IS_TRACK_VIDEO_TRANSITION (tmp->data)) {
obj = (GESTrackVideoTransition *) tmp->data;
if (!ges_track_video_transition_set_type (obj, value))
return;
}
+
+ g_object_unref (GES_TRACK_OBJECT (tmp->data));
}
+ g_list_free (trackobjects);
trself->vtype = value;
return;
layer_object_removed_cb (GESTimelineLayer * layer, GESTimelineObject * object,
GESTimeline * timeline)
{
- GList *tmp, *next;
+ GList *tmp, *next, *trackobjects;
GST_DEBUG ("TimelineObject %p removed from layer %p", object, layer);
/* Go over the object's track objects and figure out which one belongs to
* the list of tracks we control */
- for (tmp = object->trackobjects; tmp; tmp = next) {
+ trackobjects = ges_timeline_object_get_track_objects (object);
+ for (tmp = trackobjects; tmp; tmp = tmp->next) {
GESTrackObject *trobj = (GESTrackObject *) tmp->data;
next = g_list_next (tmp);
ges_timeline_object_release_track_object (object, trobj);
}
+
+ g_object_unref (GES_TRACK_OBJECT (tmp->data));
}
+ g_list_free (trackobjects);
GST_DEBUG ("Done");
}
{
GstElement *src;
- GST_DEBUG ("timelineobj:%p, trackobjec:%p, gnlobj:%p",
+ GST_DEBUG ("timelineobj:%p, trackobject:%p, gnlobj:%p",
object, trobject, gnlobj);
/* Let's just put a fakesource in for the time being */
GST_START_TEST (test_ges_scenario)
{
GESTimeline *timeline;
- GESTimelineLayer *layer;
+ GESTimelineLayer *layer, *tmp_layer;
GESTrack *track;
GESCustomTimelineSource *source;
GESTrackObject *trackobject;
+ GList *trackobjects, *tmp;
ges_init ();
/* This is the simplest scenario ever */
GST_DEBUG ("Adding the source to the timeline layer");
fail_unless (ges_timeline_layer_add_object (layer,
GES_TIMELINE_OBJECT (source)));
- fail_unless (GES_TIMELINE_OBJECT (source)->layer == layer);
+ tmp_layer = ges_timeline_object_get_layer (GES_TIMELINE_OBJECT (source));
+ fail_unless (tmp_layer == layer);
ASSERT_OBJECT_REFCOUNT (source, "source", 1);
- /* Make sure the associated TrackObject is in the Track */
- fail_unless (GES_TIMELINE_OBJECT (source)->trackobjects != NULL);
+ g_object_unref (tmp_layer);
+ ASSERT_OBJECT_REFCOUNT (layer, "layer", 1);
- trackobject =
- GES_TRACK_OBJECT ((GES_TIMELINE_OBJECT (source)->trackobjects)->data);
+ /* Make sure the associated TrackObject is in the Track */
+ trackobjects =
+ ges_timeline_object_get_track_objects (GES_TIMELINE_OBJECT (source));
+ fail_unless (trackobjects != NULL);
+ trackobject = GES_TRACK_OBJECT (trackobjects->data);
+ ASSERT_OBJECT_REFCOUNT (trackobject, "trackobject", 2);
+ for (tmp = trackobjects; tmp; tmp = tmp->next) {
+ g_object_unref (GES_TRACK_OBJECT (tmp->data));
+ }
+ g_list_free (trackobjects);
ASSERT_OBJECT_REFCOUNT (trackobject, "trackobject", 1);
GST_DEBUG ("Remove the TimelineObject from the layer");
/* Now remove the timelineobject */
g_object_ref (source);
+ ASSERT_OBJECT_REFCOUNT (layer, "layer", 1);
fail_unless (ges_timeline_layer_remove_object (layer,
GES_TIMELINE_OBJECT (source)));
ASSERT_OBJECT_REFCOUNT (source, "source", 1);
- fail_unless (GES_TIMELINE_OBJECT (source)->layer == NULL);
- fail_unless (GES_TIMELINE_OBJECT (source)->trackobjects == NULL);
+ ASSERT_OBJECT_REFCOUNT (layer, "layer", 1);
+ tmp_layer = ges_timeline_object_get_layer (GES_TIMELINE_OBJECT (source));
+ fail_unless (tmp_layer == NULL);
+ trackobjects =
+ ges_timeline_object_get_track_objects (GES_TIMELINE_OBJECT (source));
+ fail_unless (trackobjects == NULL); /* No unreffing then */
g_object_unref (source);
GST_DEBUG ("Removing track from the timeline");
GST_START_TEST (test_ges_timeline_add_layer)
{
GESTimeline *timeline;
- GESTimelineLayer *layer;
+ GESTimelineLayer *layer, *tmp_layer;
GESTrack *track;
GESCustomTimelineSource *s1, *s2, *s3;
+ GList *trackobjects, *tmp;
GESTrackObject *trackobject;
ges_init ();
s1 = ges_custom_timeline_source_new (my_fill_track_func, NULL);
fail_unless (s1 != NULL);
fail_unless (ges_timeline_layer_add_object (layer, GES_TIMELINE_OBJECT (s1)));
- fail_unless (GES_TIMELINE_OBJECT (s1)->layer == layer);
+ tmp_layer = ges_timeline_object_get_layer (GES_TIMELINE_OBJECT (s1));
+ fail_unless (tmp_layer == layer);
+ ASSERT_OBJECT_REFCOUNT (layer, "layer", 2);
+ g_object_unref (tmp_layer);
GST_DEBUG ("Creating a source");
s2 = ges_custom_timeline_source_new (my_fill_track_func, NULL);
fail_unless (s2 != NULL);
fail_unless (ges_timeline_layer_add_object (layer, GES_TIMELINE_OBJECT (s2)));
- fail_unless (GES_TIMELINE_OBJECT (s2)->layer == layer);
+ tmp_layer = ges_timeline_object_get_layer (GES_TIMELINE_OBJECT (s2));
+ fail_unless (tmp_layer == layer);
+ ASSERT_OBJECT_REFCOUNT (layer, "layer", 2);
+ g_object_unref (tmp_layer);
GST_DEBUG ("Creating a source");
s3 = ges_custom_timeline_source_new (my_fill_track_func, NULL);
fail_unless (s3 != NULL);
fail_unless (ges_timeline_layer_add_object (layer, GES_TIMELINE_OBJECT (s3)));
- fail_unless (GES_TIMELINE_OBJECT (s3)->layer == layer);
+ tmp_layer = ges_timeline_object_get_layer (GES_TIMELINE_OBJECT (s3));
+ fail_unless (tmp_layer == layer);
+ ASSERT_OBJECT_REFCOUNT (layer, "layer", 2);
+ g_object_unref (tmp_layer);
GST_DEBUG ("Add the layer to the timeline");
fail_unless (ges_timeline_add_layer (timeline, layer));
fail_unless (g_list_find (timeline->layers, layer) != NULL);
/* Make sure the associated TrackObjects are in the Track */
- fail_unless (GES_TIMELINE_OBJECT (s1)->trackobjects != NULL);
- fail_unless (GES_TIMELINE_OBJECT (s2)->trackobjects != NULL);
- fail_unless (GES_TIMELINE_OBJECT (s3)->trackobjects != NULL);
-
- trackobject =
- GES_TRACK_OBJECT ((GES_TIMELINE_OBJECT (s1)->trackobjects)->data);
- ASSERT_OBJECT_REFCOUNT (trackobject, "trackobject", 1);
-
- trackobject =
- GES_TRACK_OBJECT ((GES_TIMELINE_OBJECT (s2)->trackobjects)->data);
+ trackobjects =
+ ges_timeline_object_get_track_objects (GES_TIMELINE_OBJECT (s1));
+ fail_unless (trackobjects != NULL);
+ trackobject = GES_TRACK_OBJECT (trackobjects->data);
+ ASSERT_OBJECT_REFCOUNT (trackobject, "trackobject", 2);
+ for (tmp = trackobjects; tmp; tmp = tmp->next) {
+ g_object_unref (GES_TRACK_OBJECT (tmp->data));
+ }
+ g_list_free (trackobjects);
ASSERT_OBJECT_REFCOUNT (trackobject, "trackobject", 1);
- trackobject =
- GES_TRACK_OBJECT ((GES_TIMELINE_OBJECT (s3)->trackobjects)->data);
+ trackobjects =
+ ges_timeline_object_get_track_objects (GES_TIMELINE_OBJECT (s2));
+ trackobject = GES_TRACK_OBJECT (trackobjects->data);
+ fail_unless (trackobjects != NULL);
+ for (tmp = trackobjects; tmp; tmp = tmp->next) {
+ g_object_unref (GES_TRACK_OBJECT (tmp->data));
+ }
+ g_list_free (trackobjects);
+ ASSERT_OBJECT_REFCOUNT (GES_TRACK_OBJECT (trackobject), "trackobject", 1);
+
+ trackobjects =
+ ges_timeline_object_get_track_objects (GES_TIMELINE_OBJECT (s3));
+ trackobject = GES_TRACK_OBJECT (trackobjects->data);
+ fail_unless (trackobjects != NULL);
+ for (tmp = trackobjects; tmp; tmp = tmp->next) {
+ g_object_unref (GES_TRACK_OBJECT (tmp->data));
+ }
+ g_list_free (trackobjects);
ASSERT_OBJECT_REFCOUNT (trackobject, "trackobject", 1);
/* theoretically this is all we need to do to ensure cleanup */
GST_START_TEST (test_ges_timeline_add_layer_first)
{
GESTimeline *timeline;
- GESTimelineLayer *layer;
+ GESTimelineLayer *layer, *tmp_layer;
GESTrack *track;
GESCustomTimelineSource *s1, *s2, *s3;
- GESTrackObject *trackobject;
+ GList *trackobjects, *tmp;
ges_init ();
s1 = ges_custom_timeline_source_new (my_fill_track_func, NULL);
fail_unless (s1 != NULL);
fail_unless (ges_timeline_layer_add_object (layer, GES_TIMELINE_OBJECT (s1)));
- fail_unless (GES_TIMELINE_OBJECT (s1)->layer == layer);
+ tmp_layer = ges_timeline_object_get_layer (GES_TIMELINE_OBJECT (s1));
+ fail_unless (tmp_layer == layer);
+ g_object_unref (tmp_layer);
GST_DEBUG ("Creating a source");
s2 = ges_custom_timeline_source_new (my_fill_track_func, NULL);
fail_unless (s2 != NULL);
fail_unless (ges_timeline_layer_add_object (layer, GES_TIMELINE_OBJECT (s2)));
- fail_unless (GES_TIMELINE_OBJECT (s2)->layer == layer);
+ tmp_layer = ges_timeline_object_get_layer (GES_TIMELINE_OBJECT (s2));
+ fail_unless (tmp_layer == layer);
+ g_object_unref (tmp_layer);
GST_DEBUG ("Creating a source");
s3 = ges_custom_timeline_source_new (my_fill_track_func, NULL);
fail_unless (s3 != NULL);
fail_unless (ges_timeline_layer_add_object (layer, GES_TIMELINE_OBJECT (s3)));
- fail_unless (GES_TIMELINE_OBJECT (s3)->layer == layer);
+ tmp_layer = ges_timeline_object_get_layer (GES_TIMELINE_OBJECT (s3));
+ fail_unless (tmp_layer == layer);
+ g_object_unref (tmp_layer);
GST_DEBUG ("Add the layer to the timeline");
fail_unless (ges_timeline_add_layer (timeline, layer));
fail_unless ((gpointer) GST_ELEMENT_PARENT (track) == (gpointer) timeline);
/* Make sure the associated TrackObjects are in the Track */
- fail_unless (GES_TIMELINE_OBJECT (s1)->trackobjects != NULL);
- fail_unless (GES_TIMELINE_OBJECT (s2)->trackobjects != NULL);
- fail_unless (GES_TIMELINE_OBJECT (s3)->trackobjects != NULL);
-
- trackobject =
- GES_TRACK_OBJECT ((GES_TIMELINE_OBJECT (s1)->trackobjects)->data);
- ASSERT_OBJECT_REFCOUNT (trackobject, "trackobject", 1);
-
- trackobject =
- GES_TRACK_OBJECT ((GES_TIMELINE_OBJECT (s2)->trackobjects)->data);
- ASSERT_OBJECT_REFCOUNT (trackobject, "trackobject", 1);
-
- trackobject =
- GES_TRACK_OBJECT ((GES_TIMELINE_OBJECT (s3)->trackobjects)->data);
- ASSERT_OBJECT_REFCOUNT (trackobject, "trackobject", 1);
+ trackobjects =
+ ges_timeline_object_get_track_objects (GES_TIMELINE_OBJECT (s1));
+ fail_unless (trackobjects != NULL);
+ for (tmp = trackobjects; tmp; tmp = tmp->next) {
+ ASSERT_OBJECT_REFCOUNT (GES_TRACK_OBJECT (tmp->data), "trackobject", 2);
+ g_object_unref (GES_TRACK_OBJECT (tmp->data));
+ }
+ g_list_free (trackobjects);
+
+ trackobjects =
+ ges_timeline_object_get_track_objects (GES_TIMELINE_OBJECT (s2));
+ fail_unless (trackobjects != NULL);
+ for (tmp = trackobjects; tmp; tmp = tmp->next) {
+ ASSERT_OBJECT_REFCOUNT (GES_TRACK_OBJECT (tmp->data), "trackobject", 2);
+ g_object_unref (GES_TRACK_OBJECT (tmp->data));
+ }
+ g_list_free (trackobjects);
+
+ trackobjects =
+ ges_timeline_object_get_track_objects (GES_TIMELINE_OBJECT (s3));
+ fail_unless (trackobjects != NULL);
+ for (tmp = trackobjects; tmp; tmp = tmp->next) {
+ ASSERT_OBJECT_REFCOUNT (GES_TRACK_OBJECT (tmp->data), "trackobject", 2);
+ g_object_unref (GES_TRACK_OBJECT (tmp->data));
+ }
+ g_list_free (trackobjects);
/* theoretically this is all we need to do to ensure cleanup */
g_object_unref (timeline);
GST_START_TEST (test_ges_timeline_remove_track)
{
GESTimeline *timeline;
- GESTimelineLayer *layer;
+ GESTimelineLayer *layer, *tmp_layer;
GESTrack *track;
GESCustomTimelineSource *s1, *s2, *s3;
GESTrackObject *t1, *t2, *t3;
+ GList *trackobjects, *tmp;
ges_init ();
s1 = ges_custom_timeline_source_new (my_fill_track_func, NULL);
fail_unless (s1 != NULL);
fail_unless (ges_timeline_layer_add_object (layer, GES_TIMELINE_OBJECT (s1)));
- fail_unless (GES_TIMELINE_OBJECT (s1)->layer == layer);
+ tmp_layer = ges_timeline_object_get_layer (GES_TIMELINE_OBJECT (s1));
+ fail_unless (tmp_layer == layer);
+ g_object_unref (tmp_layer);
GST_DEBUG ("Creating a source");
s2 = ges_custom_timeline_source_new (my_fill_track_func, NULL);
fail_unless (s2 != NULL);
fail_unless (ges_timeline_layer_add_object (layer, GES_TIMELINE_OBJECT (s2)));
- fail_unless (GES_TIMELINE_OBJECT (s2)->layer == layer);
+ tmp_layer = ges_timeline_object_get_layer (GES_TIMELINE_OBJECT (s2));
+ fail_unless (tmp_layer == layer);
+ g_object_unref (tmp_layer);
GST_DEBUG ("Creating a source");
s3 = ges_custom_timeline_source_new (my_fill_track_func, NULL);
fail_unless (s3 != NULL);
fail_unless (ges_timeline_layer_add_object (layer, GES_TIMELINE_OBJECT (s3)));
- fail_unless (GES_TIMELINE_OBJECT (s3)->layer == layer);
+ tmp_layer = ges_timeline_object_get_layer (GES_TIMELINE_OBJECT (s3));
+ fail_unless (tmp_layer == layer);
+ g_object_unref (tmp_layer);
GST_DEBUG ("Add the layer to the timeline");
fail_unless (ges_timeline_add_layer (timeline, layer));
fail_unless ((gpointer) GST_ELEMENT_PARENT (track) == (gpointer) timeline);
/* Make sure the associated TrackObjects are in the Track */
- fail_unless (GES_TIMELINE_OBJECT (s1)->trackobjects != NULL);
- fail_unless (GES_TIMELINE_OBJECT (s2)->trackobjects != NULL);
- fail_unless (GES_TIMELINE_OBJECT (s3)->trackobjects != NULL);
-
- t1 = GES_TRACK_OBJECT ((GES_TIMELINE_OBJECT (s1)->trackobjects)->data);
+ trackobjects =
+ ges_timeline_object_get_track_objects (GES_TIMELINE_OBJECT (s1));
+ fail_unless (trackobjects != NULL);
+ t1 = GES_TRACK_OBJECT ((trackobjects)->data);
g_object_ref (t1);
+ for (tmp = trackobjects; tmp; tmp = tmp->next) {
+ ASSERT_OBJECT_REFCOUNT (GES_TRACK_OBJECT (tmp->data), "trackobject", 3);
+ g_object_unref (GES_TRACK_OBJECT (tmp->data));
+ }
+ g_list_free (trackobjects);
ASSERT_OBJECT_REFCOUNT (t1, "trackobject", 2);
- t2 = GES_TRACK_OBJECT ((GES_TIMELINE_OBJECT (s2)->trackobjects)->data);
+ trackobjects =
+ ges_timeline_object_get_track_objects (GES_TIMELINE_OBJECT (s2));
+ fail_unless (trackobjects != NULL);
+ t2 = GES_TRACK_OBJECT (trackobjects->data);
g_object_ref (t2);
+ for (tmp = trackobjects; tmp; tmp = tmp->next) {
+ ASSERT_OBJECT_REFCOUNT (GES_TRACK_OBJECT (tmp->data), "trackobject", 3);
+ g_object_unref (GES_TRACK_OBJECT (tmp->data));
+ }
+ g_list_free (trackobjects);
ASSERT_OBJECT_REFCOUNT (t2, "t2", 2);
- t3 = GES_TRACK_OBJECT ((GES_TIMELINE_OBJECT (s3)->trackobjects)->data);
+ trackobjects =
+ ges_timeline_object_get_track_objects (GES_TIMELINE_OBJECT (s3));
+ fail_unless (trackobjects != NULL);
+ t3 = GES_TRACK_OBJECT (trackobjects->data);
g_object_ref (t3);
+ for (tmp = trackobjects; tmp; tmp = tmp->next) {
+ ASSERT_OBJECT_REFCOUNT (GES_TRACK_OBJECT (tmp->data), "trackobject", 3);
+ g_object_unref (GES_TRACK_OBJECT (tmp->data));
+ }
+ g_list_free (trackobjects);
ASSERT_OBJECT_REFCOUNT (t3, "t3", 2);
/* remove the track and check that the track objects have been released */
, bv = {
0};
- /* ignore name property */
- if (!g_strcmp0 ("name", (*iter)->name))
+ /* ignore name and layer properties */
+ if (!g_strcmp0 ("name", (*iter)->name) ||
+ !g_strcmp0 ("layer", (*iter)->name))
continue;
/* special case caps property */
fail_unless (ges_simple_timeline_layer_add_object (GES_SIMPLE_TIMELINE_LAYER
(layer), GES_TIMELINE_OBJECT (source), -1));
- fail_unless (GES_TIMELINE_OBJECT (source)->layer == layer);
+ fail_unless (ges_timeline_object_get_layer (GES_TIMELINE_OBJECT (source)) ==
+ layer);
fail_unless_equals_uint64 (GES_TIMELINE_OBJECT_DURATION (source), GST_SECOND);
fail_unless_equals_uint64 (GES_TIMELINE_OBJECT_START (source), 0);
guint64 start, duration;
gint priority;
char *name;
+ GList *trackobjects, *tmp;
if (!tr)
return FALSE;
- trackobj = GES_TRACK_OBJECT (tr->trackobjects->data);
+ trackobjects = ges_timeline_object_get_track_objects (tr);
+ trackobj = GES_TRACK_OBJECT (trackobjects->data);
gnlobj = trackobj->gnlobject;
g_object_get (gnlobj, "start", &start, "duration", &duration,
((gfloat) start) / GST_SECOND,
((gfloat) duration) / GST_SECOND, priority);
+ for (tmp = trackobjects; tmp; tmp = tmp->next) {
+ g_object_unref (GES_TRACK_OBJECT (tmp->data));
+ }
+
+ g_list_free (trackobjects);
+
return FALSE;
}
guint64 start, duration;
gint priority;
char *name;
+ GList *trackobjects, *tmp;
if (!tr)
return FALSE;
- trackobj = GES_TRACK_OBJECT (tr->trackobjects->data);
+ trackobjects = ges_timeline_object_get_track_objects (tr);
+ trackobj = GES_TRACK_OBJECT (trackobjects->data);
gnlobj = trackobj->gnlobject;
g_object_get (gnlobj, "start", &start, "duration", &duration,
((gfloat) start) / GST_SECOND,
((gfloat) duration) / GST_SECOND, priority);
+ for (tmp = trackobjects; tmp; tmp = tmp->next) {
+ g_object_unref (GES_TRACK_OBJECT (tmp->data));
+ }
+
+ g_list_free (trackobjects);
+
return FALSE;
}
guint64 start, duration;
gint priority;
char *name;
+ GList *trackobjects, *tmp;
if (!tr)
return FALSE;
- trackobj = GES_TRACK_OBJECT (tr->trackobjects->data);
+ trackobjects = ges_timeline_object_get_track_objects (tr);
+
+ trackobj = GES_TRACK_OBJECT (trackobjects->data);
gnlobj = trackobj->gnlobject;
g_object_get (gnlobj, "start", &start, "duration", &duration,
((gfloat) start) / GST_SECOND,
((gfloat) duration) / GST_SECOND, priority);
+ for (tmp = trackobjects; tmp; tmp = tmp->next) {
+ g_object_unref (GES_TRACK_OBJECT (tmp->data));
+ }
+
+ g_list_free (trackobjects);
+
return FALSE;
}