From 9c9a44299900695a91aa50a2751f903144bd3a0f Mon Sep 17 00:00:00 2001 From: dvdli Date: Wed, 28 Oct 2020 16:05:19 +0800 Subject: AOSP CL "Add pcm_params string conversion and format checking" https://android.googlesource.com/platform/external/tinyalsa/+/70530a69767a9a383c5bf546e6e803aac08a5a1e%5E!/ title: Add pcm_params string conversion and format checking commit 70530a69767a9a383c5bf546e6e803aac08a5a1e author Andy Hung --- include/tinyalsa/pcm.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'include') diff --git a/include/tinyalsa/pcm.h b/include/tinyalsa/pcm.h index 1184d81..5191882 100644 --- a/include/tinyalsa/pcm.h +++ b/include/tinyalsa/pcm.h @@ -264,6 +264,21 @@ unsigned int pcm_params_get_min(const struct pcm_params *pcm_params, enum pcm_pa unsigned int pcm_params_get_max(const struct pcm_params *pcm_params, enum pcm_param param); +/* Converts the pcm parameters to a human readable string. + * The string parameter is a caller allocated buffer of size bytes, + * which is then filled up to size - 1 and null terminated, + * if size is greater than zero. + * The return value is the number of bytes copied to string + * (not including null termination) if less than size; otherwise, + * the number of bytes required for the buffer. + */ +int pcm_params_to_string(struct pcm_params *params, char *string, unsigned int size); + +/* Returns 1 if the pcm_format is present (format bit set) in + * the pcm_params structure; 0 otherwise, or upon unrecognized format. + */ +int pcm_params_format_test(struct pcm_params *params, enum pcm_format format); + struct pcm; struct pcm *pcm_open(unsigned int card, -- cgit v1.2.3