mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2025-10-29 05:40:25 -04:00
New PCM model with fragment concept removal and two interrupt sources
Renamed size_t/ssize_t to snd_pcm_sframes_t/snd_pcm_uframes_t
This commit is contained in:
parent
7b06e6f762
commit
cc90e32557
29 changed files with 2433 additions and 1906 deletions
171
include/pcm.h
171
include/pcm.h
|
|
@ -47,8 +47,8 @@ int snd_pcm_open(snd_pcm_t **pcm, char *name,
|
|||
/* Obsolete functions */
|
||||
#define snd_pcm_write snd_pcm_writei
|
||||
#define snd_pcm_read snd_pcm_readi
|
||||
ssize_t snd_pcm_writev(snd_pcm_t *pcm, const struct iovec *vector, int count);
|
||||
ssize_t snd_pcm_readv(snd_pcm_t *pcm, const struct iovec *vector, int count);
|
||||
snd_pcm_sframes_t snd_pcm_writev(snd_pcm_t *pcm, const struct iovec *vector, int count);
|
||||
snd_pcm_sframes_t snd_pcm_readv(snd_pcm_t *pcm, const struct iovec *vector, int count);
|
||||
|
||||
|
||||
snd_pcm_type_t snd_pcm_type(snd_pcm_t *pcm);
|
||||
|
|
@ -69,12 +69,12 @@ int snd_pcm_drop(snd_pcm_t *pcm);
|
|||
int snd_pcm_drain(snd_pcm_t *pcm);
|
||||
int snd_pcm_pause(snd_pcm_t *pcm, int enable);
|
||||
int snd_pcm_state(snd_pcm_t *pcm);
|
||||
int snd_pcm_delay(snd_pcm_t *pcm, ssize_t *delayp);
|
||||
ssize_t snd_pcm_rewind(snd_pcm_t *pcm, size_t frames);
|
||||
ssize_t snd_pcm_writei(snd_pcm_t *pcm, const void *buffer, size_t size);
|
||||
ssize_t snd_pcm_readi(snd_pcm_t *pcm, void *buffer, size_t size);
|
||||
ssize_t snd_pcm_writen(snd_pcm_t *pcm, void **bufs, size_t size);
|
||||
ssize_t snd_pcm_readn(snd_pcm_t *pcm, void **bufs, size_t size);
|
||||
int snd_pcm_delay(snd_pcm_t *pcm, snd_pcm_sframes_t *delayp);
|
||||
snd_pcm_sframes_t snd_pcm_rewind(snd_pcm_t *pcm, snd_pcm_uframes_t frames);
|
||||
snd_pcm_sframes_t snd_pcm_writei(snd_pcm_t *pcm, const void *buffer, snd_pcm_uframes_t size);
|
||||
snd_pcm_sframes_t snd_pcm_readi(snd_pcm_t *pcm, void *buffer, snd_pcm_uframes_t size);
|
||||
snd_pcm_sframes_t snd_pcm_writen(snd_pcm_t *pcm, void **bufs, snd_pcm_uframes_t size);
|
||||
snd_pcm_sframes_t snd_pcm_readn(snd_pcm_t *pcm, void **bufs, snd_pcm_uframes_t size);
|
||||
|
||||
int snd_pcm_dump_hw_setup(snd_pcm_t *pcm, FILE *fp);
|
||||
int snd_pcm_dump_sw_setup(snd_pcm_t *pcm, FILE *fp);
|
||||
|
|
@ -85,13 +85,13 @@ int snd_pcm_link(snd_pcm_t *pcm1, snd_pcm_t *pcm2);
|
|||
int snd_pcm_unlink(snd_pcm_t *pcm);
|
||||
|
||||
int snd_pcm_wait(snd_pcm_t *pcm, int timeout);
|
||||
ssize_t snd_pcm_avail_update(snd_pcm_t *pcm);
|
||||
int snd_pcm_set_avail_min(snd_pcm_t *pcm, size_t size);
|
||||
snd_pcm_sframes_t snd_pcm_avail_update(snd_pcm_t *pcm);
|
||||
int snd_pcm_set_avail_min(snd_pcm_t *pcm, snd_pcm_uframes_t size);
|
||||
|
||||
typedef struct _mask mask_t;
|
||||
size_t mask_sizeof();
|
||||
void mask_none(mask_t *mask);
|
||||
void mask_all(mask_t *mask);
|
||||
void mask_any(mask_t *mask);
|
||||
void mask_load(mask_t *mask, unsigned int msk);
|
||||
int mask_empty(const mask_t *mask);
|
||||
void mask_set(mask_t *mask, unsigned int val);
|
||||
|
|
@ -99,48 +99,59 @@ void mask_reset(mask_t *mask, unsigned int val);
|
|||
void mask_copy(mask_t *mask, const mask_t *v);
|
||||
int mask_test(const mask_t *mask, unsigned int val);
|
||||
void mask_intersect(mask_t *mask, const mask_t *v);
|
||||
void mask_union(mask_t *mask, const mask_t *v);
|
||||
int mask_eq(const mask_t *a, const mask_t *b);
|
||||
int mask_single(const mask_t *mask);
|
||||
|
||||
int snd_pcm_hw_params_any(snd_pcm_t *pcm, snd_pcm_hw_params_t *params);
|
||||
int snd_pcm_hw_param_any(snd_pcm_t *pcm, snd_pcm_hw_params_t *params,
|
||||
unsigned int var);
|
||||
snd_pcm_hw_param_t var);
|
||||
int snd_pcm_hw_param_setinteger(snd_pcm_t *pcm, snd_pcm_hw_params_t *params,
|
||||
snd_pcm_hw_param_t var);
|
||||
int snd_pcm_hw_param_first(snd_pcm_t *pcm, snd_pcm_hw_params_t *params,
|
||||
unsigned int par);
|
||||
snd_pcm_hw_param_t var, int *dir);
|
||||
int snd_pcm_hw_param_last(snd_pcm_t *pcm, snd_pcm_hw_params_t *params,
|
||||
unsigned int par);
|
||||
snd_pcm_hw_param_t var, int *dir);
|
||||
int snd_pcm_hw_param_near(snd_pcm_t *pcm, snd_pcm_hw_params_t *params,
|
||||
unsigned int var, unsigned int val);
|
||||
snd_pcm_hw_param_t var, unsigned int val,
|
||||
int *dir);
|
||||
int snd_pcm_hw_param_min(snd_pcm_t *pcm, snd_pcm_hw_params_t *params,
|
||||
unsigned int var, unsigned int val);
|
||||
snd_pcm_hw_param_t var,
|
||||
unsigned int val, int *dir);
|
||||
int snd_pcm_hw_param_max(snd_pcm_t *pcm, snd_pcm_hw_params_t *params,
|
||||
unsigned int var, unsigned int val);
|
||||
snd_pcm_hw_param_t var, unsigned int val, int *dir);
|
||||
int snd_pcm_hw_param_minmax(snd_pcm_t *pcm, snd_pcm_hw_params_t *params,
|
||||
unsigned int var, unsigned int min, unsigned int max);
|
||||
snd_pcm_hw_param_t var,
|
||||
unsigned int *min, int *mindir,
|
||||
unsigned int *max, int *maxdir);
|
||||
int snd_pcm_hw_param_set(snd_pcm_t *pcm, snd_pcm_hw_params_t *params,
|
||||
unsigned int var, unsigned int val);
|
||||
snd_pcm_hw_param_t var, unsigned int val, int dir);
|
||||
int snd_pcm_hw_param_mask(snd_pcm_t *pcm, snd_pcm_hw_params_t *params,
|
||||
unsigned int var, const mask_t *mask);
|
||||
snd_pcm_hw_param_t var, const mask_t *mask);
|
||||
int snd_pcm_hw_param_min_try(snd_pcm_t *pcm, snd_pcm_hw_params_t *params,
|
||||
unsigned int var, unsigned int val);
|
||||
snd_pcm_hw_param_t var,
|
||||
unsigned int val, int *dir);
|
||||
int snd_pcm_hw_param_max_try(snd_pcm_t *pcm, snd_pcm_hw_params_t *params,
|
||||
unsigned int var, unsigned int val);
|
||||
snd_pcm_hw_param_t var,
|
||||
unsigned int val, int *dir);
|
||||
int snd_pcm_hw_param_minmax_try(snd_pcm_t *pcm, snd_pcm_hw_params_t *params,
|
||||
unsigned int var, unsigned int min, unsigned int max);
|
||||
snd_pcm_hw_param_t var,
|
||||
unsigned int *min, int *mindir,
|
||||
unsigned int *max, int *maxdir);
|
||||
int snd_pcm_hw_param_set_try(snd_pcm_t *pcm, snd_pcm_hw_params_t *params,
|
||||
unsigned int var, unsigned int val);
|
||||
snd_pcm_hw_param_t var, unsigned int val, int dir);
|
||||
int snd_pcm_hw_param_mask_try(snd_pcm_t *pcm, snd_pcm_hw_params_t *params,
|
||||
unsigned int var, const mask_t *mask);
|
||||
snd_pcm_hw_param_t var, const mask_t *mask);
|
||||
int snd_pcm_hw_param_value(const snd_pcm_hw_params_t *params,
|
||||
unsigned int var);
|
||||
snd_pcm_hw_param_t var, int *dir);
|
||||
const mask_t *snd_pcm_hw_param_value_mask(const snd_pcm_hw_params_t *params,
|
||||
unsigned int var);
|
||||
snd_pcm_hw_param_t var);
|
||||
const interval_t *snd_pcm_hw_param_value_interval(const snd_pcm_hw_params_t *params,
|
||||
unsigned int var);
|
||||
snd_pcm_hw_param_t var);
|
||||
unsigned int snd_pcm_hw_param_value_min(const snd_pcm_hw_params_t *params,
|
||||
unsigned int var);
|
||||
snd_pcm_hw_param_t var, int *dir);
|
||||
unsigned int snd_pcm_hw_param_value_max(const snd_pcm_hw_params_t *params,
|
||||
unsigned int var);
|
||||
snd_pcm_hw_param_t var, int *dir);
|
||||
int snd_pcm_hw_params_try_explain_failure(snd_pcm_t *pcm,
|
||||
snd_pcm_hw_params_t *fail,
|
||||
snd_pcm_hw_params_t *success,
|
||||
|
|
@ -174,73 +185,73 @@ int snd_pcm_hw_strategy_simple(snd_pcm_hw_strategy_t **strategyp,
|
|||
unsigned int badness_min,
|
||||
unsigned int badness_max);
|
||||
int snd_pcm_hw_strategy_simple_near(snd_pcm_hw_strategy_t *strategy, int order,
|
||||
unsigned int param,
|
||||
snd_pcm_hw_param_t var,
|
||||
unsigned int best,
|
||||
unsigned int mul);
|
||||
int snd_pcm_hw_strategy_simple_choices(snd_pcm_hw_strategy_t *strategy, int order,
|
||||
unsigned int param,
|
||||
snd_pcm_hw_param_t var,
|
||||
unsigned int count,
|
||||
snd_pcm_hw_strategy_simple_choices_list_t *choices);
|
||||
|
||||
#define SND_PCM_SW_PARAM_START_MODE 0
|
||||
#define SND_PCM_SW_PARAM_READY_MODE 1
|
||||
#define SND_PCM_SW_PARAM_XRUN_MODE 2
|
||||
#define SND_PCM_SW_PARAM_SILENCE_MODE 3
|
||||
#define SND_PCM_SW_PARAM_TSTAMP_MODE 4
|
||||
#define SND_PCM_SW_PARAM_AVAIL_MIN 5
|
||||
#define SND_PCM_SW_PARAM_XFER_ALIGN 6
|
||||
#define SND_PCM_SW_PARAM_SILENCE_THRESHOLD 7
|
||||
#define SND_PCM_SW_PARAM_SILENCE_SIZE 8
|
||||
#define SND_PCM_SW_PARAM_LAST 8
|
||||
typedef enum _snd_pcm_sw_param {
|
||||
SND_PCM_SW_PARAM_START_MODE,
|
||||
SND_PCM_SW_PARAM_XRUN_MODE,
|
||||
SND_PCM_SW_PARAM_TSTAMP_MODE,
|
||||
SND_PCM_SW_PARAM_PERIOD_STEP,
|
||||
SND_PCM_SW_PARAM_SLEEP_MIN,
|
||||
SND_PCM_SW_PARAM_AVAIL_MIN,
|
||||
SND_PCM_SW_PARAM_XFER_ALIGN,
|
||||
SND_PCM_SW_PARAM_SILENCE_THRESHOLD,
|
||||
SND_PCM_SW_PARAM_SILENCE_SIZE,
|
||||
SND_PCM_SW_PARAM_LAST = SND_PCM_SW_PARAM_SILENCE_SIZE,
|
||||
} snd_pcm_sw_param_t;
|
||||
|
||||
int snd_pcm_sw_params_current(snd_pcm_t *pcm, snd_pcm_sw_params_t *params);
|
||||
int snd_pcm_sw_param_set(snd_pcm_t *pcm, snd_pcm_sw_params_t *params, unsigned int var, unsigned int val);
|
||||
int snd_pcm_sw_param_near(snd_pcm_t *pcm, snd_pcm_sw_params_t *params, unsigned int var, unsigned int val);
|
||||
int snd_pcm_sw_param_value(snd_pcm_sw_params_t *params, unsigned int var);
|
||||
int snd_pcm_sw_param_set(snd_pcm_t *pcm, snd_pcm_sw_params_t *params, snd_pcm_sw_param_t var, unsigned int val);
|
||||
int snd_pcm_sw_param_near(snd_pcm_t *pcm, snd_pcm_sw_params_t *params, snd_pcm_sw_param_t var, unsigned int val);
|
||||
int snd_pcm_sw_param_value(snd_pcm_sw_params_t *params, snd_pcm_sw_param_t var);
|
||||
int snd_pcm_sw_params_dump(snd_pcm_sw_params_t *params, FILE *fp);
|
||||
|
||||
/* mmap */
|
||||
const snd_pcm_channel_area_t *snd_pcm_mmap_areas(snd_pcm_t *pcm);
|
||||
const snd_pcm_channel_area_t *snd_pcm_mmap_running_areas(snd_pcm_t *pcm);
|
||||
const snd_pcm_channel_area_t *snd_pcm_mmap_stopped_areas(snd_pcm_t *pcm);
|
||||
ssize_t snd_pcm_mmap_forward(snd_pcm_t *pcm, size_t size);
|
||||
size_t snd_pcm_mmap_offset(snd_pcm_t *pcm);
|
||||
size_t snd_pcm_mmap_xfer(snd_pcm_t *pcm, size_t size);
|
||||
ssize_t snd_pcm_mmap_writei(snd_pcm_t *pcm, const void *buffer, size_t size);
|
||||
ssize_t snd_pcm_mmap_readi(snd_pcm_t *pcm, void *buffer, size_t size);
|
||||
ssize_t snd_pcm_mmap_writen(snd_pcm_t *pcm, void **bufs, size_t size);
|
||||
ssize_t snd_pcm_mmap_readn(snd_pcm_t *pcm, void **bufs, size_t size);
|
||||
snd_pcm_sframes_t snd_pcm_mmap_forward(snd_pcm_t *pcm, snd_pcm_uframes_t size);
|
||||
snd_pcm_uframes_t snd_pcm_mmap_offset(snd_pcm_t *pcm);
|
||||
snd_pcm_uframes_t snd_pcm_mmap_xfer(snd_pcm_t *pcm, snd_pcm_uframes_t size);
|
||||
snd_pcm_sframes_t snd_pcm_mmap_writei(snd_pcm_t *pcm, const void *buffer, snd_pcm_uframes_t size);
|
||||
snd_pcm_sframes_t snd_pcm_mmap_readi(snd_pcm_t *pcm, void *buffer, snd_pcm_uframes_t size);
|
||||
snd_pcm_sframes_t snd_pcm_mmap_writen(snd_pcm_t *pcm, void **bufs, snd_pcm_uframes_t size);
|
||||
snd_pcm_sframes_t snd_pcm_mmap_readn(snd_pcm_t *pcm, void **bufs, snd_pcm_uframes_t size);
|
||||
|
||||
const char *snd_pcm_stream_name(unsigned int stream);
|
||||
const char *snd_pcm_hw_param_name(unsigned int params);
|
||||
const char *snd_pcm_sw_param_name(unsigned int params);
|
||||
const char *snd_pcm_access_name(unsigned int access);
|
||||
const char *snd_pcm_format_name(unsigned int format);
|
||||
const char *snd_pcm_subformat_name(unsigned int subformat);
|
||||
const char *snd_pcm_format_description(unsigned int format);
|
||||
const char *snd_pcm_stream_name(snd_pcm_stream_t stream);
|
||||
const char *snd_pcm_hw_param_name(snd_pcm_hw_param_t var);
|
||||
const char *snd_pcm_sw_param_name(snd_pcm_sw_param_t var);
|
||||
const char *snd_pcm_access_name(snd_pcm_access_t access);
|
||||
const char *snd_pcm_format_name(snd_pcm_format_t format);
|
||||
const char *snd_pcm_subformat_name(snd_pcm_subformat_t subformat);
|
||||
const char *snd_pcm_format_description(snd_pcm_format_t format);
|
||||
int snd_pcm_format_value(const char* name);
|
||||
const char *snd_pcm_start_mode_name(unsigned int mode);
|
||||
const char *snd_pcm_ready_mode_name(unsigned int mode);
|
||||
const char *snd_pcm_xrun_mode_name(unsigned int mode);
|
||||
const char *snd_pcm_silence_mode_name(unsigned int mode);
|
||||
const char *snd_pcm_tstamp_mode_name(unsigned int mode);
|
||||
const char *snd_pcm_state_name(unsigned int state);
|
||||
const char *snd_pcm_start_mode_name(snd_pcm_start_t mode);
|
||||
const char *snd_pcm_xrun_mode_name(snd_pcm_xrun_t mode);
|
||||
const char *snd_pcm_tstamp_mode_name(snd_pcm_tstamp_t mode);
|
||||
const char *snd_pcm_state_name(snd_pcm_state_t state);
|
||||
|
||||
int snd_pcm_area_silence(const snd_pcm_channel_area_t *dst_channel, size_t dst_offset,
|
||||
size_t samples, int format);
|
||||
int snd_pcm_areas_silence(const snd_pcm_channel_area_t *dst_channels, size_t dst_offset,
|
||||
size_t vcount, size_t frames, int format);
|
||||
int snd_pcm_area_copy(const snd_pcm_channel_area_t *src_channel, size_t src_offset,
|
||||
const snd_pcm_channel_area_t *dst_channel, size_t dst_offset,
|
||||
size_t samples, int format);
|
||||
int snd_pcm_areas_copy(const snd_pcm_channel_area_t *src_channels, size_t src_offset,
|
||||
const snd_pcm_channel_area_t *dst_channels, size_t dst_offset,
|
||||
size_t channels, size_t frames, int format);
|
||||
int snd_pcm_area_silence(const snd_pcm_channel_area_t *dst_channel, snd_pcm_uframes_t dst_offset,
|
||||
unsigned int samples, int format);
|
||||
int snd_pcm_areas_silence(const snd_pcm_channel_area_t *dst_channels, snd_pcm_uframes_t dst_offset,
|
||||
unsigned int channels, snd_pcm_uframes_t frames, int format);
|
||||
int snd_pcm_area_copy(const snd_pcm_channel_area_t *src_channel, snd_pcm_uframes_t src_offset,
|
||||
const snd_pcm_channel_area_t *dst_channel, snd_pcm_uframes_t dst_offset,
|
||||
unsigned int samples, int format);
|
||||
int snd_pcm_areas_copy(const snd_pcm_channel_area_t *src_channels, snd_pcm_uframes_t src_offset,
|
||||
const snd_pcm_channel_area_t *dst_channels, snd_pcm_uframes_t dst_offset,
|
||||
unsigned int channels, snd_pcm_uframes_t frames, int format);
|
||||
|
||||
ssize_t snd_pcm_bytes_to_frames(snd_pcm_t *pcm, ssize_t bytes);
|
||||
ssize_t snd_pcm_frames_to_bytes(snd_pcm_t *pcm, ssize_t frames);
|
||||
ssize_t snd_pcm_bytes_to_samples(snd_pcm_t *pcm, ssize_t bytes);
|
||||
ssize_t snd_pcm_samples_to_bytes(snd_pcm_t *pcm, ssize_t samples);
|
||||
snd_pcm_sframes_t snd_pcm_bytes_to_frames(snd_pcm_t *pcm, ssize_t bytes);
|
||||
ssize_t snd_pcm_frames_to_bytes(snd_pcm_t *pcm, snd_pcm_sframes_t frames);
|
||||
int snd_pcm_bytes_to_samples(snd_pcm_t *pcm, ssize_t bytes);
|
||||
ssize_t snd_pcm_samples_to_bytes(snd_pcm_t *pcm, int samples);
|
||||
|
||||
|
||||
/* misc */
|
||||
|
|
@ -259,7 +270,7 @@ u_int8_t snd_pcm_format_silence(int format);
|
|||
u_int16_t snd_pcm_format_silence_16(int format);
|
||||
u_int32_t snd_pcm_format_silence_32(int format);
|
||||
u_int64_t snd_pcm_format_silence_64(int format);
|
||||
ssize_t snd_pcm_format_set_silence(int format, void *buf, size_t count);
|
||||
int snd_pcm_format_set_silence(int format, void *buf, unsigned int samples);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue