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}
This commit is contained in:
parent
1b0e3b866d
commit
c6192a9e32
@ -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));
|
||||
|
||||
@ -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",
|
||||
|
||||
@ -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);
|
||||
|
||||
|
||||
@ -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
|
||||
@ -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_));
|
||||
}
|
||||
|
||||
@ -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_
|
||||
|
||||
@ -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);
|
||||
}
|
||||
@ -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)
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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<VoiceEngineImpl*>(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
|
||||
@ -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
|
||||
@ -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),
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user