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

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

Issue 1081063003: [media_stream_audio_processor] Avoids updating UMA stats before AEC has valid results (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removed {} Created 5 years, 8 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
« no previous file with comments | « content/renderer/media/media_stream_audio_processor_options.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/media/media_stream_audio_processor_options.cc
diff --git a/content/renderer/media/media_stream_audio_processor_options.cc b/content/renderer/media/media_stream_audio_processor_options.cc
index c39b1544c5c878a13abf2a7c4b64a41319d978f1..8029b25dc81b06e900763c5affc96db0ffe01fc0 100644
--- a/content/renderer/media/media_stream_audio_processor_options.cc
+++ b/content/renderer/media/media_stream_audio_processor_options.cc
@@ -222,12 +222,20 @@ bool MediaAudioConstraints::GetDefaultValueForConstraint(
}
EchoInformation::EchoInformation()
- : num_chunks_(0) {}
+ : num_chunks_(0), echo_frames_received_(false) {
+}
EchoInformation::~EchoInformation() {}
void EchoInformation::UpdateAecDelayStats(
webrtc::EchoCancellation* echo_cancellation) {
+ // Only start collecting stats if we know echo cancellation has measured an
+ // echo. Otherwise we clutter the stats with for example cases where only the
+ // microphone is used.
+ if (!echo_frames_received_ & !echo_cancellation->stream_has_echo())
+ return;
+
+ echo_frames_received_ = true;
// In WebRTC, three echo delay metrics are calculated and updated every
// five seconds. We use one of them, |fraction_poor_delays| to log in a UMA
// histogram an Echo Cancellation quality metric. The stat in WebRTC has a
« no previous file with comments | « content/renderer/media/media_stream_audio_processor_options.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698