 Chromium Code Reviews
 Chromium Code Reviews Issue 2991343002:
  Decoupling audio_device from Obj-C code  (Closed)
    
  
    Issue 2991343002:
  Decoupling audio_device from Obj-C code  (Closed) 
  | OLD | NEW | 
|---|---|
| 1 # Copyright (c) 2014 The WebRTC project authors. All Rights Reserved. | 1 # Copyright (c) 2014 The WebRTC project authors. All Rights Reserved. | 
| 2 # | 2 # | 
| 3 # Use of this source code is governed by a BSD-style license | 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 | 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 | 5 # tree. An additional intellectual property rights grant can be found | 
| 6 # in the file PATENTS. All contributing project authors may | 6 # in the file PATENTS. All contributing project authors may | 
| 7 # be found in the AUTHORS file in the root of the source tree. | 7 # be found in the AUTHORS file in the root of the source tree. | 
| 8 | 8 | 
| 9 import("../../webrtc.gni") | 9 import("../../webrtc.gni") | 
| 10 | 10 | 
| (...skipping 28 matching lines...) Expand all Loading... | |
| 39 | 39 | 
| 40 # See https://bugs.chromium.org/p/webrtc/issues/detail?id=6265 | 40 # See https://bugs.chromium.org/p/webrtc/issues/detail?id=6265 | 
| 41 # for -Wno-thread-safety-analysis | 41 # for -Wno-thread-safety-analysis | 
| 42 "-Wno-thread-safety-analysis", | 42 "-Wno-thread-safety-analysis", | 
| 43 "-Wno-unused-private-field", | 43 "-Wno-unused-private-field", | 
| 44 ] | 44 ] | 
| 45 } | 45 } | 
| 46 } | 46 } | 
| 47 | 47 | 
| 48 rtc_static_library("audio_device") { | 48 rtc_static_library("audio_device") { | 
| 49 if (is_ios || is_mac) { | |
| 50 sources = [ | |
| 51 "noop.cc", | |
| 
kjellander_webrtc
2017/08/16 12:46:16
Add a comment about why this silly thing is needed
 | |
| 52 ] | |
| 53 } | |
| 54 if (rtc_include_internal_audio_device && is_ios) { | |
| 55 public_deps = [ | |
| 56 ":audio_device_ios", | |
| 57 ] | |
| 58 } else { | |
| 59 public_deps = [ | |
| 60 ":audio_device_generic", | |
| 61 ] | |
| 62 } | |
| 63 } | |
| 64 | |
| 65 if (rtc_include_internal_audio_device && is_ios) { | |
| 66 rtc_static_library("audio_device_ios") { | |
| 67 visibility = [ ":*" ] | |
| 68 sources = [ | |
| 69 "ios/audio_device_ios.h", | |
| 70 "ios/audio_device_ios.mm", | |
| 71 "ios/audio_device_not_implemented_ios.mm", | |
| 72 "ios/audio_session_observer.h", | |
| 73 "ios/objc/RTCAudioSessionDelegateAdapter.h", | |
| 74 "ios/objc/RTCAudioSessionDelegateAdapter.mm", | |
| 75 "ios/voice_processing_audio_unit.h", | |
| 76 "ios/voice_processing_audio_unit.mm", | |
| 77 ] | |
| 78 libs = [ | |
| 79 "AudioToolbox.framework", | |
| 80 "AVFoundation.framework", | |
| 81 "Foundation.framework", | |
| 82 "UIKit.framework", | |
| 83 ] | |
| 84 deps = [ | |
| 85 "../../rtc_base:gtest_prod", | |
| 86 "../../rtc_base:rtc_base", | |
| 87 "../../sdk:objc_audio", | |
| 88 "../../sdk:objc_common", | |
| 89 "../../system_wrappers:metrics_api", | |
| 90 ] | |
| 91 public_deps = [ | |
| 92 ":audio_device_generic", | |
| 93 ] | |
| 94 if (!build_with_chromium && is_clang) { | |
| 95 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163). | |
| 96 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ] | |
| 97 } | |
| 98 } | |
| 99 } | |
| 100 | |
| 101 rtc_static_library("audio_device_generic") { | |
| 102 visibility = [ ":*" ] | |
| 49 public_configs = [ ":audio_device_config" ] | 103 public_configs = [ ":audio_device_config" ] | 
| 50 | 104 | 
| 51 deps = [ | 105 deps = [ | 
| 52 "..:module_api", | 106 "..:module_api", | 
| 53 "../..:webrtc_common", | 107 "../..:webrtc_common", | 
| 54 "../../common_audio", | 108 "../../common_audio", | 
| 55 "../../rtc_base:rtc_base_approved", | 109 "../../rtc_base:rtc_base_approved", | 
| 56 "../../rtc_base:rtc_task_queue", | 110 "../../rtc_base:rtc_task_queue", | 
| 57 "../../system_wrappers", | 111 "../../system_wrappers", | 
| 58 "../utility", | 112 "../utility", | 
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 168 # Needed for CoreGraphics: | 222 # Needed for CoreGraphics: | 
| 169 "ApplicationServices.framework", | 223 "ApplicationServices.framework", | 
| 170 | 224 | 
| 171 "AudioToolbox.framework", | 225 "AudioToolbox.framework", | 
| 172 "CoreAudio.framework", | 226 "CoreAudio.framework", | 
| 173 | 227 | 
| 174 # Needed for CGEventSourceKeyState in audio_device_mac.cc: | 228 # Needed for CGEventSourceKeyState in audio_device_mac.cc: | 
| 175 "CoreGraphics.framework", | 229 "CoreGraphics.framework", | 
| 176 ] | 230 ] | 
| 177 } | 231 } | 
| 178 if (is_ios) { | |
| 179 public_deps = [ | |
| 180 "../../rtc_base:gtest_prod", | |
| 181 "../../rtc_base:rtc_base", | |
| 182 "../../sdk:objc_audio", | |
| 183 "../../sdk:objc_common", | |
| 184 ] | |
| 185 sources += [ | |
| 186 "ios/audio_device_ios.h", | |
| 187 "ios/audio_device_ios.mm", | |
| 188 "ios/audio_device_not_implemented_ios.mm", | |
| 189 "ios/audio_session_observer.h", | |
| 190 "ios/objc/RTCAudioSessionDelegateAdapter.h", | |
| 191 "ios/objc/RTCAudioSessionDelegateAdapter.mm", | |
| 192 "ios/voice_processing_audio_unit.h", | |
| 193 "ios/voice_processing_audio_unit.mm", | |
| 194 ] | |
| 195 libs = [ | |
| 196 "AudioToolbox.framework", | |
| 197 "AVFoundation.framework", | |
| 198 "Foundation.framework", | |
| 199 "UIKit.framework", | |
| 200 ] | |
| 201 } | |
| 202 if (is_win) { | 232 if (is_win) { | 
| 203 sources += [ | 233 sources += [ | 
| 204 "win/audio_device_core_win.cc", | 234 "win/audio_device_core_win.cc", | 
| 205 "win/audio_device_core_win.h", | 235 "win/audio_device_core_win.h", | 
| 206 ] | 236 ] | 
| 207 libs = [ | 237 libs = [ | 
| 208 # Required for the built-in WASAPI AEC. | 238 # Required for the built-in WASAPI AEC. | 
| 209 "dmoguids.lib", | 239 "dmoguids.lib", | 
| 210 "wmcodecdspuuid.lib", | 240 "wmcodecdspuuid.lib", | 
| 211 "amstrmid.lib", | 241 "amstrmid.lib", | 
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 259 "include/mock_audio_transport.h", | 289 "include/mock_audio_transport.h", | 
| 260 ] | 290 ] | 
| 261 deps = [ | 291 deps = [ | 
| 262 ":audio_device", | 292 ":audio_device", | 
| 263 "../../test:test_support", | 293 "../../test:test_support", | 
| 264 ] | 294 ] | 
| 265 all_dependent_configs = [ ":mock_audio_device_config" ] | 295 all_dependent_configs = [ ":mock_audio_device_config" ] | 
| 266 } | 296 } | 
| 267 | 297 | 
| 268 if (rtc_include_tests) { | 298 if (rtc_include_tests) { | 
| 299 # TODO(kthelgason): Reenable these tests on simulator. | |
| 300 # See bugs.webrtc.org/7812 | |
| 301 if (is_ios && !use_ios_simulator) { | |
| 302 rtc_source_set("audio_device_ios_unittests") { | |
| 303 testonly = true | |
| 304 visibility = [ ":*" ] | |
| 305 sources = [ | |
| 306 "ios/audio_device_unittest_ios.mm", | |
| 307 ] | |
| 308 deps = [ | |
| 309 ":audio_device", | |
| 310 ":mock_audio_device", | |
| 311 "../../rtc_base:rtc_base_approved", | |
| 312 "../../sdk:objc_audio", | |
| 313 "../../system_wrappers", | |
| 314 "../../test:test_support", | |
| 315 "//testing/gmock", | |
| 316 "//third_party/ocmock", | |
| 317 ] | |
| 318 if (!build_with_chromium && is_clang) { | |
| 319 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163) . | |
| 320 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ] | |
| 321 } | |
| 322 } | |
| 323 } | |
| 324 | |
| 269 rtc_source_set("audio_device_unittests") { | 325 rtc_source_set("audio_device_unittests") { | 
| 270 testonly = true | 326 testonly = true | 
| 271 | 327 | 
| 272 # Skip restricting visibility on mobile platforms since the tests on those | 328 # Skip restricting visibility on mobile platforms since the tests on those | 
| 273 # gets additional generated targets which would require many lines here to | 329 # gets additional generated targets which would require many lines here to | 
| 274 # cover (which would be confusing to read and hard to maintain). | 330 # cover (which would be confusing to read and hard to maintain). | 
| 275 if (!is_android && !is_ios) { | 331 if (!is_android && !is_ios) { | 
| 276 visibility = [ "..:modules_unittests" ] | 332 visibility = [ "..:modules_unittests" ] | 
| 277 } | 333 } | 
| 278 sources = [ | 334 sources = [ | 
| 279 "fine_audio_buffer_unittest.cc", | 335 "fine_audio_buffer_unittest.cc", | 
| 280 ] | 336 ] | 
| 281 deps = [ | 337 deps = [ | 
| 282 ":audio_device", | 338 ":audio_device", | 
| 283 ":mock_audio_device", | 339 ":mock_audio_device", | 
| 284 "../../rtc_base:rtc_base_approved", | 340 "../../rtc_base:rtc_base_approved", | 
| 285 "../../system_wrappers:system_wrappers", | 341 "../../system_wrappers", | 
| 286 "../../test:test_support", | 342 "../../test:test_support", | 
| 287 "../utility:utility", | 343 "../utility:utility", | 
| 288 "//testing/gmock", | 344 "//testing/gmock", | 
| 289 ] | 345 ] | 
| 290 if (is_linux || is_mac || is_win) { | 346 if (is_linux || is_mac || is_win) { | 
| 291 sources += [ "audio_device_unittest.cc" ] | 347 sources += [ "audio_device_unittest.cc" ] | 
| 292 } | 348 } | 
| 293 if (is_android) { | 349 if (is_android) { | 
| 294 # Need to disable error due to the line in | 350 # Need to disable error due to the line in | 
| 295 # base/android/jni_android.h triggering it: | 351 # base/android/jni_android.h triggering it: | 
| 296 # const BASE_EXPORT jobject GetApplicationContext() | 352 # const BASE_EXPORT jobject GetApplicationContext() | 
| 297 # error: type qualifiers ignored on function return type | 353 # error: type qualifiers ignored on function return type | 
| 298 cflags = [ "-Wno-ignored-qualifiers" ] | 354 cflags = [ "-Wno-ignored-qualifiers" ] | 
| 299 sources += [ | 355 sources += [ | 
| 300 "android/audio_device_unittest.cc", | 356 "android/audio_device_unittest.cc", | 
| 301 "android/audio_manager_unittest.cc", | 357 "android/audio_manager_unittest.cc", | 
| 302 "android/ensure_initialized.cc", | 358 "android/ensure_initialized.cc", | 
| 303 "android/ensure_initialized.h", | 359 "android/ensure_initialized.h", | 
| 304 ] | 360 ] | 
| 305 deps += [ | 361 deps += [ | 
| 306 "../../../base", | 362 "../../../base", | 
| 307 "../../sdk/android:libjingle_peerconnection_java", | 363 "../../sdk/android:libjingle_peerconnection_java", | 
| 308 ] | 364 ] | 
| 309 } | 365 } | 
| 310 if (is_ios && !use_ios_simulator) { | |
| 311 # TODO(kthelgason): Reenable these tests on simulator. | |
| 312 # See bugs.webrtc.org/7812 | |
| 313 sources += [ "ios/audio_device_unittest_ios.mm" ] | |
| 314 deps += [ "//third_party/ocmock" ] | |
| 315 } | |
| 316 if (!build_with_chromium && is_clang) { | 366 if (!build_with_chromium && is_clang) { | 
| 317 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163). | 367 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163). | 
| 318 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ] | 368 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ] | 
| 319 } | 369 } | 
| 320 } | 370 } | 
| 321 | 371 | 
| 322 if (!is_ios) { | 372 if (!is_ios) { | 
| 323 # These tests do not work on ios, see | 373 # These tests do not work on ios, see | 
| 324 # https://bugs.chromium.org/p/webrtc/issues/detail?id=4755 | 374 # https://bugs.chromium.org/p/webrtc/issues/detail?id=4755 | 
| 325 rtc_executable("audio_device_tests") { | 375 rtc_executable("audio_device_tests") { | 
| (...skipping 26 matching lines...) Expand all Loading... | |
| 352 "android/java/src/org/webrtc/voiceengine/WebRtcAudioManager.java", | 402 "android/java/src/org/webrtc/voiceengine/WebRtcAudioManager.java", | 
| 353 "android/java/src/org/webrtc/voiceengine/WebRtcAudioRecord.java", | 403 "android/java/src/org/webrtc/voiceengine/WebRtcAudioRecord.java", | 
| 354 "android/java/src/org/webrtc/voiceengine/WebRtcAudioTrack.java", | 404 "android/java/src/org/webrtc/voiceengine/WebRtcAudioTrack.java", | 
| 355 "android/java/src/org/webrtc/voiceengine/WebRtcAudioUtils.java", | 405 "android/java/src/org/webrtc/voiceengine/WebRtcAudioUtils.java", | 
| 356 ] | 406 ] | 
| 357 deps = [ | 407 deps = [ | 
| 358 "../../rtc_base:base_java", | 408 "../../rtc_base:base_java", | 
| 359 ] | 409 ] | 
| 360 } | 410 } | 
| 361 } | 411 } | 
| OLD | NEW |