diff --git a/subprojects/gst-plugins-bad/sys/wasapi/gstwasapiutil.c b/subprojects/gst-plugins-bad/sys/wasapi/gstwasapiutil.c index c0fce05833..8f935837ee 100644 --- a/subprojects/gst-plugins-bad/sys/wasapi/gstwasapiutil.c +++ b/subprojects/gst-plugins-bad/sys/wasapi/gstwasapiutil.c @@ -37,7 +37,8 @@ GST_DEBUG_CATEGORY_EXTERN (gst_wasapi_debug); #include /* __uuidof is only available in C++, so we hard-code the GUID values for all - * these. This is ok because these are ABI. */ + * these. This is ok because these are ABI. MSYS2 provides these in C. */ +#ifndef HAVE_AUDCLNT_GUIDS const CLSID CLSID_MMDeviceEnumerator = { 0xbcde0395, 0xe52f, 0x467c, {0x8e, 0x3d, 0xc4, 0x57, 0x92, 0x91, 0x69, 0x2e} }; @@ -54,10 +55,6 @@ const IID IID_IAudioClient = { 0x1cb9ad4c, 0xdbfa, 0x4c32, {0xb1, 0x78, 0xc2, 0xf5, 0x68, 0xa7, 0x03, 0xb2} }; -const IID IID_IAudioClient3 = { 0x7ed4ee07, 0x8e67, 0x4cd4, - {0x8c, 0x1a, 0x2b, 0x7a, 0x59, 0x87, 0xad, 0x42} -}; - const IID IID_IAudioClock = { 0xcd63314f, 0x3fba, 0x4a1b, {0x81, 0x2c, 0xef, 0x96, 0x35, 0x87, 0x28, 0xe7} }; @@ -69,6 +66,13 @@ const IID IID_IAudioCaptureClient = { 0xc8adbd64, 0xe71e, 0x48a0, const IID IID_IAudioRenderClient = { 0xf294acfc, 0x3146, 0x4483, {0xa7, 0xbf, 0xad, 0xdc, 0xa7, 0xc2, 0x60, 0xe2} }; +#endif + +#ifndef HAVE_AUDCLNT3_GUID +const IID IID_IAudioClient3 = { 0x7ed4ee07, 0x8e67, 0x4cd4, + {0x8c, 0x1a, 0x2b, 0x7a, 0x59, 0x87, 0xad, 0x42} +}; +#endif /* Desktop only defines */ #ifndef KSAUDIO_SPEAKER_MONO diff --git a/subprojects/gst-plugins-bad/sys/wasapi/meson.build b/subprojects/gst-plugins-bad/sys/wasapi/meson.build index 9e3f1b2ce0..aba3ec56ce 100644 --- a/subprojects/gst-plugins-bad/sys/wasapi/meson.build +++ b/subprojects/gst-plugins-bad/sys/wasapi/meson.build @@ -28,6 +28,18 @@ if ole32_dep.found() and ksuser_dep.found() and have_audioclient_h wasapi_args += ['-DHAVE_AUDCLNT_STREAMOPTIONS'] endif + # MinGW defines some of these GUIDs in headers, whereas with MSVC we're + # expected to define them in the code. Check which ones we need to provide. + if cc.get_id() != 'msvc' + if cc.has_header_symbol('audioclient.h', 'IID_IAudioClient') + wasapi_args += ['-DHAVE_AUDCLNT_GUIDS'] + endif + + if cc.has_header_symbol('audioclient.h', 'IID_IAudioClient3') + wasapi_args += ['-DHAVE_AUDCLNT3_GUID'] + endif + endif + gstwasapi = library('gstwasapi', wasapi_sources, c_args : gst_plugins_bad_args + wasapi_args,