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