aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authordvdli <dvdli@google.com>2020-10-28 16:05:19 +0800
committerdvdli <dvdli@google.com>2020-10-28 16:05:19 +0800
commit9c9a44299900695a91aa50a2751f903144bd3a0f (patch)
treec1df140df8a8d7f46a4f1c8e8db0666497a1d619 /include
parent0bfc861f769eab0455461cc10bd323c04862dc99 (diff)
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 <hunga@google.com>
Diffstat (limited to 'include')
-rw-r--r--include/tinyalsa/pcm.h15
1 files changed, 15 insertions, 0 deletions
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,