init_pre (GOptionContext * context, GOptionGroup * group, gpointer data,
GError ** error)
{
+ gchar *libdir;
if (gst_initialized) {
GST_DEBUG ("already initialized");
return TRUE;
/* 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
#include <fcntl.h>
#include <unistd.h>
#else
+#define WIN32_LEAN_AND_MEAN
+
#define fsync(fd) _commit(fd)
#include <io.h>
+
+#include <windows.h>
+extern HMODULE _priv_gst_dll_handle;
#endif
#ifdef HAVE_SYS_UTSNAME_H
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);
#endif
#include <glib/gstdio.h>
+#ifdef G_OS_WIN32
+#define WIN32_LEAN_AND_MEAN
+#include <windows.h>
+
+extern HMODULE _priv_gst_dll_handle;
+#endif
+
#define GST_CAT_DEFAULT preset_debug
GST_DEBUG_CATEGORY_STATIC (GST_CAT_DEFAULT);
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);
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
{
(_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);
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;