config.h needs to be consistently included before any standard headers
if we ever want to set feature test macros (like _GNU_SOURCE or whatever)
inside. It can lead to hard-to-debug issues without that.
It can also be problematic just for our own HAVE_* that it may define
if it's not consistently made available before our own headers. Just
always include it first, before everything.
We already did this in many files, just not consistently.
Make a function that can initialize raw audio info from a dict and fill
in the defaults. We can use this in many of the modules when the audio
format is parsed.
Use the helper instead of duplicating the same code.
Also add some helpers to parse a json array of uint32_t
Move some functions to convert between type name and id.
Add spa_json_begin_array/object to replace
spa_json_init+spa_json_begin_array/object
This function is better because it does not waste a useless spa_json
structure as an iterator. The relaxed versions also error out when the
container is mismatched because parsing a mismatched container is not
going to give any results anyway.
Move the address:port parsing code to the net helper. Add a default
address option.
Pass the interface address to protocol-simple and use this as the
default address for listening.
This makes sure that when the user passes tcp:3400 that we don't end up
publishing 0.0.0.0:3400 but the actual address of the interface we are
listening on so that the snapcast discover can use this to notify the
snapcast server.
Fixes#4093
The module detects remote snapcast servers and creates a new sink
with protocol-simple for each server.
It sets up a new stream on the server for the sink with JSON-RPC.