validate: Add a way to force monitoring all pipelines in a .validatetest file

See documentation for more details

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7700>
This commit is contained in:
Thibault Saunier 2024-08-20 10:45:50 -04:00 committed by GStreamer Marge Bot
parent 302797a965
commit 56000b91b7
3 changed files with 28 additions and 1 deletions

View file

@ -56,6 +56,7 @@ G_GNUC_INTERNAL gchar** gst_validate_scenario_get_include_paths(const gchar* rel
G_GNUC_INTERNAL void _priv_validate_override_registry_deinit(void);
G_GNUC_INTERNAL GstValidateReportingDetails gst_validate_runner_get_default_reporting_details (GstValidateRunner *runner);
G_GNUC_INTERNAL void gst_validate_runner_set_monitor_all_pipelines (GstValidateRunner *runner, gboolean monitor_all_pipelines);
#define GST_VALIDATE_VALIDATE_TEST_SUFFIX ".validatetest"
G_GNUC_INTERNAL GstValidateMonitor * gst_validate_get_monitor (GObject *object);

View file

@ -96,6 +96,8 @@ struct _GstValidateRunnerPrivate
gchar **pipeline_names_strv;
GList *expected_issues;
gboolean monitor_all_pipelines;
};
/* Describes the reporting level to apply to a name pattern */
@ -154,6 +156,10 @@ gst_validate_runner_should_monitor (GstValidateRunner * self,
return FALSE;
}
if (self->priv->monitor_all_pipelines) {
return TRUE;
}
if (self->priv->user_created)
return FALSE;
@ -975,6 +981,15 @@ gst_validate_runner_get_default_reporting_details (GstValidateRunner * runner)
return runner->priv->default_level;
}
void
gst_validate_runner_set_monitor_all_pipelines (GstValidateRunner * runner,
gboolean monitor_all_pipelines)
{
g_return_if_fail (GST_IS_VALIDATE_RUNNER (runner));
runner->priv->monitor_all_pipelines = monitor_all_pipelines;
}
#ifdef __GST_VALIDATE_PLUGIN
static gboolean
plugin_init (GstPlugin * plugin)

View file

@ -194,7 +194,6 @@ typedef struct
struct _GstValidateScenarioPrivate
{
GstBus *bus;
GstValidateRunner *runner;
gboolean execute_on_idle;
GMutex lock;
@ -5490,6 +5489,18 @@ gst_validate_scenario_load_structures (GstValidateScenario * scenario,
&priv->max_latency);
gst_structure_get_int (structure, "max-dropped", &priv->max_dropped);
gboolean monitor_all_pipelines = FALSE;
if (gst_structure_get_boolean (structure, "monitor-all-pipelines",
&monitor_all_pipelines) && monitor_all_pipelines) {
GstValidateRunner *runner =
gst_validate_reporter_get_runner (GST_VALIDATE_REPORTER (scenario));
g_assert (runner);
gst_validate_runner_set_monitor_all_pipelines (runner, TRUE);
gst_object_unref (runner);
}
scenario->description = gst_structure_copy (structure);
continue;