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}
diff --git a/modules/audio_processing/audio_processing_impl.cc b/modules/audio_processing/audio_processing_impl.cc
index 4a39bb9..b5ef42e 100644
--- a/modules/audio_processing/audio_processing_impl.cc
+++ b/modules/audio_processing/audio_processing_impl.cc
@@ -1557,13 +1557,6 @@
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 @@
}
// 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 @@
return stats;
}
-AudioProcessing::AudioProcessingStats AudioProcessingImpl::GetStatistics(
+AudioProcessingStats AudioProcessingImpl::GetStatistics(
bool has_remote_tracks) const {
AudioProcessingStats stats;
if (has_remote_tracks) {