mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-09 13:29:59 -05:00
Notify port available status changes, and update protocol version
The recommended way of setting available status is to call pa_device_port_set_available, which will send a subscription event to the relevant card. It will also fire a hook. Signed-off-by: David Henningsson <david.henningsson@canonical.com>
This commit is contained in:
parent
0dced7f275
commit
47f28a5843
9 changed files with 67 additions and 11 deletions
|
|
@ -4286,9 +4286,10 @@ void pa_alsa_profile_set_dump(pa_alsa_profile_set *ps) {
|
|||
pa_alsa_decibel_fix_dump(db_fix);
|
||||
}
|
||||
|
||||
void pa_alsa_add_ports(pa_hashmap **p, pa_alsa_path_set *ps) {
|
||||
void pa_alsa_add_ports(pa_core *c, pa_hashmap **p, pa_alsa_path_set *ps) {
|
||||
pa_alsa_path *path;
|
||||
|
||||
pa_assert(c);
|
||||
pa_assert(p);
|
||||
pa_assert(!*p);
|
||||
pa_assert(ps);
|
||||
|
|
@ -4313,7 +4314,7 @@ void pa_alsa_add_ports(pa_hashmap **p, pa_alsa_path_set *ps) {
|
|||
pa_device_port *port;
|
||||
pa_alsa_port_data *data;
|
||||
|
||||
port = pa_device_port_new(s->name, s->description, sizeof(pa_alsa_port_data));
|
||||
port = pa_device_port_new(c, s->name, s->description, sizeof(pa_alsa_port_data));
|
||||
port->priority = s->priority;
|
||||
|
||||
data = PA_DEVICE_PORT_DATA(port);
|
||||
|
|
@ -4338,7 +4339,7 @@ void pa_alsa_add_ports(pa_hashmap **p, pa_alsa_path_set *ps) {
|
|||
/* If there is no or just one setting we only need a
|
||||
* single entry */
|
||||
|
||||
port = pa_device_port_new(path->name, path->description, sizeof(pa_alsa_port_data));
|
||||
port = pa_device_port_new(c, path->name, path->description, sizeof(pa_alsa_port_data));
|
||||
port->priority = path->priority * 100;
|
||||
|
||||
|
||||
|
|
@ -4362,7 +4363,7 @@ void pa_alsa_add_ports(pa_hashmap **p, pa_alsa_path_set *ps) {
|
|||
else
|
||||
d = pa_xstrdup(path->description);
|
||||
|
||||
port = pa_device_port_new(n, d, sizeof(pa_alsa_port_data));
|
||||
port = pa_device_port_new(c, n, d, sizeof(pa_alsa_port_data));
|
||||
port->priority = path->priority * 100 + s->priority;
|
||||
|
||||
pa_xfree(n);
|
||||
|
|
|
|||
|
|
@ -323,6 +323,6 @@ struct pa_alsa_port_data {
|
|||
pa_alsa_setting *setting;
|
||||
};
|
||||
|
||||
void pa_alsa_add_ports(pa_hashmap **p, pa_alsa_path_set *ps);
|
||||
void pa_alsa_add_ports(pa_core *c, pa_hashmap **p, pa_alsa_path_set *ps);
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -2224,7 +2224,7 @@ pa_sink *pa_alsa_sink_new(pa_module *m, pa_modargs *ma, const char*driver, pa_ca
|
|||
}
|
||||
|
||||
if (u->mixer_path_set)
|
||||
pa_alsa_add_ports(&data.ports, u->mixer_path_set);
|
||||
pa_alsa_add_ports(u->core, &data.ports, u->mixer_path_set);
|
||||
|
||||
u->sink = pa_sink_new(m->core, &data, PA_SINK_HARDWARE | PA_SINK_LATENCY | (u->use_tsched ? PA_SINK_DYNAMIC_LATENCY : 0) |
|
||||
(set_formats ? PA_SINK_SET_FORMATS : 0));
|
||||
|
|
|
|||
|
|
@ -1950,7 +1950,7 @@ pa_source *pa_alsa_source_new(pa_module *m, pa_modargs *ma, const char*driver, p
|
|||
}
|
||||
|
||||
if (u->mixer_path_set)
|
||||
pa_alsa_add_ports(&data.ports, u->mixer_path_set);
|
||||
pa_alsa_add_ports(u->core, &data.ports, u->mixer_path_set);
|
||||
|
||||
u->source = pa_source_new(m->core, &data, PA_SOURCE_HARDWARE|PA_SOURCE_LATENCY|(u->use_tsched ? PA_SOURCE_DYNAMIC_LATENCY : 0));
|
||||
pa_source_new_data_done(&data);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue