OLD | NEW |
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 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 device supports the low-latency audio paths in | 87 // Returns true if the device supports the low-latency audio paths in |
88 // combination with OpenSL ES. | 88 // combination with OpenSL ES. |
89 bool IsLowLatencyPlayoutSupported() const; | 89 bool IsLowLatencyPlayoutSupported() const; |
90 | 90 |
| 91 // Returns true if the device supports pro-audio features in combination with |
| 92 // OpenSL ES. |
| 93 bool IsProAudioSupported() const; |
| 94 |
91 // Returns the estimated total delay of this device. Unit is in milliseconds. | 95 // 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. | 96 // The vaule is set once at construction and never changes after that. |
93 // Possible values are webrtc::kLowLatencyModeDelayEstimateInMilliseconds and | 97 // Possible values are webrtc::kLowLatencyModeDelayEstimateInMilliseconds and |
94 // webrtc::kHighLatencyModeDelayEstimateInMilliseconds. | 98 // webrtc::kHighLatencyModeDelayEstimateInMilliseconds. |
95 int GetDelayEstimateInMilliseconds() const; | 99 int GetDelayEstimateInMilliseconds() const; |
96 | 100 |
97 private: | 101 private: |
98 // Called from Java side so we can cache the native audio parameters. | 102 // Called from Java side so we can cache the native audio parameters. |
99 // This method will be called by the WebRtcAudioManager constructor, i.e. | 103 // This method will be called by the WebRtcAudioManager constructor, i.e. |
100 // on the same thread that this object is created on. | 104 // on the same thread that this object is created on. |
101 static void JNICALL CacheAudioParameters(JNIEnv* env, | 105 static void JNICALL CacheAudioParameters(JNIEnv* env, |
102 jobject obj, | 106 jobject obj, |
103 jint sample_rate, | 107 jint sample_rate, |
104 jint channels, | 108 jint channels, |
105 jboolean hardware_aec, | 109 jboolean hardware_aec, |
106 jboolean hardware_agc, | 110 jboolean hardware_agc, |
107 jboolean hardware_ns, | 111 jboolean hardware_ns, |
108 jboolean low_latency_output, | 112 jboolean low_latency_output, |
| 113 jboolean pro_audio, |
109 jint output_buffer_size, | 114 jint output_buffer_size, |
110 jint input_buffer_size, | 115 jint input_buffer_size, |
111 jlong native_audio_manager); | 116 jlong native_audio_manager); |
112 void OnCacheAudioParameters(JNIEnv* env, | 117 void OnCacheAudioParameters(JNIEnv* env, |
113 jint sample_rate, | 118 jint sample_rate, |
114 jint channels, | 119 jint channels, |
115 jboolean hardware_aec, | 120 jboolean hardware_aec, |
116 jboolean hardware_agc, | 121 jboolean hardware_agc, |
117 jboolean hardware_ns, | 122 jboolean hardware_ns, |
118 jboolean low_latency_output, | 123 jboolean low_latency_output, |
| 124 jboolean pro_audio, |
119 jint output_buffer_size, | 125 jint output_buffer_size, |
120 jint input_buffer_size); | 126 jint input_buffer_size); |
121 | 127 |
122 // Stores thread ID in the constructor. | 128 // Stores thread ID in the constructor. |
123 // We can then use ThreadChecker::CalledOnValidThread() to ensure that | 129 // We can then use ThreadChecker::CalledOnValidThread() to ensure that |
124 // other methods are called from the same thread. | 130 // other methods are called from the same thread. |
125 rtc::ThreadChecker thread_checker_; | 131 rtc::ThreadChecker thread_checker_; |
126 | 132 |
127 // Calls AttachCurrentThread() if this thread is not attached at construction. | 133 // Calls AttachCurrentThread() if this thread is not attached at construction. |
128 // Also ensures that DetachCurrentThread() is called at destruction. | 134 // Also ensures that DetachCurrentThread() is called at destruction. |
(...skipping 16 matching lines...) Expand all Loading... |
145 // True if device supports hardware (or built-in) AEC. | 151 // True if device supports hardware (or built-in) AEC. |
146 bool hardware_aec_; | 152 bool hardware_aec_; |
147 // True if device supports hardware (or built-in) AGC. | 153 // True if device supports hardware (or built-in) AGC. |
148 bool hardware_agc_; | 154 bool hardware_agc_; |
149 // True if device supports hardware (or built-in) NS. | 155 // True if device supports hardware (or built-in) NS. |
150 bool hardware_ns_; | 156 bool hardware_ns_; |
151 | 157 |
152 // True if device supports the low-latency OpenSL ES audio path. | 158 // True if device supports the low-latency OpenSL ES audio path. |
153 bool low_latency_playout_; | 159 bool low_latency_playout_; |
154 | 160 |
| 161 // True if device supports the low-latency OpenSL ES pro-audio path. |
| 162 bool pro_audio_; |
| 163 |
155 // The delay estimate can take one of two fixed values depending on if the | 164 // The delay estimate can take one of two fixed values depending on if the |
156 // device supports low-latency output or not. | 165 // device supports low-latency output or not. |
157 int delay_estimate_in_milliseconds_; | 166 int delay_estimate_in_milliseconds_; |
158 | 167 |
159 // Contains native parameters (e.g. sample rate, channel configuration). | 168 // Contains native parameters (e.g. sample rate, channel configuration). |
160 // Set at construction in OnCacheAudioParameters() which is called from | 169 // Set at construction in OnCacheAudioParameters() which is called from |
161 // Java on the same thread as this object is created on. | 170 // Java on the same thread as this object is created on. |
162 AudioParameters playout_parameters_; | 171 AudioParameters playout_parameters_; |
163 AudioParameters record_parameters_; | 172 AudioParameters record_parameters_; |
164 }; | 173 }; |
165 | 174 |
166 } // namespace webrtc | 175 } // namespace webrtc |
167 | 176 |
168 #endif // WEBRTC_MODULES_AUDIO_DEVICE_ANDROID_AUDIO_MANAGER_H_ | 177 #endif // WEBRTC_MODULES_AUDIO_DEVICE_ANDROID_AUDIO_MANAGER_H_ |
OLD | NEW |