Add a gyp/gn option to use dummy audio file devices.
Conceptually, dummy audio file devices are a "platform", like win/mac/linux, and so the conditional slots under include_internal_audio_device. When enabled, use_dummy_audio_file_devices disables whatever platform-specific audio layer would have been used and turns on dummy file device support. BUG= Review-Url: https://codereview.webrtc.org/2250483002 Cr-Commit-Position: refs/heads/master@{#13790}
This commit is contained in:
@ -173,6 +173,10 @@
|
||||
# Determines whether QUIC code will be built.
|
||||
'use_quic%': 0,
|
||||
|
||||
# By default, use normal platform audio support or dummy audio, but don't
|
||||
# use file-based audio playout and record.
|
||||
'use_dummy_audio_file_devices%': 0,
|
||||
|
||||
'conditions': [
|
||||
# Enable this to build OpenH264 encoder/FFmpeg decoder. This is supported
|
||||
# on all platforms except Android and iOS. Because FFmpeg can be built
|
||||
|
||||
@ -112,6 +112,10 @@ declare_args() {
|
||||
# Determines whether QUIC code will be built.
|
||||
rtc_use_quic = false
|
||||
|
||||
# By default, use normal platform audio support or dummy audio, but don't
|
||||
# use file-based audio playout and record.
|
||||
rtc_use_dummy_audio_file_devices = false
|
||||
|
||||
# FFmpeg must be initialized for |H264DecoderImpl| to work. This can be done
|
||||
# by WebRTC during |H264DecoderImpl::InitDecode| or externally. FFmpeg must
|
||||
# only be initialized once. Projects that initialize FFmpeg externally, such
|
||||
|
||||
@ -95,97 +95,101 @@ source_set("audio_device") {
|
||||
"OpenSLES",
|
||||
]
|
||||
}
|
||||
if (is_linux) {
|
||||
sources += [
|
||||
"linux/alsasymboltable_linux.cc",
|
||||
"linux/alsasymboltable_linux.h",
|
||||
"linux/audio_device_alsa_linux.cc",
|
||||
"linux/audio_device_alsa_linux.h",
|
||||
"linux/audio_mixer_manager_alsa_linux.cc",
|
||||
"linux/audio_mixer_manager_alsa_linux.h",
|
||||
"linux/latebindingsymboltable_linux.cc",
|
||||
"linux/latebindingsymboltable_linux.h",
|
||||
]
|
||||
defines += [ "LINUX_ALSA" ]
|
||||
libs = [
|
||||
"dl",
|
||||
"X11",
|
||||
]
|
||||
if (rtc_include_pulse_audio) {
|
||||
if (rtc_use_dummy_audio_file_devices) {
|
||||
defines += [ "WEBRTC_DUMMY_FILE_DEVICES" ]
|
||||
} else {
|
||||
if (is_linux) {
|
||||
sources += [
|
||||
"linux/audio_device_pulse_linux.cc",
|
||||
"linux/audio_device_pulse_linux.h",
|
||||
"linux/audio_mixer_manager_pulse_linux.cc",
|
||||
"linux/audio_mixer_manager_pulse_linux.h",
|
||||
"linux/pulseaudiosymboltable_linux.cc",
|
||||
"linux/pulseaudiosymboltable_linux.h",
|
||||
"linux/alsasymboltable_linux.cc",
|
||||
"linux/alsasymboltable_linux.h",
|
||||
"linux/audio_device_alsa_linux.cc",
|
||||
"linux/audio_device_alsa_linux.h",
|
||||
"linux/audio_mixer_manager_alsa_linux.cc",
|
||||
"linux/audio_mixer_manager_alsa_linux.h",
|
||||
"linux/latebindingsymboltable_linux.cc",
|
||||
"linux/latebindingsymboltable_linux.h",
|
||||
]
|
||||
defines += [ "LINUX_PULSE" ]
|
||||
defines += [ "LINUX_ALSA" ]
|
||||
libs = [
|
||||
"dl",
|
||||
"X11",
|
||||
]
|
||||
if (rtc_include_pulse_audio) {
|
||||
sources += [
|
||||
"linux/audio_device_pulse_linux.cc",
|
||||
"linux/audio_device_pulse_linux.h",
|
||||
"linux/audio_mixer_manager_pulse_linux.cc",
|
||||
"linux/audio_mixer_manager_pulse_linux.h",
|
||||
"linux/pulseaudiosymboltable_linux.cc",
|
||||
"linux/pulseaudiosymboltable_linux.h",
|
||||
]
|
||||
defines += [ "LINUX_PULSE" ]
|
||||
}
|
||||
}
|
||||
}
|
||||
if (is_mac) {
|
||||
sources += [
|
||||
"mac/audio_device_mac.cc",
|
||||
"mac/audio_device_mac.h",
|
||||
"mac/audio_mixer_manager_mac.cc",
|
||||
"mac/audio_mixer_manager_mac.h",
|
||||
"mac/portaudio/pa_memorybarrier.h",
|
||||
"mac/portaudio/pa_ringbuffer.c",
|
||||
"mac/portaudio/pa_ringbuffer.h",
|
||||
]
|
||||
libs = [
|
||||
"AudioToolbox.framework",
|
||||
"CoreAudio.framework",
|
||||
if (is_mac) {
|
||||
sources += [
|
||||
"mac/audio_device_mac.cc",
|
||||
"mac/audio_device_mac.h",
|
||||
"mac/audio_mixer_manager_mac.cc",
|
||||
"mac/audio_mixer_manager_mac.h",
|
||||
"mac/portaudio/pa_memorybarrier.h",
|
||||
"mac/portaudio/pa_ringbuffer.c",
|
||||
"mac/portaudio/pa_ringbuffer.h",
|
||||
]
|
||||
libs = [
|
||||
"AudioToolbox.framework",
|
||||
"CoreAudio.framework",
|
||||
|
||||
# Needed for CGEventSourceKeyState in audio_device_mac.cc:
|
||||
"CoreGraphics.framework",
|
||||
]
|
||||
}
|
||||
if (is_ios) {
|
||||
public_deps = [
|
||||
"../../sdk:rtc_sdk_common_objc",
|
||||
]
|
||||
sources += [
|
||||
"ios/audio_device_ios.h",
|
||||
"ios/audio_device_ios.mm",
|
||||
"ios/audio_device_not_implemented_ios.mm",
|
||||
"ios/audio_session_observer.h",
|
||||
"ios/objc/RTCAudioSession+Configuration.mm",
|
||||
"ios/objc/RTCAudioSession+Private.h",
|
||||
"ios/objc/RTCAudioSession.h",
|
||||
"ios/objc/RTCAudioSession.mm",
|
||||
"ios/objc/RTCAudioSessionConfiguration.h",
|
||||
"ios/objc/RTCAudioSessionConfiguration.m",
|
||||
"ios/objc/RTCAudioSessionDelegateAdapter.h",
|
||||
"ios/objc/RTCAudioSessionDelegateAdapter.mm",
|
||||
"ios/voice_processing_audio_unit.h",
|
||||
"ios/voice_processing_audio_unit.mm",
|
||||
]
|
||||
configs += [ "//build/config/compiler:enable_arc" ]
|
||||
# Needed for CGEventSourceKeyState in audio_device_mac.cc:
|
||||
"CoreGraphics.framework",
|
||||
]
|
||||
}
|
||||
if (is_ios) {
|
||||
public_deps = [
|
||||
"../../sdk:rtc_sdk_common_objc",
|
||||
]
|
||||
sources += [
|
||||
"ios/audio_device_ios.h",
|
||||
"ios/audio_device_ios.mm",
|
||||
"ios/audio_device_not_implemented_ios.mm",
|
||||
"ios/audio_session_observer.h",
|
||||
"ios/objc/RTCAudioSession+Configuration.mm",
|
||||
"ios/objc/RTCAudioSession+Private.h",
|
||||
"ios/objc/RTCAudioSession.h",
|
||||
"ios/objc/RTCAudioSession.mm",
|
||||
"ios/objc/RTCAudioSessionConfiguration.h",
|
||||
"ios/objc/RTCAudioSessionConfiguration.m",
|
||||
"ios/objc/RTCAudioSessionDelegateAdapter.h",
|
||||
"ios/objc/RTCAudioSessionDelegateAdapter.mm",
|
||||
"ios/voice_processing_audio_unit.h",
|
||||
"ios/voice_processing_audio_unit.mm",
|
||||
]
|
||||
configs += [ "//build/config/compiler:enable_arc" ]
|
||||
|
||||
libs = [
|
||||
"AudioToolbox.framework",
|
||||
"AVFoundation.framework",
|
||||
"Foundation.framework",
|
||||
"UIKit.framework",
|
||||
]
|
||||
}
|
||||
if (is_win) {
|
||||
sources += [
|
||||
"win/audio_device_core_win.cc",
|
||||
"win/audio_device_core_win.h",
|
||||
"win/audio_device_wave_win.cc",
|
||||
"win/audio_device_wave_win.h",
|
||||
"win/audio_mixer_manager_win.cc",
|
||||
"win/audio_mixer_manager_win.h",
|
||||
]
|
||||
libs = [
|
||||
# Required for the built-in WASAPI AEC.
|
||||
"dmoguids.lib",
|
||||
"wmcodecdspuuid.lib",
|
||||
"amstrmid.lib",
|
||||
"msdmo.lib",
|
||||
]
|
||||
libs = [
|
||||
"AudioToolbox.framework",
|
||||
"AVFoundation.framework",
|
||||
"Foundation.framework",
|
||||
"UIKit.framework",
|
||||
]
|
||||
}
|
||||
if (is_win) {
|
||||
sources += [
|
||||
"win/audio_device_core_win.cc",
|
||||
"win/audio_device_core_win.h",
|
||||
"win/audio_device_wave_win.cc",
|
||||
"win/audio_device_wave_win.h",
|
||||
"win/audio_mixer_manager_win.cc",
|
||||
"win/audio_mixer_manager_win.h",
|
||||
]
|
||||
libs = [
|
||||
# Required for the built-in WASAPI AEC.
|
||||
"dmoguids.lib",
|
||||
"wmcodecdspuuid.lib",
|
||||
"amstrmid.lib",
|
||||
"msdmo.lib",
|
||||
]
|
||||
}
|
||||
}
|
||||
} else {
|
||||
defines = [ "WEBRTC_DUMMY_AUDIO_BUILD" ]
|
||||
|
||||
@ -93,158 +93,166 @@
|
||||
'<(webrtc_root)/system_wrappers/system_wrappers.gyp:metrics_default',
|
||||
],
|
||||
'conditions': [
|
||||
['OS=="android"', {
|
||||
'sources': [
|
||||
'android/audio_device_template.h',
|
||||
'android/audio_manager.cc',
|
||||
'android/audio_manager.h',
|
||||
'android/audio_record_jni.cc',
|
||||
'android/audio_record_jni.h',
|
||||
'android/audio_track_jni.cc',
|
||||
'android/audio_track_jni.h',
|
||||
'android/build_info.cc',
|
||||
'android/build_info.h',
|
||||
'android/opensles_common.cc',
|
||||
'android/opensles_common.h',
|
||||
'android/opensles_player.cc',
|
||||
'android/opensles_player.h',
|
||||
],
|
||||
'link_settings': {
|
||||
'libraries': [
|
||||
'-llog',
|
||||
'-lOpenSLES',
|
||||
],
|
||||
},
|
||||
}],
|
||||
['OS=="linux"', {
|
||||
'sources': [
|
||||
'linux/alsasymboltable_linux.cc',
|
||||
'linux/alsasymboltable_linux.h',
|
||||
'linux/audio_device_alsa_linux.cc',
|
||||
'linux/audio_device_alsa_linux.h',
|
||||
'linux/audio_mixer_manager_alsa_linux.cc',
|
||||
'linux/audio_mixer_manager_alsa_linux.h',
|
||||
'linux/latebindingsymboltable_linux.cc',
|
||||
'linux/latebindingsymboltable_linux.h',
|
||||
],
|
||||
['use_dummy_audio_file_devices==1', {
|
||||
'defines': [
|
||||
'LINUX_ALSA',
|
||||
'WEBRTC_DUMMY_FILE_DEVICES',
|
||||
],
|
||||
'link_settings': {
|
||||
'libraries': [
|
||||
'-ldl','-lX11',
|
||||
],
|
||||
},
|
||||
}, { # use_dummy_audio_file_devices==0, so use a platform device.
|
||||
'conditions': [
|
||||
['include_pulse_audio==1', {
|
||||
'defines': [
|
||||
'LINUX_PULSE',
|
||||
],
|
||||
['OS=="android"', {
|
||||
'sources': [
|
||||
'linux/audio_device_pulse_linux.cc',
|
||||
'linux/audio_device_pulse_linux.h',
|
||||
'linux/audio_mixer_manager_pulse_linux.cc',
|
||||
'linux/audio_mixer_manager_pulse_linux.h',
|
||||
'linux/pulseaudiosymboltable_linux.cc',
|
||||
'linux/pulseaudiosymboltable_linux.h',
|
||||
'android/audio_device_template.h',
|
||||
'android/audio_manager.cc',
|
||||
'android/audio_manager.h',
|
||||
'android/audio_record_jni.cc',
|
||||
'android/audio_record_jni.h',
|
||||
'android/audio_track_jni.cc',
|
||||
'android/audio_track_jni.h',
|
||||
'android/build_info.cc',
|
||||
'android/build_info.h',
|
||||
'android/opensles_common.cc',
|
||||
'android/opensles_common.h',
|
||||
'android/opensles_player.cc',
|
||||
'android/opensles_player.h',
|
||||
],
|
||||
'link_settings': {
|
||||
'libraries': [
|
||||
'-llog',
|
||||
'-lOpenSLES',
|
||||
],
|
||||
},
|
||||
}],
|
||||
['OS=="linux"', {
|
||||
'sources': [
|
||||
'linux/alsasymboltable_linux.cc',
|
||||
'linux/alsasymboltable_linux.h',
|
||||
'linux/audio_device_alsa_linux.cc',
|
||||
'linux/audio_device_alsa_linux.h',
|
||||
'linux/audio_mixer_manager_alsa_linux.cc',
|
||||
'linux/audio_mixer_manager_alsa_linux.h',
|
||||
'linux/latebindingsymboltable_linux.cc',
|
||||
'linux/latebindingsymboltable_linux.h',
|
||||
],
|
||||
'defines': [
|
||||
'LINUX_ALSA',
|
||||
],
|
||||
'link_settings': {
|
||||
'libraries': [
|
||||
'-ldl','-lX11',
|
||||
],
|
||||
},
|
||||
'conditions': [
|
||||
['include_pulse_audio==1', {
|
||||
'defines': [
|
||||
'LINUX_PULSE',
|
||||
],
|
||||
'sources': [
|
||||
'linux/audio_device_pulse_linux.cc',
|
||||
'linux/audio_device_pulse_linux.h',
|
||||
'linux/audio_mixer_manager_pulse_linux.cc',
|
||||
'linux/audio_mixer_manager_pulse_linux.h',
|
||||
'linux/pulseaudiosymboltable_linux.cc',
|
||||
'linux/pulseaudiosymboltable_linux.h',
|
||||
],
|
||||
}],
|
||||
],
|
||||
}],
|
||||
],
|
||||
}],
|
||||
['OS=="mac"', {
|
||||
'sources': [
|
||||
'mac/audio_device_mac.cc',
|
||||
'mac/audio_device_mac.h',
|
||||
'mac/audio_mixer_manager_mac.cc',
|
||||
'mac/audio_mixer_manager_mac.h',
|
||||
'mac/portaudio/pa_memorybarrier.h',
|
||||
'mac/portaudio/pa_ringbuffer.c',
|
||||
'mac/portaudio/pa_ringbuffer.h',
|
||||
],
|
||||
'link_settings': {
|
||||
'libraries': [
|
||||
'$(SDKROOT)/System/Library/Frameworks/AudioToolbox.framework',
|
||||
'$(SDKROOT)/System/Library/Frameworks/CoreAudio.framework',
|
||||
],
|
||||
},
|
||||
}],
|
||||
['OS=="ios"', {
|
||||
'dependencies': [
|
||||
'<(webrtc_root)/sdk/sdk.gyp:rtc_sdk_common_objc',
|
||||
],
|
||||
'export_dependent_settings': [
|
||||
'<(webrtc_root)/sdk/sdk.gyp:rtc_sdk_common_objc',
|
||||
],
|
||||
'sources': [
|
||||
'ios/audio_device_ios.h',
|
||||
'ios/audio_device_ios.mm',
|
||||
'ios/audio_device_not_implemented_ios.mm',
|
||||
'ios/audio_session_observer.h',
|
||||
'ios/objc/RTCAudioSession+Configuration.mm',
|
||||
'ios/objc/RTCAudioSession+Private.h',
|
||||
'ios/objc/RTCAudioSession.h',
|
||||
'ios/objc/RTCAudioSession.mm',
|
||||
'ios/objc/RTCAudioSessionConfiguration.h',
|
||||
'ios/objc/RTCAudioSessionConfiguration.m',
|
||||
'ios/objc/RTCAudioSessionDelegateAdapter.h',
|
||||
'ios/objc/RTCAudioSessionDelegateAdapter.mm',
|
||||
'ios/voice_processing_audio_unit.h',
|
||||
'ios/voice_processing_audio_unit.mm',
|
||||
],
|
||||
'xcode_settings': {
|
||||
'CLANG_ENABLE_OBJC_ARC': 'YES',
|
||||
},
|
||||
'link_settings': {
|
||||
'xcode_settings': {
|
||||
'OTHER_LDFLAGS': [
|
||||
'-framework AudioToolbox',
|
||||
'-framework AVFoundation',
|
||||
'-framework Foundation',
|
||||
'-framework UIKit',
|
||||
['OS=="mac"', {
|
||||
'sources': [
|
||||
'mac/audio_device_mac.cc',
|
||||
'mac/audio_device_mac.h',
|
||||
'mac/audio_mixer_manager_mac.cc',
|
||||
'mac/audio_mixer_manager_mac.h',
|
||||
'mac/portaudio/pa_memorybarrier.h',
|
||||
'mac/portaudio/pa_ringbuffer.c',
|
||||
'mac/portaudio/pa_ringbuffer.h',
|
||||
],
|
||||
},
|
||||
},
|
||||
}],
|
||||
['OS=="win"', {
|
||||
'sources': [
|
||||
'win/audio_device_core_win.cc',
|
||||
'win/audio_device_core_win.h',
|
||||
'win/audio_device_wave_win.cc',
|
||||
'win/audio_device_wave_win.h',
|
||||
'win/audio_mixer_manager_win.cc',
|
||||
'win/audio_mixer_manager_win.h',
|
||||
],
|
||||
'link_settings': {
|
||||
'libraries': [
|
||||
# Required for the built-in WASAPI AEC.
|
||||
'-ldmoguids.lib',
|
||||
'-lwmcodecdspuuid.lib',
|
||||
'-lamstrmid.lib',
|
||||
'-lmsdmo.lib',
|
||||
],
|
||||
},
|
||||
}],
|
||||
['OS=="win" and clang==1', {
|
||||
'msvs_settings': {
|
||||
'VCCLCompilerTool': {
|
||||
'AdditionalOptions': [
|
||||
# Disable warnings failing when compiling with Clang on Windows.
|
||||
# https://bugs.chromium.org/p/webrtc/issues/detail?id=5366
|
||||
'-Wno-bool-conversion',
|
||||
'-Wno-delete-non-virtual-dtor',
|
||||
'-Wno-logical-op-parentheses',
|
||||
'-Wno-microsoft-extra-qualification',
|
||||
'-Wno-microsoft-goto',
|
||||
'-Wno-missing-braces',
|
||||
'-Wno-parentheses-equality',
|
||||
'-Wno-reorder',
|
||||
'-Wno-shift-overflow',
|
||||
'-Wno-tautological-compare',
|
||||
'-Wno-unused-private-field',
|
||||
'link_settings': {
|
||||
'libraries': [
|
||||
'$(SDKROOT)/System/Library/Frameworks/AudioToolbox.framework',
|
||||
'$(SDKROOT)/System/Library/Frameworks/CoreAudio.framework',
|
||||
],
|
||||
},
|
||||
}],
|
||||
['OS=="ios"', {
|
||||
'dependencies': [
|
||||
'<(webrtc_root)/sdk/sdk.gyp:rtc_sdk_common_objc',
|
||||
],
|
||||
},
|
||||
},
|
||||
}],
|
||||
'export_dependent_settings': [
|
||||
'<(webrtc_root)/sdk/sdk.gyp:rtc_sdk_common_objc',
|
||||
],
|
||||
'sources': [
|
||||
'ios/audio_device_ios.h',
|
||||
'ios/audio_device_ios.mm',
|
||||
'ios/audio_device_not_implemented_ios.mm',
|
||||
'ios/audio_session_observer.h',
|
||||
'ios/objc/RTCAudioSession+Configuration.mm',
|
||||
'ios/objc/RTCAudioSession+Private.h',
|
||||
'ios/objc/RTCAudioSession.h',
|
||||
'ios/objc/RTCAudioSession.mm',
|
||||
'ios/objc/RTCAudioSessionConfiguration.h',
|
||||
'ios/objc/RTCAudioSessionConfiguration.m',
|
||||
'ios/objc/RTCAudioSessionDelegateAdapter.h',
|
||||
'ios/objc/RTCAudioSessionDelegateAdapter.mm',
|
||||
'ios/voice_processing_audio_unit.h',
|
||||
'ios/voice_processing_audio_unit.mm',
|
||||
],
|
||||
'xcode_settings': {
|
||||
'CLANG_ENABLE_OBJC_ARC': 'YES',
|
||||
},
|
||||
'link_settings': {
|
||||
'xcode_settings': {
|
||||
'OTHER_LDFLAGS': [
|
||||
'-framework AudioToolbox',
|
||||
'-framework AVFoundation',
|
||||
'-framework Foundation',
|
||||
'-framework UIKit',
|
||||
],
|
||||
},
|
||||
},
|
||||
}],
|
||||
['OS=="win"', {
|
||||
'sources': [
|
||||
'win/audio_device_core_win.cc',
|
||||
'win/audio_device_core_win.h',
|
||||
'win/audio_device_wave_win.cc',
|
||||
'win/audio_device_wave_win.h',
|
||||
'win/audio_mixer_manager_win.cc',
|
||||
'win/audio_mixer_manager_win.h',
|
||||
],
|
||||
'link_settings': {
|
||||
'libraries': [
|
||||
# Required for the built-in WASAPI AEC.
|
||||
'-ldmoguids.lib',
|
||||
'-lwmcodecdspuuid.lib',
|
||||
'-lamstrmid.lib',
|
||||
'-lmsdmo.lib',
|
||||
],
|
||||
},
|
||||
}],
|
||||
['OS=="win" and clang==1', {
|
||||
'msvs_settings': {
|
||||
'VCCLCompilerTool': {
|
||||
'AdditionalOptions': [
|
||||
# Disable warnings failing when compiling with Clang on Windows.
|
||||
# https://bugs.chromium.org/p/webrtc/issues/detail?id=5366
|
||||
'-Wno-bool-conversion',
|
||||
'-Wno-delete-non-virtual-dtor',
|
||||
'-Wno-logical-op-parentheses',
|
||||
'-Wno-microsoft-extra-qualification',
|
||||
'-Wno-microsoft-goto',
|
||||
'-Wno-missing-braces',
|
||||
'-Wno-parentheses-equality',
|
||||
'-Wno-reorder',
|
||||
'-Wno-shift-overflow',
|
||||
'-Wno-tautological-compare',
|
||||
'-Wno-unused-private-field',
|
||||
],
|
||||
},
|
||||
},
|
||||
}],
|
||||
], # conditions (for non-dummy devices)
|
||||
}], # use_dummy_audio_file_devices check
|
||||
], # conditions
|
||||
}], # include_internal_audio_device==1
|
||||
], # conditions
|
||||
|
||||
Reference in New Issue
Block a user