pw_module -> pw_impl_module

This commit is contained in:
Wim Taymans 2019-12-11 11:57:56 +01:00
parent 815d4a8d20
commit 443a49947e
25 changed files with 184 additions and 184 deletions

View file

@ -177,9 +177,9 @@ no_mem:
static int static int
execute_command_module_load(struct pw_command *command, struct pw_context *context, char **err) execute_command_module_load(struct pw_command *command, struct pw_context *context, char **err)
{ {
struct pw_module *module; struct pw_impl_module *module;
module = pw_module_load(context, command->args[1], command->args[2], NULL); module = pw_impl_module_load(context, command->args[1], command->args[2], NULL);
if (module == NULL) { if (module == NULL) {
asprintf(err, "could not load module \"%s\": %m", command->args[1]); asprintf(err, "could not load module \"%s\": %m", command->args[1]);
return -errno; return -errno;

View file

@ -115,7 +115,7 @@ int main(int argc, char *argv[])
data.library = argv[1]; data.library = argv[1];
data.factory = argv[2]; data.factory = argv[2];
pw_module_load(data.context, "libpipewire-module-spa-device-factory", NULL, NULL); pw_impl_module_load(data.context, "libpipewire-module-spa-device-factory", NULL, NULL);
data.core = pw_context_connect(data.context, NULL, 0); data.core = pw_context_connect(data.context, NULL, 0);
if (data.core == NULL) { if (data.core == NULL) {

View file

@ -150,7 +150,7 @@ int main(int argc, char *argv[])
if (argc > 3) if (argc > 3)
data.path = argv[3]; data.path = argv[3];
pw_module_load(data.context, "libpipewire-module-spa-node-factory", NULL, NULL); pw_impl_module_load(data.context, "libpipewire-module-spa-node-factory", NULL, NULL);
data.core = pw_context_connect(data.context, NULL, 0); data.core = pw_context_connect(data.context, NULL, 0);
if (data.core == NULL) { if (data.core == NULL) {

View file

@ -409,8 +409,8 @@ int main(int argc, char *argv[])
spa_hook_list_init(&data.hooks); spa_hook_list_init(&data.hooks);
pw_module_load(data.context, "libpipewire-module-spa-node-factory", NULL, NULL); pw_impl_module_load(data.context, "libpipewire-module-spa-node-factory", NULL, NULL);
pw_module_load(data.context, "libpipewire-module-link-factory", NULL, NULL); pw_impl_module_load(data.context, "libpipewire-module-link-factory", NULL, NULL);
if (SDL_Init(SDL_INIT_VIDEO) < 0) { if (SDL_Init(SDL_INIT_VIDEO) < 0) {
printf("can't initialize SDL: %s\n", SDL_GetError()); printf("can't initialize SDL: %s\n", SDL_GetError());

View file

@ -208,15 +208,15 @@ static void module_destroy(void *data)
free(impl); free(impl);
} }
static const struct pw_module_events module_events = { static const struct pw_impl_module_events module_events = {
PW_VERSION_MODULE_EVENTS, PW_VERSION_IMPL_MODULE_EVENTS,
.destroy = module_destroy, .destroy = module_destroy,
}; };
SPA_EXPORT SPA_EXPORT
int pipewire__module_init(struct pw_module *module, const char *args) int pipewire__module_init(struct pw_impl_module *module, const char *args)
{ {
struct pw_context *context = pw_module_get_context(module); struct pw_context *context = pw_impl_module_get_context(module);
struct pw_properties *props; struct pw_properties *props;
struct impl *impl; struct impl *impl;
@ -235,9 +235,9 @@ int pipewire__module_init(struct pw_module *module, const char *args)
impl->properties = props; impl->properties = props;
pw_context_add_listener(context, &impl->context_listener, &context_events, impl); pw_context_add_listener(context, &impl->context_listener, &context_events, impl);
pw_module_add_listener(module, &impl->module_listener, &module_events, impl); pw_impl_module_add_listener(module, &impl->module_listener, &module_events, impl);
pw_module_update_properties(module, &SPA_DICT_INIT_ARRAY(module_props)); pw_impl_module_update_properties(module, &SPA_DICT_INIT_ARRAY(module_props));
return 0; return 0;
} }

View file

@ -56,7 +56,7 @@ struct factory_data {
struct spa_list node_list; struct spa_list node_list;
struct pw_context *context; struct pw_context *context;
struct pw_module *module; struct pw_impl_module *module;
struct spa_hook module_listener; struct spa_hook module_listener;
}; };
@ -184,7 +184,7 @@ static void *create_object(void *_data,
goto error_no_mem; goto error_no_mem;
} }
adapter = pw_adapter_new(pw_module_get_context(d->module), adapter = pw_adapter_new(pw_impl_module_get_context(d->module),
slave, slave,
properties, properties,
sizeof(struct node_data)); sizeof(struct node_data));
@ -259,7 +259,7 @@ static void module_destroy(void *data)
static void module_registered(void *data) static void module_registered(void *data)
{ {
struct factory_data *d = data; struct factory_data *d = data;
struct pw_module *module = d->module; struct pw_impl_module *module = d->module;
struct pw_impl_factory *factory = d->this; struct pw_impl_factory *factory = d->this;
struct spa_dict_item items[1]; struct spa_dict_item items[1];
char id[16]; char id[16];
@ -274,16 +274,16 @@ static void module_registered(void *data)
} }
} }
static const struct pw_module_events module_events = { static const struct pw_impl_module_events module_events = {
PW_VERSION_MODULE_EVENTS, PW_VERSION_IMPL_MODULE_EVENTS,
.destroy = module_destroy, .destroy = module_destroy,
.registered = module_registered, .registered = module_registered,
}; };
SPA_EXPORT SPA_EXPORT
int pipewire__module_init(struct pw_module *module, const char *args) int pipewire__module_init(struct pw_impl_module *module, const char *args)
{ {
struct pw_context *context = pw_module_get_context(module); struct pw_context *context = pw_impl_module_get_context(module);
struct pw_impl_factory *factory; struct pw_impl_factory *factory;
struct factory_data *data; struct factory_data *data;
@ -310,9 +310,9 @@ int pipewire__module_init(struct pw_module *module, const char *args)
&impl_factory, &impl_factory,
data); data);
pw_module_update_properties(module, &SPA_DICT_INIT_ARRAY(module_props)); pw_impl_module_update_properties(module, &SPA_DICT_INIT_ARRAY(module_props));
pw_module_add_listener(module, &data->module_listener, &module_events, data); pw_impl_module_add_listener(module, &data->module_listener, &module_events, data);
return 0; return 0;
} }

View file

@ -52,7 +52,7 @@ struct pw_protocol *pw_protocol_native_ext_client_device_init(struct pw_context
struct factory_data { struct factory_data {
struct pw_impl_factory *this; struct pw_impl_factory *this;
struct pw_module *module; struct pw_impl_module *module;
struct spa_hook module_listener; struct spa_hook module_listener;
struct pw_export_type export_spadevice; struct pw_export_type export_spadevice;
@ -136,13 +136,13 @@ static void module_destroy(void *data)
static void module_registered(void *data) static void module_registered(void *data)
{ {
struct factory_data *d = data; struct factory_data *d = data;
struct pw_module *module = d->module; struct pw_impl_module *module = d->module;
struct pw_impl_factory *factory = d->this; struct pw_impl_factory *factory = d->this;
struct spa_dict_item items[1]; struct spa_dict_item items[1];
char id[16]; char id[16];
int res; int res;
snprintf(id, sizeof(id), "%d", pw_global_get_id(pw_module_get_global(module))); snprintf(id, sizeof(id), "%d", pw_global_get_id(pw_impl_module_get_global(module)));
items[0] = SPA_DICT_ITEM_INIT(PW_KEY_MODULE_ID, id); items[0] = SPA_DICT_ITEM_INIT(PW_KEY_MODULE_ID, id);
pw_impl_factory_update_properties(factory, &SPA_DICT_INIT(items, 1)); pw_impl_factory_update_properties(factory, &SPA_DICT_INIT(items, 1));
@ -151,16 +151,16 @@ static void module_registered(void *data)
} }
} }
static const struct pw_module_events module_events = { static const struct pw_impl_module_events module_events = {
PW_VERSION_MODULE_EVENTS, PW_VERSION_IMPL_MODULE_EVENTS,
.destroy = module_destroy, .destroy = module_destroy,
.registered = module_registered, .registered = module_registered,
}; };
SPA_EXPORT SPA_EXPORT
int pipewire__module_init(struct pw_module *module, const char *args) int pipewire__module_init(struct pw_impl_module *module, const char *args)
{ {
struct pw_context *context = pw_module_get_context(module); struct pw_context *context = pw_impl_module_get_context(module);
struct pw_impl_factory *factory; struct pw_impl_factory *factory;
struct factory_data *data; struct factory_data *data;
@ -191,9 +191,9 @@ int pipewire__module_init(struct pw_module *module, const char *args)
data->export_spadevice.func = pw_core_spa_device_export; data->export_spadevice.func = pw_core_spa_device_export;
pw_context_register_export_type(context, &data->export_spadevice); pw_context_register_export_type(context, &data->export_spadevice);
pw_module_add_listener(module, &data->module_listener, &module_events, data); pw_impl_module_add_listener(module, &data->module_listener, &module_events, data);
pw_module_update_properties(module, &SPA_DICT_INIT_ARRAY(module_props)); pw_impl_module_update_properties(module, &SPA_DICT_INIT_ARRAY(module_props));
return 0; return 0;
} }

View file

@ -55,7 +55,7 @@ struct pw_protocol *pw_protocol_native_ext_client_node0_init(struct pw_context *
struct factory_data { struct factory_data {
struct pw_impl_factory *this; struct pw_impl_factory *this;
struct pw_module *module; struct pw_impl_module *module;
struct spa_hook module_listener; struct spa_hook module_listener;
struct pw_export_type export_node; struct pw_export_type export_node;
@ -127,13 +127,13 @@ static void module_destroy(void *data)
static void module_registered(void *data) static void module_registered(void *data)
{ {
struct factory_data *d = data; struct factory_data *d = data;
struct pw_module *module = d->module; struct pw_impl_module *module = d->module;
struct pw_impl_factory *factory = d->this; struct pw_impl_factory *factory = d->this;
struct spa_dict_item items[1]; struct spa_dict_item items[1];
char id[16]; char id[16];
int res; int res;
snprintf(id, sizeof(id), "%d", pw_global_get_id(pw_module_get_global(module))); snprintf(id, sizeof(id), "%d", pw_global_get_id(pw_impl_module_get_global(module)));
items[0] = SPA_DICT_ITEM_INIT(PW_KEY_MODULE_ID, id); items[0] = SPA_DICT_ITEM_INIT(PW_KEY_MODULE_ID, id);
pw_impl_factory_update_properties(factory, &SPA_DICT_INIT(items, 1)); pw_impl_factory_update_properties(factory, &SPA_DICT_INIT(items, 1));
@ -142,16 +142,16 @@ static void module_registered(void *data)
} }
} }
static const struct pw_module_events module_events = { static const struct pw_impl_module_events module_events = {
PW_VERSION_MODULE_EVENTS, PW_VERSION_IMPL_MODULE_EVENTS,
.destroy = module_destroy, .destroy = module_destroy,
.registered = module_registered, .registered = module_registered,
}; };
SPA_EXPORT SPA_EXPORT
int pipewire__module_init(struct pw_module *module, const char *args) int pipewire__module_init(struct pw_impl_module *module, const char *args)
{ {
struct pw_context *context = pw_module_get_context(module); struct pw_context *context = pw_impl_module_get_context(module);
struct pw_impl_factory *factory; struct pw_impl_factory *factory;
struct factory_data *data; struct factory_data *data;
@ -185,9 +185,9 @@ int pipewire__module_init(struct pw_module *module, const char *args)
data->export_spanode.func = pw_core_spa_node_export; data->export_spanode.func = pw_core_spa_node_export;
pw_context_register_export_type(context, &data->export_spanode); pw_context_register_export_type(context, &data->export_spanode);
pw_module_add_listener(module, &data->module_listener, &module_events, data); pw_impl_module_add_listener(module, &data->module_listener, &module_events, data);
pw_module_update_properties(module, &SPA_DICT_INIT_ARRAY(module_props)); pw_impl_module_update_properties(module, &SPA_DICT_INIT_ARRAY(module_props));
return 0; return 0;
} }

View file

@ -48,7 +48,7 @@ static const struct spa_dict_item module_props[] = {
}; };
struct factory_data { struct factory_data {
struct pw_module *module; struct pw_impl_module *module;
struct pw_impl_factory *this; struct pw_impl_factory *this;
struct spa_list link_list; struct spa_list link_list;
@ -340,13 +340,13 @@ static void module_destroy(void *data)
static void module_registered(void *data) static void module_registered(void *data)
{ {
struct factory_data *d = data; struct factory_data *d = data;
struct pw_module *module = d->module; struct pw_impl_module *module = d->module;
struct pw_impl_factory *factory = d->this; struct pw_impl_factory *factory = d->this;
struct spa_dict_item items[1]; struct spa_dict_item items[1];
char id[16]; char id[16];
int res; int res;
snprintf(id, sizeof(id), "%d", pw_global_get_id(pw_module_get_global(module))); snprintf(id, sizeof(id), "%d", pw_global_get_id(pw_impl_module_get_global(module)));
items[0] = SPA_DICT_ITEM_INIT(PW_KEY_MODULE_ID, id); items[0] = SPA_DICT_ITEM_INIT(PW_KEY_MODULE_ID, id);
pw_impl_factory_update_properties(factory, &SPA_DICT_INIT(items, 1)); pw_impl_factory_update_properties(factory, &SPA_DICT_INIT(items, 1));
@ -355,16 +355,16 @@ static void module_registered(void *data)
} }
} }
static const struct pw_module_events module_events = { static const struct pw_impl_module_events module_events = {
PW_VERSION_MODULE_EVENTS, PW_VERSION_IMPL_MODULE_EVENTS,
.destroy = module_destroy, .destroy = module_destroy,
.registered = module_registered, .registered = module_registered,
}; };
SPA_EXPORT SPA_EXPORT
int pipewire__module_init(struct pw_module *module, const char *args) int pipewire__module_init(struct pw_impl_module *module, const char *args)
{ {
struct pw_context *context = pw_module_get_context(module); struct pw_context *context = pw_impl_module_get_context(module);
struct pw_impl_factory *factory; struct pw_impl_factory *factory;
struct factory_data *data; struct factory_data *data;
@ -390,9 +390,9 @@ int pipewire__module_init(struct pw_module *module, const char *args)
&impl_factory, &impl_factory,
data); data);
pw_module_update_properties(module, &SPA_DICT_INIT_ARRAY(module_props)); pw_impl_module_update_properties(module, &SPA_DICT_INIT_ARRAY(module_props));
pw_module_add_listener(module, &data->module_listener, &module_events, data); pw_impl_module_add_listener(module, &data->module_listener, &module_events, data);
return 0; return 0;
} }

View file

@ -54,7 +54,7 @@ int pw_protocol_native_ext_metadata_init(struct pw_context *context);
struct factory_data { struct factory_data {
struct pw_impl_factory *this; struct pw_impl_factory *this;
struct pw_module *module; struct pw_impl_module *module;
struct spa_hook module_listener; struct spa_hook module_listener;
struct pw_export_type export_metadata; struct pw_export_type export_metadata;
@ -122,13 +122,13 @@ static void module_destroy(void *data)
static void module_registered(void *data) static void module_registered(void *data)
{ {
struct factory_data *d = data; struct factory_data *d = data;
struct pw_module *module = d->module; struct pw_impl_module *module = d->module;
struct pw_impl_factory *factory = d->this; struct pw_impl_factory *factory = d->this;
struct spa_dict_item items[1]; struct spa_dict_item items[1];
char id[16]; char id[16];
int res; int res;
snprintf(id, sizeof(id), "%d", pw_global_get_id(pw_module_get_global(module))); snprintf(id, sizeof(id), "%d", pw_global_get_id(pw_impl_module_get_global(module)));
items[0] = SPA_DICT_ITEM_INIT(PW_KEY_MODULE_ID, id); items[0] = SPA_DICT_ITEM_INIT(PW_KEY_MODULE_ID, id);
pw_impl_factory_update_properties(factory, &SPA_DICT_INIT(items, 1)); pw_impl_factory_update_properties(factory, &SPA_DICT_INIT(items, 1));
@ -137,16 +137,16 @@ static void module_registered(void *data)
} }
} }
static const struct pw_module_events module_events = { static const struct pw_impl_module_events module_events = {
PW_VERSION_MODULE_EVENTS, PW_VERSION_IMPL_MODULE_EVENTS,
.destroy = module_destroy, .destroy = module_destroy,
.registered = module_registered, .registered = module_registered,
}; };
SPA_EXPORT SPA_EXPORT
int pipewire__module_init(struct pw_module *module, const char *args) int pipewire__module_init(struct pw_impl_module *module, const char *args)
{ {
struct pw_context *context = pw_module_get_context(module); struct pw_context *context = pw_impl_module_get_context(module);
struct pw_impl_factory *factory; struct pw_impl_factory *factory;
struct factory_data *data; struct factory_data *data;
int res; int res;
@ -177,9 +177,9 @@ int pipewire__module_init(struct pw_module *module, const char *args)
data->export_metadata.func = pw_core_metadata_export; data->export_metadata.func = pw_core_metadata_export;
pw_context_register_export_type(context, &data->export_metadata); pw_context_register_export_type(context, &data->export_metadata);
pw_module_add_listener(module, &data->module_listener, &module_events, data); pw_impl_module_add_listener(module, &data->module_listener, &module_events, data);
pw_module_update_properties(module, &SPA_DICT_INIT_ARRAY(module_props)); pw_impl_module_update_properties(module, &SPA_DICT_INIT_ARRAY(module_props));
return 0; return 0;
} }

View file

@ -71,7 +71,7 @@ void pw_protocol_native_init(struct pw_protocol *protocol);
void pw_protocol_native0_init(struct pw_protocol *protocol); void pw_protocol_native0_init(struct pw_protocol *protocol);
struct protocol_data { struct protocol_data {
struct pw_module *module; struct pw_impl_module *module;
struct spa_hook module_listener; struct spa_hook module_listener;
struct pw_protocol *protocol; struct pw_protocol *protocol;
@ -1076,15 +1076,15 @@ static void module_destroy(void *data)
pw_protocol_destroy(d->protocol); pw_protocol_destroy(d->protocol);
} }
static const struct pw_module_events module_events = { static const struct pw_impl_module_events module_events = {
PW_VERSION_MODULE_EVENTS, PW_VERSION_IMPL_MODULE_EVENTS,
.destroy = module_destroy, .destroy = module_destroy,
}; };
SPA_EXPORT SPA_EXPORT
int pipewire__module_init(struct pw_module *module, const char *args) int pipewire__module_init(struct pw_impl_module *module, const char *args)
{ {
struct pw_context *context = pw_module_get_context(module); struct pw_context *context = pw_impl_module_get_context(module);
struct pw_protocol *this; struct pw_protocol *this;
const char *val; const char *val;
struct protocol_data *d; struct protocol_data *d;
@ -1126,9 +1126,9 @@ int pipewire__module_init(struct pw_module *module, const char *args)
} }
} }
pw_module_add_listener(module, &d->module_listener, &module_events, d); pw_impl_module_add_listener(module, &d->module_listener, &module_events, d);
pw_module_update_properties(module, &SPA_DICT_INIT_ARRAY(module_props)); pw_impl_module_update_properties(module, &SPA_DICT_INIT_ARRAY(module_props));
return 0; return 0;

View file

@ -426,8 +426,8 @@ static void module_destroy(void *data)
free(impl); free(impl);
} }
static const struct pw_module_events module_events = { static const struct pw_impl_module_events module_events = {
PW_VERSION_MODULE_EVENTS, PW_VERSION_IMPL_MODULE_EVENTS,
.destroy = module_destroy, .destroy = module_destroy,
}; };
@ -484,9 +484,9 @@ static void idle_func(struct spa_source *source)
} }
SPA_EXPORT SPA_EXPORT
int pipewire__module_init(struct pw_module *module, const char *args) int pipewire__module_init(struct pw_impl_module *module, const char *args)
{ {
struct pw_context *context = pw_module_get_context(module); struct pw_context *context = pw_impl_module_get_context(module);
struct impl *impl; struct impl *impl;
struct spa_loop *loop; struct spa_loop *loop;
struct spa_system *system; struct spa_system *system;
@ -526,9 +526,9 @@ int pipewire__module_init(struct pw_module *module, const char *args)
spa_loop_add_source(impl->loop, &impl->source); spa_loop_add_source(impl->loop, &impl->source);
pw_module_add_listener(module, &impl->module_listener, &module_events, impl); pw_impl_module_add_listener(module, &impl->module_listener, &module_events, impl);
pw_module_update_properties(module, &SPA_DICT_INIT_ARRAY(module_props)); pw_impl_module_update_properties(module, &SPA_DICT_INIT_ARRAY(module_props));
return 0; return 0;

View file

@ -28,9 +28,9 @@
#include <pipewire/impl.h> #include <pipewire/impl.h>
/* client-endpoint.c */ /* client-endpoint.c */
int client_endpoint_factory_init(struct pw_module *module); int client_endpoint_factory_init(struct pw_impl_module *module);
/* client-session.c */ /* client-session.c */
int client_session_factory_init(struct pw_module *module); int client_session_factory_init(struct pw_impl_module *module);
/* protocol-native.c */ /* protocol-native.c */
struct pw_protocol *pw_protocol_native_ext_session_manager_init(struct pw_context *context); struct pw_protocol *pw_protocol_native_ext_session_manager_init(struct pw_context *context);
@ -41,16 +41,16 @@ static const struct spa_dict_item module_props[] = {
}; };
SPA_EXPORT SPA_EXPORT
int pipewire__module_init(struct pw_module *module, const char *args) int pipewire__module_init(struct pw_impl_module *module, const char *args)
{ {
struct pw_context *context = pw_module_get_context(module); struct pw_context *context = pw_impl_module_get_context(module);
client_endpoint_factory_init(module); client_endpoint_factory_init(module);
client_session_factory_init(module); client_session_factory_init(module);
pw_protocol_native_ext_session_manager_init(context); pw_protocol_native_ext_session_manager_init(context);
pw_module_update_properties(module, &SPA_DICT_INIT_ARRAY(module_props)); pw_impl_module_update_properties(module, &SPA_DICT_INIT_ARRAY(module_props));
return 0; return 0;
} }

View file

@ -39,7 +39,7 @@
struct factory_data { struct factory_data {
struct pw_impl_factory *factory; struct pw_impl_factory *factory;
struct pw_module *module; struct pw_impl_module *module;
struct spa_hook module_listener; struct spa_hook module_listener;
}; };
@ -229,7 +229,7 @@ static void module_destroy(void *data)
static void module_registered(void *data) static void module_registered(void *data)
{ {
struct factory_data *d = data; struct factory_data *d = data;
struct pw_module *module = d->module; struct pw_impl_module *module = d->module;
struct pw_impl_factory *factory = d->factory; struct pw_impl_factory *factory = d->factory;
struct spa_dict_item items[1]; struct spa_dict_item items[1];
char id[16]; char id[16];
@ -244,15 +244,15 @@ static void module_registered(void *data)
} }
} }
static const struct pw_module_events module_events = { static const struct pw_impl_module_events module_events = {
PW_VERSION_MODULE_EVENTS, PW_VERSION_IMPL_MODULE_EVENTS,
.destroy = module_destroy, .destroy = module_destroy,
.registered = module_registered, .registered = module_registered,
}; };
int client_endpoint_factory_init(struct pw_module *module) int client_endpoint_factory_init(struct pw_impl_module *module)
{ {
struct pw_context *context = pw_module_get_context(module); struct pw_context *context = pw_impl_module_get_context(module);
struct pw_impl_factory *factory; struct pw_impl_factory *factory;
struct factory_data *data; struct factory_data *data;
@ -271,7 +271,7 @@ int client_endpoint_factory_init(struct pw_module *module)
pw_impl_factory_set_implementation(factory, &impl_factory, data); pw_impl_factory_set_implementation(factory, &impl_factory, data);
pw_module_add_listener(module, &data->module_listener, &module_events, data); pw_impl_module_add_listener(module, &data->module_listener, &module_events, data);
return 0; return 0;
} }

View file

@ -53,7 +53,7 @@ struct client_endpoint {
#define pw_client_endpoint_resource_create_link(r,...) \ #define pw_client_endpoint_resource_create_link(r,...) \
pw_client_endpoint_resource(r,create_link,0,__VA_ARGS__) pw_client_endpoint_resource(r,create_link,0,__VA_ARGS__)
int client_endpoint_factory_init(struct pw_module *module); int client_endpoint_factory_init(struct pw_impl_module *module);
#ifdef __cplusplus #ifdef __cplusplus
} /* extern "C" */ } /* extern "C" */

View file

@ -39,7 +39,7 @@
struct factory_data { struct factory_data {
struct pw_impl_factory *factory; struct pw_impl_factory *factory;
struct pw_module *module; struct pw_impl_module *module;
struct spa_hook module_listener; struct spa_hook module_listener;
}; };
@ -228,7 +228,7 @@ static void module_destroy(void *data)
static void module_registered(void *data) static void module_registered(void *data)
{ {
struct factory_data *d = data; struct factory_data *d = data;
struct pw_module *module = d->module; struct pw_impl_module *module = d->module;
struct pw_impl_factory *factory = d->factory; struct pw_impl_factory *factory = d->factory;
struct spa_dict_item items[1]; struct spa_dict_item items[1];
char id[16]; char id[16];
@ -243,15 +243,15 @@ static void module_registered(void *data)
} }
} }
static const struct pw_module_events module_events = { static const struct pw_impl_module_events module_events = {
PW_VERSION_MODULE_EVENTS, PW_VERSION_IMPL_MODULE_EVENTS,
.destroy = module_destroy, .destroy = module_destroy,
.registered = module_registered, .registered = module_registered,
}; };
int client_session_factory_init(struct pw_module *module) int client_session_factory_init(struct pw_impl_module *module)
{ {
struct pw_context *context = pw_module_get_context(module); struct pw_context *context = pw_impl_module_get_context(module);
struct pw_impl_factory *factory; struct pw_impl_factory *factory;
struct factory_data *data; struct factory_data *data;
@ -270,7 +270,7 @@ int client_session_factory_init(struct pw_module *module)
pw_impl_factory_set_implementation(factory, &impl_factory, data); pw_impl_factory_set_implementation(factory, &impl_factory, data);
pw_module_add_listener(module, &data->module_listener, &module_events, data); pw_impl_module_add_listener(module, &data->module_listener, &module_events, data);
return 0; return 0;
} }

View file

@ -48,7 +48,7 @@ static const struct spa_dict_item module_props[] = {
struct factory_data { struct factory_data {
struct pw_context *context; struct pw_context *context;
struct pw_module *module; struct pw_impl_module *module;
struct pw_impl_factory *this; struct pw_impl_factory *this;
struct spa_hook factory_listener; struct spa_hook factory_listener;
@ -177,13 +177,13 @@ static void module_destroy(void *_data)
static void module_registered(void *data) static void module_registered(void *data)
{ {
struct factory_data *d = data; struct factory_data *d = data;
struct pw_module *module = d->module; struct pw_impl_module *module = d->module;
struct pw_impl_factory *factory = d->this; struct pw_impl_factory *factory = d->this;
struct spa_dict_item items[1]; struct spa_dict_item items[1];
char id[16]; char id[16];
int res; int res;
snprintf(id, sizeof(id), "%d", pw_global_get_id(pw_module_get_global(module))); snprintf(id, sizeof(id), "%d", pw_global_get_id(pw_impl_module_get_global(module)));
items[0] = SPA_DICT_ITEM_INIT(PW_KEY_MODULE_ID, id); items[0] = SPA_DICT_ITEM_INIT(PW_KEY_MODULE_ID, id);
pw_impl_factory_update_properties(factory, &SPA_DICT_INIT(items, 1)); pw_impl_factory_update_properties(factory, &SPA_DICT_INIT(items, 1));
@ -192,16 +192,16 @@ static void module_registered(void *data)
} }
} }
static const struct pw_module_events module_events = { static const struct pw_impl_module_events module_events = {
PW_VERSION_MODULE_EVENTS, PW_VERSION_IMPL_MODULE_EVENTS,
.destroy = module_destroy, .destroy = module_destroy,
.registered = module_registered, .registered = module_registered,
}; };
SPA_EXPORT SPA_EXPORT
int pipewire__module_init(struct pw_module *module, const char *args) int pipewire__module_init(struct pw_impl_module *module, const char *args)
{ {
struct pw_context *context = pw_module_get_context(module); struct pw_context *context = pw_impl_module_get_context(module);
struct pw_impl_factory *factory; struct pw_impl_factory *factory;
struct factory_data *data; struct factory_data *data;
@ -224,9 +224,9 @@ int pipewire__module_init(struct pw_module *module, const char *args)
pw_impl_factory_set_implementation(factory, &factory_impl, data); pw_impl_factory_set_implementation(factory, &factory_impl, data);
pw_log_debug("module %p: new", module); pw_log_debug("module %p: new", module);
pw_module_update_properties(module, &SPA_DICT_INIT_ARRAY(module_props)); pw_impl_module_update_properties(module, &SPA_DICT_INIT_ARRAY(module_props));
pw_module_add_listener(module, &data->module_listener, &module_events, data); pw_impl_module_add_listener(module, &data->module_listener, &module_events, data);
return 0; return 0;
} }

View file

@ -58,18 +58,18 @@ static void module_destroy(void *_data)
pw_impl_device_destroy(data->this); pw_impl_device_destroy(data->this);
} }
static const struct pw_module_events module_events = { static const struct pw_impl_module_events module_events = {
PW_VERSION_MODULE_EVENTS, PW_VERSION_IMPL_MODULE_EVENTS,
.destroy = module_destroy, .destroy = module_destroy,
}; };
SPA_EXPORT SPA_EXPORT
int pipewire__module_init(struct pw_module *module, const char *args) int pipewire__module_init(struct pw_impl_module *module, const char *args)
{ {
struct pw_properties *props = NULL; struct pw_properties *props = NULL;
char **argv = NULL; char **argv = NULL;
int n_tokens; int n_tokens;
struct pw_context *context = pw_module_get_context(module); struct pw_context *context = pw_impl_module_get_context(module);
struct pw_impl_device *device; struct pw_impl_device *device;
struct device_data *data; struct device_data *data;
int res; int res;
@ -106,9 +106,9 @@ int pipewire__module_init(struct pw_module *module, const char *args)
data->context = context; data->context = context;
pw_log_debug("module %p: new", module); pw_log_debug("module %p: new", module);
pw_module_add_listener(module, &data->module_listener, &module_events, data); pw_impl_module_add_listener(module, &data->module_listener, &module_events, data);
pw_module_update_properties(module, &SPA_DICT_INIT_ARRAY(module_props)); pw_impl_module_update_properties(module, &SPA_DICT_INIT_ARRAY(module_props));
return 0; return 0;

View file

@ -49,7 +49,7 @@ static const struct spa_dict_item module_props[] = {
struct factory_data { struct factory_data {
struct pw_context *context; struct pw_context *context;
struct pw_impl_factory *this; struct pw_impl_factory *this;
struct pw_module *module; struct pw_impl_module *module;
struct spa_hook factory_listener; struct spa_hook factory_listener;
struct spa_hook module_listener; struct spa_hook module_listener;
@ -211,13 +211,13 @@ static void module_destroy(void *_data)
static void module_registered(void *data) static void module_registered(void *data)
{ {
struct factory_data *d = data; struct factory_data *d = data;
struct pw_module *module = d->module; struct pw_impl_module *module = d->module;
struct pw_impl_factory *factory = d->this; struct pw_impl_factory *factory = d->this;
struct spa_dict_item items[1]; struct spa_dict_item items[1];
char id[16]; char id[16];
int res; int res;
snprintf(id, sizeof(id), "%d", pw_global_get_id(pw_module_get_global(module))); snprintf(id, sizeof(id), "%d", pw_global_get_id(pw_impl_module_get_global(module)));
items[0] = SPA_DICT_ITEM_INIT(PW_KEY_MODULE_ID, id); items[0] = SPA_DICT_ITEM_INIT(PW_KEY_MODULE_ID, id);
pw_impl_factory_update_properties(factory, &SPA_DICT_INIT(items, 1)); pw_impl_factory_update_properties(factory, &SPA_DICT_INIT(items, 1));
@ -226,16 +226,16 @@ static void module_registered(void *data)
} }
} }
static const struct pw_module_events module_events = { static const struct pw_impl_module_events module_events = {
PW_VERSION_MODULE_EVENTS, PW_VERSION_IMPL_MODULE_EVENTS,
.destroy = module_destroy, .destroy = module_destroy,
.registered = module_registered, .registered = module_registered,
}; };
SPA_EXPORT SPA_EXPORT
int pipewire__module_init(struct pw_module *module, const char *args) int pipewire__module_init(struct pw_impl_module *module, const char *args)
{ {
struct pw_context *context = pw_module_get_context(module); struct pw_context *context = pw_impl_module_get_context(module);
struct pw_impl_factory *factory; struct pw_impl_factory *factory;
struct factory_data *data; struct factory_data *data;
@ -258,9 +258,9 @@ int pipewire__module_init(struct pw_module *module, const char *args)
pw_impl_factory_set_implementation(factory, &factory_impl, data); pw_impl_factory_set_implementation(factory, &factory_impl, data);
pw_log_debug("module %p: new", module); pw_log_debug("module %p: new", module);
pw_module_add_listener(module, &data->module_listener, &module_events, data); pw_impl_module_add_listener(module, &data->module_listener, &module_events, data);
pw_module_update_properties(module, &SPA_DICT_INIT_ARRAY(module_props)); pw_impl_module_update_properties(module, &SPA_DICT_INIT_ARRAY(module_props));
return 0; return 0;
} }

View file

@ -59,18 +59,18 @@ static void module_destroy(void *_data)
pw_node_destroy(data->this); pw_node_destroy(data->this);
} }
static const struct pw_module_events module_events = { static const struct pw_impl_module_events module_events = {
PW_VERSION_MODULE_EVENTS, PW_VERSION_IMPL_MODULE_EVENTS,
.destroy = module_destroy, .destroy = module_destroy,
}; };
SPA_EXPORT SPA_EXPORT
int pipewire__module_init(struct pw_module *module, const char *args) int pipewire__module_init(struct pw_impl_module *module, const char *args)
{ {
struct pw_properties *props = NULL; struct pw_properties *props = NULL;
char **argv = NULL; char **argv = NULL;
int n_tokens, res; int n_tokens, res;
struct pw_context *context = pw_module_get_context(module); struct pw_context *context = pw_impl_module_get_context(module);
struct pw_node *node; struct pw_node *node;
struct node_data *data; struct node_data *data;
@ -108,9 +108,9 @@ int pipewire__module_init(struct pw_module *module, const char *args)
data->properties = props; data->properties = props;
pw_log_debug("module %p: new", module); pw_log_debug("module %p: new", module);
pw_module_add_listener(module, &data->module_listener, &module_events, data); pw_impl_module_add_listener(module, &data->module_listener, &module_events, data);
pw_module_update_properties(module, &SPA_DICT_INIT_ARRAY(module_props)); pw_impl_module_update_properties(module, &SPA_DICT_INIT_ARRAY(module_props));
return 0; return 0;

View file

@ -455,13 +455,13 @@ static int load_module_profile(struct pw_context *this, const char *profile)
{ {
pw_log_debug(NAME" %p: module profile %s", this, profile); pw_log_debug(NAME" %p: module profile %s", this, profile);
if (strcmp(profile, "default") == 0) { if (strcmp(profile, "default") == 0) {
pw_module_load(this, "libpipewire-module-rtkit", NULL, NULL); pw_impl_module_load(this, "libpipewire-module-rtkit", NULL, NULL);
pw_module_load(this, "libpipewire-module-protocol-native", NULL, NULL); pw_impl_module_load(this, "libpipewire-module-protocol-native", NULL, NULL);
pw_module_load(this, "libpipewire-module-client-node", NULL, NULL); pw_impl_module_load(this, "libpipewire-module-client-node", NULL, NULL);
pw_module_load(this, "libpipewire-module-client-device", NULL, NULL); pw_impl_module_load(this, "libpipewire-module-client-device", NULL, NULL);
pw_module_load(this, "libpipewire-module-adapter", NULL, NULL); pw_impl_module_load(this, "libpipewire-module-adapter", NULL, NULL);
pw_module_load(this, "libpipewire-module-metadata", NULL, NULL); pw_impl_module_load(this, "libpipewire-module-metadata", NULL, NULL);
pw_module_load(this, "libpipewire-module-session-manager", NULL, NULL); pw_impl_module_load(this, "libpipewire-module-session-manager", NULL, NULL);
} }
return 0; return 0;
} }
@ -649,7 +649,7 @@ void pw_context_destroy(struct pw_context *context)
{ {
struct impl *impl = SPA_CONTAINER_OF(context, struct impl, this); struct impl *impl = SPA_CONTAINER_OF(context, struct impl, this);
struct pw_global *global; struct pw_global *global;
struct pw_module *module; struct pw_impl_module *module;
struct pw_impl_device *device; struct pw_impl_device *device;
struct pw_core *core; struct pw_core *core;
struct pw_resource *resource; struct pw_resource *resource;
@ -665,7 +665,7 @@ void pw_context_destroy(struct pw_context *context)
pw_core_disconnect(core); pw_core_disconnect(core);
spa_list_consume(module, &context->module_list, link) spa_list_consume(module, &context->module_list, link)
pw_module_destroy(module); pw_impl_module_destroy(module);
spa_list_consume(node, &context->node_list, link) spa_list_consume(node, &context->node_list, link)
pw_node_destroy(node); pw_node_destroy(node);

View file

@ -40,7 +40,7 @@
/** \cond */ /** \cond */
struct impl { struct impl {
struct pw_module this; struct pw_impl_module this;
void *hnd; void *hnd;
}; };
@ -120,7 +120,7 @@ static int
global_bind(void *_data, struct pw_impl_client *client, uint32_t permissions, global_bind(void *_data, struct pw_impl_client *client, uint32_t permissions,
uint32_t version, uint32_t id) uint32_t version, uint32_t id)
{ {
struct pw_module *this = _data; struct pw_impl_module *this = _data;
struct pw_global *global = this->global; struct pw_global *global = this->global;
struct pw_resource *resource; struct pw_resource *resource;
struct resource_data *data; struct resource_data *data;
@ -150,10 +150,10 @@ error_resource:
static void global_destroy(void *object) static void global_destroy(void *object)
{ {
struct pw_module *module = object; struct pw_impl_module *module = object;
spa_hook_remove(&module->global_listener); spa_hook_remove(&module->global_listener);
module->global = NULL; module->global = NULL;
pw_module_destroy(module); pw_impl_module_destroy(module);
} }
static const struct pw_global_events global_events = { static const struct pw_global_events global_events = {
@ -167,23 +167,23 @@ static const struct pw_global_events global_events = {
* \param name name of the module to load * \param name name of the module to load
* \param args A string with arguments for the module * \param args A string with arguments for the module
* \param[out] error Return location for an error string, or NULL * \param[out] error Return location for an error string, or NULL
* \return A \ref pw_module if the module could be loaded, or NULL on failure. * \return A \ref pw_impl_module if the module could be loaded, or NULL on failure.
* *
* \memberof pw_module * \memberof pw_impl_module
*/ */
SPA_EXPORT SPA_EXPORT
struct pw_module * struct pw_impl_module *
pw_module_load(struct pw_context *context, pw_impl_module_load(struct pw_context *context,
const char *name, const char *args, const char *name, const char *args,
struct pw_properties *properties) struct pw_properties *properties)
{ {
struct pw_module *this; struct pw_impl_module *this;
struct impl *impl; struct impl *impl;
void *hnd; void *hnd;
char *filename = NULL; char *filename = NULL;
const char *module_dir; const char *module_dir;
int res; int res;
pw_module_init_func_t init_func; pw_impl_module_init_func_t init_func;
module_dir = getenv("PIPEWIRE_MODULE_DIR"); module_dir = getenv("PIPEWIRE_MODULE_DIR");
if (module_dir != NULL) { if (module_dir != NULL) {
@ -261,7 +261,7 @@ pw_module_load(struct pw_context *context,
pw_properties_setf(this->properties, PW_KEY_OBJECT_ID, "%d", this->info.id); pw_properties_setf(this->properties, PW_KEY_OBJECT_ID, "%d", this->info.id);
this->info.props = &this->properties->dict; this->info.props = &this->properties->dict;
pw_module_emit_initialized(this); pw_impl_module_emit_initialized(this);
pw_global_add_listener(this->global, &this->global_listener, &global_events, this); pw_global_add_listener(this->global, &this->global_listener, &global_events, this);
@ -270,7 +270,7 @@ pw_module_load(struct pw_context *context,
pw_global_register(this->global); pw_global_register(this->global);
pw_module_emit_registered(this); pw_impl_module_emit_registered(this);
pw_log_debug(NAME" %p: loaded module: %s", this, this->info.name); pw_log_debug(NAME" %p: loaded module: %s", this, this->info.name);
@ -301,7 +301,7 @@ error_init_failed:
goto error_free_module; goto error_free_module;
error_free_module: error_free_module:
pw_module_destroy(this); pw_impl_module_destroy(this);
error_close: error_close:
if (hnd) if (hnd)
dlclose(hnd); dlclose(hnd);
@ -317,15 +317,15 @@ error_cleanup:
/** Destroy a module /** Destroy a module
* \param module the module to destroy * \param module the module to destroy
* \memberof pw_module * \memberof pw_impl_module
*/ */
SPA_EXPORT SPA_EXPORT
void pw_module_destroy(struct pw_module *module) void pw_impl_module_destroy(struct pw_impl_module *module)
{ {
struct impl *impl = SPA_CONTAINER_OF(module, struct impl, this); struct impl *impl = SPA_CONTAINER_OF(module, struct impl, this);
pw_log_debug(NAME" %p: destroy", module); pw_log_debug(NAME" %p: destroy", module);
pw_module_emit_destroy(module); pw_impl_module_emit_destroy(module);
if (module->global) { if (module->global) {
spa_list_remove(&module->link); spa_list_remove(&module->link);
@ -334,7 +334,7 @@ void pw_module_destroy(struct pw_module *module)
} }
pw_log_debug(NAME" %p: free", module); pw_log_debug(NAME" %p: free", module);
pw_module_emit_free(module); pw_impl_module_emit_free(module);
free((char *) module->info.name); free((char *) module->info.name);
free((char *) module->info.filename); free((char *) module->info.filename);
free((char *) module->info.args); free((char *) module->info.args);
@ -348,25 +348,25 @@ void pw_module_destroy(struct pw_module *module)
SPA_EXPORT SPA_EXPORT
struct pw_context * struct pw_context *
pw_module_get_context(struct pw_module *module) pw_impl_module_get_context(struct pw_impl_module *module)
{ {
return module->context; return module->context;
} }
SPA_EXPORT SPA_EXPORT
struct pw_global * pw_module_get_global(struct pw_module *module) struct pw_global * pw_impl_module_get_global(struct pw_impl_module *module)
{ {
return module->global; return module->global;
} }
SPA_EXPORT SPA_EXPORT
const struct pw_properties *pw_module_get_properties(struct pw_module *module) const struct pw_properties *pw_impl_module_get_properties(struct pw_impl_module *module)
{ {
return module->properties; return module->properties;
} }
SPA_EXPORT SPA_EXPORT
int pw_module_update_properties(struct pw_module *module, const struct spa_dict *dict) int pw_impl_module_update_properties(struct pw_impl_module *module, const struct spa_dict *dict)
{ {
struct pw_resource *resource; struct pw_resource *resource;
int changed; int changed;
@ -390,15 +390,15 @@ int pw_module_update_properties(struct pw_module *module, const struct spa_dict
SPA_EXPORT SPA_EXPORT
const struct pw_module_info * const struct pw_module_info *
pw_module_get_info(struct pw_module *module) pw_impl_module_get_info(struct pw_impl_module *module)
{ {
return &module->info; return &module->info;
} }
SPA_EXPORT SPA_EXPORT
void pw_module_add_listener(struct pw_module *module, void pw_impl_module_add_listener(struct pw_impl_module *module,
struct spa_hook *listener, struct spa_hook *listener,
const struct pw_module_events *events, const struct pw_impl_module_events *events,
void *data) void *data)
{ {
spa_hook_list_append(&module->listener_list, listener, events, data); spa_hook_list_append(&module->listener_list, listener, events, data);

View file

@ -23,8 +23,8 @@
* DEALINGS IN THE SOFTWARE. * DEALINGS IN THE SOFTWARE.
*/ */
#ifndef PIPEWIRE_MODULE_H #ifndef PIPEWIRE_IMPL_MODULE_H
#define PIPEWIRE_MODULE_H #define PIPEWIRE_IMPL_MODULE_H
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
@ -37,28 +37,28 @@ extern "C" {
#define PIPEWIRE_SYMBOL_MODULE_INIT "pipewire__module_init" #define PIPEWIRE_SYMBOL_MODULE_INIT "pipewire__module_init"
#define PIPEWIRE_MODULE_PREFIX "libpipewire-" #define PIPEWIRE_MODULE_PREFIX "libpipewire-"
/** \class pw_module /** \class pw_impl_module
* *
* A dynamically loadable module * A dynamically loadable module
*/ */
struct pw_module; struct pw_impl_module;
/** Module init function signature /** Module init function signature
* *
* \param module A \ref pw_module * \param module A \ref pw_impl_module
* \param args Arguments to the module * \param args Arguments to the module
* \return 0 on success, < 0 otherwise with an errno style error * \return 0 on success, < 0 otherwise with an errno style error
* *
* A module should provide an init function with this signature. This function * A module should provide an init function with this signature. This function
* will be called when a module is loaded. * will be called when a module is loaded.
* *
* \memberof pw_module * \memberof pw_impl_module
*/ */
typedef int (*pw_module_init_func_t) (struct pw_module *module, const char *args); typedef int (*pw_impl_module_init_func_t) (struct pw_impl_module *module, const char *args);
/** Module events added with \ref pw_module_add_listener */ /** Module events added with \ref pw_impl_module_add_listener */
struct pw_module_events { struct pw_impl_module_events {
#define PW_VERSION_MODULE_EVENTS 0 #define PW_VERSION_IMPL_MODULE_EVENTS 0
uint32_t version; uint32_t version;
/** The module is destroyed */ /** The module is destroyed */
@ -73,38 +73,38 @@ struct pw_module_events {
void (*registered) (void *data); void (*registered) (void *data);
}; };
struct pw_module * struct pw_impl_module *
pw_module_load(struct pw_context *context, pw_impl_module_load(struct pw_context *context,
const char *name, /**< name of the module */ const char *name, /**< name of the module */
const char *args /**< arguments of the module */, const char *args /**< arguments of the module */,
struct pw_properties *properties /**< extra global properties */); struct pw_properties *properties /**< extra global properties */);
/** Get the context of a module */ /** Get the context of a module */
struct pw_context * pw_module_get_context(struct pw_module *module); struct pw_context * pw_impl_module_get_context(struct pw_impl_module *module);
/** Get the global of a module */ /** Get the global of a module */
struct pw_global * pw_module_get_global(struct pw_module *module); struct pw_global * pw_impl_module_get_global(struct pw_impl_module *module);
/** Get the node properties */ /** Get the node properties */
const struct pw_properties *pw_module_get_properties(struct pw_module *module); const struct pw_properties *pw_impl_module_get_properties(struct pw_impl_module *module);
/** Update the module properties */ /** Update the module properties */
int pw_module_update_properties(struct pw_module *module, const struct spa_dict *dict); int pw_impl_module_update_properties(struct pw_impl_module *module, const struct spa_dict *dict);
/** Get the module info */ /** Get the module info */
const struct pw_module_info *pw_module_get_info(struct pw_module *module); const struct pw_module_info *pw_impl_module_get_info(struct pw_impl_module *module);
/** Add an event listener to a module */ /** Add an event listener to a module */
void pw_module_add_listener(struct pw_module *module, void pw_impl_module_add_listener(struct pw_impl_module *module,
struct spa_hook *listener, struct spa_hook *listener,
const struct pw_module_events *events, const struct pw_impl_module_events *events,
void *data); void *data);
/** Destroy a module */ /** Destroy a module */
void pw_module_destroy(struct pw_module *module); void pw_impl_module_destroy(struct pw_impl_module *module);
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#endif /* PIPEWIRE_MODULE_H */ #endif /* PIPEWIRE_IMPL_MODULE_H */

View file

@ -300,13 +300,13 @@ struct pw_impl_device {
unsigned int registered:1; unsigned int registered:1;
}; };
#define pw_module_emit(o,m,v,...) spa_hook_list_call(&o->listener_list, struct pw_module_events, m, v, ##__VA_ARGS__) #define pw_impl_module_emit(o,m,v,...) spa_hook_list_call(&o->listener_list, struct pw_impl_module_events, m, v, ##__VA_ARGS__)
#define pw_module_emit_destroy(m) pw_module_emit(m, destroy, 0) #define pw_impl_module_emit_destroy(m) pw_impl_module_emit(m, destroy, 0)
#define pw_module_emit_free(m) pw_module_emit(m, free, 0) #define pw_impl_module_emit_free(m) pw_impl_module_emit(m, free, 0)
#define pw_module_emit_initialized(m) pw_module_emit(m, initialized, 0) #define pw_impl_module_emit_initialized(m) pw_impl_module_emit(m, initialized, 0)
#define pw_module_emit_registered(m) pw_module_emit(m, registered, 0) #define pw_impl_module_emit_registered(m) pw_impl_module_emit(m, registered, 0)
struct pw_module { struct pw_impl_module {
struct pw_context *context; /**< the context object */ struct pw_context *context; /**< the context object */
struct spa_list link; /**< link in the context module_list */ struct spa_list link; /**< link in the context module_list */
struct pw_global *global; /**< global object for this module */ struct pw_global *global; /**< global object for this module */

View file

@ -238,7 +238,7 @@ static bool do_help(struct data *data, const char *cmd, char *args, char **error
static bool do_load_module(struct data *data, const char *cmd, char *args, char **error) static bool do_load_module(struct data *data, const char *cmd, char *args, char **error)
{ {
struct pw_module *module; struct pw_impl_module *module;
char *a[2]; char *a[2];
int n; int n;
uint32_t id; uint32_t id;
@ -249,14 +249,14 @@ static bool do_load_module(struct data *data, const char *cmd, char *args, char
return false; return false;
} }
module = pw_module_load(data->context, a[0], n == 2 ? a[1] : NULL, NULL); module = pw_impl_module_load(data->context, a[0], n == 2 ? a[1] : NULL, NULL);
if (module == NULL) { if (module == NULL) {
asprintf(error, "Could not load module"); asprintf(error, "Could not load module");
return false; return false;
} }
id = pw_map_insert_new(&data->vars, module); id = pw_map_insert_new(&data->vars, module);
fprintf(stdout, "%d = @module:%d\n", id, pw_global_get_id(pw_module_get_global(module))); fprintf(stdout, "%d = @module:%d\n", id, pw_global_get_id(pw_impl_module_get_global(module)));
return true; return true;
} }
@ -1648,7 +1648,7 @@ int main(int argc, char *argv[])
data.context = pw_context_new(l, pw_properties_new(PW_KEY_CORE_DAEMON, "1", NULL), 0); data.context = pw_context_new(l, pw_properties_new(PW_KEY_CORE_DAEMON, "1", NULL), 0);
info = pw_context_get_info(data.context); info = pw_context_get_info(data.context);
pw_module_load(data.context, "libpipewire-module-link-factory", NULL, NULL); pw_impl_module_load(data.context, "libpipewire-module-link-factory", NULL, NULL);
pw_loop_add_io(l, STDIN_FILENO, SPA_IO_IN|SPA_IO_HUP, false, do_input, &data); pw_loop_add_io(l, STDIN_FILENO, SPA_IO_IN|SPA_IO_HUP, false, do_input, &data);