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_CODING_NETEQ_SYNC_BUFFER_H_ | 11 #ifndef WEBRTC_MODULES_AUDIO_CODING_NETEQ_SYNC_BUFFER_H_ |
12 #define WEBRTC_MODULES_AUDIO_CODING_NETEQ_SYNC_BUFFER_H_ | 12 #define WEBRTC_MODULES_AUDIO_CODING_NETEQ_SYNC_BUFFER_H_ |
13 | 13 |
14 #include "webrtc/base/constructormagic.h" | 14 #include "webrtc/base/constructormagic.h" |
15 #include "webrtc/modules/audio_coding/neteq/audio_multi_vector.h" | 15 #include "webrtc/modules/audio_coding/neteq/audio_multi_vector.h" |
16 #include "webrtc/modules/include/module_common_types.h" | 16 #include "webrtc/modules/include/module_common_types.h" |
17 #include "webrtc/typedefs.h" | 17 #include "webrtc/typedefs.h" |
18 | 18 |
19 namespace webrtc { | 19 namespace webrtc { |
20 | 20 |
21 class SyncBuffer : public AudioMultiVector { | 21 class SyncBuffer : public AudioMultiVector { |
22 public: | 22 public: |
23 SyncBuffer(size_t channels, size_t length) | 23 SyncBuffer(size_t channels, size_t length) |
24 : AudioMultiVector(channels, length), | 24 : AudioMultiVector(channels, length), |
25 next_index_(length), | 25 next_index_(length), |
26 end_timestamp_(0), | 26 end_timestamp_(0), |
27 dtmf_index_(0) {} | 27 dtmf_index_(0) {} |
28 | 28 |
29 // Returns the number of samples yet to play out form the buffer. | 29 // Returns the number of samples yet to play out from the buffer. |
hlundin-webrtc
2017/04/26 11:41:31
Totally unrelated typo fix.
| |
30 size_t FutureLength() const; | 30 size_t FutureLength() const; |
31 | 31 |
32 // Adds the contents of |append_this| to the back of the SyncBuffer. Removes | 32 // Adds the contents of |append_this| to the back of the SyncBuffer. Removes |
33 // the same number of samples from the beginning of the SyncBuffer, to | 33 // the same number of samples from the beginning of the SyncBuffer, to |
34 // maintain a constant buffer size. The |next_index_| is updated to reflect | 34 // maintain a constant buffer size. The |next_index_| is updated to reflect |
35 // the move of the beginning of "future" data. | 35 // the move of the beginning of "future" data. |
36 void PushBack(const AudioMultiVector& append_this) override; | 36 void PushBack(const AudioMultiVector& append_this) override; |
37 | 37 |
38 // Adds |length| zeros to the beginning of each channel. Removes | 38 // Adds |length| zeros to the beginning of each channel. Removes |
39 // the same number of samples from the end of the SyncBuffer, to | 39 // the same number of samples from the end of the SyncBuffer, to |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
92 private: | 92 private: |
93 size_t next_index_; | 93 size_t next_index_; |
94 uint32_t end_timestamp_; // The timestamp of the last sample in the buffer. | 94 uint32_t end_timestamp_; // The timestamp of the last sample in the buffer. |
95 size_t dtmf_index_; // Index to the first non-DTMF sample in the buffer. | 95 size_t dtmf_index_; // Index to the first non-DTMF sample in the buffer. |
96 | 96 |
97 RTC_DISALLOW_COPY_AND_ASSIGN(SyncBuffer); | 97 RTC_DISALLOW_COPY_AND_ASSIGN(SyncBuffer); |
98 }; | 98 }; |
99 | 99 |
100 } // namespace webrtc | 100 } // namespace webrtc |
101 #endif // WEBRTC_MODULES_AUDIO_CODING_NETEQ_SYNC_BUFFER_H_ | 101 #endif // WEBRTC_MODULES_AUDIO_CODING_NETEQ_SYNC_BUFFER_H_ |
OLD | NEW |