Add parent_id

Add parent_id to globals to make hierarchy of interfaces. We can use
this to group interfaces or to describe the owner.
This commit is contained in:
Wim Taymans 2017-07-18 14:58:14 +02:00
parent 1acba78234
commit a003d1a39f
27 changed files with 151 additions and 99 deletions

View file

@ -67,11 +67,15 @@ static struct pw_node *create_node(struct pw_node_factory *factory,
return NULL;
}
static struct impl *module_new(struct pw_core *core, struct pw_properties *properties)
static bool module_init(struct pw_module *module, struct pw_properties *properties)
{
struct pw_core *core = module->core;
struct impl *impl;
impl = calloc(1, sizeof(struct impl));
if (impl == NULL)
return false;
pw_log_debug("module %p: new", impl);
impl->properties = properties;
@ -86,10 +90,11 @@ static struct impl *module_new(struct pw_core *core, struct pw_properties *prope
spa_list_insert(core->node_factory_list.prev, &impl->this.link);
pw_core_add_global(core, NULL, core->type.node_factory, 0,
NULL, impl, &impl->this.global);
impl->this.global = pw_core_add_global(core, NULL, module->global,
core->type.node_factory, 0,
NULL, impl);
return impl;
return true;
}
#if 0
@ -103,6 +108,5 @@ static void module_destroy(struct impl *impl)
bool pipewire__module_init(struct pw_module *module, const char *args)
{
module_new(module->core, NULL);
return true;
return module_init(module, NULL);
}