Rename GESTimelineObject to GESClip

This commit is contained in:
Thibault Saunier 2013-01-20 12:42:29 -03:00
parent f0359481c0
commit 04a3c49ebd
74 changed files with 1364 additions and 1491 deletions

View file

@ -14,7 +14,7 @@ LOCAL_SRC_FILES := \
ges-simple-timeline-layer.c \
ges-timeline.c \
ges-timeline-layer.c \
ges-timeline-object.c \
ges-clip.c \
ges-timeline-pipeline.c \
ges-timeline-source.c \
ges-timeline-file-source.c \

View file

@ -37,7 +37,7 @@ platform as well as Windows. It is released under the GNU Library General Public
<xi:include href="xml/ges-timeline.xml"/>
<xi:include href="xml/ges-timeline-layer.xml"/>
<xi:include href="xml/ges-timeline-element.xml"/>
<xi:include href="xml/ges-timeline-object.xml"/>
<xi:include href="xml/ges-clip.xml"/>
<xi:include href="xml/ges-timeline-source.xml"/>
<xi:include href="xml/ges-timeline-operation.xml"/>
<xi:include href="xml/ges-timeline-overlay.xml"/>
@ -102,7 +102,7 @@ platform as well as Windows. It is released under the GNU Library General Public
<chapter>
<title>Assets</title>
<xi:include href="xml/ges-asset-timeline-object.xml"/>
<xi:include href="xml/ges-asset-clip.xml"/>
<xi:include href="xml/ges-asset-track-object.xml"/>
<xi:include href="xml/ges-asset-file-source.xml"/>
<xi:include href="xml/ges-asset-track-file-source.xml"/>

View file

@ -98,7 +98,7 @@ ges_track_object_set_active
ges_track_object_set_locked
ges_track_object_is_locked
ges_track_object_get_track
ges_track_object_get_timeline_object
ges_track_object_get_clip
ges_track_object_get_gnlobject
ges_track_object_get_element
ges_track_object_get_max_duration
@ -117,7 +117,7 @@ ges_track_object_edit
ges_track_object_copy
<SUBSECTION Standard>
GESTrackObjectPrivate
ges_track_object_set_timeline_object
ges_track_object_set_clip
ges_track_object_set_track
ges_track_object_get_type
GES_IS_TRACK_OBJECT
@ -349,47 +349,47 @@ GES_TIMELINE_ELEMENT_GET_CLASS
</SECTION>
<SECTION>
<FILE>ges-timeline-object</FILE>
<TITLE>GESTimelineObject</TITLE>
GESTimelineObject
GESTimelineObjectClass
<FILE>ges-clip</FILE>
<TITLE>GESClip</TITLE>
GESClip
GESClipClass
GESCreateTrackObjectFunc
GESCreateTrackObjectsFunc
GESFillTrackObjectFunc
ges_timeline_object_get_layer
ges_timeline_object_find_track_object
ges_timeline_object_add_track_object
ges_timeline_object_add_asset
ges_timeline_object_get_top_effects
ges_timeline_object_get_top_effect_position
ges_timeline_object_move_to_layer
ges_timeline_object_set_top_effect_priority
ges_timeline_object_set_supported_formats
ges_timeline_object_get_supported_formats
ges_timeline_object_split
ges_timeline_object_edit
ges_timeline_object_get_max_duration
ges_timeline_object_objects_set_locked
ges_timeline_object_set_max_duration
ges_clip_get_layer
ges_clip_find_track_object
ges_clip_add_track_object
ges_clip_add_asset
ges_clip_get_top_effects
ges_clip_get_top_effect_position
ges_clip_move_to_layer
ges_clip_set_top_effect_priority
ges_clip_set_supported_formats
ges_clip_get_supported_formats
ges_clip_split
ges_clip_edit
ges_clip_get_max_duration
ges_clip_objects_set_locked
ges_clip_set_max_duration
<SUBSECTION Standard>
GES_TIMELINE_OBJECT_HEIGHT
ges_timeline_object_create_track_objects
ges_timeline_object_create_track_object
ges_timeline_object_fill_track_object
ges_timeline_object_is_moving_from_layer
ges_timeline_object_release_track_object
ges_timeline_object_get_track_objects
ges_timeline_object_set_layer
ges_timeline_object_set_moving_from_layer
ges_timeline_object_lock_track_objects
GESTimelineObjectPrivate
GES_IS_TIMELINE_OBJECT
GES_IS_TIMELINE_OBJECT_CLASS
GES_TIMELINE_OBJECT
GES_TIMELINE_OBJECT_CLASS
GES_TIMELINE_OBJECT_GET_CLASS
GES_TYPE_TIMELINE_OBJECT
ges_timeline_object_get_type
GES_CLIP_HEIGHT
ges_clip_create_track_objects
ges_clip_create_track_object
ges_clip_fill_track_object
ges_clip_is_moving_from_layer
ges_clip_release_track_object
ges_clip_get_track_objects
ges_clip_set_layer
ges_clip_set_moving_from_layer
ges_clip_lock_track_objects
GESClipPrivate
GES_IS_CLIP
GES_IS_CLIP_CLASS
GES_CLIP
GES_CLIP_CLASS
GES_CLIP_GET_CLASS
GES_TYPE_CLIP
ges_clip_get_type
</SECTION>
@ -983,20 +983,20 @@ ges_asset_get_type
</SECTION>
<SECTION>
<FILE>ges-asset-timeline-object</FILE>
<TITLE>GESAssetTimelineObject</TITLE>
GESAssetTimelineObject
ges_asset_timeline_object_get_type
ges_asset_timeline_object_set_supported_formats
ges_asset_timeline_object_get_supported_formats
<FILE>ges-asset-clip</FILE>
<TITLE>GESAssetClip</TITLE>
GESAssetClip
ges_asset_clip_get_type
ges_asset_clip_set_supported_formats
ges_asset_clip_get_supported_formats
<SUBSECTION Standard>
GESAssetTimelineObjectPrivate
GES_ASSET_TIMELINE_OBJECT
GES_TYPE_ASSET_TIMELINE_OBJECT
GES_ASSET_TIMELINE_OBJECT_CLASS
GES_IS_ASSET_TIMELINE_OBJECT
GES_IS_ASSET_TIMELINE_OBJECT_CLASS
GES_ASSET_TIMELINE_OBJECT_GET_CLASS
GESAssetClipPrivate
GES_ASSET_CLIP
GES_TYPE_ASSET_CLIP
GES_ASSET_CLIP_CLASS
GES_IS_ASSET_CLIP
GES_IS_ASSET_CLIP_CLASS
GES_ASSET_CLIP_GET_CLASS
</SECTION>
<SECTION>

View file

@ -8,7 +8,7 @@ ges_simple_timeline_layer_get_type
%ges_text_valign_get_type
ges_timeline_get_type
ges_timeline_layer_get_type
ges_timeline_object_get_type
ges_clip_get_type
ges_timeline_operation_get_type
ges_timeline_overlay_get_type
ges_timeline_pipeline_get_type

View file

@ -16,7 +16,7 @@ libges_@GST_API_VERSION@_la_SOURCES = \
ges-simple-timeline-layer.c \
ges-timeline.c \
ges-timeline-layer.c \
ges-timeline-object.c \
ges-clip.c \
ges-timeline-pipeline.c \
ges-timeline-source.c \
ges-timeline-effect.c \
@ -49,7 +49,7 @@ libges_@GST_API_VERSION@_la_SOURCES = \
ges-pitivi-formatter.c \
ges-asset.c \
ges-asset-file-source.c \
ges-asset-timeline-object.c \
ges-asset-clip.c \
ges-asset-track-object.c \
ges-extractable.c \
ges-project.c \
@ -70,7 +70,7 @@ libges_@GST_API_VERSION@include_HEADERS = \
ges-simple-timeline-layer.h \
ges-timeline.h \
ges-timeline-layer.h \
ges-timeline-object.h \
ges-clip.h \
ges-timeline-pipeline.h \
ges-timeline-source.h \
ges-timeline-file-source.h \
@ -103,7 +103,7 @@ libges_@GST_API_VERSION@include_HEADERS = \
ges-pitivi-formatter.h \
ges-asset.h \
ges-asset-file-source.h \
ges-asset-timeline-object.h \
ges-asset-clip.h \
ges-asset-track-object.h \
ges-extractable.h \
ges-project.h \

View file

@ -18,25 +18,24 @@
* Boston, MA 02111-1307, USA.
*/
/**
* SECTION: ges-asset-timeline-object
* @short_description: A GESAsset subclass specialized in GESTimelineObject extraction
* SECTION: ges-asset-clip
* @short_description: A GESAsset subclass specialized in GESClip extraction
*
* The #GESAssetFileSource is a special #GESAsset specilized in #GESTimelineObject.
* The #GESAssetFileSource is a special #GESAsset specilized in #GESClip.
* it is mostly used to get information about the #GESTrackType-s the objects extracted
* from it can potentialy create #GESTrackObject for.
*/
#include "ges-asset-timeline-object.h"
#include "ges-asset-clip.h"
G_DEFINE_TYPE (GESAssetTimelineObject, ges_asset_timeline_object,
GES_TYPE_ASSET);
#define GES_ASSET_TIMELINE_OBJECT_GET_PRIVATE(o)\
(G_TYPE_INSTANCE_GET_PRIVATE ((o), GES_TYPE_ASSET_TIMELINE_OBJECT, \
GESAssetTimelineObjectPrivate))
G_DEFINE_TYPE (GESAssetClip, ges_asset_clip, GES_TYPE_ASSET);
#define GES_ASSET_CLIP_GET_PRIVATE(o)\
(G_TYPE_INSTANCE_GET_PRIVATE ((o), GES_TYPE_ASSET_CLIP, \
GESAssetClipPrivate))
#define parent_class ges_asset_timeline_object_parent_class
#define parent_class ges_asset_clip_parent_class
struct _GESAssetTimelineObjectPrivate
struct _GESAssetClipPrivate
{
GESTrackType supportedformats;
};
@ -70,8 +69,7 @@ static void
_get_property (GObject * object, guint property_id,
GValue * value, GParamSpec * pspec)
{
GESAssetTimelineObjectPrivate *priv =
GES_ASSET_TIMELINE_OBJECT (object)->priv;
GESAssetClipPrivate *priv = GES_ASSET_CLIP (object)->priv;
switch (property_id) {
case PROP_SUPPORTED_FORMATS:
g_value_set_flags (value, priv->supportedformats);
@ -85,8 +83,7 @@ static void
_set_property (GObject * object, guint property_id,
const GValue * value, GParamSpec * pspec)
{
GESAssetTimelineObjectPrivate *priv =
GES_ASSET_TIMELINE_OBJECT (object)->priv;
GESAssetClipPrivate *priv = GES_ASSET_CLIP (object)->priv;
switch (property_id) {
case PROP_SUPPORTED_FORMATS:
@ -98,9 +95,9 @@ _set_property (GObject * object, guint property_id,
}
static void
ges_asset_timeline_object_init (GESAssetTimelineObject * self)
ges_asset_clip_init (GESAssetClip * self)
{
self->priv = GES_ASSET_TIMELINE_OBJECT_GET_PRIVATE (self);
self->priv = GES_ASSET_CLIP_GET_PRIVATE (self);
}
static void
@ -113,19 +110,18 @@ _constructed (GObject * object)
pspec = G_PARAM_SPEC_FLAGS (g_object_class_find_property (class,
"supported-formats"));
GES_ASSET_TIMELINE_OBJECT (object)->priv->supportedformats =
pspec->default_value;
GES_ASSET_CLIP (object)->priv->supportedformats = pspec->default_value;
g_type_class_unref (class);
G_OBJECT_CLASS (parent_class)->constructed (object);
}
static void
ges_asset_timeline_object_class_init (GESAssetTimelineObjectClass * self_class)
ges_asset_clip_class_init (GESAssetClipClass * self_class)
{
GObjectClass *object_class = G_OBJECT_CLASS (self_class);
g_type_class_add_private (self_class, sizeof (GESAssetTimelineObjectPrivate));
g_type_class_add_private (self_class, sizeof (GESAssetClipPrivate));
object_class->constructed = _constructed;
object_class->dispose = _dispose;
object_class->finalize = _finalize;
@ -133,7 +129,7 @@ ges_asset_timeline_object_class_init (GESAssetTimelineObjectClass * self_class)
object_class->set_property = _set_property;
/**
* GESAssetTimelineObject:supported-formats:
* GESAssetClip:supported-formats:
*
* The formats supported by the asset.
*/
@ -152,24 +148,24 @@ ges_asset_timeline_object_class_init (GESAssetTimelineObjectClass * self_class)
* *
***********************************************/
/**
* ges_asset_timeline_object_set_supported_formats:
* @self: a #GESAssetTimelineObject
* @supportedformats: The track types supported by the GESAssetTimelineObject
* ges_asset_clip_set_supported_formats:
* @self: a #GESAssetClip
* @supportedformats: The track types supported by the GESAssetClip
*
* Sets track types for which objects extracted from @self can create #GESTrackObject
*/
void
ges_asset_timeline_object_set_supported_formats (GESAssetTimelineObject * self,
ges_asset_clip_set_supported_formats (GESAssetClip * self,
GESTrackType supportedformats)
{
g_return_if_fail (GES_IS_ASSET_TIMELINE_OBJECT (self));
g_return_if_fail (GES_IS_ASSET_CLIP (self));
self->priv->supportedformats = supportedformats;
}
/**
* ges_asset_timeline_object_get_supported_formats:
* @self: a #GESAssetTimelineObject
* ges_asset_clip_get_supported_formats:
* @self: a #GESAssetClip
*
* Gets track types for which objects extracted from @self can create #GESTrackObject
*
@ -177,10 +173,9 @@ ges_asset_timeline_object_set_supported_formats (GESAssetTimelineObject * self,
* a layer
*/
GESTrackType
ges_asset_timeline_object_get_supported_formats (GESAssetTimelineObject * self)
ges_asset_clip_get_supported_formats (GESAssetClip * self)
{
g_return_val_if_fail (GES_IS_ASSET_TIMELINE_OBJECT (self),
GES_TRACK_TYPE_UNKNOWN);
g_return_val_if_fail (GES_IS_ASSET_CLIP (self), GES_TRACK_TYPE_UNKNOWN);
return self->priv->supportedformats;
}

View file

@ -20,8 +20,8 @@
*/
#ifndef GES_ASSET_TIMELINE_OBJECT_H
#define GES_ASSET_TIMELINE_OBJECT_H
#ifndef GES_ASSET_CLIP_H
#define GES_ASSET_CLIP_H
#include <glib-object.h>
#include <ges/ges-types.h>
@ -29,36 +29,36 @@
G_BEGIN_DECLS
#define GES_TYPE_ASSET_TIMELINE_OBJECT (ges_asset_timeline_object_get_type ())
#define GES_ASSET_TIMELINE_OBJECT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GES_TYPE_ASSET_TIMELINE_OBJECT, GESAssetTimelineObject))
#define GES_ASSET_TIMELINE_OBJECT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GES_TYPE_ASSET_TIMELINE_OBJECT, GESAssetTimelineObjectClass))
#define GES_IS_ASSET_TIMELINE_OBJECT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GES_TYPE_ASSET_TIMELINE_OBJECT))
#define GES_IS_ASSET_TIMELINE_OBJECT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GES_TYPE_ASSET_TIMELINE_OBJECT))
#define GES_ASSET_TIMELINE_OBJECT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GES_TYPE_ASSET_TIMELINE_OBJECT, GESAssetTimelineObjectClass))
#define GES_TYPE_ASSET_CLIP (ges_asset_clip_get_type ())
#define GES_ASSET_CLIP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GES_TYPE_ASSET_CLIP, GESAssetClip))
#define GES_ASSET_CLIP_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GES_TYPE_ASSET_CLIP, GESAssetClipClass))
#define GES_IS_ASSET_CLIP(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GES_TYPE_ASSET_CLIP))
#define GES_IS_ASSET_CLIP_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GES_TYPE_ASSET_CLIP))
#define GES_ASSET_CLIP_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GES_TYPE_ASSET_CLIP, GESAssetClipClass))
typedef struct _GESAssetTimelineObjectPrivate GESAssetTimelineObjectPrivate;
typedef struct _GESAssetClipPrivate GESAssetClipPrivate;
struct _GESAssetTimelineObject
struct _GESAssetClip
{
GESAsset parent;
/* <private> */
GESAssetTimelineObjectPrivate *priv;
GESAssetClipPrivate *priv;
gpointer _ges_reserved[GES_PADDING];
};
struct _GESAssetTimelineObjectClass
struct _GESAssetClipClass
{
GESAssetClass parent;
gpointer _ges_reserved[GES_PADDING];
};
GType ges_asset_timeline_object_get_type (void);
void ges_asset_timeline_object_set_supported_formats (GESAssetTimelineObject *self,
GType ges_asset_clip_get_type (void);
void ges_asset_clip_set_supported_formats (GESAssetClip *self,
GESTrackType supportedformats);
GESTrackType ges_asset_timeline_object_get_supported_formats (GESAssetTimelineObject *self);
GESTrackType ges_asset_clip_get_supported_formats (GESAssetClip *self);
G_END_DECLS
#endif /* _GES_ASSET_TIMELINE_OBJECT_H */
#endif /* _GES_ASSET_CLIP_H */

View file

@ -41,7 +41,7 @@ initable_iface_init (GInitableIface * initable_iface)
}
G_DEFINE_TYPE_WITH_CODE (GESAssetFileSource, ges_asset_filesource,
GES_TYPE_ASSET_TIMELINE_OBJECT,
GES_TYPE_ASSET_CLIP,
G_IMPLEMENT_INTERFACE (G_TYPE_INITABLE, initable_iface_init));
/* TODO: We should monitor files here, and add some way of reporting changes
@ -291,7 +291,7 @@ ges_asset_filesource_set_info (GESAssetFileSource * self,
gst_discoverer_stream_info_get_stream_id (sinf));
_create_track_file_source_asset (self, sinf, type);
}
ges_asset_timeline_object_set_supported_formats (GES_ASSET_TIMELINE_OBJECT
ges_asset_clip_set_supported_formats (GES_ASSET_CLIP
(self), supportedformats);
if (stream_list)

View file

@ -25,7 +25,7 @@
#include <gio/gio.h>
#include <ges/ges-types.h>
#include <ges/ges-asset.h>
#include <ges/ges-asset-timeline-object.h>
#include <ges/ges-asset-clip.h>
#include <ges/ges-asset-track-object.h>
G_BEGIN_DECLS
@ -47,7 +47,7 @@ GType ges_asset_filesource_get_type (void);
struct _GESAssetFileSource
{
GESAssetTimelineObject parent;
GESAssetClip parent;
/* <private> */
GESAssetFileSourcePrivate *priv;
@ -58,7 +58,7 @@ struct _GESAssetFileSource
struct _GESAssetFileSourceClass
{
GESAssetTimelineObjectClass parent_class;
GESAssetClipClass parent_class;
/* <private> */
GstDiscoverer *discoverer;

View file

@ -82,7 +82,7 @@ ges_asset_track_object_class_init (GESAssetTrackObjectClass * klass)
object_class->set_property = _set_property;
/**
* GESTimelineObject:track-type:
* GESClip:track-type:
*
* The formats supported by the object.
*/

View file

@ -24,7 +24,7 @@
*
* The Assets in the GStreamer Editing Services represent the ressources
* that can be used. You can create assets for any type that implements the #GESExtractable
* interface, for example #GESTimelineObjects, #GESFormatter, and #GESTrackObject do implement it.
* interface, for example #GESClips, #GESFormatter, and #GESTrackObject do implement it.
* This means that asssets will represent for example a #GESTimelineFileSources, #GESTrackEffect etc,
* and then you can extract objects of those types with the appropriate parameters from the asset
* using the #ges_asset_extract method:
@ -48,7 +48,7 @@
*
* Each asset are represented by a pair of @extractable_type and @id (string). Actually the @extractable_type
* is the type that implements the #GESExtractable interface, that means that for example for a #GESTimelineFileSource,
* the type that implements the #GESExtractable interface is #GESTimelineObject.
* the type that implements the #GESExtractable interface is #GESClip.
* The identifier represents different things depending on the @extractable_type and you should check
* the documentation of each type to know what the ID of #GESAsset actually represents for that type. By default,
* we only have one #GESAsset per type, and the @id is the name of the type, but this behaviour is overriden
@ -146,7 +146,7 @@ static GMutex asset_cache_lock;
* }
*
* (The first extractable type is the type of the class that implemented
* the GESExtractable interface ie: GESTimelineObject, GESTimeline,
* the GESExtractable interface ie: GESClip, GESTimeline,
* GESFomatter, etc... but not subclasses)
*
* This is in order to be able to have 2 Asset with the same ID but

View file

@ -36,7 +36,7 @@ static guint auto_transition_signals[LAST_SIGNAL] = { 0 };
G_DEFINE_TYPE (GESAutoTransition, ges_auto_transition, G_TYPE_OBJECT);
static void
neighbour_changed_cb (GESTimelineObject * obj, GParamSpec * arg G_GNUC_UNUSED,
neighbour_changed_cb (GESClip * obj, GParamSpec * arg G_GNUC_UNUSED,
GESAutoTransition * self)
{
gint64 new_duration;
@ -68,14 +68,13 @@ neighbour_changed_cb (GESTimelineObject * obj, GParamSpec * arg G_GNUC_UNUSED,
}
static void
_height_changed_cb (GESTimelineObject * obj, GParamSpec * arg G_GNUC_UNUSED,
_height_changed_cb (GESClip * obj, GParamSpec * arg G_GNUC_UNUSED,
GESAutoTransition * self)
{
/* FIXME This is really not smart and we should properly implement timelineobject
/* FIXME This is really not smart and we should properly implement clip
* priority management at the TimelineLayer level */
_set_priority0 (GES_TIMELINE_ELEMENT (self->next_timeline_object),
_PRIORITY (self->previous_timeline_object) +
self->previous_timeline_object->height);
_set_priority0 (GES_TIMELINE_ELEMENT (self->next_clip),
_PRIORITY (self->previous_clip) + self->previous_clip->height);
}
static void
@ -105,7 +104,7 @@ ges_auto_transition_finalize (GObject * object)
neighbour_changed_cb, self);
g_signal_handlers_disconnect_by_func (self->next_source, neighbour_changed_cb,
self);
g_signal_handlers_disconnect_by_func (self->previous_timeline_object,
g_signal_handlers_disconnect_by_func (self->previous_clip,
_height_changed_cb, self);
g_signal_handlers_disconnect_by_func (self->next_source, _track_changed_cb,
self);
@ -140,11 +139,9 @@ ges_auto_transition_new (GESTrackObject * transition,
self->next_source = next_source;
self->transition = transition;
self->previous_timeline_object =
ges_track_object_get_timeline_object (previous_source);
self->next_timeline_object =
ges_track_object_get_timeline_object (next_source);
self->timeline_transition = ges_track_object_get_timeline_object (transition);
self->previous_clip = ges_track_object_get_clip (previous_source);
self->next_clip = ges_track_object_get_clip (next_source);
self->timeline_transition = ges_track_object_get_clip (transition);
g_signal_connect (previous_source, "notify::start",
G_CALLBACK (neighbour_changed_cb), self);
@ -158,7 +155,7 @@ ges_auto_transition_new (GESTrackObject * transition,
G_CALLBACK (neighbour_changed_cb), self);
g_signal_connect (next_source, "notify::duration",
G_CALLBACK (neighbour_changed_cb), self);
g_signal_connect (self->previous_timeline_object, "notify::height",
g_signal_connect (self->previous_clip, "notify::height",
G_CALLBACK (_height_changed_cb), self);
g_signal_connect (next_source, "notify::track",
@ -166,14 +163,14 @@ ges_auto_transition_new (GESTrackObject * transition,
g_signal_connect (previous_source, "notify::track",
G_CALLBACK (_track_changed_cb), self);
_height_changed_cb (self->previous_timeline_object, NULL, self);
_height_changed_cb (self->previous_clip, NULL, self);
GST_DEBUG_OBJECT (self, "Created transition %" GST_PTR_FORMAT
" between %" GST_PTR_FORMAT " and: %" GST_PTR_FORMAT
" in layer nb %i, start: %" GST_TIME_FORMAT " duration: %"
GST_TIME_FORMAT, transition, next_source, previous_source,
ges_timeline_layer_get_priority (ges_timeline_object_get_layer
(self->previous_timeline_object)),
ges_timeline_layer_get_priority (ges_clip_get_layer
(self->previous_clip)),
GST_TIME_ARGS (_START (transition)),
GST_TIME_ARGS (_DURATION (transition)));

View file

@ -22,7 +22,7 @@
#include <glib-object.h>
#include "ges-track-object.h"
#include "ges-timeline-object.h"
#include "ges-clip.h"
#include "ges-timeline-layer.h"
G_BEGIN_DECLS
@ -58,9 +58,9 @@ struct _GESAutoTransition
GESTimelineLayer *layer;
GESTimelineObject *previous_timeline_object;
GESTimelineObject *next_timeline_object;
GESTimelineObject *timeline_transition;
GESClip *previous_clip;
GESClip *next_clip;
GESClip *timeline_transition;
gchar *key;

View file

@ -40,7 +40,7 @@ typedef struct PendingEffects
} PendingEffects;
typedef struct PendingTimelineObject
typedef struct PendingClip
{
gchar *id;
gdouble rate;
@ -59,7 +59,7 @@ typedef struct PendingTimelineObject
/* TODO Implement asset effect management
* PendingTrackObjects *track_objects; */
} PendingTimelineObject;
} PendingClip;
typedef struct LayerEntry
{
@ -79,14 +79,14 @@ struct _GESBaseXmlFormatterPrivate
GMarkupParseContext *parsecontext;
gboolean check_only;
/* Asset.id -> PendingTimelineObject */
GHashTable *assetid_pendingtlobjs;
/* Asset.id -> PendingClip */
GHashTable *assetid_pendingclips;
/* TimelineObject.ID -> Pending */
GHashTable *tlobjid_pendings;
/* Clip.ID -> Pending */
GHashTable *clipid_pendings;
/* TimelineObject.ID -> TimelineObject */
GHashTable *timeline_objects;
/* Clip.ID -> Clip */
GHashTable *clips;
/* ID -> track */
GHashTable *tracks;
@ -298,12 +298,10 @@ _dispose (GObject * object)
{
GESBaseXmlFormatterPrivate *priv = _GET_PRIV (object);
g_clear_pointer (&priv->assetid_pendingtlobjs,
(GDestroyNotify) g_hash_table_unref);
g_clear_pointer (&priv->timeline_objects,
(GDestroyNotify) g_hash_table_unref);
g_clear_pointer (&priv->tlobjid_pendings,
g_clear_pointer (&priv->assetid_pendingclips,
(GDestroyNotify) g_hash_table_unref);
g_clear_pointer (&priv->clips, (GDestroyNotify) g_hash_table_unref);
g_clear_pointer (&priv->clipid_pendings, (GDestroyNotify) g_hash_table_unref);
g_clear_pointer (&priv->tracks, (GDestroyNotify) g_hash_table_unref);
g_clear_pointer (&priv->layers, (GDestroyNotify) g_hash_table_unref);
@ -330,12 +328,12 @@ ges_base_xml_formatter_init (GESBaseXmlFormatter * self)
priv->parsecontext = NULL;
priv->pending_assets = NULL;
/* The PendingTimelineObject are owned by the assetid_pendingtlobjs table */
priv->assetid_pendingtlobjs = g_hash_table_new_full (g_str_hash,
/* The PendingClip are owned by the assetid_pendingclips table */
priv->assetid_pendingclips = g_hash_table_new_full (g_str_hash,
g_str_equal, g_free, NULL);
priv->tlobjid_pendings = g_hash_table_new_full (g_str_hash,
priv->clipid_pendings = g_hash_table_new_full (g_str_hash,
g_str_equal, g_free, NULL);
priv->timeline_objects = g_hash_table_new_full (g_str_hash,
priv->clips = g_hash_table_new_full (g_str_hash,
g_str_equal, g_free, gst_object_unref);
priv->tracks = g_hash_table_new_full (g_str_hash,
g_str_equal, g_free, gst_object_unref);
@ -407,38 +405,37 @@ set_property_foreach (GQuark field_id, const GValue * value, GObject * object)
g_object_set_property (object, g_quark_to_string (field_id), value);
}
static inline GESTimelineObject *
static inline GESClip *
_add_object_to_layer (GESBaseXmlFormatterPrivate * priv, const gchar * id,
GESTimelineLayer * layer, GESAsset * asset, GstClockTime start,
GstClockTime inpoint, GstClockTime duration, gdouble rate,
GESTrackType track_types, const gchar * metadatas,
GstStructure * properties)
{
GESTimelineObject *tlobj = ges_timeline_layer_add_asset (layer,
GESClip *clip = ges_timeline_layer_add_asset (layer,
asset, start, inpoint, duration, rate, track_types);
if (tlobj == NULL) {
GST_WARNING_OBJECT (tlobj, "Could not add object from asset: %s",
if (clip == NULL) {
GST_WARNING_OBJECT (clip, "Could not add object from asset: %s",
ges_asset_get_id (asset));
return NULL;
}
if (metadatas)
ges_meta_container_add_metas_from_string (GES_META_CONTAINER (tlobj),
ges_meta_container_add_metas_from_string (GES_META_CONTAINER (clip),
metadatas);
if (properties)
gst_structure_foreach (properties,
(GstStructureForeachFunc) set_property_foreach, tlobj);
(GstStructureForeachFunc) set_property_foreach, clip);
g_hash_table_insert (priv->timeline_objects, g_strdup (id),
gst_object_ref (tlobj));
return tlobj;
g_hash_table_insert (priv->clips, g_strdup (id), gst_object_ref (clip));
return clip;
}
static void
_add_track_object (GESFormatter * self, GESTimelineObject * tlobj,
_add_track_object (GESFormatter * self, GESClip * clip,
GESTrackObject * tckobj, const gchar * track_id,
GstStructure * children_properties, GstStructure * properties)
{
@ -453,9 +450,9 @@ _add_track_object (GESFormatter * self, GESTimelineObject * tlobj,
}
GST_DEBUG_OBJECT (self, "Adding track_object: %" GST_PTR_FORMAT
" To : %" GST_PTR_FORMAT, tckobj, tlobj);
" To : %" GST_PTR_FORMAT, tckobj, clip);
ges_timeline_object_add_track_object (tlobj, tckobj);
ges_clip_add_track_object (clip, tckobj);
ges_track_add_object (track, tckobj);
gst_structure_foreach (children_properties,
(GstStructureForeachFunc) _set_child_property, tckobj);
@ -475,16 +472,15 @@ _free_pending_effect (PendingEffects * pend)
}
static void
_free_pending_timeline_object (GESBaseXmlFormatterPrivate * priv,
PendingTimelineObject * pend)
_free_pending_clip (GESBaseXmlFormatterPrivate * priv, PendingClip * pend)
{
g_free (pend->id);
gst_object_unref (pend->layer);
if (pend->properties)
gst_structure_free (pend->properties);
g_list_free_full (pend->effects, (GDestroyNotify) _free_pending_effect);
g_hash_table_remove (priv->tlobjid_pendings, pend->id);
g_slice_free (PendingTimelineObject, pend);
g_hash_table_remove (priv->clipid_pendings, pend->id);
g_slice_free (PendingClip, pend);
}
static void
@ -529,26 +525,25 @@ new_asset_cb (GESAsset * source, GAsyncResult * res, PendingAsset * passet)
"- Error: %s", g_type_name (G_OBJECT_TYPE (source)), id,
error->message);
pendings = g_hash_table_lookup (priv->assetid_pendingtlobjs, id);
pendings = g_hash_table_lookup (priv->assetid_pendingclips, id);
for (tmp = pendings; tmp; tmp = tmp->next)
_free_pending_timeline_object (priv,
(PendingTimelineObject *) tmp->data);
_free_pending_clip (priv, (PendingClip *) tmp->data);
_free_pending_asset (priv, passet);
goto done;
}
/* We got a possible ID replacement for that asset, create it, and
* make sure the assetid_pendingtlobjs will use it */
* make sure the assetid_pendingclips will use it */
ges_asset_request_async (ges_asset_get_extractable_type (source),
possible_id, NULL, (GAsyncReadyCallback) new_asset_cb, passet);
ges_project_add_loading_asset (GES_FORMATTER (self)->project,
ges_asset_get_extractable_type (source), possible_id);
pendings = g_hash_table_lookup (priv->assetid_pendingtlobjs, id);
pendings = g_hash_table_lookup (priv->assetid_pendingclips, id);
if (pendings) {
g_hash_table_remove (priv->assetid_pendingtlobjs, id);
g_hash_table_insert (priv->assetid_pendingtlobjs,
g_hash_table_remove (priv->assetid_pendingclips, id);
g_hash_table_insert (priv->assetid_pendingclips,
g_strdup (possible_id), pendings);
/* pendings should no be freed */
@ -557,21 +552,21 @@ new_asset_cb (GESAsset * source, GAsyncResult * res, PendingAsset * passet)
goto done;
}
/* now that we have the GESAsset, we create the GESTimelineObjects */
pendings = g_hash_table_lookup (priv->assetid_pendingtlobjs, id);
/* now that we have the GESAsset, we create the GESClips */
pendings = g_hash_table_lookup (priv->assetid_pendingclips, id);
GST_DEBUG_OBJECT (self, "Asset created with ID %s, now creating pending "
" TimelineObjects, nb pendings: %i", id, g_list_length (pendings));
" Clips, nb pendings: %i", id, g_list_length (pendings));
for (tmp = pendings; tmp; tmp = tmp->next) {
GList *tmpeffect;
GESTimelineObject *tlobj;
PendingTimelineObject *pend = (PendingTimelineObject *) tmp->data;
GESClip *clip;
PendingClip *pend = (PendingClip *) tmp->data;
tlobj =
clip =
_add_object_to_layer (priv, pend->id, pend->layer, asset,
pend->start, pend->inpoint, pend->duration, pend->rate,
pend->track_types, pend->metadatas, pend->properties);
if (tlobj == NULL)
if (clip == NULL)
continue;
GST_DEBUG_OBJECT (self, "Adding %i effect to new object",
@ -580,10 +575,10 @@ new_asset_cb (GESAsset * source, GAsyncResult * res, PendingAsset * passet)
PendingEffects *peffect = (PendingEffects *) tmpeffect->data;
/* We keep a ref as _free_pending_effect unrefs it */
_add_track_object (self, tlobj, gst_object_ref (peffect->tckobj),
_add_track_object (self, clip, gst_object_ref (peffect->tckobj),
peffect->track_id, peffect->children_properties, peffect->properties);
}
_free_pending_timeline_object (priv, pend);
_free_pending_clip (priv, pend);
}
/* And now add to the project */
@ -599,11 +594,11 @@ done:
g_free (possible_id);
if (pendings) {
g_hash_table_remove (priv->assetid_pendingtlobjs, id);
g_hash_table_remove (priv->assetid_pendingclips, id);
g_list_free (pendings);
}
if (g_hash_table_size (priv->assetid_pendingtlobjs) == 0 &&
if (g_hash_table_size (priv->assetid_pendingclips) == 0 &&
priv->pending_assets == NULL)
_loading_done (self);
}
@ -678,14 +673,14 @@ ges_base_xml_formatter_add_asset (GESBaseXmlFormatter * self,
}
void
ges_base_xml_formatter_add_timeline_object (GESBaseXmlFormatter * self,
ges_base_xml_formatter_add_clip (GESBaseXmlFormatter * self,
const gchar * id, const char *asset_id, GType type, GstClockTime start,
GstClockTime inpoint, GstClockTime duration, gdouble rate,
guint layer_prio, GESTrackType track_types, GstStructure * properties,
const gchar * metadatas, GError ** error)
{
GESAsset *asset;
GESTimelineObject *nobj;
GESClip *nobj;
LayerEntry *entry;
GESBaseXmlFormatterPrivate *priv = _GET_PRIV (self);
@ -695,7 +690,7 @@ ges_base_xml_formatter_add_timeline_object (GESBaseXmlFormatter * self,
entry = g_hash_table_lookup (priv->layers, GINT_TO_POINTER (layer_prio));
if (entry == NULL) {
g_set_error (error, GES_ERROR_DOMAIN, 0,
"We got a TimelineObject in a layer"
"We got a Clip in a layer"
" that does not exist, something is wrong either in the project file or"
" in %s", g_type_name (G_OBJECT_TYPE (self)));
}
@ -708,7 +703,7 @@ ges_base_xml_formatter_add_timeline_object (GESBaseXmlFormatter * self,
asset = ges_asset_request (type, asset_id, NULL);
if (asset == NULL) {
gchar *real_id;
PendingTimelineObject *ptlobj;
PendingClip *pclip;
GList *pendings;
real_id = ges_extractable_type_check_id (type, asset_id, error);
@ -722,27 +717,27 @@ ges_base_xml_formatter_add_timeline_object (GESBaseXmlFormatter * self,
return;
}
pendings = g_hash_table_lookup (priv->assetid_pendingtlobjs, asset_id);
pendings = g_hash_table_lookup (priv->assetid_pendingclips, asset_id);
ptlobj = g_slice_new0 (PendingTimelineObject);
pclip = g_slice_new0 (PendingClip);
GST_DEBUG_OBJECT (self, "Adding pending %p for %s, currently: %i",
ptlobj, asset_id, g_list_length (pendings));
pclip, asset_id, g_list_length (pendings));
ptlobj->id = g_strdup (id);
ptlobj->rate = rate;
ptlobj->track_types = track_types;
ptlobj->duration = duration;
ptlobj->inpoint = inpoint;
ptlobj->start = start;
ptlobj->layer = gst_object_ref (entry->layer);
pclip->id = g_strdup (id);
pclip->rate = rate;
pclip->track_types = track_types;
pclip->duration = duration;
pclip->inpoint = inpoint;
pclip->start = start;
pclip->layer = gst_object_ref (entry->layer);
ptlobj->properties = properties ? gst_structure_copy (properties) : NULL;
ptlobj->metadatas = g_strdup (metadatas);
pclip->properties = properties ? gst_structure_copy (properties) : NULL;
pclip->metadatas = g_strdup (metadatas);
/* Add the new pending object to the hashtable */
g_hash_table_insert (priv->assetid_pendingtlobjs, real_id,
g_list_append (pendings, ptlobj));
g_hash_table_insert (priv->tlobjid_pendings, g_strdup (id), ptlobj);
g_hash_table_insert (priv->assetid_pendingclips, real_id,
g_list_append (pendings, pclip));
g_hash_table_insert (priv->clipid_pendings, g_strdup (id), pclip);
return;
}
@ -872,21 +867,21 @@ ges_base_xml_formatter_add_track_object (GESBaseXmlFormatter * self,
tckobj = GES_TRACK_OBJECT (ges_asset_extract (asset, NULL));
if (tckobj) {
GESTimelineObject *tlobj;
GESClip *clip;
if (metadatas)
ges_meta_container_add_metas_from_string (GES_META_CONTAINER (tckobj),
metadatas);
tlobj = g_hash_table_lookup (priv->timeline_objects, timeline_obj_id);
if (tlobj) {
_add_track_object (GES_FORMATTER (self), tlobj, tckobj, track_id,
clip = g_hash_table_lookup (priv->clips, timeline_obj_id);
if (clip) {
_add_track_object (GES_FORMATTER (self), clip, tckobj, track_id,
children_properties, properties);
} else {
PendingEffects *peffect;
PendingTimelineObject *pend = g_hash_table_lookup (priv->tlobjid_pendings,
PendingClip *pend = g_hash_table_lookup (priv->clipid_pendings,
timeline_obj_id);
if (pend == NULL) {
GST_WARNING_OBJECT (self, "No TimelineObject with id: %s can not "
GST_WARNING_OBJECT (self, "No Clip with id: %s can not "
"add TrackObject", timeline_obj_id);
goto out;
}

File diff suppressed because it is too large Load diff

View file

@ -18,8 +18,8 @@
* Boston, MA 02110-1301, USA.
*/
#ifndef _GES_TIMELINE_OBJECT
#define _GES_TIMELINE_OBJECT
#ifndef _GES_CLIP
#define _GES_CLIP
#include <glib-object.h>
#include <gst/gst.h>
@ -29,18 +29,18 @@
G_BEGIN_DECLS
#define GES_TYPE_TIMELINE_OBJECT ges_timeline_object_get_type()
#define GES_TIMELINE_OBJECT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GES_TYPE_TIMELINE_OBJECT, GESTimelineObject))
#define GES_TIMELINE_OBJECT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GES_TYPE_TIMELINE_OBJECT, GESTimelineObjectClass))
#define GES_IS_TIMELINE_OBJECT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GES_TYPE_TIMELINE_OBJECT))
#define GES_IS_TIMELINE_OBJECT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GES_TYPE_TIMELINE_OBJECT))
#define GES_TIMELINE_OBJECT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GES_TYPE_TIMELINE_OBJECT, GESTimelineObjectClass))
#define GES_TYPE_CLIP ges_clip_get_type()
#define GES_CLIP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GES_TYPE_CLIP, GESClip))
#define GES_CLIP_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GES_TYPE_CLIP, GESClipClass))
#define GES_IS_CLIP(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GES_TYPE_CLIP))
#define GES_IS_CLIP_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GES_TYPE_CLIP))
#define GES_CLIP_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GES_TYPE_CLIP, GESClipClass))
typedef struct _GESTimelineObjectPrivate GESTimelineObjectPrivate;
typedef struct _GESClipPrivate GESClipPrivate;
/**
* GESFillTrackObjectFunc:
* @object: the #GESTimelineObject controlling the track object
* @object: the #GESClip controlling the track object
* @trobject: the #GESTrackObject
* @gnlobj: the GNonLin object that needs to be filled.
*
@ -52,13 +52,13 @@ typedef struct _GESTimelineObjectPrivate GESTimelineObjectPrivate;
*
* Returns: TRUE if the implementer succesfully filled the @gnlobj, else #FALSE.
*/
typedef gboolean (*GESFillTrackObjectFunc) (GESTimelineObject *object,
typedef gboolean (*GESFillTrackObjectFunc) (GESClip *object,
GESTrackObject *trobject,
GstElement *gnlobj);
/**
* GESCreateTrackObjectFunc:
* @object: a #GESTimelineObject
* @object: a #GESClip
* @type: a #GESTrackType
*
* Creates the 'primary' track object for this @object.
@ -74,17 +74,17 @@ typedef gboolean (*GESFillTrackObjectFunc) (GESTimelineObject *object,
* that should be controlled by @object for the given @track.
*
* The returned #GESTrackObject will be automatically added to the list
* of objects controlled by the #GESTimelineObject.
* of objects controlled by the #GESClip.
*
* Returns: the #GESTrackObject to be used, or %NULL if it can't provide one
* for the given @track.
*/
typedef GESTrackObject *(*GESCreateTrackObjectFunc) (GESTimelineObject * object,
typedef GESTrackObject *(*GESCreateTrackObjectFunc) (GESClip * object,
GESTrackType type);
/**
* GESCreateTrackObjectsFunc:
* @object: a #GESTimelineObject
* @object: a #GESClip
* @type: a #GESTrackType
*
* Create all track objects this object handles for this type of track.
@ -93,30 +93,30 @@ typedef GESTrackObject *(*GESCreateTrackObjectFunc) (GESTimelineObject * object,
* return more than one #GESTrackObject(s) for a given #GESTrack.
*
* For each object created, the subclass must call
* ges_timeline_object_add_track_object() with the newly created object
* ges_clip_add_track_object() with the newly created object
* and provided @type.
*
* Returns: %TRUE on success %FALSE on failure.
*/
typedef GList * (*GESCreateTrackObjectsFunc) (GESTimelineObject * object, GESTrackType type);
typedef GList * (*GESCreateTrackObjectsFunc) (GESClip * object, GESTrackType type);
/**
* GES_TIMELINE_OBJECT_HEIGHT:
* @obj: a #GESTimelineObject
* GES_CLIP_HEIGHT:
* @obj: a #GESClip
*
* The span of priorities this object occupies.
*/
#define GES_TIMELINE_OBJECT_HEIGHT(obj) (((GESTimelineObject*)obj)->height)
#define GES_CLIP_HEIGHT(obj) (((GESClip*)obj)->height)
/**
* GESTimelineObject:
* GESClip:
* @trackobjects: (element-type GES.TrackObject): A list of TrackObject
* controlled by this TimelineObject sorted by priority. NOTE: Do not modify.
* controlled by this Clip sorted by priority. NOTE: Do not modify.
*
* The #GESTimelineObject base class.
* The #GESClip base class.
*/
struct _GESTimelineObject
struct _GESClip
{
GESTimelineElement parent;
@ -129,14 +129,14 @@ struct _GESTimelineObject
guint64 fullduration; /* Full usable duration of the object (-1: no duration) */
/*< private >*/
GESTimelineObjectPrivate *priv;
GESClipPrivate *priv;
/* Padding for API extension */
gpointer _ges_reserved[GES_PADDING_LARGE];
};
/**
* GESTimelineObjectClass:
* GESClipClass:
* @create_track_object: method to create a single #GESTrackObject for a given #GESTrack.
* @create_track_objects: method to create multiple #GESTrackObjects for a
* #GESTrack.
@ -152,7 +152,7 @@ struct _GESTimelineObject
*
* Subclasses can override the @create_track_object and @fill_track_object methods.
*/
struct _GESTimelineObjectClass
struct _GESClipClass
{
/*< private > */
GESTimelineElementClass parent_class;
@ -166,9 +166,9 @@ struct _GESTimelineObjectClass
gboolean need_fill_track;
gboolean snaps;
void (*track_object_added) (GESTimelineObject *object,
void (*track_object_added) (GESClip *object,
GESTrackObject *tck_object);
void (*track_object_released) (GESTimelineObject *object,
void (*track_object_released) (GESClip *object,
GESTrackObject *tck_object);
/*< private >*/
@ -176,42 +176,42 @@ struct _GESTimelineObjectClass
gpointer _ges_reserved[GES_PADDING_LARGE];
};
GType ges_timeline_object_get_type (void);
GType ges_clip_get_type (void);
/* Setters */
void ges_timeline_object_set_layer (GESTimelineObject *object,
void ges_clip_set_layer (GESClip *object,
GESTimelineLayer *layer);
/* TrackObject handling */
GList* ges_timeline_object_get_track_objects (GESTimelineObject *object);
GESTrackType ges_timeline_object_get_supported_formats (GESTimelineObject *object);
GESTrackObject *ges_timeline_object_create_track_object (GESTimelineObject *object, GESTrackType type);
GList * ges_timeline_object_create_track_objects (GESTimelineObject *object, GESTrackType type);
gboolean ges_timeline_object_release_track_object (GESTimelineObject *object, GESTrackObject *trackobject);
void ges_timeline_object_set_supported_formats (GESTimelineObject *object, GESTrackType supportedformats);
gboolean ges_timeline_object_add_asset (GESTimelineObject *object, GESAsset *asset);
gboolean ges_timeline_object_add_track_object (GESTimelineObject *object, GESTrackObject *trobj);
gboolean ges_timeline_object_fill_track_object (GESTimelineObject *object, GESTrackObject *trackobj, GstElement *gnlobj);
GESTrackObject *ges_timeline_object_find_track_object (GESTimelineObject *object, GESTrack *track, GType type);
GList* ges_clip_get_track_objects (GESClip *object);
GESTrackType ges_clip_get_supported_formats (GESClip *object);
GESTrackObject *ges_clip_create_track_object (GESClip *object, GESTrackType type);
GList * ges_clip_create_track_objects (GESClip *object, GESTrackType type);
gboolean ges_clip_release_track_object (GESClip *object, GESTrackObject *trackobject);
void ges_clip_set_supported_formats (GESClip *object, GESTrackType supportedformats);
gboolean ges_clip_add_asset (GESClip *object, GESAsset *asset);
gboolean ges_clip_add_track_object (GESClip *object, GESTrackObject *trobj);
gboolean ges_clip_fill_track_object (GESClip *object, GESTrackObject *trackobj, GstElement *gnlobj);
GESTrackObject *ges_clip_find_track_object (GESClip *object, GESTrack *track, GType type);
/* Layer */
GESTimelineLayer *ges_timeline_object_get_layer (GESTimelineObject *object);
gboolean ges_timeline_object_is_moving_from_layer (GESTimelineObject *object);
gboolean ges_timeline_object_move_to_layer (GESTimelineObject *object, GESTimelineLayer *layer);
void ges_timeline_object_set_moving_from_layer (GESTimelineObject *object, gboolean is_moving);
GESTimelineLayer *ges_clip_get_layer (GESClip *object);
gboolean ges_clip_is_moving_from_layer (GESClip *object);
gboolean ges_clip_move_to_layer (GESClip *object, GESTimelineLayer *layer);
void ges_clip_set_moving_from_layer (GESClip *object, gboolean is_moving);
/* Effects */
GList* ges_timeline_object_get_top_effects (GESTimelineObject *object);
gint ges_timeline_object_get_top_effect_position (GESTimelineObject *object, GESTrackEffect *effect);
gboolean ges_timeline_object_set_top_effect_priority (GESTimelineObject *object, GESTrackEffect *effect, guint newpriority);
GList* ges_clip_get_top_effects (GESClip *object);
gint ges_clip_get_top_effect_position (GESClip *object, GESTrackEffect *effect);
gboolean ges_clip_set_top_effect_priority (GESClip *object, GESTrackEffect *effect, guint newpriority);
/* Editing */
GESTimelineObject *ges_timeline_object_split (GESTimelineObject *object, guint64 position);
void ges_timeline_object_objects_set_locked (GESTimelineObject *object, gboolean locked);
GESClip *ges_clip_split (GESClip *object, guint64 position);
void ges_clip_objects_set_locked (GESClip *object, gboolean locked);
gboolean ges_timeline_object_edit (GESTimelineObject *object, GList *layers,
gboolean ges_clip_edit (GESClip *object, GList *layers,
gint new_layer_priority, GESEditMode mode,
GESEdge edge, guint64 position);
G_END_DECLS
#endif /* _GES_TIMELINE_OBJECT */
#endif /* _GES_CLIP */

View file

@ -131,11 +131,11 @@ ges_extractable_interface_init (GESExtractableInterface * iface)
}
static gboolean
ges_custom_timeline_source_fill_track_object (GESTimelineObject * object,
ges_custom_timeline_source_fill_track_object (GESClip * object,
GESTrackObject * trobject, GstElement * gnlobj);
static GESTrackObject *
ges_custom_timeline_source_create_track_object (GESTimelineObject * obj,
ges_custom_timeline_source_create_track_object (GESClip * obj,
GESTrackType type)
{
return g_object_new (GES_TYPE_TRACK_SOURCE, "track-type", type, NULL);
@ -163,12 +163,12 @@ static void
ges_custom_timeline_source_class_init (GESCustomTimelineSourceClass * klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
GESTimelineObjectClass *tlobj_class = GES_TIMELINE_OBJECT_CLASS (klass);
GESClipClass *clip_class = GES_CLIP_CLASS (klass);
g_type_class_add_private (klass, sizeof (GESCustomTimelineSourcePrivate));
tlobj_class->fill_track_object = ges_custom_timeline_source_fill_track_object;
tlobj_class->create_track_object =
clip_class->fill_track_object = ges_custom_timeline_source_fill_track_object;
clip_class->create_track_object =
ges_custom_timeline_source_create_track_object;
object_class->set_property = _set_property;
@ -202,7 +202,7 @@ ges_custom_timeline_source_init (GESCustomTimelineSource * self)
}
static gboolean
ges_custom_timeline_source_fill_track_object (GESTimelineObject * object,
ges_custom_timeline_source_fill_track_object (GESClip * object,
GESTrackObject * trobject, GstElement * gnlobj)
{
gboolean res;

View file

@ -48,7 +48,7 @@ typedef struct _GESCustomTimelineSourcePrivate GESCustomTimelineSourcePrivate;
/**
* GESFillTrackObjectUserFunc:
* @object: the #GESTimelineObject controlling the track object
* @object: the #GESClip controlling the track object
* @trobject: the #GESTrackObject
* @gnlobj: the GNonLin object that needs to be filled.
* @user_data: the gpointer to optional user data
@ -61,7 +61,7 @@ typedef struct _GESCustomTimelineSourcePrivate GESCustomTimelineSourcePrivate;
*
* Returns: TRUE if the implementer succesfully filled the @gnlobj, else #FALSE.
*/
typedef gboolean (*GESFillTrackObjectUserFunc) (GESTimelineObject * object,
typedef gboolean (*GESFillTrackObjectUserFunc) (GESClip * object,
GESTrackObject * trobject,
GstElement * gnlobj,
gpointer user_data);

View file

@ -158,7 +158,7 @@ G_GNUC_INTERNAL void ges_project_add_loading_asset (GESProject *p
/* FIXME GESBaseXmlFormatter is all internal for now, the API is not stable
* fo now, so do not expose it */
G_GNUC_INTERNAL void ges_base_xml_formatter_add_timeline_object (GESBaseXmlFormatter * self,
G_GNUC_INTERNAL void ges_base_xml_formatter_add_clip (GESBaseXmlFormatter * self,
const gchar *id,
const char *asset_id,
GType type,

View file

@ -14,8 +14,7 @@ static GQuark ges_meta_key;
G_DEFINE_INTERFACE_WITH_CODE (GESMetaContainer, ges_meta_container,
G_TYPE_OBJECT, ges_meta_key =
g_quark_from_static_string ("ges-meta-container-data");
);
g_quark_from_static_string ("ges-meta-container-data"););
enum
{

View file

@ -49,7 +49,7 @@ GST_DEBUG_CATEGORY_STATIC (ges_pitivi_formatter_debug);
typedef struct SrcMapping
{
gchar *id;
GESTimelineObject *obj;
GESClip *obj;
guint priority;
GList *tck_obj_ids;
} SrcMapping;
@ -73,7 +73,7 @@ struct _GESPitiviFormatterPrivate
GHashTable *track_objects_table;
/* {factory-ref: [track-object-ref-id,...]} */
GHashTable *timeline_objects_table;
GHashTable *clips_table;
/* {layerPriority: layer} */
GHashTable *layers_table;
@ -82,7 +82,7 @@ struct _GESPitiviFormatterPrivate
GESTrack *tracka, *trackv;
/* List the TimelineObject that haven't been loaded yet */
/* List the Clip that haven't been loaded yet */
GList *sources_to_load;
/* Saving context */
@ -158,7 +158,7 @@ save_track_objects (xmlTextWriterPtr writer, GList * source_list,
GST_DEBUG ("Saving track objects");
for (tmp = source_list; tmp; tmp = tmp->next) {
SrcMapping *srcmap;
GESTimelineObject *object;
GESClip *object;
guint i, j;
guint64 inpoint, duration, start;
@ -166,7 +166,7 @@ save_track_objects (xmlTextWriterPtr writer, GList * source_list,
object = srcmap->obj;
/* Save track associated objects */
tck_objs = ges_timeline_object_get_track_objects (object);
tck_objs = ges_clip_get_track_objects (object);
for (tmp_tck = tck_objs; tmp_tck; tmp_tck = tmp_tck->next) {
xmlChar *cast;
GESTrackObject *tckobj = GES_TRACK_OBJECT (tmp_tck->data);
@ -347,7 +347,7 @@ static GList *
save_sources (GESPitiviFormatter * formatter, GList * layers,
xmlTextWriterPtr writer)
{
GList *tlobjects, *tmp, *tmplayer;
GList *clipects, *tmp, *tmplayer;
GESTimelineLayer *layer;
GESPitiviFormatterPrivate *priv = formatter->priv;
@ -361,37 +361,38 @@ save_sources (GESPitiviFormatter * formatter, GList * layers,
for (tmplayer = layers; tmplayer; tmplayer = tmplayer->next) {
layer = GES_TIMELINE_LAYER (tmplayer->data);
tlobjects = ges_timeline_layer_get_objects (layer);
for (tmp = tlobjects; tmp; tmp = tmp->next) {
clipects = ges_timeline_layer_get_objects (layer);
for (tmp = clipects; tmp; tmp = tmp->next) {
SrcMapping *srcmap = g_slice_new0 (SrcMapping);
GESTimelineObject *tlobj;
gchar *tfs_uri;
tlobj = tmp->data;
GESClip *clip;
gchar *uriclip_uri;
clip = tmp->data;
if (GES_IS_TIMELINE_FILE_SOURCE (tlobj)) {
if (GES_IS_TIMELINE_FILE_SOURCE (clip)) {
tfs_uri = (gchar *) ges_timeline_filesource_get_uri
(GES_TIMELINE_FILE_SOURCE (tlobj));
uriclip_uri = (gchar *) ges_timeline_filesource_get_uri
(GES_TIMELINE_FILE_SOURCE (clip));
if (!g_hash_table_lookup (priv->saving_source_table, tfs_uri)) {
if (!g_hash_table_lookup (priv->saving_source_table, uriclip_uri)) {
gchar *strid = g_strdup_printf ("%i", priv->nb_sources);
g_hash_table_insert (priv->saving_source_table, g_strdup (tfs_uri),
strid);
write_source (tfs_uri, strid, writer);
g_hash_table_insert (priv->saving_source_table,
g_strdup (uriclip_uri), strid);
write_source (uriclip_uri, strid, writer);
priv->nb_sources++;
}
srcmap->id =
g_strdup (g_hash_table_lookup (priv->saving_source_table, tfs_uri));
srcmap->obj = g_object_ref (tlobj);
g_strdup (g_hash_table_lookup (priv->saving_source_table,
uriclip_uri));
srcmap->obj = g_object_ref (clip);
srcmap->priority = ges_timeline_layer_get_priority (layer);
/* We fill up the tck_obj_ids in save_track_objects */
source_list = g_list_append (source_list, srcmap);
}
}
g_list_foreach (tlobjects, (GFunc) g_object_unref, NULL);
g_list_free (tlobjects);
g_list_foreach (clipects, (GFunc) g_object_unref, NULL);
g_list_free (clipects);
g_object_unref (G_OBJECT (layer));
}
@ -399,11 +400,11 @@ save_sources (GESPitiviFormatter * formatter, GList * layers,
}
static void
save_timeline_objects (xmlTextWriterPtr writer, GList * list)
save_clips (xmlTextWriterPtr writer, GList * list)
{
GList *tmp, *tck_obj_ids;
xmlTextWriterStartElement (writer, BAD_CAST "timeline-objects");
xmlTextWriterStartElement (writer, BAD_CAST "clips");
GST_DEBUG ("Saving timeline objects");
@ -411,7 +412,7 @@ save_timeline_objects (xmlTextWriterPtr writer, GList * list)
SrcMapping *srcmap = (SrcMapping *) tmp->data;
xmlTextWriterStartElement (writer, BAD_CAST "timeline-object");
xmlTextWriterStartElement (writer, BAD_CAST "clip");
xmlTextWriterStartElement (writer, BAD_CAST "factory-ref");
xmlTextWriterWriteAttribute (writer, BAD_CAST "id", BAD_CAST srcmap->id);
xmlTextWriterEndElement (writer);
@ -455,7 +456,7 @@ save_pitivi_timeline_to_uri (GESFormatter * formatter,
xmlTextWriterEndElement (writer);
save_tracks (timeline, writer, list);
save_timeline_objects (writer, list);
save_clips (writer, list);
xmlTextWriterEndDocument (writer);
xmlFreeTextWriter (writer);
@ -669,20 +670,20 @@ parse_track_objects (GESFormatter * self)
}
static gboolean
parse_timeline_objects (GESFormatter * self)
parse_clips (GESFormatter * self)
{
int size, j;
xmlNodeSetPtr nodes;
xmlXPathObjectPtr xpathObj;
xmlNodePtr tlobj_nd, tmp_nd, tmp_nd2;
xmlNodePtr clip_nd, tmp_nd, tmp_nd2;
xmlChar *tckobjrefId, *facrefId = NULL;
GList *reflist = NULL;
GESPitiviFormatterPrivate *priv = GES_PITIVI_FORMATTER (self)->priv;
GHashTable *tlobjs_table = priv->timeline_objects_table;
GHashTable *clips_table = priv->clips_table;
xpathObj = xmlXPathEvalExpression ((const xmlChar *)
"/pitivi/timeline/timeline-objects/timeline-object", priv->xpathCtx);
"/pitivi/timeline/clips/clip", priv->xpathCtx);
if (xpathObj == NULL) {
xmlXPathFreeObject (xpathObj);
@ -693,9 +694,9 @@ parse_timeline_objects (GESFormatter * self)
size = (nodes) ? nodes->nodeNr : 0;
for (j = 0; j < size; j++) {
tlobj_nd = nodes->nodeTab[j];
clip_nd = nodes->nodeTab[j];
for (tmp_nd = tlobj_nd->children; tmp_nd; tmp_nd = tmp_nd->next) {
for (tmp_nd = clip_nd->children; tmp_nd; tmp_nd = tmp_nd->next) {
/* We assume that factory-ref is always before the tckobjs-ref */
if (!xmlStrcmp (tmp_nd->name, (xmlChar *) "factory-ref")) {
facrefId = xmlGetProp (tmp_nd, (xmlChar *) "id");
@ -705,12 +706,12 @@ parse_timeline_objects (GESFormatter * self)
for (tmp_nd2 = tmp_nd->children; tmp_nd2; tmp_nd2 = tmp_nd2->next) {
if (!xmlStrcmp (tmp_nd2->name, (xmlChar *) "track-object-ref")) {
/* We add the track object ref ID to the list of the current
* TimelineObject tracks, this way we can merge 2
* TimelineObject-s into 1 when we have unlinked TrackObject-s */
reflist = g_hash_table_lookup (tlobjs_table, facrefId);
* Clip tracks, this way we can merge 2
* Clip-s into 1 when we have unlinked TrackObject-s */
reflist = g_hash_table_lookup (clips_table, facrefId);
tckobjrefId = xmlGetProp (tmp_nd2, (xmlChar *) "id");
reflist = g_list_append (reflist, g_strdup ((gchar *) tckobjrefId));
g_hash_table_insert (tlobjs_table, g_strdup ((gchar *) facrefId),
g_hash_table_insert (clips_table, g_strdup ((gchar *) facrefId),
reflist);
xmlFree (tckobjrefId);
@ -744,7 +745,7 @@ set_properties (GObject * obj, GHashTable * props_table)
}
static void
track_object_added_cb (GESTimelineObject * object,
track_object_added_cb (GESClip * object,
GESTrackObject * track_object, GHashTable * props_table)
{
gchar *media_type = NULL, *lockedstr;
@ -755,7 +756,7 @@ track_object_added_cb (GESTimelineObject * object,
gint type = 0;
GESPitiviFormatter *formatter;
tck_objs = ges_timeline_object_get_track_objects (object);
tck_objs = ges_clip_get_track_objects (object);
media_type = (gchar *) g_hash_table_lookup (props_table, "media_type");
lockedstr = (gchar *) g_hash_table_lookup (props_table, "locked");
@ -802,7 +803,7 @@ track_object_added_cb (GESTimelineObject * object,
|| (!g_strcmp0 (media_type, "pitivi.stream.AudioStream")
&& track->type == GES_TRACK_TYPE_AUDIO)) {
/* We unlock the track objects so we do not move the whole TimelineObject */
/* We unlock the track objects so we do not move the whole Clip */
ges_track_object_set_locked (tmp->data, FALSE);
set_properties (G_OBJECT (tmp->data), props_table);
@ -815,7 +816,7 @@ track_object_added_cb (GESTimelineObject * object,
}
if (has_effect) {
tck_objs = ges_timeline_object_get_track_objects (object);
tck_objs = ges_clip_get_track_objects (object);
/* FIXME make sure this is the way we want to handle that
* ie: set duration and start as the other trackobject
@ -827,7 +828,7 @@ track_object_added_cb (GESTimelineObject * object,
if (GES_IS_TRACK_PARSE_LAUNCH_EFFECT (tmp->data)
&& (type == track->type)) {
/* We lock the track objects so we do not move the whole TimelineObject */
/* We lock the track objects so we do not move the whole Clip */
ges_track_object_set_locked (tmp->data, FALSE);
g_object_set (tmp->data, "start", start, "duration", duration, NULL);
if (locked)
@ -898,11 +899,9 @@ make_source (GESFormatter * self, GList * reflist, GHashTable * source_table)
/* If we only have audio or only video in the previous source,
* set it has such */
if (a_avail) {
ges_timeline_object_set_supported_formats (GES_TIMELINE_OBJECT (src),
GES_TRACK_TYPE_VIDEO);
ges_clip_set_supported_formats (GES_CLIP (src), GES_TRACK_TYPE_VIDEO);
} else if (v_avail) {
ges_timeline_object_set_supported_formats (GES_TIMELINE_OBJECT (src),
GES_TRACK_TYPE_AUDIO);
ges_clip_set_supported_formats (GES_CLIP (src), GES_TRACK_TYPE_AUDIO);
}
filename = (gchar *) g_hash_table_lookup (source_table, "filename");
@ -918,7 +917,7 @@ make_source (GESFormatter * self, GList * reflist, GHashTable * source_table)
}
set_properties (G_OBJECT (src), props_table);
ges_timeline_layer_add_object (layer, GES_TIMELINE_OBJECT (src));
ges_timeline_layer_add_object (layer, GES_CLIP (src));
g_signal_connect (src, "track-object-added",
G_CALLBACK (track_object_added_cb), props_table);
@ -937,8 +936,7 @@ make_source (GESFormatter * self, GList * reflist, GHashTable * source_table)
effect_table =
g_hash_table_lookup (props_table, (gchar *) "effect_props");
ges_timeline_object_add_track_object (GES_TIMELINE_OBJECT (src),
GES_TRACK_OBJECT (effect));
ges_clip_add_track_object (GES_CLIP (src), GES_TRACK_OBJECT (effect));
if (!g_strcmp0 (active, (gchar *) "(bool)False"))
ges_track_object_set_active (GES_TRACK_OBJECT (effect), FALSE);
@ -986,28 +984,26 @@ make_source (GESFormatter * self, GList * reflist, GHashTable * source_table)
}
if (a_avail) {
ges_timeline_object_set_supported_formats (GES_TIMELINE_OBJECT (src),
GES_TRACK_TYPE_VIDEO);
ges_clip_set_supported_formats (GES_CLIP (src), GES_TRACK_TYPE_VIDEO);
} else if (v_avail) {
ges_timeline_object_set_supported_formats (GES_TIMELINE_OBJECT (src),
GES_TRACK_TYPE_AUDIO);
ges_clip_set_supported_formats (GES_CLIP (src), GES_TRACK_TYPE_AUDIO);
}
}
static gboolean
make_timeline_objects (GESFormatter * self)
make_clips (GESFormatter * self)
{
GESPitiviFormatterPrivate *priv = GES_PITIVI_FORMATTER (self)->priv;
GHashTable *source_table;
GList *keys = NULL, *tmp = NULL, *reflist = NULL;
keys = g_hash_table_get_keys (priv->timeline_objects_table);
keys = g_hash_table_get_keys (priv->clips_table);
for (tmp = keys; tmp; tmp = tmp->next) {
gchar *fac_id = (gchar *) tmp->data;
reflist = g_hash_table_lookup (priv->timeline_objects_table, fac_id);
reflist = g_hash_table_lookup (priv->clips_table, fac_id);
source_table = g_hash_table_lookup (priv->sources_table, fac_id);
make_source (self, reflist, source_table);
}
@ -1057,7 +1053,7 @@ load_pitivi_file_from_uri (GESFormatter * self,
list_sources (self);
if (!parse_timeline_objects (self)) {
if (!parse_clips (self)) {
GST_ERROR ("Couldn't find timeline objects markup in the xptv file");
return FALSE;
}
@ -1072,12 +1068,11 @@ load_pitivi_file_from_uri (GESFormatter * self,
/* If there are no timeline objects to load we should emit
* 'project-loaded' signal.
*/
if (!g_hash_table_size (priv->timeline_objects_table) &&
GES_FORMATTER (self)->project) {
if (!g_hash_table_size (priv->clips_table) && GES_FORMATTER (self)->project) {
ges_project_set_loaded (GES_FORMATTER (self)->project,
GES_FORMATTER (self));
} else {
if (!make_timeline_objects (self)) {
if (!make_clips (self)) {
GST_ERROR ("Couldn't deserialise the project properly");
return FALSE;
}
@ -1101,8 +1096,8 @@ ges_pitivi_formatter_finalize (GObject * object)
g_hash_table_destroy (priv->saving_source_table);
g_list_free (priv->sources_to_load);
if (priv->timeline_objects_table != NULL) {
g_hash_table_foreach (priv->timeline_objects_table,
if (priv->clips_table != NULL) {
g_hash_table_foreach (priv->clips_table,
(GHFunc) list_table_destroyer, NULL);
}
@ -1153,7 +1148,7 @@ ges_pitivi_formatter_init (GESPitiviFormatter * self)
g_hash_table_new_full (g_str_hash, g_str_equal, g_free,
(GDestroyNotify) g_hash_table_destroy);
priv->timeline_objects_table =
priv->clips_table =
g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL);
priv->layers_table =

View file

@ -22,8 +22,8 @@
* SECTION:ges-simple-timeline-layer
* @short_description: High-level GESTimelineLayer
*
* #GESSimpleTimelineLayer allows using #GESTimelineObject(s) with a list-like
* API. Clients can add any type of GESTimelineObject to a
* #GESSimpleTimelineLayer allows using #GESClip(s) with a list-like
* API. Clients can add any type of GESClip to a
* GESSimpleTimelineLayer, and the layer will automatically compute the
* appropriate start times.
*
@ -38,14 +38,14 @@
static void
ges_simple_timeline_layer_object_removed (GESTimelineLayer * layer,
GESTimelineObject * object);
GESClip * object);
static void
ges_simple_timeline_layer_object_added (GESTimelineLayer * layer,
GESTimelineObject * object);
GESClip * object);
static void
timeline_object_height_changed_cb (GESTimelineObject * object G_GNUC_UNUSED,
clip_height_changed_cb (GESClip * object G_GNUC_UNUSED,
GParamSpec * arg G_GNUC_UNUSED, GESSimpleTimelineLayer * layer);
static GList *get_objects (GESTimelineLayer * layer);
@ -133,7 +133,7 @@ ges_simple_timeline_layer_class_init (GESSimpleTimelineLayerClass * klass)
/**
* GESSimpleTimelineLayer::object-moved:
* @layer: the #GESSimpleTimelineLayer
* @object: the #GESTimelineObject that was added
* @object: the #GESClip that was added
* @old: the previous position of the object
* @new: the new position of the object
*
@ -145,7 +145,7 @@ ges_simple_timeline_layer_class_init (GESSimpleTimelineLayerClass * klass)
G_SIGNAL_RUN_FIRST, G_STRUCT_OFFSET (GESSimpleTimelineLayerClass,
object_moved),
NULL, NULL, g_cclosure_marshal_generic, G_TYPE_NONE, 3,
GES_TYPE_TIMELINE_OBJECT, G_TYPE_INT, G_TYPE_INT);
GES_TYPE_CLIP, G_TYPE_INT, G_TYPE_INT);
}
static void
@ -165,8 +165,8 @@ gstl_recalculate (GESSimpleTimelineLayer * self)
gint priority = 0;
gint transition_priority = 0;
gint height;
GESTimelineObject *prev_object = NULL;
GESTimelineObject *prev_transition = NULL;
GESClip *prev_object = NULL;
GESClip *prev_transition = NULL;
gboolean valid = TRUE;
GESSimpleTimelineLayerPrivate *priv = self->priv;
@ -179,13 +179,13 @@ gstl_recalculate (GESSimpleTimelineLayer * self)
}
for (tmp = priv->objects; tmp; tmp = tmp->next) {
GESTimelineObject *obj;
GESClip *obj;
guint64 dur;
GList *l_next;
obj = (GESTimelineObject *) tmp->data;
obj = (GESClip *) tmp->data;
dur = _DURATION (obj);
height = GES_TIMELINE_OBJECT_HEIGHT (obj);
height = GES_CLIP_HEIGHT (obj);
if (GES_IS_TIMELINE_SOURCE (obj)) {
@ -279,7 +279,7 @@ gstl_recalculate (GESSimpleTimelineLayer * self)
/**
* ges_simple_timeline_layer_add_object:
* @layer: a #GESSimpleTimelineLayer
* @object: the #GESTimelineObject to add
* @object: the #GESClip to add
* @position: the position at which to add the object
*
* Adds the object at the given position in the layer. The position is where
@ -297,7 +297,7 @@ gstl_recalculate (GESSimpleTimelineLayer * self)
*/
gboolean
ges_simple_timeline_layer_add_object (GESSimpleTimelineLayer * layer,
GESTimelineObject * object, gint position)
GESClip * object, gint position)
{
gboolean res;
GList *nth;
@ -310,8 +310,8 @@ ges_simple_timeline_layer_add_object (GESSimpleTimelineLayer * layer,
if (GES_IS_TIMELINE_TRANSITION (object)) {
GList *lprev = g_list_previous (nth);
GESTimelineObject *prev = GES_TIMELINE_OBJECT (lprev ? lprev->data : NULL);
GESTimelineObject *next = GES_TIMELINE_OBJECT (nth ? nth->data : NULL);
GESClip *prev = GES_CLIP (lprev ? lprev->data : NULL);
GESClip *next = GES_CLIP (nth ? nth->data : NULL);
if ((prev && GES_IS_TIMELINE_TRANSITION (prev)) ||
(next && GES_IS_TIMELINE_TRANSITION (next))) {
@ -343,7 +343,7 @@ ges_simple_timeline_layer_add_object (GESSimpleTimelineLayer * layer,
g_signal_connect (G_OBJECT (object), "notify::height", G_CALLBACK
(timeline_object_height_changed_cb), layer);
(clip_height_changed_cb), layer);
/* recalculate positions */
gstl_recalculate (layer);
@ -358,11 +358,11 @@ ges_simple_timeline_layer_add_object (GESSimpleTimelineLayer * layer,
*
* Gets the timeline object at the given position.
*
* Returns: (transfer none): The #GESTimelineObject at the given position or NULL if
* Returns: (transfer none): The #GESClip at the given position or NULL if
* the position is off the end of the layer.
*/
GESTimelineObject *
GESClip *
ges_simple_timeline_layer_nth (GESSimpleTimelineLayer * layer, gint position)
{
GList *list;
@ -371,7 +371,7 @@ ges_simple_timeline_layer_nth (GESSimpleTimelineLayer * layer, gint position)
list = g_list_nth (priv->objects, position);
if (list)
return GES_TIMELINE_OBJECT (list->data);
return GES_CLIP (list->data);
return NULL;
}
@ -379,7 +379,7 @@ ges_simple_timeline_layer_nth (GESSimpleTimelineLayer * layer, gint position)
/**
* ges_simple_timeline_layer_index:
* @layer: a #GESSimpleTimelineLayer
* @object: a #GESTimelineObject in the layer
* @object: a #GESClip in the layer
*
* Gets the position of the given object within the given layer.
*
@ -389,7 +389,7 @@ ges_simple_timeline_layer_nth (GESSimpleTimelineLayer * layer, gint position)
gint
ges_simple_timeline_layer_index (GESSimpleTimelineLayer * layer,
GESTimelineObject * object)
GESClip * object)
{
GESSimpleTimelineLayerPrivate *priv = layer->priv;
return g_list_index (priv->objects, object);
@ -398,7 +398,7 @@ ges_simple_timeline_layer_index (GESSimpleTimelineLayer * layer,
/**
* ges_simple_timeline_layer_move_object:
* @layer: a #GESSimpleTimelineLayer
* @object: the #GESTimelineObject to move
* @object: the #GESClip to move
* @newposition: the new position at which to move the object
*
* Moves the object to the given position in the layer. To put the object before
@ -410,28 +410,28 @@ ges_simple_timeline_layer_index (GESSimpleTimelineLayer * layer,
gboolean
ges_simple_timeline_layer_move_object (GESSimpleTimelineLayer * layer,
GESTimelineObject * object, gint newposition)
GESClip * object, gint newposition)
{
gint idx;
GESSimpleTimelineLayerPrivate *priv = layer->priv;
GESTimelineLayer *tl_obj_layer;
GESTimelineLayer *clip_layer;
GST_DEBUG ("layer:%p, object:%p, newposition:%d", layer, object, newposition);
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);
clip_layer = ges_clip_get_layer (object);
if (G_UNLIKELY (clip_layer != (GESTimelineLayer *) layer)) {
GST_WARNING ("Clip doesn't belong to this layer");
if (clip_layer != NULL)
g_object_unref (clip_layer);
return FALSE;
}
if (tl_obj_layer != NULL)
g_object_unref (tl_obj_layer);
if (clip_layer != NULL)
g_object_unref (clip_layer);
/* Find it's current position */
idx = g_list_index (priv->objects, object);
if (G_UNLIKELY (idx == -1)) {
GST_WARNING ("TimelineObject not controlled by this layer");
GST_WARNING ("Clip not controlled by this layer");
return FALSE;
}
@ -488,7 +488,7 @@ ges_simple_timeline_layer_is_valid (GESSimpleTimelineLayer * layer)
static void
ges_simple_timeline_layer_object_removed (GESTimelineLayer * layer,
GESTimelineObject * object)
GESClip * object)
{
GESSimpleTimelineLayer *sl = (GESSimpleTimelineLayer *) layer;
@ -499,7 +499,7 @@ ges_simple_timeline_layer_object_removed (GESTimelineLayer * layer,
static void
ges_simple_timeline_layer_object_added (GESTimelineLayer * layer,
GESTimelineObject * object)
GESClip * object)
{
GESSimpleTimelineLayer *sl = (GESSimpleTimelineLayer *) layer;
@ -513,7 +513,7 @@ ges_simple_timeline_layer_object_added (GESTimelineLayer * layer,
}
static void
timeline_object_height_changed_cb (GESTimelineObject * object,
clip_height_changed_cb (GESClip * object,
GParamSpec * arg G_GNUC_UNUSED, GESSimpleTimelineLayer * layer)
{
GST_LOG ("layer %p: notify height changed %p", layer, object);

View file

@ -65,7 +65,7 @@ struct _GESSimpleTimelineLayerClass {
GESTimelineLayerClass parent_class;
/*< signals >*/
void (*object_moved) (GESTimelineLayer * layer, GESTimelineObject * object,
void (*object_moved) (GESTimelineLayer * layer, GESClip * object,
gint old_position, gint new_position);
/* Padding for API extension */
@ -78,22 +78,22 @@ GESSimpleTimelineLayer* ges_simple_timeline_layer_new (void);
gboolean
ges_simple_timeline_layer_add_object (GESSimpleTimelineLayer *layer,
GESTimelineObject *object, gint position);
GESClip *object, gint position);
gboolean
ges_simple_timeline_layer_move_object (GESSimpleTimelineLayer *layer,
GESTimelineObject *object, gint newposition);
GESClip *object, gint newposition);
gboolean
ges_simple_timeline_layer_is_valid (GESSimpleTimelineLayer *layer);
GESTimelineObject *
GESClip *
ges_simple_timeline_layer_nth (GESSimpleTimelineLayer *layer,
gint position);
gint
ges_simple_timeline_layer_index (GESSimpleTimelineLayer *layer,
GESTimelineObject *object);
GESClip *object);
G_END_DECLS

View file

@ -65,10 +65,10 @@ enum
};
static GList *ges_timeline_filesource_create_track_objects (GESTimelineObject *
static GList *ges_timeline_filesource_create_track_objects (GESClip *
obj, GESTrackType type);
static GESTrackObject
* ges_timeline_filesource_create_track_object (GESTimelineObject * obj,
* ges_timeline_filesource_create_track_object (GESClip * obj,
GESTrackType type);
void ges_timeline_filesource_set_uri (GESTimelineFileSource * self,
gchar * uri);
@ -95,8 +95,7 @@ ges_timeline_filesource_get_property (GObject * object, guint property_id,
break;
case PROP_SUPPORTED_FORMATS:
g_value_set_flags (value,
ges_timeline_object_get_supported_formats (GES_TIMELINE_OBJECT
(object)));
ges_clip_get_supported_formats (GES_CLIP (object)));
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
@ -107,20 +106,21 @@ static void
ges_timeline_filesource_set_property (GObject * object, guint property_id,
const GValue * value, GParamSpec * pspec)
{
GESTimelineFileSource *tfs = GES_TIMELINE_FILE_SOURCE (object);
GESTimelineFileSource *uriclip = GES_TIMELINE_FILE_SOURCE (object);
switch (property_id) {
case PROP_URI:
ges_timeline_filesource_set_uri (tfs, g_value_dup_string (value));
ges_timeline_filesource_set_uri (uriclip, g_value_dup_string (value));
break;
case PROP_MUTE:
ges_timeline_filesource_set_mute (tfs, g_value_get_boolean (value));
ges_timeline_filesource_set_mute (uriclip, g_value_get_boolean (value));
break;
case PROP_IS_IMAGE:
ges_timeline_filesource_set_is_image (tfs, g_value_get_boolean (value));
ges_timeline_filesource_set_is_image (uriclip,
g_value_get_boolean (value));
break;
case PROP_SUPPORTED_FORMATS:
ges_timeline_object_set_supported_formats (GES_TIMELINE_OBJECT (tfs),
ges_clip_set_supported_formats (GES_CLIP (uriclip),
g_value_get_flags (value));
break;
default:
@ -142,7 +142,7 @@ static void
ges_timeline_filesource_class_init (GESTimelineFileSourceClass * klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
GESTimelineObjectClass *timobj_class = GES_TIMELINE_OBJECT_CLASS (klass);
GESClipClass *timobj_class = GES_CLIP_CLASS (klass);
GESTimelineElementClass *element_class = GES_TIMELINE_ELEMENT_CLASS (klass);
g_type_class_add_private (klass, sizeof (GESTimelineFileSourcePrivate));
@ -231,28 +231,27 @@ extractable_get_id (GESExtractable * self)
static void
extractable_set_asset (GESExtractable * self, GESAsset * asset)
{
GESTimelineFileSource *tfs = GES_TIMELINE_FILE_SOURCE (self);
GESTimelineFileSource *uriclip = GES_TIMELINE_FILE_SOURCE (self);
GESAssetFileSource *filesource_asset = GES_ASSET_FILESOURCE (asset);
GESTimelineObject *tlobj = GES_TIMELINE_OBJECT (self);
GESClip *clip = GES_CLIP (self);
if (GST_CLOCK_TIME_IS_VALID (GES_TIMELINE_ELEMENT (tlobj)) == FALSE)
_set_duration0 (GES_TIMELINE_ELEMENT (tfs),
if (GST_CLOCK_TIME_IS_VALID (GES_TIMELINE_ELEMENT (clip)) == FALSE)
_set_duration0 (GES_TIMELINE_ELEMENT (uriclip),
ges_asset_filesource_get_duration (filesource_asset));
ges_timeline_element_set_max_duration (GES_TIMELINE_ELEMENT (tfs),
ges_timeline_element_set_max_duration (GES_TIMELINE_ELEMENT (uriclip),
ges_asset_filesource_get_duration (filesource_asset));
ges_timeline_filesource_set_is_image (tfs,
ges_timeline_filesource_set_is_image (uriclip,
ges_asset_filesource_is_image (filesource_asset));
if (ges_timeline_object_get_supported_formats (tlobj) ==
GES_TRACK_TYPE_UNKNOWN) {
if (ges_clip_get_supported_formats (clip) == GES_TRACK_TYPE_UNKNOWN) {
ges_timeline_object_set_supported_formats (tlobj,
ges_asset_timeline_object_get_supported_formats
(GES_ASSET_TIMELINE_OBJECT (filesource_asset)));
ges_clip_set_supported_formats (clip,
ges_asset_clip_get_supported_formats
(GES_ASSET_CLIP (filesource_asset)));
}
GES_TIMELINE_ELEMENT (tfs)->asset = asset;
GES_TIMELINE_ELEMENT (uriclip)->asset = asset;
}
static void
@ -287,14 +286,14 @@ void
ges_timeline_filesource_set_mute (GESTimelineFileSource * self, gboolean mute)
{
GList *tmp, *trackobjects;
GESTimelineObject *object = (GESTimelineObject *) self;
GESClip *object = (GESClip *) self;
GST_DEBUG ("self:%p, mute:%d", self, mute);
self->priv->mute = mute;
/* Go over tracked objects, and update 'active' status on all audio objects */
trackobjects = ges_timeline_object_get_track_objects (object);
trackobjects = ges_clip_get_track_objects (object);
for (tmp = trackobjects; tmp; tmp = tmp->next) {
GESTrackObject *trackobject = (GESTrackObject *) tmp->data;
@ -376,8 +375,7 @@ ges_timeline_filesource_get_uri (GESTimelineFileSource * self)
}
static GList *
ges_timeline_filesource_create_track_objects (GESTimelineObject * obj,
GESTrackType type)
ges_timeline_filesource_create_track_objects (GESClip * obj, GESTrackType type)
{
GList *res = NULL;
const GList *tmp, *stream_assets;
@ -398,8 +396,7 @@ ges_timeline_filesource_create_track_objects (GESTimelineObject * obj,
}
static GESTrackObject *
ges_timeline_filesource_create_track_object (GESTimelineObject * obj,
GESTrackType type)
ges_timeline_filesource_create_track_object (GESClip * obj, GESTrackType type)
{
GESTimelineFileSourcePrivate *priv = GES_TIMELINE_FILE_SOURCE (obj)->priv;
GESTrackObject *res;
@ -453,12 +450,12 @@ ges_timeline_filesource_new (gchar * uri)
void
ges_timeline_filesource_set_uri (GESTimelineFileSource * self, gchar * uri)
{
GESTimelineObject *tlobj = GES_TIMELINE_OBJECT (self);
GList *tckobjs = ges_timeline_object_get_track_objects (tlobj);
GESClip *clip = GES_CLIP (self);
GList *tckobjs = ges_clip_get_track_objects (clip);
if (tckobjs) {
/* FIXME handle this case properly */
GST_WARNING_OBJECT (tlobj, "Can not change uri when already"
GST_WARNING_OBJECT (clip, "Can not change uri when already"
"containing TrackObjects");
return;

View file

@ -22,11 +22,11 @@
/**
* SECTION:ges-timeline-layer
* @short_description: Non-overlapping sequence of GESTimelineObject
* @short_description: Non-overlapping sequence of GESClip
*
* Responsible for the ordering of the various contained TimelineObject(s). A
* Responsible for the ordering of the various contained Clip(s). A
* timeline layer has a "priority" property, which is used to manage the
* priorities of individual TimelineObjects. Two layers should not have the
* priorities of individual Clips. Two layers should not have the
* same priority within a given timeline.
*/
@ -46,7 +46,7 @@ G_DEFINE_TYPE_WITH_CODE (GESTimelineLayer, ges_timeline_layer,
struct _GESTimelineLayerPrivate
{
/*< private > */
GList *objects_start; /* The TimelineObjects sorted by start and
GList *objects_start; /* The Clips sorted by start and
* priority */
guint32 priority; /* The priority of the layer within the
@ -56,7 +56,7 @@ struct _GESTimelineLayerPrivate
typedef struct
{
GESTimelineObject *object;
GESClip *object;
GESTimelineLayer *layer;
} NewAssetUData;
@ -125,7 +125,7 @@ ges_timeline_layer_dispose (GObject * object)
while (priv->objects_start)
ges_timeline_layer_remove_object (layer,
(GESTimelineObject *) priv->objects_start->data);
(GESClip *) priv->objects_start->data);
G_OBJECT_CLASS (ges_timeline_layer_parent_class)->dispose (object);
}
@ -171,20 +171,19 @@ ges_timeline_layer_class_init (GESTimelineLayerClass * klass)
/**
* GESTimelineLayer::object-added:
* @layer: the #GESTimelineLayer
* @object: the #GESTimelineObject that was added.
* @object: the #GESClip that was added.
*
* Will be emitted after the object was added to the layer.
*/
ges_timeline_layer_signals[OBJECT_ADDED] =
g_signal_new ("object-added", G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_FIRST, G_STRUCT_OFFSET (GESTimelineLayerClass, object_added),
NULL, NULL, g_cclosure_marshal_generic, G_TYPE_NONE, 1,
GES_TYPE_TIMELINE_OBJECT);
NULL, NULL, g_cclosure_marshal_generic, G_TYPE_NONE, 1, GES_TYPE_CLIP);
/**
* GESTimelineLayer::object-removed:
* @layer: the #GESTimelineLayer
* @object: the #GESTimelineObject that was removed
* @object: the #GESClip that was removed
*
* Will be emitted after the object was removed from the layer.
*/
@ -192,7 +191,7 @@ ges_timeline_layer_class_init (GESTimelineLayerClass * klass)
g_signal_new ("object-removed", G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_FIRST, G_STRUCT_OFFSET (GESTimelineLayerClass,
object_removed), NULL, NULL, g_cclosure_marshal_generic, G_TYPE_NONE,
1, GES_TYPE_TIMELINE_OBJECT);
1, GES_TYPE_CLIP);
}
static void
@ -281,7 +280,7 @@ new_asset_cb (GESAsset * source, GAsyncResult * res, NewAssetUData * udata)
/**
* ges_timeline_layer_remove_object:
* @layer: a #GESTimelineLayer
* @object: the #GESTimelineObject to remove
* @object: the #GESClip to remove
*
* Removes the given @object from the @layer and unparents it.
* Unparenting it means the reference owned by @layer on the @object will be
@ -292,19 +291,18 @@ new_asset_cb (GESAsset * source, GAsyncResult * res, NewAssetUData * udata)
* not want to remove the object.
*/
gboolean
ges_timeline_layer_remove_object (GESTimelineLayer * layer,
GESTimelineObject * object)
ges_timeline_layer_remove_object (GESTimelineLayer * layer, GESClip * object)
{
GESTimelineLayer *current_layer;
g_return_val_if_fail (GES_IS_TIMELINE_LAYER (layer), FALSE);
g_return_val_if_fail (GES_IS_TIMELINE_OBJECT (object), FALSE);
g_return_val_if_fail (GES_IS_CLIP (object), FALSE);
GST_DEBUG ("layer:%p, object:%p", layer, object);
current_layer = ges_timeline_object_get_layer (object);
current_layer = ges_clip_get_layer (object);
if (G_UNLIKELY (current_layer != layer)) {
GST_WARNING ("TimelineObject doesn't belong to this layer");
GST_WARNING ("Clip doesn't belong to this layer");
if (current_layer != NULL)
g_object_unref (current_layer);
@ -317,7 +315,7 @@ ges_timeline_layer_remove_object (GESTimelineLayer * layer,
g_signal_emit (layer, ges_timeline_layer_signals[OBJECT_REMOVED], 0, object);
/* inform the object it's no longer in a layer */
ges_timeline_object_set_layer (object, NULL);
ges_clip_set_layer (object, NULL);
/* Remove it from our list of controlled objects */
layer->priv->objects_start =
@ -411,7 +409,7 @@ ges_timeline_layer_get_priority (GESTimelineLayer * layer)
*
* Get the timeline objects this layer contains.
*
* Returns: (transfer full) (element-type GESTimelineObject): a #GList of
* Returns: (transfer full) (element-type GESClip): a #GList of
* timeline objects. The user is responsible for
* unreffing the contained objects and freeing the list.
*/
@ -442,7 +440,7 @@ ges_timeline_layer_get_objects (GESTimelineLayer * layer)
* or not.
*
* Returns: %TRUE if @layer is empty, %FALSE if it already contains at least
* one #GESTimelineObject
* one #GESClip
*/
gboolean
ges_timeline_layer_is_empty (GESTimelineLayer * layer)
@ -455,7 +453,7 @@ ges_timeline_layer_is_empty (GESTimelineLayer * layer)
/**
* ges_timeline_layer_add_object:
* @layer: a #GESTimelineLayer
* @object: (transfer full): the #GESTimelineObject to add.
* @object: (transfer full): the #GESClip to add.
*
* Adds the given object to the layer. Sets the object's parent, and thus
* takes ownership of the object.
@ -471,8 +469,7 @@ ges_timeline_layer_is_empty (GESTimelineLayer * layer)
* if the @layer refuses to add the object.
*/
gboolean
ges_timeline_layer_add_object (GESTimelineLayer * layer,
GESTimelineObject * object)
ges_timeline_layer_add_object (GESTimelineLayer * layer, GESClip * object)
{
GESAsset *asset;
GESTimelineLayerPrivate *priv;
@ -480,14 +477,14 @@ ges_timeline_layer_add_object (GESTimelineLayer * layer,
guint32 maxprio, minprio, prio;
g_return_val_if_fail (GES_IS_TIMELINE_LAYER (layer), FALSE);
g_return_val_if_fail (GES_IS_TIMELINE_OBJECT (object), FALSE);
g_return_val_if_fail (GES_IS_CLIP (object), FALSE);
GST_DEBUG_OBJECT (layer, "adding object:%p", object);
priv = layer->priv;
current_layer = ges_timeline_object_get_layer (object);
current_layer = ges_clip_get_layer (object);
if (G_UNLIKELY (current_layer)) {
GST_WARNING ("TimelineObject %p already belongs to another layer", object);
GST_WARNING ("Clip %p already belongs to another layer", object);
g_object_unref (current_layer);
return FALSE;
@ -536,7 +533,7 @@ ges_timeline_layer_add_object (GESTimelineLayer * layer,
(GCompareFunc) element_start_compare);
/* Inform the object it's now in this layer */
ges_timeline_object_set_layer (object, layer);
ges_clip_set_layer (object, layer);
GST_DEBUG ("current object priority : %d, layer min/max : %d/%d",
_PRIORITY (object), layer->min_gnl_priority, layer->max_gnl_priority);
@ -568,28 +565,28 @@ ges_timeline_layer_add_object (GESTimelineLayer * layer,
* ges_timeline_layer_add_asset:
* @layer: a #GESTimelineLayer
* @asset: The asset to add to
* @start: The start value to set on the new #GESTimelineObject
* @inpoint: The inpoint value to set on the new #GESTimelineObject
* @duration: The duration value to set on the new #GESTimelineObject
* @rate: The rate value to set on the new #GESTimelineObject
* @track_types: The #GESTrackType to set on the the new #GESTimelineObject
* @start: The start value to set on the new #GESClip
* @inpoint: The inpoint value to set on the new #GESClip
* @duration: The duration value to set on the new #GESClip
* @rate: The rate value to set on the new #GESClip
* @track_types: The #GESTrackType to set on the the new #GESClip
*
* Creates TimelineObject from asset, adds it to layer and
* Creates Clip from asset, adds it to layer and
* returns a reference to it.
*
* Returns: (transfer none): Created #GESTimelineObject
* Returns: (transfer none): Created #GESClip
*/
GESTimelineObject *
GESClip *
ges_timeline_layer_add_asset (GESTimelineLayer * layer,
GESAsset * asset, GstClockTime start, GstClockTime inpoint,
GstClockTime duration, gdouble rate, GESTrackType track_types)
{
GESTimelineObject *tlobj;
GESClip *clip;
g_return_val_if_fail (GES_IS_TIMELINE_LAYER (layer), NULL);
g_return_val_if_fail (GES_IS_ASSET (asset), NULL);
g_return_val_if_fail (g_type_is_a (ges_asset_get_extractable_type
(asset), GES_TYPE_TIMELINE_OBJECT), NULL);
(asset), GES_TYPE_CLIP), NULL);
GST_DEBUG_OBJECT (layer, "Adding asset %s with: start: %" GST_TIME_FORMAT
" inpoint: %" GST_TIME_FORMAT " duration: %" GST_TIME_FORMAT " rate %f"
@ -597,23 +594,23 @@ ges_timeline_layer_add_asset (GESTimelineLayer * layer,
GST_TIME_ARGS (inpoint), GST_TIME_ARGS (duration), rate, track_types,
ges_track_type_name (track_types));
tlobj = GES_TIMELINE_OBJECT (ges_asset_extract (asset, NULL));
_set_start0 (GES_TIMELINE_ELEMENT (tlobj), start);
_set_inpoint0 (GES_TIMELINE_ELEMENT (tlobj), inpoint);
clip = GES_CLIP (ges_asset_extract (asset, NULL));
_set_start0 (GES_TIMELINE_ELEMENT (clip), start);
_set_inpoint0 (GES_TIMELINE_ELEMENT (clip), inpoint);
if (track_types != GES_TRACK_TYPE_UNKNOWN)
ges_timeline_object_set_supported_formats (tlobj, track_types);
ges_clip_set_supported_formats (clip, track_types);
if (GST_CLOCK_TIME_IS_VALID (duration)) {
_set_duration0 (GES_TIMELINE_ELEMENT (tlobj), duration);
_set_duration0 (GES_TIMELINE_ELEMENT (clip), duration);
}
if (!ges_timeline_layer_add_object (layer, tlobj)) {
gst_object_unref (tlobj);
if (!ges_timeline_layer_add_object (layer, clip)) {
gst_object_unref (clip);
return NULL;
}
return tlobj;
return clip;
}
/**

View file

@ -70,7 +70,7 @@ struct _GESTimelineLayer {
* @get_objects: method to get the objects contained in the layer
*
* Subclasses can override the @get_objects if they can provide a more
* efficient way of providing the list of contained #GESTimelineObject(s).
* efficient way of providing the list of contained #GESClip(s).
*/
struct _GESTimelineLayerClass {
/*< private >*/
@ -82,8 +82,8 @@ struct _GESTimelineLayerClass {
/*< private >*/
/* Signals */
void (*object_added) (GESTimelineLayer * layer, GESTimelineObject * object);
void (*object_removed) (GESTimelineLayer * layer, GESTimelineObject * object);
void (*object_added) (GESTimelineLayer * layer, GESClip * object);
void (*object_removed) (GESTimelineLayer * layer, GESClip * object);
/* Padding for API extension */
gpointer _ges_reserved[GES_PADDING];
@ -101,8 +101,8 @@ ges_timeline_layer_get_timeline (GESTimelineLayer * layer);
gboolean ges_timeline_layer_add_object (GESTimelineLayer * layer,
GESTimelineObject * object);
GESTimelineObject * ges_timeline_layer_add_asset (GESTimelineLayer *layer,
GESClip * object);
GESClip * ges_timeline_layer_add_asset (GESTimelineLayer *layer,
GESAsset *asset,
GstClockTime start,
GstClockTime inpoint,
@ -111,7 +111,7 @@ GESTimelineObject * ges_timeline_layer_add_asset (GESTimelineLayer *layer,
GESTrackType track_types);
gboolean ges_timeline_layer_remove_object (GESTimelineLayer * layer,
GESTimelineObject * object);
GESClip * object);
void ges_timeline_layer_set_priority (GESTimelineLayer * layer,
guint priority);

View file

@ -30,7 +30,7 @@
#include "ges-timeline-operation.h"
G_DEFINE_ABSTRACT_TYPE (GESTimelineOperation, ges_timeline_operation,
GES_TYPE_TIMELINE_OBJECT);
GES_TYPE_CLIP);
struct _GESTimelineOperationPrivate
{

View file

@ -24,7 +24,7 @@
#include <glib-object.h>
#include <gst/gst.h>
#include <ges/ges-types.h>
#include <ges/ges-timeline-object.h>
#include <ges/ges-clip.h>
G_BEGIN_DECLS
@ -54,7 +54,7 @@ typedef struct _GESTimelineOperationPrivate GESTimelineOperationPrivate;
*/
struct _GESTimelineOperation {
/*< private >*/
GESTimelineObject parent;
GESClip parent;
GESTimelineOperationPrivate *priv;
@ -67,7 +67,7 @@ struct _GESTimelineOperation {
*/
struct _GESTimelineOperationClass {
/*< private >*/
GESTimelineObjectClass parent_class;
GESClipClass parent_class;
/*< private >*/
/* Padding for API extension */

View file

@ -54,7 +54,7 @@ enum
static void ges_timeline_parse_launch_effect_finalize (GObject * object);
static GESTrackObject
* ges_tl_parse_launch_effect_create_track_obj (GESTimelineObject * self,
* ges_tl_parse_launch_effect_create_track_obj (GESClip * self,
GESTrackType type);
static void
@ -113,7 +113,7 @@ ges_timeline_parse_launch_effect_class_init (GESTimelineParseLaunchEffectClass *
klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
GESTimelineObjectClass *timobj_class = GES_TIMELINE_OBJECT_CLASS (klass);
GESClipClass *timobj_class = GES_CLIP_CLASS (klass);
g_type_class_add_private (klass,
sizeof (GESTimelineParseLaunchEffectPrivate));
@ -165,8 +165,7 @@ ges_timeline_parse_launch_effect_init (GESTimelineParseLaunchEffect * self)
}
static GESTrackObject *
ges_tl_parse_launch_effect_create_track_obj (GESTimelineObject * self,
GESTrackType type)
ges_tl_parse_launch_effect_create_track_obj (GESClip * self, GESTrackType type)
{
const gchar *bin_description = NULL;
GESTimelineParseLaunchEffect *effect =

View file

@ -374,8 +374,8 @@ ges_timeline_pipeline_change_state (GstElement * element,
ret = GST_STATE_CHANGE_FAILURE;
goto done;
}
if (self->priv->
mode & (TIMELINE_MODE_RENDER | TIMELINE_MODE_SMART_RENDER))
if (self->
priv->mode & (TIMELINE_MODE_RENDER | TIMELINE_MODE_SMART_RENDER))
GST_DEBUG ("rendering => Updating pipeline caps");
if (!ges_timeline_pipeline_update_caps (self)) {
GST_ERROR_OBJECT (element, "Error setting the caps for rendering");

View file

@ -24,7 +24,7 @@
*/
#include "ges-internal.h"
#include "ges-timeline-object.h"
#include "ges-clip.h"
#include "ges-timeline-source.h"
#include "ges-track-source.h"
@ -40,8 +40,7 @@ enum
PROP_0,
};
G_DEFINE_TYPE (GESTimelineSource, ges_timeline_source,
GES_TYPE_TIMELINE_OBJECT);
G_DEFINE_TYPE (GESTimelineSource, ges_timeline_source, GES_TYPE_CLIP);
static void
ges_timeline_source_get_property (GObject * object, guint property_id,
@ -81,7 +80,7 @@ ges_timeline_source_class_init (GESTimelineSourceClass * klass)
object_class->finalize = ges_timeline_source_finalize;
/* All subclasses should have snapping enabled */
GES_TIMELINE_OBJECT_CLASS (klass)->snaps = TRUE;
GES_CLIP_CLASS (klass)->snaps = TRUE;
}
static void

View file

@ -23,7 +23,7 @@
#include <glib-object.h>
#include <ges/ges-types.h>
#include <ges/ges-timeline-object.h>
#include <ges/ges-clip.h>
#include <ges/ges-enums.h>
G_BEGIN_DECLS
@ -54,7 +54,7 @@ typedef struct _GESTimelineSourcePrivate GESTimelineSourcePrivate;
*/
struct _GESTimelineSource {
GESTimelineObject parent;
GESClip parent;
/*< private >*/
GESTimelineSourcePrivate *priv;
@ -69,7 +69,7 @@ struct _GESTimelineSource {
struct _GESTimelineSourceClass {
/*< private >*/
GESTimelineObjectClass parent_class;
GESClipClass parent_class;
/* Padding for API extension */
gpointer _ges_reserved[GES_PADDING];

View file

@ -56,18 +56,18 @@ enum
PROP_VTYPE = 5,
};
static GESTrackObject *ges_tl_transition_create_track_object (GESTimelineObject
static GESTrackObject *ges_tl_transition_create_track_object (GESClip
* self, GESTrackType type);
static void
ges_timeline_standard_transition_track_object_added (GESTimelineObject * obj,
ges_timeline_standard_transition_track_object_added (GESClip * obj,
GESTrackObject * tckobj);
static void
ges_timeline_standard_transition_track_object_released (GESTimelineObject * obj,
ges_timeline_standard_transition_track_object_released (GESClip * obj,
GESTrackObject * tckobj);
/* Internal methods */
static void
ges_timeline_standard_transition_update_vtype_internal (GESTimelineObject *
ges_timeline_standard_transition_update_vtype_internal (GESClip *
self, GESVideoStandardTransitionType value, gboolean set_asset)
{
GSList *tmp;
@ -181,7 +181,7 @@ extractable_set_asset (GESExtractable * self, GESAsset * asset)
}
}
ges_timeline_standard_transition_update_vtype_internal
(GES_TIMELINE_OBJECT (self), value, FALSE);
(GES_CLIP (self), value, FALSE);
}
}
@ -219,7 +219,7 @@ static void
ges_timeline_standard_transition_set_property (GObject * object,
guint property_id, const GValue * value, GParamSpec * pspec)
{
GESTimelineObject *self = GES_TIMELINE_OBJECT (object);
GESClip *self = GES_CLIP (object);
switch (property_id) {
case PROP_VTYPE:
@ -236,7 +236,7 @@ ges_timeline_standard_transition_class_init (GESTimelineStandardTransitionClass
* klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
GESTimelineObjectClass *timobj_class = GES_TIMELINE_OBJECT_CLASS (klass);
GESClipClass *timobj_class = GES_CLIP_CLASS (klass);
g_type_class_add_private (klass,
sizeof (GESTimelineStandardTransitionPrivate));
@ -278,7 +278,7 @@ ges_timeline_standard_transition_init (GESTimelineStandardTransition * self)
}
static void
ges_timeline_standard_transition_track_object_released (GESTimelineObject * obj,
ges_timeline_standard_transition_track_object_released (GESClip * obj,
GESTrackObject * tckobj)
{
GESTimelineStandardTransitionPrivate *priv =
@ -294,7 +294,7 @@ ges_timeline_standard_transition_track_object_released (GESTimelineObject * obj,
}
static void
ges_timeline_standard_transition_track_object_added (GESTimelineObject * obj,
ges_timeline_standard_transition_track_object_added (GESClip * obj,
GESTrackObject * tckobj)
{
GESTimelineStandardTransitionPrivate *priv =
@ -308,8 +308,7 @@ ges_timeline_standard_transition_track_object_added (GESTimelineObject * obj,
}
static GESTrackObject *
ges_tl_transition_create_track_object (GESTimelineObject * obj,
GESTrackType type)
ges_tl_transition_create_track_object (GESClip * obj, GESTrackType type)
{
GESTimelineStandardTransition *transition =
(GESTimelineStandardTransition *) obj;
@ -318,7 +317,7 @@ ges_tl_transition_create_track_object (GESTimelineObject * obj,
GST_DEBUG ("Creating a GESTrackTransition");
supportedformats = ges_timeline_object_get_supported_formats (obj);
supportedformats = ges_clip_get_supported_formats (obj);
if (type == GES_TRACK_TYPE_VIDEO) {
if (supportedformats == GES_TRACK_TYPE_UNKNOWN ||
supportedformats & GES_TRACK_TYPE_VIDEO) {

View file

@ -58,7 +58,7 @@ enum
};
static GESTrackObject
* ges_timeline_test_source_create_track_object (GESTimelineObject * obj,
* ges_timeline_test_source_create_track_object (GESClip * obj,
GESTrackType type);
static void
@ -89,20 +89,21 @@ static void
ges_timeline_test_source_set_property (GObject * object, guint property_id,
const GValue * value, GParamSpec * pspec)
{
GESTimelineTestSource *tfs = GES_TIMELINE_TEST_SOURCE (object);
GESTimelineTestSource *uriclip = GES_TIMELINE_TEST_SOURCE (object);
switch (property_id) {
case PROP_MUTE:
ges_timeline_test_source_set_mute (tfs, g_value_get_boolean (value));
ges_timeline_test_source_set_mute (uriclip, g_value_get_boolean (value));
break;
case PROP_VPATTERN:
ges_timeline_test_source_set_vpattern (tfs, g_value_get_enum (value));
ges_timeline_test_source_set_vpattern (uriclip, g_value_get_enum (value));
break;
case PROP_FREQ:
ges_timeline_test_source_set_frequency (tfs, g_value_get_double (value));
ges_timeline_test_source_set_frequency (uriclip,
g_value_get_double (value));
break;
case PROP_VOLUME:
ges_timeline_test_source_set_volume (tfs, g_value_get_double (value));
ges_timeline_test_source_set_volume (uriclip, g_value_get_double (value));
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
@ -113,7 +114,7 @@ static void
ges_timeline_test_source_class_init (GESTimelineTestSourceClass * klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
GESTimelineObjectClass *timobj_class = GES_TIMELINE_OBJECT_CLASS (klass);
GESClipClass *timobj_class = GES_CLIP_CLASS (klass);
g_type_class_add_private (klass, sizeof (GESTimelineTestSourcePrivate));
@ -189,14 +190,14 @@ void
ges_timeline_test_source_set_mute (GESTimelineTestSource * self, gboolean mute)
{
GList *tmp, *trackobjects;
GESTimelineObject *object = (GESTimelineObject *) self;
GESClip *object = (GESClip *) self;
GST_DEBUG ("self:%p, mute:%d", self, mute);
self->priv->mute = mute;
/* Go over tracked objects, and update 'active' status on all audio objects */
trackobjects = ges_timeline_object_get_track_objects (object);
trackobjects = ges_clip_get_track_objects (object);
for (tmp = trackobjects; tmp; tmp = tmp->next) {
GESTrackObject *trackobject = (GESTrackObject *) tmp->data;
@ -221,11 +222,11 @@ ges_timeline_test_source_set_vpattern (GESTimelineTestSource * self,
GESVideoTestPattern vpattern)
{
GList *tmp, *trackobjects;
GESTimelineObject *object = (GESTimelineObject *) self;
GESClip *object = (GESClip *) self;
self->priv->vpattern = vpattern;
trackobjects = ges_timeline_object_get_track_objects (object);
trackobjects = ges_clip_get_track_objects (object);
for (tmp = trackobjects; tmp; tmp = tmp->next) {
GESTrackObject *trackobject = (GESTrackObject *) tmp->data;
if (GES_IS_TRACK_VIDEO_TEST_SOURCE (trackobject))
@ -250,11 +251,11 @@ ges_timeline_test_source_set_frequency (GESTimelineTestSource * self,
gdouble freq)
{
GList *tmp, *trackobjects;
GESTimelineObject *object = (GESTimelineObject *) self;
GESClip *object = (GESClip *) self;
self->priv->freq = freq;
trackobjects = ges_timeline_object_get_track_objects (object);
trackobjects = ges_clip_get_track_objects (object);
for (tmp = trackobjects; tmp; tmp = tmp->next) {
GESTrackObject *trackobject = (GESTrackObject *) tmp->data;
if (GES_IS_TRACK_AUDIO_TEST_SOURCE (trackobject))
@ -279,11 +280,11 @@ ges_timeline_test_source_set_volume (GESTimelineTestSource * self,
gdouble volume)
{
GList *tmp, *trackobjects;
GESTimelineObject *object = (GESTimelineObject *) self;
GESClip *object = (GESClip *) self;
self->priv->volume = volume;
trackobjects = ges_timeline_object_get_track_objects (object);
trackobjects = ges_clip_get_track_objects (object);
for (tmp = trackobjects; tmp; tmp = tmp->next) {
GESTrackObject *trackobject = (GESTrackObject *) tmp->data;
if (GES_IS_TRACK_AUDIO_TEST_SOURCE (trackobject))
@ -352,8 +353,7 @@ ges_timeline_test_source_get_volume (GESTimelineTestSource * self)
}
static GESTrackObject *
ges_timeline_test_source_create_track_object (GESTimelineObject * obj,
GESTrackType type)
ges_timeline_test_source_create_track_object (GESClip * obj, GESTrackType type)
{
GESTimelineTestSourcePrivate *priv = GES_TIMELINE_TEST_SOURCE (obj)->priv;
GESTrackObject *res = NULL;

View file

@ -64,7 +64,7 @@ enum
};
static GESTrackObject
* ges_timeline_text_overlay_create_track_object (GESTimelineObject * obj,
* ges_timeline_text_overlay_create_track_object (GESClip * obj,
GESTrackType type);
static void
@ -105,29 +105,30 @@ static void
ges_timeline_text_overlay_set_property (GObject * object, guint property_id,
const GValue * value, GParamSpec * pspec)
{
GESTimelineTextOverlay *tfs = GES_TIMELINE_TEXT_OVERLAY (object);
GESTimelineTextOverlay *uriclip = GES_TIMELINE_TEXT_OVERLAY (object);
switch (property_id) {
case PROP_TEXT:
ges_timeline_text_overlay_set_text (tfs, g_value_get_string (value));
ges_timeline_text_overlay_set_text (uriclip, g_value_get_string (value));
break;
case PROP_FONT_DESC:
ges_timeline_text_overlay_set_font_desc (tfs, g_value_get_string (value));
ges_timeline_text_overlay_set_font_desc (uriclip,
g_value_get_string (value));
break;
case PROP_HALIGNMENT:
ges_timeline_text_overlay_set_halign (tfs, g_value_get_enum (value));
ges_timeline_text_overlay_set_halign (uriclip, g_value_get_enum (value));
break;
case PROP_VALIGNMENT:
ges_timeline_text_overlay_set_valign (tfs, g_value_get_enum (value));
ges_timeline_text_overlay_set_valign (uriclip, g_value_get_enum (value));
break;
case PROP_COLOR:
ges_timeline_text_overlay_set_color (tfs, g_value_get_uint (value));
ges_timeline_text_overlay_set_color (uriclip, g_value_get_uint (value));
break;
case PROP_XPOS:
ges_timeline_text_overlay_set_xpos (tfs, g_value_get_double (value));
ges_timeline_text_overlay_set_xpos (uriclip, g_value_get_double (value));
break;
case PROP_YPOS:
ges_timeline_text_overlay_set_ypos (tfs, g_value_get_double (value));
ges_timeline_text_overlay_set_ypos (uriclip, g_value_get_double (value));
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
@ -152,7 +153,7 @@ static void
ges_timeline_text_overlay_class_init (GESTimelineTextOverlayClass * klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
GESTimelineObjectClass *timobj_class = GES_TIMELINE_OBJECT_CLASS (klass);
GESClipClass *timobj_class = GES_CLIP_CLASS (klass);
g_type_class_add_private (klass, sizeof (GESTimelineTextOverlayPrivate));
@ -270,7 +271,7 @@ ges_timeline_text_overlay_set_text (GESTimelineTextOverlay * self,
const gchar * text)
{
GList *tmp, *trackobjects;
GESTimelineObject *object = (GESTimelineObject *) self;
GESClip *object = (GESClip *) self;
GST_DEBUG ("self:%p, text:%s", self, text);
@ -279,7 +280,7 @@ ges_timeline_text_overlay_set_text (GESTimelineTextOverlay * self,
self->priv->text = g_strdup (text);
trackobjects = ges_timeline_object_get_track_objects (object);
trackobjects = ges_clip_get_track_objects (object);
for (tmp = trackobjects; tmp; tmp = tmp->next) {
GESTrackObject *trackobject = (GESTrackObject *) tmp->data;
@ -305,7 +306,7 @@ ges_timeline_text_overlay_set_font_desc (GESTimelineTextOverlay * self,
const gchar * font_desc)
{
GList *tmp, *trackobjects;
GESTimelineObject *object = (GESTimelineObject *) self;
GESClip *object = (GESClip *) self;
GST_DEBUG ("self:%p, font_desc:%s", self, font_desc);
@ -314,7 +315,7 @@ ges_timeline_text_overlay_set_font_desc (GESTimelineTextOverlay * self,
self->priv->font_desc = g_strdup (font_desc);
trackobjects = ges_timeline_object_get_track_objects (object);
trackobjects = ges_clip_get_track_objects (object);
for (tmp = trackobjects; tmp; tmp = tmp->next) {
GESTrackObject *trackobject = (GESTrackObject *) tmp->data;
@ -341,13 +342,13 @@ ges_timeline_text_overlay_set_halign (GESTimelineTextOverlay * self,
GESTextHAlign halign)
{
GList *tmp, *trackobjects;
GESTimelineObject *object = (GESTimelineObject *) self;
GESClip *object = (GESClip *) self;
GST_DEBUG ("self:%p, halign:%d", self, halign);
self->priv->halign = halign;
trackobjects = ges_timeline_object_get_track_objects (object);
trackobjects = ges_clip_get_track_objects (object);
for (tmp = trackobjects; tmp; tmp = tmp->next) {
GESTrackObject *trackobject = (GESTrackObject *) tmp->data;
@ -374,13 +375,13 @@ ges_timeline_text_overlay_set_valign (GESTimelineTextOverlay * self,
GESTextVAlign valign)
{
GList *tmp, *trackobjects;
GESTimelineObject *object = (GESTimelineObject *) self;
GESClip *object = (GESClip *) self;
GST_DEBUG ("self:%p, valign:%d", self, valign);
self->priv->valign = valign;
trackobjects = ges_timeline_object_get_track_objects (object);
trackobjects = ges_clip_get_track_objects (object);
for (tmp = trackobjects; tmp; tmp = tmp->next) {
GESTrackObject *trackobject = (GESTrackObject *) tmp->data;
@ -408,13 +409,13 @@ ges_timeline_text_overlay_set_color (GESTimelineTextOverlay * self,
guint32 color)
{
GList *tmp, *trackobjects;
GESTimelineObject *object = (GESTimelineObject *) self;
GESClip *object = (GESClip *) self;
GST_DEBUG ("self:%p, color:%d", self, color);
self->priv->color = color;
trackobjects = ges_timeline_object_get_track_objects (object);
trackobjects = ges_clip_get_track_objects (object);
for (tmp = trackobjects; tmp; tmp = tmp->next) {
GESTrackObject *trackobject = (GESTrackObject *) tmp->data;
@ -441,13 +442,13 @@ ges_timeline_text_overlay_set_xpos (GESTimelineTextOverlay * self,
gdouble position)
{
GList *tmp, *trackobjects;
GESTimelineObject *object = (GESTimelineObject *) self;
GESClip *object = (GESClip *) self;
GST_DEBUG ("self:%p, xpos:%f", self, position);
self->priv->xpos = position;
trackobjects = ges_timeline_object_get_track_objects (object);
trackobjects = ges_clip_get_track_objects (object);
for (tmp = trackobjects; tmp; tmp = tmp->next) {
GESTrackObject *trackobject = (GESTrackObject *) tmp->data;
@ -474,13 +475,13 @@ ges_timeline_text_overlay_set_ypos (GESTimelineTextOverlay * self,
gdouble position)
{
GList *tmp, *trackobjects;
GESTimelineObject *object = (GESTimelineObject *) self;
GESClip *object = (GESClip *) self;
GST_DEBUG ("self:%p, ypos:%f", self, position);
self->priv->ypos = position;
trackobjects = ges_timeline_object_get_track_objects (object);
trackobjects = ges_clip_get_track_objects (object);
for (tmp = trackobjects; tmp; tmp = tmp->next) {
GESTrackObject *trackobject = (GESTrackObject *) tmp->data;
@ -602,8 +603,7 @@ ges_timeline_text_overlay_get_ypos (GESTimelineTextOverlay * self)
}
static GESTrackObject *
ges_timeline_text_overlay_create_track_object (GESTimelineObject * obj,
GESTrackType type)
ges_timeline_text_overlay_create_track_object (GESClip * obj, GESTrackType type)
{
GESTimelineTextOverlayPrivate *priv = GES_TIMELINE_TEXT_OVERLAY (obj)->priv;

View file

@ -70,14 +70,14 @@ enum
};
static GESTrackObject
* ges_timeline_title_source_create_track_object (GESTimelineObject * obj,
* ges_timeline_title_source_create_track_object (GESClip * obj,
GESTrackType type);
static void
ges_timeline_title_source_track_object_added (GESTimelineObject * obj,
ges_timeline_title_source_track_object_added (GESClip * obj,
GESTrackObject * tckobj);
static void
ges_timeline_title_source_track_object_released (GESTimelineObject * obj,
ges_timeline_title_source_track_object_released (GESClip * obj,
GESTrackObject * tckobj);
static void
@ -124,35 +124,39 @@ static void
ges_timeline_title_source_set_property (GObject * object, guint property_id,
const GValue * value, GParamSpec * pspec)
{
GESTimelineTitleSource *tfs = GES_TIMELINE_TITLE_SOURCE (object);
GESTimelineTitleSource *uriclip = GES_TIMELINE_TITLE_SOURCE (object);
switch (property_id) {
case PROP_MUTE:
ges_timeline_title_source_set_mute (tfs, g_value_get_boolean (value));
ges_timeline_title_source_set_mute (uriclip, g_value_get_boolean (value));
break;
case PROP_TEXT:
ges_timeline_title_source_set_text (tfs, g_value_get_string (value));
ges_timeline_title_source_set_text (uriclip, g_value_get_string (value));
break;
case PROP_FONT_DESC:
ges_timeline_title_source_set_font_desc (tfs, g_value_get_string (value));
ges_timeline_title_source_set_font_desc (uriclip,
g_value_get_string (value));
break;
case PROP_HALIGNMENT:
ges_timeline_title_source_set_halignment (tfs, g_value_get_enum (value));
ges_timeline_title_source_set_halignment (uriclip,
g_value_get_enum (value));
break;
case PROP_VALIGNMENT:
ges_timeline_title_source_set_valignment (tfs, g_value_get_enum (value));
ges_timeline_title_source_set_valignment (uriclip,
g_value_get_enum (value));
break;
case PROP_COLOR:
ges_timeline_title_source_set_color (tfs, g_value_get_uint (value));
ges_timeline_title_source_set_color (uriclip, g_value_get_uint (value));
break;
case PROP_BACKGROUND:
ges_timeline_title_source_set_background (tfs, g_value_get_uint (value));
ges_timeline_title_source_set_background (uriclip,
g_value_get_uint (value));
break;
case PROP_XPOS:
ges_timeline_title_source_set_xpos (tfs, g_value_get_double (value));
ges_timeline_title_source_set_xpos (uriclip, g_value_get_double (value));
break;
case PROP_YPOS:
ges_timeline_title_source_set_ypos (tfs, g_value_get_double (value));
ges_timeline_title_source_set_ypos (uriclip, g_value_get_double (value));
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
@ -176,7 +180,7 @@ static void
ges_timeline_title_source_class_init (GESTimelineTitleSourceClass * klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
GESTimelineObjectClass *timobj_class = GES_TIMELINE_OBJECT_CLASS (klass);
GESClipClass *timobj_class = GES_CLIP_CLASS (klass);
g_type_class_add_private (klass, sizeof (GESTimelineTitleSourcePrivate));
@ -419,7 +423,7 @@ ges_timeline_title_source_set_mute (GESTimelineTitleSource * self,
gboolean mute)
{
GList *tmp, *trackobjects;
GESTimelineObject *object = (GESTimelineObject *) self;
GESClip *object = (GESClip *) self;
GST_DEBUG_OBJECT (self, "mute:%d", mute);
@ -427,7 +431,7 @@ ges_timeline_title_source_set_mute (GESTimelineTitleSource * self,
/* Go over tracked objects, and update 'active' status on all audio objects */
/* FIXME : We need a much less crack way to find the trackobject to change */
trackobjects = ges_timeline_object_get_track_objects (object);
trackobjects = ges_clip_get_track_objects (object);
for (tmp = trackobjects; tmp; tmp = tmp->next) {
GESTrackObject *trackobject = (GESTrackObject *) tmp->data;
@ -676,7 +680,7 @@ ges_timeline_title_source_get_ypos (GESTimelineTitleSource * self)
}
static void
ges_timeline_title_source_track_object_released (GESTimelineObject * obj,
ges_timeline_title_source_track_object_released (GESClip * obj,
GESTrackObject * tckobj)
{
GESTimelineTitleSourcePrivate *priv = GES_TIMELINE_TITLE_SOURCE (obj)->priv;
@ -690,7 +694,7 @@ ges_timeline_title_source_track_object_released (GESTimelineObject * obj,
}
static void
ges_timeline_title_source_track_object_added (GESTimelineObject * obj,
ges_timeline_title_source_track_object_added (GESClip * obj,
GESTrackObject * tckobj)
{
GESTimelineTitleSourcePrivate *priv = GES_TIMELINE_TITLE_SOURCE (obj)->priv;
@ -703,8 +707,7 @@ ges_timeline_title_source_track_object_added (GESTimelineObject * obj,
}
static GESTrackObject *
ges_timeline_title_source_create_track_object (GESTimelineObject * obj,
GESTrackType type)
ges_timeline_title_source_create_track_object (GESClip * obj, GESTrackType type)
{
GESTimelineTitleSourcePrivate *priv = GES_TIMELINE_TITLE_SOURCE (obj)->priv;

View file

@ -48,7 +48,7 @@
typedef struct _MoveContext MoveContext;
static GPtrArray *select_tracks_for_object_default (GESTimeline * timeline,
GESTimelineObject * tl_obj, GESTrackObject * tr_obj, gpointer user_data);
GESClip * clip, GESTrackObject * tr_obj, gpointer user_data);
static inline void init_movecontext (MoveContext * mv_ctx, gboolean first_init);
static void ges_extractable_interface_init (GESExtractableInterface * iface);
static void ges_meta_container_interface_init
@ -89,18 +89,18 @@ _destroy_obj_iters (TrackObjIters * iters)
*/
struct _MoveContext
{
GESTimelineObject *obj;
GESClip *obj;
GESEdge edge;
GESEditMode mode;
/* Ripple and Roll Objects */
GList *moving_tckobjs;
/* We use it as a set of TimelineObject to move between layers */
GHashTable *moving_tlobjs;
/* Min priority of the objects currently in moving_tlobjs */
/* We use it as a set of Clip to move between layers */
GHashTable *moving_clips;
/* Min priority of the objects currently in moving_clips */
guint min_move_layer;
/* Max priority of the objects currently in moving_tlobjs */
/* Max priority of the objects currently in moving_clips */
guint max_layer_prio;
/* Never trim so duration would becomes < 0 */
@ -307,7 +307,7 @@ ges_timeline_dispose (GObject * object)
g_sequence_free (priv->starts_ends);
g_sequence_free (priv->tracksources);
g_list_free (priv->movecontext.moving_tckobjs);
g_hash_table_unref (priv->movecontext.moving_tlobjs);
g_hash_table_unref (priv->movecontext.moving_clips);
g_hash_table_unref (priv->auto_transitions);
@ -484,7 +484,7 @@ ges_timeline_class_init (GESTimelineClass * klass)
/**
* GESTimeline::select-tracks-for-object:
* @timeline: the #GESTimeline
* @timeline-object: The #GESTimelineObject on which @track-object will land
* @clip: The #GESClip on which @track-object will land
* @track-object: The #GESTrackObject for which to choose the tracks it should land into
*
* Returns: (transfer full) (element-type GESTrack): a #GPtrArray of #GESTrack-s where that object should be added
@ -494,7 +494,7 @@ ges_timeline_class_init (GESTimelineClass * klass)
ges_timeline_signals[SELECT_TRACKS_FOR_OBJECT] =
g_signal_new ("select-tracks-for-object", G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_LAST, 0, _gst_array_accumulator, NULL, NULL,
G_TYPE_PTR_ARRAY, 2, GES_TYPE_TIMELINE_OBJECT, GES_TYPE_TRACK_OBJECT);
G_TYPE_PTR_ARRAY, 2, GES_TYPE_CLIP, GES_TYPE_TRACK_OBJECT);
}
static void
@ -653,8 +653,8 @@ _destroy_auto_transition_cb (GESAutoTransition * auto_transition,
GESTimeline * timeline)
{
GESTimelinePrivate *priv = timeline->priv;
GESTimelineObject *transition = auto_transition->timeline_transition;
GESTimelineLayer *layer = ges_timeline_object_get_layer (transition);
GESClip *transition = auto_transition->timeline_transition;
GESTimelineLayer *layer = ges_clip_get_layer (transition);
ges_timeline_layer_remove_object (layer, transition);
g_signal_handlers_disconnect_by_func (auto_transition,
@ -667,7 +667,7 @@ _destroy_auto_transition_cb (GESAutoTransition * auto_transition,
static GESAutoTransition *
create_transition (GESTimeline * timeline, GESTrackObject * previous,
GESTrackObject * next, GESTimelineObject * transition,
GESTrackObject * next, GESClip * transition,
GESTimelineLayer * layer, guint64 start, guint64 duration)
{
GList *tckobjs;
@ -687,7 +687,7 @@ create_transition (GESTimeline * timeline, GESTrackObject * previous,
}
/* We know there is only 1 TrackObject */
tckobjs = ges_timeline_object_get_track_objects (transition);
tckobjs = ges_clip_get_track_objects (transition);
auto_transition = ges_auto_transition_new (tckobjs->data, previous, next);
g_list_free_full (tckobjs, gst_object_unref);
@ -760,7 +760,7 @@ _create_auto_transition_from_transitions (GESTimeline * timeline,
* TrackObject-s in @track and if it is not the case properly unlink the
* object to use it */
return create_transition (timeline, prev, next,
ges_track_object_get_timeline_object (maybe_transition), layer,
ges_track_object_get_clip (maybe_transition), layer,
_START (next), transition_duration);
}
@ -874,7 +874,7 @@ static inline void
init_movecontext (MoveContext * mv_ctx, gboolean first_init)
{
if (G_UNLIKELY (first_init))
mv_ctx->moving_tlobjs = g_hash_table_new (g_direct_hash, g_direct_equal);
mv_ctx->moving_clips = g_hash_table_new (g_direct_hash, g_direct_equal);
mv_ctx->moving_tckobjs = NULL;
mv_ctx->max_trim_pos = G_MAXUINT64;
@ -889,7 +889,7 @@ static inline void
clean_movecontext (MoveContext * mv_ctx)
{
g_list_free (mv_ctx->moving_tckobjs);
g_hash_table_remove_all (mv_ctx->moving_tlobjs);
g_hash_table_remove_all (mv_ctx->moving_clips);
init_movecontext (mv_ctx, FALSE);
}
@ -1043,7 +1043,7 @@ ges_timeline_snap_position (GESTimeline * timeline, GESTrackObject * trackobj,
GESTimelinePrivate *priv = timeline->priv;
GSequenceIter *iter, *prev_iter, *nxt_iter;
GESTrackObject *tmp_tckobj;
GESTimelineObject *tmp_tlobj, *tlobj;
GESClip *tmp_clip, *clip;
GstClockTime *last_snap_ts = priv->movecontext.last_snap_ts;
guint64 snap_distance = timeline->priv->snapping_distance;
@ -1064,7 +1064,7 @@ ges_timeline_snap_position (GESTimeline * timeline, GESTrackObject * trackobj,
}
}
tlobj = ges_track_object_get_timeline_object (trackobj);
clip = ges_track_object_get_clip (trackobj);
iter = g_sequence_search (priv->starts_ends, &timecode,
(GCompareDataFunc) compare_uint64, NULL);
@ -1075,10 +1075,10 @@ ges_timeline_snap_position (GESTimeline * timeline, GESTrackObject * trackobj,
while (!g_sequence_iter_is_end (nxt_iter)) {
next_tc = g_sequence_get (iter);
tmp_tckobj = g_hash_table_lookup (timeline->priv->by_object, next_tc);
tmp_tlobj = ges_track_object_get_timeline_object (tmp_tckobj);
tmp_clip = ges_track_object_get_clip (tmp_tckobj);
off = timecode > *next_tc ? timecode - *next_tc : *next_tc - timecode;
if (next_tc != current && off <= snap_distance && tlobj != tmp_tlobj) {
if (next_tc != current && off <= snap_distance && clip != tmp_clip) {
ret = next_tc;
break;
@ -1094,11 +1094,11 @@ ges_timeline_snap_position (GESTimeline * timeline, GESTrackObject * trackobj,
while (!g_sequence_iter_is_begin (prev_iter)) {
prev_tc = g_sequence_get (prev_iter);
tmp_tckobj = g_hash_table_lookup (timeline->priv->by_object, prev_tc);
tmp_tlobj = ges_track_object_get_timeline_object (tmp_tckobj);
tmp_clip = ges_track_object_get_clip (tmp_tckobj);
off1 = timecode > *prev_tc ? timecode - *prev_tc : *prev_tc - timecode;
if (prev_tc != current && off1 < off && off1 <= snap_distance &&
tlobj != tmp_tlobj) {
clip != tmp_clip) {
ret = prev_tc;
break;
@ -1122,25 +1122,25 @@ done:
return ret;
}
static inline GESTimelineObject *
add_moving_timeline_object (MoveContext * mv_ctx, GESTrackObject * tckobj)
static inline GESClip *
add_moving_clip (MoveContext * mv_ctx, GESTrackObject * tckobj)
{
GESTimelineObject *tlobj;
GESClip *clip;
GESTimelineLayer *layer;
guint layer_prio;
tlobj = ges_track_object_get_timeline_object (tckobj);
clip = ges_track_object_get_clip (tckobj);
/* Avoid recalculating */
if (!g_hash_table_lookup (mv_ctx->moving_tlobjs, tlobj)) {
layer = ges_timeline_object_get_layer (tlobj);
if (!g_hash_table_lookup (mv_ctx->moving_clips, clip)) {
layer = ges_clip_get_layer (clip);
if (layer == NULL) {
GST_WARNING_OBJECT (tlobj, "Not in any layer, can not move"
GST_WARNING_OBJECT (clip, "Not in any layer, can not move"
" between layers");
} else {
g_hash_table_insert (mv_ctx->moving_tlobjs, tlobj, tlobj);
g_hash_table_insert (mv_ctx->moving_clips, clip, clip);
layer_prio = ges_timeline_layer_get_priority (layer);
mv_ctx->min_move_layer = MIN (mv_ctx->min_move_layer, layer_prio);
@ -1150,7 +1150,7 @@ add_moving_timeline_object (MoveContext * mv_ctx, GESTrackObject * tckobj)
}
}
return tlobj;
return clip;
}
static gboolean
@ -1228,33 +1228,33 @@ ges_timeline_set_moving_context (GESTimeline * timeline, GESTrackObject * obj,
/* A TrackObject that could initiate movement for other object */
GESTrackObject *editor_tckobj = NULL;
MoveContext *mv_ctx = &timeline->priv->movecontext;
GESTimelineObject *tlobj = ges_track_object_get_timeline_object (obj);
GESClip *clip = ges_track_object_get_clip (obj);
/* Still in the same mv_ctx */
if ((mv_ctx->obj == tlobj && mv_ctx->mode == mode &&
if ((mv_ctx->obj == clip && mv_ctx->mode == mode &&
mv_ctx->edge == edge && !mv_ctx->needs_move_ctx)) {
GST_DEBUG ("Keeping the same moving mv_ctx");
return TRUE;
}
GST_DEBUG_OBJECT (tlobj,
GST_DEBUG_OBJECT (clip,
"Changing context:\nold: obj: %p, mode: %d, edge: %d \n"
"new: obj: %p, mode: %d, edge: %d ! Has changed %i", mv_ctx->obj,
mv_ctx->mode, mv_ctx->edge, tlobj, mode, edge, mv_ctx->needs_move_ctx);
mv_ctx->mode, mv_ctx->edge, clip, mode, edge, mv_ctx->needs_move_ctx);
clean_movecontext (mv_ctx);
mv_ctx->edge = edge;
mv_ctx->mode = mode;
mv_ctx->obj = tlobj;
mv_ctx->obj = clip;
mv_ctx->needs_move_ctx = FALSE;
/* We try to find a TrackSource inside the TimelineObject so we can set the
/* We try to find a TrackSource inside the Clip so we can set the
* moving context Else we just move the selected one only */
if (GES_IS_TRACK_SOURCE (obj) == FALSE) {
GList *tmp;
for (tmp = tlobj->trackobjects; tmp; tmp = tmp->next) {
for (tmp = clip->trackobjects; tmp; tmp = tmp->next) {
if (GES_IS_TRACK_SOURCE (tmp->data)) {
editor_tckobj = tmp->data;
break;
@ -1273,10 +1273,10 @@ ges_timeline_set_moving_context (GESTimeline * timeline, GESTrackObject * obj,
default:
break;
}
add_moving_timeline_object (&timeline->priv->movecontext, editor_tckobj);
add_moving_clip (&timeline->priv->movecontext, editor_tckobj);
} else {
/* We add the main object to the moving_tlobjs set */
add_moving_timeline_object (&timeline->priv->movecontext, obj);
/* We add the main object to the moving_clips set */
add_moving_clip (&timeline->priv->movecontext, obj);
}
@ -1357,9 +1357,9 @@ gboolean
timeline_ripple_object (GESTimeline * timeline, GESTrackObject * obj,
GList * layers, GESEdge edge, guint64 position)
{
GList *tmp, *moved_tlobjs = NULL;
GList *tmp, *moved_clips = NULL;
GESTrackObject *tckobj;
GESTimelineObject *tlobj;
GESClip *clip;
guint64 duration, new_start, *snapped, *cur;
gint64 offset;
@ -1387,21 +1387,21 @@ timeline_ripple_object (GESTimeline * timeline, GESTrackObject * obj,
tckobj = GES_TRACK_OBJECT (tmp->data);
new_start = _START (tckobj) + offset;
tlobj = add_moving_timeline_object (mv_ctx, tckobj);
clip = add_moving_clip (mv_ctx, tckobj);
if (ges_track_object_is_locked (tckobj) == TRUE) {
/* Make sure not to move 2 times the same TimelineObject */
if (g_list_find (moved_tlobjs, tlobj) == NULL) {
/* Make sure not to move 2 times the same Clip */
if (g_list_find (moved_clips, clip) == NULL) {
_set_start0 (GES_TIMELINE_ELEMENT (tckobj), new_start);
moved_tlobjs = g_list_prepend (moved_tlobjs, tlobj);
moved_clips = g_list_prepend (moved_clips, clip);
}
} else {
_set_start0 (GES_TIMELINE_ELEMENT (tckobj), new_start);
}
}
g_list_free (moved_tlobjs);
g_list_free (moved_clips);
_set_start0 (GES_TIMELINE_ELEMENT (obj), position);
break;
@ -1423,14 +1423,14 @@ timeline_ripple_object (GESTimeline * timeline, GESTrackObject * obj,
tckobj = GES_TRACK_OBJECT (tmp->data);
new_start = _START (tckobj) + offset;
tlobj = add_moving_timeline_object (mv_ctx, tckobj);
clip = add_moving_clip (mv_ctx, tckobj);
if (ges_track_object_is_locked (tckobj) == TRUE) {
/* Make sure not to move 2 times the same TimelineObject */
if (g_list_find (moved_tlobjs, tlobj) == NULL) {
/* Make sure not to move 2 times the same Clip */
if (g_list_find (moved_clips, clip) == NULL) {
_set_start0 (GES_TIMELINE_ELEMENT (tckobj), new_start);
moved_tlobjs = g_list_prepend (moved_tlobjs, tlobj);
moved_clips = g_list_prepend (moved_clips, clip);
}
} else {
@ -1438,7 +1438,7 @@ timeline_ripple_object (GESTimeline * timeline, GESTrackObject * obj,
}
}
g_list_free (moved_tlobjs);
g_list_free (moved_clips);
timeline->priv->needs_transitions_update = TRUE;
GST_DEBUG ("Done Rippling end");
break;
@ -1679,19 +1679,19 @@ timeline_context_to_layer (GESTimeline * timeline, gint offset)
/* Layer's priority is always positive */
if (offset != 0 && (offset > 0 || mv_ctx->min_move_layer >= -offset)) {
GHashTableIter iter;
GESTimelineObject *key, *value;
GESClip *key, *value;
GESTimelineLayer *new_layer, *layer;
guint prio;
mv_ctx->ignore_needs_ctx = TRUE;
GST_DEBUG ("Moving %d object, offset %d",
g_hash_table_size (mv_ctx->moving_tlobjs), offset);
g_hash_table_size (mv_ctx->moving_clips), offset);
g_hash_table_iter_init (&iter, mv_ctx->moving_tlobjs);
g_hash_table_iter_init (&iter, mv_ctx->moving_clips);
while (g_hash_table_iter_next (&iter, (gpointer *) & key,
(gpointer *) & value)) {
layer = ges_timeline_object_get_layer (value);
layer = ges_clip_get_layer (value);
prio = ges_timeline_layer_get_priority (layer);
/* We know that the layer exists as we created it */
@ -1704,7 +1704,7 @@ timeline_context_to_layer (GESTimeline * timeline, gint offset)
} while (ges_timeline_layer_get_priority (new_layer) < prio + offset);
}
ret &= ges_timeline_object_move_to_layer (key, new_layer);
ret &= ges_clip_move_to_layer (key, new_layer);
g_object_unref (layer);
}
@ -1719,10 +1719,10 @@ timeline_context_to_layer (GESTimeline * timeline, gint offset)
}
static void
add_object_to_track (GESTimelineObject * object, GESTrackObject * track_object,
add_object_to_track (GESClip * object, GESTrackObject * track_object,
GESTrack * track)
{
if (!ges_timeline_object_add_track_object (object, track_object)) {
if (!ges_clip_add_track_object (object, track_object)) {
GST_WARNING_OBJECT (object,
"Failed to add track object to timeline object");
gst_object_unref (track_object);
@ -1731,7 +1731,7 @@ add_object_to_track (GESTimelineObject * object, GESTrackObject * track_object,
if (!ges_track_add_object (track, track_object)) {
GST_WARNING_OBJECT (object, "Failed to add track object to track");
ges_timeline_object_release_track_object (object, track_object);
ges_clip_release_track_object (object, track_object);
gst_object_unref (track_object);
return;
}
@ -1739,7 +1739,7 @@ add_object_to_track (GESTimelineObject * object, GESTrackObject * track_object,
static GPtrArray *
select_tracks_for_object_default (GESTimeline * timeline,
GESTimelineObject * tl_obj, GESTrackObject * tr_object, gpointer user_data)
GESClip * clip, GESTrackObject * tr_object, gpointer user_data)
{
GPtrArray *result;
GList *tmp;
@ -1759,7 +1759,7 @@ select_tracks_for_object_default (GESTimeline * timeline,
}
static void
add_object_to_tracks (GESTimeline * timeline, GESTimelineObject * object,
add_object_to_tracks (GESTimeline * timeline, GESClip * object,
GESTrack * track)
{
gint i;
@ -1770,7 +1770,7 @@ add_object_to_tracks (GESTimeline * timeline, GESTimelineObject * object,
GST_DEBUG_OBJECT (timeline, "Creating %" GST_PTR_FORMAT
" trackobjects and adding them to our tracks", object);
types = ges_timeline_object_get_supported_formats (object);
types = ges_clip_get_supported_formats (object);
if (track) {
if ((types & track->type) == 0)
return;
@ -1783,8 +1783,7 @@ add_object_to_tracks (GESTimeline * timeline, GESTimelineObject * object,
if (((track->type & types) == 0 || (track->type & visited_type)))
continue;
track_objects = ges_timeline_object_create_track_objects (object,
track->type);
track_objects = ges_clip_create_track_objects (object, track->type);
for (l = track_objects; l; l = l->next) {
GESTrack *tmp_track;
GESTrackObject *track_object = l->data;
@ -1845,11 +1844,11 @@ layer_auto_transition_changed_cb (GESTimelineLayer * layer,
}
static void
layer_object_added_cb (GESTimelineLayer * layer, GESTimelineObject * object,
layer_object_added_cb (GESTimelineLayer * layer, GESClip * object,
GESTimeline * timeline)
{
if (ges_timeline_object_is_moving_from_layer (object)) {
GST_DEBUG ("TimelineObject %p is moving from a layer to another, not doing"
if (ges_clip_is_moving_from_layer (object)) {
GST_DEBUG ("Clip %p is moving from a layer to another, not doing"
" anything on it", object);
timeline->priv->movecontext.needs_move_ctx = TRUE;
@ -1859,7 +1858,7 @@ layer_object_added_cb (GESTimelineLayer * layer, GESTimelineObject * object,
return;
}
GST_DEBUG ("New TimelineObject %p added to layer %p", object, layer);
GST_DEBUG ("New Clip %p added to layer %p", object, layer);
add_object_to_tracks (timeline, object, NULL);
GST_DEBUG ("Done");
}
@ -1873,23 +1872,23 @@ layer_priority_changed_cb (GESTimelineLayer * layer,
}
static void
layer_object_removed_cb (GESTimelineLayer * layer, GESTimelineObject * object,
layer_object_removed_cb (GESTimelineLayer * layer, GESClip * object,
GESTimeline * timeline)
{
GList *trackobjects, *tmp;
if (ges_timeline_object_is_moving_from_layer (object)) {
GST_DEBUG ("TimelineObject %p is moving from a layer to another, not doing"
if (ges_clip_is_moving_from_layer (object)) {
GST_DEBUG ("Clip %p is moving from a layer to another, not doing"
" anything on it", object);
return;
}
GST_DEBUG ("TimelineObject %p removed from layer %p", object, layer);
GST_DEBUG ("Clip %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 */
trackobjects = ges_timeline_object_get_track_objects (object);
trackobjects = ges_clip_get_track_objects (object);
for (tmp = trackobjects; tmp; tmp = tmp->next) {
GESTrackObject *trobj = (GESTrackObject *) tmp->data;
@ -1900,7 +1899,7 @@ layer_object_removed_cb (GESTimelineLayer * layer, GESTimelineObject * object,
GST_DEBUG ("Belongs to one of the tracks we control");
ges_track_remove_object (ges_track_object_get_track (trobj), trobj);
ges_timeline_object_release_track_object (object, trobj);
ges_clip_release_track_object (object, trobj);
}
/* removing the reference added by _get_track_objects() */
g_object_unref (trobj);
@ -2326,7 +2325,7 @@ ges_timeline_remove_layer (GESTimeline * timeline, GESTimelineLayer * layer)
layer_objects = ges_timeline_layer_get_objects (layer);
for (tmp = layer_objects; tmp; tmp = tmp->next) {
layer_object_removed_cb (layer, GES_TIMELINE_OBJECT (tmp->data), timeline);
layer_object_removed_cb (layer, GES_CLIP (tmp->data), timeline);
g_object_unref (G_OBJECT (tmp->data));
tmp->data = NULL;
}
@ -2424,7 +2423,7 @@ ges_timeline_add_track (GESTimeline * timeline, GESTrack * track)
objects = ges_timeline_layer_get_objects (tmp->data);
for (obj = objects; obj; obj = obj->next) {
GESTimelineObject *object = obj->data;
GESClip *object = obj->data;
add_object_to_tracks (timeline, object, track);
g_object_unref (object);
@ -2449,7 +2448,7 @@ ges_timeline_add_track (GESTimeline * timeline, GESTrack * track)
/* FIXME: release any track objects associated with this layer. currenly this
* will not happen if you remove the track before removing *all*
* timelineobjects which have a track object in this track.
* clips which have a track object in this track.
*/
gboolean

View file

@ -50,7 +50,7 @@ G_BEGIN_DECLS
/**
* ges_timeline_get_project:
* @obj: The #GESTimelineObject from which to retrieve the project
* @obj: The #GESClip from which to retrieve the project
*
* Helper macro to retrieve the project from which a #GESTimeline as been extracted
*/

View file

@ -79,11 +79,11 @@ static void
ges_track_filesource_get_property (GObject * object, guint property_id,
GValue * value, GParamSpec * pspec)
{
GESTrackFileSource *tfs = GES_TRACK_FILESOURCE (object);
GESTrackFileSource *uriclip = GES_TRACK_FILESOURCE (object);
switch (property_id) {
case PROP_URI:
g_value_set_string (value, tfs->uri);
g_value_set_string (value, uriclip->uri);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
@ -94,11 +94,11 @@ static void
ges_track_filesource_set_property (GObject * object, guint property_id,
const GValue * value, GParamSpec * pspec)
{
GESTrackFileSource *tfs = GES_TRACK_FILESOURCE (object);
GESTrackFileSource *uriclip = GES_TRACK_FILESOURCE (object);
switch (property_id) {
case PROP_URI:
tfs->uri = g_value_dup_string (value);
uriclip->uri = g_value_dup_string (value);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
@ -108,10 +108,10 @@ ges_track_filesource_set_property (GObject * object, guint property_id,
static void
ges_track_filesource_dispose (GObject * object)
{
GESTrackFileSource *tfs = GES_TRACK_FILESOURCE (object);
GESTrackFileSource *uriclip = GES_TRACK_FILESOURCE (object);
if (tfs->uri)
g_free (tfs->uri);
if (uriclip->uri)
g_free (uriclip->uri);
G_OBJECT_CLASS (ges_track_filesource_parent_class)->dispose (object);
}

View file

@ -51,11 +51,11 @@ static void
ges_track_image_source_get_property (GObject * object, guint property_id,
GValue * value, GParamSpec * pspec)
{
GESTrackImageSource *tfs = GES_TRACK_IMAGE_SOURCE (object);
GESTrackImageSource *uriclip = GES_TRACK_IMAGE_SOURCE (object);
switch (property_id) {
case PROP_URI:
g_value_set_string (value, tfs->uri);
g_value_set_string (value, uriclip->uri);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
@ -66,11 +66,11 @@ static void
ges_track_image_source_set_property (GObject * object, guint property_id,
const GValue * value, GParamSpec * pspec)
{
GESTrackImageSource *tfs = GES_TRACK_IMAGE_SOURCE (object);
GESTrackImageSource *uriclip = GES_TRACK_IMAGE_SOURCE (object);
switch (property_id) {
case PROP_URI:
tfs->uri = g_value_dup_string (value);
uriclip->uri = g_value_dup_string (value);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
@ -80,10 +80,10 @@ ges_track_image_source_set_property (GObject * object, guint property_id,
static void
ges_track_image_source_dispose (GObject * object)
{
GESTrackImageSource *tfs = GES_TRACK_IMAGE_SOURCE (object);
GESTrackImageSource *uriclip = GES_TRACK_IMAGE_SOURCE (object);
if (tfs->uri)
g_free (tfs->uri);
if (uriclip->uri)
g_free (uriclip->uri);
G_OBJECT_CLASS (ges_track_image_source_parent_class)->dispose (object);
}

View file

@ -33,7 +33,7 @@
#include "ges-internal.h"
#include "ges-extractable.h"
#include "ges-track-object.h"
#include "ges-timeline-object.h"
#include "ges-clip.h"
#include "ges-meta-container.h"
#include <gobject/gvaluecollector.h>
@ -59,13 +59,13 @@ struct _GESTrackObjectPrivate
* {GParamaSpec ---> element,}*/
GHashTable *properties_hashtable;
GESTimelineObject *timelineobj;
GESClip *timelineobj;
GESTrack *track;
gboolean valid;
gboolean locked; /* If TRUE, then moves in sync with its controlling
* GESTimelineObject */
* GESClip */
};
enum
@ -236,12 +236,11 @@ ges_track_object_class_init (GESTrackObjectClass * klass)
/**
* GESTrackObject:locked:
*
* If %TRUE, then moves in sync with its controlling #GESTimelineObject
* If %TRUE, then moves in sync with its controlling #GESClip
*/
properties[PROP_LOCKED] =
g_param_spec_boolean ("locked", "Locked",
"Moves in sync with its controling TimelineObject", TRUE,
G_PARAM_READWRITE);
"Moves in sync with its controling Clip", TRUE, G_PARAM_READWRITE);
g_object_class_install_property (object_class, PROP_LOCKED,
properties[PROP_LOCKED]);
@ -679,7 +678,7 @@ ensure_gnl_object (GESTrackObject * object)
object->priv->gnlobject = gst_object_ref (gnlobject);
if (object->priv->timelineobj)
res = ges_timeline_object_fill_track_object (object->priv->timelineobj,
res = ges_clip_fill_track_object (object->priv->timelineobj,
object, object->priv->gnlobject);
else
res = TRUE;
@ -775,32 +774,31 @@ ges_track_object_get_track (GESTrackObject * object)
}
/**
* ges_track_object_set_timeline_object:
* ges_track_object_set_clip:
* @object: The #GESTrackObject to set the parent to
* @tlobject: The #GESTimelineObject, parent of @tlobj or %NULL
* @clipect: The #GESClip, parent of @clip or %NULL
*
* Set the #GESTimelineObject to which @object belongs.
* Set the #GESClip to which @object belongs.
*/
void
ges_track_object_set_timeline_object (GESTrackObject * object,
GESTimelineObject * tlobject)
ges_track_object_set_clip (GESTrackObject * object, GESClip * clipect)
{
GST_DEBUG ("object:%p, timeline-object:%p", object, tlobject);
GST_DEBUG ("object:%p, clip:%p", object, clipect);
object->priv->timelineobj = tlobject;
object->priv->timelineobj = clipect;
}
/**
* ges_track_object_get_timeline_object:
* ges_track_object_get_clip:
* @object: a #GESTrackObject
*
* Get the #GESTimelineObject which is controlling this track object
* Get the #GESClip which is controlling this track object
*
* Returns: (transfer none): the #GESTimelineObject which is controlling
* Returns: (transfer none): the #GESClip which is controlling
* this track object
*/
GESTimelineObject *
ges_track_object_get_timeline_object (GESTrackObject * object)
GESClip *
ges_track_object_get_clip (GESTrackObject * object)
{
g_return_val_if_fail (GES_IS_TRACK_OBJECT (object), NULL);
@ -852,8 +850,8 @@ ges_track_object_set_locked_internal (GESTrackObject * object, gboolean locked)
* @locked: whether the object is lock to its parent
*
* Set the locking status of the @object in relationship to its controlling
* #GESTimelineObject. If @locked is %TRUE, then this object will move synchronously
* with its controlling #GESTimelineObject.
* #GESClip. If @locked is %TRUE, then this object will move synchronously
* with its controlling #GESClip.
*/
void
ges_track_object_set_locked (GESTrackObject * object, gboolean locked)
@ -874,7 +872,7 @@ ges_track_object_set_locked (GESTrackObject * object, gboolean locked)
* Let you know if object us locked or not (moving synchronously).
*
* Returns: %TRUE if the object is moving synchronously to its controlling
* #GESTimelineObject, else %FALSE.
* #GESClip, else %FALSE.
*/
gboolean
ges_track_object_is_locked (GESTrackObject * object)

View file

@ -24,7 +24,7 @@
#include <glib-object.h>
#include <gst/gst.h>
#include <ges/ges-types.h>
#include <ges/ges-timeline-object.h>
#include <ges/ges-clip.h>
#include <ges/ges-track.h>
G_BEGIN_DECLS
@ -122,10 +122,10 @@ GESTrackType ges_track_object_get_track_type (GESTrackObject * object);
void ges_track_object_set_track_type (GESTrackObject * object,
GESTrackType type);
void ges_track_object_set_timeline_object (GESTrackObject * object,
GESTimelineObject * tlobject);
GESTimelineObject *
ges_track_object_get_timeline_object (GESTrackObject* object);
void ges_track_object_set_clip (GESTrackObject * object,
GESClip * clipect);
GESClip *
ges_track_object_get_clip (GESTrackObject* object);
GstElement * ges_track_object_get_gnlobject (GESTrackObject * object);

View file

@ -379,12 +379,12 @@ remove_object_internal (GESTrack * track, GESTrackObject * object)
static void
dispose_tckobjs_foreach (GESTrackObject * tckobj, GESTrack * track)
{
GESTimelineObject *tlobj;
GESClip *clip;
tlobj = ges_track_object_get_timeline_object (tckobj);
clip = ges_track_object_get_clip (tckobj);
remove_object_internal (track, tckobj);
ges_timeline_object_release_track_object (tlobj, tckobj);
ges_clip_release_track_object (clip, tckobj);
}
/* GObject virtual methods */

View file

@ -44,8 +44,8 @@ typedef struct _GESTimelineLayerClass GESTimelineLayerClass;
typedef struct _GESTimelineElementClass GESTimelineElementClass;
typedef struct _GESTimelineElement GESTimelineElement;
typedef struct _GESTimelineObject GESTimelineObject;
typedef struct _GESTimelineObjectClass GESTimelineObjectClass;
typedef struct _GESClip GESClip;
typedef struct _GESClipClass GESClipClass;
typedef struct _GESTimelineOperation GESTimelineOperation;
typedef struct _GESTimelineOperationClass GESTimelineOperationClass;
@ -143,8 +143,8 @@ typedef struct _GESPitiviFormatterClass GESPitiviFormatterClass;
typedef struct _GESAsset GESAsset;
typedef struct _GESAssetClass GESAssetClass;
typedef struct _GESAssetTimelineObject GESAssetTimelineObject;
typedef struct _GESAssetTimelineObjectClass GESAssetTimelineObjectClass;
typedef struct _GESAssetClip GESAssetClip;
typedef struct _GESAssetClipClass GESAssetClipClass;
typedef struct _GESAssetFileSource GESAssetFileSource;
typedef struct _GESAssetFileSourceClass GESAssetFileSourceClass;

View file

@ -418,7 +418,7 @@ wrong_properties:
}
static inline void
_parse_timeline_object (GMarkupParseContext * context,
_parse_clip (GMarkupParseContext * context,
const gchar * element_name, const gchar ** attribute_names,
const gchar ** attribute_values, GESXmlFormatter * self, GError ** error)
{
@ -448,7 +448,7 @@ _parse_timeline_object (GMarkupParseContext * context,
return;
}
type = g_type_from_name (strtype);
if (!g_type_is_a (type, GES_TYPE_TIMELINE_OBJECT))
if (!g_type_is_a (type, GES_TYPE_CLIP))
goto wrong_type;
track_types = g_ascii_strtoll (strtrack_types, NULL, 10);
@ -485,7 +485,7 @@ _parse_timeline_object (GMarkupParseContext * context,
goto wrong_properties;
}
ges_base_xml_formatter_add_timeline_object (GES_BASE_XML_FORMATTER (self),
ges_base_xml_formatter_add_clip (GES_BASE_XML_FORMATTER (self),
strid, asset_id, type, start, inpoint, duration, rate, layer_prio,
track_types, props, metadatas, error);
if (props)
@ -496,7 +496,7 @@ _parse_timeline_object (GMarkupParseContext * context,
wrong_properties:
g_set_error (error, G_MARKUP_ERROR,
G_MARKUP_ERROR_INVALID_CONTENT,
"element '%s', TimelineObject %s properties '%s', could no be deserialized",
"element '%s', Clip %s properties '%s', could no be deserialized",
element_name, asset_id, properties);
return;
@ -510,7 +510,7 @@ convertion_failed:
wrong_type:
g_set_error (error, G_MARKUP_ERROR,
G_MARKUP_ERROR_INVALID_CONTENT,
"element '%s', %s not a GESTimelineObject'", element_name, strtype);
"element '%s', %s not a GESClip'", element_name, strtype);
}
static inline void
@ -523,13 +523,13 @@ _parse_effect (GMarkupParseContext * context, const gchar * element_name,
GstStructure *children_props = NULL, *props = NULL;
const gchar *asset_id = NULL, *strtype = NULL, *track_id =
NULL, *metadatas = NULL, *properties = NULL, *track_type = NULL,
*children_properties = NULL, *tlobj_id;
*children_properties = NULL, *clip_id;
if (!g_markup_collect_attributes (element_name, attribute_names,
attribute_values, error,
COLLECT_STR_OPT, "metadatas", &metadatas,
G_MARKUP_COLLECT_STRING, "asset-id", &asset_id,
G_MARKUP_COLLECT_STRING, "timeline-object-id", &tlobj_id,
G_MARKUP_COLLECT_STRING, "clip-id", &clip_id,
G_MARKUP_COLLECT_STRING, "type-name", &strtype,
G_MARKUP_COLLECT_STRING, "track-id", &track_id,
COLLECT_STR_OPT, "children-properties", &children_properties,
@ -556,7 +556,7 @@ _parse_effect (GMarkupParseContext * context, const gchar * element_name,
}
ges_base_xml_formatter_add_track_object (GES_BASE_XML_FORMATTER (self),
type, asset_id, track_id, tlobj_id, children_props, props, metadatas,
type, asset_id, track_id, clip_id, children_props, props, metadatas,
error);
if (props)
@ -617,8 +617,8 @@ _parse_element_start (GMarkupParseContext * context, const gchar * element_name,
else if (g_strcmp0 (element_name, "layer") == 0)
_parse_layer (context, element_name, attribute_names,
attribute_values, self, error);
else if (g_strcmp0 (element_name, "timeline-object") == 0)
_parse_timeline_object (context, element_name, attribute_names,
else if (g_strcmp0 (element_name, "clip") == 0)
_parse_clip (context, element_name, attribute_names,
attribute_values, self, error);
else if (g_strcmp0 (element_name, "effect") == 0)
_parse_effect (context, element_name, attribute_names,
@ -768,7 +768,7 @@ _save_tracks (GString * str, GESTimeline * timeline)
}
static inline void
_save_effect (GString * str, guint tlobj_id, GESTrackObject * tckobj,
_save_effect (GString * str, guint clip_id, GESTrackObject * tckobj,
GESTimeline * timeline)
{
GESTrack *tck;
@ -796,9 +796,9 @@ _save_effect (GString * str, guint tlobj_id, GESTrackObject * tckobj,
properties = _serialize_properties (G_OBJECT (tckobj), "start",
"in-point", "duration", "locked", "max-duration", "name", NULL);
metas = ges_meta_container_metas_to_string (GES_META_CONTAINER (tckobj));
append_printf_escaped (str, "<effect asset-id='%s' timeline-object-id='%u'"
append_printf_escaped (str, "<effect asset-id='%s' clip-id='%u'"
" type-name='%s' track-type='%i' track-id='%i' properties='%s' metadatas='%s'",
ges_extractable_get_id (GES_EXTRACTABLE (tckobj)), tlobj_id,
ges_extractable_get_id (GES_EXTRACTABLE (tckobj)), clip_id,
g_type_name (G_OBJECT_TYPE (tckobj)), tck->type, track_id, properties,
metas);
g_free (properties);
@ -830,10 +830,10 @@ _save_layers (GString * str, GESTimeline * timeline)
{
gchar *properties, *metas;
GESTimelineLayer *layer;
GESTimelineObject *tlobj;
GList *tmplayer, *tmptlobj, *tlobjs;
GESClip *clip;
GList *tmplayer, *tmpclip, *clips;
guint nbtlobjs = 0;
guint nbclips = 0;
for (tmplayer = timeline->layers; tmplayer; tmplayer = tmplayer->next) {
guint priority;
@ -848,34 +848,34 @@ _save_layers (GString * str, GESTimeline * timeline)
g_free (properties);
g_free (metas);
tlobjs = ges_timeline_layer_get_objects (layer);
for (tmptlobj = tlobjs; tmptlobj; tmptlobj = tmptlobj->next) {
clips = ges_timeline_layer_get_objects (layer);
for (tmpclip = clips; tmpclip; tmpclip = tmpclip->next) {
GList *effects, *tmpeffect;
tlobj = GES_TIMELINE_OBJECT (tmptlobj->data);
effects = ges_timeline_object_get_top_effects (tlobj);
clip = GES_CLIP (tmpclip->data);
effects = ges_clip_get_top_effects (clip);
/* We escape all mandatrorry properties that are handled sparetely
* and vtype for StandarTransition as it is the asset ID */
properties = _serialize_properties (G_OBJECT (tlobj),
properties = _serialize_properties (G_OBJECT (clip),
"supported-formats", "rate", "in-point", "start", "duration",
"max-duration", "priority", "vtype", "uri", NULL);
append_printf_escaped (str,
"<timeline-object id='%i' asset-id='%s'"
"<clip id='%i' asset-id='%s'"
" type-name='%s' layer-priority='%i' track-types='%i' start='%"
G_GUINT64_FORMAT "' duration='%" G_GUINT64_FORMAT "' inpoint='%"
G_GUINT64_FORMAT "' rate='%d' properties='%s' >\n", nbtlobjs,
ges_extractable_get_id (GES_EXTRACTABLE (tlobj)),
g_type_name (G_OBJECT_TYPE (tlobj)), priority,
ges_timeline_object_get_supported_formats (tlobj), _START (tlobj),
_DURATION (tlobj), _INPOINT (tlobj), 0, properties);
G_GUINT64_FORMAT "' rate='%d' properties='%s' >\n", nbclips,
ges_extractable_get_id (GES_EXTRACTABLE (clip)),
g_type_name (G_OBJECT_TYPE (clip)), priority,
ges_clip_get_supported_formats (clip), _START (clip),
_DURATION (clip), _INPOINT (clip), 0, properties);
g_free (properties);
for (tmpeffect = effects; tmpeffect; tmpeffect = tmpeffect->next)
_save_effect (str, nbtlobjs, GES_TRACK_OBJECT (tmpeffect->data),
_save_effect (str, nbclips, GES_TRACK_OBJECT (tmpeffect->data),
timeline);
g_string_append (str, "</timeline-object>\n");
nbtlobjs++;
g_string_append (str, "</clip>\n");
nbclips++;
}
g_string_append (str, "</layer>\n");
}

View file

@ -30,7 +30,7 @@
#include <ges/ges-timeline-layer.h>
#include <ges/ges-simple-timeline-layer.h>
#include <ges/ges-timeline-element.h>
#include <ges/ges-timeline-object.h>
#include <ges/ges-clip.h>
#include <ges/ges-timeline-pipeline.h>
#include <ges/ges-timeline-source.h>
#include <ges/ges-timeline-test-source.h>
@ -47,7 +47,7 @@
#include <ges/ges-timeline-file-source.h>
#include <ges/ges-screenshot.h>
#include <ges/ges-asset.h>
#include <ges/ges-asset-timeline-object.h>
#include <ges/ges-asset-clip.h>
#include <ges/ges-asset-track-object.h>
#include <ges/ges-asset-file-source.h>
#include <ges/ges-project.h>

View file

@ -30,7 +30,7 @@ main (gint argc, gchar * argv[])
GESAsset *asset;
GESTimeline *timeline;
GESTimelineLayer *layer;
GESTimelineObject *object;
GESClip *object;
GstClockTime start, start_ripple, end, end_ripple, max_rippling_time = 0,
min_rippling_time = GST_CLOCK_TIME_NONE;
@ -43,7 +43,7 @@ main (gint argc, gchar * argv[])
ges_timeline_add_layer (timeline, layer);
start = gst_util_get_timestamp ();
object = GES_TIMELINE_OBJECT (ges_timeline_layer_add_asset (layer, asset, 0,
object = GES_CLIP (ges_timeline_layer_add_asset (layer, asset, 0,
0, 1000, 1, GES_TRACK_TYPE_UNKNOWN));
for (i = 1; i < NUM_OBJECTS; i++)
@ -56,7 +56,7 @@ main (gint argc, gchar * argv[])
start_ripple = gst_util_get_timestamp ();
for (i = 1; i < 501; i++) {
start = gst_util_get_timestamp ();
ges_timeline_object_edit (object, NULL, 0, GES_EDIT_MODE_NORMAL,
ges_clip_edit (object, NULL, 0, GES_EDIT_MODE_NORMAL,
GES_EDGE_NONE, i * 1000);
end = gst_util_get_timestamp ();
max_rippling_time = MAX (max_rippling_time, end - start);
@ -75,7 +75,7 @@ main (gint argc, gchar * argv[])
start_ripple = gst_util_get_timestamp ();
for (i = 1; i < 501; i++) {
start = gst_util_get_timestamp ();
ges_timeline_object_edit (object, NULL, 0, GES_EDIT_MODE_NORMAL,
ges_clip_edit (object, NULL, 0, GES_EDIT_MODE_NORMAL,
GES_EDGE_NONE, i * 1000);
end = gst_util_get_timestamp ();
max_rippling_time = MAX (max_rippling_time, end - start);

View file

@ -34,7 +34,7 @@ check_PROGRAMS = \
ges/effects \
ges/filesource \
ges/simplelayer \
ges/timelineobject \
ges/clip \
ges/timelineedition \
ges/titles\
ges/transition \

View file

@ -7,7 +7,7 @@ overlays
save_and_load
simplelayer
text_properties
timelineobject
clip
timelineedition
titles
transition

View file

@ -39,14 +39,14 @@ GST_START_TEST (test_test_source_properties)
{
GESTrack *track;
GESTrackObject *trackobject;
GESTimelineObject *object;
GESClip *object;
ges_init ();
track = ges_track_new (GES_TRACK_TYPE_AUDIO, gst_caps_ref (GST_CAPS_ANY));
fail_unless (track != NULL);
object = (GESTimelineObject *)
object = (GESClip *)
ges_timeline_test_source_new ();
fail_unless (object != NULL);
@ -57,8 +57,8 @@ GST_START_TEST (test_test_source_properties)
assert_equals_uint64 (_DURATION (object), 51);
assert_equals_uint64 (_INPOINT (object), 12);
trackobject = ges_timeline_object_create_track_object (object, track->type);
ges_timeline_object_add_track_object (object, trackobject);
trackobject = ges_clip_create_track_object (object, track->type);
ges_clip_add_track_object (object, trackobject);
fail_unless (trackobject != NULL);
fail_unless (ges_track_object_set_track (trackobject, track));
@ -93,7 +93,7 @@ GST_START_TEST (test_test_source_properties)
gnl_object_check (ges_track_object_get_gnlobject (trackobject), 420, 510, 120,
510, 0, TRUE);
ges_timeline_object_release_track_object (object, trackobject);
ges_clip_release_track_object (object, trackobject);
g_object_unref (object);
}
@ -127,7 +127,7 @@ GST_START_TEST (test_test_source_in_layer)
g_object_set (source, "duration", (guint64) GST_SECOND, NULL);
ges_simple_timeline_layer_add_object ((GESSimpleTimelineLayer *) layer,
(GESTimelineObject *) source, 0);
(GESClip *) source, 0);
/* specifically test the vpattern property */
g_object_set (source, "vpattern", (gint) GES_VIDEO_TEST_PATTERN_WHITE, NULL);
@ -135,7 +135,7 @@ GST_START_TEST (test_test_source_in_layer)
assert_equals_int (ptrn, GES_VIDEO_TEST_PATTERN_WHITE);
trobj =
ges_timeline_object_find_track_object (GES_TIMELINE_OBJECT (source), v,
ges_clip_find_track_object (GES_CLIP (source), v,
GES_TYPE_TRACK_VIDEO_TEST_SOURCE);
g_assert (GES_IS_TRACK_VIDEO_TEST_SOURCE (trobj));
@ -147,7 +147,7 @@ GST_START_TEST (test_test_source_in_layer)
/* test audio properties as well */
trobj = ges_timeline_object_find_track_object (GES_TIMELINE_OBJECT (source),
trobj = ges_clip_find_track_object (GES_CLIP (source),
a, GES_TYPE_TRACK_AUDIO_TEST_SOURCE);
g_assert (GES_IS_TRACK_AUDIO_TEST_SOURCE (trobj));
assert_equals_float (ges_timeline_test_source_get_frequency (source), 440);
@ -185,7 +185,7 @@ GST_START_TEST (test_test_source_in_layer)
g_object_unref (trobj);
ges_timeline_layer_remove_object (layer, (GESTimelineObject *) source);
ges_timeline_layer_remove_object (layer, (GESClip *) source);
GST_DEBUG ("removing the layer");
@ -238,7 +238,7 @@ GST_START_TEST (test_gap_filling_basic)
GESTrack *track;
GESTrackObject *trackobject, *trackobject1, *trackobject2;
/*GESTimelineLayer *layer; */
GESTimelineObject *object, *object1, *object2;
GESClip *object, *object1, *object2;
GstElement *gnlsrc, *gnlsrc1, *gap = NULL;
GstElement *composition;
GList *tmp;
@ -251,7 +251,7 @@ GST_START_TEST (test_gap_filling_basic)
composition = find_composition (track);
fail_unless (composition != NULL);
object = GES_TIMELINE_OBJECT (ges_timeline_test_source_new ());
object = GES_CLIP (ges_timeline_test_source_new ());
fail_unless (object != NULL);
/* Set some properties */
@ -259,8 +259,8 @@ GST_START_TEST (test_gap_filling_basic)
assert_equals_uint64 (_START (object), 0);
assert_equals_uint64 (_DURATION (object), 5);
trackobject = ges_timeline_object_create_track_object (object, track->type);
ges_timeline_object_add_track_object (object, trackobject);
trackobject = ges_clip_create_track_object (object, track->type);
ges_clip_add_track_object (object, trackobject);
fail_unless (ges_track_add_object (track, trackobject));
fail_unless (trackobject != NULL);
@ -274,15 +274,15 @@ GST_START_TEST (test_gap_filling_basic)
/* Check no gap were wrongly added */
assert_equals_int (g_list_length (GST_BIN_CHILDREN (composition)), 1);
object1 = GES_TIMELINE_OBJECT (ges_timeline_test_source_new ());
object1 = GES_CLIP (ges_timeline_test_source_new ());
fail_unless (object1 != NULL);
g_object_set (object1, "start", (guint64) 15, "duration", (guint64) 5, NULL);
assert_equals_uint64 (_START (object1), 15);
assert_equals_uint64 (_DURATION (object1), 5);
trackobject1 = ges_timeline_object_create_track_object (object1, track->type);
ges_timeline_object_add_track_object (object1, trackobject1);
trackobject1 = ges_clip_create_track_object (object1, track->type);
ges_clip_add_track_object (object1, trackobject1);
fail_unless (ges_track_add_object (track, trackobject1));
fail_unless (trackobject1 != NULL);
gnlsrc1 = ges_track_object_get_gnlobject (trackobject1);
@ -305,11 +305,11 @@ GST_START_TEST (test_gap_filling_basic)
fail_unless (gap != NULL);
gap_object_check (gap, 5, 10, 0)
object2 = GES_TIMELINE_OBJECT (ges_timeline_test_source_new ());
object2 = GES_CLIP (ges_timeline_test_source_new ());
fail_unless (object2 != NULL);
g_object_set (object2, "start", (guint64) 35, "duration", (guint64) 5, NULL);
trackobject2 = ges_timeline_object_create_track_object (object2, track->type);
ges_timeline_object_add_track_object (object2, trackobject2);
trackobject2 = ges_clip_create_track_object (object2, track->type);
ges_clip_add_track_object (object2, trackobject2);
fail_unless (ges_track_add_object (track, trackobject2));
fail_unless (trackobject2 != NULL);
assert_equals_uint64 (_START (trackobject2), 35);

View file

@ -31,7 +31,7 @@ GST_START_TEST (test_ges_init)
GST_END_TEST;
static gboolean
my_fill_track_func (GESTimelineObject * object,
my_fill_track_func (GESClip * object,
GESTrackObject * trobject, GstElement * gnlobj, gpointer user_data)
{
GstElement *src;
@ -102,10 +102,9 @@ GST_START_TEST (test_ges_scenario)
/* The source will be floating before added to the layer... */
fail_unless (g_object_is_floating (source));
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_layer_add_object (layer, GES_CLIP (source)));
fail_if (g_object_is_floating (source));
tmp_layer = ges_timeline_object_get_layer (GES_TIMELINE_OBJECT (source));
tmp_layer = ges_clip_get_layer (GES_CLIP (source));
fail_unless (tmp_layer == layer);
/* The timeline stole our reference */
ASSERT_OBJECT_REFCOUNT (source, "source", 1);
@ -113,12 +112,11 @@ GST_START_TEST (test_ges_scenario)
ASSERT_OBJECT_REFCOUNT (layer, "layer", 1);
/* Make sure the associated TrackObject is in the Track */
trackobjects =
ges_timeline_object_get_track_objects (GES_TIMELINE_OBJECT (source));
trackobjects = ges_clip_get_track_objects (GES_CLIP (source));
fail_unless (trackobjects != NULL);
trackobject = GES_TRACK_OBJECT (trackobjects->data);
/* There are 4 references:
* 1 by the timelineobject
* 1 by the clip
* 1 by the track
* 1 by the timeline
* 1 added by the call to _get_track_objects() above */
@ -128,24 +126,22 @@ GST_START_TEST (test_ges_scenario)
}
g_list_free (trackobjects);
/* There are 3 references:
* 1 by the timelineobject
* 1 by the clip
* 1 by the timeline
* 1 by the track */
ASSERT_OBJECT_REFCOUNT (trackobject, "trackobject", 3);
GST_DEBUG ("Remove the TimelineObject from the layer");
GST_DEBUG ("Remove the Clip from the layer");
/* Now remove the timelineobject */
/* Now remove the clip */
g_object_ref (source);
ASSERT_OBJECT_REFCOUNT (layer, "layer", 1);
fail_unless (ges_timeline_layer_remove_object (layer,
GES_TIMELINE_OBJECT (source)));
fail_unless (ges_timeline_layer_remove_object (layer, GES_CLIP (source)));
ASSERT_OBJECT_REFCOUNT (source, "source", 1);
ASSERT_OBJECT_REFCOUNT (layer, "layer", 1);
tmp_layer = ges_timeline_object_get_layer (GES_TIMELINE_OBJECT (source));
tmp_layer = ges_clip_get_layer (GES_CLIP (source));
fail_unless (tmp_layer == NULL);
trackobjects =
ges_timeline_object_get_track_objects (GES_TIMELINE_OBJECT (source));
trackobjects = ges_clip_get_track_objects (GES_CLIP (source));
fail_unless (trackobjects == NULL); /* No unreffing then */
g_object_unref (source);
@ -217,8 +213,8 @@ GST_START_TEST (test_ges_timeline_add_layer)
GST_DEBUG ("Creating a source");
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)));
tmp_layer = ges_timeline_object_get_layer (GES_TIMELINE_OBJECT (s1));
fail_unless (ges_timeline_layer_add_object (layer, GES_CLIP (s1)));
tmp_layer = ges_clip_get_layer (GES_CLIP (s1));
fail_unless (tmp_layer == layer);
ASSERT_OBJECT_REFCOUNT (layer, "layer", 2);
g_object_unref (tmp_layer);
@ -226,8 +222,8 @@ GST_START_TEST (test_ges_timeline_add_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)));
tmp_layer = ges_timeline_object_get_layer (GES_TIMELINE_OBJECT (s2));
fail_unless (ges_timeline_layer_add_object (layer, GES_CLIP (s2)));
tmp_layer = ges_clip_get_layer (GES_CLIP (s2));
fail_unless (tmp_layer == layer);
ASSERT_OBJECT_REFCOUNT (layer, "layer", 2);
g_object_unref (tmp_layer);
@ -235,8 +231,8 @@ GST_START_TEST (test_ges_timeline_add_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)));
tmp_layer = ges_timeline_object_get_layer (GES_TIMELINE_OBJECT (s3));
fail_unless (ges_timeline_layer_add_object (layer, GES_CLIP (s3)));
tmp_layer = ges_clip_get_layer (GES_CLIP (s3));
fail_unless (tmp_layer == layer);
ASSERT_OBJECT_REFCOUNT (layer, "layer", 2);
g_object_unref (tmp_layer);
@ -252,12 +248,11 @@ GST_START_TEST (test_ges_timeline_add_layer)
g_list_free (layers);
/* Make sure the associated TrackObjects are in the Track */
trackobjects =
ges_timeline_object_get_track_objects (GES_TIMELINE_OBJECT (s1));
trackobjects = ges_clip_get_track_objects (GES_CLIP (s1));
fail_unless (trackobjects != NULL);
trackobject = GES_TRACK_OBJECT (trackobjects->data);
/* There are 4 references:
* 1 by the timelineobject
* 1 by the clip
* 1 by the trackobject
* 1 by the timeline
* 1 added by the call to _get_track_objects() above */
@ -267,13 +262,12 @@ GST_START_TEST (test_ges_timeline_add_layer)
}
g_list_free (trackobjects);
/* There are 3 references:
* 1 by the timelineobject
* 1 by the clip
* 1 by the timeline
* 1 by the trackobject */
ASSERT_OBJECT_REFCOUNT (trackobject, "trackobject", 3);
trackobjects =
ges_timeline_object_get_track_objects (GES_TIMELINE_OBJECT (s2));
trackobjects = ges_clip_get_track_objects (GES_CLIP (s2));
trackobject = GES_TRACK_OBJECT (trackobjects->data);
fail_unless (trackobjects != NULL);
for (tmp = trackobjects; tmp; tmp = tmp->next) {
@ -281,13 +275,12 @@ GST_START_TEST (test_ges_timeline_add_layer)
}
g_list_free (trackobjects);
/* There are 3 references:
* 1 by the timelineobject
* 1 by the clip
* 1 by the timeline
* 1 by the trackobject */
ASSERT_OBJECT_REFCOUNT (GES_TRACK_OBJECT (trackobject), "trackobject", 3);
trackobjects =
ges_timeline_object_get_track_objects (GES_TIMELINE_OBJECT (s3));
trackobjects = ges_clip_get_track_objects (GES_CLIP (s3));
trackobject = GES_TRACK_OBJECT (trackobjects->data);
fail_unless (trackobjects != NULL);
for (tmp = trackobjects; tmp; tmp = tmp->next) {
@ -295,7 +288,7 @@ GST_START_TEST (test_ges_timeline_add_layer)
}
g_list_free (trackobjects);
/* There are 3 references:
* 1 by the timelineobject
* 1 by the clip
* 1 by the timeline
* 1 by the trackobject */
ASSERT_OBJECT_REFCOUNT (trackobject, "trackobject", 3);
@ -335,24 +328,24 @@ GST_START_TEST (test_ges_timeline_add_layer_first)
GST_DEBUG ("Creating a source");
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)));
tmp_layer = ges_timeline_object_get_layer (GES_TIMELINE_OBJECT (s1));
fail_unless (ges_timeline_layer_add_object (layer, GES_CLIP (s1)));
tmp_layer = ges_clip_get_layer (GES_CLIP (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)));
tmp_layer = ges_timeline_object_get_layer (GES_TIMELINE_OBJECT (s2));
fail_unless (ges_timeline_layer_add_object (layer, GES_CLIP (s2)));
tmp_layer = ges_clip_get_layer (GES_CLIP (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)));
tmp_layer = ges_timeline_object_get_layer (GES_TIMELINE_OBJECT (s3));
fail_unless (ges_timeline_layer_add_object (layer, GES_CLIP (s3)));
tmp_layer = ges_clip_get_layer (GES_CLIP (s3));
fail_unless (tmp_layer == layer);
g_object_unref (tmp_layer);
@ -373,12 +366,11 @@ GST_START_TEST (test_ges_timeline_add_layer_first)
fail_unless ((gpointer) GST_ELEMENT_PARENT (track) == (gpointer) timeline);
/* Make sure the associated TrackObjects are in the Track */
trackobjects =
ges_timeline_object_get_track_objects (GES_TIMELINE_OBJECT (s1));
trackobjects = ges_clip_get_track_objects (GES_CLIP (s1));
fail_unless (trackobjects != NULL);
for (tmp = trackobjects; tmp; tmp = tmp->next) {
/* Each object has 4 references:
* 1 by the timelineobject
* 1 by the clip
* 1 by the track
* 1 by the timeline
* 1 added by _get_track_object() above */
@ -387,12 +379,11 @@ GST_START_TEST (test_ges_timeline_add_layer_first)
}
g_list_free (trackobjects);
trackobjects =
ges_timeline_object_get_track_objects (GES_TIMELINE_OBJECT (s2));
trackobjects = ges_clip_get_track_objects (GES_CLIP (s2));
fail_unless (trackobjects != NULL);
for (tmp = trackobjects; tmp; tmp = tmp->next) {
/* Each object has 4 references:
* 1 by the timelineobject
* 1 by the clip
* 1 by the track
* 1 by the timeline
* 1 added by _get_track_object() above */
@ -401,12 +392,11 @@ GST_START_TEST (test_ges_timeline_add_layer_first)
}
g_list_free (trackobjects);
trackobjects =
ges_timeline_object_get_track_objects (GES_TIMELINE_OBJECT (s3));
trackobjects = ges_clip_get_track_objects (GES_CLIP (s3));
fail_unless (trackobjects != NULL);
for (tmp = trackobjects; tmp; tmp = tmp->next) {
/* Each object has 4 references:
* 1 by the timelineobject
* 1 by the clip
* 1 by the track
* 1 by the timeline
* 1 added by _get_track_object() above */
@ -449,24 +439,24 @@ GST_START_TEST (test_ges_timeline_remove_track)
GST_DEBUG ("Creating a source");
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)));
tmp_layer = ges_timeline_object_get_layer (GES_TIMELINE_OBJECT (s1));
fail_unless (ges_timeline_layer_add_object (layer, GES_CLIP (s1)));
tmp_layer = ges_clip_get_layer (GES_CLIP (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)));
tmp_layer = ges_timeline_object_get_layer (GES_TIMELINE_OBJECT (s2));
fail_unless (ges_timeline_layer_add_object (layer, GES_CLIP (s2)));
tmp_layer = ges_clip_get_layer (GES_CLIP (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)));
tmp_layer = ges_timeline_object_get_layer (GES_TIMELINE_OBJECT (s3));
fail_unless (ges_timeline_layer_add_object (layer, GES_CLIP (s3)));
tmp_layer = ges_clip_get_layer (GES_CLIP (s3));
fail_unless (tmp_layer == layer);
g_object_unref (tmp_layer);
@ -488,13 +478,12 @@ GST_START_TEST (test_ges_timeline_remove_track)
fail_unless ((gpointer) GST_ELEMENT_PARENT (track) == (gpointer) timeline);
/* Make sure the associated TrackObjects are in the Track */
trackobjects =
ges_timeline_object_get_track_objects (GES_TIMELINE_OBJECT (s1));
trackobjects = ges_clip_get_track_objects (GES_CLIP (s1));
fail_unless (trackobjects != NULL);
t1 = GES_TRACK_OBJECT ((trackobjects)->data);
for (tmp = trackobjects; tmp; tmp = tmp->next) {
/* There are 4 references held:
* 1 by the timelineobject
* 1 by the clip
* 1 by the track
* 1 by the timeline
* 1 added by the call to _get_track_objects() above */
@ -510,13 +499,12 @@ GST_START_TEST (test_ges_timeline_remove_track)
* 1 added by ourselves above (g_object_ref (t1)) */
ASSERT_OBJECT_REFCOUNT (t1, "trackobject", 4);
trackobjects =
ges_timeline_object_get_track_objects (GES_TIMELINE_OBJECT (s2));
trackobjects = ges_clip_get_track_objects (GES_CLIP (s2));
fail_unless (trackobjects != NULL);
t2 = GES_TRACK_OBJECT (trackobjects->data);
for (tmp = trackobjects; tmp; tmp = tmp->next) {
/* There are 4 references held:
* 1 by the timelineobject
* 1 by the clip
* 1 by the track
* 1 by the timeline
* 1 added by the call to _get_track_objects() above */
@ -532,13 +520,12 @@ GST_START_TEST (test_ges_timeline_remove_track)
* 1 added by ourselves above (g_object_ref (t1)) */
ASSERT_OBJECT_REFCOUNT (t2, "t2", 4);
trackobjects =
ges_timeline_object_get_track_objects (GES_TIMELINE_OBJECT (s3));
trackobjects = ges_clip_get_track_objects (GES_CLIP (s3));
fail_unless (trackobjects != NULL);
t3 = GES_TRACK_OBJECT (trackobjects->data);
for (tmp = trackobjects; tmp; tmp = tmp->next) {
/* There are 4 references held:
* 1 by the timelineobject
* 1 by the clip
* 1 by the track
* 1 by the timeline
* 1 added by the call to _get_track_objects() above */
@ -577,14 +564,13 @@ typedef struct
} SelectTracksData;
static GPtrArray *
select_tracks_cb (GESTimeline * timeline, GESTimelineObject * tobj,
select_tracks_cb (GESTimeline * timeline, GESClip * tobj,
GESTrackObject * trobj, SelectTracksData * st_data)
{
GESTrack *track;
GPtrArray *ret = g_ptr_array_new ();
track = (tobj == (GESTimelineObject *) * st_data->o2) ? *st_data->tr2 :
*st_data->tr1;
track = (tobj == (GESClip *) * st_data->o2) ? *st_data->tr2 : *st_data->tr1;
gst_object_ref (track);
@ -640,24 +626,24 @@ GST_START_TEST (test_ges_timeline_multiple_tracks)
GST_DEBUG ("Creating a source");
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)));
tmp_layer = ges_timeline_object_get_layer (GES_TIMELINE_OBJECT (s1));
fail_unless (ges_timeline_layer_add_object (layer, GES_CLIP (s1)));
tmp_layer = ges_clip_get_layer (GES_CLIP (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)));
tmp_layer = ges_timeline_object_get_layer (GES_TIMELINE_OBJECT (s2));
fail_unless (ges_timeline_layer_add_object (layer, GES_CLIP (s2)));
tmp_layer = ges_clip_get_layer (GES_CLIP (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)));
tmp_layer = ges_timeline_object_get_layer (GES_TIMELINE_OBJECT (s3));
fail_unless (ges_timeline_layer_add_object (layer, GES_CLIP (s3)));
tmp_layer = ges_clip_get_layer (GES_CLIP (s3));
fail_unless (tmp_layer == layer);
g_object_unref (tmp_layer);
@ -673,13 +659,12 @@ GST_START_TEST (test_ges_timeline_multiple_tracks)
g_list_free (layers);
/* Make sure the associated TrackObjects are in the Track */
trackobjects =
ges_timeline_object_get_track_objects (GES_TIMELINE_OBJECT (s1));
trackobjects = ges_clip_get_track_objects (GES_CLIP (s1));
fail_unless (trackobjects != NULL);
t1 = GES_TRACK_OBJECT ((trackobjects)->data);
for (tmp = trackobjects; tmp; tmp = tmp->next) {
/* There are 4 references held:
* 1 by the timelineobject
* 1 by the clip
* 1 by the track
* 1 by the timeline
* 1 added by the call to _get_track_objects() above */
@ -696,13 +681,12 @@ GST_START_TEST (test_ges_timeline_multiple_tracks)
* 1 added by ourselves above (g_object_ref (t1)) */
ASSERT_OBJECT_REFCOUNT (t1, "trackobject", 4);
trackobjects =
ges_timeline_object_get_track_objects (GES_TIMELINE_OBJECT (s2));
trackobjects = ges_clip_get_track_objects (GES_CLIP (s2));
fail_unless (trackobjects != NULL);
t2 = GES_TRACK_OBJECT (trackobjects->data);
for (tmp = trackobjects; tmp; tmp = tmp->next) {
/* There are 4 references held:
* 1 by the timelineobject
* 1 by the clip
* 1 by the track
* 1 by the timeline
* 1 added by the call to _get_track_objects() above */
@ -719,13 +703,12 @@ GST_START_TEST (test_ges_timeline_multiple_tracks)
* 1 added by ourselves above (g_object_ref (t1)) */
ASSERT_OBJECT_REFCOUNT (t2, "t2", 4);
trackobjects =
ges_timeline_object_get_track_objects (GES_TIMELINE_OBJECT (s3));
trackobjects = ges_clip_get_track_objects (GES_CLIP (s3));
fail_unless (trackobjects != NULL);
t3 = GES_TRACK_OBJECT (trackobjects->data);
for (tmp = trackobjects; tmp; tmp = tmp->next) {
/* There are 4 references held:
* 1 by the timelineobject
* 1 by the clip
* 1 by the track
* 1 by the timeline
* 1 added by the call to _get_track_objects() above */

View file

@ -22,7 +22,7 @@
#include <gst/check/gstcheck.h>
static gboolean
my_fill_track_func (GESTimelineObject * object,
my_fill_track_func (GESClip * object,
GESTrackObject * trobject, GstElement * gnlobj, gpointer user_data)
{
GstElement *src;
@ -43,7 +43,7 @@ GST_START_TEST (test_object_properties)
{
GESTrack *track;
GESTrackObject *trackobject;
GESTimelineObject *object;
GESClip *object;
ges_init ();
@ -51,8 +51,7 @@ GST_START_TEST (test_object_properties)
fail_unless (track != NULL);
object =
(GESTimelineObject *) ges_custom_timeline_source_new (my_fill_track_func,
NULL);
(GESClip *) ges_custom_timeline_source_new (my_fill_track_func, NULL);
fail_unless (object != NULL);
/* Set some properties */
@ -62,8 +61,8 @@ GST_START_TEST (test_object_properties)
assert_equals_uint64 (_DURATION (object), 51);
assert_equals_uint64 (_INPOINT (object), 12);
trackobject = ges_timeline_object_create_track_object (object, track->type);
ges_timeline_object_add_track_object (object, trackobject);
trackobject = ges_clip_create_track_object (object, track->type);
ges_clip_add_track_object (object, trackobject);
fail_unless (trackobject != NULL);
fail_unless (ges_track_object_set_track (trackobject, track));
@ -99,7 +98,7 @@ GST_START_TEST (test_object_properties)
gnl_object_check (ges_track_object_get_gnlobject (trackobject), 400, 510, 120,
510, 0, TRUE);
ges_timeline_object_release_track_object (object, trackobject);
ges_clip_release_track_object (object, trackobject);
g_object_unref (object);
g_object_unref (track);
@ -111,7 +110,7 @@ GST_START_TEST (test_object_properties_unlocked)
{
GESTrack *track;
GESTrackObject *trackobject;
GESTimelineObject *object;
GESClip *object;
ges_init ();
@ -119,8 +118,7 @@ GST_START_TEST (test_object_properties_unlocked)
fail_unless (track != NULL);
object =
(GESTimelineObject *) ges_custom_timeline_source_new (my_fill_track_func,
NULL);
(GESClip *) ges_custom_timeline_source_new (my_fill_track_func, NULL);
fail_unless (object != NULL);
/* Set some properties */
@ -130,8 +128,8 @@ GST_START_TEST (test_object_properties_unlocked)
assert_equals_uint64 (_DURATION (object), 51);
assert_equals_uint64 (_INPOINT (object), 12);
trackobject = ges_timeline_object_create_track_object (object, track->type);
ges_timeline_object_add_track_object (object, trackobject);
trackobject = ges_clip_create_track_object (object, track->type);
ges_clip_add_track_object (object, trackobject);
fail_unless (trackobject != NULL);
fail_unless (ges_track_object_set_track (trackobject, track));
@ -147,7 +145,7 @@ GST_START_TEST (test_object_properties_unlocked)
/* This time we unlock the trackobject and make sure it doesn't propagate */
ges_track_object_set_locked (trackobject, FALSE);
/* Change more properties, they will be set on the GESTimelineObject */
/* Change more properties, they will be set on the GESClip */
g_object_set (object, "start", (guint64) 420, "duration", (guint64) 510,
"in-point", (guint64) 120, NULL);
assert_equals_uint64 (_START (object), 420);
@ -161,7 +159,7 @@ GST_START_TEST (test_object_properties_unlocked)
gnl_object_check (ges_track_object_get_gnlobject (trackobject), 42, 51, 12,
51, 0, TRUE);
/* When unlocked, moving the GESTrackObject won't move the GESTimelineObject
/* When unlocked, moving the GESTrackObject won't move the GESClip
* either */
/* This time, we move the trackobject to see if the changes move
* along to the parent and the gnonlin object */
@ -172,7 +170,7 @@ GST_START_TEST (test_object_properties_unlocked)
51, 0, TRUE);
ges_timeline_object_release_track_object (object, trackobject);
ges_clip_release_track_object (object, trackobject);
g_object_unref (object);
g_object_unref (track);
@ -184,7 +182,7 @@ GST_START_TEST (test_split_object)
{
GESTrack *track;
GESTrackObject *trackobject, *splittckobj;
GESTimelineObject *object, *splitobj;
GESClip *object, *splitobj;
GList *splittckobjs;
ges_init ();
@ -193,8 +191,7 @@ GST_START_TEST (test_split_object)
fail_unless (track != NULL);
object =
(GESTimelineObject *) ges_custom_timeline_source_new (my_fill_track_func,
NULL);
(GESClip *) ges_custom_timeline_source_new (my_fill_track_func, NULL);
fail_unless (object != NULL);
/* Set some properties */
@ -204,8 +201,8 @@ GST_START_TEST (test_split_object)
assert_equals_uint64 (_DURATION (object), 50);
assert_equals_uint64 (_INPOINT (object), 12);
trackobject = ges_timeline_object_create_track_object (object, track->type);
ges_timeline_object_add_track_object (object, trackobject);
trackobject = ges_clip_create_track_object (object, track->type);
ges_clip_add_track_object (object, trackobject);
fail_unless (trackobject != NULL);
fail_unless (ges_track_object_set_track (trackobject, track));
@ -218,8 +215,8 @@ GST_START_TEST (test_split_object)
gnl_object_check (ges_track_object_get_gnlobject (trackobject), 42, 50, 12,
50, 0, TRUE);
splitobj = ges_timeline_object_split (object, 67);
fail_unless (GES_IS_TIMELINE_OBJECT (splitobj));
splitobj = ges_clip_split (object, 67);
fail_unless (GES_IS_CLIP (splitobj));
assert_equals_uint64 (_START (object), 42);
assert_equals_uint64 (_DURATION (object), 25);
@ -229,7 +226,7 @@ GST_START_TEST (test_split_object)
assert_equals_uint64 (_DURATION (splitobj), 25);
assert_equals_uint64 (_INPOINT (splitobj), 37);
splittckobjs = ges_timeline_object_get_track_objects (splitobj);
splittckobjs = ges_clip_get_track_objects (splitobj);
fail_unless_equals_int (g_list_length (splittckobjs), 1);
splittckobj = GES_TRACK_OBJECT (splittckobjs->data);
@ -243,7 +240,7 @@ GST_START_TEST (test_split_object)
/* We own the only ref */
ASSERT_OBJECT_REFCOUNT (splitobj, "splitobj", 1);
/* 1 ref for the TimelineObject, 1 ref for the Track and 1 in splittckobjs */
/* 1 ref for the Clip, 1 ref for the Track and 1 in splittckobjs */
ASSERT_OBJECT_REFCOUNT (splittckobj, "splittckobj", 3);
g_object_unref (track);
@ -259,8 +256,8 @@ GST_END_TEST;
static Suite *
ges_suite (void)
{
Suite *s = suite_create ("ges-timeline-object");
TCase *tc_chain = tcase_create ("timeline-object");
Suite *s = suite_create ("ges-clip");
TCase *tc_chain = tcase_create ("clip");
suite_add_tcase (s, tc_chain);

View file

@ -21,8 +21,7 @@
#include <ges/ges.h>
#include <gst/check/gstcheck.h>
void
effect_added_cb (GESTimelineObject * obj, GESTrackEffect * trop, gpointer data);
void effect_added_cb (GESClip * obj, GESTrackEffect * trop, gpointer data);
void
deep_prop_changed_cb (GESTrackObject * obj, GstElement * element,
GParamSpec * spec);
@ -40,7 +39,7 @@ GST_START_TEST (test_effect_basic)
GST_END_TEST;
GST_START_TEST (test_add_effect_to_tl_object)
GST_START_TEST (test_add_effect_to_clip)
{
GESTimeline *timeline;
GESTimelineLayer *layer;
@ -64,7 +63,7 @@ GST_START_TEST (test_add_effect_to_tl_object)
g_object_set (source, "duration", 10 * GST_SECOND, NULL);
ges_simple_timeline_layer_add_object ((GESSimpleTimelineLayer *) (layer),
(GESTimelineObject *) source, 0);
(GESClip *) source, 0);
GST_DEBUG ("Create effect");
@ -73,14 +72,14 @@ GST_START_TEST (test_add_effect_to_tl_object)
fail_unless (GES_IS_TRACK_EFFECT (track_effect));
fail_unless (ges_timeline_object_add_track_object (GES_TIMELINE_OBJECT
fail_unless (ges_clip_add_track_object (GES_CLIP
(source), GES_TRACK_OBJECT (track_effect)));
fail_unless (ges_track_add_object (track_video,
GES_TRACK_OBJECT (track_effect)));
assert_equals_int (GES_TRACK_OBJECT (track_effect)->active, TRUE);
ges_timeline_layer_remove_object (layer, (GESTimelineObject *) source);
ges_timeline_layer_remove_object (layer, (GESClip *) source);
g_object_unref (timeline);
}
@ -96,7 +95,7 @@ GST_START_TEST (test_get_effects_from_tl)
GESTimelineTestSource *source;
GList *effects, *tmp = NULL;
gint effect_prio = -1;
guint tl_object_height = 0;
guint clip_height = 0;
ges_init ();
@ -112,7 +111,7 @@ GST_START_TEST (test_get_effects_from_tl)
g_object_set (source, "duration", 10 * GST_SECOND, NULL);
ges_simple_timeline_layer_add_object ((GESSimpleTimelineLayer *) (layer),
(GESTimelineObject *) source, 0);
(GESClip *) source, 0);
GST_DEBUG ("Create effect");
@ -124,30 +123,28 @@ GST_START_TEST (test_get_effects_from_tl)
fail_unless (GES_IS_TRACK_EFFECT (track_effect1));
fail_unless (GES_IS_TRACK_EFFECT (track_effect2));
fail_unless (ges_timeline_object_add_track_object (GES_TIMELINE_OBJECT
fail_unless (ges_clip_add_track_object (GES_CLIP
(source), GES_TRACK_OBJECT (track_effect)));
fail_unless (ges_track_add_object (track_video,
GES_TRACK_OBJECT (track_effect)));
fail_unless (ges_timeline_object_add_track_object (GES_TIMELINE_OBJECT
fail_unless (ges_clip_add_track_object (GES_CLIP
(source), GES_TRACK_OBJECT (track_effect1)));
fail_unless (ges_track_add_object (track_video,
GES_TRACK_OBJECT (track_effect1)));
fail_unless (ges_timeline_object_add_track_object (GES_TIMELINE_OBJECT
fail_unless (ges_clip_add_track_object (GES_CLIP
(source), GES_TRACK_OBJECT (track_effect2)));
fail_unless (ges_track_add_object (track_video,
GES_TRACK_OBJECT (track_effect2)));
g_object_get (G_OBJECT (source), "height", &tl_object_height, NULL);
fail_unless (tl_object_height == 4);
g_object_get (G_OBJECT (source), "height", &clip_height, NULL);
fail_unless (clip_height == 4);
effects = ges_timeline_object_get_top_effects (GES_TIMELINE_OBJECT (source));
effects = ges_clip_get_top_effects (GES_CLIP (source));
fail_unless (g_list_length (effects) == 3);
for (tmp = effects; tmp; tmp = tmp->next) {
gint priority =
ges_timeline_object_get_top_effect_position (GES_TIMELINE_OBJECT
(source),
gint priority = ges_clip_get_top_effect_position (GES_CLIP (source),
GES_TRACK_EFFECT (tmp->data));
fail_unless (priority > effect_prio);
fail_unless (GES_IS_TRACK_EFFECT (tmp->data));
@ -157,22 +154,22 @@ GST_START_TEST (test_get_effects_from_tl)
}
g_list_free (effects);
ges_timeline_layer_remove_object (layer, (GESTimelineObject *) source);
ges_timeline_layer_remove_object (layer, (GESClip *) source);
g_object_unref (timeline);
}
GST_END_TEST;
GST_START_TEST (test_tl_effect)
GST_START_TEST (test_effect_clip)
{
GESTimeline *timeline;
GESTimelineLayer *layer;
GESTrack *track_audio, *track_video;
GESTimelineParseLaunchEffect *tl_effect;
GESTimelineParseLaunchEffect *effect_clip;
GESTrackParseLaunchEffect *tck_effect, *tck_effect1;
GList *effects, *tmp;
gint i, tl_object_height;
gint i, clip_height;
gint effect_prio = -1;
/* FIXME the order of track type is not well defined */
guint track_type[4] = { GES_TRACK_TYPE_AUDIO,
@ -192,64 +189,61 @@ GST_START_TEST (test_tl_effect)
ges_timeline_add_layer (timeline, layer);
GST_DEBUG ("Create effect");
tl_effect = ges_timeline_parse_launch_effect_new ("identity", "identity");
effect_clip = ges_timeline_parse_launch_effect_new ("identity", "identity");
g_object_set (tl_effect, "duration", 25 * GST_SECOND, NULL);
g_object_set (effect_clip, "duration", 25 * GST_SECOND, NULL);
ges_simple_timeline_layer_add_object ((GESSimpleTimelineLayer *) (layer),
(GESTimelineObject *) tl_effect, 0);
(GESClip *) effect_clip, 0);
tck_effect = ges_track_parse_launch_effect_new ("identity");
fail_unless (ges_timeline_object_add_track_object (GES_TIMELINE_OBJECT
(tl_effect), GES_TRACK_OBJECT (tck_effect)));
fail_unless (ges_clip_add_track_object (GES_CLIP
(effect_clip), GES_TRACK_OBJECT (tck_effect)));
fail_unless (ges_track_add_object (track_video,
GES_TRACK_OBJECT (tck_effect)));
g_object_get (tl_effect, "height", &tl_object_height, NULL);
assert_equals_int (tl_object_height, 3);
g_object_get (effect_clip, "height", &clip_height, NULL);
assert_equals_int (clip_height, 3);
tck_effect1 = ges_track_parse_launch_effect_new ("identity");
fail_unless (ges_timeline_object_add_track_object (GES_TIMELINE_OBJECT
(tl_effect), GES_TRACK_OBJECT (tck_effect1)));
fail_unless (ges_clip_add_track_object (GES_CLIP
(effect_clip), GES_TRACK_OBJECT (tck_effect1)));
fail_unless (ges_track_add_object (track_audio,
GES_TRACK_OBJECT (tck_effect1)));
g_object_get (tl_effect, "height", &tl_object_height, NULL);
assert_equals_int (tl_object_height, 4);
g_object_get (effect_clip, "height", &clip_height, NULL);
assert_equals_int (clip_height, 4);
effects =
ges_timeline_object_get_top_effects (GES_TIMELINE_OBJECT (tl_effect));
effects = ges_clip_get_top_effects (GES_CLIP (effect_clip));
for (tmp = effects, i = 0; tmp; tmp = tmp->next, i++) {
gint priority =
ges_timeline_object_get_top_effect_position (GES_TIMELINE_OBJECT
(tl_effect),
gint priority = ges_clip_get_top_effect_position (GES_CLIP (effect_clip),
GES_TRACK_EFFECT (tmp->data));
fail_unless (priority > effect_prio);
fail_unless (GES_IS_TRACK_EFFECT (tmp->data));
fail_unless (ges_track_object_get_track (GES_TRACK_OBJECT (tmp->data))->
type == track_type[i]);
fail_unless (ges_track_object_get_track (GES_TRACK_OBJECT (tmp->
data))->type == track_type[i]);
effect_prio = priority;
g_object_unref (tmp->data);
}
g_list_free (effects);
ges_timeline_layer_remove_object (layer, (GESTimelineObject *) tl_effect);
ges_timeline_layer_remove_object (layer, (GESClip *) effect_clip);
g_object_unref (timeline);
}
GST_END_TEST;
GST_START_TEST (test_priorities_tl_object)
GST_START_TEST (test_priorities_clip)
{
GESTimeline *timeline;
GESTimelineLayer *layer;
GESTrack *track_audio, *track_video;
GESTimelineParseLaunchEffect *tl_effect;
GESTimelineParseLaunchEffect *effect_clip;
GESTrackParseLaunchEffect *tck_effect, *tck_effect1;
GList *effects, *tmp;
gint i, tl_object_height;
gint i, clip_height;
gint effect_prio = -1;
ges_init ();
@ -264,46 +258,43 @@ GST_START_TEST (test_priorities_tl_object)
ges_timeline_add_layer (timeline, layer);
GST_DEBUG ("Create effect");
tl_effect = ges_timeline_parse_launch_effect_new ("identity", "identity");
effect_clip = ges_timeline_parse_launch_effect_new ("identity", "identity");
g_object_set (tl_effect, "duration", 25 * GST_SECOND, NULL);
g_object_set (effect_clip, "duration", 25 * GST_SECOND, NULL);
ges_simple_timeline_layer_add_object ((GESSimpleTimelineLayer *) (layer),
(GESTimelineObject *) tl_effect, 0);
(GESClip *) effect_clip, 0);
tck_effect = ges_track_parse_launch_effect_new ("identity");
fail_unless (ges_timeline_object_add_track_object (GES_TIMELINE_OBJECT
(tl_effect), GES_TRACK_OBJECT (tck_effect)));
fail_unless (ges_clip_add_track_object (GES_CLIP
(effect_clip), GES_TRACK_OBJECT (tck_effect)));
fail_unless (ges_track_add_object (track_video,
GES_TRACK_OBJECT (tck_effect)));
g_object_get (tl_effect, "height", &tl_object_height, NULL);
fail_unless (tl_object_height == 3);
g_object_get (effect_clip, "height", &clip_height, NULL);
fail_unless (clip_height == 3);
tck_effect1 = ges_track_parse_launch_effect_new ("identity");
fail_unless (ges_timeline_object_add_track_object (GES_TIMELINE_OBJECT
(tl_effect), GES_TRACK_OBJECT (tck_effect1)));
fail_unless (ges_clip_add_track_object (GES_CLIP
(effect_clip), GES_TRACK_OBJECT (tck_effect1)));
fail_unless (ges_track_add_object (track_audio,
GES_TRACK_OBJECT (tck_effect1)));
fail_unless (ges_timeline_object_set_top_effect_priority (GES_TIMELINE_OBJECT
(tl_effect), GES_TRACK_EFFECT (tck_effect1), 0));
fail_unless (ges_clip_set_top_effect_priority (GES_CLIP
(effect_clip), GES_TRACK_EFFECT (tck_effect1), 0));
fail_unless (_PRIORITY (tck_effect), 3);
fail_unless (ges_timeline_object_set_top_effect_priority (GES_TIMELINE_OBJECT
(tl_effect), GES_TRACK_EFFECT (tck_effect1), 3));
fail_unless (ges_clip_set_top_effect_priority (GES_CLIP
(effect_clip), GES_TRACK_EFFECT (tck_effect1), 3));
fail_unless (_PRIORITY (tck_effect) == 2);
g_object_get (tl_effect, "height", &tl_object_height, NULL);
fail_unless (tl_object_height == 4);
g_object_get (effect_clip, "height", &clip_height, NULL);
fail_unless (clip_height == 4);
effects =
ges_timeline_object_get_top_effects (GES_TIMELINE_OBJECT (tl_effect));
effects = ges_clip_get_top_effects (GES_CLIP (effect_clip));
for (tmp = effects, i = 0; tmp; tmp = tmp->next, i++) {
gint priority =
ges_timeline_object_get_top_effect_position (GES_TIMELINE_OBJECT
(tl_effect),
gint priority = ges_clip_get_top_effect_position (GES_CLIP (effect_clip),
GES_TRACK_EFFECT (tmp->data));
fail_unless (priority > effect_prio);
fail_unless (GES_IS_TRACK_EFFECT (tmp->data));
@ -313,7 +304,7 @@ GST_START_TEST (test_priorities_tl_object)
}
g_list_free (effects);
ges_timeline_layer_remove_object (layer, (GESTimelineObject *) tl_effect);
ges_timeline_layer_remove_object (layer, (GESClip *) effect_clip);
g_object_unref (timeline);
}
@ -325,7 +316,7 @@ GST_START_TEST (test_track_effect_set_properties)
GESTimeline *timeline;
GESTimelineLayer *layer;
GESTrack *track_video;
GESTimelineParseLaunchEffect *tl_effect;
GESTimelineParseLaunchEffect *effect_clip;
GESTrackObject *tck_effect;
guint scratch_line, n_props, i;
gboolean color_aging;
@ -343,16 +334,15 @@ GST_START_TEST (test_track_effect_set_properties)
ges_timeline_add_layer (timeline, layer);
GST_DEBUG ("Create effect");
tl_effect = ges_timeline_parse_launch_effect_new ("agingtv", NULL);
effect_clip = ges_timeline_parse_launch_effect_new ("agingtv", NULL);
g_object_set (tl_effect, "duration", 25 * GST_SECOND, NULL);
g_object_set (effect_clip, "duration", 25 * GST_SECOND, NULL);
ges_simple_timeline_layer_add_object ((GESSimpleTimelineLayer *) (layer),
(GESTimelineObject *) tl_effect, 0);
(GESClip *) effect_clip, 0);
tck_effect = GES_TRACK_OBJECT (ges_track_parse_launch_effect_new ("agingtv"));
fail_unless (ges_timeline_object_add_track_object (GES_TIMELINE_OBJECT
(tl_effect), tck_effect));
fail_unless (ges_clip_add_track_object (GES_CLIP (effect_clip), tck_effect));
fail_unless (ges_track_add_object (track_video, tck_effect));
ges_track_object_set_child_properties (tck_effect,
@ -385,7 +375,7 @@ GST_START_TEST (test_track_effect_set_properties)
}
g_free (pspecs);
ges_timeline_layer_remove_object (layer, (GESTimelineObject *) tl_effect);
ges_timeline_layer_remove_object (layer, (GESClip *) effect_clip);
g_object_unref (timeline);
}
@ -393,10 +383,10 @@ GST_START_TEST (test_track_effect_set_properties)
GST_END_TEST;
void
effect_added_cb (GESTimelineObject * obj, GESTrackEffect * trop, gpointer data)
effect_added_cb (GESClip * obj, GESTrackEffect * trop, gpointer data)
{
GST_DEBUG ("Effect added");
fail_unless (GES_IS_TIMELINE_OBJECT (obj));
fail_unless (GES_IS_CLIP (obj));
fail_unless (GES_IS_TRACK_EFFECT (trop));
}
@ -409,12 +399,12 @@ deep_prop_changed_cb (GESTrackObject * obj, GstElement * element,
fail_unless (GST_IS_ELEMENT (element));
}
GST_START_TEST (test_tl_obj_signals)
GST_START_TEST (test_clip_signals)
{
GESTimeline *timeline;
GESTimelineLayer *layer;
GESTrack *track_video;
GESTimelineParseLaunchEffect *tl_effect;
GESTimelineParseLaunchEffect *effect_clip;
GESTrackParseLaunchEffect *tck_effect;
GValue val = { 0, };
@ -428,18 +418,18 @@ GST_START_TEST (test_tl_obj_signals)
ges_timeline_add_layer (timeline, layer);
GST_DEBUG ("Create effect");
tl_effect = ges_timeline_parse_launch_effect_new ("agingtv", NULL);
g_signal_connect (tl_effect, "effect-added", (GCallback) effect_added_cb,
tl_effect);
effect_clip = ges_timeline_parse_launch_effect_new ("agingtv", NULL);
g_signal_connect (effect_clip, "effect-added", (GCallback) effect_added_cb,
effect_clip);
g_object_set (tl_effect, "duration", 25 * GST_SECOND, NULL);
g_object_set (effect_clip, "duration", 25 * GST_SECOND, NULL);
ges_simple_timeline_layer_add_object ((GESSimpleTimelineLayer *) (layer),
(GESTimelineObject *) tl_effect, 0);
(GESClip *) effect_clip, 0);
tck_effect = ges_track_parse_launch_effect_new ("agingtv");
fail_unless (ges_timeline_object_add_track_object (GES_TIMELINE_OBJECT
(tl_effect), GES_TRACK_OBJECT (tck_effect)));
fail_unless (ges_clip_add_track_object (GES_CLIP
(effect_clip), GES_TRACK_OBJECT (tck_effect)));
fail_unless (ges_track_add_object (track_video,
GES_TRACK_OBJECT (tck_effect)));
g_signal_connect (tck_effect, "deep-notify", (GCallback) deep_prop_changed_cb,
@ -454,7 +444,7 @@ GST_START_TEST (test_tl_obj_signals)
fail_unless (G_VALUE_HOLDS_UINT (&val));
g_value_unset (&val);
ges_timeline_layer_remove_object (layer, (GESTimelineObject *) tl_effect);
ges_timeline_layer_remove_object (layer, (GESClip *) effect_clip);
g_object_unref (timeline);
}
@ -469,12 +459,12 @@ ges_suite (void)
suite_add_tcase (s, tc_chain);
tcase_add_test (tc_chain, test_effect_basic);
tcase_add_test (tc_chain, test_add_effect_to_tl_object);
tcase_add_test (tc_chain, test_add_effect_to_clip);
tcase_add_test (tc_chain, test_get_effects_from_tl);
tcase_add_test (tc_chain, test_tl_effect);
tcase_add_test (tc_chain, test_priorities_tl_object);
tcase_add_test (tc_chain, test_effect_clip);
tcase_add_test (tc_chain, test_priorities_clip);
tcase_add_test (tc_chain, test_track_effect_set_properties);
tcase_add_test (tc_chain, test_tl_obj_signals);
tcase_add_test (tc_chain, test_clip_signals);
return s;
}

View file

@ -50,10 +50,10 @@ asset_created_cb (GObject * source, GAsyncResult * res, gpointer udata)
fail_if (g_strcmp0 (ges_timeline_filesource_get_uri (tlfs), av_uri));
assert_equals_uint64 (_DURATION (tlfs), GST_SECOND);
fail_unless (ges_timeline_object_get_supported_formats
(GES_TIMELINE_OBJECT (tlfs)) & GES_TRACK_TYPE_VIDEO);
fail_unless (ges_timeline_object_get_supported_formats
(GES_TIMELINE_OBJECT (tlfs)) & GES_TRACK_TYPE_AUDIO);
fail_unless (ges_clip_get_supported_formats
(GES_CLIP (tlfs)) & GES_TRACK_TYPE_VIDEO);
fail_unless (ges_clip_get_supported_formats
(GES_CLIP (tlfs)) & GES_TRACK_TYPE_AUDIO);
tracks = ges_timeline_get_tracks (ges_timeline_layer_get_timeline (layer));
for (tmp = tracks; tmp; tmp = tmp->next) {
@ -114,14 +114,14 @@ GST_START_TEST (test_filesource_properties)
{
GESTrack *track;
GESTrackObject *trackobject;
GESTimelineObject *object;
GESClip *object;
ges_init ();
track = ges_track_new (GES_TRACK_TYPE_AUDIO, GST_CAPS_ANY);
fail_unless (track != NULL);
object = (GESTimelineObject *)
object = (GESClip *)
ges_timeline_filesource_new ((gchar *)
"crack:///there/is/no/way/this/exists");
fail_unless (object != NULL);
@ -134,8 +134,8 @@ GST_START_TEST (test_filesource_properties)
assert_equals_uint64 (_DURATION (object), 51);
assert_equals_uint64 (_INPOINT (object), 12);
trackobject = ges_timeline_object_create_track_object (object, track->type);
ges_timeline_object_add_track_object (object, trackobject);
trackobject = ges_clip_create_track_object (object, track->type);
ges_clip_add_track_object (object, trackobject);
fail_unless (trackobject != NULL);
fail_unless (ges_track_object_set_track (trackobject, track));
@ -170,7 +170,7 @@ GST_START_TEST (test_filesource_properties)
gnl_object_check (ges_track_object_get_gnlobject (trackobject), 420, 510, 120,
510, 0, TRUE);
ges_timeline_object_release_track_object (object, trackobject);
ges_clip_release_track_object (object, trackobject);
g_object_unref (object);
g_object_unref (track);
@ -181,26 +181,26 @@ GST_END_TEST;
GST_START_TEST (test_filesource_images)
{
GESTrackObject *trobj;
GESTimelineObject *tlobj;
GESTimelineFileSource *tfs;
GESClip *clip;
GESTimelineFileSource *uriclip;
GESTrack *a, *v;
ges_init ();
tfs = ges_timeline_filesource_new ((gchar *) TEST_URI);
g_object_set (G_OBJECT (tfs), "supported-formats",
uriclip = ges_timeline_filesource_new ((gchar *) TEST_URI);
g_object_set (G_OBJECT (uriclip), "supported-formats",
(GESTrackType) GES_TRACK_TYPE_AUDIO | GES_TRACK_TYPE_VIDEO, NULL);
tlobj = GES_TIMELINE_OBJECT (tfs);
clip = GES_CLIP (uriclip);
a = ges_track_audio_raw_new ();
v = ges_track_video_raw_new ();
/* set the is_image property to true then create a video track object. */
g_object_set (G_OBJECT (tfs), "is-image", TRUE, NULL);
g_object_set (G_OBJECT (uriclip), "is-image", TRUE, NULL);
/* the returned track object should be an image source */
trobj = ges_timeline_object_create_track_object (tlobj, v->type);
ges_timeline_object_add_track_object (tlobj, trobj);
trobj = ges_clip_create_track_object (clip, v->type);
ges_clip_add_track_object (clip, trobj);
fail_unless (GES_IS_TRACK_IMAGE_SOURCE (trobj));
/* The track holds a reference to the object
@ -208,15 +208,15 @@ GST_START_TEST (test_filesource_images)
ASSERT_OBJECT_REFCOUNT (trobj, "Video Track Object", 2);
ges_track_remove_object (v, trobj);
ges_timeline_object_release_track_object (tlobj, trobj);
ges_clip_release_track_object (clip, trobj);
/* the timeline object should not create any TrackObject in the audio track */
trobj = ges_timeline_object_create_track_object (tlobj, a->type);
trobj = ges_clip_create_track_object (clip, a->type);
fail_unless (trobj == NULL);
g_object_unref (a);
g_object_unref (v);
g_object_unref (tlobj);
g_object_unref (clip);
}
GST_END_TEST;

View file

@ -24,7 +24,7 @@
#define LAYER_HEIGHT 1000
static gboolean
my_fill_track_func (GESTimelineObject * object,
my_fill_track_func (GESClip * object,
GESTrackObject * trobject, GstElement * gnlobj, gpointer user_data)
{
GstElement *src;
@ -48,7 +48,7 @@ GST_START_TEST (test_layer_properties)
GESTimelineLayer *layer;
GESTrack *track;
GESTrackObject *trackobject;
GESTimelineObject *object;
GESClip *object;
ges_init ();
@ -70,8 +70,7 @@ GST_START_TEST (test_layer_properties)
fail_unless (ges_timeline_add_track (timeline, track));
object =
(GESTimelineObject *) ges_custom_timeline_source_new (my_fill_track_func,
NULL);
(GESClip *) ges_custom_timeline_source_new (my_fill_track_func, NULL);
fail_unless (object != NULL);
/* Set some properties */
@ -84,11 +83,9 @@ GST_START_TEST (test_layer_properties)
/* Add the object to the timeline */
fail_unless (g_object_is_floating (object));
fail_unless (ges_timeline_layer_add_object (layer,
GES_TIMELINE_OBJECT (object)));
fail_unless (ges_timeline_layer_add_object (layer, GES_CLIP (object)));
fail_if (g_object_is_floating (object));
trackobject = ges_timeline_object_find_track_object (object, track,
G_TYPE_NONE);
trackobject = ges_clip_find_track_object (object, track, G_TYPE_NONE);
fail_unless (trackobject != NULL);
/* This is not a SimpleLayer, therefore the properties shouldn't have changed */
@ -135,7 +132,7 @@ GST_START_TEST (test_layer_priorities)
GESTimeline *timeline;
GESTimelineLayer *layer1, *layer2, *layer3;
GESTrackObject *tckobj1, *tckobj2, *tckobj3;
GESTimelineObject *object1, *object2, *object3;
GESClip *object1, *object2, *object3;
GstElement *gnlobj1, *gnlobj2, *gnlobj3;
guint prio1, prio2, prio3;
GList *objs, *tmp;
@ -163,19 +160,16 @@ GST_START_TEST (test_layer_priorities)
fail_unless (ges_timeline_add_track (timeline, track));
object1 =
GES_TIMELINE_OBJECT (ges_custom_timeline_source_new (my_fill_track_func,
NULL));
ges_timeline_object_set_supported_formats (object1,
GES_CLIP (ges_custom_timeline_source_new (my_fill_track_func, NULL));
ges_clip_set_supported_formats (object1,
GES_TRACK_TYPE_AUDIO | GES_TRACK_TYPE_VIDEO);
object2 =
GES_TIMELINE_OBJECT (ges_custom_timeline_source_new (my_fill_track_func,
NULL));
ges_timeline_object_set_supported_formats (object2,
GES_CLIP (ges_custom_timeline_source_new (my_fill_track_func, NULL));
ges_clip_set_supported_formats (object2,
GES_TRACK_TYPE_AUDIO | GES_TRACK_TYPE_VIDEO);
object3 =
GES_TIMELINE_OBJECT (ges_custom_timeline_source_new (my_fill_track_func,
NULL));
ges_timeline_object_set_supported_formats (object3,
GES_CLIP (ges_custom_timeline_source_new (my_fill_track_func, NULL));
ges_clip_set_supported_formats (object3,
GES_TRACK_TYPE_AUDIO | GES_TRACK_TYPE_VIDEO);
fail_unless (object1 != NULL);
fail_unless (object2 != NULL);
@ -191,15 +185,15 @@ GST_START_TEST (test_layer_priorities)
/* Add objects to the timeline */
fail_unless (ges_timeline_layer_add_object (layer1, object1));
tckobj1 = ges_timeline_object_find_track_object (object1, track, G_TYPE_NONE);
tckobj1 = ges_clip_find_track_object (object1, track, G_TYPE_NONE);
fail_unless (tckobj1 != NULL);
fail_unless (ges_timeline_layer_add_object (layer2, object2));
tckobj2 = ges_timeline_object_find_track_object (object2, track, G_TYPE_NONE);
tckobj2 = ges_clip_find_track_object (object2, track, G_TYPE_NONE);
fail_unless (tckobj2 != NULL);
fail_unless (ges_timeline_layer_add_object (layer3, object3));
tckobj3 = ges_timeline_object_find_track_object (object3, track, G_TYPE_NONE);
tckobj3 = ges_clip_find_track_object (object3, track, G_TYPE_NONE);
fail_unless (tckobj3 != NULL);
assert_equals_int (_PRIORITY (object1), 0);
@ -243,8 +237,8 @@ GST_START_TEST (test_layer_priorities)
assert_equals_int (prio3, LAYER_HEIGHT * 2 - 1);
/* And move objects around */
fail_unless (ges_timeline_object_move_to_layer (object2, layer1));
fail_unless (ges_timeline_object_move_to_layer (object3, layer1));
fail_unless (ges_clip_move_to_layer (object2, layer1));
fail_unless (ges_clip_move_to_layer (object3, layer1));
objs = ges_timeline_layer_get_objects (layer1);
assert_equals_int (g_list_length (objs), 3);
@ -268,7 +262,7 @@ GST_START_TEST (test_layer_priorities)
assert_equals_int (prio3, LAYER_HEIGHT * 3 - 1);
/* And change TrackObject-s priorities and check that changes are well
* refected on it containing TimelineObject */
* refected on it containing Clip */
ges_timeline_element_set_priority (GES_TIMELINE_ELEMENT (tckobj3),
LAYER_HEIGHT * 2);
g_object_get (gnlobj3, "priority", &prio3, NULL);
@ -288,7 +282,7 @@ GST_START_TEST (test_single_layer_automatic_transition)
GESAsset *asset;
GESTimeline *timeline;
GList *objects, *current;
GESTimelineObject *transition;
GESClip *transition;
GESTimelineLayer *layer;
GESTimelineElement *src, *src1, *src2;
@ -318,12 +312,12 @@ GST_START_TEST (test_single_layer_automatic_transition)
GST_DEBUG ("Adding object from 0 -- 1000 to first layer");
src = GES_TIMELINE_ELEMENT (ges_timeline_layer_add_asset (layer, asset, 0, 0,
1000, 1, GES_TRACK_TYPE_UNKNOWN));
fail_unless (GES_IS_TIMELINE_OBJECT (src));
fail_unless (GES_IS_CLIP (src));
GST_DEBUG ("Adding object from 500 -- 1000 to first layer");
src1 = GES_TIMELINE_ELEMENT (ges_timeline_layer_add_asset (layer, asset, 500,
0, 1000, 1, GES_TRACK_TYPE_UNKNOWN));
fail_unless (GES_IS_TIMELINE_OBJECT (src1));
fail_unless (GES_IS_CLIP (src1));
/*
* 500__transition__1000
@ -401,7 +395,7 @@ GST_START_TEST (test_single_layer_automatic_transition)
GST_DEBUG ("Trimming second source to 500 no transition should be created "
"as they have the same end");
ges_timeline_object_edit (GES_TIMELINE_OBJECT (src1), NULL, -1,
ges_clip_edit (GES_CLIP (src1), NULL, -1,
GES_EDIT_MODE_TRIM, GES_EDGE_START, 500);
/* 250___________src_________1250
@ -625,7 +619,7 @@ GST_START_TEST (test_single_layer_automatic_transition)
g_list_free_full (objects, gst_object_unref);
GST_DEBUG ("Set third object start to 1000, Transition should be updated");
ges_timeline_object_edit (GES_TIMELINE_OBJECT (src2), NULL, -1,
ges_clip_edit (GES_CLIP (src2), NULL, -1,
GES_EDIT_MODE_NORMAL, GES_EDGE_START, 1000);
/* 600____src___1100
* !_tr__^
@ -687,7 +681,7 @@ GST_START_TEST (test_multi_layer_automatic_transition)
GESAsset *asset;
GESTimeline *timeline;
GList *objects, *current;
GESTimelineObject *transition;
GESClip *transition;
GESTimelineLayer *layer, *layer1;
GESTimelineElement *src, *src1, *src2, *src3;
@ -722,12 +716,12 @@ GST_START_TEST (test_multi_layer_automatic_transition)
GST_DEBUG ("Adding object from 0 -- 1000 to first layer");
src = GES_TIMELINE_ELEMENT (ges_timeline_layer_add_asset (layer, asset, 0, 0,
1000, 1, GES_TRACK_TYPE_UNKNOWN));
fail_unless (GES_IS_TIMELINE_OBJECT (src));
fail_unless (GES_IS_CLIP (src));
GST_DEBUG ("Adding object from 500 -- 1000 to first layer");
src1 = GES_TIMELINE_ELEMENT (ges_timeline_layer_add_asset (layer, asset, 500,
0, 1000, 1, GES_TRACK_TYPE_UNKNOWN));
fail_unless (GES_IS_TIMELINE_OBJECT (src1));
fail_unless (GES_IS_CLIP (src1));
/*
* 500__transition__1000
@ -918,7 +912,7 @@ GST_START_TEST (test_multi_layer_automatic_transition)
ASSERT_OBJECT_REFCOUNT (transition, "Only the layer owns a ref", 1);
GST_DEBUG ("Moving src3 to first layer, should add a transition");
ges_timeline_object_move_to_layer (GES_TIMELINE_OBJECT (src3), layer);
ges_clip_move_to_layer (GES_CLIP (src3), layer);
/* 500__transition__1000
* 0___________src_________1000
@ -985,7 +979,7 @@ GST_START_TEST (test_multi_layer_automatic_transition)
GST_DEBUG
("Moving src to second layer, should remove first transition on first layer");
ges_timeline_object_move_to_layer (GES_TIMELINE_OBJECT (src), layer1);
ges_clip_move_to_layer (GES_CLIP (src), layer1);
/* 500___________src1_________1500
* 1000___________src3_________2000 Layer
@ -1035,7 +1029,7 @@ GST_START_TEST (test_multi_layer_automatic_transition)
ASSERT_OBJECT_REFCOUNT (transition, "Only the layer owns a ref", 1);
GST_DEBUG ("Edit src to first layer start=1500");
ges_timeline_object_edit (GES_TIMELINE_OBJECT (src), NULL, 0,
ges_clip_edit (GES_CLIP (src), NULL, 0,
GES_EDIT_MODE_NORMAL, GES_EDGE_NONE, 1500);
/* 1500___________src_________2500
* 1500______tr______2000
@ -1100,7 +1094,7 @@ GST_START_TEST (test_multi_layer_automatic_transition)
ASSERT_OBJECT_REFCOUNT (transition, "Only the layer owns a ref", 1);
GST_DEBUG ("Ripple src1 to 700");
ges_timeline_object_edit (GES_TIMELINE_OBJECT (src1), NULL, 0,
ges_clip_edit (GES_CLIP (src1), NULL, 0,
GES_EDIT_MODE_RIPPLE, GES_EDGE_NONE, 700);
/* 1700___________src_________2700
* 1700__tr__2000
@ -1175,7 +1169,7 @@ GST_START_TEST (test_layer_activate_automatic_transition)
GESTimeline *timeline;
GESTimelineLayer *layer;
GList *objects, *current;
GESTimelineObject *transition;
GESClip *transition;
GESTimelineElement *src, *src1, *src2, *src3;
ges_init ();
@ -1197,22 +1191,22 @@ GST_START_TEST (test_layer_activate_automatic_transition)
GST_DEBUG ("Adding object from 0 -- 1000 to layer");
src = GES_TIMELINE_ELEMENT (ges_timeline_layer_add_asset (layer, asset, 0, 0,
1000, 1, GES_TRACK_TYPE_UNKNOWN));
fail_unless (GES_IS_TIMELINE_OBJECT (src));
fail_unless (GES_IS_CLIP (src));
GST_DEBUG ("Adding object from 500 -- 1000 to first layer");
src1 = GES_TIMELINE_ELEMENT (ges_timeline_layer_add_asset (layer, asset, 500,
0, 1000, 1, GES_TRACK_TYPE_UNKNOWN));
fail_unless (GES_IS_TIMELINE_OBJECT (src1));
fail_unless (GES_IS_CLIP (src1));
GST_DEBUG ("Adding object from 1000 -- 2000 to layer");
src2 = GES_TIMELINE_ELEMENT (ges_timeline_layer_add_asset (layer, asset, 1000,
0, 1000, 1, GES_TRACK_TYPE_UNKNOWN));
fail_unless (GES_IS_TIMELINE_OBJECT (src2));
fail_unless (GES_IS_CLIP (src2));
GST_DEBUG ("Adding object from 2000 -- 2500 to layer");
src3 = GES_TIMELINE_ELEMENT (ges_timeline_layer_add_asset (layer, asset, 2000,
0, 500, 1, GES_TRACK_TYPE_UNKNOWN));
fail_unless (GES_IS_TIMELINE_OBJECT (src3));
fail_unless (GES_IS_CLIP (src3));
/*
* 0___________src_________1000
@ -1238,10 +1232,10 @@ GST_START_TEST (test_layer_activate_automatic_transition)
GST_DEBUG ("Adding transition from 1000 -- 1500 to layer");
transition =
GES_TIMELINE_OBJECT (ges_timeline_layer_add_asset (layer,
GES_CLIP (ges_timeline_layer_add_asset (layer,
transition_asset, 1000, 0, 500, 1, GES_TRACK_TYPE_VIDEO));
fail_unless (GES_IS_TIMELINE_STANDARD_TRANSITION (transition));
objects = ges_timeline_object_get_track_objects (transition);
objects = ges_clip_get_track_objects (transition);
assert_equals_int (g_list_length (objects), 1);
g_list_free_full (objects, gst_object_unref);

View file

@ -39,14 +39,14 @@ GST_START_TEST (test_overlay_properties)
{
GESTrack *track;
GESTrackObject *trackobject;
GESTimelineObject *object;
GESClip *object;
ges_init ();
track = ges_track_new (GES_TRACK_TYPE_VIDEO, gst_caps_ref (GST_CAPS_ANY));
fail_unless (track != NULL);
object = (GESTimelineObject *)
object = (GESClip *)
ges_timeline_text_overlay_new ();
fail_unless (object != NULL);
@ -57,8 +57,8 @@ GST_START_TEST (test_overlay_properties)
assert_equals_uint64 (_DURATION (object), 51);
assert_equals_uint64 (_INPOINT (object), 12);
trackobject = ges_timeline_object_create_track_object (object, track->type);
ges_timeline_object_add_track_object (object, trackobject);
trackobject = ges_clip_create_track_object (object, track->type);
ges_clip_add_track_object (object, trackobject);
fail_unless (trackobject != NULL);
fail_unless (ges_track_object_set_track (trackobject, track));
@ -85,7 +85,7 @@ GST_START_TEST (test_overlay_properties)
gnl_object_check (ges_track_object_get_gnlobject (trackobject), 420, 510, 120,
510, 0, TRUE);
ges_timeline_object_release_track_object (object, trackobject);
ges_clip_release_track_object (object, trackobject);
g_object_unref (object);
}
@ -120,7 +120,7 @@ GST_START_TEST (test_overlay_in_layer)
g_object_set (source, "duration", (guint64) GST_SECOND, NULL);
ges_simple_timeline_layer_add_object ((GESSimpleTimelineLayer *) layer,
(GESTimelineObject *) source, 0);
(GESClip *) source, 0);
/* specifically test the text property */
g_object_set (source, "text", (gchar *) "some text", NULL);
@ -128,9 +128,7 @@ GST_START_TEST (test_overlay_in_layer)
assert_equals_string ("some text", text);
g_free (text);
trobj =
ges_timeline_object_find_track_object (GES_TIMELINE_OBJECT (source), v,
G_TYPE_NONE);
trobj = ges_clip_find_track_object (GES_CLIP (source), v, G_TYPE_NONE);
/* test the font-desc property */
g_object_set (source, "font-desc", (gchar *) "sans 72", NULL);
@ -181,7 +179,7 @@ GST_START_TEST (test_overlay_in_layer)
GST_DEBUG ("removing the source");
ges_timeline_layer_remove_object (layer, (GESTimelineObject *) source);
ges_timeline_layer_remove_object (layer, (GESClip *) source);
GST_DEBUG ("removing the layer");

View file

@ -198,25 +198,25 @@ _test_project (GESProject * project, GESTimeline * timeline)
GESTrack *track;
const GList *profiles;
GstEncodingContainerProfile *profile;
GList *tracks, *tmp, *tmptckobj, *tlobjs;
GList *tracks, *tmp, *tmptckobj, *clips;
fail_unless (GES_IS_TIMELINE (timeline));
assert_equals_int (g_list_length (timeline->layers), 2);
assert_equals_string (ges_meta_container_get_string (GES_META_CONTAINER
(project), "name"), "Example project");
tlobjs =
ges_timeline_layer_get_objects (GES_TIMELINE_LAYER (timeline->
layers->data));
fail_unless (ges_meta_container_get_uint (GES_META_CONTAINER
(timeline->layers->data), "a", &a_meta));
clips =
ges_timeline_layer_get_objects (GES_TIMELINE_LAYER (timeline->layers->
data));
fail_unless (ges_meta_container_get_uint (GES_META_CONTAINER (timeline->
layers->data), "a", &a_meta));
assert_equals_int (a_meta, 3);
assert_equals_int (g_list_length (tlobjs), 1);
assert_equals_int (g_list_length (clips), 1);
media_uri = ges_test_file_uri ("audio_video.ogg");
assert_equals_string (ges_asset_get_id (ges_extractable_get_asset
(GES_EXTRACTABLE (tlobjs->data))), media_uri);
(GES_EXTRACTABLE (clips->data))), media_uri);
g_free (media_uri);
g_list_free_full (tlobjs, gst_object_unref);
g_list_free_full (clips, gst_object_unref);
/* Check tracks and the objects they contain */
tracks = ges_timeline_get_tracks (timeline);

View file

@ -22,7 +22,7 @@
#include <gst/check/gstcheck.h>
static gboolean
my_fill_track_func (GESTimelineObject * object,
my_fill_track_func (GESClip * object,
GESTrackObject * trobject, GstElement * gnlobj, gpointer user_data)
{
GstElement *src;
@ -41,7 +41,7 @@ my_fill_track_func (GESTimelineObject * object,
}
static gboolean
arbitrary_fill_track_func (GESTimelineObject * object,
arbitrary_fill_track_func (GESClip * object,
GESTrackObject * trobject, GstElement * gnlobj, gpointer user_data)
{
GstElement *src;
@ -67,7 +67,7 @@ GST_START_TEST (test_gsl_add)
GESTimelineLayer *layer;
GESTrack *track;
GESCustomTimelineSource *source;
GESTimelineObject *source2;
GESClip *source2;
gint result;
ges_init ();
@ -87,9 +87,8 @@ GST_START_TEST (test_gsl_add)
fail_unless_equals_uint64 (_START (source), 42);
fail_unless (ges_simple_timeline_layer_add_object (GES_SIMPLE_TIMELINE_LAYER
(layer), GES_TIMELINE_OBJECT (source), -1));
fail_unless (ges_timeline_object_get_layer (GES_TIMELINE_OBJECT (source)) ==
layer);
(layer), GES_CLIP (source), -1));
fail_unless (ges_clip_get_layer (GES_CLIP (source)) == layer);
fail_unless_equals_uint64 (_DURATION (source), GST_SECOND);
fail_unless_equals_uint64 (_START (source), 0);
@ -100,7 +99,7 @@ GST_START_TEST (test_gsl_add)
source2 = ges_simple_timeline_layer_nth ((GESSimpleTimelineLayer *) layer, 2);
fail_if (source2);
source2 = ges_simple_timeline_layer_nth ((GESSimpleTimelineLayer *) layer, 0);
fail_unless ((GESTimelineObject *) source == source2);
fail_unless ((GESClip *) source == source2);
/* test position */
@ -108,11 +107,10 @@ GST_START_TEST (test_gsl_add)
source2);
fail_unless_equals_int (result, 0);
result = ges_simple_timeline_layer_index ((GESSimpleTimelineLayer *) layer,
(GESTimelineObject *) NULL);
(GESClip *) NULL);
fail_unless_equals_int (result, -1);
fail_unless (ges_timeline_layer_remove_object (layer,
GES_TIMELINE_OBJECT (source)));
fail_unless (ges_timeline_layer_remove_object (layer, GES_CLIP (source)));
fail_unless (ges_timeline_remove_track (timeline, track));
fail_unless (ges_timeline_remove_layer (timeline, layer));
g_object_unref (timeline);
@ -128,7 +126,7 @@ typedef struct
static void
object_moved_cb (GESSimpleTimelineLayer * layer,
GESTimelineObject * object, gint old, gint new, gpointer user)
GESClip * object, gint old, gint new, gpointer user)
{
siginfo *info;
info = (siginfo *) user;
@ -166,19 +164,19 @@ GST_START_TEST (test_gsl_move_simple)
/* Add source to any position */
GST_DEBUG ("Adding the source to the timeline layer");
fail_unless (ges_simple_timeline_layer_add_object (GES_SIMPLE_TIMELINE_LAYER
(layer), GES_TIMELINE_OBJECT (source1), -1));
(layer), GES_CLIP (source1), -1));
fail_unless_equals_uint64 (_START (source1), 0);
/* Add source2 to the end */
GST_DEBUG ("Adding the source to the timeline layer");
fail_unless (ges_simple_timeline_layer_add_object (GES_SIMPLE_TIMELINE_LAYER
(layer), GES_TIMELINE_OBJECT (source2), -1));
(layer), GES_CLIP (source2), -1));
fail_unless_equals_uint64 (_START (source1), 0);
fail_unless_equals_uint64 (_START (source2), GST_SECOND);
/* Move source2 before source 1 (newpos:0) */
fail_unless (ges_simple_timeline_layer_move_object (GES_SIMPLE_TIMELINE_LAYER
(layer), GES_TIMELINE_OBJECT (source2), 0));
(layer), GES_CLIP (source2), 0));
fail_unless_equals_uint64 (_START (source1), GST_SECOND);
fail_unless_equals_uint64 (_START (source2), 0);
fail_unless_equals_int (info.new, 0);
@ -186,7 +184,7 @@ GST_START_TEST (test_gsl_move_simple)
/* Move source2 after source 1 (newpos:0) */
fail_unless (ges_simple_timeline_layer_move_object (GES_SIMPLE_TIMELINE_LAYER
(layer), GES_TIMELINE_OBJECT (source2), 1));
(layer), GES_CLIP (source2), 1));
fail_unless_equals_uint64 (_START (source1), 0);
fail_unless_equals_uint64 (_START (source2), GST_SECOND);
fail_unless_equals_int (info.new, 1);
@ -194,7 +192,7 @@ GST_START_TEST (test_gsl_move_simple)
/* Move source1 to end (newpos:-1) */
fail_unless (ges_simple_timeline_layer_move_object (GES_SIMPLE_TIMELINE_LAYER
(layer), GES_TIMELINE_OBJECT (source1), -1));
(layer), GES_CLIP (source1), -1));
fail_unless_equals_uint64 (_START (source1), GST_SECOND);
fail_unless_equals_uint64 (_START (source2), 0);
/* position will be decremented, this is expected */
@ -203,25 +201,21 @@ GST_START_TEST (test_gsl_move_simple)
/* remove source1, source2 should be moved to the beginning */
g_object_ref (source1);
fail_unless (ges_timeline_layer_remove_object (layer,
GES_TIMELINE_OBJECT (source1)));
fail_unless (ges_timeline_layer_remove_object (layer, GES_CLIP (source1)));
fail_unless_equals_uint64 (_START (source2), 0);
g_object_set (source1, "start", (guint64) 42, NULL);
/* re-add source1... using the normal API, it should be added to the end */
fail_unless (ges_timeline_layer_add_object (layer,
GES_TIMELINE_OBJECT (source1)));
fail_unless (ges_timeline_layer_add_object (layer, GES_CLIP (source1)));
fail_unless_equals_uint64 (_START (source2), 0);
fail_unless_equals_uint64 (_START (source1), GST_SECOND);
/* remove source1 ... */
fail_unless (ges_timeline_layer_remove_object (layer,
GES_TIMELINE_OBJECT (source1)));
fail_unless (ges_timeline_layer_remove_object (layer, GES_CLIP (source1)));
fail_unless_equals_uint64 (_START (source2), 0);
/* ... and source2 */
fail_unless (ges_timeline_layer_remove_object (layer,
GES_TIMELINE_OBJECT (source2)));
fail_unless (ges_timeline_layer_remove_object (layer, GES_CLIP (source2)));
fail_unless (ges_timeline_remove_track (timeline, track));
fail_unless (ges_timeline_remove_layer (timeline, layer));
@ -280,7 +274,7 @@ GST_START_TEST (test_gsl_with_transitions)
source2 = ges_custom_timeline_source_new (arbitrary_fill_track_func,
(gpointer) ELEMENT);
g_object_set (source2, "duration", GST_SECOND, "start", (guint64) 42, NULL);
GES_TIMELINE_OBJECT (source2)->height = 4;
GES_CLIP (source2)->height = 4;
fail_unless_equals_uint64 (_DURATION (source2), GST_SECOND);
source3 = ges_custom_timeline_source_new (arbitrary_fill_track_func,
@ -348,15 +342,14 @@ GST_START_TEST (test_gsl_with_transitions)
GST_DEBUG ("Adding source1");
fail_unless (ges_simple_timeline_layer_add_object (gstl,
GES_TIMELINE_OBJECT (source1), -1));
GES_CLIP (source1), -1));
fail_unless_equals_uint64 (_DURATION (source1), GST_SECOND);
fail_unless_equals_uint64 (_START (source1), 0);
fail_unless_equals_uint64 (_PRIORITY (source1), 2);
GST_DEBUG ("Adding tr1");
fail_unless (ges_simple_timeline_layer_add_object (gstl,
GES_TIMELINE_OBJECT (tr1), -1));
fail_unless (ges_simple_timeline_layer_add_object (gstl, GES_CLIP (tr1), -1));
fail_unless_equals_uint64 (_DURATION (source1), GST_SECOND);
fail_unless_equals_uint64 (_START (source1), 0);
fail_unless_equals_uint64 (_PRIORITY (source1), 2);
@ -367,7 +360,7 @@ GST_START_TEST (test_gsl_with_transitions)
GST_DEBUG ("Adding source2");
fail_unless (ges_simple_timeline_layer_add_object (gstl,
GES_TIMELINE_OBJECT (source2), -1));
GES_CLIP (source2), -1));
fail_unless_equals_uint64 (_DURATION (source1), GST_SECOND);
fail_unless_equals_uint64 (_START (source1), 0);
fail_unless_equals_uint64 (_PRIORITY (source1), 2);
@ -383,7 +376,7 @@ GST_START_TEST (test_gsl_with_transitions)
GST_DEBUG ("Adding source3");
fail_unless (ges_simple_timeline_layer_add_object (gstl,
GES_TIMELINE_OBJECT (source3), -1));
GES_CLIP (source3), -1));
fail_unless_equals_uint64 (_DURATION (source1), GST_SECOND);
fail_unless_equals_uint64 (_START (source1), 0);
fail_unless_equals_uint64 (_PRIORITY (source1), 2);
@ -401,8 +394,7 @@ GST_START_TEST (test_gsl_with_transitions)
GST_DEBUG ("Adding tr2");
fail_unless (ges_simple_timeline_layer_add_object (gstl,
GES_TIMELINE_OBJECT (tr2), 3));
fail_unless (ges_simple_timeline_layer_add_object (gstl, GES_CLIP (tr2), 3));
fail_unless_equals_uint64 (_DURATION (source1), GST_SECOND);
fail_unless_equals_uint64 (_START (source1), 0);
fail_unless_equals_uint64 (_PRIORITY (source1), 2);
@ -424,7 +416,7 @@ GST_START_TEST (test_gsl_with_transitions)
GST_DEBUG ("Adding source4");
fail_unless (ges_simple_timeline_layer_add_object (gstl,
GES_TIMELINE_OBJECT (source4), -1));
GES_CLIP (source4), -1));
fail_unless_equals_uint64 (_DURATION (source1), GST_SECOND);
fail_unless_equals_uint64 (_START (source1), 0);
fail_unless_equals_uint64 (_PRIORITY (source1), 2);
@ -449,24 +441,19 @@ GST_START_TEST (test_gsl_with_transitions)
GST_DEBUG ("Checking wrong insertion of tr3");
fail_if (ges_simple_timeline_layer_add_object (gstl,
GES_TIMELINE_OBJECT (tr3), 1));
fail_if (ges_simple_timeline_layer_add_object (gstl, GES_CLIP (tr3), 1));
fail_if (ges_simple_timeline_layer_add_object (gstl,
GES_TIMELINE_OBJECT (tr3), 2));
fail_if (ges_simple_timeline_layer_add_object (gstl, GES_CLIP (tr3), 2));
fail_if (ges_simple_timeline_layer_add_object (gstl,
GES_TIMELINE_OBJECT (tr3), 3));
fail_if (ges_simple_timeline_layer_add_object (gstl, GES_CLIP (tr3), 3));
fail_if (ges_simple_timeline_layer_add_object (gstl,
GES_TIMELINE_OBJECT (tr3), 4));
fail_if (ges_simple_timeline_layer_add_object (gstl, GES_CLIP (tr3), 4));
/* check that insertions which don't cause problems still work */
GST_DEBUG ("Checking correct insertion of tr3");
fail_unless (ges_simple_timeline_layer_add_object (gstl,
GES_TIMELINE_OBJECT (tr3), 5));
fail_unless (ges_simple_timeline_layer_add_object (gstl, GES_CLIP (tr3), 5));
/* at this point the layer should still be valid */
g_object_get (G_OBJECT (layer), "valid", &valid, NULL);
@ -475,21 +462,18 @@ GST_START_TEST (test_gsl_with_transitions)
GST_DEBUG ("Checking correct insertion of tr4");
fail_unless (ges_simple_timeline_layer_add_object (gstl,
GES_TIMELINE_OBJECT (tr4), -1));
fail_unless (ges_simple_timeline_layer_add_object (gstl, GES_CLIP (tr4), -1));
GST_DEBUG ("Checking correct insertion of tr5");
fail_unless (ges_simple_timeline_layer_add_object (gstl,
GES_TIMELINE_OBJECT (tr5), 0));
fail_unless (ges_simple_timeline_layer_add_object (gstl, GES_CLIP (tr5), 0));
/* removals which result in two or more adjacent transitions will also
* print a warning on the console. This is expected */
GST_DEBUG ("Removing source1");
fail_unless (ges_timeline_layer_remove_object (layer,
GES_TIMELINE_OBJECT (source1)));
fail_unless (ges_timeline_layer_remove_object (layer, GES_CLIP (source1)));
/* layer should now be invalid */
@ -499,12 +483,9 @@ GST_START_TEST (test_gsl_with_transitions)
GST_DEBUG ("Removing source2/3/4");
fail_unless (ges_timeline_layer_remove_object (layer,
GES_TIMELINE_OBJECT (source2)));
fail_unless (ges_timeline_layer_remove_object (layer,
GES_TIMELINE_OBJECT (source3)));
fail_unless (ges_timeline_layer_remove_object (layer,
GES_TIMELINE_OBJECT (source4)));
fail_unless (ges_timeline_layer_remove_object (layer, GES_CLIP (source2)));
fail_unless (ges_timeline_layer_remove_object (layer, GES_CLIP (source3)));
fail_unless (ges_timeline_layer_remove_object (layer, GES_CLIP (source4)));
g_object_get (G_OBJECT (layer), "valid", &valid, NULL);
fail_unless (!valid);
@ -512,16 +493,11 @@ GST_START_TEST (test_gsl_with_transitions)
GST_DEBUG ("Removing transitions");
fail_unless (ges_timeline_layer_remove_object (layer,
GES_TIMELINE_OBJECT (tr1)));
fail_unless (ges_timeline_layer_remove_object (layer,
GES_TIMELINE_OBJECT (tr2)));
fail_unless (ges_timeline_layer_remove_object (layer,
GES_TIMELINE_OBJECT (tr3)));
fail_unless (ges_timeline_layer_remove_object (layer,
GES_TIMELINE_OBJECT (tr4)));
fail_unless (ges_timeline_layer_remove_object (layer,
GES_TIMELINE_OBJECT (tr5)));
fail_unless (ges_timeline_layer_remove_object (layer, GES_CLIP (tr1)));
fail_unless (ges_timeline_layer_remove_object (layer, GES_CLIP (tr2)));
fail_unless (ges_timeline_layer_remove_object (layer, GES_CLIP (tr3)));
fail_unless (ges_timeline_layer_remove_object (layer, GES_CLIP (tr4)));
fail_unless (ges_timeline_layer_remove_object (layer, GES_CLIP (tr5)));
GST_DEBUG ("done removing transition");

View file

@ -14,14 +14,14 @@
<track track-type="2" caps="audio/x-raw" track-id="0"/>
<track track-type="4" caps="video/x-raw" track-id="1"/>
<layer priority="0" properties='properties, auto-transition=(boolean)true;' metadatas='metadatas, a=(guint)3'>
<timeline-object id="0" layer-priority='0' asset-id="file:///test/not/exisiting" type-name="GESTimelineFileSource" track-types="6" start="0" duration="1000000000">
<effect asset-id='agingtv' timeline-object-id='0' type-name='GESTrackParseLaunchEffect' track-type='4' track-id='1' metadatas='metadatas;' children-properties='properties, scratch-lines=(uint)12;'/>
</timeline-object>
<clip id="0" layer-priority='0' asset-id="file:///test/not/exisiting" type-name="GESTimelineFileSource" track-types="6" start="0" duration="1000000000">
<effect asset-id='agingtv' clip-id='0' type-name='GESTrackParseLaunchEffect' track-type='4' track-id='1' metadatas='metadatas;' children-properties='properties, scratch-lines=(uint)12;'/>
</clip>
</layer>
<layer priority="1" properties='properties, auto-transition=(boolean)true;'>
<timeline-object id="1" asset-id="file:///test/not/exisiting" layer-priority="1"
<clip id="1" asset-id="file:///test/not/exisiting" layer-priority="1"
type-name="GESTimelineFileSource" track-types="2" start="1000000000" duration="1000000000">
</timeline-object>
</clip>
</layer>
</timeline>
</project>

View file

@ -47,10 +47,10 @@ GST_START_TEST (test_text_properties_in_layer)
g_object_set (source, "duration", (guint64) GST_SECOND, NULL);
ges_simple_timeline_layer_add_object ((GESSimpleTimelineLayer *) layer,
(GESTimelineObject *) source, 0);
(GESClip *) source, 0);
trobj =
ges_timeline_object_find_track_object (GES_TIMELINE_OBJECT (source), v,
ges_clip_find_track_object (GES_CLIP (source), v,
GES_TYPE_TRACK_TEXT_OVERLAY);
fail_unless (trobj != NULL);
@ -92,7 +92,7 @@ GST_START_TEST (test_text_properties_in_layer)
GST_DEBUG ("removing the source");
ges_timeline_layer_remove_object (layer, (GESTimelineObject *) source);
ges_timeline_layer_remove_object (layer, (GESClip *) source);
GST_DEBUG ("removing the layer");

View file

@ -23,7 +23,7 @@
#include <gst/check/gstcheck.h>
static gboolean
my_fill_track_func (GESTimelineObject * object,
my_fill_track_func (GESClip * object,
GESTrackObject * trobject, GstElement * gnlobj, gpointer user_data)
{
GstElement *src;
@ -40,12 +40,10 @@ my_fill_track_func (GESTimelineObject * object,
return TRUE;
}
static inline GESTimelineObject *
create_custom_tlobj (void)
static inline GESClip *
create_custom_clip (void)
{
return
GES_TIMELINE_OBJECT (ges_custom_timeline_source_new (my_fill_track_func,
NULL));
return GES_CLIP (ges_custom_timeline_source_new (my_fill_track_func, NULL));
}
#define CHECK_OBJECT_PROPS(obj, start, inpoint, duration) {\
@ -59,7 +57,7 @@ GST_START_TEST (test_basic_timeline_edition)
GESTrack *track;
GESTimeline *timeline;
GESTrackObject *tckobj, *tckobj1, *tckobj2;
GESTimelineObject *obj, *obj1, *obj2;
GESClip *obj, *obj1, *obj2;
ges_init ();
@ -71,9 +69,9 @@ GST_START_TEST (test_basic_timeline_edition)
fail_unless (ges_timeline_add_track (timeline, track));
obj = create_custom_tlobj ();
obj1 = create_custom_tlobj ();
obj2 = create_custom_tlobj ();
obj = create_custom_clip ();
obj1 = create_custom_clip ();
obj2 = create_custom_clip ();
fail_unless (obj && obj1 && obj2);
@ -92,20 +90,20 @@ GST_START_TEST (test_basic_timeline_edition)
g_object_set (obj2, "start", (guint64) 50, "duration", (guint64) 60,
"in-point", (guint64) 0, NULL);
tckobj = ges_timeline_object_create_track_object (obj, track->type);
tckobj = ges_clip_create_track_object (obj, track->type);
fail_unless (tckobj != NULL);
fail_unless (ges_timeline_object_add_track_object (obj, tckobj));
fail_unless (ges_clip_add_track_object (obj, tckobj));
fail_unless (ges_track_add_object (track, tckobj));
assert_equals_uint64 (_DURATION (tckobj), 10);
tckobj1 = ges_timeline_object_create_track_object (obj1, track->type);
tckobj1 = ges_clip_create_track_object (obj1, track->type);
fail_unless (tckobj1 != NULL);
fail_unless (ges_timeline_object_add_track_object (obj1, tckobj1));
fail_unless (ges_clip_add_track_object (obj1, tckobj1));
fail_unless (ges_track_add_object (track, tckobj1));
assert_equals_uint64 (_DURATION (tckobj1), 10);
tckobj2 = ges_timeline_object_create_track_object (obj2, track->type);
fail_unless (ges_timeline_object_add_track_object (obj2, tckobj2));
tckobj2 = ges_clip_create_track_object (obj2, track->type);
fail_unless (ges_clip_add_track_object (obj2, tckobj2));
fail_unless (tckobj2 != NULL);
fail_unless (ges_track_add_object (track, tckobj2));
assert_equals_uint64 (_DURATION (tckobj2), 60);
@ -120,7 +118,7 @@ GST_START_TEST (test_basic_timeline_edition)
* | obj | | obj1 | | obj2 |
* time 10------- 20 --------30 60---------120
*/
fail_unless (ges_timeline_object_edit (obj, NULL, -1, GES_EDIT_MODE_RIPPLE,
fail_unless (ges_clip_edit (obj, NULL, -1, GES_EDIT_MODE_RIPPLE,
GES_EDGE_NONE, 10) == TRUE);
CHECK_OBJECT_PROPS (tckobj, 10, 0, 10);
CHECK_OBJECT_PROPS (tckobj1, 20, 0, 10);
@ -129,7 +127,7 @@ GST_START_TEST (test_basic_timeline_edition)
/* FIXME find a way to check that we are using the same MovingContext
* inside the GESTrack */
fail_unless (ges_timeline_object_edit (obj1, NULL, -1, GES_EDIT_MODE_RIPPLE,
fail_unless (ges_clip_edit (obj1, NULL, -1, GES_EDIT_MODE_RIPPLE,
GES_EDGE_NONE, 40) == TRUE);
CHECK_OBJECT_PROPS (tckobj, 10, 0, 10);
CHECK_OBJECT_PROPS (tckobj1, 40, 0, 10);
@ -138,7 +136,7 @@ GST_START_TEST (test_basic_timeline_edition)
/**
* Rippling obj1 back to: 20 (getting to the exact same timeline as before
*/
fail_unless (ges_timeline_object_edit (obj1, NULL, -1, GES_EDIT_MODE_RIPPLE,
fail_unless (ges_clip_edit (obj1, NULL, -1, GES_EDIT_MODE_RIPPLE,
GES_EDGE_NONE, 20) == TRUE);
CHECK_OBJECT_PROPS (tckobj, 10, 0, 10);
CHECK_OBJECT_PROPS (tckobj1, 20, 0, 10);
@ -154,9 +152,9 @@ GST_START_TEST (test_basic_timeline_edition)
* | obj1 27 -|-----|-37 obj2 |
* time 20-----------30 35-------------120
*/
fail_unless (ges_timeline_object_edit (obj, NULL, -1, GES_EDIT_MODE_NORMAL,
fail_unless (ges_clip_edit (obj, NULL, -1, GES_EDIT_MODE_NORMAL,
GES_EDGE_NONE, 27) == TRUE);
fail_unless (ges_timeline_object_edit (obj2, NULL, -1, GES_EDIT_MODE_NORMAL,
fail_unless (ges_clip_edit (obj2, NULL, -1, GES_EDIT_MODE_NORMAL,
GES_EDGE_NONE, 35) == TRUE);
CHECK_OBJECT_PROPS (tckobj, 27, 0, 10);
CHECK_OBJECT_PROPS (tckobj1, 20, 0, 10);
@ -172,7 +170,7 @@ GST_START_TEST (test_basic_timeline_edition)
* | obj1 | 32----|-37 obj2 |
* time 20-----------30 35-------------120
*/
fail_unless (ges_timeline_object_edit (obj, NULL, -1, GES_EDIT_MODE_TRIM,
fail_unless (ges_clip_edit (obj, NULL, -1, GES_EDIT_MODE_TRIM,
GES_EDGE_START, 32) == TRUE);
CHECK_OBJECT_PROPS (tckobj, 32, 5, 5);
CHECK_OBJECT_PROPS (tckobj1, 20, 0, 10);
@ -186,7 +184,7 @@ GST_START_TEST (test_basic_timeline_edition)
* | obj1 | 32----|-42 obj2 |
* time 20-----------30 35-------------120
*/
fail_unless (ges_timeline_object_edit (obj, NULL, -1, GES_EDIT_MODE_RIPPLE,
fail_unless (ges_clip_edit (obj, NULL, -1, GES_EDIT_MODE_RIPPLE,
GES_EDGE_END, 42) == TRUE);
CHECK_OBJECT_PROPS (tckobj, 32, 5, 10);
CHECK_OBJECT_PROPS (tckobj1, 20, 0, 10);
@ -199,9 +197,9 @@ GST_START_TEST (test_basic_timeline_edition)
* | obj1 | | obj1 || obj2 |
* time 20-------30 32--------52 ---------112
*/
fail_unless (ges_timeline_object_edit (obj2, NULL, -1, GES_EDIT_MODE_NORMAL,
fail_unless (ges_clip_edit (obj2, NULL, -1, GES_EDIT_MODE_NORMAL,
GES_EDGE_NONE, 42) == TRUE);
fail_unless (ges_timeline_object_edit (obj, NULL, -1, GES_EDIT_MODE_RIPPLE,
fail_unless (ges_clip_edit (obj, NULL, -1, GES_EDIT_MODE_RIPPLE,
GES_EDGE_END, 52) == TRUE);
CHECK_OBJECT_PROPS (tckobj, 32, 5, 20);
CHECK_OBJECT_PROPS (tckobj1, 20, 0, 10);
@ -214,7 +212,7 @@ GST_START_TEST (test_basic_timeline_edition)
* | obj1 | | obj || obj2 |
* time 20-------40 42--------62 ---------122
*/
fail_unless (ges_timeline_object_edit (obj1, NULL, -1, GES_EDIT_MODE_RIPPLE,
fail_unless (ges_clip_edit (obj1, NULL, -1, GES_EDIT_MODE_RIPPLE,
GES_EDGE_END, 40) == TRUE);
CHECK_OBJECT_PROPS (tckobj, 42, 5, 20);
CHECK_OBJECT_PROPS (tckobj1, 20, 0, 20);
@ -227,18 +225,18 @@ GST_START_TEST (test_basic_timeline_edition)
* | obj1 || obj || obj2 |
* time 20------ 25 ------ 62 ---------122
*/
fail_unless (ges_timeline_object_edit (obj, NULL, -1, GES_EDIT_MODE_TRIM,
fail_unless (ges_clip_edit (obj, NULL, -1, GES_EDIT_MODE_TRIM,
GES_EDGE_START, 40) == TRUE);
fail_unless (ges_timeline_object_edit (obj, NULL, -1, GES_EDIT_MODE_ROLL,
fail_unless (ges_clip_edit (obj, NULL, -1, GES_EDIT_MODE_ROLL,
GES_EDGE_START, 25) == TRUE);
CHECK_OBJECT_PROPS (tckobj, 25, 0, 37);
CHECK_OBJECT_PROPS (tckobj1, 20, 0, 5);
CHECK_OBJECT_PROPS (tckobj2, 62, 0, 60);
/* Make sure that not doing anything when not able to roll */
fail_unless (ges_timeline_object_edit (obj, NULL, -1, GES_EDIT_MODE_ROLL,
fail_unless (ges_clip_edit (obj, NULL, -1, GES_EDIT_MODE_ROLL,
GES_EDGE_START, 65) == TRUE);
fail_unless (ges_timeline_object_edit (obj1, NULL, -1, GES_EDIT_MODE_ROLL,
fail_unless (ges_clip_edit (obj1, NULL, -1, GES_EDIT_MODE_ROLL,
GES_EDGE_END, 65) == TRUE, 0);
CHECK_OBJECT_PROPS (tckobj, 25, 0, 37);
CHECK_OBJECT_PROPS (tckobj1, 20, 0, 5);
@ -257,7 +255,7 @@ GST_START_TEST (test_snapping)
GESTrack *track;
GESTimeline *timeline;
GESTrackObject *tckobj, *tckobj1, *tckobj2;
GESTimelineObject *obj, *obj1, *obj2;
GESClip *obj, *obj1, *obj2;
GESTimelineLayer *layer;
GList *tckobjs;
@ -271,9 +269,9 @@ GST_START_TEST (test_snapping)
fail_unless (ges_timeline_add_track (timeline, track));
obj = create_custom_tlobj ();
obj1 = create_custom_tlobj ();
obj2 = create_custom_tlobj ();
obj = create_custom_clip ();
obj1 = create_custom_clip ();
obj2 = create_custom_clip ();
fail_unless (obj && obj1 && obj2);
@ -296,7 +294,7 @@ GST_START_TEST (test_snapping)
fail_unless (ges_timeline_layer_add_object (layer, obj));
fail_unless ((tckobjs = ges_timeline_object_get_track_objects (obj)) != NULL);
fail_unless ((tckobjs = ges_clip_get_track_objects (obj)) != NULL);
fail_unless ((tckobj = GES_TRACK_OBJECT (tckobjs->data)) != NULL);
fail_unless (ges_track_object_get_track (tckobj) == track);
assert_equals_uint64 (_DURATION (tckobj), 37);
@ -307,11 +305,10 @@ GST_START_TEST (test_snapping)
ASSERT_OBJECT_REFCOUNT (tckobj, "First tckobj", 3);
/* We have 1 ref to obj1:
* + layer */
ASSERT_OBJECT_REFCOUNT (obj, "First tlobj", 1);
ASSERT_OBJECT_REFCOUNT (obj, "First clip", 1);
fail_unless (ges_timeline_layer_add_object (layer, obj1));
fail_unless ((tckobjs =
ges_timeline_object_get_track_objects (obj1)) != NULL);
fail_unless ((tckobjs = ges_clip_get_track_objects (obj1)) != NULL);
fail_unless ((tckobj1 = GES_TRACK_OBJECT (tckobjs->data)) != NULL);
fail_unless (ges_track_object_get_track (tckobj1) == track);
assert_equals_uint64 (_DURATION (tckobj1), 15);
@ -319,11 +316,10 @@ GST_START_TEST (test_snapping)
/* Same ref logic */
ASSERT_OBJECT_REFCOUNT (tckobj1, "First tckobj", 3);
ASSERT_OBJECT_REFCOUNT (obj1, "First tlobj", 1);
ASSERT_OBJECT_REFCOUNT (obj1, "First clip", 1);
fail_unless (ges_timeline_layer_add_object (layer, obj2));
fail_unless ((tckobjs =
ges_timeline_object_get_track_objects (obj2)) != NULL);
fail_unless ((tckobjs = ges_clip_get_track_objects (obj2)) != NULL);
fail_unless ((tckobj2 = GES_TRACK_OBJECT (tckobjs->data)) != NULL);
fail_unless (ges_track_object_get_track (tckobj2) == track);
assert_equals_uint64 (_DURATION (tckobj2), 60);
@ -331,18 +327,18 @@ GST_START_TEST (test_snapping)
/* Same ref logic */
ASSERT_OBJECT_REFCOUNT (tckobj2, "First tckobj", 3);
ASSERT_OBJECT_REFCOUNT (obj2, "First tlobj", 1);
ASSERT_OBJECT_REFCOUNT (obj2, "First clip", 1);
/* Snaping to edge, so no move */
g_object_set (timeline, "snapping-distance", (guint64) 3, NULL);
fail_unless (ges_timeline_object_edit (obj1, NULL, -1, GES_EDIT_MODE_TRIM,
fail_unless (ges_clip_edit (obj1, NULL, -1, GES_EDIT_MODE_TRIM,
GES_EDGE_END, 27) == TRUE);
CHECK_OBJECT_PROPS (tckobj, 25, 0, 37);
CHECK_OBJECT_PROPS (tckobj1, 20, 0, 5);
CHECK_OBJECT_PROPS (tckobj2, 62, 0, 60);
/* Snaping to edge, so no move */
fail_unless (ges_timeline_object_edit (obj1, NULL, -1, GES_EDIT_MODE_TRIM,
fail_unless (ges_clip_edit (obj1, NULL, -1, GES_EDIT_MODE_TRIM,
GES_EDGE_END, 27) == TRUE);
CHECK_OBJECT_PROPS (tckobj, 25, 0, 37);
CHECK_OBJECT_PROPS (tckobj1, 20, 0, 5);
@ -435,7 +431,7 @@ GST_START_TEST (test_snapping)
* | obj | | obj1 || obj2 |
* time 25---------62 73---------110--------170
*/
fail_unless (ges_timeline_object_edit (obj1, NULL, -1, GES_EDIT_MODE_NORMAL,
fail_unless (ges_clip_edit (obj1, NULL, -1, GES_EDIT_MODE_NORMAL,
GES_EDGE_NONE, 72) == TRUE);
CHECK_OBJECT_PROPS (tckobj, 25, 0, 37);
CHECK_OBJECT_PROPS (tckobj1, 73, 5, 37);
@ -446,7 +442,7 @@ GST_START_TEST (test_snapping)
* | obj || obj1 | | obj2 |
* time 25---------62-------- 99 110--------170
*/
fail_unless (ges_timeline_object_edit (obj1, NULL, -1, GES_EDIT_MODE_NORMAL,
fail_unless (ges_clip_edit (obj1, NULL, -1, GES_EDIT_MODE_NORMAL,
GES_EDGE_NONE, 58) == TRUE);
CHECK_OBJECT_PROPS (tckobj, 25, 0, 37);
CHECK_OBJECT_PROPS (tckobj1, 62, 5, 37);
@ -477,9 +473,9 @@ GST_START_TEST (test_snapping)
ASSERT_OBJECT_REFCOUNT (tckobj, "First tckobj", 3);
ASSERT_OBJECT_REFCOUNT (tckobj1, "Second tckobj", 3);
ASSERT_OBJECT_REFCOUNT (tckobj2, "Third tckobj", 3);
ASSERT_OBJECT_REFCOUNT (obj, "First tlobj", 1);
ASSERT_OBJECT_REFCOUNT (obj1, "Second tlobj", 1);
ASSERT_OBJECT_REFCOUNT (obj2, "Third tlobj", 1);
ASSERT_OBJECT_REFCOUNT (obj, "First clip", 1);
ASSERT_OBJECT_REFCOUNT (obj1, "Second clip", 1);
ASSERT_OBJECT_REFCOUNT (obj2, "Third clip", 1);
g_object_unref (timeline);
@ -501,7 +497,7 @@ GST_START_TEST (test_timeline_edition_mode)
GESTrack *track;
GESTimeline *timeline;
GESTrackObject *tckobj, *tckobj1, *tckobj2;
GESTimelineObject *obj, *obj1, *obj2;
GESClip *obj, *obj1, *obj2;
GESTimelineLayer *layer, *layer1, *layer2;
GList *tckobjs, *layers, *tmp;
@ -515,9 +511,9 @@ GST_START_TEST (test_timeline_edition_mode)
fail_unless (ges_timeline_add_track (timeline, track));
obj = create_custom_tlobj ();
obj1 = create_custom_tlobj ();
obj2 = create_custom_tlobj ();
obj = create_custom_clip ();
obj1 = create_custom_clip ();
obj2 = create_custom_clip ();
fail_unless (obj && obj1 && obj2);
@ -544,7 +540,7 @@ GST_START_TEST (test_timeline_edition_mode)
fail_unless (ges_timeline_layer_add_object (layer, obj));
fail_unless ((tckobjs = ges_timeline_object_get_track_objects (obj)) != NULL);
fail_unless ((tckobjs = ges_clip_get_track_objects (obj)) != NULL);
fail_unless ((tckobj = GES_TRACK_OBJECT (tckobjs->data)) != NULL);
fail_unless (ges_track_object_get_track (tckobj) == track);
assert_equals_uint64 (_DURATION (tckobj), 10);
@ -556,16 +552,14 @@ GST_START_TEST (test_timeline_edition_mode)
assert_equals_int (ges_timeline_layer_get_priority (layer1), 1);
fail_unless (ges_timeline_layer_add_object (layer1, obj1));
fail_unless ((tckobjs =
ges_timeline_object_get_track_objects (obj1)) != NULL);
fail_unless ((tckobjs = ges_clip_get_track_objects (obj1)) != NULL);
fail_unless ((tckobj1 = GES_TRACK_OBJECT (tckobjs->data)) != NULL);
fail_unless (ges_track_object_get_track (tckobj1) == track);
assert_equals_uint64 (_DURATION (tckobj1), 10);
g_list_free_full (tckobjs, g_object_unref);
fail_unless (ges_timeline_layer_add_object (layer1, obj2));
fail_unless ((tckobjs =
ges_timeline_object_get_track_objects (obj2)) != NULL);
fail_unless ((tckobjs = ges_clip_get_track_objects (obj2)) != NULL);
fail_unless ((tckobj2 = GES_TRACK_OBJECT (tckobjs->data)) != NULL);
fail_unless (ges_track_object_get_track (tckobj2) == track);
assert_equals_uint64 (_DURATION (tckobj2), 60);
@ -585,7 +579,7 @@ GST_START_TEST (test_timeline_edition_mode)
* | obj1 | | obj2 |
* 20--------30 60--------120
*/
fail_unless (ges_timeline_object_edit (obj, NULL, -1, GES_EDIT_MODE_RIPPLE,
fail_unless (ges_clip_edit (obj, NULL, -1, GES_EDIT_MODE_RIPPLE,
GES_EDGE_NONE, 10) == TRUE);
CHECK_OBJECT_PROPS (tckobj, 10, 0, 10);
CHECK_OBJECT_PROPS (tckobj1, 20, 0, 10);
@ -594,15 +588,15 @@ GST_START_TEST (test_timeline_edition_mode)
/* FIXME find a way to check that we are using the same MovingContext
* inside the GESTimeline */
fail_unless (ges_timeline_object_edit (obj1, NULL, 3, GES_EDIT_MODE_RIPPLE,
fail_unless (ges_clip_edit (obj1, NULL, 3, GES_EDIT_MODE_RIPPLE,
GES_EDGE_NONE, 40) == TRUE);
CHECK_OBJECT_PROPS (tckobj, 10, 0, 10);
CHECK_OBJECT_PROPS (tckobj1, 40, 0, 10);
CHECK_OBJECT_PROPS (tckobj2, 80, 0, 60);
layer2 = ges_timeline_object_get_layer (obj1);
layer2 = ges_clip_get_layer (obj1);
assert_equals_int (ges_timeline_layer_get_priority (layer2), 3);
/* obj2 should have moved layer too */
fail_unless (ges_timeline_object_get_layer (obj2) == layer2);
fail_unless (ges_clip_get_layer (obj2) == layer2);
/* We got 2 reference to the same object, unref them */
g_object_unref (layer2);
g_object_unref (layer2);
@ -610,15 +604,15 @@ GST_START_TEST (test_timeline_edition_mode)
/**
* Rippling obj1 back to: 20 (getting to the exact same timeline as before
*/
fail_unless (ges_timeline_object_edit (obj1, NULL, 1, GES_EDIT_MODE_RIPPLE,
fail_unless (ges_clip_edit (obj1, NULL, 1, GES_EDIT_MODE_RIPPLE,
GES_EDGE_NONE, 20) == TRUE);
CHECK_OBJECT_PROPS (tckobj, 10, 0, 10);
CHECK_OBJECT_PROPS (tckobj1, 20, 0, 10);
CHECK_OBJECT_PROPS (tckobj2, 60, 0, 60);
layer2 = ges_timeline_object_get_layer (obj1);
layer2 = ges_clip_get_layer (obj1);
assert_equals_int (ges_timeline_layer_get_priority (layer2), 1);
/* obj2 should have moved layer too */
fail_unless (ges_timeline_object_get_layer (obj2) == layer2);
fail_unless (ges_clip_get_layer (obj2) == layer2);
/* We got 2 reference to the same object, unref them */
g_object_unref (layer2);
g_object_unref (layer2);
@ -637,9 +631,9 @@ GST_START_TEST (test_timeline_edition_mode)
* | obj1 | | obj2 |
* 20--------30 35---------95
*/
fail_unless (ges_timeline_object_edit (obj, NULL, -1, GES_EDIT_MODE_NORMAL,
fail_unless (ges_clip_edit (obj, NULL, -1, GES_EDIT_MODE_NORMAL,
GES_EDGE_NONE, 27) == TRUE);
fail_unless (ges_timeline_object_edit (obj2, NULL, -1, GES_EDIT_MODE_NORMAL,
fail_unless (ges_clip_edit (obj2, NULL, -1, GES_EDIT_MODE_NORMAL,
GES_EDGE_NONE, 35) == TRUE);
CHECK_OBJECT_PROPS (tckobj, 27, 0, 10);
CHECK_OBJECT_PROPS (tckobj1, 20, 0, 10);
@ -659,7 +653,7 @@ GST_START_TEST (test_timeline_edition_mode)
* layer 1 | obj1 | | obj2 |
* 20--------30 35---------95
*/
fail_unless (ges_timeline_object_edit (obj, NULL, -1, GES_EDIT_MODE_TRIM,
fail_unless (ges_clip_edit (obj, NULL, -1, GES_EDIT_MODE_TRIM,
GES_EDGE_START, 32) == TRUE);
CHECK_OBJECT_PROPS (tckobj, 32, 5, 5);
CHECK_OBJECT_PROPS (tckobj1, 20, 0, 10);
@ -677,12 +671,12 @@ GST_START_TEST (test_timeline_edition_mode)
* layer 2: | obj |
* 32------35
*/
fail_unless (ges_timeline_object_edit (obj, NULL, 2, GES_EDIT_MODE_RIPPLE,
fail_unless (ges_clip_edit (obj, NULL, 2, GES_EDIT_MODE_RIPPLE,
GES_EDGE_END, 35) == TRUE);
CHECK_OBJECT_PROPS (tckobj, 32, 5, 3);
CHECK_OBJECT_PROPS (tckobj1, 20, 0, 10);
CHECK_OBJECT_PROPS (tckobj2, 35, 0, 60);
layer = ges_timeline_object_get_layer (obj);
layer = ges_clip_get_layer (obj);
assert_equals_int (ges_timeline_layer_get_priority (layer), 2);
g_object_unref (layer);
@ -698,12 +692,12 @@ GST_START_TEST (test_timeline_edition_mode)
* layer 2: | obj |
* 32------50
*/
fail_unless (ges_timeline_object_edit (obj, NULL, 2, GES_EDIT_MODE_ROLL,
fail_unless (ges_clip_edit (obj, NULL, 2, GES_EDIT_MODE_ROLL,
GES_EDGE_END, 50) == TRUE);
CHECK_OBJECT_PROPS (tckobj, 32, 5, 18);
CHECK_OBJECT_PROPS (tckobj1, 20, 0, 10);
CHECK_OBJECT_PROPS (tckobj2, 50, 15, 45);
layer = ges_timeline_object_get_layer (obj);
layer = ges_clip_get_layer (obj);
assert_equals_int (ges_timeline_layer_get_priority (layer), 2);
g_object_unref (layer);
@ -712,7 +706,7 @@ GST_START_TEST (test_timeline_edition_mode)
gint32 random = g_random_int_range (35, 94);
guint64 tck3_inpoint = random - 35;
fail_unless (ges_timeline_object_edit (obj, NULL, -1, GES_EDIT_MODE_ROLL,
fail_unless (ges_clip_edit (obj, NULL, -1, GES_EDIT_MODE_ROLL,
GES_EDGE_END, random) == TRUE);
CHECK_OBJECT_PROPS (tckobj, 32, 5, random - 32);
CHECK_OBJECT_PROPS (tckobj1, 20, 0, 10);
@ -731,12 +725,12 @@ GST_START_TEST (test_timeline_edition_mode)
* layer 2: | obj |
* 32------35
*/
fail_unless (ges_timeline_object_edit (obj, NULL, 2, GES_EDIT_MODE_ROLL,
fail_unless (ges_clip_edit (obj, NULL, 2, GES_EDIT_MODE_ROLL,
GES_EDGE_END, 35) == TRUE);
CHECK_OBJECT_PROPS (tckobj, 32, 5, 3);
CHECK_OBJECT_PROPS (tckobj1, 20, 0, 10);
CHECK_OBJECT_PROPS (tckobj2, 35, 0, 60);
layer = ges_timeline_object_get_layer (obj);
layer = ges_clip_get_layer (obj);
assert_equals_int (ges_timeline_layer_get_priority (layer), 2);
g_object_unref (layer);
@ -754,12 +748,12 @@ GST_START_TEST (test_timeline_edition_mode)
*
*/
/* Can not move to the first layer as obj2 should move to a layer with priority < 0 */
fail_unless (ges_timeline_object_edit (obj, NULL, 0, GES_EDIT_MODE_RIPPLE,
fail_unless (ges_clip_edit (obj, NULL, 0, GES_EDIT_MODE_RIPPLE,
GES_EDGE_END, 52) == TRUE);
CHECK_OBJECT_PROPS (tckobj, 32, 5, 20);
CHECK_OBJECT_PROPS (tckobj1, 20, 0, 10);
CHECK_OBJECT_PROPS (tckobj2, 52, 0, 60)
layer = ges_timeline_object_get_layer (obj);
layer = ges_clip_get_layer (obj);
assert_equals_int (ges_timeline_layer_get_priority (layer), 2);
g_object_unref (layer);
@ -782,9 +776,9 @@ GST_START_TEST (test_timeline_edition_mode)
ASSERT_OBJECT_REFCOUNT (tckobj2, "Third tckobj", 3);
/* We have 1 ref:
* + layer */
ASSERT_OBJECT_REFCOUNT (obj, "First tlobj", 1);
ASSERT_OBJECT_REFCOUNT (obj1, "Second tlobj", 1);
ASSERT_OBJECT_REFCOUNT (obj2, "Third tlobj", 1);
ASSERT_OBJECT_REFCOUNT (obj, "First clip", 1);
ASSERT_OBJECT_REFCOUNT (obj1, "Second clip", 1);
ASSERT_OBJECT_REFCOUNT (obj2, "Third clip", 1);
/* Ripple obj end to 52
* New timeline:
@ -799,18 +793,18 @@ GST_START_TEST (test_timeline_edition_mode)
* 42------60
*
*/
fail_unless (ges_timeline_object_edit (obj1, NULL, 0, GES_EDIT_MODE_RIPPLE,
fail_unless (ges_clip_edit (obj1, NULL, 0, GES_EDIT_MODE_RIPPLE,
GES_EDGE_END, 40) == TRUE);
CHECK_OBJECT_PROPS (tckobj, 42, 5, 20);
CHECK_OBJECT_PROPS (tckobj1, 20, 0, 20);
CHECK_OBJECT_PROPS (tckobj2, 62, 0, 60);
/* Check that movement between layer has been done properly */
layer1 = ges_timeline_object_get_layer (obj);
layer = ges_timeline_object_get_layer (obj1);
layer1 = ges_clip_get_layer (obj);
layer = ges_clip_get_layer (obj1);
assert_equals_int (ges_timeline_layer_get_priority (layer1), 1);
assert_equals_int (ges_timeline_layer_get_priority (layer), 0);
fail_unless (ges_timeline_object_get_layer (obj2) == layer);
fail_unless (ges_clip_get_layer (obj2) == layer);
g_object_unref (layer1);
/* We have 2 references to @layer that we do not need anymore */ ;
g_object_unref (layer);
@ -829,7 +823,7 @@ GST_START_TEST (test_timeline_edition_mode)
* 40------62
*
*/
fail_unless (ges_timeline_object_edit (obj, NULL, -1, GES_EDIT_MODE_TRIM,
fail_unless (ges_clip_edit (obj, NULL, -1, GES_EDIT_MODE_TRIM,
GES_EDGE_START, 40) == TRUE);
CHECK_OBJECT_PROPS (tckobj, 40, 3, 22);
CHECK_OBJECT_PROPS (tckobj1, 20, 0, 20);
@ -848,16 +842,16 @@ GST_START_TEST (test_timeline_edition_mode)
* 25------62
*
*/
fail_unless (ges_timeline_object_edit (obj1, NULL, -1, GES_EDIT_MODE_ROLL,
fail_unless (ges_clip_edit (obj1, NULL, -1, GES_EDIT_MODE_ROLL,
GES_EDGE_END, 25) == TRUE);
CHECK_OBJECT_PROPS (tckobj, 25, 0, 37);
CHECK_OBJECT_PROPS (tckobj1, 20, 0, 5);
CHECK_OBJECT_PROPS (tckobj2, 62, 0, 60);
/* Make sure that not doing anything when not able to roll */
fail_unless (ges_timeline_object_edit (obj, NULL, -1, GES_EDIT_MODE_ROLL,
fail_unless (ges_clip_edit (obj, NULL, -1, GES_EDIT_MODE_ROLL,
GES_EDGE_START, 65) == TRUE);
fail_unless (ges_timeline_object_edit (obj1, NULL, -1, GES_EDIT_MODE_ROLL,
fail_unless (ges_clip_edit (obj1, NULL, -1, GES_EDIT_MODE_ROLL,
GES_EDGE_END, 65) == TRUE, 0);
CHECK_OBJECT_PROPS (tckobj, 25, 0, 37);
CHECK_OBJECT_PROPS (tckobj1, 20, 0, 5);
@ -865,14 +859,14 @@ GST_START_TEST (test_timeline_edition_mode)
/* Snaping to edge, so no move */
g_object_set (timeline, "snapping-distance", (guint64) 3, NULL);
fail_unless (ges_timeline_object_edit (obj1, NULL, -1, GES_EDIT_MODE_TRIM,
fail_unless (ges_clip_edit (obj1, NULL, -1, GES_EDIT_MODE_TRIM,
GES_EDGE_END, 27) == TRUE);
CHECK_OBJECT_PROPS (tckobj, 25, 0, 37);
CHECK_OBJECT_PROPS (tckobj1, 20, 0, 5);
CHECK_OBJECT_PROPS (tckobj2, 62, 0, 60);
/* Snaping to edge, so no move */
fail_unless (ges_timeline_object_edit (obj1, NULL, -1, GES_EDIT_MODE_TRIM,
fail_unless (ges_clip_edit (obj1, NULL, -1, GES_EDIT_MODE_TRIM,
GES_EDGE_END, 27) == TRUE);
CHECK_OBJECT_PROPS (tckobj, 25, 0, 37);
@ -888,7 +882,7 @@ GST_START_TEST (test_timeline_edition_mode)
* time 20----------30
*/
g_object_set (timeline, "snapping-distance", (guint64) 0, NULL);
fail_unless (ges_timeline_object_edit (obj1, NULL, -1, GES_EDIT_MODE_TRIM,
fail_unless (ges_clip_edit (obj1, NULL, -1, GES_EDIT_MODE_TRIM,
GES_EDGE_END, 30) == TRUE);
CHECK_OBJECT_PROPS (tckobj, 25, 0, 37);
CHECK_OBJECT_PROPS (tckobj1, 20, 0, 10);
@ -905,9 +899,9 @@ GST_START_TEST (test_timeline_edition_mode)
* time 20---------------------- 72 --------122
*/
/* Rolling involves only neighbours that are currently snapping */
fail_unless (ges_timeline_object_edit (obj1, NULL, -1, GES_EDIT_MODE_ROLL,
fail_unless (ges_clip_edit (obj1, NULL, -1, GES_EDIT_MODE_ROLL,
GES_EDGE_END, 62) == TRUE);
fail_unless (ges_timeline_object_edit (obj1, NULL, -1, GES_EDIT_MODE_ROLL,
fail_unless (ges_clip_edit (obj1, NULL, -1, GES_EDIT_MODE_ROLL,
GES_EDGE_END, 72) == TRUE);
CHECK_OBJECT_PROPS (tckobj, 25, 0, 37);
CHECK_OBJECT_PROPS (tckobj1, 20, 0, 52);
@ -923,7 +917,7 @@ GST_START_TEST (test_timeline_edition_mode)
* time 25------------- 72 --------122
*/
g_object_set (timeline, "snapping-distance", (guint64) 4, NULL);
fail_unless (ges_timeline_object_edit (obj1, NULL, -1, GES_EDIT_MODE_TRIM,
fail_unless (ges_clip_edit (obj1, NULL, -1, GES_EDIT_MODE_TRIM,
GES_EDGE_START, 28) == TRUE);
CHECK_OBJECT_PROPS (tckobj, 25, 0, 37);
CHECK_OBJECT_PROPS (tckobj1, 25, 5, 47);
@ -937,7 +931,7 @@ GST_START_TEST (test_timeline_edition_mode)
* | obj1 || obj2 |
* time 25-------- 62 --------122
*/
fail_unless (ges_timeline_object_edit (obj2, NULL, -1, GES_EDIT_MODE_ROLL,
fail_unless (ges_clip_edit (obj2, NULL, -1, GES_EDIT_MODE_ROLL,
GES_EDGE_START, 59) == TRUE);
CHECK_OBJECT_PROPS (tckobj, 25, 0, 37);
CHECK_OBJECT_PROPS (tckobj1, 25, 5, 37);

View file

@ -39,14 +39,14 @@ GST_START_TEST (test_title_source_properties)
{
GESTrack *track;
GESTrackObject *trackobject;
GESTimelineObject *object;
GESClip *object;
ges_init ();
track = ges_track_video_raw_new ();
fail_unless (track != NULL);
object = (GESTimelineObject *)
object = (GESClip *)
ges_timeline_title_source_new ();
fail_unless (object != NULL);
@ -57,8 +57,8 @@ GST_START_TEST (test_title_source_properties)
assert_equals_uint64 (_DURATION (object), 51);
assert_equals_uint64 (_INPOINT (object), 12);
trackobject = ges_timeline_object_create_track_object (object, track->type);
ges_timeline_object_add_track_object (object, trackobject);
trackobject = ges_clip_create_track_object (object, track->type);
ges_clip_add_track_object (object, trackobject);
fail_unless (trackobject != NULL);
fail_unless (ges_track_object_set_track (trackobject, track));
@ -85,7 +85,7 @@ GST_START_TEST (test_title_source_properties)
gnl_object_check (ges_track_object_get_gnlobject (trackobject), 420, 510, 120,
510, 0, TRUE);
ges_timeline_object_release_track_object (object, trackobject);
ges_clip_release_track_object (object, trackobject);
g_object_unref (object);
}
@ -120,7 +120,7 @@ GST_START_TEST (test_title_source_in_layer)
g_object_set (source, "duration", (guint64) GST_SECOND, NULL);
ges_simple_timeline_layer_add_object ((GESSimpleTimelineLayer *) layer,
(GESTimelineObject *) source, 0);
(GESClip *) source, 0);
/* specifically test the text property */
g_object_set (source, "text", (gchar *) "some text", NULL);
@ -129,7 +129,7 @@ GST_START_TEST (test_title_source_in_layer)
g_free (text);
trobj =
ges_timeline_object_find_track_object (GES_TIMELINE_OBJECT (source), v,
ges_clip_find_track_object (GES_CLIP (source), v,
GES_TYPE_TRACK_TITLE_SOURCE);
/* Check the text is still the same */
@ -183,7 +183,7 @@ GST_START_TEST (test_title_source_in_layer)
GST_DEBUG ("removing the source");
ges_timeline_layer_remove_object (layer, (GESTimelineObject *) source);
ges_timeline_layer_remove_object (layer, (GESClip *) source);
GST_DEBUG ("removing the layer");

View file

@ -47,16 +47,14 @@ GST_START_TEST (test_transition_basic)
fail_unless (tr2->vtype == 1);
/* Make sure track object is created and vtype is set */
trackobject =
ges_timeline_object_create_track_object (GES_TIMELINE_OBJECT (tr2),
track->type);
ges_timeline_object_add_track_object (GES_TIMELINE_OBJECT (tr2), trackobject);
trackobject = ges_clip_create_track_object (GES_CLIP (tr2), track->type);
ges_clip_add_track_object (GES_CLIP (tr2), trackobject);
fail_unless (trackobject != NULL);
fail_unless (ges_track_video_transition_get_transition_type
(GES_TRACK_VIDEO_TRANSITION (trackobject)) == 1);
fail_unless (ges_timeline_object_release_track_object (GES_TIMELINE_OBJECT
fail_unless (ges_clip_release_track_object (GES_CLIP
(tr2), trackobject) == TRUE);
g_object_unref (track);
@ -70,12 +68,12 @@ GST_START_TEST (test_transition_properties)
{
GESTrack *track;
GESTrackObject *trackobject;
GESTimelineObject *object;
GESClip *object;
ges_init ();
object =
GES_TIMELINE_OBJECT (ges_timeline_standard_transition_new
GES_CLIP (ges_timeline_standard_transition_new
(GES_VIDEO_STANDARD_TRANSITION_TYPE_CROSSFADE));
track = ges_track_video_raw_new ();
@ -89,8 +87,8 @@ GST_START_TEST (test_transition_properties)
assert_equals_uint64 (_DURATION (object), 51);
assert_equals_uint64 (_INPOINT (object), 12);
trackobject = ges_timeline_object_create_track_object (object, track->type);
ges_timeline_object_add_track_object (object, trackobject);
trackobject = ges_clip_create_track_object (object, track->type);
ges_clip_add_track_object (object, trackobject);
fail_unless (trackobject != NULL);
fail_unless (ges_track_object_set_track (trackobject, track));
@ -137,13 +135,13 @@ GST_START_TEST (test_transition_properties)
(GES_TRACK_VIDEO_TRANSITION (trackobject)), 1);
GST_DEBUG ("Releasing track object");
ges_timeline_object_release_track_object (object, trackobject);
ges_clip_release_track_object (object, trackobject);
g_object_set (object, "vtype", 1, NULL);
GST_DEBUG ("creating track object");
trackobject = ges_timeline_object_create_track_object (object, track->type);
ges_timeline_object_add_track_object (object, trackobject);
trackobject = ges_clip_create_track_object (object, track->type);
ges_clip_add_track_object (object, trackobject);
fail_unless (trackobject != NULL);
fail_unless (ges_track_object_set_track (trackobject, track));
@ -154,7 +152,7 @@ GST_START_TEST (test_transition_properties)
(GES_TRACK_VIDEO_TRANSITION (trackobject)), 1);
assert_equals_int (GES_TIMELINE_STANDARD_TRANSITION (object)->vtype, 1);
ges_timeline_object_release_track_object (object, trackobject);
ges_clip_release_track_object (object, trackobject);
g_object_unref (object);
g_object_unref (track);
}

View file

@ -213,7 +213,7 @@ update_play_sensitivity (App * app)
/* Backend callbacks ********************************************************/
static void
test_source_notify_volume_changed_cb (GESTimelineObject * object, GParamSpec *
test_source_notify_volume_changed_cb (GESClip * object, GParamSpec *
unused G_GNUC_UNUSED, App * app)
{
gdouble volume;
@ -231,13 +231,12 @@ layer_notify_valid_changed_cb (GObject * object, GParamSpec * unused
}
static gboolean
find_row_for_object (GtkListStore * model, GtkTreeIter * ret,
GESTimelineObject * object)
find_row_for_object (GtkListStore * model, GtkTreeIter * ret, GESClip * object)
{
gtk_tree_model_get_iter_first ((GtkTreeModel *) model, ret);
while (gtk_list_store_iter_is_valid (model, ret)) {
GESTimelineObject *obj;
GESClip *obj;
gtk_tree_model_get ((GtkTreeModel *) model, ret, 2, &obj, -1);
if (obj == object) {
g_object_unref (obj);
@ -252,7 +251,7 @@ find_row_for_object (GtkListStore * model, GtkTreeIter * ret,
/* this callback is registered for every timeline object, and updates the
* corresponding duration cell in the model */
static void
timeline_object_notify_duration_cb (GESTimelineObject * object,
clip_notify_duration_cb (GESClip * object,
GParamSpec * arg G_GNUC_UNUSED, App * app)
{
GtkTreeIter iter;
@ -267,7 +266,7 @@ timeline_object_notify_duration_cb (GESTimelineObject * object,
* current selection */
static void
filesource_notify_duration_cb (GESTimelineObject * object,
filesource_notify_duration_cb (GESClip * object,
GParamSpec * arg G_GNUC_UNUSED, App * app)
{
guint64 duration, max_inpoint;
@ -283,7 +282,7 @@ filesource_notify_duration_cb (GESTimelineObject * object,
}
static void
filesource_notify_max_duration_cb (GESTimelineObject * object,
filesource_notify_max_duration_cb (GESClip * object,
GParamSpec * arg G_GNUC_UNUSED, App * app)
{
gtk_range_set_range (GTK_RANGE (app->duration), 0, (gdouble)
@ -293,7 +292,7 @@ filesource_notify_max_duration_cb (GESTimelineObject * object,
}
static void
filesource_notify_in_point_cb (GESTimelineObject * object,
filesource_notify_in_point_cb (GESClip * object,
GParamSpec * arg G_GNUC_UNUSED, App * app)
{
gtk_range_set_value (GTK_RANGE (app->in_point),
@ -326,7 +325,7 @@ object_count_changed (App * app)
}
static void
title_source_text_changed_cb (GESTimelineObject * object,
title_source_text_changed_cb (GESClip * object,
GParamSpec * arg G_GNUC_UNUSED, App * app)
{
GtkTreeIter iter;
@ -340,8 +339,7 @@ title_source_text_changed_cb (GESTimelineObject * object,
}
static void
layer_object_added_cb (GESTimelineLayer * layer, GESTimelineObject * object,
App * app)
layer_object_added_cb (GESTimelineLayer * layer, GESClip * object, App * app)
{
GtkTreeIter iter;
gchar *description;
@ -371,16 +369,15 @@ layer_object_added_cb (GESTimelineLayer * layer, GESTimelineObject * object,
}
g_signal_connect (G_OBJECT (object), "notify::duration",
G_CALLBACK (timeline_object_notify_duration_cb), app);
timeline_object_notify_duration_cb (object, NULL, app);
G_CALLBACK (clip_notify_duration_cb), app);
clip_notify_duration_cb (object, NULL, app);
app->n_objects++;
object_count_changed (app);
}
static void
layer_object_removed_cb (GESTimelineLayer * layer, GESTimelineObject * object,
App * app)
layer_object_removed_cb (GESTimelineLayer * layer, GESClip * object, App * app)
{
GtkTreeIter iter;
@ -397,7 +394,7 @@ layer_object_removed_cb (GESTimelineLayer * layer, GESTimelineObject * object,
}
static void
layer_object_moved_cb (GESTimelineObject * layer, GESTimelineObject * object,
layer_object_moved_cb (GESClip * layer, GESClip * object,
gint old, gint new, App * app)
{
GtkTreeIter a, b;
@ -574,7 +571,7 @@ seconds_notify_text_changed_cb (GtkEntry * widget, GParamSpec * unused,
gtk_entry_set_icon_from_stock (app->seconds,
GTK_ENTRY_ICON_SECONDARY, NULL);
for (tmp = app->selected_objects; tmp; tmp = tmp->next) {
g_object_set (GES_TIMELINE_OBJECT (tmp->data), "duration",
g_object_set (GES_CLIP (tmp->data), "duration",
(guint64) str_to_time (text), NULL);
}
}
@ -595,7 +592,7 @@ duration_cell_func (GtkTreeViewColumn * column, GtkCellRenderer * renderer,
/* UI Initialization ********************************************************/
static void
connect_to_filesource (GESTimelineObject * object, App * app)
connect_to_filesource (GESClip * object, App * app)
{
g_signal_connect (G_OBJECT (object), "notify::max-duration",
G_CALLBACK (filesource_notify_max_duration_cb), app);
@ -611,7 +608,7 @@ connect_to_filesource (GESTimelineObject * object, App * app)
}
static void
disconnect_from_filesource (GESTimelineObject * object, App * app)
disconnect_from_filesource (GESClip * object, App * app)
{
g_signal_handlers_disconnect_by_func (G_OBJECT (object),
filesource_notify_duration_cb, app);
@ -621,7 +618,7 @@ disconnect_from_filesource (GESTimelineObject * object, App * app)
}
static void
connect_to_title_source (GESTimelineObject * object, App * app)
connect_to_title_source (GESClip * object, App * app)
{
GESTimelineTitleSource *obj;
obj = GES_TIMELINE_TITLE_SOURCE (object);
@ -633,12 +630,12 @@ connect_to_title_source (GESTimelineObject * object, App * app)
}
static void
disconnect_from_title_source (GESTimelineObject * object, App * app)
disconnect_from_title_source (GESClip * object, App * app)
{
}
static void
connect_to_test_source (GESTimelineObject * object, App * app)
connect_to_test_source (GESClip * object, App * app)
{
GObjectClass *klass;
GParamSpecDouble *pspec;
@ -665,14 +662,14 @@ connect_to_test_source (GESTimelineObject * object, App * app)
}
static void
disconnect_from_test_source (GESTimelineObject * object, App * app)
disconnect_from_test_source (GESClip * object, App * app)
{
g_signal_handlers_disconnect_by_func (G_OBJECT (object),
test_source_notify_volume_changed_cb, app);
}
static void
connect_to_object (GESTimelineObject * object, App * app)
connect_to_object (GESClip * object, App * app)
{
gchar buf[30];
guint64 duration;
@ -696,7 +693,7 @@ connect_to_object (GESTimelineObject * object, App * app)
}
static void
disconnect_from_object (GESTimelineObject * object, App * app)
disconnect_from_object (GESClip * object, App * app)
{
if (GES_IS_TIMELINE_FILE_SOURCE (object)) {
disconnect_from_filesource (object, app);
@ -1024,7 +1021,7 @@ selection_foreach (GtkTreeModel * model, GtkTreePath * path, GtkTreeIter
* iter, gpointer user)
{
select_info *info = (select_info *) user;
GESTimelineObject *obj;
GESClip *obj;
gtk_tree_model_get (model, iter, 2, &obj, -1);
info->objects = g_list_append (info->objects, obj);
@ -1045,8 +1042,7 @@ app_delete_objects (App * app, GList * objects)
GList *cur;
for (cur = objects; cur; cur = cur->next) {
ges_timeline_layer_remove_object (app->layer,
GES_TIMELINE_OBJECT (cur->data));
ges_timeline_layer_remove_object (app->layer, GES_CLIP (cur->data));
cur->data = NULL;
}
@ -1066,7 +1062,7 @@ app_move_selected_up (App * app)
pos = g_list_index (objects, app->selected_objects->data);
ges_simple_timeline_layer_move_object (GES_SIMPLE_TIMELINE_LAYER (app->layer),
GES_TIMELINE_OBJECT (app->selected_objects->data), pos - 1);
GES_CLIP (app->selected_objects->data), pos - 1);
for (tmp = objects; tmp; tmp = tmp->next) {
g_object_unref (tmp->data);
@ -1086,8 +1082,7 @@ app_add_effect_on_selected_clips (App * app, const gchar * bin_desc,
for (tmp = objects; tmp; tmp = tmp->next) {
effect = GES_TRACK_OBJECT (ges_track_parse_launch_effect_new (bin_desc));
ges_timeline_object_add_track_object (GES_TIMELINE_OBJECT (tmp->data),
effect);
ges_clip_add_track_object (GES_CLIP (tmp->data), effect);
if (type == GES_TRACK_TYPE_VIDEO)
ges_track_add_object (app->video_track, effect);
@ -1142,7 +1137,7 @@ app_move_selected_down (App * app)
pos = g_list_index (objects, app->selected_objects->data);
ges_simple_timeline_layer_move_object (GES_SIMPLE_TIMELINE_LAYER (app->layer),
GES_TIMELINE_OBJECT (app->selected_objects->data), pos - 1);
GES_CLIP (app->selected_objects->data), pos - 1);
for (tmp = objects; tmp; tmp = tmp->next) {
g_object_unref (tmp->data);
@ -1152,11 +1147,11 @@ app_move_selected_down (App * app)
static void
app_add_file (App * app, gchar * uri)
{
GESTimelineObject *obj;
GESClip *obj;
GST_DEBUG ("adding file %s", uri);
obj = GES_TIMELINE_OBJECT (ges_timeline_filesource_new (uri));
obj = GES_CLIP (ges_timeline_filesource_new (uri));
ges_simple_timeline_layer_add_object (GES_SIMPLE_TIMELINE_LAYER (app->layer),
obj, -1);
@ -1192,11 +1187,11 @@ app_launch_project (App * app, gchar * uri)
static void
app_add_title (App * app)
{
GESTimelineObject *obj;
GESClip *obj;
GST_DEBUG ("adding title");
obj = GES_TIMELINE_OBJECT (ges_timeline_title_source_new ());
obj = GES_CLIP (ges_timeline_title_source_new ());
g_object_set (G_OBJECT (obj), "duration", GST_SECOND, NULL);
ges_simple_timeline_layer_add_object (GES_SIMPLE_TIMELINE_LAYER (app->layer),
@ -1206,11 +1201,11 @@ app_add_title (App * app)
static void
app_add_test (App * app)
{
GESTimelineObject *obj;
GESClip *obj;
GST_DEBUG ("adding test");
obj = GES_TIMELINE_OBJECT (ges_timeline_test_source_new ());
obj = GES_CLIP (ges_timeline_test_source_new ());
g_object_set (G_OBJECT (obj), "duration", GST_SECOND, NULL);
ges_simple_timeline_layer_add_object (GES_SIMPLE_TIMELINE_LAYER
@ -1220,11 +1215,11 @@ app_add_test (App * app)
static void
app_add_transition (App * app)
{
GESTimelineObject *obj;
GESClip *obj;
GST_DEBUG ("adding transition");
obj = GES_TIMELINE_OBJECT (ges_timeline_standard_transition_new
obj = GES_CLIP (ges_timeline_standard_transition_new
(GES_VIDEO_STANDARD_TRANSITION_TYPE_CROSSFADE));
g_object_set (G_OBJECT (obj), "duration", GST_SECOND, NULL);

View file

@ -26,10 +26,10 @@ typedef struct
char *name;
} transition_type;
GESTimelineObject *make_source (char *path, guint64 start, guint64 duration,
GESClip *make_source (char *path, guint64 start, guint64 duration,
gint priority);
GESTimelineObject *make_overlay (char *text, guint64 start, guint64 duration,
GESClip *make_overlay (char *text, guint64 start, guint64 duration,
gint priority, guint32 color, gdouble xpos, gdouble ypos);
GESTimelinePipeline *make_timeline (char *path, float duration, char *text,
@ -38,13 +38,12 @@ GESTimelinePipeline *make_timeline (char *path, float duration, char *text,
#define DEFAULT_DURATION 5
#define DEFAULT_POS 0.5
GESTimelineObject *
GESClip *
make_source (char *path, guint64 start, guint64 duration, gint priority)
{
gchar *uri = gst_filename_to_uri (path, NULL);
GESTimelineObject *ret =
GES_TIMELINE_OBJECT (ges_timeline_filesource_new (uri));
GESClip *ret = GES_CLIP (ges_timeline_filesource_new (uri));
g_object_set (ret,
"start", (guint64) start,
@ -56,12 +55,11 @@ make_source (char *path, guint64 start, guint64 duration, gint priority)
return ret;
}
GESTimelineObject *
GESClip *
make_overlay (char *text, guint64 start, guint64 duration, gint priority,
guint32 color, gdouble xpos, gdouble ypos)
{
GESTimelineObject *ret =
GES_TIMELINE_OBJECT (ges_timeline_text_overlay_new ());
GESClip *ret = GES_CLIP (ges_timeline_text_overlay_new ());
g_object_set (ret,
"text", (gchar *) text,
@ -84,8 +82,8 @@ make_timeline (char *path, float duration, char *text, guint32 color,
GESTimeline *timeline;
GESTrack *trackv, *tracka;
GESTimelineLayer *layer1;
GESTimelineObject *srca;
GESTimelineObject *overlay;
GESClip *srca;
GESClip *overlay;
GESTimelinePipeline *pipeline;
guint64 aduration;

View file

@ -94,7 +94,7 @@ main (int argc, gchar ** argv)
g_free (uri);
g_object_set (src, "in-point", inpoint * GST_SECOND,
"duration", duration * GST_SECOND, "mute", mute, NULL);
ges_timeline_layer_add_object (layer1, GES_TIMELINE_OBJECT (src));
ges_timeline_layer_add_object (layer1, GES_CLIP (src));
}
/* Play the pipeline */

View file

@ -26,7 +26,7 @@ main (int argc, gchar ** argv)
GESAsset *src_asset;
GESTimelinePipeline *pipeline;
GESTimeline *timeline;
GESTimelineObject *source;
GESClip *source;
GESTimelineLayer *layer;
GMainLoop *mainloop;

View file

@ -70,7 +70,7 @@ main (int argc, gchar ** argv)
g_object_set (src, "start", offset, "duration", GST_SECOND, NULL);
ges_timeline_layer_add_object (layer, (GESTimelineObject *) src);
ges_timeline_layer_add_object (layer, (GESClip *) src);
}
/* In order to listen our timeline, let's grab a convenience pipeline to put

View file

@ -70,7 +70,7 @@ main (int argc, gchar ** argv)
g_object_set (src, "duration", GST_SECOND, NULL);
/* Since we're using a GESSimpleTimelineLayer, objects will be automatically
* appended to the end of the layer */
ges_timeline_layer_add_object (layer, (GESTimelineObject *) src);
ges_timeline_layer_add_object (layer, (GESClip *) src);
}
/* In order to view our timeline, let's grab a convenience pipeline to put

View file

@ -125,7 +125,7 @@ main (int argc, gchar ** argv)
g_object_set (src, "duration", GST_SECOND, NULL);
/* Since we're using a GESSimpleTimelineLayer, objects will be automatically
* appended to the end of the layer */
ges_timeline_layer_add_object (layer, (GESTimelineObject *) src);
ges_timeline_layer_add_object (layer, (GESClip *) src);
}
/* In order to view our timeline, let's grab a convenience pipeline to put

View file

@ -26,19 +26,18 @@ typedef struct
char *name;
} transition_type;
GESTimelineObject *make_source (char *path, guint64 start, guint64 duration,
GESClip *make_source (char *path, guint64 start, guint64 duration,
gint priority, gchar * text);
GESTimelinePipeline *make_timeline (char *path, float duration, char *text);
GESTimelineObject *
GESClip *
make_source (char *path, guint64 start, guint64 duration, gint priority,
gchar * text)
{
gchar *uri = gst_filename_to_uri (path, NULL);
GESTimelineObject *ret =
GES_TIMELINE_OBJECT (ges_timeline_filesource_new (uri));
GESClip *ret = GES_CLIP (ges_timeline_filesource_new (uri));
g_object_set (ret,
"start", (guint64) start,
@ -57,7 +56,7 @@ make_timeline (char *path, float duration, char *text)
GESTimeline *timeline;
GESTrack *trackv, *tracka;
GESTimelineLayer *layer1;
GESTimelineObject *srca;
GESClip *srca;
GESTimelinePipeline *pipeline;
guint64 aduration;

View file

@ -76,7 +76,7 @@ create_timeline (void)
GESTimelineLayer *layer;
GESTrack *tracka, *trackv;
GESTimeline *timeline;
GESTimelineObject *src;
GESClip *src;
timeline = ges_timeline_new ();
@ -92,13 +92,13 @@ create_timeline (void)
return NULL;
/* Add the main audio/video file */
src = GES_TIMELINE_OBJECT (ges_timeline_test_source_new ());
src = GES_CLIP (ges_timeline_test_source_new ());
g_object_set (src,
"vpattern", GES_VIDEO_TEST_PATTERN_SNOW,
"duration", 10 * GST_SECOND, NULL);
ges_simple_timeline_layer_add_object ((GESSimpleTimelineLayer *) layer,
GES_TIMELINE_OBJECT (src), 0);
GES_CLIP (src), 0);
pipeline = ges_timeline_pipeline_new ();

View file

@ -27,23 +27,22 @@ typedef struct
char *name;
} transition_type;
GESTimelineObject *make_source (gchar * path, guint64 start, guint64 inpoint,
GESClip *make_source (gchar * path, guint64 start, guint64 inpoint,
guint64 duration, gint priority);
gboolean print_transition_data (GESTimelineObject * tr);
gboolean print_transition_data (GESClip * tr);
GESTimelinePipeline *make_timeline (gchar * nick, double tdur, gchar * patha,
gfloat adur, gdouble ainpoint, gchar * pathb, gfloat bdur,
gdouble binpoint);
GESTimelineObject *
GESClip *
make_source (gchar * path, guint64 start, guint64 duration, guint64 inpoint,
gint priority)
{
gchar *uri = gst_filename_to_uri (path, NULL);
GESTimelineObject *ret =
GES_TIMELINE_OBJECT (ges_timeline_filesource_new (uri));
GESClip *ret = GES_CLIP (ges_timeline_filesource_new (uri));
g_object_set (ret,
"start", (guint64) start,
@ -56,7 +55,7 @@ make_source (gchar * path, guint64 start, guint64 duration, guint64 inpoint,
}
gboolean
print_transition_data (GESTimelineObject * tr)
print_transition_data (GESClip * tr)
{
GESTrackObject *trackobj;
GstElement *gnlobj;
@ -68,7 +67,7 @@ print_transition_data (GESTimelineObject * tr)
if (!tr)
return FALSE;
if (!(trackobjects = ges_timeline_object_get_track_objects (tr)))
if (!(trackobjects = ges_clip_get_track_objects (tr)))
return FALSE;
if (!(trackobj = GES_TRACK_OBJECT (trackobjects->data)))
return FALSE;
@ -97,7 +96,7 @@ make_timeline (gchar * nick, gdouble tdur, gchar * patha, gfloat adur,
GESTimeline *timeline;
GESTrack *trackv, *tracka;
GESTimelineLayer *layer1;
GESTimelineObject *srca, *srcb;
GESClip *srca, *srcb;
GESTimelinePipeline *pipeline;
guint64 aduration, bduration, tduration, tstart, ainpoint, binpoint;
GESTimelineStandardTransition *tr = NULL;
@ -144,7 +143,7 @@ make_timeline (gchar * nick, gdouble tdur, gchar * patha, gfloat adur,
g_object_set (tr,
"start", (guint64) tstart,
"duration", (guint64) tduration, "in-point", (guint64) 0, NULL);
ges_timeline_layer_add_object (layer1, GES_TIMELINE_OBJECT (tr));
ges_timeline_layer_add_object (layer1, GES_CLIP (tr));
g_timeout_add_seconds (1, (GSourceFunc) print_transition_data, tr);
}

View file

@ -153,14 +153,14 @@ create_timeline (int nbargs, gchar ** argv, gchar * audio, gchar * video)
* ready to start using it... by solely working with the layer !*/
for (i = 0; i < nbargs / 3; i++) {
GESTimelineObject *obj;
GESClip *obj;
char *source = argv[i * 3];
char *arg0 = argv[(i * 3) + 1];
guint64 duration = str_to_time (argv[(i * 3) + 2]);
if (!g_strcmp0 ("+pattern", source)) {
obj = GES_TIMELINE_OBJECT (ges_timeline_test_source_new_for_nick (arg0));
obj = GES_CLIP (ges_timeline_test_source_new_for_nick (arg0));
if (!obj) {
g_error ("%s is an invalid pattern name!\n", arg0);
goto build_failure;
@ -178,9 +178,7 @@ create_timeline (int nbargs, gchar ** argv, gchar * audio, gchar * video)
goto build_failure;
}
obj =
GES_TIMELINE_OBJECT (ges_timeline_standard_transition_new_for_nick
(arg0));
obj = GES_CLIP (ges_timeline_standard_transition_new_for_nick (arg0));
if (!obj) {
g_error ("invalid transition type\n");
@ -195,7 +193,7 @@ create_timeline (int nbargs, gchar ** argv, gchar * audio, gchar * video)
}
else if (!g_strcmp0 ("+title", source)) {
obj = GES_TIMELINE_OBJECT (ges_timeline_title_source_new ());
obj = GES_CLIP (ges_timeline_title_source_new ());
g_object_set (obj, "duration", duration, "text", arg0, NULL);
@ -213,7 +211,7 @@ create_timeline (int nbargs, gchar ** argv, gchar * audio, gchar * video)
}
inpoint = str_to_time (argv[i * 3 + 1]);
obj = GES_TIMELINE_OBJECT (ges_timeline_filesource_new (uri));
obj = GES_CLIP (ges_timeline_filesource_new (uri));
g_object_set (obj,
"in-point", (guint64) inpoint, "duration", (guint64) duration, NULL);