From c6192a9e3207cd3c2815939c9c6a68cbf97905de Mon Sep 17 00:00:00 2001 From: solenberg Date: Mon, 13 Mar 2017 02:36:19 -0700 Subject: [PATCH] Remove VoENetEqStats interface. (TBR stefan@ for changes to webrtc/test/mock_voice_engine.h) BUG=webrtc:4690 TBR=stefan@webrtc.org Review-Url: https://codereview.webrtc.org/2744953003 Cr-Commit-Position: refs/heads/master@{#17201} --- webrtc/test/mock_voice_engine.h | 6 -- webrtc/voice_engine/BUILD.gn | 4 - webrtc/voice_engine/channel.h | 6 +- webrtc/voice_engine/include/voe_neteq_stats.h | 49 ------------ .../fixtures/before_initialization_fixture.cc | 2 - .../fixtures/before_initialization_fixture.h | 2 - .../auto_test/standard/neteq_stats_test.cc | 59 -------------- .../test/auto_test/voe_standard_test.cc | 5 -- .../test/auto_test/voe_standard_test.h | 4 +- .../test/auto_test/voe_test_defines.h | 3 - webrtc/voice_engine/voe_neteq_stats_impl.cc | 77 ------------------- webrtc/voice_engine/voe_neteq_stats_impl.h | 38 --------- webrtc/voice_engine/voice_engine_impl.h | 3 - 13 files changed, 4 insertions(+), 254 deletions(-) delete mode 100644 webrtc/voice_engine/include/voe_neteq_stats.h delete mode 100644 webrtc/voice_engine/test/auto_test/standard/neteq_stats_test.cc delete mode 100644 webrtc/voice_engine/voe_neteq_stats_impl.cc delete mode 100644 webrtc/voice_engine/voe_neteq_stats_impl.h diff --git a/webrtc/test/mock_voice_engine.h b/webrtc/test/mock_voice_engine.h index a55489b788..7c11f5d74b 100644 --- a/webrtc/test/mock_voice_engine.h +++ b/webrtc/test/mock_voice_engine.h @@ -196,12 +196,6 @@ class MockVoiceEngine : public VoiceEngineImpl { MOCK_CONST_METHOD0(BuiltInNSIsAvailable, bool()); MOCK_METHOD1(EnableBuiltInNS, int(bool enable)); - // VoENetEqStats - MOCK_METHOD2(GetNetworkStatistics, - int(int channel, NetworkStatistics& stats)); - MOCK_CONST_METHOD2(GetDecodingCallStatistics, - int(int channel, AudioDecodingCallStats* stats)); - // VoENetwork MOCK_METHOD2(RegisterExternalTransport, int(int channel, Transport& transport)); diff --git a/webrtc/voice_engine/BUILD.gn b/webrtc/voice_engine/BUILD.gn index 38f0212e4f..31cdff8d5c 100644 --- a/webrtc/voice_engine/BUILD.gn +++ b/webrtc/voice_engine/BUILD.gn @@ -79,7 +79,6 @@ rtc_static_library("voice_engine") { "include/voe_errors.h", "include/voe_file.h", "include/voe_hardware.h", - "include/voe_neteq_stats.h", "include/voe_network.h", "include/voe_rtp_rtcp.h", "monitor_module.h", @@ -103,8 +102,6 @@ rtc_static_library("voice_engine") { "voe_file_impl.h", "voe_hardware_impl.cc", "voe_hardware_impl.h", - "voe_neteq_stats_impl.cc", - "voe_neteq_stats_impl.h", "voe_network_impl.cc", "voe_network_impl.h", "voe_rtp_rtcp_impl.cc", @@ -278,7 +275,6 @@ if (rtc_include_tests) { "test/auto_test/standard/hardware_before_initializing_test.cc", "test/auto_test/standard/hardware_test.cc", "test/auto_test/standard/mixing_test.cc", - "test/auto_test/standard/neteq_stats_test.cc", "test/auto_test/standard/rtp_rtcp_before_streaming_test.cc", "test/auto_test/standard/rtp_rtcp_extensions.cc", "test/auto_test/standard/rtp_rtcp_test.cc", diff --git a/webrtc/voice_engine/channel.h b/webrtc/voice_engine/channel.h index 9835b20757..60e6f6040c 100644 --- a/webrtc/voice_engine/channel.h +++ b/webrtc/voice_engine/channel.h @@ -249,17 +249,17 @@ class Channel int GetSpeechOutputLevel() const; int GetSpeechOutputLevelFullRange() const; - // VoENetEqStats + // Stats. int GetNetworkStatistics(NetworkStatistics& stats); void GetDecodingCallStatistics(AudioDecodingCallStats* stats) const; - // Audio+Video Sync + // Audio+Video Sync. uint32_t GetDelayEstimate() const; int SetMinimumPlayoutDelay(int delayMs); int GetPlayoutTimestamp(unsigned int& timestamp); int GetRtpRtcp(RtpRtcp** rtpRtcpModule, RtpReceiver** rtp_receiver) const; - // DTMF + // DTMF. int SendTelephoneEventOutband(int event, int duration_ms); int SetSendTelephoneEventPayloadType(int payload_type, int payload_frequency); diff --git a/webrtc/voice_engine/include/voe_neteq_stats.h b/webrtc/voice_engine/include/voe_neteq_stats.h deleted file mode 100644 index fb70cae18a..0000000000 --- a/webrtc/voice_engine/include/voe_neteq_stats.h +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright (c) 2011 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. - */ - -#ifndef WEBRTC_VOICE_ENGINE_VOE_NETEQ_STATS_H -#define WEBRTC_VOICE_ENGINE_VOE_NETEQ_STATS_H - -#include "webrtc/common_types.h" - -namespace webrtc { - -class VoiceEngine; - -class WEBRTC_DLLEXPORT VoENetEqStats { - public: - // Factory for the VoENetEqStats sub-API. Increases an internal - // reference counter if successful. Returns NULL if the API is not - // supported or if construction fails. - static VoENetEqStats* GetInterface(VoiceEngine* voiceEngine); - - // Releases the VoENetEqStats sub-API and decreases an internal - // reference counter. Returns the new reference count. This value should - // be zero for all sub-API:s before the VoiceEngine object can be safely - // deleted. - virtual int Release() = 0; - - // Get the "in-call" statistics from NetEQ. - // The statistics are reset after the query. - virtual int GetNetworkStatistics(int channel, NetworkStatistics& stats) = 0; - - // Get statistics of calls to AudioCodingModule::PlayoutData10Ms(). - virtual int GetDecodingCallStatistics( - int channel, - AudioDecodingCallStats* stats) const = 0; - - protected: - VoENetEqStats() {} - virtual ~VoENetEqStats() {} -}; - -} // namespace webrtc - -#endif // #ifndef WEBRTC_VOICE_ENGINE_VOE_NETEQ_STATS_H diff --git a/webrtc/voice_engine/test/auto_test/fixtures/before_initialization_fixture.cc b/webrtc/voice_engine/test/auto_test/fixtures/before_initialization_fixture.cc index b8a88caf03..9529394392 100644 --- a/webrtc/voice_engine/test/auto_test/fixtures/before_initialization_fixture.cc +++ b/webrtc/voice_engine/test/auto_test/fixtures/before_initialization_fixture.cc @@ -22,7 +22,6 @@ BeforeInitializationFixture::BeforeInitializationFixture() voe_network_ = webrtc::VoENetwork::GetInterface(voice_engine_); voe_file_ = webrtc::VoEFile::GetInterface(voice_engine_); voe_hardware_ = webrtc::VoEHardware::GetInterface(voice_engine_); - voe_neteq_stats_ = webrtc::VoENetEqStats::GetInterface(voice_engine_); } BeforeInitializationFixture::~BeforeInitializationFixture() { @@ -32,7 +31,6 @@ BeforeInitializationFixture::~BeforeInitializationFixture() { voe_network_->Release(); voe_file_->Release(); voe_hardware_->Release(); - voe_neteq_stats_->Release(); EXPECT_TRUE(webrtc::VoiceEngine::Delete(voice_engine_)); } diff --git a/webrtc/voice_engine/test/auto_test/fixtures/before_initialization_fixture.h b/webrtc/voice_engine/test/auto_test/fixtures/before_initialization_fixture.h index ac1ad3c6d4..073ff4441f 100644 --- a/webrtc/voice_engine/test/auto_test/fixtures/before_initialization_fixture.h +++ b/webrtc/voice_engine/test/auto_test/fixtures/before_initialization_fixture.h @@ -20,7 +20,6 @@ #include "webrtc/voice_engine/include/voe_errors.h" #include "webrtc/voice_engine/include/voe_file.h" #include "webrtc/voice_engine/include/voe_hardware.h" -#include "webrtc/voice_engine/include/voe_neteq_stats.h" #include "webrtc/voice_engine/include/voe_network.h" #include "webrtc/voice_engine/include/voe_rtp_rtcp.h" #include "webrtc/voice_engine/test/auto_test/voe_test_common.h" @@ -52,7 +51,6 @@ class BeforeInitializationFixture : public testing::Test { webrtc::VoENetwork* voe_network_; webrtc::VoEFile* voe_file_; webrtc::VoEHardware* voe_hardware_; - webrtc::VoENetEqStats* voe_neteq_stats_; }; #endif // SRC_VOICE_ENGINE_MAIN_TEST_AUTO_TEST_STANDARD_TEST_BASE_H_ diff --git a/webrtc/voice_engine/test/auto_test/standard/neteq_stats_test.cc b/webrtc/voice_engine/test/auto_test/standard/neteq_stats_test.cc deleted file mode 100644 index 94a2c42e15..0000000000 --- a/webrtc/voice_engine/test/auto_test/standard/neteq_stats_test.cc +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright (c) 2012 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/voice_engine/test/auto_test/fixtures/after_streaming_fixture.h" - -class NetEQStatsTest : public AfterStreamingFixture { -}; - -TEST_F(NetEQStatsTest, ManualPrintStatisticsAfterRunningAWhile) { - Sleep(5000); - - webrtc::NetworkStatistics network_statistics; - - EXPECT_EQ(0, voe_neteq_stats_->GetNetworkStatistics( - channel_, network_statistics)); - - TEST_LOG("Inspect these statistics and ensure they make sense.\n"); - - TEST_LOG(" currentAccelerateRate = %hu \n", - network_statistics.currentAccelerateRate); - TEST_LOG(" currentBufferSize = %hu \n", - network_statistics.currentBufferSize); - TEST_LOG(" currentSecondaryDecodedRate = %hu \n", - network_statistics.currentSecondaryDecodedRate); - TEST_LOG(" currentDiscardRate = %hu \n", - network_statistics.currentDiscardRate); - TEST_LOG(" currentExpandRate = %hu \n", - network_statistics.currentExpandRate); - TEST_LOG(" currentPacketLossRate = %hu \n", - network_statistics.currentPacketLossRate); - TEST_LOG(" currentPreemptiveRate = %hu \n", - network_statistics.currentPreemptiveRate); - TEST_LOG(" currentSpeechExpandRate = %hu \n", - network_statistics.currentSpeechExpandRate); - TEST_LOG(" preferredBufferSize = %hu \n", - network_statistics.preferredBufferSize); - TEST_LOG(" jitterPeaksFound = %i \n", - network_statistics.jitterPeaksFound); - TEST_LOG(" clockDriftPPM = %i \n", - network_statistics.clockDriftPPM); - TEST_LOG(" meanWaitingTimeMs = %i \n", - network_statistics.meanWaitingTimeMs); - TEST_LOG(" medianWaitingTimeMs = %i \n", - network_statistics.medianWaitingTimeMs); - TEST_LOG(" minWaitingTimeMs = %i \n", - network_statistics.minWaitingTimeMs); - TEST_LOG(" maxWaitingTimeMs = %i \n", - network_statistics.maxWaitingTimeMs); - - // This is only set to a non-zero value in off-mode. - EXPECT_EQ(0U, network_statistics.addedSamples); -} diff --git a/webrtc/voice_engine/test/auto_test/voe_standard_test.cc b/webrtc/voice_engine/test/auto_test/voe_standard_test.cc index ef674c22fe..82aa441ef2 100644 --- a/webrtc/voice_engine/test/auto_test/voe_standard_test.cc +++ b/webrtc/voice_engine/test/auto_test/voe_standard_test.cc @@ -16,7 +16,6 @@ #include "webrtc/system_wrappers/include/event_wrapper.h" #include "webrtc/typedefs.h" -#include "webrtc/voice_engine/include/voe_neteq_stats.h" #include "webrtc/voice_engine/test/auto_test/automated_mode.h" #include "webrtc/voice_engine/test/auto_test/voe_test_defines.h" #include "webrtc/voice_engine/voice_engine_defines.h" @@ -44,8 +43,6 @@ void SubAPIManager::DisplayStatus() const { TEST_LOG(" File\n"); if (_hardware) TEST_LOG(" Hardware\n"); - if (_netEqStats) - TEST_LOG(" NetEqStats\n"); if (_network) TEST_LOG(" Network\n"); if (_rtp_rtcp) @@ -62,8 +59,6 @@ void SubAPIManager::DisplayStatus() const { TEST_LOG(" File\n"); if (!_hardware) TEST_LOG(" Hardware\n"); - if (!_netEqStats) - TEST_LOG(" NetEqStats\n"); if (!_network) TEST_LOG(" Network\n"); if (!_rtp_rtcp) diff --git a/webrtc/voice_engine/test/auto_test/voe_standard_test.h b/webrtc/voice_engine/test/auto_test/voe_standard_test.h index f5b0bf3f19..338eb36700 100644 --- a/webrtc/voice_engine/test/auto_test/voe_standard_test.h +++ b/webrtc/voice_engine/test/auto_test/voe_standard_test.h @@ -33,14 +33,12 @@ class SubAPIManager { _codec(false), _file(false), _hardware(false), - _netEqStats(false), _network(false), _rtp_rtcp(false), _apm(false) { _codec = true; _file = true; _hardware = true; - _netEqStats = true; _network = true; _rtp_rtcp = true; _apm = true; @@ -51,7 +49,7 @@ class SubAPIManager { private: bool _base, _codec; bool _file, _hardware; - bool _netEqStats, _network, _rtp_rtcp, _apm; + bool _network, _rtp_rtcp, _apm; }; } // namespace voetest diff --git a/webrtc/voice_engine/test/auto_test/voe_test_defines.h b/webrtc/voice_engine/test/auto_test/voe_test_defines.h index 1db5ee1764..0f3cfe6fed 100644 --- a/webrtc/voice_engine/test/auto_test/voe_test_defines.h +++ b/webrtc/voice_engine/test/auto_test/voe_test_defines.h @@ -20,11 +20,8 @@ #define _TEST_RTP_RTCP_ #define _TEST_HARDWARE_ #define _TEST_CODEC_ -#define _TEST_VOLUME_ -#define _TEST_AUDIO_PROCESSING_ #define _TEST_FILE_ #define _TEST_NETWORK_ -#define _TEST_NETEQ_STATS_ #define TESTED_AUDIO_LAYER kAudioPlatformDefault //#define TESTED_AUDIO_LAYER kAudioLinuxPulse diff --git a/webrtc/voice_engine/voe_neteq_stats_impl.cc b/webrtc/voice_engine/voe_neteq_stats_impl.cc deleted file mode 100644 index 384292346b..0000000000 --- a/webrtc/voice_engine/voe_neteq_stats_impl.cc +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Copyright (c) 2012 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/voice_engine/voe_neteq_stats_impl.h" - -#include "webrtc/modules/audio_coding/include/audio_coding_module.h" -#include "webrtc/system_wrappers/include/trace.h" -#include "webrtc/voice_engine/channel.h" -#include "webrtc/voice_engine/include/voe_errors.h" -#include "webrtc/voice_engine/voice_engine_impl.h" - -namespace webrtc { - -VoENetEqStats* VoENetEqStats::GetInterface(VoiceEngine* voiceEngine) { - if (NULL == voiceEngine) { - return NULL; - } - VoiceEngineImpl* s = static_cast(voiceEngine); - s->AddRef(); - return s; -} - -VoENetEqStatsImpl::VoENetEqStatsImpl(voe::SharedData* shared) - : _shared(shared) { - WEBRTC_TRACE(kTraceMemory, kTraceVoice, VoEId(_shared->instance_id(), -1), - "VoENetEqStatsImpl::VoENetEqStatsImpl() - ctor"); -} - -VoENetEqStatsImpl::~VoENetEqStatsImpl() { - WEBRTC_TRACE(kTraceMemory, kTraceVoice, VoEId(_shared->instance_id(), -1), - "VoENetEqStatsImpl::~VoENetEqStatsImpl() - dtor"); -} - -int VoENetEqStatsImpl::GetNetworkStatistics(int channel, - NetworkStatistics& stats) { - if (!_shared->statistics().Initialized()) { - _shared->SetLastError(VE_NOT_INITED, kTraceError); - return -1; - } - voe::ChannelOwner ch = _shared->channel_manager().GetChannel(channel); - voe::Channel* channelPtr = ch.channel(); - if (channelPtr == NULL) { - _shared->SetLastError(VE_CHANNEL_NOT_VALID, kTraceError, - "GetNetworkStatistics() failed to locate channel"); - return -1; - } - - return channelPtr->GetNetworkStatistics(stats); -} - -int VoENetEqStatsImpl::GetDecodingCallStatistics( - int channel, AudioDecodingCallStats* stats) const { - if (!_shared->statistics().Initialized()) { - _shared->SetLastError(VE_NOT_INITED, kTraceError); - return -1; - } - voe::ChannelOwner ch = _shared->channel_manager().GetChannel(channel); - voe::Channel* channelPtr = ch.channel(); - if (channelPtr == NULL) { - _shared->SetLastError(VE_CHANNEL_NOT_VALID, kTraceError, - "GetDecodingCallStatistics() failed to locate " - "channel"); - return -1; - } - - channelPtr->GetDecodingCallStatistics(stats); - return 0; -} - -} // namespace webrtc diff --git a/webrtc/voice_engine/voe_neteq_stats_impl.h b/webrtc/voice_engine/voe_neteq_stats_impl.h deleted file mode 100644 index d441e8263f..0000000000 --- a/webrtc/voice_engine/voe_neteq_stats_impl.h +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) 2012 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. - */ - -#ifndef WEBRTC_VOICE_ENGINE_VOE_NETEQ_STATS_IMPL_H -#define WEBRTC_VOICE_ENGINE_VOE_NETEQ_STATS_IMPL_H - -#include "webrtc/voice_engine/include/voe_neteq_stats.h" - -#include "webrtc/common_types.h" -#include "webrtc/voice_engine/shared_data.h" - -namespace webrtc { - -class VoENetEqStatsImpl : public VoENetEqStats { - public: - int GetNetworkStatistics(int channel, NetworkStatistics& stats) override; - - int GetDecodingCallStatistics(int channel, - AudioDecodingCallStats* stats) const override; - - protected: - VoENetEqStatsImpl(voe::SharedData* shared); - ~VoENetEqStatsImpl() override; - - private: - voe::SharedData* _shared; -}; - -} // namespace webrtc - -#endif // WEBRTC_VOICE_ENGINE_VOE_NETEQ_STATS_IMPL_H diff --git a/webrtc/voice_engine/voice_engine_impl.h b/webrtc/voice_engine/voice_engine_impl.h index baa994eadb..ec446c6f96 100644 --- a/webrtc/voice_engine/voice_engine_impl.h +++ b/webrtc/voice_engine/voice_engine_impl.h @@ -19,7 +19,6 @@ #include "webrtc/voice_engine/voe_codec_impl.h" #include "webrtc/voice_engine/voe_file_impl.h" #include "webrtc/voice_engine/voe_hardware_impl.h" -#include "webrtc/voice_engine/voe_neteq_stats_impl.h" #include "webrtc/voice_engine/voe_network_impl.h" #include "webrtc/voice_engine/voe_rtp_rtcp_impl.h" @@ -33,7 +32,6 @@ class VoiceEngineImpl : public voe::SharedData, // Must be the first base class public VoECodecImpl, public VoEFileImpl, public VoEHardwareImpl, - public VoENetEqStatsImpl, public VoENetworkImpl, public VoERTP_RTCPImpl, public VoEBaseImpl { @@ -43,7 +41,6 @@ class VoiceEngineImpl : public voe::SharedData, // Must be the first base class VoECodecImpl(this), VoEFileImpl(this), VoEHardwareImpl(this), - VoENetEqStatsImpl(this), VoENetworkImpl(this), VoERTP_RTCPImpl(this), VoEBaseImpl(this),