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 |
11 #ifndef WEBRTC_MODULES_AUDIO_DEVICE_AUDIO_DEVICE_BUFFER_H_ | 11 #ifndef WEBRTC_MODULES_AUDIO_DEVICE_AUDIO_DEVICE_BUFFER_H_ |
12 #define WEBRTC_MODULES_AUDIO_DEVICE_AUDIO_DEVICE_BUFFER_H_ | 12 #define WEBRTC_MODULES_AUDIO_DEVICE_AUDIO_DEVICE_BUFFER_H_ |
13 | 13 |
14 #include "webrtc/base/buffer.h" | 14 #include "webrtc/base/buffer.h" |
15 #include "webrtc/base/criticalsection.h" | 15 #include "webrtc/base/criticalsection.h" |
16 #include "webrtc/base/task_queue.h" | 16 #include "webrtc/base/task_queue.h" |
17 #include "webrtc/base/thread_checker.h" | 17 #include "webrtc/base/thread_checker.h" |
18 #include "webrtc/modules/audio_device/include/audio_device.h" | 18 #include "webrtc/modules/audio_device/include/audio_device.h" |
| 19 #include "webrtc/system_wrappers/include/file_wrapper.h" |
19 #include "webrtc/typedefs.h" | 20 #include "webrtc/typedefs.h" |
20 | 21 |
21 namespace webrtc { | 22 namespace webrtc { |
22 // Delta times between two successive playout callbacks are limited to this | 23 // Delta times between two successive playout callbacks are limited to this |
23 // value before added to an internal array. | 24 // value before added to an internal array. |
24 const size_t kMaxDeltaTimeInMs = 500; | 25 const size_t kMaxDeltaTimeInMs = 500; |
25 // TODO(henrika): remove when no longer used by external client. | 26 // TODO(henrika): remove when no longer used by external client. |
26 const size_t kMaxBufferSizeBytes = 3840; // 10ms in stereo @ 96kHz | 27 const size_t kMaxBufferSizeBytes = 3840; // 10ms in stereo @ 96kHz |
27 | 28 |
28 class AudioDeviceObserver; | 29 class AudioDeviceObserver; |
29 | 30 |
30 class AudioDeviceBuffer { | 31 class AudioDeviceBuffer { |
31 public: | 32 public: |
32 AudioDeviceBuffer(); | 33 AudioDeviceBuffer(); |
33 virtual ~AudioDeviceBuffer(); | 34 virtual ~AudioDeviceBuffer(); |
34 | 35 |
35 void SetId(uint32_t id) {} | 36 void SetId(uint32_t id) {}; |
36 int32_t RegisterAudioCallback(AudioTransport* audio_callback); | 37 int32_t RegisterAudioCallback(AudioTransport* audio_callback); |
37 | 38 |
38 int32_t InitPlayout(); | 39 int32_t InitPlayout(); |
39 int32_t InitRecording(); | 40 int32_t InitRecording(); |
40 | 41 |
41 int32_t SetRecordingSampleRate(uint32_t fsHz); | 42 int32_t SetRecordingSampleRate(uint32_t fsHz); |
42 int32_t SetPlayoutSampleRate(uint32_t fsHz); | 43 int32_t SetPlayoutSampleRate(uint32_t fsHz); |
43 int32_t RecordingSampleRate() const; | 44 int32_t RecordingSampleRate() const; |
44 int32_t PlayoutSampleRate() const; | 45 int32_t PlayoutSampleRate() const; |
45 | 46 |
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
199 // all level measurements since the last log has been exactly zero. | 200 // all level measurements since the last log has been exactly zero. |
200 // In other words: this counter is incremented only if 20 measurements | 201 // In other words: this counter is incremented only if 20 measurements |
201 // (two per second) in a row equals zero. The member is only incremented on | 202 // (two per second) in a row equals zero. The member is only incremented on |
202 // the task queue and max once every 10th second. | 203 // the task queue and max once every 10th second. |
203 size_t num_rec_level_is_zero_; | 204 size_t num_rec_level_is_zero_; |
204 }; | 205 }; |
205 | 206 |
206 } // namespace webrtc | 207 } // namespace webrtc |
207 | 208 |
208 #endif // WEBRTC_MODULES_AUDIO_DEVICE_AUDIO_DEVICE_BUFFER_H_ | 209 #endif // WEBRTC_MODULES_AUDIO_DEVICE_AUDIO_DEVICE_BUFFER_H_ |
OLD | NEW |