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

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

Issue 1238083005: [NOT FOR REVIEW] Convert channel counts to size_t. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc@size_t
Patch Set: Checkpoint 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 22 matching lines...) Expand all
33 init_recording_(native_reg->GetMethodId("InitRecording", "(II)I")), 33 init_recording_(native_reg->GetMethodId("InitRecording", "(II)I")),
34 start_recording_(native_reg->GetMethodId("StartRecording", "()Z")), 34 start_recording_(native_reg->GetMethodId("StartRecording", "()Z")),
35 stop_recording_(native_reg->GetMethodId("StopRecording", "()Z")), 35 stop_recording_(native_reg->GetMethodId("StopRecording", "()Z")),
36 enable_built_in_aec_(native_reg->GetMethodId( 36 enable_built_in_aec_(native_reg->GetMethodId(
37 "EnableBuiltInAEC", "(Z)Z")) { 37 "EnableBuiltInAEC", "(Z)Z")) {
38 } 38 }
39 39
40 AudioRecordJni::JavaAudioRecord::~JavaAudioRecord() {} 40 AudioRecordJni::JavaAudioRecord::~JavaAudioRecord() {}
41 41
42 int AudioRecordJni::JavaAudioRecord::InitRecording( 42 int AudioRecordJni::JavaAudioRecord::InitRecording(
43 int sample_rate, int channels) { 43 int sample_rate, size_t channels) {
44 return audio_record_->CallIntMethod(init_recording_, 44 return audio_record_->CallIntMethod(init_recording_,
45 static_cast<jint>(sample_rate), 45 static_cast<jint>(sample_rate),
46 static_cast<jint>(channels)); 46 static_cast<jint>(channels));
47 } 47 }
48 48
49 bool AudioRecordJni::JavaAudioRecord::StartRecording() { 49 bool AudioRecordJni::JavaAudioRecord::StartRecording() {
50 return audio_record_->CallBooleanMethod(start_recording_); 50 return audio_record_->CallBooleanMethod(start_recording_);
51 } 51 }
52 52
53 bool AudioRecordJni::JavaAudioRecord::StopRecording() { 53 bool AudioRecordJni::JavaAudioRecord::StopRecording() {
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
163 return 0; 163 return 0;
164 } 164 }
165 165
166 void AudioRecordJni::AttachAudioBuffer(AudioDeviceBuffer* audioBuffer) { 166 void AudioRecordJni::AttachAudioBuffer(AudioDeviceBuffer* audioBuffer) {
167 ALOGD("AttachAudioBuffer"); 167 ALOGD("AttachAudioBuffer");
168 DCHECK(thread_checker_.CalledOnValidThread()); 168 DCHECK(thread_checker_.CalledOnValidThread());
169 audio_device_buffer_ = audioBuffer; 169 audio_device_buffer_ = audioBuffer;
170 const int sample_rate_hz = audio_parameters_.sample_rate(); 170 const int sample_rate_hz = audio_parameters_.sample_rate();
171 ALOGD("SetRecordingSampleRate(%d)", sample_rate_hz); 171 ALOGD("SetRecordingSampleRate(%d)", sample_rate_hz);
172 audio_device_buffer_->SetRecordingSampleRate(sample_rate_hz); 172 audio_device_buffer_->SetRecordingSampleRate(sample_rate_hz);
173 const int channels = audio_parameters_.channels(); 173 const size_t channels = audio_parameters_.channels();
174 ALOGD("SetRecordingChannels(%d)", channels); 174 ALOGD("SetRecordingChannels(%" PRIuS ")", channels);
175 audio_device_buffer_->SetRecordingChannels(channels); 175 audio_device_buffer_->SetRecordingChannels(channels);
176 total_delay_in_milliseconds_ = 176 total_delay_in_milliseconds_ =
177 audio_manager_->GetDelayEstimateInMilliseconds(); 177 audio_manager_->GetDelayEstimateInMilliseconds();
178 DCHECK_GT(total_delay_in_milliseconds_, 0); 178 DCHECK_GT(total_delay_in_milliseconds_, 0);
179 ALOGD("total_delay_in_milliseconds: %d", total_delay_in_milliseconds_); 179 ALOGD("total_delay_in_milliseconds: %d", total_delay_in_milliseconds_);
180 } 180 }
181 181
182 int32_t AudioRecordJni::EnableBuiltInAEC(bool enable) { 182 int32_t AudioRecordJni::EnableBuiltInAEC(bool enable) {
183 ALOGD("EnableBuiltInAEC%s", GetThreadInfo().c_str()); 183 ALOGD("EnableBuiltInAEC%s", GetThreadInfo().c_str());
184 DCHECK(thread_checker_.CalledOnValidThread()); 184 DCHECK(thread_checker_.CalledOnValidThread());
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
226 // of |playDelayMs| and |recDelayMs|, hence the distributions does not matter. 226 // of |playDelayMs| and |recDelayMs|, hence the distributions does not matter.
227 audio_device_buffer_->SetVQEData(total_delay_in_milliseconds_, 227 audio_device_buffer_->SetVQEData(total_delay_in_milliseconds_,
228 0, // recDelayMs 228 0, // recDelayMs
229 0); // clockDrift 229 0); // clockDrift
230 if (audio_device_buffer_->DeliverRecordedData() == -1) { 230 if (audio_device_buffer_->DeliverRecordedData() == -1) {
231 ALOGE("AudioDeviceBuffer::DeliverRecordedData failed!"); 231 ALOGE("AudioDeviceBuffer::DeliverRecordedData failed!");
232 } 232 }
233 } 233 }
234 234
235 } // namespace webrtc 235 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/modules/audio_device/android/audio_record_jni.h ('k') | webrtc/modules/audio_device/android/audio_track_jni.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698