| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "content/renderer/media/media_stream_audio_processor_options.h" | 5 #include "content/renderer/media/media_stream_audio_processor_options.h" |
| 6 | 6 |
| 7 #include "base/files/file_path.h" | 7 #include "base/files/file_path.h" |
| 8 #include "base/files/file_util.h" | 8 #include "base/files/file_util.h" |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/metrics/field_trial.h" | 10 #include "base/metrics/field_trial.h" |
| (...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 246 if (time_since_last_log.InSeconds() < kTimeBetweenLogsInSeconds) | 246 if (time_since_last_log.InSeconds() < kTimeBetweenLogsInSeconds) |
| 247 return; | 247 return; |
| 248 | 248 |
| 249 // Calculate how frequent the AEC delay was out of bounds since last time we | 249 // Calculate how frequent the AEC delay was out of bounds since last time we |
| 250 // updated UMA histograms. Then store the result into one of three histogram | 250 // updated UMA histograms. Then store the result into one of three histogram |
| 251 // buckets; see DelayBasedEchoQuality. | 251 // buckets; see DelayBasedEchoQuality. |
| 252 float poor_delay_frequency = 0.f; | 252 float poor_delay_frequency = 0.f; |
| 253 if (echo_total_delay_counts_ > 0) { | 253 if (echo_total_delay_counts_ > 0) { |
| 254 poor_delay_frequency = static_cast<float>(echo_poor_delay_counts_) / | 254 poor_delay_frequency = static_cast<float>(echo_poor_delay_counts_) / |
| 255 static_cast<float>(echo_total_delay_counts_); | 255 static_cast<float>(echo_total_delay_counts_); |
| 256 UMA_HISTOGRAM_ENUMERATION("Media.AecDelayBasedQuality", | 256 UMA_HISTOGRAM_ENUMERATION("WebRTC.AecDelayBasedQuality", |
| 257 EchoDelayFrequencyToQuality(poor_delay_frequency), | 257 EchoDelayFrequencyToQuality(poor_delay_frequency), |
| 258 DELAY_BASED_ECHO_QUALITY_MAX); | 258 DELAY_BASED_ECHO_QUALITY_MAX); |
| 259 } | 259 } |
| 260 echo_poor_delay_counts_ = 0; | 260 echo_poor_delay_counts_ = 0; |
| 261 echo_total_delay_counts_ = 0; | 261 echo_total_delay_counts_ = 0; |
| 262 last_log_time_ = base::TimeTicks::Now(); | 262 last_log_time_ = base::TimeTicks::Now(); |
| 263 } | 263 } |
| 264 | 264 |
| 265 void EnableEchoCancellation(AudioProcessing* audio_processing) { | 265 void EnableEchoCancellation(AudioProcessing* audio_processing) { |
| 266 #if defined(OS_ANDROID) || defined(OS_IOS) | 266 #if defined(OS_ANDROID) || defined(OS_IOS) |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 370 } | 370 } |
| 371 | 371 |
| 372 int median = 0, std = 0; | 372 int median = 0, std = 0; |
| 373 if (!audio_processing->echo_cancellation()->GetDelayMetrics(&median, &std)) { | 373 if (!audio_processing->echo_cancellation()->GetDelayMetrics(&median, &std)) { |
| 374 stats->echo_delay_median_ms = median; | 374 stats->echo_delay_median_ms = median; |
| 375 stats->echo_delay_std_ms = std; | 375 stats->echo_delay_std_ms = std; |
| 376 } | 376 } |
| 377 } | 377 } |
| 378 | 378 |
| 379 } // namespace content | 379 } // namespace content |
| OLD | NEW |