mirror of
https://github.com/Rafostar/clapper.git
synced 2025-08-30 07:42:23 +02:00
gst-plugin: Allow overriding importers path with env variable
This commit is contained in:
@@ -115,11 +115,14 @@ _obtain_available_modules_once (G_GNUC_UNUSED gpointer data)
|
|||||||
GFile *dir;
|
GFile *dir;
|
||||||
GFileEnumerator *dir_enum;
|
GFileEnumerator *dir_enum;
|
||||||
GError *error = NULL;
|
GError *error = NULL;
|
||||||
|
const gchar *imp_path, *env_path = g_getenv ("CLAPPER_SINK_IMPORTER_PATH");
|
||||||
|
|
||||||
GST_INFO ("Preparing modules");
|
GST_INFO ("Preparing modules");
|
||||||
|
|
||||||
modules = g_ptr_array_new ();
|
modules = g_ptr_array_new ();
|
||||||
dir = g_file_new_for_path (CLAPPER_SINK_IMPORTER_PATH);
|
|
||||||
|
imp_path = (env_path && env_path[0]) ? env_path : CLAPPER_SINK_IMPORTER_PATH;
|
||||||
|
dir = g_file_new_for_path (imp_path);
|
||||||
|
|
||||||
if ((dir_enum = g_file_enumerate_children (dir,
|
if ((dir_enum = g_file_enumerate_children (dir,
|
||||||
G_FILE_ATTRIBUTE_STANDARD_NAME,
|
G_FILE_ATTRIBUTE_STANDARD_NAME,
|
||||||
@@ -139,7 +142,7 @@ _obtain_available_modules_once (G_GNUC_UNUSED gpointer data)
|
|||||||
if (!g_str_has_suffix (module_name, G_MODULE_SUFFIX))
|
if (!g_str_has_suffix (module_name, G_MODULE_SUFFIX))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
module_path = g_module_build_path (CLAPPER_SINK_IMPORTER_PATH, module_name);
|
module_path = g_module_build_path (imp_path, module_name);
|
||||||
module = g_module_open (module_path, G_MODULE_BIND_LAZY);
|
module = g_module_open (module_path, G_MODULE_BIND_LAZY);
|
||||||
g_free (module_path);
|
g_free (module_path);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user