mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-02 09:01:46 -05:00
alsa: Add a proplist to mappings
The proplist isn't used by the conventional alsa-mixer code path, but can be used by UCM to transfer properties from UCM data to the sinks/sources corresponding to a mapping. These properties could be used later in policy, etc. The specific use for which I'm writing this now is for UCM modifiers that have their own PlaybackPCM/CapturePCM field. These will be translated to a separate sink/source corresponding to the modifier by adding an additional mapping per sink/source. These mappings' proplist will be populated with the name of the modifier and corresponding "device.intended_role" property. The latter will be used in the usual routing-by-role way, and the former will be used during sink/source activation and deactivation to know what UCM modifier is to be enabled or disabled.
This commit is contained in:
parent
89024f6f12
commit
a08c85d299
4 changed files with 15 additions and 2 deletions
|
|
@ -1714,7 +1714,7 @@ static int setup_mixer(struct userdata *u, pa_bool_t ignore_dB) {
|
|||
pa_source *pa_alsa_source_new(pa_module *m, pa_modargs *ma, const char*driver, pa_card *card, pa_alsa_mapping *mapping) {
|
||||
|
||||
struct userdata *u = NULL;
|
||||
const char *dev_id = NULL;
|
||||
const char *dev_id = NULL, *key;
|
||||
pa_sample_spec ss;
|
||||
uint32_t alternate_sample_rate;
|
||||
pa_channel_map map;
|
||||
|
|
@ -1724,6 +1724,7 @@ pa_source *pa_alsa_source_new(pa_module *m, pa_modargs *ma, const char*driver, p
|
|||
pa_bool_t use_mmap = TRUE, b, use_tsched = TRUE, d, ignore_dB = FALSE, namereg_fail = FALSE, deferred_volume = FALSE, fixed_latency_range = FALSE;
|
||||
pa_source_new_data data;
|
||||
pa_alsa_profile_set *profile_set = NULL;
|
||||
void *state = NULL;
|
||||
|
||||
pa_assert(m);
|
||||
pa_assert(ma);
|
||||
|
|
@ -1947,6 +1948,9 @@ pa_source *pa_alsa_source_new(pa_module *m, pa_modargs *ma, const char*driver, p
|
|||
if (mapping) {
|
||||
pa_proplist_sets(data.proplist, PA_PROP_DEVICE_PROFILE_NAME, mapping->name);
|
||||
pa_proplist_sets(data.proplist, PA_PROP_DEVICE_PROFILE_DESCRIPTION, mapping->description);
|
||||
|
||||
while ((key = pa_proplist_iterate(mapping->proplist, &state)))
|
||||
pa_proplist_sets(data.proplist, key, pa_proplist_gets(mapping->proplist, key));
|
||||
}
|
||||
|
||||
pa_alsa_init_description(data.proplist);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue