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

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

Issue 1316523002: Convert channel counts to size_t. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc@master
Patch Set: Fix compile Created 4 years, 11 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 25 matching lines...) Expand all
36 init_recording_(native_reg->GetMethodId("initRecording", "(II)I")), 36 init_recording_(native_reg->GetMethodId("initRecording", "(II)I")),
37 start_recording_(native_reg->GetMethodId("startRecording", "()Z")), 37 start_recording_(native_reg->GetMethodId("startRecording", "()Z")),
38 stop_recording_(native_reg->GetMethodId("stopRecording", "()Z")), 38 stop_recording_(native_reg->GetMethodId("stopRecording", "()Z")),
39 enable_built_in_aec_(native_reg->GetMethodId("enableBuiltInAEC", "(Z)Z")), 39 enable_built_in_aec_(native_reg->GetMethodId("enableBuiltInAEC", "(Z)Z")),
40 enable_built_in_agc_(native_reg->GetMethodId("enableBuiltInAGC", "(Z)Z")), 40 enable_built_in_agc_(native_reg->GetMethodId("enableBuiltInAGC", "(Z)Z")),
41 enable_built_in_ns_(native_reg->GetMethodId("enableBuiltInNS", "(Z)Z")) {} 41 enable_built_in_ns_(native_reg->GetMethodId("enableBuiltInNS", "(Z)Z")) {}
42 42
43 AudioRecordJni::JavaAudioRecord::~JavaAudioRecord() {} 43 AudioRecordJni::JavaAudioRecord::~JavaAudioRecord() {}
44 44
45 int AudioRecordJni::JavaAudioRecord::InitRecording( 45 int AudioRecordJni::JavaAudioRecord::InitRecording(
46 int sample_rate, int channels) { 46 int sample_rate, size_t channels) {
47 return audio_record_->CallIntMethod(init_recording_, 47 return audio_record_->CallIntMethod(init_recording_,
48 static_cast<jint>(sample_rate), 48 static_cast<jint>(sample_rate),
49 static_cast<jint>(channels)); 49 static_cast<jint>(channels));
50 } 50 }
51 51
52 bool AudioRecordJni::JavaAudioRecord::StartRecording() { 52 bool AudioRecordJni::JavaAudioRecord::StartRecording() {
53 return audio_record_->CallBooleanMethod(start_recording_); 53 return audio_record_->CallBooleanMethod(start_recording_);
54 } 54 }
55 55
56 bool AudioRecordJni::JavaAudioRecord::StopRecording() { 56 bool AudioRecordJni::JavaAudioRecord::StopRecording() {
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
178 return 0; 178 return 0;
179 } 179 }
180 180
181 void AudioRecordJni::AttachAudioBuffer(AudioDeviceBuffer* audioBuffer) { 181 void AudioRecordJni::AttachAudioBuffer(AudioDeviceBuffer* audioBuffer) {
182 ALOGD("AttachAudioBuffer"); 182 ALOGD("AttachAudioBuffer");
183 RTC_DCHECK(thread_checker_.CalledOnValidThread()); 183 RTC_DCHECK(thread_checker_.CalledOnValidThread());
184 audio_device_buffer_ = audioBuffer; 184 audio_device_buffer_ = audioBuffer;
185 const int sample_rate_hz = audio_parameters_.sample_rate(); 185 const int sample_rate_hz = audio_parameters_.sample_rate();
186 ALOGD("SetRecordingSampleRate(%d)", sample_rate_hz); 186 ALOGD("SetRecordingSampleRate(%d)", sample_rate_hz);
187 audio_device_buffer_->SetRecordingSampleRate(sample_rate_hz); 187 audio_device_buffer_->SetRecordingSampleRate(sample_rate_hz);
188 const int channels = audio_parameters_.channels(); 188 const size_t channels = audio_parameters_.channels();
189 ALOGD("SetRecordingChannels(%d)", channels); 189 ALOGD("SetRecordingChannels(%" PRIuS ")", channels);
190 audio_device_buffer_->SetRecordingChannels(channels); 190 audio_device_buffer_->SetRecordingChannels(channels);
191 total_delay_in_milliseconds_ = 191 total_delay_in_milliseconds_ =
192 audio_manager_->GetDelayEstimateInMilliseconds(); 192 audio_manager_->GetDelayEstimateInMilliseconds();
193 RTC_DCHECK_GT(total_delay_in_milliseconds_, 0); 193 RTC_DCHECK_GT(total_delay_in_milliseconds_, 0);
194 ALOGD("total_delay_in_milliseconds: %d", total_delay_in_milliseconds_); 194 ALOGD("total_delay_in_milliseconds: %d", total_delay_in_milliseconds_);
195 } 195 }
196 196
197 int32_t AudioRecordJni::EnableBuiltInAEC(bool enable) { 197 int32_t AudioRecordJni::EnableBuiltInAEC(bool enable) {
198 ALOGD("EnableBuiltInAEC%s", GetThreadInfo().c_str()); 198 ALOGD("EnableBuiltInAEC%s", GetThreadInfo().c_str());
199 RTC_DCHECK(thread_checker_.CalledOnValidThread()); 199 RTC_DCHECK(thread_checker_.CalledOnValidThread());
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
253 // of |playDelayMs| and |recDelayMs|, hence the distributions does not matter. 253 // of |playDelayMs| and |recDelayMs|, hence the distributions does not matter.
254 audio_device_buffer_->SetVQEData(total_delay_in_milliseconds_, 254 audio_device_buffer_->SetVQEData(total_delay_in_milliseconds_,
255 0, // recDelayMs 255 0, // recDelayMs
256 0); // clockDrift 256 0); // clockDrift
257 if (audio_device_buffer_->DeliverRecordedData() == -1) { 257 if (audio_device_buffer_->DeliverRecordedData() == -1) {
258 ALOGE("AudioDeviceBuffer::DeliverRecordedData failed!"); 258 ALOGE("AudioDeviceBuffer::DeliverRecordedData failed!");
259 } 259 }
260 } 260 }
261 261
262 } // namespace webrtc 262 } // 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