module: implement properties

This commit is contained in:
Wim Taymans 2018-06-01 11:23:02 +02:00
parent c0a3220228
commit 46ad3155b5
13 changed files with 123 additions and 6 deletions

View file

@ -32,6 +32,12 @@
#include "module-client-node/client-node.h"
#include "module-client-node/client-stream.h"
static const struct spa_dict_item module_props[] = {
{ PW_MODULE_PROP_AUTHOR, "Wim Taymans <wim.taymans@gmail.com>" },
{ PW_MODULE_PROP_DESCRIPTION, "Allow clients to create and control remote nodes" },
{ PW_MODULE_PROP_VERSION, PACKAGE_VERSION },
};
struct pw_protocol *pw_protocol_native_ext_client_node_init(struct pw_core *core);
struct factory_data {
@ -143,6 +149,8 @@ static int module_init(struct pw_module *module, struct pw_properties *propertie
pw_module_add_listener(module, &data->module_listener, &module_events, data);
pw_module_update_properties(module, &SPA_DICT_INIT_ARRAY(module_props));
return 0;
}

View file

@ -38,6 +38,12 @@
#include "pipewire/module.h"
#include "pipewire/utils.h"
static const struct spa_dict_item module_props[] = {
{ PW_MODULE_PROP_AUTHOR, "Wim Taymans <wim.taymans@gmail.com>" },
{ PW_MODULE_PROP_DESCRIPTION, "Perform portal queries to check permissions" },
{ PW_MODULE_PROP_VERSION, PACKAGE_VERSION },
};
struct impl {
struct pw_core *core;
struct pw_type *type;
@ -502,6 +508,8 @@ static int module_init(struct pw_module *module, struct pw_properties *propertie
pw_core_add_listener(core, &impl->core_listener, &core_events, impl);
pw_module_add_listener(module, &impl->module_listener, &module_events, impl);
pw_module_update_properties(module, &SPA_DICT_INIT_ARRAY(module_props));
return 0;
error:

View file

@ -30,6 +30,12 @@
#include "pipewire/module.h"
#include "pipewire/link.h"
static const struct spa_dict_item module_props[] = {
{ PW_MODULE_PROP_AUTHOR, "Wim Taymans <wim.taymans@gmail.com>" },
{ PW_MODULE_PROP_DESCRIPTION, "Allow clients to create links" },
{ PW_MODULE_PROP_VERSION, PACKAGE_VERSION },
};
struct factory_data {
struct pw_factory *this;
struct pw_properties *properties;
@ -222,6 +228,8 @@ static int module_init(struct pw_module *module, struct pw_properties *propertie
pw_module_add_listener(module, &data->module_listener, &module_events, data);
pw_module_update_properties(module, &SPA_DICT_INIT_ARRAY(module_props));
return 0;
}

View file

@ -42,6 +42,12 @@
#include "module-media-session/audio-dsp.h"
static const struct spa_dict_item module_props[] = {
{ PW_MODULE_PROP_AUTHOR, "Wim Taymans <wim.taymans@gmail.com>" },
{ PW_MODULE_PROP_DESCRIPTION, "Manage media sessions" },
{ PW_MODULE_PROP_VERSION, PACKAGE_VERSION },
};
#define DEFAULT_CHANNELS 2
#define DEFAULT_SAMPLE_RATE 48000
#define DEFAULT_BUFFER_SIZE (64 * sizeof(float))
@ -794,6 +800,8 @@ static int module_init(struct pw_module *module, struct pw_properties *propertie
pw_core_add_listener(core, &impl->core_listener, &core_events, impl);
pw_module_add_listener(module, &impl->module_listener, &module_events, impl);
pw_module_update_properties(module, &SPA_DICT_INIT_ARRAY(module_props));
return 0;
}

View file

@ -54,6 +54,12 @@
#define UNIX_PATH_MAX 108
#endif
static const struct spa_dict_item module_props[] = {
{ PW_MODULE_PROP_AUTHOR, "Wim Taymans <wim.taymans@gmail.com>" },
{ PW_MODULE_PROP_DESCRIPTION, "Native protocol using unix sockets" },
{ PW_MODULE_PROP_VERSION, PACKAGE_VERSION },
};
static bool debug_messages = 0;
#define LOCK_SUFFIX ".lock"
@ -922,6 +928,8 @@ static int module_init(struct pw_module *module, struct pw_properties *propertie
pw_module_add_listener(module, &d->module_listener, &module_events, d);
pw_module_update_properties(module, &SPA_DICT_INIT_ARRAY(module_props));
return 0;
}

View file

@ -41,6 +41,12 @@
#include "pipewire/module.h"
#include "pipewire/utils.h"
static const struct spa_dict_item module_props[] = {
{ PW_MODULE_PROP_AUTHOR, "Wim Taymans <wim.taymans@gmail.com>" },
{ PW_MODULE_PROP_DESCRIPTION, "Use RTKit to raise thread priorities" },
{ PW_MODULE_PROP_VERSION, PACKAGE_VERSION },
};
struct impl {
struct pw_core *core;
struct pw_type *type;
@ -505,6 +511,8 @@ static int module_init(struct pw_module *module, struct pw_properties *propertie
pw_module_add_listener(module, &impl->module_listener, &module_events, impl);
pw_module_update_properties(module, &SPA_DICT_INIT_ARRAY(module_props));
return 0;
error:

View file

@ -29,6 +29,12 @@
#include "pipewire/module.h"
#include "pipewire/private.h"
static const struct spa_dict_item module_props[] = {
{ PW_MODULE_PROP_AUTHOR, "Wim Taymans <wim.taymans@gmail.com>" },
{ PW_MODULE_PROP_DESCRIPTION, "Suspend nodes when not in use" },
{ PW_MODULE_PROP_VERSION, PACKAGE_VERSION },
};
struct impl {
struct pw_core *core;
struct pw_type *t;
@ -209,6 +215,8 @@ static int module_init(struct pw_module *module, struct pw_properties *propertie
pw_module_add_listener(module, &impl->module_listener, &module_events, impl);
pw_core_add_listener(impl->core, &impl->core_listener, &core_events, impl);
pw_module_update_properties(module, &SPA_DICT_INIT_ARRAY(module_props));
return 0;
}

View file

@ -33,6 +33,12 @@
#include "spa-monitor.h"
static const struct spa_dict_item module_props[] = {
{ PW_MODULE_PROP_AUTHOR, "Wim Taymans <wim.taymans@gmail.com>" },
{ PW_MODULE_PROP_DESCRIPTION, "Manage SPA monitors" },
{ PW_MODULE_PROP_VERSION, PACKAGE_VERSION },
};
struct data {
struct pw_spa_monitor *monitor;
struct spa_hook module_listener;
@ -84,6 +90,8 @@ int pipewire__module_init(struct pw_module *module, const char *args)
pw_module_add_listener(module, &data->module_listener, &module_events, data);
pw_module_update_properties(module, &SPA_DICT_INIT_ARRAY(module_props));
return 0;
not_enough_arguments:

View file

@ -31,6 +31,12 @@
#include "spa-node.h"
static const struct spa_dict_item module_props[] = {
{ PW_MODULE_PROP_AUTHOR, "Wim Taymans <wim.taymans@gmail.com>" },
{ PW_MODULE_PROP_DESCRIPTION, "Provide a factory to make SPA nodes" },
{ PW_MODULE_PROP_VERSION, PACKAGE_VERSION },
};
struct factory_data {
struct pw_core *core;
struct pw_factory *this;
@ -191,6 +197,8 @@ static int module_init(struct pw_module *module, struct pw_properties *propertie
pw_log_debug("module %p: new", module);
pw_module_add_listener(module, &data->module_listener, &module_events, data);
pw_module_update_properties(module, &SPA_DICT_INIT_ARRAY(module_props));
pw_factory_register(factory, NULL, pw_module_get_global(module), NULL);
return 0;

View file

@ -34,6 +34,12 @@
#include "spa-monitor.h"
#include "spa-node.h"
static const struct spa_dict_item module_props[] = {
{ PW_MODULE_PROP_AUTHOR, "Wim Taymans <wim.taymans@gmail.com>" },
{ PW_MODULE_PROP_DESCRIPTION, "Load and manage an SPA node" },
{ PW_MODULE_PROP_VERSION, PACKAGE_VERSION },
};
struct node_data {
struct pw_node *this;
struct pw_core *core;
@ -96,6 +102,8 @@ int pipewire__module_init(struct pw_module *module, const char *args)
pw_log_debug("module %p: new", module);
pw_module_add_listener(module, &data->module_listener, &module_events, data);
pw_module_update_properties(module, &SPA_DICT_INIT_ARRAY(module_props));
return 0;
not_enough_arguments: