[FFmpeg-cvslog] force WINAPI_FAMILY to WINAPI_FAMILY_DESKTOP_APP to use DVXA
Steve Lhomme
git at videolan.org
Sun Jul 26 22:17:05 CEST 2015
ffmpeg | branch: master | Steve Lhomme <robux4 at gmail.com> | Sun Jul 26 13:35:47 2015 +0200| [c5327df838396e7c43a56bdd141c0f01ba3edc94] | committer: Michael Niedermayer
force WINAPI_FAMILY to WINAPI_FAMILY_DESKTOP_APP to use DVXA
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: Michael Niedermayer <michael at niedermayer.cc>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=c5327df838396e7c43a56bdd141c0f01ba3edc94
---
configure | 2 +-
libavcodec/dxva2_internal.h | 7 +++++++
2 files changed, 8 insertions(+), 1 deletion(-)
diff --git a/configure b/configure
index bfed9e6..116f5a2 100755
--- a/configure
+++ b/configure
@@ -5098,7 +5098,7 @@ check_lib2 "windows.h psapi.h" GetProcessMemoryInfo -lpsapi
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 "d3d9.h dxva2api.h" DXVA2_ConfigPictureDecode -D_WIN32_WINNT=0x0600
diff --git a/libavcodec/dxva2_internal.h b/libavcodec/dxva2_internal.h
index 426de9d..d5cc01e 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 <objbase.h>
+
#if CONFIG_DXVA2
#include "dxva2.h"
#endif
@@ -35,6 +38,10 @@
#endif
#if HAVE_DXVA_H
+/* dxva.h defines nothing otherwise but it works */
+#undef WINAPI_FAMILY
+#define WINAPI_FAMILY WINAPI_FAMILY_DESKTOP_APP
+#define _CRT_BUILD_DESKTOP_APP 0
#include <dxva.h>
#endif
More information about the ffmpeg-cvslog
mailing list