OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2011 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2011 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 // A ring buffer to hold arbitrary data. Provides no thread safety. Unless | 11 // A ring buffer to hold arbitrary data. Provides no thread safety. Unless |
12 // otherwise specified, functions return 0 on success and -1 on error. | 12 // otherwise specified, functions return 0 on success and -1 on error. |
13 | 13 |
14 #include "webrtc/common_audio/ring_buffer.h" | 14 #include "webrtc/modules/audio_processing/utility/ring_buffer.h" |
15 | 15 |
16 #include <stddef.h> // size_t | 16 #include <stddef.h> // size_t |
17 #include <stdlib.h> | 17 #include <stdlib.h> |
18 #include <string.h> | 18 #include <string.h> |
19 | 19 |
20 enum Wrap { | 20 enum Wrap { |
21 SAME_WRAP, | 21 SAME_WRAP, |
22 DIFF_WRAP | 22 DIFF_WRAP |
23 }; | 23 }; |
24 | 24 |
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
238 } | 238 } |
239 } | 239 } |
240 | 240 |
241 size_t WebRtc_available_write(const RingBuffer* self) { | 241 size_t WebRtc_available_write(const RingBuffer* self) { |
242 if (!self) { | 242 if (!self) { |
243 return 0; | 243 return 0; |
244 } | 244 } |
245 | 245 |
246 return self->element_count - WebRtc_available_read(self); | 246 return self->element_count - WebRtc_available_read(self); |
247 } | 247 } |
OLD | NEW |