From 322980e2e3844abf837dcc8cc5317406b3d8cb94 Mon Sep 17 00:00:00 2001 From: Arun Raghavan Date: Tue, 8 Mar 2011 23:30:24 +0530 Subject: 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'. --- src/utils/pactl.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'src/utils/pactl.c') 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) { -- cgit From 7aa84e82089a88a542f15cbf6f38c808b4f04db1 Mon Sep 17 00:00:00 2001 From: Arun Raghavan Date: Tue, 8 Mar 2011 23:31:59 +0530 Subject: introspect: Get format of sink input This gets the negotiated format of sink inputs in pa_context_get_sink_input*(). Also prints the format in 'pactl list'. --- src/utils/pactl.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/utils/pactl.c') diff --git a/src/utils/pactl.c b/src/utils/pactl.c index 109d31b9..7be7049f 100644 --- a/src/utils/pactl.c +++ b/src/utils/pactl.c @@ -560,7 +560,7 @@ static void get_card_info_callback(pa_context *c, const pa_card_info *i, int is_ } static void get_sink_input_info_callback(pa_context *c, const pa_sink_input_info *i, int is_last, void *userdata) { - char t[32], k[32], s[PA_SAMPLE_SPEC_SNPRINT_MAX], cv[PA_CVOLUME_SNPRINT_MAX], cvdb[PA_SW_CVOLUME_SNPRINT_DB_MAX], cm[PA_CHANNEL_MAP_SNPRINT_MAX]; + char t[32], k[32], s[PA_SAMPLE_SPEC_SNPRINT_MAX], cv[PA_CVOLUME_SNPRINT_MAX], cvdb[PA_SW_CVOLUME_SNPRINT_DB_MAX], cm[PA_CHANNEL_MAP_SNPRINT_MAX], f[PA_FORMAT_INFO_SNPRINT_MAX]; char *pl; if (is_last < 0) { @@ -600,6 +600,7 @@ static void get_sink_input_info_callback(pa_context *c, const pa_sink_input_info "\tSink: %u\n" "\tSample Specification: %s\n" "\tChannel Map: %s\n" + "\tFormat: %s\n" "\tMute: %s\n" "\tVolume: %s\n" "\t %s\n" @@ -615,6 +616,7 @@ static void get_sink_input_info_callback(pa_context *c, const pa_sink_input_info i->sink, pa_sample_spec_snprint(s, sizeof(s), &i->sample_spec), pa_channel_map_snprint(cm, sizeof(cm), &i->channel_map), + pa_format_info_snprint(f, sizeof(f), i->format), pa_yes_no(i->mute), pa_cvolume_snprint(cv, sizeof(cv), &i->volume), pa_sw_cvolume_snprint_dB(cvdb, sizeof(cvdb), &i->volume), -- cgit