mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-27 07:00:01 -05:00
sink, source: Add API to change channel count
This makes this part symmetrical with the rest of the sample spec, and will be useful when we implement switching channel count in a sink.
This commit is contained in:
parent
f9d139c3bc
commit
4693028b9b
4 changed files with 38 additions and 0 deletions
|
|
@ -3077,6 +3077,24 @@ void pa_source_set_sample_rate(pa_source *s, uint32_t rate) {
|
|||
pa_subscription_post(s->core, PA_SUBSCRIPTION_EVENT_SOURCE | PA_SUBSCRIPTION_EVENT_CHANGE, s->index);
|
||||
}
|
||||
|
||||
/* Called from the main thread */
|
||||
void pa_source_set_channels(pa_source *s, uint8_t channels) {
|
||||
uint8_t old_channels;
|
||||
|
||||
pa_assert(s);
|
||||
pa_assert(pa_channels_valid(channels));
|
||||
|
||||
old_channels = s->sample_spec.channels;
|
||||
if (old_channels == channels)
|
||||
return;
|
||||
|
||||
pa_log_info("%s: channels: %u -> %u", s->name, old_channels, channels);
|
||||
|
||||
s->sample_spec.channels = channels;
|
||||
|
||||
pa_subscription_post(s->core, PA_SUBSCRIPTION_EVENT_SOURCE | PA_SUBSCRIPTION_EVENT_CHANGE, s->index);
|
||||
}
|
||||
|
||||
/* Called from the main thread */
|
||||
void pa_source_set_channel_map(pa_source *s, pa_channel_map *map) {
|
||||
pa_channel_map old_map;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue