]> code.delx.au - pulseaudio/commitdiff
stream: Add API to get a stream's pa_format_info
authorArun Raghavan <arun.raghavan@collabora.co.uk>
Tue, 8 Mar 2011 14:46:00 +0000 (20:16 +0530)
committerArun Raghavan <arun.raghavan@collabora.co.uk>
Mon, 2 May 2011 06:25:38 +0000 (11:55 +0530)
src/map-file
src/pulse/stream.c
src/pulse/stream.h

index 5283a5e36bbf38e7782130fa85afd162452962d8..1acc6e987543a6125207055d73736f204b62bc51 100644 (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;
index 10e431cd7a4744b3ddb1d66317b5ac9356069e77..bd2e6ca1ead2b032785701781f76b106221709f0 100644 (file)
@@ -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);
index 48bf09df667467765b7cc184b4cb82bc13cdbb7e..b265fae6f5664df533497870b2da12d1bc47da65 100644 (file)
@@ -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