| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| #ifndef __ALSA_PCM_IOPLUG_H |
| #define __ALSA_PCM_IOPLUG_H |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| enum { |
| SND_PCM_IOPLUG_HW_ACCESS = 0, |
| SND_PCM_IOPLUG_HW_FORMAT, |
| SND_PCM_IOPLUG_HW_CHANNELS, |
| SND_PCM_IOPLUG_HW_RATE, |
| SND_PCM_IOPLUG_HW_PERIOD_BYTES, |
| SND_PCM_IOPLUG_HW_BUFFER_BYTES, |
| SND_PCM_IOPLUG_HW_PERIODS, |
| SND_PCM_IOPLUG_HW_PARAMS |
| }; |
| |
| |
| typedef struct snd_pcm_ioplug snd_pcm_ioplug_t; |
| |
| typedef struct snd_pcm_ioplug_callback snd_pcm_ioplug_callback_t; |
| #ifdef DOC_HIDDEN |
| |
| typedef snd_pcm_ioplug snd_pcm_ioplug_t; |
| typedef snd_pcm_ioplug_callback snd_pcm_ioplug_callback_t; |
| #endif |
| |
| |
| |
| |
| #define SND_PCM_IOPLUG_FLAG_LISTED (1<<0) |
| #define SND_PCM_IOPLUG_FLAG_MONOTONIC (1<<1) |
| |
| #define SND_PCM_IOPLUG_FLAG_BOUNDARY_WA (1<<2) |
| |
| |
| |
| |
| #define SND_PCM_IOPLUG_VERSION_MAJOR 1 |
| #define SND_PCM_IOPLUG_VERSION_MINOR 0 |
| #define SND_PCM_IOPLUG_VERSION_TINY 2 |
| |
| |
| |
| #define SND_PCM_IOPLUG_VERSION ((SND_PCM_IOPLUG_VERSION_MAJOR<<16) |\ |
| (SND_PCM_IOPLUG_VERSION_MINOR<<8) |\ |
| (SND_PCM_IOPLUG_VERSION_TINY)) |
| |
| |
| struct snd_pcm_ioplug { |
| |
| |
| |
| |
| unsigned int version; |
| |
| |
| |
| const char *name; |
| unsigned int flags; |
| int poll_fd; |
| unsigned int poll_events; |
| unsigned int mmap_rw; |
| |
| |
| |
| const snd_pcm_ioplug_callback_t *callback; |
| |
| |
| |
| void *private_data; |
| |
| |
| |
| snd_pcm_t *pcm; |
| |
| snd_pcm_stream_t stream; |
| snd_pcm_state_t state; |
| volatile snd_pcm_uframes_t appl_ptr; |
| volatile snd_pcm_uframes_t hw_ptr; |
| int nonblock; |
| |
| snd_pcm_access_t access; |
| snd_pcm_format_t format; |
| unsigned int channels; |
| unsigned int rate; |
| snd_pcm_uframes_t period_size; |
| snd_pcm_uframes_t buffer_size; |
| }; |
| |
| |
| struct snd_pcm_ioplug_callback { |
| |
| |
| |
| int (*start)(snd_pcm_ioplug_t *io); |
| |
| |
| |
| int (*stop)(snd_pcm_ioplug_t *io); |
| |
| |
| |
| |
| |
| |
| snd_pcm_sframes_t (*pointer)(snd_pcm_ioplug_t *io); |
| |
| |
| |
| snd_pcm_sframes_t (*transfer)(snd_pcm_ioplug_t *io, |
| const snd_pcm_channel_area_t *areas, |
| snd_pcm_uframes_t offset, |
| snd_pcm_uframes_t size); |
| |
| |
| |
| int (*close)(snd_pcm_ioplug_t *io); |
| |
| |
| |
| int (*hw_params)(snd_pcm_ioplug_t *io, snd_pcm_hw_params_t *params); |
| |
| |
| |
| int (*hw_free)(snd_pcm_ioplug_t *io); |
| |
| |
| |
| int (*sw_params)(snd_pcm_ioplug_t *io, snd_pcm_sw_params_t *params); |
| |
| |
| |
| int (*prepare)(snd_pcm_ioplug_t *io); |
| |
| |
| |
| int (*drain)(snd_pcm_ioplug_t *io); |
| |
| |
| |
| int (*pause)(snd_pcm_ioplug_t *io, int enable); |
| |
| |
| |
| int (*resume)(snd_pcm_ioplug_t *io); |
| |
| |
| |
| int (*poll_descriptors_count)(snd_pcm_ioplug_t *io); |
| |
| |
| |
| int (*poll_descriptors)(snd_pcm_ioplug_t *io, struct pollfd *pfd, unsigned int space); |
| |
| |
| |
| int (*poll_revents)(snd_pcm_ioplug_t *io, struct pollfd *pfd, unsigned int nfds, unsigned short *revents); |
| |
| |
| |
| void (*dump)(snd_pcm_ioplug_t *io, snd_output_t *out); |
| |
| |
| |
| int (*delay)(snd_pcm_ioplug_t *io, snd_pcm_sframes_t *delayp); |
| |
| |
| |
| snd_pcm_chmap_query_t **(*query_chmaps)(snd_pcm_ioplug_t *io); |
| |
| |
| |
| snd_pcm_chmap_t *(*get_chmap)(snd_pcm_ioplug_t *io); |
| |
| |
| |
| int (*set_chmap)(snd_pcm_ioplug_t *io, const snd_pcm_chmap_t *map); |
| }; |
| |
| |
| int snd_pcm_ioplug_create(snd_pcm_ioplug_t *io, const char *name, |
| snd_pcm_stream_t stream, int mode); |
| int snd_pcm_ioplug_delete(snd_pcm_ioplug_t *io); |
| |
| |
| int snd_pcm_ioplug_reinit_status(snd_pcm_ioplug_t *ioplug); |
| |
| |
| const snd_pcm_channel_area_t *snd_pcm_ioplug_mmap_areas(snd_pcm_ioplug_t *ioplug); |
| |
| |
| void snd_pcm_ioplug_params_reset(snd_pcm_ioplug_t *io); |
| |
| |
| int snd_pcm_ioplug_set_param_minmax(snd_pcm_ioplug_t *io, int type, unsigned int min, unsigned int max); |
| int snd_pcm_ioplug_set_param_list(snd_pcm_ioplug_t *io, int type, unsigned int num_list, const unsigned int *list); |
| |
| |
| int snd_pcm_ioplug_set_state(snd_pcm_ioplug_t *ioplug, snd_pcm_state_t state); |
| |
| |
| snd_pcm_uframes_t snd_pcm_ioplug_avail(const snd_pcm_ioplug_t * const ioplug, |
| const snd_pcm_uframes_t hw_ptr, |
| const snd_pcm_uframes_t appl_ptr); |
| snd_pcm_uframes_t snd_pcm_ioplug_hw_avail(const snd_pcm_ioplug_t * const ioplug, |
| const snd_pcm_uframes_t hw_ptr, |
| const snd_pcm_uframes_t appl_ptr); |
| |
| |
| |
| #endif |