validate: disable QOS features when running with valgrind

Reviewers: thiblahute

Differential Revision: http://phabricator.freedesktop.org/D156
This commit is contained in:
Guillaume Desmottes 2015-05-08 16:33:50 +02:00 committed by Thibault Saunier
parent b54a22c9bc
commit 4927c65710
4 changed files with 53 additions and 0 deletions

View file

@ -1 +1,5 @@
SUBDIRS = scenarios
configdir=${datadir}/gstreamer-$(GST_API_VERSION)/validate/
config_DATA = \
valgrind.config

View file

@ -0,0 +1 @@
core, action=set-property, target-element-klass=Filter, property-name=qos, property-value=false

View file

@ -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 <string.h>
/**
@ -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;
}

View file

@ -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()