modules: support audio.layout where we can

This commit is contained in:
Wim Taymans 2025-10-30 12:29:31 +01:00
parent 8ba08f3029
commit ff0bc22cb1
28 changed files with 116 additions and 7 deletions

View file

@ -4274,10 +4274,18 @@ impl_init(const struct spa_handle_factory *factory,
this->direction = SPA_DIRECTION_INPUT;
}
else if (spa_streq(k, SPA_KEY_AUDIO_POSITION)) {
if (s != NULL)
spa_audio_parse_position_n(s, strlen(s),
this->props.channel_map, SPA_N_ELEMENTS(this->props.channel_map),
&this->props.n_channels);
if (s == NULL)
continue;
spa_audio_parse_position_n(s, strlen(s),
this->props.channel_map, SPA_N_ELEMENTS(this->props.channel_map),
&this->props.n_channels);
}
else if (spa_streq(k, SPA_KEY_AUDIO_LAYOUT)) {
if (s == NULL)
continue;
spa_audio_parse_layout(s,
this->props.channel_map, SPA_N_ELEMENTS(this->props.channel_map),
&this->props.n_channels);
}
else if (spa_streq(k, SPA_KEY_PORT_IGNORE_LATENCY))
this->port_ignore_latency = spa_atob(s);

View file

@ -44,6 +44,11 @@ static int avb_set_param(struct state *state, const char *k, const char *s)
SPA_N_ELEMENTS(state->default_pos.pos),
&state->default_pos.channels);
fmt_change++;
} else if (spa_streq(k, SPA_KEY_AUDIO_LAYOUT)) {
spa_audio_parse_layout(s, state->default_pos.pos,
SPA_N_ELEMENTS(state->default_pos.pos),
&state->default_pos.channels);
fmt_change++;
} else if (spa_streq(k, SPA_KEY_AUDIO_ALLOWED_RATES)) {
state->n_allowed_rates = spa_avb_parse_rates(state->allowed_rates,
MAX_RATES, s, strlen(s));

View file

@ -952,6 +952,9 @@ impl_init(const struct spa_handle_factory *factory,
} else if (spa_streq(k, SPA_KEY_AUDIO_POSITION)) {
spa_audio_parse_position_n(s, strlen(s), this->props.pos,
SPA_N_ELEMENTS(this->props.pos), &this->props.channels);
} else if (spa_streq(k, SPA_KEY_AUDIO_LAYOUT)) {
spa_audio_parse_layout(s, this->props.pos,
SPA_N_ELEMENTS(this->props.pos), &this->props.channels);
} else if (spa_streq(k, "clock.name")) {
spa_scnprintf(this->props.clock_name,
sizeof(this->props.clock_name),