mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-19 05:45:58 +00:00
GESTimelineObject: add private structure
This commit is contained in:
parent
7fc3be7d44
commit
dfeb7afe85
18 changed files with 432 additions and 139 deletions
|
@ -271,6 +271,7 @@ GES_TIMELINE_OBJECT_HEIGHT
|
||||||
ges_timeline_object_set_inpoint
|
ges_timeline_object_set_inpoint
|
||||||
ges_timeline_object_set_start
|
ges_timeline_object_set_start
|
||||||
ges_timeline_object_set_duration
|
ges_timeline_object_set_duration
|
||||||
|
ges_timeline_object_get_layer
|
||||||
ges_timeline_object_find_track_object
|
ges_timeline_object_find_track_object
|
||||||
CreateTrackObjectsFunc
|
CreateTrackObjectsFunc
|
||||||
ges_timeline_object_add_track_object
|
ges_timeline_object_add_track_object
|
||||||
|
@ -279,6 +280,7 @@ ges_timeline_object_create_track_objects
|
||||||
ges_timeline_object_create_track_object
|
ges_timeline_object_create_track_object
|
||||||
ges_timeline_object_fill_track_object
|
ges_timeline_object_fill_track_object
|
||||||
ges_timeline_object_release_track_object
|
ges_timeline_object_release_track_object
|
||||||
|
ges_timeline_object_get_track_objects
|
||||||
ges_timeline_object_set_layer
|
ges_timeline_object_set_layer
|
||||||
ges_timeline_object_set_priority
|
ges_timeline_object_set_priority
|
||||||
GES_IS_TIMELINE_OBJECT
|
GES_IS_TIMELINE_OBJECT
|
||||||
|
|
|
@ -383,13 +383,19 @@ ges_simple_timeline_layer_move_object (GESSimpleTimelineLayer * layer,
|
||||||
{
|
{
|
||||||
gint idx;
|
gint idx;
|
||||||
GESSimpleTimelineLayerPrivate *priv = layer->priv;
|
GESSimpleTimelineLayerPrivate *priv = layer->priv;
|
||||||
|
GESTimelineLayer *tl_obj_layer;
|
||||||
|
|
||||||
GST_DEBUG ("layer:%p, object:%p, newposition:%d", layer, object, newposition);
|
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");
|
GST_WARNING ("TimelineObject doesn't belong to this layer");
|
||||||
|
if (tl_obj_layer != NULL)
|
||||||
|
g_object_unref (tl_obj_layer);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
if (tl_obj_layer != NULL)
|
||||||
|
g_object_unref (tl_obj_layer);
|
||||||
|
|
||||||
/* Find it's current position */
|
/* Find it's current position */
|
||||||
idx = g_list_index (priv->objects, object);
|
idx = g_list_index (priv->objects, object);
|
||||||
|
|
|
@ -204,7 +204,7 @@ ges_tl_filesource_init (GESTimelineFileSource * self)
|
||||||
static void
|
static void
|
||||||
ges_tl_filesource_set_mute (GESTimelineFileSource * self, gboolean mute)
|
ges_tl_filesource_set_mute (GESTimelineFileSource * self, gboolean mute)
|
||||||
{
|
{
|
||||||
GList *tmp;
|
GList *tmp, *trackobjects;
|
||||||
GESTimelineObject *object = (GESTimelineObject *) self;
|
GESTimelineObject *object = (GESTimelineObject *) self;
|
||||||
|
|
||||||
GST_DEBUG ("self:%p, mute:%d", self, mute);
|
GST_DEBUG ("self:%p, mute:%d", self, mute);
|
||||||
|
@ -212,12 +212,16 @@ ges_tl_filesource_set_mute (GESTimelineFileSource * self, gboolean mute)
|
||||||
self->mute = mute;
|
self->mute = mute;
|
||||||
|
|
||||||
/* Go over tracked objects, and update 'active' status on all audio objects */
|
/* 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;
|
GESTrackObject *trackobject = (GESTrackObject *) tmp->data;
|
||||||
|
|
||||||
if (trackobject->track->type == GES_TRACK_TYPE_AUDIO)
|
if (trackobject->track->type == GES_TRACK_TYPE_AUDIO)
|
||||||
ges_track_object_set_active (trackobject, !mute);
|
ges_track_object_set_active (trackobject, !mute);
|
||||||
|
|
||||||
|
g_object_unref (GES_TRACK_OBJECT (tmp->data));
|
||||||
}
|
}
|
||||||
|
g_list_free (trackobjects);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
|
@ -228,10 +228,14 @@ gboolean
|
||||||
ges_timeline_layer_add_object (GESTimelineLayer * layer,
|
ges_timeline_layer_add_object (GESTimelineLayer * layer,
|
||||||
GESTimelineObject * object)
|
GESTimelineObject * object)
|
||||||
{
|
{
|
||||||
|
GESTimelineLayer *tl_obj_layer;
|
||||||
|
|
||||||
GST_DEBUG ("layer:%p, object:%p", layer, object);
|
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");
|
GST_WARNING ("TimelineObject %p already belongs to another layer");
|
||||||
|
g_object_unref (tl_obj_layer);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -278,12 +282,17 @@ gboolean
|
||||||
ges_timeline_layer_remove_object (GESTimelineLayer * layer,
|
ges_timeline_layer_remove_object (GESTimelineLayer * layer,
|
||||||
GESTimelineObject * object)
|
GESTimelineObject * object)
|
||||||
{
|
{
|
||||||
|
GESTimelineLayer *tl_obj_layer;
|
||||||
GST_DEBUG ("layer:%p, object:%p", layer, object);
|
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");
|
GST_WARNING ("TimelineObject doesn't belong to this layer");
|
||||||
|
if (tl_obj_layer != NULL)
|
||||||
|
g_object_unref (tl_obj_layer);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
g_object_unref (tl_obj_layer);
|
||||||
|
|
||||||
/* emit 'object-removed' */
|
/* emit 'object-removed' */
|
||||||
g_signal_emit (layer, ges_timeline_layer_signals[OBJECT_REMOVED], 0, object);
|
g_signal_emit (layer, ges_timeline_layer_signals[OBJECT_REMOVED], 0, object);
|
||||||
|
|
|
@ -45,6 +45,17 @@ track_object_priority_offset_changed_cb (GESTrackObject * child,
|
||||||
|
|
||||||
G_DEFINE_TYPE (GESTimelineObject, ges_timeline_object, G_TYPE_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
|
enum
|
||||||
{
|
{
|
||||||
PROP_0,
|
PROP_0,
|
||||||
|
@ -53,6 +64,7 @@ enum
|
||||||
PROP_DURATION,
|
PROP_DURATION,
|
||||||
PROP_PRIORITY,
|
PROP_PRIORITY,
|
||||||
PROP_HEIGHT,
|
PROP_HEIGHT,
|
||||||
|
PROP_LAYER,
|
||||||
};
|
};
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -77,6 +89,9 @@ ges_timeline_object_get_property (GObject * object, guint property_id,
|
||||||
case PROP_HEIGHT:
|
case PROP_HEIGHT:
|
||||||
g_value_set_uint (value, tobj->height);
|
g_value_set_uint (value, tobj->height);
|
||||||
break;
|
break;
|
||||||
|
case PROP_LAYER:
|
||||||
|
g_value_set_object (value, tobj->priv->layer);
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
|
||||||
}
|
}
|
||||||
|
@ -123,6 +138,8 @@ ges_timeline_object_class_init (GESTimelineObjectClass * klass)
|
||||||
{
|
{
|
||||||
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
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->get_property = ges_timeline_object_get_property;
|
||||||
object_class->set_property = ges_timeline_object_set_property;
|
object_class->set_property = ges_timeline_object_set_property;
|
||||||
object_class->dispose = ges_timeline_object_dispose;
|
object_class->dispose = ges_timeline_object_dispose;
|
||||||
|
@ -164,7 +181,7 @@ ges_timeline_object_class_init (GESTimelineObjectClass * klass)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* GESTimelineObject:priority
|
* GESTimelineObject:priority
|
||||||
*
|
*
|
||||||
* The layer priority of the timeline object.
|
* The layer priority of the timeline object.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -183,14 +200,28 @@ ges_timeline_object_class_init (GESTimelineObjectClass * klass)
|
||||||
"The span of priorities this object occupies", 0, G_MAXUINT, 1,
|
"The span of priorities this object occupies", 0, G_MAXUINT, 1,
|
||||||
G_PARAM_READABLE));
|
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;
|
klass->need_fill_track = TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
ges_timeline_object_init (GESTimelineObject * self)
|
ges_timeline_object_init (GESTimelineObject * self)
|
||||||
{
|
{
|
||||||
|
self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self,
|
||||||
|
GES_TYPE_TIMELINE_OBJECT, GESTimelineObjectPrivate);
|
||||||
self->duration = GST_SECOND;
|
self->duration = GST_SECOND;
|
||||||
self->height = 1;
|
self->height = 1;
|
||||||
|
self->priv->trackobjects = NULL;
|
||||||
|
self->priv->layer = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -274,7 +305,7 @@ ges_timeline_object_create_track_objects_func (GESTimelineObject * object,
|
||||||
* ges_timeline_object_add_track_object:
|
* ges_timeline_object_add_track_object:
|
||||||
* @object: a #GESTimelineObject
|
* @object: a #GESTimelineObject
|
||||||
* @trobj: the GESTrackObject
|
* @trobj: the GESTrackObject
|
||||||
*
|
*
|
||||||
* Add a track object to the timeline object. Should only be called by
|
* Add a track object to the timeline object. Should only be called by
|
||||||
* subclasses implementing the create_track_objects (plural) vmethod.
|
* subclasses implementing the create_track_objects (plural) vmethod.
|
||||||
*
|
*
|
||||||
|
@ -295,7 +326,8 @@ ges_timeline_object_add_track_object (GESTimelineObject * object, GESTrackObject
|
||||||
|
|
||||||
GST_DEBUG ("Adding TrackObject to the list of controlled track objects");
|
GST_DEBUG ("Adding TrackObject to the list of controlled track objects");
|
||||||
/* We steal the initial reference */
|
/* 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 ("Setting properties on newly created TrackObject");
|
||||||
|
|
||||||
|
@ -323,14 +355,15 @@ ges_timeline_object_release_track_object (GESTimelineObject * object,
|
||||||
{
|
{
|
||||||
GST_DEBUG ("object:%p, trackobject:%p", object, trobj);
|
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");
|
GST_WARNING ("TrackObject isn't controlled by this object");
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* FIXME : Do we need to tell the subclasses ? If so, add a new virtual-method */
|
/* 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);
|
ges_track_object_set_timeline_object (trobj, NULL);
|
||||||
|
|
||||||
|
@ -345,7 +378,7 @@ ges_timeline_object_set_layer (GESTimelineObject * object,
|
||||||
{
|
{
|
||||||
GST_DEBUG ("object:%p, layer:%p", object, layer);
|
GST_DEBUG ("object:%p, layer:%p", object, layer);
|
||||||
|
|
||||||
object->layer = layer;
|
object->priv->layer = layer;
|
||||||
}
|
}
|
||||||
|
|
||||||
gboolean
|
gboolean
|
||||||
|
@ -389,10 +422,10 @@ ges_timeline_object_set_start (GESTimelineObject * object, guint64 start)
|
||||||
GST_DEBUG ("object:%p, start:%" GST_TIME_FORMAT,
|
GST_DEBUG ("object:%p, start:%" GST_TIME_FORMAT,
|
||||||
object, GST_TIME_ARGS (start));
|
object, GST_TIME_ARGS (start));
|
||||||
|
|
||||||
if (G_LIKELY (object->trackobjects)) {
|
if (G_LIKELY (object->priv->trackobjects)) {
|
||||||
GList *tmp;
|
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 */
|
/* call set_start_internal on each trackobject */
|
||||||
ges_track_object_set_start_internal (GES_TRACK_OBJECT (tmp->data), start);
|
ges_track_object_set_start_internal (GES_TRACK_OBJECT (tmp->data), start);
|
||||||
|
|
||||||
|
@ -408,10 +441,10 @@ ges_timeline_object_set_inpoint (GESTimelineObject * object, guint64 inpoint)
|
||||||
GST_DEBUG ("object:%p, inpoint:%" GST_TIME_FORMAT,
|
GST_DEBUG ("object:%p, inpoint:%" GST_TIME_FORMAT,
|
||||||
object, GST_TIME_ARGS (inpoint));
|
object, GST_TIME_ARGS (inpoint));
|
||||||
|
|
||||||
if (G_LIKELY (object->trackobjects)) {
|
if (G_LIKELY (object->priv->trackobjects)) {
|
||||||
GList *tmp;
|
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 */
|
/* call set_inpoint_internal on each trackobject */
|
||||||
ges_track_object_set_inpoint_internal (GES_TRACK_OBJECT (tmp->data),
|
ges_track_object_set_inpoint_internal (GES_TRACK_OBJECT (tmp->data),
|
||||||
inpoint);
|
inpoint);
|
||||||
|
@ -429,10 +462,10 @@ ges_timeline_object_set_duration (GESTimelineObject * object, guint64 duration)
|
||||||
GST_DEBUG ("object:%p, duration:%" GST_TIME_FORMAT,
|
GST_DEBUG ("object:%p, duration:%" GST_TIME_FORMAT,
|
||||||
object, GST_TIME_ARGS (duration));
|
object, GST_TIME_ARGS (duration));
|
||||||
|
|
||||||
if (G_LIKELY (object->trackobjects)) {
|
if (G_LIKELY (object->priv->trackobjects)) {
|
||||||
GList *tmp;
|
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 */
|
/* call set_duration_internal on each trackobject */
|
||||||
ges_track_object_set_duration_internal (GES_TRACK_OBJECT (tmp->data),
|
ges_track_object_set_duration_internal (GES_TRACK_OBJECT (tmp->data),
|
||||||
duration);
|
duration);
|
||||||
|
@ -449,10 +482,10 @@ ges_timeline_object_set_priority (GESTimelineObject * object, guint priority)
|
||||||
{
|
{
|
||||||
GST_DEBUG ("object:%p, priority:%d", object, priority);
|
GST_DEBUG ("object:%p, priority:%d", object, priority);
|
||||||
|
|
||||||
if (G_LIKELY (object->trackobjects)) {
|
if (G_LIKELY (object->priv->trackobjects)) {
|
||||||
GList *tmp;
|
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 */
|
/* call set_priority_internal on each trackobject */
|
||||||
ges_track_object_set_priority_internal (GES_TRACK_OBJECT (tmp->data),
|
ges_track_object_set_priority_internal (GES_TRACK_OBJECT (tmp->data),
|
||||||
priority);
|
priority);
|
||||||
|
@ -485,10 +518,10 @@ ges_timeline_object_find_track_object (GESTimelineObject * object,
|
||||||
{
|
{
|
||||||
GESTrackObject *ret = NULL;
|
GESTrackObject *ret = NULL;
|
||||||
|
|
||||||
if (G_LIKELY (object->trackobjects)) {
|
if (G_LIKELY (object->priv->trackobjects)) {
|
||||||
GList *tmp;
|
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 (GES_TRACK_OBJECT (tmp->data)->track == track) {
|
||||||
if ((type != G_TYPE_NONE) && !G_TYPE_CHECK_INSTANCE_TYPE (tmp->data,
|
if ((type != G_TYPE_NONE) && !G_TYPE_CHECK_INSTANCE_TYPE (tmp->data,
|
||||||
type))
|
type))
|
||||||
|
@ -503,6 +536,52 @@ ges_timeline_object_find_track_object (GESTimelineObject * object,
|
||||||
return ret;
|
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
|
static void
|
||||||
track_object_priority_offset_changed_cb (GESTrackObject * child,
|
track_object_priority_offset_changed_cb (GESTrackObject * child,
|
||||||
GParamSpec * arg G_GNUC_UNUSED, GESTimelineObject * obj)
|
GParamSpec * arg G_GNUC_UNUSED, GESTimelineObject * obj)
|
||||||
|
|
|
@ -44,6 +44,8 @@ G_BEGIN_DECLS
|
||||||
#define GES_TIMELINE_OBJECT_GET_CLASS(obj) \
|
#define GES_TIMELINE_OBJECT_GET_CLASS(obj) \
|
||||||
(G_TYPE_INSTANCE_GET_CLASS ((obj), GES_TYPE_TIMELINE_OBJECT, GESTimelineObjectClass))
|
(G_TYPE_INSTANCE_GET_CLASS ((obj), GES_TYPE_TIMELINE_OBJECT, GESTimelineObjectClass))
|
||||||
|
|
||||||
|
typedef struct _GESTimelineObjectPrivate GESTimelineObjectPrivate;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* FillTrackObjectFunc:
|
* FillTrackObjectFunc:
|
||||||
* @object: the #GESTimelineObject controlling the track object
|
* @object: the #GESTimelineObject controlling the track object
|
||||||
|
@ -59,8 +61,8 @@ G_BEGIN_DECLS
|
||||||
* Returns: TRUE if the implementer succesfully filled the @gnlobj, else #FALSE.
|
* Returns: TRUE if the implementer succesfully filled the @gnlobj, else #FALSE.
|
||||||
*/
|
*/
|
||||||
typedef gboolean (*FillTrackObjectFunc) (GESTimelineObject * object,
|
typedef gboolean (*FillTrackObjectFunc) (GESTimelineObject * object,
|
||||||
GESTrackObject * trobject,
|
GESTrackObject * trobject,
|
||||||
GstElement * gnlobj);
|
GstElement * gnlobj);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* CreateTrackObjectFunc:
|
* CreateTrackObjectFunc:
|
||||||
|
@ -68,7 +70,7 @@ typedef gboolean (*FillTrackObjectFunc) (GESTimelineObject * object,
|
||||||
* @track: a #GESTrack
|
* @track: a #GESTrack
|
||||||
*
|
*
|
||||||
* Creates the 'primary track object for this @object.
|
* Creates the 'primary track object for this @object.
|
||||||
*
|
*
|
||||||
* Implementors should override this function if they only interested in
|
* Implementors should override this function if they only interested in
|
||||||
* creating a single custom track object per track.
|
* creating a single custom track object per track.
|
||||||
*
|
*
|
||||||
|
@ -81,13 +83,13 @@ typedef gboolean (*FillTrackObjectFunc) (GESTimelineObject * object,
|
||||||
* Returns: the #GESTrackObject to be used, or %NULL.
|
* Returns: the #GESTrackObject to be used, or %NULL.
|
||||||
*/
|
*/
|
||||||
typedef GESTrackObject* (*CreateTrackObjectFunc) (GESTimelineObject * object,
|
typedef GESTrackObject* (*CreateTrackObjectFunc) (GESTimelineObject * object,
|
||||||
GESTrack * track);
|
GESTrack * track);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* CreateTrackObjectsFunc:
|
* CreateTrackObjectsFunc:
|
||||||
* @object: a #GESTimelineObject
|
* @object: a #GESTimelineObject
|
||||||
* @track: a #GESTrack
|
* @track: a #GESTrack
|
||||||
*
|
*
|
||||||
* Create all track objects this object handles for this type of track.
|
* Create all track objects this object handles for this type of track.
|
||||||
*
|
*
|
||||||
* Returns: %TRUE on success %FALSE on failure.
|
* Returns: %TRUE on success %FALSE on failure.
|
||||||
|
@ -144,17 +146,17 @@ typedef gboolean (*CreateTrackObjectsFunc) (GESTimelineObject * object,
|
||||||
struct _GESTimelineObject {
|
struct _GESTimelineObject {
|
||||||
GObject parent;
|
GObject parent;
|
||||||
|
|
||||||
/*< public >*/
|
|
||||||
GESTimelineLayer * layer;
|
|
||||||
|
|
||||||
/*< private >*/
|
/*< private >*/
|
||||||
GList *trackobjects; /* A list of TrackObject controlled by this TimelineObject */
|
|
||||||
|
|
||||||
/* start, inpoint, duration and fullduration are in nanoseconds */
|
GESTimelineObjectPrivate *priv;
|
||||||
guint64 start; /* position (in time) of the object in the layer */
|
|
||||||
guint64 inpoint; /* in-point */
|
/* We don't add those properties to the priv struct for optimization purposes
|
||||||
guint64 duration; /* duration of the object used in the layer */
|
* start, inpoint, duration and fullduration are in nanoseconds */
|
||||||
guint32 priority; /* priority of the object in the layer (0:top priority) */
|
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 */
|
guint32 height; /* the span of priorities this object needs */
|
||||||
|
|
||||||
guint64 fullduration; /* Full usable duration of the object (-1: no duration) */
|
guint64 fullduration; /* Full usable duration of the object (-1: no duration) */
|
||||||
|
@ -182,7 +184,7 @@ struct _GESTimelineObjectClass {
|
||||||
CreateTrackObjectsFunc create_track_objects;
|
CreateTrackObjectsFunc create_track_objects;
|
||||||
|
|
||||||
/* FIXME : might need a release_track_object */
|
/* FIXME : might need a release_track_object */
|
||||||
FillTrackObjectFunc fill_track_object;
|
FillTrackObjectFunc fill_track_object;
|
||||||
gboolean need_fill_track;
|
gboolean need_fill_track;
|
||||||
|
|
||||||
/*< private >*/
|
/*< private >*/
|
||||||
|
@ -198,28 +200,33 @@ void ges_timeline_object_set_duration (GESTimelineObject * object, guint64 durat
|
||||||
void ges_timeline_object_set_priority (GESTimelineObject * object, guint priority);
|
void ges_timeline_object_set_priority (GESTimelineObject * object, guint priority);
|
||||||
|
|
||||||
void ges_timeline_object_set_layer (GESTimelineObject * object,
|
void ges_timeline_object_set_layer (GESTimelineObject * object,
|
||||||
GESTimelineLayer * layer);
|
GESTimelineLayer * layer);
|
||||||
|
|
||||||
GESTrackObject *
|
GESTrackObject *
|
||||||
ges_timeline_object_create_track_object (GESTimelineObject * object,
|
ges_timeline_object_create_track_object (GESTimelineObject * object,
|
||||||
GESTrack * track);
|
GESTrack * track);
|
||||||
|
|
||||||
gboolean ges_timeline_object_create_track_objects (GESTimelineObject *
|
gboolean ges_timeline_object_create_track_objects (GESTimelineObject *
|
||||||
object, GESTrack * track);
|
object, GESTrack * track);
|
||||||
|
|
||||||
gboolean
|
gboolean
|
||||||
ges_timeline_object_release_track_object (GESTimelineObject * object,
|
ges_timeline_object_release_track_object (GESTimelineObject * object,
|
||||||
GESTrackObject * trackobject);
|
GESTrackObject * trackobject);
|
||||||
|
|
||||||
gboolean
|
gboolean
|
||||||
ges_timeline_object_fill_track_object (GESTimelineObject * object,
|
ges_timeline_object_fill_track_object (GESTimelineObject * object,
|
||||||
GESTrackObject * trackobj,
|
GESTrackObject * trackobj,
|
||||||
GstElement * gnlobj);
|
GstElement * gnlobj);
|
||||||
|
|
||||||
GESTrackObject *
|
GESTrackObject *
|
||||||
ges_timeline_object_find_track_object (GESTimelineObject * object,
|
ges_timeline_object_find_track_object (GESTimelineObject * object,
|
||||||
GESTrack * track,
|
GESTrack * track, GType type);
|
||||||
GType type);
|
|
||||||
|
GList *
|
||||||
|
ges_timeline_object_get_track_objects (GESTimelineObject *object);
|
||||||
|
|
||||||
|
GESTimelineLayer *
|
||||||
|
ges_timeline_object_get_layer (GESTimelineObject *object);
|
||||||
|
|
||||||
gboolean
|
gboolean
|
||||||
ges_timeline_object_add_track_object (GESTimelineObject *object, GESTrackObject
|
ges_timeline_object_add_track_object (GESTimelineObject *object, GESTrackObject
|
||||||
|
|
|
@ -287,7 +287,7 @@ ges_timeline_source_create_track_objects (GESTimelineObject * obj,
|
||||||
static void
|
static void
|
||||||
ges_timeline_source_set_text (GESTimelineSource * self, const gchar * text)
|
ges_timeline_source_set_text (GESTimelineSource * self, const gchar * text)
|
||||||
{
|
{
|
||||||
GList *tmp;
|
GList *tmp, *trackobjects;
|
||||||
GESTimelineObject *object = (GESTimelineObject *) self;
|
GESTimelineObject *object = (GESTimelineObject *) self;
|
||||||
|
|
||||||
GST_DEBUG ("self:%p, text:%s", self, text);
|
GST_DEBUG ("self:%p, text:%s", self, text);
|
||||||
|
@ -297,7 +297,8 @@ ges_timeline_source_set_text (GESTimelineSource * self, const gchar * text)
|
||||||
|
|
||||||
self->text = g_strdup (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;
|
GESTrackObject *trackobject = (GESTrackObject *) tmp->data;
|
||||||
|
|
||||||
if (GES_IS_TRACK_TEXT_OVERLAY (trackobject)) {
|
if (GES_IS_TRACK_TEXT_OVERLAY (trackobject)) {
|
||||||
|
@ -306,14 +307,17 @@ ges_timeline_source_set_text (GESTimelineSource * self, const gchar * text)
|
||||||
ges_track_object_set_active (trackobject, (text && (*text)) ? TRUE :
|
ges_track_object_set_active (trackobject, (text && (*text)) ? TRUE :
|
||||||
FALSE);
|
FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
g_object_unref (GES_TRACK_OBJECT (tmp->data));
|
||||||
}
|
}
|
||||||
|
g_list_free (trackobjects);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
ges_timeline_source_set_font_desc (GESTimelineSource * self, const gchar *
|
ges_timeline_source_set_font_desc (GESTimelineSource * self, const gchar *
|
||||||
font_desc)
|
font_desc)
|
||||||
{
|
{
|
||||||
GList *tmp;
|
GList *tmp, *trackobjects;
|
||||||
GESTimelineObject *object = (GESTimelineObject *) self;
|
GESTimelineObject *object = (GESTimelineObject *) self;
|
||||||
|
|
||||||
GST_DEBUG ("self:%p, font_desc:%s", self, font_desc);
|
GST_DEBUG ("self:%p, font_desc:%s", self, font_desc);
|
||||||
|
@ -323,52 +327,64 @@ ges_timeline_source_set_font_desc (GESTimelineSource * self, const gchar *
|
||||||
|
|
||||||
self->font_desc = g_strdup (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;
|
GESTrackObject *trackobject = (GESTrackObject *) tmp->data;
|
||||||
|
|
||||||
if (GES_IS_TRACK_TEXT_OVERLAY (trackobject))
|
if (GES_IS_TRACK_TEXT_OVERLAY (trackobject))
|
||||||
ges_track_text_overlay_set_font_desc ((GESTrackTextOverlay *)
|
ges_track_text_overlay_set_font_desc ((GESTrackTextOverlay *)
|
||||||
(trackobject), self->font_desc);
|
(trackobject), self->font_desc);
|
||||||
|
|
||||||
|
g_object_unref (GES_TRACK_OBJECT (tmp->data));
|
||||||
}
|
}
|
||||||
|
g_list_free (trackobjects);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
ges_timeline_source_set_halign (GESTimelineSource * self, GESTextHAlign halign)
|
ges_timeline_source_set_halign (GESTimelineSource * self, GESTextHAlign halign)
|
||||||
{
|
{
|
||||||
GList *tmp;
|
GList *tmp, *trackobjects;
|
||||||
GESTimelineObject *object = (GESTimelineObject *) self;
|
GESTimelineObject *object = (GESTimelineObject *) self;
|
||||||
|
|
||||||
GST_DEBUG ("self:%p, halign:%d", self, halign);
|
GST_DEBUG ("self:%p, halign:%d", self, halign);
|
||||||
|
|
||||||
self->halign = 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;
|
GESTrackObject *trackobject = (GESTrackObject *) tmp->data;
|
||||||
|
|
||||||
if (GES_IS_TRACK_TEXT_OVERLAY (trackobject))
|
if (GES_IS_TRACK_TEXT_OVERLAY (trackobject))
|
||||||
ges_track_text_overlay_set_halignment ((GESTrackTextOverlay *)
|
ges_track_text_overlay_set_halignment ((GESTrackTextOverlay *)
|
||||||
(trackobject), self->halign);
|
(trackobject), self->halign);
|
||||||
|
|
||||||
|
g_object_unref (GES_TRACK_OBJECT (tmp->data));
|
||||||
}
|
}
|
||||||
|
g_list_free (trackobjects);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
ges_timeline_source_set_valign (GESTimelineSource * self, GESTextVAlign valign)
|
ges_timeline_source_set_valign (GESTimelineSource * self, GESTextVAlign valign)
|
||||||
{
|
{
|
||||||
GList *tmp;
|
GList *tmp, *trackobjects;
|
||||||
GESTimelineObject *object = (GESTimelineObject *) self;
|
GESTimelineObject *object = (GESTimelineObject *) self;
|
||||||
|
|
||||||
GST_DEBUG ("self:%p, valign:%d", self, valign);
|
GST_DEBUG ("self:%p, valign:%d", self, valign);
|
||||||
|
|
||||||
self->valign = 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;
|
GESTrackObject *trackobject = (GESTrackObject *) tmp->data;
|
||||||
|
|
||||||
if (GES_IS_TRACK_TEXT_OVERLAY (trackobject))
|
if (GES_IS_TRACK_TEXT_OVERLAY (trackobject))
|
||||||
ges_track_text_overlay_set_valignment ((GESTrackTextOverlay *)
|
ges_track_text_overlay_set_valignment ((GESTrackTextOverlay *)
|
||||||
(trackobject), self->valign);
|
(trackobject), self->valign);
|
||||||
|
|
||||||
|
g_object_unref (GES_TRACK_OBJECT (tmp->data));
|
||||||
}
|
}
|
||||||
|
g_list_free (trackobjects);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -204,7 +204,7 @@ ges_timeline_test_source_init (GESTimelineTestSource * self)
|
||||||
static void
|
static void
|
||||||
ges_timeline_test_source_set_mute (GESTimelineTestSource * self, gboolean mute)
|
ges_timeline_test_source_set_mute (GESTimelineTestSource * self, gboolean mute)
|
||||||
{
|
{
|
||||||
GList *tmp;
|
GList *tmp, *trackobjects;
|
||||||
GESTimelineObject *object = (GESTimelineObject *) self;
|
GESTimelineObject *object = (GESTimelineObject *) self;
|
||||||
|
|
||||||
GST_DEBUG ("self:%p, mute:%d", self, mute);
|
GST_DEBUG ("self:%p, mute:%d", self, mute);
|
||||||
|
@ -212,62 +212,78 @@ ges_timeline_test_source_set_mute (GESTimelineTestSource * self, gboolean mute)
|
||||||
self->mute = mute;
|
self->mute = mute;
|
||||||
|
|
||||||
/* Go over tracked objects, and update 'active' status on all audio objects */
|
/* 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;
|
GESTrackObject *trackobject = (GESTrackObject *) tmp->data;
|
||||||
|
|
||||||
if (trackobject->track->type == GES_TRACK_TYPE_AUDIO)
|
if (trackobject->track->type == GES_TRACK_TYPE_AUDIO)
|
||||||
ges_track_object_set_active (trackobject, !mute);
|
ges_track_object_set_active (trackobject, !mute);
|
||||||
|
|
||||||
|
g_object_unref (GES_TRACK_OBJECT (tmp->data));
|
||||||
}
|
}
|
||||||
|
g_list_free (trackobjects);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
ges_timeline_test_source_set_vpattern (GESTimelineTestSource * self,
|
ges_timeline_test_source_set_vpattern (GESTimelineTestSource * self,
|
||||||
GESVideoTestPattern vpattern)
|
GESVideoTestPattern vpattern)
|
||||||
{
|
{
|
||||||
GList *tmp;
|
GList *tmp, *trackobjects;
|
||||||
GESTimelineObject *object = (GESTimelineObject *) self;
|
GESTimelineObject *object = (GESTimelineObject *) self;
|
||||||
|
|
||||||
self->vpattern = vpattern;
|
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;
|
GESTrackObject *trackobject = (GESTrackObject *) tmp->data;
|
||||||
if (GES_IS_TRACK_VIDEO_TEST_SOURCE (trackobject))
|
if (GES_IS_TRACK_VIDEO_TEST_SOURCE (trackobject))
|
||||||
ges_track_video_test_source_set_pattern (
|
ges_track_video_test_source_set_pattern (
|
||||||
(GESTrackVideoTestSource *) trackobject, vpattern);
|
(GESTrackVideoTestSource *) trackobject, vpattern);
|
||||||
|
|
||||||
|
g_object_unref (GES_TRACK_OBJECT (tmp->data));
|
||||||
}
|
}
|
||||||
|
g_list_free (trackobjects);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
ges_timeline_test_source_set_freq (GESTimelineTestSource * self, gdouble freq)
|
ges_timeline_test_source_set_freq (GESTimelineTestSource * self, gdouble freq)
|
||||||
{
|
{
|
||||||
GList *tmp;
|
GList *tmp, *trackobjects;
|
||||||
GESTimelineObject *object = (GESTimelineObject *) self;
|
GESTimelineObject *object = (GESTimelineObject *) self;
|
||||||
|
|
||||||
self->freq = freq;
|
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;
|
GESTrackObject *trackobject = (GESTrackObject *) tmp->data;
|
||||||
if (GES_IS_TRACK_AUDIO_TEST_SOURCE (trackobject))
|
if (GES_IS_TRACK_AUDIO_TEST_SOURCE (trackobject))
|
||||||
ges_track_audio_test_source_set_freq (
|
ges_track_audio_test_source_set_freq (
|
||||||
(GESTrackAudioTestSource *) trackobject, freq);
|
(GESTrackAudioTestSource *) trackobject, freq);
|
||||||
|
|
||||||
|
g_object_unref (GES_TRACK_OBJECT (tmp->data));
|
||||||
}
|
}
|
||||||
|
g_list_free (trackobjects);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
ges_timeline_test_source_set_volume (GESTimelineTestSource * self,
|
ges_timeline_test_source_set_volume (GESTimelineTestSource * self,
|
||||||
gdouble volume)
|
gdouble volume)
|
||||||
{
|
{
|
||||||
GList *tmp;
|
GList *tmp, *trackobjects;
|
||||||
GESTimelineObject *object = (GESTimelineObject *) self;
|
GESTimelineObject *object = (GESTimelineObject *) self;
|
||||||
|
|
||||||
self->volume = volume;
|
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;
|
GESTrackObject *trackobject = (GESTrackObject *) tmp->data;
|
||||||
if (GES_IS_TRACK_AUDIO_TEST_SOURCE (trackobject))
|
if (GES_IS_TRACK_AUDIO_TEST_SOURCE (trackobject))
|
||||||
ges_track_audio_test_source_set_volume (
|
ges_track_audio_test_source_set_volume (
|
||||||
(GESTrackAudioTestSource *) trackobject, volume);
|
(GESTrackAudioTestSource *) trackobject, volume);
|
||||||
|
|
||||||
|
g_object_unref (GES_TRACK_OBJECT (tmp->data));
|
||||||
}
|
}
|
||||||
|
g_list_free (trackobjects);
|
||||||
}
|
}
|
||||||
|
|
||||||
static GESTrackObject *
|
static GESTrackObject *
|
||||||
|
|
|
@ -221,7 +221,7 @@ ges_tl_text_overlay_init (GESTimelineTextOverlay * self)
|
||||||
static void
|
static void
|
||||||
ges_tl_text_overlay_set_text (GESTimelineTextOverlay * self, const gchar * text)
|
ges_tl_text_overlay_set_text (GESTimelineTextOverlay * self, const gchar * text)
|
||||||
{
|
{
|
||||||
GList *tmp;
|
GList *tmp, *trackobjects;
|
||||||
GESTimelineObject *object = (GESTimelineObject *) self;
|
GESTimelineObject *object = (GESTimelineObject *) self;
|
||||||
|
|
||||||
GST_DEBUG ("self:%p, text:%s", self, text);
|
GST_DEBUG ("self:%p, text:%s", self, text);
|
||||||
|
@ -231,20 +231,24 @@ ges_tl_text_overlay_set_text (GESTimelineTextOverlay * self, const gchar * text)
|
||||||
|
|
||||||
self->text = g_strdup (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;
|
GESTrackObject *trackobject = (GESTrackObject *) tmp->data;
|
||||||
|
|
||||||
if (trackobject->track->type == GES_TRACK_TYPE_VIDEO)
|
if (trackobject->track->type == GES_TRACK_TYPE_VIDEO)
|
||||||
ges_track_text_overlay_set_text (GES_TRACK_TEXT_OVERLAY
|
ges_track_text_overlay_set_text (GES_TRACK_TEXT_OVERLAY
|
||||||
(trackobject), self->text);
|
(trackobject), self->text);
|
||||||
|
|
||||||
|
g_object_unref (GES_TRACK_OBJECT (tmp->data));
|
||||||
}
|
}
|
||||||
|
g_list_free (trackobjects);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
ges_tl_text_overlay_set_font_desc (GESTimelineTextOverlay * self, const gchar *
|
ges_tl_text_overlay_set_font_desc (GESTimelineTextOverlay * self, const gchar *
|
||||||
font_desc)
|
font_desc)
|
||||||
{
|
{
|
||||||
GList *tmp;
|
GList *tmp, *trackobjects;
|
||||||
GESTimelineObject *object = (GESTimelineObject *) self;
|
GESTimelineObject *object = (GESTimelineObject *) self;
|
||||||
|
|
||||||
GST_DEBUG ("self:%p, font_desc:%s", self, font_desc);
|
GST_DEBUG ("self:%p, font_desc:%s", self, font_desc);
|
||||||
|
@ -254,13 +258,17 @@ ges_tl_text_overlay_set_font_desc (GESTimelineTextOverlay * self, const gchar *
|
||||||
|
|
||||||
self->font_desc = g_strdup (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;
|
GESTrackObject *trackobject = (GESTrackObject *) tmp->data;
|
||||||
|
|
||||||
if (trackobject->track->type == GES_TRACK_TYPE_VIDEO)
|
if (trackobject->track->type == GES_TRACK_TYPE_VIDEO)
|
||||||
ges_track_text_overlay_set_font_desc (GES_TRACK_TEXT_OVERLAY
|
ges_track_text_overlay_set_font_desc (GES_TRACK_TEXT_OVERLAY
|
||||||
(trackobject), self->font_desc);
|
(trackobject), self->font_desc);
|
||||||
|
|
||||||
|
g_object_unref (GES_TRACK_OBJECT (tmp->data));
|
||||||
}
|
}
|
||||||
|
g_list_free (trackobjects);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -268,20 +276,24 @@ static void
|
||||||
ges_tl_text_overlay_set_halign (GESTimelineTextOverlay * self,
|
ges_tl_text_overlay_set_halign (GESTimelineTextOverlay * self,
|
||||||
GESTextHAlign halign)
|
GESTextHAlign halign)
|
||||||
{
|
{
|
||||||
GList *tmp;
|
GList *tmp, *trackobjects;
|
||||||
GESTimelineObject *object = (GESTimelineObject *) self;
|
GESTimelineObject *object = (GESTimelineObject *) self;
|
||||||
|
|
||||||
GST_DEBUG ("self:%p, halign:%d", self, halign);
|
GST_DEBUG ("self:%p, halign:%d", self, halign);
|
||||||
|
|
||||||
self->halign = 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;
|
GESTrackObject *trackobject = (GESTrackObject *) tmp->data;
|
||||||
|
|
||||||
if (trackobject->track->type == GES_TRACK_TYPE_VIDEO)
|
if (trackobject->track->type == GES_TRACK_TYPE_VIDEO)
|
||||||
ges_track_text_overlay_set_halignment (GES_TRACK_TEXT_OVERLAY
|
ges_track_text_overlay_set_halignment (GES_TRACK_TEXT_OVERLAY
|
||||||
(trackobject), self->halign);
|
(trackobject), self->halign);
|
||||||
|
|
||||||
|
g_object_unref (GES_TRACK_OBJECT (tmp->data));
|
||||||
}
|
}
|
||||||
|
g_list_free (trackobjects);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -289,20 +301,24 @@ static void
|
||||||
ges_tl_text_overlay_set_valign (GESTimelineTextOverlay * self,
|
ges_tl_text_overlay_set_valign (GESTimelineTextOverlay * self,
|
||||||
GESTextVAlign valign)
|
GESTextVAlign valign)
|
||||||
{
|
{
|
||||||
GList *tmp;
|
GList *tmp, *trackobjects;
|
||||||
GESTimelineObject *object = (GESTimelineObject *) self;
|
GESTimelineObject *object = (GESTimelineObject *) self;
|
||||||
|
|
||||||
GST_DEBUG ("self:%p, valign:%d", self, valign);
|
GST_DEBUG ("self:%p, valign:%d", self, valign);
|
||||||
|
|
||||||
self->valign = 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;
|
GESTrackObject *trackobject = (GESTrackObject *) tmp->data;
|
||||||
|
|
||||||
if (trackobject->track->type == GES_TRACK_TYPE_VIDEO)
|
if (trackobject->track->type == GES_TRACK_TYPE_VIDEO)
|
||||||
ges_track_text_overlay_set_valignment (GES_TRACK_TEXT_OVERLAY
|
ges_track_text_overlay_set_valignment (GES_TRACK_TEXT_OVERLAY
|
||||||
(trackobject), self->valign);
|
(trackobject), self->valign);
|
||||||
|
|
||||||
|
g_object_unref (GES_TRACK_OBJECT (tmp->data));
|
||||||
}
|
}
|
||||||
|
g_list_free (trackobjects);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -239,7 +239,7 @@ ges_tl_title_src_init (GESTimelineTitleSource * self)
|
||||||
static void
|
static void
|
||||||
ges_tl_title_src_set_text (GESTimelineTitleSource * self, const gchar * text)
|
ges_tl_title_src_set_text (GESTimelineTitleSource * self, const gchar * text)
|
||||||
{
|
{
|
||||||
GList *tmp;
|
GList *tmp, *trackobjects;
|
||||||
GESTimelineObject *object = (GESTimelineObject *) self;
|
GESTimelineObject *object = (GESTimelineObject *) self;
|
||||||
|
|
||||||
GST_DEBUG ("self:%p, text:%s", self, text);
|
GST_DEBUG ("self:%p, text:%s", self, text);
|
||||||
|
@ -249,20 +249,24 @@ ges_tl_title_src_set_text (GESTimelineTitleSource * self, const gchar * text)
|
||||||
|
|
||||||
self->text = g_strdup (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;
|
GESTrackObject *trackobject = (GESTrackObject *) tmp->data;
|
||||||
|
|
||||||
if (GES_IS_TRACK_TITLE_SOURCE (trackobject))
|
if (GES_IS_TRACK_TITLE_SOURCE (trackobject))
|
||||||
ges_track_title_source_set_text (GES_TRACK_TITLE_SOURCE
|
ges_track_title_source_set_text (GES_TRACK_TITLE_SOURCE
|
||||||
(trackobject), self->text);
|
(trackobject), self->text);
|
||||||
|
|
||||||
|
g_object_unref (GES_TRACK_OBJECT (tmp->data));
|
||||||
}
|
}
|
||||||
|
g_list_free (trackobjects);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
ges_tl_title_src_set_font_desc (GESTimelineTitleSource * self, const gchar *
|
ges_tl_title_src_set_font_desc (GESTimelineTitleSource * self, const gchar *
|
||||||
font_desc)
|
font_desc)
|
||||||
{
|
{
|
||||||
GList *tmp;
|
GList *tmp, *trackobjects;
|
||||||
GESTimelineObject *object = (GESTimelineObject *) self;
|
GESTimelineObject *object = (GESTimelineObject *) self;
|
||||||
|
|
||||||
GST_DEBUG ("self:%p, font_desc:%s", self, font_desc);
|
GST_DEBUG ("self:%p, font_desc:%s", self, font_desc);
|
||||||
|
@ -272,59 +276,70 @@ ges_tl_title_src_set_font_desc (GESTimelineTitleSource * self, const gchar *
|
||||||
|
|
||||||
self->font_desc = g_strdup (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;
|
GESTrackObject *trackobject = (GESTrackObject *) tmp->data;
|
||||||
|
|
||||||
if (GES_IS_TRACK_TITLE_SOURCE (trackobject))
|
if (GES_IS_TRACK_TITLE_SOURCE (trackobject))
|
||||||
ges_track_title_source_set_font_desc (GES_TRACK_TITLE_SOURCE
|
ges_track_title_source_set_font_desc (GES_TRACK_TITLE_SOURCE
|
||||||
(trackobject), self->font_desc);
|
(trackobject), self->font_desc);
|
||||||
|
|
||||||
|
g_object_unref (GES_TRACK_OBJECT (tmp->data));
|
||||||
}
|
}
|
||||||
|
g_list_free (trackobjects);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
ges_tl_title_src_set_halign (GESTimelineTitleSource * self,
|
ges_tl_title_src_set_halign (GESTimelineTitleSource * self,
|
||||||
GESTextHAlign halign)
|
GESTextHAlign halign)
|
||||||
{
|
{
|
||||||
GList *tmp;
|
GList *tmp, *trackobjects;
|
||||||
GESTimelineObject *object = (GESTimelineObject *) self;
|
GESTimelineObject *object = (GESTimelineObject *) self;
|
||||||
|
|
||||||
GST_DEBUG ("self:%p, halign:%d", self, halign);
|
GST_DEBUG ("self:%p, halign:%d", self, halign);
|
||||||
|
|
||||||
self->halign = 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;
|
GESTrackObject *trackobject = (GESTrackObject *) tmp->data;
|
||||||
|
|
||||||
if (GES_IS_TRACK_TITLE_SOURCE (trackobject))
|
if (GES_IS_TRACK_TITLE_SOURCE (trackobject))
|
||||||
ges_track_title_source_set_halignment (GES_TRACK_TITLE_SOURCE
|
ges_track_title_source_set_halignment (GES_TRACK_TITLE_SOURCE
|
||||||
(trackobject), self->halign);
|
(trackobject), self->halign);
|
||||||
|
|
||||||
|
g_object_unref (GES_TRACK_OBJECT (tmp->data));
|
||||||
}
|
}
|
||||||
|
g_list_free (trackobjects);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
ges_tl_title_src_set_valign (GESTimelineTitleSource * self,
|
ges_tl_title_src_set_valign (GESTimelineTitleSource * self,
|
||||||
GESTextVAlign valign)
|
GESTextVAlign valign)
|
||||||
{
|
{
|
||||||
GList *tmp;
|
GList *tmp, *trackobjects;
|
||||||
GESTimelineObject *object = (GESTimelineObject *) self;
|
GESTimelineObject *object = (GESTimelineObject *) self;
|
||||||
|
|
||||||
GST_DEBUG ("self:%p, valign:%d", self, valign);
|
GST_DEBUG ("self:%p, valign:%d", self, valign);
|
||||||
|
|
||||||
self->valign = 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;
|
GESTrackObject *trackobject = (GESTrackObject *) tmp->data;
|
||||||
|
|
||||||
if (GES_IS_TRACK_TITLE_SOURCE (trackobject))
|
if (GES_IS_TRACK_TITLE_SOURCE (trackobject))
|
||||||
ges_track_title_source_set_valignment (GES_TRACK_TITLE_SOURCE
|
ges_track_title_source_set_valignment (GES_TRACK_TITLE_SOURCE
|
||||||
(trackobject), self->valign);
|
(trackobject), self->valign);
|
||||||
|
|
||||||
|
g_object_unref (GES_TRACK_OBJECT (tmp->data));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
ges_tl_title_src_set_mute (GESTimelineTitleSource * self, gboolean mute)
|
ges_tl_title_src_set_mute (GESTimelineTitleSource * self, gboolean mute)
|
||||||
{
|
{
|
||||||
GList *tmp;
|
GList *tmp, *trackobjects;
|
||||||
GESTimelineObject *object = (GESTimelineObject *) self;
|
GESTimelineObject *object = (GESTimelineObject *) self;
|
||||||
|
|
||||||
GST_DEBUG ("self:%p, mute:%d", self, mute);
|
GST_DEBUG ("self:%p, mute:%d", self, mute);
|
||||||
|
@ -332,12 +347,16 @@ ges_tl_title_src_set_mute (GESTimelineTitleSource * self, gboolean mute)
|
||||||
self->mute = mute;
|
self->mute = mute;
|
||||||
|
|
||||||
/* Go over tracked objects, and update 'active' status on all audio objects */
|
/* 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;
|
GESTrackObject *trackobject = (GESTrackObject *) tmp->data;
|
||||||
|
|
||||||
if (trackobject->track->type == GES_TRACK_TYPE_AUDIO)
|
if (trackobject->track->type == GES_TRACK_TYPE_AUDIO)
|
||||||
ges_track_object_set_active (trackobject, !mute);
|
ges_track_object_set_active (trackobject, !mute);
|
||||||
|
|
||||||
|
g_object_unref (GES_TRACK_OBJECT (tmp->data));
|
||||||
}
|
}
|
||||||
|
g_list_free (trackobjects);
|
||||||
}
|
}
|
||||||
|
|
||||||
static GESTrackObject *
|
static GESTrackObject *
|
||||||
|
|
|
@ -63,17 +63,21 @@ static void
|
||||||
ges_timeline_transition_update_vtype_internal (GESTimelineObject * self,
|
ges_timeline_transition_update_vtype_internal (GESTimelineObject * self,
|
||||||
GESVideoTransitionType value)
|
GESVideoTransitionType value)
|
||||||
{
|
{
|
||||||
GList *tmp;
|
GList *tmp, *trackobjects;
|
||||||
GESTimelineTransition *trself = (GESTimelineTransition *) self;
|
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;
|
GESTrackVideoTransition *obj;
|
||||||
if (GES_IS_TRACK_VIDEO_TRANSITION (tmp->data)) {
|
if (GES_IS_TRACK_VIDEO_TRANSITION (tmp->data)) {
|
||||||
obj = (GESTrackVideoTransition *) tmp->data;
|
obj = (GESTrackVideoTransition *) tmp->data;
|
||||||
if (!ges_track_video_transition_set_type (obj, value))
|
if (!ges_track_video_transition_set_type (obj, value))
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
g_object_unref (GES_TRACK_OBJECT (tmp->data));
|
||||||
}
|
}
|
||||||
|
g_list_free (trackobjects);
|
||||||
|
|
||||||
trself->vtype = value;
|
trself->vtype = value;
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -551,14 +551,15 @@ static void
|
||||||
layer_object_removed_cb (GESTimelineLayer * layer, GESTimelineObject * object,
|
layer_object_removed_cb (GESTimelineLayer * layer, GESTimelineObject * object,
|
||||||
GESTimeline * timeline)
|
GESTimeline * timeline)
|
||||||
{
|
{
|
||||||
GList *tmp, *next;
|
GList *tmp, *next, *trackobjects;
|
||||||
|
|
||||||
GST_DEBUG ("TimelineObject %p removed from layer %p", object, layer);
|
GST_DEBUG ("TimelineObject %p removed from layer %p", object, layer);
|
||||||
|
|
||||||
/* Go over the object's track objects and figure out which one belongs to
|
/* Go over the object's track objects and figure out which one belongs to
|
||||||
* the list of tracks we control */
|
* 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;
|
GESTrackObject *trobj = (GESTrackObject *) tmp->data;
|
||||||
|
|
||||||
next = g_list_next (tmp);
|
next = g_list_next (tmp);
|
||||||
|
@ -572,7 +573,10 @@ layer_object_removed_cb (GESTimelineLayer * layer, GESTimelineObject * object,
|
||||||
|
|
||||||
ges_timeline_object_release_track_object (object, trobj);
|
ges_timeline_object_release_track_object (object, trobj);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
g_object_unref (GES_TRACK_OBJECT (tmp->data));
|
||||||
}
|
}
|
||||||
|
g_list_free (trackobjects);
|
||||||
|
|
||||||
GST_DEBUG ("Done");
|
GST_DEBUG ("Done");
|
||||||
}
|
}
|
||||||
|
|
|
@ -34,7 +34,7 @@ my_fill_track_func (GESTimelineObject * object,
|
||||||
{
|
{
|
||||||
GstElement *src;
|
GstElement *src;
|
||||||
|
|
||||||
GST_DEBUG ("timelineobj:%p, trackobjec:%p, gnlobj:%p",
|
GST_DEBUG ("timelineobj:%p, trackobject:%p, gnlobj:%p",
|
||||||
object, trobject, gnlobj);
|
object, trobject, gnlobj);
|
||||||
|
|
||||||
/* Let's just put a fakesource in for the time being */
|
/* Let's just put a fakesource in for the time being */
|
||||||
|
@ -45,10 +45,11 @@ my_fill_track_func (GESTimelineObject * object,
|
||||||
GST_START_TEST (test_ges_scenario)
|
GST_START_TEST (test_ges_scenario)
|
||||||
{
|
{
|
||||||
GESTimeline *timeline;
|
GESTimeline *timeline;
|
||||||
GESTimelineLayer *layer;
|
GESTimelineLayer *layer, *tmp_layer;
|
||||||
GESTrack *track;
|
GESTrack *track;
|
||||||
GESCustomTimelineSource *source;
|
GESCustomTimelineSource *source;
|
||||||
GESTrackObject *trackobject;
|
GESTrackObject *trackobject;
|
||||||
|
GList *trackobjects, *tmp;
|
||||||
|
|
||||||
ges_init ();
|
ges_init ();
|
||||||
/* This is the simplest scenario ever */
|
/* This is the simplest scenario ever */
|
||||||
|
@ -89,23 +90,37 @@ GST_START_TEST (test_ges_scenario)
|
||||||
GST_DEBUG ("Adding the source to the timeline layer");
|
GST_DEBUG ("Adding the source to the timeline layer");
|
||||||
fail_unless (ges_timeline_layer_add_object (layer,
|
fail_unless (ges_timeline_layer_add_object (layer,
|
||||||
GES_TIMELINE_OBJECT (source)));
|
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);
|
ASSERT_OBJECT_REFCOUNT (source, "source", 1);
|
||||||
/* Make sure the associated TrackObject is in the Track */
|
g_object_unref (tmp_layer);
|
||||||
fail_unless (GES_TIMELINE_OBJECT (source)->trackobjects != NULL);
|
ASSERT_OBJECT_REFCOUNT (layer, "layer", 1);
|
||||||
|
|
||||||
trackobject =
|
/* Make sure the associated TrackObject is in the Track */
|
||||||
GES_TRACK_OBJECT ((GES_TIMELINE_OBJECT (source)->trackobjects)->data);
|
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);
|
ASSERT_OBJECT_REFCOUNT (trackobject, "trackobject", 1);
|
||||||
|
|
||||||
GST_DEBUG ("Remove the TimelineObject from the layer");
|
GST_DEBUG ("Remove the TimelineObject from the layer");
|
||||||
/* Now remove the timelineobject */
|
/* Now remove the timelineobject */
|
||||||
g_object_ref (source);
|
g_object_ref (source);
|
||||||
|
ASSERT_OBJECT_REFCOUNT (layer, "layer", 1);
|
||||||
fail_unless (ges_timeline_layer_remove_object (layer,
|
fail_unless (ges_timeline_layer_remove_object (layer,
|
||||||
GES_TIMELINE_OBJECT (source)));
|
GES_TIMELINE_OBJECT (source)));
|
||||||
ASSERT_OBJECT_REFCOUNT (source, "source", 1);
|
ASSERT_OBJECT_REFCOUNT (source, "source", 1);
|
||||||
fail_unless (GES_TIMELINE_OBJECT (source)->layer == NULL);
|
ASSERT_OBJECT_REFCOUNT (layer, "layer", 1);
|
||||||
fail_unless (GES_TIMELINE_OBJECT (source)->trackobjects == NULL);
|
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);
|
g_object_unref (source);
|
||||||
|
|
||||||
GST_DEBUG ("Removing track from the timeline");
|
GST_DEBUG ("Removing track from the timeline");
|
||||||
|
@ -140,9 +155,10 @@ GST_END_TEST;
|
||||||
GST_START_TEST (test_ges_timeline_add_layer)
|
GST_START_TEST (test_ges_timeline_add_layer)
|
||||||
{
|
{
|
||||||
GESTimeline *timeline;
|
GESTimeline *timeline;
|
||||||
GESTimelineLayer *layer;
|
GESTimelineLayer *layer, *tmp_layer;
|
||||||
GESTrack *track;
|
GESTrack *track;
|
||||||
GESCustomTimelineSource *s1, *s2, *s3;
|
GESCustomTimelineSource *s1, *s2, *s3;
|
||||||
|
GList *trackobjects, *tmp;
|
||||||
GESTrackObject *trackobject;
|
GESTrackObject *trackobject;
|
||||||
|
|
||||||
ges_init ();
|
ges_init ();
|
||||||
|
@ -172,19 +188,28 @@ GST_START_TEST (test_ges_timeline_add_layer)
|
||||||
s1 = ges_custom_timeline_source_new (my_fill_track_func, NULL);
|
s1 = ges_custom_timeline_source_new (my_fill_track_func, NULL);
|
||||||
fail_unless (s1 != NULL);
|
fail_unless (s1 != NULL);
|
||||||
fail_unless (ges_timeline_layer_add_object (layer, GES_TIMELINE_OBJECT (s1)));
|
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");
|
GST_DEBUG ("Creating a source");
|
||||||
s2 = ges_custom_timeline_source_new (my_fill_track_func, NULL);
|
s2 = ges_custom_timeline_source_new (my_fill_track_func, NULL);
|
||||||
fail_unless (s2 != NULL);
|
fail_unless (s2 != NULL);
|
||||||
fail_unless (ges_timeline_layer_add_object (layer, GES_TIMELINE_OBJECT (s2)));
|
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");
|
GST_DEBUG ("Creating a source");
|
||||||
s3 = ges_custom_timeline_source_new (my_fill_track_func, NULL);
|
s3 = ges_custom_timeline_source_new (my_fill_track_func, NULL);
|
||||||
fail_unless (s3 != NULL);
|
fail_unless (s3 != NULL);
|
||||||
fail_unless (ges_timeline_layer_add_object (layer, GES_TIMELINE_OBJECT (s3)));
|
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");
|
GST_DEBUG ("Add the layer to the timeline");
|
||||||
fail_unless (ges_timeline_add_layer (timeline, layer));
|
fail_unless (ges_timeline_add_layer (timeline, layer));
|
||||||
|
@ -194,20 +219,35 @@ GST_START_TEST (test_ges_timeline_add_layer)
|
||||||
fail_unless (g_list_find (timeline->layers, layer) != NULL);
|
fail_unless (g_list_find (timeline->layers, layer) != NULL);
|
||||||
|
|
||||||
/* Make sure the associated TrackObjects are in the Track */
|
/* Make sure the associated TrackObjects are in the Track */
|
||||||
fail_unless (GES_TIMELINE_OBJECT (s1)->trackobjects != NULL);
|
trackobjects =
|
||||||
fail_unless (GES_TIMELINE_OBJECT (s2)->trackobjects != NULL);
|
ges_timeline_object_get_track_objects (GES_TIMELINE_OBJECT (s1));
|
||||||
fail_unless (GES_TIMELINE_OBJECT (s3)->trackobjects != NULL);
|
fail_unless (trackobjects != NULL);
|
||||||
|
trackobject = GES_TRACK_OBJECT (trackobjects->data);
|
||||||
trackobject =
|
ASSERT_OBJECT_REFCOUNT (trackobject, "trackobject", 2);
|
||||||
GES_TRACK_OBJECT ((GES_TIMELINE_OBJECT (s1)->trackobjects)->data);
|
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);
|
ASSERT_OBJECT_REFCOUNT (trackobject, "trackobject", 1);
|
||||||
|
|
||||||
trackobject =
|
trackobjects =
|
||||||
GES_TRACK_OBJECT ((GES_TIMELINE_OBJECT (s2)->trackobjects)->data);
|
ges_timeline_object_get_track_objects (GES_TIMELINE_OBJECT (s2));
|
||||||
ASSERT_OBJECT_REFCOUNT (trackobject, "trackobject", 1);
|
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);
|
||||||
|
|
||||||
trackobject =
|
trackobjects =
|
||||||
GES_TRACK_OBJECT ((GES_TIMELINE_OBJECT (s3)->trackobjects)->data);
|
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);
|
ASSERT_OBJECT_REFCOUNT (trackobject, "trackobject", 1);
|
||||||
|
|
||||||
/* theoretically this is all we need to do to ensure cleanup */
|
/* theoretically this is all we need to do to ensure cleanup */
|
||||||
|
@ -221,10 +261,10 @@ GST_END_TEST;
|
||||||
GST_START_TEST (test_ges_timeline_add_layer_first)
|
GST_START_TEST (test_ges_timeline_add_layer_first)
|
||||||
{
|
{
|
||||||
GESTimeline *timeline;
|
GESTimeline *timeline;
|
||||||
GESTimelineLayer *layer;
|
GESTimelineLayer *layer, *tmp_layer;
|
||||||
GESTrack *track;
|
GESTrack *track;
|
||||||
GESCustomTimelineSource *s1, *s2, *s3;
|
GESCustomTimelineSource *s1, *s2, *s3;
|
||||||
GESTrackObject *trackobject;
|
GList *trackobjects, *tmp;
|
||||||
|
|
||||||
ges_init ();
|
ges_init ();
|
||||||
|
|
||||||
|
@ -246,19 +286,25 @@ GST_START_TEST (test_ges_timeline_add_layer_first)
|
||||||
s1 = ges_custom_timeline_source_new (my_fill_track_func, NULL);
|
s1 = ges_custom_timeline_source_new (my_fill_track_func, NULL);
|
||||||
fail_unless (s1 != NULL);
|
fail_unless (s1 != NULL);
|
||||||
fail_unless (ges_timeline_layer_add_object (layer, GES_TIMELINE_OBJECT (s1)));
|
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");
|
GST_DEBUG ("Creating a source");
|
||||||
s2 = ges_custom_timeline_source_new (my_fill_track_func, NULL);
|
s2 = ges_custom_timeline_source_new (my_fill_track_func, NULL);
|
||||||
fail_unless (s2 != NULL);
|
fail_unless (s2 != NULL);
|
||||||
fail_unless (ges_timeline_layer_add_object (layer, GES_TIMELINE_OBJECT (s2)));
|
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");
|
GST_DEBUG ("Creating a source");
|
||||||
s3 = ges_custom_timeline_source_new (my_fill_track_func, NULL);
|
s3 = ges_custom_timeline_source_new (my_fill_track_func, NULL);
|
||||||
fail_unless (s3 != NULL);
|
fail_unless (s3 != NULL);
|
||||||
fail_unless (ges_timeline_layer_add_object (layer, GES_TIMELINE_OBJECT (s3)));
|
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");
|
GST_DEBUG ("Add the layer to the timeline");
|
||||||
fail_unless (ges_timeline_add_layer (timeline, layer));
|
fail_unless (ges_timeline_add_layer (timeline, layer));
|
||||||
|
@ -274,21 +320,32 @@ GST_START_TEST (test_ges_timeline_add_layer_first)
|
||||||
fail_unless ((gpointer) GST_ELEMENT_PARENT (track) == (gpointer) timeline);
|
fail_unless ((gpointer) GST_ELEMENT_PARENT (track) == (gpointer) timeline);
|
||||||
|
|
||||||
/* Make sure the associated TrackObjects are in the Track */
|
/* Make sure the associated TrackObjects are in the Track */
|
||||||
fail_unless (GES_TIMELINE_OBJECT (s1)->trackobjects != NULL);
|
trackobjects =
|
||||||
fail_unless (GES_TIMELINE_OBJECT (s2)->trackobjects != NULL);
|
ges_timeline_object_get_track_objects (GES_TIMELINE_OBJECT (s1));
|
||||||
fail_unless (GES_TIMELINE_OBJECT (s3)->trackobjects != NULL);
|
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);
|
||||||
|
|
||||||
trackobject =
|
trackobjects =
|
||||||
GES_TRACK_OBJECT ((GES_TIMELINE_OBJECT (s1)->trackobjects)->data);
|
ges_timeline_object_get_track_objects (GES_TIMELINE_OBJECT (s2));
|
||||||
ASSERT_OBJECT_REFCOUNT (trackobject, "trackobject", 1);
|
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);
|
||||||
|
|
||||||
trackobject =
|
trackobjects =
|
||||||
GES_TRACK_OBJECT ((GES_TIMELINE_OBJECT (s2)->trackobjects)->data);
|
ges_timeline_object_get_track_objects (GES_TIMELINE_OBJECT (s3));
|
||||||
ASSERT_OBJECT_REFCOUNT (trackobject, "trackobject", 1);
|
fail_unless (trackobjects != NULL);
|
||||||
|
for (tmp = trackobjects; tmp; tmp = tmp->next) {
|
||||||
trackobject =
|
ASSERT_OBJECT_REFCOUNT (GES_TRACK_OBJECT (tmp->data), "trackobject", 2);
|
||||||
GES_TRACK_OBJECT ((GES_TIMELINE_OBJECT (s3)->trackobjects)->data);
|
g_object_unref (GES_TRACK_OBJECT (tmp->data));
|
||||||
ASSERT_OBJECT_REFCOUNT (trackobject, "trackobject", 1);
|
}
|
||||||
|
g_list_free (trackobjects);
|
||||||
|
|
||||||
/* theoretically this is all we need to do to ensure cleanup */
|
/* theoretically this is all we need to do to ensure cleanup */
|
||||||
g_object_unref (timeline);
|
g_object_unref (timeline);
|
||||||
|
@ -299,10 +356,11 @@ GST_END_TEST;
|
||||||
GST_START_TEST (test_ges_timeline_remove_track)
|
GST_START_TEST (test_ges_timeline_remove_track)
|
||||||
{
|
{
|
||||||
GESTimeline *timeline;
|
GESTimeline *timeline;
|
||||||
GESTimelineLayer *layer;
|
GESTimelineLayer *layer, *tmp_layer;
|
||||||
GESTrack *track;
|
GESTrack *track;
|
||||||
GESCustomTimelineSource *s1, *s2, *s3;
|
GESCustomTimelineSource *s1, *s2, *s3;
|
||||||
GESTrackObject *t1, *t2, *t3;
|
GESTrackObject *t1, *t2, *t3;
|
||||||
|
GList *trackobjects, *tmp;
|
||||||
|
|
||||||
ges_init ();
|
ges_init ();
|
||||||
|
|
||||||
|
@ -324,19 +382,25 @@ GST_START_TEST (test_ges_timeline_remove_track)
|
||||||
s1 = ges_custom_timeline_source_new (my_fill_track_func, NULL);
|
s1 = ges_custom_timeline_source_new (my_fill_track_func, NULL);
|
||||||
fail_unless (s1 != NULL);
|
fail_unless (s1 != NULL);
|
||||||
fail_unless (ges_timeline_layer_add_object (layer, GES_TIMELINE_OBJECT (s1)));
|
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");
|
GST_DEBUG ("Creating a source");
|
||||||
s2 = ges_custom_timeline_source_new (my_fill_track_func, NULL);
|
s2 = ges_custom_timeline_source_new (my_fill_track_func, NULL);
|
||||||
fail_unless (s2 != NULL);
|
fail_unless (s2 != NULL);
|
||||||
fail_unless (ges_timeline_layer_add_object (layer, GES_TIMELINE_OBJECT (s2)));
|
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");
|
GST_DEBUG ("Creating a source");
|
||||||
s3 = ges_custom_timeline_source_new (my_fill_track_func, NULL);
|
s3 = ges_custom_timeline_source_new (my_fill_track_func, NULL);
|
||||||
fail_unless (s3 != NULL);
|
fail_unless (s3 != NULL);
|
||||||
fail_unless (ges_timeline_layer_add_object (layer, GES_TIMELINE_OBJECT (s3)));
|
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");
|
GST_DEBUG ("Add the layer to the timeline");
|
||||||
fail_unless (ges_timeline_add_layer (timeline, layer));
|
fail_unless (ges_timeline_add_layer (timeline, layer));
|
||||||
|
@ -352,20 +416,40 @@ GST_START_TEST (test_ges_timeline_remove_track)
|
||||||
fail_unless ((gpointer) GST_ELEMENT_PARENT (track) == (gpointer) timeline);
|
fail_unless ((gpointer) GST_ELEMENT_PARENT (track) == (gpointer) timeline);
|
||||||
|
|
||||||
/* Make sure the associated TrackObjects are in the Track */
|
/* Make sure the associated TrackObjects are in the Track */
|
||||||
fail_unless (GES_TIMELINE_OBJECT (s1)->trackobjects != NULL);
|
trackobjects =
|
||||||
fail_unless (GES_TIMELINE_OBJECT (s2)->trackobjects != NULL);
|
ges_timeline_object_get_track_objects (GES_TIMELINE_OBJECT (s1));
|
||||||
fail_unless (GES_TIMELINE_OBJECT (s3)->trackobjects != NULL);
|
fail_unless (trackobjects != NULL);
|
||||||
|
t1 = GES_TRACK_OBJECT ((trackobjects)->data);
|
||||||
t1 = GES_TRACK_OBJECT ((GES_TIMELINE_OBJECT (s1)->trackobjects)->data);
|
|
||||||
g_object_ref (t1);
|
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);
|
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);
|
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);
|
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);
|
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);
|
ASSERT_OBJECT_REFCOUNT (t3, "t3", 2);
|
||||||
|
|
||||||
/* remove the track and check that the track objects have been released */
|
/* remove the track and check that the track objects have been released */
|
||||||
|
|
|
@ -282,8 +282,9 @@ ges_objs_equal (GObject * a, GObject * b)
|
||||||
, bv = {
|
, bv = {
|
||||||
0};
|
0};
|
||||||
|
|
||||||
/* ignore name property */
|
/* ignore name and layer properties */
|
||||||
if (!g_strcmp0 ("name", (*iter)->name))
|
if (!g_strcmp0 ("name", (*iter)->name) ||
|
||||||
|
!g_strcmp0 ("layer", (*iter)->name))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
/* special case caps property */
|
/* special case caps property */
|
||||||
|
|
|
@ -78,7 +78,8 @@ GST_START_TEST (test_gsl_add)
|
||||||
|
|
||||||
fail_unless (ges_simple_timeline_layer_add_object (GES_SIMPLE_TIMELINE_LAYER
|
fail_unless (ges_simple_timeline_layer_add_object (GES_SIMPLE_TIMELINE_LAYER
|
||||||
(layer), GES_TIMELINE_OBJECT (source), -1));
|
(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_DURATION (source), GST_SECOND);
|
||||||
fail_unless_equals_uint64 (GES_TIMELINE_OBJECT_START (source), 0);
|
fail_unless_equals_uint64 (GES_TIMELINE_OBJECT_START (source), 0);
|
||||||
|
|
||||||
|
|
|
@ -77,11 +77,13 @@ print_transition_data (GESTimelineObject * tr)
|
||||||
guint64 start, duration;
|
guint64 start, duration;
|
||||||
gint priority;
|
gint priority;
|
||||||
char *name;
|
char *name;
|
||||||
|
GList *trackobjects, *tmp;
|
||||||
|
|
||||||
if (!tr)
|
if (!tr)
|
||||||
return FALSE;
|
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;
|
gnlobj = trackobj->gnlobject;
|
||||||
|
|
||||||
g_object_get (gnlobj, "start", &start, "duration", &duration,
|
g_object_get (gnlobj, "start", &start, "duration", &duration,
|
||||||
|
@ -90,6 +92,12 @@ print_transition_data (GESTimelineObject * tr)
|
||||||
((gfloat) start) / GST_SECOND,
|
((gfloat) start) / GST_SECOND,
|
||||||
((gfloat) duration) / GST_SECOND, priority);
|
((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;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -61,11 +61,13 @@ print_transition_data (GESTimelineObject * tr)
|
||||||
guint64 start, duration;
|
guint64 start, duration;
|
||||||
gint priority;
|
gint priority;
|
||||||
char *name;
|
char *name;
|
||||||
|
GList *trackobjects, *tmp;
|
||||||
|
|
||||||
if (!tr)
|
if (!tr)
|
||||||
return FALSE;
|
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;
|
gnlobj = trackobj->gnlobject;
|
||||||
|
|
||||||
g_object_get (gnlobj, "start", &start, "duration", &duration,
|
g_object_get (gnlobj, "start", &start, "duration", &duration,
|
||||||
|
@ -74,6 +76,12 @@ print_transition_data (GESTimelineObject * tr)
|
||||||
((gfloat) start) / GST_SECOND,
|
((gfloat) start) / GST_SECOND,
|
||||||
((gfloat) duration) / GST_SECOND, priority);
|
((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;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -61,11 +61,14 @@ print_transition_data (GESTimelineObject * tr)
|
||||||
guint64 start, duration;
|
guint64 start, duration;
|
||||||
gint priority;
|
gint priority;
|
||||||
char *name;
|
char *name;
|
||||||
|
GList *trackobjects, *tmp;
|
||||||
|
|
||||||
if (!tr)
|
if (!tr)
|
||||||
return FALSE;
|
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;
|
gnlobj = trackobj->gnlobject;
|
||||||
|
|
||||||
g_object_get (gnlobj, "start", &start, "duration", &duration,
|
g_object_get (gnlobj, "start", &start, "duration", &duration,
|
||||||
|
@ -74,6 +77,12 @@ print_transition_data (GESTimelineObject * tr)
|
||||||
((gfloat) start) / GST_SECOND,
|
((gfloat) start) / GST_SECOND,
|
||||||
((gfloat) duration) / GST_SECOND, priority);
|
((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;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue