OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2014 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2014 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 #include "webrtc/base/platform_thread.h" | 10 #include "webrtc/base/platform_thread.h" |
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
166 _recordingFramesIn10MS = static_cast<size_t>(kRecordingFixedSampleRate / 100); | 166 _recordingFramesIn10MS = static_cast<size_t>(kRecordingFixedSampleRate / 100); |
167 | 167 |
168 if (_ptrAudioBuffer) { | 168 if (_ptrAudioBuffer) { |
169 _ptrAudioBuffer->SetRecordingSampleRate(kRecordingFixedSampleRate); | 169 _ptrAudioBuffer->SetRecordingSampleRate(kRecordingFixedSampleRate); |
170 _ptrAudioBuffer->SetRecordingChannels(kRecordingNumChannels); | 170 _ptrAudioBuffer->SetRecordingChannels(kRecordingNumChannels); |
171 } | 171 } |
172 return 0; | 172 return 0; |
173 } | 173 } |
174 | 174 |
175 bool FileAudioDevice::RecordingIsInitialized() const { | 175 bool FileAudioDevice::RecordingIsInitialized() const { |
176 return true; | 176 return _recordingFramesIn10MS != 0; |
177 } | 177 } |
178 | 178 |
179 int32_t FileAudioDevice::StartPlayout() { | 179 int32_t FileAudioDevice::StartPlayout() { |
180 if (_playing) { | 180 if (_playing) { |
181 return 0; | 181 return 0; |
182 } | 182 } |
183 | 183 |
184 _playoutFramesIn10MS = static_cast<size_t>(kPlayoutFixedSampleRate / 100); | 184 _playoutFramesIn10MS = static_cast<size_t>(kPlayoutFixedSampleRate / 100); |
185 _playing = true; | 185 _playing = true; |
186 _playoutFramesLeft = 0; | 186 _playoutFramesLeft = 0; |
(...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
524 | 524 |
525 uint64_t deltaTimeMillis = _clock->CurrentNtpInMilliseconds() - currentTime; | 525 uint64_t deltaTimeMillis = _clock->CurrentNtpInMilliseconds() - currentTime; |
526 if(deltaTimeMillis < 10) { | 526 if(deltaTimeMillis < 10) { |
527 SleepMs(10 - deltaTimeMillis); | 527 SleepMs(10 - deltaTimeMillis); |
528 } | 528 } |
529 | 529 |
530 return true; | 530 return true; |
531 } | 531 } |
532 | 532 |
533 } // namespace webrtc | 533 } // namespace webrtc |
OLD | NEW |