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

Side by Side Diff: webrtc/modules/audio_device/android/audio_manager.h

Issue 1952123003: Surface the IntelligibilityEnhancer on MediaConstraints (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 4 years, 7 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
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 77
78 // Returns true if the device supports built-in audio effects for AEC, AGC 78 // Returns true if the device supports built-in audio effects for AEC, AGC
79 // and NS. Some devices can also be blacklisted for use in combination with 79 // and NS. Some devices can also be blacklisted for use in combination with
80 // platform effects and these devices will return false. 80 // platform effects and these devices will return false.
81 // Can currently only be used in combination with a Java based audio backend 81 // Can currently only be used in combination with a Java based audio backend
82 // for the recoring side (i.e. using the android.media.AudioRecord API). 82 // for the recoring side (i.e. using the android.media.AudioRecord API).
83 bool IsAcousticEchoCancelerSupported() const; 83 bool IsAcousticEchoCancelerSupported() const;
84 bool IsAutomaticGainControlSupported() const; 84 bool IsAutomaticGainControlSupported() const;
85 bool IsNoiseSuppressorSupported() const; 85 bool IsNoiseSuppressorSupported() const;
86 86
87 // Returns true if the Intelligibility Enhancer was enabled from the Java API.
88 bool IsIntelligibilityEnhancerEnabled() const;
89
87 // Returns true if the device supports the low-latency audio paths in 90 // Returns true if the device supports the low-latency audio paths in
88 // combination with OpenSL ES. 91 // combination with OpenSL ES.
89 bool IsLowLatencyPlayoutSupported() const; 92 bool IsLowLatencyPlayoutSupported() const;
90 93
91 // Returns the estimated total delay of this device. Unit is in milliseconds. 94 // Returns the estimated total delay of this device. Unit is in milliseconds.
92 // The vaule is set once at construction and never changes after that. 95 // The vaule is set once at construction and never changes after that.
93 // Possible values are webrtc::kLowLatencyModeDelayEstimateInMilliseconds and 96 // Possible values are webrtc::kLowLatencyModeDelayEstimateInMilliseconds and
94 // webrtc::kHighLatencyModeDelayEstimateInMilliseconds. 97 // webrtc::kHighLatencyModeDelayEstimateInMilliseconds.
95 int GetDelayEstimateInMilliseconds() const; 98 int GetDelayEstimateInMilliseconds() const;
96 99
97 private: 100 private:
98 // Called from Java side so we can cache the native audio parameters. 101 // Called from Java side so we can cache the native audio parameters.
99 // This method will be called by the WebRtcAudioManager constructor, i.e. 102 // This method will be called by the WebRtcAudioManager constructor, i.e.
100 // on the same thread that this object is created on. 103 // on the same thread that this object is created on.
101 static void JNICALL CacheAudioParameters(JNIEnv* env, 104 static void JNICALL CacheAudioParameters(JNIEnv* env,
102 jobject obj, 105 jobject obj,
103 jint sample_rate, 106 jint sample_rate,
104 jint channels, 107 jint channels,
105 jboolean hardware_aec, 108 jboolean hardware_aec,
106 jboolean hardware_agc, 109 jboolean hardware_agc,
107 jboolean hardware_ns, 110 jboolean hardware_ns,
111 jboolean intelligibility,
108 jboolean low_latency_output, 112 jboolean low_latency_output,
109 jint output_buffer_size, 113 jint output_buffer_size,
110 jint input_buffer_size, 114 jint input_buffer_size,
111 jlong native_audio_manager); 115 jlong native_audio_manager);
112 void OnCacheAudioParameters(JNIEnv* env, 116 void OnCacheAudioParameters(JNIEnv* env,
113 jint sample_rate, 117 jint sample_rate,
114 jint channels, 118 jint channels,
115 jboolean hardware_aec, 119 jboolean hardware_aec,
116 jboolean hardware_agc, 120 jboolean hardware_agc,
117 jboolean hardware_ns, 121 jboolean hardware_ns,
122 jboolean intelligibility,
118 jboolean low_latency_output, 123 jboolean low_latency_output,
119 jint output_buffer_size, 124 jint output_buffer_size,
120 jint input_buffer_size); 125 jint input_buffer_size);
121 126
122 // Stores thread ID in the constructor. 127 // Stores thread ID in the constructor.
123 // We can then use ThreadChecker::CalledOnValidThread() to ensure that 128 // We can then use ThreadChecker::CalledOnValidThread() to ensure that
124 // other methods are called from the same thread. 129 // other methods are called from the same thread.
125 rtc::ThreadChecker thread_checker_; 130 rtc::ThreadChecker thread_checker_;
126 131
127 // Calls AttachCurrentThread() if this thread is not attached at construction. 132 // Calls AttachCurrentThread() if this thread is not attached at construction.
(...skipping 14 matching lines...) Expand all
142 // Set to true by Init() and false by Close(). 147 // Set to true by Init() and false by Close().
143 bool initialized_; 148 bool initialized_;
144 149
145 // True if device supports hardware (or built-in) AEC. 150 // True if device supports hardware (or built-in) AEC.
146 bool hardware_aec_; 151 bool hardware_aec_;
147 // True if device supports hardware (or built-in) AGC. 152 // True if device supports hardware (or built-in) AGC.
148 bool hardware_agc_; 153 bool hardware_agc_;
149 // True if device supports hardware (or built-in) NS. 154 // True if device supports hardware (or built-in) NS.
150 bool hardware_ns_; 155 bool hardware_ns_;
151 156
157 // True if the IE is enabled.
158 bool intelligibility_;
159
152 // True if device supports the low-latency OpenSL ES audio path. 160 // True if device supports the low-latency OpenSL ES audio path.
153 bool low_latency_playout_; 161 bool low_latency_playout_;
154 162
155 // The delay estimate can take one of two fixed values depending on if the 163 // The delay estimate can take one of two fixed values depending on if the
156 // device supports low-latency output or not. 164 // device supports low-latency output or not.
157 int delay_estimate_in_milliseconds_; 165 int delay_estimate_in_milliseconds_;
158 166
159 // Contains native parameters (e.g. sample rate, channel configuration). 167 // Contains native parameters (e.g. sample rate, channel configuration).
160 // Set at construction in OnCacheAudioParameters() which is called from 168 // Set at construction in OnCacheAudioParameters() which is called from
161 // Java on the same thread as this object is created on. 169 // Java on the same thread as this object is created on.
162 AudioParameters playout_parameters_; 170 AudioParameters playout_parameters_;
163 AudioParameters record_parameters_; 171 AudioParameters record_parameters_;
164 }; 172 };
165 173
166 } // namespace webrtc 174 } // namespace webrtc
167 175
168 #endif // WEBRTC_MODULES_AUDIO_DEVICE_ANDROID_AUDIO_MANAGER_H_ 176 #endif // WEBRTC_MODULES_AUDIO_DEVICE_ANDROID_AUDIO_MANAGER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698