mirror of
				https://gitlab.freedesktop.org/pipewire/pipewire.git
				synced 2025-11-03 09:01:54 -05:00 
			
		
		
		
	module-pipe: improve properties on nodes
Actually move the stream properties in stream.props object for the pipe tunnel module. Set pipe.filename on the node. Remap this to device.string in pulse. Add some more default properties on the pipe nodes. See #2973
This commit is contained in:
		
							parent
							
								
									cb8d9f38b2
								
							
						
					
					
						commit
						d11fb766c6
					
				
					 4 changed files with 18 additions and 2 deletions
				
			
		| 
						 | 
				
			
			@ -96,8 +96,9 @@ static int module_pipe_sink_load(struct module *module)
 | 
			
		|||
			fprintf(f, " ],");
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
	fprintf(f, " \"stream.props\": {");
 | 
			
		||||
	pw_properties_serialize_dict(f, &data->capture_props->dict, 0);
 | 
			
		||||
	fprintf(f, " }");
 | 
			
		||||
	fprintf(f, " } }");
 | 
			
		||||
	fclose(f);
 | 
			
		||||
 | 
			
		||||
	data->mod = pw_context_load_module(module->impl->context,
 | 
			
		||||
| 
						 | 
				
			
			@ -181,6 +182,12 @@ static int module_pipe_sink_prepare(struct module * const module)
 | 
			
		|||
		filename = strdup(str);
 | 
			
		||||
		pw_properties_set(props, "file", NULL);
 | 
			
		||||
	}
 | 
			
		||||
	if ((str = pw_properties_get(capture_props, PW_KEY_DEVICE_ICON_NAME)) == NULL)
 | 
			
		||||
		pw_properties_set(capture_props, PW_KEY_DEVICE_ICON_NAME,
 | 
			
		||||
				"audio-card");
 | 
			
		||||
	if ((str = pw_properties_get(capture_props, PW_KEY_NODE_NAME)) == NULL)
 | 
			
		||||
		pw_properties_set(capture_props, PW_KEY_NODE_NAME,
 | 
			
		||||
				"fifo_output");
 | 
			
		||||
 | 
			
		||||
	d->module = module;
 | 
			
		||||
	d->capture_props = capture_props;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -96,8 +96,9 @@ static int module_pipe_source_load(struct module *module)
 | 
			
		|||
			fprintf(f, " ],");
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
	fprintf(f, " \"stream.props\": {");
 | 
			
		||||
	pw_properties_serialize_dict(f, &data->playback_props->dict, 0);
 | 
			
		||||
	fprintf(f, " }");
 | 
			
		||||
	fprintf(f, " } }");
 | 
			
		||||
	fclose(f);
 | 
			
		||||
 | 
			
		||||
	data->mod = pw_context_load_module(module->impl->context,
 | 
			
		||||
| 
						 | 
				
			
			@ -181,6 +182,12 @@ static int module_pipe_source_prepare(struct module * const module)
 | 
			
		|||
		filename = strdup(str);
 | 
			
		||||
		pw_properties_set(props, "file", NULL);
 | 
			
		||||
	}
 | 
			
		||||
	if ((str = pw_properties_get(playback_props, PW_KEY_DEVICE_ICON_NAME)) == NULL)
 | 
			
		||||
		pw_properties_set(playback_props, PW_KEY_DEVICE_ICON_NAME,
 | 
			
		||||
				"audio-input-microphone");
 | 
			
		||||
	if ((str = pw_properties_get(playback_props, PW_KEY_NODE_NAME)) == NULL)
 | 
			
		||||
		pw_properties_set(playback_props, PW_KEY_NODE_NAME,
 | 
			
		||||
				"fifo_input");
 | 
			
		||||
 | 
			
		||||
	d->module = module;
 | 
			
		||||
	d->playback_props = playback_props;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -53,5 +53,6 @@ const struct str_map props_key_map[] = {
 | 
			
		|||
	{ PW_KEY_APP_PROCESS_MACHINE_ID, "application.process.machine_id" },
 | 
			
		||||
	{ PW_KEY_APP_PROCESS_SESSION_ID, "application.process.session_id" },
 | 
			
		||||
	{ PW_KEY_MEDIA_ROLE, "media.role", media_role_map },
 | 
			
		||||
	{ "pipe.filename", "device.string" },
 | 
			
		||||
	{ NULL, NULL },
 | 
			
		||||
};
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue