pulse: parse and fill up the array of formats

A sink and source can have an array of pa_format_info structures
that contain the possible formats of the device. Parse them from
the EnumFormat and return them when introspecting.
This commit is contained in:
Wim Taymans 2020-09-17 16:34:18 +02:00
parent 8406ad8a4e
commit 023281fd0b
6 changed files with 333 additions and 180 deletions

View file

@ -301,6 +301,7 @@ struct global {
uint32_t active_port;
enum spa_param_availability available_port;
uint32_t device_index;
struct pw_array formats;
} node_info;
struct {
uint32_t node_id;
@ -516,11 +517,16 @@ int pa_metadata_update(struct global *global, uint32_t subject, const char *key,
int pa_metadata_get(struct global *global, uint32_t subject, const char *key,
const char **type, const char **value);
void pw_channel_map_from_positions(pa_channel_map *map, uint32_t n_pos, const uint32_t *pos);
void pw_channel_map_to_positions(const pa_channel_map *map, uint32_t *pos);
int pa_format_parse_param(const struct spa_pod *param,
pa_sample_spec *spec, pa_channel_map *map);
const struct spa_pod *pa_format_build_param(struct spa_pod_builder *b,
uint32_t id, pa_sample_spec *spec, pa_channel_map *map);
pa_format_info* pa_format_info_from_param(const struct spa_pod *param);
#ifdef __cplusplus
}
#endif