diff --git a/acconfig.h b/acconfig.h index 362458552b..8cd8d8fbd9 100644 --- a/acconfig.h +++ b/acconfig.h @@ -2,6 +2,8 @@ #undef PLUGINS_SRCDIR #undef PLUGINS_USE_SRCDIR +#undef GST_CONFIG_DIR + #undef HAVE_CPU_I386 #undef HAVE_CPU_PPC diff --git a/configure.in b/configure.in index 61492038cf..3a7550d001 100644 --- a/configure.in +++ b/configure.in @@ -408,6 +408,17 @@ AC_ARG_ENABLE(profiling, esac], [USE_PROFILING=no]) dnl Default value +dnl Default value +GST_CONFIG_DIR="/etc/gstreamer" +AC_ARG_WITH(configdir, +[ --with-configdir specify path to use for configdir], +[case "${withval}" in + yes) AC_MSG_ERROR(bad value ${withval} for --with-configdir) ;; + no) AC_MSG_ERROR(bad value ${withval} for --with-configdir) ;; + *) GST_CONFIG_DIR="${withval}" ;; +esac], +[:]) dnl Default value + dnl ################################################ dnl # Set defines according to variables set above # @@ -493,6 +504,11 @@ dnl ############################ dnl # Set up some more defines # dnl ############################ +dnl Set location of configuration dir. +GST_CONFIG_DIR="/etc/gstreamer" +AC_DEFINE_UNQUOTED(GST_CONFIG_DIR,"$GST_CONFIG_DIR") +AC_SUBST(GST_CONFIG_DIR) + dnl Set location of plugin directory if test "x${prefix}" = "xNONE"; then PLUGINS_DIR=${ac_default_prefix}/lib/gst @@ -509,7 +525,6 @@ AC_SUBST(PLUGINS_SRCDIR) - dnl ############################## dnl # Set up the defaults cflags # dnl ############################## diff --git a/docs/manual/factories.sgml b/docs/manual/factories.sgml index cba70f3491..b35b11b621 100644 --- a/docs/manual/factories.sgml +++ b/docs/manual/factories.sgml @@ -27,8 +27,8 @@ - While this mechanism is quite effective it also has one big problems: - The elements are created base on their name. Indeed, we create an + While this mechanism is quite effective it also has some big problems: + The elements are created based on their name. Indeed, we create an element mpg123 by explicitly stating the mpg123 elements name. Our little program therefore always uses the mpg123 decoder element to decode the MP3 audio stream, even if there are 3 other MP3 decoders diff --git a/gst/gstplugin.c b/gst/gstplugin.c index c0d32c034d..2dfef45675 100644 --- a/gst/gstplugin.c +++ b/gst/gstplugin.c @@ -25,14 +25,11 @@ #include #include -//#define GST_DEBUG_ENABLED #include "gst_private.h" - #include "gstplugin.h" +#include "config.h" -//#undef PLUGINS_USE_SRCDIR - /* list of loaded modules and its sequence number */ GList *_gst_modules; gint _gst_modules_seqno; @@ -77,12 +74,12 @@ _gst_plugin_initialize (void) PLUGINS_SRCDIR "/gst/elements"); _gst_plugin_paths = g_list_prepend (_gst_plugin_paths, PLUGINS_SRCDIR "/gst/types"); -#else +#else /* PLUGINS_USE_SRCDIR */ /* add the main (installed) library path */ _gst_plugin_paths = g_list_prepend (_gst_plugin_paths, PLUGINS_DIR); #endif /* PLUGINS_USE_SRCDIR */ - doc = xmlParseFile ("/etc/gstreamer/reg.xml"); + doc = xmlParseFile (GST_CONFIG_DIR"/reg.xml"); if (!doc || strcmp (doc->root->name, "GST-PluginRegistry")) { g_warning ("gstplugin: registry needs rebuild\n"); diff --git a/tools/gstreamer-register.c b/tools/gstreamer-register.c index e3097f59fa..3ddc0cf99b 100644 --- a/tools/gstreamer-register.c +++ b/tools/gstreamer-register.c @@ -31,9 +31,11 @@ #include #include -#define GST_CONFIG_DIR "/etc/gstreamer" -#define GLOBAL_REGISTRY_FILE GST_CONFIG_DIR"/reg.xml" -#define GLOBAL_REGISTRY_FILE_TMP GST_CONFIG_DIR"/.reg.xml.tmp" +#include "config.h" + +#define GLOBAL_REGISTRY_DIR GST_CONFIG_DIR +#define GLOBAL_REGISTRY_FILE GLOBAL_REGISTRY_DIR"/reg.xml" +#define GLOBAL_REGISTRY_FILE_TMP GLOBAL_REGISTRY_DIR"/.reg.xml.tmp" extern gboolean _gst_plugin_spew; @@ -102,7 +104,7 @@ int main(int argc,char *argv[]) if (argc != 1) usage(argv[0]); // Check that directory for config exists - check_dir(GST_CONFIG_DIR); + check_dir(GLOBAL_REGISTRY_DIR); // Read the plugins _gst_plugin_spew = TRUE;