mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-10-29 05:40:23 -04:00
introspect: Get format of source output
This gets the negotiated format of source outputs in pa_context_get_source_output*(). Also prints the format and volume in 'pactl list'.
This commit is contained in:
parent
dffc4d18d3
commit
4ab60d0377
5 changed files with 20 additions and 3 deletions
|
|
@ -639,7 +639,7 @@ static void get_sink_input_info_callback(pa_context *c, const pa_sink_input_info
|
|||
}
|
||||
|
||||
static void get_source_output_info_callback(pa_context *c, const pa_source_output_info *i, int is_last, void *userdata) {
|
||||
char t[32], k[32], s[PA_SAMPLE_SPEC_SNPRINT_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) {
|
||||
|
|
@ -680,6 +680,11 @@ static void get_source_output_info_callback(pa_context *c, const pa_source_outpu
|
|||
"\tSource: %u\n"
|
||||
"\tSample Specification: %s\n"
|
||||
"\tChannel Map: %s\n"
|
||||
"\tFormat: %s\n"
|
||||
"\tMute: %s\n"
|
||||
"\tVolume: %s\n"
|
||||
"\t %s\n"
|
||||
"\t balance %0.2f\n"
|
||||
"\tBuffer Latency: %0.0f usec\n"
|
||||
"\tSource Latency: %0.0f usec\n"
|
||||
"\tResample method: %s\n"
|
||||
|
|
@ -691,6 +696,11 @@ static void get_source_output_info_callback(pa_context *c, const pa_source_outpu
|
|||
i->source,
|
||||
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),
|
||||
pa_cvolume_get_balance(&i->volume, &i->channel_map),
|
||||
(double) i->buffer_usec,
|
||||
(double) i->source_usec,
|
||||
i->resample_method ? i->resample_method : _("n/a"),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue