From d2fb30a188a5988fd6af132d86f3a011eb535c04 Mon Sep 17 00:00:00 2001 From: Xavier Claessens Date: Fri, 1 Dec 2023 08:21:03 -0500 Subject: [PATCH] devenv: Whitelist all plugins to be able to run tests Meson devenv already overrides GST_PLUGIN_PATH and GST_PLUGIN_SYSTEM_PATH so only built plugins can be found. That means unit tests are allowed to use every plugins. This makes easier to run some unit tests under devenv instead of through "meson test". Part-of: --- meson.build | 1 + subprojects/gstreamer/gst/gstplugin.c | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/meson.build b/meson.build index 5b53892b68..5551cb728e 100644 --- a/meson.build +++ b/meson.build @@ -340,6 +340,7 @@ devenv.set('GST_VERSION', meson.project_version()) devenv.set('GST_ENV', 'gst-' + meson.project_version()) devenv.set('GST_REGISTRY', meson.current_build_dir() / 'registry.dat') devenv.set('GST_PLUGIN_SYSTEM_PATH', '') +devenv.set('GST_PLUGIN_LOADING_WHITELIST', '*') meson.add_devenv(devenv) generate_plugins_paths = find_program('scripts/generate_plugins_path.py') diff --git a/subprojects/gstreamer/gst/gstplugin.c b/subprojects/gstreamer/gst/gstplugin.c index 75f9479bf9..669648ccc0 100644 --- a/subprojects/gstreamer/gst/gstplugin.c +++ b/subprojects/gstreamer/gst/gstplugin.c @@ -345,7 +345,8 @@ _priv_gst_plugin_initialize (void) * plugin1,plugin2 or * source-package@pathprefix or * source-package@* or just - * source-package + * source-package or + * * * * ie. the bit before the path will be checked against both the plugin * name and the plugin's source package name, to keep the format simple. @@ -361,6 +362,9 @@ gst_plugin_desc_matches_whitelist_entry (const GstPluginDesc * desc, GST_LOG ("Whitelist pattern '%s', plugin: %s of %s@%s", pattern, desc->name, desc->source, GST_STR_NULL (filename)); + if (strcmp (pattern, "*") == 0) + return TRUE; + /* do we have a path prefix? */ sep = strchr (pattern, '@'); if (sep != NULL && strcmp (sep, "@*") != 0 && strcmp (sep, "@") != 0) {