diff options
Diffstat (limited to 'ges/ges-validate.c')
-rw-r--r-- | ges/ges-validate.c | 71 |
1 files changed, 3 insertions, 68 deletions
diff --git a/ges/ges-validate.c b/ges/ges-validate.c index ace70e84..7354b6c7 100644 --- a/ges/ges-validate.c +++ b/ges/ges-validate.c @@ -876,73 +876,6 @@ beach: GST_END_VALIDATE_ACTION; -GES_START_VALIDATE_ACTION (_set_control_source) -{ - guint mode; - GESTrackElement *element = NULL; - - GstControlSource *source = NULL; - gchar *element_name, *property_name, *binding_type = NULL, - *source_type = NULL, *interpolation_mode = NULL; - - REPORT_UNLESS (gst_structure_get (action->structure, - "element-name", G_TYPE_STRING, &element_name, - "property-name", G_TYPE_STRING, &property_name, NULL), - beach, "Wrong parameters"); - - TRY_GET ("binding-type", G_TYPE_STRING, &binding_type, NULL); - TRY_GET ("source-type", G_TYPE_STRING, &source_type, NULL); - TRY_GET ("interpolation-mode", G_TYPE_STRING, &interpolation_mode, NULL); - - element = - (GESTrackElement *) (ges_timeline_get_element (timeline, element_name)); - if (GES_IS_CLIP (element)) { - GList *tmp; - for (tmp = GES_CONTAINER_CHILDREN (element); tmp; tmp = tmp->next) { - if (ges_timeline_element_lookup_child (tmp->data, property_name, NULL, - NULL)) { - gst_object_replace ((GstObject **) & element, tmp->data); - - break; - } - } - } - REPORT_UNLESS (GES_IS_TRACK_ELEMENT (element), beach, - "Could not find track element element %s (got %" GST_PTR_FORMAT ")", - element_name, element); - - if (!binding_type) - binding_type = g_strdup ("direct"); - - REPORT_UNLESS (source_type == NULL - || !g_strcmp0 (source_type, "interpolation"), beach, - "Interpolation type %s not supported", source_type); - source = gst_interpolation_control_source_new (); - - if (interpolation_mode) - REPORT_UNLESS (gst_validate_utils_enum_from_str - (GST_TYPE_INTERPOLATION_MODE, interpolation_mode, &mode), beach, - "Wrong intorpolation mode: %s", interpolation_mode); - else - mode = GST_INTERPOLATION_MODE_LINEAR; - - g_object_set (source, "mode", mode, NULL); - - res = ges_track_element_set_control_source (element, - source, property_name, binding_type); - -beach: - gst_clear_object (&element); - gst_clear_object (&source); - g_free (property_name); - g_free (element_name); - g_free (binding_type); - g_free (source_type); - g_free (interpolation_mode); -} - -GST_END_VALIDATE_ACTION; - GES_START_VALIDATE_ACTION (_validate_action_execute) { GError *err = NULL; @@ -952,6 +885,8 @@ GES_START_VALIDATE_ACTION (_validate_action_execute) if (gst_structure_has_name (action->structure, "add-keyframe") || gst_structure_has_name (action->structure, "remove-keyframe")) { func = _ges_add_remove_keyframe_from_struct; + } else if (gst_structure_has_name (action->structure, "set-control-source")) { + func = _ges_set_control_source_from_struct; } else if (gst_structure_has_name (action->structure, "add-clip")) { func = _ges_add_clip_from_struct; } else if (gst_structure_has_name (action->structure, "container-add-child")) { @@ -1743,7 +1678,7 @@ ges_validate_register_action_types (void) {NULL} }, "Ungroup children of @container-name.", FALSE); - gst_validate_register_action_type ("set-control-source", "ges", _set_control_source, + gst_validate_register_action_type ("set-control-source", "ges", _validate_action_execute, (GstValidateActionParameter []) { { .name = "element-name", |