#include <stdlib.h>
#include <string.h>
#include "pv_circular_buffer.h"
Go to the source code of this file.
◆ pv_circular_buffer_delete()
◆ pv_circular_buffer_init()
Constructor for PV_circular_buffer object.
- Parameters
-
capacity | Capacity of the buffer to read and write. |
element_size | Size of each element in the buffer. |
object[out] | Circular buffer object. |
- Returns
- Status Code. Returns PV_CIRCULAR_BUFFER_STATUS_OUT_OF_MEMORY or PV_CIRCULAR_BUFFER_STATUS_INVALID_ARGUMENT on failure.
Definition at line 26 of file pvrecorder/src/pv_circular_buffer.c.
◆ pv_circular_buffer_read()
Reads and copies the elements to the provided buffer.
- Parameters
-
object | Circular buffer object. |
buffer[out] | A pointer to copy the elements into. |
length | The amount to copy to read from the buffer. is not PV_CIRCULAR_BUFFER_STATUS_SUCCESS. |
- Returns
- Returns the total length of frames copied to buffer.
Definition at line 68 of file pvrecorder/src/pv_circular_buffer.c.
◆ pv_circular_buffer_reset()
◆ pv_circular_buffer_status_to_string()
◆ pv_circular_buffer_write()
Writes and copies the elements of param ${buffer} to the object's buffer. Overwrites existing frames if the buffer is full and returns PV_CIRCULAR_BUFFER_STATUS_WRITE_OVERFLOW which is not a failure.
- Parameters
-
object | Circular buffer object. |
buffer | A pointer to copy its elements to the object's buffer. |
length | The amount of elements to copy. |
- Returns
- Status Code. Returns PV_CIRCULAR_BUFFER_STATUS_INVALID_ARGUMENT on failure.
Definition at line 108 of file pvrecorder/src/pv_circular_buffer.c.