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 | |
mbonadei | 9aa3f0a | 2017-01-24 06:58:22 -0800 | [diff] [blame] | 9 | import("../../webrtc.gni") |
kjellander@webrtc.org | 1227ab8 | 2014-06-23 19:21:07 +0000 | [diff] [blame] | 10 | |
mbonadei | 438062b | 2017-01-09 02:37:21 -0800 | [diff] [blame] | 11 | if (is_android) { |
| 12 | import("//build/config/android/config.gni") |
| 13 | import("//build/config/android/rules.gni") |
| 14 | } |
| 15 | |
kjellander@webrtc.org | c4870bb | 2014-09-01 04:24:11 +0000 | [diff] [blame] | 16 | config("audio_device_config") { |
| 17 | include_dirs = [ |
Henrik Kjellander | ff761fb | 2015-11-04 08:31:52 +0100 | [diff] [blame] | 18 | "../include", |
kjellander@webrtc.org | c4870bb | 2014-09-01 04:24:11 +0000 | [diff] [blame] | 19 | "include", |
| 20 | "dummy", # Contains dummy audio device implementations. |
| 21 | ] |
kjellander@webrtc.org | 1227ab8 | 2014-06-23 19:21:07 +0000 | [diff] [blame] | 22 | } |
kjellander@webrtc.org | c4870bb | 2014-09-01 04:24:11 +0000 | [diff] [blame] | 23 | |
ehmaldonado | d02fe4b | 2016-08-26 13:31:24 -0700 | [diff] [blame] | 24 | config("audio_device_warnings_config") { |
| 25 | if (is_win && is_clang) { |
| 26 | cflags = [ |
| 27 | # Disable warnings failing when compiling with Clang on Windows. |
| 28 | # https://bugs.chromium.org/p/webrtc/issues/detail?id=5366 |
| 29 | "-Wno-bool-conversion", |
| 30 | "-Wno-delete-non-virtual-dtor", |
| 31 | "-Wno-logical-op-parentheses", |
| 32 | "-Wno-microsoft-extra-qualification", |
| 33 | "-Wno-microsoft-goto", |
ehmaldonado | d02fe4b | 2016-08-26 13:31:24 -0700 | [diff] [blame] | 34 | "-Wno-reorder", |
| 35 | "-Wno-shift-overflow", |
ehmaldonado | d02fe4b | 2016-08-26 13:31:24 -0700 | [diff] [blame] | 36 | ] |
| 37 | } |
| 38 | } |
| 39 | |
mbonadei | bcc2176 | 2017-09-12 04:45:24 -0700 | [diff] [blame] | 40 | rtc_source_set("audio_device") { |
Per Kjellander | a7f2d84 | 2018-01-10 15:54:53 +0000 | [diff] [blame] | 41 | visibility = [ "*" ] |
mbonadei | bcc2176 | 2017-09-12 04:45:24 -0700 | [diff] [blame] | 42 | public_deps = [ |
Paulina Hensman | 7bd79a0 | 2018-03-15 12:44:12 +0100 | [diff] [blame] | 43 | ":audio_device_api", |
| 44 | |
| 45 | # Deprecated. |
| 46 | # TODO(webrtc:7452): Remove this public dep. audio_device_impl should |
| 47 | # be depended on directly if needed. |
| 48 | ":audio_device_impl", |
mbonadei | bcc2176 | 2017-09-12 04:45:24 -0700 | [diff] [blame] | 49 | ] |
mbonadei | bcc2176 | 2017-09-12 04:45:24 -0700 | [diff] [blame] | 50 | } |
| 51 | |
| 52 | if (rtc_include_internal_audio_device && is_ios) { |
| 53 | rtc_source_set("audio_device_ios_objc") { |
Paulina Hensman | 7bd79a0 | 2018-03-15 12:44:12 +0100 | [diff] [blame] | 54 | visibility = [ |
| 55 | ":audio_device_impl", |
| 56 | ":audio_device_ios_objc_unittests", |
| 57 | ] |
mbonadei | bcc2176 | 2017-09-12 04:45:24 -0700 | [diff] [blame] | 58 | sources = [ |
| 59 | "ios/audio_device_ios.h", |
| 60 | "ios/audio_device_ios.mm", |
| 61 | "ios/audio_device_not_implemented_ios.mm", |
| 62 | "ios/audio_session_observer.h", |
Patrik Höglund | 6d3ed71 | 2018-01-05 11:51:05 +0100 | [diff] [blame] | 63 | "ios/objc/RTCAudioSession.h", |
| 64 | "ios/objc/RTCAudioSessionConfiguration.h", |
mbonadei | bcc2176 | 2017-09-12 04:45:24 -0700 | [diff] [blame] | 65 | "ios/objc/RTCAudioSessionDelegateAdapter.h", |
| 66 | "ios/objc/RTCAudioSessionDelegateAdapter.mm", |
| 67 | "ios/voice_processing_audio_unit.h", |
| 68 | "ios/voice_processing_audio_unit.mm", |
| 69 | ] |
| 70 | libs = [ |
| 71 | "AudioToolbox.framework", |
| 72 | "AVFoundation.framework", |
| 73 | "Foundation.framework", |
| 74 | "UIKit.framework", |
| 75 | ] |
| 76 | deps = [ |
Paulina Hensman | 7bd79a0 | 2018-03-15 12:44:12 +0100 | [diff] [blame] | 77 | ":audio_device_api", |
| 78 | ":audio_device_buffer", |
mbonadei | bcc2176 | 2017-09-12 04:45:24 -0700 | [diff] [blame] | 79 | ":audio_device_generic", |
| 80 | "../../api:array_view", |
Patrik Höglund | a8005cf | 2017-12-13 16:05:42 +0100 | [diff] [blame] | 81 | "../../rtc_base:checks", |
mbonadei | bcc2176 | 2017-09-12 04:45:24 -0700 | [diff] [blame] | 82 | "../../rtc_base:gtest_prod", |
| 83 | "../../rtc_base:rtc_base", |
Karl Wiberg | 80ba333 | 2018-02-05 10:33:35 +0100 | [diff] [blame] | 84 | "../../rtc_base/system:fallthrough", |
mbonadei | bcc2176 | 2017-09-12 04:45:24 -0700 | [diff] [blame] | 85 | "../../sdk:audio_objc", |
| 86 | "../../sdk:common_objc", |
| 87 | "../../system_wrappers:metrics_api", |
| 88 | ] |
| 89 | if (!build_with_chromium && is_clang) { |
| 90 | # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163). |
| 91 | suppressed_configs += [ "//build/config/clang:find_bad_constructs" ] |
| 92 | } |
| 93 | } |
| 94 | } |
| 95 | |
Paulina Hensman | 7bd79a0 | 2018-03-15 12:44:12 +0100 | [diff] [blame] | 96 | rtc_source_set("audio_device_api") { |
Peter Hanspers | 43619a4 | 2018-05-14 10:41:10 +0000 | [diff] [blame] | 97 | visibility = [ |
| 98 | ":audio_device", |
| 99 | ":audio_device_buffer", |
| 100 | ":audio_device_impl", |
| 101 | ":audio_device_ios_objc", |
| 102 | ":audio_device_generic", |
| 103 | ] |
Paulina Hensman | 7bd79a0 | 2018-03-15 12:44:12 +0100 | [diff] [blame] | 104 | sources = [ |
| 105 | "include/audio_device.h", |
| 106 | "include/audio_device_defines.h", |
| 107 | ] |
| 108 | deps = [ |
| 109 | "../../:typedefs", |
| 110 | "../../rtc_base:checks", |
| 111 | "../../rtc_base:deprecation", |
| 112 | "../../rtc_base:rtc_base_approved", |
henrika | 883d00f | 2018-03-16 10:09:49 +0100 | [diff] [blame] | 113 | "../../rtc_base:stringutils", |
Paulina Hensman | 7bd79a0 | 2018-03-15 12:44:12 +0100 | [diff] [blame] | 114 | ] |
| 115 | if (!build_with_chromium && is_clang) { |
| 116 | # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163). |
| 117 | suppressed_configs += [ "//build/config/clang:find_bad_constructs" ] |
| 118 | } |
| 119 | } |
| 120 | |
| 121 | rtc_source_set("audio_device_buffer") { |
| 122 | sources = [ |
| 123 | "audio_device_buffer.cc", |
| 124 | "audio_device_buffer.h", |
| 125 | "audio_device_config.h", |
| 126 | "fine_audio_buffer.cc", |
| 127 | "fine_audio_buffer.h", |
| 128 | ] |
| 129 | deps = [ |
| 130 | ":audio_device_api", |
| 131 | "../../:typedefs", |
| 132 | "../../api:array_view", |
| 133 | "../../common_audio:common_audio_c", |
| 134 | "../../rtc_base:checks", |
| 135 | "../../rtc_base:rtc_base_approved", |
| 136 | "../../rtc_base:rtc_task_queue", |
| 137 | "../../system_wrappers", |
| 138 | "../../system_wrappers:metrics_api", |
| 139 | ] |
| 140 | if (!build_with_chromium && is_clang) { |
| 141 | # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163). |
| 142 | suppressed_configs += [ "//build/config/clang:find_bad_constructs" ] |
| 143 | } |
| 144 | } |
| 145 | |
| 146 | rtc_source_set("audio_device_generic") { |
| 147 | sources = [ |
| 148 | "audio_device_generic.cc", |
| 149 | "audio_device_generic.h", |
| 150 | ] |
| 151 | deps = [ |
| 152 | ":audio_device_api", |
| 153 | ":audio_device_buffer", |
| 154 | "../../rtc_base:rtc_base_approved", |
| 155 | ] |
| 156 | if (!build_with_chromium && is_clang) { |
| 157 | # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163). |
| 158 | suppressed_configs += [ "//build/config/clang:find_bad_constructs" ] |
| 159 | } |
| 160 | } |
| 161 | |
| 162 | # Contains default implementations of webrtc::AudioDeviceModule for Windows, |
| 163 | # Linux, Mac, iOS and Android. |
| 164 | rtc_source_set("audio_device_impl") { |
| 165 | visibility = [ "*" ] |
ehmaldonado | e9cc686 | 2016-09-05 06:10:18 -0700 | [diff] [blame] | 166 | public_configs = [ ":audio_device_config" ] |
ehmaldonado | d02fe4b | 2016-08-26 13:31:24 -0700 | [diff] [blame] | 167 | |
Zeke Chin | b3fb71c | 2016-02-18 15:44:07 -0800 | [diff] [blame] | 168 | deps = [ |
Paulina Hensman | 7bd79a0 | 2018-03-15 12:44:12 +0100 | [diff] [blame] | 169 | ":audio_device_api", |
| 170 | ":audio_device_buffer", |
| 171 | ":audio_device_generic", |
Zeke Chin | b3fb71c | 2016-02-18 15:44:07 -0800 | [diff] [blame] | 172 | "../..:webrtc_common", |
Patrik Höglund | 3e11343 | 2017-12-15 14:40:10 +0100 | [diff] [blame] | 173 | "../../:typedefs", |
kwiberg | 529662a | 2017-09-04 05:43:17 -0700 | [diff] [blame] | 174 | "../../api:array_view", |
Zeke Chin | b3fb71c | 2016-02-18 15:44:07 -0800 | [diff] [blame] | 175 | "../../common_audio", |
Mirko Bonadei | dbbb33c | 2018-02-05 15:50:41 +0100 | [diff] [blame] | 176 | "../../common_audio:common_audio_c", |
Patrik Höglund | a8005cf | 2017-12-13 16:05:42 +0100 | [diff] [blame] | 177 | "../../rtc_base:checks", |
Fredrik Solenberg | 2a87797 | 2017-12-15 16:42:15 +0100 | [diff] [blame] | 178 | "../../rtc_base:deprecation", |
ehmaldonado | f6a861a | 2017-07-19 10:40:47 -0700 | [diff] [blame] | 179 | "../../rtc_base:rtc_base_approved", |
| 180 | "../../rtc_base:rtc_task_queue", |
Karl Wiberg | 6a4d411 | 2018-03-23 10:39:34 +0100 | [diff] [blame] | 181 | "../../rtc_base/system:file_wrapper", |
Zeke Chin | b3fb71c | 2016-02-18 15:44:07 -0800 | [diff] [blame] | 182 | "../../system_wrappers", |
Mirko Bonadei | a498ae8 | 2017-12-06 09:17:14 +0100 | [diff] [blame] | 183 | "../../system_wrappers:metrics_api", |
Zeke Chin | b3fb71c | 2016-02-18 15:44:07 -0800 | [diff] [blame] | 184 | "../utility", |
| 185 | ] |
Paulina Hensman | 7bd79a0 | 2018-03-15 12:44:12 +0100 | [diff] [blame] | 186 | if (rtc_include_internal_audio_device && is_ios) { |
| 187 | deps += [ ":audio_device_ios_objc" ] |
| 188 | } |
Zeke Chin | b3fb71c | 2016-02-18 15:44:07 -0800 | [diff] [blame] | 189 | |
kjellander@webrtc.org | c4870bb | 2014-09-01 04:24:11 +0000 | [diff] [blame] | 190 | sources = [ |
kjellander@webrtc.org | c4870bb | 2014-09-01 04:24:11 +0000 | [diff] [blame] | 191 | "dummy/audio_device_dummy.cc", |
| 192 | "dummy/audio_device_dummy.h", |
kjellander@webrtc.org | c4870bb | 2014-09-01 04:24:11 +0000 | [diff] [blame] | 193 | "dummy/file_audio_device.cc", |
| 194 | "dummy/file_audio_device.h", |
Patrik Höglund | d420903 | 2018-01-02 15:00:11 +0100 | [diff] [blame] | 195 | "include/fake_audio_device.h", |
Artem Titov | f2afa57 | 2018-03-13 13:25:19 +0100 | [diff] [blame] | 196 | "include/test_audio_device.cc", |
Artem Titov | 0f03973 | 2018-03-07 12:20:51 +0100 | [diff] [blame] | 197 | "include/test_audio_device.h", |
kjellander@webrtc.org | c4870bb | 2014-09-01 04:24:11 +0000 | [diff] [blame] | 198 | ] |
| 199 | |
Dan Minor | 9c68613 | 2018-01-15 10:20:00 -0500 | [diff] [blame] | 200 | if (build_with_mozilla) { |
| 201 | sources += [ |
| 202 | "opensl/single_rw_fifo.cc", |
| 203 | "opensl/single_rw_fifo.h", |
| 204 | ] |
| 205 | } |
| 206 | |
kjellander@webrtc.org | c4870bb | 2014-09-01 04:24:11 +0000 | [diff] [blame] | 207 | include_dirs = [] |
| 208 | if (is_linux) { |
| 209 | include_dirs += [ "linux" ] |
| 210 | } |
| 211 | if (is_ios) { |
| 212 | include_dirs += [ "ios" ] |
| 213 | } |
| 214 | if (is_mac) { |
| 215 | include_dirs += [ "mac" ] |
| 216 | } |
| 217 | if (is_win) { |
| 218 | include_dirs += [ "win" ] |
| 219 | } |
| 220 | if (is_android) { |
| 221 | include_dirs += [ "android" ] |
| 222 | } |
Henrik Kjellander | b79472a | 2015-10-14 08:13:58 +0200 | [diff] [blame] | 223 | defines = [] |
kjellander | 70bed7d | 2015-11-23 17:23:44 -0800 | [diff] [blame] | 224 | cflags = [] |
henrika | 7be7883 | 2017-06-13 17:34:16 +0200 | [diff] [blame] | 225 | if (rtc_audio_device_plays_sinus_tone) { |
| 226 | defines += [ "AUDIO_DEVICE_PLAYS_SINUS_TONE" ] |
| 227 | } |
henrika | 883d00f | 2018-03-16 10:09:49 +0100 | [diff] [blame] | 228 | if (rtc_enable_android_aaudio) { |
| 229 | defines += [ "AUDIO_DEVICE_INCLUDE_ANDROID_AAUDIO" ] |
| 230 | } |
kjellander@webrtc.org | 6d08ca6 | 2014-09-07 17:36:10 +0000 | [diff] [blame] | 231 | if (rtc_include_internal_audio_device) { |
Mirko Bonadei | 7fc0259 | 2018-02-06 14:08:01 +0100 | [diff] [blame] | 232 | # TODO(bugs.webrtc.org/8850): remove this when the circular dependency will be fixed. |
| 233 | check_includes = false |
kjellander@webrtc.org | c4870bb | 2014-09-01 04:24:11 +0000 | [diff] [blame] | 234 | sources += [ |
Lu Liu | 4b62001 | 2017-04-06 10:17:01 -0700 | [diff] [blame] | 235 | "audio_device_data_observer.cc", |
Tommi | 931e658 | 2015-05-20 09:44:38 +0200 | [diff] [blame] | 236 | "audio_device_impl.cc", |
| 237 | "audio_device_impl.h", |
Lu Liu | 4b62001 | 2017-04-06 10:17:01 -0700 | [diff] [blame] | 238 | "include/audio_device_data_observer.h", |
kjellander@webrtc.org | c4870bb | 2014-09-01 04:24:11 +0000 | [diff] [blame] | 239 | ] |
kjellander | a46a4c9 | 2016-01-07 02:54:22 -0800 | [diff] [blame] | 240 | if (is_android) { |
| 241 | sources += [ |
Patrik Höglund | d420903 | 2018-01-02 15:00:11 +0100 | [diff] [blame] | 242 | "android/audio_common.h", |
kjellander | a46a4c9 | 2016-01-07 02:54:22 -0800 | [diff] [blame] | 243 | "android/audio_device_template.h", |
| 244 | "android/audio_manager.cc", |
| 245 | "android/audio_manager.h", |
| 246 | "android/audio_record_jni.cc", |
| 247 | "android/audio_record_jni.h", |
| 248 | "android/audio_track_jni.cc", |
| 249 | "android/audio_track_jni.h", |
| 250 | "android/build_info.cc", |
| 251 | "android/build_info.h", |
| 252 | "android/opensles_common.cc", |
| 253 | "android/opensles_common.h", |
| 254 | "android/opensles_player.cc", |
| 255 | "android/opensles_player.h", |
henrika | 918b554 | 2016-09-19 15:44:09 +0200 | [diff] [blame] | 256 | "android/opensles_recorder.cc", |
| 257 | "android/opensles_recorder.h", |
kjellander | a46a4c9 | 2016-01-07 02:54:22 -0800 | [diff] [blame] | 258 | ] |
| 259 | libs = [ |
| 260 | "log", |
| 261 | "OpenSLES", |
| 262 | ] |
henrika | 883d00f | 2018-03-16 10:09:49 +0100 | [diff] [blame] | 263 | if (rtc_enable_android_aaudio) { |
| 264 | sources += [ |
| 265 | "android/aaudio_player.cc", |
| 266 | "android/aaudio_player.h", |
| 267 | "android/aaudio_recorder.cc", |
| 268 | "android/aaudio_recorder.h", |
| 269 | "android/aaudio_wrapper.cc", |
| 270 | "android/aaudio_wrapper.h", |
| 271 | ] |
| 272 | libs += [ "aaudio" ] |
| 273 | } |
Dan Minor | 9c68613 | 2018-01-15 10:20:00 -0500 | [diff] [blame] | 274 | |
| 275 | if (build_with_mozilla) { |
| 276 | include_dirs += [ |
| 277 | "/config/external/nspr", |
| 278 | "/nsprpub/lib/ds", |
| 279 | "/nsprpub/pr/include", |
| 280 | ] |
| 281 | } |
kjellander | a46a4c9 | 2016-01-07 02:54:22 -0800 | [diff] [blame] | 282 | } |
noahric | c594aa61 | 2016-08-16 18:21:18 -0700 | [diff] [blame] | 283 | if (rtc_use_dummy_audio_file_devices) { |
| 284 | defines += [ "WEBRTC_DUMMY_FILE_DEVICES" ] |
| 285 | } else { |
| 286 | if (is_linux) { |
kjellander@webrtc.org | c4870bb | 2014-09-01 04:24:11 +0000 | [diff] [blame] | 287 | sources += [ |
noahric | c594aa61 | 2016-08-16 18:21:18 -0700 | [diff] [blame] | 288 | "linux/alsasymboltable_linux.cc", |
| 289 | "linux/alsasymboltable_linux.h", |
| 290 | "linux/audio_device_alsa_linux.cc", |
| 291 | "linux/audio_device_alsa_linux.h", |
| 292 | "linux/audio_mixer_manager_alsa_linux.cc", |
| 293 | "linux/audio_mixer_manager_alsa_linux.h", |
| 294 | "linux/latebindingsymboltable_linux.cc", |
| 295 | "linux/latebindingsymboltable_linux.h", |
kjellander@webrtc.org | c4870bb | 2014-09-01 04:24:11 +0000 | [diff] [blame] | 296 | ] |
noahric | c594aa61 | 2016-08-16 18:21:18 -0700 | [diff] [blame] | 297 | defines += [ "LINUX_ALSA" ] |
kjellander | c41d0c4 | 2017-05-30 12:06:04 -0700 | [diff] [blame] | 298 | libs = [ "dl" ] |
Joachim Bauch | 75f18fc | 2017-12-20 21:25:47 +0100 | [diff] [blame] | 299 | if (rtc_use_x11) { |
kjellander | c41d0c4 | 2017-05-30 12:06:04 -0700 | [diff] [blame] | 300 | libs += [ "X11" ] |
Joachim Bauch | 75f18fc | 2017-12-20 21:25:47 +0100 | [diff] [blame] | 301 | defines += [ "WEBRTC_USE_X11" ] |
kjellander | c41d0c4 | 2017-05-30 12:06:04 -0700 | [diff] [blame] | 302 | } |
noahric | c594aa61 | 2016-08-16 18:21:18 -0700 | [diff] [blame] | 303 | if (rtc_include_pulse_audio) { |
| 304 | sources += [ |
| 305 | "linux/audio_device_pulse_linux.cc", |
| 306 | "linux/audio_device_pulse_linux.h", |
| 307 | "linux/audio_mixer_manager_pulse_linux.cc", |
| 308 | "linux/audio_mixer_manager_pulse_linux.h", |
| 309 | "linux/pulseaudiosymboltable_linux.cc", |
| 310 | "linux/pulseaudiosymboltable_linux.h", |
| 311 | ] |
| 312 | defines += [ "LINUX_PULSE" ] |
| 313 | } |
kjellander@webrtc.org | c4870bb | 2014-09-01 04:24:11 +0000 | [diff] [blame] | 314 | } |
noahric | c594aa61 | 2016-08-16 18:21:18 -0700 | [diff] [blame] | 315 | if (is_mac) { |
| 316 | sources += [ |
| 317 | "mac/audio_device_mac.cc", |
| 318 | "mac/audio_device_mac.h", |
| 319 | "mac/audio_mixer_manager_mac.cc", |
| 320 | "mac/audio_mixer_manager_mac.h", |
noahric | c594aa61 | 2016-08-16 18:21:18 -0700 | [diff] [blame] | 321 | ] |
kjellander | 7439f97 | 2016-12-05 22:47:46 -0800 | [diff] [blame] | 322 | deps += [ ":mac_portaudio" ] |
noahric | c594aa61 | 2016-08-16 18:21:18 -0700 | [diff] [blame] | 323 | libs = [ |
maxmorin | 2ec45b9 | 2016-08-24 06:51:09 -0700 | [diff] [blame] | 324 | # Needed for CoreGraphics: |
| 325 | "ApplicationServices.framework", |
| 326 | |
noahric | c594aa61 | 2016-08-16 18:21:18 -0700 | [diff] [blame] | 327 | "AudioToolbox.framework", |
| 328 | "CoreAudio.framework", |
kjellander | bac0412 | 2016-06-02 02:18:48 -0700 | [diff] [blame] | 329 | |
noahric | c594aa61 | 2016-08-16 18:21:18 -0700 | [diff] [blame] | 330 | # Needed for CGEventSourceKeyState in audio_device_mac.cc: |
| 331 | "CoreGraphics.framework", |
| 332 | ] |
| 333 | } |
noahric | c594aa61 | 2016-08-16 18:21:18 -0700 | [diff] [blame] | 334 | if (is_win) { |
| 335 | sources += [ |
| 336 | "win/audio_device_core_win.cc", |
| 337 | "win/audio_device_core_win.h", |
noahric | c594aa61 | 2016-08-16 18:21:18 -0700 | [diff] [blame] | 338 | ] |
| 339 | libs = [ |
| 340 | # Required for the built-in WASAPI AEC. |
| 341 | "dmoguids.lib", |
| 342 | "wmcodecdspuuid.lib", |
| 343 | "amstrmid.lib", |
| 344 | "msdmo.lib", |
| 345 | ] |
| 346 | } |
ehmaldonado | d02fe4b | 2016-08-26 13:31:24 -0700 | [diff] [blame] | 347 | configs += [ ":audio_device_warnings_config" ] |
kjellander@webrtc.org | c4870bb | 2014-09-01 04:24:11 +0000 | [diff] [blame] | 348 | } |
| 349 | } else { |
| 350 | defines = [ "WEBRTC_DUMMY_AUDIO_BUILD" ] |
| 351 | } |
| 352 | |
| 353 | if (!build_with_chromium) { |
| 354 | sources += [ |
| 355 | # Do not link these into Chrome since they contain static data. |
| 356 | "dummy/file_audio_device_factory.cc", |
| 357 | "dummy/file_audio_device_factory.h", |
| 358 | ] |
| 359 | } |
| 360 | |
kjellander | e40a7ee | 2016-10-16 23:56:12 -0700 | [diff] [blame] | 361 | if (!build_with_chromium && is_clang) { |
| 362 | # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163). |
ehmaldonado | 38a2132 | 2016-09-02 04:10:34 -0700 | [diff] [blame] | 363 | suppressed_configs += [ "//build/config/clang:find_bad_constructs" ] |
kjellander@webrtc.org | c4870bb | 2014-09-01 04:24:11 +0000 | [diff] [blame] | 364 | } |
kjellander@webrtc.org | c4870bb | 2014-09-01 04:24:11 +0000 | [diff] [blame] | 365 | } |
maxmorin | 6910537 | 2016-08-16 02:17:44 -0700 | [diff] [blame] | 366 | |
kjellander | 7439f97 | 2016-12-05 22:47:46 -0800 | [diff] [blame] | 367 | rtc_source_set("mac_portaudio") { |
| 368 | visibility = [ ":*" ] # Only targets in this file can depend on this. |
| 369 | sources = [ |
| 370 | "mac/portaudio/pa_memorybarrier.h", |
| 371 | "mac/portaudio/pa_ringbuffer.c", |
| 372 | "mac/portaudio/pa_ringbuffer.h", |
| 373 | ] |
| 374 | } |
| 375 | |
mbonadei | 3edccb9 | 2017-06-01 04:47:20 -0700 | [diff] [blame] | 376 | rtc_source_set("mock_audio_device") { |
| 377 | testonly = true |
| 378 | sources = [ |
| 379 | "include/mock_audio_device.h", |
| 380 | "include/mock_audio_transport.h", |
Patrik Höglund | d420903 | 2018-01-02 15:00:11 +0100 | [diff] [blame] | 381 | "mock_audio_device_buffer.h", |
mbonadei | 3edccb9 | 2017-06-01 04:47:20 -0700 | [diff] [blame] | 382 | ] |
| 383 | deps = [ |
| 384 | ":audio_device", |
Paulina Hensman | 7bd79a0 | 2018-03-15 12:44:12 +0100 | [diff] [blame] | 385 | ":audio_device_buffer", |
| 386 | ":audio_device_impl", |
mbonadei | 3edccb9 | 2017-06-01 04:47:20 -0700 | [diff] [blame] | 387 | "../../test:test_support", |
| 388 | ] |
mbonadei | 3edccb9 | 2017-06-01 04:47:20 -0700 | [diff] [blame] | 389 | } |
| 390 | |
aleloi | 5de52fd | 2016-11-10 01:05:34 -0800 | [diff] [blame] | 391 | if (rtc_include_tests) { |
mbonadei | bcc2176 | 2017-09-12 04:45:24 -0700 | [diff] [blame] | 392 | # TODO(kthelgason): Reenable these tests on simulator. |
| 393 | # See bugs.webrtc.org/7812 |
| 394 | if (is_ios && !use_ios_simulator) { |
| 395 | rtc_source_set("audio_device_ios_objc_unittests") { |
| 396 | testonly = true |
| 397 | visibility = [ ":*" ] |
| 398 | sources = [ |
| 399 | "ios/audio_device_unittest_ios.mm", |
| 400 | ] |
| 401 | deps = [ |
| 402 | ":audio_device", |
Paulina Hensman | 7bd79a0 | 2018-03-15 12:44:12 +0100 | [diff] [blame] | 403 | ":audio_device_buffer", |
| 404 | ":audio_device_impl", |
| 405 | ":audio_device_ios_objc", |
mbonadei | bcc2176 | 2017-09-12 04:45:24 -0700 | [diff] [blame] | 406 | ":mock_audio_device", |
| 407 | "../../rtc_base:rtc_base_approved", |
| 408 | "../../sdk:audio_objc", |
| 409 | "../../system_wrappers", |
Patrik Höglund | 7696bef | 2018-03-15 15:05:39 +0100 | [diff] [blame] | 410 | "../../test:fileutils", |
mbonadei | bcc2176 | 2017-09-12 04:45:24 -0700 | [diff] [blame] | 411 | "../../test:test_support", |
mbonadei | bcc2176 | 2017-09-12 04:45:24 -0700 | [diff] [blame] | 412 | "//third_party/ocmock", |
| 413 | ] |
| 414 | if (!build_with_chromium && is_clang) { |
| 415 | # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163). |
| 416 | suppressed_configs += [ "//build/config/clang:find_bad_constructs" ] |
| 417 | } |
| 418 | } |
| 419 | } |
| 420 | |
ehmaldonado | 3626865 | 2017-01-19 08:27:11 -0800 | [diff] [blame] | 421 | rtc_source_set("audio_device_unittests") { |
| 422 | testonly = true |
kjellander | e0629c0 | 2017-04-25 04:04:50 -0700 | [diff] [blame] | 423 | |
ehmaldonado | 3626865 | 2017-01-19 08:27:11 -0800 | [diff] [blame] | 424 | sources = [ |
| 425 | "fine_audio_buffer_unittest.cc", |
Artem Titov | f2afa57 | 2018-03-13 13:25:19 +0100 | [diff] [blame] | 426 | "include/test_audio_device_unittest.cc", |
ehmaldonado | 3626865 | 2017-01-19 08:27:11 -0800 | [diff] [blame] | 427 | ] |
| 428 | deps = [ |
| 429 | ":audio_device", |
Paulina Hensman | 7bd79a0 | 2018-03-15 12:44:12 +0100 | [diff] [blame] | 430 | ":audio_device_buffer", |
| 431 | ":audio_device_impl", |
ehmaldonado | 3626865 | 2017-01-19 08:27:11 -0800 | [diff] [blame] | 432 | ":mock_audio_device", |
kwiberg | 529662a | 2017-09-04 05:43:17 -0700 | [diff] [blame] | 433 | "../../api:array_view", |
kwiberg | 84f6a3f | 2017-09-05 08:43:13 -0700 | [diff] [blame] | 434 | "../../api:optional", |
Artem Titov | 0f03973 | 2018-03-07 12:20:51 +0100 | [diff] [blame] | 435 | "../../common_audio", |
Patrik Höglund | a8005cf | 2017-12-13 16:05:42 +0100 | [diff] [blame] | 436 | "../../rtc_base:checks", |
ehmaldonado | f6a861a | 2017-07-19 10:40:47 -0700 | [diff] [blame] | 437 | "../../rtc_base:rtc_base_approved", |
mbonadei | bcc2176 | 2017-09-12 04:45:24 -0700 | [diff] [blame] | 438 | "../../system_wrappers", |
Patrik Höglund | 7696bef | 2018-03-15 15:05:39 +0100 | [diff] [blame] | 439 | "../../test:fileutils", |
ehmaldonado | 3626865 | 2017-01-19 08:27:11 -0800 | [diff] [blame] | 440 | "../../test:test_support", |
| 441 | "../utility:utility", |
ehmaldonado | 3626865 | 2017-01-19 08:27:11 -0800 | [diff] [blame] | 442 | ] |
henrika | 1b35bab | 2017-03-29 07:50:19 -0700 | [diff] [blame] | 443 | if (is_linux || is_mac || is_win) { |
henrika | f2f91fa | 2017-03-17 04:26:22 -0700 | [diff] [blame] | 444 | sources += [ "audio_device_unittest.cc" ] |
| 445 | } |
ehmaldonado | 3626865 | 2017-01-19 08:27:11 -0800 | [diff] [blame] | 446 | if (is_android) { |
| 447 | # Need to disable error due to the line in |
| 448 | # base/android/jni_android.h triggering it: |
| 449 | # const BASE_EXPORT jobject GetApplicationContext() |
| 450 | # error: type qualifiers ignored on function return type |
| 451 | cflags = [ "-Wno-ignored-qualifiers" ] |
| 452 | sources += [ |
| 453 | "android/audio_device_unittest.cc", |
| 454 | "android/audio_manager_unittest.cc", |
| 455 | "android/ensure_initialized.cc", |
| 456 | "android/ensure_initialized.h", |
| 457 | ] |
| 458 | deps += [ |
| 459 | "../../../base", |
jianjun.zhu | c024740 | 2017-07-11 06:20:45 -0700 | [diff] [blame] | 460 | "../../sdk/android:libjingle_peerconnection_java", |
ehmaldonado | 3626865 | 2017-01-19 08:27:11 -0800 | [diff] [blame] | 461 | ] |
| 462 | } |
ehmaldonado | 3626865 | 2017-01-19 08:27:11 -0800 | [diff] [blame] | 463 | if (!build_with_chromium && is_clang) { |
| 464 | # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163). |
| 465 | suppressed_configs += [ "//build/config/clang:find_bad_constructs" ] |
| 466 | } |
Joachim Bauch | 5d2bb36 | 2017-12-20 21:19:49 +0100 | [diff] [blame] | 467 | if (!rtc_include_internal_audio_device) { |
| 468 | defines = [ "WEBRTC_DUMMY_AUDIO_BUILD" ] |
| 469 | } |
ehmaldonado | 3626865 | 2017-01-19 08:27:11 -0800 | [diff] [blame] | 470 | } |
maxmorin | 6910537 | 2016-08-16 02:17:44 -0700 | [diff] [blame] | 471 | } |
mbonadei | 438062b | 2017-01-09 02:37:21 -0800 | [diff] [blame] | 472 | |
| 473 | if (!build_with_chromium && is_android) { |
Mirko Bonadei | fbb3b7d | 2017-11-07 15:36:33 +0000 | [diff] [blame] | 474 | rtc_android_library("audio_device_java") { |
mbonadei | b55bd97 | 2017-01-23 01:25:53 -0800 | [diff] [blame] | 475 | java_files = [ |
mbonadei | 438062b | 2017-01-09 02:37:21 -0800 | [diff] [blame] | 476 | "android/java/src/org/webrtc/voiceengine/BuildInfo.java", |
| 477 | "android/java/src/org/webrtc/voiceengine/WebRtcAudioEffects.java", |
| 478 | "android/java/src/org/webrtc/voiceengine/WebRtcAudioManager.java", |
| 479 | "android/java/src/org/webrtc/voiceengine/WebRtcAudioRecord.java", |
| 480 | "android/java/src/org/webrtc/voiceengine/WebRtcAudioTrack.java", |
| 481 | "android/java/src/org/webrtc/voiceengine/WebRtcAudioUtils.java", |
| 482 | ] |
mbonadei | b55bd97 | 2017-01-23 01:25:53 -0800 | [diff] [blame] | 483 | deps = [ |
jianjun.zhu | c024740 | 2017-07-11 06:20:45 -0700 | [diff] [blame] | 484 | "../../rtc_base:base_java", |
mbonadei | b55bd97 | 2017-01-23 01:25:53 -0800 | [diff] [blame] | 485 | ] |
mbonadei | 438062b | 2017-01-09 02:37:21 -0800 | [diff] [blame] | 486 | } |
| 487 | } |