This adds integer range/array and string array property getters to the
pa_format_info API. Corresponding tests added as well to ensure the code
is valgrind-clean.
The corresponding functions are added to map-file manually for now.
These utility functions could be handy to clients.
pa_format_info_to_sample_spec_fake() isn't made public, but the return
value is changed to keep in sync with pa_format_info_to_sample_spec().
This makes handling errors in getter functions more graceful, rather
than triggering warnings/asserts. Better to be less trigger-happy about
these things since this is now public-facing API.
We currently only have setters and clients need to be able to query
these values as well. The return types for these functions needed to be
changed to int since this is public API now.
Removes the comma as the proplist separator since that makes
pa_proplist_from_string() break and prints only the encoding if there
are no properties (instead of "<encoding>, (no properties)").
This replaces the simple string used by pa_format_info's proplist with a
JSON string (accessed via new API only). This allows us to express lists
and ranges more cleanly, and embed type information for future
extensibility.
We use json-c for JSON parsing. This is a lightweight depdency (32 KB on
my system) and avoids the hassle of having to reinvent a JSON parser.
Also included is a test which verifies functionality and is
valgrind-clean.
IEC61937-encapsulated E-AC3 frames contain 6 audio blocks per substream,
which corresponds to 1536 samples contained a 24576-byte frame. To cope
with this, we maintain the s16le stereo sample spec, but quadruple the
sample rate so that the conversion remains accurate.
We frequently need to free an idxset containing pa_format_infos, so
define an internal free function that can be used directly with this
(instead of defining it once-per-file).