| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2013 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 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 119 int frames_per_buffer = j_audio_record_->InitRecording( | 119 int frames_per_buffer = j_audio_record_->InitRecording( |
| 120 audio_parameters_.sample_rate(), audio_parameters_.channels()); | 120 audio_parameters_.sample_rate(), audio_parameters_.channels()); |
| 121 if (frames_per_buffer < 0) { | 121 if (frames_per_buffer < 0) { |
| 122 ALOGE("InitRecording failed!"); | 122 ALOGE("InitRecording failed!"); |
| 123 return -1; | 123 return -1; |
| 124 } | 124 } |
| 125 frames_per_buffer_ = frames_per_buffer; | 125 frames_per_buffer_ = frames_per_buffer; |
| 126 ALOGD("frames_per_buffer: %d", frames_per_buffer_); | 126 ALOGD("frames_per_buffer: %d", frames_per_buffer_); |
| 127 CHECK_EQ(direct_buffer_capacity_in_bytes_, | 127 CHECK_EQ(direct_buffer_capacity_in_bytes_, |
| 128 frames_per_buffer_ * kBytesPerFrame); | 128 frames_per_buffer_ * kBytesPerFrame); |
| 129 CHECK_EQ(frames_per_buffer_, audio_parameters_.frames_per_10ms_buffer()); | 129 CHECK_EQ(frames_per_buffer_, |
| 130 static_cast<int>(audio_parameters_.frames_per_10ms_buffer())); |
| 130 initialized_ = true; | 131 initialized_ = true; |
| 131 return 0; | 132 return 0; |
| 132 } | 133 } |
| 133 | 134 |
| 134 int32_t AudioRecordJni::StartRecording() { | 135 int32_t AudioRecordJni::StartRecording() { |
| 135 ALOGD("StartRecording%s", GetThreadInfo().c_str()); | 136 ALOGD("StartRecording%s", GetThreadInfo().c_str()); |
| 136 DCHECK(thread_checker_.CalledOnValidThread()); | 137 DCHECK(thread_checker_.CalledOnValidThread()); |
| 137 DCHECK(initialized_); | 138 DCHECK(initialized_); |
| 138 DCHECK(!recording_); | 139 DCHECK(!recording_); |
| 139 if (!j_audio_record_->StartRecording()) { | 140 if (!j_audio_record_->StartRecording()) { |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 225 // of |playDelayMs| and |recDelayMs|, hence the distributions does not matter. | 226 // of |playDelayMs| and |recDelayMs|, hence the distributions does not matter. |
| 226 audio_device_buffer_->SetVQEData(total_delay_in_milliseconds_, | 227 audio_device_buffer_->SetVQEData(total_delay_in_milliseconds_, |
| 227 0, // recDelayMs | 228 0, // recDelayMs |
| 228 0); // clockDrift | 229 0); // clockDrift |
| 229 if (audio_device_buffer_->DeliverRecordedData() == -1) { | 230 if (audio_device_buffer_->DeliverRecordedData() == -1) { |
| 230 ALOGE("AudioDeviceBuffer::DeliverRecordedData failed!"); | 231 ALOGE("AudioDeviceBuffer::DeliverRecordedData failed!"); |
| 231 } | 232 } |
| 232 } | 233 } |
| 233 | 234 |
| 234 } // namespace webrtc | 235 } // namespace webrtc |
| OLD | NEW |