validate:scenario: Allow not config action to be executed from config files

When those are special cased to support that, such as the `set-property`
action.

This special handling was added in

  4927c65710
  validate: disable QOS features when running with valgrind

before we started to support executing arbitrary config action from
configuration files.
This commit is contained in:
Thibault Saunier 2017-07-19 10:52:40 -04:00
parent b3134e89d9
commit 1d568ff11f
2 changed files with 12 additions and 1 deletions

View file

@ -4260,7 +4260,8 @@ init_scenarios (void)
"Besides property-name and value, either 'target-element-name' or\n"
"'target-element-klass' needs to be defined",
GST_VALIDATE_ACTION_TYPE_CAN_EXECUTE_ON_ADDITION |
GST_VALIDATE_ACTION_TYPE_CAN_BE_OPTIONAL);
GST_VALIDATE_ACTION_TYPE_CAN_BE_OPTIONAL |
GST_VALIDATE_ACTION_TYPE_HANDLED_IN_CONFIG);
REGISTER_ACTION_TYPE ("set-debug-threshold",
_execute_set_debug_threshold,
@ -4335,6 +4336,13 @@ init_scenarios (void)
continue;
}
if (atype->flags & GST_VALIDATE_ACTION_TYPE_HANDLED_IN_CONFIG) {
GST_INFO ("Action type %s from configuration files"
" is handled.", action_typename);
continue;
}
if (!(atype->flags & GST_VALIDATE_ACTION_TYPE_CONFIG) &&
!(_action_type_has_parameter (atype, "as-config"))) {
g_error ("[CONFIG ERROR] Action '%s' is not a config action",

View file

@ -140,6 +140,8 @@ GType gst_validate_action_get_type (void);
* @GST_VALIDATE_ACTION_TYPE_CAN_BE_OPTIONAL: The action can use the 'optional' keyword. Such action
* instances will have the #GST_VALIDATE_ACTION_TYPE_NO_EXECUTION_NOT_FATAL
* flag set and won't be considered as fatal if they fail.
* @GST_VALIDATE_ACTION_TYPE_HANDLED_IN_CONFIG: The action can be used in config files even if it is not strictly a config
* action (ie. it needs a scenario to run).
*/
typedef enum
{
@ -152,6 +154,7 @@ typedef enum
GST_VALIDATE_ACTION_TYPE_NO_EXECUTION_NOT_FATAL = 1 << 6,
GST_VALIDATE_ACTION_TYPE_CAN_BE_OPTIONAL = 1 << 7,
GST_VALIDATE_ACTION_TYPE_DOESNT_NEED_PIPELINE = 1 << 8,
GST_VALIDATE_ACTION_TYPE_HANDLED_IN_CONFIG = 1 << 9,
} GstValidateActionTypeFlags;
/**