sink-input: Query sink inputs for max_rewind value when setting max_rewind

This patch is in preparation of allowing virtual sinks to specify their own
max_rewind limit.

Currently pa_sink_set_max_rewind_within_thread() simply sets the value of
max_rewind and informs the sink inputs about the new value. Virtual sinks
may however provide their own limit on max_rewind.

This patch allows to query the active sink inputs for the max_rewind value
they support and sets max_rewind to the minimum supported value. This way,
the max_rewind value from the virtual sinks can be communicated to the master
sink.

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/120>
This commit is contained in:
Georg Chini 2021-01-01 00:32:52 +01:00 committed by PulseAudio Marge Bot
parent 5c6d91a97c
commit a37fd7eada
3 changed files with 44 additions and 0 deletions

View file

@ -156,6 +156,13 @@ struct pa_sink_input {
* changes. Called from IO context. */
void (*update_max_rewind) (pa_sink_input *i, size_t nbytes); /* may be NULL */
/* Called whenever the maximum rewindable size of the sink
* changes. Used by virtual sinks to communicate rewind limits
* of the virtual sink to the master sink. Must return size_t (-1)
* if there is no limit or if the virtual sink is not opened.
* Called from IO context. */
size_t (*get_max_rewind_limit) (pa_sink_input *i); /* may be NULL */
/* Called whenever the maximum request size of the sink
* changes. Called from IO context. */
void (*update_max_request) (pa_sink_input *i, size_t nbytes); /* may be NULL */