OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2013 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_FINE_AUDIO_BUFFER_H_ | 11 #ifndef WEBRTC_MODULES_AUDIO_DEVICE_FINE_AUDIO_BUFFER_H_ |
12 #define WEBRTC_MODULES_AUDIO_DEVICE_FINE_AUDIO_BUFFER_H_ | 12 #define WEBRTC_MODULES_AUDIO_DEVICE_FINE_AUDIO_BUFFER_H_ |
13 | 13 |
14 #include <memory> | 14 #include <memory> |
15 | 15 |
| 16 #include "webrtc/base/buffer.h" |
16 #include "webrtc/typedefs.h" | 17 #include "webrtc/typedefs.h" |
17 | 18 |
18 namespace webrtc { | 19 namespace webrtc { |
19 | 20 |
20 class AudioDeviceBuffer; | 21 class AudioDeviceBuffer; |
21 | 22 |
22 // FineAudioBuffer takes an AudioDeviceBuffer (ADB) which deals with audio data | 23 // FineAudioBuffer takes an AudioDeviceBuffer (ADB) which deals with audio data |
23 // corresponding to 10ms of data. It then allows for this data to be pulled in | 24 // corresponding to 10ms of data. It then allows for this data to be pulled in |
24 // a finer or coarser granularity. I.e. interacting with this class instead of | 25 // a finer or coarser granularity. I.e. interacting with this class instead of |
25 // directly with the AudioDeviceBuffer one can ask for any number of audio data | 26 // directly with the AudioDeviceBuffer one can ask for any number of audio data |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 // Number of audio bytes per 10ms. | 88 // Number of audio bytes per 10ms. |
88 const size_t bytes_per_10_ms_; | 89 const size_t bytes_per_10_ms_; |
89 // Storage for output samples that are not yet asked for. | 90 // Storage for output samples that are not yet asked for. |
90 std::unique_ptr<int8_t[]> playout_cache_buffer_; | 91 std::unique_ptr<int8_t[]> playout_cache_buffer_; |
91 // Location of first unread output sample. | 92 // Location of first unread output sample. |
92 size_t playout_cached_buffer_start_; | 93 size_t playout_cached_buffer_start_; |
93 // Number of bytes stored in output (contain samples to be played out) cache. | 94 // Number of bytes stored in output (contain samples to be played out) cache. |
94 size_t playout_cached_bytes_; | 95 size_t playout_cached_bytes_; |
95 // Storage for input samples that are about to be delivered to the WebRTC | 96 // Storage for input samples that are about to be delivered to the WebRTC |
96 // ADB or remains from the last successful delivery of a 10ms audio buffer. | 97 // ADB or remains from the last successful delivery of a 10ms audio buffer. |
97 std::unique_ptr<int8_t[]> record_cache_buffer_; | 98 rtc::BufferT<int8_t> record_buffer_; |
98 // Required (max) size in bytes of the |record_cache_buffer_|. | |
99 const size_t required_record_buffer_size_bytes_; | |
100 // Number of bytes in input (contains recorded samples) cache. | |
101 size_t record_cached_bytes_; | |
102 // Read and write pointers used in the buffering scheme on the recording side. | |
103 size_t record_read_pos_; | |
104 size_t record_write_pos_; | |
105 }; | 99 }; |
106 | 100 |
107 } // namespace webrtc | 101 } // namespace webrtc |
108 | 102 |
109 #endif // WEBRTC_MODULES_AUDIO_DEVICE_FINE_AUDIO_BUFFER_H_ | 103 #endif // WEBRTC_MODULES_AUDIO_DEVICE_FINE_AUDIO_BUFFER_H_ |
OLD | NEW |