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

Side by Side Diff: content/renderer/media/media_stream_audio_processor_options.cc

Issue 999203003: content/renderer/media/: Change when to populate WebRTC.AecDelayBasedQuality (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 231 matching lines...) Expand 10 before | Expand all | Expand 10 after
242 if (num_chunks_ < kNumChunksInFiveSeconds) { 242 if (num_chunks_ < kNumChunksInFiveSeconds) {
243 return; 243 return;
244 } 244 }
245 245
246 int dummy_median = 0, dummy_std = 0; 246 int dummy_median = 0, dummy_std = 0;
247 float fraction_poor_delays = 0; 247 float fraction_poor_delays = 0;
248 if (echo_cancellation->GetDelayMetrics( 248 if (echo_cancellation->GetDelayMetrics(
249 &dummy_median, &dummy_std, &fraction_poor_delays) == 249 &dummy_median, &dummy_std, &fraction_poor_delays) ==
250 webrtc::AudioProcessing::kNoError) { 250 webrtc::AudioProcessing::kNoError) {
251 num_chunks_ = 0; 251 num_chunks_ = 0;
252 // Map |fraction_poor_delays| to an Echo Cancellation quality and log in UMA
253 // histogram. See DelayBasedEchoQuality for information on histogram
254 // buckets.
255 UMA_HISTOGRAM_ENUMERATION("WebRTC.AecDelayBasedQuality",
perkj_chrome 2015/03/27 09:34:09 So you no longer want to log when GetDelayMetrics
bjornv 2015/03/27 10:01:53 That's a good point. I'll remember that one if we'
256 EchoDelayFrequencyToQuality(fraction_poor_delays),
257 DELAY_BASED_ECHO_QUALITY_MAX);
252 } 258 }
253 // Map |fraction_poor_delays| to an Echo Cancellation quality and log in UMA
254 // histogram. See DelayBasedEchoQuality for information on histogram buckets.
255 UMA_HISTOGRAM_ENUMERATION("WebRTC.AecDelayBasedQuality",
256 EchoDelayFrequencyToQuality(fraction_poor_delays),
257 DELAY_BASED_ECHO_QUALITY_MAX);
258 } 259 }
259 260
260 void EnableEchoCancellation(AudioProcessing* audio_processing) { 261 void EnableEchoCancellation(AudioProcessing* audio_processing) {
261 #if defined(OS_ANDROID) || defined(OS_IOS) 262 #if defined(OS_ANDROID) || defined(OS_IOS)
262 const std::string group_name = 263 const std::string group_name =
263 base::FieldTrialList::FindFullName("ReplaceAECMWithAEC"); 264 base::FieldTrialList::FindFullName("ReplaceAECMWithAEC");
264 if (group_name.empty() || 265 if (group_name.empty() ||
265 !(group_name == "Enabled" || group_name == "DefaultEnabled")) { 266 !(group_name == "Enabled" || group_name == "DefaultEnabled")) {
266 // Mobile devices are using AECM. 267 // Mobile devices are using AECM.
267 int err = audio_processing->echo_control_mobile()->set_routing_mode( 268 int err = audio_processing->echo_control_mobile()->set_routing_mode(
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
368 int median = 0, std = 0; 369 int median = 0, std = 0;
369 float dummy = 0; 370 float dummy = 0;
370 if (echo_cancellation->GetDelayMetrics(&median, &std, &dummy) == 371 if (echo_cancellation->GetDelayMetrics(&median, &std, &dummy) ==
371 webrtc::AudioProcessing::kNoError) { 372 webrtc::AudioProcessing::kNoError) {
372 stats->echo_delay_median_ms = median; 373 stats->echo_delay_median_ms = median;
373 stats->echo_delay_std_ms = std; 374 stats->echo_delay_std_ms = std;
374 } 375 }
375 } 376 }
376 377
377 } // namespace content 378 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698