mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-24 17:20:36 +00:00
test vpatern property in unit tests
This commit is contained in:
parent
d48c10c026
commit
efb7524a0a
2 changed files with 20 additions and 5 deletions
|
@ -42,6 +42,8 @@
|
||||||
#include <ges/ges-timeline-file-source.h>
|
#include <ges/ges-timeline-file-source.h>
|
||||||
#include <ges/ges-track-filesource.h>
|
#include <ges/ges-track-filesource.h>
|
||||||
#include <ges/ges-track-background-source.h>
|
#include <ges/ges-track-background-source.h>
|
||||||
|
#include <ges/ges-track-video-background-source.h>
|
||||||
|
#include <ges/ges-track-audio-background-source.h>
|
||||||
|
|
||||||
#include <ges/ges-utils.h>
|
#include <ges/ges-utils.h>
|
||||||
|
|
||||||
|
|
|
@ -103,9 +103,6 @@ GST_START_TEST (test_background_source_properties)
|
||||||
gnl_object_check (trackobject->gnlobject, 420, 510, 120, 510, 0, TRUE);
|
gnl_object_check (trackobject->gnlobject, 420, 510, 120, 510, 0, TRUE);
|
||||||
|
|
||||||
ges_timeline_object_release_track_object (object, trackobject);
|
ges_timeline_object_release_track_object (object, trackobject);
|
||||||
|
|
||||||
g_object_unref (object);
|
|
||||||
g_object_unref (track);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
GST_END_TEST;
|
GST_END_TEST;
|
||||||
|
@ -115,7 +112,9 @@ GST_START_TEST (test_background_source_in_layer)
|
||||||
GESTimeline *timeline;
|
GESTimeline *timeline;
|
||||||
GESTimelineLayer *layer;
|
GESTimelineLayer *layer;
|
||||||
GESTrack *a, *v;
|
GESTrack *a, *v;
|
||||||
|
GESTrackObject *trobj;
|
||||||
GESTimelineBackgroundSource *source;
|
GESTimelineBackgroundSource *source;
|
||||||
|
GESTrackVideoBgSrcPattern ptrn;
|
||||||
|
|
||||||
ges_init ();
|
ges_init ();
|
||||||
|
|
||||||
|
@ -128,14 +127,28 @@ GST_START_TEST (test_background_source_in_layer)
|
||||||
ges_timeline_add_track (timeline, v);
|
ges_timeline_add_track (timeline, v);
|
||||||
ges_timeline_add_layer (timeline, layer);
|
ges_timeline_add_layer (timeline, layer);
|
||||||
|
|
||||||
source = ges_timeline_background_source_new ();
|
source = ges_timeline_background_source_new_for_nick ((gchar *) "red");
|
||||||
|
g_object_get (source, "vpattern", &ptrn, NULL);
|
||||||
|
assert_equals_int (ptrn, GES_TRACK_VIDEO_BG_SRC_RED);
|
||||||
|
|
||||||
g_object_set (source, "duration", (guint64) GST_SECOND, NULL);
|
g_object_set (source, "duration", (guint64) GST_SECOND, NULL);
|
||||||
|
|
||||||
ges_simple_timeline_layer_add_object ((GESSimpleTimelineLayer *) layer,
|
ges_simple_timeline_layer_add_object ((GESSimpleTimelineLayer *) layer,
|
||||||
(GESTimelineObject *) source, 0);
|
(GESTimelineObject *) source, 0);
|
||||||
|
|
||||||
|
/* specifically test the vpattern property */
|
||||||
|
g_object_set (source, "vpattern", (gint) GES_TRACK_VIDEO_BG_SRC_WHITE, NULL);
|
||||||
|
g_object_get (source, "vpattern", &ptrn, NULL);
|
||||||
|
assert_equals_int (ptrn, GES_TRACK_VIDEO_BG_SRC_WHITE);
|
||||||
|
|
||||||
|
trobj =
|
||||||
|
ges_timeline_object_find_track_object (GES_TIMELINE_OBJECT (source), v);
|
||||||
|
|
||||||
|
ptrn = ((GESTrackVideoBackgroundSource *) trobj)->pattern;
|
||||||
|
assert_equals_int (ptrn, GES_TRACK_VIDEO_BG_SRC_WHITE);
|
||||||
|
|
||||||
ges_timeline_layer_remove_object (layer, (GESTimelineObject *) source);
|
ges_timeline_layer_remove_object (layer, (GESTimelineObject *) source);
|
||||||
g_object_unref (timeline);
|
g_object_unref (timeline);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
GST_END_TEST;
|
GST_END_TEST;
|
||||||
|
|
Loading…
Reference in a new issue