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}
This commit is contained in:
peah 2016-04-10 22:51:07 -07:00 committed by Commit bot
parent 2704512f7b
commit 4d23447b15
2 changed files with 10 additions and 15 deletions

View File

@ -17,20 +17,6 @@
#include <stdlib.h>
#include <string.h>
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

View File

@ -20,7 +20,16 @@ extern "C" {
#include <stddef.h> // 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);