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
|
|
@ -427,40 +427,9 @@ static void do_create_object(void *data,
|
|||
return;
|
||||
}
|
||||
|
||||
static void
|
||||
do_create_link(void *data,
|
||||
uint32_t output_node_id,
|
||||
uint32_t output_port_id,
|
||||
uint32_t input_node_id,
|
||||
uint32_t input_port_id,
|
||||
const struct spa_pod *filter,
|
||||
const struct spa_dict *props,
|
||||
uint32_t new_id)
|
||||
{
|
||||
struct resource *resource = data;
|
||||
struct client_info *cinfo = resource->cinfo;
|
||||
|
||||
if (cinfo->is_sandboxed) {
|
||||
pw_resource_error(resource->resource, -EPERM, "not allowed");
|
||||
return;
|
||||
}
|
||||
pw_resource_do_parent(resource->resource,
|
||||
&resource->override,
|
||||
struct pw_core_proxy_methods,
|
||||
create_link,
|
||||
output_node_id,
|
||||
output_port_id,
|
||||
input_node_id,
|
||||
input_port_id,
|
||||
filter,
|
||||
props,
|
||||
new_id);
|
||||
}
|
||||
|
||||
static const struct pw_core_proxy_methods core_override = {
|
||||
PW_VERSION_CORE_PROXY_METHODS,
|
||||
.create_object = do_create_object,
|
||||
.create_link = do_create_link,
|
||||
};
|
||||
|
||||
static void client_resource_impl(void *data, struct pw_resource *resource)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue