| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2016 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 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 DestroyAudioRecorder(); | 69 DestroyAudioRecorder(); |
| 70 engine_ = nullptr; | 70 engine_ = nullptr; |
| 71 RTC_DCHECK(!engine_); | 71 RTC_DCHECK(!engine_); |
| 72 RTC_DCHECK(!recorder_); | 72 RTC_DCHECK(!recorder_); |
| 73 RTC_DCHECK(!simple_buffer_queue_); | 73 RTC_DCHECK(!simple_buffer_queue_); |
| 74 } | 74 } |
| 75 | 75 |
| 76 int OpenSLESRecorder::Init() { | 76 int OpenSLESRecorder::Init() { |
| 77 ALOGD("Init%s", GetThreadInfo().c_str()); | 77 ALOGD("Init%s", GetThreadInfo().c_str()); |
| 78 RTC_DCHECK(thread_checker_.CalledOnValidThread()); | 78 RTC_DCHECK(thread_checker_.CalledOnValidThread()); |
| 79 if (audio_parameters_.channels() == 2) { |
| 80 // TODO(henrika): FineAudioBuffer needs more work to support stereo. |
| 81 ALOGE("OpenSLESRecorder does not support stereo"); |
| 82 return -1; |
| 83 } |
| 79 return 0; | 84 return 0; |
| 80 } | 85 } |
| 81 | 86 |
| 82 int OpenSLESRecorder::Terminate() { | 87 int OpenSLESRecorder::Terminate() { |
| 83 ALOGD("Terminate%s", GetThreadInfo().c_str()); | 88 ALOGD("Terminate%s", GetThreadInfo().c_str()); |
| 84 RTC_DCHECK(thread_checker_.CalledOnValidThread()); | 89 RTC_DCHECK(thread_checker_.CalledOnValidThread()); |
| 85 StopRecording(); | 90 StopRecording(); |
| 86 return 0; | 91 return 0; |
| 87 } | 92 } |
| 88 | 93 |
| (...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 419 SLAndroidSimpleBufferQueueState state = GetBufferQueueState(); | 424 SLAndroidSimpleBufferQueueState state = GetBufferQueueState(); |
| 420 ALOGD("state.count:%d state.index:%d", state.count, state.index); | 425 ALOGD("state.count:%d state.index:%d", state.count, state.index); |
| 421 } | 426 } |
| 422 | 427 |
| 423 SLuint32 OpenSLESRecorder::GetBufferCount() { | 428 SLuint32 OpenSLESRecorder::GetBufferCount() { |
| 424 SLAndroidSimpleBufferQueueState state = GetBufferQueueState(); | 429 SLAndroidSimpleBufferQueueState state = GetBufferQueueState(); |
| 425 return state.count; | 430 return state.count; |
| 426 } | 431 } |
| 427 | 432 |
| 428 } // namespace webrtc | 433 } // namespace webrtc |
| OLD | NEW |