diff --git a/gst/gst.c b/gst/gst.c index 17cbcca53d..f734dc9c76 100644 --- a/gst/gst.c +++ b/gst/gst.c @@ -461,6 +461,7 @@ static gboolean init_pre (GOptionContext * context, GOptionGroup * group, gpointer data, GError ** error) { + gchar *libdir; if (gst_initialized) { GST_DEBUG ("already initialized"); return TRUE; @@ -481,8 +482,24 @@ init_pre (GOptionContext * context, GOptionGroup * group, gpointer data, /* This is the earliest we can make stuff show up in the logs. * So give some useful info about GStreamer here */ +#ifdef G_OS_WIN32 + { + gchar *basedir = g_win32_get_package_installation_directory_of_module (_priv_gst_dll_handle); + + libdir = g_build_filename (basedir, +#ifdef _DEBUG + "debug" +#endif + "lib", + NULL); + g_free (basedir); + } +#else + libdir = g_strdup (LIBDIR); +#endif GST_INFO ("Initializing GStreamer Core Library version %s", VERSION); - GST_INFO ("Using library installed in %s", LIBDIR); + GST_INFO ("Using library installed in %s", libdir); + g_free (libdir); /* Print some basic system details if possible (OS/architecture) */ #ifdef HAVE_SYS_UTSNAME_H diff --git a/gst/gstpluginloader.c b/gst/gstpluginloader.c index 13a8fd5835..9235136746 100644 --- a/gst/gstpluginloader.c +++ b/gst/gstpluginloader.c @@ -33,8 +33,13 @@ #include #include #else +#define WIN32_LEAN_AND_MEAN + #define fsync(fd) _commit(fd) #include + +#include +extern HMODULE _priv_gst_dll_handle; #endif #ifdef HAVE_SYS_UTSNAME_H @@ -470,7 +475,22 @@ gst_plugin_loader_spawn (GstPluginLoader * loader) if (!res) { GST_LOG ("Trying installed plugin scanner"); + +#ifdef G_OS_WIN32 + { + gchar *basedir; + + basedir = g_win32_get_package_installation_directory_of_module (_priv_gst_dll_handle); + helper_bin = g_build_filename (basedir, + "lib", + "gstreamer-" GST_API_VERSION, + "gst-plugin-scanner.exe", + NULL); + g_free (basedir); + } +#else helper_bin = g_strdup (GST_PLUGIN_SCANNER_INSTALLED); +#endif res = gst_plugin_loader_try_helper (loader, helper_bin); g_free (helper_bin); diff --git a/gst/gstpreset.c b/gst/gstpreset.c index 2db8439d99..6f514473eb 100644 --- a/gst/gstpreset.c +++ b/gst/gstpreset.c @@ -78,6 +78,13 @@ #endif #include +#ifdef G_OS_WIN32 +#define WIN32_LEAN_AND_MEAN +#include + +extern HMODULE _priv_gst_dll_handle; +#endif + #define GST_CAT_DEFAULT preset_debug GST_DEBUG_CATEGORY_STATIC (GST_CAT_DEFAULT); @@ -175,8 +182,18 @@ preset_get_paths (GstPreset * preset, const gchar ** preset_user_path, gchar *preset_dir; /* system presets in '$GST_DATADIR/gstreamer-1.0/presets/GstAudioPanorama.prs' */ +#ifdef G_OS_WIN32 + gchar *basedir = g_win32_get_package_installation_directory_of_module (_priv_gst_dll_handle); + preset_dir = g_build_filename (basedir, + "share", + "gstreamer-" GST_API_VERSION, + "presets", + NULL); + g_free (basedir); +#else preset_dir = g_build_filename (GST_DATADIR, "gstreamer-" GST_API_VERSION, "presets", NULL); +#endif GST_INFO_OBJECT (preset, "system_preset_dir: '%s'", preset_dir); preset_path = g_strdup_printf ("%s" G_DIR_SEPARATOR_S "%s.prs", preset_dir, element_name); diff --git a/gst/gstregistry.c b/gst/gstregistry.c index 79014c80d4..0830395add 100644 --- a/gst/gstregistry.c +++ b/gst/gstregistry.c @@ -1593,8 +1593,6 @@ scan_and_update_registry (GstRegistry * default_registry, g_free (home_plugins); /* add the main (installed) library path */ - GST_DEBUG ("scanning main plugins %s", PLUGINDIR); - changed |= gst_registry_scan_path_internal (&context, PLUGINDIR); #ifdef G_OS_WIN32 { @@ -1606,8 +1604,13 @@ scan_and_update_registry (GstRegistry * default_registry, (_priv_gst_dll_handle); dir = - g_build_filename (base_dir, "lib", "gstreamer-" GST_API_VERSION, - NULL); + g_build_filename (base_dir, +#ifdef _DEBUG + "debug" +#endif + "lib", + "gstreamer-" GST_API_VERSION, + NULL); GST_DEBUG ("scanning DLL dir %s", dir); changed |= gst_registry_scan_path_internal (&context, dir); @@ -1615,6 +1618,9 @@ scan_and_update_registry (GstRegistry * default_registry, g_free (dir); g_free (base_dir); } +#else + GST_DEBUG ("scanning main plugins %s", PLUGINDIR); + changed |= gst_registry_scan_path_internal (&context, PLUGINDIR); #endif } else { gchar **list;