summaryrefslogtreecommitdiffstats
path: root/src/pulse
diff options
context:
space:
mode:
authorColin Guthrie <colin@mageia.org>2011-05-16 22:23:24 +0100
committerColin Guthrie <colin@mageia.org>2011-06-22 22:45:27 +0100
commit4ab60d03778bf1e680d29c6ff37266978df44aa5 (patch)
tree3a68fcaf3e29bc798e5947d7d65b961975c0e373 /src/pulse
parentdffc4d18d3a9f608f8b316f1e7057d13978ef44f (diff)
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'.
Diffstat (limited to 'src/pulse')
-rw-r--r--src/pulse/introspect.c6
-rw-r--r--src/pulse/introspect.h1
2 files changed, 6 insertions, 1 deletions
diff --git a/src/pulse/introspect.c b/src/pulse/introspect.c
index d6ad0f50..014eadfc 100644
--- a/src/pulse/introspect.c
+++ b/src/pulse/introspect.c
@@ -1168,6 +1168,7 @@ static void context_get_source_output_info_callback(pa_pdispatch *pd, uint32_t c
pa_zero(i);
i.proplist = pa_proplist_new();
+ i.format = pa_format_info_new();
if (pa_tagstruct_getu32(t, &i.index) < 0 ||
pa_tagstruct_gets(t, &i.name) < 0 ||
@@ -1185,10 +1186,12 @@ static void context_get_source_output_info_callback(pa_pdispatch *pd, uint32_t c
(o->context->version >= 22 && (pa_tagstruct_get_cvolume(t, &i.volume) < 0 ||
pa_tagstruct_get_boolean(t, &mute) < 0 ||
pa_tagstruct_get_boolean(t, &has_volume) < 0 ||
- pa_tagstruct_get_boolean(t, &volume_writable) < 0))) {
+ pa_tagstruct_get_boolean(t, &volume_writable) < 0 ||
+ pa_tagstruct_get_format_info(t, i.format) < 0))) {
pa_context_fail(o->context, PA_ERR_PROTOCOL);
pa_proplist_free(i.proplist);
+ pa_format_info_free(i.format);
goto finish;
}
@@ -1203,6 +1206,7 @@ static void context_get_source_output_info_callback(pa_pdispatch *pd, uint32_t c
}
pa_proplist_free(i.proplist);
+ pa_format_info_free(i.format);
}
}
diff --git a/src/pulse/introspect.h b/src/pulse/introspect.h
index 84a12b62..196d44d6 100644
--- a/src/pulse/introspect.h
+++ b/src/pulse/introspect.h
@@ -561,6 +561,7 @@ typedef struct pa_source_output_info {
int mute; /**< Stream muted \since 1.0 */
int has_volume; /**< Stream has volume. If not set, then the meaning of this struct's volume member is unspecified. \since 1.0 */
int volume_writable; /**< The volume can be set. If not set, the volume can still change even though clients can't control the volume. \since 1.0 */
+ pa_format_info *format; /**< Stream format information. \since 1.0 */
} pa_source_output_info;
/** Callback prototype for pa_context_get_source_output_info() and friends*/