[vlc-commits] [Git][videolan/vlc][master] directx_va: fix warning when DXVA2 is not available

Steve Lhomme (@robUx4) gitlab at videolan.org
Sat Dec 16 12:38:27 UTC 2023



Steve Lhomme pushed to branch master at VideoLAN / VLC


Commits:
468ef310 by Steve Lhomme at 2023-12-16T12:23:44+00:00
directx_va: fix warning when DXVA2 is not available

The defines come from detection in configure.ac so they are not defined
when the header is not found.

- - - - -


2 changed files:

- modules/codec/avcodec/directx_va.c
- modules/codec/avcodec/directx_va.h


Changes:

=====================================
modules/codec/avcodec/directx_va.c
=====================================
@@ -35,9 +35,9 @@
 
 #include <initguid.h>
 
-#if HAVE_LIBAVCODEC_DXVA2_H
+#if defined(HAVE_LIBAVCODEC_DXVA2_H)
 # include <libavcodec/dxva2.h>
-#elif HAVE_LIBAVCODEC_D3D11VA_H
+#elif defined(HAVE_LIBAVCODEC_D3D11VA_H)
 # include <libavcodec/d3d11va.h>
 #else
 # error bogus libavcodec DXVA support
@@ -76,9 +76,9 @@ static const int PROF_AV1_HIGH[]    = { FF_PROFILE_AV1_HIGH, FF_PROFILE_AV1_MAIN
 
 #if defined(__MINGW64_VERSION_MAJOR) // mingw-w64 doesn't have all the standard GUIDs
 
-# if HAVE_LIBAVCODEC_DXVA2_H
+# if defined(HAVE_LIBAVCODEC_DXVA2_H)
 // do nothing, we have redirected DXVA_xxx to DXVA2_xxx
-# elif HAVE_LIBAVCODEC_D3D11VA_H && __MINGW64_VERSION_MAJOR > 11
+# elif defined(HAVE_LIBAVCODEC_D3D11VA_H) && __MINGW64_VERSION_MAJOR > 11
 // do nothing, we have redirected DXVA_xxx to D3D11_DECODER_PROFILE_xxx
 # else // !HAVE_LIBAVCODEC_DXVA2_H && !HAVE_LIBAVCODEC_D3D11VA_H
 // define missing GUIDs from D3D11-only builds with old mingw-w64


=====================================
modules/codec/avcodec/directx_va.h
=====================================
@@ -85,11 +85,11 @@ bool directx_va_canUseDecoder(vlc_va_t *, UINT VendorId, UINT DeviceId, const GU
 #ifdef _MSC_VER
 // MSVC should have all the DXVA_xxx GUIDs but not the few DXVA2_xxx ones we
 // need depending on the configuration (they don't have DXVA_xxx equivalents)
-# if HAVE_LIBAVCODEC_DXVA2_H
+# if defined(HAVE_LIBAVCODEC_DXVA2_H)
 
 // nothing to do, dxva2api.h will have them
 
-# elif HAVE_LIBAVCODEC_D3D11VA_H
+# elif defined(HAVE_LIBAVCODEC_D3D11VA_H)
 
 #  define DXVA2_ModeMPEG2_VLD     D3D11_DECODER_PROFILE_MPEG2_VLD
 #  define DXVA2_ModeMPEG2_MoComp  D3D11_DECODER_PROFILE_MPEG2_MOCOMP
@@ -98,7 +98,7 @@ bool directx_va_canUseDecoder(vlc_va_t *, UINT VendorId, UINT DeviceId, const GU
 # endif // !HAVE_LIBAVCODEC_xxx
 
 #elif defined(__MINGW64_VERSION_MAJOR) // mingw-w64 doesn't have all the standard GUIDs
-# if HAVE_LIBAVCODEC_DXVA2_H
+# if defined(HAVE_LIBAVCODEC_DXVA2_H)
 
 // redirect missing DXVA_xxx to existing DXVA2_xxx variants
 #  define DXVA_ModeMPEG1_VLD       DXVA2_ModeMPEG1_VLD
@@ -139,7 +139,7 @@ bool directx_va_canUseDecoder(vlc_va_t *, UINT VendorId, UINT DeviceId, const GU
 #  define DXVA_ModeVP9_VLD_Profile0        DXVA2_ModeVP9_VLD_Profile0
 #  define DXVA_ModeVP9_VLD_10bit_Profile2  DXVA2_ModeVP9_VLD_10bit_Profile2
 
-# elif HAVE_LIBAVCODEC_D3D11VA_H && __MINGW64_VERSION_MAJOR > 11
+# elif defined(HAVE_LIBAVCODEC_D3D11VA_H) && __MINGW64_VERSION_MAJOR > 11
 
 // redirect missing DXVA_xxx to existing D3D11_DECODER_PROFILE_xxx variants
 #  define DXVA2_ModeMPEG2_VLD     D3D11_DECODER_PROFILE_MPEG2_VLD



View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/468ef3103f0f0d48e66cb7b72d7eabd6cd408840

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/468ef3103f0f0d48e66cb7b72d7eabd6cd408840
You're receiving this email because of your account on code.videolan.org.


VideoLAN code repository instance


More information about the vlc-commits mailing list