validate:scenario: Allow not config action to be executed from config files
authorThibault Saunier <thibault.saunier@osg.samsung.com>
Wed, 19 Jul 2017 14:52:40 +0000 (10:52 -0400)
committerThibault Saunier <thibault.saunier@osg.samsung.com>
Wed, 19 Jul 2017 15:34:12 +0000 (11:34 -0400)
When those are special cased to support that, such as the `set-property`
action.

This special handling was added in

  4927c657107dd23405456a703bb23173ab60f27d
  validate: disable QOS features when running with valgrind

before we started to support executing arbitrary config action from
configuration files.

validate/gst/validate/gst-validate-scenario.c
validate/gst/validate/gst-validate-scenario.h

index f7a1ade..ff5da7e 100644 (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",
index d4e4688..68249fe 100644 (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;
 
 /**