mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-02 09:01:50 -05:00
pulse-server: module: rework registry
Move all module methods into the `module_info` struct, and place all such structs into the "pw_mod_pulse_modules" section of the executable. This way there is no need for an explicit module registry, and all information about a module can be declared in the module's source file in a single place.
This commit is contained in:
parent
6ad6300ec6
commit
37fa911a72
26 changed files with 219 additions and 292 deletions
|
|
@ -59,7 +59,7 @@ void module_schedule_unload(struct module *module)
|
|||
module->unloading = true;
|
||||
}
|
||||
|
||||
struct module *module_new(struct impl *impl, const struct module_methods *methods, size_t user_data)
|
||||
struct module *module_new(struct impl *impl, size_t user_data)
|
||||
{
|
||||
struct module *module;
|
||||
|
||||
|
|
@ -69,7 +69,6 @@ struct module *module_new(struct impl *impl, const struct module_methods *method
|
|||
|
||||
module->index = SPA_ID_INVALID;
|
||||
module->impl = impl;
|
||||
module->methods = methods;
|
||||
spa_hook_list_init(&module->listener_list);
|
||||
module->user_data = SPA_PTROFF(module, sizeof(*module), void);
|
||||
module->loaded = false;
|
||||
|
|
@ -86,12 +85,12 @@ void module_add_listener(struct module *module,
|
|||
|
||||
int module_load(struct client *client, struct module *module)
|
||||
{
|
||||
pw_log_info("load module index:%u name:%s", module->index, module->name);
|
||||
if (module->methods->load == NULL)
|
||||
pw_log_info("load module index:%u name:%s", module->index, module->info->name);
|
||||
if (module->info->load == NULL)
|
||||
return -ENOTSUP;
|
||||
/* subscription event is sent when the module does a
|
||||
* module_emit_loaded() */
|
||||
return module->methods->load(client, module);
|
||||
return module->info->load(client, module);
|
||||
}
|
||||
|
||||
void module_free(struct module *module)
|
||||
|
|
@ -109,7 +108,6 @@ void module_free(struct module *module)
|
|||
spa_hook_list_clean(&module->listener_list);
|
||||
pw_properties_free(module->props);
|
||||
|
||||
free((char*)module->name);
|
||||
free((char*)module->args);
|
||||
|
||||
free(module);
|
||||
|
|
@ -123,10 +121,10 @@ int module_unload(struct module *module)
|
|||
/* Note that client can be NULL (when the module is being unloaded
|
||||
* internally and not by a client request */
|
||||
|
||||
pw_log_info("unload module index:%u name:%s", module->index, module->name);
|
||||
pw_log_info("unload module index:%u name:%s", module->index, module->info->name);
|
||||
|
||||
if (module->methods->unload)
|
||||
res = module->methods->unload(module);
|
||||
if (module->info->unload)
|
||||
res = module->info->unload(module);
|
||||
|
||||
if (module->loaded)
|
||||
broadcast_subscribe_event(impl,
|
||||
|
|
@ -260,44 +258,20 @@ bool module_args_parse_bool(const char *v)
|
|||
return false;
|
||||
}
|
||||
|
||||
#include "modules/registry.h"
|
||||
|
||||
static const struct module_info module_list[] = {
|
||||
{ "module-always-sink", 1, create_module_always_sink, },
|
||||
{ "module-combine-sink", 0, create_module_combine_sink, },
|
||||
{ "module-echo-cancel", 0, create_module_echo_cancel, },
|
||||
{ "module-ladspa-sink", 0, create_module_ladspa_sink, },
|
||||
{ "module-ladspa-source", 0, create_module_ladspa_source, },
|
||||
{ "module-loopback", 0, create_module_loopback, },
|
||||
{ "module-null-sink", 0, create_module_null_sink, },
|
||||
{ "module-native-protocol-tcp", 0, create_module_native_protocol_tcp, },
|
||||
{ "module-pipe-source", 0, create_module_pipe_source, },
|
||||
{ "module-pipe-sink", 0, create_module_pipe_sink, },
|
||||
{ "module-raop-discover", 1, create_module_raop_discover, },
|
||||
{ "module-remap-sink", 0, create_module_remap_sink, },
|
||||
{ "module-remap-source", 0, create_module_remap_source, },
|
||||
{ "module-simple-protocol-tcp", 0, create_module_simple_protocol_tcp, },
|
||||
{ "module-switch-on-connect", 1, create_module_switch_on_connect, },
|
||||
{ "module-tunnel-sink", 0, create_module_tunnel_sink, },
|
||||
{ "module-tunnel-source", 0, create_module_tunnel_source, },
|
||||
{ "module-zeroconf-discover", 1, create_module_zeroconf_discover, },
|
||||
#ifdef HAVE_AVAHI
|
||||
{ "module-zeroconf-publish", 0, create_module_zeroconf_publish, },
|
||||
#endif
|
||||
{ "module-roc-sink", 0, create_module_roc_sink, },
|
||||
{ "module-roc-source", 0, create_module_roc_source, },
|
||||
{ "module-x11-bell", 0, create_module_x11_bell, },
|
||||
};
|
||||
|
||||
static const struct module_info *find_module_info(const char *name)
|
||||
{
|
||||
const struct module_info *info;
|
||||
extern const struct module_info __start_pw_mod_pulse_modules[];
|
||||
extern const struct module_info __stop_pw_mod_pulse_modules[];
|
||||
|
||||
SPA_FOR_EACH_ELEMENT(module_list, info) {
|
||||
const struct module_info *info = __start_pw_mod_pulse_modules;
|
||||
|
||||
for (; info < __stop_pw_mod_pulse_modules; info++) {
|
||||
if (spa_streq(info->name, name))
|
||||
return info;
|
||||
}
|
||||
|
||||
spa_assert(info == __stop_pw_mod_pulse_modules);
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
|
@ -305,7 +279,7 @@ static int find_module_by_name(void *item_data, void *data)
|
|||
{
|
||||
const char *name = data;
|
||||
const struct module *module = item_data;
|
||||
return spa_streq(module->name, name) ? 1 : 0;
|
||||
return spa_streq(module->info->name, name) ? 1 : 0;
|
||||
}
|
||||
|
||||
struct module *module_create(struct client *client, const char *name, const char *args)
|
||||
|
|
@ -334,12 +308,12 @@ struct module *module_create(struct client *client, const char *name, const char
|
|||
if (module == NULL)
|
||||
return NULL;
|
||||
|
||||
module->info = info;
|
||||
module->index = pw_map_insert_new(&impl->modules, module);
|
||||
if (module->index == SPA_ID_INVALID) {
|
||||
module_unload(module);
|
||||
return NULL;
|
||||
}
|
||||
module->name = strdup(name);
|
||||
module->args = args ? strdup(args) : NULL;
|
||||
module->index |= MODULE_FLAG;
|
||||
return module;
|
||||
|
|
|
|||
|
|
@ -37,10 +37,20 @@ struct pw_properties;
|
|||
|
||||
struct module_info {
|
||||
const char *name;
|
||||
|
||||
unsigned int load_once:1;
|
||||
|
||||
struct module *(*create) (struct impl *impl, const char *args);
|
||||
int (*load) (struct client *client, struct module *module);
|
||||
int (*unload) (struct module *module);
|
||||
};
|
||||
|
||||
#define DEFINE_MODULE_INFO(name) \
|
||||
__attribute__((used)) \
|
||||
__attribute__((section("pw_mod_pulse_modules"))) \
|
||||
__attribute__((aligned(__alignof__(struct module_info)))) \
|
||||
const struct module_info name
|
||||
|
||||
struct module_events {
|
||||
#define VERSION_MODULE_EVENTS 0
|
||||
uint32_t version;
|
||||
|
|
@ -49,21 +59,12 @@ struct module_events {
|
|||
void (*destroy) (void *data);
|
||||
};
|
||||
|
||||
struct module_methods {
|
||||
#define VERSION_MODULE_METHODS 0
|
||||
uint32_t version;
|
||||
|
||||
int (*load) (struct client *client, struct module *module);
|
||||
int (*unload) (struct module *module);
|
||||
};
|
||||
|
||||
struct module {
|
||||
uint32_t index;
|
||||
const char *name;
|
||||
const char *args;
|
||||
struct pw_properties *props;
|
||||
struct impl *impl;
|
||||
const struct module_methods *methods;
|
||||
const struct module_info *info;
|
||||
struct spa_hook_list listener_list;
|
||||
void *user_data;
|
||||
unsigned int loaded:1;
|
||||
|
|
@ -75,7 +76,7 @@ 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, const struct module_methods *methods, size_t user_data);
|
||||
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);
|
||||
|
|
|
|||
|
|
@ -94,12 +94,6 @@ static int module_always_sink_unload(struct module *module)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static const struct module_methods module_always_sink_methods = {
|
||||
VERSION_MODULE_METHODS,
|
||||
.load = module_always_sink_load,
|
||||
.unload = module_always_sink_unload,
|
||||
};
|
||||
|
||||
static const struct spa_dict_item module_always_sink_info[] = {
|
||||
{ PW_KEY_MODULE_AUTHOR, "Pauli Virtanen <pav@iki.fi>" },
|
||||
{ PW_KEY_MODULE_DESCRIPTION, "Always keeps at least one sink loaded even if it's a null one" },
|
||||
|
|
@ -123,7 +117,7 @@ struct module *create_module_always_sink(struct impl *impl, const char *argument
|
|||
if (argument)
|
||||
module_args_add_props(props, argument);
|
||||
|
||||
module = module_new(impl, &module_always_sink_methods, sizeof(struct module_always_sink_data));
|
||||
module = module_new(impl, sizeof(struct module_always_sink_data));
|
||||
if (module == NULL) {
|
||||
res = -errno;
|
||||
goto out;
|
||||
|
|
@ -136,3 +130,11 @@ out:
|
|||
errno = -res;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
DEFINE_MODULE_INFO(module_always_sink) = {
|
||||
.name = "module-always-sink",
|
||||
.load_once = true,
|
||||
.create = create_module_always_sink,
|
||||
.load = module_always_sink_load,
|
||||
.unload = module_always_sink_unload,
|
||||
};
|
||||
|
|
|
|||
|
|
@ -30,7 +30,6 @@
|
|||
|
||||
#include "../manager.h"
|
||||
#include "../module.h"
|
||||
#include "registry.h"
|
||||
|
||||
#define NAME "combine-sink"
|
||||
|
||||
|
|
@ -500,12 +499,6 @@ static int module_combine_sink_unload(struct module *module)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static const struct module_methods module_combine_sink_methods = {
|
||||
VERSION_MODULE_METHODS,
|
||||
.load = module_combine_sink_load,
|
||||
.unload = module_combine_sink_unload,
|
||||
};
|
||||
|
||||
struct module *create_module_combine_sink(struct impl *impl, const char *argument)
|
||||
{
|
||||
struct module *module;
|
||||
|
|
@ -554,7 +547,7 @@ struct module *create_module_combine_sink(struct impl *impl, const char *argumen
|
|||
goto out;
|
||||
}
|
||||
|
||||
module = module_new(impl, &module_combine_sink_methods, sizeof(*d));
|
||||
module = module_new(impl, sizeof(*d));
|
||||
if (module == NULL) {
|
||||
res = -errno;
|
||||
goto out;
|
||||
|
|
@ -580,3 +573,10 @@ out:
|
|||
errno = -res;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
DEFINE_MODULE_INFO(module_combine_sink) = {
|
||||
.name = "module-combine-sink",
|
||||
.create = create_module_combine_sink,
|
||||
.load = module_combine_sink_load,
|
||||
.unload = module_combine_sink_unload,
|
||||
};
|
||||
|
|
|
|||
|
|
@ -31,7 +31,6 @@
|
|||
|
||||
#include "../defs.h"
|
||||
#include "../module.h"
|
||||
#include "registry.h"
|
||||
|
||||
#define NAME "echo-cancel"
|
||||
|
||||
|
|
@ -127,12 +126,6 @@ static int module_echo_cancel_unload(struct module *module)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static const struct module_methods module_echo_cancel_methods = {
|
||||
VERSION_MODULE_METHODS,
|
||||
.load = module_echo_cancel_load,
|
||||
.unload = module_echo_cancel_unload,
|
||||
};
|
||||
|
||||
static const struct spa_dict_item module_echo_cancel_info[] = {
|
||||
{ PW_KEY_MODULE_AUTHOR, "Arun Raghavan <arun@asymptotic.io>" },
|
||||
{ PW_KEY_MODULE_DESCRIPTION, "Acoustic echo canceller" },
|
||||
|
|
@ -240,7 +233,7 @@ struct module *create_module_echo_cancel(struct impl *impl, const char *argument
|
|||
pw_properties_set(props, "aec_args", NULL);
|
||||
}
|
||||
|
||||
module = module_new(impl, &module_echo_cancel_methods, sizeof(*d));
|
||||
module = module_new(impl, sizeof(*d));
|
||||
if (module == NULL) {
|
||||
res = -errno;
|
||||
goto out;
|
||||
|
|
@ -264,3 +257,10 @@ out:
|
|||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
DEFINE_MODULE_INFO(module_echo_cancel) = {
|
||||
.name = "module-echo-cancel",
|
||||
.create = create_module_echo_cancel,
|
||||
.load = module_echo_cancel_load,
|
||||
.unload = module_echo_cancel_unload,
|
||||
};
|
||||
|
|
|
|||
|
|
@ -30,7 +30,6 @@
|
|||
|
||||
#include "../defs.h"
|
||||
#include "../module.h"
|
||||
#include "registry.h"
|
||||
|
||||
#define NAME "ladspa-sink"
|
||||
|
||||
|
|
@ -144,12 +143,6 @@ static int module_ladspa_sink_unload(struct module *module)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static const struct module_methods module_ladspa_sink_methods = {
|
||||
VERSION_MODULE_METHODS,
|
||||
.load = module_ladspa_sink_load,
|
||||
.unload = module_ladspa_sink_unload,
|
||||
};
|
||||
|
||||
static const struct spa_dict_item module_ladspa_sink_info[] = {
|
||||
{ PW_KEY_MODULE_AUTHOR, "Wim Taymans <wim.taymans@gmail.com>" },
|
||||
{ PW_KEY_MODULE_DESCRIPTION, "Virtual LADSPA sink" },
|
||||
|
|
@ -245,7 +238,7 @@ struct module *create_module_ladspa_sink(struct impl *impl, const char *argument
|
|||
if (pw_properties_get(playback_props, PW_KEY_NODE_PASSIVE) == NULL)
|
||||
pw_properties_set(playback_props, PW_KEY_NODE_PASSIVE, "true");
|
||||
|
||||
module = module_new(impl, &module_ladspa_sink_methods, sizeof(*d));
|
||||
module = module_new(impl, sizeof(*d));
|
||||
if (module == NULL) {
|
||||
res = -errno;
|
||||
goto out;
|
||||
|
|
@ -265,3 +258,10 @@ out:
|
|||
errno = -res;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
DEFINE_MODULE_INFO(module_ladspa_sink) = {
|
||||
.name = "module-ladspa-sink",
|
||||
.create = create_module_ladspa_sink,
|
||||
.load = module_ladspa_sink_load,
|
||||
.unload = module_ladspa_sink_unload,
|
||||
};
|
||||
|
|
|
|||
|
|
@ -30,7 +30,6 @@
|
|||
|
||||
#include "../defs.h"
|
||||
#include "../module.h"
|
||||
#include "registry.h"
|
||||
|
||||
#define NAME "ladspa-source"
|
||||
|
||||
|
|
@ -144,12 +143,6 @@ static int module_ladspa_source_unload(struct module *module)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static const struct module_methods module_ladspa_source_methods = {
|
||||
VERSION_MODULE_METHODS,
|
||||
.load = module_ladspa_source_load,
|
||||
.unload = module_ladspa_source_unload,
|
||||
};
|
||||
|
||||
static const struct spa_dict_item module_ladspa_source_info[] = {
|
||||
{ PW_KEY_MODULE_AUTHOR, "Wim Taymans <wim.taymans@gmail.com>" },
|
||||
{ PW_KEY_MODULE_DESCRIPTION, "Virtual LADSPA source" },
|
||||
|
|
@ -245,7 +238,7 @@ struct module *create_module_ladspa_source(struct impl *impl, const char *argume
|
|||
if (pw_properties_get(capture_props, PW_KEY_NODE_PASSIVE) == NULL)
|
||||
pw_properties_set(capture_props, PW_KEY_NODE_PASSIVE, "true");
|
||||
|
||||
module = module_new(impl, &module_ladspa_source_methods, sizeof(*d));
|
||||
module = module_new(impl, sizeof(*d));
|
||||
if (module == NULL) {
|
||||
res = -errno;
|
||||
goto out;
|
||||
|
|
@ -265,3 +258,10 @@ out:
|
|||
errno = -res;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
DEFINE_MODULE_INFO(module_ladspa_source) = {
|
||||
.name = "module-ladspa-source",
|
||||
.create = create_module_ladspa_source,
|
||||
.load = module_ladspa_source_load,
|
||||
.unload = module_ladspa_source_unload,
|
||||
};
|
||||
|
|
|
|||
|
|
@ -31,7 +31,6 @@
|
|||
|
||||
#include "../defs.h"
|
||||
#include "../module.h"
|
||||
#include "registry.h"
|
||||
|
||||
#define NAME "loopback"
|
||||
|
||||
|
|
@ -127,12 +126,6 @@ static int module_loopback_unload(struct module *module)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static const struct module_methods module_loopback_methods = {
|
||||
VERSION_MODULE_METHODS,
|
||||
.load = module_loopback_load,
|
||||
.unload = module_loopback_unload,
|
||||
};
|
||||
|
||||
static const struct spa_dict_item module_loopback_info[] = {
|
||||
{ PW_KEY_MODULE_AUTHOR, "Arun Raghavan <arun@asymptotic.io>" },
|
||||
{ PW_KEY_MODULE_DESCRIPTION, "Loopback from source to sink" },
|
||||
|
|
@ -234,7 +227,7 @@ struct module *create_module_loopback(struct impl *impl, const char *argument)
|
|||
pw_properties_set(props, "source_output_properties", NULL);
|
||||
}
|
||||
|
||||
module = module_new(impl, &module_loopback_methods, sizeof(*d));
|
||||
module = module_new(impl, sizeof(*d));
|
||||
if (module == NULL) {
|
||||
res = -errno;
|
||||
goto out;
|
||||
|
|
@ -256,3 +249,10 @@ out:
|
|||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
DEFINE_MODULE_INFO(module_loopback) = {
|
||||
.name = "module-loopback",
|
||||
.create = create_module_loopback,
|
||||
.load = module_loopback_load,
|
||||
.unload = module_loopback_unload,
|
||||
};
|
||||
|
|
|
|||
|
|
@ -27,7 +27,6 @@
|
|||
#include "../module.h"
|
||||
#include "../pulse-server.h"
|
||||
#include "../server.h"
|
||||
#include "registry.h"
|
||||
|
||||
#define NAME "protocol-tcp"
|
||||
|
||||
|
|
@ -71,12 +70,6 @@ static int module_native_protocol_tcp_unload(struct module *module)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static const struct module_methods module_native_protocol_tcp_methods = {
|
||||
VERSION_MODULE_METHODS,
|
||||
.load = module_native_protocol_tcp_load,
|
||||
.unload = module_native_protocol_tcp_unload,
|
||||
};
|
||||
|
||||
static const struct spa_dict_item module_native_protocol_tcp_info[] = {
|
||||
{ PW_KEY_MODULE_AUTHOR, "Wim Taymans <wim.taymans@gmail.com>" },
|
||||
{ PW_KEY_MODULE_DESCRIPTION, "Native protocol (TCP sockets)" },
|
||||
|
|
@ -111,7 +104,7 @@ struct module *create_module_native_protocol_tcp(struct impl *impl, const char *
|
|||
pw_properties_setf(props, "pulse.tcp", "[ \"tcp:%s%s%s\" ]",
|
||||
listen ? listen : "", listen ? ":" : "", port);
|
||||
|
||||
module = module_new(impl, &module_native_protocol_tcp_methods, sizeof(*d));
|
||||
module = module_new(impl, sizeof(*d));
|
||||
if (module == NULL) {
|
||||
res = -errno;
|
||||
goto out;
|
||||
|
|
@ -127,3 +120,10 @@ out:
|
|||
errno = -res;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
DEFINE_MODULE_INFO(module_native_protocol_tcp) = {
|
||||
.name = "module-native-protocol-tcp",
|
||||
.create = create_module_native_protocol_tcp,
|
||||
.load = module_native_protocol_tcp_load,
|
||||
.unload = module_native_protocol_tcp_unload,
|
||||
};
|
||||
|
|
|
|||
|
|
@ -26,7 +26,6 @@
|
|||
|
||||
#include "../manager.h"
|
||||
#include "../module.h"
|
||||
#include "registry.h"
|
||||
|
||||
#define NAME "null-sink"
|
||||
|
||||
|
|
@ -147,12 +146,6 @@ static int module_null_sink_unload(struct module *module)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static const struct module_methods module_null_sink_methods = {
|
||||
VERSION_MODULE_METHODS,
|
||||
.load = module_null_sink_load,
|
||||
.unload = module_null_sink_unload,
|
||||
};
|
||||
|
||||
static const struct spa_dict_item module_null_sink_info[] = {
|
||||
{ PW_KEY_MODULE_AUTHOR, "Wim Taymans <wim.taymans@gmail.com>" },
|
||||
{ PW_KEY_MODULE_DESCRIPTION, "A NULL sink" },
|
||||
|
|
@ -234,7 +227,7 @@ struct module *create_module_null_sink(struct impl *impl, const char *argument)
|
|||
if (pw_properties_get(props, "monitor.channel-volumes") == NULL)
|
||||
pw_properties_set(props, "monitor.channel-volumes", "true");
|
||||
|
||||
module = module_new(impl, &module_null_sink_methods, sizeof(struct module_null_sink_data));
|
||||
module = module_new(impl, sizeof(struct module_null_sink_data));
|
||||
if (module == NULL) {
|
||||
res = -errno;
|
||||
goto out;
|
||||
|
|
@ -247,3 +240,10 @@ out:
|
|||
errno = -res;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
DEFINE_MODULE_INFO(module_null_sink) = {
|
||||
.name = "module-null-sink",
|
||||
.create = create_module_null_sink,
|
||||
.load = module_null_sink_load,
|
||||
.unload = module_null_sink_unload,
|
||||
};
|
||||
|
|
|
|||
|
|
@ -34,7 +34,6 @@
|
|||
|
||||
#include "../defs.h"
|
||||
#include "../module.h"
|
||||
#include "registry.h"
|
||||
|
||||
#define NAME "pipe-sink"
|
||||
|
||||
|
|
@ -140,7 +139,7 @@ static const struct pw_stream_events in_stream_events = {
|
|||
.process = capture_process
|
||||
};
|
||||
|
||||
static int module_pipesink_load(struct client *client, struct module *module)
|
||||
static int module_pipe_sink_load(struct client *client, struct module *module)
|
||||
{
|
||||
struct module_pipesink_data *data = module->user_data;
|
||||
int res;
|
||||
|
|
@ -187,7 +186,7 @@ static int module_pipesink_load(struct client *client, struct module *module)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int module_pipesink_unload(struct module *module)
|
||||
static int module_pipe_sink_unload(struct module *module)
|
||||
{
|
||||
struct module_pipesink_data *d = module->user_data;
|
||||
|
||||
|
|
@ -207,13 +206,7 @@ static int module_pipesink_unload(struct module *module)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static const struct module_methods module_pipesink_methods = {
|
||||
VERSION_MODULE_METHODS,
|
||||
.load = module_pipesink_load,
|
||||
.unload = module_pipesink_unload,
|
||||
};
|
||||
|
||||
static const struct spa_dict_item module_pipesink_info[] = {
|
||||
static const struct spa_dict_item module_pipe_sink_info[] = {
|
||||
{ PW_KEY_MODULE_AUTHOR, "Sanchayan Maity <sanchayan@asymptotic.io>" },
|
||||
{ PW_KEY_MODULE_DESCRIPTION, "Pipe sink" },
|
||||
{ PW_KEY_MODULE_USAGE, "file=<name of the FIFO special file to use> "
|
||||
|
|
@ -240,7 +233,7 @@ struct module *create_module_pipe_sink(struct impl *impl, const char *argument)
|
|||
|
||||
PW_LOG_TOPIC_INIT(mod_topic);
|
||||
|
||||
props = pw_properties_new_dict(&SPA_DICT_INIT_ARRAY(module_pipesink_info));
|
||||
props = pw_properties_new_dict(&SPA_DICT_INIT_ARRAY(module_pipe_sink_info));
|
||||
capture_props = pw_properties_new(NULL, NULL);
|
||||
if (!props || !capture_props) {
|
||||
res = -EINVAL;
|
||||
|
|
@ -311,7 +304,7 @@ struct module *create_module_pipe_sink(struct impl *impl, const char *argument)
|
|||
pw_properties_set(capture_props, PW_KEY_NODE_VIRTUAL, "true");
|
||||
pw_properties_set(capture_props, PW_KEY_MEDIA_CLASS, "Audio/Sink");
|
||||
|
||||
module = module_new(impl, &module_pipesink_methods, sizeof(*d));
|
||||
module = module_new(impl, sizeof(*d));
|
||||
if (module == NULL) {
|
||||
res = -errno;
|
||||
goto out;
|
||||
|
|
@ -343,3 +336,10 @@ out:
|
|||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
DEFINE_MODULE_INFO(module_pipe_sink) = {
|
||||
.name = "module-pipe-sink",
|
||||
.create = create_module_pipe_sink,
|
||||
.load = module_pipe_sink_load,
|
||||
.unload = module_pipe_sink_unload,
|
||||
};
|
||||
|
|
|
|||
|
|
@ -34,7 +34,6 @@
|
|||
|
||||
#include "../defs.h"
|
||||
#include "../module.h"
|
||||
#include "registry.h"
|
||||
|
||||
#define NAME "pipe-source"
|
||||
|
||||
|
|
@ -161,7 +160,7 @@ static const struct pw_stream_events out_stream_events = {
|
|||
.process = playback_process
|
||||
};
|
||||
|
||||
static int module_pipesource_load(struct client *client, struct module *module)
|
||||
static int module_pipe_source_load(struct client *client, struct module *module)
|
||||
{
|
||||
struct module_pipesrc_data *data = module->user_data;
|
||||
int res;
|
||||
|
|
@ -209,7 +208,7 @@ static int module_pipesource_load(struct client *client, struct module *module)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int module_pipesource_unload(struct module *module)
|
||||
static int module_pipe_source_unload(struct module *module)
|
||||
{
|
||||
struct module_pipesrc_data *d = module->user_data;
|
||||
|
||||
|
|
@ -227,13 +226,7 @@ static int module_pipesource_unload(struct module *module)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static const struct module_methods module_pipesource_methods = {
|
||||
VERSION_MODULE_METHODS,
|
||||
.load = module_pipesource_load,
|
||||
.unload = module_pipesource_unload,
|
||||
};
|
||||
|
||||
static const struct spa_dict_item module_pipesource_info[] = {
|
||||
static const struct spa_dict_item module_pipe_source_info[] = {
|
||||
{ PW_KEY_MODULE_AUTHOR, "Sanchayan Maity <sanchayan@asymptotic.io>" },
|
||||
{ PW_KEY_MODULE_DESCRIPTION, "Pipe source" },
|
||||
{ PW_KEY_MODULE_USAGE, "file=<name of the FIFO special file to use> "
|
||||
|
|
@ -260,7 +253,7 @@ struct module *create_module_pipe_source(struct impl *impl, const char *argument
|
|||
|
||||
PW_LOG_TOPIC_INIT(mod_topic);
|
||||
|
||||
props = pw_properties_new_dict(&SPA_DICT_INIT_ARRAY(module_pipesource_info));
|
||||
props = pw_properties_new_dict(&SPA_DICT_INIT_ARRAY(module_pipe_source_info));
|
||||
playback_props = pw_properties_new(NULL, NULL);
|
||||
if (!props || !playback_props) {
|
||||
res = -errno;
|
||||
|
|
@ -370,7 +363,7 @@ struct module *create_module_pipe_source(struct impl *impl, const char *argument
|
|||
pw_properties_set(playback_props, PW_KEY_NODE_VIRTUAL, "true");
|
||||
pw_properties_set(playback_props, PW_KEY_MEDIA_CLASS, "Audio/Source");
|
||||
|
||||
module = module_new(impl, &module_pipesource_methods, sizeof(*d) + stride);
|
||||
module = module_new(impl, sizeof(*d) + stride);
|
||||
if (module == NULL) {
|
||||
res = -errno;
|
||||
goto out;
|
||||
|
|
@ -401,3 +394,10 @@ out:
|
|||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
DEFINE_MODULE_INFO(module_pipe_source) = {
|
||||
.name = "module-pipe-source",
|
||||
.create = create_module_pipe_source,
|
||||
.load = module_pipe_source_load,
|
||||
.unload = module_pipe_source_unload,
|
||||
};
|
||||
|
|
|
|||
|
|
@ -28,7 +28,6 @@
|
|||
|
||||
#include "../defs.h"
|
||||
#include "../module.h"
|
||||
#include "registry.h"
|
||||
|
||||
#define NAME "raop-discover"
|
||||
|
||||
|
|
@ -86,12 +85,6 @@ static int module_raop_discover_unload(struct module *module)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static const struct module_methods module_raop_discover_methods = {
|
||||
VERSION_MODULE_METHODS,
|
||||
.load = module_raop_discover_load,
|
||||
.unload = module_raop_discover_unload,
|
||||
};
|
||||
|
||||
static const struct spa_dict_item module_raop_discover_info[] = {
|
||||
{ PW_KEY_MODULE_AUTHOR, "Wim Taymans <wim.taymans@gmail.con>" },
|
||||
{ PW_KEY_MODULE_DESCRIPTION, "mDNS/DNS-SD Service Discovery of RAOP devices" },
|
||||
|
|
@ -116,7 +109,7 @@ struct module *create_module_raop_discover(struct impl *impl, const char *argume
|
|||
if (argument != NULL)
|
||||
module_args_add_props(props, argument);
|
||||
|
||||
module = module_new(impl, &module_raop_discover_methods, sizeof(*d));
|
||||
module = module_new(impl, sizeof(*d));
|
||||
if (module == NULL) {
|
||||
res = -errno;
|
||||
goto out;
|
||||
|
|
@ -132,3 +125,11 @@ out:
|
|||
errno = -res;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
DEFINE_MODULE_INFO(module_raop_discover) = {
|
||||
.name = "module-raop-discover",
|
||||
.load_once = true,
|
||||
.create = create_module_raop_discover,
|
||||
.load = module_raop_discover_load,
|
||||
.unload = module_raop_discover_unload,
|
||||
};
|
||||
|
|
|
|||
|
|
@ -30,7 +30,6 @@
|
|||
|
||||
#include "../defs.h"
|
||||
#include "../module.h"
|
||||
#include "registry.h"
|
||||
|
||||
#define NAME "remap-sink"
|
||||
|
||||
|
|
@ -115,12 +114,6 @@ static int module_remap_sink_unload(struct module *module)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static const struct module_methods module_remap_sink_methods = {
|
||||
VERSION_MODULE_METHODS,
|
||||
.load = module_remap_sink_load,
|
||||
.unload = module_remap_sink_unload,
|
||||
};
|
||||
|
||||
static const struct spa_dict_item module_remap_sink_info[] = {
|
||||
{ PW_KEY_MODULE_AUTHOR, "Wim Taymans <wim.taymans@gmail.com>" },
|
||||
{ PW_KEY_MODULE_DESCRIPTION, "Remap sink channels" },
|
||||
|
|
@ -242,7 +235,7 @@ struct module *create_module_remap_sink(struct impl *impl, const char *argument)
|
|||
if (pw_properties_get(playback_props, PW_KEY_NODE_PASSIVE) == NULL)
|
||||
pw_properties_set(playback_props, PW_KEY_NODE_PASSIVE, "true");
|
||||
|
||||
module = module_new(impl, &module_remap_sink_methods, sizeof(*d));
|
||||
module = module_new(impl, sizeof(*d));
|
||||
if (module == NULL) {
|
||||
res = -errno;
|
||||
goto out;
|
||||
|
|
@ -262,3 +255,10 @@ out:
|
|||
errno = -res;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
DEFINE_MODULE_INFO(module_remap_sink) = {
|
||||
.name = "module-remap-sink",
|
||||
.create = create_module_remap_sink,
|
||||
.load = module_remap_sink_load,
|
||||
.unload = module_remap_sink_unload,
|
||||
};
|
||||
|
|
|
|||
|
|
@ -30,7 +30,6 @@
|
|||
|
||||
#include "../defs.h"
|
||||
#include "../module.h"
|
||||
#include "registry.h"
|
||||
|
||||
#define NAME "remap-sink"
|
||||
|
||||
|
|
@ -115,12 +114,6 @@ static int module_remap_source_unload(struct module *module)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static const struct module_methods module_remap_source_methods = {
|
||||
VERSION_MODULE_METHODS,
|
||||
.load = module_remap_source_load,
|
||||
.unload = module_remap_source_unload,
|
||||
};
|
||||
|
||||
static const struct spa_dict_item module_remap_source_info[] = {
|
||||
{ PW_KEY_MODULE_AUTHOR, "Wim Taymans <wim.taymans@gmail.com>" },
|
||||
{ PW_KEY_MODULE_DESCRIPTION, "Remap source channels" },
|
||||
|
|
@ -242,7 +235,7 @@ struct module *create_module_remap_source(struct impl *impl, const char *argumen
|
|||
if (pw_properties_get(capture_props, PW_KEY_NODE_PASSIVE) == NULL)
|
||||
pw_properties_set(capture_props, PW_KEY_NODE_PASSIVE, "true");
|
||||
|
||||
module = module_new(impl, &module_remap_source_methods, sizeof(*d));
|
||||
module = module_new(impl, sizeof(*d));
|
||||
if (module == NULL) {
|
||||
res = -errno;
|
||||
goto out;
|
||||
|
|
@ -262,3 +255,10 @@ out:
|
|||
errno = -res;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
DEFINE_MODULE_INFO(module_remap_source) = {
|
||||
.name = "module-remap-source",
|
||||
.create = create_module_remap_source,
|
||||
.load = module_remap_source_load,
|
||||
.unload = module_remap_source_unload,
|
||||
};
|
||||
|
|
|
|||
|
|
@ -29,7 +29,6 @@
|
|||
|
||||
#include "../defs.h"
|
||||
#include "../module.h"
|
||||
#include "registry.h"
|
||||
|
||||
#define NAME "roc-sink"
|
||||
|
||||
|
|
@ -115,12 +114,6 @@ static int module_roc_sink_unload(struct module *module)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static const struct module_methods module_roc_sink_methods = {
|
||||
VERSION_MODULE_METHODS,
|
||||
.load = module_roc_sink_load,
|
||||
.unload = module_roc_sink_unload,
|
||||
};
|
||||
|
||||
static const struct spa_dict_item module_roc_sink_info[] = {
|
||||
{ PW_KEY_MODULE_AUTHOR, "Sanchayan Maity <sanchayan@asymptotic.io>" },
|
||||
{ PW_KEY_MODULE_DESCRIPTION, "roc sink" },
|
||||
|
|
@ -197,7 +190,7 @@ struct module *create_module_roc_sink(struct impl *impl, const char *argument)
|
|||
pw_properties_set(roc_props, "remote.repair.port", ROC_DEFAULT_REPAIR_PORT);
|
||||
}
|
||||
|
||||
module = module_new(impl, &module_roc_sink_methods, sizeof(*d));
|
||||
module = module_new(impl, sizeof(*d));
|
||||
if (module == NULL) {
|
||||
res = -errno;
|
||||
goto out;
|
||||
|
|
@ -217,3 +210,10 @@ out:
|
|||
errno = -res;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
DEFINE_MODULE_INFO(module_roc_sink) = {
|
||||
.name = "module-roc-sink",
|
||||
.create = create_module_roc_sink,
|
||||
.load = module_roc_sink_load,
|
||||
.unload = module_roc_sink_unload,
|
||||
};
|
||||
|
|
|
|||
|
|
@ -29,7 +29,6 @@
|
|||
|
||||
#include "../defs.h"
|
||||
#include "../module.h"
|
||||
#include "registry.h"
|
||||
|
||||
#define NAME "roc-source"
|
||||
|
||||
|
|
@ -115,12 +114,6 @@ static int module_roc_source_unload(struct module *module)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static const struct module_methods module_roc_source_methods = {
|
||||
VERSION_MODULE_METHODS,
|
||||
.load = module_roc_source_load,
|
||||
.unload = module_roc_source_unload,
|
||||
};
|
||||
|
||||
static const struct spa_dict_item module_roc_source_info[] = {
|
||||
{ PW_KEY_MODULE_AUTHOR, "Sanchayan Maity <sanchayan@asymptotic.io>" },
|
||||
{ PW_KEY_MODULE_DESCRIPTION, "roc source" },
|
||||
|
|
@ -204,7 +197,7 @@ struct module *create_module_roc_source(struct impl *impl, const char *argument)
|
|||
pw_properties_set(roc_props, "resampler.profile", ROC_DEFAULT_REPAIR_PORT);
|
||||
}
|
||||
|
||||
module = module_new(impl, &module_roc_source_methods, sizeof(*d));
|
||||
module = module_new(impl, sizeof(*d));
|
||||
if (module == NULL) {
|
||||
res = -errno;
|
||||
goto out;
|
||||
|
|
@ -224,3 +217,10 @@ out:
|
|||
errno = -res;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
DEFINE_MODULE_INFO(module_roc_source) = {
|
||||
.name = "module-roc-source",
|
||||
.create = create_module_roc_source,
|
||||
.load = module_roc_source_load,
|
||||
.unload = module_roc_source_unload,
|
||||
};
|
||||
|
|
|
|||
|
|
@ -27,7 +27,6 @@
|
|||
|
||||
#include "../defs.h"
|
||||
#include "../module.h"
|
||||
#include "registry.h"
|
||||
|
||||
#define NAME "simple-protocol-tcp"
|
||||
|
||||
|
|
@ -115,12 +114,6 @@ static int module_simple_protocol_tcp_unload(struct module *module)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static const struct module_methods module_simple_protocol_tcp_methods = {
|
||||
VERSION_MODULE_METHODS,
|
||||
.load = module_simple_protocol_tcp_load,
|
||||
.unload = module_simple_protocol_tcp_unload,
|
||||
};
|
||||
|
||||
static const struct spa_dict_item module_simple_protocol_tcp_info[] = {
|
||||
{ PW_KEY_MODULE_AUTHOR, "Wim Taymans <wim.taymans@gmail.com>" },
|
||||
{ PW_KEY_MODULE_DESCRIPTION, "Simple protocol (TCP sockets)" },
|
||||
|
|
@ -204,7 +197,7 @@ struct module *create_module_simple_protocol_tcp(struct impl *impl, const char *
|
|||
pw_properties_setf(module_props, "server.address", "[ \"tcp:%s%s%s\" ]",
|
||||
listen ? listen : "", listen ? ":" : "", port);
|
||||
|
||||
module = module_new(impl, &module_simple_protocol_tcp_methods, sizeof(*d));
|
||||
module = module_new(impl, sizeof(*d));
|
||||
if (module == NULL) {
|
||||
res = -errno;
|
||||
goto out;
|
||||
|
|
@ -223,3 +216,10 @@ out:
|
|||
errno = -res;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
DEFINE_MODULE_INFO(module_simple_protocol_tcp) = {
|
||||
.name = "module-simple-protocol-tcp",
|
||||
.create = create_module_simple_protocol_tcp,
|
||||
.load = module_simple_protocol_tcp_load,
|
||||
.unload = module_simple_protocol_tcp_unload,
|
||||
};
|
||||
|
|
|
|||
|
|
@ -31,7 +31,6 @@
|
|||
|
||||
#include "../defs.h"
|
||||
#include "../module.h"
|
||||
#include "registry.h"
|
||||
|
||||
#include "../manager.h"
|
||||
#include "../collect.h"
|
||||
|
|
@ -234,12 +233,6 @@ static int module_switch_on_connect_unload(struct module *module)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static const struct module_methods module_switch_on_connect_methods = {
|
||||
VERSION_MODULE_METHODS,
|
||||
.load = module_switch_on_connect_load,
|
||||
.unload = module_switch_on_connect_unload,
|
||||
};
|
||||
|
||||
static const struct spa_dict_item module_switch_on_connect_info[] = {
|
||||
{ PW_KEY_MODULE_AUTHOR, "Pauli Virtanen <pav@iki.fi>" },
|
||||
{ PW_KEY_MODULE_DESCRIPTION, "Switch to new devices on connect. "
|
||||
|
|
@ -299,7 +292,7 @@ struct module *create_module_switch_on_connect(struct impl *impl, const char *ar
|
|||
|
||||
pw_properties_set(props, "blocklist", NULL);
|
||||
|
||||
module = module_new(impl, &module_switch_on_connect_methods, sizeof(*d));
|
||||
module = module_new(impl, sizeof(*d));
|
||||
if (module == NULL) {
|
||||
res = -errno;
|
||||
goto out;
|
||||
|
|
@ -329,3 +322,11 @@ out:
|
|||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
DEFINE_MODULE_INFO(module_switch_on_connect) = {
|
||||
.name = "module-switch-on-connect",
|
||||
.load_once = true,
|
||||
.create = create_module_switch_on_connect,
|
||||
.load = module_switch_on_connect_load,
|
||||
.unload = module_switch_on_connect_unload,
|
||||
};
|
||||
|
|
|
|||
|
|
@ -32,7 +32,6 @@
|
|||
|
||||
#include "../defs.h"
|
||||
#include "../module.h"
|
||||
#include "registry.h"
|
||||
|
||||
#define NAME "tunnel-sink"
|
||||
|
||||
|
|
@ -120,12 +119,6 @@ static int module_tunnel_sink_unload(struct module *module)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static const struct module_methods module_tunnel_sink_methods = {
|
||||
VERSION_MODULE_METHODS,
|
||||
.load = module_tunnel_sink_load,
|
||||
.unload = module_tunnel_sink_unload,
|
||||
};
|
||||
|
||||
static const struct spa_dict_item module_tunnel_sink_info[] = {
|
||||
{ PW_KEY_MODULE_AUTHOR, "Wim Taymans <wim.taymans@gmail.com>" },
|
||||
{ PW_KEY_MODULE_DESCRIPTION, "Create a network sink which connects to a remote PulseAudio server" },
|
||||
|
|
@ -219,7 +212,7 @@ struct module *create_module_tunnel_sink(struct impl *impl, const char *argument
|
|||
pw_properties_set(stream_props, PW_KEY_AUDIO_FORMAT, format_id2name(id));
|
||||
}
|
||||
|
||||
module = module_new(impl, &module_tunnel_sink_methods, sizeof(*d));
|
||||
module = module_new(impl, sizeof(*d));
|
||||
if (module == NULL) {
|
||||
res = -errno;
|
||||
goto out;
|
||||
|
|
@ -239,3 +232,10 @@ out:
|
|||
errno = -res;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
DEFINE_MODULE_INFO(module_tunnel_sink) = {
|
||||
.name = "module-tunnel-sink",
|
||||
.create = create_module_tunnel_sink,
|
||||
.load = module_tunnel_sink_load,
|
||||
.unload = module_tunnel_sink_unload,
|
||||
};
|
||||
|
|
|
|||
|
|
@ -32,7 +32,6 @@
|
|||
|
||||
#include "../defs.h"
|
||||
#include "../module.h"
|
||||
#include "registry.h"
|
||||
|
||||
#define NAME "tunnel-source"
|
||||
|
||||
|
|
@ -120,12 +119,6 @@ static int module_tunnel_source_unload(struct module *module)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static const struct module_methods module_tunnel_source_methods = {
|
||||
VERSION_MODULE_METHODS,
|
||||
.load = module_tunnel_source_load,
|
||||
.unload = module_tunnel_source_unload,
|
||||
};
|
||||
|
||||
static const struct spa_dict_item module_tunnel_source_info[] = {
|
||||
{ PW_KEY_MODULE_AUTHOR, "Wim Taymans <wim.taymans@gmail.com>" },
|
||||
{ PW_KEY_MODULE_DESCRIPTION, "Create a network source which connects to a remote PulseAudio server" },
|
||||
|
|
@ -209,7 +202,7 @@ struct module *create_module_tunnel_source(struct impl *impl, const char *argume
|
|||
|
||||
audio_info_to_props(&info, stream_props);
|
||||
|
||||
module = module_new(impl, &module_tunnel_source_methods, sizeof(*d));
|
||||
module = module_new(impl, sizeof(*d));
|
||||
if (module == NULL) {
|
||||
res = -errno;
|
||||
goto out;
|
||||
|
|
@ -229,3 +222,10 @@ out:
|
|||
errno = -res;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
DEFINE_MODULE_INFO(module_tunnel_source) = {
|
||||
.name = "module-tunnel-source",
|
||||
.create = create_module_tunnel_source,
|
||||
.load = module_tunnel_source_load,
|
||||
.unload = module_tunnel_source_unload,
|
||||
};
|
||||
|
|
|
|||
|
|
@ -100,12 +100,6 @@ static int module_x11_bell_unload(struct module *module)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static const struct module_methods module_x11_bell_methods = {
|
||||
VERSION_MODULE_METHODS,
|
||||
.load = module_x11_bell_load,
|
||||
.unload = module_x11_bell_unload,
|
||||
};
|
||||
|
||||
static const struct spa_dict_item module_x11_bell_info[] = {
|
||||
{ PW_KEY_MODULE_AUTHOR, "Wim Taymans <wim.taymans@gmail.com>" },
|
||||
{ PW_KEY_MODULE_DESCRIPTION, "X11 bell interceptor" },
|
||||
|
|
@ -132,7 +126,7 @@ struct module *create_module_x11_bell(struct impl *impl, const char *argument)
|
|||
if (argument)
|
||||
module_args_add_props(props, argument);
|
||||
|
||||
module = module_new(impl, &module_x11_bell_methods, sizeof(struct module_x11_bell_data));
|
||||
module = module_new(impl, sizeof(struct module_x11_bell_data));
|
||||
if (module == NULL) {
|
||||
res = -errno;
|
||||
goto out;
|
||||
|
|
@ -145,3 +139,10 @@ out:
|
|||
errno = -res;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
DEFINE_MODULE_INFO(module_x11_bell) = {
|
||||
.name = "module-x11-bell",
|
||||
.create = create_module_x11_bell,
|
||||
.load = module_x11_bell_load,
|
||||
.unload = module_x11_bell_unload,
|
||||
};
|
||||
|
|
|
|||
|
|
@ -28,7 +28,6 @@
|
|||
|
||||
#include "../defs.h"
|
||||
#include "../module.h"
|
||||
#include "registry.h"
|
||||
|
||||
#define NAME "zeroconf-discover"
|
||||
|
||||
|
|
@ -86,12 +85,6 @@ static int module_zeroconf_discover_unload(struct module *module)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static const struct module_methods module_zeroconf_discover_methods = {
|
||||
VERSION_MODULE_METHODS,
|
||||
.load = module_zeroconf_discover_load,
|
||||
.unload = module_zeroconf_discover_unload,
|
||||
};
|
||||
|
||||
static const struct spa_dict_item module_zeroconf_discover_info[] = {
|
||||
{ PW_KEY_MODULE_AUTHOR, "Wim Taymans <wim.taymans@gmail.con>" },
|
||||
{ PW_KEY_MODULE_DESCRIPTION, "mDNS/DNS-SD Service Discovery" },
|
||||
|
|
@ -116,7 +109,7 @@ struct module *create_module_zeroconf_discover(struct impl *impl, const char *ar
|
|||
if (argument != NULL)
|
||||
module_args_add_props(props, argument);
|
||||
|
||||
module = module_new(impl, &module_zeroconf_discover_methods, sizeof(*d));
|
||||
module = module_new(impl, sizeof(*d));
|
||||
if (module == NULL) {
|
||||
res = -errno;
|
||||
goto out;
|
||||
|
|
@ -132,3 +125,11 @@ out:
|
|||
errno = -res;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
DEFINE_MODULE_INFO(module_zeroconf_discover) = {
|
||||
.name = "module-zeroconf-discover",
|
||||
.load_once = true,
|
||||
.create = create_module_zeroconf_discover,
|
||||
.load = module_zeroconf_discover_load,
|
||||
.unload = module_zeroconf_discover_unload,
|
||||
};
|
||||
|
|
|
|||
|
|
@ -32,7 +32,6 @@
|
|||
#include "../manager.h"
|
||||
#include "../module.h"
|
||||
#include "../pulse-server.h"
|
||||
#include "registry.h"
|
||||
#include "../../module-zeroconf-discover/avahi-poll.h"
|
||||
|
||||
#include <avahi-client/client.h>
|
||||
|
|
@ -631,12 +630,6 @@ static int module_zeroconf_publish_unload(struct module *module)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static const struct module_methods module_zeroconf_publish_methods = {
|
||||
VERSION_MODULE_METHODS,
|
||||
.load = module_zeroconf_publish_load,
|
||||
.unload = module_zeroconf_publish_unload,
|
||||
};
|
||||
|
||||
static const struct spa_dict_item module_zeroconf_publish_info[] = {
|
||||
{ PW_KEY_MODULE_AUTHOR, "Sanchayan Maity <sanchayan@asymptotic.io" },
|
||||
{ PW_KEY_MODULE_DESCRIPTION, "mDNS/DNS-SD Service Publish" },
|
||||
|
|
@ -661,7 +654,7 @@ struct module *create_module_zeroconf_publish(struct impl *impl, const char *arg
|
|||
if (argument)
|
||||
module_args_add_props(props, argument);
|
||||
|
||||
module = module_new(impl, &module_zeroconf_publish_methods, sizeof(*d));
|
||||
module = module_new(impl, sizeof(*d));
|
||||
if (module == NULL) {
|
||||
res = -errno;
|
||||
goto out;
|
||||
|
|
@ -680,3 +673,10 @@ out:
|
|||
errno = -res;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
DEFINE_MODULE_INFO(module_zeroconf_publish) = {
|
||||
.name = "module-zeroconf-publish",
|
||||
.create = create_module_zeroconf_publish,
|
||||
.load = module_zeroconf_publish_load,
|
||||
.unload = module_zeroconf_publish_unload,
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1,54 +0,0 @@
|
|||
/* PipeWire
|
||||
*
|
||||
* Copyright © 2021 Wim Taymans <wim.taymans@gmail.com>
|
||||
* Copyright © 2021 Arun Raghavan <arun@asymptotic.io>
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice (including the next
|
||||
* paragraph) shall be included in all copies or substantial portions of the
|
||||
* Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
#ifndef PIPEWIRE_PULSE_MODULE_REGISTRY_H
|
||||
#define PIPEWIRE_PULSE_MODULE_REGISTRY_H
|
||||
|
||||
struct impl;
|
||||
|
||||
struct module *create_module_always_sink(struct impl *impl, const char *argument);
|
||||
struct module *create_module_combine_sink(struct impl *impl, const char *argument);
|
||||
struct module *create_module_echo_cancel(struct impl *impl, const char *argument);
|
||||
struct module *create_module_ladspa_sink(struct impl *impl, const char *argument);
|
||||
struct module *create_module_ladspa_source(struct impl *impl, const char *argument);
|
||||
struct module *create_module_loopback(struct impl *impl, const char *argument);
|
||||
struct module *create_module_native_protocol_tcp(struct impl *impl, const char *argument);
|
||||
struct module *create_module_null_sink(struct impl *impl, const char *argument);
|
||||
struct module *create_module_raop_discover(struct impl *impl, const char *argument);
|
||||
struct module *create_module_remap_sink(struct impl *impl, const char *argument);
|
||||
struct module *create_module_remap_source(struct impl *impl, const char *argument);
|
||||
struct module *create_module_tunnel_sink(struct impl *impl, const char *argument);
|
||||
struct module *create_module_tunnel_source(struct impl *impl, const char *argument);
|
||||
struct module *create_module_simple_protocol_tcp(struct impl *impl, const char *argument);
|
||||
struct module *create_module_switch_on_connect(struct impl *impl, const char *argument);
|
||||
struct module *create_module_pipe_source(struct impl *impl, const char *argument);
|
||||
struct module *create_module_pipe_sink(struct impl *impl, const char *argument);
|
||||
struct module *create_module_zeroconf_discover(struct impl *impl, const char *argument);
|
||||
struct module *create_module_zeroconf_publish(struct impl *impl, const char *argument);
|
||||
struct module *create_module_roc_sink(struct impl *impl, const char *argument);
|
||||
struct module *create_module_roc_source(struct impl *impl, const char *argument);
|
||||
struct module *create_module_x11_bell(struct impl *impl, const char *argument);
|
||||
|
||||
#endif
|
||||
|
|
@ -3353,7 +3353,7 @@ static int fill_ext_module_info(struct client *client, struct message *m,
|
|||
{
|
||||
message_put(m,
|
||||
TAG_U32, module->index, /* module index */
|
||||
TAG_STRING, module->name,
|
||||
TAG_STRING, module->info->name,
|
||||
TAG_STRING, module->args,
|
||||
TAG_U32, -1, /* n_used */
|
||||
TAG_INVALID);
|
||||
|
|
@ -4741,7 +4741,7 @@ static void handle_module_loaded(struct module *module, struct client *client, u
|
|||
|
||||
if (SPA_RESULT_IS_OK(result)) {
|
||||
pw_log_info("[%s] loaded module index:%u name:%s tag:%d",
|
||||
client_name, module->index, module->name, tag);
|
||||
client_name, module->index, module->info->name, tag);
|
||||
|
||||
module->loaded = true;
|
||||
|
||||
|
|
@ -4762,7 +4762,7 @@ static void handle_module_loaded(struct module *module, struct client *client, u
|
|||
else {
|
||||
pw_log_warn("%p: [%s] failed to load module index:%u name:%s tag:%d result:%d (%s)",
|
||||
impl, client_name,
|
||||
module->index, module->name, tag,
|
||||
module->index, module->info->name, tag,
|
||||
result, spa_strerror(result));
|
||||
|
||||
module_schedule_unload(module);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue