9# define MIN(a,b) (((a)<(b))?(a):(b))
13# define MAX(a,b) (((a)>(b))?(a):(b))
49 for (
int j = 0; j < lenResult; j++) {
59 for (
int j = 0; j < lenResult; j++) {
72 for (
int j = 0; j <
len; j++) {
99 for (
int j = 0; j < result; j++) {
108 template <
int rows,
int channels>
111 for (
int j = 0; j < lenResult; j++) {
113 for (
int i = 0; i < channels; i++) {
215 return MAX(result, 0);
224 if (
len<=0)
return 0;
228 return len_available;
231 len_available -=
len;
260 size_t result =
MIN(available_size, (
size_t)
max_size);
#define LOGE_HELIX(...)
Definition Allocator.h:16
#define LOG_METHOD
Definition ConfigHelix.h:47
void * memmove(void *Dest, const void *Src, ACPI_SIZE Count)
Definition utclib.c:255
unsigned char uint8_t
Definition acefiex.h:161
#define write
Definition acwin.h:181
flag
Definition bytecode.h:29
Shared functionality of all buffers.
Definition Buffers.h:32
int readFrames(T data[][2], int len)
reads multiple values for array of 2 dimensional frames
Definition Buffers.h:95
virtual void reset()=0
clears the buffer
virtual int readArray(T data[], int len)
reads multiple values
Definition Buffers.h:43
virtual ~BaseBuffer()=default
virtual int available()=0
provides the number of entries that are available to read
void clear()
same as reset
Definition Buffers.h:136
virtual T * address()=0
returns the address of the start of the physical read buffer
void setWritePos(int pos)
Definition Buffers.h:150
virtual T peek()=0
peeks the actual entry from the buffer
virtual int availableForWrite()=0
provides the number of entries that are available to write
virtual bool isFull()=0
checks if the buffer is full
virtual int clearArray(int len)
Removes the next len entries.
Definition Buffers.h:57
int readFrames(T(&data)[rows][channels])
Definition Buffers.h:109
bool isEmpty()
Definition Buffers.h:127
BaseBuffer & operator=(BaseBuffer const &)=delete
virtual int writeArray(const T data[], int len)
Fills the buffer data.
Definition Buffers.h:67
virtual int writeArrayOverwrite(const T data[], int len)
Fills the buffer data and overwrites the oldest data if the buffer is full.
Definition Buffers.h:85
BaseBuffer(BaseBuffer const &)=delete
virtual bool write(T data)=0
write add an entry to the buffer
virtual T read()=0
reads a single value
A simple Buffer implementation which just uses a (dynamically sized) array.
Definition Buffers.h:162
void onExternalBufferRefilled(void *data, int len)
notifies that the external buffer has been refilled
Definition Buffers.h:181
int current_write_pos
Definition Buffers.h:284
SingleBuffer(int size)
Construct a new Single Buffer object.
Definition Buffers.h:169
int available() override
provides the number of entries that are available to read
Definition Buffers.h:213
T peek() override
peeks the actual entry from the buffer
Definition Buffers.h:205
int max_size
Definition Buffers.h:282
T * address() override
Provides address to beginning of the buffer.
Definition Buffers.h:244
void setClearWithZero(bool flag)
Sets the buffer to 0 on clear.
Definition Buffers.h:277
bool is_clear_with_zero
Definition Buffers.h:286
void setWritePos(int pos)
Definition Buffers.h:289
SingleBuffer()
Construct a new Single Buffer w/o allocating any memory.
Definition Buffers.h:178
bool isFull() override
checks if the buffer is full
Definition Buffers.h:220
T * data()
Provides address of actual data.
Definition Buffers.h:247
int availableForWrite() override
provides the number of entries that are available to write
Definition Buffers.h:218
void reset() override
clears the buffer
Definition Buffers.h:249
bool owns_buffer
Definition Buffers.h:285
Vector< T > buffer
Definition Buffers.h:287
T read() override
reads a single value
Definition Buffers.h:197
void resize(int size)
Definition Buffers.h:269
int current_read_pos
Definition Buffers.h:283
bool write(T sample) override
write add an entry to the buffer
Definition Buffers.h:188
size_t setAvailable(size_t available_size)
Definition Buffers.h:259
size_t size() override
Definition Buffers.h:267
int clearArray(int len) override
consumes len bytes and moves current data to the beginning
Definition Buffers.h:223
Vector implementation which provides the most important methods as defined by std::vector....
Definition Vector.h:18
int sample
Definition h264bsd_deblocking.c:642
#define LOGD_HELIX(...)
Definition helix_log_idf.h:21
size_t len
Definition initial.c:23
void * data
Definition kthread.h:30
#define MIN(a, b)
Definition kernel.h:576
#define MAX(a, b)
Definition kernel.h:577
Definition Allocator.h:19
__virtio16 rows
Definition virtio_console.h:3