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

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

Issue 1228823003: Update audio code to use size_t more correctly, webrtc/modules/audio_device/ (Closed) Base URL: https://chromium.googlesource.com/external/webrtc@master
Patch Set: Review comments Created 5 years, 4 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) 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
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
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
OLDNEW
« no previous file with comments | « webrtc/modules/audio_device/android/audio_manager_unittest.cc ('k') | webrtc/modules/audio_device/audio_device_buffer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698