diff options
author | Arun Raghavan <arun.raghavan@collabora.co.uk> | 2011-03-01 16:34:06 +0530 |
---|---|---|
committer | Arun Raghavan <arun.raghavan@collabora.co.uk> | 2011-05-02 11:54:47 +0530 |
commit | 54c391e6db550c5519df0ebb37f2197eed440c92 (patch) | |
tree | d13e7ffdd9f7331c74312d14edc242f076bd094b | |
parent | 0ac2cfce6d1a3d7ab5af6aca659e46625c32d3c4 (diff) |
format: Add convenience API to check if a format is PCM or not
-rw-r--r-- | src/map-file | 1 | ||||
-rw-r--r-- | src/pulse/format.c | 4 | ||||
-rw-r--r-- | src/pulse/format.h | 3 |
3 files changed, 8 insertions, 0 deletions
diff --git a/src/map-file b/src/map-file index b4196f15..3b1de105 100644 --- a/src/map-file +++ b/src/map-file @@ -162,6 +162,7 @@ pa_ext_stream_restore_test; pa_ext_stream_restore_write; pa_format_info_copy; pa_format_info_free; +pa_format_info_is_pcm; pa_format_info_new; pa_format_info_valid; pa_frame_size; diff --git a/src/pulse/format.c b/src/pulse/format.c index c3962de9..4ecd75ee 100644 --- a/src/pulse/format.c +++ b/src/pulse/format.c @@ -70,6 +70,10 @@ int pa_format_info_valid(pa_format_info *f) { return (f->encoding >= 0 && f->encoding < PA_ENCODING_MAX && f->plist != NULL); } +int pa_format_info_is_pcm(pa_format_info *f) { + return f->encoding == PA_ENCODING_PCM; +} + pa_bool_t pa_format_info_is_compatible(pa_format_info *first, pa_format_info *second) { const char *key; void *state = NULL; diff --git a/src/pulse/format.h b/src/pulse/format.h index fdf4f377..7e3ab08d 100644 --- a/src/pulse/format.h +++ b/src/pulse/format.h @@ -74,6 +74,9 @@ void pa_format_info_free(pa_format_info *f); /** Returns non-zero when the format info structure is valid */ int pa_format_info_valid(pa_format_info *f); +/** Returns non-zero when the format info structure represents a PCM (i.e. uncompressed data) format */ +int pa_format_info_is_pcm(pa_format_info *f); + PA_C_DECL_END #endif |