| 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 17 matching lines...) Expand all Loading... |
| 28 const char MediaAudioConstraints::kGoogExperimentalEchoCancellation[] = | 28 const char MediaAudioConstraints::kGoogExperimentalEchoCancellation[] = |
| 29 "googEchoCancellation2"; | 29 "googEchoCancellation2"; |
| 30 const char MediaAudioConstraints::kGoogAutoGainControl[] = | 30 const char MediaAudioConstraints::kGoogAutoGainControl[] = |
| 31 "googAutoGainControl"; | 31 "googAutoGainControl"; |
| 32 const char MediaAudioConstraints::kGoogExperimentalAutoGainControl[] = | 32 const char MediaAudioConstraints::kGoogExperimentalAutoGainControl[] = |
| 33 "googAutoGainControl2"; | 33 "googAutoGainControl2"; |
| 34 const char MediaAudioConstraints::kGoogNoiseSuppression[] = | 34 const char MediaAudioConstraints::kGoogNoiseSuppression[] = |
| 35 "googNoiseSuppression"; | 35 "googNoiseSuppression"; |
| 36 const char MediaAudioConstraints::kGoogExperimentalNoiseSuppression[] = | 36 const char MediaAudioConstraints::kGoogExperimentalNoiseSuppression[] = |
| 37 "googNoiseSuppression2"; | 37 "googNoiseSuppression2"; |
| 38 const char MediaAudioConstraints::kGoogBeamforming[] = "googBeamforming"; | |
| 39 const char MediaAudioConstraints::kGoogHighpassFilter[] = "googHighpassFilter"; | 38 const char MediaAudioConstraints::kGoogHighpassFilter[] = "googHighpassFilter"; |
| 40 const char MediaAudioConstraints::kGoogTypingNoiseDetection[] = | 39 const char MediaAudioConstraints::kGoogTypingNoiseDetection[] = |
| 41 "googTypingNoiseDetection"; | 40 "googTypingNoiseDetection"; |
| 42 const char MediaAudioConstraints::kGoogAudioMirroring[] = "googAudioMirroring"; | 41 const char MediaAudioConstraints::kGoogAudioMirroring[] = "googAudioMirroring"; |
| 43 | 42 |
| 44 namespace { | 43 namespace { |
| 45 | 44 |
| 46 // Constant constraint keys which enables default audio constraints on | 45 // Constant constraint keys which enables default audio constraints on |
| 47 // mediastreams with audio. | 46 // mediastreams with audio. |
| 48 struct { | 47 struct { |
| 49 const char* key; | 48 const char* key; |
| 50 bool value; | 49 bool value; |
| 51 } const kDefaultAudioConstraints[] = { | 50 } const kDefaultAudioConstraints[] = { |
| 52 { MediaAudioConstraints::kEchoCancellation, true }, | 51 { MediaAudioConstraints::kEchoCancellation, true }, |
| 53 { MediaAudioConstraints::kGoogEchoCancellation, true }, | 52 { MediaAudioConstraints::kGoogEchoCancellation, true }, |
| 54 #if defined(OS_ANDROID) || defined(OS_IOS) | 53 #if defined(OS_ANDROID) || defined(OS_IOS) |
| 55 { MediaAudioConstraints::kGoogExperimentalEchoCancellation, false }, | 54 { MediaAudioConstraints::kGoogExperimentalEchoCancellation, false }, |
| 56 #else | 55 #else |
| 57 // Enable the extended filter mode AEC on all non-mobile platforms. | 56 // Enable the extended filter mode AEC on all non-mobile platforms. |
| 58 { MediaAudioConstraints::kGoogExperimentalEchoCancellation, true }, | 57 { MediaAudioConstraints::kGoogExperimentalEchoCancellation, true }, |
| 59 #endif | 58 #endif |
| 60 { MediaAudioConstraints::kGoogAutoGainControl, true }, | 59 { MediaAudioConstraints::kGoogAutoGainControl, true }, |
| 61 { MediaAudioConstraints::kGoogExperimentalAutoGainControl, true }, | 60 { MediaAudioConstraints::kGoogExperimentalAutoGainControl, true }, |
| 62 { MediaAudioConstraints::kGoogNoiseSuppression, true }, | 61 { MediaAudioConstraints::kGoogNoiseSuppression, true }, |
| 63 { MediaAudioConstraints::kGoogHighpassFilter, true }, | 62 { MediaAudioConstraints::kGoogHighpassFilter, true }, |
| 64 { MediaAudioConstraints::kGoogTypingNoiseDetection, true }, | 63 { MediaAudioConstraints::kGoogTypingNoiseDetection, true }, |
| 65 { MediaAudioConstraints::kGoogExperimentalNoiseSuppression, false }, | 64 { MediaAudioConstraints::kGoogExperimentalNoiseSuppression, false }, |
| 66 { MediaAudioConstraints::kGoogBeamforming, false }, | |
| 67 #if defined(OS_WIN) | 65 #if defined(OS_WIN) |
| 68 { kMediaStreamAudioDucking, true }, | 66 { kMediaStreamAudioDucking, true }, |
| 69 #else | 67 #else |
| 70 { kMediaStreamAudioDucking, false }, | 68 { kMediaStreamAudioDucking, false }, |
| 71 #endif | 69 #endif |
| 72 }; | 70 }; |
| 73 | 71 |
| 74 bool IsAudioProcessingConstraint(const std::string& key) { | 72 bool IsAudioProcessingConstraint(const std::string& key) { |
| 75 // |kMediaStreamAudioDucking| does not require audio processing. | 73 // |kMediaStreamAudioDucking| does not require audio processing. |
| 76 return key != kMediaStreamAudioDucking; | 74 return key != kMediaStreamAudioDucking; |
| (...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 369 } | 367 } |
| 370 | 368 |
| 371 int median = 0, std = 0; | 369 int median = 0, std = 0; |
| 372 if (!audio_processing->echo_cancellation()->GetDelayMetrics(&median, &std)) { | 370 if (!audio_processing->echo_cancellation()->GetDelayMetrics(&median, &std)) { |
| 373 stats->echo_delay_median_ms = median; | 371 stats->echo_delay_median_ms = median; |
| 374 stats->echo_delay_std_ms = std; | 372 stats->echo_delay_std_ms = std; |
| 375 } | 373 } |
| 376 } | 374 } |
| 377 | 375 |
| 378 } // namespace content | 376 } // namespace content |
| OLD | NEW |