mirror of
				https://gitlab.freedesktop.org/pipewire/pipewire.git
				synced 2025-11-03 09:01:54 -05:00 
			
		
		
		
	pw_factory -> pw_impl_factory
This commit is contained in:
		
							parent
							
								
									73900eea1b
								
							
						
					
					
						commit
						815d4a8d20
					
				
					 17 changed files with 170 additions and 169 deletions
				
			
		| 
						 | 
				
			
			@ -48,7 +48,7 @@ static const struct spa_dict_item module_props[] = {
 | 
			
		|||
 | 
			
		||||
struct factory_data {
 | 
			
		||||
	struct pw_context *context;
 | 
			
		||||
	struct pw_factory *this;
 | 
			
		||||
	struct pw_impl_factory *this;
 | 
			
		||||
	struct pw_module *module;
 | 
			
		||||
 | 
			
		||||
	struct spa_hook factory_listener;
 | 
			
		||||
| 
						 | 
				
			
			@ -118,7 +118,7 @@ static void *create_object(void *_data,
 | 
			
		|||
	client = resource ? pw_resource_get_client(resource) : NULL;
 | 
			
		||||
 | 
			
		||||
	pw_properties_setf(properties, PW_KEY_FACTORY_ID, "%d",
 | 
			
		||||
			pw_global_get_id(pw_factory_get_global(data->this)));
 | 
			
		||||
			pw_global_get_id(pw_impl_factory_get_global(data->this)));
 | 
			
		||||
 | 
			
		||||
	if (client) {
 | 
			
		||||
		pw_properties_setf(properties, PW_KEY_CLIENT_ID, "%d",
 | 
			
		||||
| 
						 | 
				
			
			@ -181,8 +181,8 @@ error_exit:
 | 
			
		|||
	return NULL;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static const struct pw_factory_implementation factory_impl = {
 | 
			
		||||
	PW_VERSION_FACTORY_IMPLEMENTATION,
 | 
			
		||||
static const struct pw_impl_factory_implementation factory_impl = {
 | 
			
		||||
	PW_VERSION_IMPL_FACTORY_IMPLEMENTATION,
 | 
			
		||||
	.create_object = create_object,
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -197,31 +197,31 @@ static void factory_destroy(void *_data)
 | 
			
		|||
		pw_node_destroy(nd->node);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static const struct pw_factory_events factory_events = {
 | 
			
		||||
	PW_VERSION_FACTORY_IMPLEMENTATION,
 | 
			
		||||
static const struct pw_impl_factory_events factory_events = {
 | 
			
		||||
	PW_VERSION_IMPL_FACTORY_EVENTS,
 | 
			
		||||
	.destroy = factory_destroy,
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
static void module_destroy(void *_data)
 | 
			
		||||
{
 | 
			
		||||
	struct factory_data *data = _data;
 | 
			
		||||
	pw_factory_destroy(data->this);
 | 
			
		||||
	pw_impl_factory_destroy(data->this);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void module_registered(void *data)
 | 
			
		||||
{
 | 
			
		||||
	struct factory_data *d = data;
 | 
			
		||||
	struct pw_module *module = d->module;
 | 
			
		||||
	struct pw_factory *factory = d->this;
 | 
			
		||||
	struct pw_impl_factory *factory = d->this;
 | 
			
		||||
	struct spa_dict_item items[1];
 | 
			
		||||
	char id[16];
 | 
			
		||||
	int res;
 | 
			
		||||
 | 
			
		||||
	snprintf(id, sizeof(id), "%d", pw_global_get_id(pw_module_get_global(module)));
 | 
			
		||||
	items[0] = SPA_DICT_ITEM_INIT(PW_KEY_MODULE_ID, id);
 | 
			
		||||
	pw_factory_update_properties(factory, &SPA_DICT_INIT(items, 1));
 | 
			
		||||
	pw_impl_factory_update_properties(factory, &SPA_DICT_INIT(items, 1));
 | 
			
		||||
 | 
			
		||||
	if ((res = pw_factory_register(factory, NULL)) < 0) {
 | 
			
		||||
	if ((res = pw_impl_factory_register(factory, NULL)) < 0) {
 | 
			
		||||
		pw_log_error(NAME" %p: can't register factory: %s", factory, spa_strerror(res));
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			@ -236,10 +236,10 @@ SPA_EXPORT
 | 
			
		|||
int pipewire__module_init(struct pw_module *module, const char *args)
 | 
			
		||||
{
 | 
			
		||||
	struct pw_context *context = pw_module_get_context(module);
 | 
			
		||||
	struct pw_factory *factory;
 | 
			
		||||
	struct pw_impl_factory *factory;
 | 
			
		||||
	struct factory_data *data;
 | 
			
		||||
 | 
			
		||||
	factory = pw_factory_new(context,
 | 
			
		||||
	factory = pw_impl_factory_new(context,
 | 
			
		||||
				 "spa-node-factory",
 | 
			
		||||
				 PW_TYPE_INTERFACE_Node,
 | 
			
		||||
				 PW_VERSION_NODE_PROXY,
 | 
			
		||||
| 
						 | 
				
			
			@ -248,14 +248,14 @@ int pipewire__module_init(struct pw_module *module, const char *args)
 | 
			
		|||
	if (factory == NULL)
 | 
			
		||||
		return -errno;
 | 
			
		||||
 | 
			
		||||
	data = pw_factory_get_user_data(factory);
 | 
			
		||||
	data = pw_impl_factory_get_user_data(factory);
 | 
			
		||||
	data->this = factory;
 | 
			
		||||
	data->context = context;
 | 
			
		||||
	data->module = module;
 | 
			
		||||
	spa_list_init(&data->node_list);
 | 
			
		||||
 | 
			
		||||
	pw_factory_add_listener(factory, &data->factory_listener, &factory_events, data);
 | 
			
		||||
	pw_factory_set_implementation(factory, &factory_impl, data);
 | 
			
		||||
	pw_impl_factory_add_listener(factory, &data->factory_listener, &factory_events, data);
 | 
			
		||||
	pw_impl_factory_set_implementation(factory, &factory_impl, data);
 | 
			
		||||
 | 
			
		||||
	pw_log_debug("module %p: new", module);
 | 
			
		||||
	pw_module_add_listener(module, &data->module_listener, &module_events, data);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue