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;
113 mossfw_allocator_t _alloc;
123 virtual void setup_instance(
int sz,
char *mem,
129 static void mempoolmossfw_free(
void *priv, mossfw_data_t *mem);
136 void *get_data(
void) {
return (
void *)data.xc; };
137 int get_fs(
void) {
return fs; };
138 void set_fs(
int hz) { fs = hz; };
139 int get_storedsize(
void) {
return data_bytes; };
140 void set_storedsize(
int sz) { data_bytes = sz; };
141 int get_fullsize(
void) {
return _sz; };
142 int get_typebytes(
void);
143 virtual void set_eof() = 0;
144 virtual void clear_eof() = 0;
145 virtual bool is_eof() = 0;
157 struct ap_buffer_s _abuf;
161 void setup_instance(
int sz,
char *mem,
163 void reset_audiodata(
void);
165 void set_storedsize(
int sz);
166 void set_channels(
int ch);
167 int get_channels(
void);
171 struct ap_buffer_s *get_raw_abuf();
172 dq_entry_t *get_link(
void);
185 struct dq_queue_s _free_mem;
190 mossfw_condition_t _cond;
193 bool _create_instance(
int block_size,
int block_num,
194 char *mem,
int memsize);
199 bool create_instance(
int block_size,
int block_num);
200 bool create_instance(
int block_size,
int block_num,
201 char *mem,
int memsize);
229 int get_evtid() {
return _msg.evtid; };
230 void *get_issuer() {
return _msg.issuer; };
231 unsigned long get_arg() {
return _msg.arg; };
232 void set_msgcontent(
int evtid,
void *issuer,
unsigned long arg);
234 dq_entry_t *get_link(
void) {
return &_msg.link; };
238 bool is_eof() {
return false; };
252 struct dq_queue_s _free_mem;
255 mossfw_condition_t _cond;
262 bool create_instance(
int msgnum);
Definition: al_memalloc.h:111
Definition: al_memalloc.h:155
Definition: al_memalloc.h:97
Definition: al_memalloc.h:182
Definition: al_memalloc.h:248
Definition: al_memalloc.h:221
Definition: al_memalloc.h:70
Definition: al_memalloc.h:213