bluetooth: allow increasing output bitrate

Bluetooth thread may ask encoder to reduce bitrate if writing is not keeping up
with inputs or writing to bluetooth socket takes too much time.

Assuming conditions leading to reduced bitrate are intermittent, allow periodic
attempts to increase encoder bitrate, by default at most twice per second.

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/481>
This commit is contained in:
Igor V. Kovalenko 2021-01-20 12:51:14 +03:00 committed by PulseAudio Marge Bot
parent ac33a01f30
commit 9699511215
3 changed files with 34 additions and 0 deletions

View file

@ -88,6 +88,11 @@ typedef struct pa_a2dp_codec {
* enough */
size_t (*reduce_encoder_bitrate)(void *codec_info, size_t write_link_mtu);
/* Increase encoder bitrate for codec, returns new write block size or zero
* if not changed, called periodically when socket is keeping up with
* encoded data */
size_t (*increase_encoder_bitrate)(void *codec_info, size_t write_link_mtu);
/* Encode input_buffer of input_size to output_buffer of output_size,
* returns size of filled ouput_buffer and set processed to size of
* processed input_buffer */