Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1425)

Unified Diff: content/renderer/media/media_stream_audio_processor_options.h

Issue 2103483002: Add UMA stats for AEC filter divergence metric. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed unit test. Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/renderer/media/media_stream_audio_processor_options.h
diff --git a/content/renderer/media/media_stream_audio_processor_options.h b/content/renderer/media/media_stream_audio_processor_options.h
index 2d5af1d4f41261f97fba8ace5a9072c6677499cc..a0c6a56f4d4fe920c1db57d400af8a4241a6893f 100644
--- a/content/renderer/media/media_stream_audio_processor_options.h
+++ b/content/renderer/media/media_stream_audio_processor_options.h
@@ -9,6 +9,7 @@
#include "base/files/file.h"
#include "base/macros.h"
+#include "base/threading/thread_checker.h"
#include "content/common/content_export.h"
#include "content/public/common/media_stream_request.h"
#include "third_party/WebKit/public/platform/WebMediaConstraints.h"
@@ -103,14 +104,36 @@ class CONTENT_EXPORT EchoInformation {
EchoInformation();
virtual ~EchoInformation();
- void UpdateAecDelayStats(webrtc::EchoCancellation* echo_cancellation);
+ // Updates stats, and reports delay metrics as UMA stats every 5 seconds.
+ // Must be called every time AudioProcessing::ProcessStream() is called.
+ void UpdateAecStats(webrtc::EchoCancellation* echo_cancellation);
+
+ // Reports AEC divergent filter metrics as UMA and resets the associated data.
+ void ReportAndResetAecDivergentFilterStats();
private:
- // Counter to track 5 seconds of processed 10 ms chunks in order to query a
- // new metric from webrtc::EchoCancellation::GetEchoDelayMetrics().
- int num_chunks_;
+ void UpdateAecDelayStats(webrtc::EchoCancellation* echo_cancellation);
+ void UpdateAecDivergentFilterStats(
+ webrtc::EchoCancellation* echo_cancellation);
+
+ // Counter to track 5 seconds of data in order to query a new metric from
+ // webrtc::EchoCancellation::GetEchoDelayMetrics().
+ int delay_stats_time_ms_;
bool echo_frames_received_;
+ // Counter to track 1 second of data in order to query a new divergent filter
+ // fraction metric from webrtc::EchoCancellation::GetMetrics().
+ int divergent_filter_stats_time_ms_;
+
+ // Total number of times we queried for the divergent filter fraction metric.
+ int num_divergent_filter_fraction_;
+
+ // Number of non-zero divergent filter fraction metrics.
+ int num_non_zero_divergent_filter_fraction_;
+
+ // Ensures that this class is accessed on the same thread.
+ base::ThreadChecker thread_checker_;
+
DISALLOW_COPY_AND_ASSIGN(EchoInformation);
};
« no previous file with comments | « content/renderer/media/media_stream_audio_processor.cc ('k') | content/renderer/media/media_stream_audio_processor_options.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698