From 40b018e35a29c1fa7fcc52b8297d52e97df93568 Mon Sep 17 00:00:00 2001 From: Eric Laurent Date: Sat, 18 Jun 2011 10:10:23 -0700 Subject: 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. --- include/tinyalsa/asoundlib.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'include') 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 /* * 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. -- cgit v1.2.3-70-g09d2