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 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
195 } | 195 } |
196 | 196 |
197 // TODO(henrika): possibly add stereo support. | 197 // TODO(henrika): possibly add stereo support. |
198 void AudioTrackJni::AttachAudioBuffer(AudioDeviceBuffer* audioBuffer) { | 198 void AudioTrackJni::AttachAudioBuffer(AudioDeviceBuffer* audioBuffer) { |
199 ALOGD("AttachAudioBuffer%s", GetThreadInfo().c_str()); | 199 ALOGD("AttachAudioBuffer%s", GetThreadInfo().c_str()); |
200 RTC_DCHECK(thread_checker_.CalledOnValidThread()); | 200 RTC_DCHECK(thread_checker_.CalledOnValidThread()); |
201 audio_device_buffer_ = audioBuffer; | 201 audio_device_buffer_ = audioBuffer; |
202 const int sample_rate_hz = audio_parameters_.sample_rate(); | 202 const int sample_rate_hz = audio_parameters_.sample_rate(); |
203 ALOGD("SetPlayoutSampleRate(%d)", sample_rate_hz); | 203 ALOGD("SetPlayoutSampleRate(%d)", sample_rate_hz); |
204 audio_device_buffer_->SetPlayoutSampleRate(sample_rate_hz); | 204 audio_device_buffer_->SetPlayoutSampleRate(sample_rate_hz); |
205 const int channels = audio_parameters_.channels(); | 205 const size_t channels = audio_parameters_.channels(); |
206 ALOGD("SetPlayoutChannels(%d)", channels); | 206 ALOGD("SetPlayoutChannels(%" PRIuS ")", channels); |
207 audio_device_buffer_->SetPlayoutChannels(channels); | 207 audio_device_buffer_->SetPlayoutChannels(channels); |
208 } | 208 } |
209 | 209 |
210 void JNICALL AudioTrackJni::CacheDirectBufferAddress( | 210 void JNICALL AudioTrackJni::CacheDirectBufferAddress( |
211 JNIEnv* env, jobject obj, jobject byte_buffer, jlong nativeAudioTrack) { | 211 JNIEnv* env, jobject obj, jobject byte_buffer, jlong nativeAudioTrack) { |
212 webrtc::AudioTrackJni* this_object = | 212 webrtc::AudioTrackJni* this_object = |
213 reinterpret_cast<webrtc::AudioTrackJni*> (nativeAudioTrack); | 213 reinterpret_cast<webrtc::AudioTrackJni*> (nativeAudioTrack); |
214 this_object->OnCacheDirectBufferAddress(env, byte_buffer); | 214 this_object->OnCacheDirectBufferAddress(env, byte_buffer); |
215 } | 215 } |
216 | 216 |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
251 return; | 251 return; |
252 } | 252 } |
253 RTC_DCHECK_EQ(static_cast<size_t>(samples), frames_per_buffer_); | 253 RTC_DCHECK_EQ(static_cast<size_t>(samples), frames_per_buffer_); |
254 // Copy decoded data into common byte buffer to ensure that it can be | 254 // Copy decoded data into common byte buffer to ensure that it can be |
255 // written to the Java based audio track. | 255 // written to the Java based audio track. |
256 samples = audio_device_buffer_->GetPlayoutData(direct_buffer_address_); | 256 samples = audio_device_buffer_->GetPlayoutData(direct_buffer_address_); |
257 RTC_DCHECK_EQ(length, kBytesPerFrame * samples); | 257 RTC_DCHECK_EQ(length, kBytesPerFrame * samples); |
258 } | 258 } |
259 | 259 |
260 } // namespace webrtc | 260 } // namespace webrtc |
OLD | NEW |