mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-04 13:30:12 -05:00
client-node: make the client parent
This commit is contained in:
parent
294bba65a1
commit
0e2885b599
1 changed files with 3 additions and 11 deletions
|
|
@ -55,20 +55,16 @@ static void *create_object(void *_data,
|
||||||
struct pw_properties *properties,
|
struct pw_properties *properties,
|
||||||
uint32_t new_id)
|
uint32_t new_id)
|
||||||
{
|
{
|
||||||
struct factory_data *d = _data;
|
|
||||||
void *result;
|
void *result;
|
||||||
struct pw_resource *node_resource;
|
struct pw_resource *node_resource;
|
||||||
struct pw_global *parent;
|
struct pw_global *parent;
|
||||||
|
struct pw_client *client = pw_resource_get_client(resource);
|
||||||
|
|
||||||
if (resource == NULL)
|
node_resource = pw_resource_new(client, new_id, PW_PERM_RWX, type, version, 0);
|
||||||
goto no_resource;
|
|
||||||
|
|
||||||
node_resource = pw_resource_new(pw_resource_get_client(resource),
|
|
||||||
new_id, PW_PERM_RWX, type, version, 0);
|
|
||||||
if (node_resource == NULL)
|
if (node_resource == NULL)
|
||||||
goto no_mem;
|
goto no_mem;
|
||||||
|
|
||||||
parent = pw_module_get_global(d->module);
|
parent = pw_client_get_global(client);
|
||||||
|
|
||||||
if (properties && pw_properties_get(properties, "node.stream") != NULL) {
|
if (properties && pw_properties_get(properties, "node.stream") != NULL) {
|
||||||
result = pw_client_stream_new(node_resource, parent, properties);
|
result = pw_client_stream_new(node_resource, parent, properties);
|
||||||
|
|
@ -81,10 +77,6 @@ static void *create_object(void *_data,
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
|
|
||||||
no_resource:
|
|
||||||
pw_log_error("client-node needs a resource");
|
|
||||||
pw_resource_error(resource, new_id, -EINVAL, "no resource");
|
|
||||||
goto done;
|
|
||||||
no_mem:
|
no_mem:
|
||||||
pw_log_error("can't create node");
|
pw_log_error("can't create node");
|
||||||
pw_resource_error(resource, new_id, -ENOMEM, "no memory");
|
pw_resource_error(resource, new_id, -ENOMEM, "no memory");
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue