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