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 |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 size_t position); | 60 size_t position); |
61 | 61 |
62 // Same as the above method, but where all of |insert_this| is written (with | 62 // Same as the above method, but where all of |insert_this| is written (with |
63 // the same constraints as above, that the SyncBuffer is not extended). | 63 // the same constraints as above, that the SyncBuffer is not extended). |
64 virtual void ReplaceAtIndex(const AudioMultiVector& insert_this, | 64 virtual void ReplaceAtIndex(const AudioMultiVector& insert_this, |
65 size_t position); | 65 size_t position); |
66 | 66 |
67 // Reads |requested_len| samples from each channel and writes them interleaved | 67 // Reads |requested_len| samples from each channel and writes them interleaved |
68 // into |output|. The |next_index_| is updated to point to the sample to read | 68 // into |output|. The |next_index_| is updated to point to the sample to read |
69 // next time. The AudioFrame |output| is first reset, and the |data_|, | 69 // next time. The AudioFrame |output| is first reset, and the |data_|, |
70 // |interleaved_|, |num_channels_|, and |samples_per_channel_| fields are | 70 // |num_channels_|, and |samples_per_channel_| fields are updated. |
71 // updated. | |
72 void GetNextAudioInterleaved(size_t requested_len, AudioFrame* output); | 71 void GetNextAudioInterleaved(size_t requested_len, AudioFrame* output); |
73 | 72 |
74 // Adds |increment| to |end_timestamp_|. | 73 // Adds |increment| to |end_timestamp_|. |
75 void IncreaseEndTimestamp(uint32_t increment); | 74 void IncreaseEndTimestamp(uint32_t increment); |
76 | 75 |
77 // Flushes the buffer. The buffer will contain only zeros after the flush, and | 76 // Flushes the buffer. The buffer will contain only zeros after the flush, and |
78 // |next_index_| will point to the end, like when the buffer was first | 77 // |next_index_| will point to the end, like when the buffer was first |
79 // created. | 78 // created. |
80 void Flush(); | 79 void Flush(); |
81 | 80 |
(...skipping 11 matching lines...) Expand all Loading... |
93 private: | 92 private: |
94 size_t next_index_; | 93 size_t next_index_; |
95 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. |
96 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. |
97 | 96 |
98 RTC_DISALLOW_COPY_AND_ASSIGN(SyncBuffer); | 97 RTC_DISALLOW_COPY_AND_ASSIGN(SyncBuffer); |
99 }; | 98 }; |
100 | 99 |
101 } // namespace webrtc | 100 } // namespace webrtc |
102 #endif // WEBRTC_MODULES_AUDIO_CODING_NETEQ_SYNC_BUFFER_H_ | 101 #endif // WEBRTC_MODULES_AUDIO_CODING_NETEQ_SYNC_BUFFER_H_ |
OLD | NEW |