mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-19 00:01:23 +00:00
validate: Allow passing a GST_VALIDATE_CONFIG as a string
Instead of forcing user to put it in a file. We are simply using the GstCaps synthax to parse it.
This commit is contained in:
parent
e247122051
commit
1fb0f02d6a
2 changed files with 18 additions and 1 deletions
|
@ -85,7 +85,8 @@
|
|||
<title><envar>GST_VALIDATE_CONFIG</envar></title>
|
||||
|
||||
<para>
|
||||
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.
|
||||
</para>
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue