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) {
541 GObject *tmpobject, *object = g_object_ref (G_OBJECT (data->element));
542 gchar **object_prop_name = g_strsplit (property, "::", 2);
544 GParamSpec *pspec = NULL;
548 g_object_class_find_property (G_OBJECT_GET_CLASS (object),
549 object_prop_name[i]);
552 GST_VALIDATE_REPORT_ACTION (data->scenario, data->action,
553 SCENARIO_ACTION_EXECUTION_ERROR,
554 "Could not get property %s on %" GES_FORMAT,
555 object_prop_name[i], GES_ARGS (data->element));
556 data->res = GST_VALIDATE_EXECUTE_ACTION_ERROR_REPORTED;
557 g_strfreev (object_prop_name);
562 if (!object_prop_name[++i])
566 g_object_get (tmpobject, pspec->name, &object, NULL);
567 g_object_unref (tmpobject);
570 g_strfreev (object_prop_name);
571 g_value_init (&cvalue, pspec->value_type);
572 g_object_get_property (object, pspec->name, &cvalue);
573 g_object_unref (object);
577 if (GST_CLOCK_TIME_IS_VALID (data->time)) {
578 if (!GES_IS_TRACK_ELEMENT (data->element)) {
579 GST_VALIDATE_REPORT_ACTION (data->scenario, data->action,
580 SCENARIO_ACTION_EXECUTION_ERROR,
581 "Could not get property at time for type %s - only GESTrackElement supported",
582 G_OBJECT_TYPE_NAME (data->element));
583 data->res = GST_VALIDATE_EXECUTE_ACTION_ERROR_REPORTED;
589 ges_track_element_get_control_binding (GES_TRACK_ELEMENT
590 (data->element), property);
592 tvalue = gst_control_binding_get_value (binding, data->time);
595 GST_VALIDATE_REPORT_ACTION (data->scenario, data->action,
596 SCENARIO_ACTION_EXECUTION_ERROR,
597 "Could not get property: %s at %" GST_TIME_FORMAT, property,
598 GST_TIME_ARGS (data->time));
599 data->res = GST_VALIDATE_EXECUTE_ACTION_ERROR_REPORTED;
607 && !ges_timeline_element_get_child_property (data->element, property,
609 GST_VALIDATE_REPORT_ACTION (data->scenario, data->action,
610 SCENARIO_ACTION_EXECUTION_ERROR, "Could not get child property: %s:",
612 data->res = GST_VALIDATE_EXECUTE_ACTION_ERROR_REPORTED;
618 observed_value = tvalue ? tvalue : &cvalue;
620 if (G_VALUE_TYPE (observed_value) != G_VALUE_TYPE (expected_value)) {
621 g_value_init (&comparable_value, G_VALUE_TYPE (observed_value));
623 if (G_VALUE_TYPE (observed_value) == GST_TYPE_CLOCK_TIME) {
626 if (gst_validate_utils_get_clocktime (data->action->structure, property,
628 g_value_set_uint64 (&comparable_value, t);
629 expected_value = &comparable_value;
631 } else if (g_value_transform (expected_value, &comparable_value)) {
632 expected_value = &comparable_value;
636 if (gst_value_compare (observed_value, expected_value) != GST_VALUE_EQUAL) {
637 gchar *expected = gst_value_serialize (expected_value), *observed =
638 gst_value_serialize (observed_value);
640 GST_VALIDATE_REPORT_ACTION (data->scenario, data->action,
641 SCENARIO_ACTION_CHECK_ERROR,
642 "%s::%s expected value: '(%s)%s' different than observed: '(%s)%s'",
643 GES_TIMELINE_ELEMENT_NAME (data->element), property,
644 G_VALUE_TYPE_NAME (observed_value), expected,
645 G_VALUE_TYPE_NAME (expected_value), observed);
649 data->res = GST_VALIDATE_EXECUTE_ACTION_ERROR_REPORTED;
652 if (G_VALUE_TYPE (&comparable_value) != G_TYPE_NONE)
653 g_value_unset (&comparable_value);
656 g_value_unset (tvalue);
659 g_value_reset (&cvalue);
664 set_property (GQuark field_id, const GValue * value, PropertyData * data)
666 const gchar *property = g_quark_to_string (field_id);
668 if (data->on_children) {
669 if (!ges_timeline_element_set_child_property (data->element, property,
671 gchar *v = gst_value_serialize (value);
673 GST_VALIDATE_REPORT_ACTION (data->scenario, data->action,
674 SCENARIO_ACTION_EXECUTION_ERROR,
675 "Could not set %s child property %s to %s",
676 GES_TIMELINE_ELEMENT_NAME (data->element), property, v);
678 data->res = GST_VALIDATE_EXECUTE_ACTION_ERROR_REPORTED;
685 gst_validate_object_set_property (GST_VALIDATE_REPORTER
686 (data->scenario), G_OBJECT (data->element), property, value, FALSE);
692 GES_START_VALIDATE_ACTION (set_or_check_properties)
694 GESTimelineElement *element;
695 GstStructure *structure;
696 const gchar *element_name;
697 gboolean is_setting = FALSE;
698 PropertyData data = {
699 .scenario = scenario,
701 .res = GST_VALIDATE_EXECUTE_ACTION_OK,
702 .time = GST_CLOCK_TIME_NONE,
704 !gst_structure_has_name (action->structure, "check-ges-properties")
705 && !gst_structure_has_name (action->structure, "set-ges-properties"),
709 is_setting = gst_structure_has_name (action->structure, "set-ges-properties")
710 || gst_structure_has_name (action->structure, "set-child-properties");
711 gst_validate_action_get_clocktime (scenario, action, "at-time", &data.time);
713 structure = gst_structure_copy (action->structure);
714 element_name = gst_structure_get_string (structure, "element-name");
715 element = ges_timeline_get_element (timeline, element_name);
717 GST_VALIDATE_REPORT_ACTION (scenario, action,
718 SCENARIO_ACTION_EXECUTION_ERROR,
719 "Can not find element: %s", element_name);
721 data.res = GST_VALIDATE_EXECUTE_ACTION_ERROR_REPORTED;
725 data.element = element;
726 gst_structure_remove_fields (structure, "element-name", "at-time",
727 "project-uri", NULL);
728 gst_structure_foreach (structure,
729 is_setting ? (GstStructureForeachFunc) set_property
730 : (GstStructureForeachFunc) check_property, &data);
731 gst_object_unref (element);
734 gst_structure_free (structure);
738 GST_END_VALIDATE_ACTION;
740 GES_START_VALIDATE_ACTION (_set_track_restriction_caps)
744 GESTrackType track_types;
746 const gchar *track_type_str =
747 gst_structure_get_string (action->structure, "track-type");
748 const gchar *caps_str = gst_structure_get_string (action->structure, "caps");
750 REPORT_UNLESS (track_types =
751 gst_validate_utils_flags_from_str (GES_TYPE_TRACK_TYPE, track_type_str),
752 done, "Invalid track types: %s", track_type_str);
754 REPORT_UNLESS (caps = gst_caps_from_string (caps_str),
755 done, "Invalid track restriction caps: %s", caps_str);
757 res = GST_VALIDATE_EXECUTE_ACTION_ERROR;
758 for (tmp = timeline->tracks; tmp; tmp = tmp->next) {
759 GESTrack *track = tmp->data;
761 if (track->type & track_types) {
764 str = gst_caps_to_string (caps);
767 ges_track_set_restriction_caps (track, caps);
769 res = GST_VALIDATE_EXECUTE_ACTION_OK;
772 gst_caps_unref (caps);
775 GST_END_VALIDATE_ACTION;
777 GES_START_VALIDATE_ACTION (_set_asset_on_element)
780 GESTimelineElement *element;
781 const gchar *element_name, *id;
783 element_name = gst_structure_get_string (action->structure, "element-name");
784 element = ges_timeline_get_element (timeline, element_name);
785 REPORT_UNLESS (element, done, "Can't find %s", element_name);
787 id = gst_structure_get_string (action->structure, "asset-id");
789 gst_validate_printf (action, "Setting asset %s on element %s\n",
792 asset = _ges_get_asset_from_timeline (timeline, G_OBJECT_TYPE (element), id,
794 REPORT_UNLESS (asset, beach, "Could not find asset: %s", id);
796 res = ges_extractable_set_asset (GES_EXTRACTABLE (element), asset);
799 gst_clear_object (&asset);
800 gst_clear_object (&element);
803 GST_END_VALIDATE_ACTION;
805 GES_START_VALIDATE_ACTION (_container_remove_child)
807 GESContainer *container = NULL;
808 GESTimelineElement *child = NULL;
809 const gchar *container_name, *child_name;
812 gst_structure_get_string (action->structure, "container-name");
814 (GESContainer *) ges_timeline_get_element (timeline, container_name);
815 REPORT_UNLESS (GES_IS_CONTAINER (container), beach,
816 "Could not find container: %s", container_name);
818 child_name = gst_structure_get_string (action->structure, "child-name");
819 child = ges_timeline_get_element (timeline, child_name);
820 REPORT_UNLESS (GES_IS_TIMELINE_ELEMENT (child), beach, "Could not find %s",
823 res = ges_container_remove (container, child);
826 gst_clear_object (&container);
827 gst_clear_object (&child);
830 GST_END_VALIDATE_ACTION;
832 GES_START_VALIDATE_ACTION (_ungroup)
834 GESContainer *container;
835 gboolean recursive = FALSE;
836 const gchar *container_name;
839 gst_structure_get_string (action->structure, "container-name");
841 (GESContainer *) ges_timeline_get_element (timeline, container_name);
842 REPORT_UNLESS (GES_IS_CONTAINER (container), beach, "Could not find %s",
845 gst_structure_get_boolean (action->structure, "recursive", &recursive);
847 g_list_free (ges_container_ungroup (container, recursive));
850 gst_clear_object (&container);
853 GST_END_VALIDATE_ACTION;
855 GES_START_VALIDATE_ACTION (_copy_element)
857 GESTimelineElement *element = NULL, *copied = NULL, *pasted = NULL;
858 gboolean recursive = FALSE;
859 const gchar *element_name, *paste_name;
860 GstClockTime position;
862 element_name = gst_structure_get_string (action->structure, "element-name");
863 element = ges_timeline_get_element (timeline, element_name);
865 REPORT_UNLESS (GES_IS_CONTAINER (element), beach, "Could not find %s",
868 if (!gst_structure_get_boolean (action->structure, "recursive", &recursive))
871 REPORT_UNLESS (gst_validate_action_get_clocktime (scenario, action,
872 "position", &position), beach, "Could not find position");
874 copied = ges_timeline_element_copy (element, recursive);
875 pasted = ges_timeline_element_paste (copied, position);
877 REPORT_UNLESS (pasted, beach, "Could not paste clip %s", element_name);
879 paste_name = gst_structure_get_string (action->structure, "paste-name");
881 REPORT_UNLESS (ges_timeline_element_set_name (pasted, paste_name),
882 beach, "Could not set element name %s", paste_name);
885 gst_clear_object (&pasted);
886 gst_clear_object (&element);
888 /* `copied` is only used for the single paste operation, and is not
889 * actually in any timeline. We own it (it is actually still floating).
890 * `pasted` is the actual new object in the timeline. We own a
891 * reference to it. */
892 gst_clear_object (&copied);
895 GST_END_VALIDATE_ACTION;
897 GES_START_VALIDATE_ACTION (_validate_action_execute)
900 ActionFromStructureFunc func;
902 gst_structure_remove_field (action->structure, "playback-time");
903 if (gst_structure_has_name (action->structure, "add-keyframe") ||
904 gst_structure_has_name (action->structure, "remove-keyframe")) {
905 func = _ges_add_remove_keyframe_from_struct;
906 } else if (gst_structure_has_name (action->structure, "set-control-source")) {
907 func = _ges_set_control_source_from_struct;
908 } else if (gst_structure_has_name (action->structure, "add-clip")) {
909 func = _ges_add_clip_from_struct;
910 } else if (gst_structure_has_name (action->structure, "container-add-child")) {
911 func = _ges_container_add_child_from_struct;
912 } else if (gst_structure_has_name (action->structure, "set-child-property")) {
913 func = _ges_set_child_property_from_struct;
915 g_assert_not_reached ();
918 if (!func (timeline, action->structure, &err)) {
919 GST_VALIDATE_REPORT_ACTION (scenario, action,
920 g_quark_from_string ("scenario::execution-error"),
921 "Could not execute %s (error: %s)",
922 gst_structure_get_name (action->structure),
923 err ? err->message : "None");
925 g_clear_error (&err);
926 res = GST_VALIDATE_EXECUTE_ACTION_ERROR_REPORTED;
930 GST_END_VALIDATE_ACTION;
933 _project_loaded_cb (GESProject * project, GESTimeline * timeline,
934 GstValidateAction * action)
936 gst_validate_action_set_done (action);
939 GES_START_VALIDATE_ACTION (_load_project)
942 GESProject *project = NULL;
943 GList *tmp, *tmp_full;
946 GError *error = NULL;
947 const gchar *content = NULL;
949 gchar *tmpfile = g_strdup_printf ("%s%s%s", g_get_tmp_dir (),
950 G_DIR_SEPARATOR_S, "tmpxgesload.xges");
952 res = GST_VALIDATE_EXECUTE_ACTION_ASYNC;
953 REPORT_UNLESS (GES_IS_PIPELINE (pipeline), local_done,
954 "Not a GES pipeline, can't work with it");
956 gst_element_get_state (pipeline, &state, NULL, 0);
957 gst_element_set_state (pipeline, GST_STATE_NULL);
959 content = gst_structure_get_string (action->structure, "serialized-content");
962 g_file_set_contents (tmpfile, content, -1, &error);
963 REPORT_UNLESS (!error, local_done,
964 "Could not set XML content: %s", error->message);
966 uri = gst_filename_to_uri (tmpfile, &error);
967 REPORT_UNLESS (!error, local_done,
968 "Could not set filename to URI: %s", error->message);
970 uri = g_strdup (gst_structure_get_string (action->structure, "uri"));
971 REPORT_UNLESS (uri, local_done,
972 "None of 'uri' or 'content' passed as parameter"
973 " can't load any timeline!");
976 tmp_full = ges_timeline_get_layers (timeline);
977 for (tmp = tmp_full; tmp; tmp = tmp->next)
978 ges_timeline_remove_layer (timeline, tmp->data);
979 g_list_free_full (tmp_full, gst_object_unref);
981 tmp_full = ges_timeline_get_tracks (timeline);
982 for (tmp = tmp_full; tmp; tmp = tmp->next)
983 ges_timeline_remove_track (timeline, tmp->data);
984 g_list_free_full (tmp_full, gst_object_unref);
986 project = ges_project_new (uri);
987 g_signal_connect (project, "loaded", G_CALLBACK (_project_loaded_cb), action);
988 ges_project_load (project, gst_object_ref (timeline), &error);
989 REPORT_UNLESS (!error, local_done,
990 "Could not load timeline: %s", error->message);
992 gst_element_set_state (pipeline, state);
995 gst_clear_object (&project);
996 g_clear_error (&error);
1001 GST_END_VALIDATE_ACTION;
1004 prepare_seek_action (GstValidateAction * action)
1006 gint res = GST_VALIDATE_EXECUTE_ACTION_ERROR;
1007 GESFrameNumber fstart, fstop;
1008 GstValidateScenario *scenario = gst_validate_action_get_scenario (action);
1009 GstValidateActionType *type = gst_validate_get_action_type (action->type);
1012 DECLARE_AND_GET_TIMELINE (scenario, action);
1015 && ges_util_structure_get_clocktime (action->structure, "start", NULL,
1017 GstClockTime start = ges_timeline_get_frame_time (timeline, fstart);
1020 GST_VALIDATE_REPORT_ACTION (scenario, action,
1021 SCENARIO_ACTION_EXECUTION_ERROR,
1022 "Invalid seeking frame number '%" G_GINT64_FORMAT "': %s", fstart,
1026 gst_structure_set (action->structure, "start", G_TYPE_UINT64, start, NULL);
1030 && ges_util_structure_get_clocktime (action->structure, "stop", NULL,
1032 GstClockTime stop = ges_timeline_get_frame_time (timeline, fstop);
1035 GST_VALIDATE_REPORT_ACTION (scenario, action,
1036 SCENARIO_ACTION_EXECUTION_ERROR,
1037 "Invalid seeking frame number '%" G_GINT64_FORMAT "': %s", fstop,
1041 gst_structure_set (action->structure, "stop", G_TYPE_UINT64, stop, NULL);
1044 gst_object_unref (scenario);
1045 gst_object_unref (timeline);
1046 return type->overriden_type->prepare (action);
1049 gst_object_unref (scenario);
1050 gst_object_unref (timeline);
1055 set_layer_active (GstValidateScenario * scenario, GstValidateAction * action)
1060 GList *tracks = NULL;
1061 GstValidateExecuteActionReturn res = GST_VALIDATE_EXECUTE_ACTION_OK;
1062 gchar **track_names =
1063 gst_validate_utils_get_strv (action->structure, "tracks");
1065 DECLARE_AND_GET_TIMELINE (scenario, action);
1067 for (i = 0; track_names[i]; i++) {
1069 (GESTrack *) gst_bin_get_by_name (GST_BIN (timeline), track_names[i]);
1072 GST_VALIDATE_REPORT_ACTION (scenario, action,
1073 SCENARIO_ACTION_EXECUTION_ERROR,
1074 "Could not find track %s", track_names[i]);
1075 res = GST_VALIDATE_EXECUTE_ACTION_ERROR_REPORTED;
1079 tracks = g_list_prepend (tracks, track);
1082 if (!gst_structure_get_int (action->structure, "layer-priority", &layer_prio)) {
1083 GST_VALIDATE_REPORT_ACTION (scenario, action,
1084 SCENARIO_ACTION_EXECUTION_ERROR,
1085 "Could not find layer from %" GST_PTR_FORMAT, action->structure);
1086 res = GST_VALIDATE_EXECUTE_ACTION_ERROR_REPORTED;
1089 if (!(layer = g_list_nth_data (timeline->layers, layer_prio))) {
1090 GST_VALIDATE_REPORT_ACTION (scenario, action,
1091 SCENARIO_ACTION_EXECUTION_ERROR, "Could not find layer %d", layer_prio);
1092 res = GST_VALIDATE_EXECUTE_ACTION_ERROR_REPORTED;
1096 if (!gst_structure_get_boolean (action->structure, "active", &active)) {
1097 GST_VALIDATE_REPORT_ACTION (scenario, action,
1098 SCENARIO_ACTION_EXECUTION_ERROR,
1099 "Could not find 'active' boolean in %" GST_PTR_FORMAT,
1101 res = GST_VALIDATE_EXECUTE_ACTION_ERROR_REPORTED;
1105 if (!ges_layer_set_active_for_tracks (layer, active, tracks)) {
1106 GST_VALIDATE_REPORT_ACTION (scenario, action,
1107 SCENARIO_ACTION_EXECUTION_ERROR,
1108 "Could not set active for track defined in %" GST_PTR_FORMAT,
1110 res = GST_VALIDATE_EXECUTE_ACTION_ERROR_REPORTED;
1115 g_strfreev (track_names);
1116 gst_object_unref (timeline);
1117 g_list_free_full (tracks, gst_object_unref);
1125 ges_validate_register_action_types (void)
1127 #ifdef HAVE_GST_VALIDATE
1128 GstValidateActionType *validate_seek, *seek_override;
1131 gst_validate_init ();
1132 validate_seek = gst_validate_get_action_type ("seek");
1135 seek_override = gst_validate_register_action_type("seek", "ges", validate_seek->execute,
1136 validate_seek->parameters, validate_seek->description,
1137 validate_seek->flags);
1138 gst_mini_object_unref(GST_MINI_OBJECT(validate_seek));
1139 seek_override->prepare = prepare_seek_action;
1141 gst_validate_register_action_type ("edit-container", "ges", _edit,
1142 (GstValidateActionParameter []) {
1144 .name = "container-name",
1145 .description = "The name of the GESContainer to edit",
1151 .description = "The new position of the GESContainer",
1153 .types = "double or string",
1154 .possible_variables = "position: The current position in the stream\n"
1155 "duration: The duration of the stream",
1159 .name = "edit-mode",
1160 .description = "The GESEditMode to use to edit @container-name",
1167 .description = "The GESEdge to use to edit @container-name\n"
1168 "should be in [ start, end, none ] ",
1174 .name = "new-layer-priority",
1175 .description = "The priority of the layer @container should land in.\n"
1176 "If the layer you're trying to move the container to doesn't exist, it will\n"
1177 "be created automatically. -1 means no move.",
1183 .name = "project-uri",
1184 .description = "The project URI with the serialized timeline to execute the action on",
1190 "Allows to edit a container (like a GESClip), for more details, have a look at:\n"
1191 "ges_timeline_element_edit documentation, Note that the timeline will\n"
1192 "be committed, and flushed so that the edition is taken into account",
1193 GST_VALIDATE_ACTION_TYPE_NONE);
1195 gst_validate_register_action_type ("edit", "ges", _edit,
1196 (GstValidateActionParameter []) {
1198 .name = "element-name",
1199 .description = "The name of the element to edit",
1205 .description = "The new position of the element",
1207 .types = "double or string",
1208 .possible_variables = "position: The current position in the stream\n"
1209 "duration: The duration of the stream",
1213 .name = "source-frame",
1214 .description = "The new frame of the element, computed from the @element-name"
1215 "clip's source frame.",
1217 .types = "double or string",
1221 .name = "edit-mode",
1222 .description = "The GESEditMode to use to edit @element-name",
1229 .description = "The GESEdge to use to edit @element-name\n"
1230 "should be in [ start, end, none ] ",
1236 .name = "new-layer-priority",
1237 .description = "The priority of the layer @element should land in.\n"
1238 "If the layer you're trying to move the element to doesn't exist, it will\n"
1239 "be created automatically. -1 means no move.",
1245 .name = "project-uri",
1246 .description = "The project URI with the serialized timeline to execute the action on",
1252 "Allows to edit a element (like a GESClip), for more details, have a look at:\n"
1253 "ges_timeline_element_edit documentation, Note that the timeline will\n"
1254 "be committed, and flushed so that the edition is taken into account",
1255 GST_VALIDATE_ACTION_TYPE_NONE);
1257 gst_validate_register_action_type ("add-asset", "ges", _add_asset,
1258 (GstValidateActionParameter []) {
1261 .description = "Adds an asset to a project.",
1267 .description = "The type of asset to add",
1272 .name = "project-uri",
1273 .description = "The project URI with the serialized timeline to execute the action on",
1279 "Allows to add an asset to the current project", GST_VALIDATE_ACTION_TYPE_NONE);
1281 gst_validate_register_action_type ("remove-asset", "ges", _remove_asset,
1282 (GstValidateActionParameter []) {
1285 .description = "The ID of the clip to remove",
1291 .description = "The type of asset to remove",
1296 .name = "project-uri",
1297 .description = "The project URI with the serialized timeline to execute the action on",
1303 "Allows to remove an asset from the current project", GST_VALIDATE_ACTION_TYPE_NONE);
1305 gst_validate_register_action_type ("add-layer", "ges", _add_layer,
1306 (GstValidateActionParameter []) {
1309 .description = "The priority of the new layer to add,"
1310 "if not specified, the new layer will be"
1311 " appended to the timeline",
1316 .name = "project-uri",
1317 .description = "The project URI with the serialized timeline to execute the action on",
1323 "Allows to add a layer to the current timeline", GST_VALIDATE_ACTION_TYPE_NONE);
1325 gst_validate_register_action_type ("remove-layer", "ges", _remove_layer,
1326 (GstValidateActionParameter []) {
1329 .description = "The priority of the layer to remove",
1334 .name = "auto-transition",
1335 .description = "Whether auto-transition is activated on the new layer.",
1341 .name = "project-uri",
1342 .description = "The nested timeline to add clip to",
1348 "Allows to remove a layer from the current timeline", GST_VALIDATE_ACTION_TYPE_NONE);
1350 gst_validate_register_action_type ("add-clip", "ges", _validate_action_execute,
1351 (GstValidateActionParameter []) {
1354 .description = "The name of the clip to add",
1359 .name = "layer-priority",
1360 .description = "The priority of the clip to add",
1366 .description = "The id of the asset from which to extract the clip",
1372 .description = "The type of the clip to create",
1378 .description = "The start value to set on the new GESClip.",
1379 .types = "double or string",
1384 .description = "The inpoint value to set on the new GESClip",
1385 .types = "double or string",
1390 .description = "The duration value to set on the new GESClip",
1391 .types = "double or string",
1395 .name = "project-uri",
1396 .description = "The project URI with the serialized timeline to execute the action on",
1401 }, "Allows to add a clip to a given layer", GST_VALIDATE_ACTION_TYPE_NONE);
1403 gst_validate_register_action_type ("remove-clip", "ges", _remove_clip,
1404 (GstValidateActionParameter []) {
1407 .description = "The name of the clip to remove",
1412 .name = "project-uri",
1413 .description = "The project URI with the serialized timeline to execute the action on",
1418 }, "Allows to remove a clip from a given layer", GST_VALIDATE_ACTION_TYPE_NONE);
1420 gst_validate_register_action_type ("serialize-project", "ges", _serialize_project,
1421 (GstValidateActionParameter []) {
1424 .description = "The uri where to store the serialized project",
1429 }, "serializes a project", GST_VALIDATE_ACTION_TYPE_NONE);
1431 gst_validate_register_action_type ("set-child-property", "ges", _validate_action_execute,
1432 (GstValidateActionParameter []) {
1434 .name = "element-name",
1435 .description = "The name of the element on which to modify the property",
1441 .description = "The name of the property to modify",
1447 .description = "The value of the property",
1452 .name = "project-uri",
1453 .description = "The project URI with the serialized timeline to execute the action on",
1458 }, "Allows to change child property of an object", GST_VALIDATE_ACTION_TYPE_NONE);
1460 gst_validate_register_action_type ("set-layer-active", "ges", set_layer_active,
1461 (GstValidateActionParameter []) {
1463 .name = "layer-priority",
1464 .description = "The priority of the layer to set activness on",
1470 .description = "The activness of the layer",
1471 .types = "gboolean",
1476 .description = "tracks",
1477 .types = "{string, }",
1481 }, "Set activness of a layer (on optional tracks).",
1482 GST_VALIDATE_ACTION_TYPE_NONE);
1484 gst_validate_register_action_type ("set-ges-properties", "ges", set_or_check_properties,
1485 (GstValidateActionParameter []) {
1487 .name = "element-name",
1488 .description = "The name of the element on which to set properties",
1493 }, "Set `element-name` properties values defined by the"
1494 " fields in the following format: `property_name=expected-value`",
1495 GST_VALIDATE_ACTION_TYPE_NONE);
1497 gst_validate_register_action_type ("check-ges-properties", "ges", set_or_check_properties,
1498 (GstValidateActionParameter []) {
1500 .name = "element-name",
1501 .description = "The name of the element on which to check properties",
1506 }, "Check `element-name` properties values defined by the"
1507 " fields in the following format: `property_name=expected-value`",
1508 GST_VALIDATE_ACTION_TYPE_NONE);
1510 gst_validate_register_action_type ("check-child-properties", "ges", set_or_check_properties,
1511 (GstValidateActionParameter []) {
1513 .name = "element-name",
1514 .description = "The name of the element on which to check children properties",
1520 .description = "The time at which to check the values, taking into"
1521 " account the ControlBinding if any set.",
1526 }, "Check `element-name` children properties values defined by the"
1527 " fields in the following format: `property_name=expected-value`",
1528 GST_VALIDATE_ACTION_TYPE_NONE);
1530 gst_validate_register_action_type ("set-child-properties", "ges", set_or_check_properties,
1531 (GstValidateActionParameter []) {
1533 .name = "element-name",
1534 .description = "The name of the element on which to modify child properties",
1539 }, "Sets `element-name` children properties values defined by the"
1540 " fields in the following format: `property-name=new-value`",
1541 GST_VALIDATE_ACTION_TYPE_NONE);
1543 gst_validate_register_action_type ("split-clip", "ges", _split_clip,
1544 (GstValidateActionParameter []) {
1546 .name = "clip-name",
1547 .description = "The name of the clip to split",
1553 .description = "The position at which to split the clip",
1554 .types = "double or string",
1558 .name = "project-uri",
1559 .description = "The project URI with the serialized timeline to execute the action on",
1564 }, "Split a clip at a specified position.", GST_VALIDATE_ACTION_TYPE_NONE);
1566 gst_validate_register_action_type ("set-track-restriction-caps", "ges", _set_track_restriction_caps,
1567 (GstValidateActionParameter []) {
1569 .name = "track-type",
1570 .description = "The type of track to set restriction caps on",
1576 .description = "The caps to set on the track",
1581 .name = "project-uri",
1582 .description = "The project URI with the serialized timeline to execute the action on",
1587 }, "Sets restriction caps on tracks of a specific type.", GST_VALIDATE_ACTION_TYPE_NONE);
1589 gst_validate_register_action_type ("element-set-asset", "ges", _set_asset_on_element,
1590 (GstValidateActionParameter []) {
1592 .name = "element-name",
1593 .description = "The name of the TimelineElement to set an asset on",
1599 .description = "The id of the asset from which to extract the clip",
1604 .name = "project-uri",
1605 .description = "The project URI with the serialized timeline to execute the action on",
1610 }, "Sets restriction caps on tracks of a specific type.", GST_VALIDATE_ACTION_TYPE_NONE);
1613 gst_validate_register_action_type ("container-add-child", "ges", _validate_action_execute,
1614 (GstValidateActionParameter []) {
1616 .name = "container-name",
1617 .description = "The name of the GESContainer to add a child to",
1622 .name = "child-name",
1623 .description = "The name of the child to add to @container-name",
1630 .description = "The id of the asset from which to extract the child",
1636 .name = "child-type",
1637 .description = "The type of the child to create",
1643 .name = "project-uri",
1644 .description = "The project URI with the serialized timeline to execute the action on",
1649 }, "Add a child to @container-name. If asset-id and child-type are specified,"
1650 " the child will be created and added. Otherwise @child-name has to be specified"
1651 " and will be added to the container.", GST_VALIDATE_ACTION_TYPE_NONE);
1653 gst_validate_register_action_type ("container-remove-child", "ges", _container_remove_child,
1654 (GstValidateActionParameter []) {
1656 .name = "container-name",
1657 .description = "The name of the GESContainer to remove a child from",
1662 .name = "child-name",
1663 .description = "The name of the child to reomve from @container-name",
1668 .name = "project-uri",
1669 .description = "The project URI with the serialized timeline to execute the action on",
1674 }, "Remove a child from @container-name.", FALSE);
1676 gst_validate_register_action_type ("ungroup-container", "ges", _ungroup,
1677 (GstValidateActionParameter []) {
1679 .name = "container-name",
1680 .description = "The name of the GESContainer to ungroup children from",
1685 .name = "recursive",
1686 .description = "Whether to recurse ungrouping or not.",
1691 .name = "project-uri",
1692 .description = "The project URI with the serialized timeline to execute the action on",
1697 }, "Ungroup children of @container-name.", FALSE);
1699 gst_validate_register_action_type ("set-control-source", "ges", _validate_action_execute,
1700 (GstValidateActionParameter []) {
1702 .name = "element-name",
1703 .description = "The name of the GESTrackElement to set the control source on",
1708 .name = "property-name",
1709 .description = "The name of the property for which to set a control source",
1714 .name = "binding-type",
1715 .description = "The name of the type of binding to use",
1721 .name = "source-type",
1722 .description = "The name of the type of ControlSource to use",
1725 .def = "interpolation",
1728 .name = "interpolation-mode",
1729 .description = "The name of the GstInterpolationMode to on the source",
1735 .name = "project-uri",
1736 .description = "The project URI with the serialized timeline to execute the action on",
1741 }, "Adds a GstControlSource on @element-name::@property-name"
1742 " allowing you to then add keyframes on that property.", GST_VALIDATE_ACTION_TYPE_NONE);
1744 gst_validate_register_action_type ("add-keyframe", "ges", _validate_action_execute,
1745 (GstValidateActionParameter []) {
1747 .name = "element-name",
1748 .description = "The name of the GESTrackElement to add a keyframe on",
1753 .name = "property-name",
1754 .description = "The name of the property for which to add a keyframe on",
1759 .name = "timestamp",
1760 .description = "The timestamp of the keyframe",
1761 .types = "string or float",
1766 .description = "The value of the keyframe",
1771 .name = "project-uri",
1772 .description = "The project URI with the serialized timeline to execute the action on",
1777 }, "Set a keyframe on @element-name:property-name.", GST_VALIDATE_ACTION_TYPE_NONE);
1779 gst_validate_register_action_type ("copy-element", "ges", _copy_element,
1780 (GstValidateActionParameter []) {
1782 .name = "element-name",
1783 .description = "The name of the GESTtimelineElement to copy",
1789 .description = "Copy recursively or not",
1796 .description = "The time where to paste the element",
1797 .types = "string or float",
1801 .name = "paste-name",
1802 .description = "The name of the copied element",
1807 .name = "project-uri",
1808 .description = "The project URI with the serialized timeline to execute the action on",
1813 }, "Remove a child from @container-name.", GST_VALIDATE_ACTION_TYPE_NONE);
1815 gst_validate_register_action_type ("remove-keyframe", "ges", _validate_action_execute,
1816 (GstValidateActionParameter []) {
1818 .name = "element-name",
1819 .description = "The name of the GESTrackElement to add a keyframe on",
1824 .name = "property-name",
1825 .description = "The name of the property for which to add a keyframe on",
1830 .name = "timestamp",
1831 .description = "The timestamp of the keyframe",
1832 .types = "string or float",
1836 .name = "project-uri",
1837 .description = "The project URI with the serialized timeline to execute the action on",
1842 }, "Remove a keyframe on @element-name:property-name.", GST_VALIDATE_ACTION_TYPE_NONE);
1844 gst_validate_register_action_type ("load-project", "ges", _load_project,
1845 (GstValidateActionParameter []) {
1847 .name = "serialized-content",
1848 .description = "The full content of the XML describing project in XGES format.",
1855 .description = "The uri of the project to load (used only if serialized-content is not provided)",
1862 "Loads a project either from its content passed in the 'serialized-content' field or using the provided 'uri'.\n"
1863 "Note that it will completely clean the previous timeline",
1864 GST_VALIDATE_ACTION_TYPE_NONE);
1867 gst_validate_register_action_type ("commit", "ges", _commit, NULL,
1868 "Commit the timeline.", GST_VALIDATE_ACTION_TYPE_ASYNC);