![]() |
Mixxx
|
#include <stdio.h>#include <stdlib.h>#include <math.h>#include <string.h>#include "util/pa_memorybarrier.h"#include "util/pa_ringbuffer.h"
Go to the source code of this file.
Definition in file pa_ringbuffer.c.
| ring_buffer_size_t PaUtil_AdvanceRingBufferReadIndex | ( | PaUtilRingBuffer * | rbuf, |
| ring_buffer_size_t | elementCount | ||
| ) |
Advance the read index to the next location to be read.
| rbuf | The ring buffer. |
| elementCount | The number of elements to advance. |
Definition at line 188 of file pa_ringbuffer.c.

| ring_buffer_size_t PaUtil_AdvanceRingBufferWriteIndex | ( | PaUtilRingBuffer * | rbuf, |
| ring_buffer_size_t | elementCount | ||
| ) |
Advance the write index to the next location to be written.
| rbuf | The ring buffer. |
| elementCount | The number of elements to advance. |
Definition at line 140 of file pa_ringbuffer.c.

| void PaUtil_FlushRingBuffer | ( | PaUtilRingBuffer * | rbuf | ) |
Reset buffer to empty. Should only be called when buffer is NOT being read or written.
| rbuf | The ring buffer. |
Definition at line 94 of file pa_ringbuffer.c.

| ring_buffer_size_t PaUtil_GetRingBufferReadAvailable | ( | const PaUtilRingBuffer * | rbuf | ) |
Retrieve the number of elements available in the ring buffer for reading.
| rbuf | The ring buffer. |
Definition at line 81 of file pa_ringbuffer.c.

| ring_buffer_size_t PaUtil_GetRingBufferReadRegions | ( | PaUtilRingBuffer * | rbuf, |
| ring_buffer_size_t | elementCount, | ||
| void ** | dataPtr1, | ||
| ring_buffer_size_t * | sizePtr1, | ||
| void ** | dataPtr2, | ||
| ring_buffer_size_t * | sizePtr2 | ||
| ) |
Get address of region(s) from which we can read data.
| rbuf | The ring buffer. |
| elementCount | The number of elements desired. |
| dataPtr1 | The address where the first (or only) region pointer will be stored. |
| sizePtr1 | The address where the first (or only) region length will be stored. |
| dataPtr2 | The address where the second region pointer will be stored if the first region is too small to satisfy elementCount. |
| sizePtr2 | The address where the second region length will be stored if the first region is too small to satisfy elementCount. |
Definition at line 155 of file pa_ringbuffer.c.


| ring_buffer_size_t PaUtil_GetRingBufferWriteAvailable | ( | const PaUtilRingBuffer * | rbuf | ) |
Retrieve the number of elements available in the ring buffer for writing.
| rbuf | The ring buffer. |
Definition at line 87 of file pa_ringbuffer.c.


| ring_buffer_size_t PaUtil_GetRingBufferWriteRegions | ( | PaUtilRingBuffer * | rbuf, |
| ring_buffer_size_t | elementCount, | ||
| void ** | dataPtr1, | ||
| ring_buffer_size_t * | sizePtr1, | ||
| void ** | dataPtr2, | ||
| ring_buffer_size_t * | sizePtr2 | ||
| ) |
Get address of region(s) to which we can write data.
| rbuf | The ring buffer. |
| elementCount | The number of elements desired. |
| dataPtr1 | The address where the first (or only) region pointer will be stored. |
| sizePtr1 | The address where the first (or only) region length will be stored. |
| dataPtr2 | The address where the second region pointer will be stored if the first region is too small to satisfy elementCount. |
| sizePtr2 | The address where the second region length will be stored if the first region is too small to satisfy elementCount. |
Definition at line 105 of file pa_ringbuffer.c.


| ring_buffer_size_t PaUtil_InitializeRingBuffer | ( | PaUtilRingBuffer * | rbuf, |
| ring_buffer_size_t | elementSizeBytes, | ||
| ring_buffer_size_t | elementCount, | ||
| void * | dataPtr | ||
| ) |
Initialize Ring Buffer to empty state ready to have elements written to it.
| rbuf | The ring buffer. |
| elementSizeBytes | The size of a single data element in bytes. |
| elementCount | The number of elements in the buffer (must be a power of 2). |
| dataPtr | A pointer to a previously allocated area where the data will be maintained. It must be elementCount*elementSizeBytes long. |
Definition at line 67 of file pa_ringbuffer.c.


| ring_buffer_size_t PaUtil_ReadRingBuffer | ( | PaUtilRingBuffer * | rbuf, |
| void * | data, | ||
| ring_buffer_size_t | elementCount | ||
| ) |
Read data from the ring buffer.
| rbuf | The ring buffer. |
| data | The address where the data should be stored. |
| elementCount | The number of elements to be read. |
Definition at line 221 of file pa_ringbuffer.c.


| ring_buffer_size_t PaUtil_WriteRingBuffer | ( | PaUtilRingBuffer * | rbuf, |
| const void * | data, | ||
| ring_buffer_size_t | elementCount | ||
| ) |
Write data to the ring buffer.
| rbuf | The ring buffer. |
| data | The address of new data to write to the buffer. |
| elementCount | The number of elements to be written. |
Definition at line 199 of file pa_ringbuffer.c.

