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:
Wim Taymans 2023-01-19 11:05:54 +01:00
parent cb8d9f38b2
commit d11fb766c6
4 changed files with 18 additions and 2 deletions

View file

@ -665,6 +665,7 @@ int pipewire__module_init(struct pw_impl_module *module, const char *args)
copy_props(impl, props, PW_KEY_NODE_VIRTUAL);
copy_props(impl, props, PW_KEY_MEDIA_CLASS);
copy_props(impl, props, PW_KEY_TARGET_OBJECT);
copy_props(impl, props, "pipe.filename");
parse_audio_info(impl->stream_props, &impl->info);

View file

@ -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;

View file

@ -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;

View file

@ -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 },
};