[vlc-commits] [Git][videolan/vlc][master] 2 commits: directx_va: fix detection of mingw-w64 v13 dxva.h

Steve Lhomme (@robUx4) gitlab at videolan.org
Sat Aug 23 14:37:10 UTC 2025



Steve Lhomme pushed to branch master at VideoLAN / VLC


Commits:
20227126 by Steve Lhomme at 2025-08-23T13:49:10+00:00
directx_va: fix detection of mingw-w64 v13 dxva.h

If the dxva.h file comes from the contribs, it doesn't match the system
__MINGW64_VERSION_MAJOR. But we can detect it another way.

- - - - -
2487ebc2 by Steve Lhomme at 2025-08-23T13:49:10+00:00
contrib: mingw: update to version 13.0.0

- - - - -


7 changed files:

- − contrib/src/mingw64/0001-crt-add-missing-DXVAHD_CreateDevice-for-x86.patch
- − contrib/src/mingw64/0001-headers-disable-more-strmif-interfaces-in-UWP.patch
- − contrib/src/mingw64/0001-headers-dxvahd-Add-missing-WINAPI-on-DXVAHD_CreateDe.patch
- + contrib/src/mingw64/0001-winnt-define-__MINGW_CXX1-1-4-_CONSTEXPR-found-in-_m.patch
- contrib/src/mingw64/SHA512SUMS
- contrib/src/mingw64/rules.mak
- modules/codec/avcodec/directx_va.c


Changes:

=====================================
contrib/src/mingw64/0001-crt-add-missing-DXVAHD_CreateDevice-for-x86.patch deleted
=====================================
@@ -1,29 +0,0 @@
-From 9b6446b15771822edb28f4624aa54c10d3c5983b Mon Sep 17 00:00:00 2001
-From: Steve Lhomme <robux4 at ycbcr.xyz>
-Date: Thu, 30 Jan 2025 06:53:18 +0100
-Subject: [PATCH] crt: add missing DXVAHD_CreateDevice for x86
-
-It was first added to arm32 in 4a306baa4a206c9314bdc129e98abfa1aebe2b0e.
-Then to the common one in 96fe9ec413001bfc3f5971df64bcdedc216a9020.
-But it was always missing in x86.
-
-I verified that's the only one missing in that .def.
----
- mingw-w64-crt/lib32/dxva2.def | 1 +
- 1 file changed, 1 insertion(+)
-
-diff --git a/mingw-w64-crt/lib32/dxva2.def b/mingw-w64-crt/lib32/dxva2.def
-index d43af5be3..ea343a53f 100644
---- a/mingw-w64-crt/lib32/dxva2.def
-+++ b/mingw-w64-crt/lib32/dxva2.def
-@@ -8,6 +8,7 @@ EXPORTS
- CapabilitiesRequestAndCapabilitiesReply at 12
- DXVA2CreateDirect3DDeviceManager9 at 8
- DXVA2CreateVideoService at 12
-+DXVAHD_CreateDevice at 20
- DegaussMonitor at 4
- DestroyPhysicalMonitor at 4
- DestroyPhysicalMonitors at 8
--- 
-2.45.2
-


=====================================
contrib/src/mingw64/0001-headers-disable-more-strmif-interfaces-in-UWP.patch deleted
=====================================
@@ -1,125 +0,0 @@
-From b9509ccdb9ee3c73b8f69fa6de431cec907d49b2 Mon Sep 17 00:00:00 2001
-From: Steve Lhomme <robux4 at ycbcr.xyz>
-Date: Mon, 3 Jun 2024 13:50:03 +0200
-Subject: [PATCH] headers: disable more strmif interfaces in UWP
-
-Just as they are in axcore since dc4c87129e1768dba6b35ad56e395f263f3d2e6d.
----
- mingw-w64-headers/include/axextend.idl |  6 ++++++
- mingw-w64-headers/include/dyngraph.idl |  6 ++++++
- mingw-w64-headers/include/strmif.h     | 12 ++++++++++++
- mingw-w64-headers/include/strmif.idl   |  8 ++++++++
- 4 files changed, 32 insertions(+)
-
-diff --git a/mingw-w64-headers/include/axextend.idl b/mingw-w64-headers/include/axextend.idl
-index 6981b972b..d1dd53e92 100644
---- a/mingw-w64-headers/include/axextend.idl
-+++ b/mingw-w64-headers/include/axextend.idl
-@@ -16,6 +16,9 @@
-  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
-  */
- 
-+cpp_quote("#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)")
-+cpp_quote("")
-+
- interface IAMAnalogVideoDecoder;
- interface IAMAnalogVideoEncoder;
- interface IAMAudioInputMixer;
-@@ -1552,3 +1555,6 @@ interface IAMPluginControl : IUnknown
-             [in] LPCWSTR dllName);
- }
- cpp_quote("#endif /*(_WIN32_WINNT >= 0x0601)*/")
-+
-+cpp_quote("#endif /* WINAPI_PARTITION_DESKTOP */")
-+cpp_quote("")
-diff --git a/mingw-w64-headers/include/dyngraph.idl b/mingw-w64-headers/include/dyngraph.idl
-index 92f91e841..ee50f9a42 100644
---- a/mingw-w64-headers/include/dyngraph.idl
-+++ b/mingw-w64-headers/include/dyngraph.idl
-@@ -20,6 +20,9 @@
- #pragma makedep install
- #endif
- 
-+cpp_quote("#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)")
-+cpp_quote("")
-+
- interface IPinConnection;
- interface IPinFlowControl;
- interface IGraphConfig;
-@@ -152,3 +155,6 @@ interface IFilterChain : IUnknown
-         [in] IBaseFilter *pStartFilter,
-         [in] IBaseFilter *pEndFilter);
- }
-+
-+cpp_quote("#endif /* WINAPI_PARTITION_DESKTOP */")
-+cpp_quote("")
-diff --git a/mingw-w64-headers/include/strmif.h b/mingw-w64-headers/include/strmif.h
-index 77a6689cd..48822dce2 100644
---- a/mingw-w64-headers/include/strmif.h
-+++ b/mingw-w64-headers/include/strmif.h
-@@ -3789,6 +3789,8 @@ enum tagAM_MEDIAEVENT_FLAGS {
- };
- 
- #endif
-+#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
-+
- #ifndef __IAMAnalogVideoDecoder_FWD_DEFINED__
- #define __IAMAnalogVideoDecoder_FWD_DEFINED__
- typedef interface IAMAnalogVideoDecoder IAMAnalogVideoDecoder;
-@@ -11079,6 +11081,10 @@ static __WIDL_INLINE HRESULT IAMPluginControl_IsLegacyDisabled(IAMPluginControl*
- #endif  /* __IAMPluginControl_INTERFACE_DEFINED__ */
- 
- #endif /*(_WIN32_WINNT >= 0x0601)*/
-+#endif /* WINAPI_PARTITION_DESKTOP */
-+
-+#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
-+
- #ifndef __IPinConnection_FWD_DEFINED__
- #define __IPinConnection_FWD_DEFINED__
- typedef interface IPinConnection IPinConnection;
-@@ -11711,6 +11717,10 @@ static __WIDL_INLINE HRESULT IFilterChain_RemoveChain(IFilterChain* This,IBaseFi
- 
- #endif  /* __IFilterChain_INTERFACE_DEFINED__ */
- 
-+#endif /* WINAPI_PARTITION_DESKTOP */
-+
-+#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
-+
- #ifndef __IReferenceClock2_FWD_DEFINED__
- #define __IReferenceClock2_FWD_DEFINED__
- typedef struct IReferenceClock2 IReferenceClock2;
-@@ -16647,6 +16657,8 @@ __CRT_UUID_DECL(IMpeg2Demultiplexer,0x436eee9c,0x264f,0x4242,0x90,0xe1,0x4e,0x33
- 
-   extern RPC_IF_HANDLE __MIDL_itf_strmif_0413_v0_0_c_ifspec;
-   extern RPC_IF_HANDLE __MIDL_itf_strmif_0413_v0_0_s_ifspec;
-+#endif /* WINAPI_PARTITION_DESKTOP */
-+
- /* Begin additional prototypes for all interfaces */
- 
- 
-diff --git a/mingw-w64-headers/include/strmif.idl b/mingw-w64-headers/include/strmif.idl
-index c2cdd4921..9f9bb6515 100644
---- a/mingw-w64-headers/include/strmif.idl
-+++ b/mingw-w64-headers/include/strmif.idl
-@@ -12,6 +12,9 @@ import "objidl.idl";
- #include "axextend.idl"
- #include "dyngraph.idl"
- 
-+cpp_quote("#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)")
-+cpp_quote("")
-+
- cpp_quote("#ifndef __IReferenceClock2_FWD_DEFINED__")
- cpp_quote("#define __IReferenceClock2_FWD_DEFINED__")
- cpp_quote("typedef struct IReferenceClock2 IReferenceClock2;")
-@@ -4948,3 +4951,8 @@ cpp_quote("#endif")
- cpp_quote("")
- cpp_quote("  extern RPC_IF_HANDLE __MIDL_itf_strmif_0413_v0_0_c_ifspec;")
- cpp_quote("  extern RPC_IF_HANDLE __MIDL_itf_strmif_0413_v0_0_s_ifspec;")
-+
-+
-+cpp_quote("#endif /* WINAPI_PARTITION_DESKTOP */")
-+cpp_quote("")
-+
--- 
-2.45.0.windows.1
-


=====================================
contrib/src/mingw64/0001-headers-dxvahd-Add-missing-WINAPI-on-DXVAHD_CreateDe.patch deleted
=====================================
@@ -1,39 +0,0 @@
-From 0a5b3814cf63bcb1c275cc35d75b20c1f328f2a7 Mon Sep 17 00:00:00 2001
-From: Steve Lhomme <robux4 at ycbcr.xyz>
-Date: Thu, 30 Jan 2025 10:21:26 +0100
-Subject: [PATCH] headers/dxvahd: Add missing WINAPI on DXVAHD_CreateDevice()
-
----
- mingw-w64-headers/include/dxvahd.h   | 2 +-
- mingw-w64-headers/include/dxvahd.idl | 2 +-
- 2 files changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/mingw-w64-headers/include/dxvahd.h b/mingw-w64-headers/include/dxvahd.h
-index 2258d2836..65c37d34f 100644
---- a/mingw-w64-headers/include/dxvahd.h
-+++ b/mingw-w64-headers/include/dxvahd.h
-@@ -415,7 +415,7 @@ typedef struct _DXVAHDSW_CALLBACKS {
-   PDXVAHDSW_DestroyVideoProcessor             DestroyVideoProcessor;
- } DXVAHDSW_CALLBACKS;
- 
--HRESULT DXVAHD_CreateDevice(IDirect3DDevice9Ex *pD3DDevice,const DXVAHD_CONTENT_DESC *pContentDesc,DXVAHD_DEVICE_USAGE Usage,PDXVAHDSW_Plugin pPlugin,IDXVAHD_Device **ppDevice);
-+HRESULT WINAPI DXVAHD_CreateDevice(IDirect3DDevice9Ex *pD3DDevice,const DXVAHD_CONTENT_DESC *pContentDesc,DXVAHD_DEVICE_USAGE Usage,PDXVAHDSW_Plugin pPlugin,IDXVAHD_Device **ppDevice);
- 
- /*****************************************************************************
-  * IDXVAHD_Device interface
-diff --git a/mingw-w64-headers/include/dxvahd.idl b/mingw-w64-headers/include/dxvahd.idl
-index 607f3778e..519e9ed3c 100644
---- a/mingw-w64-headers/include/dxvahd.idl
-+++ b/mingw-w64-headers/include/dxvahd.idl
-@@ -398,7 +398,7 @@ cpp_quote("  PDXVAHDSW_VideoProcessBltHD                 VideoProcessBltHD;")
- cpp_quote("  PDXVAHDSW_DestroyVideoProcessor             DestroyVideoProcessor;")
- cpp_quote("} DXVAHDSW_CALLBACKS;")
- cpp_quote("")
--cpp_quote("HRESULT DXVAHD_CreateDevice(IDirect3DDevice9Ex *pD3DDevice,const DXVAHD_CONTENT_DESC *pContentDesc,DXVAHD_DEVICE_USAGE Usage,PDXVAHDSW_Plugin pPlugin,IDXVAHD_Device **ppDevice);")
-+cpp_quote("HRESULT WINAPI DXVAHD_CreateDevice(IDirect3DDevice9Ex *pD3DDevice,const DXVAHD_CONTENT_DESC *pContentDesc,DXVAHD_DEVICE_USAGE Usage,PDXVAHDSW_Plugin pPlugin,IDXVAHD_Device **ppDevice);")
- cpp_quote("")
- [
-     object,
--- 
-2.45.2
-


=====================================
contrib/src/mingw64/0001-winnt-define-__MINGW_CXX1-1-4-_CONSTEXPR-found-in-_m.patch
=====================================
@@ -0,0 +1,38 @@
+From 98b7ca9279e9b4b2499b4c796b64a99035d25a0a Mon Sep 17 00:00:00 2001
+From: Steve Lhomme <robux4 at ycbcr.xyz>
+Date: Wed, 20 Aug 2025 15:36:03 +0200
+Subject: [PATCH] winnt: define __MINGW_CXX1[1|4]_CONSTEXPR found in _mingw.h
+
+When installing winnt.h in contribs this is not defined with mingw-w64
+older than v13.0.0.
+---
+ mingw-w64-headers/include/winnt.h | 13 +++++++++++++
+ 1 file changed, 13 insertions(+)
+
+diff --git a/mingw-w64-headers/include/winnt.h b/mingw-w64-headers/include/winnt.h
+index 38b4d4f38..296a9ec3c 100644
+--- a/mingw-w64-headers/include/winnt.h
++++ b/mingw-w64-headers/include/winnt.h
+@@ -710,6 +710,19 @@ typedef LONG RTL_REFERENCE_COUNT32, *PRTL_REFERENCE_COUNT32;
+ #define RTL_CONST_CAST(type) (type)
+ #endif
+ 
++#define __MINGW_CXX11_CONSTEXPR
++#define __MINGW_CXX14_CONSTEXPR
++#ifdef __cplusplus
++# if __cplusplus >= 201103L || defined(_MSC_VER)
++#  undef __MINGW_CXX11_CONSTEXPR
++#  define __MINGW_CXX11_CONSTEXPR  constexpr
++# endif
++# if __cplusplus >= 201402L || defined(_MSC_VER)
++#  undef __MINGW_CXX14_CONSTEXPR
++#  define __MINGW_CXX14_CONSTEXPR  constexpr
++# endif
++#endif
++
+ #ifdef __cplusplus
+ #define DEFINE_ENUM_FLAG_OPERATORS(ENUMTYPE) \
+ extern "C++" { \
+-- 
+2.45.1.windows.1
+


=====================================
contrib/src/mingw64/SHA512SUMS
=====================================
@@ -1 +1 @@
-949b2bfab8763ab10ec4e9fdfdaf5361517a4ab787fb98ab419b38d02694061c2e821ebbf6e2e4b39d92bdf17419d116daa8e63afd9e01d11592f39df4da69d7  mingw-w64-v12.0.0.tar.bz2
\ No newline at end of file
+39a22bd92465f571df1d90ac80b88dc6846998f71e4b7db79d1c9aa6e04cb3e41b632990a7238fc2c384ea67e4a77d103230db2c0d741869340d24ea79b6dda8  mingw-w64-v13.0.0.tar.bz2
\ No newline at end of file


=====================================
contrib/src/mingw64/rules.mak
=====================================
@@ -1,6 +1,6 @@
 # winpthreads, dxvahd, winrt_headers, dcomp
 
-MINGW64_VERSION := 12.0.0
+MINGW64_VERSION := 13.0.0
 MINGW64_URL := $(SF)/mingw-w64/mingw-w64/mingw-w64-release/mingw-w64-v$(MINGW64_VERSION).tar.bz2
 # MINGW64_HASH=2c35e8ff0d33916bd490e8932cba2049cd1af3d0
 # MINGW64_GITURL := https://git.code.sf.net/p/mingw-w64/mingw-w64
@@ -63,9 +63,7 @@ $(TARBALLS)/mingw-w64-v$(MINGW64_VERSION).tar.bz2:
 mingw64: mingw-w64-v$(MINGW64_VERSION).tar.bz2 .sum-mingw64
 # mingw64: mingw-w64-$(MINGW64_HASH).tar.xz .sum-mingw64
 	$(UNPACK)
-	$(APPLY) $(SRC)/mingw64/0001-headers-disable-more-strmif-interfaces-in-UWP.patch
-	$(APPLY) $(SRC)/mingw64/0001-crt-add-missing-DXVAHD_CreateDevice-for-x86.patch
-	$(APPLY) $(SRC)/mingw64/0001-headers-dxvahd-Add-missing-WINAPI-on-DXVAHD_CreateDe.patch
+	$(APPLY) $(SRC)/mingw64/0001-winnt-define-__MINGW_CXX1-1-4-_CONSTEXPR-found-in-_m.patch
 	$(MOVE)
 
 .mingw64: mingw64
@@ -179,6 +177,7 @@ endif
 	install $</mingw-w64-headers/include/wincrypt.h     "$(PREFIX)/include"
 	install $</mingw-w64-headers/include/winnt.h        "$(PREFIX)/include"
 	install $</mingw-w64-headers/include/heapapi.h      "$(PREFIX)/include"
+	install $</mingw-w64-headers/include/minwinbase.h   "$(PREFIX)/include"
 
 	# Trick mingw-w64 into just building libwindowsapp.a
 	$(MAKEBUILDDIR)


=====================================
modules/codec/avcodec/directx_va.c
=====================================
@@ -141,7 +141,7 @@ DEFINE_GUID(DXVA2_ModeVP9_VLD_Profile0,             0x463707f8, 0xa1d0, 0x4585,
 DEFINE_GUID(DXVA2_ModeVP9_VLD_10bit_Profile2,       0xa4c749ef, 0x6ecf, 0x48aa, 0x84, 0x48, 0x50, 0xa7, 0xa1, 0x16, 0x5f, 0xf7);
 #  endif // __MINGW64_VERSION_MAJOR < 8
 
-#  if __MINGW64_VERSION_MAJOR < 13
+#  if !defined(DXVA_ModeH264_MoComp_NoFGT) // __MINGW64_VERSION_MAJOR < 13
 DEFINE_GUID(DXVA_ModeMPEG1_A,                       0x1b81be09, 0xa0c7, 0x11d3, 0xb9, 0x84, 0x00, 0xc0, 0x4f, 0x2e, 0x73, 0xc5);
 DEFINE_GUID(DXVA_ModeMPEG2_A,                       0x1b81be0A, 0xa0c7, 0x11d3, 0xb9, 0x84, 0x00, 0xc0, 0x4f, 0x2e, 0x73, 0xc5);
 DEFINE_GUID(DXVA_ModeMPEG2_B,                       0x1b81be0B, 0xa0c7, 0x11d3, 0xb9, 0x84, 0x00, 0xc0, 0x4f, 0x2e, 0x73, 0xc5);



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/5d7bf6f99ad7e122fc1b6708ed78f7fbb36e5293...2487ebc25cb7a19a67ec460166d809f41b492f33

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/5d7bf6f99ad7e122fc1b6708ed78f7fbb36e5293...2487ebc25cb7a19a67ec460166d809f41b492f33
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