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 | |
Mirko Bonadei | 86d053c | 2019-10-17 21:32:04 +0200 | [diff] [blame] | 64 | rtc_library("audio_device_buffer") { |
Paulina Hensman | 7bd79a0 | 2018-03-15 12:44:12 +0100 | [diff] [blame] | 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 | |
Mirko Bonadei | 86d053c | 2019-10-17 21:32:04 +0200 | [diff] [blame] | 85 | rtc_library("audio_device_generic") { |
Paulina Hensman | 7bd79a0 | 2018-03-15 12:44:12 +0100 | [diff] [blame] | 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 | |
Mirko Bonadei | 86d053c | 2019-10-17 21:32:04 +0200 | [diff] [blame] | 97 | rtc_library("audio_device_name") { |
henrika | 7e6fcea | 2018-05-18 10:20:58 +0200 | [diff] [blame] | 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", |
Danil Chapovalov | 196100e | 2018-06-21 10:17:24 +0200 | [diff] [blame] | 151 | "//third_party/abseil-cpp/absl/types:optional", |
henrika | ec9c745 | 2018-06-08 16:10:03 +0200 | [diff] [blame] | 152 | ] |
| 153 | } |
| 154 | } |
| 155 | |
Paulina Hensman | 7bd79a0 | 2018-03-15 12:44:12 +0100 | [diff] [blame] | 156 | # Contains default implementations of webrtc::AudioDeviceModule for Windows, |
| 157 | # Linux, Mac, iOS and Android. |
Mirko Bonadei | 86d053c | 2019-10-17 21:32:04 +0200 | [diff] [blame] | 158 | rtc_library("audio_device_impl") { |
Paulina Hensman | 7bd79a0 | 2018-03-15 12:44:12 +0100 | [diff] [blame] | 159 | visibility = [ "*" ] |
Zeke Chin | b3fb71c | 2016-02-18 15:44:07 -0800 | [diff] [blame] | 160 | deps = [ |
Paulina Hensman | 7bd79a0 | 2018-03-15 12:44:12 +0100 | [diff] [blame] | 161 | ":audio_device_api", |
| 162 | ":audio_device_buffer", |
Mirko Bonadei | 7dbb7c3 | 2018-11-16 11:13:32 +0100 | [diff] [blame] | 163 | ":audio_device_default", |
Paulina Hensman | 7bd79a0 | 2018-03-15 12:44:12 +0100 | [diff] [blame] | 164 | ":audio_device_generic", |
kwiberg | 529662a | 2017-09-04 05:43:17 -0700 | [diff] [blame] | 165 | "../../api:array_view", |
Lu Liu | c771c80 | 2019-03-22 12:40:05 -0700 | [diff] [blame] | 166 | "../../api:refcountedbase", |
Mirko Bonadei | d970807 | 2019-01-25 20:26:48 +0100 | [diff] [blame] | 167 | "../../api:scoped_refptr", |
Artem Titov | 94b57c0 | 2019-03-21 13:35:10 +0100 | [diff] [blame] | 168 | "../../api/task_queue", |
Zeke Chin | b3fb71c | 2016-02-18 15:44:07 -0800 | [diff] [blame] | 169 | "../../common_audio", |
Mirko Bonadei | dbbb33c | 2018-02-05 15:50:41 +0100 | [diff] [blame] | 170 | "../../common_audio:common_audio_c", |
Artem Titov | 94b57c0 | 2019-03-21 13:35:10 +0100 | [diff] [blame] | 171 | "../../rtc_base", |
Patrik Höglund | a8005cf | 2017-12-13 16:05:42 +0100 | [diff] [blame] | 172 | "../../rtc_base:checks", |
Fredrik Solenberg | 2a87797 | 2017-12-15 16:42:15 +0100 | [diff] [blame] | 173 | "../../rtc_base:deprecation", |
ehmaldonado | f6a861a | 2017-07-19 10:40:47 -0700 | [diff] [blame] | 174 | "../../rtc_base:rtc_base_approved", |
| 175 | "../../rtc_base:rtc_task_queue", |
Mirko Bonadei | 944ba82 | 2018-09-04 11:06:17 +0200 | [diff] [blame] | 176 | "../../rtc_base/system:arch", |
Karl Wiberg | 6a4d411 | 2018-03-23 10:39:34 +0100 | [diff] [blame] | 177 | "../../rtc_base/system:file_wrapper", |
Sebastian Jansson | 77efcd8 | 2019-03-13 08:50:42 +0100 | [diff] [blame] | 178 | "../../rtc_base/task_utils:repeating_task", |
Zeke Chin | b3fb71c | 2016-02-18 15:44:07 -0800 | [diff] [blame] | 179 | "../../system_wrappers", |
Alex Narest | 44dc241 | 2019-08-29 13:17:11 +0200 | [diff] [blame] | 180 | "../../system_wrappers:field_trial", |
Mirko Bonadei | 17f4878 | 2018-09-28 08:51:10 +0200 | [diff] [blame] | 181 | "../../system_wrappers:metrics", |
Zeke Chin | b3fb71c | 2016-02-18 15:44:07 -0800 | [diff] [blame] | 182 | "../utility", |
| 183 | ] |
Paulina Hensman | 7bd79a0 | 2018-03-15 12:44:12 +0100 | [diff] [blame] | 184 | if (rtc_include_internal_audio_device && is_ios) { |
Kári Tristan Helgason | 7a930da | 2019-04-10 08:43:53 +0200 | [diff] [blame] | 185 | deps += [ "../../sdk:audio_device" ] |
Paulina Hensman | 7bd79a0 | 2018-03-15 12:44:12 +0100 | [diff] [blame] | 186 | } |
Zeke Chin | b3fb71c | 2016-02-18 15:44:07 -0800 | [diff] [blame] | 187 | |
kjellander@webrtc.org | c4870bb | 2014-09-01 04:24:11 +0000 | [diff] [blame] | 188 | sources = [ |
kjellander@webrtc.org | c4870bb | 2014-09-01 04:24:11 +0000 | [diff] [blame] | 189 | "dummy/audio_device_dummy.cc", |
| 190 | "dummy/audio_device_dummy.h", |
kjellander@webrtc.org | c4870bb | 2014-09-01 04:24:11 +0000 | [diff] [blame] | 191 | "dummy/file_audio_device.cc", |
| 192 | "dummy/file_audio_device.h", |
Patrik Höglund | d420903 | 2018-01-02 15:00:11 +0100 | [diff] [blame] | 193 | "include/fake_audio_device.h", |
Artem Titov | f2afa57 | 2018-03-13 13:25:19 +0100 | [diff] [blame] | 194 | "include/test_audio_device.cc", |
Artem Titov | 0f03973 | 2018-03-07 12:20:51 +0100 | [diff] [blame] | 195 | "include/test_audio_device.h", |
kjellander@webrtc.org | c4870bb | 2014-09-01 04:24:11 +0000 | [diff] [blame] | 196 | ] |
| 197 | |
Dan Minor | 9c68613 | 2018-01-15 10:20:00 -0500 | [diff] [blame] | 198 | if (build_with_mozilla) { |
| 199 | sources += [ |
| 200 | "opensl/single_rw_fifo.cc", |
| 201 | "opensl/single_rw_fifo.h", |
| 202 | ] |
| 203 | } |
| 204 | |
Henrik Kjellander | b79472a | 2015-10-14 08:13:58 +0200 | [diff] [blame] | 205 | defines = [] |
kjellander | 70bed7d | 2015-11-23 17:23:44 -0800 | [diff] [blame] | 206 | cflags = [] |
henrika | 7be7883 | 2017-06-13 17:34:16 +0200 | [diff] [blame] | 207 | if (rtc_audio_device_plays_sinus_tone) { |
| 208 | defines += [ "AUDIO_DEVICE_PLAYS_SINUS_TONE" ] |
| 209 | } |
henrika | 883d00f | 2018-03-16 10:09:49 +0100 | [diff] [blame] | 210 | if (rtc_enable_android_aaudio) { |
Mirko Bonadei | 185e802 | 2019-03-27 21:11:17 +0100 | [diff] [blame] | 211 | defines += [ "WEBRTC_AUDIO_DEVICE_INCLUDE_ANDROID_AAUDIO" ] |
henrika | 883d00f | 2018-03-16 10:09:49 +0100 | [diff] [blame] | 212 | } |
kjellander@webrtc.org | 6d08ca6 | 2014-09-07 17:36:10 +0000 | [diff] [blame] | 213 | if (rtc_include_internal_audio_device) { |
kjellander@webrtc.org | c4870bb | 2014-09-01 04:24:11 +0000 | [diff] [blame] | 214 | sources += [ |
Lu Liu | 4b62001 | 2017-04-06 10:17:01 -0700 | [diff] [blame] | 215 | "audio_device_data_observer.cc", |
Tommi | 931e658 | 2015-05-20 09:44:38 +0200 | [diff] [blame] | 216 | "audio_device_impl.cc", |
| 217 | "audio_device_impl.h", |
Lu Liu | 4b62001 | 2017-04-06 10:17:01 -0700 | [diff] [blame] | 218 | "include/audio_device_data_observer.h", |
kjellander@webrtc.org | c4870bb | 2014-09-01 04:24:11 +0000 | [diff] [blame] | 219 | ] |
kjellander | a46a4c9 | 2016-01-07 02:54:22 -0800 | [diff] [blame] | 220 | if (is_android) { |
| 221 | sources += [ |
Patrik Höglund | d420903 | 2018-01-02 15:00:11 +0100 | [diff] [blame] | 222 | "android/audio_common.h", |
kjellander | a46a4c9 | 2016-01-07 02:54:22 -0800 | [diff] [blame] | 223 | "android/audio_device_template.h", |
| 224 | "android/audio_manager.cc", |
| 225 | "android/audio_manager.h", |
| 226 | "android/audio_record_jni.cc", |
| 227 | "android/audio_record_jni.h", |
| 228 | "android/audio_track_jni.cc", |
| 229 | "android/audio_track_jni.h", |
| 230 | "android/build_info.cc", |
| 231 | "android/build_info.h", |
| 232 | "android/opensles_common.cc", |
| 233 | "android/opensles_common.h", |
| 234 | "android/opensles_player.cc", |
| 235 | "android/opensles_player.h", |
henrika | 918b554 | 2016-09-19 15:44:09 +0200 | [diff] [blame] | 236 | "android/opensles_recorder.cc", |
| 237 | "android/opensles_recorder.h", |
kjellander | a46a4c9 | 2016-01-07 02:54:22 -0800 | [diff] [blame] | 238 | ] |
| 239 | libs = [ |
| 240 | "log", |
| 241 | "OpenSLES", |
| 242 | ] |
henrika | 883d00f | 2018-03-16 10:09:49 +0100 | [diff] [blame] | 243 | if (rtc_enable_android_aaudio) { |
| 244 | sources += [ |
| 245 | "android/aaudio_player.cc", |
| 246 | "android/aaudio_player.h", |
| 247 | "android/aaudio_recorder.cc", |
| 248 | "android/aaudio_recorder.h", |
| 249 | "android/aaudio_wrapper.cc", |
| 250 | "android/aaudio_wrapper.h", |
| 251 | ] |
| 252 | libs += [ "aaudio" ] |
| 253 | } |
Dan Minor | 9c68613 | 2018-01-15 10:20:00 -0500 | [diff] [blame] | 254 | |
| 255 | if (build_with_mozilla) { |
| 256 | include_dirs += [ |
| 257 | "/config/external/nspr", |
| 258 | "/nsprpub/lib/ds", |
| 259 | "/nsprpub/pr/include", |
| 260 | ] |
| 261 | } |
kjellander | a46a4c9 | 2016-01-07 02:54:22 -0800 | [diff] [blame] | 262 | } |
noahric | c594aa61 | 2016-08-16 18:21:18 -0700 | [diff] [blame] | 263 | if (rtc_use_dummy_audio_file_devices) { |
| 264 | defines += [ "WEBRTC_DUMMY_FILE_DEVICES" ] |
| 265 | } else { |
| 266 | if (is_linux) { |
kjellander@webrtc.org | c4870bb | 2014-09-01 04:24:11 +0000 | [diff] [blame] | 267 | sources += [ |
noahric | c594aa61 | 2016-08-16 18:21:18 -0700 | [diff] [blame] | 268 | "linux/alsasymboltable_linux.cc", |
| 269 | "linux/alsasymboltable_linux.h", |
| 270 | "linux/audio_device_alsa_linux.cc", |
| 271 | "linux/audio_device_alsa_linux.h", |
| 272 | "linux/audio_mixer_manager_alsa_linux.cc", |
| 273 | "linux/audio_mixer_manager_alsa_linux.h", |
| 274 | "linux/latebindingsymboltable_linux.cc", |
| 275 | "linux/latebindingsymboltable_linux.h", |
kjellander@webrtc.org | c4870bb | 2014-09-01 04:24:11 +0000 | [diff] [blame] | 276 | ] |
noahric | c594aa61 | 2016-08-16 18:21:18 -0700 | [diff] [blame] | 277 | defines += [ "LINUX_ALSA" ] |
kjellander | c41d0c4 | 2017-05-30 12:06:04 -0700 | [diff] [blame] | 278 | libs = [ "dl" ] |
Joachim Bauch | 75f18fc | 2017-12-20 21:25:47 +0100 | [diff] [blame] | 279 | if (rtc_use_x11) { |
kjellander | c41d0c4 | 2017-05-30 12:06:04 -0700 | [diff] [blame] | 280 | libs += [ "X11" ] |
Joachim Bauch | 75f18fc | 2017-12-20 21:25:47 +0100 | [diff] [blame] | 281 | defines += [ "WEBRTC_USE_X11" ] |
kjellander | c41d0c4 | 2017-05-30 12:06:04 -0700 | [diff] [blame] | 282 | } |
noahric | c594aa61 | 2016-08-16 18:21:18 -0700 | [diff] [blame] | 283 | if (rtc_include_pulse_audio) { |
| 284 | sources += [ |
| 285 | "linux/audio_device_pulse_linux.cc", |
| 286 | "linux/audio_device_pulse_linux.h", |
| 287 | "linux/audio_mixer_manager_pulse_linux.cc", |
| 288 | "linux/audio_mixer_manager_pulse_linux.h", |
| 289 | "linux/pulseaudiosymboltable_linux.cc", |
| 290 | "linux/pulseaudiosymboltable_linux.h", |
| 291 | ] |
| 292 | defines += [ "LINUX_PULSE" ] |
| 293 | } |
kjellander@webrtc.org | c4870bb | 2014-09-01 04:24:11 +0000 | [diff] [blame] | 294 | } |
noahric | c594aa61 | 2016-08-16 18:21:18 -0700 | [diff] [blame] | 295 | if (is_mac) { |
| 296 | sources += [ |
| 297 | "mac/audio_device_mac.cc", |
| 298 | "mac/audio_device_mac.h", |
| 299 | "mac/audio_mixer_manager_mac.cc", |
| 300 | "mac/audio_mixer_manager_mac.h", |
noahric | c594aa61 | 2016-08-16 18:21:18 -0700 | [diff] [blame] | 301 | ] |
Oleh Prypin | 84de3d9 | 2019-08-01 12:19:31 +0200 | [diff] [blame] | 302 | deps += [ |
| 303 | ":audio_device_impl_frameworks", |
| 304 | "../third_party/portaudio:mac_portaudio", |
noahric | c594aa61 | 2016-08-16 18:21:18 -0700 | [diff] [blame] | 305 | ] |
| 306 | } |
noahric | c594aa61 | 2016-08-16 18:21:18 -0700 | [diff] [blame] | 307 | if (is_win) { |
| 308 | sources += [ |
| 309 | "win/audio_device_core_win.cc", |
| 310 | "win/audio_device_core_win.h", |
noahric | c594aa61 | 2016-08-16 18:21:18 -0700 | [diff] [blame] | 311 | ] |
| 312 | libs = [ |
| 313 | # Required for the built-in WASAPI AEC. |
| 314 | "dmoguids.lib", |
| 315 | "wmcodecdspuuid.lib", |
| 316 | "amstrmid.lib", |
| 317 | "msdmo.lib", |
| 318 | ] |
| 319 | } |
ehmaldonado | d02fe4b | 2016-08-26 13:31:24 -0700 | [diff] [blame] | 320 | configs += [ ":audio_device_warnings_config" ] |
kjellander@webrtc.org | c4870bb | 2014-09-01 04:24:11 +0000 | [diff] [blame] | 321 | } |
| 322 | } else { |
| 323 | defines = [ "WEBRTC_DUMMY_AUDIO_BUILD" ] |
| 324 | } |
| 325 | |
| 326 | if (!build_with_chromium) { |
| 327 | sources += [ |
| 328 | # Do not link these into Chrome since they contain static data. |
| 329 | "dummy/file_audio_device_factory.cc", |
| 330 | "dummy/file_audio_device_factory.h", |
| 331 | ] |
| 332 | } |
kjellander@webrtc.org | c4870bb | 2014-09-01 04:24:11 +0000 | [diff] [blame] | 333 | } |
maxmorin | 6910537 | 2016-08-16 02:17:44 -0700 | [diff] [blame] | 334 | |
Oleh Prypin | 84de3d9 | 2019-08-01 12:19:31 +0200 | [diff] [blame] | 335 | if (is_mac) { |
| 336 | rtc_source_set("audio_device_impl_frameworks") { |
| 337 | visibility = [ ":*" ] |
| 338 | libs = [ |
| 339 | # Needed for CoreGraphics: |
| 340 | "ApplicationServices.framework", |
| 341 | |
| 342 | "AudioToolbox.framework", |
| 343 | "CoreAudio.framework", |
| 344 | |
| 345 | # Needed for CGEventSourceKeyState in audio_device_mac.cc: |
| 346 | "CoreGraphics.framework", |
| 347 | ] |
| 348 | } |
| 349 | } |
| 350 | |
mbonadei | 3edccb9 | 2017-06-01 04:47:20 -0700 | [diff] [blame] | 351 | rtc_source_set("mock_audio_device") { |
| 352 | testonly = true |
| 353 | sources = [ |
| 354 | "include/mock_audio_device.h", |
| 355 | "include/mock_audio_transport.h", |
Patrik Höglund | d420903 | 2018-01-02 15:00:11 +0100 | [diff] [blame] | 356 | "mock_audio_device_buffer.h", |
mbonadei | 3edccb9 | 2017-06-01 04:47:20 -0700 | [diff] [blame] | 357 | ] |
| 358 | deps = [ |
| 359 | ":audio_device", |
Paulina Hensman | 7bd79a0 | 2018-03-15 12:44:12 +0100 | [diff] [blame] | 360 | ":audio_device_buffer", |
| 361 | ":audio_device_impl", |
mbonadei | 3edccb9 | 2017-06-01 04:47:20 -0700 | [diff] [blame] | 362 | "../../test:test_support", |
| 363 | ] |
mbonadei | 3edccb9 | 2017-06-01 04:47:20 -0700 | [diff] [blame] | 364 | } |
| 365 | |
aleloi | 5de52fd | 2016-11-10 01:05:34 -0800 | [diff] [blame] | 366 | if (rtc_include_tests) { |
Mirko Bonadei | 86d053c | 2019-10-17 21:32:04 +0200 | [diff] [blame] | 367 | rtc_library("audio_device_unittests") { |
ehmaldonado | 3626865 | 2017-01-19 08:27:11 -0800 | [diff] [blame] | 368 | testonly = true |
kjellander | e0629c0 | 2017-04-25 04:04:50 -0700 | [diff] [blame] | 369 | |
ehmaldonado | 3626865 | 2017-01-19 08:27:11 -0800 | [diff] [blame] | 370 | sources = [ |
| 371 | "fine_audio_buffer_unittest.cc", |
Artem Titov | f2afa57 | 2018-03-13 13:25:19 +0100 | [diff] [blame] | 372 | "include/test_audio_device_unittest.cc", |
ehmaldonado | 3626865 | 2017-01-19 08:27:11 -0800 | [diff] [blame] | 373 | ] |
| 374 | deps = [ |
| 375 | ":audio_device", |
Paulina Hensman | 7bd79a0 | 2018-03-15 12:44:12 +0100 | [diff] [blame] | 376 | ":audio_device_buffer", |
| 377 | ":audio_device_impl", |
ehmaldonado | 3626865 | 2017-01-19 08:27:11 -0800 | [diff] [blame] | 378 | ":mock_audio_device", |
kwiberg | 529662a | 2017-09-04 05:43:17 -0700 | [diff] [blame] | 379 | "../../api:array_view", |
Mirko Bonadei | d970807 | 2019-01-25 20:26:48 +0100 | [diff] [blame] | 380 | "../../api:scoped_refptr", |
Danil Chapovalov | 1c41be6 | 2019-04-01 09:16:12 +0200 | [diff] [blame] | 381 | "../../api/task_queue", |
| 382 | "../../api/task_queue:default_task_queue_factory", |
Artem Titov | 0f03973 | 2018-03-07 12:20:51 +0100 | [diff] [blame] | 383 | "../../common_audio", |
Patrik Höglund | a8005cf | 2017-12-13 16:05:42 +0100 | [diff] [blame] | 384 | "../../rtc_base:checks", |
Mirko Bonadei | 3663ed3 | 2019-10-19 12:03:23 +0200 | [diff] [blame] | 385 | "../../rtc_base:ignore_wundef", |
ehmaldonado | f6a861a | 2017-07-19 10:40:47 -0700 | [diff] [blame] | 386 | "../../rtc_base:rtc_base_approved", |
mbonadei | bcc2176 | 2017-09-12 04:45:24 -0700 | [diff] [blame] | 387 | "../../system_wrappers", |
Patrik Höglund | 7696bef | 2018-03-15 15:05:39 +0100 | [diff] [blame] | 388 | "../../test:fileutils", |
ehmaldonado | 3626865 | 2017-01-19 08:27:11 -0800 | [diff] [blame] | 389 | "../../test:test_support", |
Artem Titov | 94b57c0 | 2019-03-21 13:35:10 +0100 | [diff] [blame] | 390 | "../utility", |
Danil Chapovalov | 196100e | 2018-06-21 10:17:24 +0200 | [diff] [blame] | 391 | "//third_party/abseil-cpp/absl/types:optional", |
ehmaldonado | 3626865 | 2017-01-19 08:27:11 -0800 | [diff] [blame] | 392 | ] |
henrika | 1b35bab | 2017-03-29 07:50:19 -0700 | [diff] [blame] | 393 | if (is_linux || is_mac || is_win) { |
henrika | f2f91fa | 2017-03-17 04:26:22 -0700 | [diff] [blame] | 394 | sources += [ "audio_device_unittest.cc" ] |
| 395 | } |
henrika | ec9c745 | 2018-06-08 16:10:03 +0200 | [diff] [blame] | 396 | if (is_win) { |
henrika | 7e6fcea | 2018-05-18 10:20:58 +0200 | [diff] [blame] | 397 | sources += [ "win/core_audio_utility_win_unittest.cc" ] |
henrika | ec9c745 | 2018-06-08 16:10:03 +0200 | [diff] [blame] | 398 | deps += [ |
| 399 | ":audio_device_module_from_input_and_output", |
| 400 | ":windows_core_audio_utility", |
| 401 | ] |
henrika | 7e6fcea | 2018-05-18 10:20:58 +0200 | [diff] [blame] | 402 | } |
ehmaldonado | 3626865 | 2017-01-19 08:27:11 -0800 | [diff] [blame] | 403 | if (is_android) { |
| 404 | # Need to disable error due to the line in |
| 405 | # base/android/jni_android.h triggering it: |
| 406 | # const BASE_EXPORT jobject GetApplicationContext() |
| 407 | # error: type qualifiers ignored on function return type |
| 408 | cflags = [ "-Wno-ignored-qualifiers" ] |
| 409 | sources += [ |
| 410 | "android/audio_device_unittest.cc", |
| 411 | "android/audio_manager_unittest.cc", |
| 412 | "android/ensure_initialized.cc", |
| 413 | "android/ensure_initialized.h", |
| 414 | ] |
| 415 | deps += [ |
Oleh Prypin | da04e06 | 2018-07-23 10:04:12 +0200 | [diff] [blame] | 416 | "../../base", |
jianjun.zhu | c024740 | 2017-07-11 06:20:45 -0700 | [diff] [blame] | 417 | "../../sdk/android:libjingle_peerconnection_java", |
ehmaldonado | 3626865 | 2017-01-19 08:27:11 -0800 | [diff] [blame] | 418 | ] |
| 419 | } |
Joachim Bauch | 5d2bb36 | 2017-12-20 21:19:49 +0100 | [diff] [blame] | 420 | if (!rtc_include_internal_audio_device) { |
| 421 | defines = [ "WEBRTC_DUMMY_AUDIO_BUILD" ] |
| 422 | } |
ehmaldonado | 3626865 | 2017-01-19 08:27:11 -0800 | [diff] [blame] | 423 | } |
maxmorin | 6910537 | 2016-08-16 02:17:44 -0700 | [diff] [blame] | 424 | } |
mbonadei | 438062b | 2017-01-09 02:37:21 -0800 | [diff] [blame] | 425 | |
| 426 | if (!build_with_chromium && is_android) { |
Mirko Bonadei | fbb3b7d | 2017-11-07 15:36:33 +0000 | [diff] [blame] | 427 | rtc_android_library("audio_device_java") { |
mbonadei | b55bd97 | 2017-01-23 01:25:53 -0800 | [diff] [blame] | 428 | java_files = [ |
mbonadei | 438062b | 2017-01-09 02:37:21 -0800 | [diff] [blame] | 429 | "android/java/src/org/webrtc/voiceengine/BuildInfo.java", |
| 430 | "android/java/src/org/webrtc/voiceengine/WebRtcAudioEffects.java", |
| 431 | "android/java/src/org/webrtc/voiceengine/WebRtcAudioManager.java", |
| 432 | "android/java/src/org/webrtc/voiceengine/WebRtcAudioRecord.java", |
| 433 | "android/java/src/org/webrtc/voiceengine/WebRtcAudioTrack.java", |
| 434 | "android/java/src/org/webrtc/voiceengine/WebRtcAudioUtils.java", |
| 435 | ] |
mbonadei | b55bd97 | 2017-01-23 01:25:53 -0800 | [diff] [blame] | 436 | deps = [ |
jianjun.zhu | c024740 | 2017-07-11 06:20:45 -0700 | [diff] [blame] | 437 | "../../rtc_base:base_java", |
Peter Wen | 7bc331f | 2019-03-06 09:18:57 -0500 | [diff] [blame] | 438 | "//third_party/android_deps:com_android_support_support_annotations_java", |
mbonadei | b55bd97 | 2017-01-23 01:25:53 -0800 | [diff] [blame] | 439 | ] |
mbonadei | 438062b | 2017-01-09 02:37:21 -0800 | [diff] [blame] | 440 | } |
| 441 | } |