diff options
author | Takashi Iwai <tiwai@suse.de> | 2008-02-01 12:19:25 +0100 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2008-02-01 12:19:25 +0100 |
commit | 0a0af26d1e77dc9a1978d48feb42b53b89016492 (patch) | |
tree | 25f2891f804d29a070b40cbc3d6feb71280e1d84 | |
parent | a476ea116286408f4de9a0057d3cf1a43721066e (diff) | |
download | salsa-lib-0a0af26d1e77dc9a1978d48feb42b53b89016492.tar.gz |
make 1.0.16 compatible
add snd_pcm_htimestamp().
add missing snd_pcm_get_params().
snd_pcm_set_params() is not implemented yet.
-rw-r--r-- | configure.ac | 4 | ||||
-rw-r--r-- | src/asound.h | 5 | ||||
-rw-r--r-- | src/pcm_macros.h | 36 | ||||
-rw-r--r-- | src/pcm_types.h | 11 |
4 files changed, 50 insertions, 6 deletions
diff --git a/configure.ac b/configure.ac index 870b7c6..ae93a2a 100644 --- a/configure.ac +++ b/configure.ac @@ -14,8 +14,8 @@ AC_HEADER_STDC dnl Compatible version AC_ARG_WITH(compat-version, AS_HELP_STRING([--with-compat-version=VERSION], - [specify the compatible version with ALSA-lib (default=1.0.14)]), - compatver="$withval", compatver="1.0.14") + [specify the compatible version with ALSA-lib (default=1.0.16)]), + compatver="$withval", compatver="1.0.16") SND_LIB_VERSION="$compatver" SND_LIB_MAJOR=1 diff --git a/src/asound.h b/src/asound.h index 9b045b9..5b22072 100644 --- a/src/asound.h +++ b/src/asound.h @@ -331,8 +331,9 @@ struct sndrv_pcm_hw_params { enum sndrv_pcm_tstamp { SNDRV_PCM_TSTAMP_NONE = 0, - SNDRV_PCM_TSTAMP_MMAP, - SNDRV_PCM_TSTAMP_LAST = SNDRV_PCM_TSTAMP_MMAP, + SNDRV_PCM_TSTAMP_ENABLE, + SNDRV_PCM_TSTAMP_MMAP = SNDRV_PCM_TSTAMP_ENABLE, + SNDRV_PCM_TSTAMP_LAST = SNDRV_PCM_TSTAMP_ENABLE, }; struct sndrv_pcm_sw_params { diff --git a/src/pcm_macros.h b/src/pcm_macros.h index c8d9a42..51d2402 100644 --- a/src/pcm_macros.h +++ b/src/pcm_macros.h @@ -1976,6 +1976,30 @@ void snd_pcm_info_set_stream(snd_pcm_info_t *obj, snd_pcm_stream_t val) obj->stream = val; } +static inline +int snd_hw_htimestamp(snd_pcm_t *pcm, snd_pcm_uframes_t *avail, + snd_htimestamp_t *tstamp) +{ + *avail = snd_pcm_avail_update(pcm); + *tstamp = pcm->mmap_status->tstamp; + return 0; +} + + +/* + * helper functions + */ +static inline +int snd_pcm_get_params(snd_pcm_t *pcm, + snd_pcm_uframes_t *buffer_size, + snd_pcm_uframes_t *period_size) +{ + if (!pcm->setup) + return -EBADFD; + *buffer_size = pcm->buffer_size; + *period_size = pcm->period_size; + return 0; +} /* * not implemented yet @@ -2017,6 +2041,18 @@ snd_pcm_sframes_t snd_pcm_mmap_readn(snd_pcm_t *pcm, void **bufs, return -ENXIO; } +static inline __SALSA_NOT_IMPLEMENTED +int snd_pcm_set_params(snd_pcm_t *pcm, + snd_pcm_format_t format, + snd_pcm_access_t access, + unsigned int channels, + unsigned int rate, + int soft_resample, + unsigned int latency) +{ + return -ENXIO; +} + #if SALSA_HAS_ASYNC_SUPPORT static inline diff --git a/src/pcm_types.h b/src/pcm_types.h index 4aa72a4..8740160 100644 --- a/src/pcm_types.h +++ b/src/pcm_types.h @@ -254,9 +254,16 @@ typedef unsigned long snd_pcm_uframes_t; typedef long snd_pcm_sframes_t; /** Non blocking mode (flag for open mode) \hideinitializer */ -#define SND_PCM_NONBLOCK 0x0001 +#define SND_PCM_NONBLOCK 0x00000001 /** Async notification (flag for open mode) \hideinitializer */ -#define SND_PCM_ASYNC 0x0002 +#define SND_PCM_ASYNC 0x00000002 +#define SND_PCM_NO_AUTO_RESAMPLE 0x00010000 +/** Disable automatic (but not forced!) channel conversion */ +#define SND_PCM_NO_AUTO_CHANNELS 0x00020000 +/** Disable automatic (but not forced!) format conversion */ +#define SND_PCM_NO_AUTO_FORMAT 0x00040000 +/** Disable soft volume control */ +#define SND_PCM_NO_SOFTVOL 0x00080000 /** PCM type */ enum _snd_pcm_type { |