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

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

Issue 833643005: Add a media constraint to enable beamforming. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Declare and initialize geometry at once Created 5 years, 11 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 | « content/renderer/media/media_stream_audio_processor_options.h ('k') | 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 17 matching lines...) Expand all
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
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
OLDNEW
« 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