mirror of
				https://gitlab.freedesktop.org/pipewire/pipewire.git
				synced 2025-11-03 09:01:54 -05:00 
			
		
		
		
	use global_update_keys
First set the properties in the object itself and then copy them over to the global. This ensure that the global properties are also in the object and makes code a bit cleaner. It also make it possible to use the global id to make the property values unique, if we want to later .
This commit is contained in:
		
							parent
							
								
									f79c347667
								
							
						
					
					
						commit
						469dff0153
					
				
					 9 changed files with 32 additions and 72 deletions
				
			
		| 
						 | 
					@ -324,16 +324,10 @@ int endpoint_init(struct endpoint *this,
 | 
				
			||||||
	this->client_ep = client_ep;
 | 
						this->client_ep = client_ep;
 | 
				
			||||||
	this->props = properties;
 | 
						this->props = properties;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	properties = pw_properties_new(NULL, NULL);
 | 
					 | 
				
			||||||
	if (!properties)
 | 
					 | 
				
			||||||
		goto no_mem;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	pw_properties_update_keys(properties, &this->props->dict, keys);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	this->global = pw_global_new (context,
 | 
						this->global = pw_global_new (context,
 | 
				
			||||||
			PW_TYPE_INTERFACE_Endpoint,
 | 
								PW_TYPE_INTERFACE_Endpoint,
 | 
				
			||||||
			PW_VERSION_ENDPOINT,
 | 
								PW_VERSION_ENDPOINT,
 | 
				
			||||||
			properties, endpoint_bind, this);
 | 
								NULL, endpoint_bind, this);
 | 
				
			||||||
	if (!this->global)
 | 
						if (!this->global)
 | 
				
			||||||
		goto no_mem;
 | 
							goto no_mem;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -344,6 +338,8 @@ int endpoint_init(struct endpoint *this,
 | 
				
			||||||
	this->info.id = pw_global_get_id(this->global);
 | 
						this->info.id = pw_global_get_id(this->global);
 | 
				
			||||||
	this->info.props = &this->props->dict;
 | 
						this->info.props = &this->props->dict;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						pw_global_update_keys(this->global, &this->props->dict, keys);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	pw_resource_set_bound_id(client_ep->resource, this->info.id);
 | 
						pw_resource_set_bound_id(client_ep->resource, this->info.id);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	return pw_global_register(this->global);
 | 
						return pw_global_register(this->global);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -286,16 +286,10 @@ int session_init(struct session *this,
 | 
				
			||||||
	this->client_sess = client_sess;
 | 
						this->client_sess = client_sess;
 | 
				
			||||||
	this->props = properties;
 | 
						this->props = properties;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	properties = pw_properties_new(NULL, NULL);
 | 
					 | 
				
			||||||
	if (!properties)
 | 
					 | 
				
			||||||
		goto no_mem;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	pw_properties_update_keys(properties, &this->props->dict, keys);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	this->global = pw_global_new (context,
 | 
						this->global = pw_global_new (context,
 | 
				
			||||||
			PW_TYPE_INTERFACE_Session,
 | 
								PW_TYPE_INTERFACE_Session,
 | 
				
			||||||
			PW_VERSION_SESSION,
 | 
								PW_VERSION_SESSION,
 | 
				
			||||||
			properties, session_bind, this);
 | 
								NULL, session_bind, this);
 | 
				
			||||||
	if (!this->global)
 | 
						if (!this->global)
 | 
				
			||||||
		goto no_mem;
 | 
							goto no_mem;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -306,6 +300,8 @@ int session_init(struct session *this,
 | 
				
			||||||
	this->info.id = pw_global_get_id(this->global);
 | 
						this->info.id = pw_global_get_id(this->global);
 | 
				
			||||||
	this->info.props = &this->props->dict;
 | 
						this->info.props = &this->props->dict;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						pw_global_update_keys(this->global, &this->props->dict, keys);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	pw_resource_set_bound_id(client_sess->resource, this->info.id);
 | 
						pw_resource_set_bound_id(client_sess->resource, this->info.id);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	return pw_global_register(this->global);
 | 
						return pw_global_register(this->global);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -437,13 +437,6 @@ int pw_impl_client_register(struct pw_impl_client *client,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	pw_log_debug(NAME" %p: register", client);
 | 
						pw_log_debug(NAME" %p: register", client);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (properties == NULL)
 | 
					 | 
				
			||||||
		properties = pw_properties_new(NULL, NULL);
 | 
					 | 
				
			||||||
	if (properties == NULL)
 | 
					 | 
				
			||||||
		return -errno;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	pw_properties_update_keys(properties, &client->properties->dict, keys);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	client->global = pw_global_new(context,
 | 
						client->global = pw_global_new(context,
 | 
				
			||||||
				       PW_TYPE_INTERFACE_Client,
 | 
									       PW_TYPE_INTERFACE_Client,
 | 
				
			||||||
				       PW_VERSION_CLIENT,
 | 
									       PW_VERSION_CLIENT,
 | 
				
			||||||
| 
						 | 
					@ -460,6 +453,8 @@ int pw_impl_client_register(struct pw_impl_client *client,
 | 
				
			||||||
	pw_properties_setf(client->properties, PW_KEY_OBJECT_ID, "%d", client->info.id);
 | 
						pw_properties_setf(client->properties, PW_KEY_OBJECT_ID, "%d", client->info.id);
 | 
				
			||||||
	client->info.props = &client->properties->dict;
 | 
						client->info.props = &client->properties->dict;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						pw_global_update_keys(client->global, client->info.props, keys);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	pw_impl_client_emit_initialized(client);
 | 
						pw_impl_client_emit_initialized(client);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	pw_global_add_listener(client->global, &client->global_listener, &global_events, client);
 | 
						pw_global_add_listener(client->global, &client->global_listener, &global_events, client);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -564,13 +564,6 @@ int pw_impl_core_register(struct pw_impl_core *core,
 | 
				
			||||||
	if (core->registered)
 | 
						if (core->registered)
 | 
				
			||||||
		goto error_existed;
 | 
							goto error_existed;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (properties == NULL)
 | 
					 | 
				
			||||||
		properties = pw_properties_new(NULL, NULL);
 | 
					 | 
				
			||||||
	if (properties == NULL)
 | 
					 | 
				
			||||||
		return -errno;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	pw_properties_update_keys(properties, &core->properties->dict, keys);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        core->global = pw_global_new(context,
 | 
					        core->global = pw_global_new(context,
 | 
				
			||||||
					PW_TYPE_INTERFACE_Core,
 | 
										PW_TYPE_INTERFACE_Core,
 | 
				
			||||||
					PW_VERSION_CORE,
 | 
										PW_VERSION_CORE,
 | 
				
			||||||
| 
						 | 
					@ -587,16 +580,18 @@ int pw_impl_core_register(struct pw_impl_core *core,
 | 
				
			||||||
	pw_properties_setf(core->properties, PW_KEY_OBJECT_ID, "%d", core->info.id);
 | 
						pw_properties_setf(core->properties, PW_KEY_OBJECT_ID, "%d", core->info.id);
 | 
				
			||||||
	core->info.props = &core->properties->dict;
 | 
						core->info.props = &core->properties->dict;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						pw_global_update_keys(core->global, core->info.props, keys);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	pw_impl_core_emit_initialized(core);
 | 
						pw_impl_core_emit_initialized(core);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	pw_global_add_listener(core->global, &core->global_listener, &global_events, core);
 | 
						pw_global_add_listener(core->global, &core->global_listener, &global_events, core);
 | 
				
			||||||
	pw_global_register(core->global);
 | 
						pw_global_register(core->global);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	return 0;
 | 
						return 0;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
error_existed:
 | 
					error_existed:
 | 
				
			||||||
	res = -EEXIST;
 | 
						res = -EEXIST;
 | 
				
			||||||
	goto error_exit;
 | 
						goto error_exit;
 | 
				
			||||||
 | 
					 | 
				
			||||||
error_exit:
 | 
					error_exit:
 | 
				
			||||||
	if (properties)
 | 
						if (properties)
 | 
				
			||||||
		pw_properties_free(properties);
 | 
							pw_properties_free(properties);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -479,13 +479,6 @@ int pw_impl_device_register(struct pw_impl_device *device,
 | 
				
			||||||
	if (device->registered)
 | 
						if (device->registered)
 | 
				
			||||||
		goto error_existed;
 | 
							goto error_existed;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (properties == NULL)
 | 
					 | 
				
			||||||
		properties = pw_properties_new(NULL, NULL);
 | 
					 | 
				
			||||||
	if (properties == NULL)
 | 
					 | 
				
			||||||
		return -errno;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	pw_properties_update_keys(properties, &device->properties->dict, keys);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        device->global = pw_global_new(context,
 | 
					        device->global = pw_global_new(context,
 | 
				
			||||||
				       PW_TYPE_INTERFACE_Device,
 | 
									       PW_TYPE_INTERFACE_Device,
 | 
				
			||||||
				       PW_VERSION_DEVICE,
 | 
									       PW_VERSION_DEVICE,
 | 
				
			||||||
| 
						 | 
					@ -502,6 +495,8 @@ int pw_impl_device_register(struct pw_impl_device *device,
 | 
				
			||||||
	pw_properties_setf(device->properties, PW_KEY_OBJECT_ID, "%d", device->info.id);
 | 
						pw_properties_setf(device->properties, PW_KEY_OBJECT_ID, "%d", device->info.id);
 | 
				
			||||||
	device->info.props = &device->properties->dict;
 | 
						device->info.props = &device->properties->dict;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						pw_global_update_keys(device->global, device->info.props, keys);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	pw_impl_device_emit_initialized(device);
 | 
						pw_impl_device_emit_initialized(device);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	pw_global_add_listener(device->global, &device->global_listener, &global_events, device);
 | 
						pw_global_add_listener(device->global, &device->global_listener, &global_events, device);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -176,23 +176,15 @@ int pw_impl_factory_register(struct pw_impl_factory *factory,
 | 
				
			||||||
	struct pw_context *context = factory->context;
 | 
						struct pw_context *context = factory->context;
 | 
				
			||||||
	const char *keys[] = {
 | 
						const char *keys[] = {
 | 
				
			||||||
		PW_KEY_MODULE_ID,
 | 
							PW_KEY_MODULE_ID,
 | 
				
			||||||
 | 
							PW_KEY_FACTORY_NAME,
 | 
				
			||||||
 | 
							PW_KEY_FACTORY_TYPE_NAME,
 | 
				
			||||||
 | 
							PW_KEY_FACTORY_TYPE_VERSION,
 | 
				
			||||||
		NULL
 | 
							NULL
 | 
				
			||||||
	};
 | 
						};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (factory->registered)
 | 
						if (factory->registered)
 | 
				
			||||||
		goto error_existed;
 | 
							goto error_existed;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (properties == NULL)
 | 
					 | 
				
			||||||
		properties = pw_properties_new(NULL, NULL);
 | 
					 | 
				
			||||||
	if (properties == NULL)
 | 
					 | 
				
			||||||
		return -errno;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	pw_properties_update_keys(properties, &factory->properties->dict, keys);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	pw_properties_set(properties, PW_KEY_FACTORY_NAME, factory->info.name);
 | 
					 | 
				
			||||||
	pw_properties_setf(properties, PW_KEY_FACTORY_TYPE_NAME, "%s", factory->info.type);
 | 
					 | 
				
			||||||
	pw_properties_setf(properties, PW_KEY_FACTORY_TYPE_VERSION, "%d", factory->info.version);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        factory->global = pw_global_new(context,
 | 
					        factory->global = pw_global_new(context,
 | 
				
			||||||
					PW_TYPE_INTERFACE_Factory,
 | 
										PW_TYPE_INTERFACE_Factory,
 | 
				
			||||||
					PW_VERSION_FACTORY,
 | 
										PW_VERSION_FACTORY,
 | 
				
			||||||
| 
						 | 
					@ -207,8 +199,13 @@ int pw_impl_factory_register(struct pw_impl_factory *factory,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	factory->info.id = factory->global->id;
 | 
						factory->info.id = factory->global->id;
 | 
				
			||||||
	pw_properties_setf(factory->properties, PW_KEY_OBJECT_ID, "%d", factory->info.id);
 | 
						pw_properties_setf(factory->properties, PW_KEY_OBJECT_ID, "%d", factory->info.id);
 | 
				
			||||||
 | 
						pw_properties_set(factory->properties, PW_KEY_FACTORY_NAME, factory->info.name);
 | 
				
			||||||
 | 
						pw_properties_setf(factory->properties, PW_KEY_FACTORY_TYPE_NAME, "%s", factory->info.type);
 | 
				
			||||||
 | 
						pw_properties_setf(factory->properties, PW_KEY_FACTORY_TYPE_VERSION, "%d", factory->info.version);
 | 
				
			||||||
	factory->info.props = &factory->properties->dict;
 | 
						factory->info.props = &factory->properties->dict;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						pw_global_update_keys(factory->global, factory->info.props, keys);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	pw_impl_factory_emit_initialized(factory);
 | 
						pw_impl_factory_emit_initialized(factory);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	pw_global_add_listener(factory->global, &factory->global_listener, &global_events, factory);
 | 
						pw_global_add_listener(factory->global, &factory->global_listener, &global_events, factory);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1177,17 +1177,14 @@ int pw_impl_link_register(struct pw_impl_link *link,
 | 
				
			||||||
		PW_KEY_MODULE_ID,
 | 
							PW_KEY_MODULE_ID,
 | 
				
			||||||
		PW_KEY_FACTORY_ID,
 | 
							PW_KEY_FACTORY_ID,
 | 
				
			||||||
		PW_KEY_CLIENT_ID,
 | 
							PW_KEY_CLIENT_ID,
 | 
				
			||||||
 | 
							PW_KEY_LINK_OUTPUT_PORT,
 | 
				
			||||||
 | 
							PW_KEY_LINK_INPUT_PORT,
 | 
				
			||||||
		NULL
 | 
							NULL
 | 
				
			||||||
	};
 | 
						};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (link->registered)
 | 
						if (link->registered)
 | 
				
			||||||
		goto error_existed;
 | 
							goto error_existed;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (properties == NULL)
 | 
					 | 
				
			||||||
		properties = pw_properties_new(NULL, NULL);
 | 
					 | 
				
			||||||
	if (properties == NULL)
 | 
					 | 
				
			||||||
		return -errno;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	output_node = link->output->node;
 | 
						output_node = link->output->node;
 | 
				
			||||||
	input_node = link->input->node;
 | 
						input_node = link->input->node;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1196,11 +1193,6 @@ int pw_impl_link_register(struct pw_impl_link *link,
 | 
				
			||||||
	link->info.input_node_id = input_node->global->id;
 | 
						link->info.input_node_id = input_node->global->id;
 | 
				
			||||||
	link->info.input_port_id = link->input->global->id;
 | 
						link->info.input_port_id = link->input->global->id;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	pw_properties_update_keys(properties, &link->properties->dict, keys);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	pw_properties_setf(properties, PW_KEY_LINK_OUTPUT_PORT, "%d", link->info.output_port_id);
 | 
					 | 
				
			||||||
	pw_properties_setf(properties, PW_KEY_LINK_INPUT_PORT, "%d", link->info.input_port_id);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	link->global = pw_global_new(context,
 | 
						link->global = pw_global_new(context,
 | 
				
			||||||
				     PW_TYPE_INTERFACE_Link,
 | 
									     PW_TYPE_INTERFACE_Link,
 | 
				
			||||||
				     PW_VERSION_LINK,
 | 
									     PW_VERSION_LINK,
 | 
				
			||||||
| 
						 | 
					@ -1215,8 +1207,12 @@ int pw_impl_link_register(struct pw_impl_link *link,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	link->info.id = link->global->id;
 | 
						link->info.id = link->global->id;
 | 
				
			||||||
	pw_properties_setf(link->properties, PW_KEY_OBJECT_ID, "%d", link->info.id);
 | 
						pw_properties_setf(link->properties, PW_KEY_OBJECT_ID, "%d", link->info.id);
 | 
				
			||||||
 | 
						pw_properties_setf(link->properties, PW_KEY_LINK_OUTPUT_PORT, "%d", link->info.output_port_id);
 | 
				
			||||||
 | 
						pw_properties_setf(link->properties, PW_KEY_LINK_INPUT_PORT, "%d", link->info.input_port_id);
 | 
				
			||||||
	link->info.props = &link->properties->dict;
 | 
						link->info.props = &link->properties->dict;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						pw_global_update_keys(link->global, link->info.props, keys);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	pw_impl_link_emit_initialized(link);
 | 
						pw_impl_link_emit_initialized(link);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	pw_global_add_listener(link->global, &link->global_listener, &global_events, link);
 | 
						pw_global_add_listener(link->global, &link->global_listener, &global_events, link);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -634,13 +634,6 @@ int pw_impl_node_register(struct pw_impl_node *this,
 | 
				
			||||||
	if (this->registered)
 | 
						if (this->registered)
 | 
				
			||||||
		goto error_existed;
 | 
							goto error_existed;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (properties == NULL)
 | 
					 | 
				
			||||||
		properties = pw_properties_new(NULL, NULL);
 | 
					 | 
				
			||||||
	if (properties == NULL)
 | 
					 | 
				
			||||||
		return -errno;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	pw_properties_update_keys(properties, &this->properties->dict, keys);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	this->global = pw_global_new(context,
 | 
						this->global = pw_global_new(context,
 | 
				
			||||||
				     PW_TYPE_INTERFACE_Node,
 | 
									     PW_TYPE_INTERFACE_Node,
 | 
				
			||||||
				     PW_VERSION_NODE,
 | 
									     PW_VERSION_NODE,
 | 
				
			||||||
| 
						 | 
					@ -661,6 +654,8 @@ int pw_impl_node_register(struct pw_impl_node *this,
 | 
				
			||||||
	pw_properties_setf(this->properties, PW_KEY_OBJECT_ID, "%d", this->info.id);
 | 
						pw_properties_setf(this->properties, PW_KEY_OBJECT_ID, "%d", this->info.id);
 | 
				
			||||||
	this->info.props = &this->properties->dict;
 | 
						this->info.props = &this->properties->dict;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						pw_global_update_keys(this->global, &this->properties->dict, keys);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	pw_impl_node_initialized(this);
 | 
						pw_impl_node_initialized(this);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	pw_global_add_listener(this->global, &this->global_listener, &global_events, this);
 | 
						pw_global_add_listener(this->global, &this->global_listener, &global_events, this);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -782,6 +782,7 @@ int pw_impl_port_register(struct pw_impl_port *port,
 | 
				
			||||||
	const char *keys[] = {
 | 
						const char *keys[] = {
 | 
				
			||||||
		PW_KEY_OBJECT_PATH,
 | 
							PW_KEY_OBJECT_PATH,
 | 
				
			||||||
		PW_KEY_FORMAT_DSP,
 | 
							PW_KEY_FORMAT_DSP,
 | 
				
			||||||
 | 
							PW_KEY_NODE_ID,
 | 
				
			||||||
		PW_KEY_AUDIO_CHANNEL,
 | 
							PW_KEY_AUDIO_CHANNEL,
 | 
				
			||||||
		PW_KEY_PORT_NAME,
 | 
							PW_KEY_PORT_NAME,
 | 
				
			||||||
		PW_KEY_PORT_DIRECTION,
 | 
							PW_KEY_PORT_DIRECTION,
 | 
				
			||||||
| 
						 | 
					@ -795,14 +796,6 @@ int pw_impl_port_register(struct pw_impl_port *port,
 | 
				
			||||||
	if (node == NULL || node->global == NULL)
 | 
						if (node == NULL || node->global == NULL)
 | 
				
			||||||
		return -EIO;
 | 
							return -EIO;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (properties == NULL)
 | 
					 | 
				
			||||||
		properties = pw_properties_new(NULL, NULL);
 | 
					 | 
				
			||||||
	if (properties == NULL)
 | 
					 | 
				
			||||||
		return -errno;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	pw_properties_setf(properties, PW_KEY_NODE_ID, "%d", node->global->id);
 | 
					 | 
				
			||||||
	pw_properties_update_keys(properties, &port->properties->dict, keys);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	port->global = pw_global_new(node->context,
 | 
						port->global = pw_global_new(node->context,
 | 
				
			||||||
				PW_TYPE_INTERFACE_Port,
 | 
									PW_TYPE_INTERFACE_Port,
 | 
				
			||||||
				PW_VERSION_PORT,
 | 
									PW_VERSION_PORT,
 | 
				
			||||||
| 
						 | 
					@ -819,6 +812,8 @@ int pw_impl_port_register(struct pw_impl_port *port,
 | 
				
			||||||
	pw_properties_setf(port->properties, PW_KEY_OBJECT_ID, "%d", port->info.id);
 | 
						pw_properties_setf(port->properties, PW_KEY_OBJECT_ID, "%d", port->info.id);
 | 
				
			||||||
	port->info.props = &port->properties->dict;
 | 
						port->info.props = &port->properties->dict;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						pw_global_update_keys(port->global, &port->properties->dict, keys);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	pw_impl_port_emit_initialized(port);
 | 
						pw_impl_port_emit_initialized(port);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	return pw_global_register(port->global);
 | 
						return pw_global_register(port->global);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue