mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2025-10-29 05:40:25 -04:00
Timestamp update (struct timeval -> struct timespec).
This commit is contained in:
parent
8bb29f007d
commit
cf9e518d51
15 changed files with 91 additions and 36 deletions
|
|
@ -114,6 +114,11 @@ int snd_async_handler_get_fd(snd_async_handler_t *handler);
|
|||
int snd_async_handler_get_signo(snd_async_handler_t *handler);
|
||||
void *snd_async_handler_get_callback_private(snd_async_handler_t *handler);
|
||||
|
||||
/** Timestamp */
|
||||
typedef struct timeval snd_timestamp_t;
|
||||
/** Hi-res timestamp */
|
||||
typedef struct timespec snd_htimestamp_t;
|
||||
|
||||
/** \} */
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
|
|
|||
|
|
@ -288,8 +288,6 @@ typedef enum _snd_pcm_tstamp {
|
|||
typedef unsigned long snd_pcm_uframes_t;
|
||||
/** Signed frames quantity */
|
||||
typedef long snd_pcm_sframes_t;
|
||||
/** Timestamp */
|
||||
typedef struct timeval snd_timestamp_t;
|
||||
|
||||
/** Non blocking mode (flag for open mode) \hideinitializer */
|
||||
#define SND_PCM_NONBLOCK 0x0001
|
||||
|
|
|
|||
|
|
@ -135,7 +135,7 @@ size_t snd_rawmidi_status_sizeof(void);
|
|||
int snd_rawmidi_status_malloc(snd_rawmidi_status_t **ptr);
|
||||
void snd_rawmidi_status_free(snd_rawmidi_status_t *obj);
|
||||
void snd_rawmidi_status_copy(snd_rawmidi_status_t *dst, const snd_rawmidi_status_t *src);
|
||||
void snd_rawmidi_status_get_tstamp(const snd_rawmidi_status_t *obj, snd_timestamp_t *ptr);
|
||||
void snd_rawmidi_status_get_tstamp(const snd_rawmidi_status_t *obj, snd_htimestamp_t *ptr);
|
||||
size_t snd_rawmidi_status_get_avail(const snd_rawmidi_status_t *obj);
|
||||
size_t snd_rawmidi_status_get_xruns(const snd_rawmidi_status_t *obj);
|
||||
int snd_rawmidi_status(snd_rawmidi_t *rmidi, snd_rawmidi_status_t * status);
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
* Advanced Linux Sound Architecture - ALSA - Driver
|
||||
* Copyright (c) 1994-2000 by Jaroslav Kysela <perex@suse.cz>,
|
||||
* Copyright (c) 1994-2003 by Jaroslav Kysela <perex@suse.cz>,
|
||||
* Abramo Bagnara <abramo@alsa-project.org>
|
||||
*
|
||||
*
|
||||
|
|
@ -93,7 +93,7 @@ struct sndrv_aes_iec958 {
|
|||
* *
|
||||
****************************************************************************/
|
||||
|
||||
#define SNDRV_HWDEP_VERSION SNDRV_PROTOCOL_VERSION(1, 0, 0)
|
||||
#define SNDRV_HWDEP_VERSION SNDRV_PROTOCOL_VERSION(1, 0, 1)
|
||||
|
||||
enum sndrv_hwdep_iface {
|
||||
SNDRV_HWDEP_IFACE_OPL2 = 0,
|
||||
|
|
@ -150,7 +150,7 @@ enum {
|
|||
* *
|
||||
*****************************************************************************/
|
||||
|
||||
#define SNDRV_PCM_VERSION SNDRV_PROTOCOL_VERSION(2, 0, 3)
|
||||
#define SNDRV_PCM_VERSION SNDRV_PROTOCOL_VERSION(2, 0, 5)
|
||||
|
||||
typedef unsigned long sndrv_pcm_uframes_t;
|
||||
typedef long sndrv_pcm_sframes_t;
|
||||
|
|
@ -398,8 +398,8 @@ struct sndrv_pcm_channel_info {
|
|||
|
||||
struct sndrv_pcm_status {
|
||||
enum sndrv_pcm_state state; /* stream state */
|
||||
struct timeval trigger_tstamp; /* time when stream was started/stopped/paused */
|
||||
struct timeval tstamp; /* reference timestamp */
|
||||
struct timespec trigger_tstamp; /* time when stream was started/stopped/paused */
|
||||
struct timespec tstamp; /* reference timestamp */
|
||||
sndrv_pcm_uframes_t appl_ptr; /* appl ptr */
|
||||
sndrv_pcm_uframes_t hw_ptr; /* hw ptr */
|
||||
sndrv_pcm_sframes_t delay; /* current delay in frames */
|
||||
|
|
@ -414,7 +414,7 @@ struct sndrv_pcm_mmap_status {
|
|||
enum sndrv_pcm_state state; /* RO: state - SNDRV_PCM_STATE_XXXX */
|
||||
int pad1; /* Needed for 64 bit alignment */
|
||||
sndrv_pcm_uframes_t hw_ptr; /* RO: hw ptr (0...boundary-1) */
|
||||
struct timeval tstamp; /* Timestamp */
|
||||
struct timespec tstamp; /* Timestamp */
|
||||
enum sndrv_pcm_state suspended_state; /* RO: suspended stream state */
|
||||
};
|
||||
|
||||
|
|
@ -438,6 +438,7 @@ struct sndrv_xfern {
|
|||
enum {
|
||||
SNDRV_PCM_IOCTL_PVERSION = _IOR('A', 0x00, int),
|
||||
SNDRV_PCM_IOCTL_INFO = _IOR('A', 0x01, struct sndrv_pcm_info),
|
||||
SNDRV_PCM_IOCTL_TSTAMP = _IOW('A', 0x02, int),
|
||||
SNDRV_PCM_IOCTL_HW_REFINE = _IOWR('A', 0x10, struct sndrv_pcm_hw_params),
|
||||
SNDRV_PCM_IOCTL_HW_PARAMS = _IOWR('A', 0x11, struct sndrv_pcm_hw_params),
|
||||
SNDRV_PCM_IOCTL_HW_FREE = _IO('A', 0x12),
|
||||
|
|
@ -455,6 +456,7 @@ enum {
|
|||
SNDRV_PCM_IOCTL_REWIND = _IOW('A', 0x46, sndrv_pcm_uframes_t),
|
||||
SNDRV_PCM_IOCTL_RESUME = _IO('A', 0x47),
|
||||
SNDRV_PCM_IOCTL_XRUN = _IO('A', 0x48),
|
||||
SNDRV_PCM_IOCTL_FORWARD = _IOW('A', 0x49, sndrv_pcm_uframes_t),
|
||||
SNDRV_PCM_IOCTL_WRITEI_FRAMES = _IOW('A', 0x50, struct sndrv_xferi),
|
||||
SNDRV_PCM_IOCTL_READI_FRAMES = _IOR('A', 0x51, struct sndrv_xferi),
|
||||
SNDRV_PCM_IOCTL_WRITEN_FRAMES = _IOW('A', 0x52, struct sndrv_xfern),
|
||||
|
|
@ -512,7 +514,7 @@ struct sndrv_rawmidi_params {
|
|||
|
||||
struct sndrv_rawmidi_status {
|
||||
enum sndrv_rawmidi_stream stream;
|
||||
struct timeval tstamp; /* Timestamp */
|
||||
struct timespec tstamp; /* Timestamp */
|
||||
size_t avail; /* available bytes */
|
||||
size_t xruns; /* count of overruns since last status (in bytes) */
|
||||
unsigned char reserved[16]; /* reserved for future use */
|
||||
|
|
@ -531,7 +533,7 @@ enum {
|
|||
* Timer section - /dev/snd/timer
|
||||
*/
|
||||
|
||||
#define SNDRV_TIMER_VERSION SNDRV_PROTOCOL_VERSION(2, 0, 0)
|
||||
#define SNDRV_TIMER_VERSION SNDRV_PROTOCOL_VERSION(2, 0, 1)
|
||||
|
||||
enum sndrv_timer_class {
|
||||
SNDRV_TIMER_CLASS_NONE = -1,
|
||||
|
|
@ -591,8 +593,8 @@ struct sndrv_timer_params {
|
|||
};
|
||||
|
||||
struct sndrv_timer_status {
|
||||
struct timeval tstamp; /* Timestamp */
|
||||
unsigned int resolution; /* current resolution */
|
||||
struct timespec tstamp; /* Timestamp - last update */
|
||||
unsigned int resolution; /* current resolution in ns */
|
||||
unsigned int lost; /* counter of master tick lost */
|
||||
unsigned int overrun; /* count of read queue overruns */
|
||||
unsigned int queue; /* used queue size */
|
||||
|
|
@ -602,6 +604,7 @@ struct sndrv_timer_status {
|
|||
enum {
|
||||
SNDRV_TIMER_IOCTL_PVERSION = _IOR('T', 0x00, int),
|
||||
SNDRV_TIMER_IOCTL_NEXT_DEVICE = _IOWR('T', 0x01, struct sndrv_timer_id),
|
||||
SNDRV_TIMER_IOCTL_TREAD = _IOW('T', 0x02, int),
|
||||
SNDRV_TIMER_IOCTL_SELECT = _IOW('T', 0x10, struct sndrv_timer_select),
|
||||
SNDRV_TIMER_IOCTL_INFO = _IOR('T', 0x11, struct sndrv_timer_info),
|
||||
SNDRV_TIMER_IOCTL_PARAMS = _IOW('T', 0x12, struct sndrv_timer_params),
|
||||
|
|
@ -616,13 +619,27 @@ struct sndrv_timer_read {
|
|||
unsigned int ticks;
|
||||
};
|
||||
|
||||
enum sndrv_timer_event {
|
||||
SNDRV_TIMER_EVENT_RESOLUTION = 0, /* val = resolution in ns */
|
||||
SNDRV_TIMER_EVENT_TICK, /* val = ticks */
|
||||
SNDRV_TIMER_EVENT_START, /* val = resolution in ns */
|
||||
SNDRV_TIMER_EVENT_STOP, /* val = 0 */
|
||||
SNDRV_TIMER_EVENT_CONTINUE /* val = resolution in ns */
|
||||
};
|
||||
|
||||
struct sndrv_timer_tread {
|
||||
enum sndrv_timer_event event;
|
||||
struct timespec tstamp;
|
||||
unsigned int val;
|
||||
};
|
||||
|
||||
/****************************************************************************
|
||||
* *
|
||||
* Section for driver control interface - /dev/snd/control? *
|
||||
* *
|
||||
****************************************************************************/
|
||||
|
||||
#define SNDRV_CTL_VERSION SNDRV_PROTOCOL_VERSION(2, 0, 0)
|
||||
#define SNDRV_CTL_VERSION SNDRV_PROTOCOL_VERSION(2, 0, 1)
|
||||
|
||||
struct sndrv_ctl_card_info {
|
||||
int card; /* card number */
|
||||
|
|
@ -663,6 +680,7 @@ enum sndrv_ctl_elem_iface {
|
|||
#define SNDRV_CTL_ELEM_ACCESS_WRITE (1<<1)
|
||||
#define SNDRV_CTL_ELEM_ACCESS_READWRITE (SNDRV_CTL_ELEM_ACCESS_READ|SNDRV_CTL_ELEM_ACCESS_WRITE)
|
||||
#define SNDRV_CTL_ELEM_ACCESS_VOLATILE (1<<2) /* control value may be changed without a notification */
|
||||
#define SNDRV_CTL_ELEM_ACCESS_TIMESTAMP (1<<2) /* when was control changed */
|
||||
#define SNDRV_CTL_ELEM_ACCESS_INACTIVE (1<<8) /* control does actually nothing, but may be updated */
|
||||
#define SNDRV_CTL_ELEM_ACCESS_LOCK (1<<9) /* write lock */
|
||||
#define SNDRV_CTL_ELEM_ACCESS_OWNER (1<<10) /* write lock owner */
|
||||
|
|
@ -743,7 +761,8 @@ struct sndrv_ctl_elem_value {
|
|||
} bytes;
|
||||
struct sndrv_aes_iec958 iec958;
|
||||
} value; /* RO */
|
||||
unsigned char reserved[128];
|
||||
struct timespec timestamp;
|
||||
unsigned char reserved[128-sizeof(struct timespec)];
|
||||
};
|
||||
|
||||
enum {
|
||||
|
|
|
|||
|
|
@ -171,7 +171,7 @@ int snd_timer_status_malloc(snd_timer_status_t **ptr);
|
|||
void snd_timer_status_free(snd_timer_status_t *obj);
|
||||
void snd_timer_status_copy(snd_timer_status_t *dst, const snd_timer_status_t *src);
|
||||
|
||||
struct timeval snd_timer_status_get_timestamp(snd_timer_status_t * status);
|
||||
snd_htimestamp_t snd_timer_status_get_timestamp(snd_timer_status_t * status);
|
||||
long snd_timer_status_get_resolution(snd_timer_status_t * status);
|
||||
long snd_timer_status_get_lost(snd_timer_status_t * status);
|
||||
long snd_timer_status_get_overrun(snd_timer_status_t * status);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue