summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorArun Raghavan <arun.raghavan@collabora.co.uk>2011-03-08 20:16:00 +0530
committerArun Raghavan <arun.raghavan@collabora.co.uk>2011-05-02 11:55:38 +0530
commitdedbc942ab2090320856c36d6673db12026efdc1 (patch)
tree0a1fb77bbe9f81a87d1265ec679e686fe4084e5b /src
parent8631f4e2c44b47db76795bebdbab54914a1f3ea0 (diff)
stream: Add API to get a stream's pa_format_info
Diffstat (limited to 'src')
-rw-r--r--src/map-file1
-rw-r--r--src/pulse/stream.c10
-rw-r--r--src/pulse/stream.h3
3 files changed, 14 insertions, 0 deletions
diff --git a/src/map-file b/src/map-file
index 5283a5e3..1acc6e98 100644
--- a/src/map-file
+++ b/src/map-file
@@ -258,6 +258,7 @@ pa_stream_get_channel_map;
pa_stream_get_context;
pa_stream_get_device_index;
pa_stream_get_device_name;
+pa_stream_get_format_info;
pa_stream_get_index;
pa_stream_get_latency;
pa_stream_get_monitor_stream;
diff --git a/src/pulse/stream.c b/src/pulse/stream.c
index 10e431cd..bd2e6ca1 100644
--- a/src/pulse/stream.c
+++ b/src/pulse/stream.c
@@ -2470,6 +2470,16 @@ const pa_channel_map* pa_stream_get_channel_map(pa_stream *s) {
return &s->channel_map;
}
+const pa_format_info* pa_stream_get_format_info(pa_stream *s) {
+ pa_assert(s);
+ pa_assert(PA_REFCNT_VALUE(s) >= 1);
+
+ /* We don't have the format till routing is done */
+ PA_CHECK_VALIDITY_RETURN_NULL(s->context, s->state == PA_STREAM_READY, PA_ERR_BADSTATE);
+ PA_CHECK_VALIDITY_RETURN_NULL(s->context, !pa_detect_fork(), PA_ERR_FORKED);
+
+ return s->format;
+}
const pa_buffer_attr* pa_stream_get_buffer_attr(pa_stream *s) {
pa_assert(s);
pa_assert(PA_REFCNT_VALUE(s) >= 1);
diff --git a/src/pulse/stream.h b/src/pulse/stream.h
index 48bf09df..b265fae6 100644
--- a/src/pulse/stream.h
+++ b/src/pulse/stream.h
@@ -709,6 +709,9 @@ const pa_sample_spec* pa_stream_get_sample_spec(pa_stream *s);
/** Return a pointer to the stream's channel map. */
const pa_channel_map* pa_stream_get_channel_map(pa_stream *s);
+/** Return a pointer to the stream's format \since 1.0 */
+const pa_format_info* pa_stream_get_format_info(pa_stream *s);
+
/** Return the per-stream server-side buffer metrics of the
* stream. Only valid after the stream has been connected successfuly
* and if the server is at least PulseAudio 0.9. This will return the