From 9b4b96c0dee90d260891ec765b28f6ca15594340 Mon Sep 17 00:00:00 2001 From: Steve Lhomme Date: Sun, 26 Jul 2015 13:35:47 +0200 Subject: force WINAPI_FAMILY to WINAPI_FAMILY_DESKTOP_APP to be able to use dxva.h MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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: Martin Storsjö --- libavcodec/dxva2_internal.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'libavcodec/dxva2_internal.h') diff --git a/libavcodec/dxva2_internal.h b/libavcodec/dxva2_internal.h index 3b651a42bc..7155123b5d 100644 --- a/libavcodec/dxva2_internal.h +++ b/libavcodec/dxva2_internal.h @@ -27,6 +27,9 @@ #include "config.h" +/* define the proper COM entries before forcing desktop APIs */ +#include + #if CONFIG_DXVA2 #include "dxva2.h" #endif @@ -34,6 +37,12 @@ #include "d3d11va.h" #endif #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 #endif -- cgit v1.2.3