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 | 8d95e3b | 2018-05-15 10:22:36 +0200 | [diff] [blame] | 97 | visibility = [ "*" ] |
Paulina Hensman | 7bd79a0 | 2018-03-15 12:44:12 +0100 | [diff] [blame] | 98 | sources = [ |
| 99 | "include/audio_device.h", |
| 100 | "include/audio_device_defines.h", |
| 101 | ] |
| 102 | deps = [ |
| 103 | "../../:typedefs", |
| 104 | "../../rtc_base:checks", |
| 105 | "../../rtc_base:deprecation", |
| 106 | "../../rtc_base:rtc_base_approved", |
henrika | 883d00f | 2018-03-16 10:09:49 +0100 | [diff] [blame] | 107 | "../../rtc_base:stringutils", |
Paulina Hensman | 7bd79a0 | 2018-03-15 12:44:12 +0100 | [diff] [blame] | 108 | ] |
| 109 | if (!build_with_chromium && is_clang) { |
| 110 | # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163). |
| 111 | suppressed_configs += [ "//build/config/clang:find_bad_constructs" ] |
| 112 | } |
| 113 | } |
| 114 | |
| 115 | rtc_source_set("audio_device_buffer") { |
| 116 | sources = [ |
| 117 | "audio_device_buffer.cc", |
| 118 | "audio_device_buffer.h", |
| 119 | "audio_device_config.h", |
| 120 | "fine_audio_buffer.cc", |
| 121 | "fine_audio_buffer.h", |
| 122 | ] |
| 123 | deps = [ |
| 124 | ":audio_device_api", |
| 125 | "../../:typedefs", |
| 126 | "../../api:array_view", |
| 127 | "../../common_audio:common_audio_c", |
| 128 | "../../rtc_base:checks", |
| 129 | "../../rtc_base:rtc_base_approved", |
| 130 | "../../rtc_base:rtc_task_queue", |
| 131 | "../../system_wrappers", |
| 132 | "../../system_wrappers:metrics_api", |
| 133 | ] |
| 134 | if (!build_with_chromium && is_clang) { |
| 135 | # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163). |
| 136 | suppressed_configs += [ "//build/config/clang:find_bad_constructs" ] |
| 137 | } |
| 138 | } |
| 139 | |
| 140 | rtc_source_set("audio_device_generic") { |
| 141 | sources = [ |
| 142 | "audio_device_generic.cc", |
| 143 | "audio_device_generic.h", |
| 144 | ] |
| 145 | deps = [ |
| 146 | ":audio_device_api", |
| 147 | ":audio_device_buffer", |
| 148 | "../../rtc_base:rtc_base_approved", |
| 149 | ] |
| 150 | if (!build_with_chromium && is_clang) { |
| 151 | # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163). |
| 152 | suppressed_configs += [ "//build/config/clang:find_bad_constructs" ] |
| 153 | } |
| 154 | } |
| 155 | |
henrika | 7e6fcea | 2018-05-18 10:20:58 +0200 | [diff] [blame] | 156 | rtc_source_set("audio_device_name") { |
| 157 | sources = [ |
| 158 | "audio_device_name.cc", |
| 159 | "audio_device_name.h", |
| 160 | ] |
| 161 | } |
| 162 | |
henrika | ec9c745 | 2018-06-08 16:10:03 +0200 | [diff] [blame] | 163 | rtc_source_set("windows_core_audio_utility") { |
| 164 | if (is_win && !build_with_chromium) { |
| 165 | sources = [ |
| 166 | "win/core_audio_utility_win.cc", |
| 167 | "win/core_audio_utility_win.h", |
| 168 | ] |
| 169 | |
| 170 | deps = [ |
| 171 | ":audio_device_api", |
| 172 | ":audio_device_name", |
| 173 | "../../api/units:time_delta", |
| 174 | "../../rtc_base:checks", |
| 175 | "../../rtc_base:rtc_base_approved", |
| 176 | ] |
| 177 | } |
| 178 | } |
| 179 | |
| 180 | # An ADM with a dedicated factory method which does not depend on the |
| 181 | # audio_device_impl target. The goal is to use this new structure and |
| 182 | # gradually phase out the old design. |
| 183 | # TODO(henrika): currently only supported on Windows. |
| 184 | rtc_source_set("audio_device_module_from_input_and_output") { |
| 185 | visibility = [ ":*" ] |
| 186 | |
| 187 | if (is_win && !build_with_chromium) { |
| 188 | sources = [ |
| 189 | "include/audio_device_factory.cc", |
| 190 | "include/audio_device_factory.h", |
| 191 | ] |
| 192 | sources += [ |
| 193 | "win/audio_device_module_win.cc", |
| 194 | "win/audio_device_module_win.h", |
| 195 | "win/core_audio_base_win.cc", |
| 196 | "win/core_audio_base_win.h", |
| 197 | "win/core_audio_input_win.cc", |
| 198 | "win/core_audio_input_win.h", |
| 199 | "win/core_audio_output_win.cc", |
| 200 | "win/core_audio_output_win.h", |
| 201 | ] |
| 202 | |
| 203 | deps = [ |
| 204 | ":audio_device_api", |
| 205 | ":audio_device_buffer", |
| 206 | ":windows_core_audio_utility", |
henrika | ec9c745 | 2018-06-08 16:10:03 +0200 | [diff] [blame] | 207 | "../../rtc_base:checks", |
| 208 | "../../rtc_base:rtc_base_approved", |
Danil Chapovalov | 196100e | 2018-06-21 10:17:24 +0200 | [diff] [blame^] | 209 | "//third_party/abseil-cpp/absl/types:optional", |
henrika | ec9c745 | 2018-06-08 16:10:03 +0200 | [diff] [blame] | 210 | ] |
| 211 | } |
| 212 | } |
| 213 | |
Paulina Hensman | 7bd79a0 | 2018-03-15 12:44:12 +0100 | [diff] [blame] | 214 | # Contains default implementations of webrtc::AudioDeviceModule for Windows, |
| 215 | # Linux, Mac, iOS and Android. |
| 216 | rtc_source_set("audio_device_impl") { |
| 217 | visibility = [ "*" ] |
ehmaldonado | e9cc686 | 2016-09-05 06:10:18 -0700 | [diff] [blame] | 218 | public_configs = [ ":audio_device_config" ] |
ehmaldonado | d02fe4b | 2016-08-26 13:31:24 -0700 | [diff] [blame] | 219 | |
Zeke Chin | b3fb71c | 2016-02-18 15:44:07 -0800 | [diff] [blame] | 220 | deps = [ |
Paulina Hensman | 7bd79a0 | 2018-03-15 12:44:12 +0100 | [diff] [blame] | 221 | ":audio_device_api", |
| 222 | ":audio_device_buffer", |
| 223 | ":audio_device_generic", |
Zeke Chin | b3fb71c | 2016-02-18 15:44:07 -0800 | [diff] [blame] | 224 | "../..:webrtc_common", |
Patrik Höglund | 3e11343 | 2017-12-15 14:40:10 +0100 | [diff] [blame] | 225 | "../../:typedefs", |
kwiberg | 529662a | 2017-09-04 05:43:17 -0700 | [diff] [blame] | 226 | "../../api:array_view", |
Zeke Chin | b3fb71c | 2016-02-18 15:44:07 -0800 | [diff] [blame] | 227 | "../../common_audio", |
Mirko Bonadei | dbbb33c | 2018-02-05 15:50:41 +0100 | [diff] [blame] | 228 | "../../common_audio:common_audio_c", |
Patrik Höglund | a8005cf | 2017-12-13 16:05:42 +0100 | [diff] [blame] | 229 | "../../rtc_base:checks", |
Fredrik Solenberg | 2a87797 | 2017-12-15 16:42:15 +0100 | [diff] [blame] | 230 | "../../rtc_base:deprecation", |
ehmaldonado | f6a861a | 2017-07-19 10:40:47 -0700 | [diff] [blame] | 231 | "../../rtc_base:rtc_base_approved", |
| 232 | "../../rtc_base:rtc_task_queue", |
Karl Wiberg | 6a4d411 | 2018-03-23 10:39:34 +0100 | [diff] [blame] | 233 | "../../rtc_base/system:file_wrapper", |
Zeke Chin | b3fb71c | 2016-02-18 15:44:07 -0800 | [diff] [blame] | 234 | "../../system_wrappers", |
Mirko Bonadei | a498ae8 | 2017-12-06 09:17:14 +0100 | [diff] [blame] | 235 | "../../system_wrappers:metrics_api", |
Zeke Chin | b3fb71c | 2016-02-18 15:44:07 -0800 | [diff] [blame] | 236 | "../utility", |
| 237 | ] |
Paulina Hensman | 7bd79a0 | 2018-03-15 12:44:12 +0100 | [diff] [blame] | 238 | if (rtc_include_internal_audio_device && is_ios) { |
| 239 | deps += [ ":audio_device_ios_objc" ] |
| 240 | } |
Zeke Chin | b3fb71c | 2016-02-18 15:44:07 -0800 | [diff] [blame] | 241 | |
kjellander@webrtc.org | c4870bb | 2014-09-01 04:24:11 +0000 | [diff] [blame] | 242 | sources = [ |
kjellander@webrtc.org | c4870bb | 2014-09-01 04:24:11 +0000 | [diff] [blame] | 243 | "dummy/audio_device_dummy.cc", |
| 244 | "dummy/audio_device_dummy.h", |
kjellander@webrtc.org | c4870bb | 2014-09-01 04:24:11 +0000 | [diff] [blame] | 245 | "dummy/file_audio_device.cc", |
| 246 | "dummy/file_audio_device.h", |
Patrik Höglund | d420903 | 2018-01-02 15:00:11 +0100 | [diff] [blame] | 247 | "include/fake_audio_device.h", |
Artem Titov | f2afa57 | 2018-03-13 13:25:19 +0100 | [diff] [blame] | 248 | "include/test_audio_device.cc", |
Artem Titov | 0f03973 | 2018-03-07 12:20:51 +0100 | [diff] [blame] | 249 | "include/test_audio_device.h", |
kjellander@webrtc.org | c4870bb | 2014-09-01 04:24:11 +0000 | [diff] [blame] | 250 | ] |
| 251 | |
Dan Minor | 9c68613 | 2018-01-15 10:20:00 -0500 | [diff] [blame] | 252 | if (build_with_mozilla) { |
| 253 | sources += [ |
| 254 | "opensl/single_rw_fifo.cc", |
| 255 | "opensl/single_rw_fifo.h", |
| 256 | ] |
| 257 | } |
| 258 | |
kjellander@webrtc.org | c4870bb | 2014-09-01 04:24:11 +0000 | [diff] [blame] | 259 | include_dirs = [] |
| 260 | if (is_linux) { |
| 261 | include_dirs += [ "linux" ] |
| 262 | } |
| 263 | if (is_ios) { |
| 264 | include_dirs += [ "ios" ] |
| 265 | } |
| 266 | if (is_mac) { |
| 267 | include_dirs += [ "mac" ] |
| 268 | } |
| 269 | if (is_win) { |
| 270 | include_dirs += [ "win" ] |
| 271 | } |
| 272 | if (is_android) { |
| 273 | include_dirs += [ "android" ] |
| 274 | } |
Henrik Kjellander | b79472a | 2015-10-14 08:13:58 +0200 | [diff] [blame] | 275 | defines = [] |
kjellander | 70bed7d | 2015-11-23 17:23:44 -0800 | [diff] [blame] | 276 | cflags = [] |
henrika | 7be7883 | 2017-06-13 17:34:16 +0200 | [diff] [blame] | 277 | if (rtc_audio_device_plays_sinus_tone) { |
| 278 | defines += [ "AUDIO_DEVICE_PLAYS_SINUS_TONE" ] |
| 279 | } |
henrika | 883d00f | 2018-03-16 10:09:49 +0100 | [diff] [blame] | 280 | if (rtc_enable_android_aaudio) { |
| 281 | defines += [ "AUDIO_DEVICE_INCLUDE_ANDROID_AAUDIO" ] |
| 282 | } |
kjellander@webrtc.org | 6d08ca6 | 2014-09-07 17:36:10 +0000 | [diff] [blame] | 283 | if (rtc_include_internal_audio_device) { |
Mirko Bonadei | 7fc0259 | 2018-02-06 14:08:01 +0100 | [diff] [blame] | 284 | # TODO(bugs.webrtc.org/8850): remove this when the circular dependency will be fixed. |
| 285 | check_includes = false |
kjellander@webrtc.org | c4870bb | 2014-09-01 04:24:11 +0000 | [diff] [blame] | 286 | sources += [ |
Lu Liu | 4b62001 | 2017-04-06 10:17:01 -0700 | [diff] [blame] | 287 | "audio_device_data_observer.cc", |
Tommi | 931e658 | 2015-05-20 09:44:38 +0200 | [diff] [blame] | 288 | "audio_device_impl.cc", |
| 289 | "audio_device_impl.h", |
Lu Liu | 4b62001 | 2017-04-06 10:17:01 -0700 | [diff] [blame] | 290 | "include/audio_device_data_observer.h", |
kjellander@webrtc.org | c4870bb | 2014-09-01 04:24:11 +0000 | [diff] [blame] | 291 | ] |
kjellander | a46a4c9 | 2016-01-07 02:54:22 -0800 | [diff] [blame] | 292 | if (is_android) { |
| 293 | sources += [ |
Patrik Höglund | d420903 | 2018-01-02 15:00:11 +0100 | [diff] [blame] | 294 | "android/audio_common.h", |
kjellander | a46a4c9 | 2016-01-07 02:54:22 -0800 | [diff] [blame] | 295 | "android/audio_device_template.h", |
| 296 | "android/audio_manager.cc", |
| 297 | "android/audio_manager.h", |
| 298 | "android/audio_record_jni.cc", |
| 299 | "android/audio_record_jni.h", |
| 300 | "android/audio_track_jni.cc", |
| 301 | "android/audio_track_jni.h", |
| 302 | "android/build_info.cc", |
| 303 | "android/build_info.h", |
| 304 | "android/opensles_common.cc", |
| 305 | "android/opensles_common.h", |
| 306 | "android/opensles_player.cc", |
| 307 | "android/opensles_player.h", |
henrika | 918b554 | 2016-09-19 15:44:09 +0200 | [diff] [blame] | 308 | "android/opensles_recorder.cc", |
| 309 | "android/opensles_recorder.h", |
kjellander | a46a4c9 | 2016-01-07 02:54:22 -0800 | [diff] [blame] | 310 | ] |
| 311 | libs = [ |
| 312 | "log", |
| 313 | "OpenSLES", |
| 314 | ] |
henrika | 883d00f | 2018-03-16 10:09:49 +0100 | [diff] [blame] | 315 | if (rtc_enable_android_aaudio) { |
| 316 | sources += [ |
| 317 | "android/aaudio_player.cc", |
| 318 | "android/aaudio_player.h", |
| 319 | "android/aaudio_recorder.cc", |
| 320 | "android/aaudio_recorder.h", |
| 321 | "android/aaudio_wrapper.cc", |
| 322 | "android/aaudio_wrapper.h", |
| 323 | ] |
| 324 | libs += [ "aaudio" ] |
| 325 | } |
Dan Minor | 9c68613 | 2018-01-15 10:20:00 -0500 | [diff] [blame] | 326 | |
| 327 | if (build_with_mozilla) { |
| 328 | include_dirs += [ |
| 329 | "/config/external/nspr", |
| 330 | "/nsprpub/lib/ds", |
| 331 | "/nsprpub/pr/include", |
| 332 | ] |
| 333 | } |
kjellander | a46a4c9 | 2016-01-07 02:54:22 -0800 | [diff] [blame] | 334 | } |
noahric | c594aa61 | 2016-08-16 18:21:18 -0700 | [diff] [blame] | 335 | if (rtc_use_dummy_audio_file_devices) { |
| 336 | defines += [ "WEBRTC_DUMMY_FILE_DEVICES" ] |
| 337 | } else { |
| 338 | if (is_linux) { |
kjellander@webrtc.org | c4870bb | 2014-09-01 04:24:11 +0000 | [diff] [blame] | 339 | sources += [ |
noahric | c594aa61 | 2016-08-16 18:21:18 -0700 | [diff] [blame] | 340 | "linux/alsasymboltable_linux.cc", |
| 341 | "linux/alsasymboltable_linux.h", |
| 342 | "linux/audio_device_alsa_linux.cc", |
| 343 | "linux/audio_device_alsa_linux.h", |
| 344 | "linux/audio_mixer_manager_alsa_linux.cc", |
| 345 | "linux/audio_mixer_manager_alsa_linux.h", |
| 346 | "linux/latebindingsymboltable_linux.cc", |
| 347 | "linux/latebindingsymboltable_linux.h", |
kjellander@webrtc.org | c4870bb | 2014-09-01 04:24:11 +0000 | [diff] [blame] | 348 | ] |
noahric | c594aa61 | 2016-08-16 18:21:18 -0700 | [diff] [blame] | 349 | defines += [ "LINUX_ALSA" ] |
kjellander | c41d0c4 | 2017-05-30 12:06:04 -0700 | [diff] [blame] | 350 | libs = [ "dl" ] |
Joachim Bauch | 75f18fc | 2017-12-20 21:25:47 +0100 | [diff] [blame] | 351 | if (rtc_use_x11) { |
kjellander | c41d0c4 | 2017-05-30 12:06:04 -0700 | [diff] [blame] | 352 | libs += [ "X11" ] |
Joachim Bauch | 75f18fc | 2017-12-20 21:25:47 +0100 | [diff] [blame] | 353 | defines += [ "WEBRTC_USE_X11" ] |
kjellander | c41d0c4 | 2017-05-30 12:06:04 -0700 | [diff] [blame] | 354 | } |
noahric | c594aa61 | 2016-08-16 18:21:18 -0700 | [diff] [blame] | 355 | if (rtc_include_pulse_audio) { |
| 356 | sources += [ |
| 357 | "linux/audio_device_pulse_linux.cc", |
| 358 | "linux/audio_device_pulse_linux.h", |
| 359 | "linux/audio_mixer_manager_pulse_linux.cc", |
| 360 | "linux/audio_mixer_manager_pulse_linux.h", |
| 361 | "linux/pulseaudiosymboltable_linux.cc", |
| 362 | "linux/pulseaudiosymboltable_linux.h", |
| 363 | ] |
| 364 | defines += [ "LINUX_PULSE" ] |
| 365 | } |
kjellander@webrtc.org | c4870bb | 2014-09-01 04:24:11 +0000 | [diff] [blame] | 366 | } |
noahric | c594aa61 | 2016-08-16 18:21:18 -0700 | [diff] [blame] | 367 | if (is_mac) { |
| 368 | sources += [ |
| 369 | "mac/audio_device_mac.cc", |
| 370 | "mac/audio_device_mac.h", |
| 371 | "mac/audio_mixer_manager_mac.cc", |
| 372 | "mac/audio_mixer_manager_mac.h", |
noahric | c594aa61 | 2016-08-16 18:21:18 -0700 | [diff] [blame] | 373 | ] |
kjellander | 7439f97 | 2016-12-05 22:47:46 -0800 | [diff] [blame] | 374 | deps += [ ":mac_portaudio" ] |
noahric | c594aa61 | 2016-08-16 18:21:18 -0700 | [diff] [blame] | 375 | libs = [ |
maxmorin | 2ec45b9 | 2016-08-24 06:51:09 -0700 | [diff] [blame] | 376 | # Needed for CoreGraphics: |
| 377 | "ApplicationServices.framework", |
| 378 | |
noahric | c594aa61 | 2016-08-16 18:21:18 -0700 | [diff] [blame] | 379 | "AudioToolbox.framework", |
| 380 | "CoreAudio.framework", |
kjellander | bac0412 | 2016-06-02 02:18:48 -0700 | [diff] [blame] | 381 | |
noahric | c594aa61 | 2016-08-16 18:21:18 -0700 | [diff] [blame] | 382 | # Needed for CGEventSourceKeyState in audio_device_mac.cc: |
| 383 | "CoreGraphics.framework", |
| 384 | ] |
| 385 | } |
noahric | c594aa61 | 2016-08-16 18:21:18 -0700 | [diff] [blame] | 386 | if (is_win) { |
| 387 | sources += [ |
| 388 | "win/audio_device_core_win.cc", |
| 389 | "win/audio_device_core_win.h", |
noahric | c594aa61 | 2016-08-16 18:21:18 -0700 | [diff] [blame] | 390 | ] |
| 391 | libs = [ |
| 392 | # Required for the built-in WASAPI AEC. |
| 393 | "dmoguids.lib", |
| 394 | "wmcodecdspuuid.lib", |
| 395 | "amstrmid.lib", |
| 396 | "msdmo.lib", |
| 397 | ] |
| 398 | } |
ehmaldonado | d02fe4b | 2016-08-26 13:31:24 -0700 | [diff] [blame] | 399 | configs += [ ":audio_device_warnings_config" ] |
kjellander@webrtc.org | c4870bb | 2014-09-01 04:24:11 +0000 | [diff] [blame] | 400 | } |
| 401 | } else { |
| 402 | defines = [ "WEBRTC_DUMMY_AUDIO_BUILD" ] |
| 403 | } |
| 404 | |
| 405 | if (!build_with_chromium) { |
| 406 | sources += [ |
| 407 | # Do not link these into Chrome since they contain static data. |
| 408 | "dummy/file_audio_device_factory.cc", |
| 409 | "dummy/file_audio_device_factory.h", |
| 410 | ] |
| 411 | } |
| 412 | |
kjellander | e40a7ee | 2016-10-16 23:56:12 -0700 | [diff] [blame] | 413 | if (!build_with_chromium && is_clang) { |
| 414 | # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163). |
ehmaldonado | 38a2132 | 2016-09-02 04:10:34 -0700 | [diff] [blame] | 415 | suppressed_configs += [ "//build/config/clang:find_bad_constructs" ] |
kjellander@webrtc.org | c4870bb | 2014-09-01 04:24:11 +0000 | [diff] [blame] | 416 | } |
kjellander@webrtc.org | c4870bb | 2014-09-01 04:24:11 +0000 | [diff] [blame] | 417 | } |
maxmorin | 6910537 | 2016-08-16 02:17:44 -0700 | [diff] [blame] | 418 | |
kjellander | 7439f97 | 2016-12-05 22:47:46 -0800 | [diff] [blame] | 419 | rtc_source_set("mac_portaudio") { |
| 420 | visibility = [ ":*" ] # Only targets in this file can depend on this. |
| 421 | sources = [ |
| 422 | "mac/portaudio/pa_memorybarrier.h", |
| 423 | "mac/portaudio/pa_ringbuffer.c", |
| 424 | "mac/portaudio/pa_ringbuffer.h", |
| 425 | ] |
| 426 | } |
| 427 | |
mbonadei | 3edccb9 | 2017-06-01 04:47:20 -0700 | [diff] [blame] | 428 | rtc_source_set("mock_audio_device") { |
| 429 | testonly = true |
| 430 | sources = [ |
| 431 | "include/mock_audio_device.h", |
| 432 | "include/mock_audio_transport.h", |
Patrik Höglund | d420903 | 2018-01-02 15:00:11 +0100 | [diff] [blame] | 433 | "mock_audio_device_buffer.h", |
mbonadei | 3edccb9 | 2017-06-01 04:47:20 -0700 | [diff] [blame] | 434 | ] |
| 435 | deps = [ |
| 436 | ":audio_device", |
Paulina Hensman | 7bd79a0 | 2018-03-15 12:44:12 +0100 | [diff] [blame] | 437 | ":audio_device_buffer", |
| 438 | ":audio_device_impl", |
mbonadei | 3edccb9 | 2017-06-01 04:47:20 -0700 | [diff] [blame] | 439 | "../../test:test_support", |
| 440 | ] |
mbonadei | 3edccb9 | 2017-06-01 04:47:20 -0700 | [diff] [blame] | 441 | } |
| 442 | |
aleloi | 5de52fd | 2016-11-10 01:05:34 -0800 | [diff] [blame] | 443 | if (rtc_include_tests) { |
mbonadei | bcc2176 | 2017-09-12 04:45:24 -0700 | [diff] [blame] | 444 | # TODO(kthelgason): Reenable these tests on simulator. |
| 445 | # See bugs.webrtc.org/7812 |
| 446 | if (is_ios && !use_ios_simulator) { |
| 447 | rtc_source_set("audio_device_ios_objc_unittests") { |
| 448 | testonly = true |
| 449 | visibility = [ ":*" ] |
| 450 | sources = [ |
| 451 | "ios/audio_device_unittest_ios.mm", |
| 452 | ] |
| 453 | deps = [ |
| 454 | ":audio_device", |
Paulina Hensman | 7bd79a0 | 2018-03-15 12:44:12 +0100 | [diff] [blame] | 455 | ":audio_device_buffer", |
| 456 | ":audio_device_impl", |
| 457 | ":audio_device_ios_objc", |
mbonadei | bcc2176 | 2017-09-12 04:45:24 -0700 | [diff] [blame] | 458 | ":mock_audio_device", |
| 459 | "../../rtc_base:rtc_base_approved", |
| 460 | "../../sdk:audio_objc", |
| 461 | "../../system_wrappers", |
Patrik Höglund | 7696bef | 2018-03-15 15:05:39 +0100 | [diff] [blame] | 462 | "../../test:fileutils", |
mbonadei | bcc2176 | 2017-09-12 04:45:24 -0700 | [diff] [blame] | 463 | "../../test:test_support", |
mbonadei | bcc2176 | 2017-09-12 04:45:24 -0700 | [diff] [blame] | 464 | "//third_party/ocmock", |
| 465 | ] |
| 466 | if (!build_with_chromium && is_clang) { |
| 467 | # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163). |
| 468 | suppressed_configs += [ "//build/config/clang:find_bad_constructs" ] |
| 469 | } |
| 470 | } |
| 471 | } |
| 472 | |
ehmaldonado | 3626865 | 2017-01-19 08:27:11 -0800 | [diff] [blame] | 473 | rtc_source_set("audio_device_unittests") { |
| 474 | testonly = true |
kjellander | e0629c0 | 2017-04-25 04:04:50 -0700 | [diff] [blame] | 475 | |
ehmaldonado | 3626865 | 2017-01-19 08:27:11 -0800 | [diff] [blame] | 476 | sources = [ |
| 477 | "fine_audio_buffer_unittest.cc", |
Artem Titov | f2afa57 | 2018-03-13 13:25:19 +0100 | [diff] [blame] | 478 | "include/test_audio_device_unittest.cc", |
ehmaldonado | 3626865 | 2017-01-19 08:27:11 -0800 | [diff] [blame] | 479 | ] |
| 480 | deps = [ |
| 481 | ":audio_device", |
Paulina Hensman | 7bd79a0 | 2018-03-15 12:44:12 +0100 | [diff] [blame] | 482 | ":audio_device_buffer", |
| 483 | ":audio_device_impl", |
ehmaldonado | 3626865 | 2017-01-19 08:27:11 -0800 | [diff] [blame] | 484 | ":mock_audio_device", |
kwiberg | 529662a | 2017-09-04 05:43:17 -0700 | [diff] [blame] | 485 | "../../api:array_view", |
Artem Titov | 0f03973 | 2018-03-07 12:20:51 +0100 | [diff] [blame] | 486 | "../../common_audio", |
Patrik Höglund | a8005cf | 2017-12-13 16:05:42 +0100 | [diff] [blame] | 487 | "../../rtc_base:checks", |
ehmaldonado | f6a861a | 2017-07-19 10:40:47 -0700 | [diff] [blame] | 488 | "../../rtc_base:rtc_base_approved", |
mbonadei | bcc2176 | 2017-09-12 04:45:24 -0700 | [diff] [blame] | 489 | "../../system_wrappers", |
Patrik Höglund | 7696bef | 2018-03-15 15:05:39 +0100 | [diff] [blame] | 490 | "../../test:fileutils", |
ehmaldonado | 3626865 | 2017-01-19 08:27:11 -0800 | [diff] [blame] | 491 | "../../test:test_support", |
| 492 | "../utility:utility", |
Danil Chapovalov | 196100e | 2018-06-21 10:17:24 +0200 | [diff] [blame^] | 493 | "//third_party/abseil-cpp/absl/types:optional", |
ehmaldonado | 3626865 | 2017-01-19 08:27:11 -0800 | [diff] [blame] | 494 | ] |
henrika | 1b35bab | 2017-03-29 07:50:19 -0700 | [diff] [blame] | 495 | if (is_linux || is_mac || is_win) { |
henrika | f2f91fa | 2017-03-17 04:26:22 -0700 | [diff] [blame] | 496 | sources += [ "audio_device_unittest.cc" ] |
| 497 | } |
henrika | ec9c745 | 2018-06-08 16:10:03 +0200 | [diff] [blame] | 498 | if (is_win) { |
henrika | 7e6fcea | 2018-05-18 10:20:58 +0200 | [diff] [blame] | 499 | sources += [ "win/core_audio_utility_win_unittest.cc" ] |
henrika | ec9c745 | 2018-06-08 16:10:03 +0200 | [diff] [blame] | 500 | deps += [ |
| 501 | ":audio_device_module_from_input_and_output", |
| 502 | ":windows_core_audio_utility", |
| 503 | ] |
henrika | 7e6fcea | 2018-05-18 10:20:58 +0200 | [diff] [blame] | 504 | } |
ehmaldonado | 3626865 | 2017-01-19 08:27:11 -0800 | [diff] [blame] | 505 | if (is_android) { |
| 506 | # Need to disable error due to the line in |
| 507 | # base/android/jni_android.h triggering it: |
| 508 | # const BASE_EXPORT jobject GetApplicationContext() |
| 509 | # error: type qualifiers ignored on function return type |
| 510 | cflags = [ "-Wno-ignored-qualifiers" ] |
| 511 | sources += [ |
| 512 | "android/audio_device_unittest.cc", |
| 513 | "android/audio_manager_unittest.cc", |
| 514 | "android/ensure_initialized.cc", |
| 515 | "android/ensure_initialized.h", |
| 516 | ] |
| 517 | deps += [ |
| 518 | "../../../base", |
jianjun.zhu | c024740 | 2017-07-11 06:20:45 -0700 | [diff] [blame] | 519 | "../../sdk/android:libjingle_peerconnection_java", |
ehmaldonado | 3626865 | 2017-01-19 08:27:11 -0800 | [diff] [blame] | 520 | ] |
| 521 | } |
ehmaldonado | 3626865 | 2017-01-19 08:27:11 -0800 | [diff] [blame] | 522 | if (!build_with_chromium && is_clang) { |
| 523 | # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163). |
| 524 | suppressed_configs += [ "//build/config/clang:find_bad_constructs" ] |
| 525 | } |
Joachim Bauch | 5d2bb36 | 2017-12-20 21:19:49 +0100 | [diff] [blame] | 526 | if (!rtc_include_internal_audio_device) { |
| 527 | defines = [ "WEBRTC_DUMMY_AUDIO_BUILD" ] |
| 528 | } |
ehmaldonado | 3626865 | 2017-01-19 08:27:11 -0800 | [diff] [blame] | 529 | } |
maxmorin | 6910537 | 2016-08-16 02:17:44 -0700 | [diff] [blame] | 530 | } |
mbonadei | 438062b | 2017-01-09 02:37:21 -0800 | [diff] [blame] | 531 | |
| 532 | if (!build_with_chromium && is_android) { |
Mirko Bonadei | fbb3b7d | 2017-11-07 15:36:33 +0000 | [diff] [blame] | 533 | rtc_android_library("audio_device_java") { |
mbonadei | b55bd97 | 2017-01-23 01:25:53 -0800 | [diff] [blame] | 534 | java_files = [ |
mbonadei | 438062b | 2017-01-09 02:37:21 -0800 | [diff] [blame] | 535 | "android/java/src/org/webrtc/voiceengine/BuildInfo.java", |
| 536 | "android/java/src/org/webrtc/voiceengine/WebRtcAudioEffects.java", |
| 537 | "android/java/src/org/webrtc/voiceengine/WebRtcAudioManager.java", |
| 538 | "android/java/src/org/webrtc/voiceengine/WebRtcAudioRecord.java", |
| 539 | "android/java/src/org/webrtc/voiceengine/WebRtcAudioTrack.java", |
| 540 | "android/java/src/org/webrtc/voiceengine/WebRtcAudioUtils.java", |
| 541 | ] |
mbonadei | b55bd97 | 2017-01-23 01:25:53 -0800 | [diff] [blame] | 542 | deps = [ |
jianjun.zhu | c024740 | 2017-07-11 06:20:45 -0700 | [diff] [blame] | 543 | "../../rtc_base:base_java", |
mbonadei | b55bd97 | 2017-01-23 01:25:53 -0800 | [diff] [blame] | 544 | ] |
mbonadei | 438062b | 2017-01-09 02:37:21 -0800 | [diff] [blame] | 545 | } |
| 546 | } |