]> git.sesse.net Git - vlc/commitdiff
Dxva2 is only available in Windows Vista and above
authorRafaël Carré <funman@videolan.org>
Wed, 7 Dec 2011 16:20:40 +0000 (11:20 -0500)
committerRafaël Carré <funman@videolan.org>
Wed, 7 Dec 2011 16:21:27 +0000 (11:21 -0500)
Define _WIN32_WINNT to 0x600 when checking/using dxva2 headers
Continue to use a lower version to retain XP compatibility for the rest of VLC

configure.ac
modules/codec/avcodec/dxva2.c
modules/codec/avcodec/video.c

index 0647c62fbab61ffb54769e4e7671c13f9dd4122c..d0538e2f2ff32b4bae0a95b67e83367cfaddee52 100644 (file)
@@ -2443,7 +2443,9 @@ AS_IF([test "${enable_dxva2}" != "no"], [
     AS_IF([test "${enable_dxva2}" = "yes"],
           [AC_MSG_ERROR([dxva2 is present but libavcodec/dxva2.h is missing])],
               [AC_MSG_WARN([dxva2 is present but libavcodec/dxva2.h is missing ])])
-        ])
+        ], [#undef _WIN32_WINNT
+            /* DXVA2 is only available in Vista and above */
+            #define _WIN32_WINNT 0x600])
       ],[
     AS_IF([test "${enable_dxva2}" = "yes"],
               [AC_MSG_ERROR([Could not find required dxva2api.h])],
index 11ad2e7a5932eb1f59d4239d29eeb3ab42e230c1..8ae4fd3878c2f2de69282149f6bade3b1e7af189 100644 (file)
 # include "config.h"
 #endif
 
+
+#if defined(HAVE_LIBAVCODEC_AVCODEC_H) && defined(HAVE_AVCODEC_DXVA2)
+# if _WIN32_WINNT < 0x600
+/* dxva2 needs Vista support */
+#  undef _WIN32_WINNT
+#  define _WIN32_WINNT 0x600
+# endif
+#endif
+
 #include <vlc_common.h>
 #include <vlc_picture.h>
 #include <vlc_fourcc.h>
@@ -37,6 +46,7 @@
 #   include <libavcodec/avcodec.h>
 #   ifdef HAVE_AVCODEC_DXVA2
 #       define DXVA2API_USE_BITFIELDS
+#       define COBJMACROS
 #       include <libavcodec/dxva2.h>
 #   endif
 #else
index 6c9b865134cf3257412b5ed2e5a18de5050a7cca..95e64b5d36ad59662f4c7c94fafd276cbd260c7a 100644 (file)
 # include "config.h"
 #endif
 
+#if defined(HAVE_LIBAVCODEC_AVCODEC_H) && defined(HAVE_AVCODEC_DXVA2)
+# if _WIN32_WINNT < 0x600
+/* dxva2 needs Vista support */
+#  undef _WIN32_WINNT
+#  define _WIN32_WINNT 0x600
+# endif
+#endif
+
 #include <vlc_common.h>
 #include <vlc_codec.h>
 #include <vlc_avcodec.h>