36#ifndef __INCLUDE_AUDIOLITE_MEMALLOC_H
37#define __INCLUDE_AUDIOLITE_MEMALLOC_H
49#include <nuttx/audio/audio.h>
51#include <mossfw/mossfw_memoryallocator.h>
52#include <mossfw/mossfw_lock.h>
53#include <mossfw/mossfw_data.h>
72 struct timeval timekeeper;
74 uint32_t max_zero_timeus;
81 void reflesh(
int rem);
82 void update_remain(
int rem);
84 uint32_t measure_interval();
88 uint32_t zero_time() {
return max_zero_timeus; };
89 int minimum_remain() {
return min_remain; };
102 virtual void disable_pool() = 0;
103 virtual void enable_pool() = 0;
104 virtual int remaining() = 0;
114 mossfw_allocator_t _alloc;
124 virtual void setup_instance(
int sz,
char *mem,
130 static void mempoolmossfw_free(
void *priv, mossfw_data_t *mem);
137 void *get_data(
void) {
return (
void *)data.xc; };
138 int get_fs(
void) {
return fs; };
139 void set_fs(
int hz) { fs = hz; };
140 int get_storedsize(
void) {
return data_bytes; };
141 void set_storedsize(
int sz) { data_bytes = sz; };
142 int get_fullsize(
void) {
return _sz; };
143 int get_typebytes(
void);
144 virtual void set_eof() = 0;
145 virtual void clear_eof() = 0;
146 virtual bool is_eof() = 0;
158 struct ap_buffer_s _abuf;
162 void setup_instance(
int sz,
char *mem,
164 void reset_audiodata(
void);
166 void set_storedsize(
int sz);
167 void set_channels(
int ch);
168 int get_channels(
void);
172 struct ap_buffer_s *get_raw_abuf();
173 dq_entry_t *get_link(
void);
186 struct dq_queue_s _free_mem;
191 mossfw_condition_t _cond;
194 bool _create_instance(
int block_size,
int block_num,
195 char *mem,
int memsize);
200 bool create_instance(
int block_size,
int block_num);
201 bool create_instance(
int block_size,
int block_num,
202 char *mem,
int memsize);
231 int get_evtid() {
return _msg.evtid; };
232 void *get_issuer() {
return _msg.issuer; };
233 unsigned long get_arg() {
return _msg.arg; };
234 void set_msgcontent(
int evtid,
void *issuer,
unsigned long arg);
236 dq_entry_t *get_link(
void) {
return &_msg.link; };
240 bool is_eof() {
return false; };
254 struct dq_queue_s _free_mem;
257 mossfw_condition_t _cond;
264 bool create_instance(
int msgnum);
Definition: al_memalloc.h:112
Definition: al_memalloc.h:156
Definition: al_memalloc.h:97
Definition: al_memalloc.h:183
Definition: al_memalloc.h:250
Definition: al_memalloc.h:223
Definition: al_memalloc.h:70
Definition: al_memalloc.h:215