From d29e3ea4b2f4d7901ddcda5f229c30f4daf731f6 Mon Sep 17 00:00:00 2001 From: peah Date: Tue, 13 Sep 2016 21:42:39 -0700 Subject: [PATCH] Added build flag around the Intelligibility enhancer performance test code BUG=chromium:641931 Review-Url: https://codereview.webrtc.org/2294093004 Cr-Commit-Position: refs/heads/master@{#14202} --- webrtc/BUILD.gn | 7 +++++++ .../audio_processing_performance_unittest.cc | 10 ++++++++++ webrtc/webrtc_tests.gypi | 6 ++++++ 3 files changed, 23 insertions(+) diff --git a/webrtc/BUILD.gn b/webrtc/BUILD.gn index 504309121a..2d722c9125 100644 --- a/webrtc/BUILD.gn +++ b/webrtc/BUILD.gn @@ -776,6 +776,13 @@ if (rtc_include_tests) { "//testing/gmock", "//testing/gtest", ] + + if (rtc_enable_intelligibility_enhancer) { + defines = [ "WEBRTC_INTELLIGIBILITY_ENHANCER=1" ] + } else { + defines = [ "WEBRTC_INTELLIGIBILITY_ENHANCER=0" ] + } + if (is_android) { deps += [ "//testing/android/native_test:native_test_native_code" ] data = webrtc_perf_tests_resources diff --git a/webrtc/modules/audio_processing/audio_processing_performance_unittest.cc b/webrtc/modules/audio_processing/audio_processing_performance_unittest.cc index 5309a6a42f..a29c96d682 100644 --- a/webrtc/modules/audio_processing/audio_processing_performance_unittest.cc +++ b/webrtc/modules/audio_processing/audio_processing_performance_unittest.cc @@ -29,6 +29,14 @@ #include "webrtc/system_wrappers/include/sleep.h" #include "webrtc/test/testsupport/perf_test.h" +// Check to verify that the define for the intelligibility enhancer is properly +// set. +#if !defined(WEBRTC_INTELLIGIBILITY_ENHANCER) || \ + (WEBRTC_INTELLIGIBILITY_ENHANCER != 0 && \ + WEBRTC_INTELLIGIBILITY_ENHANCER != 1) +#error "Set WEBRTC_INTELLIGIBILITY_ENHANCER to either 0 or 1" +#endif + namespace webrtc { namespace { @@ -96,6 +104,7 @@ struct SimulationConfig { } } +#if WEBRTC_INTELLIGIBILITY_ENHANCER == 1 const SettingsType intelligibility_enhancer_settings[] = { SettingsType::kDefaultApmDesktopAndIntelligibilityEnhancer}; @@ -107,6 +116,7 @@ struct SimulationConfig { simulation_configs.push_back(SimulationConfig(sample_rate, settings)); } } +#endif const SettingsType beamformer_settings[] = { SettingsType::kDefaultApmDesktopAndBeamformer}; diff --git a/webrtc/webrtc_tests.gypi b/webrtc/webrtc_tests.gypi index 79e011f262..5c4d62adb3 100644 --- a/webrtc/webrtc_tests.gypi +++ b/webrtc/webrtc_tests.gypi @@ -454,6 +454,12 @@ 'webrtc', ], 'conditions': [ + ['enable_intelligibility_enhancer==1', { + 'defines': ['WEBRTC_INTELLIGIBILITY_ENHANCER=1',], + }, { + 'defines': ['WEBRTC_INTELLIGIBILITY_ENHANCER=0',], + }], + ['OS=="android"', { 'dependencies': [ '<(DEPTH)/testing/android/native_test.gyp:native_test_native_code',