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

Side by Side Diff: webrtc/modules/audio_device/android/opensles_player.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 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 RTC_DCHECK(!engine_); 72 RTC_DCHECK(!engine_);
73 RTC_DCHECK(!output_mix_.Get()); 73 RTC_DCHECK(!output_mix_.Get());
74 RTC_DCHECK(!player_); 74 RTC_DCHECK(!player_);
75 RTC_DCHECK(!simple_buffer_queue_); 75 RTC_DCHECK(!simple_buffer_queue_);
76 RTC_DCHECK(!volume_); 76 RTC_DCHECK(!volume_);
77 } 77 }
78 78
79 int OpenSLESPlayer::Init() { 79 int OpenSLESPlayer::Init() {
80 ALOGD("Init%s", GetThreadInfo().c_str()); 80 ALOGD("Init%s", GetThreadInfo().c_str());
81 RTC_DCHECK(thread_checker_.CalledOnValidThread()); 81 RTC_DCHECK(thread_checker_.CalledOnValidThread());
82 if (audio_parameters_.channels() == 2) {
83 // TODO(henrika): FineAudioBuffer needs more work to support stereo.
84 ALOGE("OpenSLESPlayer does not support stereo");
85 return -1;
86 }
82 return 0; 87 return 0;
83 } 88 }
84 89
85 int OpenSLESPlayer::Terminate() { 90 int OpenSLESPlayer::Terminate() {
86 ALOGD("Terminate%s", GetThreadInfo().c_str()); 91 ALOGD("Terminate%s", GetThreadInfo().c_str());
87 RTC_DCHECK(thread_checker_.CalledOnValidThread()); 92 RTC_DCHECK(thread_checker_.CalledOnValidThread());
88 StopPlayout(); 93 StopPlayout();
89 return 0; 94 return 0;
90 } 95 }
91 96
(...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after
416 RTC_DCHECK(player_); 421 RTC_DCHECK(player_);
417 SLuint32 state; 422 SLuint32 state;
418 SLresult err = (*player_)->GetPlayState(player_, &state); 423 SLresult err = (*player_)->GetPlayState(player_, &state);
419 if (SL_RESULT_SUCCESS != err) { 424 if (SL_RESULT_SUCCESS != err) {
420 ALOGE("GetPlayState failed: %d", err); 425 ALOGE("GetPlayState failed: %d", err);
421 } 426 }
422 return state; 427 return state;
423 } 428 }
424 429
425 } // namespace webrtc 430 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698