mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-10-29 05:40:27 -04:00
clarify PIPEWIRE_NODE
PIPEWIRE_NODE is mapped to TARGET_OBJECT so it contains the serial or the node name. Make sure pw-stream maps this to TARGET_OBJECT. Make JACK use the PIPEWIRE_NODE for serial or node.name.
This commit is contained in:
parent
2254c74fb9
commit
95f87301c7
3 changed files with 11 additions and 10 deletions
|
|
@ -55,7 +55,8 @@ applications:
|
||||||
samplerate. This function will attempt to change
|
samplerate. This function will attempt to change
|
||||||
the graph samplerate to `denom` and use the
|
the graph samplerate to `denom` and use the
|
||||||
specified `num` as the buffer size.
|
specified `num` as the buffer size.
|
||||||
* `PIPEWIRE_NODE=<id>` to request a link to the specified node
|
* `PIPEWIRE_NODE=<id>` to request a link to the specified node. The
|
||||||
|
id can be a node.name or object.serial of the target node.
|
||||||
|
|
||||||
### Using tools
|
### Using tools
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -5591,16 +5591,13 @@ const char ** jack_get_ports (jack_client_t *client,
|
||||||
struct object *o;
|
struct object *o;
|
||||||
struct pw_array tmp;
|
struct pw_array tmp;
|
||||||
const char *str;
|
const char *str;
|
||||||
uint32_t i, count, id;
|
uint32_t i, count;
|
||||||
int r;
|
int r;
|
||||||
regex_t port_regex, type_regex;
|
regex_t port_regex, type_regex;
|
||||||
|
|
||||||
spa_return_val_if_fail(c != NULL, NULL);
|
spa_return_val_if_fail(c != NULL, NULL);
|
||||||
|
|
||||||
if ((str = getenv("PIPEWIRE_NODE")) != NULL)
|
str = getenv("PIPEWIRE_NODE");
|
||||||
id = pw_properties_parse_int(str);
|
|
||||||
else
|
|
||||||
id = SPA_ID_INVALID;
|
|
||||||
|
|
||||||
if (port_name_pattern && port_name_pattern[0]) {
|
if (port_name_pattern && port_name_pattern[0]) {
|
||||||
if ((r = regcomp(&port_regex, port_name_pattern, REG_EXTENDED | REG_NOSUB)) != 0) {
|
if ((r = regcomp(&port_regex, port_name_pattern, REG_EXTENDED | REG_NOSUB)) != 0) {
|
||||||
|
|
@ -5615,7 +5612,7 @@ const char ** jack_get_ports (jack_client_t *client,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pw_log_debug("%p: ports id:%d name:\"%s\" type:\"%s\" flags:%08lx", c, id,
|
pw_log_debug("%p: ports target:%s name:\"%s\" type:\"%s\" flags:%08lx", c, str,
|
||||||
port_name_pattern, type_name_pattern, flags);
|
port_name_pattern, type_name_pattern, flags);
|
||||||
|
|
||||||
pthread_mutex_lock(&c->context.lock);
|
pthread_mutex_lock(&c->context.lock);
|
||||||
|
|
@ -5631,8 +5628,11 @@ const char ** jack_get_ports (jack_client_t *client,
|
||||||
continue;
|
continue;
|
||||||
if (!SPA_FLAG_IS_SET(o->port.flags, flags))
|
if (!SPA_FLAG_IS_SET(o->port.flags, flags))
|
||||||
continue;
|
continue;
|
||||||
if (id != SPA_ID_INVALID && o->port.node_id != id)
|
if (str != NULL && o->port.node != NULL) {
|
||||||
continue;
|
if (!spa_strstartswith(o->port.name, str) &&
|
||||||
|
o->port.node->serial != atoll(str))
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
if (port_name_pattern && port_name_pattern[0]) {
|
if (port_name_pattern && port_name_pattern[0]) {
|
||||||
bool match;
|
bool match;
|
||||||
|
|
|
||||||
|
|
@ -1892,7 +1892,7 @@ pw_stream_connect(struct pw_stream *stream,
|
||||||
if (target_id != PW_ID_ANY)
|
if (target_id != PW_ID_ANY)
|
||||||
pw_properties_setf(stream->properties, PW_KEY_NODE_TARGET, "%d", target_id);
|
pw_properties_setf(stream->properties, PW_KEY_NODE_TARGET, "%d", target_id);
|
||||||
else if ((str = getenv("PIPEWIRE_NODE")) != NULL)
|
else if ((str = getenv("PIPEWIRE_NODE")) != NULL)
|
||||||
pw_properties_set(stream->properties, PW_KEY_NODE_TARGET, str);
|
pw_properties_set(stream->properties, PW_KEY_TARGET_OBJECT, str);
|
||||||
if ((flags & PW_STREAM_FLAG_AUTOCONNECT) &&
|
if ((flags & PW_STREAM_FLAG_AUTOCONNECT) &&
|
||||||
pw_properties_get(stream->properties, PW_KEY_NODE_AUTOCONNECT) == NULL) {
|
pw_properties_get(stream->properties, PW_KEY_NODE_AUTOCONNECT) == NULL) {
|
||||||
str = getenv("PIPEWIRE_AUTOCONNECT");
|
str = getenv("PIPEWIRE_AUTOCONNECT");
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue