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])],
# 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>
# include <libavcodec/avcodec.h>
# ifdef HAVE_AVCODEC_DXVA2
# define DXVA2API_USE_BITFIELDS
+# define COBJMACROS
# include <libavcodec/dxva2.h>
# endif
#else
# 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>