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 /src/pulse | |
parent | 0ac2cfce6d1a3d7ab5af6aca659e46625c32d3c4 (diff) |
format: Add convenience API to check if a format is PCM or not
Diffstat (limited to 'src/pulse')
-rw-r--r-- | src/pulse/format.c | 4 | ||||
-rw-r--r-- | src/pulse/format.h | 3 |
2 files changed, 7 insertions, 0 deletions
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 |