If using the winstore compat library, a fallback LoadLibrary
function does exist, that only calls LoadPackagedLibrary though
(which doesn't work for dynamically loading d3d11 DLLs).
Therefore explicitly check the targeted API family instead.
Make this check a reusable HAVE_* component which other parts
of the libraries can check when necessary as well.
Signed-off-by: Martin Storsjö <martin@martin.st>
Merged from Libav commit
4d330da006fe48178.
sndio
texi2html
threads
+ uwp
vaapi_drm
vaapi_x11
vdpau_x11
# d3d11va requires linking directly to dxgi and d3d11 if not building for
# the desktop api partition
-enabled LoadLibrary || d3d11va_extralibs="-ldxgi -ld3d11"
+check_cpp <<EOF && enable uwp && d3d11va_extralibs="-ldxgi -ld3d11"
+#ifdef WINAPI_FAMILY
+#include <winapifamily.h>
+#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
+#error desktop, not uwp
+#else
+// WINAPI_FAMILY_APP, WINAPI_FAMILY_PHONE_APP => UWP
+#endif
+#else
+#error no family set
+#endif
+EOF
enabled vaapi &&
check_lib vaapi va/va.h vaInitialize -lva
static av_cold void load_functions(void)
{
-#if HAVE_LOADLIBRARY
+#if !HAVE_UWP
// We let these "leak" - this is fine, as unloading has no great benefit, and
// Windows will mark a DLL as loaded forever if its internal refcount overflows
// from too many LoadLibrary calls.
int ret;
// (On UWP we can't check this.)
-#if HAVE_LOADLIBRARY
+#if !HAVE_UWP
if (!LoadLibrary("d3d11_1sdklayers.dll"))
is_debug = 0;
#endif
ID3D10Multithread_Release(pMultithread);
}
-#if HAVE_LOADLIBRARY && HAVE_DXGIDEBUG_H
+#if !HAVE_UWP && HAVE_DXGIDEBUG_H
if (is_debug) {
HANDLE dxgidebug_dll = LoadLibrary("dxgidebug.dll");
if (dxgidebug_dll) {