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 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
168 if (!j_audio_record_->StopRecording()) { | 168 if (!j_audio_record_->StopRecording()) { |
169 ALOGE("StopRecording failed!"); | 169 ALOGE("StopRecording failed!"); |
170 return -1; | 170 return -1; |
171 } | 171 } |
172 // If we don't detach here, we will hit a RTC_DCHECK in OnDataIsRecorded() | 172 // If we don't detach here, we will hit a RTC_DCHECK in OnDataIsRecorded() |
173 // next time StartRecording() is called since it will create a new Java | 173 // next time StartRecording() is called since it will create a new Java |
174 // thread. | 174 // thread. |
175 thread_checker_java_.DetachFromThread(); | 175 thread_checker_java_.DetachFromThread(); |
176 initialized_ = false; | 176 initialized_ = false; |
177 recording_ = false; | 177 recording_ = false; |
| 178 direct_buffer_address_= nullptr; |
178 return 0; | 179 return 0; |
179 } | 180 } |
180 | 181 |
181 void AudioRecordJni::AttachAudioBuffer(AudioDeviceBuffer* audioBuffer) { | 182 void AudioRecordJni::AttachAudioBuffer(AudioDeviceBuffer* audioBuffer) { |
182 ALOGD("AttachAudioBuffer"); | 183 ALOGD("AttachAudioBuffer"); |
183 RTC_DCHECK(thread_checker_.CalledOnValidThread()); | 184 RTC_DCHECK(thread_checker_.CalledOnValidThread()); |
184 audio_device_buffer_ = audioBuffer; | 185 audio_device_buffer_ = audioBuffer; |
185 const int sample_rate_hz = audio_parameters_.sample_rate(); | 186 const int sample_rate_hz = audio_parameters_.sample_rate(); |
186 ALOGD("SetRecordingSampleRate(%d)", sample_rate_hz); | 187 ALOGD("SetRecordingSampleRate(%d)", sample_rate_hz); |
187 audio_device_buffer_->SetRecordingSampleRate(sample_rate_hz); | 188 audio_device_buffer_->SetRecordingSampleRate(sample_rate_hz); |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
253 // of |playDelayMs| and |recDelayMs|, hence the distributions does not matter. | 254 // of |playDelayMs| and |recDelayMs|, hence the distributions does not matter. |
254 audio_device_buffer_->SetVQEData(total_delay_in_milliseconds_, | 255 audio_device_buffer_->SetVQEData(total_delay_in_milliseconds_, |
255 0, // recDelayMs | 256 0, // recDelayMs |
256 0); // clockDrift | 257 0); // clockDrift |
257 if (audio_device_buffer_->DeliverRecordedData() == -1) { | 258 if (audio_device_buffer_->DeliverRecordedData() == -1) { |
258 ALOGE("AudioDeviceBuffer::DeliverRecordedData failed!"); | 259 ALOGE("AudioDeviceBuffer::DeliverRecordedData failed!"); |
259 } | 260 } |
260 } | 261 } |
261 | 262 |
262 } // namespace webrtc | 263 } // namespace webrtc |
OLD | NEW |