From e3718b4213b9e26cc90a8c30847df2aba0382715 Mon Sep 17 00:00:00 2001 From: Brandon Lewis Date: Wed, 30 Jun 2010 20:25:18 +0200 Subject: [PATCH] GESTimelineBackgroundSource -> GESTimelineTestSource --- docs/libs/ges-sections.txt | 26 ++--- ges/Makefile.am | 4 +- ...nd-source.c => ges-timeline-test-source.c} | 96 ++++++++++--------- ...nd-source.h => ges-timeline-test-source.h} | 42 ++++---- ges/ges-types.h | 4 +- ges/ges.h | 2 +- tests/check/ges/backgroundsource.c | 22 ++--- tools/ges-launch.c | 13 ++- 8 files changed, 106 insertions(+), 103 deletions(-) rename ges/{ges-timeline-background-source.c => ges-timeline-test-source.c} (67%) rename ges/{ges-timeline-background-source.h => ges-timeline-test-source.h} (50%) diff --git a/docs/libs/ges-sections.txt b/docs/libs/ges-sections.txt index 451307c9f4..0e9392e79c 100644 --- a/docs/libs/ges-sections.txt +++ b/docs/libs/ges-sections.txt @@ -345,19 +345,20 @@ GES_TYPE_SIMPLE_TIMELINE_LAYER
-ges-timeline-background-source -GESTimelineBackgroundSource -GESTimelineBackgroundSource -GESTimelineBackgroundSourceClass -ges_timeline_background_source_new -ges_timeline_background_source_new_for_nick -ges_tl_bg_src_get_type +ges-timeline-test-source +GESTimelineTestSource +GESTimelineTestSource +GESTimelineTestSourceClass +ges_timeline_test_source_new +ges_timeline_test_source_new_for_nick +ges_timeline_test_source_get_type -GES_IS_TIMELINE_BACKGROUND_SOURCE -GES_IS_TIMELINE_BACKGROUND_SOURCE_CLASS -GES_TIMELINE_BACKGROUND_SOURCE -GES_TIMELINE_BACKGROUND_SOURCE_CLASS -GES_TIMELINE_BACKGROUND_SOURCE_GET_CLASS +GES_TYPE_TIMELINE_TEST_SOURCE +GES_IS_TIMELINE_TEST_SOURCE +GES_IS_TIMELINE_TEST_SOURCE_CLASS +GES_TIMELINE_TEST_SOURCE +GES_TIMELINE_TEST_SOURCE_CLASS +GES_TIMELINE_TEST_SOURCE_GET_CLASS
@@ -445,7 +446,6 @@ ges_track_title_source_new GES_TRACK_TITLE_SOURCE GES_TRACK_TITLE_SOURCE_CLASS GES_TRACK_TITLE_SOURCE_GET_CLASS -GES_TYPE_TIMELINE_BACKGROUND_SOURCE GES_TYPE_TIMELINE_TITLE_SOURCE GES_TYPE_TRACK_TITLE_SOURCE GES_IS_TRACK_TITLE_SOURCE diff --git a/ges/Makefile.am b/ges/Makefile.am index 8cb766218a..278a4791c2 100644 --- a/ges/Makefile.am +++ b/ges/Makefile.am @@ -18,7 +18,7 @@ libges_@GST_MAJORMINOR@_la_SOURCES = \ ges-timeline-source.c \ ges-timeline-file-source.c \ ges-timeline-transition.c \ - ges-timeline-background-source.c \ + ges-timeline-test-source.c \ ges-timeline-title-source.c \ ges-timeline-overlay.c \ ges-track.c \ @@ -49,7 +49,7 @@ libges_@GST_MAJORMINOR@include_HEADERS = \ ges-timeline-source.h \ ges-timeline-file-source.h \ ges-timeline-transition.h \ - ges-timeline-background-source.h \ + ges-timeline-test-source.h \ ges-timeline-title-source.h \ ges-timeline-overlay.h \ ges-track.h \ diff --git a/ges/ges-timeline-background-source.c b/ges/ges-timeline-test-source.c similarity index 67% rename from ges/ges-timeline-background-source.c rename to ges/ges-timeline-test-source.c index e83d3d6c1b..789273e501 100644 --- a/ges/ges-timeline-background-source.c +++ b/ges/ges-timeline-test-source.c @@ -19,7 +19,7 @@ */ /** - * SECTION:ges-timeline-background-source + * SECTION:ges-timeline-test-source * @short_description: An object for manipulating media files in a GESTimeline * * Represents all the output treams from a particular uri. It is assumed that @@ -27,18 +27,18 @@ */ #include "ges-internal.h" -#include "ges-timeline-background-source.h" +#include "ges-timeline-test-source.h" #include "ges-timeline-source.h" #include "ges-track-object.h" #include "ges-track-video-test-source.h" #include "ges-track-audio-test-source.h" #include -G_DEFINE_TYPE (GESTimelineBackgroundSource, ges_tl_bg_src, +G_DEFINE_TYPE (GESTimelineTestSource, ges_timeline_test_source, GES_TYPE_TIMELINE_SOURCE); -#define GES_TIMELINE_BACKGROUND_SOURCE_VPATTERN_TYPE\ - ges_timeline_background_source_vpattern_get_type() +#define GES_TIMELINE_TEST_SOURCE_VPATTERN_TYPE\ + ges_timeline_test_source_vpattern_get_type() /* table more-or-less copied from gstvideotestsrc.c */ static GEnumValue vpattern_enum_values[] = { @@ -59,17 +59,17 @@ static GEnumValue vpattern_enum_values[] = { {0, NULL, NULL} }; -GType ges_timeline_background_source_vpattern_get_type (void); +GType ges_timeline_test_source_vpattern_get_type (void); GType -ges_timeline_background_source_vpattern_get_type (void) +ges_timeline_test_source_vpattern_get_type (void) { static gsize once = 0; static GType theType = 0; if (g_once_init_enter (&once)) { - theType = g_enum_register_static ("GESTimelineBackgroundSourceVPattern", + theType = g_enum_register_static ("GESTimelineTestSourceVPattern", vpattern_enum_values); g_once_init_leave (&once, 1); }; @@ -85,20 +85,21 @@ enum }; static void -ges_tl_bg_src_set_mute (GESTimelineBackgroundSource * self, gboolean mute); +ges_timeline_test_source_set_mute (GESTimelineTestSource * self, gboolean mute); static void -ges_tl_bg_src_set_vpattern (GESTimelineBackgroundSource * self, gint vpattern); +ges_timeline_test_source_set_vpattern (GESTimelineTestSource * self, + gint vpattern); static GESTrackObject - * ges_tl_bg_src_create_track_object (GESTimelineObject * obj, + * ges_timeline_test_source_create_track_object (GESTimelineObject * obj, GESTrack * track); static void -ges_tl_bg_src_get_property (GObject * object, guint property_id, +ges_timeline_test_source_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) { - GESTimelineBackgroundSource *tfs = GES_TIMELINE_BACKGROUND_SOURCE (object); + GESTimelineTestSource *tfs = GES_TIMELINE_TEST_SOURCE (object); switch (property_id) { case PROP_MUTE: @@ -113,17 +114,17 @@ ges_tl_bg_src_get_property (GObject * object, guint property_id, } static void -ges_tl_bg_src_set_property (GObject * object, guint property_id, +ges_timeline_test_source_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec) { - GESTimelineBackgroundSource *tfs = GES_TIMELINE_BACKGROUND_SOURCE (object); + GESTimelineTestSource *tfs = GES_TIMELINE_TEST_SOURCE (object); switch (property_id) { case PROP_MUTE: - ges_tl_bg_src_set_mute (tfs, g_value_get_boolean (value)); + ges_timeline_test_source_set_mute (tfs, g_value_get_boolean (value)); break; case PROP_VPATTERN: - ges_tl_bg_src_set_vpattern (tfs, g_value_get_enum (value)); + ges_timeline_test_source_set_vpattern (tfs, g_value_get_enum (value)); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); @@ -131,41 +132,41 @@ ges_tl_bg_src_set_property (GObject * object, guint property_id, } static void -ges_tl_bg_src_dispose (GObject * object) +ges_timeline_test_source_dispose (GObject * object) { - G_OBJECT_CLASS (ges_tl_bg_src_parent_class)->dispose (object); + G_OBJECT_CLASS (ges_timeline_test_source_parent_class)->dispose (object); } static void -ges_tl_bg_src_finalize (GObject * object) +ges_timeline_test_source_finalize (GObject * object) { - G_OBJECT_CLASS (ges_tl_bg_src_parent_class)->finalize (object); + G_OBJECT_CLASS (ges_timeline_test_source_parent_class)->finalize (object); } static void -ges_tl_bg_src_class_init (GESTimelineBackgroundSourceClass * klass) +ges_timeline_test_source_class_init (GESTimelineTestSourceClass * klass) { GObjectClass *object_class = G_OBJECT_CLASS (klass); GESTimelineObjectClass *timobj_class = GES_TIMELINE_OBJECT_CLASS (klass); - object_class->get_property = ges_tl_bg_src_get_property; - object_class->set_property = ges_tl_bg_src_set_property; - object_class->dispose = ges_tl_bg_src_dispose; - object_class->finalize = ges_tl_bg_src_finalize; + object_class->get_property = ges_timeline_test_source_get_property; + object_class->set_property = ges_timeline_test_source_set_property; + object_class->dispose = ges_timeline_test_source_dispose; + object_class->finalize = ges_timeline_test_source_finalize; /** - * GESTimelineBackgroundSource:vpattern: + * GESTimelineTestSource:vpattern: * * Video pattern to display in video track objects. */ g_object_class_install_property (object_class, PROP_VPATTERN, g_param_spec_enum ("vpattern", "VPattern", "Which video pattern to display. See videotestsrc element", - GES_TIMELINE_BACKGROUND_SOURCE_VPATTERN_TYPE, + GES_TIMELINE_TEST_SOURCE_VPATTERN_TYPE, GES_TRACK_VIDEO_BG_SRC_BLACK, G_PARAM_READWRITE | G_PARAM_CONSTRUCT)); /** - * GESTimelineBackgroundSource:mute: + * GESTimelineTestSource:mute: * * Whether the sound will be played or not. */ @@ -173,18 +174,19 @@ ges_tl_bg_src_class_init (GESTimelineBackgroundSourceClass * klass) g_param_spec_boolean ("mute", "Mute", "Mute audio track", FALSE, G_PARAM_READWRITE | G_PARAM_CONSTRUCT)); - timobj_class->create_track_object = ges_tl_bg_src_create_track_object; + timobj_class->create_track_object = + ges_timeline_test_source_create_track_object; timobj_class->need_fill_track = FALSE; } static void -ges_tl_bg_src_init (GESTimelineBackgroundSource * self) +ges_timeline_test_source_init (GESTimelineTestSource * self) { GES_TIMELINE_OBJECT (self)->duration = 0; } static void -ges_tl_bg_src_set_mute (GESTimelineBackgroundSource * self, gboolean mute) +ges_timeline_test_source_set_mute (GESTimelineTestSource * self, gboolean mute) { GList *tmp; GESTimelineObject *object = (GESTimelineObject *) self; @@ -203,7 +205,8 @@ ges_tl_bg_src_set_mute (GESTimelineBackgroundSource * self, gboolean mute) } static void -ges_tl_bg_src_set_vpattern (GESTimelineBackgroundSource * self, gint vpattern) +ges_timeline_test_source_set_vpattern (GESTimelineTestSource * self, + gint vpattern) { GList *tmp; GESTimelineObject *object = (GESTimelineObject *) self; @@ -219,12 +222,13 @@ ges_tl_bg_src_set_vpattern (GESTimelineBackgroundSource * self, gint vpattern) } static GESTrackObject * -ges_tl_bg_src_create_track_object (GESTimelineObject * obj, GESTrack * track) +ges_timeline_test_source_create_track_object (GESTimelineObject * obj, + GESTrack * track) { - GESTimelineBackgroundSource *tfs = (GESTimelineBackgroundSource *) obj; + GESTimelineTestSource *tfs = (GESTimelineTestSource *) obj; GESTrackObject *res = NULL; - GST_DEBUG ("Creating a GESTrackBackgroundSource"); + GST_DEBUG ("Creating a GESTrackTestSource"); if (track->type == GES_TRACK_TYPE_VIDEO) { res = (GESTrackObject *) ges_track_video_test_source_new (); @@ -245,32 +249,32 @@ ges_tl_bg_src_create_track_object (GESTimelineObject * obj, GESTrack * track) } /** - * ges_timeline_backgroundsource_new: + * ges_timeline_testsource_new: * @uri: the URI the source should control * - * Creates a new #GESTimelineBackgroundSource for the provided @uri. + * Creates a new #GESTimelineTestSource for the provided @uri. * - * Returns: The newly created #GESTimelineBackgroundSource, or NULL if there was an + * Returns: The newly created #GESTimelineTestSource, or NULL if there was an * error. */ -GESTimelineBackgroundSource * -ges_timeline_background_source_new (void) +GESTimelineTestSource * +ges_timeline_test_source_new (void) { /* FIXME : Check for validity/existence of URI */ - return g_object_new (GES_TYPE_TIMELINE_BACKGROUND_SOURCE, NULL); + return g_object_new (GES_TYPE_TIMELINE_TEST_SOURCE, NULL); } -GESTimelineBackgroundSource * -ges_timeline_background_source_new_for_nick (gchar * nick) +GESTimelineTestSource * +ges_timeline_test_source_new_for_nick (gchar * nick) { - GESTimelineBackgroundSource *ret; + GESTimelineTestSource *ret; GEnumValue *value; int i; for (i = 0, value = &vpattern_enum_values[i]; value->value_nick; value = &vpattern_enum_values[i++]) { if (!strcmp (nick, value->value_nick)) { - ret = g_object_new (GES_TYPE_TIMELINE_BACKGROUND_SOURCE, "vpattern", + ret = g_object_new (GES_TYPE_TIMELINE_TEST_SOURCE, "vpattern", (gint) value->value, NULL); return ret; } diff --git a/ges/ges-timeline-background-source.h b/ges/ges-timeline-test-source.h similarity index 50% rename from ges/ges-timeline-background-source.h rename to ges/ges-timeline-test-source.h index 68a04e4c3a..e22c27d4b0 100644 --- a/ges/ges-timeline-background-source.h +++ b/ges/ges-timeline-test-source.h @@ -18,8 +18,8 @@ * Boston, MA 02111-1307, USA. */ -#ifndef _GES_TL_BACKGROUNDSOURCE -#define _GES_TL_BACKGROUNDSOURCE +#ifndef _GES_TL_TESTSOURCE +#define _GES_TL_TESTSOURCE #include #include @@ -28,30 +28,30 @@ G_BEGIN_DECLS -#define GES_TYPE_TIMELINE_BACKGROUND_SOURCE ges_tl_bg_src_get_type() +#define GES_TYPE_TIMELINE_TEST_SOURCE ges_timeline_test_source_get_type() -#define GES_TIMELINE_BACKGROUND_SOURCE(obj) \ - (G_TYPE_CHECK_INSTANCE_CAST ((obj), GES_TYPE_TIMELINE_BACKGROUND_SOURCE, GESTimelineBackgroundSource)) +#define GES_TIMELINE_TEST_SOURCE(obj) \ + (G_TYPE_CHECK_INSTANCE_CAST ((obj), GES_TYPE_TIMELINE_TEST_SOURCE, GESTimelineTestSource)) -#define GES_TIMELINE_BACKGROUND_SOURCE_CLASS(klass) \ - (G_TYPE_CHECK_CLASS_CAST ((klass), GES_TYPE_TIMELINE_BACKGROUND_SOURCE, GESTimelineBackgroundSourceClass)) +#define GES_TIMELINE_TEST_SOURCE_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_CAST ((klass), GES_TYPE_TIMELINE_TEST_SOURCE, GESTimelineTestSourceClass)) -#define GES_IS_TIMELINE_BACKGROUND_SOURCE(obj) \ - (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GES_TYPE_TIMELINE_BACKGROUND_SOURCE)) +#define GES_IS_TIMELINE_TEST_SOURCE(obj) \ + (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GES_TYPE_TIMELINE_TEST_SOURCE)) -#define GES_IS_TIMELINE_BACKGROUND_SOURCE_CLASS(klass) \ - (G_TYPE_CHECK_CLASS_TYPE ((klass), GES_TYPE_TIMELINE_BACKGROUND_SOURCE)) +#define GES_IS_TIMELINE_TEST_SOURCE_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_TYPE ((klass), GES_TYPE_TIMELINE_TEST_SOURCE)) -#define GES_TIMELINE_BACKGROUND_SOURCE_GET_CLASS(obj) \ - (G_TYPE_INSTANCE_GET_CLASS ((obj), GES_TYPE_TIMELINE_BACKGROUND_SOURCE, GESTimelineBackgroundSourceClass)) +#define GES_TIMELINE_TEST_SOURCE_GET_CLASS(obj) \ + (G_TYPE_INSTANCE_GET_CLASS ((obj), GES_TYPE_TIMELINE_TEST_SOURCE, GESTimelineTestSourceClass)) /** - * GESTimelineBackgroundSource: + * GESTimelineTestSource: * @parent: parent * */ -struct _GESTimelineBackgroundSource { +struct _GESTimelineTestSource { GESTimelineSource parent; /*< private >*/ @@ -60,23 +60,23 @@ struct _GESTimelineBackgroundSource { }; /** - * GESTimelineBackgroundSourceClass: + * GESTimelineTestSourceClass: * @parent_class: parent class */ -struct _GESTimelineBackgroundSourceClass { +struct _GESTimelineTestSourceClass { GESTimelineSourceClass parent_class; /*< public >*/ }; -GType ges_tl_bg_src_get_type (void); +GType ges_timeline_test_source_get_type (void); -GESTimelineBackgroundSource* ges_timeline_background_source_new (void); -GESTimelineBackgroundSource* ges_timeline_background_source_new_for_nick(gchar +GESTimelineTestSource* ges_timeline_test_source_new (void); +GESTimelineTestSource* ges_timeline_test_source_new_for_nick(gchar * nick); G_END_DECLS -#endif /* _GES_TL_BACKGROUNDSOURCE */ +#endif /* _GES_TL_TESTSOURCE */ diff --git a/ges/ges-types.h b/ges/ges-types.h index 27c6343c1c..dcd79442c2 100644 --- a/ges/ges-types.h +++ b/ges/ges-types.h @@ -48,8 +48,8 @@ typedef struct _GESTimelineFileSourceClass GESTimelineFileSourceClass; typedef struct _GESTimelineTransition GESTimelineTransition; typedef struct _GESTimelineTransitionClass GESTimelineTransitionClass; -typedef struct _GESTimelineBackgroundSource GESTimelineBackgroundSource; -typedef struct _GESTimelineBackgroundSourceClass GESTimelineBackgroundSourceClass; +typedef struct _GESTimelineTestSource GESTimelineTestSource; +typedef struct _GESTimelineTestSourceClass GESTimelineTestSourceClass; typedef struct _GESTimelineTitleSource GESTimelineTitleSource; typedef struct _GESTimelineTitleSourceClass GESTimelineTitleSourceClass; diff --git a/ges/ges.h b/ges/ges.h index a85bfa404c..806f101e14 100644 --- a/ges/ges.h +++ b/ges/ges.h @@ -33,7 +33,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/tests/check/ges/backgroundsource.c b/tests/check/ges/backgroundsource.c index 4c10022973..dc7c2a0d31 100644 --- a/tests/check/ges/backgroundsource.c +++ b/tests/check/ges/backgroundsource.c @@ -20,13 +20,13 @@ #include #include -GST_START_TEST (test_background_source_basic) +GST_START_TEST (test_test_source_basic) { - GESTimelineBackgroundSource *source; + GESTimelineTestSource *source; ges_init (); - source = ges_timeline_background_source_new (); + source = ges_timeline_test_source_new (); fail_unless (source != NULL); g_object_unref (source); @@ -49,7 +49,7 @@ GST_END_TEST; } -GST_START_TEST (test_background_source_properties) +GST_START_TEST (test_test_source_properties) { GESTrack *track; GESTrackObject *trackobject; @@ -61,7 +61,7 @@ GST_START_TEST (test_background_source_properties) fail_unless (track != NULL); object = (GESTimelineObject *) - ges_timeline_background_source_new (); + ges_timeline_test_source_new (); fail_unless (object != NULL); /* Set some properties */ @@ -108,13 +108,13 @@ GST_START_TEST (test_background_source_properties) GST_END_TEST; -GST_START_TEST (test_background_source_in_layer) +GST_START_TEST (test_test_source_in_layer) { GESTimeline *timeline; GESTimelineLayer *layer; GESTrack *a, *v; GESTrackObject *trobj; - GESTimelineBackgroundSource *source; + GESTimelineTestSource *source; GESTrackVideoBgSrcPattern ptrn; ges_init (); @@ -128,7 +128,7 @@ GST_START_TEST (test_background_source_in_layer) ges_timeline_add_track (timeline, v); ges_timeline_add_layer (timeline, layer); - source = ges_timeline_background_source_new_for_nick ((gchar *) "red"); + source = ges_timeline_test_source_new_for_nick ((gchar *) "red"); g_object_get (source, "vpattern", &ptrn, NULL); assert_equals_int (ptrn, GES_TRACK_VIDEO_BG_SRC_RED); @@ -168,9 +168,9 @@ ges_suite (void) suite_add_tcase (s, tc_chain); - tcase_add_test (tc_chain, test_background_source_basic); - tcase_add_test (tc_chain, test_background_source_properties); - tcase_add_test (tc_chain, test_background_source_in_layer); + tcase_add_test (tc_chain, test_test_source_basic); + tcase_add_test (tc_chain, test_test_source_properties); + tcase_add_test (tc_chain, test_test_source_in_layer); return s; } diff --git a/tools/ges-launch.c b/tools/ges-launch.c index d040c8c189..75b7c61b12 100644 --- a/tools/ges-launch.c +++ b/tools/ges-launch.c @@ -79,7 +79,7 @@ GESTimelineObject * pattern_source_new (guint pattern) { GESTimelineObject *ret; - ret = GES_TIMELINE_OBJECT (ges_timeline_background_source_new ()); + ret = GES_TIMELINE_OBJECT (ges_timeline_test_source_new ()); g_object_set (ret, "vpattern", pattern, NULL); return ret; } @@ -185,8 +185,7 @@ create_timeline (int nbargs, gchar ** argv) guint64 duration = str_to_time (argv[(i * 3) + 2]); if (!g_strcmp0 ("+pattern", source)) { - obj = GES_TIMELINE_OBJECT (ges_timeline_background_source_new_for_nick - (arg0)); + obj = GES_TIMELINE_OBJECT (ges_timeline_test_source_new_for_nick (arg0)); if (!obj) g_error ("%s invalid pattern!", arg0); @@ -315,13 +314,13 @@ void print_pattern_list (void) { GEnumClass *enum_class; - GESTimelineBackgroundSource *tr; - GESTimelineBackgroundSourceClass *klass; + GESTimelineTestSource *tr; + GESTimelineTestSourceClass *klass; GParamSpec *pspec; GEnumValue *v; - tr = ges_timeline_background_source_new (); - klass = GES_TIMELINE_BACKGROUND_SOURCE_GET_CLASS (tr); + tr = ges_timeline_test_source_new (); + klass = GES_TIMELINE_TEST_SOURCE_GET_CLASS (tr); pspec = g_object_class_find_property (G_OBJECT_CLASS (klass), "vpattern");