2016-08-12 15:51:45 +00:00
|
|
|
wasapi_sources = [
|
2021-08-23 18:54:27 +00:00
|
|
|
'gstmmdeviceenumerator.cpp',
|
2016-08-12 15:51:45 +00:00
|
|
|
'gstwasapi.c',
|
|
|
|
'gstwasapisrc.c',
|
|
|
|
'gstwasapisink.c',
|
|
|
|
'gstwasapiutil.c',
|
2018-02-08 09:11:05 +00:00
|
|
|
'gstwasapidevice.c',
|
2016-08-12 15:51:45 +00:00
|
|
|
]
|
|
|
|
|
2018-07-27 13:29:23 +00:00
|
|
|
if host_system != 'windows'
|
|
|
|
if get_option('wasapi').disabled()
|
|
|
|
subdir_done()
|
|
|
|
elif get_option('wasapi').enabled()
|
|
|
|
error('Cannot build wasapi plugin when not building for Windows')
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
|
|
|
ole32_dep = cc.find_library('ole32', required : get_option('wasapi'))
|
|
|
|
ksuser_dep = cc.find_library('ksuser', required : get_option('wasapi'))
|
|
|
|
have_audioclient_h = cc.has_header('audioclient.h')
|
|
|
|
if not have_audioclient_h and get_option('wasapi').enabled()
|
|
|
|
error('wasapi plugin enabled but audioclient.h not found')
|
|
|
|
endif
|
2016-08-12 15:51:45 +00:00
|
|
|
|
2018-07-27 13:29:23 +00:00
|
|
|
if ole32_dep.found() and ksuser_dep.found() and have_audioclient_h
|
2018-08-07 19:01:51 +00:00
|
|
|
wasapi_args = ['-DCOBJMACROS']
|
|
|
|
if cc.has_header_symbol('audioclient.h', 'AUDCLNT_STREAMOPTIONS_NONE')
|
|
|
|
wasapi_args += ['-DHAVE_AUDCLNT_STREAMOPTIONS']
|
|
|
|
endif
|
|
|
|
|
2023-08-08 13:42:40 +00:00
|
|
|
# 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
|
|
|
|
|
2016-08-12 15:51:45 +00:00
|
|
|
gstwasapi = library('gstwasapi',
|
|
|
|
wasapi_sources,
|
2018-08-07 19:01:51 +00:00
|
|
|
c_args : gst_plugins_bad_args + wasapi_args,
|
2021-08-23 18:54:27 +00:00
|
|
|
cpp_args: gst_plugins_bad_args,
|
2016-08-12 15:51:45 +00:00
|
|
|
include_directories : [configinc],
|
2018-07-27 13:29:23 +00:00
|
|
|
dependencies : [gstaudio_dep, ole32_dep, ksuser_dep],
|
2016-08-12 15:51:45 +00:00
|
|
|
install : true,
|
|
|
|
install_dir : plugins_install_dir)
|
2018-10-22 09:30:45 +00:00
|
|
|
plugins += [gstwasapi]
|
2016-08-12 15:51:45 +00:00
|
|
|
endif
|