Make writable size more accurate by using the clock. mplayer uses this
to check if the clock is advancing.
Remove requested_bytes, we can use ready_bytes for the ready bytes
and use the queued bytes for playback.
Reset after a flush, wait for a new timing update.
Setting the size on input stream buffers based on the elapsed
ticks does not give a meaningfull value for the queue size so
just leave it to the user to set the size field.
The read_index should not include the delay to the device.
Keep a separate lis of memory blocks filled by the app and give
those to the stream when we can. This is because pulse can allocate
an infinite amount of buffers but we must cycle between a fixed
number. Use DYNAMIC_DATA to avoid memcpy.
Use the right requested_bytes in the write_callback. This should
be the tlength - the amount of bytes we already queued.
_get_time() should include the sink latency.
By default, the pipewiresrc tries to negotiate 16 buffers. This value is
hard coded in the pipewiresrc. If the buffers are large, this could lead
to an undesirably high memory usage. Applications that know about the
buffer size and that fewer buffers are sufficient should be able to
configure the limits for the number of buffers that are negotiated.
Therefore, add the min-buffers and max-buffers properties to the
pipewiresrc to enable applications to configure limits for the number of
negotiated buffers.
Make a new DRAINED status.
Place the DRAINED status on an input IO when a stream is out of
buffers and draining.
All nodes that don't have HAVE_DATA on the input io need to copy
it to the output io and return the status. This makes sure the
DRAINED is forwarded and nodes return DRAINED from _process()
DRAINED on the resampler flushes out the last queued samples and then
forwards the DRAINED in the next iteration.
Emit a new drained signal from the context when a node returns
DRAINED. Use this to trigger the drained signal in the stream.
Abuse the xrun callback in the adapter to emit the drained signal until
almost all data left the resampler. This needs more work with a proper
signal and a buffer flag to signal the drain.