OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2012 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 389 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
400 kFixedRecordDelayEstimate); | 400 kFixedRecordDelayEstimate); |
401 return noErr; | 401 return noErr; |
402 } | 402 } |
403 | 403 |
404 OSStatus AudioDeviceIOS::OnGetPlayoutData(AudioUnitRenderActionFlags* flags, | 404 OSStatus AudioDeviceIOS::OnGetPlayoutData(AudioUnitRenderActionFlags* flags, |
405 const AudioTimeStamp* time_stamp, | 405 const AudioTimeStamp* time_stamp, |
406 UInt32 bus_number, | 406 UInt32 bus_number, |
407 UInt32 num_frames, | 407 UInt32 num_frames, |
408 AudioBufferList* io_data) { | 408 AudioBufferList* io_data) { |
409 // Verify 16-bit, noninterleaved mono PCM signal format. | 409 // Verify 16-bit, noninterleaved mono PCM signal format. |
410 RTC_DCHECK_EQ(1u, io_data->mNumberBuffers); | 410 RTC_DCHECK_EQ(1, io_data->mNumberBuffers); |
411 AudioBuffer* audio_buffer = &io_data->mBuffers[0]; | 411 AudioBuffer* audio_buffer = &io_data->mBuffers[0]; |
412 RTC_DCHECK_EQ(1u, audio_buffer->mNumberChannels); | 412 RTC_DCHECK_EQ(1, audio_buffer->mNumberChannels); |
413 // Get pointer to internal audio buffer to which new audio data shall be | 413 // Get pointer to internal audio buffer to which new audio data shall be |
414 // written. | 414 // written. |
415 const size_t size_in_bytes = audio_buffer->mDataByteSize; | 415 const size_t size_in_bytes = audio_buffer->mDataByteSize; |
416 RTC_CHECK_EQ(size_in_bytes / VoiceProcessingAudioUnit::kBytesPerSample, | 416 RTC_CHECK_EQ(size_in_bytes / VoiceProcessingAudioUnit::kBytesPerSample, |
417 num_frames); | 417 num_frames); |
418 int8_t* destination = reinterpret_cast<int8_t*>(audio_buffer->mData); | 418 int8_t* destination = reinterpret_cast<int8_t*>(audio_buffer->mData); |
419 // Produce silence and give audio unit a hint about it if playout is not | 419 // Produce silence and give audio unit a hint about it if playout is not |
420 // activated. | 420 // activated. |
421 if (!rtc::AtomicOps::AcquireLoad(&playing_)) { | 421 if (!rtc::AtomicOps::AcquireLoad(&playing_)) { |
422 *flags |= kAudioUnitRenderAction_OutputIsSilence; | 422 *flags |= kAudioUnitRenderAction_OutputIsSilence; |
(...skipping 411 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
834 | 834 |
835 // All I/O should be stopped or paused prior to deactivating the audio | 835 // All I/O should be stopped or paused prior to deactivating the audio |
836 // session, hence we deactivate as last action. | 836 // session, hence we deactivate as last action. |
837 [session lockForConfiguration]; | 837 [session lockForConfiguration]; |
838 UnconfigureAudioSession(); | 838 UnconfigureAudioSession(); |
839 [session endWebRTCSession:nil]; | 839 [session endWebRTCSession:nil]; |
840 [session unlockForConfiguration]; | 840 [session unlockForConfiguration]; |
841 } | 841 } |
842 | 842 |
843 } // namespace webrtc | 843 } // namespace webrtc |
OLD | NEW |