| 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 <iostream> | 10 #include <iostream> |
| (...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 165 return -1; | 165 return -1; |
| 166 } | 166 } |
| 167 | 167 |
| 168 int32_t FileAudioDevice::InitRecording() { | 168 int32_t FileAudioDevice::InitRecording() { |
| 169 CriticalSectionScoped lock(&_critSect); | 169 CriticalSectionScoped lock(&_critSect); |
| 170 | 170 |
| 171 if (_recording) { | 171 if (_recording) { |
| 172 return -1; | 172 return -1; |
| 173 } | 173 } |
| 174 | 174 |
| 175 _recordingFramesIn10MS = static_cast<uint32_t>(kRecordingFixedSampleRate/100); | 175 _recordingFramesIn10MS = static_cast<size_t>(kRecordingFixedSampleRate / 100); |
| 176 | 176 |
| 177 if (_ptrAudioBuffer) { | 177 if (_ptrAudioBuffer) { |
| 178 _ptrAudioBuffer->SetRecordingSampleRate(kRecordingFixedSampleRate); | 178 _ptrAudioBuffer->SetRecordingSampleRate(kRecordingFixedSampleRate); |
| 179 _ptrAudioBuffer->SetRecordingChannels(kRecordingNumChannels); | 179 _ptrAudioBuffer->SetRecordingChannels(kRecordingNumChannels); |
| 180 } | 180 } |
| 181 return 0; | 181 return 0; |
| 182 } | 182 } |
| 183 | 183 |
| 184 bool FileAudioDevice::RecordingIsInitialized() const { | 184 bool FileAudioDevice::RecordingIsInitialized() const { |
| 185 return true; | 185 return true; |
| 186 } | 186 } |
| 187 | 187 |
| 188 int32_t FileAudioDevice::StartPlayout() { | 188 int32_t FileAudioDevice::StartPlayout() { |
| 189 if (_playing) { | 189 if (_playing) { |
| 190 return 0; | 190 return 0; |
| 191 } | 191 } |
| 192 | 192 |
| 193 _playoutFramesIn10MS = static_cast<uint32_t>(kPlayoutFixedSampleRate/100); | 193 _playoutFramesIn10MS = static_cast<size_t>(kPlayoutFixedSampleRate / 100); |
| 194 _playing = true; | 194 _playing = true; |
| 195 _playoutFramesLeft = 0; | 195 _playoutFramesLeft = 0; |
| 196 | 196 |
| 197 if (!_playoutBuffer) { | 197 if (!_playoutBuffer) { |
| 198 _playoutBuffer = new int8_t[2 * | 198 _playoutBuffer = new int8_t[2 * |
| 199 kPlayoutNumChannels * | 199 kPlayoutNumChannels * |
| 200 kPlayoutFixedSampleRate/100]; | 200 kPlayoutFixedSampleRate/100]; |
| 201 } | 201 } |
| 202 if (!_playoutBuffer) { | 202 if (!_playoutBuffer) { |
| 203 _playing = false; | 203 _playing = false; |
| (...skipping 338 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 542 _critSect.Enter(); | 542 _critSect.Enter(); |
| 543 } | 543 } |
| 544 } | 544 } |
| 545 | 545 |
| 546 _critSect.Leave(); | 546 _critSect.Leave(); |
| 547 SleepMs(10 - (_clock->CurrentNtpInMilliseconds() - currentTime)); | 547 SleepMs(10 - (_clock->CurrentNtpInMilliseconds() - currentTime)); |
| 548 return true; | 548 return true; |
| 549 } | 549 } |
| 550 | 550 |
| 551 } // namespace webrtc | 551 } // namespace webrtc |
| OLD | NEW |