diff --git a/validate/docs/validate/envvariables.xml b/validate/docs/validate/envvariables.xml index 9904091566..b88f0dfdb9 100644 --- a/validate/docs/validate/envvariables.xml +++ b/validate/docs/validate/envvariables.xml @@ -85,7 +85,8 @@ <envar>GST_VALIDATE_CONFIG</envar> - Set this variable to a colon-separated list of paths to GstValidate config files. + Set this variable to a colon-separated list of paths to GstValidate config files or + directly as a string in the GstCaps serialization format. The config file has a format similar to the scenario file. The name of the configuration corresponds to the name of the plugin the configuration applies to. diff --git a/validate/gst/validate/validate.c b/validate/gst/validate/validate.c index 99bc50237f..309ef0f499 100644 --- a/validate/gst/validate/validate.c +++ b/validate/gst/validate/validate.c @@ -157,6 +157,22 @@ gst_validate_plugin_get_config (GstPlugin * plugin) } g_strfreev (tmp); + if (!plugin_conf) { + GstCaps *confs; + + confs = gst_caps_from_string (config); + + if (confs) { + gint i; + + for (i = 0; i < gst_caps_get_size (confs); i++) + plugin_conf = g_list_append (plugin_conf, + gst_structure_copy (gst_caps_get_structure (confs, i))); + + gst_caps_unref (confs); + } + } + if (plugin) g_object_set_data_full (G_OBJECT (plugin), GST_VALIDATE_PLUGIN_CONFIG, plugin_conf, _free_plugin_config);