use SPA_EXPORT to export symbols

This commit is contained in:
Wim Taymans 2019-02-06 13:24:41 +01:00
parent a563050797
commit 569cbb48a9
52 changed files with 326 additions and 24 deletions

View file

@ -42,7 +42,11 @@ have_cpp = add_languages('cpp', required : false)
cc = meson.get_compiler('c') cc = meson.get_compiler('c')
if cc.get_id() == 'gcc' if cc.get_id() == 'gcc'
add_global_arguments('-Wsign-compare', '-Wimplicit-fallthrough', '-Wpointer-arith', language : 'c') add_global_arguments('-fvisibility=hidden',
'-Wsign-compare',
'-Wimplicit-fallthrough',
'-Wpointer-arith',
language : 'c')
endif endif
cdata = configuration_data() cdata = configuration_data()

@ -1 +1 @@
Subproject commit ea1f9e18f7a61d7632c2d65248f99b6abf33f140 Subproject commit ddd753cfc5161797f624b4795e8c7bb71ebfad6d

@ -1 +1 @@
Subproject commit 13d51dfe379c288309d1eb907ba3390de171b4f8 Subproject commit 96460ab2d1260df22698e2a08509ee657b26d4dd

@ -1 +1 @@
Subproject commit 6cd1104d0c9fb0213f371e7b4b12925d70e2f2d7 Subproject commit 5f9200d9ee58271e60ff24e91e07fa340d71d494

View file

@ -31,6 +31,7 @@ extern const struct spa_handle_factory spa_alsa_sink_factory;
extern const struct spa_handle_factory spa_alsa_monitor_factory; extern const struct spa_handle_factory spa_alsa_monitor_factory;
extern const struct spa_handle_factory spa_alsa_device_factory; extern const struct spa_handle_factory spa_alsa_device_factory;
SPA_EXPORT
int spa_handle_factory_enum(const struct spa_handle_factory **factory, uint32_t *index) int spa_handle_factory_enum(const struct spa_handle_factory **factory, uint32_t *index)
{ {
spa_return_val_if_fail(factory != NULL, -EINVAL); spa_return_val_if_fail(factory != NULL, -EINVAL);

View file

@ -33,8 +33,8 @@ extern const struct spa_handle_factory spa_resample_factory;
extern const struct spa_handle_factory spa_splitter_factory; extern const struct spa_handle_factory spa_splitter_factory;
extern const struct spa_handle_factory spa_merger_factory; extern const struct spa_handle_factory spa_merger_factory;
int SPA_EXPORT
spa_handle_factory_enum(const struct spa_handle_factory **factory, uint32_t *index) int spa_handle_factory_enum(const struct spa_handle_factory **factory, uint32_t *index)
{ {
spa_return_val_if_fail(factory != NULL, -EINVAL); spa_return_val_if_fail(factory != NULL, -EINVAL);
spa_return_val_if_fail(index != NULL, -EINVAL); spa_return_val_if_fail(index != NULL, -EINVAL);

View file

@ -28,8 +28,8 @@
extern const struct spa_handle_factory spa_audiomixer_factory; extern const struct spa_handle_factory spa_audiomixer_factory;
int SPA_EXPORT
spa_handle_factory_enum(const struct spa_handle_factory **factory, uint32_t *index) int spa_handle_factory_enum(const struct spa_handle_factory **factory, uint32_t *index)
{ {
spa_return_val_if_fail(factory != NULL, -EINVAL); spa_return_val_if_fail(factory != NULL, -EINVAL);
spa_return_val_if_fail(index != NULL, -EINVAL); spa_return_val_if_fail(index != NULL, -EINVAL);

View file

@ -28,8 +28,8 @@
extern const struct spa_handle_factory spa_audiotestsrc_factory; extern const struct spa_handle_factory spa_audiotestsrc_factory;
int SPA_EXPORT
spa_handle_factory_enum(const struct spa_handle_factory **factory, uint32_t *index) int spa_handle_factory_enum(const struct spa_handle_factory **factory, uint32_t *index)
{ {
spa_return_val_if_fail(factory != NULL, -EINVAL); spa_return_val_if_fail(factory != NULL, -EINVAL);
spa_return_val_if_fail(index != NULL, -EINVAL); spa_return_val_if_fail(index != NULL, -EINVAL);

View file

@ -29,8 +29,8 @@
extern const struct spa_handle_factory spa_bluez5_monitor_factory; extern const struct spa_handle_factory spa_bluez5_monitor_factory;
int SPA_EXPORT
spa_handle_factory_enum(const struct spa_handle_factory **factory, uint32_t *index) int spa_handle_factory_enum(const struct spa_handle_factory **factory, uint32_t *index)
{ {
spa_return_val_if_fail(factory != NULL, -EINVAL); spa_return_val_if_fail(factory != NULL, -EINVAL);
spa_return_val_if_fail(index != NULL, -EINVAL); spa_return_val_if_fail(index != NULL, -EINVAL);

View file

@ -82,6 +82,7 @@ ffmpeg_enum_interface_info(const struct spa_handle_factory *factory,
return 1; return 1;
} }
SPA_EXPORT
int spa_handle_factory_enum(const struct spa_handle_factory **factory, uint32_t *index) int spa_handle_factory_enum(const struct spa_handle_factory **factory, uint32_t *index)
{ {
static const AVCodec *c = NULL; static const AVCodec *c = NULL;

View file

@ -424,8 +424,8 @@ static const struct spa_handle_factory dbus_factory = {
impl_enum_interface_info, impl_enum_interface_info,
}; };
int SPA_EXPORT
spa_handle_factory_enum(const struct spa_handle_factory **factory, uint32_t *index) int spa_handle_factory_enum(const struct spa_handle_factory **factory, uint32_t *index)
{ {
spa_return_val_if_fail(factory != NULL, -EINVAL); spa_return_val_if_fail(factory != NULL, -EINVAL);
spa_return_val_if_fail(index != NULL, -EINVAL); spa_return_val_if_fail(index != NULL, -EINVAL);

View file

@ -31,8 +31,8 @@ extern const struct spa_handle_factory spa_support_logger_factory;
extern const struct spa_handle_factory spa_support_loop_factory; extern const struct spa_handle_factory spa_support_loop_factory;
extern const struct spa_handle_factory spa_support_cpu_factory; extern const struct spa_handle_factory spa_support_cpu_factory;
SPA_EXPORT int SPA_EXPORT
spa_handle_factory_enum(const struct spa_handle_factory **factory, uint32_t *index) int spa_handle_factory_enum(const struct spa_handle_factory **factory, uint32_t *index)
{ {
spa_return_val_if_fail(factory != NULL, -EINVAL); spa_return_val_if_fail(factory != NULL, -EINVAL);
spa_return_val_if_fail(index != NULL, -EINVAL); spa_return_val_if_fail(index != NULL, -EINVAL);

View file

@ -29,8 +29,8 @@
extern const struct spa_handle_factory spa_fakesrc_factory; extern const struct spa_handle_factory spa_fakesrc_factory;
extern const struct spa_handle_factory spa_fakesink_factory; extern const struct spa_handle_factory spa_fakesink_factory;
int SPA_EXPORT
spa_handle_factory_enum(const struct spa_handle_factory **factory, uint32_t *index) int spa_handle_factory_enum(const struct spa_handle_factory **factory, uint32_t *index)
{ {
spa_return_val_if_fail(factory != NULL, -EINVAL); spa_return_val_if_fail(factory != NULL, -EINVAL);
spa_return_val_if_fail(index != NULL, -EINVAL); spa_return_val_if_fail(index != NULL, -EINVAL);

View file

@ -30,8 +30,8 @@ extern const struct spa_handle_factory spa_v4l2_source_factory;
extern const struct spa_handle_factory spa_v4l2_monitor_factory; extern const struct spa_handle_factory spa_v4l2_monitor_factory;
extern const struct spa_handle_factory spa_v4l2_device_factory; extern const struct spa_handle_factory spa_v4l2_device_factory;
int SPA_EXPORT
spa_handle_factory_enum(const struct spa_handle_factory **factory, int spa_handle_factory_enum(const struct spa_handle_factory **factory,
uint32_t *index) uint32_t *index)
{ {
spa_return_val_if_fail(factory != NULL, -EINVAL); spa_return_val_if_fail(factory != NULL, -EINVAL);

View file

@ -28,8 +28,8 @@
extern const struct spa_handle_factory spa_videotestsrc_factory; extern const struct spa_handle_factory spa_videotestsrc_factory;
int SPA_EXPORT
spa_handle_factory_enum(const struct spa_handle_factory **factory, uint32_t *index) int spa_handle_factory_enum(const struct spa_handle_factory **factory, uint32_t *index)
{ {
spa_return_val_if_fail(factory != NULL, -EINVAL); spa_return_val_if_fail(factory != NULL, -EINVAL);
spa_return_val_if_fail(index != NULL, -EINVAL); spa_return_val_if_fail(index != NULL, -EINVAL);

View file

@ -28,6 +28,7 @@
extern const struct spa_handle_factory spa_volume_factory; extern const struct spa_handle_factory spa_volume_factory;
SPA_EXPORT
int spa_handle_factory_enum(const struct spa_handle_factory **factory, uint32_t *index) int spa_handle_factory_enum(const struct spa_handle_factory **factory, uint32_t *index)
{ {
spa_return_val_if_fail(factory != NULL, -EINVAL); spa_return_val_if_fail(factory != NULL, -EINVAL);

View file

@ -204,6 +204,7 @@ static const struct pw_module_events module_events = {
.destroy = module_destroy, .destroy = module_destroy,
}; };
SPA_EXPORT
int pipewire__module_init(struct pw_module *module, const char *args) int pipewire__module_init(struct pw_module *module, const char *args)
{ {
struct pw_core *core = pw_module_get_core(module); struct pw_core *core = pw_module_get_core(module);

View file

@ -235,6 +235,7 @@ static int module_init(struct pw_module *module, struct pw_properties *propertie
return 0; return 0;
} }
SPA_EXPORT
int pipewire__module_init(struct pw_module *module, const char *args) int pipewire__module_init(struct pw_module *module, const char *args)
{ {
return module_init(module, NULL); return module_init(module, NULL);

View file

@ -167,6 +167,7 @@ static int module_init(struct pw_module *module, struct pw_properties *propertie
return 0; return 0;
} }
SPA_EXPORT
int pipewire__module_init(struct pw_module *module, const char *args) int pipewire__module_init(struct pw_module *module, const char *args)
{ {
return module_init(module, NULL); return module_init(module, NULL);

View file

@ -338,6 +338,7 @@ static int module_init(struct pw_module *module, struct pw_properties *propertie
return 0; return 0;
} }
SPA_EXPORT
int pipewire__module_init(struct pw_module *module, const char *args) int pipewire__module_init(struct pw_module *module, const char *args)
{ {
return module_init(module, NULL); return module_init(module, NULL);

View file

@ -631,6 +631,7 @@ static void pw_protocol_dbus_destroy(struct impl *impl)
} }
#endif #endif
SPA_EXPORT
int pipewire__module_init(struct pw_module *module, const char *args) int pipewire__module_init(struct pw_module *module, const char *args)
{ {
pw_protocol_dbus_new(module->core, NULL); pw_protocol_dbus_new(module->core, NULL);

View file

@ -879,6 +879,7 @@ static int module_init(struct pw_module *module, struct pw_properties *propertie
return 0; return 0;
} }
SPA_EXPORT
int pipewire__module_init(struct pw_module *module, const char *args) int pipewire__module_init(struct pw_module *module, const char *args)
{ {
return module_init(module, NULL); return module_init(module, NULL);

View file

@ -525,6 +525,7 @@ static int module_init(struct pw_module *module, struct pw_properties *propertie
} }
SPA_EXPORT
int pipewire__module_init(struct pw_module *module, const char *args) int pipewire__module_init(struct pw_module *module, const char *args)
{ {
return module_init(module, NULL); return module_init(module, NULL);

View file

@ -62,6 +62,7 @@ static const struct pw_module_events module_events = {
.destroy = module_destroy, .destroy = module_destroy,
}; };
SPA_EXPORT
int pipewire__module_init(struct pw_module *module, const char *args) int pipewire__module_init(struct pw_module *module, const char *args)
{ {
struct pw_properties *props = NULL; struct pw_properties *props = NULL;

View file

@ -63,6 +63,7 @@ const struct pw_module_events module_events = {
.destroy = module_destroy, .destroy = module_destroy,
}; };
SPA_EXPORT
int pipewire__module_init(struct pw_module *module, const char *args) int pipewire__module_init(struct pw_module *module, const char *args)
{ {
const char *dir; const char *dir;

View file

@ -205,6 +205,7 @@ static int module_init(struct pw_module *module, struct pw_properties *propertie
return 0; return 0;
} }
SPA_EXPORT
int pipewire__module_init(struct pw_module *module, const char *args) int pipewire__module_init(struct pw_module *module, const char *args)
{ {
return module_init(module, NULL); return module_init(module, NULL);

View file

@ -64,6 +64,7 @@ static const struct pw_module_events module_events = {
.destroy = module_destroy, .destroy = module_destroy,
}; };
SPA_EXPORT
int pipewire__module_init(struct pw_module *module, const char *args) int pipewire__module_init(struct pw_module *module, const char *args)
{ {
struct pw_properties *props = NULL; struct pw_properties *props = NULL;

View file

@ -225,6 +225,7 @@ static const struct pw_core_events core_events = {
* *
* \memberof pw_client * \memberof pw_client
*/ */
SPA_EXPORT
struct pw_client *pw_client_new(struct pw_core *core, struct pw_client *pw_client_new(struct pw_core *core,
struct ucred *ucred, struct ucred *ucred,
struct pw_properties *properties, struct pw_properties *properties,
@ -295,6 +296,7 @@ static const struct pw_global_events global_events = {
.bind = global_bind, .bind = global_bind,
}; };
SPA_EXPORT
int pw_client_register(struct pw_client *client, int pw_client_register(struct pw_client *client,
struct pw_client *owner, struct pw_client *owner,
struct pw_global *parent, struct pw_global *parent,
@ -321,31 +323,37 @@ int pw_client_register(struct pw_client *client,
return 0; return 0;
} }
SPA_EXPORT
struct pw_core *pw_client_get_core(struct pw_client *client) struct pw_core *pw_client_get_core(struct pw_client *client)
{ {
return client->core; return client->core;
} }
SPA_EXPORT
struct pw_resource *pw_client_get_core_resource(struct pw_client *client) struct pw_resource *pw_client_get_core_resource(struct pw_client *client)
{ {
return client->core_resource; return client->core_resource;
} }
SPA_EXPORT
struct pw_resource *pw_client_find_resource(struct pw_client *client, uint32_t id) struct pw_resource *pw_client_find_resource(struct pw_client *client, uint32_t id)
{ {
return pw_map_lookup(&client->objects, id); return pw_map_lookup(&client->objects, id);
} }
SPA_EXPORT
struct pw_global *pw_client_get_global(struct pw_client *client) struct pw_global *pw_client_get_global(struct pw_client *client)
{ {
return client->global; return client->global;
} }
SPA_EXPORT
const struct pw_properties *pw_client_get_properties(struct pw_client *client) const struct pw_properties *pw_client_get_properties(struct pw_client *client)
{ {
return client->properties; return client->properties;
} }
SPA_EXPORT
const struct ucred *pw_client_get_ucred(struct pw_client *client) const struct ucred *pw_client_get_ucred(struct pw_client *client)
{ {
if (!client->ucred_valid) if (!client->ucred_valid)
@ -354,6 +362,7 @@ const struct ucred *pw_client_get_ucred(struct pw_client *client)
return &client->ucred; return &client->ucred;
} }
SPA_EXPORT
void *pw_client_get_user_data(struct pw_client *client) void *pw_client_get_user_data(struct pw_client *client)
{ {
return client->user_data; return client->user_data;
@ -373,6 +382,7 @@ static int destroy_resource(void *object, void *data)
* *
* \memberof pw_client * \memberof pw_client
*/ */
SPA_EXPORT
void pw_client_destroy(struct pw_client *client) void pw_client_destroy(struct pw_client *client)
{ {
struct impl *impl = SPA_CONTAINER_OF(client, struct impl, this); struct impl *impl = SPA_CONTAINER_OF(client, struct impl, this);
@ -403,6 +413,7 @@ void pw_client_destroy(struct pw_client *client)
free(impl); free(impl);
} }
SPA_EXPORT
void pw_client_add_listener(struct pw_client *client, void pw_client_add_listener(struct pw_client *client,
struct spa_hook *listener, struct spa_hook *listener,
const struct pw_client_events *events, const struct pw_client_events *events,
@ -411,6 +422,7 @@ void pw_client_add_listener(struct pw_client *client,
spa_hook_list_append(&client->listener_list, listener, events, data); spa_hook_list_append(&client->listener_list, listener, events, data);
} }
SPA_EXPORT
const struct pw_client_info *pw_client_get_info(struct pw_client *client) const struct pw_client_info *pw_client_get_info(struct pw_client *client)
{ {
return &client->info; return &client->info;
@ -427,6 +439,7 @@ const struct pw_client_info *pw_client_get_info(struct pw_client *client)
* *
* \memberof pw_client * \memberof pw_client
*/ */
SPA_EXPORT
int pw_client_update_properties(struct pw_client *client, const struct spa_dict *dict) int pw_client_update_properties(struct pw_client *client, const struct spa_dict *dict)
{ {
struct pw_resource *resource; struct pw_resource *resource;
@ -453,6 +466,7 @@ int pw_client_update_properties(struct pw_client *client, const struct spa_dict
return changed; return changed;
} }
SPA_EXPORT
int pw_client_update_permissions(struct pw_client *client, int pw_client_update_permissions(struct pw_client *client,
uint32_t n_permissions, const struct pw_permission *permissions) uint32_t n_permissions, const struct pw_permission *permissions)
{ {
@ -511,6 +525,7 @@ int pw_client_update_permissions(struct pw_client *client,
return 0; return 0;
} }
SPA_EXPORT
void pw_client_set_busy(struct pw_client *client, bool busy) void pw_client_set_busy(struct pw_client *client, bool busy)
{ {
if (client->busy != busy) { if (client->busy != busy) {

View file

@ -187,6 +187,7 @@ static struct pw_command *parse_command_exec(const char *line, char **err)
* *
* \memberof pw_command * \memberof pw_command
*/ */
SPA_EXPORT
void pw_command_free(struct pw_command *command) void pw_command_free(struct pw_command *command)
{ {
struct impl *impl = SPA_CONTAINER_OF(command, struct impl, this); struct impl *impl = SPA_CONTAINER_OF(command, struct impl, this);
@ -206,6 +207,7 @@ void pw_command_free(struct pw_command *command)
* *
* \memberof pw_command * \memberof pw_command
*/ */
SPA_EXPORT
struct pw_command *pw_command_parse(const char *line, char **err) struct pw_command *pw_command_parse(const char *line, char **err)
{ {
struct pw_command *command = NULL; struct pw_command *command = NULL;
@ -239,6 +241,7 @@ struct pw_command *pw_command_parse(const char *line, char **err)
* *
* \memberof pw_command * \memberof pw_command
*/ */
SPA_EXPORT
int pw_command_run(struct pw_command *command, struct pw_core *core, char **err) int pw_command_run(struct pw_command *command, struct pw_core *core, char **err)
{ {
return command->func(command, core, err); return command->func(command, core, err);

View file

@ -124,11 +124,13 @@ void pw_control_destroy(struct pw_control *control)
free(control); free(control);
} }
SPA_EXPORT
struct pw_port *pw_control_get_port(struct pw_control *control) struct pw_port *pw_control_get_port(struct pw_control *control)
{ {
return control->port; return control->port;
} }
SPA_EXPORT
void pw_control_add_listener(struct pw_control *control, void pw_control_add_listener(struct pw_control *control,
struct spa_hook *listener, struct spa_hook *listener,
const struct pw_control_events *events, const struct pw_control_events *events,
@ -137,6 +139,7 @@ void pw_control_add_listener(struct pw_control *control,
spa_hook_list_append(&control->listener_list, listener, events, data); spa_hook_list_append(&control->listener_list, listener, events, data);
} }
SPA_EXPORT
int pw_control_link(struct pw_control *control, struct pw_control *other) int pw_control_link(struct pw_control *control, struct pw_control *other)
{ {
int res = 0; int res = 0;
@ -215,6 +218,7 @@ int pw_control_link(struct pw_control *control, struct pw_control *other)
return res; return res;
} }
SPA_EXPORT
int pw_control_unlink(struct pw_control *control, struct pw_control *other) int pw_control_unlink(struct pw_control *control, struct pw_control *other)
{ {
int res = 0; int res = 0;

View file

@ -385,6 +385,7 @@ static const struct pw_global_events global_events = {
* *
* \memberof pw_core * \memberof pw_core
*/ */
SPA_EXPORT
struct pw_core *pw_core_new(struct pw_loop *main_loop, struct pw_core *pw_core_new(struct pw_loop *main_loop,
struct pw_properties *properties, struct pw_properties *properties,
size_t user_data_size) size_t user_data_size)
@ -497,6 +498,7 @@ struct pw_core *pw_core_new(struct pw_loop *main_loop,
* *
* \memberof pw_core * \memberof pw_core
*/ */
SPA_EXPORT
void pw_core_destroy(struct pw_core *core) void pw_core_destroy(struct pw_core *core)
{ {
struct impl *impl = SPA_CONTAINER_OF(core, struct impl, this); struct impl *impl = SPA_CONTAINER_OF(core, struct impl, this);
@ -540,21 +542,25 @@ void pw_core_destroy(struct pw_core *core)
free(core); free(core);
} }
SPA_EXPORT
void *pw_core_get_user_data(struct pw_core *core) void *pw_core_get_user_data(struct pw_core *core)
{ {
return core->user_data; return core->user_data;
} }
SPA_EXPORT
const struct pw_core_info *pw_core_get_info(struct pw_core *core) const struct pw_core_info *pw_core_get_info(struct pw_core *core)
{ {
return &core->info; return &core->info;
} }
SPA_EXPORT
struct pw_global *pw_core_get_global(struct pw_core *core) struct pw_global *pw_core_get_global(struct pw_core *core)
{ {
return core->global; return core->global;
} }
SPA_EXPORT
void pw_core_add_listener(struct pw_core *core, void pw_core_add_listener(struct pw_core *core,
struct spa_hook *listener, struct spa_hook *listener,
const struct pw_core_events *events, const struct pw_core_events *events,
@ -563,17 +569,20 @@ void pw_core_add_listener(struct pw_core *core,
spa_hook_list_append(&core->listener_list, listener, events, data); spa_hook_list_append(&core->listener_list, listener, events, data);
} }
SPA_EXPORT
const struct spa_support *pw_core_get_support(struct pw_core *core, uint32_t *n_support) const struct spa_support *pw_core_get_support(struct pw_core *core, uint32_t *n_support)
{ {
*n_support = core->n_support; *n_support = core->n_support;
return core->support; return core->support;
} }
SPA_EXPORT
struct pw_loop *pw_core_get_main_loop(struct pw_core *core) struct pw_loop *pw_core_get_main_loop(struct pw_core *core)
{ {
return core->main_loop; return core->main_loop;
} }
SPA_EXPORT
const struct pw_properties *pw_core_get_properties(struct pw_core *core) const struct pw_properties *pw_core_get_properties(struct pw_core *core)
{ {
return core->properties; return core->properties;
@ -588,6 +597,7 @@ const struct pw_properties *pw_core_get_properties(struct pw_core *core)
* *
* \memberof pw_core * \memberof pw_core
*/ */
SPA_EXPORT
int pw_core_update_properties(struct pw_core *core, const struct spa_dict *dict) int pw_core_update_properties(struct pw_core *core, const struct spa_dict *dict)
{ {
struct pw_resource *resource; struct pw_resource *resource;
@ -614,6 +624,7 @@ int pw_core_update_properties(struct pw_core *core, const struct spa_dict *dict)
return changed; return changed;
} }
SPA_EXPORT
int pw_core_for_each_global(struct pw_core *core, int pw_core_for_each_global(struct pw_core *core,
int (*callback) (void *data, struct pw_global *global), int (*callback) (void *data, struct pw_global *global),
void *data) void *data)
@ -631,6 +642,7 @@ int pw_core_for_each_global(struct pw_core *core,
return 0; return 0;
} }
SPA_EXPORT
struct pw_global *pw_core_find_global(struct pw_core *core, uint32_t id) struct pw_global *pw_core_find_global(struct pw_core *core, uint32_t id)
{ {
struct pw_global *global; struct pw_global *global;
@ -876,6 +888,7 @@ int pw_core_find_format(struct pw_core *core,
* *
* \memberof pw_core * \memberof pw_core
*/ */
SPA_EXPORT
struct pw_factory *pw_core_find_factory(struct pw_core *core, struct pw_factory *pw_core_find_factory(struct pw_core *core,
const char *name) const char *name)
{ {

View file

@ -44,6 +44,7 @@ struct node_data {
struct spa_hook node_listener; struct spa_hook node_listener;
}; };
SPA_EXPORT
struct pw_device *pw_device_new(struct pw_core *core, struct pw_device *pw_device_new(struct pw_core *core,
const char *name, const char *name,
struct pw_properties *properties, struct pw_properties *properties,
@ -81,6 +82,7 @@ struct pw_device *pw_device_new(struct pw_core *core,
return NULL; return NULL;
} }
SPA_EXPORT
void pw_device_destroy(struct pw_device *device) void pw_device_destroy(struct pw_device *device)
{ {
struct node_data *nd; struct node_data *nd;
@ -115,6 +117,7 @@ static const struct pw_resource_events resource_events = {
.destroy = device_unbind_func, .destroy = device_unbind_func,
}; };
SPA_EXPORT
int pw_device_for_each_param(struct pw_device *device, int pw_device_for_each_param(struct pw_device *device,
uint32_t param_id, uint32_t param_id,
uint32_t index, uint32_t max, uint32_t index, uint32_t max,
@ -237,6 +240,7 @@ static const struct pw_global_events global_events = {
.bind = global_bind, .bind = global_bind,
}; };
SPA_EXPORT
int pw_device_register(struct pw_device *device, int pw_device_register(struct pw_device *device,
struct pw_client *owner, struct pw_client *owner,
struct pw_global *parent, struct pw_global *parent,
@ -382,22 +386,26 @@ static const struct spa_device_callbacks device_callbacks = {
.remove = device_remove, .remove = device_remove,
}; };
SPA_EXPORT
void pw_device_set_implementation(struct pw_device *device, struct spa_device *spa_device) void pw_device_set_implementation(struct pw_device *device, struct spa_device *spa_device)
{ {
device->implementation = spa_device; device->implementation = spa_device;
spa_device_set_callbacks(device->implementation, &device_callbacks, device); spa_device_set_callbacks(device->implementation, &device_callbacks, device);
} }
SPA_EXPORT
struct spa_device *pw_device_get_implementation(struct pw_device *device) struct spa_device *pw_device_get_implementation(struct pw_device *device)
{ {
return device->implementation; return device->implementation;
} }
SPA_EXPORT
const struct pw_properties *pw_device_get_properties(struct pw_device *device) const struct pw_properties *pw_device_get_properties(struct pw_device *device)
{ {
return device->properties; return device->properties;
} }
SPA_EXPORT
int pw_device_update_properties(struct pw_device *device, const struct spa_dict *dict) int pw_device_update_properties(struct pw_device *device, const struct spa_dict *dict)
{ {
struct pw_resource *resource; struct pw_resource *resource;
@ -423,16 +431,19 @@ int pw_device_update_properties(struct pw_device *device, const struct spa_dict
return changed; return changed;
} }
SPA_EXPORT
void *pw_device_get_user_data(struct pw_device *device) void *pw_device_get_user_data(struct pw_device *device)
{ {
return device->user_data; return device->user_data;
} }
SPA_EXPORT
struct pw_global *pw_device_get_global(struct pw_device *device) struct pw_global *pw_device_get_global(struct pw_device *device)
{ {
return device->global; return device->global;
} }
SPA_EXPORT
void pw_device_add_listener(struct pw_device *device, void pw_device_add_listener(struct pw_device *device,
struct spa_hook *listener, struct spa_hook *listener,
const struct pw_device_events *events, const struct pw_device_events *events,

View file

@ -35,6 +35,7 @@ struct resource_data {
struct spa_hook resource_listener; struct spa_hook resource_listener;
}; };
SPA_EXPORT
struct pw_factory *pw_factory_new(struct pw_core *core, struct pw_factory *pw_factory_new(struct pw_core *core,
const char *name, const char *name,
uint32_t type, uint32_t type,
@ -62,6 +63,7 @@ struct pw_factory *pw_factory_new(struct pw_core *core,
return this; return this;
} }
SPA_EXPORT
void pw_factory_destroy(struct pw_factory *factory) void pw_factory_destroy(struct pw_factory *factory)
{ {
pw_log_debug("factory %p: destroy", factory); pw_log_debug("factory %p: destroy", factory);
@ -138,6 +140,7 @@ static const struct pw_global_events global_events = {
.bind = global_bind, .bind = global_bind,
}; };
SPA_EXPORT
int pw_factory_register(struct pw_factory *factory, int pw_factory_register(struct pw_factory *factory,
struct pw_client *owner, struct pw_client *owner,
struct pw_global *parent, struct pw_global *parent,
@ -173,16 +176,19 @@ int pw_factory_register(struct pw_factory *factory,
return 0; return 0;
} }
SPA_EXPORT
void *pw_factory_get_user_data(struct pw_factory *factory) void *pw_factory_get_user_data(struct pw_factory *factory)
{ {
return factory->user_data; return factory->user_data;
} }
SPA_EXPORT
struct pw_global *pw_factory_get_global(struct pw_factory *factory) struct pw_global *pw_factory_get_global(struct pw_factory *factory)
{ {
return factory->global; return factory->global;
} }
SPA_EXPORT
void pw_factory_add_listener(struct pw_factory *factory, void pw_factory_add_listener(struct pw_factory *factory,
struct spa_hook *listener, struct spa_hook *listener,
const struct pw_factory_events *events, const struct pw_factory_events *events,
@ -191,6 +197,7 @@ void pw_factory_add_listener(struct pw_factory *factory,
spa_hook_list_append(&factory->listener_list, listener, events, data); spa_hook_list_append(&factory->listener_list, listener, events, data);
} }
SPA_EXPORT
void pw_factory_set_implementation(struct pw_factory *factory, void pw_factory_set_implementation(struct pw_factory *factory,
const struct pw_factory_implementation *implementation, const struct pw_factory_implementation *implementation,
void *data) void *data)
@ -199,6 +206,7 @@ void pw_factory_set_implementation(struct pw_factory *factory,
factory->implementation_data = data; factory->implementation_data = data;
} }
SPA_EXPORT
void *pw_factory_create_object(struct pw_factory *factory, void *pw_factory_create_object(struct pw_factory *factory,
struct pw_resource *resource, struct pw_resource *resource,
uint32_t type, uint32_t type,

View file

@ -42,6 +42,7 @@ struct impl {
/** \endcond */ /** \endcond */
SPA_EXPORT
uint32_t pw_global_get_permissions(struct pw_global *global, struct pw_client *client) uint32_t pw_global_get_permissions(struct pw_global *global, struct pw_client *client)
{ {
uint32_t perms = PW_PERM_RWX; uint32_t perms = PW_PERM_RWX;
@ -64,6 +65,7 @@ uint32_t pw_global_get_permissions(struct pw_global *global, struct pw_client *c
* *
* \memberof pw_global * \memberof pw_global
*/ */
SPA_EXPORT
struct pw_global * struct pw_global *
pw_global_new(struct pw_core *core, pw_global_new(struct pw_core *core,
uint32_t type, uint32_t type,
@ -106,6 +108,7 @@ pw_global_new(struct pw_core *core,
* *
* \memberof pw_global * \memberof pw_global
*/ */
SPA_EXPORT
int int
pw_global_register(struct pw_global *global, pw_global_register(struct pw_global *global,
struct pw_client *owner, struct pw_client *owner,
@ -176,46 +179,55 @@ static int global_unregister(struct pw_global *global)
return 0; return 0;
} }
SPA_EXPORT
struct pw_core *pw_global_get_core(struct pw_global *global) struct pw_core *pw_global_get_core(struct pw_global *global)
{ {
return global->core; return global->core;
} }
SPA_EXPORT
struct pw_client *pw_global_get_owner(struct pw_global *global) struct pw_client *pw_global_get_owner(struct pw_global *global)
{ {
return global->owner; return global->owner;
} }
SPA_EXPORT
struct pw_global *pw_global_get_parent(struct pw_global *global) struct pw_global *pw_global_get_parent(struct pw_global *global)
{ {
return global->parent; return global->parent;
} }
SPA_EXPORT
uint32_t pw_global_get_type(struct pw_global *global) uint32_t pw_global_get_type(struct pw_global *global)
{ {
return global->type; return global->type;
} }
SPA_EXPORT
uint32_t pw_global_get_version(struct pw_global *global) uint32_t pw_global_get_version(struct pw_global *global)
{ {
return global->version; return global->version;
} }
SPA_EXPORT
const struct pw_properties *pw_global_get_properties(struct pw_global *global) const struct pw_properties *pw_global_get_properties(struct pw_global *global)
{ {
return global->properties; return global->properties;
} }
SPA_EXPORT
void * pw_global_get_object(struct pw_global *global) void * pw_global_get_object(struct pw_global *global)
{ {
return global->object; return global->object;
} }
SPA_EXPORT
uint32_t pw_global_get_id(struct pw_global *global) uint32_t pw_global_get_id(struct pw_global *global)
{ {
return global->id; return global->id;
} }
SPA_EXPORT
void pw_global_add_listener(struct pw_global *global, void pw_global_add_listener(struct pw_global *global,
struct spa_hook *listener, struct spa_hook *listener,
const struct pw_global_events *events, const struct pw_global_events *events,
@ -237,6 +249,7 @@ void pw_global_add_listener(struct pw_global *global,
* *
* \memberof pw_global * \memberof pw_global
*/ */
SPA_EXPORT
int int
pw_global_bind(struct pw_global *global, struct pw_client *client, uint32_t permissions, pw_global_bind(struct pw_global *global, struct pw_client *client, uint32_t permissions,
uint32_t version, uint32_t id) uint32_t version, uint32_t id)
@ -258,6 +271,7 @@ pw_global_bind(struct pw_global *global, struct pw_client *client, uint32_t perm
return res; return res;
} }
SPA_EXPORT
int pw_global_update_permissions(struct pw_global *global, struct pw_client *client, int pw_global_update_permissions(struct pw_global *global, struct pw_client *client,
uint32_t old_permissions, uint32_t new_permissions) uint32_t old_permissions, uint32_t new_permissions)
{ {
@ -301,6 +315,7 @@ int pw_global_update_permissions(struct pw_global *global, struct pw_client *cli
* *
* \memberof pw_global * \memberof pw_global
*/ */
SPA_EXPORT
void pw_global_destroy(struct pw_global *global) void pw_global_destroy(struct pw_global *global)
{ {
struct pw_resource *resource; struct pw_resource *resource;

View file

@ -28,6 +28,7 @@
#include "pipewire/remote.h" #include "pipewire/remote.h"
SPA_EXPORT
const char *pw_node_state_as_string(enum pw_node_state state) const char *pw_node_state_as_string(enum pw_node_state state)
{ {
switch (state) { switch (state) {
@ -45,6 +46,7 @@ const char *pw_node_state_as_string(enum pw_node_state state)
return "invalid-state"; return "invalid-state";
} }
SPA_EXPORT
const char *pw_direction_as_string(enum pw_direction direction) const char *pw_direction_as_string(enum pw_direction direction)
{ {
switch (direction) { switch (direction) {
@ -58,6 +60,7 @@ const char *pw_direction_as_string(enum pw_direction direction)
return "invalid-direction"; return "invalid-direction";
} }
SPA_EXPORT
const char *pw_link_state_as_string(enum pw_link_state state) const char *pw_link_state_as_string(enum pw_link_state state)
{ {
switch (state) { switch (state) {
@ -120,6 +123,7 @@ static struct spa_dict *pw_spa_dict_copy(struct spa_dict *dict)
return NULL; return NULL;
} }
SPA_EXPORT
struct pw_core_info *pw_core_info_update(struct pw_core_info *info, struct pw_core_info *pw_core_info_update(struct pw_core_info *info,
const struct pw_core_info *update) const struct pw_core_info *update)
{ {
@ -160,6 +164,7 @@ struct pw_core_info *pw_core_info_update(struct pw_core_info *info,
return info; return info;
} }
SPA_EXPORT
void pw_core_info_free(struct pw_core_info *info) void pw_core_info_free(struct pw_core_info *info)
{ {
free((void *) info->user_name); free((void *) info->user_name);
@ -171,6 +176,7 @@ void pw_core_info_free(struct pw_core_info *info)
free(info); free(info);
} }
SPA_EXPORT
struct pw_node_info *pw_node_info_update(struct pw_node_info *info, struct pw_node_info *pw_node_info_update(struct pw_node_info *info,
const struct pw_node_info *update) const struct pw_node_info *update)
{ {
@ -212,6 +218,7 @@ struct pw_node_info *pw_node_info_update(struct pw_node_info *info,
return info; return info;
} }
SPA_EXPORT
void pw_node_info_free(struct pw_node_info *info) void pw_node_info_free(struct pw_node_info *info)
{ {
@ -222,6 +229,7 @@ void pw_node_info_free(struct pw_node_info *info)
free(info); free(info);
} }
SPA_EXPORT
struct pw_port_info *pw_port_info_update(struct pw_port_info *info, struct pw_port_info *pw_port_info_update(struct pw_port_info *info,
const struct pw_port_info *update) const struct pw_port_info *update)
{ {
@ -246,6 +254,7 @@ struct pw_port_info *pw_port_info_update(struct pw_port_info *info,
return info; return info;
} }
SPA_EXPORT
void pw_port_info_free(struct pw_port_info *info) void pw_port_info_free(struct pw_port_info *info)
{ {
@ -254,6 +263,7 @@ void pw_port_info_free(struct pw_port_info *info)
free(info); free(info);
} }
SPA_EXPORT
struct pw_factory_info *pw_factory_info_update(struct pw_factory_info *info, struct pw_factory_info *pw_factory_info_update(struct pw_factory_info *info,
const struct pw_factory_info *update) const struct pw_factory_info *update)
{ {
@ -280,6 +290,7 @@ struct pw_factory_info *pw_factory_info_update(struct pw_factory_info *info,
return info; return info;
} }
SPA_EXPORT
void pw_factory_info_free(struct pw_factory_info *info) void pw_factory_info_free(struct pw_factory_info *info)
{ {
free((void *) info->name); free((void *) info->name);
@ -288,6 +299,7 @@ void pw_factory_info_free(struct pw_factory_info *info)
free(info); free(info);
} }
SPA_EXPORT
struct pw_module_info *pw_module_info_update(struct pw_module_info *info, struct pw_module_info *pw_module_info_update(struct pw_module_info *info,
const struct pw_module_info *update) const struct pw_module_info *update)
{ {
@ -322,6 +334,7 @@ struct pw_module_info *pw_module_info_update(struct pw_module_info *info,
return info; return info;
} }
SPA_EXPORT
void pw_module_info_free(struct pw_module_info *info) void pw_module_info_free(struct pw_module_info *info)
{ {
free((void *) info->name); free((void *) info->name);
@ -333,6 +346,7 @@ void pw_module_info_free(struct pw_module_info *info)
} }
SPA_EXPORT
struct pw_device_info *pw_device_info_update(struct pw_device_info *info, struct pw_device_info *pw_device_info_update(struct pw_device_info *info,
const struct pw_device_info *update) const struct pw_device_info *update)
{ {
@ -357,6 +371,7 @@ struct pw_device_info *pw_device_info_update(struct pw_device_info *info,
return info; return info;
} }
SPA_EXPORT
void pw_device_info_free(struct pw_device_info *info) void pw_device_info_free(struct pw_device_info *info)
{ {
free((void *) info->name); free((void *) info->name);
@ -365,6 +380,7 @@ void pw_device_info_free(struct pw_device_info *info)
free(info); free(info);
} }
SPA_EXPORT
struct pw_client_info *pw_client_info_update(struct pw_client_info *info, struct pw_client_info *pw_client_info_update(struct pw_client_info *info,
const struct pw_client_info *update) const struct pw_client_info *update)
{ {
@ -387,6 +403,7 @@ struct pw_client_info *pw_client_info_update(struct pw_client_info *info,
return info; return info;
} }
SPA_EXPORT
void pw_client_info_free(struct pw_client_info *info) void pw_client_info_free(struct pw_client_info *info)
{ {
if (info->props) if (info->props)
@ -394,6 +411,7 @@ void pw_client_info_free(struct pw_client_info *info)
free(info); free(info);
} }
SPA_EXPORT
struct pw_link_info *pw_link_info_update(struct pw_link_info *info, struct pw_link_info *pw_link_info_update(struct pw_link_info *info,
const struct pw_link_info *update) const struct pw_link_info *update)
{ {
@ -433,6 +451,7 @@ struct pw_link_info *pw_link_info_update(struct pw_link_info *info,
return info; return info;
} }
SPA_EXPORT
void pw_link_info_free(struct pw_link_info *info) void pw_link_info_free(struct pw_link_info *info)
{ {
free((void *) info->error); free((void *) info->error);

View file

@ -1228,6 +1228,7 @@ static void try_unlink_controls(struct impl *impl, struct pw_port *port, struct
} }
} }
SPA_EXPORT
struct pw_link *pw_link_new(struct pw_core *core, struct pw_link *pw_link_new(struct pw_core *core,
struct pw_port *output, struct pw_port *output,
struct pw_port *input, struct pw_port *input,
@ -1347,6 +1348,7 @@ static const struct pw_global_events global_events = {
.bind = global_bind, .bind = global_bind,
}; };
SPA_EXPORT
int pw_link_register(struct pw_link *link, int pw_link_register(struct pw_link *link,
struct pw_client *owner, struct pw_client *owner,
struct pw_global *parent, struct pw_global *parent,
@ -1396,6 +1398,7 @@ int pw_link_register(struct pw_link *link,
return 0; return 0;
} }
SPA_EXPORT
void pw_link_destroy(struct pw_link *link) void pw_link_destroy(struct pw_link *link)
{ {
struct impl *impl = SPA_CONTAINER_OF(link, struct impl, this); struct impl *impl = SPA_CONTAINER_OF(link, struct impl, this);
@ -1430,6 +1433,7 @@ void pw_link_destroy(struct pw_link *link)
free(impl); free(impl);
} }
SPA_EXPORT
void pw_link_add_listener(struct pw_link *link, void pw_link_add_listener(struct pw_link *link,
struct spa_hook *listener, struct spa_hook *listener,
const struct pw_link_events *events, const struct pw_link_events *events,
@ -1450,31 +1454,37 @@ struct pw_link *pw_link_find(struct pw_port *output_port, struct pw_port *input_
return NULL; return NULL;
} }
SPA_EXPORT
struct pw_core *pw_link_get_core(struct pw_link *link) struct pw_core *pw_link_get_core(struct pw_link *link)
{ {
return link->core; return link->core;
} }
SPA_EXPORT
void *pw_link_get_user_data(struct pw_link *link) void *pw_link_get_user_data(struct pw_link *link)
{ {
return link->user_data; return link->user_data;
} }
SPA_EXPORT
const struct pw_link_info *pw_link_get_info(struct pw_link *link) const struct pw_link_info *pw_link_get_info(struct pw_link *link)
{ {
return &link->info; return &link->info;
} }
SPA_EXPORT
struct pw_global *pw_link_get_global(struct pw_link *link) struct pw_global *pw_link_get_global(struct pw_link *link)
{ {
return link->global; return link->global;
} }
SPA_EXPORT
struct pw_port *pw_link_get_output(struct pw_link *link) struct pw_port *pw_link_get_output(struct pw_link *link)
{ {
return link->output; return link->output;
} }
SPA_EXPORT
struct pw_port *pw_link_get_input(struct pw_link *link) struct pw_port *pw_link_get_input(struct pw_link *link)
{ {
return link->input; return link->input;

View file

@ -26,6 +26,7 @@
#define DEFAULT_LOG_LEVEL SPA_LOG_LEVEL_ERROR #define DEFAULT_LOG_LEVEL SPA_LOG_LEVEL_ERROR
SPA_EXPORT
enum spa_log_level pw_log_level = DEFAULT_LOG_LEVEL; enum spa_log_level pw_log_level = DEFAULT_LOG_LEVEL;
static struct spa_log *global_log = NULL; static struct spa_log *global_log = NULL;
@ -34,6 +35,7 @@ static struct spa_log *global_log = NULL;
* \param log the global log to set * \param log the global log to set
* \memberof pw_log * \memberof pw_log
*/ */
SPA_EXPORT
void pw_log_set(struct spa_log *log) void pw_log_set(struct spa_log *log)
{ {
global_log = log; global_log = log;
@ -45,6 +47,7 @@ void pw_log_set(struct spa_log *log)
* \return the global log * \return the global log
* \memberof pw_log * \memberof pw_log
*/ */
SPA_EXPORT
struct spa_log *pw_log_get(void) struct spa_log *pw_log_get(void)
{ {
return global_log; return global_log;
@ -54,6 +57,7 @@ struct spa_log *pw_log_get(void)
* \param level the new log level * \param level the new log level
* \memberof pw_log * \memberof pw_log
*/ */
SPA_EXPORT
void pw_log_set_level(enum spa_log_level level) void pw_log_set_level(enum spa_log_level level)
{ {
pw_log_level = level; pw_log_level = level;
@ -71,6 +75,7 @@ void pw_log_set_level(enum spa_log_level level)
* *
* \memberof pw_log * \memberof pw_log
*/ */
SPA_EXPORT
void void
pw_log_log(enum spa_log_level level, pw_log_log(enum spa_log_level level,
const char *file, const char *file,
@ -96,6 +101,7 @@ pw_log_log(enum spa_log_level level,
* *
* \memberof pw_log * \memberof pw_log
*/ */
SPA_EXPORT
void void
pw_log_logv(enum spa_log_level level, pw_log_logv(enum spa_log_level level,
const char *file, const char *file,

View file

@ -46,6 +46,7 @@ struct impl {
* \returns a newly allocated loop * \returns a newly allocated loop
* \memberof pw_loop * \memberof pw_loop
*/ */
SPA_EXPORT
struct pw_loop *pw_loop_new(struct pw_properties *properties) struct pw_loop *pw_loop_new(struct pw_properties *properties)
{ {
int res; int res;
@ -116,6 +117,7 @@ struct pw_loop *pw_loop_new(struct pw_properties *properties)
* \param loop a loop to destroy * \param loop a loop to destroy
* \memberof pw_loop * \memberof pw_loop
*/ */
SPA_EXPORT
void pw_loop_destroy(struct pw_loop *loop) void pw_loop_destroy(struct pw_loop *loop)
{ {
struct impl *impl = SPA_CONTAINER_OF(loop, struct impl, this); struct impl *impl = SPA_CONTAINER_OF(loop, struct impl, this);

View file

@ -38,6 +38,7 @@ static void do_stop(void *data, uint64_t count)
* *
* \memberof pw_main_loop * \memberof pw_main_loop
*/ */
SPA_EXPORT
struct pw_main_loop *pw_main_loop_new(struct pw_properties *properties) struct pw_main_loop *pw_main_loop_new(struct pw_properties *properties)
{ {
struct pw_main_loop *this; struct pw_main_loop *this;
@ -68,6 +69,7 @@ struct pw_main_loop *pw_main_loop_new(struct pw_properties *properties)
* *
* \memberof pw_main_loop * \memberof pw_main_loop
*/ */
SPA_EXPORT
void pw_main_loop_destroy(struct pw_main_loop *loop) void pw_main_loop_destroy(struct pw_main_loop *loop)
{ {
pw_log_debug("main-loop %p: destroy", loop); pw_log_debug("main-loop %p: destroy", loop);
@ -78,6 +80,7 @@ void pw_main_loop_destroy(struct pw_main_loop *loop)
free(loop); free(loop);
} }
SPA_EXPORT
void pw_main_loop_add_listener(struct pw_main_loop *loop, void pw_main_loop_add_listener(struct pw_main_loop *loop,
struct spa_hook *listener, struct spa_hook *listener,
const struct pw_main_loop_events *events, const struct pw_main_loop_events *events,
@ -86,6 +89,7 @@ void pw_main_loop_add_listener(struct pw_main_loop *loop,
spa_hook_list_append(&loop->listener_list, listener, events, data); spa_hook_list_append(&loop->listener_list, listener, events, data);
} }
SPA_EXPORT
struct pw_loop * pw_main_loop_get_loop(struct pw_main_loop *loop) struct pw_loop * pw_main_loop_get_loop(struct pw_main_loop *loop)
{ {
return loop->loop; return loop->loop;
@ -98,6 +102,7 @@ struct pw_loop * pw_main_loop_get_loop(struct pw_main_loop *loop)
* *
* \memberof pw_main_loop * \memberof pw_main_loop
*/ */
SPA_EXPORT
void pw_main_loop_quit(struct pw_main_loop *loop) void pw_main_loop_quit(struct pw_main_loop *loop)
{ {
pw_log_debug("main-loop %p: quit", loop); pw_log_debug("main-loop %p: quit", loop);
@ -112,6 +117,7 @@ void pw_main_loop_quit(struct pw_main_loop *loop)
* *
* \memberof pw_main_loop * \memberof pw_main_loop
*/ */
SPA_EXPORT
void pw_main_loop_run(struct pw_main_loop *loop) void pw_main_loop_run(struct pw_main_loop *loop)
{ {
pw_log_debug("main-loop %p: run", loop); pw_log_debug("main-loop %p: run", loop);

View file

@ -94,6 +94,7 @@ static struct spa_list _memblocks = SPA_LIST_INIT(&_memblocks);
* \return 0 on success, < 0 on error * \return 0 on success, < 0 on error
* \memberof pw_memblock * \memberof pw_memblock
*/ */
SPA_EXPORT
int pw_memblock_map(struct pw_memblock *mem) int pw_memblock_map(struct pw_memblock *mem)
{ {
if (mem->ptr != NULL) if (mem->ptr != NULL)
@ -154,6 +155,7 @@ int pw_memblock_map(struct pw_memblock *mem)
* \return 0 on success, < 0 on error * \return 0 on success, < 0 on error
* \memberof pw_memblock * \memberof pw_memblock
*/ */
SPA_EXPORT
int pw_memblock_alloc(enum pw_memblock_flags flags, size_t size, struct pw_memblock **mem) int pw_memblock_alloc(enum pw_memblock_flags flags, size_t size, struct pw_memblock **mem)
{ {
struct memblock tmp, *p; struct memblock tmp, *p;
@ -229,6 +231,7 @@ int pw_memblock_alloc(enum pw_memblock_flags flags, size_t size, struct pw_membl
return -ENOMEM; return -ENOMEM;
} }
SPA_EXPORT
int int
pw_memblock_import(enum pw_memblock_flags flags, pw_memblock_import(enum pw_memblock_flags flags,
int fd, off_t offset, size_t size, int fd, off_t offset, size_t size,
@ -253,6 +256,7 @@ pw_memblock_import(enum pw_memblock_flags flags,
* \param mem a memblock * \param mem a memblock
* \memberof pw_memblock * \memberof pw_memblock
*/ */
SPA_EXPORT
void pw_memblock_free(struct pw_memblock *mem) void pw_memblock_free(struct pw_memblock *mem)
{ {
struct memblock *m = (struct memblock *)mem; struct memblock *m = (struct memblock *)mem;
@ -273,6 +277,7 @@ void pw_memblock_free(struct pw_memblock *mem)
free(mem); free(mem);
} }
SPA_EXPORT
struct pw_memblock * pw_memblock_find(const void *ptr) struct pw_memblock * pw_memblock_find(const void *ptr)
{ {
struct memblock *m; struct memblock *m;

View file

@ -166,6 +166,7 @@ static const struct pw_global_events global_events = {
* *
* \memberof pw_module * \memberof pw_module
*/ */
SPA_EXPORT
struct pw_module * struct pw_module *
pw_module_load(struct pw_core *core, pw_module_load(struct pw_core *core,
const char *name, const char *args, const char *name, const char *args,
@ -289,6 +290,7 @@ pw_module_load(struct pw_core *core,
* \param module the module to destroy * \param module the module to destroy
* \memberof pw_module * \memberof pw_module
*/ */
SPA_EXPORT
void pw_module_destroy(struct pw_module *module) void pw_module_destroy(struct pw_module *module)
{ {
struct impl *impl = SPA_CONTAINER_OF(module, struct impl, this); struct impl *impl = SPA_CONTAINER_OF(module, struct impl, this);
@ -313,22 +315,26 @@ void pw_module_destroy(struct pw_module *module)
free(impl); free(impl);
} }
SPA_EXPORT
struct pw_core * struct pw_core *
pw_module_get_core(struct pw_module *module) pw_module_get_core(struct pw_module *module)
{ {
return module->core; return module->core;
} }
SPA_EXPORT
struct pw_global * pw_module_get_global(struct pw_module *module) struct pw_global * pw_module_get_global(struct pw_module *module)
{ {
return module->global; return module->global;
} }
SPA_EXPORT
const struct pw_properties *pw_module_get_properties(struct pw_module *module) const struct pw_properties *pw_module_get_properties(struct pw_module *module)
{ {
return module->properties; return module->properties;
} }
SPA_EXPORT
int pw_module_update_properties(struct pw_module *module, const struct spa_dict *dict) int pw_module_update_properties(struct pw_module *module, const struct spa_dict *dict)
{ {
struct pw_resource *resource; struct pw_resource *resource;
@ -352,12 +358,14 @@ int pw_module_update_properties(struct pw_module *module, const struct spa_dict
return changed; return changed;
} }
SPA_EXPORT
const struct pw_module_info * const struct pw_module_info *
pw_module_get_info(struct pw_module *module) pw_module_get_info(struct pw_module *module)
{ {
return &module->info; return &module->info;
} }
SPA_EXPORT
void pw_module_add_listener(struct pw_module *module, void pw_module_add_listener(struct pw_module *module,
struct spa_hook *listener, struct spa_hook *listener,
const struct pw_module_events *events, const struct pw_module_events *events,

View file

@ -276,6 +276,7 @@ static void update_port_map(struct pw_node *node, enum pw_direction direction,
} }
} }
SPA_EXPORT
int pw_node_update_ports(struct pw_node *node) int pw_node_update_ports(struct pw_node *node)
{ {
uint32_t *input_port_ids, *output_port_ids; uint32_t *input_port_ids, *output_port_ids;
@ -456,6 +457,7 @@ static const struct pw_global_events global_events = {
.bind = global_bind, .bind = global_bind,
}; };
SPA_EXPORT
int pw_node_register(struct pw_node *this, int pw_node_register(struct pw_node *this,
struct pw_client *owner, struct pw_client *owner,
struct pw_global *parent, struct pw_global *parent,
@ -505,6 +507,7 @@ int pw_node_register(struct pw_node *this,
return 0; return 0;
} }
SPA_EXPORT
int pw_node_initialized(struct pw_node *this) int pw_node_initialized(struct pw_node *this)
{ {
pw_log_debug("node %p initialized", this); pw_log_debug("node %p initialized", this);
@ -568,6 +571,7 @@ static int recalc_quantum(struct pw_node *driver)
return 0; return 0;
} }
SPA_EXPORT
int pw_node_set_driver(struct pw_node *node, struct pw_node *driver) int pw_node_set_driver(struct pw_node *node, struct pw_node *driver)
{ {
struct impl *impl = SPA_CONTAINER_OF(node, struct impl, this); struct impl *impl = SPA_CONTAINER_OF(node, struct impl, this);
@ -648,6 +652,7 @@ static void check_properties(struct pw_node *node)
} }
SPA_EXPORT
struct pw_node *pw_node_new(struct pw_core *core, struct pw_node *pw_node_new(struct pw_core *core,
const char *name, const char *name,
struct pw_properties *properties, struct pw_properties *properties,
@ -727,31 +732,37 @@ struct pw_node *pw_node_new(struct pw_core *core,
return NULL; return NULL;
} }
SPA_EXPORT
const struct pw_node_info *pw_node_get_info(struct pw_node *node) const struct pw_node_info *pw_node_get_info(struct pw_node *node)
{ {
return &node->info; return &node->info;
} }
SPA_EXPORT
void * pw_node_get_user_data(struct pw_node *node) void * pw_node_get_user_data(struct pw_node *node)
{ {
return node->user_data; return node->user_data;
} }
SPA_EXPORT
struct pw_core * pw_node_get_core(struct pw_node *node) struct pw_core * pw_node_get_core(struct pw_node *node)
{ {
return node->core; return node->core;
} }
SPA_EXPORT
struct pw_global *pw_node_get_global(struct pw_node *node) struct pw_global *pw_node_get_global(struct pw_node *node)
{ {
return node->global; return node->global;
} }
SPA_EXPORT
const struct pw_properties *pw_node_get_properties(struct pw_node *node) const struct pw_properties *pw_node_get_properties(struct pw_node *node)
{ {
return node->properties; return node->properties;
} }
SPA_EXPORT
int pw_node_update_properties(struct pw_node *node, const struct spa_dict *dict) int pw_node_update_properties(struct pw_node *node, const struct spa_dict *dict)
{ {
struct pw_resource *resource; struct pw_resource *resource;
@ -882,6 +893,7 @@ static const struct spa_node_callbacks node_callbacks = {
.reuse_buffer = node_reuse_buffer, .reuse_buffer = node_reuse_buffer,
}; };
SPA_EXPORT
void pw_node_set_implementation(struct pw_node *node, void pw_node_set_implementation(struct pw_node *node,
struct spa_node *spa_node) struct spa_node *spa_node)
{ {
@ -905,11 +917,13 @@ void pw_node_set_implementation(struct pw_node *node,
} }
} }
SPA_EXPORT
struct spa_node *pw_node_get_implementation(struct pw_node *node) struct spa_node *pw_node_get_implementation(struct pw_node *node)
{ {
return node->node; return node->node;
} }
SPA_EXPORT
void pw_node_add_listener(struct pw_node *node, void pw_node_add_listener(struct pw_node *node,
struct spa_hook *listener, struct spa_hook *listener,
const struct pw_node_events *events, const struct pw_node_events *events,
@ -926,6 +940,7 @@ void pw_node_add_listener(struct pw_node *node,
* *
* \memberof pw_node * \memberof pw_node
*/ */
SPA_EXPORT
void pw_node_destroy(struct pw_node *node) void pw_node_destroy(struct pw_node *node)
{ {
struct impl *impl = SPA_CONTAINER_OF(node, struct impl, this); struct impl *impl = SPA_CONTAINER_OF(node, struct impl, this);
@ -986,6 +1001,7 @@ void pw_node_destroy(struct pw_node *node)
free(impl); free(impl);
} }
SPA_EXPORT
int pw_node_for_each_port(struct pw_node *node, int pw_node_for_each_port(struct pw_node *node,
enum pw_direction direction, enum pw_direction direction,
int (*callback) (void *data, struct pw_port *port), int (*callback) (void *data, struct pw_port *port),
@ -1006,6 +1022,7 @@ int pw_node_for_each_port(struct pw_node *node,
return 0; return 0;
} }
SPA_EXPORT
int pw_node_for_each_param(struct pw_node *node, int pw_node_for_each_param(struct pw_node *node,
uint32_t param_id, uint32_t param_id,
uint32_t index, uint32_t max, uint32_t index, uint32_t max,
@ -1039,6 +1056,7 @@ int pw_node_for_each_param(struct pw_node *node,
return res; return res;
} }
SPA_EXPORT
struct pw_port * struct pw_port *
pw_node_find_port(struct pw_node *node, enum pw_direction direction, uint32_t port_id) pw_node_find_port(struct pw_node *node, enum pw_direction direction, uint32_t port_id)
{ {
@ -1073,6 +1091,7 @@ pw_node_find_port(struct pw_node *node, enum pw_direction direction, uint32_t po
return port; return port;
} }
SPA_EXPORT
uint32_t pw_node_get_free_port_id(struct pw_node *node, enum pw_direction direction) uint32_t pw_node_get_free_port_id(struct pw_node *node, enum pw_direction direction)
{ {
uint32_t n_ports, max_ports; uint32_t n_ports, max_ports;
@ -1147,6 +1166,7 @@ static void node_activate(struct pw_node *this)
* *
* \memberof pw_node * \memberof pw_node
*/ */
SPA_EXPORT
int pw_node_set_state(struct pw_node *node, enum pw_node_state state) int pw_node_set_state(struct pw_node *node, enum pw_node_state state)
{ {
int res = 0; int res = 0;
@ -1195,6 +1215,7 @@ int pw_node_set_state(struct pw_node *node, enum pw_node_state state)
return res; return res;
} }
SPA_EXPORT
int pw_node_set_active(struct pw_node *node, bool active) int pw_node_set_active(struct pw_node *node, bool active)
{ {
bool old = node->active; bool old = node->active;
@ -1217,11 +1238,13 @@ int pw_node_set_active(struct pw_node *node, bool active)
return 0; return 0;
} }
SPA_EXPORT
bool pw_node_is_active(struct pw_node *node) bool pw_node_is_active(struct pw_node *node)
{ {
return node->active; return node->active;
} }
SPA_EXPORT
int pw_node_set_enabled(struct pw_node *node, bool enabled) int pw_node_set_enabled(struct pw_node *node, bool enabled)
{ {
bool old = node->enabled; bool old = node->enabled;
@ -1242,6 +1265,7 @@ int pw_node_set_enabled(struct pw_node *node, bool enabled)
return 0; return 0;
} }
SPA_EXPORT
bool pw_node_is_enabled(struct pw_node *node) bool pw_node_is_enabled(struct pw_node *node)
{ {
return node->enabled; return node->enabled;

View file

@ -302,11 +302,13 @@ static void configure_debug(struct support *support, const char *str)
* \param type the interface type * \param type the interface type
* \return the interface or NULL when not configured * \return the interface or NULL when not configured
*/ */
SPA_EXPORT
void *pw_get_support_interface(uint32_t type) void *pw_get_support_interface(uint32_t type)
{ {
return spa_support_find(global_support.support, global_support.n_support, type); return spa_support_find(global_support.support, global_support.n_support, type);
} }
SPA_EXPORT
const struct spa_handle_factory *pw_get_support_factory(const char *factory_name) const struct spa_handle_factory *pw_get_support_factory(const char *factory_name)
{ {
struct plugin *plugin = global_support.support_plugin; struct plugin *plugin = global_support.support_plugin;
@ -315,12 +317,14 @@ const struct spa_handle_factory *pw_get_support_factory(const char *factory_name
return find_factory(plugin, factory_name); return find_factory(plugin, factory_name);
} }
SPA_EXPORT
const struct spa_support *pw_get_support(uint32_t *n_support) const struct spa_support *pw_get_support(uint32_t *n_support)
{ {
*n_support = global_support.n_support; *n_support = global_support.n_support;
return global_support.support; return global_support.support;
} }
SPA_EXPORT
void *pw_load_spa_interface(const char *lib, const char *factory_name, uint32_t type, void *pw_load_spa_interface(const char *lib, const char *factory_name, uint32_t type,
const struct spa_dict *info, const struct spa_dict *info,
uint32_t n_support, uint32_t n_support,
@ -372,6 +376,7 @@ static struct interface *find_interface(void *iface)
return NULL; return NULL;
} }
SPA_EXPORT
int pw_unload_spa_interface(void *iface) int pw_unload_spa_interface(void *iface)
{ {
struct interface *i; struct interface *i;
@ -384,6 +389,7 @@ int pw_unload_spa_interface(void *iface)
return 0; return 0;
} }
SPA_EXPORT
void *pw_load_spa_dbus_interface(struct pw_loop *loop) void *pw_load_spa_dbus_interface(struct pw_loop *loop)
{ {
struct spa_support support = SPA_SUPPORT_INIT(SPA_TYPE_INTERFACE_LoopUtils, loop->utils); struct spa_support support = SPA_SUPPORT_INIT(SPA_TYPE_INTERFACE_LoopUtils, loop->utils);
@ -404,6 +410,7 @@ void *pw_load_spa_dbus_interface(struct pw_loop *loop)
* *
* \memberof pw_pipewire * \memberof pw_pipewire
*/ */
SPA_EXPORT
void pw_init(int *argc, char **argv[]) void pw_init(int *argc, char **argv[])
{ {
const char *str; const char *str;
@ -467,6 +474,7 @@ void pw_init(int *argc, char **argv[])
* *
* \memberof pw_pipewire * \memberof pw_pipewire
*/ */
SPA_EXPORT
bool pw_debug_is_category_enabled(const char *name) bool pw_debug_is_category_enabled(const char *name)
{ {
int i; int i;
@ -482,12 +490,14 @@ bool pw_debug_is_category_enabled(const char *name)
} }
/** Get the application name \memberof pw_pipewire */ /** Get the application name \memberof pw_pipewire */
SPA_EXPORT
const char *pw_get_application_name(void) const char *pw_get_application_name(void)
{ {
return NULL; return NULL;
} }
/** Get the program name \memberof pw_pipewire */ /** Get the program name \memberof pw_pipewire */
SPA_EXPORT
const char *pw_get_prgname(void) const char *pw_get_prgname(void)
{ {
static char tcomm[16 + 1]; static char tcomm[16 + 1];
@ -500,6 +510,7 @@ const char *pw_get_prgname(void)
} }
/** Get the user name \memberof pw_pipewire */ /** Get the user name \memberof pw_pipewire */
SPA_EXPORT
const char *pw_get_user_name(void) const char *pw_get_user_name(void)
{ {
struct passwd *pw; struct passwd *pw;
@ -511,6 +522,7 @@ const char *pw_get_user_name(void)
} }
/** Get the host name \memberof pw_pipewire */ /** Get the host name \memberof pw_pipewire */
SPA_EXPORT
const char *pw_get_host_name(void) const char *pw_get_host_name(void)
{ {
static char hname[256]; static char hname[256];
@ -528,6 +540,7 @@ const char *pw_get_host_name(void)
* *
* \memberof pw_pipewire * \memberof pw_pipewire
*/ */
SPA_EXPORT
const char *pw_get_client_name(void) const char *pw_get_client_name(void)
{ {
const char *cc; const char *cc;
@ -552,6 +565,7 @@ const char *pw_get_client_name(void)
* *
* \memberof pw_pipewire * \memberof pw_pipewire
*/ */
SPA_EXPORT
void pw_fill_remote_properties(struct pw_core *core, struct pw_properties *properties) void pw_fill_remote_properties(struct pw_core *core, struct pw_properties *properties)
{ {
const char *val; const char *val;
@ -596,11 +610,13 @@ void pw_fill_remote_properties(struct pw_core *core, struct pw_properties *prope
* *
* \memberof pw_pipewire * \memberof pw_pipewire
*/ */
SPA_EXPORT
void pw_fill_stream_properties(struct pw_core *core, struct pw_properties *properties) void pw_fill_stream_properties(struct pw_core *core, struct pw_properties *properties)
{ {
} }
/** Reverse the direction \memberof pw_pipewire */ /** Reverse the direction \memberof pw_pipewire */
SPA_EXPORT
enum pw_direction pw_direction_reverse(enum pw_direction direction) enum pw_direction pw_direction_reverse(enum pw_direction direction)
{ {
if (direction == PW_DIRECTION_INPUT) if (direction == PW_DIRECTION_INPUT)
@ -611,6 +627,7 @@ enum pw_direction pw_direction_reverse(enum pw_direction direction)
} }
/** Get the currently running version */ /** Get the currently running version */
SPA_EXPORT
const char* pw_get_library_version(void) const char* pw_get_library_version(void)
{ {
return pw_get_headers_version(); return pw_get_headers_version();
@ -631,6 +648,7 @@ static const struct spa_type_info type_info[] = {
{ 0, NULL, 0, NULL }, { 0, NULL, 0, NULL },
}; };
SPA_EXPORT
const struct spa_type_info * pw_type_info(void) const struct spa_type_info * pw_type_info(void)
{ {
return type_info; return type_info;

View file

@ -187,6 +187,7 @@ static const struct spa_node schedule_mix_node = {
.port_reuse_buffer = schedule_mix_reuse_buffer, .port_reuse_buffer = schedule_mix_reuse_buffer,
}; };
SPA_EXPORT
int pw_port_init_mix(struct pw_port *port, struct pw_port_mix *mix) int pw_port_init_mix(struct pw_port *port, struct pw_port_mix *mix)
{ {
uint32_t port_id; uint32_t port_id;
@ -215,6 +216,8 @@ int pw_port_init_mix(struct pw_port *port, struct pw_port_mix *mix)
return res; return res;
} }
SPA_EXPORT
int pw_port_release_mix(struct pw_port *port, struct pw_port_mix *mix) int pw_port_release_mix(struct pw_port *port, struct pw_port_mix *mix)
{ {
int res = 0; int res = 0;
@ -238,6 +241,7 @@ int pw_port_release_mix(struct pw_port *port, struct pw_port_mix *mix)
return res; return res;
} }
SPA_EXPORT
struct pw_port *pw_port_new(enum pw_direction direction, struct pw_port *pw_port_new(enum pw_direction direction,
uint32_t port_id, uint32_t port_id,
struct pw_properties *properties, struct pw_properties *properties,
@ -304,6 +308,7 @@ struct pw_port *pw_port_new(enum pw_direction direction,
return NULL; return NULL;
} }
SPA_EXPORT
int pw_port_set_mix(struct pw_port *port, struct spa_node *node, uint32_t flags) int pw_port_set_mix(struct pw_port *port, struct spa_node *node, uint32_t flags)
{ {
struct impl *impl = SPA_CONTAINER_OF(port, struct impl, this); struct impl *impl = SPA_CONTAINER_OF(port, struct impl, this);
@ -320,21 +325,25 @@ int pw_port_set_mix(struct pw_port *port, struct spa_node *node, uint32_t flags)
return 0; return 0;
} }
SPA_EXPORT
enum pw_direction pw_port_get_direction(struct pw_port *port) enum pw_direction pw_port_get_direction(struct pw_port *port)
{ {
return port->direction; return port->direction;
} }
SPA_EXPORT
uint32_t pw_port_get_id(struct pw_port *port) uint32_t pw_port_get_id(struct pw_port *port)
{ {
return port->port_id; return port->port_id;
} }
SPA_EXPORT
const struct pw_properties *pw_port_get_properties(struct pw_port *port) const struct pw_properties *pw_port_get_properties(struct pw_port *port)
{ {
return port->properties; return port->properties;
} }
SPA_EXPORT
int pw_port_update_properties(struct pw_port *port, const struct spa_dict *dict) int pw_port_update_properties(struct pw_port *port, const struct spa_dict *dict)
{ {
struct pw_resource *resource; struct pw_resource *resource;
@ -360,11 +369,13 @@ int pw_port_update_properties(struct pw_port *port, const struct spa_dict *dict)
return changed; return changed;
} }
SPA_EXPORT
struct pw_node *pw_port_get_node(struct pw_port *port) struct pw_node *pw_port_get_node(struct pw_port *port)
{ {
return port->node; return port->node;
} }
SPA_EXPORT
void pw_port_add_listener(struct pw_port *port, void pw_port_add_listener(struct pw_port *port,
struct spa_hook *listener, struct spa_hook *listener,
const struct pw_port_events *events, const struct pw_port_events *events,
@ -373,6 +384,7 @@ void pw_port_add_listener(struct pw_port *port,
spa_hook_list_append(&port->listener_list, listener, events, data); spa_hook_list_append(&port->listener_list, listener, events, data);
} }
SPA_EXPORT
void * pw_port_get_user_data(struct pw_port *port) void * pw_port_get_user_data(struct pw_port *port)
{ {
return port->user_data; return port->user_data;
@ -535,6 +547,7 @@ int pw_port_register(struct pw_port *port,
return pw_global_register(port->global, owner, parent); return pw_global_register(port->global, owner, parent);
} }
SPA_EXPORT
int pw_port_add(struct pw_port *port, struct pw_node *node) int pw_port_add(struct pw_port *port, struct pw_node *node)
{ {
uint32_t port_id = port->port_id; uint32_t port_id = port->port_id;
@ -758,6 +771,7 @@ do_port_command(struct spa_loop *loop,
return spa_node_port_send_command(node->node, port->direction, port->port_id, data); return spa_node_port_send_command(node->node, port->direction, port->port_id, data);
} }
SPA_EXPORT
int pw_port_send_command(struct pw_port *port, bool block, const struct spa_command *command) int pw_port_send_command(struct pw_port *port, bool block, const struct spa_command *command)
{ {
return pw_loop_invoke(port->node->data_loop, do_port_command, 0, return pw_loop_invoke(port->node->data_loop, do_port_command, 0,
@ -856,11 +870,13 @@ int pw_port_for_each_link(struct pw_port *port,
return res; return res;
} }
SPA_EXPORT
int pw_port_is_linked(struct pw_port *port) int pw_port_is_linked(struct pw_port *port)
{ {
return spa_list_is_empty(&port->links) ? 0 : 1; return spa_list_is_empty(&port->links) ? 0 : 1;
} }
SPA_EXPORT
int pw_port_set_param(struct pw_port *port, uint32_t mix_id, uint32_t id, uint32_t flags, int pw_port_set_param(struct pw_port *port, uint32_t mix_id, uint32_t id, uint32_t flags,
const struct spa_pod *param) const struct spa_pod *param)
{ {
@ -915,6 +931,7 @@ int pw_port_set_param(struct pw_port *port, uint32_t mix_id, uint32_t id, uint32
return res; return res;
} }
SPA_EXPORT
int pw_port_use_buffers(struct pw_port *port, uint32_t mix_id, int pw_port_use_buffers(struct pw_port *port, uint32_t mix_id,
struct spa_buffer **buffers, uint32_t n_buffers) struct spa_buffer **buffers, uint32_t n_buffers)
{ {
@ -970,6 +987,7 @@ int pw_port_use_buffers(struct pw_port *port, uint32_t mix_id,
return res; return res;
} }
SPA_EXPORT
int pw_port_alloc_buffers(struct pw_port *port, uint32_t mix_id, int pw_port_alloc_buffers(struct pw_port *port, uint32_t mix_id,
struct spa_pod **params, uint32_t n_params, struct spa_pod **params, uint32_t n_params,
struct spa_buffer **buffers, uint32_t *n_buffers) struct spa_buffer **buffers, uint32_t *n_buffers)

View file

@ -89,6 +89,7 @@ static struct properties *properties_new(int prealloc)
* *
* \memberof pw_properties * \memberof pw_properties
*/ */
SPA_EXPORT
struct pw_properties *pw_properties_new(const char *key, ...) struct pw_properties *pw_properties_new(const char *key, ...)
{ {
struct properties *impl; struct properties *impl;
@ -118,6 +119,7 @@ struct pw_properties *pw_properties_new(const char *key, ...)
* *
* \memberof pw_properties * \memberof pw_properties
*/ */
SPA_EXPORT
struct pw_properties *pw_properties_new_dict(const struct spa_dict *dict) struct pw_properties *pw_properties_new_dict(const struct spa_dict *dict)
{ {
uint32_t i; uint32_t i;
@ -147,6 +149,7 @@ struct pw_properties *pw_properties_new_dict(const struct spa_dict *dict)
* *
* \memberof pw_properties * \memberof pw_properties
*/ */
SPA_EXPORT
struct pw_properties * struct pw_properties *
pw_properties_new_string(const char *str) pw_properties_new_string(const char *str)
{ {
@ -186,6 +189,7 @@ pw_properties_new_string(const char *str)
* *
* \memberof pw_properties * \memberof pw_properties
*/ */
SPA_EXPORT
struct pw_properties *pw_properties_copy(const struct pw_properties *properties) struct pw_properties *pw_properties_copy(const struct pw_properties *properties)
{ {
return pw_properties_new_dict(&properties->dict); return pw_properties_new_dict(&properties->dict);
@ -197,6 +201,7 @@ struct pw_properties *pw_properties_copy(const struct pw_properties *properties)
* *
* \memberof pw_properties * \memberof pw_properties
*/ */
SPA_EXPORT
void pw_properties_clear(struct pw_properties *properties) void pw_properties_clear(struct pw_properties *properties)
{ {
struct properties *impl = SPA_CONTAINER_OF(properties, struct properties, this); struct properties *impl = SPA_CONTAINER_OF(properties, struct properties, this);
@ -219,6 +224,7 @@ void pw_properties_clear(struct pw_properties *properties)
* *
* \memberof pw_properties * \memberof pw_properties
*/ */
SPA_EXPORT
int pw_properties_update(struct pw_properties *props, int pw_properties_update(struct pw_properties *props,
const struct spa_dict *dict) const struct spa_dict *dict)
{ {
@ -237,6 +243,7 @@ int pw_properties_update(struct pw_properties *props,
* *
* \memberof pw_properties * \memberof pw_properties
*/ */
SPA_EXPORT
void pw_properties_free(struct pw_properties *properties) void pw_properties_free(struct pw_properties *properties)
{ {
struct properties *impl = SPA_CONTAINER_OF(properties, struct properties, this); struct properties *impl = SPA_CONTAINER_OF(properties, struct properties, this);
@ -301,13 +308,14 @@ static int do_replace(struct pw_properties *properties, const char *key, char *v
* *
* \memberof pw_properties * \memberof pw_properties
*/ */
SPA_EXPORT
int pw_properties_set(struct pw_properties *properties, const char *key, const char *value) int pw_properties_set(struct pw_properties *properties, const char *key, const char *value)
{ {
return do_replace(properties, key, (char*)value, true); return do_replace(properties, key, (char*)value, true);
} }
int SPA_EXPORT
pw_properties_setva(struct pw_properties *properties, int pw_properties_setva(struct pw_properties *properties,
const char *key, const char *format, va_list args) const char *key, const char *format, va_list args)
{ {
char *value; char *value;
@ -327,6 +335,7 @@ pw_properties_setva(struct pw_properties *properties,
* *
* \memberof pw_properties * \memberof pw_properties
*/ */
SPA_EXPORT
int pw_properties_setf(struct pw_properties *properties, const char *key, const char *format, ...) int pw_properties_setf(struct pw_properties *properties, const char *key, const char *format, ...)
{ {
int res; int res;
@ -349,6 +358,7 @@ int pw_properties_setf(struct pw_properties *properties, const char *key, const
* *
* \memberof pw_properties * \memberof pw_properties
*/ */
SPA_EXPORT
const char *pw_properties_get(const struct pw_properties *properties, const char *key) const char *pw_properties_get(const struct pw_properties *properties, const char *key)
{ {
struct properties *impl = SPA_CONTAINER_OF(properties, struct properties, this); struct properties *impl = SPA_CONTAINER_OF(properties, struct properties, this);
@ -373,6 +383,7 @@ const char *pw_properties_get(const struct pw_properties *properties, const char
* *
* \memberof pw_properties * \memberof pw_properties
*/ */
SPA_EXPORT
const char *pw_properties_iterate(const struct pw_properties *properties, void **state) const char *pw_properties_iterate(const struct pw_properties *properties, void **state)
{ {
struct properties *impl = SPA_CONTAINER_OF(properties, struct properties, this); struct properties *impl = SPA_CONTAINER_OF(properties, struct properties, this);

View file

@ -41,6 +41,7 @@ struct marshal {
}; };
/** \endcond */ /** \endcond */
SPA_EXPORT
struct pw_protocol *pw_protocol_new(struct pw_core *core, struct pw_protocol *pw_protocol_new(struct pw_core *core,
const char *name, const char *name,
size_t user_data_size) size_t user_data_size)
@ -69,23 +70,27 @@ struct pw_protocol *pw_protocol_new(struct pw_core *core,
return protocol; return protocol;
} }
SPA_EXPORT
void *pw_protocol_get_user_data(struct pw_protocol *protocol) void *pw_protocol_get_user_data(struct pw_protocol *protocol)
{ {
return protocol->user_data; return protocol->user_data;
} }
SPA_EXPORT
const struct pw_protocol_implementaton * const struct pw_protocol_implementaton *
pw_protocol_get_implementation(struct pw_protocol *protocol) pw_protocol_get_implementation(struct pw_protocol *protocol)
{ {
return protocol->implementation; return protocol->implementation;
} }
SPA_EXPORT
const void * const void *
pw_protocol_get_extension(struct pw_protocol *protocol) pw_protocol_get_extension(struct pw_protocol *protocol)
{ {
return protocol->extension; return protocol->extension;
} }
SPA_EXPORT
void pw_protocol_destroy(struct pw_protocol *protocol) void pw_protocol_destroy(struct pw_protocol *protocol)
{ {
struct impl *impl = SPA_CONTAINER_OF(protocol, struct impl, this); struct impl *impl = SPA_CONTAINER_OF(protocol, struct impl, this);
@ -112,6 +117,7 @@ void pw_protocol_destroy(struct pw_protocol *protocol)
free(impl); free(impl);
} }
SPA_EXPORT
void pw_protocol_add_listener(struct pw_protocol *protocol, void pw_protocol_add_listener(struct pw_protocol *protocol,
struct spa_hook *listener, struct spa_hook *listener,
const struct pw_protocol_events *events, const struct pw_protocol_events *events,
@ -120,6 +126,7 @@ void pw_protocol_add_listener(struct pw_protocol *protocol,
spa_hook_list_append(&protocol->listener_list, listener, events, data); spa_hook_list_append(&protocol->listener_list, listener, events, data);
} }
SPA_EXPORT
int int
pw_protocol_add_marshal(struct pw_protocol *protocol, pw_protocol_add_marshal(struct pw_protocol *protocol,
const struct pw_protocol_marshal *marshal) const struct pw_protocol_marshal *marshal)
@ -141,6 +148,7 @@ pw_protocol_add_marshal(struct pw_protocol *protocol,
return 0; return 0;
} }
SPA_EXPORT
const struct pw_protocol_marshal * const struct pw_protocol_marshal *
pw_protocol_get_marshal(struct pw_protocol *protocol, uint32_t type) pw_protocol_get_marshal(struct pw_protocol *protocol, uint32_t type)
{ {
@ -156,6 +164,7 @@ pw_protocol_get_marshal(struct pw_protocol *protocol, uint32_t type)
return NULL; return NULL;
} }
SPA_EXPORT
struct pw_protocol *pw_core_find_protocol(struct pw_core *core, const char *name) struct pw_protocol *pw_core_find_protocol(struct pw_core *core, const char *name)
{ {
struct pw_protocol *protocol; struct pw_protocol *protocol;

View file

@ -51,6 +51,7 @@ struct proxy {
* *
* \memberof pw_proxy * \memberof pw_proxy
*/ */
SPA_EXPORT
struct pw_proxy *pw_proxy_new(struct pw_proxy *factory, struct pw_proxy *pw_proxy_new(struct pw_proxy *factory,
uint32_t type, uint32_t type,
size_t user_data_size) size_t user_data_size)
@ -86,21 +87,25 @@ struct pw_proxy *pw_proxy_new(struct pw_proxy *factory,
return this; return this;
} }
SPA_EXPORT
void *pw_proxy_get_user_data(struct pw_proxy *proxy) void *pw_proxy_get_user_data(struct pw_proxy *proxy)
{ {
return proxy->user_data; return proxy->user_data;
} }
SPA_EXPORT
uint32_t pw_proxy_get_id(struct pw_proxy *proxy) uint32_t pw_proxy_get_id(struct pw_proxy *proxy)
{ {
return proxy->id; return proxy->id;
} }
SPA_EXPORT
struct pw_protocol *pw_proxy_get_protocol(struct pw_proxy *proxy) struct pw_protocol *pw_proxy_get_protocol(struct pw_proxy *proxy)
{ {
return proxy->remote->conn->protocol; return proxy->remote->conn->protocol;
} }
SPA_EXPORT
void pw_proxy_add_listener(struct pw_proxy *proxy, void pw_proxy_add_listener(struct pw_proxy *proxy,
struct spa_hook *listener, struct spa_hook *listener,
const struct pw_proxy_events *events, const struct pw_proxy_events *events,
@ -109,6 +114,7 @@ void pw_proxy_add_listener(struct pw_proxy *proxy,
spa_hook_list_append(&proxy->listener_list, listener, events, data); spa_hook_list_append(&proxy->listener_list, listener, events, data);
} }
SPA_EXPORT
void pw_proxy_add_proxy_listener(struct pw_proxy *proxy, void pw_proxy_add_proxy_listener(struct pw_proxy *proxy,
struct spa_hook *listener, struct spa_hook *listener,
const void *events, const void *events,
@ -125,6 +131,7 @@ void pw_proxy_add_proxy_listener(struct pw_proxy *proxy,
* decides to destroy the server side object * decides to destroy the server side object
* \memberof pw_proxy * \memberof pw_proxy
*/ */
SPA_EXPORT
void pw_proxy_destroy(struct pw_proxy *proxy) void pw_proxy_destroy(struct pw_proxy *proxy)
{ {
struct proxy *impl = SPA_CONTAINER_OF(proxy, struct proxy, this); struct proxy *impl = SPA_CONTAINER_OF(proxy, struct proxy, this);
@ -138,11 +145,13 @@ void pw_proxy_destroy(struct pw_proxy *proxy)
free(impl); free(impl);
} }
SPA_EXPORT
struct spa_hook_list *pw_proxy_get_proxy_listeners(struct pw_proxy *proxy) struct spa_hook_list *pw_proxy_get_proxy_listeners(struct pw_proxy *proxy)
{ {
return &proxy->proxy_listener_list; return &proxy->proxy_listener_list;
} }
SPA_EXPORT
const struct pw_protocol_marshal *pw_proxy_get_marshal(struct pw_proxy *proxy) const struct pw_protocol_marshal *pw_proxy_get_marshal(struct pw_proxy *proxy)
{ {
return proxy->marshal; return proxy->marshal;

View file

@ -46,6 +46,7 @@ struct remote {
/** \endcond */ /** \endcond */
SPA_EXPORT
const char *pw_remote_state_as_string(enum pw_remote_state state) const char *pw_remote_state_as_string(enum pw_remote_state state)
{ {
switch (state) { switch (state) {
@ -116,6 +117,7 @@ static const struct pw_core_proxy_events core_proxy_events = {
.remove_id = core_event_remove_id, .remove_id = core_event_remove_id,
}; };
SPA_EXPORT
struct pw_remote *pw_remote_new(struct pw_core *core, struct pw_remote *pw_remote_new(struct pw_core *core,
struct pw_properties *properties, struct pw_properties *properties,
size_t user_data_size) size_t user_data_size)
@ -193,6 +195,7 @@ struct pw_remote *pw_remote_new(struct pw_core *core,
return NULL; return NULL;
} }
SPA_EXPORT
void pw_remote_destroy(struct pw_remote *remote) void pw_remote_destroy(struct pw_remote *remote)
{ {
struct remote *impl = SPA_CONTAINER_OF(remote, struct remote, this); struct remote *impl = SPA_CONTAINER_OF(remote, struct remote, this);
@ -219,16 +222,19 @@ void pw_remote_destroy(struct pw_remote *remote)
free(impl); free(impl);
} }
SPA_EXPORT
struct pw_core *pw_remote_get_core(struct pw_remote *remote) struct pw_core *pw_remote_get_core(struct pw_remote *remote)
{ {
return remote->core; return remote->core;
} }
SPA_EXPORT
const struct pw_properties *pw_remote_get_properties(struct pw_remote *remote) const struct pw_properties *pw_remote_get_properties(struct pw_remote *remote)
{ {
return remote->properties; return remote->properties;
} }
SPA_EXPORT
int pw_remote_update_properties(struct pw_remote *remote, const struct spa_dict *dict) int pw_remote_update_properties(struct pw_remote *remote, const struct spa_dict *dict)
{ {
int changed; int changed;
@ -246,11 +252,13 @@ int pw_remote_update_properties(struct pw_remote *remote, const struct spa_dict
return changed; return changed;
} }
SPA_EXPORT
void *pw_remote_get_user_data(struct pw_remote *remote) void *pw_remote_get_user_data(struct pw_remote *remote)
{ {
return remote->user_data; return remote->user_data;
} }
SPA_EXPORT
enum pw_remote_state pw_remote_get_state(struct pw_remote *remote, const char **error) enum pw_remote_state pw_remote_get_state(struct pw_remote *remote, const char **error)
{ {
if (error) if (error)
@ -258,6 +266,7 @@ enum pw_remote_state pw_remote_get_state(struct pw_remote *remote, const char **
return remote->state; return remote->state;
} }
SPA_EXPORT
void pw_remote_add_listener(struct pw_remote *remote, void pw_remote_add_listener(struct pw_remote *remote,
struct spa_hook *listener, struct spa_hook *listener,
const struct pw_remote_events *events, const struct pw_remote_events *events,
@ -299,16 +308,19 @@ static int do_connect(struct pw_remote *remote)
return -ENOMEM; return -ENOMEM;
} }
SPA_EXPORT
struct pw_core_proxy * pw_remote_get_core_proxy(struct pw_remote *remote) struct pw_core_proxy * pw_remote_get_core_proxy(struct pw_remote *remote)
{ {
return remote->core_proxy; return remote->core_proxy;
} }
SPA_EXPORT
struct pw_client_proxy * pw_remote_get_client_proxy(struct pw_remote *remote) struct pw_client_proxy * pw_remote_get_client_proxy(struct pw_remote *remote)
{ {
return remote->client_proxy; return remote->client_proxy;
} }
SPA_EXPORT
struct pw_proxy *pw_remote_find_proxy(struct pw_remote *remote, uint32_t id) struct pw_proxy *pw_remote_find_proxy(struct pw_remote *remote, uint32_t id)
{ {
return pw_map_lookup(&remote->objects, id); return pw_map_lookup(&remote->objects, id);
@ -326,6 +338,7 @@ static void done_connect(void *data, int result)
do_connect(remote); do_connect(remote);
} }
SPA_EXPORT
int pw_remote_connect(struct pw_remote *remote) int pw_remote_connect(struct pw_remote *remote)
{ {
int res; int res;
@ -340,6 +353,7 @@ int pw_remote_connect(struct pw_remote *remote)
return remote->state == PW_REMOTE_STATE_ERROR ? -EIO : 0; return remote->state == PW_REMOTE_STATE_ERROR ? -EIO : 0;
} }
SPA_EXPORT
int pw_remote_connect_fd(struct pw_remote *remote, int fd) int pw_remote_connect_fd(struct pw_remote *remote, int fd)
{ {
int res; int res;
@ -355,6 +369,7 @@ int pw_remote_connect_fd(struct pw_remote *remote, int fd)
return do_connect(remote); return do_connect(remote);
} }
SPA_EXPORT
int pw_remote_steal_fd(struct pw_remote *remote) int pw_remote_steal_fd(struct pw_remote *remote)
{ {
int fd; int fd;
@ -365,6 +380,7 @@ int pw_remote_steal_fd(struct pw_remote *remote)
return fd; return fd;
} }
SPA_EXPORT
int pw_remote_disconnect(struct pw_remote *remote) int pw_remote_disconnect(struct pw_remote *remote)
{ {
struct pw_proxy *proxy; struct pw_proxy *proxy;
@ -389,6 +405,7 @@ int pw_remote_disconnect(struct pw_remote *remote)
return 0; return 0;
} }
SPA_EXPORT
struct pw_proxy *pw_remote_export(struct pw_remote *remote, struct pw_proxy *pw_remote_export(struct pw_remote *remote,
uint32_t type, struct pw_properties *props, void *object) uint32_t type, struct pw_properties *props, void *object)
{ {
@ -420,6 +437,7 @@ struct pw_proxy *pw_remote_export(struct pw_remote *remote,
return NULL; return NULL;
} }
SPA_EXPORT
int pw_core_register_export_type(struct pw_core *core, struct pw_export_type *type) int pw_core_register_export_type(struct pw_core *core, struct pw_export_type *type)
{ {
pw_log_debug("Add export type %d/%s to core", type->type, pw_log_debug("Add export type %d/%s to core", type->type,

View file

@ -38,6 +38,7 @@ struct impl {
}; };
/** \endcond */ /** \endcond */
SPA_EXPORT
struct pw_resource *pw_resource_new(struct pw_client *client, struct pw_resource *pw_resource_new(struct pw_client *client,
uint32_t id, uint32_t id,
uint32_t permissions, uint32_t permissions,
@ -89,36 +90,43 @@ struct pw_resource *pw_resource_new(struct pw_client *client,
return NULL; return NULL;
} }
SPA_EXPORT
struct pw_client *pw_resource_get_client(struct pw_resource *resource) struct pw_client *pw_resource_get_client(struct pw_resource *resource)
{ {
return resource->client; return resource->client;
} }
SPA_EXPORT
uint32_t pw_resource_get_id(struct pw_resource *resource) uint32_t pw_resource_get_id(struct pw_resource *resource)
{ {
return resource->id; return resource->id;
} }
SPA_EXPORT
uint32_t pw_resource_get_permissions(struct pw_resource *resource) uint32_t pw_resource_get_permissions(struct pw_resource *resource)
{ {
return resource->permissions; return resource->permissions;
} }
SPA_EXPORT
uint32_t pw_resource_get_type(struct pw_resource *resource) uint32_t pw_resource_get_type(struct pw_resource *resource)
{ {
return resource->type; return resource->type;
} }
SPA_EXPORT
struct pw_protocol *pw_resource_get_protocol(struct pw_resource *resource) struct pw_protocol *pw_resource_get_protocol(struct pw_resource *resource)
{ {
return resource->client->protocol; return resource->client->protocol;
} }
SPA_EXPORT
void *pw_resource_get_user_data(struct pw_resource *resource) void *pw_resource_get_user_data(struct pw_resource *resource)
{ {
return resource->user_data; return resource->user_data;
} }
SPA_EXPORT
void pw_resource_add_listener(struct pw_resource *resource, void pw_resource_add_listener(struct pw_resource *resource,
struct spa_hook *listener, struct spa_hook *listener,
const struct pw_resource_events *events, const struct pw_resource_events *events,
@ -127,6 +135,7 @@ void pw_resource_add_listener(struct pw_resource *resource,
spa_hook_list_append(&resource->listener_list, listener, events, data); spa_hook_list_append(&resource->listener_list, listener, events, data);
} }
SPA_EXPORT
void pw_resource_set_implementation(struct pw_resource *resource, void pw_resource_set_implementation(struct pw_resource *resource,
const void *implementation, const void *implementation,
void *data) void *data)
@ -139,6 +148,7 @@ void pw_resource_set_implementation(struct pw_resource *resource,
pw_client_events_resource_impl(client, resource); pw_client_events_resource_impl(client, resource);
} }
SPA_EXPORT
void pw_resource_add_override(struct pw_resource *resource, void pw_resource_add_override(struct pw_resource *resource,
struct spa_hook *listener, struct spa_hook *listener,
const void *implementation, const void *implementation,
@ -147,22 +157,26 @@ void pw_resource_add_override(struct pw_resource *resource,
spa_hook_list_prepend(&resource->implementation_list, listener, implementation, data); spa_hook_list_prepend(&resource->implementation_list, listener, implementation, data);
} }
SPA_EXPORT
struct spa_hook_list *pw_resource_get_implementation(struct pw_resource *resource) struct spa_hook_list *pw_resource_get_implementation(struct pw_resource *resource)
{ {
return &resource->implementation_list; return &resource->implementation_list;
} }
SPA_EXPORT
const struct pw_protocol_marshal *pw_resource_get_marshal(struct pw_resource *resource) const struct pw_protocol_marshal *pw_resource_get_marshal(struct pw_resource *resource)
{ {
return resource->marshal; return resource->marshal;
} }
SPA_EXPORT
void pw_resource_error(struct pw_resource *resource, uint32_t id, int result, const char *error) void pw_resource_error(struct pw_resource *resource, uint32_t id, int result, const char *error)
{ {
if (resource->client->core_resource) if (resource->client->core_resource)
pw_core_resource_error(resource->client->core_resource, id, result, error); pw_core_resource_error(resource->client->core_resource, id, result, error);
} }
SPA_EXPORT
void pw_resource_destroy(struct pw_resource *resource) void pw_resource_destroy(struct pw_resource *resource)
{ {
struct pw_client *client = resource->client; struct pw_client *client = resource->client;

View file

@ -900,6 +900,7 @@ static const struct pw_remote_events remote_events = {
.exported = on_remote_exported, .exported = on_remote_exported,
}; };
SPA_EXPORT
struct pw_stream * pw_stream_new(struct pw_remote *remote, const char *name, struct pw_stream * pw_stream_new(struct pw_remote *remote, const char *name,
struct pw_properties *props) struct pw_properties *props)
{ {
@ -963,6 +964,7 @@ struct pw_stream * pw_stream_new(struct pw_remote *remote, const char *name,
return NULL; return NULL;
} }
SPA_EXPORT
struct pw_stream * struct pw_stream *
pw_stream_new_simple(struct pw_loop *loop, pw_stream_new_simple(struct pw_loop *loop,
const char *name, const char *name,
@ -997,6 +999,7 @@ pw_stream_new_simple(struct pw_loop *loop,
return NULL; return NULL;
} }
SPA_EXPORT
const char *pw_stream_state_as_string(enum pw_stream_state state) const char *pw_stream_state_as_string(enum pw_stream_state state)
{ {
switch (state) { switch (state) {
@ -1018,6 +1021,7 @@ const char *pw_stream_state_as_string(enum pw_stream_state state)
return "invalid-state"; return "invalid-state";
} }
SPA_EXPORT
void pw_stream_destroy(struct pw_stream *stream) void pw_stream_destroy(struct pw_stream *stream)
{ {
struct stream *impl = SPA_CONTAINER_OF(stream, struct stream, this); struct stream *impl = SPA_CONTAINER_OF(stream, struct stream, this);
@ -1046,6 +1050,7 @@ void pw_stream_destroy(struct pw_stream *stream)
free(impl); free(impl);
} }
SPA_EXPORT
void pw_stream_add_listener(struct pw_stream *stream, void pw_stream_add_listener(struct pw_stream *stream,
struct spa_hook *listener, struct spa_hook *listener,
const struct pw_stream_events *events, const struct pw_stream_events *events,
@ -1054,6 +1059,7 @@ void pw_stream_add_listener(struct pw_stream *stream,
spa_hook_list_append(&stream->listener_list, listener, events, data); spa_hook_list_append(&stream->listener_list, listener, events, data);
} }
SPA_EXPORT
enum pw_stream_state pw_stream_get_state(struct pw_stream *stream, const char **error) enum pw_stream_state pw_stream_get_state(struct pw_stream *stream, const char **error)
{ {
if (error) if (error)
@ -1061,16 +1067,19 @@ enum pw_stream_state pw_stream_get_state(struct pw_stream *stream, const char **
return stream->state; return stream->state;
} }
SPA_EXPORT
const char *pw_stream_get_name(struct pw_stream *stream) const char *pw_stream_get_name(struct pw_stream *stream)
{ {
return stream->name; return stream->name;
} }
SPA_EXPORT
const struct pw_properties *pw_stream_get_properties(struct pw_stream *stream) const struct pw_properties *pw_stream_get_properties(struct pw_stream *stream)
{ {
return stream->properties; return stream->properties;
} }
SPA_EXPORT
int pw_stream_update_properties(struct pw_stream *stream, const struct spa_dict *dict) int pw_stream_update_properties(struct pw_stream *stream, const struct spa_dict *dict)
{ {
struct stream *impl = SPA_CONTAINER_OF(stream, struct stream, this); struct stream *impl = SPA_CONTAINER_OF(stream, struct stream, this);
@ -1087,6 +1096,7 @@ int pw_stream_update_properties(struct pw_stream *stream, const struct spa_dict
return res; return res;
} }
SPA_EXPORT
struct pw_remote *pw_stream_get_remote(struct pw_stream *stream) struct pw_remote *pw_stream_get_remote(struct pw_stream *stream)
{ {
return stream->remote; return stream->remote;
@ -1116,6 +1126,7 @@ static void add_controls(struct pw_stream *stream)
SPA_PARAM_IO_size, SPA_POD_Int(sizeof(struct spa_io_sequence)))); SPA_PARAM_IO_size, SPA_POD_Int(sizeof(struct spa_io_sequence))));
} }
SPA_EXPORT
int int
pw_stream_connect(struct pw_stream *stream, pw_stream_connect(struct pw_stream *stream,
enum pw_direction direction, enum pw_direction direction,
@ -1166,11 +1177,13 @@ pw_stream_connect(struct pw_stream *stream,
return res; return res;
} }
SPA_EXPORT
uint32_t pw_stream_get_node_id(struct pw_stream *stream) uint32_t pw_stream_get_node_id(struct pw_stream *stream)
{ {
return stream->node_id; return stream->node_id;
} }
SPA_EXPORT
int pw_stream_disconnect(struct pw_stream *stream) int pw_stream_disconnect(struct pw_stream *stream)
{ {
struct stream *impl = SPA_CONTAINER_OF(stream, struct stream, this); struct stream *impl = SPA_CONTAINER_OF(stream, struct stream, this);
@ -1191,6 +1204,7 @@ int pw_stream_disconnect(struct pw_stream *stream)
return 0; return 0;
} }
SPA_EXPORT
void pw_stream_finish_format(struct pw_stream *stream, void pw_stream_finish_format(struct pw_stream *stream,
int res, int res,
const struct spa_pod **params, const struct spa_pod **params,
@ -1208,6 +1222,7 @@ void pw_stream_finish_format(struct pw_stream *stream,
impl->pending_seq = SPA_ID_INVALID; impl->pending_seq = SPA_ID_INVALID;
} }
SPA_EXPORT
int pw_stream_set_control(struct pw_stream *stream, int pw_stream_set_control(struct pw_stream *stream,
const char *name, float value) const char *name, float value)
{ {
@ -1224,6 +1239,7 @@ int pw_stream_set_control(struct pw_stream *stream,
return 0; return 0;
} }
SPA_EXPORT
int pw_stream_get_control(struct pw_stream *stream, int pw_stream_get_control(struct pw_stream *stream,
const char *name, float *value) const char *name, float *value)
{ {
@ -1238,6 +1254,7 @@ int pw_stream_get_control(struct pw_stream *stream,
return 0; return 0;
} }
SPA_EXPORT
int pw_stream_set_active(struct pw_stream *stream, bool active) int pw_stream_set_active(struct pw_stream *stream, bool active)
{ {
struct stream *impl = SPA_CONTAINER_OF(stream, struct stream, this); struct stream *impl = SPA_CONTAINER_OF(stream, struct stream, this);
@ -1246,6 +1263,7 @@ int pw_stream_set_active(struct pw_stream *stream, bool active)
return 0; return 0;
} }
SPA_EXPORT
int pw_stream_get_time(struct pw_stream *stream, struct pw_time *time) int pw_stream_get_time(struct pw_stream *stream, struct pw_time *time)
{ {
struct stream *impl = SPA_CONTAINER_OF(stream, struct stream, this); struct stream *impl = SPA_CONTAINER_OF(stream, struct stream, this);
@ -1290,6 +1308,7 @@ static inline int call_trigger(struct stream *impl)
return res; return res;
} }
SPA_EXPORT
struct pw_buffer *pw_stream_dequeue_buffer(struct pw_stream *stream) struct pw_buffer *pw_stream_dequeue_buffer(struct pw_stream *stream)
{ {
struct stream *impl = SPA_CONTAINER_OF(stream, struct stream, this); struct stream *impl = SPA_CONTAINER_OF(stream, struct stream, this);
@ -1306,6 +1325,7 @@ struct pw_buffer *pw_stream_dequeue_buffer(struct pw_stream *stream)
return &b->this; return &b->this;
} }
SPA_EXPORT
int pw_stream_queue_buffer(struct pw_stream *stream, struct pw_buffer *buffer) int pw_stream_queue_buffer(struct pw_stream *stream, struct pw_buffer *buffer)
{ {
struct stream *impl = SPA_CONTAINER_OF(stream, struct stream, this); struct stream *impl = SPA_CONTAINER_OF(stream, struct stream, this);
@ -1340,6 +1360,7 @@ do_flush(struct spa_loop *loop,
return 0; return 0;
} }
SPA_EXPORT
int pw_stream_flush(struct pw_stream *stream, bool drain) int pw_stream_flush(struct pw_stream *stream, bool drain)
{ {
struct stream *impl = SPA_CONTAINER_OF(stream, struct stream, this); struct stream *impl = SPA_CONTAINER_OF(stream, struct stream, this);

View file

@ -101,6 +101,7 @@ do { \
* *
* \memberof pw_thread_loop * \memberof pw_thread_loop
*/ */
SPA_EXPORT
struct pw_thread_loop *pw_thread_loop_new(struct pw_loop *loop, struct pw_thread_loop *pw_thread_loop_new(struct pw_loop *loop,
const char *name) const char *name)
{ {
@ -150,6 +151,7 @@ struct pw_thread_loop *pw_thread_loop_new(struct pw_loop *loop,
} }
/** Destroy a threaded loop \memberof pw_thread_loop */ /** Destroy a threaded loop \memberof pw_thread_loop */
SPA_EXPORT
void pw_thread_loop_destroy(struct pw_thread_loop *loop) void pw_thread_loop_destroy(struct pw_thread_loop *loop)
{ {
pw_thread_loop_events_destroy(loop); pw_thread_loop_events_destroy(loop);
@ -168,6 +170,7 @@ void pw_thread_loop_destroy(struct pw_thread_loop *loop)
free(loop); free(loop);
} }
SPA_EXPORT
void pw_thread_loop_add_listener(struct pw_thread_loop *loop, void pw_thread_loop_add_listener(struct pw_thread_loop *loop,
struct spa_hook *listener, struct spa_hook *listener,
const struct pw_thread_loop_events *events, const struct pw_thread_loop_events *events,
@ -176,6 +179,7 @@ void pw_thread_loop_add_listener(struct pw_thread_loop *loop,
spa_hook_list_append(&loop->listener_list, listener, events, data); spa_hook_list_append(&loop->listener_list, listener, events, data);
} }
SPA_EXPORT
struct pw_loop * struct pw_loop *
pw_thread_loop_get_loop(struct pw_thread_loop *loop) pw_thread_loop_get_loop(struct pw_thread_loop *loop)
{ {
@ -210,6 +214,7 @@ static void *do_loop(void *user_data)
* *
* \memberof pw_thread_loop * \memberof pw_thread_loop
*/ */
SPA_EXPORT
int pw_thread_loop_start(struct pw_thread_loop *loop) int pw_thread_loop_start(struct pw_thread_loop *loop)
{ {
if (!loop->running) { if (!loop->running) {
@ -232,6 +237,7 @@ int pw_thread_loop_start(struct pw_thread_loop *loop)
* *
* \memberof pw_thread_loop * \memberof pw_thread_loop
*/ */
SPA_EXPORT
void pw_thread_loop_stop(struct pw_thread_loop *loop) void pw_thread_loop_stop(struct pw_thread_loop *loop)
{ {
pw_log_debug("thread-loop: %p stopping", loop); pw_log_debug("thread-loop: %p stopping", loop);
@ -252,6 +258,7 @@ void pw_thread_loop_stop(struct pw_thread_loop *loop)
* *
* \memberof pw_thread_loop * \memberof pw_thread_loop
*/ */
SPA_EXPORT
void pw_thread_loop_lock(struct pw_thread_loop *loop) void pw_thread_loop_lock(struct pw_thread_loop *loop)
{ {
pthread_mutex_lock(&loop->lock); pthread_mutex_lock(&loop->lock);
@ -264,6 +271,7 @@ void pw_thread_loop_lock(struct pw_thread_loop *loop)
* *
* \memberof pw_thread_loop * \memberof pw_thread_loop
*/ */
SPA_EXPORT
void pw_thread_loop_unlock(struct pw_thread_loop *loop) void pw_thread_loop_unlock(struct pw_thread_loop *loop)
{ {
pw_log_trace("thread-loop: %p", loop); pw_log_trace("thread-loop: %p", loop);
@ -280,6 +288,7 @@ void pw_thread_loop_unlock(struct pw_thread_loop *loop)
* *
* \memberof pw_thread_loop * \memberof pw_thread_loop
*/ */
SPA_EXPORT
void pw_thread_loop_signal(struct pw_thread_loop *loop, bool wait_for_accept) void pw_thread_loop_signal(struct pw_thread_loop *loop, bool wait_for_accept)
{ {
pw_log_trace("thread-loop: %p, waiting %d", loop, loop->n_waiting); pw_log_trace("thread-loop: %p, waiting %d", loop, loop->n_waiting);
@ -300,6 +309,7 @@ void pw_thread_loop_signal(struct pw_thread_loop *loop, bool wait_for_accept)
* *
* \memberof pw_thread_loop * \memberof pw_thread_loop
*/ */
SPA_EXPORT
void pw_thread_loop_wait(struct pw_thread_loop *loop) void pw_thread_loop_wait(struct pw_thread_loop *loop)
{ {
pw_log_trace("thread-loop: %p, waiting %d", loop, loop->n_waiting); pw_log_trace("thread-loop: %p, waiting %d", loop, loop->n_waiting);
@ -318,6 +328,7 @@ void pw_thread_loop_wait(struct pw_thread_loop *loop)
* *
* \memberof pw_thread_loop * \memberof pw_thread_loop
*/ */
SPA_EXPORT
int pw_thread_loop_timed_wait(struct pw_thread_loop *loop, int wait_max_sec) int pw_thread_loop_timed_wait(struct pw_thread_loop *loop, int wait_max_sec)
{ {
struct timespec timeout; struct timespec timeout;
@ -339,6 +350,7 @@ int pw_thread_loop_timed_wait(struct pw_thread_loop *loop, int wait_max_sec)
* *
* \memberof pw_thread_loop * \memberof pw_thread_loop
*/ */
SPA_EXPORT
void pw_thread_loop_accept(struct pw_thread_loop *loop) void pw_thread_loop_accept(struct pw_thread_loop *loop)
{ {
loop->n_waiting_for_accept--; loop->n_waiting_for_accept--;
@ -352,6 +364,7 @@ void pw_thread_loop_accept(struct pw_thread_loop *loop)
* *
* \memberof pw_thread_loop * \memberof pw_thread_loop
*/ */
SPA_EXPORT
bool pw_thread_loop_in_thread(struct pw_thread_loop *loop) bool pw_thread_loop_in_thread(struct pw_thread_loop *loop)
{ {
return pthread_self() == loop->thread; return pthread_self() == loop->thread;

View file

@ -41,6 +41,7 @@
* *
* \memberof pw_utils * \memberof pw_utils
*/ */
SPA_EXPORT
const char *pw_split_walk(const char *str, const char *delimiter, size_t * len, const char **state) const char *pw_split_walk(const char *str, const char *delimiter, size_t * len, const char **state)
{ {
const char *s = *state ? *state : str; const char *s = *state ? *state : str;
@ -66,6 +67,7 @@ const char *pw_split_walk(const char *str, const char *delimiter, size_t * len,
* *
* \memberof pw_utils * \memberof pw_utils
*/ */
SPA_EXPORT
char **pw_split_strv(const char *str, const char *delimiter, int max_tokens, int *n_tokens) char **pw_split_strv(const char *str, const char *delimiter, int max_tokens, int *n_tokens)
{ {
const char *state = NULL, *s = NULL; const char *state = NULL, *s = NULL;
@ -99,6 +101,7 @@ char **pw_split_strv(const char *str, const char *delimiter, int max_tokens, int
* *
* \memberof pw_utils * \memberof pw_utils
*/ */
SPA_EXPORT
void pw_free_strv(char **str) void pw_free_strv(char **str)
{ {
int i; int i;
@ -117,6 +120,7 @@ void pw_free_strv(char **str)
* *
* \memberof pw_utils * \memberof pw_utils
*/ */
SPA_EXPORT
char *pw_strip(char *str, const char *whitespace) char *pw_strip(char *str, const char *whitespace)
{ {
char *e, *l = NULL; char *e, *l = NULL;