aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorEric Laurent <elaurent@google.com>2011-06-18 10:10:23 -0700
committerSimon Wilson <simonwilson@google.com>2011-07-25 10:53:36 -0700
commit40b018e35a29c1fa7fcc52b8297d52e97df93568 (patch)
treef73f6ae0c8ca4a0f17238af46524311ec89bcc00 /include
parentc8aedefba2dda8da5cbc2343f02eac5925a42001 (diff)
pcm: add pcm_get_htimestamp() function
pcm_get_htimestamp() returns the number of available frames in the kernel driver buffers as well as the corresponding high resolution time stamp.
Diffstat (limited to 'include')
-rw-r--r--include/tinyalsa/asoundlib.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/include/tinyalsa/asoundlib.h b/include/tinyalsa/asoundlib.h
index 14511c9..7b13c0d 100644
--- a/include/tinyalsa/asoundlib.h
+++ b/include/tinyalsa/asoundlib.h
@@ -29,6 +29,7 @@
#ifndef ASOUNDLIB_H
#define ASOUNDLIB_H
+#include <sys/time.h>
/*
* PCM API
@@ -90,6 +91,15 @@ unsigned int pcm_get_buffer_size(struct pcm *pcm);
/* Returns the pcm latency in ms */
unsigned int pcm_get_latency(struct pcm *pcm);
+/* Returns available frames in pcm buffer and corresponding time stamp.
+ * For an input stream, frames available are frames ready for the
+ * application to read.
+ * For an output stream, frames available are the number of empty frames available
+ * for the application to write.
+ */
+int pcm_get_htimestamp(struct pcm *pcm, unsigned int *avail,
+ struct timespec *tstamp);
+
/* Write data to the fifo.
* Will start playback on the first write or on a write that
* occurs after a fifo underrun.