sink, source: Rework reconfiguration logic to apply to more than rate 62/178062/1
authorArun Raghavan <arun@arunraghavan.net>
Sun, 3 Sep 2017 11:23:17 +0000 (16:53 +0530)
committerSangchul Lee <sc11.lee@samsung.com>
Tue, 8 May 2018 03:36:20 +0000 (12:36 +0900)
commite4e5ed4772b776c32d9d16e3d1ed583de7dbf908
tree493be0eff6f4cfd02f9a2d2df0d220529f8fff1a
parent81e8ba9f3ab0917da4fdfa094f49333be57964c6
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.

Change-Id: I0784496978f5cf2ea6db973bb62cc2033cb5207a
Signed-off-by: Sangchul Lee <sc11.lee@samsung.com>
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