format: Expose pa_format_info convenience getters in API

We move over helper functions to get rate, channels, channel map and
sample format (if PCM) in the public API, so users of the extended API
are more easily able to pull out these values from pa_format_info.
This commit is contained in:
Arun Raghavan 2018-05-26 08:52:52 +05:30 committed by Arun Raghavan
parent 1f45082c68
commit 6d7a266e0e
5 changed files with 113 additions and 109 deletions

View file

@ -22,26 +22,6 @@
#include <stdbool.h>
/* Gets the sample format stored in the format info. Returns a negative error
* code on failure. If the sample format property is not set at all, returns
* -PA_ERR_NOENTITY. */
int pa_format_info_get_sample_format(const pa_format_info *f, pa_sample_format_t *sf);
/* Gets the sample rate stored in the format info. Returns a negative error
* code on failure. If the sample rate property is not set at all, returns
* -PA_ERR_NOENTITY. */
int pa_format_info_get_rate(const pa_format_info *f, uint32_t *rate);
/* Gets the channel count stored in the format info. Returns a negative error
* code on failure. If the channels property is not set at all, returns
* -PA_ERR_NOENTITY. */
int pa_format_info_get_channels(const pa_format_info *f, uint8_t *channels);
/* Gets the channel map stored in the format info. Returns a negative error
* code on failure. If the channel map property is not set at all, returns
* -PA_ERR_NOENTITY. */
int pa_format_info_get_channel_map(const pa_format_info *f, pa_channel_map *map);
/* Convert a sample spec and an optional channel map to a new PCM format info
* object (remember to free it). If map is NULL, then the channel map will be
* left unspecified. If some fields of the sample spec should be ignored, pass