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