introspect: Get formats for sinks

This gets the list of supported formats for a sink in
pa_context_get_sink_info*(). Also prints these in 'pactl list'.
This commit is contained in:
Arun Raghavan 2011-03-08 23:30:24 +05:30
parent dedbc942ab
commit 322980e2e3
5 changed files with 68 additions and 1 deletions

View file

@ -2984,6 +2984,19 @@ static void sink_fill_tagstruct(pa_native_connection *c, pa_tagstruct *t, pa_sin
pa_tagstruct_puts(t, sink->active_port ? sink->active_port->name : NULL);
}
if (c->version >= 21) {
uint32_t i;
pa_format_info *f;
pa_idxset *formats = pa_sink_get_formats(sink);
pa_tagstruct_putu8(t, (uint8_t) pa_idxset_size(formats));
PA_IDXSET_FOREACH(f, formats, i) {
pa_tagstruct_put_format_info(t, f);
}
pa_idxset_free(formats, (pa_free2_cb_t) pa_format_info_free2, NULL);
}
}
static void source_fill_tagstruct(pa_native_connection *c, pa_tagstruct *t, pa_source *source) {