sink, source: Rework reconfiguration logic to apply to more than rate
authorArun Raghavan <arun@arunraghavan.net>
Sun, 3 Sep 2017 11:23:17 +0000 (16:53 +0530)
committerArun Raghavan <arun@arunraghavan.net>
Sat, 21 Oct 2017 15:53:37 +0000 (21:23 +0530)
commit7a7072557a9d445a70bbbfb1f0d7d94f5b190e3d
treeaa8e01531239ba79bc993978ab5e896f24c452f9
parent4f1041c271d58395e53b3ba69a91d4f6ff979ceb
sink, source: Rework reconfiguration logic to apply to more than rate

This rejigs the update_rate() logic to encompass changes to the sample
spec as a whole, as well as passthrough status. As a result,
sinks/sources provide a reconfigure() method which allows
reconfiguration as required.

The behaviour itself is currently unchanged -- alsa-sink/-source do not
actually implement anything other than rate updates for now (nor are
they ever requested to). This can be modified in the future, to allow,
for example 24-bit output when incoming media supports it, as well as
channel count changes for passthrough sinks.

Another related change is that passthrough status is now part of
sink/source reconfiguration, and we can stop doing a suspend/unsuspend
when entering/leaving passthrough state. So that part is now divided
in two -- pa_sink_reconfigure() sets the sink in passthrough mode if
required, and pa_sink_enter_passthrough() sets up everything else
(this currently means only volumes, but could disable other processing)
for passthrough mode.
src/modules/alsa/alsa-sink.c
src/modules/alsa/alsa-source.c
src/pulsecore/sink-input.c
src/pulsecore/sink.c
src/pulsecore/sink.h
src/pulsecore/source-output.c
src/pulsecore/source.c
src/pulsecore/source.h