summaryrefslogtreecommitdiffstats
path: root/compat
diff options
context:
space:
mode:
authorMatt Oliver <protogonoi@gmail.com>2017-07-01 23:16:42 +1000
committerMatt Oliver <protogonoi@gmail.com>2017-07-30 14:30:43 +1000
commita3833bee9482fe650e05ee99718209414bd3356e (patch)
tree77de4f41691ccfc8ecc248df8a72a03646024499 /compat
parent1e0c75ea165c926c544d42f0a1e51d7f6fa95354 (diff)
downloadffmpeg-streaming-a3833bee9482fe650e05ee99718209414bd3356e.zip
ffmpeg-streaming-a3833bee9482fe650e05ee99718209414bd3356e.tar.gz
win32_dlfcn: Support WinRT/UWP.
This only enables dlls that are packaged with the application to be loaded. Due to the limitations of WinRT/UWP it is not allowed to load external/system dlls so this cannot be used as a complete replacement for normal win32 dll loading. Signed-off-by: Matt Oliver <protogonoi@gmail.com>
Diffstat (limited to 'compat')
-rw-r--r--compat/w32dlfcn.h12
1 files changed, 11 insertions, 1 deletions
diff --git a/compat/w32dlfcn.h b/compat/w32dlfcn.h
index bc9bb8c..78cc8f4 100644
--- a/compat/w32dlfcn.h
+++ b/compat/w32dlfcn.h
@@ -21,7 +21,7 @@
#ifdef _WIN32
#include <windows.h>
-#if _WIN32_WINNT < 0x0602
+#if (_WIN32_WINNT < 0x0602) || HAVE_WINRT
#include "libavutil/wchar_filename.h"
#endif
/**
@@ -71,7 +71,17 @@ exit:
#ifndef LOAD_LIBRARY_SEARCH_SYSTEM32
# define LOAD_LIBRARY_SEARCH_SYSTEM32 0x00000800
#endif
+#if HAVE_WINRT
+ wchar_t *name_w = NULL;
+ int ret;
+ if (utf8towchar(name, &name_w))
+ return NULL;
+ ret = LoadPackagedLibrary(name_w, 0);
+ av_free(name_w);
+ return ret;
+#else
return LoadLibraryExA(name, NULL, LOAD_LIBRARY_SEARCH_APPLICATION_DIR | LOAD_LIBRARY_SEARCH_SYSTEM32);
+#endif
}
#define dlopen(name, flags) win32_dlopen(name)
#define dlclose FreeLibrary
OpenPOWER on IntegriCloud