mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-20 16:51:10 +00:00
tests: project: Add children properties check
Rename test_project_add_keyframes into test_project_add_properties
This commit is contained in:
parent
e8fd816e33
commit
b89ffaea82
2 changed files with 27 additions and 9 deletions
|
@ -297,7 +297,7 @@ _test_project (GESProject * project, GESTimeline * timeline)
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_add_keyframes (GESTimeline * timeline)
|
_add_properties (GESTimeline * timeline)
|
||||||
{
|
{
|
||||||
GList *tracks;
|
GList *tracks;
|
||||||
GList *tmp;
|
GList *tmp;
|
||||||
|
@ -316,6 +316,7 @@ _add_keyframes (GESTimeline * timeline)
|
||||||
for (tmp_tck = track_elements; tmp_tck; tmp_tck = tmp_tck->next) {
|
for (tmp_tck = track_elements; tmp_tck; tmp_tck = tmp_tck->next) {
|
||||||
GESTrackElement *element = GES_TRACK_ELEMENT (tmp_tck->data);
|
GESTrackElement *element = GES_TRACK_ELEMENT (tmp_tck->data);
|
||||||
|
|
||||||
|
/* Adding keyframes */
|
||||||
if (GES_IS_EFFECT (element)) {
|
if (GES_IS_EFFECT (element)) {
|
||||||
GstControlSource *source;
|
GstControlSource *source;
|
||||||
GstControlBinding *tmp_binding, *binding;
|
GstControlBinding *tmp_binding, *binding;
|
||||||
|
@ -349,6 +350,15 @@ _add_keyframes (GESTimeline * timeline)
|
||||||
gst_timed_value_control_source_set (GST_TIMED_VALUE_CONTROL_SOURCE
|
gst_timed_value_control_source_set (GST_TIMED_VALUE_CONTROL_SOURCE
|
||||||
(source), 10 * GST_SECOND, 1.);
|
(source), 10 * GST_SECOND, 1.);
|
||||||
}
|
}
|
||||||
|
/* Adding children properties */
|
||||||
|
else if (GES_IS_VIDEO_SOURCE (element)) {
|
||||||
|
gint64 posx = 42;
|
||||||
|
ges_track_element_set_child_properties (element, "posx", posx,
|
||||||
|
NULL);
|
||||||
|
ges_track_element_get_child_properties (element, "posx", &posx,
|
||||||
|
NULL);
|
||||||
|
fail_unless_equals_int64 (posx, 42);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
@ -358,7 +368,7 @@ _add_keyframes (GESTimeline * timeline)
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_check_keyframes (GESTimeline * timeline)
|
_check_properties (GESTimeline * timeline)
|
||||||
{
|
{
|
||||||
GList *tracks;
|
GList *tracks;
|
||||||
GList *tmp;
|
GList *tmp;
|
||||||
|
@ -376,7 +386,7 @@ _check_keyframes (GESTimeline * timeline)
|
||||||
|
|
||||||
for (tmp_tck = track_elements; tmp_tck; tmp_tck = tmp_tck->next) {
|
for (tmp_tck = track_elements; tmp_tck; tmp_tck = tmp_tck->next) {
|
||||||
GESTrackElement *element = GES_TRACK_ELEMENT (tmp_tck->data);
|
GESTrackElement *element = GES_TRACK_ELEMENT (tmp_tck->data);
|
||||||
|
/* Checking keyframes */
|
||||||
if (GES_IS_EFFECT (element)) {
|
if (GES_IS_EFFECT (element)) {
|
||||||
GstControlBinding *binding;
|
GstControlBinding *binding;
|
||||||
GstControlSource *source;
|
GstControlSource *source;
|
||||||
|
@ -406,6 +416,14 @@ _check_keyframes (GESTimeline * timeline)
|
||||||
fail_unless (value->value == 1.);
|
fail_unless (value->value == 1.);
|
||||||
fail_unless (value->timestamp == 10 * GST_SECOND);
|
fail_unless (value->timestamp == 10 * GST_SECOND);
|
||||||
}
|
}
|
||||||
|
/* Checking children properties */
|
||||||
|
else if (GES_IS_VIDEO_SOURCE (element)) {
|
||||||
|
/* Init 'posx' with a wrong value */
|
||||||
|
gint64 posx = 27;
|
||||||
|
ges_track_element_get_child_properties (element, "posx", &posx,
|
||||||
|
NULL);
|
||||||
|
fail_unless_equals_int64 (posx, 42);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
@ -414,13 +432,13 @@ _check_keyframes (GESTimeline * timeline)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
GST_START_TEST (test_project_add_keyframes)
|
GST_START_TEST (test_project_add_properties)
|
||||||
{
|
{
|
||||||
GESProject *project;
|
GESProject *project;
|
||||||
GESTimeline *timeline;
|
GESTimeline *timeline;
|
||||||
GESAsset *formatter_asset;
|
GESAsset *formatter_asset;
|
||||||
gboolean saved;
|
gboolean saved;
|
||||||
gchar *uri = ges_test_file_uri ("test-keyframes.xges");
|
gchar *uri = ges_test_file_uri ("test-properties.xges");
|
||||||
|
|
||||||
project = ges_project_new (uri);
|
project = ges_project_new (uri);
|
||||||
mainloop = g_main_loop_new (NULL, FALSE);
|
mainloop = g_main_loop_new (NULL, FALSE);
|
||||||
|
@ -439,9 +457,9 @@ GST_START_TEST (test_project_add_keyframes)
|
||||||
|
|
||||||
g_free (uri);
|
g_free (uri);
|
||||||
|
|
||||||
_add_keyframes (timeline);
|
_add_properties (timeline);
|
||||||
|
|
||||||
uri = get_tmp_uri ("test-keyframes-save.xges");
|
uri = get_tmp_uri ("test-properties-save.xges");
|
||||||
formatter_asset = ges_asset_request (GES_TYPE_FORMATTER, "ges", NULL);
|
formatter_asset = ges_asset_request (GES_TYPE_FORMATTER, "ges", NULL);
|
||||||
saved =
|
saved =
|
||||||
ges_project_save (project, timeline, uri, formatter_asset, TRUE, NULL);
|
ges_project_save (project, timeline, uri, formatter_asset, TRUE, NULL);
|
||||||
|
@ -462,7 +480,7 @@ GST_START_TEST (test_project_add_keyframes)
|
||||||
|
|
||||||
g_main_loop_run (mainloop);
|
g_main_loop_run (mainloop);
|
||||||
|
|
||||||
_check_keyframes (timeline);
|
_check_properties (timeline);
|
||||||
|
|
||||||
gst_object_unref (timeline);
|
gst_object_unref (timeline);
|
||||||
gst_object_unref (project);
|
gst_object_unref (project);
|
||||||
|
@ -720,7 +738,7 @@ ges_suite (void)
|
||||||
tcase_add_test (tc_chain, test_project_simple);
|
tcase_add_test (tc_chain, test_project_simple);
|
||||||
tcase_add_test (tc_chain, test_project_add_assets);
|
tcase_add_test (tc_chain, test_project_add_assets);
|
||||||
tcase_add_test (tc_chain, test_project_load_xges);
|
tcase_add_test (tc_chain, test_project_load_xges);
|
||||||
tcase_add_test (tc_chain, test_project_add_keyframes);
|
tcase_add_test (tc_chain, test_project_add_properties);
|
||||||
tcase_add_test (tc_chain, test_project_auto_transition);
|
tcase_add_test (tc_chain, test_project_auto_transition);
|
||||||
/*tcase_add_test (tc_chain, test_load_xges_and_play); */
|
/*tcase_add_test (tc_chain, test_load_xges_and_play); */
|
||||||
tcase_add_test (tc_chain, test_project_unexistant_effect);
|
tcase_add_test (tc_chain, test_project_unexistant_effect);
|
||||||
|
|
Loading…
Reference in a new issue