}
static void
-_add_keyframes (GESTimeline * timeline)
+_add_properties (GESTimeline * timeline)
{
GList *tracks;
GList *tmp;
for (tmp_tck = track_elements; tmp_tck; tmp_tck = tmp_tck->next) {
GESTrackElement *element = GES_TRACK_ELEMENT (tmp_tck->data);
+ /* Adding keyframes */
if (GES_IS_EFFECT (element)) {
GstControlSource *source;
GstControlBinding *tmp_binding, *binding;
gst_timed_value_control_source_set (GST_TIMED_VALUE_CONTROL_SOURCE
(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;
default:
}
static void
-_check_keyframes (GESTimeline * timeline)
+_check_properties (GESTimeline * timeline)
{
GList *tracks;
GList *tmp;
for (tmp_tck = track_elements; tmp_tck; tmp_tck = tmp_tck->next) {
GESTrackElement *element = GES_TRACK_ELEMENT (tmp_tck->data);
-
+ /* Checking keyframes */
if (GES_IS_EFFECT (element)) {
GstControlBinding *binding;
GstControlSource *source;
fail_unless (value->value == 1.);
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;
default:
}
}
-GST_START_TEST (test_project_add_keyframes)
+GST_START_TEST (test_project_add_properties)
{
GESProject *project;
GESTimeline *timeline;
GESAsset *formatter_asset;
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);
mainloop = g_main_loop_new (NULL, FALSE);
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);
saved =
ges_project_save (project, timeline, uri, formatter_asset, TRUE, NULL);
g_main_loop_run (mainloop);
- _check_keyframes (timeline);
+ _check_properties (timeline);
gst_object_unref (timeline);
gst_object_unref (project);
tcase_add_test (tc_chain, test_project_simple);
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_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_load_xges_and_play); */
tcase_add_test (tc_chain, test_project_unexistant_effect);