* application specific directory and in the users home directory. When getting
* a list of presets individual presets are read and overlaid in 1) system,
* 2) application and 3) user order. Whenever an earlier entry is newer, the
- * later entries will be updated.
- *
+ * later entries will be updated. Since 1.8 you can also provide extra paths
+ * where to find presets through the GST_PRESET_PATH environment variable.
+ * Presets found in those paths will be concidered as "app presets".
*/
/* FIXME:
* - non racyness
gboolean merged = FALSE;
GKeyFile *in_user, *in_app = NULL, *in_system;
- preset_get_paths (preset, &preset_user_path, &preset_app_path,
- &preset_system_path);
+ const gchar *envvar;
/* try to load the user, app and system presets, we do this to get the
* versions of all files. */
- in_user = preset_open_and_parse_header (preset, preset_user_path,
- &version_user);
+ envvar = g_getenv ("GST_PRESET_PATH");
+ if (envvar) {
+ gint i;
+ gchar **preset_dirs = g_strsplit (envvar, G_SEARCHPATH_SEPARATOR_S, -1);
+
+ for (i = 0; preset_dirs[i]; i++) {
+ gchar *preset_path = g_strdup_printf ("%s" G_DIR_SEPARATOR_S "%s.prs",
+ preset_dirs[i], G_OBJECT_TYPE_NAME (preset));
+
+ in_user = preset_open_and_parse_header (preset, preset_path,
+ &version_user);
+ g_free (preset_path);
+ if (in_user)
+ break;
+ }
+ g_strfreev (preset_dirs);
+ }
+
+ preset_get_paths (preset, &preset_user_path, &preset_app_path,
+ &preset_system_path);
+ if (!in_user) {
+ in_user = preset_open_and_parse_header (preset, preset_user_path,
+ &version_user);
+ }
+
if (preset_app_path) {
in_app = preset_open_and_parse_header (preset, preset_app_path,
&version_app);
:$GST/gst-editing-services/plugins/nle/.libs\
${GST_PLUGIN_PATH:+:$GST_PLUGIN_PATH}"
+export GST_PRESET_PATH="\
+$GST/gst-plugins-good/gst/equalizer/\
+:$GST/gst-plugins-good/gst/equalizer\
+:$GST/gst-plugins-good/ext/vpx/\
+:$GST/gst-plugins-ugly/ext/x264\
+:$GST/gst-plugins-ugly/ext/amrnb\
+:$GST/gst-plugins-bad/gst/freeverb\
+:$GST/gst-plugins-bad/ext/voamrwbenc\
+${GST_PRESET_PATH:+:$GST_PRESET_PATH}"
+
# don't use any system-installed plug-ins at all
export GST_PLUGIN_SYSTEM_PATH=
# set our registry somewhere else so we don't mess up the registry generated