mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-04 13:30:12 -05:00
core: remove create-link
Make a link factory and use create-object to make links. That way we can have different kinds of links based on the factory and we can also hide the factory when link creation should be blocked.
This commit is contained in:
parent
f1345f91a8
commit
67b06d4ad2
7 changed files with 250 additions and 244 deletions
|
|
@ -934,11 +934,18 @@ static bool do_create_link(struct data *data, const char *cmd, char *args, char
|
|||
}
|
||||
if (n == 5)
|
||||
props = parse_props(a[4]);
|
||||
else
|
||||
props = pw_properties_new(NULL, NULL);
|
||||
|
||||
proxy = (struct pw_proxy*)pw_core_proxy_create_link(rd->core_proxy, t->link,
|
||||
atoi(a[0]), atoi(a[1]),
|
||||
atoi(a[2]), atoi(a[3]),
|
||||
NULL,
|
||||
pw_properties_set(props, PW_LINK_OUTPUT_NODE_ID, a[0]);
|
||||
pw_properties_set(props, PW_LINK_OUTPUT_PORT_ID, a[1]);
|
||||
pw_properties_set(props, PW_LINK_INPUT_NODE_ID, a[2]);
|
||||
pw_properties_set(props, PW_LINK_INPUT_PORT_ID, a[3]);
|
||||
|
||||
proxy = (struct pw_proxy*)pw_core_proxy_create_object(rd->core_proxy,
|
||||
"link-factory",
|
||||
t->link,
|
||||
PW_VERSION_LINK,
|
||||
props ? &props->dict : NULL,
|
||||
sizeof(struct proxy_data));
|
||||
|
||||
|
|
@ -1099,6 +1106,8 @@ int main(int argc, char *argv[])
|
|||
data.t = pw_core_get_type(data.core);
|
||||
info = pw_core_get_info(data.core);
|
||||
|
||||
pw_module_load(data.core, "libpipewire-module-link-factory", NULL);
|
||||
|
||||
pw_loop_add_io(l, STDIN_FILENO, SPA_IO_IN|SPA_IO_HUP, false, do_input, &data);
|
||||
|
||||
fprintf(stdout, "Welcome to PipeWire \"%s\" version %s. Type 'help' for usage.\n", info->name, info->version);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue