mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-04-26 06:54:49 +00:00
validate:scenario: Update Action.repeat field when needed
Summary: And print the current repeat value of the action that have such a field Reviewers: Mathieu_Du Differential Revision: http://phabricator.freedesktop.org/D73
This commit is contained in:
parent
1e6b188d78
commit
0159c96ab0
3 changed files with 29 additions and 7 deletions
|
@ -41,6 +41,7 @@ void init_scenarios (void);
|
||||||
/* FIXME 2.0 Remove that as this is only for backward compatibility
|
/* FIXME 2.0 Remove that as this is only for backward compatibility
|
||||||
* as we used to have to print actions in the action execution function
|
* as we used to have to print actions in the action execution function
|
||||||
* and this is done by the scenario itself now */
|
* and this is done by the scenario itself now */
|
||||||
gboolean _action_check_and_set_printed (GstValidateAction *action);
|
GST_EXPORT gboolean _action_check_and_set_printed (GstValidateAction *action);
|
||||||
|
GST_EXPORT gboolean gst_validate_action_is_subaction (GstValidateAction *action);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -579,7 +579,18 @@ gst_validate_print_action (GstValidateAction * action, const gchar * message)
|
||||||
GString *string = NULL;
|
GString *string = NULL;
|
||||||
|
|
||||||
if (message == NULL) {
|
if (message == NULL) {
|
||||||
string = g_string_new (gst_structure_get_name (action->structure));
|
gint nrepeats;
|
||||||
|
|
||||||
|
string = g_string_new (NULL);
|
||||||
|
|
||||||
|
if (gst_validate_action_is_subaction (action))
|
||||||
|
g_string_append_printf (string, "(subaction)");
|
||||||
|
|
||||||
|
if (gst_structure_get_int (action->structure, "repeat", &nrepeats))
|
||||||
|
g_string_append_printf (string, "(%d/%d)", action->repeat, nrepeats);
|
||||||
|
|
||||||
|
g_string_append_printf (string, " %s",
|
||||||
|
gst_structure_get_name (action->structure));
|
||||||
|
|
||||||
g_string_append_len (string, ": ", 2);
|
g_string_append_len (string, ": ", 2);
|
||||||
gst_structure_foreach (action->structure,
|
gst_structure_foreach (action->structure,
|
||||||
|
|
|
@ -268,6 +268,13 @@ _action_check_and_set_printed (GstValidateAction * action)
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
gboolean
|
||||||
|
gst_validate_action_is_subaction (GstValidateAction * action)
|
||||||
|
{
|
||||||
|
return !gst_structure_is_equal (action->structure,
|
||||||
|
action->priv->main_structure);
|
||||||
|
}
|
||||||
|
|
||||||
/* GstValidateActionType implementation */
|
/* GstValidateActionType implementation */
|
||||||
GType _gst_validate_action_type_type;
|
GType _gst_validate_action_type_type;
|
||||||
GST_DEFINE_MINI_OBJECT_TYPE (GstValidateActionType, gst_validate_action_type);
|
GST_DEFINE_MINI_OBJECT_TYPE (GstValidateActionType, gst_validate_action_type);
|
||||||
|
@ -1316,14 +1323,17 @@ execute_next_action (GstValidateScenario * scenario)
|
||||||
SCENARIO_ACTION_EXECUTION_ERROR, "Could not execute %s", str);
|
SCENARIO_ACTION_EXECUTION_ERROR, "Could not execute %s", str);
|
||||||
|
|
||||||
g_free (str);
|
g_free (str);
|
||||||
} else if (act->priv->state == GST_VALIDATE_EXECUTE_ACTION_OK) {
|
}
|
||||||
|
|
||||||
|
if (act->repeat > 0 && !gst_validate_action_is_subaction (act)) {
|
||||||
|
act->repeat--;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (act->priv->state == GST_VALIDATE_EXECUTE_ACTION_OK) {
|
||||||
act->priv->state = _execute_sub_action_action (act);
|
act->priv->state = _execute_sub_action_action (act);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (act->repeat > 0 && gst_structure_is_equal (act->structure,
|
if (act->priv->state != GST_VALIDATE_EXECUTE_ACTION_ASYNC) {
|
||||||
act->priv->main_structure)) {
|
|
||||||
act->repeat--;
|
|
||||||
} else if (act->priv->state != GST_VALIDATE_EXECUTE_ACTION_ASYNC) {
|
|
||||||
tmp = priv->actions;
|
tmp = priv->actions;
|
||||||
priv->actions = g_list_remove_link (priv->actions, tmp);
|
priv->actions = g_list_remove_link (priv->actions, tmp);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue