device-port: introduce available_group member

In some cases, the I/O connector functionality can be shared
and we cannot determine the proper purpose automatically.
We just know that something was inserted to the jack.

Introduce a group identifier (a simple string - unique
per group) which helps to determine the proper ports
for the application. The user interface may be used
to set the wanted behaviour.

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
This commit is contained in:
Jaroslav Kysela 2020-04-14 17:42:34 +02:00 committed by Tanu Kaskinen
parent 9315bbdfe5
commit 861836c5f7
7 changed files with 54 additions and 8 deletions

View file

@ -1034,9 +1034,15 @@ static int read_ports(struct userdata *u, pa_tagstruct *t) {
pa_log("Parse failure");
return -PA_ERR_PROTOCOL;
}
if (u->version >= 24 && pa_tagstruct_getu32(t, &priority) < 0) { /* available */
pa_log("Parse failure");
return -PA_ERR_PROTOCOL;
if (u->version >= 24) {
if (pa_tagstruct_getu32(t, &priority) < 0) { /* available */
pa_log("Parse failure");
return -PA_ERR_PROTOCOL;
}
if (u->version >= 34 && pa_tagstruct_gets(t, &s) < 0) { /* available_group */
pa_log("Parse failure");
return -PA_ERR_PROTOCOL;
}
}
}