Expose the acquire_loop/release_loop functions and use them in the
modules.
Make sure the nodes created from the module use the same data loop as
the module. We need to ensure this because otherwise, the nodes might
be scheduled on different data loops and the invoke or timer logic will
fail.
Make a new function to set the rtp stream in the error state.
When we fail to start the stream, set the error state. Otherwise (like
when we try to use an invalid interface name) the socket create will
fail but the stream will still try to send data to the invalid socket.
Make a method to get the current time to compare agains the pw_time-now
field. This is currently CLOCK_MONOTONIC but make this into a method
so that we can more easily change it later.
When multiple packets need to be flushed (because sess.latency is set
and larger than ptime) use a timer to space the packets uniformly in
the current quantum to avoid bursts.
See !1873
Use the sess.latency.msec also for the sender and use it to control the
NODE_LATENCY. Make it a float to be in line with the other time values.
Set is to a default of ptime, which was what it used to be.
This makes it possible to set the ptime to a smaller value than the
sess.latency.msec so that we send out multiple packets per quantum.
This will result in some bursty output for now but with a timer that can
be improved later.
Update the docs a little, mention the new rtp.ptime and rtp.frametime.
This should be done to match packet size requirements (e.g. 1 ms) while allowing user's software to run at higher buffer size to not stutter.
This will require scheduling multiple rtp_audio_flush_packets calls per one rtp_audio_process_capture call
This method can be used to access the param_changed method of the
underlying pw_stream.
Also adds new public functions rtp_stream_set_param and
rtp_stream_update_params which plum things through to pw_stream_set_param
and pw_stream_update_params respectively.
Move the stream function setup to a stream specific method.
Keep a separate stream format, that can be different later from the
rtp format once we add encoding.
Rename some methods to make them more unique.
The type of `0xffff` is `int`, and UBSan does not like
when that value is shifted left by 16 bits, which causes
e.g.
case APPLE_MIDI_CMD_IN:
to not compile with the following error:
error: case label does not reduce to an integer constant
One could use `0xffffu` to force the type to be `unsigned int`,
or simply use `0xffff0000` which has no shifts. This patch
does the latter.