mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-04 13:30:12 -05:00
pulse-server: pass already created module object to module_info::create()
All modules need to manually create a `module` object and check if it was successfully created. The same with argument parsing. To simplify modules, move the module object creation and argument parsing into `module_create()`, and pass the already initialized module to `module_info::create()`. The semantics of `module_info::create()` are kept, that is, if it fails, `module_info::unload()` will not be called.
This commit is contained in:
parent
5ad52bb88a
commit
fa3a28ab68
25 changed files with 210 additions and 548 deletions
|
|
@ -40,11 +40,12 @@ struct module_info {
|
|||
|
||||
unsigned int load_once:1;
|
||||
|
||||
struct module *(*create) (struct impl *impl, const char *args);
|
||||
int (*create) (struct module *module);
|
||||
int (*load) (struct client *client, struct module *module);
|
||||
int (*unload) (struct module *module);
|
||||
|
||||
const struct spa_dict *properties;
|
||||
size_t data_size;
|
||||
};
|
||||
|
||||
#define DEFINE_MODULE_INFO(name) \
|
||||
|
|
@ -79,7 +80,6 @@ struct module {
|
|||
|
||||
struct module *module_create(struct client *client, const char *name, const char *args);
|
||||
void module_free(struct module *module);
|
||||
struct module *module_new(struct impl *impl, size_t user_data);
|
||||
int module_load(struct client *client, struct module *module);
|
||||
int module_unload(struct module *module);
|
||||
void module_schedule_unload(struct module *module);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue