gstreamer/sys/wasapi/meson.build
Seungha Yang 589ff8ca6d wasapideviceprovider: Add support for dynamic device add/remove
Adding IMMDeviceEnumerator::RegisterEndpointNotificationCallback
in order to support device monitoring.
On OnDeviceAdded(), OnDeviceRemoved(), and OnDefaultDeviceChanged()
callback, wasapi device provider implementation will enumerate
devices again and will notify newly added and removed device
via GstDeviceProvider API.

As a bonus point, this IMMDeviceEnumerator abstraction object
will spawn a dedicated internal COM thread, so various COM thread
related issues of WASAPI plugin can be resolved by this commit.

Fixes: https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/issues/1649
Fixes: https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/issues/1110
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2484>
2021-09-21 17:34:35 +00:00

41 lines
1.3 KiB
Meson

wasapi_sources = [
'gstmmdeviceenumerator.cpp',
'gstwasapi.c',
'gstwasapisrc.c',
'gstwasapisink.c',
'gstwasapiutil.c',
'gstwasapidevice.c',
]
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
if ole32_dep.found() and ksuser_dep.found() and have_audioclient_h
wasapi_args = ['-DCOBJMACROS']
if cc.has_header_symbol('audioclient.h', 'AUDCLNT_STREAMOPTIONS_NONE')
wasapi_args += ['-DHAVE_AUDCLNT_STREAMOPTIONS']
endif
gstwasapi = library('gstwasapi',
wasapi_sources,
c_args : gst_plugins_bad_args + wasapi_args,
cpp_args: gst_plugins_bad_args,
include_directories : [configinc],
dependencies : [gstaudio_dep, ole32_dep, ksuser_dep],
install : true,
install_dir : plugins_install_dir)
pkgconfig.generate(gstwasapi, install_dir : plugins_pkgconfig_install_dir)
plugins += [gstwasapi]
endif