mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-02 09:01:46 -05:00
alsa-mixer: Fill in input and output names
Fill in input_name and output_name to make routing easier for routing modules. Signed-off-by: David Henningsson <david.henningsson@canonical.com>
This commit is contained in:
parent
b9818b016f
commit
2a71fd7597
3 changed files with 12 additions and 1 deletions
|
|
@ -3473,6 +3473,8 @@ static void profile_free(pa_alsa_profile *p) {
|
||||||
|
|
||||||
pa_xfree(p->name);
|
pa_xfree(p->name);
|
||||||
pa_xfree(p->description);
|
pa_xfree(p->description);
|
||||||
|
pa_xfree(p->input_name);
|
||||||
|
pa_xfree(p->output_name);
|
||||||
|
|
||||||
pa_xstrfreev(p->input_mapping_names);
|
pa_xstrfreev(p->input_mapping_names);
|
||||||
pa_xstrfreev(p->output_mapping_names);
|
pa_xstrfreev(p->output_mapping_names);
|
||||||
|
|
@ -4123,6 +4125,7 @@ static void profile_set_add_auto_pair(
|
||||||
p->name = name;
|
p->name = name;
|
||||||
|
|
||||||
if (m) {
|
if (m) {
|
||||||
|
p->output_name = pa_xstrdup(m->name);
|
||||||
p->output_mappings = pa_idxset_new(pa_idxset_trivial_hash_func, pa_idxset_trivial_compare_func);
|
p->output_mappings = pa_idxset_new(pa_idxset_trivial_hash_func, pa_idxset_trivial_compare_func);
|
||||||
pa_idxset_put(p->output_mappings, m, NULL);
|
pa_idxset_put(p->output_mappings, m, NULL);
|
||||||
p->priority += m->priority * 100;
|
p->priority += m->priority * 100;
|
||||||
|
|
@ -4130,6 +4133,7 @@ static void profile_set_add_auto_pair(
|
||||||
}
|
}
|
||||||
|
|
||||||
if (n) {
|
if (n) {
|
||||||
|
p->input_name = pa_xstrdup(n->name);
|
||||||
p->input_mappings = pa_idxset_new(pa_idxset_trivial_hash_func, pa_idxset_trivial_compare_func);
|
p->input_mappings = pa_idxset_new(pa_idxset_trivial_hash_func, pa_idxset_trivial_compare_func);
|
||||||
pa_idxset_put(p->input_mappings, n, NULL);
|
pa_idxset_put(p->input_mappings, n, NULL);
|
||||||
p->priority += n->priority;
|
p->priority += n->priority;
|
||||||
|
|
@ -4292,9 +4296,11 @@ void pa_alsa_profile_dump(pa_alsa_profile *p) {
|
||||||
pa_alsa_mapping *m;
|
pa_alsa_mapping *m;
|
||||||
pa_assert(p);
|
pa_assert(p);
|
||||||
|
|
||||||
pa_log_debug("Profile %s (%s), priority=%u, supported=%s n_input_mappings=%u, n_output_mappings=%u",
|
pa_log_debug("Profile %s (%s), input=%s, output=%s priority=%u, supported=%s n_input_mappings=%u, n_output_mappings=%u",
|
||||||
p->name,
|
p->name,
|
||||||
pa_strnull(p->description),
|
pa_strnull(p->description),
|
||||||
|
pa_strnull(p->input_name),
|
||||||
|
pa_strnull(p->output_name),
|
||||||
p->priority,
|
p->priority,
|
||||||
pa_yes_no(p->supported),
|
pa_yes_no(p->supported),
|
||||||
p->input_mappings ? pa_idxset_size(p->input_mappings) : 0,
|
p->input_mappings ? pa_idxset_size(p->input_mappings) : 0,
|
||||||
|
|
|
||||||
|
|
@ -293,6 +293,9 @@ struct pa_alsa_profile {
|
||||||
char *description;
|
char *description;
|
||||||
unsigned priority;
|
unsigned priority;
|
||||||
|
|
||||||
|
char *input_name;
|
||||||
|
char *output_name;
|
||||||
|
|
||||||
bool supported:1;
|
bool supported:1;
|
||||||
bool fallback_input:1;
|
bool fallback_input:1;
|
||||||
bool fallback_output:1;
|
bool fallback_output:1;
|
||||||
|
|
|
||||||
|
|
@ -143,6 +143,8 @@ static void add_profiles(struct userdata *u, pa_hashmap *h, pa_hashmap *ports) {
|
||||||
|
|
||||||
cp = pa_card_profile_new(ap->name, ap->description, sizeof(struct profile_data));
|
cp = pa_card_profile_new(ap->name, ap->description, sizeof(struct profile_data));
|
||||||
cp->priority = ap->priority;
|
cp->priority = ap->priority;
|
||||||
|
cp->input_name = pa_xstrdup(ap->input_name);
|
||||||
|
cp->output_name = pa_xstrdup(ap->output_name);
|
||||||
|
|
||||||
if (ap->output_mappings) {
|
if (ap->output_mappings) {
|
||||||
cp->n_sinks = pa_idxset_size(ap->output_mappings);
|
cp->n_sinks = pa_idxset_size(ap->output_mappings);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue