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

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

Issue 2119633004: Adds support for OpenSL ES based audio capture on Android (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Rebased Created 4 years, 3 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 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 // platform effects and these devices will return false. 94 // platform effects and these devices will return false.
95 // Can currently only be used in combination with a Java based audio backend 95 // Can currently only be used in combination with a Java based audio backend
96 // for the recoring side (i.e. using the android.media.AudioRecord API). 96 // for the recoring side (i.e. using the android.media.AudioRecord API).
97 bool IsAcousticEchoCancelerSupported() const; 97 bool IsAcousticEchoCancelerSupported() const;
98 bool IsAutomaticGainControlSupported() const; 98 bool IsAutomaticGainControlSupported() const;
99 bool IsNoiseSuppressorSupported() const; 99 bool IsNoiseSuppressorSupported() const;
100 100
101 // Returns true if the device supports the low-latency audio paths in 101 // Returns true if the device supports the low-latency audio paths in
102 // combination with OpenSL ES. 102 // combination with OpenSL ES.
103 bool IsLowLatencyPlayoutSupported() const; 103 bool IsLowLatencyPlayoutSupported() const;
104 bool IsLowLatencyRecordSupported() const;
104 105
105 // Returns true if the device supports pro-audio features in combination with 106 // Returns true if the device supports pro-audio features in combination with
106 // OpenSL ES. 107 // OpenSL ES.
107 bool IsProAudioSupported() const; 108 bool IsProAudioSupported() const;
108 109
109 // Returns the estimated total delay of this device. Unit is in milliseconds. 110 // Returns the estimated total delay of this device. Unit is in milliseconds.
110 // The vaule is set once at construction and never changes after that. 111 // The vaule is set once at construction and never changes after that.
111 // Possible values are webrtc::kLowLatencyModeDelayEstimateInMilliseconds and 112 // Possible values are webrtc::kLowLatencyModeDelayEstimateInMilliseconds and
112 // webrtc::kHighLatencyModeDelayEstimateInMilliseconds. 113 // webrtc::kHighLatencyModeDelayEstimateInMilliseconds.
113 int GetDelayEstimateInMilliseconds() const; 114 int GetDelayEstimateInMilliseconds() const;
114 115
115 private: 116 private:
116 // Called from Java side so we can cache the native audio parameters. 117 // Called from Java side so we can cache the native audio parameters.
117 // This method will be called by the WebRtcAudioManager constructor, i.e. 118 // This method will be called by the WebRtcAudioManager constructor, i.e.
118 // on the same thread that this object is created on. 119 // on the same thread that this object is created on.
119 static void JNICALL CacheAudioParameters(JNIEnv* env, 120 static void JNICALL CacheAudioParameters(JNIEnv* env,
120 jobject obj, 121 jobject obj,
121 jint sample_rate, 122 jint sample_rate,
122 jint channels, 123 jint channels,
123 jboolean hardware_aec, 124 jboolean hardware_aec,
124 jboolean hardware_agc, 125 jboolean hardware_agc,
125 jboolean hardware_ns, 126 jboolean hardware_ns,
126 jboolean low_latency_output, 127 jboolean low_latency_output,
128 jboolean low_latency_input,
127 jboolean pro_audio, 129 jboolean pro_audio,
128 jint output_buffer_size, 130 jint output_buffer_size,
129 jint input_buffer_size, 131 jint input_buffer_size,
130 jlong native_audio_manager); 132 jlong native_audio_manager);
131 void OnCacheAudioParameters(JNIEnv* env, 133 void OnCacheAudioParameters(JNIEnv* env,
132 jint sample_rate, 134 jint sample_rate,
133 jint channels, 135 jint channels,
134 jboolean hardware_aec, 136 jboolean hardware_aec,
135 jboolean hardware_agc, 137 jboolean hardware_agc,
136 jboolean hardware_ns, 138 jboolean hardware_ns,
137 jboolean low_latency_output, 139 jboolean low_latency_output,
140 jboolean low_latency_input,
138 jboolean pro_audio, 141 jboolean pro_audio,
139 jint output_buffer_size, 142 jint output_buffer_size,
140 jint input_buffer_size); 143 jint input_buffer_size);
141 144
142 // Stores thread ID in the constructor. 145 // Stores thread ID in the constructor.
143 // We can then use ThreadChecker::CalledOnValidThread() to ensure that 146 // We can then use ThreadChecker::CalledOnValidThread() to ensure that
144 // other methods are called from the same thread. 147 // other methods are called from the same thread.
145 rtc::ThreadChecker thread_checker_; 148 rtc::ThreadChecker thread_checker_;
146 149
147 // Calls AttachCurrentThread() if this thread is not attached at construction. 150 // Calls AttachCurrentThread() if this thread is not attached at construction.
(...skipping 23 matching lines...) Expand all
171 // Set to true by Init() and false by Close(). 174 // Set to true by Init() and false by Close().
172 bool initialized_; 175 bool initialized_;
173 176
174 // True if device supports hardware (or built-in) AEC. 177 // True if device supports hardware (or built-in) AEC.
175 bool hardware_aec_; 178 bool hardware_aec_;
176 // True if device supports hardware (or built-in) AGC. 179 // True if device supports hardware (or built-in) AGC.
177 bool hardware_agc_; 180 bool hardware_agc_;
178 // True if device supports hardware (or built-in) NS. 181 // True if device supports hardware (or built-in) NS.
179 bool hardware_ns_; 182 bool hardware_ns_;
180 183
181 // True if device supports the low-latency OpenSL ES audio path. 184 // True if device supports the low-latency OpenSL ES audio path for output.
182 bool low_latency_playout_; 185 bool low_latency_playout_;
183 186
187 // True if device supports the low-latency OpenSL ES audio path for input.
188 bool low_latency_record_;
189
184 // True if device supports the low-latency OpenSL ES pro-audio path. 190 // True if device supports the low-latency OpenSL ES pro-audio path.
185 bool pro_audio_; 191 bool pro_audio_;
186 192
187 // The delay estimate can take one of two fixed values depending on if the 193 // The delay estimate can take one of two fixed values depending on if the
188 // device supports low-latency output or not. 194 // device supports low-latency output or not.
189 int delay_estimate_in_milliseconds_; 195 int delay_estimate_in_milliseconds_;
190 196
191 // Contains native parameters (e.g. sample rate, channel configuration). 197 // Contains native parameters (e.g. sample rate, channel configuration).
192 // Set at construction in OnCacheAudioParameters() which is called from 198 // Set at construction in OnCacheAudioParameters() which is called from
193 // Java on the same thread as this object is created on. 199 // Java on the same thread as this object is created on.
194 AudioParameters playout_parameters_; 200 AudioParameters playout_parameters_;
195 AudioParameters record_parameters_; 201 AudioParameters record_parameters_;
196 }; 202 };
197 203
198 } // namespace webrtc 204 } // namespace webrtc
199 205
200 #endif // WEBRTC_MODULES_AUDIO_DEVICE_ANDROID_AUDIO_MANAGER_H_ 206 #endif // WEBRTC_MODULES_AUDIO_DEVICE_ANDROID_AUDIO_MANAGER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698