39 #define OUTBUF_SAMPLES 11520 87 .sample_rate = 192000,
116 unsigned int in_samples;
131 pvt->
datalen += out_samples * 2;
159 for (x = 0; x <
ARRAY_LEN(codec_list); x++) {
160 for (y = 0; y <
ARRAY_LEN(codec_list); y++) {
170 memcpy(&translators[idx].src_codec, &codec_list[x],
sizeof(
struct ast_codec));
171 memcpy(&translators[idx].dst_codec, &codec_list[y],
sizeof(
struct ast_codec));
172 snprintf(translators[idx].
name,
sizeof(translators[idx].name),
"slin %ukhz -> %ukhz",
int datalen
actual space used in outbuf
#define AST_MODULE_INFO_STANDARD(keystr, desc)
const char * name
Name for this codec.
Asterisk main include file. File version handling, generic pbx functions.
int(* newpvt)(struct ast_trans_pvt *)
Descriptor of a translator.
Support for translation of data formats. translate.c.
static void resamp_destroy(struct ast_trans_pvt *pvt)
EXPORT SpeexResamplerState * speex_resampler_init(spx_uint32_t nb_channels, spx_uint32_t in_rate, spx_uint32_t out_rate, int quality, int *err)
Create a new resampler with integer input and output rates.
static int resamp_new(struct ast_trans_pvt *pvt)
static int load_module(void)
struct ast_frame_subclass subclass
#define ast_register_translator(t)
See __ast_register_translator()
int ast_unregister_translator(struct ast_translator *t)
Unregister a translator Unregisters the given tranlator.
static int resamp_framein(struct ast_trans_pvt *pvt, struct ast_frame *f)
static struct ast_codec codec_list[]
int buf_size
size of outbuf, in bytes. Mandatory. The wrapper code will also allocate an AST_FRIENDLY_OFFSET space...
union ast_trans_pvt::@327 outbuf
void(* destroy)(struct ast_trans_pvt *pvt)
struct ast_codec dst_codec
Default structure for translators, with the basic fields and buffers, all allocated as part of the sa...
struct ast_codec src_codec
static struct ast_translator * translators
#define ast_calloc(num, len)
A wrapper for calloc()
Module has failed to load, may be in an inconsistent state.
unsigned int sample_rate
Sample rate (number of samples carried in a second)
EXPORT void speex_resampler_destroy(SpeexResamplerState *st)
static int unload_module(void)
Data structure associated with a single frame of data.
struct ast_translator * t
union ast_frame::@263 data
struct ast_format * format
#define ASTERISK_GPL_KEY
The text the key() function should return.
Asterisk module definitions.
Represents a media codec within Asterisk.
EXPORT int speex_resampler_process_int(SpeexResamplerState *st, spx_uint32_t channel_index, const spx_int16_t *in, spx_uint32_t *in_len, spx_int16_t *out, spx_uint32_t *out_len)
int(* framein)(struct ast_trans_pvt *pvt, struct ast_frame *in)
int buffer_samples
size of outbuf, in samples. Leave it 0 if you want the framein callback deal with the frame...