From 4d23447b1548fa31e54f92754661af0740008b3d Mon Sep 17 00:00:00 2001 From: peah Date: Sun, 10 Apr 2016 22:51:07 -0700 Subject: [PATCH] Moved struct definition to the header file for the ring buffer. This is done in order to allow the ringbuffer to be recorded using protobufs. The actual recording will be added in other CLs. BUG=webrtc:5724 Review URL: https://codereview.webrtc.org/1862513007 Cr-Commit-Position: refs/heads/master@{#12308} --- webrtc/common_audio/ring_buffer.c | 14 -------------- webrtc/common_audio/ring_buffer.h | 11 ++++++++++- 2 files changed, 10 insertions(+), 15 deletions(-) diff --git a/webrtc/common_audio/ring_buffer.c b/webrtc/common_audio/ring_buffer.c index 60fb5dff20..5fc653bd57 100644 --- a/webrtc/common_audio/ring_buffer.c +++ b/webrtc/common_audio/ring_buffer.c @@ -17,20 +17,6 @@ #include #include -enum Wrap { - SAME_WRAP, - DIFF_WRAP -}; - -struct RingBuffer { - size_t read_pos; - size_t write_pos; - size_t element_count; - size_t element_size; - enum Wrap rw_wrap; - char* data; -}; - // Get address of region(s) from which we can read data. // If the region is contiguous, |data_ptr_bytes_2| will be zero. // If non-contiguous, |data_ptr_bytes_2| will be the size in bytes of the second diff --git a/webrtc/common_audio/ring_buffer.h b/webrtc/common_audio/ring_buffer.h index 4125c48d01..74951a8b2d 100644 --- a/webrtc/common_audio/ring_buffer.h +++ b/webrtc/common_audio/ring_buffer.h @@ -20,7 +20,16 @@ extern "C" { #include // size_t -typedef struct RingBuffer RingBuffer; +enum Wrap { SAME_WRAP, DIFF_WRAP }; + +typedef struct RingBuffer { + size_t read_pos; + size_t write_pos; + size_t element_count; + size_t element_size; + enum Wrap rw_wrap; + char* data; +} RingBuffer; // Creates and initializes the buffer. Returns NULL on failure. RingBuffer* WebRtc_CreateBuffer(size_t element_count, size_t element_size);