Removes VoECallReport sub API as part of a clean-up operation where the goal is to remove unused APIs.
BUG=3206 R=niklas.enbom@webrtc.org Review URL: https://webrtc-codereview.appspot.com/11779004 git-svn-id: http://webrtc.googlecode.com/svn/trunk@5896 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
parent
5692531f18
commit
b9309beea4
@ -84,10 +84,6 @@
|
||||
#define WEBRTC_VOICE_ENGINE_VIDEO_SYNC_API
|
||||
#define WEBRTC_VOICE_ENGINE_VOLUME_CONTROL_API
|
||||
|
||||
#ifndef WEBRTC_CHROMIUM_BUILD
|
||||
#define WEBRTC_VOICE_ENGINE_CALL_REPORT_API
|
||||
#endif
|
||||
|
||||
// ============================================================================
|
||||
// VideoEngine
|
||||
// ============================================================================
|
||||
|
@ -502,8 +502,6 @@ Channel::OnPeriodicDeadOrAlive(int32_t id,
|
||||
isAlive = (_outputSpeechType != AudioFrame::kPLCCNG);
|
||||
}
|
||||
|
||||
UpdateDeadOrAliveCounters(isAlive);
|
||||
|
||||
// Send callback to the registered observer
|
||||
if (_connectionObserver)
|
||||
{
|
||||
@ -908,8 +906,6 @@ Channel::Channel(int32_t channelId,
|
||||
_rtpTimeOutSeconds(0),
|
||||
_connectionObserver(false),
|
||||
_connectionObserverPtr(NULL),
|
||||
_countAliveDetections(0),
|
||||
_countDeadDetections(0),
|
||||
_outputSpeechType(AudioFrame::kNormalSpeech),
|
||||
vie_network_(NULL),
|
||||
video_channel_(-1),
|
||||
@ -4353,68 +4349,6 @@ int Channel::SetExternalMixing(bool enabled) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
Channel::ResetRTCPStatistics()
|
||||
{
|
||||
WEBRTC_TRACE(kTraceInfo, kTraceVoice, VoEId(_instanceId,_channelId),
|
||||
"Channel::ResetRTCPStatistics()");
|
||||
uint32_t remoteSSRC(0);
|
||||
remoteSSRC = rtp_receiver_->SSRC();
|
||||
return _rtpRtcpModule->ResetRTT(remoteSSRC);
|
||||
}
|
||||
|
||||
int
|
||||
Channel::GetRoundTripTimeSummary(StatVal& delaysMs) const
|
||||
{
|
||||
WEBRTC_TRACE(kTraceInfo, kTraceVoice, VoEId(_instanceId,_channelId),
|
||||
"Channel::GetRoundTripTimeSummary()");
|
||||
// Override default module outputs for the case when RTCP is disabled.
|
||||
// This is done to ensure that we are backward compatible with the
|
||||
// VoiceEngine where we did not use RTP/RTCP module.
|
||||
if (!_rtpRtcpModule->RTCP())
|
||||
{
|
||||
delaysMs.min = -1;
|
||||
delaysMs.max = -1;
|
||||
delaysMs.average = -1;
|
||||
WEBRTC_TRACE(kTraceWarning, kTraceVoice, VoEId(_instanceId,_channelId),
|
||||
"Channel::GetRoundTripTimeSummary() RTCP is disabled =>"
|
||||
" valid RTT measurements cannot be retrieved");
|
||||
return 0;
|
||||
}
|
||||
|
||||
uint32_t remoteSSRC;
|
||||
uint16_t RTT;
|
||||
uint16_t avgRTT;
|
||||
uint16_t maxRTT;
|
||||
uint16_t minRTT;
|
||||
// The remote SSRC will be zero if no RTP packet has been received.
|
||||
remoteSSRC = rtp_receiver_->SSRC();
|
||||
if (remoteSSRC == 0)
|
||||
{
|
||||
WEBRTC_TRACE(kTraceWarning, kTraceVoice, VoEId(_instanceId,_channelId),
|
||||
"Channel::GetRoundTripTimeSummary() unable to measure RTT"
|
||||
" since no RTP packet has been received yet");
|
||||
}
|
||||
|
||||
// Retrieve RTT statistics from the RTP/RTCP module for the specified
|
||||
// channel and SSRC. The SSRC is required to parse out the correct source
|
||||
// in conference scenarios.
|
||||
if (_rtpRtcpModule->RTT(remoteSSRC, &RTT, &avgRTT, &minRTT,&maxRTT) != 0)
|
||||
{
|
||||
WEBRTC_TRACE(kTraceWarning, kTraceVoice, VoEId(_instanceId,_channelId),
|
||||
"GetRoundTripTimeSummary unable to retrieve RTT values"
|
||||
" from the RTCP layer");
|
||||
delaysMs.min = -1; delaysMs.max = -1; delaysMs.average = -1;
|
||||
}
|
||||
else
|
||||
{
|
||||
delaysMs.min = minRTT;
|
||||
delaysMs.max = maxRTT;
|
||||
delaysMs.average = avgRTT;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
Channel::GetNetworkStatistics(NetworkStatistics& stats)
|
||||
{
|
||||
@ -4810,28 +4744,6 @@ Channel::InsertInbandDtmfTone()
|
||||
return 0;
|
||||
}
|
||||
|
||||
void
|
||||
Channel::ResetDeadOrAliveCounters()
|
||||
{
|
||||
_countDeadDetections = 0;
|
||||
_countAliveDetections = 0;
|
||||
}
|
||||
|
||||
void
|
||||
Channel::UpdateDeadOrAliveCounters(bool alive)
|
||||
{
|
||||
if (alive)
|
||||
_countAliveDetections++;
|
||||
else
|
||||
_countDeadDetections++;
|
||||
}
|
||||
|
||||
int
|
||||
Channel::GetDeadOrAliveCounters(int& countDead, int& countAlive) const
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int32_t
|
||||
Channel::SendPacketRaw(const void *data, int len, bool RTCP)
|
||||
{
|
||||
|
@ -281,12 +281,6 @@ public:
|
||||
int SetChannelOutputVolumeScaling(float scaling);
|
||||
int GetChannelOutputVolumeScaling(float& scaling) const;
|
||||
|
||||
// VoECallReport
|
||||
void ResetDeadOrAliveCounters();
|
||||
int ResetRTCPStatistics();
|
||||
int GetRoundTripTimeSummary(StatVal& delaysMs) const;
|
||||
int GetDeadOrAliveCounters(int& countDead, int& countAlive) const;
|
||||
|
||||
// VoENetEqStats
|
||||
int GetNetworkStatistics(NetworkStatistics& stats);
|
||||
void GetDecodingCallStatistics(AudioDecodingCallStats* stats) const;
|
||||
@ -514,7 +508,6 @@ private:
|
||||
int InsertInbandDtmfTone();
|
||||
int32_t MixOrReplaceAudioWithFile(int mixingFrequency);
|
||||
int32_t MixAudioWithFile(AudioFrame& audioFrame, int mixingFrequency);
|
||||
void UpdateDeadOrAliveCounters(bool alive);
|
||||
int32_t SendPacketRaw(const void *data, int len, bool RTCP);
|
||||
void UpdatePacketDelay(uint32_t timestamp,
|
||||
uint16_t sequenceNumber);
|
||||
@ -615,8 +608,6 @@ private:
|
||||
uint32_t _rtpTimeOutSeconds;
|
||||
bool _connectionObserver;
|
||||
VoEConnectionObserver* _connectionObserverPtr;
|
||||
uint32_t _countAliveDetections;
|
||||
uint32_t _countDeadDetections;
|
||||
AudioFrame::SpeechType _outputSpeechType;
|
||||
ViENetwork* vie_network_;
|
||||
int video_channel_;
|
||||
|
@ -1,87 +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.
|
||||
*/
|
||||
|
||||
// This sub-API supports the following functionalities:
|
||||
//
|
||||
// - Long-term speech and noise level metrics.
|
||||
// - Long-term echo metric statistics.
|
||||
// - Round Trip Time (RTT) statistics.
|
||||
// - Dead-or-Alive connection summary.
|
||||
// - Generation of call reports to text files.
|
||||
//
|
||||
// Usage example, omitting error checking:
|
||||
//
|
||||
// using namespace webrtc;
|
||||
// VoiceEngine* voe = VoiceEngine::Create();
|
||||
// VoEBase* base = VoEBase::GetInterface(voe);
|
||||
// VoECallReport report = VoECallReport::GetInterface(voe);
|
||||
// base->Init();
|
||||
// LevelStatistics stats;
|
||||
// report->GetSpeechAndNoiseSummary(stats);
|
||||
// ...
|
||||
// base->Terminate();
|
||||
// base->Release();
|
||||
// report->Release();
|
||||
// VoiceEngine::Delete(voe);
|
||||
//
|
||||
#ifndef WEBRTC_VOICE_ENGINE_VOE_CALL_REPORT_H
|
||||
#define WEBRTC_VOICE_ENGINE_VOE_CALL_REPORT_H
|
||||
|
||||
#include "webrtc/common_types.h"
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
class VoiceEngine;
|
||||
|
||||
// VoECallReport
|
||||
class WEBRTC_DLLEXPORT VoECallReport
|
||||
{
|
||||
public:
|
||||
// Factory for the VoECallReport sub-API. Increases an internal
|
||||
// reference counter if successful. Returns NULL if the API is not
|
||||
// supported or if construction fails.
|
||||
static VoECallReport* GetInterface(VoiceEngine* voiceEngine);
|
||||
|
||||
// Releases the VoECallReport 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;
|
||||
|
||||
// Performs a combined reset of all components involved in generating
|
||||
// the call report for a specified |channel|. Pass in -1 to reset
|
||||
// all channels.
|
||||
virtual int ResetCallReportStatistics(int channel) = 0;
|
||||
|
||||
// Gets minimum, maximum and average levels for long-term echo metrics.
|
||||
virtual int GetEchoMetricSummary(EchoStatistics& stats) = 0;
|
||||
|
||||
// Gets minimum, maximum and average levels for Round Trip Time (RTT)
|
||||
// measurements.
|
||||
virtual int GetRoundTripTimeSummary(int channel,
|
||||
StatVal& delaysMs) = 0;
|
||||
|
||||
// Gets the total amount of dead and alive connection detections
|
||||
// during a VoIP session.
|
||||
virtual int GetDeadOrAliveSummary(int channel, int& numOfDeadDetections,
|
||||
int& numOfAliveDetections) = 0;
|
||||
|
||||
// Creates a text file in ASCII format, which contains a summary
|
||||
// of all the statistics that can be obtained by the call report sub-API.
|
||||
virtual int WriteReportToFile(const char* fileNameUTF8) = 0;
|
||||
|
||||
protected:
|
||||
VoECallReport() { }
|
||||
virtual ~VoECallReport() { }
|
||||
};
|
||||
|
||||
} // namespace webrtc
|
||||
|
||||
#endif // WEBRTC_VOICE_ENGINE_VOE_CALL_REPORT_H
|
@ -36,7 +36,6 @@ BeforeInitializationFixture::BeforeInitializationFixture() {
|
||||
voe_vsync_ = webrtc::VoEVideoSync::GetInterface(voice_engine_);
|
||||
voe_hardware_ = webrtc::VoEHardware::GetInterface(voice_engine_);
|
||||
voe_xmedia_ = webrtc::VoEExternalMedia::GetInterface(voice_engine_);
|
||||
voe_call_report_ = webrtc::VoECallReport::GetInterface(voice_engine_);
|
||||
voe_neteq_stats_ = webrtc::VoENetEqStats::GetInterface(voice_engine_);
|
||||
}
|
||||
|
||||
@ -52,7 +51,6 @@ BeforeInitializationFixture::~BeforeInitializationFixture() {
|
||||
voe_vsync_->Release();
|
||||
voe_hardware_->Release();
|
||||
voe_xmedia_->Release();
|
||||
voe_call_report_->Release();
|
||||
voe_neteq_stats_->Release();
|
||||
|
||||
EXPECT_TRUE(webrtc::VoiceEngine::Delete(voice_engine_));
|
||||
|
@ -19,7 +19,6 @@
|
||||
#include "webrtc/test/testsupport/gtest_disable.h"
|
||||
#include "webrtc/voice_engine/include/voe_audio_processing.h"
|
||||
#include "webrtc/voice_engine/include/voe_base.h"
|
||||
#include "webrtc/voice_engine/include/voe_call_report.h"
|
||||
#include "webrtc/voice_engine/include/voe_codec.h"
|
||||
#include "webrtc/voice_engine/include/voe_dtmf.h"
|
||||
#include "webrtc/voice_engine/include/voe_errors.h"
|
||||
@ -68,7 +67,6 @@ class BeforeInitializationFixture : public testing::Test {
|
||||
webrtc::VoEVideoSync* voe_vsync_;
|
||||
webrtc::VoEHardware* voe_hardware_;
|
||||
webrtc::VoEExternalMedia* voe_xmedia_;
|
||||
webrtc::VoECallReport* voe_call_report_;
|
||||
webrtc::VoENetEqStats* voe_neteq_stats_;
|
||||
webrtc::Config config_;
|
||||
};
|
||||
|
@ -1,66 +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/test/testsupport/fileutils.h"
|
||||
#include "webrtc/voice_engine/test/auto_test/fixtures/after_streaming_fixture.h"
|
||||
|
||||
class CallReportTest : public AfterStreamingFixture {
|
||||
};
|
||||
|
||||
TEST_F(CallReportTest, ResetCallReportStatisticsFailsForBadInput) {
|
||||
EXPECT_EQ(-1, voe_call_report_->ResetCallReportStatistics(-2));
|
||||
EXPECT_EQ(-1, voe_call_report_->ResetCallReportStatistics(1));
|
||||
}
|
||||
|
||||
TEST_F(CallReportTest, ResetCallReportStatisticsSucceedsWithCorrectInput) {
|
||||
EXPECT_EQ(0, voe_call_report_->ResetCallReportStatistics(channel_));
|
||||
EXPECT_EQ(0, voe_call_report_->ResetCallReportStatistics(-1));
|
||||
}
|
||||
|
||||
TEST_F(CallReportTest, EchoMetricSummarySucceeds) {
|
||||
EXPECT_EQ(0, voe_apm_->SetEcMetricsStatus(true));
|
||||
Sleep(1000);
|
||||
|
||||
webrtc::EchoStatistics echo_statistics;
|
||||
EXPECT_EQ(0, voe_call_report_->GetEchoMetricSummary(echo_statistics));
|
||||
}
|
||||
|
||||
TEST_F(CallReportTest, GetRoundTripTimeSummaryReturnsAllMinusOnesIfRtcpIsOff) {
|
||||
voe_rtp_rtcp_->SetRTCPStatus(channel_, false);
|
||||
|
||||
webrtc::StatVal delays;
|
||||
EXPECT_EQ(0, voe_call_report_->GetRoundTripTimeSummary(channel_, delays));
|
||||
EXPECT_EQ(-1, delays.average);
|
||||
EXPECT_EQ(-1, delays.min);
|
||||
EXPECT_EQ(-1, delays.max);
|
||||
}
|
||||
|
||||
// Flaky: https://code.google.com/p/webrtc/issues/detail?id=1719
|
||||
TEST_F(CallReportTest, DISABLED_GetRoundTripTimesReturnsValuesIfRtcpIsOn) {
|
||||
voe_rtp_rtcp_->SetRTCPStatus(channel_, true);
|
||||
Sleep(1000);
|
||||
|
||||
webrtc::StatVal delays;
|
||||
EXPECT_EQ(0, voe_call_report_->GetRoundTripTimeSummary(channel_, delays));
|
||||
EXPECT_NE(-1, delays.average);
|
||||
EXPECT_NE(-1, delays.min);
|
||||
EXPECT_NE(-1, delays.max);
|
||||
}
|
||||
|
||||
TEST_F(CallReportTest, WriteReportToFileFailsOnBadInput) {
|
||||
EXPECT_EQ(-1, voe_call_report_->WriteReportToFile(NULL));
|
||||
}
|
||||
|
||||
TEST_F(CallReportTest, WriteReportToFileSucceedsWithCorrectFilename) {
|
||||
std::string output_path = webrtc::test::OutputPath();
|
||||
std::string report_filename = output_path + "call_report.txt";
|
||||
|
||||
EXPECT_EQ(0, voe_call_report_->WriteReportToFile(report_filename.c_str()));
|
||||
}
|
@ -42,8 +42,6 @@ void SubAPIManager::DisplayStatus() const {
|
||||
TEST_LOG("Supported sub APIs:\n\n");
|
||||
if (_base)
|
||||
TEST_LOG(" Base\n");
|
||||
if (_callReport)
|
||||
TEST_LOG(" CallReport\n");
|
||||
if (_codec)
|
||||
TEST_LOG(" Codec\n");
|
||||
if (_dtmf)
|
||||
@ -70,8 +68,6 @@ void SubAPIManager::DisplayStatus() const {
|
||||
TEST_LOG("Excluded sub APIs:\n\n");
|
||||
if (!_base)
|
||||
TEST_LOG(" Base\n");
|
||||
if (!_callReport)
|
||||
TEST_LOG(" CallReport\n");
|
||||
if (!_codec)
|
||||
TEST_LOG(" Codec\n");
|
||||
if (!_dtmf)
|
||||
@ -101,7 +97,6 @@ VoETestManager::VoETestManager()
|
||||
: initialized_(false),
|
||||
voice_engine_(NULL),
|
||||
voe_base_(0),
|
||||
voe_call_report_(0),
|
||||
voe_codec_(0),
|
||||
voe_dtmf_(0),
|
||||
voe_xmedia_(0),
|
||||
@ -174,9 +169,6 @@ void VoETestManager::GetInterfaces() {
|
||||
#ifdef _TEST_XMEDIA_
|
||||
voe_xmedia_ = VoEExternalMedia::GetInterface(voice_engine_);
|
||||
#endif
|
||||
#ifdef _TEST_CALL_REPORT_
|
||||
voe_call_report_ = VoECallReport::GetInterface(voice_engine_);
|
||||
#endif
|
||||
#ifdef WEBRTC_VOICE_ENGINE_NETEQ_STATS_API
|
||||
voe_neteq_stats_ = VoENetEqStats::GetInterface(voice_engine_);
|
||||
#endif
|
||||
@ -234,12 +226,6 @@ int VoETestManager::ReleaseInterfaces() {
|
||||
voe_xmedia_ = NULL;
|
||||
}
|
||||
#endif
|
||||
#ifdef _TEST_CALL_REPORT_
|
||||
if (voe_call_report_) {
|
||||
voe_call_report_->Release();
|
||||
voe_call_report_ = NULL;
|
||||
}
|
||||
#endif
|
||||
#ifdef WEBRTC_VOICE_ENGINE_NETEQ_STATS_API
|
||||
if (voe_neteq_stats_) {
|
||||
voe_neteq_stats_->Release();
|
||||
|
@ -25,9 +25,6 @@
|
||||
#include "webrtc/voice_engine/test/auto_test/resource_manager.h"
|
||||
#include "webrtc/voice_engine/test/auto_test/voe_test_common.h"
|
||||
#include "webrtc/voice_engine/test/auto_test/voe_test_interface.h"
|
||||
#ifdef WEBRTC_VOICE_ENGINE_CALL_REPORT_API
|
||||
#include "webrtc/voice_engine/include/voe_call_report.h"
|
||||
#endif
|
||||
#ifdef WEBRTC_VOICE_ENGINE_CODEC_API
|
||||
#include "webrtc/voice_engine/include/voe_codec.h"
|
||||
#endif
|
||||
@ -65,7 +62,6 @@ class SubAPIManager {
|
||||
public:
|
||||
SubAPIManager()
|
||||
: _base(true),
|
||||
_callReport(false),
|
||||
_codec(false),
|
||||
_dtmf(false),
|
||||
_externalMedia(false),
|
||||
@ -77,9 +73,6 @@ class SubAPIManager {
|
||||
_videoSync(false),
|
||||
_volumeControl(false),
|
||||
_apm(false) {
|
||||
#ifdef WEBRTC_VOICE_ENGINE_CALL_REPORT_API
|
||||
_callReport = true;
|
||||
#endif
|
||||
#ifdef WEBRTC_VOICE_ENGINE_CODEC_API
|
||||
_codec = true;
|
||||
#endif
|
||||
@ -116,7 +109,7 @@ class SubAPIManager {
|
||||
void DisplayStatus() const;
|
||||
|
||||
private:
|
||||
bool _base, _callReport, _codec, _dtmf;
|
||||
bool _base, _codec, _dtmf;
|
||||
bool _externalMedia, _file, _hardware;
|
||||
bool _netEqStats, _network, _rtp_rtcp, _videoSync, _volumeControl, _apm;
|
||||
};
|
||||
@ -182,10 +175,6 @@ class VoETestManager {
|
||||
return voe_xmedia_;
|
||||
}
|
||||
|
||||
VoECallReport* CallReportPtr() const {
|
||||
return voe_call_report_;
|
||||
}
|
||||
|
||||
#ifdef WEBRTC_VOICE_ENGINE_NETEQ_STATS_API
|
||||
VoENetEqStats* NetEqStatsPtr() const {
|
||||
return voe_neteq_stats_;
|
||||
@ -197,7 +186,6 @@ class VoETestManager {
|
||||
|
||||
VoiceEngine* voice_engine_;
|
||||
VoEBase* voe_base_;
|
||||
VoECallReport* voe_call_report_;
|
||||
VoECodec* voe_codec_;
|
||||
VoEDtmf* voe_dtmf_;
|
||||
VoEExternalMedia* voe_xmedia_;
|
||||
|
@ -28,7 +28,6 @@
|
||||
#define _TEST_AUDIO_PROCESSING_
|
||||
#define _TEST_FILE_
|
||||
#define _TEST_NETWORK_
|
||||
#define _TEST_CALL_REPORT_
|
||||
#define _TEST_VIDEO_SYNC_
|
||||
#define _TEST_NETEQ_STATS_
|
||||
#define _TEST_XMEDIA_
|
||||
@ -77,9 +76,6 @@
|
||||
#ifndef WEBRTC_VOICE_ENGINE_NETEQ_STATS_API
|
||||
#undef _TEST_NETEQ_STATS_
|
||||
#endif
|
||||
#ifndef WEBRTC_VOICE_ENGINE_CALL_REPORT_API
|
||||
#undef _TEST_CALL_REPORT_
|
||||
#endif
|
||||
|
||||
// Some parts can cause problems while running Insure
|
||||
#ifdef __INSURE__
|
||||
|
@ -1,373 +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_call_report_impl.h"
|
||||
|
||||
#include "webrtc/modules/audio_processing/include/audio_processing.h"
|
||||
#include "webrtc/system_wrappers/interface/critical_section_wrapper.h"
|
||||
#include "webrtc/system_wrappers/interface/file_wrapper.h"
|
||||
#include "webrtc/system_wrappers/interface/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
|
||||
{
|
||||
|
||||
VoECallReport* VoECallReport::GetInterface(VoiceEngine* voiceEngine)
|
||||
{
|
||||
#ifndef WEBRTC_VOICE_ENGINE_CALL_REPORT_API
|
||||
return NULL;
|
||||
#else
|
||||
if (NULL == voiceEngine)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
VoiceEngineImpl* s = static_cast<VoiceEngineImpl*>(voiceEngine);
|
||||
s->AddRef();
|
||||
return s;
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifdef WEBRTC_VOICE_ENGINE_CALL_REPORT_API
|
||||
|
||||
VoECallReportImpl::VoECallReportImpl(voe::SharedData* shared) :
|
||||
_file(*FileWrapper::Create()), _shared(shared)
|
||||
{
|
||||
WEBRTC_TRACE(kTraceMemory, kTraceVoice, VoEId(_shared->instance_id(), -1),
|
||||
"VoECallReportImpl() - ctor");
|
||||
}
|
||||
|
||||
VoECallReportImpl::~VoECallReportImpl()
|
||||
{
|
||||
WEBRTC_TRACE(kTraceMemory, kTraceVoice, VoEId(_shared->instance_id(), -1),
|
||||
"~VoECallReportImpl() - dtor");
|
||||
delete &_file;
|
||||
}
|
||||
|
||||
int VoECallReportImpl::ResetCallReportStatistics(int channel)
|
||||
{
|
||||
WEBRTC_TRACE(kTraceApiCall, kTraceVoice, VoEId(_shared->instance_id(), -1),
|
||||
"ResetCallReportStatistics(channel=%d)", channel);
|
||||
|
||||
if (!_shared->statistics().Initialized())
|
||||
{
|
||||
_shared->SetLastError(VE_NOT_INITED, kTraceError);
|
||||
return -1;
|
||||
}
|
||||
|
||||
assert(_shared->audio_processing() != NULL);
|
||||
|
||||
bool echoMode =
|
||||
_shared->audio_processing()->echo_cancellation()->are_metrics_enabled();
|
||||
|
||||
WEBRTC_TRACE(kTraceInfo, kTraceVoice, VoEId(_shared->instance_id(), -1),
|
||||
" current AudioProcessingModule echo metric state %d)",
|
||||
echoMode);
|
||||
// Reset the APM statistics
|
||||
if (_shared->audio_processing()->echo_cancellation()->enable_metrics(true)
|
||||
!= 0)
|
||||
{
|
||||
_shared->SetLastError(VE_APM_ERROR, kTraceError,
|
||||
"ResetCallReportStatistics() unable to "
|
||||
"set the AudioProcessingModule echo metrics state");
|
||||
return -1;
|
||||
}
|
||||
// Restore metric states
|
||||
_shared->audio_processing()->echo_cancellation()->enable_metrics(echoMode);
|
||||
|
||||
// Reset channel dependent statistics
|
||||
if (channel != -1)
|
||||
{
|
||||
voe::ChannelOwner ch = _shared->channel_manager().GetChannel(channel);
|
||||
voe::Channel* channelPtr = ch.channel();
|
||||
if (channelPtr == NULL)
|
||||
{
|
||||
_shared->SetLastError(VE_CHANNEL_NOT_VALID, kTraceError,
|
||||
"ResetCallReportStatistics() failed to locate channel");
|
||||
return -1;
|
||||
}
|
||||
channelPtr->ResetDeadOrAliveCounters();
|
||||
channelPtr->ResetRTCPStatistics();
|
||||
} else {
|
||||
for (voe::ChannelManager::Iterator it(&_shared->channel_manager());
|
||||
it.IsValid();
|
||||
it.Increment()) {
|
||||
it.GetChannel()->ResetDeadOrAliveCounters();
|
||||
it.GetChannel()->ResetRTCPStatistics();
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int VoECallReportImpl::GetEchoMetricSummary(EchoStatistics& stats)
|
||||
{
|
||||
WEBRTC_TRACE(kTraceApiCall, kTraceVoice, VoEId(_shared->instance_id(), -1),
|
||||
"GetEchoMetricSummary()");
|
||||
|
||||
if (!_shared->statistics().Initialized())
|
||||
{
|
||||
_shared->SetLastError(VE_NOT_INITED, kTraceError);
|
||||
return -1;
|
||||
}
|
||||
assert(_shared->audio_processing() != NULL);
|
||||
|
||||
return (GetEchoMetricSummaryInternal(stats));
|
||||
}
|
||||
|
||||
int VoECallReportImpl::GetEchoMetricSummaryInternal(EchoStatistics& stats)
|
||||
{
|
||||
// Retrieve echo metrics from the AudioProcessingModule
|
||||
int ret(0);
|
||||
bool mode(false);
|
||||
EchoCancellation::Metrics metrics;
|
||||
|
||||
// Ensure that echo metrics is enabled
|
||||
|
||||
mode =
|
||||
_shared->audio_processing()->echo_cancellation()->are_metrics_enabled();
|
||||
if (mode != false)
|
||||
{
|
||||
ret = _shared->audio_processing()->echo_cancellation()->
|
||||
GetMetrics(&metrics);
|
||||
if (ret != 0)
|
||||
{
|
||||
WEBRTC_TRACE(kTraceWarning, kTraceVoice,
|
||||
VoEId(_shared->instance_id(), -1),
|
||||
" AudioProcessingModule GetMetrics() => error");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
WEBRTC_TRACE(kTraceWarning, kTraceVoice,
|
||||
VoEId(_shared->instance_id(), -1),
|
||||
" AudioProcessingModule echo metrics is not enabled");
|
||||
}
|
||||
|
||||
if ((ret != 0) || (mode == false))
|
||||
{
|
||||
// Mark complete struct as invalid (-100 dB)
|
||||
WEBRTC_TRACE(kTraceWarning, kTraceVoice,
|
||||
VoEId(_shared->instance_id(), -1),
|
||||
" unable to retrieve echo metrics from the AudioProcessingModule");
|
||||
stats.erl.min = -100;
|
||||
stats.erl.max = -100;
|
||||
stats.erl.average = -100;
|
||||
stats.erle.min = -100;
|
||||
stats.erle.max = -100;
|
||||
stats.erle.average = -100;
|
||||
stats.rerl.min = -100;
|
||||
stats.rerl.max = -100;
|
||||
stats.rerl.average = -100;
|
||||
stats.a_nlp.min = -100;
|
||||
stats.a_nlp.max = -100;
|
||||
stats.a_nlp.average = -100;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
// Deliver output results to user
|
||||
stats.erl.min = metrics.echo_return_loss.minimum;
|
||||
stats.erl.max = metrics.echo_return_loss.maximum;
|
||||
stats.erl.average = metrics.echo_return_loss.average;
|
||||
WEBRTC_TRACE(kTraceStateInfo, kTraceVoice,
|
||||
VoEId(_shared->instance_id(), -1), " erl: min=%d, max=%d, avg=%d",
|
||||
stats.erl.min, stats.erl.max, stats.erl.average);
|
||||
|
||||
stats.erle.min = metrics.echo_return_loss_enhancement.minimum;
|
||||
stats.erle.max = metrics.echo_return_loss_enhancement.maximum;
|
||||
stats.erle.average = metrics.echo_return_loss_enhancement.average;
|
||||
WEBRTC_TRACE(kTraceStateInfo, kTraceVoice,
|
||||
VoEId(_shared->instance_id(), -1), " erle: min=%d, max=%d, avg=%d",
|
||||
stats.erle.min, stats.erle.max, stats.erle.average);
|
||||
|
||||
stats.rerl.min = metrics.residual_echo_return_loss.minimum;
|
||||
stats.rerl.max = metrics.residual_echo_return_loss.maximum;
|
||||
stats.rerl.average = metrics.residual_echo_return_loss.average;
|
||||
WEBRTC_TRACE(kTraceStateInfo, kTraceVoice,
|
||||
VoEId(_shared->instance_id(), -1), " rerl: min=%d, max=%d, avg=%d",
|
||||
stats.rerl.min, stats.rerl.max, stats.rerl.average);
|
||||
|
||||
stats.a_nlp.min = metrics.a_nlp.minimum;
|
||||
stats.a_nlp.max = metrics.a_nlp.maximum;
|
||||
stats.a_nlp.average = metrics.a_nlp.average;
|
||||
WEBRTC_TRACE(kTraceStateInfo, kTraceVoice,
|
||||
VoEId(_shared->instance_id(), -1),
|
||||
" a_nlp: min=%d, max=%d, avg=%d",
|
||||
stats.a_nlp.min, stats.a_nlp.max, stats.a_nlp.average);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
int VoECallReportImpl::GetRoundTripTimeSummary(int channel, StatVal& delaysMs)
|
||||
{
|
||||
WEBRTC_TRACE(kTraceApiCall, kTraceVoice, VoEId(_shared->instance_id(), -1),
|
||||
"GetRoundTripTimeSummary()");
|
||||
|
||||
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,
|
||||
"GetRoundTripTimeSummary() failed to locate channel");
|
||||
return -1;
|
||||
}
|
||||
|
||||
return channelPtr->GetRoundTripTimeSummary(delaysMs);
|
||||
}
|
||||
|
||||
int VoECallReportImpl::GetDeadOrAliveSummary(int channel,
|
||||
int& numOfDeadDetections,
|
||||
int& numOfAliveDetections)
|
||||
{
|
||||
WEBRTC_TRACE(kTraceApiCall, kTraceVoice, VoEId(_shared->instance_id(), -1),
|
||||
"GetDeadOrAliveSummary(channel=%d)", channel);
|
||||
|
||||
if (!_shared->statistics().Initialized())
|
||||
{
|
||||
_shared->SetLastError(VE_NOT_INITED, kTraceError);
|
||||
return -1;
|
||||
}
|
||||
|
||||
return (GetDeadOrAliveSummaryInternal(channel, numOfDeadDetections,
|
||||
numOfAliveDetections));
|
||||
}
|
||||
|
||||
int VoECallReportImpl::GetDeadOrAliveSummaryInternal(int channel,
|
||||
int& numOfDeadDetections,
|
||||
int& numOfAliveDetections)
|
||||
{
|
||||
WEBRTC_TRACE(kTraceApiCall, kTraceVoice, VoEId(_shared->instance_id(), -1),
|
||||
"GetDeadOrAliveSummary(channel=%d)", channel);
|
||||
|
||||
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,
|
||||
"GetRoundTripTimeSummary() failed to locate channel");
|
||||
return -1;
|
||||
}
|
||||
|
||||
return channelPtr->GetDeadOrAliveCounters(numOfDeadDetections,
|
||||
numOfAliveDetections);
|
||||
}
|
||||
|
||||
int VoECallReportImpl::WriteReportToFile(const char* fileNameUTF8)
|
||||
{
|
||||
WEBRTC_TRACE(kTraceApiCall, kTraceVoice, VoEId(_shared->instance_id(), -1),
|
||||
"WriteReportToFile(fileNameUTF8=%s)", fileNameUTF8);
|
||||
|
||||
if (!_shared->statistics().Initialized())
|
||||
{
|
||||
_shared->SetLastError(VE_NOT_INITED, kTraceError);
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (NULL == fileNameUTF8)
|
||||
{
|
||||
_shared->SetLastError(VE_INVALID_ARGUMENT, kTraceError,
|
||||
"WriteReportToFile() invalid filename");
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (_file.Open())
|
||||
{
|
||||
_file.CloseFile();
|
||||
}
|
||||
|
||||
// Open text file in write mode
|
||||
if (_file.OpenFile(fileNameUTF8, false, false, true) != 0)
|
||||
{
|
||||
_shared->SetLastError(VE_BAD_FILE, kTraceError,
|
||||
"WriteReportToFile() unable to open the file");
|
||||
return -1;
|
||||
}
|
||||
|
||||
// Summarize information and add it to the open file
|
||||
//
|
||||
_file.WriteText("WebRtc VoiceEngine Call Report\n");
|
||||
_file.WriteText("==============================\n");
|
||||
_file.WriteText("\nNetwork Packet Round Trip Time (RTT)\n");
|
||||
_file.WriteText("------------------------------------\n\n");
|
||||
|
||||
if (_shared->channel_manager().NumOfChannels() == 0)
|
||||
return 0;
|
||||
|
||||
for (voe::ChannelManager::Iterator it(&_shared->channel_manager());
|
||||
it.IsValid();
|
||||
it.Increment()) {
|
||||
StatVal delaysMs;
|
||||
_file.WriteText("channel %d:\n", it.GetChannel()->ChannelId());
|
||||
it.GetChannel()->GetRoundTripTimeSummary(delaysMs);
|
||||
_file.WriteText(" min:%5d [ms]\n", delaysMs.min);
|
||||
_file.WriteText(" max:%5d [ms]\n", delaysMs.max);
|
||||
_file.WriteText(" avg:%5d [ms]\n", delaysMs.average);
|
||||
}
|
||||
|
||||
_file.WriteText("\nDead-or-Alive Connection Detections\n");
|
||||
_file.WriteText("------------------------------------\n\n");
|
||||
|
||||
for (voe::ChannelManager::Iterator it(&_shared->channel_manager());
|
||||
it.IsValid();
|
||||
it.Increment()) {
|
||||
int dead = 0;
|
||||
int alive = 0;
|
||||
_file.WriteText("channel %d:\n", it.GetChannel()->ChannelId());
|
||||
GetDeadOrAliveSummary(it.GetChannel()->ChannelId(), dead, alive);
|
||||
_file.WriteText(" #dead :%6d\n", dead);
|
||||
_file.WriteText(" #alive:%6d\n", alive);
|
||||
}
|
||||
|
||||
EchoStatistics echo;
|
||||
GetEchoMetricSummary(echo);
|
||||
|
||||
_file.WriteText("\nEcho Metrics\n");
|
||||
_file.WriteText("------------\n\n");
|
||||
|
||||
_file.WriteText("erl:\n");
|
||||
_file.WriteText(" min:%5d [dB]\n", echo.erl.min);
|
||||
_file.WriteText(" max:%5d [dB]\n", echo.erl.max);
|
||||
_file.WriteText(" avg:%5d [dB]\n", echo.erl.average);
|
||||
_file.WriteText("\nerle:\n");
|
||||
_file.WriteText(" min:%5d [dB]\n", echo.erle.min);
|
||||
_file.WriteText(" max:%5d [dB]\n", echo.erle.max);
|
||||
_file.WriteText(" avg:%5d [dB]\n", echo.erle.average);
|
||||
_file.WriteText("rerl:\n");
|
||||
_file.WriteText(" min:%5d [dB]\n", echo.rerl.min);
|
||||
_file.WriteText(" max:%5d [dB]\n", echo.rerl.max);
|
||||
_file.WriteText(" avg:%5d [dB]\n", echo.rerl.average);
|
||||
_file.WriteText("a_nlp:\n");
|
||||
_file.WriteText(" min:%5d [dB]\n", echo.a_nlp.min);
|
||||
_file.WriteText(" max:%5d [dB]\n", echo.a_nlp.max);
|
||||
_file.WriteText(" avg:%5d [dB]\n", echo.a_nlp.average);
|
||||
|
||||
_file.WriteText("\n<END>");
|
||||
|
||||
_file.Flush();
|
||||
_file.CloseFile();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif // WEBRTC_VOICE_ENGINE_CALL_REPORT_API
|
||||
|
||||
} // namespace webrtc
|
@ -1,57 +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_CALL_REPORT_IMPL_H
|
||||
#define WEBRTC_VOICE_ENGINE_VOE_CALL_REPORT_IMPL_H
|
||||
|
||||
#include "webrtc/voice_engine/include/voe_call_report.h"
|
||||
|
||||
#include "webrtc/voice_engine/shared_data.h"
|
||||
|
||||
|
||||
namespace webrtc
|
||||
{
|
||||
class FileWrapper;
|
||||
|
||||
class VoECallReportImpl: public VoECallReport
|
||||
{
|
||||
public:
|
||||
virtual int ResetCallReportStatistics(int channel);
|
||||
|
||||
virtual int GetEchoMetricSummary(EchoStatistics& stats);
|
||||
|
||||
virtual int GetRoundTripTimeSummary(int channel,
|
||||
StatVal& delaysMs);
|
||||
|
||||
virtual int GetDeadOrAliveSummary(int channel, int& numOfDeadDetections,
|
||||
int& numOfAliveDetections);
|
||||
|
||||
virtual int WriteReportToFile(const char* fileNameUTF8);
|
||||
|
||||
protected:
|
||||
VoECallReportImpl(voe::SharedData* shared);
|
||||
virtual ~VoECallReportImpl();
|
||||
|
||||
private:
|
||||
int GetDeadOrAliveSummaryInternal(int channel,
|
||||
int& numOfDeadDetections,
|
||||
int& numOfAliveDetections);
|
||||
|
||||
int GetEchoMetricSummaryInternal(EchoStatistics& stats);
|
||||
|
||||
int GetSpeechAndNoiseSummaryInternal(LevelStatistics& stats);
|
||||
|
||||
FileWrapper& _file;
|
||||
voe::SharedData* _shared;
|
||||
};
|
||||
|
||||
} // namespace webrtc
|
||||
|
||||
#endif // WEBRTC_VOICE_ENGINE_VOE_CALL_REPORT_IMPL_H
|
@ -31,7 +31,6 @@
|
||||
'../typedefs.h',
|
||||
'include/voe_audio_processing.h',
|
||||
'include/voe_base.h',
|
||||
'include/voe_call_report.h',
|
||||
'include/voe_codec.h',
|
||||
'include/voe_dtmf.h',
|
||||
'include/voe_errors.h',
|
||||
@ -69,8 +68,6 @@
|
||||
'voe_audio_processing_impl.h',
|
||||
'voe_base_impl.cc',
|
||||
'voe_base_impl.h',
|
||||
'voe_call_report_impl.cc',
|
||||
'voe_call_report_impl.h',
|
||||
'voe_codec_impl.cc',
|
||||
'voe_codec_impl.h',
|
||||
'voe_dtmf_impl.cc',
|
||||
@ -166,7 +163,6 @@
|
||||
'test/auto_test/fixtures/before_initialization_fixture.cc',
|
||||
'test/auto_test/fixtures/before_initialization_fixture.h',
|
||||
'test/auto_test/standard/audio_processing_test.cc',
|
||||
'test/auto_test/standard/call_report_test.cc',
|
||||
'test/auto_test/standard/codec_before_streaming_test.cc',
|
||||
'test/auto_test/standard/codec_test.cc',
|
||||
'test/auto_test/standard/dtmf_test.cc',
|
||||
|
@ -18,9 +18,6 @@
|
||||
#ifdef WEBRTC_VOICE_ENGINE_AUDIO_PROCESSING_API
|
||||
#include "webrtc/voice_engine/voe_audio_processing_impl.h"
|
||||
#endif
|
||||
#ifdef WEBRTC_VOICE_ENGINE_CALL_REPORT_API
|
||||
#include "webrtc/voice_engine/voe_call_report_impl.h"
|
||||
#endif
|
||||
#ifdef WEBRTC_VOICE_ENGINE_CODEC_API
|
||||
#include "webrtc/voice_engine/voe_codec_impl.h"
|
||||
#endif
|
||||
@ -58,9 +55,6 @@ class VoiceEngineImpl : public voe::SharedData, // Must be the first base class
|
||||
#ifdef WEBRTC_VOICE_ENGINE_AUDIO_PROCESSING_API
|
||||
public VoEAudioProcessingImpl,
|
||||
#endif
|
||||
#ifdef WEBRTC_VOICE_ENGINE_CALL_REPORT_API
|
||||
public VoECallReportImpl,
|
||||
#endif
|
||||
#ifdef WEBRTC_VOICE_ENGINE_CODEC_API
|
||||
public VoECodecImpl,
|
||||
#endif
|
||||
@ -97,9 +91,6 @@ public:
|
||||
#ifdef WEBRTC_VOICE_ENGINE_AUDIO_PROCESSING_API
|
||||
VoEAudioProcessingImpl(this),
|
||||
#endif
|
||||
#ifdef WEBRTC_VOICE_ENGINE_CALL_REPORT_API
|
||||
VoECallReportImpl(this),
|
||||
#endif
|
||||
#ifdef WEBRTC_VOICE_ENGINE_CODEC_API
|
||||
VoECodecImpl(this),
|
||||
#endif
|
||||
|
Loading…
x
Reference in New Issue
Block a user