pulse-server: move extension to modules

Add extension support to modules. This is a list of extension commands
that can be performed on the module.

Remove the custom registry of extensions and make proper modules that
implement the extensions.

This is more in line with what pulseaudio does. The advantage is that the
modules actually show up in the module list and that we can use the
module user_data to implement the extension later.
This commit is contained in:
Wim Taymans 2024-01-23 12:22:45 +01:00
parent 89077d16ec
commit d71fb40989
13 changed files with 269 additions and 102 deletions

View file

@ -9,19 +9,15 @@
struct client;
struct message;
struct extension_sub {
const char *name;
uint32_t command;
int (*process)(struct client *client, uint32_t command, uint32_t tag, struct message *m);
};
struct module;
struct extension {
const char *name;
uint32_t index;
int (*process)(struct client *client, uint32_t tag, struct message *m);
uint32_t command;
int (*process)(struct module *module, struct client *client, uint32_t command,
uint32_t tag, struct message *m);
};
const struct extension *extension_find(uint32_t index, const char *name);
int extension_process(struct module *module, struct client *client, uint32_t tag, struct message *m);
#endif /* PULSE_SERVER_EXTENSION_H */