| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2015 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 #ifndef WEBRTC_COMMON_AUDIO_AUDIO_RING_BUFFER_H_ | 10 #ifndef WEBRTC_COMMON_AUDIO_AUDIO_RING_BUFFER_H_ |
| 11 #define WEBRTC_COMMON_AUDIO_AUDIO_RING_BUFFER_H_ | 11 #define WEBRTC_COMMON_AUDIO_AUDIO_RING_BUFFER_H_ |
| 12 | 12 |
| 13 #include <stddef.h> | 13 #include <stddef.h> |
| 14 |
| 15 #include <memory> |
| 14 #include <vector> | 16 #include <vector> |
| 15 | 17 |
| 16 struct RingBuffer; | 18 struct RingBuffer; |
| 17 | 19 |
| 18 namespace webrtc { | 20 namespace webrtc { |
| 19 | 21 |
| 20 // A ring buffer tailored for float deinterleaved audio. Any operation that | 22 // A ring buffer tailored for float deinterleaved audio. Any operation that |
| 21 // cannot be performed as requested will cause a crash (e.g. insufficient data | 23 // cannot be performed as requested will cause a crash (e.g. insufficient data |
| 22 // in the buffer to fulfill a read request.) | 24 // in the buffer to fulfill a read request.) |
| 23 class AudioRingBuffer final { | 25 class AudioRingBuffer final { |
| (...skipping 22 matching lines...) Expand all Loading... |
| 46 void MoveReadPositionBackward(size_t frames); | 48 void MoveReadPositionBackward(size_t frames); |
| 47 | 49 |
| 48 private: | 50 private: |
| 49 // TODO(kwiberg): Use std::vector<std::unique_ptr<RingBuffer>> instead. | 51 // TODO(kwiberg): Use std::vector<std::unique_ptr<RingBuffer>> instead. |
| 50 std::vector<RingBuffer*> buffers_; | 52 std::vector<RingBuffer*> buffers_; |
| 51 }; | 53 }; |
| 52 | 54 |
| 53 } // namespace webrtc | 55 } // namespace webrtc |
| 54 | 56 |
| 55 #endif // WEBRTC_COMMON_AUDIO_AUDIO_RING_BUFFER_H_ | 57 #endif // WEBRTC_COMMON_AUDIO_AUDIO_RING_BUFFER_H_ |
| OLD | NEW |