mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-11 01:45:33 +00:00
validate: Fix setting ges properties
And fix typos. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-editing-services/-/merge_requests/175>
This commit is contained in:
parent
5e448921d8
commit
8258d56a13
1 changed files with 36 additions and 26 deletions
|
@ -328,7 +328,7 @@ GES_START_VALIDATE_ACTION (_remove_clip)
|
||||||
|
|
||||||
name = gst_structure_get_string (action->structure, "name");
|
name = gst_structure_get_string (action->structure, "name");
|
||||||
clip = ges_timeline_get_element (timeline, name);
|
clip = ges_timeline_get_element (timeline, name);
|
||||||
REPORT_UNLESS (GES_IS_CLIP (clip), beach, "Couldnt' find clip: %s", name);
|
REPORT_UNLESS (GES_IS_CLIP (clip), beach, "Couldn't find clip: %s", name);
|
||||||
|
|
||||||
layer = ges_clip_get_layer (GES_CLIP (clip));
|
layer = ges_clip_get_layer (GES_CLIP (clip));
|
||||||
REPORT_UNLESS (layer, beach, "Clip %s not in a layer", name);
|
REPORT_UNLESS (layer, beach, "Clip %s not in a layer", name);
|
||||||
|
@ -466,7 +466,7 @@ GES_START_VALIDATE_ACTION (_commit)
|
||||||
|
|
||||||
bus = gst_pipeline_get_bus (GST_PIPELINE (pipeline));
|
bus = gst_pipeline_get_bus (GST_PIPELINE (pipeline));
|
||||||
|
|
||||||
gst_validate_printf (action, "Commiting timeline %s\n",
|
gst_validate_printf (action, "Committing timeline %s\n",
|
||||||
GST_OBJECT_NAME (timeline));
|
GST_OBJECT_NAME (timeline));
|
||||||
|
|
||||||
g_signal_connect (bus, "message::async-done", G_CALLBACK (_commit_done_cb),
|
g_signal_connect (bus, "message::async-done", G_CALLBACK (_commit_done_cb),
|
||||||
|
@ -515,7 +515,7 @@ typedef struct
|
||||||
GESTimelineElement *element;
|
GESTimelineElement *element;
|
||||||
GstValidateActionReturn res;
|
GstValidateActionReturn res;
|
||||||
GstClockTime time;
|
GstClockTime time;
|
||||||
gboolean check_children;
|
gboolean on_children;
|
||||||
GstValidateAction *action;
|
GstValidateAction *action;
|
||||||
} PropertyData;
|
} PropertyData;
|
||||||
|
|
||||||
|
@ -527,7 +527,7 @@ check_property (GQuark field_id, GValue * expected_value, PropertyData * data)
|
||||||
const gchar *property = g_quark_to_string (field_id);
|
const gchar *property = g_quark_to_string (field_id);
|
||||||
GstControlBinding *binding = NULL;
|
GstControlBinding *binding = NULL;
|
||||||
|
|
||||||
if (!data->check_children) {
|
if (!data->on_children) {
|
||||||
GParamSpec *pspec =
|
GParamSpec *pspec =
|
||||||
g_object_class_find_property (G_OBJECT_GET_CLASS (data->element),
|
g_object_class_find_property (G_OBJECT_GET_CLASS (data->element),
|
||||||
property);
|
property);
|
||||||
|
@ -637,7 +637,9 @@ set_property (GQuark field_id, const GValue * value, PropertyData * data)
|
||||||
{
|
{
|
||||||
const gchar *property = g_quark_to_string (field_id);
|
const gchar *property = g_quark_to_string (field_id);
|
||||||
|
|
||||||
if (!ges_timeline_element_set_child_property (data->element, property, value)) {
|
if (data->on_children) {
|
||||||
|
if (!ges_timeline_element_set_child_property (data->element, property,
|
||||||
|
value)) {
|
||||||
gchar *v = gst_value_serialize (value);
|
gchar *v = gst_value_serialize (value);
|
||||||
|
|
||||||
GST_VALIDATE_REPORT_ACTION (data->scenario, data->action,
|
GST_VALIDATE_REPORT_ACTION (data->scenario, data->action,
|
||||||
|
@ -650,6 +652,11 @@ set_property (GQuark field_id, const GValue * value, PropertyData * data)
|
||||||
|
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
data->res =
|
||||||
|
gst_validate_object_set_property (GST_VALIDATE_REPORTER
|
||||||
|
(data->scenario), G_OBJECT (data->element), property, value, FALSE);
|
||||||
|
}
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
@ -659,16 +666,20 @@ GES_START_VALIDATE_ACTION (set_or_check_properties)
|
||||||
GESTimelineElement *element;
|
GESTimelineElement *element;
|
||||||
GstStructure *structure;
|
GstStructure *structure;
|
||||||
const gchar *element_name;
|
const gchar *element_name;
|
||||||
|
gboolean is_setting = FALSE;
|
||||||
PropertyData data = {
|
PropertyData data = {
|
||||||
.scenario = scenario,
|
.scenario = scenario,
|
||||||
.element = NULL,
|
.element = NULL,
|
||||||
.res = GST_VALIDATE_EXECUTE_ACTION_OK,
|
.res = GST_VALIDATE_EXECUTE_ACTION_OK,
|
||||||
.time = GST_CLOCK_TIME_NONE,
|
.time = GST_CLOCK_TIME_NONE,
|
||||||
.check_children =
|
.on_children =
|
||||||
!gst_structure_has_name (action->structure, "check-ges-properties"),
|
!gst_structure_has_name (action->structure, "check-ges-properties")
|
||||||
|
&& !gst_structure_has_name (action->structure, "set-ges-properties"),
|
||||||
.action = action,
|
.action = action,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
is_setting = gst_structure_has_name (action->structure, "set-ges-properties")
|
||||||
|
|| gst_structure_has_name (action->structure, "set-child-properties");
|
||||||
gst_validate_action_get_clocktime (scenario, action, "at-time", &data.time);
|
gst_validate_action_get_clocktime (scenario, action, "at-time", &data.time);
|
||||||
|
|
||||||
structure = gst_structure_copy (action->structure);
|
structure = gst_structure_copy (action->structure);
|
||||||
|
@ -687,8 +698,7 @@ GES_START_VALIDATE_ACTION (set_or_check_properties)
|
||||||
gst_structure_remove_fields (structure, "element-name", "at-time",
|
gst_structure_remove_fields (structure, "element-name", "at-time",
|
||||||
"project-uri", NULL);
|
"project-uri", NULL);
|
||||||
gst_structure_foreach (structure,
|
gst_structure_foreach (structure,
|
||||||
gst_structure_has_name (action->structure,
|
is_setting ? (GstStructureForeachFunc) set_property
|
||||||
"set-child-properties") ? (GstStructureForeachFunc) set_property
|
|
||||||
: (GstStructureForeachFunc) check_property, &data);
|
: (GstStructureForeachFunc) check_property, &data);
|
||||||
gst_object_unref (element);
|
gst_object_unref (element);
|
||||||
|
|
||||||
|
@ -711,10 +721,10 @@ GES_START_VALIDATE_ACTION (_set_track_restriction_caps)
|
||||||
|
|
||||||
REPORT_UNLESS (track_types =
|
REPORT_UNLESS (track_types =
|
||||||
gst_validate_utils_flags_from_str (GES_TYPE_TRACK_TYPE, track_type_str),
|
gst_validate_utils_flags_from_str (GES_TYPE_TRACK_TYPE, track_type_str),
|
||||||
done, "Invalide track types: %s", track_type_str);
|
done, "Invalid track types: %s", track_type_str);
|
||||||
|
|
||||||
REPORT_UNLESS (caps = gst_caps_from_string (caps_str),
|
REPORT_UNLESS (caps = gst_caps_from_string (caps_str),
|
||||||
done, "Invalide track restriction caps: %s", caps_str);
|
done, "Invalid track restriction caps: %s", caps_str);
|
||||||
|
|
||||||
res = GST_VALIDATE_EXECUTE_ACTION_ERROR;
|
res = GST_VALIDATE_EXECUTE_ACTION_ERROR;
|
||||||
for (tmp = timeline->tracks; tmp; tmp = tmp->next) {
|
for (tmp = timeline->tracks; tmp; tmp = tmp->next) {
|
||||||
|
@ -868,7 +878,7 @@ GES_START_VALIDATE_ACTION (_set_control_source)
|
||||||
REPORT_UNLESS (gst_structure_get (action->structure,
|
REPORT_UNLESS (gst_structure_get (action->structure,
|
||||||
"element-name", G_TYPE_STRING, &element_name,
|
"element-name", G_TYPE_STRING, &element_name,
|
||||||
"property-name", G_TYPE_STRING, &property_name, NULL),
|
"property-name", G_TYPE_STRING, &property_name, NULL),
|
||||||
beach, "Wrong parametters");
|
beach, "Wrong parameters");
|
||||||
|
|
||||||
TRY_GET ("binding-type", G_TYPE_STRING, &binding_type, NULL);
|
TRY_GET ("binding-type", G_TYPE_STRING, &binding_type, NULL);
|
||||||
TRY_GET ("source-type", G_TYPE_STRING, &source_type, NULL);
|
TRY_GET ("source-type", G_TYPE_STRING, &source_type, NULL);
|
||||||
|
@ -984,7 +994,7 @@ GES_START_VALIDATE_ACTION (_load_project)
|
||||||
} else {
|
} else {
|
||||||
uri = g_strdup (gst_structure_get_string (action->structure, "uri"));
|
uri = g_strdup (gst_structure_get_string (action->structure, "uri"));
|
||||||
REPORT_UNLESS (uri, local_done,
|
REPORT_UNLESS (uri, local_done,
|
||||||
"None of 'uri' or 'content' passed as parametter"
|
"None of 'uri' or 'content' passed as parameter"
|
||||||
" can't load any timeline!");
|
" can't load any timeline!");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1204,7 +1214,7 @@ ges_validate_register_action_types (void)
|
||||||
},
|
},
|
||||||
"Allows to edit a container (like a GESClip), for more details, have a look at:\n"
|
"Allows to edit a container (like a GESClip), for more details, have a look at:\n"
|
||||||
"ges_timeline_element_edit documentation, Note that the timeline will\n"
|
"ges_timeline_element_edit documentation, Note that the timeline will\n"
|
||||||
"be commited, and flushed so that the edition is taken into account",
|
"be committed, and flushed so that the edition is taken into account",
|
||||||
GST_VALIDATE_ACTION_TYPE_NONE);
|
GST_VALIDATE_ACTION_TYPE_NONE);
|
||||||
|
|
||||||
gst_validate_register_action_type ("edit", "ges", _edit,
|
gst_validate_register_action_type ("edit", "ges", _edit,
|
||||||
|
@ -1266,7 +1276,7 @@ ges_validate_register_action_types (void)
|
||||||
},
|
},
|
||||||
"Allows to edit a element (like a GESClip), for more details, have a look at:\n"
|
"Allows to edit a element (like a GESClip), for more details, have a look at:\n"
|
||||||
"ges_timeline_element_edit documentation, Note that the timeline will\n"
|
"ges_timeline_element_edit documentation, Note that the timeline will\n"
|
||||||
"be commited, and flushed so that the edition is taken into account",
|
"be committed, and flushed so that the edition is taken into account",
|
||||||
GST_VALIDATE_ACTION_TYPE_NONE);
|
GST_VALIDATE_ACTION_TYPE_NONE);
|
||||||
|
|
||||||
gst_validate_register_action_type ("add-asset", "ges", _add_asset,
|
gst_validate_register_action_type ("add-asset", "ges", _add_asset,
|
||||||
|
@ -1347,7 +1357,7 @@ ges_validate_register_action_types (void)
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
.name = "auto-transition",
|
.name = "auto-transition",
|
||||||
.description = "Wheter auto-transition is activated on the new layer.",
|
.description = "Whether auto-transition is activated on the new layer.",
|
||||||
.mandatory = FALSE,
|
.mandatory = FALSE,
|
||||||
.types="boolean",
|
.types="boolean",
|
||||||
.def = "False"
|
.def = "False"
|
||||||
|
@ -1662,7 +1672,7 @@ ges_validate_register_action_types (void)
|
||||||
},
|
},
|
||||||
{NULL}
|
{NULL}
|
||||||
}, "Add a child to @container-name. If asset-id and child-type are specified,"
|
}, "Add a child to @container-name. If asset-id and child-type are specified,"
|
||||||
" the child will be created and added. Otherwize @child-name has to be specified"
|
" the child will be created and added. Otherwise @child-name has to be specified"
|
||||||
" and will be added to the container.", GST_VALIDATE_ACTION_TYPE_NONE);
|
" and will be added to the container.", GST_VALIDATE_ACTION_TYPE_NONE);
|
||||||
|
|
||||||
gst_validate_register_action_type ("container-remove-child", "ges", _container_remove_child,
|
gst_validate_register_action_type ("container-remove-child", "ges", _container_remove_child,
|
||||||
|
@ -1698,7 +1708,7 @@ ges_validate_register_action_types (void)
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
.name = "recursive",
|
.name = "recursive",
|
||||||
.description = "Wether to recurse ungrouping or not.",
|
.description = "Whether to recurse ungrouping or not.",
|
||||||
.types = "boolean",
|
.types = "boolean",
|
||||||
.mandatory = FALSE,
|
.mandatory = FALSE,
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in a new issue