From 4074894de1b4f5985e7e3c760a154cd4c02df4f7 Mon Sep 17 00:00:00 2001 From: yixy-only <1907860402@qq.com> Date: Wed, 28 Oct 2026 00:20:36 +0800 Subject: [PATCH] fix(mingw): declare MFCreateDeviceSource for mingw-w64 < 10 --- src/ccap_imp_windows_msmf.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/ccap_imp_windows_msmf.cpp b/src/ccap_imp_windows_msmf.cpp index e20abdf..50900f1 100644 --- a/src/ccap_imp_windows_msmf.cpp +++ b/src/ccap_imp_windows_msmf.cpp @@ -21,6 +21,11 @@ #include #include +#if defined(__MINGW32__) && (!defined(__MINGW64_VERSION_MAJOR) || __MINGW64_VERSION_MAJOR < 10) +// mingw-w64 < 10.0.0 omits this declaration from mfidl.h, but mf.lib still exports it. +extern "C" HRESULT WINAPI MFCreateDeviceSource(IMFAttributes* attributes, IMFMediaSource** source); +#endif + namespace { template