3 #include "AudioConfig.h"
4 #include "AudioTools/CoreAudio/AudioTypes.h"
5 #include "AudioTools/CoreAudio/Buffers.h"
6 #include "AudioTools/CoreAudio/AudioLogger.h"
27 is_sync_available = syncAvailable;
34 return p_buffer->read();
42 for (
int j = 0; j < lenResult; j++) {
43 data[j] = p_buffer->read();
49 LOGD(
"%s: %d", LOG_METHOD, len);
52 for (
int j = 0; j < len; j++) {
53 if (p_buffer->write(data[j]) == 0) {
65 return p_buffer->peek();
69 bool isFull()
override {
return p_buffer->isFull(); }
71 bool isEmpty() {
return available() == 0; }
77 return p_buffer->write(data);
90 if (is_sync_available)
LockGuard guard(p_mutex);
91 return p_buffer->available();
97 if (is_sync_available)
LockGuard guard(p_mutex);
98 return p_buffer->availableForWrite();
104 return p_buffer->address();
108 return p_buffer->size();
112 BaseBuffer<T> *p_buffer =
nullptr;
113 MutexBase *p_mutex =
nullptr;
114 bool is_sync_available =
false;