Implement two reading modes for IFrameReader: soft read and hard read.
Hard read is current behavior - return as much samples as possible (up to requested size), fill gaps caused by packet loss with zeros.
Soft read enables new behavior - stop reading when encountered gap (caused by packet loss). E.g. when 10 samples requested, but only 5 samples are available, and then there is a gap, only 5 samples will be returned (using partial read mechanism implemented in #615).
Use-cases
Soft reads are needed when next chunk in pipeline can help if it arrived earlier than deadline, but on the other hand if it haven't arrived yet, we don't want to mark it as late and create a gap.
It can be used in:
PLC: to use next chunk for interpolation - #731
Audio I/O: to fill ALSA/PulseAudio buffer as full as possible to amortize scheduler jitter
Video I/O: to fill processing buffer as full as possible to amortize decoding jitter
Impl
[x] roc_audio: add reading mode argument to FrameReader: soft or hard
Summary
Implement two reading modes for IFrameReader: soft read and hard read.
Hard read is current behavior - return as much samples as possible (up to requested size), fill gaps caused by packet loss with zeros.
Soft read enables new behavior - stop reading when encountered gap (caused by packet loss). E.g. when 10 samples requested, but only 5 samples are available, and then there is a gap, only 5 samples will be returned (using partial read mechanism implemented in #615).
Use-cases
Soft reads are needed when next chunk in pipeline can help if it arrived earlier than deadline, but on the other hand if it haven't arrived yet, we don't want to mark it as late and create a gap.
It can be used in:
Impl