mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-03-30 12:49:40 +00:00
validate: Fix build on windows
Check where libgstvalidate.dll is installed and use that base folder to figure out where GstValidate plugins are installed
This commit is contained in:
parent
62a0db232c
commit
8b6c521bb1
1 changed files with 23 additions and 5 deletions
|
@ -38,11 +38,31 @@
|
||||||
#include "validate.h"
|
#include "validate.h"
|
||||||
#include "gst-validate-internal.h"
|
#include "gst-validate-internal.h"
|
||||||
|
|
||||||
|
#ifdef G_OS_WIN32
|
||||||
|
#define WIN32_LEAN_AND_MEAN /* prevents from including too many things */
|
||||||
|
#include <windows.h> /* GetStdHandle, windows console */
|
||||||
|
|
||||||
|
HMODULE _priv_gstvalidate_dll_handle = NULL;
|
||||||
|
#endif
|
||||||
|
|
||||||
GST_DEBUG_CATEGORY (gstvalidate_debug);
|
GST_DEBUG_CATEGORY (gstvalidate_debug);
|
||||||
|
|
||||||
static GMutex _gst_validate_registry_mutex;
|
static GMutex _gst_validate_registry_mutex;
|
||||||
static GstRegistry *_gst_validate_registry_default = NULL;
|
static GstRegistry *_gst_validate_registry_default = NULL;
|
||||||
|
|
||||||
|
#ifdef G_OS_WIN32
|
||||||
|
BOOL WINAPI DllMain (HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved);
|
||||||
|
BOOL WINAPI
|
||||||
|
DllMain (HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
|
||||||
|
{
|
||||||
|
if (fdwReason == DLL_PROCESS_ATTACH)
|
||||||
|
_priv_gstvalidate_dll_handle = (HMODULE) hinstDLL;
|
||||||
|
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
static GstRegistry *
|
static GstRegistry *
|
||||||
gst_validate_registry_get (void)
|
gst_validate_registry_get (void)
|
||||||
{
|
{
|
||||||
|
@ -104,13 +124,11 @@ gst_validate_init_plugins (void)
|
||||||
|
|
||||||
base_dir =
|
base_dir =
|
||||||
g_win32_get_package_installation_directory_of_module
|
g_win32_get_package_installation_directory_of_module
|
||||||
(_priv_gst_dll_handle);
|
(_priv_gstvalidate_dll_handle);
|
||||||
|
|
||||||
dir = g_build_filename (base_dir,
|
dir = g_build_filename (base_dir,
|
||||||
#ifdef _DEBUG
|
"lib", "gstreamer-" GST_API_VERSION, "validate", NULL);
|
||||||
"debug"
|
|
||||||
#endif
|
|
||||||
"lib", "gstreamer-" GST_API_VERSION, NULL);
|
|
||||||
GST_DEBUG ("scanning DLL dir %s", dir);
|
GST_DEBUG ("scanning DLL dir %s", dir);
|
||||||
|
|
||||||
gst_registry_scan_path (registry, dir);
|
gst_registry_scan_path (registry, dir);
|
||||||
|
|
Loading…
Reference in a new issue