mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-05 13:29:57 -05:00
format: Add convenience API to check if a format is PCM or not
This commit is contained in:
parent
0ac2cfce6d
commit
54c391e6db
3 changed files with 8 additions and 0 deletions
|
|
@ -162,6 +162,7 @@ pa_ext_stream_restore_test;
|
||||||
pa_ext_stream_restore_write;
|
pa_ext_stream_restore_write;
|
||||||
pa_format_info_copy;
|
pa_format_info_copy;
|
||||||
pa_format_info_free;
|
pa_format_info_free;
|
||||||
|
pa_format_info_is_pcm;
|
||||||
pa_format_info_new;
|
pa_format_info_new;
|
||||||
pa_format_info_valid;
|
pa_format_info_valid;
|
||||||
pa_frame_size;
|
pa_frame_size;
|
||||||
|
|
|
||||||
|
|
@ -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);
|
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) {
|
pa_bool_t pa_format_info_is_compatible(pa_format_info *first, pa_format_info *second) {
|
||||||
const char *key;
|
const char *key;
|
||||||
void *state = NULL;
|
void *state = NULL;
|
||||||
|
|
|
||||||
|
|
@ -74,6 +74,9 @@ void pa_format_info_free(pa_format_info *f);
|
||||||
/** Returns non-zero when the format info structure is valid */
|
/** Returns non-zero when the format info structure is valid */
|
||||||
int pa_format_info_valid(pa_format_info *f);
|
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
|
PA_C_DECL_END
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue