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> | |
11 #include "webrtc/modules/audio_device/dummy/file_audio_device.h" | 10 #include "webrtc/modules/audio_device/dummy/file_audio_device.h" |
12 #include "webrtc/system_wrappers/include/sleep.h" | 11 #include "webrtc/system_wrappers/include/sleep.h" |
13 #include "webrtc/system_wrappers/include/thread_wrapper.h" | 12 #include "webrtc/system_wrappers/include/thread_wrapper.h" |
14 | 13 |
15 namespace webrtc { | 14 namespace webrtc { |
16 | 15 |
17 int kRecordingFixedSampleRate = 48000; | 16 const int kRecordingFixedSampleRate = 48000; |
18 int kRecordingNumChannels = 2; | 17 const int kRecordingNumChannels = 2; |
19 int kPlayoutFixedSampleRate = 48000; | 18 const int kPlayoutFixedSampleRate = 48000; |
20 int kPlayoutNumChannels = 2; | 19 const int kPlayoutNumChannels = 2; |
21 int kPlayoutBufferSize = kPlayoutFixedSampleRate / 100 | 20 const int kPlayoutBufferSize = kPlayoutFixedSampleRate / 100 |
22 * kPlayoutNumChannels * 2; | 21 * kPlayoutNumChannels * 2; |
23 int kRecordingBufferSize = kRecordingFixedSampleRate / 100 | 22 const int kRecordingBufferSize = kRecordingFixedSampleRate / 100 |
24 * kRecordingNumChannels * 2; | 23 * kRecordingNumChannels * 2; |
25 | 24 |
26 FileAudioDevice::FileAudioDevice(const int32_t id, | 25 FileAudioDevice::FileAudioDevice(const int32_t id, |
27 const char* inputFilename, | 26 const char* inputFilename, |
28 const char* outputFilename): | 27 const char* outputFilename): |
29 _ptrAudioBuffer(NULL), | 28 _ptrAudioBuffer(NULL), |
30 _recordingBuffer(NULL), | 29 _recordingBuffer(NULL), |
31 _playoutBuffer(NULL), | 30 _playoutBuffer(NULL), |
32 _recordingFramesLeft(0), | 31 _recordingFramesLeft(0), |
33 _playoutFramesLeft(0), | 32 _playoutFramesLeft(0), |
34 _critSect(*CriticalSectionWrapper::CreateCriticalSection()), | 33 _critSect(*CriticalSectionWrapper::CreateCriticalSection()), |
(...skipping 507 matching lines...) Loading... |
542 _critSect.Enter(); | 541 _critSect.Enter(); |
543 } | 542 } |
544 } | 543 } |
545 | 544 |
546 _critSect.Leave(); | 545 _critSect.Leave(); |
547 SleepMs(10 - (_clock->CurrentNtpInMilliseconds() - currentTime)); | 546 SleepMs(10 - (_clock->CurrentNtpInMilliseconds() - currentTime)); |
548 return true; | 547 return true; |
549 } | 548 } |
550 | 549 |
551 } // namespace webrtc | 550 } // namespace webrtc |
OLD | NEW |