mirror of
https://gitlab.freedesktop.org/pipewire/pipewire
synced 2024-09-19 16:01:45 +00:00
pulse-server: use STREAM_CAPTURE_SINK for monitor capture
Make the pulseaudio layer set the PW_KEY_STREAM_CAPTURE_SINK property when a monitor device is selected as a source to make it easier for the session manager to find the right source.
This commit is contained in:
parent
d4d6458b5b
commit
5ae75e1d2a
|
@ -200,6 +200,8 @@ struct module *create_module_echo_cancel(struct impl *impl, const char *argument
|
||||||
if (spa_strendswith(str, ".monitor")) {
|
if (spa_strendswith(str, ".monitor")) {
|
||||||
pw_properties_setf(source_props, PW_KEY_NODE_TARGET,
|
pw_properties_setf(source_props, PW_KEY_NODE_TARGET,
|
||||||
"%.*s", (int)strlen(str)-8, str);
|
"%.*s", (int)strlen(str)-8, str);
|
||||||
|
pw_properties_set(source_props, PW_KEY_STREAM_CAPTURE_SINK,
|
||||||
|
"true");
|
||||||
} else {
|
} else {
|
||||||
pw_properties_set(source_props, PW_KEY_NODE_TARGET, str);
|
pw_properties_set(source_props, PW_KEY_NODE_TARGET, str);
|
||||||
}
|
}
|
||||||
|
|
|
@ -175,6 +175,8 @@ struct module *create_module_loopback(struct impl *impl, const char *argument)
|
||||||
if (spa_strendswith(str, ".monitor")) {
|
if (spa_strendswith(str, ".monitor")) {
|
||||||
pw_properties_setf(capture_props, PW_KEY_NODE_TARGET,
|
pw_properties_setf(capture_props, PW_KEY_NODE_TARGET,
|
||||||
"%.*s", (int)strlen(str)-8, str);
|
"%.*s", (int)strlen(str)-8, str);
|
||||||
|
pw_properties_set(capture_props, PW_KEY_STREAM_CAPTURE_SINK,
|
||||||
|
"true");
|
||||||
} else {
|
} else {
|
||||||
pw_properties_set(capture_props, PW_KEY_NODE_TARGET, str);
|
pw_properties_set(capture_props, PW_KEY_NODE_TARGET, str);
|
||||||
}
|
}
|
||||||
|
|
|
@ -82,6 +82,8 @@ static int module_simple_protocol_tcp_load(struct client *client, struct module
|
||||||
fprintf(f, "capture.node=\"%s\" ", str);
|
fprintf(f, "capture.node=\"%s\" ", str);
|
||||||
if ((str = pw_properties_get(data->module_props, "playback.node")) != NULL)
|
if ((str = pw_properties_get(data->module_props, "playback.node")) != NULL)
|
||||||
fprintf(f, "playback.node=\"%s\" ", str);
|
fprintf(f, "playback.node=\"%s\" ", str);
|
||||||
|
if ((str = pw_properties_get(data->module_props, PW_KEY_STREAM_CAPTURE_SINK)) != NULL)
|
||||||
|
fprintf(f, PW_KEY_STREAM_CAPTURE_SINK"=\"%s\" ", str);
|
||||||
fclose(f);
|
fclose(f);
|
||||||
|
|
||||||
data->mod = pw_context_load_module(impl->context,
|
data->mod = pw_context_load_module(impl->context,
|
||||||
|
@ -181,6 +183,8 @@ struct module *create_module_simple_protocol_tcp(struct impl *impl, const char *
|
||||||
if (spa_strendswith(str, ".monitor")) {
|
if (spa_strendswith(str, ".monitor")) {
|
||||||
pw_properties_setf(module_props, "capture.node",
|
pw_properties_setf(module_props, "capture.node",
|
||||||
"%.*s", (int)strlen(str)-8, str);
|
"%.*s", (int)strlen(str)-8, str);
|
||||||
|
pw_properties_set(module_props, PW_KEY_STREAM_CAPTURE_SINK,
|
||||||
|
"true");
|
||||||
} else {
|
} else {
|
||||||
pw_properties_set(module_props, "capture.node", str);
|
pw_properties_set(module_props, "capture.node", str);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1817,6 +1817,8 @@ static int do_create_record_stream(struct client *client, uint32_t command, uint
|
||||||
pw_properties_setf(props,
|
pw_properties_setf(props,
|
||||||
PW_KEY_NODE_TARGET,
|
PW_KEY_NODE_TARGET,
|
||||||
"%.*s", (int)strlen(source_name)-8, source_name);
|
"%.*s", (int)strlen(source_name)-8, source_name);
|
||||||
|
pw_properties_set(props,
|
||||||
|
PW_KEY_STREAM_CAPTURE_SINK, "true");
|
||||||
} else {
|
} else {
|
||||||
pw_properties_set(props,
|
pw_properties_set(props,
|
||||||
PW_KEY_NODE_TARGET, source_name);
|
PW_KEY_NODE_TARGET, source_name);
|
||||||
|
|
|
@ -388,6 +388,8 @@ static int create_streams(struct impl *impl, struct client *client)
|
||||||
PW_KEY_NODE_GROUP, "pipewire.dummy",
|
PW_KEY_NODE_GROUP, "pipewire.dummy",
|
||||||
PW_KEY_NODE_LATENCY, DEFAULT_LATENCY,
|
PW_KEY_NODE_LATENCY, DEFAULT_LATENCY,
|
||||||
PW_KEY_NODE_TARGET, pw_properties_get(impl->props, "capture.node"),
|
PW_KEY_NODE_TARGET, pw_properties_get(impl->props, "capture.node"),
|
||||||
|
PW_KEY_STREAM_CAPTURE_SINK, pw_properties_get(impl->props,
|
||||||
|
PW_KEY_STREAM_CAPTURE_SINK),
|
||||||
PW_KEY_NODE_NETWORK, "true",
|
PW_KEY_NODE_NETWORK, "true",
|
||||||
NULL);
|
NULL);
|
||||||
if (props == NULL)
|
if (props == NULL)
|
||||||
|
|
Loading…
Reference in a new issue