| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
|
| 23 |
|
| 24 |
|
| 25 |
|
| 26 |
|
| 27 |
|
| 28 |
|
| 29 |
|
| 30 |
|
| 31 |
#ifndef __ALSA_PCM_IOPLUG_H |
| 32 |
#define __ALSA_PCM_IOPLUG_H |
| 33 |
|
| 34 |
|
| 35 |
|
| 36 |
|
| 37 |
|
| 38 |
|
| 39 |
|
| 40 |
|
| 41 |
|
| 42 |
enum { |
| 43 |
SND_PCM_IOPLUG_HW_ACCESS = 0, |
| 44 |
SND_PCM_IOPLUG_HW_FORMAT, |
| 45 |
SND_PCM_IOPLUG_HW_CHANNELS, |
| 46 |
SND_PCM_IOPLUG_HW_RATE, |
| 47 |
SND_PCM_IOPLUG_HW_PERIOD_BYTES, |
| 48 |
SND_PCM_IOPLUG_HW_BUFFER_BYTES, |
| 49 |
SND_PCM_IOPLUG_HW_PERIODS, |
| 50 |
SND_PCM_IOPLUG_HW_PARAMS |
| 51 |
}; |
| 52 |
|
| 53 |
|
| 54 |
typedef struct snd_pcm_ioplug snd_pcm_ioplug_t; |
| 55 |
|
| 56 |
typedef struct snd_pcm_ioplug_callback snd_pcm_ioplug_callback_t; |
| 57 |
#ifdef DOC_HIDDEN |
| 58 |
|
| 59 |
typedef snd_pcm_ioplug snd_pcm_ioplug_t; |
| 60 |
typedef snd_pcm_ioplug_callback snd_pcm_ioplug_callback_t; |
| 61 |
#endif |
| 62 |
|
| 63 |
|
| 64 |
|
| 65 |
|
| 66 |
#define SND_PCM_IOPLUG_FLAG_LISTED (1<<0) |
| 67 |
#define SND_PCM_IOPLUG_FLAG_MONOTONIC (1<<1) |
| 68 |
|
| 69 |
|
| 70 |
|
| 71 |
|
| 72 |
#define SND_PCM_IOPLUG_VERSION_MAJOR 1 |
| 73 |
#define SND_PCM_IOPLUG_VERSION_MINOR 0 |
| 74 |
#define SND_PCM_IOPLUG_VERSION_TINY 2 |
| 75 |
|
| 76 |
|
| 77 |
|
| 78 |
#define SND_PCM_IOPLUG_VERSION ((SND_PCM_IOPLUG_VERSION_MAJOR<<16) |\ |
| 79 |
(SND_PCM_IOPLUG_VERSION_MINOR<<8) |\ |
| 80 |
(SND_PCM_IOPLUG_VERSION_TINY)) |
| 81 |
|
| 82 |
|
| 83 |
struct snd_pcm_ioplug { |
| 84 |
|
| 85 |
|
| 86 |
|
| 87 |
|
| 88 |
unsigned int version; |
| 89 |
|
| 90 |
|
| 91 |
|
| 92 |
const char *name; |
| 93 |
unsigned int flags; |
| 94 |
int poll_fd; |
| 95 |
unsigned int poll_events; |
| 96 |
unsigned int mmap_rw; |
| 97 |
|
| 98 |
|
| 99 |
|
| 100 |
const snd_pcm_ioplug_callback_t *callback; |
| 101 |
|
| 102 |
|
| 103 |
|
| 104 |
void *private_data; |
| 105 |
|
| 106 |
|
| 107 |
|
| 108 |
snd_pcm_t *pcm; |
| 109 |
|
| 110 |
snd_pcm_stream_t stream; |
| 111 |
snd_pcm_state_t state; |
| 112 |
volatile snd_pcm_uframes_t appl_ptr; |
| 113 |
volatile snd_pcm_uframes_t hw_ptr; |
| 114 |
int nonblock; |
| 115 |
|
| 116 |
snd_pcm_access_t access; |
| 117 |
snd_pcm_format_t format; |
| 118 |
unsigned int channels; |
| 119 |
unsigned int rate; |
| 120 |
snd_pcm_uframes_t period_size; |
| 121 |
snd_pcm_uframes_t buffer_size; |
| 122 |
}; |
| 123 |
|
| 124 |
|
| 125 |
struct snd_pcm_ioplug_callback { |
| 126 |
|
| 127 |
|
| 128 |
|
| 129 |
int (*start)(snd_pcm_ioplug_t *io); |
| 130 |
|
| 131 |
|
| 132 |
|
| 133 |
int (*stop)(snd_pcm_ioplug_t *io); |
| 134 |
|
| 135 |
|
| 136 |
|
| 137 |
snd_pcm_sframes_t (*pointer)(snd_pcm_ioplug_t *io); |
| 138 |
|
| 139 |
|
| 140 |
|
| 141 |
snd_pcm_sframes_t (*transfer)(snd_pcm_ioplug_t *io, |
| 142 |
const snd_pcm_channel_area_t *areas, |
| 143 |
snd_pcm_uframes_t offset, |
| 144 |
snd_pcm_uframes_t size); |
| 145 |
|
| 146 |
|
| 147 |
|
| 148 |
int (*close)(snd_pcm_ioplug_t *io); |
| 149 |
|
| 150 |
|
| 151 |
|
| 152 |
int (*hw_params)(snd_pcm_ioplug_t *io, snd_pcm_hw_params_t *params); |
| 153 |
|
| 154 |
|
| 155 |
|
| 156 |
int (*hw_free)(snd_pcm_ioplug_t *io); |
| 157 |
|
| 158 |
|
| 159 |
|
| 160 |
int (*sw_params)(snd_pcm_ioplug_t *io, snd_pcm_sw_params_t *params); |
| 161 |
|
| 162 |
|
| 163 |
|
| 164 |
int (*prepare)(snd_pcm_ioplug_t *io); |
| 165 |
|
| 166 |
|
| 167 |
|
| 168 |
int (*drain)(snd_pcm_ioplug_t *io); |
| 169 |
|
| 170 |
|
| 171 |
|
| 172 |
int (*pause)(snd_pcm_ioplug_t *io, int enable); |
| 173 |
|
| 174 |
|
| 175 |
|
| 176 |
int (*resume)(snd_pcm_ioplug_t *io); |
| 177 |
|
| 178 |
|
| 179 |
|
| 180 |
int (*poll_descriptors_count)(snd_pcm_ioplug_t *io); |
| 181 |
|
| 182 |
|
| 183 |
|
| 184 |
int (*poll_descriptors)(snd_pcm_ioplug_t *io, struct pollfd *pfd, unsigned int space); |
| 185 |
|
| 186 |
|
| 187 |
|
| 188 |
int (*poll_revents)(snd_pcm_ioplug_t *io, struct pollfd *pfd, unsigned int nfds, unsigned short *revents); |
| 189 |
|
| 190 |
|
| 191 |
|
| 192 |
void (*dump)(snd_pcm_ioplug_t *io, snd_output_t *out); |
| 193 |
|
| 194 |
|
| 195 |
|
| 196 |
int (*delay)(snd_pcm_ioplug_t *io, snd_pcm_sframes_t *delayp); |
| 197 |
|
| 198 |
|
| 199 |
|
| 200 |
snd_pcm_chmap_query_t **(*query_chmaps)(snd_pcm_ioplug_t *io); |
| 201 |
|
| 202 |
|
| 203 |
|
| 204 |
snd_pcm_chmap_t *(*get_chmap)(snd_pcm_ioplug_t *io); |
| 205 |
|
| 206 |
|
| 207 |
|
| 208 |
int (*set_chmap)(snd_pcm_ioplug_t *io, const snd_pcm_chmap_t *map); |
| 209 |
}; |
| 210 |
|
| 211 |
|
| 212 |
int snd_pcm_ioplug_create(snd_pcm_ioplug_t *io, const char *name, |
| 213 |
snd_pcm_stream_t stream, int mode); |
| 214 |
int snd_pcm_ioplug_delete(snd_pcm_ioplug_t *io); |
| 215 |
|
| 216 |
|
| 217 |
int snd_pcm_ioplug_reinit_status(snd_pcm_ioplug_t *ioplug); |
| 218 |
|
| 219 |
|
| 220 |
const snd_pcm_channel_area_t *snd_pcm_ioplug_mmap_areas(snd_pcm_ioplug_t *ioplug); |
| 221 |
|
| 222 |
|
| 223 |
void snd_pcm_ioplug_params_reset(snd_pcm_ioplug_t *io); |
| 224 |
|
| 225 |
|
| 226 |
int snd_pcm_ioplug_set_param_minmax(snd_pcm_ioplug_t *io, int type, unsigned int min, unsigned int max); |
| 227 |
int snd_pcm_ioplug_set_param_list(snd_pcm_ioplug_t *io, int type, unsigned int num_list, const unsigned int *list); |
| 228 |
|
| 229 |
|
| 230 |
int snd_pcm_ioplug_set_state(snd_pcm_ioplug_t *ioplug, snd_pcm_state_t state); |
| 231 |
|
| 232 |
|
| 233 |
|
| 234 |
#endif |