From: Jaroslav Kysela Date: Sun, 14 Mar 2004 18:37:55 +0000 (+0000) Subject: Initial proposal for simple PCM API extension X-Git-Tag: v1.0.4~13 X-Git-Url: https://git.alsa-project.org/?a=commitdiff_plain;h=894bd9157eb4bc5b6b830e81f8b4b105fa64e329;p=alsa-lib.git Initial proposal for simple PCM API extension --- diff --git a/include/pcm.h b/include/pcm.h index b4d1fc3f..b6d485f2 100644 --- a/include/pcm.h +++ b/include/pcm.h @@ -1213,6 +1213,55 @@ int16_t *snd_pcm_scope_s16_get_channel_buffer(snd_pcm_scope_t *scope, /** \} */ +/** + * \defgroup PCM_Simple Simple setup functions + * \ingroup PCM + * See the \ref pcm page for more details. + * \{ + */ + +/** Simple PCM latency type */ +typedef enum _snd_spcm_latency { + /** standard latency - for standard playback or capture + (estimated latency in one direction 350ms) */ + SND_SPCM_LATENCY_STANDARD = 0, + /** medium latency - software phones etc. + (estimated latency in one direction maximally 25ms */ + SND_SPCM_LATENCY_MEDIUM, + /** realtime latency - realtime applications (effect processors etc.) + (estimated latency in one direction 5ms and better) */ + SND_SPCM_LATENCY_REALTIME +} snd_spcm_latency_t; + +/** Simple PCM xrun type */ +typedef enum _snd_spcm_xrun_type { + /** driver / library will ignore all xruns, the stream runs forever */ + SND_SPCM_XRUN_IGNORE = 0, + /** driver / library stops the stream when an xrun occurs */ + SND_SPCM_XRUN_STOP +} snd_spcm_xrun_type_t; + +int snd_spcm_init(snd_pcm_t *pcm, + unsigned int rate, + unsigned int channels, + snd_pcm_format_t format, + snd_pcm_subformat_t subformat, + snd_spcm_latency_t latency, + snd_pcm_access_t access, + snd_spcm_xrun_type_t xrun_type); + +int snd_spcm_init_duplex(snd_pcm_t *playback_pcm, + snd_pcm_t *capture_pcm, + unsigned int rate, + unsigned int channels, + snd_pcm_format_t format, + snd_pcm_subformat_t subformat, + snd_spcm_latency_t latency, + snd_pcm_access_t access, + snd_spcm_xrun_type_t xrun_type); + +/** \} */ + /** * \defgroup PCM_Deprecated Deprecated Functions * \ingroup PCM