mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-10-29 05:40:23 -04:00
mix: Export function to get/set mixing implementation for a sample format
Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
This commit is contained in:
parent
fe455ae013
commit
9fa000bbfc
2 changed files with 19 additions and 2 deletions
|
|
@ -534,8 +534,6 @@ static void pa_mix_float32re_c(pa_mix_info streams[], unsigned nstreams, unsigne
|
|||
}
|
||||
}
|
||||
|
||||
typedef void (*pa_do_mix_func_t) (pa_mix_info streams[], unsigned nstreams, unsigned channels, void *data, void *end);
|
||||
|
||||
static pa_do_mix_func_t do_mix_table[] = {
|
||||
[PA_SAMPLE_U8] = (pa_do_mix_func_t) pa_mix_u8_c,
|
||||
[PA_SAMPLE_ALAW] = (pa_do_mix_func_t) pa_mix_alaw_c,
|
||||
|
|
@ -597,6 +595,20 @@ size_t pa_mix(
|
|||
return length;
|
||||
}
|
||||
|
||||
pa_do_mix_func_t pa_get_mix_func(pa_sample_format_t f) {
|
||||
pa_assert(f >= 0);
|
||||
pa_assert(f < PA_SAMPLE_MAX);
|
||||
|
||||
return do_mix_table[f];
|
||||
}
|
||||
|
||||
void pa_set_mix_func(pa_sample_format_t f, pa_do_mix_func_t func) {
|
||||
pa_assert(f >= 0);
|
||||
pa_assert(f < PA_SAMPLE_MAX);
|
||||
|
||||
do_mix_table[f] = func;
|
||||
}
|
||||
|
||||
typedef union {
|
||||
float f;
|
||||
uint32_t i;
|
||||
|
|
|
|||
|
|
@ -51,6 +51,11 @@ size_t pa_mix(
|
|||
const pa_cvolume *volume,
|
||||
pa_bool_t mute);
|
||||
|
||||
typedef void (*pa_do_mix_func_t) (pa_mix_info streams[], unsigned nstreams, unsigned channels, void *data, void *end);
|
||||
|
||||
pa_do_mix_func_t pa_get_mix_func(pa_sample_format_t f);
|
||||
void pa_set_mix_func(pa_sample_format_t f, pa_do_mix_func_t func);
|
||||
|
||||
void pa_volume_memchunk(
|
||||
pa_memchunk*c,
|
||||
const pa_sample_spec *spec,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue