aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorGlenn Kasten <gkasten@google.com>2013-08-22 15:11:48 -0700
committerGlenn Kasten <gkasten@google.com>2013-09-03 11:11:10 -0700
commit810124041268e4f0b20d271ddc566d11ecb8575f (patch)
treee3e180d1e7f0f182c308e320fc4a56cba879ad67 /include
parent782bfda5e796cb46d0e7be0dc882ff686d5ad2a2 (diff)
pcm_get_htimestamp can now use CLOCK_MONOTONIC
Previously the timebase was not documented. Now a new pcm_open flag can be used to specify the clock. If flag PCM_MONOTONIC is specified, then pcm_open uses SNDRV_PCM_IOCTL_TTSTAMP with parameter SNDRV_PCM_TSTAMP_TYPE_MONOTONIC to request timestamps in CLOCK_MONOTONIC. Change-Id: I40ce359cb38d686cbb2521fb0602a8a17ab4f925
Diffstat (limited to 'include')
-rw-r--r--include/tinyalsa/asoundlib.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/include/tinyalsa/asoundlib.h b/include/tinyalsa/asoundlib.h
index 3d20b94..5c08577 100644
--- a/include/tinyalsa/asoundlib.h
+++ b/include/tinyalsa/asoundlib.h
@@ -55,6 +55,7 @@ struct pcm;
* second call to pcm_write will attempt to
* restart the stream.
*/
+#define PCM_MONOTONIC 0x00000008 /* see pcm_get_htimestamp */
/* PCM runtime states */
#define PCM_STATE_OPEN 0
@@ -166,6 +167,8 @@ unsigned int pcm_bytes_to_frames(struct pcm *pcm, unsigned int bytes);
unsigned int pcm_get_latency(struct pcm *pcm);
/* Returns available frames in pcm buffer and corresponding time stamp.
+ * The clock is CLOCK_MONOTONIC if flag PCM_MONOTONIC was specified in pcm_open,
+ * otherwise the clock is CLOCK_REALTIME.
* 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