]> code.delx.au - pulseaudio/blob - src/pulsecore/mix.h
remap: Change remapping function argument type from void to int16_t / float as approp...
[pulseaudio] / src / pulsecore / mix.h
1 #ifndef foomixhfoo
2 #define foomixhfoo
3
4 /***
5 This file is part of PulseAudio.
6
7 Copyright 2004-2006 Lennart Poettering
8 Copyright 2006 Pierre Ossman <ossman@cendio.se> for Cendio AB
9 Copyright 2013 Peter Meerwald <pmeerw@pmeerw.net>
10
11 PulseAudio is free software; you can redistribute it and/or modify
12 it under the terms of the GNU Lesser General Public License as published
13 by the Free Software Foundation; either version 2.1 of the License,
14 or (at your option) any later version.
15
16 PulseAudio is distributed in the hope that it will be useful, but
17 WITHOUT ANY WARRANTY; without even the implied warranty of
18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 General Public License for more details.
20
21 You should have received a copy of the GNU Lesser General Public License
22 along with PulseAudio; if not, write to the Free Software
23 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
24 USA.
25 ***/
26
27 #include <pulse/sample.h>
28 #include <pulse/volume.h>
29 #include <pulsecore/memchunk.h>
30
31 typedef struct pa_mix_info {
32 pa_memchunk chunk;
33 pa_cvolume volume;
34 void *userdata;
35
36 /* The following fields are used internally by pa_mix(), should
37 * not be initialised by the caller of pa_mix(). */
38 void *ptr;
39 union {
40 int32_t i;
41 float f;
42 } linear[PA_CHANNELS_MAX];
43 } pa_mix_info;
44
45 size_t pa_mix(
46 pa_mix_info channels[],
47 unsigned nchannels,
48 void *data,
49 size_t length,
50 const pa_sample_spec *spec,
51 const pa_cvolume *volume,
52 bool mute);
53
54 typedef void (*pa_do_mix_func_t) (pa_mix_info streams[], unsigned nstreams, unsigned channels, void *data, unsigned length);
55
56 pa_do_mix_func_t pa_get_mix_func(pa_sample_format_t f);
57 void pa_set_mix_func(pa_sample_format_t f, pa_do_mix_func_t func);
58
59 void pa_volume_memchunk(
60 pa_memchunk*c,
61 const pa_sample_spec *spec,
62 const pa_cvolume *volume);
63
64 #endif