xref: /qemu/audio/mixeng.h (revision 85571bc7)
1*85571bc7Sbellard /*
2*85571bc7Sbellard  * QEMU Mixing engine header
3*85571bc7Sbellard  *
4*85571bc7Sbellard  * Copyright (c) 2004 Vassili Karpov (malc)
5*85571bc7Sbellard  *
6*85571bc7Sbellard  * Permission is hereby granted, free of charge, to any person obtaining a copy
7*85571bc7Sbellard  * of this software and associated documentation files (the "Software"), to deal
8*85571bc7Sbellard  * in the Software without restriction, including without limitation the rights
9*85571bc7Sbellard  * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10*85571bc7Sbellard  * copies of the Software, and to permit persons to whom the Software is
11*85571bc7Sbellard  * furnished to do so, subject to the following conditions:
12*85571bc7Sbellard  *
13*85571bc7Sbellard  * The above copyright notice and this permission notice shall be included in
14*85571bc7Sbellard  * all copies or substantial portions of the Software.
15*85571bc7Sbellard  *
16*85571bc7Sbellard  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17*85571bc7Sbellard  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18*85571bc7Sbellard  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
19*85571bc7Sbellard  * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20*85571bc7Sbellard  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21*85571bc7Sbellard  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22*85571bc7Sbellard  * THE SOFTWARE.
23*85571bc7Sbellard  */
24*85571bc7Sbellard #ifndef QEMU_MIXENG_H
25*85571bc7Sbellard #define QEMU_MIXENG_H
26*85571bc7Sbellard 
27*85571bc7Sbellard typedef void (t_sample) (void *dst, const void *src, int samples);
28*85571bc7Sbellard typedef void (f_sample) (void *dst, const void *src, int samples);
29*85571bc7Sbellard typedef struct { int64_t l; int64_t r; } st_sample_t;
30*85571bc7Sbellard 
31*85571bc7Sbellard extern t_sample *mixeng_conv[2][2][2];
32*85571bc7Sbellard extern f_sample *mixeng_clip[2][2][2];
33*85571bc7Sbellard 
34*85571bc7Sbellard void *st_rate_start (int inrate, int outrate);
35*85571bc7Sbellard void st_rate_flow (void *opaque, st_sample_t *ibuf, st_sample_t *obuf,
36*85571bc7Sbellard                    int *isamp, int *osamp);
37*85571bc7Sbellard void st_rate_stop (void *opaque);
38*85571bc7Sbellard 
39*85571bc7Sbellard #endif  /* mixeng.h */
40