From 0e0be0a2f56225593e624c74b689e68f5747435a Mon Sep 17 00:00:00 2001 From: aleloi Date: Wed, 10 Aug 2016 04:55:20 -0700 Subject: [PATCH] Migrated GN target :neteq_ilbc_quality_test Migrated GN target :neteq_ilbc_quality_test from webrtc/modules/audio_coding/neteq/neteq_tests.gypi NOTRY=True BUG=webrtc:6190 Review-Url: https://codereview.webrtc.org/2221193004 Cr-Commit-Position: refs/heads/master@{#13708} --- webrtc/modules/audio_coding/BUILD.gn | 27 ++++++++++++++----- webrtc/modules/audio_coding/neteq/neteq.gypi | 1 + .../audio_coding/neteq/neteq_tests.gypi | 1 + .../audio_coding/neteq/tools/audio_sink.cc | 21 +++++++++++++++ .../audio_coding/neteq/tools/audio_sink.h | 6 ++--- 5 files changed, 46 insertions(+), 10 deletions(-) create mode 100644 webrtc/modules/audio_coding/neteq/tools/audio_sink.cc diff --git a/webrtc/modules/audio_coding/BUILD.gn b/webrtc/modules/audio_coding/BUILD.gn index 3e292e31ad..5938d6cb65 100644 --- a/webrtc/modules/audio_coding/BUILD.gn +++ b/webrtc/modules/audio_coding/BUILD.gn @@ -1167,6 +1167,7 @@ if (rtc_include_tests) { "neteq/tools/audio_checksum.h", "neteq/tools/audio_loop.cc", "neteq/tools/audio_loop.h", + "neteq/tools/audio_sink.cc", "neteq/tools/audio_sink.h", "neteq/tools/constant_pcm_packet_source.cc", "neteq/tools/constant_pcm_packet_source.h", @@ -1388,17 +1389,12 @@ if (rtc_include_tests) { deps = [ ":neteq", ":neteq_test_support", + ":neteq_unittest_tools", ":webrtc_opus", "../../test:test_support_main", "//testing/gtest", "//third_party/gflags", ] - - if (is_clang) { - # Suppress warnings from the Chromium Clang plugins - # (bugs.webrtc.org/163). - configs -= [ "//build/config/clang:find_bad_constructs" ] - } } executable("neteq_speed_test") { @@ -1428,4 +1424,23 @@ if (rtc_include_tests) { "../../system_wrappers:system_wrappers_default", ] } + + executable("neteq_ilbc_quality_test") { + testonly = true + + sources = [ + "neteq/test/neteq_ilbc_quality_test.cc", + ] + + deps = [ + ":ilbc", + ":neteq", + ":neteq_test_support", + ":neteq_unittest_tools", + "../../system_wrappers:system_wrappers_default", + "../../test:test_support_main", + "//testing/gtest", + "//third_party/gflags", + ] + } } diff --git a/webrtc/modules/audio_coding/neteq/neteq.gypi b/webrtc/modules/audio_coding/neteq/neteq.gypi index a06b613938..f43a261efa 100644 --- a/webrtc/modules/audio_coding/neteq/neteq.gypi +++ b/webrtc/modules/audio_coding/neteq/neteq.gypi @@ -228,6 +228,7 @@ 'tools/audio_loop.cc', 'tools/audio_loop.h', 'tools/audio_sink.h', + 'tools/audio_sink.cc', 'tools/constant_pcm_packet_source.cc', 'tools/constant_pcm_packet_source.h', 'tools/fake_decode_from_file.cc', diff --git a/webrtc/modules/audio_coding/neteq/neteq_tests.gypi b/webrtc/modules/audio_coding/neteq/neteq_tests.gypi index e5ead384ef..f2b1e8a1b2 100644 --- a/webrtc/modules/audio_coding/neteq/neteq_tests.gypi +++ b/webrtc/modules/audio_coding/neteq/neteq_tests.gypi @@ -241,6 +241,7 @@ 'dependencies': [ '<(DEPTH)/testing/gtest.gyp:gtest', '<(DEPTH)/third_party/gflags/gflags.gyp:gflags', + '<(webrtc_root)/system_wrappers/system_wrappers.gyp:system_wrappers_default', '<(webrtc_root)/test/test.gyp:test_support_main', 'neteq', 'neteq_test_support', diff --git a/webrtc/modules/audio_coding/neteq/tools/audio_sink.cc b/webrtc/modules/audio_coding/neteq/tools/audio_sink.cc new file mode 100644 index 0000000000..fb848bdbd9 --- /dev/null +++ b/webrtc/modules/audio_coding/neteq/tools/audio_sink.cc @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. + * + * Use of this source code is governed by a BSD-style license + * that can be found in the LICENSE file in the root of the source + * tree. An additional intellectual property rights grant can be found + * in the file PATENTS. All contributing project authors may + * be found in the AUTHORS file in the root of the source tree. + */ + +#include "webrtc/modules/audio_coding/neteq/tools/audio_sink.h" + +namespace webrtc { +namespace test { + +bool AudioSinkFork::WriteArray(const int16_t* audio, size_t num_samples) { + return left_sink_->WriteArray(audio, num_samples) && + right_sink_->WriteArray(audio, num_samples); +} +} // namespace test +} // namespace webrtc diff --git a/webrtc/modules/audio_coding/neteq/tools/audio_sink.h b/webrtc/modules/audio_coding/neteq/tools/audio_sink.h index 489a8b2ad8..8a5479ef26 100644 --- a/webrtc/modules/audio_coding/neteq/tools/audio_sink.h +++ b/webrtc/modules/audio_coding/neteq/tools/audio_sink.h @@ -47,10 +47,7 @@ class AudioSinkFork : public AudioSink { AudioSinkFork(AudioSink* left, AudioSink* right) : left_sink_(left), right_sink_(right) {} - bool WriteArray(const int16_t* audio, size_t num_samples) override { - return left_sink_->WriteArray(audio, num_samples) && - right_sink_->WriteArray(audio, num_samples); - } + bool WriteArray(const int16_t* audio, size_t num_samples) override; private: AudioSink* left_sink_; @@ -58,6 +55,7 @@ class AudioSinkFork : public AudioSink { RTC_DISALLOW_COPY_AND_ASSIGN(AudioSinkFork); }; + } // namespace test } // namespace webrtc #endif // WEBRTC_MODULES_AUDIO_CODING_NETEQ_TOOLS_AUDIO_SINK_H_