Lines Matching refs:element_count
28 size_t element_count;
37 // region. Returns room available to be read or |element_count|, whichever is
40 size_t element_count,
47 const size_t read_elements = (readable_elements < element_count ?
48 readable_elements : element_count);
49 const size_t margin = buf->element_count - buf->read_pos;
68 RingBuffer* WebRtc_CreateBuffer(size_t element_count, size_t element_size) {
70 if (element_count == 0 || element_size == 0) {
79 self->data = malloc(element_count * element_size);
86 self->element_count = element_count;
99 memset(self->data, 0, self->element_count * self->element_size);
115 size_t element_count) {
130 element_count,
160 size_t element_count) {
170 const size_t write_elements = (free_elements < element_count ? free_elements
171 : element_count);
173 const size_t margin = self->element_count - self->write_pos;
192 int WebRtc_MoveReadPtr(RingBuffer* self, int element_count) {
204 if (element_count > readable_elements) {
205 element_count = readable_elements;
207 if (element_count < -free_elements) {
208 element_count = -free_elements;
211 read_pos += element_count;
212 if (read_pos > (int) self->element_count) {
214 read_pos -= (int) self->element_count;
219 read_pos += (int) self->element_count;
225 return element_count;
237 return self->element_count - self->read_pos + self->write_pos;
246 return self->element_count - WebRtc_available_read(self);