summaryrefslogtreecommitdiffstats
path: root/src/pulsecore
diff options
context:
space:
mode:
authorColin Guthrie <colin@mageia.org>2011-05-16 22:15:57 +0100
committerColin Guthrie <colin@mageia.org>2011-06-22 21:55:27 +0100
commitfdf3a0881445560e962924a02319fc5cd2506231 (patch)
tree48f95613887f873dbbc225a90697d4ba9ac772d9 /src/pulsecore
parent5d35375aa758fde7d9f3d6467e2506aca9784597 (diff)
introspect: Get formats for sources
This gets the list of supported formats for a source in pa_context_get_source_info*(). Also prints these in 'pactl list'.
Diffstat (limited to 'src/pulsecore')
-rw-r--r--src/pulsecore/protocol-native.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/pulsecore/protocol-native.c b/src/pulsecore/protocol-native.c
index 501ff378..3574ca98 100644
--- a/src/pulsecore/protocol-native.c
+++ b/src/pulsecore/protocol-native.c
@@ -3131,6 +3131,19 @@ static void source_fill_tagstruct(pa_native_connection *c, pa_tagstruct *t, pa_s
pa_tagstruct_puts(t, source->active_port ? source->active_port->name : NULL);
}
+
+ if (c->version >= 22) {
+ uint32_t i;
+ pa_format_info *f;
+ pa_idxset *formats = pa_source_get_formats(source);
+
+ 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 client_fill_tagstruct(pa_native_connection *c, pa_tagstruct *t, pa_client *client) {