From 774dbf9346b729b96f628ac93225b694c0cd9e70 Mon Sep 17 00:00:00 2001 From: Thibault Saunier Date: Fri, 6 Mar 2015 11:55:09 +0100 Subject: [PATCH] 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 --- validate/gst/validate/gst-validate-scenario.c | 9 +++++++-- validate/gst/validate/gst-validate-scenario.h | 8 ++++---- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/validate/gst/validate/gst-validate-scenario.c b/validate/gst/validate/gst-validate-scenario.c index 6a60c90269..7ea3e951c5 100644 --- a/validate/gst/validate/gst-validate-scenario.c +++ b/validate/gst/validate/gst-validate-scenario.c @@ -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); diff --git a/validate/gst/validate/gst-validate-scenario.h b/validate/gst/validate/gst-validate-scenario.h index 270d4ff544..f595a82098 100644 --- a/validate/gst/validate/gst-validate-scenario.h +++ b/validate/gst/validate/gst-validate-scenario.h @@ -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