1 /* 2 * Copyright (c) 2011 The WebRTC project authors. All Rights Reserved. 3 * 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 6 * tree. An additional intellectual property rights grant can be found 7 * in the file PATENTS. All contributing project authors may 8 * be found in the AUTHORS file in the root of the source tree. 9 */ 10 11 /* 12 * Specifies the interface for the AEC generic buffer. 13 */ 14 15 #ifndef WEBRTC_MODULES_AUDIO_PROCESSING_UTILITY_RING_BUFFER_H_ 16 #define WEBRTC_MODULES_AUDIO_PROCESSING_UTILITY_RING_BUFFER_H_ 17 18 // Determines buffer datatype 19 typedef short bufdata_t; 20 21 // Unless otherwise specified, functions return 0 on success and -1 on error 22 int WebRtcApm_CreateBuffer(void **bufInst, int size); 23 int WebRtcApm_InitBuffer(void *bufInst); 24 int WebRtcApm_FreeBuffer(void *bufInst); 25 26 // Returns number of samples read 27 int WebRtcApm_ReadBuffer(void *bufInst, bufdata_t *data, int size); 28 29 // Returns number of samples written 30 int WebRtcApm_WriteBuffer(void *bufInst, const bufdata_t *data, int size); 31 32 // Returns number of samples flushed 33 int WebRtcApm_FlushBuffer(void *bufInst, int size); 34 35 // Returns number of samples stuffed 36 int WebRtcApm_StuffBuffer(void *bufInst, int size); 37 38 // Returns number of samples in buffer 39 int WebRtcApm_get_buffer_size(const void *bufInst); 40 41 #endif // WEBRTC_MODULES_AUDIO_PROCESSING_UTILITY_RING_BUFFER_H_ 42