summaryrefslogtreecommitdiffstats
path: root/src/utils
diff options
context:
space:
mode:
authorArun Raghavan <arun.raghavan@collabora.co.uk>2011-03-08 23:30:24 +0530
committerArun Raghavan <arun.raghavan@collabora.co.uk>2011-05-02 11:55:39 +0530
commit322980e2e3844abf837dcc8cc5317406b3d8cb94 (patch)
tree3d18986461d595d75e88d826cc2dc77b2562582d /src/utils
parentdedbc942ab2090320856c36d6673db12026efdc1 (diff)
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'.
Diffstat (limited to 'src/utils')
-rw-r--r--src/utils/pactl.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/utils/pactl.c b/src/utils/pactl.c
index 194183d4..109d31b9 100644
--- a/src/utils/pactl.c
+++ b/src/utils/pactl.c
@@ -222,7 +222,8 @@ static void get_sink_info_callback(pa_context *c, const pa_sink_info *i, int is_
cvdb[PA_SW_CVOLUME_SNPRINT_DB_MAX],
v[PA_VOLUME_SNPRINT_MAX],
vdb[PA_SW_VOLUME_SNPRINT_DB_MAX],
- cm[PA_CHANNEL_MAP_SNPRINT_MAX];
+ cm[PA_CHANNEL_MAP_SNPRINT_MAX],
+ f[PA_FORMAT_INFO_SNPRINT_MAX];
char *pl;
if (is_last < 0) {
@@ -307,6 +308,14 @@ static void get_sink_info_callback(pa_context *c, const pa_sink_info *i, int is_
if (i->active_port)
printf(_("\tActive Port: %s\n"),
i->active_port->name);
+
+ if (i->formats) {
+ uint8_t j;
+
+ printf(_("\tFormats:\n"));
+ for (j = 0; j < i->n_formats; j++)
+ printf("\t\t%s\n", pa_format_info_snprint(f, sizeof(f), i->formats[j]));
+ }
}
static void get_source_info_callback(pa_context *c, const pa_source_info *i, int is_last, void *userdata) {