1 /* GStreamer Editing Services
3 * Copyright (C) <2014> Thibault Saunier <thibault.saunier@collabora.com>
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version.
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Library General Public License for more details.
15 * You should have received a copy of the GNU Library General Public
16 * License along with this library; if not, write to the
17 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 * Boston, MA 02111-1307, USA.
27 #ifdef HAVE_GST_VALIDATE
28 #include <gst/validate/validate.h>
29 #include <gst/validate/gst-validate-scenario.h>
30 #include <gst/validate/gst-validate-utils.h>
31 #include "ges-internal.h"
32 #include "ges-structured-interface.h"
34 #define MONITOR_ON_PIPELINE "validate-monitor"
35 #define RUNNER_ON_PIPELINE "runner-monitor"
44 _get_clocktime (GstStructure * structure, const gchar * name,
45 GstClockTime * val, GESFrameNumber * frames)
47 const GValue *gvalue = gst_structure_get_value (structure, name);
52 if (frames && G_VALUE_TYPE (gvalue) == G_TYPE_STRING) {
53 const gchar *str = g_value_get_string (gvalue);
55 if (str && str[0] == 'f') {
56 GValue v = G_VALUE_INIT;
58 g_value_init (&v, G_TYPE_UINT64);
59 if (gst_value_deserialize (&v, &str[1])) {
60 *frames = g_value_get_uint64 (&v);
62 *val = GST_CLOCK_TIME_NONE;
74 return gst_validate_utils_get_clocktime (structure, name, val);
78 project_loaded_cb (GESProject * project, GESTimeline * timeline,
79 LoadTimelineData * data)
81 g_main_loop_quit (data->ml);
85 error_loading_asset_cb (GESProject * project, GError * err,
86 const gchar * unused_id, GType extractable_type, LoadTimelineData * data)
88 data->error = g_error_copy (err);
89 g_main_loop_quit (data->ml);
93 _ges_load_timeline (GstValidateScenario * scenario, GstValidateAction * action,
94 const gchar * project_uri)
96 GESProject *project = ges_project_new (project_uri);
97 GESTimeline *timeline;
98 LoadTimelineData data = { 0 };
100 data.ml = g_main_loop_new (NULL, TRUE);
102 GES_TIMELINE (ges_asset_extract (GES_ASSET (project), &data.error));
106 g_signal_connect (project, "loaded", (GCallback) project_loaded_cb, &data);
107 g_signal_connect (project, "error-loading-asset",
108 (GCallback) error_loading_asset_cb, &data);
109 g_main_loop_run (data.ml);
110 g_signal_handlers_disconnect_by_func (project, project_loaded_cb, &data);
111 g_signal_handlers_disconnect_by_func (project, error_loading_asset_cb, &data);
112 GST_INFO_OBJECT (scenario, "Loaded timeline from %s", project_uri);
116 GST_VALIDATE_REPORT_ACTION (scenario, action,
117 SCENARIO_ACTION_EXECUTION_ERROR, "Can not load timeline from: %s (%s)",
118 project_uri, data.error->message);
119 g_clear_error (&data.error);
120 gst_clear_object (&timeline);
123 g_main_loop_unref (data.ml);
124 gst_object_unref (project);
128 #ifdef G_HAVE_ISO_VARARGS
129 #define REPORT_UNLESS(condition, errpoint, ...) \
131 if (!(condition)) { \
132 res = GST_VALIDATE_EXECUTE_ACTION_ERROR_REPORTED; \
133 gst_validate_report_action(GST_VALIDATE_REPORTER(scenario), action, \
134 SCENARIO_ACTION_EXECUTION_ERROR, \
140 #else /* G_HAVE_GNUC_VARARGS */
141 #ifdef G_HAVE_GNUC_VARARGS
142 #define REPORT_UNLESS(condition, errpoint, args...) \
144 if (!(condition)) { \
145 res = GST_VALIDATE_EXECUTE_ACTION_ERROR_REPORTED; \
146 gst_validate_report_action(GST_VALIDATE_REPORTER(scenario), action, \
147 SCENARIO_ACTION_EXECUTION_ERROR, ##args); \
152 #endif /* G_HAVE_ISO_VARARGS */
153 #endif /* G_HAVE_GNUC_VARARGS */
155 #define DECLARE_AND_GET_TIMELINE_AND_PIPELINE(scenario, action) \
156 GESTimeline *timeline = NULL; \
157 GstElement *pipeline = NULL; \
158 const gchar *project_uri = \
159 gst_structure_get_string(action->structure, "project-uri"); \
160 if (!project_uri) { \
161 pipeline = gst_validate_scenario_get_pipeline(scenario); \
162 REPORT_UNLESS(GES_IS_PIPELINE(pipeline), done, \
163 "Can't execute a '%s' action after the pipeline " \
164 "has been destroyed.", \
166 g_object_get(pipeline, "timeline", &timeline, NULL); \
168 timeline = _ges_load_timeline(scenario, action, project_uri); \
170 return GST_VALIDATE_EXECUTE_ACTION_ERROR_REPORTED; \
173 #define DECLARE_AND_GET_TIMELINE(scenario, action) \
174 DECLARE_AND_GET_TIMELINE_AND_PIPELINE(scenario, action); \
176 gst_object_unref(pipeline);
178 #define GES_START_VALIDATE_ACTION(funcname) \
180 funcname(GstValidateScenario *scenario, GstValidateAction *action) { \
181 GstValidateActionReturn res = GST_VALIDATE_EXECUTE_ACTION_OK; \
182 DECLARE_AND_GET_TIMELINE_AND_PIPELINE(scenario, action);
184 #define GST_END_VALIDATE_ACTION \
186 if (res == GST_VALIDATE_EXECUTE_ACTION_OK) { \
188 _ges_save_timeline_if_needed(timeline, action->structure, NULL), \
189 done_no_save, "Could not save timeline to %s", \
190 gst_structure_get_string(action->structure, "project-id")); \
194 gst_clear_object(&pipeline); \
195 gst_clear_object(&timeline); \
199 #define TRY_GET(name,type,var,def) G_STMT_START {\
200 if (!gst_structure_get (action->structure, name, type, var, NULL)) {\
205 GES_START_VALIDATE_ACTION (_serialize_project)
207 const gchar *uri = gst_structure_get_string (action->structure, "uri");
208 gchar *location = gst_uri_get_location (uri),
209 *dir = g_path_get_dirname (location);
211 gst_validate_printf (action, "Saving project to %s", uri);
213 g_mkdir_with_parents (dir, 0755);
217 res = ges_timeline_save_to_uri (timeline, uri, NULL, TRUE, NULL);
220 GST_END_VALIDATE_ACTION;
222 GES_START_VALIDATE_ACTION (_remove_asset)
224 const gchar *id = NULL;
225 const gchar *type_string = NULL;
230 project = ges_timeline_get_project (timeline);
232 id = gst_structure_get_string (action->structure, "id");
233 type_string = gst_structure_get_string (action->structure, "type");
235 REPORT_UNLESS (type_string && id, done,
236 "Missing parameters, we got type %s and id %s", type_string, id);
237 REPORT_UNLESS ((type = g_type_from_name (type_string)), done,
238 "This type doesn't exist : %s", type_string);
240 asset = ges_project_get_asset (project, id, type);
241 REPORT_UNLESS (asset, done, "No asset with id %s and type %s", id,
243 res = ges_project_remove_asset (project, asset);
244 gst_object_unref (asset);
247 GST_END_VALIDATE_ACTION;
249 GES_START_VALIDATE_ACTION (_add_asset)
251 const gchar *id = NULL;
252 const gchar *type_string = NULL;
254 GESAsset *asset = NULL;
257 project = ges_timeline_get_project (timeline);
259 id = gst_structure_get_string (action->structure, "id");
260 type_string = gst_structure_get_string (action->structure, "type");
262 gst_validate_printf (action, "Adding asset of type %s with ID %s\n",
265 REPORT_UNLESS (type_string
266 && id, beach, "Missing parameters, we got type %s and id %s", type_string,
268 REPORT_UNLESS ((type =
269 g_type_from_name (type_string)), beach,
270 "This type doesn't exist : %s", type_string);
272 asset = _ges_get_asset_from_timeline (timeline, type, id, NULL);
274 REPORT_UNLESS (asset, beach, "Could not get asset for %s id: %s", type_string,
276 res = ges_project_add_asset (project, asset);
279 gst_clear_object (&asset);
282 GST_END_VALIDATE_ACTION;
284 GES_START_VALIDATE_ACTION (_add_layer)
288 gboolean auto_transition = FALSE;
290 REPORT_UNLESS (gst_structure_get_int (action->structure, "priority",
291 &priority), done, "priority is needed when adding a layer");
292 REPORT_UNLESS ((layer =
293 _ges_get_layer_by_priority (timeline, priority)), done,
294 "No layer with priority: %d", priority);
296 gst_structure_get_boolean (action->structure, "auto-transition",
298 g_object_set (layer, "priority", priority, "auto-transition", auto_transition,
300 gst_object_unref (layer);
303 GST_END_VALIDATE_ACTION;
305 GES_START_VALIDATE_ACTION (_remove_layer)
307 GESLayer *layer = NULL;
310 REPORT_UNLESS (gst_structure_get_int (action->structure, "priority",
311 &priority), done, "'priority' is required when removing a layer");
312 layer = _ges_get_layer_by_priority (timeline, priority);
313 REPORT_UNLESS (layer, beach, "No layer with priority %d", priority);
315 res = ges_timeline_remove_layer (timeline, layer);
318 gst_clear_object (&layer);
321 GST_END_VALIDATE_ACTION;
323 GES_START_VALIDATE_ACTION (_remove_clip)
325 GESTimelineElement *clip;
326 GESLayer *layer = NULL;
329 name = gst_structure_get_string (action->structure, "name");
330 clip = ges_timeline_get_element (timeline, name);
331 REPORT_UNLESS (GES_IS_CLIP (clip), beach, "Couldn't find clip: %s", name);
333 layer = ges_clip_get_layer (GES_CLIP (clip));
334 REPORT_UNLESS (layer, beach, "Clip %s not in a layer", name);
336 res = ges_layer_remove_clip (layer, GES_CLIP (clip));
339 gst_clear_object (&layer);
340 gst_clear_object (&clip);
343 GST_END_VALIDATE_ACTION;
345 GES_START_VALIDATE_ACTION (_edit)
347 GList *layers = NULL;
348 GESTimelineElement *element;
349 GESFrameNumber fposition = GES_FRAME_NUMBER_NONE;
350 GstClockTime position;
352 gboolean source_position = FALSE;
354 gint new_layer_priority = -1;
355 guint edge = GES_EDGE_NONE;
356 guint mode = GES_EDIT_MODE_NORMAL;
358 const gchar *edit_mode_str = NULL, *edge_str = NULL;
359 const gchar *element_name;
361 res = GST_VALIDATE_EXECUTE_ACTION_ERROR;
362 element_name = gst_structure_get_string (action->structure,
363 gst_structure_has_name (action->structure, "edit-container") ?
364 "container-name" : "element-name");
366 element = ges_timeline_get_element (timeline, element_name);
367 REPORT_UNLESS (element, beach, "Could not find element %s", element_name);
369 if (!_get_clocktime (action->structure, "position", &position, &fposition)) {
371 if (!gst_structure_get_int (action->structure, "source-frame",
372 (gint *) & fposition)
373 && !gst_structure_get_int64 (action->structure, "source-frame",
375 gchar *structstr = gst_structure_to_string (action->structure);
377 GST_VALIDATE_REPORT_ACTION (scenario, action,
378 SCENARIO_ACTION_EXECUTION_ERROR,
379 "could not find `position` or `source-frame` in %s", structstr);
384 source_position = TRUE;
385 position = GST_CLOCK_TIME_NONE;
389 gst_structure_get_string (action->structure, "edit-mode"))) {
390 REPORT_UNLESS (gst_validate_utils_enum_from_str (GES_TYPE_EDIT_MODE,
391 edit_mode_str, &mode), beach,
392 "Could not get enum from %s", edit_mode_str);
395 if ((edge_str = gst_structure_get_string (action->structure, "edge"))) {
396 REPORT_UNLESS (gst_validate_utils_enum_from_str (GES_TYPE_EDGE, edge_str,
397 &edge), beach, "Could not get enum from %s", edge_str);
400 if (GES_FRAME_NUMBER_IS_VALID (fposition)) {
401 if (source_position) {
402 GESClip *clip = NULL;
404 if (GES_IS_CLIP (element))
405 clip = GES_CLIP (element);
406 else if (GES_IS_TRACK_ELEMENT (element))
407 clip = GES_CLIP (element->parent);
409 REPORT_UNLESS (clip, beach,
410 "Could not get find element to edit using source frame for %"
411 GST_PTR_FORMAT, action->structure);
413 ges_clip_get_timeline_time_from_source_frame (clip, fposition, &err);
415 position = ges_timeline_get_frame_time (timeline, fposition);
418 REPORT_UNLESS (GST_CLOCK_TIME_IS_VALID (position), beach,
419 "Invalid frame number '%" G_GINT64_FORMAT "': %s", fposition,
420 err ? err->message : "Unknown");
423 gst_structure_get_int (action->structure, "new-layer-priority",
424 &new_layer_priority);
426 if (!(res = ges_timeline_element_edit (element, layers,
427 new_layer_priority, mode, edge, position))) {
429 gchar *fpositionstr = GES_FRAME_NUMBER_IS_VALID (fposition)
430 ? g_strdup_printf ("(%" G_GINT64_FORMAT ")", fposition)
433 GST_VALIDATE_REPORT_ACTION (scenario, action,
434 SCENARIO_ACTION_EXECUTION_ERROR,
435 "Could not edit '%s' to %" GST_TIME_FORMAT
436 "%s in %s mode, edge: %s "
437 "with new layer prio: %d",
438 element_name, GST_TIME_ARGS (position),
439 fpositionstr ? fpositionstr : "",
440 edit_mode_str ? edit_mode_str : "normal",
441 edge_str ? edge_str : "None", new_layer_priority);
442 g_free (fpositionstr);
447 gst_clear_object (&element);
448 g_clear_error (&err);
451 GST_END_VALIDATE_ACTION;
455 _state_changed_cb (GstBus * bus, GstMessage * message,
456 GstValidateAction * action)
460 if (!GST_IS_PIPELINE (GST_MESSAGE_SRC (message)))
463 gst_message_parse_state_changed (message, NULL, NULL, &next_state);
465 if (next_state == GST_STATE_VOID_PENDING) {
466 gst_validate_action_set_done (action);
468 g_signal_handlers_disconnect_by_func (bus, _state_changed_cb, action);
472 GES_START_VALIDATE_ACTION (_commit)
477 bus = gst_pipeline_get_bus (GST_PIPELINE (pipeline));
479 gst_validate_printf (action, "Committing timeline %s\n",
480 GST_OBJECT_NAME (timeline));
482 g_signal_connect (bus, "message::state-changed",
483 G_CALLBACK (_state_changed_cb), action);
485 gst_element_get_state (pipeline, &state, NULL, 0);
486 if (!ges_timeline_commit (timeline) || state < GST_STATE_PAUSED) {
487 g_signal_handlers_disconnect_by_func (bus, G_CALLBACK (_state_changed_cb),
489 gst_object_unref (bus);
493 gst_object_unref (bus);
495 res = GST_VALIDATE_EXECUTE_ACTION_ASYNC;
498 GST_END_VALIDATE_ACTION;
500 GES_START_VALIDATE_ACTION (_split_clip)
502 const gchar *clip_name;
503 GESTimelineElement *element;
504 GstClockTime position;
506 clip_name = gst_structure_get_string (action->structure, "clip-name");
508 element = ges_timeline_get_element (timeline, clip_name);
509 REPORT_UNLESS (GES_IS_CLIP (element), beach, "Could not find clip: %s",
511 REPORT_UNLESS (gst_validate_action_get_clocktime (scenario, action,
512 "position", &position), beach,
513 "Could not find position in %" GST_PTR_FORMAT, action->structure);
514 res = (ges_clip_split (GES_CLIP (element), position) != NULL);
517 gst_clear_object (&element);
520 GST_END_VALIDATE_ACTION;
524 GstValidateScenario *scenario;
525 GESTimelineElement *element;
526 GstValidateActionReturn res;
528 gboolean on_children;
529 GstValidateAction *action;
533 check_property (GQuark field_id, GValue * expected_value, PropertyData * data)
535 GValue cvalue = G_VALUE_INIT, *tvalue = NULL, comparable_value = G_VALUE_INIT,
537 const gchar *property = g_quark_to_string (field_id);
538 GstControlBinding *binding = NULL;
540 if (!data->on_children) {
542 g_object_class_find_property (G_OBJECT_GET_CLASS (data->element),
545 GST_VALIDATE_REPORT_ACTION (data->scenario, data->action,
546 SCENARIO_ACTION_EXECUTION_ERROR,
547 "Could not get property %s on %" GES_FORMAT,
548 property, GES_ARGS (data->element));
549 data->res = GST_VALIDATE_EXECUTE_ACTION_ERROR_REPORTED;
554 g_value_init (&cvalue, pspec->value_type);
555 g_object_get_property (G_OBJECT (data->element), property, &cvalue);
559 if (GST_CLOCK_TIME_IS_VALID (data->time)) {
560 if (!GES_IS_TRACK_ELEMENT (data->element)) {
561 GST_VALIDATE_REPORT_ACTION (data->scenario, data->action,
562 SCENARIO_ACTION_EXECUTION_ERROR,
563 "Could not get property at time for type %s - only GESTrackElement supported",
564 G_OBJECT_TYPE_NAME (data->element));
565 data->res = GST_VALIDATE_EXECUTE_ACTION_ERROR_REPORTED;
571 ges_track_element_get_control_binding (GES_TRACK_ELEMENT
572 (data->element), property);
574 tvalue = gst_control_binding_get_value (binding, data->time);
577 GST_VALIDATE_REPORT_ACTION (data->scenario, data->action,
578 SCENARIO_ACTION_EXECUTION_ERROR,
579 "Could not get property: %s at %" GST_TIME_FORMAT, property,
580 GST_TIME_ARGS (data->time));
581 data->res = GST_VALIDATE_EXECUTE_ACTION_ERROR_REPORTED;
589 && !ges_timeline_element_get_child_property (data->element, property,
591 GST_VALIDATE_REPORT_ACTION (data->scenario, data->action,
592 SCENARIO_ACTION_EXECUTION_ERROR, "Could not get property: %s:",
594 data->res = GST_VALIDATE_EXECUTE_ACTION_ERROR_REPORTED;
600 observed_value = tvalue ? tvalue : &cvalue;
602 if (G_VALUE_TYPE (observed_value) != G_VALUE_TYPE (expected_value)) {
603 g_value_init (&comparable_value, G_VALUE_TYPE (observed_value));
605 if (G_VALUE_TYPE (observed_value) == GST_TYPE_CLOCK_TIME) {
608 if (gst_validate_utils_get_clocktime (data->action->structure, property,
610 g_value_set_uint64 (&comparable_value, t);
611 expected_value = &comparable_value;
613 } else if (g_value_transform (expected_value, &comparable_value)) {
614 expected_value = &comparable_value;
618 if (gst_value_compare (observed_value, expected_value) != GST_VALUE_EQUAL) {
619 gchar *expected = gst_value_serialize (expected_value), *observed =
620 gst_value_serialize (observed_value);
622 GST_VALIDATE_REPORT_ACTION (data->scenario, data->action,
623 SCENARIO_ACTION_CHECK_ERROR,
624 "%s:%s expected value: '(%s)%s' different than observed: '(%s)%s'",
625 GES_TIMELINE_ELEMENT_NAME (data->element), property,
626 G_VALUE_TYPE_NAME (observed_value), expected,
627 G_VALUE_TYPE_NAME (expected_value), observed);
631 data->res = GST_VALIDATE_EXECUTE_ACTION_ERROR_REPORTED;
634 if (G_VALUE_TYPE (&comparable_value) != G_TYPE_NONE)
635 g_value_unset (&comparable_value);
638 g_value_unset (tvalue);
641 g_value_reset (&cvalue);
646 set_property (GQuark field_id, const GValue * value, PropertyData * data)
648 const gchar *property = g_quark_to_string (field_id);
650 if (data->on_children) {
651 if (!ges_timeline_element_set_child_property (data->element, property,
653 gchar *v = gst_value_serialize (value);
655 GST_VALIDATE_REPORT_ACTION (data->scenario, data->action,
656 SCENARIO_ACTION_EXECUTION_ERROR,
657 "Could not set %s child property %s to %s",
658 GES_TIMELINE_ELEMENT_NAME (data->element), property, v);
660 data->res = GST_VALIDATE_EXECUTE_ACTION_ERROR_REPORTED;
667 gst_validate_object_set_property (GST_VALIDATE_REPORTER
668 (data->scenario), G_OBJECT (data->element), property, value, FALSE);
674 GES_START_VALIDATE_ACTION (set_or_check_properties)
676 GESTimelineElement *element;
677 GstStructure *structure;
678 const gchar *element_name;
679 gboolean is_setting = FALSE;
680 PropertyData data = {
681 .scenario = scenario,
683 .res = GST_VALIDATE_EXECUTE_ACTION_OK,
684 .time = GST_CLOCK_TIME_NONE,
686 !gst_structure_has_name (action->structure, "check-ges-properties")
687 && !gst_structure_has_name (action->structure, "set-ges-properties"),
691 is_setting = gst_structure_has_name (action->structure, "set-ges-properties")
692 || gst_structure_has_name (action->structure, "set-child-properties");
693 gst_validate_action_get_clocktime (scenario, action, "at-time", &data.time);
695 structure = gst_structure_copy (action->structure);
696 element_name = gst_structure_get_string (structure, "element-name");
697 element = ges_timeline_get_element (timeline, element_name);
699 GST_VALIDATE_REPORT_ACTION (scenario, action,
700 SCENARIO_ACTION_EXECUTION_ERROR,
701 "Can not find element: %s", element_name);
703 data.res = GST_VALIDATE_EXECUTE_ACTION_ERROR_REPORTED;
707 data.element = element;
708 gst_structure_remove_fields (structure, "element-name", "at-time",
709 "project-uri", NULL);
710 gst_structure_foreach (structure,
711 is_setting ? (GstStructureForeachFunc) set_property
712 : (GstStructureForeachFunc) check_property, &data);
713 gst_object_unref (element);
716 gst_structure_free (structure);
720 GST_END_VALIDATE_ACTION;
722 GES_START_VALIDATE_ACTION (_set_track_restriction_caps)
726 GESTrackType track_types;
728 const gchar *track_type_str =
729 gst_structure_get_string (action->structure, "track-type");
730 const gchar *caps_str = gst_structure_get_string (action->structure, "caps");
732 REPORT_UNLESS (track_types =
733 gst_validate_utils_flags_from_str (GES_TYPE_TRACK_TYPE, track_type_str),
734 done, "Invalid track types: %s", track_type_str);
736 REPORT_UNLESS (caps = gst_caps_from_string (caps_str),
737 done, "Invalid track restriction caps: %s", caps_str);
739 res = GST_VALIDATE_EXECUTE_ACTION_ERROR;
740 for (tmp = timeline->tracks; tmp; tmp = tmp->next) {
741 GESTrack *track = tmp->data;
743 if (track->type & track_types) {
746 str = gst_caps_to_string (caps);
749 ges_track_set_restriction_caps (track, caps);
751 res = GST_VALIDATE_EXECUTE_ACTION_OK;
754 gst_caps_unref (caps);
757 GST_END_VALIDATE_ACTION;
759 GES_START_VALIDATE_ACTION (_set_asset_on_element)
762 GESTimelineElement *element;
763 const gchar *element_name, *id;
765 element_name = gst_structure_get_string (action->structure, "element-name");
766 element = ges_timeline_get_element (timeline, element_name);
767 REPORT_UNLESS (element, done, "Can't find %s", element_name);
769 id = gst_structure_get_string (action->structure, "asset-id");
771 gst_validate_printf (action, "Setting asset %s on element %s\n",
774 asset = _ges_get_asset_from_timeline (timeline, G_OBJECT_TYPE (element), id,
776 REPORT_UNLESS (asset, beach, "Could not find asset: %s", id);
778 res = ges_extractable_set_asset (GES_EXTRACTABLE (element), asset);
781 gst_clear_object (&asset);
782 gst_clear_object (&element);
785 GST_END_VALIDATE_ACTION;
787 GES_START_VALIDATE_ACTION (_container_remove_child)
789 GESContainer *container = NULL;
790 GESTimelineElement *child = NULL;
791 const gchar *container_name, *child_name;
794 gst_structure_get_string (action->structure, "container-name");
796 (GESContainer *) ges_timeline_get_element (timeline, container_name);
797 REPORT_UNLESS (GES_IS_CONTAINER (container), beach,
798 "Could not find container: %s", container_name);
800 child_name = gst_structure_get_string (action->structure, "child-name");
801 child = ges_timeline_get_element (timeline, child_name);
802 REPORT_UNLESS (GES_IS_TIMELINE_ELEMENT (child), beach, "Could not find %s",
805 res = ges_container_remove (container, child);
808 gst_clear_object (&container);
809 gst_clear_object (&child);
812 GST_END_VALIDATE_ACTION;
814 GES_START_VALIDATE_ACTION (_ungroup)
816 GESContainer *container;
817 gboolean recursive = FALSE;
818 const gchar *container_name;
821 gst_structure_get_string (action->structure, "container-name");
823 (GESContainer *) ges_timeline_get_element (timeline, container_name);
824 REPORT_UNLESS (GES_IS_CONTAINER (container), beach, "Could not find %s",
827 gst_structure_get_boolean (action->structure, "recursive", &recursive);
829 g_list_free (ges_container_ungroup (container, recursive));
832 gst_clear_object (&container);
835 GST_END_VALIDATE_ACTION;
837 GES_START_VALIDATE_ACTION (_copy_element)
839 GESTimelineElement *element = NULL, *copied = NULL, *pasted = NULL;
840 gboolean recursive = FALSE;
841 const gchar *element_name, *paste_name;
842 GstClockTime position;
844 element_name = gst_structure_get_string (action->structure, "element-name");
845 element = ges_timeline_get_element (timeline, element_name);
847 REPORT_UNLESS (GES_IS_CONTAINER (element), beach, "Could not find %s",
850 if (!gst_structure_get_boolean (action->structure, "recursive", &recursive))
853 REPORT_UNLESS (gst_validate_action_get_clocktime (scenario, action,
854 "position", &position), beach, "Could not find position");
856 copied = ges_timeline_element_copy (element, recursive);
857 pasted = ges_timeline_element_paste (copied, position);
859 REPORT_UNLESS (pasted, beach, "Could not paste clip %s", element_name);
861 paste_name = gst_structure_get_string (action->structure, "paste-name");
863 REPORT_UNLESS (ges_timeline_element_set_name (pasted, paste_name),
864 beach, "Could not set element name %s", paste_name);
867 gst_clear_object (&pasted);
868 gst_clear_object (&element);
870 /* `copied` is only used for the single paste operation, and is not
871 * actually in any timeline. We own it (it is actually still floating).
872 * `pasted` is the actual new object in the timeline. We own a
873 * reference to it. */
874 gst_clear_object (&copied);
877 GST_END_VALIDATE_ACTION;
879 GES_START_VALIDATE_ACTION (_validate_action_execute)
882 ActionFromStructureFunc func;
884 gst_structure_remove_field (action->structure, "playback-time");
885 if (gst_structure_has_name (action->structure, "add-keyframe") ||
886 gst_structure_has_name (action->structure, "remove-keyframe")) {
887 func = _ges_add_remove_keyframe_from_struct;
888 } else if (gst_structure_has_name (action->structure, "set-control-source")) {
889 func = _ges_set_control_source_from_struct;
890 } else if (gst_structure_has_name (action->structure, "add-clip")) {
891 func = _ges_add_clip_from_struct;
892 } else if (gst_structure_has_name (action->structure, "container-add-child")) {
893 func = _ges_container_add_child_from_struct;
894 } else if (gst_structure_has_name (action->structure, "set-child-property")) {
895 func = _ges_set_child_property_from_struct;
897 g_assert_not_reached ();
900 if (!func (timeline, action->structure, &err)) {
901 GST_VALIDATE_REPORT_ACTION (scenario, action,
902 g_quark_from_string ("scenario::execution-error"),
903 "Could not execute %s (error: %s)",
904 gst_structure_get_name (action->structure),
905 err ? err->message : "None");
907 g_clear_error (&err);
908 res = GST_VALIDATE_EXECUTE_ACTION_ERROR_REPORTED;
912 GST_END_VALIDATE_ACTION;
915 _project_loaded_cb (GESProject * project, GESTimeline * timeline,
916 GstValidateAction * action)
918 gst_validate_action_set_done (action);
921 GES_START_VALIDATE_ACTION (_load_project)
924 GESProject *project = NULL;
925 GList *tmp, *tmp_full;
928 GError *error = NULL;
929 const gchar *content = NULL;
931 gchar *tmpfile = g_strdup_printf ("%s%s%s", g_get_tmp_dir (),
932 G_DIR_SEPARATOR_S, "tmpxgesload.xges");
934 res = GST_VALIDATE_EXECUTE_ACTION_ASYNC;
935 REPORT_UNLESS (GES_IS_PIPELINE (pipeline), local_done,
936 "Not a GES pipeline, can't work with it");
938 gst_element_get_state (pipeline, &state, NULL, 0);
939 gst_element_set_state (pipeline, GST_STATE_NULL);
941 content = gst_structure_get_string (action->structure, "serialized-content");
944 g_file_set_contents (tmpfile, content, -1, &error);
945 REPORT_UNLESS (!error, local_done,
946 "Could not set XML content: %s", error->message);
948 uri = gst_filename_to_uri (tmpfile, &error);
949 REPORT_UNLESS (!error, local_done,
950 "Could not set filename to URI: %s", error->message);
952 uri = g_strdup (gst_structure_get_string (action->structure, "uri"));
953 REPORT_UNLESS (uri, local_done,
954 "None of 'uri' or 'content' passed as parameter"
955 " can't load any timeline!");
958 tmp_full = ges_timeline_get_layers (timeline);
959 for (tmp = tmp_full; tmp; tmp = tmp->next)
960 ges_timeline_remove_layer (timeline, tmp->data);
961 g_list_free_full (tmp_full, gst_object_unref);
963 tmp_full = ges_timeline_get_tracks (timeline);
964 for (tmp = tmp_full; tmp; tmp = tmp->next)
965 ges_timeline_remove_track (timeline, tmp->data);
966 g_list_free_full (tmp_full, gst_object_unref);
968 project = ges_project_new (uri);
969 g_signal_connect (project, "loaded", G_CALLBACK (_project_loaded_cb), action);
970 ges_project_load (project, gst_object_ref (timeline), &error);
971 REPORT_UNLESS (!error, local_done,
972 "Could not load timeline: %s", error->message);
974 gst_element_set_state (pipeline, state);
977 gst_clear_object (&project);
978 g_clear_error (&error);
983 GST_END_VALIDATE_ACTION;
986 prepare_seek_action (GstValidateAction * action)
988 gint res = GST_VALIDATE_EXECUTE_ACTION_ERROR;
989 GESFrameNumber fstart, fstop;
990 GstValidateScenario *scenario = gst_validate_action_get_scenario (action);
991 GstValidateActionType *type = gst_validate_get_action_type (action->type);
994 DECLARE_AND_GET_TIMELINE (scenario, action);
997 && ges_util_structure_get_clocktime (action->structure, "start", NULL,
999 GstClockTime start = ges_timeline_get_frame_time (timeline, fstart);
1002 GST_VALIDATE_REPORT_ACTION (scenario, action,
1003 SCENARIO_ACTION_EXECUTION_ERROR,
1004 "Invalid seeking frame number '%" G_GINT64_FORMAT "': %s", fstart,
1008 gst_structure_set (action->structure, "start", G_TYPE_UINT64, start, NULL);
1012 && ges_util_structure_get_clocktime (action->structure, "stop", NULL,
1014 GstClockTime stop = ges_timeline_get_frame_time (timeline, fstop);
1017 GST_VALIDATE_REPORT_ACTION (scenario, action,
1018 SCENARIO_ACTION_EXECUTION_ERROR,
1019 "Invalid seeking frame number '%" G_GINT64_FORMAT "': %s", fstop,
1023 gst_structure_set (action->structure, "stop", G_TYPE_UINT64, stop, NULL);
1026 gst_object_unref (scenario);
1027 gst_object_unref (timeline);
1028 return type->overriden_type->prepare (action);
1031 gst_object_unref (scenario);
1032 gst_object_unref (timeline);
1037 set_layer_active (GstValidateScenario * scenario, GstValidateAction * action)
1042 GList *tracks = NULL;
1043 GstValidateExecuteActionReturn res = GST_VALIDATE_EXECUTE_ACTION_OK;
1044 gchar **track_names =
1045 gst_validate_utils_get_strv (action->structure, "tracks");
1047 DECLARE_AND_GET_TIMELINE (scenario, action);
1049 for (i = 0; track_names[i]; i++) {
1051 (GESTrack *) gst_bin_get_by_name (GST_BIN (timeline), track_names[i]);
1054 GST_VALIDATE_REPORT_ACTION (scenario, action,
1055 SCENARIO_ACTION_EXECUTION_ERROR,
1056 "Could not find track %s", track_names[i]);
1057 res = GST_VALIDATE_EXECUTE_ACTION_ERROR_REPORTED;
1061 tracks = g_list_prepend (tracks, track);
1064 if (!gst_structure_get_int (action->structure, "layer-priority", &layer_prio)) {
1065 GST_VALIDATE_REPORT_ACTION (scenario, action,
1066 SCENARIO_ACTION_EXECUTION_ERROR,
1067 "Could not find layer from %" GST_PTR_FORMAT, action->structure);
1068 res = GST_VALIDATE_EXECUTE_ACTION_ERROR_REPORTED;
1071 if (!(layer = g_list_nth_data (timeline->layers, layer_prio))) {
1072 GST_VALIDATE_REPORT_ACTION (scenario, action,
1073 SCENARIO_ACTION_EXECUTION_ERROR, "Could not find layer %d", layer_prio);
1074 res = GST_VALIDATE_EXECUTE_ACTION_ERROR_REPORTED;
1078 if (!gst_structure_get_boolean (action->structure, "active", &active)) {
1079 GST_VALIDATE_REPORT_ACTION (scenario, action,
1080 SCENARIO_ACTION_EXECUTION_ERROR,
1081 "Could not find 'active' boolean in %" GST_PTR_FORMAT,
1083 res = GST_VALIDATE_EXECUTE_ACTION_ERROR_REPORTED;
1087 if (!ges_layer_set_active_for_tracks (layer, active, tracks)) {
1088 GST_VALIDATE_REPORT_ACTION (scenario, action,
1089 SCENARIO_ACTION_EXECUTION_ERROR,
1090 "Could not set active for track defined in %" GST_PTR_FORMAT,
1092 res = GST_VALIDATE_EXECUTE_ACTION_ERROR_REPORTED;
1097 g_strfreev (track_names);
1098 gst_object_unref (timeline);
1099 g_list_free_full (tracks, gst_object_unref);
1107 ges_validate_register_action_types (void)
1109 #ifdef HAVE_GST_VALIDATE
1110 GstValidateActionType *validate_seek, *seek_override;
1113 gst_validate_init ();
1114 validate_seek = gst_validate_get_action_type ("seek");
1117 seek_override = gst_validate_register_action_type("seek", "ges", validate_seek->execute,
1118 validate_seek->parameters, validate_seek->description,
1119 validate_seek->flags);
1120 gst_mini_object_unref(GST_MINI_OBJECT(validate_seek));
1121 seek_override->prepare = prepare_seek_action;
1123 gst_validate_register_action_type ("edit-container", "ges", _edit,
1124 (GstValidateActionParameter []) {
1126 .name = "container-name",
1127 .description = "The name of the GESContainer to edit",
1133 .description = "The new position of the GESContainer",
1135 .types = "double or string",
1136 .possible_variables = "position: The current position in the stream\n"
1137 "duration: The duration of the stream",
1141 .name = "edit-mode",
1142 .description = "The GESEditMode to use to edit @container-name",
1149 .description = "The GESEdge to use to edit @container-name\n"
1150 "should be in [ start, end, none ] ",
1156 .name = "new-layer-priority",
1157 .description = "The priority of the layer @container should land in.\n"
1158 "If the layer you're trying to move the container to doesn't exist, it will\n"
1159 "be created automatically. -1 means no move.",
1165 .name = "project-uri",
1166 .description = "The project URI with the serialized timeline to execute the action on",
1172 "Allows to edit a container (like a GESClip), for more details, have a look at:\n"
1173 "ges_timeline_element_edit documentation, Note that the timeline will\n"
1174 "be committed, and flushed so that the edition is taken into account",
1175 GST_VALIDATE_ACTION_TYPE_NONE);
1177 gst_validate_register_action_type ("edit", "ges", _edit,
1178 (GstValidateActionParameter []) {
1180 .name = "element-name",
1181 .description = "The name of the element to edit",
1187 .description = "The new position of the element",
1189 .types = "double or string",
1190 .possible_variables = "position: The current position in the stream\n"
1191 "duration: The duration of the stream",
1195 .name = "source-frame",
1196 .description = "The new frame of the element, computed from the @element-name"
1197 "clip's source frame.",
1199 .types = "double or string",
1203 .name = "edit-mode",
1204 .description = "The GESEditMode to use to edit @element-name",
1211 .description = "The GESEdge to use to edit @element-name\n"
1212 "should be in [ start, end, none ] ",
1218 .name = "new-layer-priority",
1219 .description = "The priority of the layer @element should land in.\n"
1220 "If the layer you're trying to move the element to doesn't exist, it will\n"
1221 "be created automatically. -1 means no move.",
1227 .name = "project-uri",
1228 .description = "The project URI with the serialized timeline to execute the action on",
1234 "Allows to edit a element (like a GESClip), for more details, have a look at:\n"
1235 "ges_timeline_element_edit documentation, Note that the timeline will\n"
1236 "be committed, and flushed so that the edition is taken into account",
1237 GST_VALIDATE_ACTION_TYPE_NONE);
1239 gst_validate_register_action_type ("add-asset", "ges", _add_asset,
1240 (GstValidateActionParameter []) {
1243 .description = "Adds an asset to a project.",
1249 .description = "The type of asset to add",
1254 .name = "project-uri",
1255 .description = "The project URI with the serialized timeline to execute the action on",
1261 "Allows to add an asset to the current project", GST_VALIDATE_ACTION_TYPE_NONE);
1263 gst_validate_register_action_type ("remove-asset", "ges", _remove_asset,
1264 (GstValidateActionParameter []) {
1267 .description = "The ID of the clip to remove",
1273 .description = "The type of asset to remove",
1278 .name = "project-uri",
1279 .description = "The project URI with the serialized timeline to execute the action on",
1285 "Allows to remove an asset from the current project", GST_VALIDATE_ACTION_TYPE_NONE);
1287 gst_validate_register_action_type ("add-layer", "ges", _add_layer,
1288 (GstValidateActionParameter []) {
1291 .description = "The priority of the new layer to add,"
1292 "if not specified, the new layer will be"
1293 " appended to the timeline",
1298 .name = "project-uri",
1299 .description = "The project URI with the serialized timeline to execute the action on",
1305 "Allows to add a layer to the current timeline", GST_VALIDATE_ACTION_TYPE_NONE);
1307 gst_validate_register_action_type ("remove-layer", "ges", _remove_layer,
1308 (GstValidateActionParameter []) {
1311 .description = "The priority of the layer to remove",
1316 .name = "auto-transition",
1317 .description = "Whether auto-transition is activated on the new layer.",
1323 .name = "project-uri",
1324 .description = "The nested timeline to add clip to",
1330 "Allows to remove a layer from the current timeline", GST_VALIDATE_ACTION_TYPE_NONE);
1332 gst_validate_register_action_type ("add-clip", "ges", _validate_action_execute,
1333 (GstValidateActionParameter []) {
1336 .description = "The name of the clip to add",
1341 .name = "layer-priority",
1342 .description = "The priority of the clip to add",
1348 .description = "The id of the asset from which to extract the clip",
1354 .description = "The type of the clip to create",
1360 .description = "The start value to set on the new GESClip.",
1361 .types = "double or string",
1366 .description = "The inpoint value to set on the new GESClip",
1367 .types = "double or string",
1372 .description = "The duration value to set on the new GESClip",
1373 .types = "double or string",
1377 .name = "project-uri",
1378 .description = "The project URI with the serialized timeline to execute the action on",
1383 }, "Allows to add a clip to a given layer", GST_VALIDATE_ACTION_TYPE_NONE);
1385 gst_validate_register_action_type ("remove-clip", "ges", _remove_clip,
1386 (GstValidateActionParameter []) {
1389 .description = "The name of the clip to remove",
1394 .name = "project-uri",
1395 .description = "The project URI with the serialized timeline to execute the action on",
1400 }, "Allows to remove a clip from a given layer", GST_VALIDATE_ACTION_TYPE_NONE);
1402 gst_validate_register_action_type ("serialize-project", "ges", _serialize_project,
1403 (GstValidateActionParameter []) {
1406 .description = "The uri where to store the serialized project",
1411 }, "serializes a project", GST_VALIDATE_ACTION_TYPE_NONE);
1413 gst_validate_register_action_type ("set-child-property", "ges", _validate_action_execute,
1414 (GstValidateActionParameter []) {
1416 .name = "element-name",
1417 .description = "The name of the element on which to modify the property",
1423 .description = "The name of the property to modify",
1429 .description = "The value of the property",
1434 .name = "project-uri",
1435 .description = "The project URI with the serialized timeline to execute the action on",
1440 }, "Allows to change child property of an object", GST_VALIDATE_ACTION_TYPE_NONE);
1442 gst_validate_register_action_type ("set-layer-active", "ges", set_layer_active,
1443 (GstValidateActionParameter []) {
1445 .name = "layer-priority",
1446 .description = "The priority of the layer to set activness on",
1452 .description = "The activness of the layer",
1453 .types = "gboolean",
1458 .description = "tracks",
1459 .types = "{string, }",
1463 }, "Set activness of a layer (on optional tracks).",
1464 GST_VALIDATE_ACTION_TYPE_NONE);
1466 gst_validate_register_action_type ("set-ges-properties", "ges", set_or_check_properties,
1467 (GstValidateActionParameter []) {
1469 .name = "element-name",
1470 .description = "The name of the element on which to set properties",
1475 }, "Set `element-name` properties values defined by the"
1476 " fields in the following format: `property_name=expected-value`",
1477 GST_VALIDATE_ACTION_TYPE_NONE);
1479 gst_validate_register_action_type ("check-ges-properties", "ges", set_or_check_properties,
1480 (GstValidateActionParameter []) {
1482 .name = "element-name",
1483 .description = "The name of the element on which to check properties",
1488 }, "Check `element-name` properties values defined by the"
1489 " fields in the following format: `property_name=expected-value`",
1490 GST_VALIDATE_ACTION_TYPE_NONE);
1492 gst_validate_register_action_type ("check-child-properties", "ges", set_or_check_properties,
1493 (GstValidateActionParameter []) {
1495 .name = "element-name",
1496 .description = "The name of the element on which to check children properties",
1502 .description = "The time at which to check the values, taking into"
1503 " account the ControlBinding if any set.",
1508 }, "Check `element-name` children properties values defined by the"
1509 " fields in the following format: `property_name=expected-value`",
1510 GST_VALIDATE_ACTION_TYPE_NONE);
1512 gst_validate_register_action_type ("set-child-properties", "ges", set_or_check_properties,
1513 (GstValidateActionParameter []) {
1515 .name = "element-name",
1516 .description = "The name of the element on which to modify child properties",
1521 }, "Sets `element-name` children properties values defined by the"
1522 " fields in the following format: `property-name=new-value`",
1523 GST_VALIDATE_ACTION_TYPE_NONE);
1525 gst_validate_register_action_type ("split-clip", "ges", _split_clip,
1526 (GstValidateActionParameter []) {
1528 .name = "clip-name",
1529 .description = "The name of the clip to split",
1535 .description = "The position at which to split the clip",
1536 .types = "double or string",
1540 .name = "project-uri",
1541 .description = "The project URI with the serialized timeline to execute the action on",
1546 }, "Split a clip at a specified position.", GST_VALIDATE_ACTION_TYPE_NONE);
1548 gst_validate_register_action_type ("set-track-restriction-caps", "ges", _set_track_restriction_caps,
1549 (GstValidateActionParameter []) {
1551 .name = "track-type",
1552 .description = "The type of track to set restriction caps on",
1558 .description = "The caps to set on the track",
1563 .name = "project-uri",
1564 .description = "The project URI with the serialized timeline to execute the action on",
1569 }, "Sets restriction caps on tracks of a specific type.", GST_VALIDATE_ACTION_TYPE_NONE);
1571 gst_validate_register_action_type ("element-set-asset", "ges", _set_asset_on_element,
1572 (GstValidateActionParameter []) {
1574 .name = "element-name",
1575 .description = "The name of the TimelineElement to set an asset on",
1581 .description = "The id of the asset from which to extract the clip",
1586 .name = "project-uri",
1587 .description = "The project URI with the serialized timeline to execute the action on",
1592 }, "Sets restriction caps on tracks of a specific type.", GST_VALIDATE_ACTION_TYPE_NONE);
1595 gst_validate_register_action_type ("container-add-child", "ges", _validate_action_execute,
1596 (GstValidateActionParameter []) {
1598 .name = "container-name",
1599 .description = "The name of the GESContainer to add a child to",
1604 .name = "child-name",
1605 .description = "The name of the child to add to @container-name",
1612 .description = "The id of the asset from which to extract the child",
1618 .name = "child-type",
1619 .description = "The type of the child to create",
1625 .name = "project-uri",
1626 .description = "The project URI with the serialized timeline to execute the action on",
1631 }, "Add a child to @container-name. If asset-id and child-type are specified,"
1632 " the child will be created and added. Otherwise @child-name has to be specified"
1633 " and will be added to the container.", GST_VALIDATE_ACTION_TYPE_NONE);
1635 gst_validate_register_action_type ("container-remove-child", "ges", _container_remove_child,
1636 (GstValidateActionParameter []) {
1638 .name = "container-name",
1639 .description = "The name of the GESContainer to remove a child from",
1644 .name = "child-name",
1645 .description = "The name of the child to reomve from @container-name",
1650 .name = "project-uri",
1651 .description = "The project URI with the serialized timeline to execute the action on",
1656 }, "Remove a child from @container-name.", FALSE);
1658 gst_validate_register_action_type ("ungroup-container", "ges", _ungroup,
1659 (GstValidateActionParameter []) {
1661 .name = "container-name",
1662 .description = "The name of the GESContainer to ungroup children from",
1667 .name = "recursive",
1668 .description = "Whether to recurse ungrouping or not.",
1673 .name = "project-uri",
1674 .description = "The project URI with the serialized timeline to execute the action on",
1679 }, "Ungroup children of @container-name.", FALSE);
1681 gst_validate_register_action_type ("set-control-source", "ges", _validate_action_execute,
1682 (GstValidateActionParameter []) {
1684 .name = "element-name",
1685 .description = "The name of the GESTrackElement to set the control source on",
1690 .name = "property-name",
1691 .description = "The name of the property for which to set a control source",
1696 .name = "binding-type",
1697 .description = "The name of the type of binding to use",
1703 .name = "source-type",
1704 .description = "The name of the type of ControlSource to use",
1707 .def = "interpolation",
1710 .name = "interpolation-mode",
1711 .description = "The name of the GstInterpolationMode to on the source",
1717 .name = "project-uri",
1718 .description = "The project URI with the serialized timeline to execute the action on",
1723 }, "Adds a GstControlSource on @element-name::@property-name"
1724 " allowing you to then add keyframes on that property.", GST_VALIDATE_ACTION_TYPE_NONE);
1726 gst_validate_register_action_type ("add-keyframe", "ges", _validate_action_execute,
1727 (GstValidateActionParameter []) {
1729 .name = "element-name",
1730 .description = "The name of the GESTrackElement to add a keyframe on",
1735 .name = "property-name",
1736 .description = "The name of the property for which to add a keyframe on",
1741 .name = "timestamp",
1742 .description = "The timestamp of the keyframe",
1743 .types = "string or float",
1748 .description = "The value of the keyframe",
1753 .name = "project-uri",
1754 .description = "The project URI with the serialized timeline to execute the action on",
1759 }, "Set a keyframe on @element-name:property-name.", GST_VALIDATE_ACTION_TYPE_NONE);
1761 gst_validate_register_action_type ("copy-element", "ges", _copy_element,
1762 (GstValidateActionParameter []) {
1764 .name = "element-name",
1765 .description = "The name of the GESTtimelineElement to copy",
1771 .description = "Copy recursively or not",
1778 .description = "The time where to paste the element",
1779 .types = "string or float",
1783 .name = "paste-name",
1784 .description = "The name of the copied element",
1789 .name = "project-uri",
1790 .description = "The project URI with the serialized timeline to execute the action on",
1795 }, "Remove a child from @container-name.", GST_VALIDATE_ACTION_TYPE_NONE);
1797 gst_validate_register_action_type ("remove-keyframe", "ges", _validate_action_execute,
1798 (GstValidateActionParameter []) {
1800 .name = "element-name",
1801 .description = "The name of the GESTrackElement to add a keyframe on",
1806 .name = "property-name",
1807 .description = "The name of the property for which to add a keyframe on",
1812 .name = "timestamp",
1813 .description = "The timestamp of the keyframe",
1814 .types = "string or float",
1818 .name = "project-uri",
1819 .description = "The project URI with the serialized timeline to execute the action on",
1824 }, "Remove a keyframe on @element-name:property-name.", GST_VALIDATE_ACTION_TYPE_NONE);
1826 gst_validate_register_action_type ("load-project", "ges", _load_project,
1827 (GstValidateActionParameter []) {
1829 .name = "serialized-content",
1830 .description = "The full content of the XML describing project in XGES format.",
1837 .description = "The uri of the project to load (used only if serialized-content is not provided)",
1844 "Loads a project either from its content passed in the 'serialized-content' field or using the provided 'uri'.\n"
1845 "Note that it will completely clean the previous timeline",
1846 GST_VALIDATE_ACTION_TYPE_NONE);
1849 gst_validate_register_action_type ("commit", "ges", _commit, NULL,
1850 "Commit the timeline.", GST_VALIDATE_ACTION_TYPE_ASYNC);