aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDylan Reid <dgreid@google.com>2015-09-23 19:33:54 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2015-09-23 19:33:54 +0000
commitad5e111650419aa42b2a099c6b4bfa4fa3a6f2d3 (patch)
treec82de10b3729db2107681ba2ab4833e7dacede8b
parent875ff85c6c51104e855418a22725cc557d29cad5 (diff)
parentb42510d55bafc96805a44bd6ac40faac28ebd219 (diff)
downloadtinyalsa-marshmallow-dr1.6-release.tar.gz
* changes: Add pcm_get_poll_fd Export pcm_mmap_avail
-rw-r--r--include/tinyalsa/asoundlib.h2
-rw-r--r--pcm.c7
2 files changed, 8 insertions, 1 deletions
diff --git a/include/tinyalsa/asoundlib.h b/include/tinyalsa/asoundlib.h
index 1554b52..97ee4f3 100644
--- a/include/tinyalsa/asoundlib.h
+++ b/include/tinyalsa/asoundlib.h
@@ -235,6 +235,7 @@ int pcm_mmap_read(struct pcm *pcm, void *data, unsigned int count);
int pcm_mmap_begin(struct pcm *pcm, void **areas, unsigned int *offset,
unsigned int *frames);
int pcm_mmap_commit(struct pcm *pcm, unsigned int offset, unsigned int frames);
+int pcm_mmap_avail(struct pcm *pcm);
/* Prepare the PCM substream to be triggerable */
int pcm_prepare(struct pcm *pcm);
@@ -247,6 +248,7 @@ int pcm_ioctl(struct pcm *pcm, int request, ...);
/* Interrupt driven API */
int pcm_wait(struct pcm *pcm, int timeout);
+int pcm_get_poll_fd(struct pcm *pcm);
/* Change avail_min after the stream has been opened with no need to stop the stream.
* Only accepted if opened with PCM_MMAP and PCM_NOIRQ flags
diff --git a/pcm.c b/pcm.c
index e3a41b0..488ea0c 100644
--- a/pcm.c
+++ b/pcm.c
@@ -1059,7 +1059,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)
{
pcm_sync_ptr(pcm, SNDRV_PCM_SYNC_PTR_HWSYNC);
if (pcm->flags & PCM_IN)
@@ -1180,6 +1180,11 @@ int pcm_wait(struct pcm *pcm, int timeout)
return 1;
}
+int pcm_get_poll_fd(struct pcm *pcm)
+{
+ return pcm->fd;
+}
+
int pcm_mmap_transfer(struct pcm *pcm, const void *buffer, unsigned int bytes)
{
int err = 0, frames, avail;