| 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_EXTPLUG_H |
| 32 |
#define __ALSA_PCM_EXTPLUG_H |
| 33 |
|
| 34 |
|
| 35 |
|
| 36 |
|
| 37 |
|
| 38 |
|
| 39 |
|
| 40 |
|
| 41 |
|
| 42 |
enum { |
| 43 |
SND_PCM_EXTPLUG_HW_FORMAT, |
| 44 |
SND_PCM_EXTPLUG_HW_CHANNELS, |
| 45 |
SND_PCM_EXTPLUG_HW_PARAMS |
| 46 |
}; |
| 47 |
|
| 48 |
|
| 49 |
typedef struct snd_pcm_extplug snd_pcm_extplug_t; |
| 50 |
|
| 51 |
typedef struct snd_pcm_extplug_callback snd_pcm_extplug_callback_t; |
| 52 |
#ifdef DOC_HIDDEN |
| 53 |
|
| 54 |
typedef snd_pcm_extplug snd_pcm_extplug_t; |
| 55 |
typedef snd_pcm_extplug_callback snd_pcm_extplug_callback_t; |
| 56 |
#endif |
| 57 |
|
| 58 |
|
| 59 |
|
| 60 |
|
| 61 |
#define SND_PCM_EXTPLUG_VERSION_MAJOR 1 |
| 62 |
#define SND_PCM_EXTPLUG_VERSION_MINOR 0 |
| 63 |
#define SND_PCM_EXTPLUG_VERSION_TINY 2 |
| 64 |
|
| 65 |
|
| 66 |
|
| 67 |
#define SND_PCM_EXTPLUG_VERSION ((SND_PCM_EXTPLUG_VERSION_MAJOR<<16) |\ |
| 68 |
(SND_PCM_EXTPLUG_VERSION_MINOR<<8) |\ |
| 69 |
(SND_PCM_EXTPLUG_VERSION_TINY)) |
| 70 |
|
| 71 |
|
| 72 |
struct snd_pcm_extplug { |
| 73 |
|
| 74 |
|
| 75 |
|
| 76 |
|
| 77 |
unsigned int version; |
| 78 |
|
| 79 |
|
| 80 |
|
| 81 |
const char *name; |
| 82 |
|
| 83 |
|
| 84 |
|
| 85 |
const snd_pcm_extplug_callback_t *callback; |
| 86 |
|
| 87 |
|
| 88 |
|
| 89 |
void *private_data; |
| 90 |
|
| 91 |
|
| 92 |
|
| 93 |
snd_pcm_t *pcm; |
| 94 |
|
| 95 |
|
| 96 |
|
| 97 |
snd_pcm_stream_t stream; |
| 98 |
|
| 99 |
|
| 100 |
|
| 101 |
snd_pcm_format_t format; |
| 102 |
|
| 103 |
|
| 104 |
|
| 105 |
snd_pcm_subformat_t subformat; |
| 106 |
|
| 107 |
|
| 108 |
|
| 109 |
unsigned int channels; |
| 110 |
|
| 111 |
|
| 112 |
|
| 113 |
unsigned int rate; |
| 114 |
|
| 115 |
|
| 116 |
|
| 117 |
snd_pcm_format_t slave_format; |
| 118 |
|
| 119 |
|
| 120 |
|
| 121 |
snd_pcm_subformat_t slave_subformat; |
| 122 |
|
| 123 |
|
| 124 |
|
| 125 |
unsigned int slave_channels; |
| 126 |
}; |
| 127 |
|
| 128 |
|
| 129 |
struct snd_pcm_extplug_callback { |
| 130 |
|
| 131 |
|
| 132 |
|
| 133 |
snd_pcm_sframes_t (*transfer)(snd_pcm_extplug_t *ext, |
| 134 |
const snd_pcm_channel_area_t *dst_areas, |
| 135 |
snd_pcm_uframes_t dst_offset, |
| 136 |
const snd_pcm_channel_area_t *src_areas, |
| 137 |
snd_pcm_uframes_t src_offset, |
| 138 |
snd_pcm_uframes_t size); |
| 139 |
|
| 140 |
|
| 141 |
|
| 142 |
int (*close)(snd_pcm_extplug_t *ext); |
| 143 |
|
| 144 |
|
| 145 |
|
| 146 |
int (*hw_params)(snd_pcm_extplug_t *ext, snd_pcm_hw_params_t *params); |
| 147 |
|
| 148 |
|
| 149 |
|
| 150 |
int (*hw_free)(snd_pcm_extplug_t *ext); |
| 151 |
|
| 152 |
|
| 153 |
|
| 154 |
void (*dump)(snd_pcm_extplug_t *ext, snd_output_t *out); |
| 155 |
|
| 156 |
|
| 157 |
|
| 158 |
int (*init)(snd_pcm_extplug_t *ext); |
| 159 |
|
| 160 |
|
| 161 |
|
| 162 |
snd_pcm_chmap_query_t **(*query_chmaps)(snd_pcm_extplug_t *ext); |
| 163 |
|
| 164 |
|
| 165 |
|
| 166 |
snd_pcm_chmap_t *(*get_chmap)(snd_pcm_extplug_t *ext); |
| 167 |
|
| 168 |
|
| 169 |
|
| 170 |
int (*set_chmap)(snd_pcm_extplug_t *ext, const snd_pcm_chmap_t *map); |
| 171 |
}; |
| 172 |
|
| 173 |
|
| 174 |
int snd_pcm_extplug_create(snd_pcm_extplug_t *ext, const char *name, |
| 175 |
snd_config_t *root, snd_config_t *slave_conf, |
| 176 |
snd_pcm_stream_t stream, int mode); |
| 177 |
int snd_pcm_extplug_delete(snd_pcm_extplug_t *ext); |
| 178 |
|
| 179 |
|
| 180 |
void snd_pcm_extplug_params_reset(snd_pcm_extplug_t *ext); |
| 181 |
|
| 182 |
|
| 183 |
int snd_pcm_extplug_set_param_list(snd_pcm_extplug_t *extplug, int type, unsigned int num_list, const unsigned int *list); |
| 184 |
int snd_pcm_extplug_set_param_minmax(snd_pcm_extplug_t *extplug, int type, unsigned int min, unsigned int max); |
| 185 |
int snd_pcm_extplug_set_slave_param_list(snd_pcm_extplug_t *extplug, int type, unsigned int num_list, const unsigned int *list); |
| 186 |
int snd_pcm_extplug_set_slave_param_minmax(snd_pcm_extplug_t *extplug, int type, unsigned int min, unsigned int max); |
| 187 |
|
| 188 |
|
| 189 |
|
| 190 |
|
| 191 |
static __inline__ int snd_pcm_extplug_set_param(snd_pcm_extplug_t *extplug, int type, unsigned int val) |
| 192 |
{ |
| 193 |
return snd_pcm_extplug_set_param_list(extplug, type, 1, &val); |
| 194 |
} |
| 195 |
|
| 196 |
|
| 197 |
|
| 198 |
|
| 199 |
static __inline__ int snd_pcm_extplug_set_slave_param(snd_pcm_extplug_t *extplug, int type, unsigned int val) |
| 200 |
{ |
| 201 |
return snd_pcm_extplug_set_slave_param_list(extplug, type, 1, &val); |
| 202 |
} |
| 203 |
|
| 204 |
|
| 205 |
|
| 206 |
#endif |