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

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

Issue 1373443003: Modifies invalid DCHECK in AudioRecordJni::OnCacheDirectBufferAddress() (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 5 years, 2 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
« no previous file with comments | « webrtc/modules/audio_device/android/audio_device_unittest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 205 matching lines...) Expand 10 before | Expand all | Expand 10 after
216 JNIEnv* env, jobject obj, jobject byte_buffer, jlong nativeAudioRecord) { 216 JNIEnv* env, jobject obj, jobject byte_buffer, jlong nativeAudioRecord) {
217 webrtc::AudioRecordJni* this_object = 217 webrtc::AudioRecordJni* this_object =
218 reinterpret_cast<webrtc::AudioRecordJni*> (nativeAudioRecord); 218 reinterpret_cast<webrtc::AudioRecordJni*> (nativeAudioRecord);
219 this_object->OnCacheDirectBufferAddress(env, byte_buffer); 219 this_object->OnCacheDirectBufferAddress(env, byte_buffer);
220 } 220 }
221 221
222 void AudioRecordJni::OnCacheDirectBufferAddress( 222 void AudioRecordJni::OnCacheDirectBufferAddress(
223 JNIEnv* env, jobject byte_buffer) { 223 JNIEnv* env, jobject byte_buffer) {
224 ALOGD("OnCacheDirectBufferAddress"); 224 ALOGD("OnCacheDirectBufferAddress");
225 RTC_DCHECK(thread_checker_.CalledOnValidThread()); 225 RTC_DCHECK(thread_checker_.CalledOnValidThread());
226 RTC_DCHECK(!direct_buffer_address_);
magjed_webrtc 2015/09/25 09:18:24 Would it be possible to keep this check if you cle
henrika_webrtc 2015/09/25 09:26:46 Good point. Let me check ;-)
227 direct_buffer_address_ = 226 direct_buffer_address_ =
228 env->GetDirectBufferAddress(byte_buffer); 227 env->GetDirectBufferAddress(byte_buffer);
229 jlong capacity = env->GetDirectBufferCapacity(byte_buffer); 228 jlong capacity = env->GetDirectBufferCapacity(byte_buffer);
230 ALOGD("direct buffer capacity: %lld", capacity); 229 ALOGD("direct buffer capacity: %lld", capacity);
231 direct_buffer_capacity_in_bytes_ = static_cast<size_t>(capacity); 230 direct_buffer_capacity_in_bytes_ = static_cast<size_t>(capacity);
232 } 231 }
233 232
234 void JNICALL AudioRecordJni::DataIsRecorded( 233 void JNICALL AudioRecordJni::DataIsRecorded(
235 JNIEnv* env, jobject obj, jint length, jlong nativeAudioRecord) { 234 JNIEnv* env, jobject obj, jint length, jlong nativeAudioRecord) {
236 webrtc::AudioRecordJni* this_object = 235 webrtc::AudioRecordJni* this_object =
(...skipping 16 matching lines...) Expand all
253 // of |playDelayMs| and |recDelayMs|, hence the distributions does not matter. 252 // of |playDelayMs| and |recDelayMs|, hence the distributions does not matter.
254 audio_device_buffer_->SetVQEData(total_delay_in_milliseconds_, 253 audio_device_buffer_->SetVQEData(total_delay_in_milliseconds_,
255 0, // recDelayMs 254 0, // recDelayMs
256 0); // clockDrift 255 0); // clockDrift
257 if (audio_device_buffer_->DeliverRecordedData() == -1) { 256 if (audio_device_buffer_->DeliverRecordedData() == -1) {
258 ALOGE("AudioDeviceBuffer::DeliverRecordedData failed!"); 257 ALOGE("AudioDeviceBuffer::DeliverRecordedData failed!");
259 } 258 }
260 } 259 }
261 260
262 } // namespace webrtc 261 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/modules/audio_device/android/audio_device_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698