Remove deprecated AudioProcessing::GetStatistics function

Additionally, AudioProcessing::GetStatistics(bool) is made pure
virtual and the default implementation in AudioProcessing is removed.

Deprecation PSA:
https://groups.google.com/forum/#!msg/discuss-webrtc/NgqEPvkNuDE/7HtwnMmADgAJ

Bug: webrtc:9947, webrtc:8572
Change-Id: I123402bf7d6c49f3613154c469b818109d8fad43
Reviewed-on: https://webrtc-review.googlesource.com/c/108783
Commit-Queue: Sam Zackrisson <saza@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Reviewed-by: Ivo Creusen <ivoc@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#25463}
This commit is contained in:
Sam Zackrisson
2018-11-01 11:37:15 +01:00
committed by Commit Bot
parent 4e93329839
commit 281276301c
10 changed files with 23 additions and 218 deletions

View File

@ -520,78 +520,12 @@ class AudioProcessing : public rtc::RefCountInterface {
// specific member variables are reset.
virtual void UpdateHistogramsOnCallEnd() = 0;
// TODO(ivoc): Remove when the calling code no longer uses the old Statistics
// API.
struct Statistic {
int instant = 0; // Instantaneous value.
int average = 0; // Long-term average.
int maximum = 0; // Long-term maximum.
int minimum = 0; // Long-term minimum.
};
struct Stat {
void Set(const Statistic& other) {
Set(other.instant, other.average, other.maximum, other.minimum);
}
void Set(float instant, float average, float maximum, float minimum) {
instant_ = instant;
average_ = average;
maximum_ = maximum;
minimum_ = minimum;
}
float instant() const { return instant_; }
float average() const { return average_; }
float maximum() const { return maximum_; }
float minimum() const { return minimum_; }
private:
float instant_ = 0.0f; // Instantaneous value.
float average_ = 0.0f; // Long-term average.
float maximum_ = 0.0f; // Long-term maximum.
float minimum_ = 0.0f; // Long-term minimum.
};
struct RTC_EXPORT AudioProcessingStatistics {
AudioProcessingStatistics();
AudioProcessingStatistics(const AudioProcessingStatistics& other);
~AudioProcessingStatistics();
// AEC Statistics.
// RERL = ERL + ERLE
Stat residual_echo_return_loss;
// ERL = 10log_10(P_far / P_echo)
Stat echo_return_loss;
// ERLE = 10log_10(P_echo / P_out)
Stat echo_return_loss_enhancement;
// (Pre non-linear processing suppression) A_NLP = 10log_10(P_echo / P_a)
Stat a_nlp;
// Fraction of time that the AEC linear filter is divergent, in a 1-second
// non-overlapped aggregation window.
float divergent_filter_fraction = -1.0f;
// The delay metrics consists of the delay median and standard deviation. It
// also consists of the fraction of delay estimates that can make the echo
// cancellation perform poorly. The values are aggregated until the first
// call to |GetStatistics()| and afterwards aggregated and updated every
// second. Note that if there are several clients pulling metrics from
// |GetStatistics()| during a session the first call from any of them will
// change to one second aggregation window for all.
int delay_median = -1;
int delay_standard_deviation = -1;
float fraction_poor_delays = -1.0f;
// Residual echo detector likelihood.
float residual_echo_likelihood = -1.0f;
// Maximum residual echo likelihood from the last time period.
float residual_echo_likelihood_recent_max = -1.0f;
};
// TODO(ivoc): Make this pure virtual when all subclasses have been updated.
virtual AudioProcessingStatistics GetStatistics() const;
// This returns the stats as optionals and it will replace the regular
// GetStatistics.
virtual AudioProcessingStats GetStatistics(bool has_remote_tracks) const;
// Get audio processing statistics. The |has_remote_tracks| argument should be
// set if there are active remote tracks (this would usually be true during
// a call). If there are no remote tracks some of the stats will not be set by
// AudioProcessing, because they only make sense if there is at least one
// remote track.
virtual AudioProcessingStats GetStatistics(bool has_remote_tracks) const = 0;
// These provide access to the component interfaces and should never return
// NULL. The pointers will be valid for the lifetime of the APM instance.