Use the new AudioProcessing statistics everywhere.

The new interface uses optionals instead of default values, and only values that are actually used are included. To make it easy to add/remove stats in the future, the struct itself is copied around on all layers, instead of copying the values one by one. This CL also fixes a bug which caused several APM statistics to get stuck at a fixed level when there are no more receive streams (after some period where there were receive streams). Since APM doesn't know this happens, an argument was added to the GetStats call to pass this information down to APM.

Bug: webrtc:8563, b/67926135
Change-Id: I96cc008353355bb520c4523f5c5379860f73ee24
Reviewed-on: https://webrtc-review.googlesource.com/25621
Commit-Queue: Ivo Creusen <ivoc@webrtc.org>
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#20877}
This commit is contained in:
Ivo Creusen
2017-11-24 17:29:59 +01:00
committed by Commit Bot
parent 606c882972
commit 56d460902e
27 changed files with 322 additions and 267 deletions

View File

@ -1557,13 +1557,6 @@ AudioProcessing::AudioProcessingStatistics::AudioProcessingStatistics(
AudioProcessing::AudioProcessingStatistics::~AudioProcessingStatistics() =
default;
AudioProcessing::AudioProcessingStats::AudioProcessingStats() = default;
AudioProcessing::AudioProcessingStats::AudioProcessingStats(
const AudioProcessingStats& other) = default;
AudioProcessing::AudioProcessingStats::~AudioProcessingStats() = default;
// TODO(ivoc): Remove this when GetStatistics() becomes pure virtual.
AudioProcessing::AudioProcessingStatistics AudioProcessing::GetStatistics()
const {
@ -1571,7 +1564,7 @@ AudioProcessing::AudioProcessingStatistics AudioProcessing::GetStatistics()
}
// TODO(ivoc): Remove this when GetStatistics() becomes pure virtual.
AudioProcessing::AudioProcessingStats AudioProcessing::GetStatistics(
AudioProcessingStats AudioProcessing::GetStatistics(
bool has_remote_tracks) const {
return AudioProcessingStats();
}
@ -1611,7 +1604,7 @@ AudioProcessing::AudioProcessingStatistics AudioProcessingImpl::GetStatistics()
return stats;
}
AudioProcessing::AudioProcessingStats AudioProcessingImpl::GetStatistics(
AudioProcessingStats AudioProcessingImpl::GetStatistics(
bool has_remote_tracks) const {
AudioProcessingStats stats;
if (has_remote_tracks) {