From faaa6972a2846b43366887bc0779c6c1be20a16f Mon Sep 17 00:00:00 2001 From: dvdli Date: Wed, 28 Oct 2020 22:18:40 +0800 Subject: AOSP CL "Export pcm_mmap_avail" https://android.googlesource.com/platform/external/tinyalsa/+/9074cfc4127cb841f0633b35895141f90da3f0d6 commit 9074cfc4127cb841f0633b35895141f90da3f0d6 author Dylan Reid Export pcm_mmap_avail This is useful for timer based wakeups and for checking how much data has been captured by a hotwording device. Change-Id: I409201a5c9ce73abc807a9dd767beb3a32810f06 Signed-off-by: Dylan Reid --- include/tinyalsa/pcm.h | 2 ++ src/pcm.c | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/include/tinyalsa/pcm.h b/include/tinyalsa/pcm.h index f32e11d..a49746c 100644 --- a/include/tinyalsa/pcm.h +++ b/include/tinyalsa/pcm.h @@ -341,6 +341,8 @@ int pcm_mmap_begin(struct pcm *pcm, void **areas, unsigned int *offset, unsigned int pcm_mmap_commit(struct pcm *pcm, unsigned int offset, unsigned int frames); +int pcm_mmap_avail(struct pcm *pcm); + int pcm_link(struct pcm *pcm1, struct pcm *pcm2); int pcm_unlink(struct pcm *pcm); diff --git a/src/pcm.c b/src/pcm.c index 8da3241..e88c18c 100644 --- a/src/pcm.c +++ b/src/pcm.c @@ -1236,7 +1236,7 @@ static inline int pcm_mmap_capture_avail(struct pcm *pcm) return avail; } -static inline int pcm_mmap_avail(struct pcm *pcm) +int pcm_mmap_avail(struct pcm *pcm) { if (pcm->flags & PCM_IN) return pcm_mmap_capture_avail(pcm); -- cgit v1.2.3