kjellander@webrtc.org | 1227ab8 | 2014-06-23 19:21:07 +0000 | [diff] [blame] | 1 | # Copyright (c) 2014 The WebRTC project authors. All Rights Reserved. |
| 2 | # |
| 3 | # Use of this source code is governed by a BSD-style license |
| 4 | # that can be found in the LICENSE file in the root of the source |
| 5 | # tree. An additional intellectual property rights grant can be found |
| 6 | # in the file PATENTS. All contributing project authors may |
| 7 | # be found in the AUTHORS file in the root of the source tree. |
| 8 | |
| 9 | import("../../build/webrtc.gni") |
| 10 | |
kjellander@webrtc.org | c4870bb | 2014-09-01 04:24:11 +0000 | [diff] [blame] | 11 | config("audio_device_config") { |
| 12 | include_dirs = [ |
Henrik Kjellander | ff761fb | 2015-11-04 08:31:52 +0100 | [diff] [blame] | 13 | "../include", |
kjellander@webrtc.org | c4870bb | 2014-09-01 04:24:11 +0000 | [diff] [blame] | 14 | "include", |
| 15 | "dummy", # Contains dummy audio device implementations. |
| 16 | ] |
kjellander | 95177d1 | 2016-04-07 00:13:58 -0700 | [diff] [blame] | 17 | if (is_ios) { |
| 18 | # GN orders flags on a target before flags from configs. In order to be able |
| 19 | # suppress the -Wthread-safety-analysis warning, it has come from a config |
| 20 | # and can't be on the target directly. |
| 21 | # TODO(tkchin): Remove after fixing |
| 22 | # https://bugs.chromium.org/p/webrtc/issues/detail?id=5748 |
| 23 | cflags = [ "-Wno-thread-safety-analysis" ] |
| 24 | } |
kjellander@webrtc.org | 1227ab8 | 2014-06-23 19:21:07 +0000 | [diff] [blame] | 25 | } |
kjellander@webrtc.org | c4870bb | 2014-09-01 04:24:11 +0000 | [diff] [blame] | 26 | |
ehmaldonado | d02fe4b | 2016-08-26 13:31:24 -0700 | [diff] [blame] | 27 | config("audio_device_warnings_config") { |
| 28 | if (is_win && is_clang) { |
| 29 | cflags = [ |
| 30 | # Disable warnings failing when compiling with Clang on Windows. |
| 31 | # https://bugs.chromium.org/p/webrtc/issues/detail?id=5366 |
| 32 | "-Wno-bool-conversion", |
| 33 | "-Wno-delete-non-virtual-dtor", |
| 34 | "-Wno-logical-op-parentheses", |
| 35 | "-Wno-microsoft-extra-qualification", |
| 36 | "-Wno-microsoft-goto", |
| 37 | "-Wno-missing-braces", |
| 38 | "-Wno-parentheses-equality", |
| 39 | "-Wno-reorder", |
| 40 | "-Wno-shift-overflow", |
| 41 | "-Wno-tautological-compare", |
| 42 | |
| 43 | # See https://bugs.chromium.org/p/webrtc/issues/detail?id=6265 |
| 44 | # for -Wno-thread-safety-analysis |
| 45 | "-Wno-thread-safety-analysis", |
| 46 | "-Wno-unused-private-field", |
| 47 | ] |
| 48 | } |
| 49 | } |
| 50 | |
ehmaldonado | 38a2132 | 2016-09-02 04:10:34 -0700 | [diff] [blame^] | 51 | rtc_source_set("audio_device") { |
ehmaldonado | d02fe4b | 2016-08-26 13:31:24 -0700 | [diff] [blame] | 52 | configs += [ "../..:common_config" ] |
| 53 | public_configs = [ |
| 54 | "../..:common_inherited_config", |
| 55 | ":audio_device_config", |
| 56 | ] |
| 57 | |
Zeke Chin | b3fb71c | 2016-02-18 15:44:07 -0800 | [diff] [blame] | 58 | deps = [ |
| 59 | "../..:webrtc_common", |
Max Morin | 84cab20 | 2016-07-01 13:35:19 +0200 | [diff] [blame] | 60 | "../../base:rtc_base", |
Zeke Chin | b3fb71c | 2016-02-18 15:44:07 -0800 | [diff] [blame] | 61 | "../../base:rtc_base_approved", |
maxmorin | 6910537 | 2016-08-16 02:17:44 -0700 | [diff] [blame] | 62 | "../../base:rtc_task_queue", |
Zeke Chin | b3fb71c | 2016-02-18 15:44:07 -0800 | [diff] [blame] | 63 | "../../common_audio", |
| 64 | "../../system_wrappers", |
| 65 | "../utility", |
| 66 | ] |
| 67 | |
kjellander@webrtc.org | c4870bb | 2014-09-01 04:24:11 +0000 | [diff] [blame] | 68 | sources = [ |
kjellander@webrtc.org | c4870bb | 2014-09-01 04:24:11 +0000 | [diff] [blame] | 69 | "audio_device_buffer.cc", |
| 70 | "audio_device_buffer.h", |
Henrik Kjellander | 57e5fd2 | 2015-05-25 12:55:39 +0200 | [diff] [blame] | 71 | "audio_device_config.h", |
kjellander@webrtc.org | c4870bb | 2014-09-01 04:24:11 +0000 | [diff] [blame] | 72 | "audio_device_generic.cc", |
| 73 | "audio_device_generic.h", |
kjellander@webrtc.org | c4870bb | 2014-09-01 04:24:11 +0000 | [diff] [blame] | 74 | "dummy/audio_device_dummy.cc", |
| 75 | "dummy/audio_device_dummy.h", |
kjellander@webrtc.org | c4870bb | 2014-09-01 04:24:11 +0000 | [diff] [blame] | 76 | "dummy/file_audio_device.cc", |
| 77 | "dummy/file_audio_device.h", |
henrika | 86d907c | 2015-09-07 16:09:50 +0200 | [diff] [blame] | 78 | "fine_audio_buffer.cc", |
| 79 | "fine_audio_buffer.h", |
Henrik Kjellander | 57e5fd2 | 2015-05-25 12:55:39 +0200 | [diff] [blame] | 80 | "include/audio_device.h", |
| 81 | "include/audio_device_defines.h", |
kjellander@webrtc.org | c4870bb | 2014-09-01 04:24:11 +0000 | [diff] [blame] | 82 | ] |
| 83 | |
kjellander@webrtc.org | c4870bb | 2014-09-01 04:24:11 +0000 | [diff] [blame] | 84 | include_dirs = [] |
| 85 | if (is_linux) { |
| 86 | include_dirs += [ "linux" ] |
| 87 | } |
| 88 | if (is_ios) { |
| 89 | include_dirs += [ "ios" ] |
| 90 | } |
| 91 | if (is_mac) { |
| 92 | include_dirs += [ "mac" ] |
| 93 | } |
| 94 | if (is_win) { |
| 95 | include_dirs += [ "win" ] |
| 96 | } |
| 97 | if (is_android) { |
| 98 | include_dirs += [ "android" ] |
| 99 | } |
Henrik Kjellander | b79472a | 2015-10-14 08:13:58 +0200 | [diff] [blame] | 100 | defines = [] |
kjellander | 70bed7d | 2015-11-23 17:23:44 -0800 | [diff] [blame] | 101 | cflags = [] |
kjellander@webrtc.org | 6d08ca6 | 2014-09-07 17:36:10 +0000 | [diff] [blame] | 102 | if (rtc_include_internal_audio_device) { |
kjellander@webrtc.org | c4870bb | 2014-09-01 04:24:11 +0000 | [diff] [blame] | 103 | sources += [ |
Tommi | 931e658 | 2015-05-20 09:44:38 +0200 | [diff] [blame] | 104 | "audio_device_impl.cc", |
| 105 | "audio_device_impl.h", |
kjellander@webrtc.org | c4870bb | 2014-09-01 04:24:11 +0000 | [diff] [blame] | 106 | ] |
kjellander | a46a4c9 | 2016-01-07 02:54:22 -0800 | [diff] [blame] | 107 | if (is_android) { |
| 108 | sources += [ |
| 109 | "android/audio_device_template.h", |
| 110 | "android/audio_manager.cc", |
| 111 | "android/audio_manager.h", |
| 112 | "android/audio_record_jni.cc", |
| 113 | "android/audio_record_jni.h", |
| 114 | "android/audio_track_jni.cc", |
| 115 | "android/audio_track_jni.h", |
| 116 | "android/build_info.cc", |
| 117 | "android/build_info.h", |
| 118 | "android/opensles_common.cc", |
| 119 | "android/opensles_common.h", |
| 120 | "android/opensles_player.cc", |
| 121 | "android/opensles_player.h", |
| 122 | ] |
| 123 | libs = [ |
| 124 | "log", |
| 125 | "OpenSLES", |
| 126 | ] |
| 127 | } |
noahric | c594aa61 | 2016-08-16 18:21:18 -0700 | [diff] [blame] | 128 | if (rtc_use_dummy_audio_file_devices) { |
| 129 | defines += [ "WEBRTC_DUMMY_FILE_DEVICES" ] |
| 130 | } else { |
| 131 | if (is_linux) { |
kjellander@webrtc.org | c4870bb | 2014-09-01 04:24:11 +0000 | [diff] [blame] | 132 | sources += [ |
noahric | c594aa61 | 2016-08-16 18:21:18 -0700 | [diff] [blame] | 133 | "linux/alsasymboltable_linux.cc", |
| 134 | "linux/alsasymboltable_linux.h", |
| 135 | "linux/audio_device_alsa_linux.cc", |
| 136 | "linux/audio_device_alsa_linux.h", |
| 137 | "linux/audio_mixer_manager_alsa_linux.cc", |
| 138 | "linux/audio_mixer_manager_alsa_linux.h", |
| 139 | "linux/latebindingsymboltable_linux.cc", |
| 140 | "linux/latebindingsymboltable_linux.h", |
kjellander@webrtc.org | c4870bb | 2014-09-01 04:24:11 +0000 | [diff] [blame] | 141 | ] |
noahric | c594aa61 | 2016-08-16 18:21:18 -0700 | [diff] [blame] | 142 | defines += [ "LINUX_ALSA" ] |
| 143 | libs = [ |
| 144 | "dl", |
| 145 | "X11", |
| 146 | ] |
| 147 | if (rtc_include_pulse_audio) { |
| 148 | sources += [ |
| 149 | "linux/audio_device_pulse_linux.cc", |
| 150 | "linux/audio_device_pulse_linux.h", |
| 151 | "linux/audio_mixer_manager_pulse_linux.cc", |
| 152 | "linux/audio_mixer_manager_pulse_linux.h", |
| 153 | "linux/pulseaudiosymboltable_linux.cc", |
| 154 | "linux/pulseaudiosymboltable_linux.h", |
| 155 | ] |
| 156 | defines += [ "LINUX_PULSE" ] |
| 157 | } |
kjellander@webrtc.org | c4870bb | 2014-09-01 04:24:11 +0000 | [diff] [blame] | 158 | } |
noahric | c594aa61 | 2016-08-16 18:21:18 -0700 | [diff] [blame] | 159 | if (is_mac) { |
| 160 | sources += [ |
| 161 | "mac/audio_device_mac.cc", |
| 162 | "mac/audio_device_mac.h", |
| 163 | "mac/audio_mixer_manager_mac.cc", |
| 164 | "mac/audio_mixer_manager_mac.h", |
| 165 | "mac/portaudio/pa_memorybarrier.h", |
| 166 | "mac/portaudio/pa_ringbuffer.c", |
| 167 | "mac/portaudio/pa_ringbuffer.h", |
| 168 | ] |
| 169 | libs = [ |
maxmorin | 2ec45b9 | 2016-08-24 06:51:09 -0700 | [diff] [blame] | 170 | # Needed for CoreGraphics: |
| 171 | "ApplicationServices.framework", |
| 172 | |
noahric | c594aa61 | 2016-08-16 18:21:18 -0700 | [diff] [blame] | 173 | "AudioToolbox.framework", |
| 174 | "CoreAudio.framework", |
kjellander | bac0412 | 2016-06-02 02:18:48 -0700 | [diff] [blame] | 175 | |
noahric | c594aa61 | 2016-08-16 18:21:18 -0700 | [diff] [blame] | 176 | # Needed for CGEventSourceKeyState in audio_device_mac.cc: |
| 177 | "CoreGraphics.framework", |
| 178 | ] |
| 179 | } |
| 180 | if (is_ios) { |
| 181 | public_deps = [ |
| 182 | "../../sdk:rtc_sdk_common_objc", |
| 183 | ] |
| 184 | sources += [ |
| 185 | "ios/audio_device_ios.h", |
| 186 | "ios/audio_device_ios.mm", |
| 187 | "ios/audio_device_not_implemented_ios.mm", |
| 188 | "ios/audio_session_observer.h", |
| 189 | "ios/objc/RTCAudioSession+Configuration.mm", |
| 190 | "ios/objc/RTCAudioSession+Private.h", |
| 191 | "ios/objc/RTCAudioSession.h", |
| 192 | "ios/objc/RTCAudioSession.mm", |
| 193 | "ios/objc/RTCAudioSessionConfiguration.h", |
| 194 | "ios/objc/RTCAudioSessionConfiguration.m", |
| 195 | "ios/objc/RTCAudioSessionDelegateAdapter.h", |
| 196 | "ios/objc/RTCAudioSessionDelegateAdapter.mm", |
| 197 | "ios/voice_processing_audio_unit.h", |
| 198 | "ios/voice_processing_audio_unit.mm", |
| 199 | ] |
| 200 | configs += [ "//build/config/compiler:enable_arc" ] |
kjellander | 95177d1 | 2016-04-07 00:13:58 -0700 | [diff] [blame] | 201 | |
noahric | c594aa61 | 2016-08-16 18:21:18 -0700 | [diff] [blame] | 202 | libs = [ |
| 203 | "AudioToolbox.framework", |
| 204 | "AVFoundation.framework", |
| 205 | "Foundation.framework", |
| 206 | "UIKit.framework", |
| 207 | ] |
| 208 | } |
| 209 | if (is_win) { |
| 210 | sources += [ |
| 211 | "win/audio_device_core_win.cc", |
| 212 | "win/audio_device_core_win.h", |
| 213 | "win/audio_device_wave_win.cc", |
| 214 | "win/audio_device_wave_win.h", |
| 215 | "win/audio_mixer_manager_win.cc", |
| 216 | "win/audio_mixer_manager_win.h", |
| 217 | ] |
| 218 | libs = [ |
| 219 | # Required for the built-in WASAPI AEC. |
| 220 | "dmoguids.lib", |
| 221 | "wmcodecdspuuid.lib", |
| 222 | "amstrmid.lib", |
| 223 | "msdmo.lib", |
| 224 | ] |
| 225 | } |
ehmaldonado | d02fe4b | 2016-08-26 13:31:24 -0700 | [diff] [blame] | 226 | configs += [ ":audio_device_warnings_config" ] |
kjellander@webrtc.org | c4870bb | 2014-09-01 04:24:11 +0000 | [diff] [blame] | 227 | } |
| 228 | } else { |
| 229 | defines = [ "WEBRTC_DUMMY_AUDIO_BUILD" ] |
| 230 | } |
| 231 | |
| 232 | if (!build_with_chromium) { |
| 233 | sources += [ |
| 234 | # Do not link these into Chrome since they contain static data. |
| 235 | "dummy/file_audio_device_factory.cc", |
| 236 | "dummy/file_audio_device_factory.h", |
| 237 | ] |
| 238 | } |
| 239 | |
| 240 | if (is_clang) { |
| 241 | # Suppress warnings from Chrome's Clang plugins. |
| 242 | # See http://code.google.com/p/webrtc/issues/detail?id=163 for details. |
ehmaldonado | 38a2132 | 2016-09-02 04:10:34 -0700 | [diff] [blame^] | 243 | suppressed_configs += [ "//build/config/clang:find_bad_constructs" ] |
kjellander@webrtc.org | c4870bb | 2014-09-01 04:24:11 +0000 | [diff] [blame] | 244 | } |
kjellander@webrtc.org | c4870bb | 2014-09-01 04:24:11 +0000 | [diff] [blame] | 245 | } |
maxmorin | 6910537 | 2016-08-16 02:17:44 -0700 | [diff] [blame] | 246 | |
| 247 | # These tests do not work on ios, see |
| 248 | # https://bugs.chromium.org/p/webrtc/issues/detail?id=4755 |
| 249 | if (rtc_include_tests && !is_ios) { |
ehmaldonado | 38a2132 | 2016-09-02 04:10:34 -0700 | [diff] [blame^] | 250 | rtc_executable("audio_device_tests") { |
maxmorin | 6910537 | 2016-08-16 02:17:44 -0700 | [diff] [blame] | 251 | testonly = true |
| 252 | sources = [ |
| 253 | "test/audio_device_test_api.cc", |
| 254 | "test/audio_device_test_defines.h", |
| 255 | ] |
| 256 | deps = [ |
| 257 | ":audio_device", |
| 258 | "../..:webrtc_common", |
| 259 | "../../system_wrappers", |
| 260 | "../../test:test_support", |
| 261 | "../../test:test_support_main", |
| 262 | "../rtp_rtcp", |
| 263 | "../utility", |
ehmaldonado | bcba64a | 2016-08-19 02:11:07 -0700 | [diff] [blame] | 264 | "//build/config/sanitizers:deps", |
maxmorin | 6910537 | 2016-08-16 02:17:44 -0700 | [diff] [blame] | 265 | "//testing/gtest", |
| 266 | ] |
| 267 | configs += [ "../..:common_config" ] |
| 268 | public_configs = [ |
| 269 | "../..:common_inherited_config", |
| 270 | ":audio_device_config", |
| 271 | ] |
| 272 | } |
| 273 | } |