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