topology: move the topology element table from builder to elem

- use offsetof() for the lists
- add other info to describe the elements
- use the table in the element constructor

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
This commit is contained in:
Jaroslav Kysela 2019-12-15 16:15:29 +01:00
parent d52eaba63d
commit 4f076f5b69
4 changed files with 199 additions and 153 deletions

View file

@ -196,6 +196,21 @@ struct map_elem {
int id;
};
/* mapping table */
struct tplg_table {
const char *name;
off_t loff;
size_t size;
int type;
int tsoc;
unsigned build: 1;
unsigned enew: 1;
void (*free)(void *);
};
extern struct tplg_table tplg_table[];
extern unsigned int tplg_table_items;
int tplg_parse_compound(snd_tplg_t *tplg, snd_config_t *cfg,
int (*fcn)(snd_tplg_t *, snd_config_t *, void *),
void *private);