validate:scenario: Report disabling plugin issues

Summary:
+ typedef GstValidateActionReturn so it can be used in the introspection
+ Add GST_VALIDATE_EXECUTE_ACTION_ERROR_REPORTED which should be used
  to tell Validate that something wrong happened so the sub action
  won't be executed, but that it should not report an error itself
  as it has already been handled in the action function.

Reviewers: Mathieu_Du

Differential Revision: http://phabricator.freedesktop.org/D81
This commit is contained in:
Thibault Saunier 2015-03-06 11:55:09 +01:00
parent 69ca5c69cc
commit 774dbf9346
2 changed files with 11 additions and 6 deletions

View file

@ -1099,6 +1099,7 @@ _fill_action (GstValidateScenario * scenario, GstValidateAction * action,
if (IS_CONFIG_ACTION_TYPE (action_type->flags) ||
(gst_structure_get_boolean (action->structure, "as-config",
&is_config) && is_config == TRUE)) {
gst_validate_print_action (action, NULL);
res = action_type->execute (scenario, action);
@ -1594,8 +1595,12 @@ _execute_disable_plugin (GstValidateScenario * scenario,
plugin = gst_registry_find_plugin (gst_registry_get (), plugin_name);
if (plugin == NULL)
return GST_VALIDATE_EXECUTE_ACTION_ERROR;
if (plugin == NULL) {
GST_VALIDATE_REPORT (action->scenario, SCENARIO_ACTION_EXECUTION_ERROR,
"Could not find plugin to disable: %s", plugin_name);
return GST_VALIDATE_EXECUTE_ACTION_ERROR_REPORTED;
}
gst_registry_remove_plugin (gst_registry_get (), plugin);

View file

@ -42,14 +42,14 @@ typedef struct _GstValidateActionParameter GstValidateActionParameter;
GST_EXPORT GType _gst_validate_action_type;
enum
typedef enum
{
GST_VALIDATE_EXECUTE_ACTION_ERROR,
GST_VALIDATE_EXECUTE_ACTION_OK,
GST_VALIDATE_EXECUTE_ACTION_ASYNC,
GST_VALIDATE_EXECUTE_ACTION_INTERLACED
};
GST_VALIDATE_EXECUTE_ACTION_INTERLACED,
GST_VALIDATE_EXECUTE_ACTION_ERROR_REPORTED
} GstValidateActionReturn;
/* TODO 2.0 -- Make it an actual enum type */
#define GstValidateExecuteActionReturn gint