hook: handle port and factory implementation with hook

This way we can also handle the version number.
This commit is contained in:
Wim Taymans 2019-05-14 18:08:02 +02:00
parent 23d4ed62dd
commit 903cbeb7c1
5 changed files with 23 additions and 26 deletions

View file

@ -245,8 +245,7 @@ static void node_port_init(void *data, struct pw_port *port)
if (direction == PW_DIRECTION_INPUT) {
pw_log_debug("mix node %p", p->spa_node);
pw_port_set_mix(port, p->spa_node, PW_PORT_MIX_FLAG_MULTI);
port->implementation = &port_implementation;
port->implementation_data = p;
port->impl = SPA_HOOK_INIT(&port_implementation, p);
}
spa_list_append(&n->ports, &p->link);
}

View file

@ -1532,9 +1532,7 @@ static void node_port_added(void *data, struct pw_port *port)
PW_PORT_MIX_FLAG_MULTI |
PW_PORT_MIX_FLAG_MIX_ONLY);
port->implementation = &port_impl;
port->implementation_data = p;
port->impl = SPA_HOOK_INIT(&port_impl, p);
port->owner_data = impl;
}