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-microsoft-goto", |
ehmaldonado | d02fe4b | 2016-08-26 13:31:24 -0700 | [diff] [blame] | 22 | ] |
| 23 | } |
| 24 | } |
| 25 | |
Mirko Bonadei | 7dbb7c3 | 2018-11-16 11:13:32 +0100 | [diff] [blame] | 26 | rtc_source_set("audio_device_default") { |
| 27 | visibility = [ "*" ] |
| 28 | sources = [ |
| 29 | "include/audio_device_default.h", |
| 30 | ] |
| 31 | deps = [ |
| 32 | ":audio_device_api", |
| 33 | ] |
| 34 | } |
| 35 | |
mbonadei | bcc2176 | 2017-09-12 04:45:24 -0700 | [diff] [blame] | 36 | rtc_source_set("audio_device") { |
Per Kjellander | a7f2d84 | 2018-01-10 15:54:53 +0000 | [diff] [blame] | 37 | visibility = [ "*" ] |
mbonadei | bcc2176 | 2017-09-12 04:45:24 -0700 | [diff] [blame] | 38 | public_deps = [ |
Paulina Hensman | 7bd79a0 | 2018-03-15 12:44:12 +0100 | [diff] [blame] | 39 | ":audio_device_api", |
| 40 | |
| 41 | # Deprecated. |
| 42 | # TODO(webrtc:7452): Remove this public dep. audio_device_impl should |
| 43 | # be depended on directly if needed. |
| 44 | ":audio_device_impl", |
mbonadei | bcc2176 | 2017-09-12 04:45:24 -0700 | [diff] [blame] | 45 | ] |
mbonadei | bcc2176 | 2017-09-12 04:45:24 -0700 | [diff] [blame] | 46 | } |
| 47 | |
Paulina Hensman | 7bd79a0 | 2018-03-15 12:44:12 +0100 | [diff] [blame] | 48 | rtc_source_set("audio_device_api") { |
Peter Hanspers | 8d95e3b | 2018-05-15 10:22:36 +0200 | [diff] [blame] | 49 | visibility = [ "*" ] |
Paulina Hensman | 7bd79a0 | 2018-03-15 12:44:12 +0100 | [diff] [blame] | 50 | sources = [ |
| 51 | "include/audio_device.h", |
| 52 | "include/audio_device_defines.h", |
| 53 | ] |
| 54 | deps = [ |
Mirko Bonadei | d970807 | 2019-01-25 20:26:48 +0100 | [diff] [blame] | 55 | "../../api:scoped_refptr", |
Danil Chapovalov | 1c41be6 | 2019-04-01 09:16:12 +0200 | [diff] [blame] | 56 | "../../api/task_queue", |
Paulina Hensman | 7bd79a0 | 2018-03-15 12:44:12 +0100 | [diff] [blame] | 57 | "../../rtc_base:checks", |
| 58 | "../../rtc_base:deprecation", |
| 59 | "../../rtc_base:rtc_base_approved", |
henrika | 883d00f | 2018-03-16 10:09:49 +0100 | [diff] [blame] | 60 | "../../rtc_base:stringutils", |
Paulina Hensman | 7bd79a0 | 2018-03-15 12:44:12 +0100 | [diff] [blame] | 61 | ] |
Paulina Hensman | 7bd79a0 | 2018-03-15 12:44:12 +0100 | [diff] [blame] | 62 | } |
| 63 | |
| 64 | rtc_source_set("audio_device_buffer") { |
| 65 | sources = [ |
| 66 | "audio_device_buffer.cc", |
| 67 | "audio_device_buffer.h", |
| 68 | "audio_device_config.h", |
| 69 | "fine_audio_buffer.cc", |
| 70 | "fine_audio_buffer.h", |
| 71 | ] |
| 72 | deps = [ |
| 73 | ":audio_device_api", |
Paulina Hensman | 7bd79a0 | 2018-03-15 12:44:12 +0100 | [diff] [blame] | 74 | "../../api:array_view", |
Danil Chapovalov | 1c41be6 | 2019-04-01 09:16:12 +0200 | [diff] [blame] | 75 | "../../api/task_queue", |
Paulina Hensman | 7bd79a0 | 2018-03-15 12:44:12 +0100 | [diff] [blame] | 76 | "../../common_audio:common_audio_c", |
| 77 | "../../rtc_base:checks", |
| 78 | "../../rtc_base:rtc_base_approved", |
| 79 | "../../rtc_base:rtc_task_queue", |
| 80 | "../../system_wrappers", |
Mirko Bonadei | 17f4878 | 2018-09-28 08:51:10 +0200 | [diff] [blame] | 81 | "../../system_wrappers:metrics", |
Paulina Hensman | 7bd79a0 | 2018-03-15 12:44:12 +0100 | [diff] [blame] | 82 | ] |
Paulina Hensman | 7bd79a0 | 2018-03-15 12:44:12 +0100 | [diff] [blame] | 83 | } |
| 84 | |
| 85 | rtc_source_set("audio_device_generic") { |
| 86 | sources = [ |
| 87 | "audio_device_generic.cc", |
| 88 | "audio_device_generic.h", |
| 89 | ] |
| 90 | deps = [ |
| 91 | ":audio_device_api", |
| 92 | ":audio_device_buffer", |
| 93 | "../../rtc_base:rtc_base_approved", |
| 94 | ] |
Paulina Hensman | 7bd79a0 | 2018-03-15 12:44:12 +0100 | [diff] [blame] | 95 | } |
| 96 | |
henrika | 7e6fcea | 2018-05-18 10:20:58 +0200 | [diff] [blame] | 97 | rtc_source_set("audio_device_name") { |
| 98 | sources = [ |
| 99 | "audio_device_name.cc", |
| 100 | "audio_device_name.h", |
| 101 | ] |
| 102 | } |
| 103 | |
henrika | ec9c745 | 2018-06-08 16:10:03 +0200 | [diff] [blame] | 104 | rtc_source_set("windows_core_audio_utility") { |
| 105 | if (is_win && !build_with_chromium) { |
| 106 | sources = [ |
| 107 | "win/core_audio_utility_win.cc", |
| 108 | "win/core_audio_utility_win.h", |
| 109 | ] |
| 110 | |
| 111 | deps = [ |
| 112 | ":audio_device_api", |
| 113 | ":audio_device_name", |
| 114 | "../../api/units:time_delta", |
| 115 | "../../rtc_base:checks", |
| 116 | "../../rtc_base:rtc_base_approved", |
| 117 | ] |
| 118 | } |
| 119 | } |
| 120 | |
| 121 | # An ADM with a dedicated factory method which does not depend on the |
| 122 | # audio_device_impl target. The goal is to use this new structure and |
| 123 | # gradually phase out the old design. |
| 124 | # TODO(henrika): currently only supported on Windows. |
| 125 | rtc_source_set("audio_device_module_from_input_and_output") { |
Mirko Bonadei | 00d1adf | 2019-04-09 11:32:18 +0200 | [diff] [blame] | 126 | visibility = [ "*" ] |
henrika | ec9c745 | 2018-06-08 16:10:03 +0200 | [diff] [blame] | 127 | if (is_win && !build_with_chromium) { |
| 128 | sources = [ |
| 129 | "include/audio_device_factory.cc", |
| 130 | "include/audio_device_factory.h", |
| 131 | ] |
| 132 | sources += [ |
| 133 | "win/audio_device_module_win.cc", |
| 134 | "win/audio_device_module_win.h", |
| 135 | "win/core_audio_base_win.cc", |
| 136 | "win/core_audio_base_win.h", |
| 137 | "win/core_audio_input_win.cc", |
| 138 | "win/core_audio_input_win.h", |
| 139 | "win/core_audio_output_win.cc", |
| 140 | "win/core_audio_output_win.h", |
| 141 | ] |
| 142 | |
| 143 | deps = [ |
| 144 | ":audio_device_api", |
| 145 | ":audio_device_buffer", |
| 146 | ":windows_core_audio_utility", |
Mirko Bonadei | d970807 | 2019-01-25 20:26:48 +0100 | [diff] [blame] | 147 | "../../api:scoped_refptr", |
Danil Chapovalov | 1c41be6 | 2019-04-01 09:16:12 +0200 | [diff] [blame] | 148 | "../../api/task_queue", |
henrika | ec9c745 | 2018-06-08 16:10:03 +0200 | [diff] [blame] | 149 | "../../rtc_base:checks", |
| 150 | "../../rtc_base:rtc_base_approved", |
Karl Wiberg | 918f50c | 2018-07-05 11:40:33 +0200 | [diff] [blame] | 151 | "//third_party/abseil-cpp/absl/memory", |
Danil Chapovalov | 196100e | 2018-06-21 10:17:24 +0200 | [diff] [blame] | 152 | "//third_party/abseil-cpp/absl/types:optional", |
henrika | ec9c745 | 2018-06-08 16:10:03 +0200 | [diff] [blame] | 153 | ] |
| 154 | } |
| 155 | } |
| 156 | |
Paulina Hensman | 7bd79a0 | 2018-03-15 12:44:12 +0100 | [diff] [blame] | 157 | # Contains default implementations of webrtc::AudioDeviceModule for Windows, |
| 158 | # Linux, Mac, iOS and Android. |
| 159 | rtc_source_set("audio_device_impl") { |
| 160 | visibility = [ "*" ] |
Zeke Chin | b3fb71c | 2016-02-18 15:44:07 -0800 | [diff] [blame] | 161 | deps = [ |
Paulina Hensman | 7bd79a0 | 2018-03-15 12:44:12 +0100 | [diff] [blame] | 162 | ":audio_device_api", |
| 163 | ":audio_device_buffer", |
Mirko Bonadei | 7dbb7c3 | 2018-11-16 11:13:32 +0100 | [diff] [blame] | 164 | ":audio_device_default", |
Paulina Hensman | 7bd79a0 | 2018-03-15 12:44:12 +0100 | [diff] [blame] | 165 | ":audio_device_generic", |
kwiberg | 529662a | 2017-09-04 05:43:17 -0700 | [diff] [blame] | 166 | "../../api:array_view", |
Lu Liu | c771c80 | 2019-03-22 12:40:05 -0700 | [diff] [blame] | 167 | "../../api:refcountedbase", |
Mirko Bonadei | d970807 | 2019-01-25 20:26:48 +0100 | [diff] [blame] | 168 | "../../api:scoped_refptr", |
Artem Titov | 94b57c0 | 2019-03-21 13:35:10 +0100 | [diff] [blame] | 169 | "../../api/task_queue", |
Sebastian Jansson | 77efcd8 | 2019-03-13 08:50:42 +0100 | [diff] [blame] | 170 | "../../api/task_queue:global_task_queue_factory", |
Zeke Chin | b3fb71c | 2016-02-18 15:44:07 -0800 | [diff] [blame] | 171 | "../../common_audio", |
Mirko Bonadei | dbbb33c | 2018-02-05 15:50:41 +0100 | [diff] [blame] | 172 | "../../common_audio:common_audio_c", |
Artem Titov | 94b57c0 | 2019-03-21 13:35:10 +0100 | [diff] [blame] | 173 | "../../rtc_base", |
Patrik Höglund | a8005cf | 2017-12-13 16:05:42 +0100 | [diff] [blame] | 174 | "../../rtc_base:checks", |
Fredrik Solenberg | 2a87797 | 2017-12-15 16:42:15 +0100 | [diff] [blame] | 175 | "../../rtc_base:deprecation", |
ehmaldonado | f6a861a | 2017-07-19 10:40:47 -0700 | [diff] [blame] | 176 | "../../rtc_base:rtc_base_approved", |
| 177 | "../../rtc_base:rtc_task_queue", |
Mirko Bonadei | 944ba82 | 2018-09-04 11:06:17 +0200 | [diff] [blame] | 178 | "../../rtc_base/system:arch", |
Karl Wiberg | 6a4d411 | 2018-03-23 10:39:34 +0100 | [diff] [blame] | 179 | "../../rtc_base/system:file_wrapper", |
Sebastian Jansson | 77efcd8 | 2019-03-13 08:50:42 +0100 | [diff] [blame] | 180 | "../../rtc_base/task_utils:repeating_task", |
Zeke Chin | b3fb71c | 2016-02-18 15:44:07 -0800 | [diff] [blame] | 181 | "../../system_wrappers", |
Mirko Bonadei | 17f4878 | 2018-09-28 08:51:10 +0200 | [diff] [blame] | 182 | "../../system_wrappers:metrics", |
Zeke Chin | b3fb71c | 2016-02-18 15:44:07 -0800 | [diff] [blame] | 183 | "../utility", |
Mirko Bonadei | 944ba82 | 2018-09-04 11:06:17 +0200 | [diff] [blame] | 184 | "//third_party/abseil-cpp/absl/memory", |
Zeke Chin | b3fb71c | 2016-02-18 15:44:07 -0800 | [diff] [blame] | 185 | ] |
Paulina Hensman | 7bd79a0 | 2018-03-15 12:44:12 +0100 | [diff] [blame] | 186 | if (rtc_include_internal_audio_device && is_ios) { |
Kári Tristan Helgason | 7a930da | 2019-04-10 08:43:53 +0200 | [diff] [blame^] | 187 | deps += [ "../../sdk:audio_device" ] |
Paulina Hensman | 7bd79a0 | 2018-03-15 12:44:12 +0100 | [diff] [blame] | 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 | |
Henrik Kjellander | b79472a | 2015-10-14 08:13:58 +0200 | [diff] [blame] | 207 | defines = [] |
kjellander | 70bed7d | 2015-11-23 17:23:44 -0800 | [diff] [blame] | 208 | cflags = [] |
henrika | 7be7883 | 2017-06-13 17:34:16 +0200 | [diff] [blame] | 209 | if (rtc_audio_device_plays_sinus_tone) { |
| 210 | defines += [ "AUDIO_DEVICE_PLAYS_SINUS_TONE" ] |
| 211 | } |
henrika | 883d00f | 2018-03-16 10:09:49 +0100 | [diff] [blame] | 212 | if (rtc_enable_android_aaudio) { |
Mirko Bonadei | 185e802 | 2019-03-27 21:11:17 +0100 | [diff] [blame] | 213 | defines += [ "WEBRTC_AUDIO_DEVICE_INCLUDE_ANDROID_AAUDIO" ] |
henrika | 883d00f | 2018-03-16 10:09:49 +0100 | [diff] [blame] | 214 | } |
kjellander@webrtc.org | 6d08ca6 | 2014-09-07 17:36:10 +0000 | [diff] [blame] | 215 | if (rtc_include_internal_audio_device) { |
kjellander@webrtc.org | c4870bb | 2014-09-01 04:24:11 +0000 | [diff] [blame] | 216 | sources += [ |
Lu Liu | 4b62001 | 2017-04-06 10:17:01 -0700 | [diff] [blame] | 217 | "audio_device_data_observer.cc", |
Tommi | 931e658 | 2015-05-20 09:44:38 +0200 | [diff] [blame] | 218 | "audio_device_impl.cc", |
| 219 | "audio_device_impl.h", |
Lu Liu | 4b62001 | 2017-04-06 10:17:01 -0700 | [diff] [blame] | 220 | "include/audio_device_data_observer.h", |
kjellander@webrtc.org | c4870bb | 2014-09-01 04:24:11 +0000 | [diff] [blame] | 221 | ] |
kjellander | a46a4c9 | 2016-01-07 02:54:22 -0800 | [diff] [blame] | 222 | if (is_android) { |
| 223 | sources += [ |
Patrik Höglund | d420903 | 2018-01-02 15:00:11 +0100 | [diff] [blame] | 224 | "android/audio_common.h", |
kjellander | a46a4c9 | 2016-01-07 02:54:22 -0800 | [diff] [blame] | 225 | "android/audio_device_template.h", |
| 226 | "android/audio_manager.cc", |
| 227 | "android/audio_manager.h", |
| 228 | "android/audio_record_jni.cc", |
| 229 | "android/audio_record_jni.h", |
| 230 | "android/audio_track_jni.cc", |
| 231 | "android/audio_track_jni.h", |
| 232 | "android/build_info.cc", |
| 233 | "android/build_info.h", |
| 234 | "android/opensles_common.cc", |
| 235 | "android/opensles_common.h", |
| 236 | "android/opensles_player.cc", |
| 237 | "android/opensles_player.h", |
henrika | 918b554 | 2016-09-19 15:44:09 +0200 | [diff] [blame] | 238 | "android/opensles_recorder.cc", |
| 239 | "android/opensles_recorder.h", |
kjellander | a46a4c9 | 2016-01-07 02:54:22 -0800 | [diff] [blame] | 240 | ] |
| 241 | libs = [ |
| 242 | "log", |
| 243 | "OpenSLES", |
| 244 | ] |
henrika | 883d00f | 2018-03-16 10:09:49 +0100 | [diff] [blame] | 245 | if (rtc_enable_android_aaudio) { |
| 246 | sources += [ |
| 247 | "android/aaudio_player.cc", |
| 248 | "android/aaudio_player.h", |
| 249 | "android/aaudio_recorder.cc", |
| 250 | "android/aaudio_recorder.h", |
| 251 | "android/aaudio_wrapper.cc", |
| 252 | "android/aaudio_wrapper.h", |
| 253 | ] |
| 254 | libs += [ "aaudio" ] |
| 255 | } |
Dan Minor | 9c68613 | 2018-01-15 10:20:00 -0500 | [diff] [blame] | 256 | |
| 257 | if (build_with_mozilla) { |
| 258 | include_dirs += [ |
| 259 | "/config/external/nspr", |
| 260 | "/nsprpub/lib/ds", |
| 261 | "/nsprpub/pr/include", |
| 262 | ] |
| 263 | } |
kjellander | a46a4c9 | 2016-01-07 02:54:22 -0800 | [diff] [blame] | 264 | } |
noahric | c594aa61 | 2016-08-16 18:21:18 -0700 | [diff] [blame] | 265 | if (rtc_use_dummy_audio_file_devices) { |
| 266 | defines += [ "WEBRTC_DUMMY_FILE_DEVICES" ] |
| 267 | } else { |
| 268 | if (is_linux) { |
kjellander@webrtc.org | c4870bb | 2014-09-01 04:24:11 +0000 | [diff] [blame] | 269 | sources += [ |
noahric | c594aa61 | 2016-08-16 18:21:18 -0700 | [diff] [blame] | 270 | "linux/alsasymboltable_linux.cc", |
| 271 | "linux/alsasymboltable_linux.h", |
| 272 | "linux/audio_device_alsa_linux.cc", |
| 273 | "linux/audio_device_alsa_linux.h", |
| 274 | "linux/audio_mixer_manager_alsa_linux.cc", |
| 275 | "linux/audio_mixer_manager_alsa_linux.h", |
| 276 | "linux/latebindingsymboltable_linux.cc", |
| 277 | "linux/latebindingsymboltable_linux.h", |
kjellander@webrtc.org | c4870bb | 2014-09-01 04:24:11 +0000 | [diff] [blame] | 278 | ] |
noahric | c594aa61 | 2016-08-16 18:21:18 -0700 | [diff] [blame] | 279 | defines += [ "LINUX_ALSA" ] |
kjellander | c41d0c4 | 2017-05-30 12:06:04 -0700 | [diff] [blame] | 280 | libs = [ "dl" ] |
Joachim Bauch | 75f18fc | 2017-12-20 21:25:47 +0100 | [diff] [blame] | 281 | if (rtc_use_x11) { |
kjellander | c41d0c4 | 2017-05-30 12:06:04 -0700 | [diff] [blame] | 282 | libs += [ "X11" ] |
Joachim Bauch | 75f18fc | 2017-12-20 21:25:47 +0100 | [diff] [blame] | 283 | defines += [ "WEBRTC_USE_X11" ] |
kjellander | c41d0c4 | 2017-05-30 12:06:04 -0700 | [diff] [blame] | 284 | } |
noahric | c594aa61 | 2016-08-16 18:21:18 -0700 | [diff] [blame] | 285 | if (rtc_include_pulse_audio) { |
| 286 | sources += [ |
| 287 | "linux/audio_device_pulse_linux.cc", |
| 288 | "linux/audio_device_pulse_linux.h", |
| 289 | "linux/audio_mixer_manager_pulse_linux.cc", |
| 290 | "linux/audio_mixer_manager_pulse_linux.h", |
| 291 | "linux/pulseaudiosymboltable_linux.cc", |
| 292 | "linux/pulseaudiosymboltable_linux.h", |
| 293 | ] |
| 294 | defines += [ "LINUX_PULSE" ] |
| 295 | } |
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 | if (is_mac) { |
| 298 | sources += [ |
| 299 | "mac/audio_device_mac.cc", |
| 300 | "mac/audio_device_mac.h", |
| 301 | "mac/audio_mixer_manager_mac.cc", |
| 302 | "mac/audio_mixer_manager_mac.h", |
noahric | c594aa61 | 2016-08-16 18:21:18 -0700 | [diff] [blame] | 303 | ] |
Artem Titov | 8ff433a | 2018-07-24 13:42:22 +0200 | [diff] [blame] | 304 | deps += [ "../third_party/portaudio:mac_portaudio" ] |
noahric | c594aa61 | 2016-08-16 18:21:18 -0700 | [diff] [blame] | 305 | libs = [ |
maxmorin | 2ec45b9 | 2016-08-24 06:51:09 -0700 | [diff] [blame] | 306 | # Needed for CoreGraphics: |
| 307 | "ApplicationServices.framework", |
| 308 | |
noahric | c594aa61 | 2016-08-16 18:21:18 -0700 | [diff] [blame] | 309 | "AudioToolbox.framework", |
| 310 | "CoreAudio.framework", |
kjellander | bac0412 | 2016-06-02 02:18:48 -0700 | [diff] [blame] | 311 | |
noahric | c594aa61 | 2016-08-16 18:21:18 -0700 | [diff] [blame] | 312 | # Needed for CGEventSourceKeyState in audio_device_mac.cc: |
| 313 | "CoreGraphics.framework", |
| 314 | ] |
| 315 | } |
noahric | c594aa61 | 2016-08-16 18:21:18 -0700 | [diff] [blame] | 316 | if (is_win) { |
| 317 | sources += [ |
| 318 | "win/audio_device_core_win.cc", |
| 319 | "win/audio_device_core_win.h", |
noahric | c594aa61 | 2016-08-16 18:21:18 -0700 | [diff] [blame] | 320 | ] |
| 321 | libs = [ |
| 322 | # Required for the built-in WASAPI AEC. |
| 323 | "dmoguids.lib", |
| 324 | "wmcodecdspuuid.lib", |
| 325 | "amstrmid.lib", |
| 326 | "msdmo.lib", |
| 327 | ] |
| 328 | } |
ehmaldonado | d02fe4b | 2016-08-26 13:31:24 -0700 | [diff] [blame] | 329 | configs += [ ":audio_device_warnings_config" ] |
kjellander@webrtc.org | c4870bb | 2014-09-01 04:24:11 +0000 | [diff] [blame] | 330 | } |
| 331 | } else { |
| 332 | defines = [ "WEBRTC_DUMMY_AUDIO_BUILD" ] |
| 333 | } |
| 334 | |
| 335 | if (!build_with_chromium) { |
| 336 | sources += [ |
| 337 | # Do not link these into Chrome since they contain static data. |
| 338 | "dummy/file_audio_device_factory.cc", |
| 339 | "dummy/file_audio_device_factory.h", |
| 340 | ] |
| 341 | } |
kjellander@webrtc.org | c4870bb | 2014-09-01 04:24:11 +0000 | [diff] [blame] | 342 | } |
maxmorin | 6910537 | 2016-08-16 02:17:44 -0700 | [diff] [blame] | 343 | |
mbonadei | 3edccb9 | 2017-06-01 04:47:20 -0700 | [diff] [blame] | 344 | rtc_source_set("mock_audio_device") { |
| 345 | testonly = true |
| 346 | sources = [ |
| 347 | "include/mock_audio_device.h", |
| 348 | "include/mock_audio_transport.h", |
Patrik Höglund | d420903 | 2018-01-02 15:00:11 +0100 | [diff] [blame] | 349 | "mock_audio_device_buffer.h", |
mbonadei | 3edccb9 | 2017-06-01 04:47:20 -0700 | [diff] [blame] | 350 | ] |
| 351 | deps = [ |
| 352 | ":audio_device", |
Paulina Hensman | 7bd79a0 | 2018-03-15 12:44:12 +0100 | [diff] [blame] | 353 | ":audio_device_buffer", |
| 354 | ":audio_device_impl", |
mbonadei | 3edccb9 | 2017-06-01 04:47:20 -0700 | [diff] [blame] | 355 | "../../test:test_support", |
| 356 | ] |
mbonadei | 3edccb9 | 2017-06-01 04:47:20 -0700 | [diff] [blame] | 357 | } |
| 358 | |
aleloi | 5de52fd | 2016-11-10 01:05:34 -0800 | [diff] [blame] | 359 | if (rtc_include_tests) { |
ehmaldonado | 3626865 | 2017-01-19 08:27:11 -0800 | [diff] [blame] | 360 | rtc_source_set("audio_device_unittests") { |
| 361 | testonly = true |
kjellander | e0629c0 | 2017-04-25 04:04:50 -0700 | [diff] [blame] | 362 | |
ehmaldonado | 3626865 | 2017-01-19 08:27:11 -0800 | [diff] [blame] | 363 | sources = [ |
| 364 | "fine_audio_buffer_unittest.cc", |
Artem Titov | f2afa57 | 2018-03-13 13:25:19 +0100 | [diff] [blame] | 365 | "include/test_audio_device_unittest.cc", |
ehmaldonado | 3626865 | 2017-01-19 08:27:11 -0800 | [diff] [blame] | 366 | ] |
| 367 | deps = [ |
| 368 | ":audio_device", |
Paulina Hensman | 7bd79a0 | 2018-03-15 12:44:12 +0100 | [diff] [blame] | 369 | ":audio_device_buffer", |
| 370 | ":audio_device_impl", |
ehmaldonado | 3626865 | 2017-01-19 08:27:11 -0800 | [diff] [blame] | 371 | ":mock_audio_device", |
kwiberg | 529662a | 2017-09-04 05:43:17 -0700 | [diff] [blame] | 372 | "../../api:array_view", |
Mirko Bonadei | d970807 | 2019-01-25 20:26:48 +0100 | [diff] [blame] | 373 | "../../api:scoped_refptr", |
Danil Chapovalov | 1c41be6 | 2019-04-01 09:16:12 +0200 | [diff] [blame] | 374 | "../../api/task_queue", |
| 375 | "../../api/task_queue:default_task_queue_factory", |
Artem Titov | 0f03973 | 2018-03-07 12:20:51 +0100 | [diff] [blame] | 376 | "../../common_audio", |
Patrik Höglund | a8005cf | 2017-12-13 16:05:42 +0100 | [diff] [blame] | 377 | "../../rtc_base:checks", |
ehmaldonado | f6a861a | 2017-07-19 10:40:47 -0700 | [diff] [blame] | 378 | "../../rtc_base:rtc_base_approved", |
mbonadei | bcc2176 | 2017-09-12 04:45:24 -0700 | [diff] [blame] | 379 | "../../system_wrappers", |
Patrik Höglund | 7696bef | 2018-03-15 15:05:39 +0100 | [diff] [blame] | 380 | "../../test:fileutils", |
ehmaldonado | 3626865 | 2017-01-19 08:27:11 -0800 | [diff] [blame] | 381 | "../../test:test_support", |
Artem Titov | 94b57c0 | 2019-03-21 13:35:10 +0100 | [diff] [blame] | 382 | "../utility", |
Danil Chapovalov | 196100e | 2018-06-21 10:17:24 +0200 | [diff] [blame] | 383 | "//third_party/abseil-cpp/absl/types:optional", |
ehmaldonado | 3626865 | 2017-01-19 08:27:11 -0800 | [diff] [blame] | 384 | ] |
henrika | 1b35bab | 2017-03-29 07:50:19 -0700 | [diff] [blame] | 385 | if (is_linux || is_mac || is_win) { |
henrika | f2f91fa | 2017-03-17 04:26:22 -0700 | [diff] [blame] | 386 | sources += [ "audio_device_unittest.cc" ] |
Steve Anton | 40d5533 | 2019-01-07 10:21:47 -0800 | [diff] [blame] | 387 | deps += [ "//third_party/abseil-cpp/absl/memory" ] |
henrika | f2f91fa | 2017-03-17 04:26:22 -0700 | [diff] [blame] | 388 | } |
henrika | ec9c745 | 2018-06-08 16:10:03 +0200 | [diff] [blame] | 389 | if (is_win) { |
henrika | 7e6fcea | 2018-05-18 10:20:58 +0200 | [diff] [blame] | 390 | sources += [ "win/core_audio_utility_win_unittest.cc" ] |
henrika | ec9c745 | 2018-06-08 16:10:03 +0200 | [diff] [blame] | 391 | deps += [ |
| 392 | ":audio_device_module_from_input_and_output", |
| 393 | ":windows_core_audio_utility", |
| 394 | ] |
henrika | 7e6fcea | 2018-05-18 10:20:58 +0200 | [diff] [blame] | 395 | } |
ehmaldonado | 3626865 | 2017-01-19 08:27:11 -0800 | [diff] [blame] | 396 | if (is_android) { |
| 397 | # Need to disable error due to the line in |
| 398 | # base/android/jni_android.h triggering it: |
| 399 | # const BASE_EXPORT jobject GetApplicationContext() |
| 400 | # error: type qualifiers ignored on function return type |
| 401 | cflags = [ "-Wno-ignored-qualifiers" ] |
| 402 | sources += [ |
| 403 | "android/audio_device_unittest.cc", |
| 404 | "android/audio_manager_unittest.cc", |
| 405 | "android/ensure_initialized.cc", |
| 406 | "android/ensure_initialized.h", |
| 407 | ] |
| 408 | deps += [ |
Oleh Prypin | da04e06 | 2018-07-23 10:04:12 +0200 | [diff] [blame] | 409 | "../../base", |
jianjun.zhu | c024740 | 2017-07-11 06:20:45 -0700 | [diff] [blame] | 410 | "../../sdk/android:libjingle_peerconnection_java", |
ehmaldonado | 3626865 | 2017-01-19 08:27:11 -0800 | [diff] [blame] | 411 | ] |
| 412 | } |
Joachim Bauch | 5d2bb36 | 2017-12-20 21:19:49 +0100 | [diff] [blame] | 413 | if (!rtc_include_internal_audio_device) { |
| 414 | defines = [ "WEBRTC_DUMMY_AUDIO_BUILD" ] |
| 415 | } |
ehmaldonado | 3626865 | 2017-01-19 08:27:11 -0800 | [diff] [blame] | 416 | } |
maxmorin | 6910537 | 2016-08-16 02:17:44 -0700 | [diff] [blame] | 417 | } |
mbonadei | 438062b | 2017-01-09 02:37:21 -0800 | [diff] [blame] | 418 | |
| 419 | if (!build_with_chromium && is_android) { |
Mirko Bonadei | fbb3b7d | 2017-11-07 15:36:33 +0000 | [diff] [blame] | 420 | rtc_android_library("audio_device_java") { |
mbonadei | b55bd97 | 2017-01-23 01:25:53 -0800 | [diff] [blame] | 421 | java_files = [ |
mbonadei | 438062b | 2017-01-09 02:37:21 -0800 | [diff] [blame] | 422 | "android/java/src/org/webrtc/voiceengine/BuildInfo.java", |
| 423 | "android/java/src/org/webrtc/voiceengine/WebRtcAudioEffects.java", |
| 424 | "android/java/src/org/webrtc/voiceengine/WebRtcAudioManager.java", |
| 425 | "android/java/src/org/webrtc/voiceengine/WebRtcAudioRecord.java", |
| 426 | "android/java/src/org/webrtc/voiceengine/WebRtcAudioTrack.java", |
| 427 | "android/java/src/org/webrtc/voiceengine/WebRtcAudioUtils.java", |
| 428 | ] |
mbonadei | b55bd97 | 2017-01-23 01:25:53 -0800 | [diff] [blame] | 429 | deps = [ |
jianjun.zhu | c024740 | 2017-07-11 06:20:45 -0700 | [diff] [blame] | 430 | "../../rtc_base:base_java", |
Peter Wen | 7bc331f | 2019-03-06 09:18:57 -0500 | [diff] [blame] | 431 | "//third_party/android_deps:com_android_support_support_annotations_java", |
mbonadei | b55bd97 | 2017-01-23 01:25:53 -0800 | [diff] [blame] | 432 | ] |
mbonadei | 438062b | 2017-01-09 02:37:21 -0800 | [diff] [blame] | 433 | } |
| 434 | } |