From 4927c657107dd23405456a703bb23173ab60f27d Mon Sep 17 00:00:00 2001 From: Guillaume Desmottes Date: Fri, 8 May 2015 16:33:50 +0200 Subject: [PATCH] validate: disable QOS features when running with valgrind Reviewers: thiblahute Differential Revision: http://phabricator.freedesktop.org/D156 --- validate/data/Makefile.am | 4 +++ validate/data/valgrind.config | 1 + .../gst/validate/gst-validate-element-monitor.c | 38 ++++++++++++++++++++++ validate/launcher/baseclasses.py | 10 ++++++ 4 files changed, 53 insertions(+) create mode 100644 validate/data/valgrind.config diff --git a/validate/data/Makefile.am b/validate/data/Makefile.am index 44ba117..d3709bc 100644 --- a/validate/data/Makefile.am +++ b/validate/data/Makefile.am @@ -1 +1,5 @@ SUBDIRS = scenarios + +configdir=${datadir}/gstreamer-$(GST_API_VERSION)/validate/ +config_DATA = \ + valgrind.config diff --git a/validate/data/valgrind.config b/validate/data/valgrind.config new file mode 100644 index 0000000..bcccdd2 --- /dev/null +++ b/validate/data/valgrind.config @@ -0,0 +1 @@ +core, action=set-property, target-element-klass=Filter, property-name=qos, property-value=false diff --git a/validate/gst/validate/gst-validate-element-monitor.c b/validate/gst/validate/gst-validate-element-monitor.c index e8b078f..7d9f945 100644 --- a/validate/gst/validate/gst-validate-element-monitor.c +++ b/validate/gst/validate/gst-validate-element-monitor.c @@ -29,6 +29,8 @@ #include "gst-validate-element-monitor.h" #include "gst-validate-pad-monitor.h" #include "gst-validate-monitor-factory.h" +#include "gst-validate-utils.h" +#include "validate.h" #include /** @@ -186,6 +188,39 @@ gst_validate_element_monitor_inspect (GstValidateElementMonitor * monitor) GST_ERROR_OBJECT (element, "no klassname"); } +static void +set_config_properties (GstValidateMonitor * monitor, GstElement * element) +{ + GList *config, *l; + + config = gst_validate_plugin_get_config (NULL); + for (l = config; l != NULL; l = g_list_next (l)) { + GstStructure *s = l->data; + const gchar *klass; + const gchar *prop_name; + const GValue *prop_value; + + if (g_strcmp0 (gst_structure_get_string (s, "action"), "set-property") != 0) + continue; + + klass = gst_structure_get_string (s, "target-element-klass"); + if (klass && !gst_validate_element_has_klass (element, klass)) + continue; + + prop_name = gst_structure_get_string (s, "property-name"); + if (!prop_name + || !g_object_class_find_property (G_OBJECT_GET_CLASS (element), + prop_name)) + continue; + + prop_value = gst_structure_get_value (s, "property-value"); + if (!prop_value) + continue; + + g_object_set_property (G_OBJECT (element), prop_name, prop_value); + } +} + static gboolean gst_validate_element_monitor_do_setup (GstValidateMonitor * monitor) { @@ -244,6 +279,9 @@ gst_validate_element_monitor_do_setup (GstValidateMonitor * monitor) } } gst_iterator_free (iterator); + + set_config_properties (monitor, element); + return TRUE; } diff --git a/validate/launcher/baseclasses.py b/validate/launcher/baseclasses.py index 6591de3..f7bc670 100644 --- a/validate/launcher/baseclasses.py +++ b/validate/launcher/baseclasses.py @@ -323,6 +323,16 @@ class Test(Loggable): self.hard_timeout *= VALGRIND_TIMEOUT_FACTOR self.timeout *= VALGRIND_TIMEOUT_FACTOR + # Enable 'valgrind.config' + vg_config = get_data_file('data', 'valgrind.config') + + if self.proc_env.get('GST_VALIDATE_CONFIG'): + self.proc_env['GST_VALIDATE_CONFIG'] = '%s%s%s' % (self.proc_env['GST_VALIDATE_CONFIG'], os.pathsep, vg_config) + else: + self.proc_env['GST_VALIDATE_CONFIG'] = vg_config + + self.add_env_variable('GST_VALIDATE_CONFIG', self.proc_env['GST_VALIDATE_CONFIG']) + def test_start(self, queue): self.open_logfile() -- 2.7.4