From 7d83e5c7816b5e343695a75ba58b32dbe1be969a Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Mon, 1 Oct 2007 20:16:28 +0000 Subject: move all sources down to a seperate src/ tree git-svn-id: file:///home/lennart/svn/public/libsydney/trunk@34 9ba3c220-e4d3-45a2-8aa3-73fcc9aff6ce --- src/converter.h | 82 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 82 insertions(+) create mode 100644 src/converter.h (limited to 'src/converter.h') diff --git a/src/converter.h b/src/converter.h new file mode 100644 index 0000000..8112231 --- /dev/null +++ b/src/converter.h @@ -0,0 +1,82 @@ +#ifndef foosydneyconverterhfoo +#define foosydneyconverterhfoo + +#include "sydney.h" +#include "volscale.h" +#include "byteswap.h" +#include "zero.h" +#include "add.h" +#include "bbuffer.h" +#include "resample.h" +#include "format.h" +#include "common.h" +#include "interleave.h" + +typedef struct sa_converter sa_converter_t; + +struct sa_converter { + sa_pcm_format_t from_pcm_format, to_pcm_format; + unsigned from_nchannels, to_nchannels; + unsigned from_rate, to_rate; + + int sum_required; + int remap_required; + + sa_pcm_format_t work_pcm_format; + + size_t from_sample_size, work_sample_size, to_sample_size; + + sa_byteswap_func_t pre_byteswap_func, post_byteswap_func; + sa_format_func_t pre_format_func, post_format_func; + sa_volscale_func_t volscale_func; + sa_zero_func_t zero_func; + sa_add_func_t add_func; + sa_resample_func_t resample_func; + sa_interleave_func_t interleave_func; + + SpeexResamplerState *speex; + + sa_bbuffer_t bb_pre_byteswap, + bb_pre_format, + bb_volscale, + bb_remap, + bb_resample, + bb_post_format, + bb_post_byteswap, + bb_interleave, + bb_tmp; + + void **from_process_data, **to_process_data; + size_t *from_stride, *to_stride; + + int32_t *volume_factor, *volume_divisor; + int no_volume; + + int *channel_map_table; + + void *zero_buffer; + size_t zero_size; +}; + +int sa_converter_init(sa_converter_t *c, const pcm_attrs_t *from, const pcm_attrs_t *to, int dynamic_rate_enabled); +void sa_converter_done(sa_converter_t *c); + +int sa_converter_go( + sa_converter_t *c, + const void *const src[], const size_t sstr[], int sinterleave, + void **dst[], size_t *dstr[], int dinterleave, + size_t *size); + +int sa_converter_go_interleaved( + sa_converter_t *c, + const void *const data, + void **dst[], size_t *dstr[], int dinterleave, + size_t *size); + +void sa_converter_set_volume(sa_converter_t *c, const int32_t vol[]); + +void sa_converter_set_ratio(sa_converter_t *c, unsigned rate1, unsigned rate2); + +void* sa_converter_get_zero_buffer(sa_converter_t *c, size_t size); + +#endif -- cgit