Commit 9b4b96c0 authored by Steve Lhomme's avatar Steve Lhomme Committed by Martin Storsjö

force WINAPI_FAMILY to WINAPI_FAMILY_DESKTOP_APP to be able to use dxva.h

The struct definitions in dxva.h, which are necessary in order to
actually use d3d11va, are hidden when WINAPI_FAMILY targets Windows Phone
or WindowsRT.

Building with WINAPI_FAMILY=WINAPI_FAMILY_DESKTOP_APP is disallowed
when targeting ARM. ("Compiling Desktop applications for the ARM
platform is not supported.") So we set _CRT_BUILD_DESKTOP_APP to 0
to tell the runtime not to detect some issues with this mismatching.

The same tweaks to detect if the API is available is done in dxva2_internal.h
when compiling each DXVA2/D3D11VA decoders.
Signed-off-by: 's avatarMartin Storsjö <martin@martin.st>
parent 4d0d55cd
...@@ -4270,7 +4270,7 @@ check_lib2 "windows.h psapi.h" GetProcessMemoryInfo -lpsapi ...@@ -4270,7 +4270,7 @@ check_lib2 "windows.h psapi.h" GetProcessMemoryInfo -lpsapi
check_struct "sys/time.h sys/resource.h" "struct rusage" ru_maxrss check_struct "sys/time.h sys/resource.h" "struct rusage" ru_maxrss
check_type "windows.h dxva.h" "DXVA_PicParams_HEVC" check_type "windows.h dxva.h" "DXVA_PicParams_HEVC" -DWINAPI_FAMILY=WINAPI_FAMILY_DESKTOP_APP -D_CRT_BUILD_DESKTOP_APP=0
check_type "windows.h d3d11.h" "ID3D11VideoDecoder" check_type "windows.h d3d11.h" "ID3D11VideoDecoder"
check_type "d3d9.h dxva2api.h" DXVA2_ConfigPictureDecode -D_WIN32_WINNT=0x0600 check_type "d3d9.h dxva2api.h" DXVA2_ConfigPictureDecode -D_WIN32_WINNT=0x0600
......
...@@ -27,6 +27,9 @@ ...@@ -27,6 +27,9 @@
#include "config.h" #include "config.h"
/* define the proper COM entries before forcing desktop APIs */
#include <objbase.h>
#if CONFIG_DXVA2 #if CONFIG_DXVA2
#include "dxva2.h" #include "dxva2.h"
#endif #endif
...@@ -34,6 +37,12 @@ ...@@ -34,6 +37,12 @@
#include "d3d11va.h" #include "d3d11va.h"
#endif #endif
#if HAVE_DXVA_H #if HAVE_DXVA_H
/* When targeting WINAPI_FAMILY_PHONE_APP or WINAPI_FAMILY_APP, dxva.h
* defines nothing. Force the struct definitions to be visible. */
#undef WINAPI_FAMILY
#define WINAPI_FAMILY WINAPI_FAMILY_DESKTOP_APP
#undef _CRT_BUILD_DESKTOP_APP
#define _CRT_BUILD_DESKTOP_APP 0
#include <dxva.h> #include <dxva.h>
#endif #endif
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment