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 | 10 |
11 #ifndef WEBRTC_AUDIO_DEVICE_FILE_AUDIO_DEVICE_H | 11 #ifndef WEBRTC_AUDIO_DEVICE_FILE_AUDIO_DEVICE_H |
12 #define WEBRTC_AUDIO_DEVICE_FILE_AUDIO_DEVICE_H | 12 #define WEBRTC_AUDIO_DEVICE_FILE_AUDIO_DEVICE_H |
13 | 13 |
14 #include <stdio.h> | 14 #include <stdio.h> |
15 | 15 |
16 #include <memory> | 16 #include <memory> |
17 #include <string> | 17 #include <string> |
18 | 18 |
| 19 #include "webrtc/base/criticalsection.h" |
19 #include "webrtc/base/timeutils.h" | 20 #include "webrtc/base/timeutils.h" |
20 #include "webrtc/modules/audio_device/audio_device_generic.h" | 21 #include "webrtc/modules/audio_device/audio_device_generic.h" |
21 #include "webrtc/system_wrappers/include/critical_section_wrapper.h" | |
22 #include "webrtc/system_wrappers/include/file_wrapper.h" | 22 #include "webrtc/system_wrappers/include/file_wrapper.h" |
23 | 23 |
24 namespace rtc { | 24 namespace rtc { |
25 class PlatformThread; | 25 class PlatformThread; |
26 } // namespace rtc | 26 } // namespace rtc |
27 | 27 |
28 namespace webrtc { | 28 namespace webrtc { |
29 class EventWrapper; | 29 class EventWrapper; |
30 | 30 |
31 // This is a fake audio device which plays audio from a file as its microphone | 31 // This is a fake audio device which plays audio from a file as its microphone |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
169 bool PlayThreadProcess(); | 169 bool PlayThreadProcess(); |
170 | 170 |
171 int32_t _playout_index; | 171 int32_t _playout_index; |
172 int32_t _record_index; | 172 int32_t _record_index; |
173 AudioDeviceModule::BufferType _playBufType; | 173 AudioDeviceModule::BufferType _playBufType; |
174 AudioDeviceBuffer* _ptrAudioBuffer; | 174 AudioDeviceBuffer* _ptrAudioBuffer; |
175 int8_t* _recordingBuffer; // In bytes. | 175 int8_t* _recordingBuffer; // In bytes. |
176 int8_t* _playoutBuffer; // In bytes. | 176 int8_t* _playoutBuffer; // In bytes. |
177 uint32_t _recordingFramesLeft; | 177 uint32_t _recordingFramesLeft; |
178 uint32_t _playoutFramesLeft; | 178 uint32_t _playoutFramesLeft; |
179 CriticalSectionWrapper& _critSect; | 179 rtc::CriticalSection _critSect; |
180 | 180 |
181 size_t _recordingBufferSizeIn10MS; | 181 size_t _recordingBufferSizeIn10MS; |
182 size_t _recordingFramesIn10MS; | 182 size_t _recordingFramesIn10MS; |
183 size_t _playoutFramesIn10MS; | 183 size_t _playoutFramesIn10MS; |
184 | 184 |
185 // TODO(pbos): Make plain members instead of pointers and stop resetting them. | 185 // TODO(pbos): Make plain members instead of pointers and stop resetting them. |
186 std::unique_ptr<rtc::PlatformThread> _ptrThreadRec; | 186 std::unique_ptr<rtc::PlatformThread> _ptrThreadRec; |
187 std::unique_ptr<rtc::PlatformThread> _ptrThreadPlay; | 187 std::unique_ptr<rtc::PlatformThread> _ptrThreadPlay; |
188 | 188 |
189 bool _playing; | 189 bool _playing; |
190 bool _recording; | 190 bool _recording; |
191 int64_t _lastCallPlayoutMillis; | 191 int64_t _lastCallPlayoutMillis; |
192 int64_t _lastCallRecordMillis; | 192 int64_t _lastCallRecordMillis; |
193 | 193 |
194 FileWrapper& _outputFile; | 194 FileWrapper& _outputFile; |
195 FileWrapper& _inputFile; | 195 FileWrapper& _inputFile; |
196 std::string _outputFilename; | 196 std::string _outputFilename; |
197 std::string _inputFilename; | 197 std::string _inputFilename; |
198 }; | 198 }; |
199 | 199 |
200 } // namespace webrtc | 200 } // namespace webrtc |
201 | 201 |
202 #endif // WEBRTC_AUDIO_DEVICE_FILE_AUDIO_DEVICE_H | 202 #endif // WEBRTC_AUDIO_DEVICE_FILE_AUDIO_DEVICE_H |
OLD | NEW |