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

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

Issue 3009193002: Improves stereo/mono audio support on Android (Closed)
Patch Set: nit Created 3 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 202 matching lines...) Expand 10 before | Expand all | Expand 10 after
213 213
214 bool AudioManager::IsProAudioSupported() const { 214 bool AudioManager::IsProAudioSupported() const {
215 RTC_DCHECK(thread_checker_.CalledOnValidThread()); 215 RTC_DCHECK(thread_checker_.CalledOnValidThread());
216 ALOGD("IsProAudioSupported()"); 216 ALOGD("IsProAudioSupported()");
217 // TODO(henrika): return the state independently of if OpenSL ES is 217 // TODO(henrika): return the state independently of if OpenSL ES is
218 // blacklisted or not for now. We could use the same approach as in 218 // blacklisted or not for now. We could use the same approach as in
219 // IsLowLatencyPlayoutSupported() but I can't see the need for it yet. 219 // IsLowLatencyPlayoutSupported() but I can't see the need for it yet.
220 return pro_audio_; 220 return pro_audio_;
221 } 221 }
222 222
223 bool AudioManager::IsStereoPlayoutSupported() const {
224 RTC_DCHECK(thread_checker_.CalledOnValidThread());
225 ALOGD("IsStereoPlayoutSupported()");
226 return (playout_parameters_.channels() == 2);
227 }
228
229 bool AudioManager::IsStereoRecordSupported() const {
230 RTC_DCHECK(thread_checker_.CalledOnValidThread());
231 ALOGD("IsStereoRecordSupported()");
232 return (record_parameters_.channels() == 2);
233 }
234
223 int AudioManager::GetDelayEstimateInMilliseconds() const { 235 int AudioManager::GetDelayEstimateInMilliseconds() const {
224 return delay_estimate_in_milliseconds_; 236 return delay_estimate_in_milliseconds_;
225 } 237 }
226 238
227 void JNICALL AudioManager::CacheAudioParameters(JNIEnv* env, 239 void JNICALL AudioManager::CacheAudioParameters(JNIEnv* env,
228 jobject obj, 240 jobject obj,
229 jint sample_rate, 241 jint sample_rate,
230 jint output_channels, 242 jint output_channels,
231 jint input_channels, 243 jint input_channels,
232 jboolean hardware_aec, 244 jboolean hardware_aec,
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
289 return playout_parameters_; 301 return playout_parameters_;
290 } 302 }
291 303
292 const AudioParameters& AudioManager::GetRecordAudioParameters() { 304 const AudioParameters& AudioManager::GetRecordAudioParameters() {
293 RTC_CHECK(record_parameters_.is_valid()); 305 RTC_CHECK(record_parameters_.is_valid());
294 RTC_DCHECK(thread_checker_.CalledOnValidThread()); 306 RTC_DCHECK(thread_checker_.CalledOnValidThread());
295 return record_parameters_; 307 return record_parameters_;
296 } 308 }
297 309
298 } // namespace webrtc 310 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/modules/audio_device/android/audio_manager.h ('k') | webrtc/modules/audio_device/android/audio_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698