| 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 899 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 910 OSStatus result = | 910 OSStatus result = |
| 911 AudioUnitGetProperty(_auVoiceProcessing, kAudioUnitProperty_Latency, | 911 AudioUnitGetProperty(_auVoiceProcessing, kAudioUnitProperty_Latency, |
| 912 kAudioUnitScope_Global, 0, &f64, &size); | 912 kAudioUnitScope_Global, 0, &f64, &size); |
| 913 if (0 != result) { | 913 if (0 != result) { |
| 914 LOG_F(LS_ERROR) << "AU latency error: " << result; | 914 LOG_F(LS_ERROR) << "AU latency error: " << result; |
| 915 } | 915 } |
| 916 assert(f64 >= 0); | 916 assert(f64 >= 0); |
| 917 totalDelaySeconds += f64; | 917 totalDelaySeconds += f64; |
| 918 | 918 |
| 919 // To ms | 919 // To ms |
| 920 _playoutDelay = static_cast<uint32_t>(totalDelaySeconds / 1000); | 920 _playoutDelay = static_cast<uint32_t>(totalDelaySeconds * 1000); |
| 921 | 921 |
| 922 // Reset counter | 922 // Reset counter |
| 923 _playoutDelayMeasurementCounter = 0; | 923 _playoutDelayMeasurementCounter = 0; |
| 924 } | 924 } |
| 925 | 925 |
| 926 // todo: Add playout buffer? | 926 // todo: Add playout buffer? |
| 927 } | 927 } |
| 928 | 928 |
| 929 void AudioDeviceIOS::UpdateRecordingDelay() { | 929 void AudioDeviceIOS::UpdateRecordingDelay() { |
| 930 ++_recordingDelayMeasurementCounter; | 930 ++_recordingDelayMeasurementCounter; |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1045 // Device Buffer? | 1045 // Device Buffer? |
| 1046 timespec t; | 1046 timespec t; |
| 1047 t.tv_sec = 0; | 1047 t.tv_sec = 0; |
| 1048 t.tv_nsec = 5 * 1000 * 1000; | 1048 t.tv_nsec = 5 * 1000 * 1000; |
| 1049 nanosleep(&t, nullptr); | 1049 nanosleep(&t, nullptr); |
| 1050 } | 1050 } |
| 1051 return true; | 1051 return true; |
| 1052 } | 1052 } |
| 1053 | 1053 |
| 1054 } // namespace webrtc | 1054 } // namespace webrtc |
| OLD | NEW |