summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilippe Normand <pnormand@igalia.com>2011-04-29 13:43:07 +0200
committerSebastian Dröge <sebastian.droege@collabora.co.uk>2011-05-03 09:43:22 +0200
commit4e36f93924cf984d7ff1ab28e290ab9893464ad2 (patch)
tree088a83e9263969e5bd28a9882acfc7b8c24d917e
parent5fe9bcd989cdfb4d540baab90cad32c5b4873752 (diff)
core: store presets, registry and plugins in XDG directories.
Presets and plugins moved to $XDG_DATA_HOME/gstreamer-0.11/ root directory. Registry moved to $XDG_CACHE_HOME/gstreamer-0.11/. Fixes bug #518597.
-rw-r--r--docs/random/porting-to-0.11.txt5
-rw-r--r--gst/gstpreset.c6
-rw-r--r--gst/gstregistry.c9
-rw-r--r--tests/check/gst/gstpreset.c10
4 files changed, 18 insertions, 12 deletions
diff --git a/docs/random/porting-to-0.11.txt b/docs/random/porting-to-0.11.txt
index f67f90f8a..7401d2c6f 100644
--- a/docs/random/porting-to-0.11.txt
+++ b/docs/random/porting-to-0.11.txt
@@ -12,6 +12,11 @@ The 0.11 porting guide
* multifdsink, tcpclientsink, tcpclientsrc, tcpserversrc the protocol property
is removed, use gdppay and gdpdepay.
+* Presets and plugins moved to $XDG_DATA_HOME/gstreamer-0.11/ root
+ directory. Registry moved to $XDG_CACHE_HOME/gstreamer-0.11/.
+ XDG_CACHE_HOME usually points to $HOME/.cache and XDG_DATA_HOME
+ usually is $HOME/.local/share/.
+
* GstObject:
GST_OBJECT_DISPOSING flag removed
GST_OBJECT_IS_DISPOSING removed
diff --git a/gst/gstpreset.c b/gst/gstpreset.c
index d56606573..99a5755f4 100644
--- a/gst/gstpreset.c
+++ b/gst/gstpreset.c
@@ -141,9 +141,9 @@ preset_get_paths (GstPreset * preset, const gchar ** preset_user_path,
if (!(preset_path = g_type_get_qdata (type, preset_user_path_quark))) {
gchar *preset_dir;
- /* user presets go in '$HOME/.gstreamer-0.10/presets/GstSimSyn.prs' */
- preset_dir = g_build_filename (g_get_home_dir (),
- ".gstreamer-" GST_MAJORMINOR, "presets", NULL);
+ /* user presets go in user's XDG data directory. */
+ preset_dir = g_build_filename (g_get_user_data_dir (),
+ "gstreamer-" GST_MAJORMINOR, "presets", NULL);
GST_INFO_OBJECT (preset, "user_preset_dir: '%s'", preset_dir);
preset_path =
g_strdup_printf ("%s" G_DIR_SEPARATOR_S "%s.prs", preset_dir,
diff --git a/gst/gstregistry.c b/gst/gstregistry.c
index 5b6df92f3..96cb41511 100644
--- a/gst/gstregistry.c
+++ b/gst/gstregistry.c
@@ -1509,8 +1509,9 @@ scan_and_update_registry (GstRegistry * default_registry,
/* plugins in the user's home directory take precedence over
* system-installed ones */
- home_plugins = g_build_filename (g_get_home_dir (),
- ".gstreamer-" GST_MAJORMINOR, "plugins", NULL);
+ home_plugins = g_build_filename (g_get_user_data_dir (),
+ "gstreamer-" GST_MAJORMINOR, "plugins", NULL);
+
GST_DEBUG ("scanning home plugins %s", home_plugins);
changed |= gst_registry_scan_path_internal (&context, home_plugins);
g_free (home_plugins);
@@ -1589,8 +1590,8 @@ ensure_current_registry (GError ** error)
default_registry = gst_registry_get_default ();
registry_file = g_strdup (g_getenv ("GST_REGISTRY"));
if (registry_file == NULL) {
- registry_file = g_build_filename (g_get_home_dir (),
- ".gstreamer-" GST_MAJORMINOR, "registry." HOST_CPU ".bin", NULL);
+ registry_file = g_build_filename (g_get_user_cache_dir (),
+ "gstreamer-" GST_MAJORMINOR, "registry." HOST_CPU ".bin", NULL);
}
if (!_gst_disable_registry_cache) {
diff --git a/tests/check/gst/gstpreset.c b/tests/check/gst/gstpreset.c
index 02d5bb770..3e624a025 100644
--- a/tests/check/gst/gstpreset.c
+++ b/tests/check/gst/gstpreset.c
@@ -248,8 +248,8 @@ remove_preset_file (void)
{
gchar *preset_file_name;
- preset_file_name = g_build_filename (g_get_home_dir (),
- ".gstreamer-" GST_MAJORMINOR, "presets", "GstPresetTest.prs", NULL);
+ preset_file_name = g_build_filename (g_get_user_data_dir (),
+ "gstreamer-" GST_MAJORMINOR, "presets", "GstPresetTest.prs", NULL);
g_unlink (preset_file_name);
g_free (preset_file_name);
}
@@ -281,9 +281,9 @@ gst_preset_suite (void)
gchar *gst_dir;
gboolean can_write = FALSE;
- /* cehck if we can create presets */
- gst_dir = g_build_filename (g_get_home_dir (),
- ".gstreamer-" GST_MAJORMINOR, NULL);
+ /* check if we can create presets */
+ gst_dir = g_build_filename (g_get_user_data_dir (),
+ "gstreamer-" GST_MAJORMINOR, NULL);
can_write = (g_access (gst_dir, R_OK | W_OK | X_OK) == 0);
g_free (gst_dir);