From 4df812066f4ab37d03ddadc6fa6c369431506a5a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Dzi=C4=99giel?= Date: Sun, 19 Jan 2025 15:45:55 +0100 Subject: [PATCH] clapper: enhancers-loader: Support loading extra enhancers Allow setting an additional dir(s) with "CLAPPER_ENHANCERS_EXTRA_PATH" env. This should allow to add other enhancers without removing default ones. If app/user needs to remove default ones, "CLAPPER_ENHANCERS_PATH" env can be set to empty. --- src/lib/clapper/clapper-enhancers-loader.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/lib/clapper/clapper-enhancers-loader.c b/src/lib/clapper/clapper-enhancers-loader.c index 6c7a26f4..119cb637 100644 --- a/src/lib/clapper/clapper-enhancers-loader.c +++ b/src/lib/clapper/clapper-enhancers-loader.c @@ -84,6 +84,7 @@ clapper_enhancers_loader_initialize (void) peas_engine_enable_loader (_engine, "python"); peas_engine_enable_loader (_engine, "gjs"); +load_enhancers: dir_paths = g_strsplit (enhancers_path, G_SEARCHPATH_SEPARATOR_S, 0); for (i = 0; dir_paths[i]; ++i) @@ -91,6 +92,11 @@ clapper_enhancers_loader_initialize (void) g_strfreev (dir_paths); + /* Support loading additional enhancers from non-default directory */ + enhancers_path = g_getenv ("CLAPPER_ENHANCERS_EXTRA_PATH"); + if (enhancers_path && *enhancers_path != '\0') + goto load_enhancers; + if (gst_debug_category_get_threshold (GST_CAT_DEFAULT) >= GST_LEVEL_INFO) { GListModel *list = (GListModel *) _engine; guint n_items = g_list_model_get_n_items (list);