webrtc/modules/audio_device/include
Anders Klemets eb8c4ca608 Remove unnecessary checks from AudioDeviceWindowsCore::CoreAudioIsSupported
This removes some code in the AudioDeviceWindowsCore::CoreAudioIsSupported function that was checking that every audio input and output device was functional. There are legitimate cases where some, or all, audio devices may not be accessible, and that was causing CoreAudioIsSupported to return false.

If CoreAudioIsSupported returns false, a subsequent RTC_CHECK call fails, which causes the entire app to exit.

After this change, the CoreAudioIsSupported() function simply checks if the Core Audio APIs are supported and no longer tries to do extra stuff unrelated to checking if the APIs are supported.

Note that Core Audio is actually supported in all versions of Windows after Windows XP. There were log messages in the code saying that if CoreAudioIsSupported() returns false, WebRTC will use the Wave Audio APIs instead. But this is no longer the case. The Wave Audio APIs would only be needed for Windows XP, and this code appears to have already been removed from WebRTC.
It is tempting to simply make CoreAudioIsSupported() do a "return true;" but for now I only removed the part of the logging messages that mentioned the Wave Audio APIs.

I understand that there is a new Audio Device Module (ADM) called WindowsCoreAudio2, which is now recommended for use by apps. Apps are supposed to instantiate WindowsCoreAudio2 and pass it in to WebRTC. When the app supplies its own ADM, CoreAudioIsSupported() does not get invoked, which avoids the bug. To help make it clearer that using WindowsCoreAudio2 is an acceptable solution, I am removing a comment that says that kWindowsCoreAudio2 is "experimental".

Bug: webrtc:11081
Change-Id: I7ed1684a276799f4c83006b45629e48814f0b18b
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/161463
Commit-Queue: Henrik Andreassson <henrika@webrtc.org>
Reviewed-by: Henrik Andreassson <henrika@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30025}
2019-12-06 10:09:03 +00:00
..
audio_device_data_observer.h Delete deprecated AudioDeviceWithDataObserver factory 2019-06-05 09:01:25 +00:00
audio_device_default.h Reporting audio device underrun counter 2019-08-16 11:49:55 +00:00
audio_device_defines.h Format almost everything. 2019-07-08 13:45:15 +00:00
audio_device_factory.cc Use std::make_unique instead of absl::make_unique. 2019-09-17 15:47:29 +00:00
audio_device_factory.h Use std::make_unique instead of absl::make_unique. 2019-09-17 15:47:29 +00:00
audio_device.h Remove unnecessary checks from AudioDeviceWindowsCore::CoreAudioIsSupported 2019-12-06 10:09:03 +00:00
fake_audio_device.h Separate test/fake_audio_device on API and implementation. Step 1. 2018-03-07 12:46:00 +00:00
mock_audio_device.h Reporting audio device underrun counter 2019-08-16 11:49:55 +00:00
mock_audio_transport.h AudioTransport: Remove PushCaptureData() method 2018-04-04 08:04:09 +00:00
test_audio_device_unittest.cc Format almost everything. 2019-07-08 13:45:15 +00:00
test_audio_device.cc Use std::make_unique instead of absl::make_unique. 2019-09-17 15:47:29 +00:00
test_audio_device.h Format almost everything. 2019-07-08 13:45:15 +00:00