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