diff --git a/docs/libs/ges-docs.sgml b/docs/libs/ges-docs.sgml
index ef8adc7cb1..78eccf5d12 100644
--- a/docs/libs/ges-docs.sgml
+++ b/docs/libs/ges-docs.sgml
@@ -86,7 +86,6 @@ platform as well as Windows. It is released under the GNU Library General Public
Convenience classes
-
diff --git a/docs/libs/ges-sections.txt b/docs/libs/ges-sections.txt
index 865cb1eb36..2feb484f6a 100644
--- a/docs/libs/ges-sections.txt
+++ b/docs/libs/ges-sections.txt
@@ -621,24 +621,6 @@ ges_transition_clip_get_type
-
-ges-custom-source-clip
-GESCustomSourceClip
-GESCustomSourceClip
-GESFillTrackElementUserFunc
-ges_custom_source_clip_new
-
-GESCustomSourceClipClass
-ges_custom_source_clip_get_type
-GESCustomSourceClipPrivate
-GES_CUSTOM_SOURCE_CLIP
-GES_CUSTOM_SOURCE_CLIP_CLASS
-GES_CUSTOM_SOURCE_CLIP_GET_CLASS
-GES_IS_CUSTOM_SOURCE_CLIP
-GES_IS_CUSTOM_SOURCE_CLIP_CLASS
-GES_TYPE_CUSTOM_SOURCE_CLIP
-
-
ges-simple-layer
GESSimpleLayer
@@ -1026,7 +1008,6 @@ ges_asset_request_async
ges_asset_request_finish
ges_asset_extract
ges_list_assets
-ges_asset_custom_source_clip_new
GESAssetPrivate
GES_ASSET
diff --git a/docs/libs/ges.types b/docs/libs/ges.types
index 45688fcb30..8977022447 100644
--- a/docs/libs/ges.types
+++ b/docs/libs/ges.types
@@ -1,7 +1,6 @@
#include
#include
-ges_custom_source_clip_get_type
ges_formatter_get_type
ges_simple_layer_get_type
%ges_text_halign_get_type
diff --git a/ges/Makefile.am b/ges/Makefile.am
index fc8855d060..f40cbbaee3 100644
--- a/ges/Makefile.am
+++ b/ges/Makefile.am
@@ -11,7 +11,6 @@ libges_@GST_API_VERSION@_la_SOURCES = \
$(built_source_make) \
ges.c \
ges-enums.c \
- ges-custom-source-clip.c \
ges-meta-container.c \
ges-simple-layer.c \
ges-timeline.c \
@@ -74,7 +73,6 @@ libges_@GST_API_VERSION@include_HEADERS = \
ges.h \
ges-enums.h \
ges-gerror.h \
- ges-custom-source-clip.h \
ges-meta-container.h \
ges-simple-layer.h \
ges-timeline.h \
diff --git a/ges/ges-custom-source-clip.c b/ges/ges-custom-source-clip.c
deleted file mode 100644
index 04ee972b86..0000000000
--- a/ges/ges-custom-source-clip.c
+++ /dev/null
@@ -1,267 +0,0 @@
-/* GStreamer Editing Services
- * Copyright (C) 2009 Edward Hervey
- * 2009 Nokia Corporation
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- */
-
-/**
- * SECTION:ges-custom-source-clip
- * @short_description: Convenience GESSourceClip
- *
- * #GESCustomSourceClip allows creating #GESSourceClip(s) without the
- * need to subclass.
- *
- * Its usage should be limited to testing and prototyping purposes.
- *
- * To instanciate a asset to extract GESCustomSourceClip-s the expected
- * ID is:
- * 'PointerToFuncAsInt!PointerToUDataAsInt'
- *
- * You should use the #ges_asset_custom_source_clip_new helper to create
- * a new GESAsset letting you extract GESCustomSourceClip.
- */
-
-#include "ges-internal.h"
-#include "ges-custom-source-clip.h"
-#include "ges-source-clip.h"
-#include "ges-source.h"
-#include "ges-extractable.h"
-
-enum
-{
- PROP_0,
- PROP_FILL_FUNC,
- PROP_USER_DATA
-};
-
-struct _GESCustomSourceClipPrivate
-{
- GESFillTrackElementUserFunc filltrackelementfunc;
- gpointer user_data;
-};
-
-static void ges_extractable_interface_init (GESExtractableInterface * iface);
-
-G_DEFINE_TYPE_WITH_CODE (GESCustomSourceClip, ges_custom_source_clip,
- GES_TYPE_SOURCE_CLIP,
- G_IMPLEMENT_INTERFACE (GES_TYPE_EXTRACTABLE,
- ges_extractable_interface_init));
-
-static GParameter *
-extractable_get_parameters_from_id (const gchar * id, guint * n_params)
-{
- gchar **func_udata;
- GParameter *params = g_new0 (GParameter, 3);
- *n_params = 3;
-
- /* We already know that we have a valid ID here */
- func_udata = g_strsplit (id, "!", -1);
-
- params[0].name = "fill-func";
- g_value_init (¶ms[0].value, G_TYPE_POINTER);
- g_value_set_pointer (¶ms[0].value,
- GUINT_TO_POINTER (g_ascii_strtoll (func_udata[0], NULL, 10)));
-
- params[1].name = "user-data";
- g_value_init (¶ms[1].value, G_TYPE_POINTER);
- g_value_set_pointer (¶ms[1].value,
- GUINT_TO_POINTER (g_ascii_strtoll (func_udata[1], NULL, 10)));
-
- params[2].name = "supported-formats";
- g_value_init (¶ms[2].value, GES_TYPE_TRACK_TYPE);
- g_value_set_flags (¶ms[2].value, GES_TRACK_TYPE_CUSTOM);
-
- g_strfreev (func_udata);
-
- return params;
-}
-
-static gchar *
-extractable_check_id (GType type, const gchar * id)
-{
-
- gchar *ret, **strv = g_strsplit (id, "!", -1);
-
- if (g_strv_length (strv) != 2) {
- g_strfreev (strv);
-
- return NULL;
- }
-
- /* Remove any whitespace */
- strv[0] = g_strstrip (strv[0]);
- strv[1] = g_strstrip (strv[1]);
- ret = g_strjoinv ("!", strv);
-
- g_strfreev (strv);
-
- return ret;
-}
-
-static gchar *
-extractable_get_id (GESExtractable * self)
-{
- GESCustomSourceClipPrivate *priv = GES_CUSTOM_SOURCE_CLIP (self)->priv;
-
- return g_strdup_printf ("%i!%i", GPOINTER_TO_INT (priv->filltrackelementfunc),
- GPOINTER_TO_INT (priv->user_data));
-}
-
-static void
-ges_extractable_interface_init (GESExtractableInterface * iface)
-{
- iface->check_id = (GESExtractableCheckId) extractable_check_id;
- iface->get_id = extractable_get_id;
- iface->get_parameters_from_id = extractable_get_parameters_from_id;
-}
-
-static gboolean
-ges_custom_source_clip_fill_track_element (GESClip * clip,
- GESTrackElement * track_element, GstElement * gnlobj);
-
-static GESTrackElement *
-ges_custom_source_clip_create_track_element (GESClip * clip, GESTrackType type)
-{
- return g_object_new (GES_TYPE_SOURCE, "track-type", type, NULL);
-}
-
-static void
-_set_property (GObject * object, guint property_id,
- const GValue * value, GParamSpec * pspec)
-{
- GESCustomSourceClipPrivate *priv = GES_CUSTOM_SOURCE_CLIP (object)->priv;
- switch (property_id) {
- case PROP_FILL_FUNC:
- priv->filltrackelementfunc = g_value_get_pointer (value);
- break;
- case PROP_USER_DATA:
- priv->user_data = g_value_get_pointer (value);
- break;
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
- }
-}
-
-static void
-ges_custom_source_clip_class_init (GESCustomSourceClipClass * klass)
-{
- GObjectClass *object_class = G_OBJECT_CLASS (klass);
- GESClipClass *clip_class = GES_CLIP_CLASS (klass);
-
- g_type_class_add_private (klass, sizeof (GESCustomSourceClipPrivate));
-
- clip_class->fill_track_element = ges_custom_source_clip_fill_track_element;
- clip_class->create_track_element =
- ges_custom_source_clip_create_track_element;
-
- object_class->set_property = _set_property;
-
- /**
- * GESCustomSourceClip:fill-func:
- *
- * The function pointer to create the TrackElement content
- */
- g_object_class_install_property (object_class, PROP_FILL_FUNC,
- g_param_spec_pointer ("fill-func", "Fill func",
- "A pointer to a GESFillTrackElementUserFunc",
- G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));
-
- /**
- * GESCustomSourceClip:user-data:
- *
- * The user data that will be passed
- */
- g_object_class_install_property (object_class, PROP_USER_DATA,
- g_param_spec_pointer ("user-data", "User data",
- "The user data pointer that will be passed when creating TrackElements",
- G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));
-}
-
-static void
-ges_custom_source_clip_init (GESCustomSourceClip * self)
-{
- self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self,
- GES_TYPE_CUSTOM_SOURCE_CLIP, GESCustomSourceClipPrivate);
-}
-
-static gboolean
-ges_custom_source_clip_fill_track_element (GESClip * clip,
- GESTrackElement * track_element, GstElement * gnlobj)
-{
- gboolean res;
- GESCustomSourceClipPrivate *priv;
-
- GST_DEBUG ("Calling callback (timelineobj:%p, trackelement:%p, gnlobj:%p)",
- clip, track_element, gnlobj);
-
- priv = GES_CUSTOM_SOURCE_CLIP (clip)->priv;
- res = priv->filltrackelementfunc (clip, track_element, gnlobj,
- priv->user_data);
-
- GST_DEBUG ("Returning res:%d", res);
-
- return res;
-}
-
-/**
- * ges_custom_source_clip_new:
- * @func: (scope notified): The #GESFillTrackElementUserFunc that will be used to fill the track
- * objects.
- * @user_data: (closure): a gpointer that will be used when @func is called.
- *
- * Creates a new #GESCustomSourceClip.
- *
- * Returns: The new #GESCustomSourceClip.
- */
-GESCustomSourceClip *
-ges_custom_source_clip_new (GESFillTrackElementUserFunc func,
- gpointer user_data)
-{
- GESCustomSourceClip *src;
- GESAsset *asset = ges_asset_custom_source_clip_new (func, user_data);
-
- src = GES_CUSTOM_SOURCE_CLIP (ges_asset_extract (asset, NULL));
- gst_object_unref (asset);
-
- return src;
-}
-
-/**
- * ges_asset_custom_source_clip_new:
- * @func: (scope notified): The #GESFillTrackElementUserFunc that will be used to fill the track
- * objects.
- * @user_data: (closure): a gpointer that will be used when @func is called.
- *
- * Helper constructor to instanciate a new #GESAsset from which you can
- * extract #GESCustomSourceClip-s
- *
- * Returns: The new #GESAsset
- */
-GESAsset *
-ges_asset_custom_source_clip_new (GESFillTrackElementUserFunc func,
- gpointer user_data)
-{
- GESAsset *asset;
- gchar *id = g_strdup_printf ("%i!%i", GPOINTER_TO_INT (func),
- GPOINTER_TO_INT (user_data));
-
- asset = ges_asset_request (GES_TYPE_CUSTOM_SOURCE_CLIP, id, NULL);
-
- g_free (id);
-
- return asset;
-}
diff --git a/ges/ges-custom-source-clip.h b/ges/ges-custom-source-clip.h
deleted file mode 100644
index 08fffae17c..0000000000
--- a/ges/ges-custom-source-clip.h
+++ /dev/null
@@ -1,111 +0,0 @@
-/* GStreamer Editing Services
- * Copyright (C) 2009 Edward Hervey
- * 2009 Nokia Corporation
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- */
-
-#ifndef _GES_CUSTOM_SOURCE_CLIP
-#define _GES_CUSTOM_SOURCE_CLIP
-
-#include
-#include
-#include
-
-G_BEGIN_DECLS
-
-#define GES_TYPE_CUSTOM_SOURCE_CLIP ges_custom_source_clip_get_type()
-
-#define GES_CUSTOM_SOURCE_CLIP(obj) \
- (G_TYPE_CHECK_INSTANCE_CAST ((obj), GES_TYPE_CUSTOM_SOURCE_CLIP, GESCustomSourceClip))
-
-#define GES_CUSTOM_SOURCE_CLIP_CLASS(klass) \
- (G_TYPE_CHECK_CLASS_CAST ((klass), GES_TYPE_CUSTOM_SOURCE_CLIP, GESCustomSourceClipClass))
-
-#define GES_IS_CUSTOM_SOURCE_CLIP(obj) \
- (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GES_TYPE_CUSTOM_SOURCE_CLIP))
-
-#define GES_IS_CUSTOM_SOURCE_CLIP_CLASS(klass) \
- (G_TYPE_CHECK_CLASS_TYPE ((klass), GES_TYPE_CUSTOM_SOURCE_CLIP))
-
-#define GES_CUSTOM_SOURCE_CLIP_GET_CLASS(obj) \
- (G_TYPE_INSTANCE_GET_CLASS ((obj), GES_TYPE_CUSTOM_SOURCE_CLIP, GESCustomSourceClipClass))
-
-typedef struct _GESCustomSourceClipPrivate GESCustomSourceClipPrivate;
-
-/**
- * GESFillTrackElementUserFunc:
- * @object: the #GESClip controlling the track element
- * @track_element: the #GESTrackElement
- * @gnlobj: the GNonLin object that needs to be filled.
- * @user_data: the gpointer to optional user data
- *
- * A function that will be called when the GNonLin object of a corresponding
- * track element needs to be filled.
- *
- * The implementer of this function shall add the proper #GstElement to @gnlobj
- * using gst_bin_add().
- *
- * Returns: TRUE if the implementer succesfully filled the @gnlobj, else #FALSE.
- */
-typedef gboolean (*GESFillTrackElementUserFunc) (GESClip * object,
- GESTrackElement * track_element,
- GstElement * gnlobj,
- gpointer user_data);
-
-/**
- * GESCustomSourceClip:
- *
- * Debugging custom timeline source
- */
-
-struct _GESCustomSourceClip {
- GESSourceClip parent;
-
- /*< private >*/
- GESCustomSourceClipPrivate *priv;
-
- /* Padding for API extension */
- gpointer _ges_reserved[GES_PADDING];
-};
-
-/**
- * GESCustomSourceClipClass:
- */
-
-struct _GESCustomSourceClipClass {
- GESSourceClipClass parent_class;
-
- /*< private >*/
- /* Padding for API extension */
- gpointer _ges_reserved[GES_PADDING];
-};
-
-GType ges_custom_source_clip_get_type (void);
-
-GESCustomSourceClip*
-ges_custom_source_clip_new (GESFillTrackElementUserFunc func,
- gpointer user_data);
-
-GESAsset*
-ges_asset_custom_source_clip_new (GESFillTrackElementUserFunc func,
- gpointer user_data);
-
-
-G_END_DECLS
-
-#endif /* _GES_CUSTOM_SOURCE_CLIP */
-
diff --git a/ges/ges-types.h b/ges/ges-types.h
index 46ab16ba85..76bc9bbc1f 100644
--- a/ges/ges-types.h
+++ b/ges/ges-types.h
@@ -29,9 +29,6 @@
/* Type definitions */
-typedef struct _GESCustomSourceClip GESCustomSourceClip;
-typedef struct _GESCustomSourceClipClass GESCustomSourceClipClass;
-
typedef struct _GESSimpleLayer GESSimpleLayer;
typedef struct _GESSimpleLayerClass GESSimpleLayerClass;
diff --git a/ges/ges.h b/ges/ges.h
index 343b57a1f2..28e7eac686 100644
--- a/ges/ges.h
+++ b/ges/ges.h
@@ -42,7 +42,6 @@
#include
#include
#include
-#include
#include
#include
#include
diff --git a/tests/check/ges/basic.c b/tests/check/ges/basic.c
index 22e29caaa8..26bd00c374 100644
--- a/tests/check/ges/basic.c
+++ b/tests/check/ges/basic.c
@@ -32,31 +32,12 @@ GST_START_TEST (test_ges_init)
GST_END_TEST;
-static gboolean
-my_fill_track_func (GESClip * clip,
- GESTrackElement * track_element, GstElement * gnlobj, gpointer user_data)
-{
- GstElement *src;
-
- GST_DEBUG ("timelineobj:%p, trackelement:%p, gnlobj:%p",
- clip, track_element, gnlobj);
-
- /* Let's just put a fakesource in for the time being */
- src = gst_element_factory_make ("fakesrc", NULL);
-
- /* If this fails... that means that there already was something
- * in it */
- fail_unless (gst_bin_add (GST_BIN (gnlobj), src));
-
- return TRUE;
-}
-
GST_START_TEST (test_ges_scenario)
{
GESTimeline *timeline;
GESLayer *layer, *tmp_layer;
GESTrack *track;
- GESCustomSourceClip *source;
+ GESTestClip *source;
GESTrackElement *trackelement;
GList *trackelements, *layers, *tracks;
@@ -85,7 +66,7 @@ GST_START_TEST (test_ges_scenario)
/* Give the Timeline a Track */
GST_DEBUG ("Create a Track");
- track = ges_track_new (GES_TRACK_TYPE_CUSTOM, gst_caps_ref (GST_CAPS_ANY));
+ track = GES_TRACK (ges_video_track_new ());
fail_unless (track != NULL);
GST_DEBUG ("Add the track to the timeline");
@@ -98,7 +79,7 @@ GST_START_TEST (test_ges_scenario)
/* Create a source and add it to the Layer */
GST_DEBUG ("Creating a source");
- source = ges_custom_source_clip_new (my_fill_track_func, NULL);
+ source = ges_test_clip_new ();
fail_unless (source != NULL);
/* The source will be floating before added to the layer... */
@@ -180,7 +161,7 @@ GST_START_TEST (test_ges_timeline_add_layer)
GESTimeline *timeline;
GESLayer *layer, *tmp_layer;
GESTrack *track;
- GESCustomSourceClip *s1, *s2, *s3;
+ GESTestClip *s1, *s2, *s3;
GList *trackelements, *layers;
GESTrackElement *trackelement;
@@ -196,7 +177,7 @@ GST_START_TEST (test_ges_timeline_add_layer)
fail_unless (layer != NULL);
/* Give the Timeline a Track */
GST_DEBUG ("Create a Track");
- track = ges_track_new (GES_TRACK_TYPE_CUSTOM, gst_caps_ref (GST_CAPS_ANY));
+ track = GES_TRACK (ges_video_track_new ());
fail_unless (track != NULL);
GST_DEBUG ("Add the track to the timeline");
@@ -208,7 +189,7 @@ GST_START_TEST (test_ges_timeline_add_layer)
/* Create a source and add it to the Layer */
GST_DEBUG ("Creating a source");
- s1 = ges_custom_source_clip_new (my_fill_track_func, NULL);
+ s1 = ges_test_clip_new ();
fail_unless (s1 != NULL);
fail_unless (ges_layer_add_clip (layer, GES_CLIP (s1)));
tmp_layer = ges_clip_get_layer (GES_CLIP (s1));
@@ -217,7 +198,7 @@ GST_START_TEST (test_ges_timeline_add_layer)
gst_object_unref (tmp_layer);
GST_DEBUG ("Creating a source");
- s2 = ges_custom_source_clip_new (my_fill_track_func, NULL);
+ s2 = ges_test_clip_new ();
fail_unless (s2 != NULL);
fail_unless (ges_layer_add_clip (layer, GES_CLIP (s2)));
tmp_layer = ges_clip_get_layer (GES_CLIP (s2));
@@ -226,7 +207,7 @@ GST_START_TEST (test_ges_timeline_add_layer)
gst_object_unref (tmp_layer);
GST_DEBUG ("Creating a source");
- s3 = ges_custom_source_clip_new (my_fill_track_func, NULL);
+ s3 = ges_test_clip_new ();
fail_unless (s3 != NULL);
fail_unless (ges_layer_add_clip (layer, GES_CLIP (s3)));
tmp_layer = ges_clip_get_layer (GES_CLIP (s3));
@@ -292,7 +273,7 @@ GST_START_TEST (test_ges_timeline_add_layer_first)
GESTimeline *timeline;
GESLayer *layer, *tmp_layer;
GESTrack *track;
- GESCustomSourceClip *s1, *s2, *s3;
+ GESTestClip *s1, *s2, *s3;
GList *trackelements, *tmp, *layers;
ges_init ();
@@ -307,12 +288,12 @@ GST_START_TEST (test_ges_timeline_add_layer_first)
fail_unless (layer != NULL);
/* Give the Timeline a Track */
GST_DEBUG ("Create a Track");
- track = ges_track_new (GES_TRACK_TYPE_CUSTOM, gst_caps_ref (GST_CAPS_ANY));
+ track = GES_TRACK (ges_video_track_new ());
fail_unless (track != NULL);
/* Create a source and add it to the Layer */
GST_DEBUG ("Creating a source");
- s1 = ges_custom_source_clip_new (my_fill_track_func, NULL);
+ s1 = ges_test_clip_new ();
fail_unless (s1 != NULL);
fail_unless (ges_layer_add_clip (layer, GES_CLIP (s1)));
tmp_layer = ges_clip_get_layer (GES_CLIP (s1));
@@ -320,7 +301,7 @@ GST_START_TEST (test_ges_timeline_add_layer_first)
gst_object_unref (tmp_layer);
GST_DEBUG ("Creating a source");
- s2 = ges_custom_source_clip_new (my_fill_track_func, NULL);
+ s2 = ges_test_clip_new ();
fail_unless (s2 != NULL);
fail_unless (ges_layer_add_clip (layer, GES_CLIP (s2)));
tmp_layer = ges_clip_get_layer (GES_CLIP (s2));
@@ -328,7 +309,7 @@ GST_START_TEST (test_ges_timeline_add_layer_first)
gst_object_unref (tmp_layer);
GST_DEBUG ("Creating a source");
- s3 = ges_custom_source_clip_new (my_fill_track_func, NULL);
+ s3 = ges_test_clip_new ();
fail_unless (s3 != NULL);
fail_unless (ges_layer_add_clip (layer, GES_CLIP (s3)));
tmp_layer = ges_clip_get_layer (GES_CLIP (s3));
@@ -393,7 +374,7 @@ GST_START_TEST (test_ges_timeline_remove_track)
GESTimeline *timeline;
GESLayer *layer, *tmp_layer;
GESTrack *track;
- GESCustomSourceClip *s1, *s2, *s3;
+ GESTestClip *s1, *s2, *s3;
GESTrackElement *t1, *t2, *t3;
GList *trackelements, *tmp, *layers;
@@ -409,12 +390,12 @@ GST_START_TEST (test_ges_timeline_remove_track)
fail_unless (layer != NULL);
/* Give the Timeline a Track */
GST_DEBUG ("Create a Track");
- track = ges_track_new (GES_TRACK_TYPE_CUSTOM, gst_caps_ref (GST_CAPS_ANY));
+ track = GES_TRACK (ges_video_track_new ());
fail_unless (track != NULL);
/* Create a source and add it to the Layer */
GST_DEBUG ("Creating a source");
- s1 = ges_custom_source_clip_new (my_fill_track_func, NULL);
+ s1 = ges_test_clip_new ();
fail_unless (s1 != NULL);
fail_unless (ges_layer_add_clip (layer, GES_CLIP (s1)));
tmp_layer = ges_clip_get_layer (GES_CLIP (s1));
@@ -423,7 +404,7 @@ GST_START_TEST (test_ges_timeline_remove_track)
ASSERT_OBJECT_REFCOUNT (layer, "1 for the timeline", 1);
GST_DEBUG ("Creating a source");
- s2 = ges_custom_source_clip_new (my_fill_track_func, NULL);
+ s2 = ges_test_clip_new ();
fail_unless (s2 != NULL);
fail_unless (ges_layer_add_clip (layer, GES_CLIP (s2)));
tmp_layer = ges_clip_get_layer (GES_CLIP (s2));
@@ -432,7 +413,7 @@ GST_START_TEST (test_ges_timeline_remove_track)
ASSERT_OBJECT_REFCOUNT (layer, "1 for the timeline", 1);
GST_DEBUG ("Creating a source");
- s3 = ges_custom_source_clip_new (my_fill_track_func, NULL);
+ s3 = ges_test_clip_new ();
fail_unless (s3 != NULL);
fail_unless (ges_layer_add_clip (layer, GES_CLIP (s3)));
tmp_layer = ges_clip_get_layer (GES_CLIP (s3));
@@ -525,7 +506,7 @@ GST_END_TEST;
typedef struct
{
- GESCustomSourceClip **o1, **o2, **o3;
+ GESTestClip **o1, **o2, **o3;
GESTrack **tr1, **tr2;
} SelectTracksData;
@@ -550,7 +531,7 @@ GST_START_TEST (test_ges_timeline_multiple_tracks)
GESTimeline *timeline;
GESLayer *layer, *tmp_layer;
GESTrack *track1, *track2;
- GESCustomSourceClip *s1, *s2, *s3;
+ GESTestClip *s1, *s2, *s3;
GESTrackElement *t1, *t2, *t3;
GList *trackelements, *tmp, *layers;
SelectTracksData st_data = { &s1, &s2, &s3, &track1, &track2 };
@@ -570,10 +551,10 @@ GST_START_TEST (test_ges_timeline_multiple_tracks)
fail_unless (layer != NULL);
/* Give the Timeline a Track */
GST_DEBUG ("Create Track 1");
- track1 = ges_track_new (GES_TRACK_TYPE_CUSTOM, gst_caps_ref (GST_CAPS_ANY));
+ track1 = GES_TRACK (ges_video_track_new ());
fail_unless (track1 != NULL);
GST_DEBUG ("Create Track 2");
- track2 = ges_track_new (GES_TRACK_TYPE_CUSTOM, gst_caps_ref (GST_CAPS_ANY));
+ track2 = GES_TRACK (ges_video_track_new ());
fail_unless (track2 != NULL);
GST_DEBUG ("Add the track 1 to the timeline");
@@ -590,7 +571,7 @@ GST_START_TEST (test_ges_timeline_multiple_tracks)
/* Create a source and add it to the Layer */
GST_DEBUG ("Creating a source");
- s1 = ges_custom_source_clip_new (my_fill_track_func, NULL);
+ s1 = ges_test_clip_new ();
fail_unless (s1 != NULL);
fail_unless (ges_layer_add_clip (layer, GES_CLIP (s1)));
tmp_layer = ges_clip_get_layer (GES_CLIP (s1));
@@ -598,7 +579,7 @@ GST_START_TEST (test_ges_timeline_multiple_tracks)
gst_object_unref (tmp_layer);
GST_DEBUG ("Creating a source");
- s2 = ges_custom_source_clip_new (my_fill_track_func, NULL);
+ s2 = ges_test_clip_new ();
fail_unless (s2 != NULL);
fail_unless (ges_layer_add_clip (layer, GES_CLIP (s2)));
tmp_layer = ges_clip_get_layer (GES_CLIP (s2));
@@ -606,7 +587,7 @@ GST_START_TEST (test_ges_timeline_multiple_tracks)
gst_object_unref (tmp_layer);
GST_DEBUG ("Creating a source");
- s3 = ges_custom_source_clip_new (my_fill_track_func, NULL);
+ s3 = ges_test_clip_new ();
fail_unless (s3 != NULL);
fail_unless (ges_layer_add_clip (layer, GES_CLIP (s3)));
tmp_layer = ges_clip_get_layer (GES_CLIP (s3));
diff --git a/tests/check/ges/clip.c b/tests/check/ges/clip.c
index 0fbb0b5a2d..dab49891aa 100644
--- a/tests/check/ges/clip.c
+++ b/tests/check/ges/clip.c
@@ -21,24 +21,6 @@
#include
#include
-static gboolean
-my_fill_track_func (GESClip * clip,
- GESTrackElement * track_element, GstElement * gnlobj, gpointer user_data)
-{
- GstElement *src;
-
- GST_DEBUG ("timelineobj:%p, trackelementec:%p, gnlobj:%p",
- clip, track_element, gnlobj);
-
- /* Let's just put a fakesource in for the time being */
- src = gst_element_factory_make ("fakesrc", NULL);
- /* If this fails... that means that there already was something
- * in it */
- fail_unless (gst_bin_add (GST_BIN (gnlobj), src));
-
- return TRUE;
-}
-
GST_START_TEST (test_object_properties)
{
GESClip *clip;
@@ -49,7 +31,7 @@ GST_START_TEST (test_object_properties)
ges_init ();
- track = ges_track_new (GES_TRACK_TYPE_CUSTOM, gst_caps_ref (GST_CAPS_ANY));
+ track = GES_TRACK (ges_video_track_new ());
fail_unless (track != NULL);
layer = ges_layer_new ();
@@ -59,7 +41,7 @@ GST_START_TEST (test_object_properties)
fail_unless (ges_timeline_add_layer (timeline, layer));
fail_unless (ges_timeline_add_track (timeline, track));
- clip = (GESClip *) ges_custom_source_clip_new (my_fill_track_func, NULL);
+ clip = (GESClip *) ges_test_clip_new ();
fail_unless (clip != NULL);
/* Set some properties */
diff --git a/tests/check/ges/layer.c b/tests/check/ges/layer.c
index ad11045bf2..dfe21a7329 100644
--- a/tests/check/ges/layer.c
+++ b/tests/check/ges/layer.c
@@ -23,25 +23,6 @@
#define LAYER_HEIGHT 1000
-static gboolean
-my_fill_track_func (GESClip * clip,
- GESTrackElement * track_element, GstElement * gnlobj, gpointer user_data)
-{
- GstElement *src;
-
- GST_DEBUG ("timelineobj:%p, trackelementec:%p, gnlobj:%p",
- clip, track_element, gnlobj);
-
- /* Let's just put a fakesource in for the time being */
- src = gst_element_factory_make ("fakesrc", NULL);
-
- /* If this fails... that means that there already was something
- * in it */
- fail_unless (gst_bin_add (GST_BIN (gnlobj), src));
-
- return TRUE;
-}
-
GST_START_TEST (test_layer_properties)
{
GESTimeline *timeline;
@@ -65,11 +46,11 @@ GST_START_TEST (test_layer_properties)
fail_unless (ges_timeline_add_layer (timeline, layer));
fail_if (g_object_is_floating (layer));
- track = ges_track_new (GES_TRACK_TYPE_CUSTOM, gst_caps_ref (GST_CAPS_ANY));
+ track = GES_TRACK (ges_video_track_new ());
fail_unless (track != NULL);
fail_unless (ges_timeline_add_track (timeline, track));
- clip = (GESClip *) ges_custom_source_clip_new (my_fill_track_func, NULL);
+ clip = (GESClip *) ges_test_clip_new ();
fail_unless (clip != NULL);
/* Set some properties */
@@ -162,13 +143,13 @@ GST_START_TEST (test_layer_priorities)
fail_unless (track != NULL);
fail_unless (ges_timeline_add_track (timeline, track));
- clip1 = GES_CLIP (ges_custom_source_clip_new (my_fill_track_func, NULL));
+ clip1 = GES_CLIP (ges_test_clip_new ());
ges_clip_set_supported_formats (clip1,
GES_TRACK_TYPE_AUDIO | GES_TRACK_TYPE_VIDEO);
- clip2 = GES_CLIP (ges_custom_source_clip_new (my_fill_track_func, NULL));
+ clip2 = GES_CLIP (ges_test_clip_new ());
ges_clip_set_supported_formats (clip2,
GES_TRACK_TYPE_AUDIO | GES_TRACK_TYPE_VIDEO);
- clip3 = GES_CLIP (ges_custom_source_clip_new (my_fill_track_func, NULL));
+ clip3 = GES_CLIP (ges_test_clip_new ());
ges_clip_set_supported_formats (clip3,
GES_TRACK_TYPE_AUDIO | GES_TRACK_TYPE_VIDEO);
fail_unless (clip1 != NULL);
diff --git a/tests/check/ges/simplelayer.c b/tests/check/ges/simplelayer.c
index 9a316f819e..c873929bca 100644
--- a/tests/check/ges/simplelayer.c
+++ b/tests/check/ges/simplelayer.c
@@ -21,31 +21,12 @@
#include
#include
-static gboolean
-my_fill_track_func (GESClip * clip,
- GESTrackElement * track_element, GstElement * gnlobj, gpointer user_data)
-{
- GstElement *src;
-
- GST_DEBUG ("timelineobj:%p, trackelementec:%p, gnlobj:%p",
- clip, track_element, gnlobj);
-
- /* Let's just put a fakesource in for the time being */
- src = gst_element_factory_make ("fakesrc", NULL);
-
- /* If this fails... that means that there already was something
- * in it */
- fail_unless (gst_bin_add (GST_BIN (gnlobj), src));
-
- return TRUE;
-}
-
GST_START_TEST (test_gsl_add)
{
GESTimeline *timeline;
GESLayer *layer;
GESTrack *track;
- GESCustomSourceClip *source;
+ GESTestClip *source;
GESClip *source2;
gint result;
@@ -56,10 +37,10 @@ GST_START_TEST (test_gsl_add)
timeline = ges_timeline_new ();
layer = (GESLayer *) ges_simple_layer_new ();
fail_unless (ges_timeline_add_layer (timeline, layer));
- track = ges_track_new (GES_TRACK_TYPE_CUSTOM, gst_caps_ref (GST_CAPS_ANY));
+ track = GES_TRACK (ges_video_track_new ());
fail_unless (ges_timeline_add_track (timeline, track));
- source = ges_custom_source_clip_new (my_fill_track_func, NULL);
+ source = ges_test_clip_new ();
fail_unless (source != NULL);
g_object_set (source, "duration", GST_SECOND, "start", (guint64) 42, NULL);
fail_unless_equals_uint64 (_DURATION (source), GST_SECOND);
@@ -115,7 +96,7 @@ GST_START_TEST (test_gsl_move_simple)
GESTimeline *timeline;
GESLayer *layer;
GESTrack *track;
- GESCustomSourceClip *source1, *source2;
+ GESTestClip *source1, *source2;
siginfo info = { 0, 0 };
ges_init ();
@@ -130,10 +111,10 @@ GST_START_TEST (test_gsl_move_simple)
(object_moved_cb), &info);
/* Create two 1s sources */
- source1 = ges_custom_source_clip_new (my_fill_track_func, NULL);
+ source1 = ges_test_clip_new ();
g_object_set (source1, "duration", GST_SECOND, "start", (guint64) 42, NULL);
fail_unless_equals_uint64 (_DURATION (source1), GST_SECOND);
- source2 = ges_custom_source_clip_new (my_fill_track_func, NULL);
+ source2 = ges_test_clip_new ();
g_object_set (source2, "duration", GST_SECOND, "start", (guint64) 42, NULL);
fail_unless_equals_uint64 (_DURATION (source2), GST_SECOND);
diff --git a/tests/check/ges/timelineedition.c b/tests/check/ges/timelineedition.c
index f96be2853f..540f2ee0bf 100644
--- a/tests/check/ges/timelineedition.c
+++ b/tests/check/ges/timelineedition.c
@@ -49,30 +49,6 @@
} \
}
-static gboolean
-my_fill_track_func (GESClip * clip,
- GESTrackElement * track_element, GstElement * gnlobj, gpointer user_data)
-{
- GstElement *src;
-
- GST_DEBUG ("timelineobj:%p, trackelementec:%p, gnlobj:%p",
- clip, track_element, gnlobj);
-
- /* Let's just put a fakesource in for the time being */
- src = gst_element_factory_make ("fakesrc", NULL);
- /* If this fails... that means that there already was something
- * in it */
- fail_unless (gst_bin_add (GST_BIN (gnlobj), src));
-
- return TRUE;
-}
-
-static inline GESClip *
-create_custom_clip (void)
-{
- return GES_CLIP (ges_custom_source_clip_new (my_fill_track_func, NULL));
-}
-
GST_START_TEST (test_basic_timeline_edition)
{
GESAsset *asset;
@@ -274,7 +250,7 @@ GST_START_TEST (test_snapping)
ges_init ();
- track = ges_track_new (GES_TRACK_TYPE_CUSTOM, gst_caps_ref (GST_CAPS_ANY));
+ track = GES_TRACK (ges_video_track_new ());
fail_unless (track != NULL);
timeline = ges_timeline_new ();
@@ -282,9 +258,9 @@ GST_START_TEST (test_snapping)
fail_unless (ges_timeline_add_track (timeline, track));
- clip = GES_CONTAINER (create_custom_clip ());
- clip1 = GES_CONTAINER (create_custom_clip ());
- clip2 = GES_CONTAINER (create_custom_clip ());
+ clip = GES_CONTAINER (ges_test_clip_new ());
+ clip1 = GES_CONTAINER (ges_test_clip_new ());
+ clip2 = GES_CONTAINER (ges_test_clip_new ());
fail_unless (clip && clip1 && clip2);
@@ -572,7 +548,7 @@ GST_START_TEST (test_timeline_edition_mode)
ges_init ();
- track = ges_track_new (GES_TRACK_TYPE_CUSTOM, gst_caps_ref (GST_CAPS_ANY));
+ track = GES_TRACK (ges_video_track_new ());
fail_unless (track != NULL);
timeline = ges_timeline_new ();
@@ -580,9 +556,9 @@ GST_START_TEST (test_timeline_edition_mode)
fail_unless (ges_timeline_add_track (timeline, track));
- clip = GES_CONTAINER (create_custom_clip ());
- clip1 = GES_CONTAINER (create_custom_clip ());
- clip2 = GES_CONTAINER (create_custom_clip ());
+ clip = GES_CONTAINER (ges_test_clip_new ());
+ clip1 = GES_CONTAINER (ges_test_clip_new ());
+ clip2 = GES_CONTAINER (ges_test_clip_new ());
fail_unless (clip && clip1 && clip2);