[vlc-commits] Dxva2 is only available in Windows Vista and above

Rafaël Carré git at videolan.org
Mon Feb 27 19:20:47 CET 2012


vlc/vlc-2.0 | branch: master | Rafaël Carré <funman at videolan.org> | Wed Dec  7 11:20:40 2011 -0500| [c2c2300b06b4689301353f31d84eb1c7c803a2fb] | committer: Rafaël Carré

Dxva2 is only available in Windows Vista and above

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
(cherry picked from commit 87038073b8434addc0d360d98a55b67fd55352a7)

Signed-off-by: Rafaël Carré <funman at videolan.org>

> http://git.videolan.org/gitweb.cgi/vlc/vlc-2.0.git/?a=commit;h=c2c2300b06b4689301353f31d84eb1c7c803a2fb
---

 configure.ac                  |    4 +++-
 modules/codec/avcodec/dxva2.c |   10 ++++++++++
 modules/codec/avcodec/video.c |    8 ++++++++
 3 files changed, 21 insertions(+), 1 deletions(-)

diff --git a/configure.ac b/configure.ac
index 96cfd28..0dac4e5 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2494,7 +2494,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])],
diff --git a/modules/codec/avcodec/dxva2.c b/modules/codec/avcodec/dxva2.c
index 6d47a41..a0c4dbc 100644
--- a/modules/codec/avcodec/dxva2.c
+++ b/modules/codec/avcodec/dxva2.c
@@ -27,6 +27,15 @@
 # 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
diff --git a/modules/codec/avcodec/video.c b/modules/codec/avcodec/video.c
index b309b76..69ab06e 100644
--- a/modules/codec/avcodec/video.c
+++ b/modules/codec/avcodec/video.c
@@ -29,6 +29,14 @@
 # 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>



More information about the vlc-commits mailing list