53 #define LPC10_BYTES_IN_COMPRESSED_FRAME (LPC10_BITS_IN_COMPRESSED_FRAME + 7)/8 55 #define BUFFER_SAMPLES 8000 85 if (*c & (0x80 >> (x & 7)))
97 unsigned char mask=0x80;
118 while (len + LPC10_BYTES_IN_COMPRESSED_FRAME <= f->datalen) {
141 printf(
"Decoded %d, expected %d\n", len, f->
datalen);
174 tmpbuf[x] = (
float)tmp->
buf[x +
samples] / 32768.0;
212 .
name =
"lpc10tolin",
234 .
name =
"lintolpc10",
struct ast_frame * ast_trans_frameout(struct ast_trans_pvt *pvt, int datalen, int samples)
generic frameout function
int datalen
actual space used in outbuf
#define LPC10_BYTES_IN_COMPRESSED_FRAME
Asterisk main include file. File version handling, generic pbx functions.
static int lpc10tolin_framein(struct ast_trans_pvt *pvt, struct ast_frame *f)
Descriptor of a translator.
Support for translation of data formats. translate.c.
int lpc10_encode(real *speech, INT32 *bits, struct lpc10_encoder_state *st)
static int lpc10_enc_new(struct ast_trans_pvt *pvt)
#define AST_LIST_NEXT(elm, field)
Returns the next entry in the list after the given entry.
static struct ast_translator lpc10tolin
#define LPC10_BITS_IN_COMPRESSED_FRAME
static struct ast_frame * slin8_sample(void)
static int lintolpc10_framein(struct ast_trans_pvt *pvt, struct ast_frame *f)
#define LPC10_SAMPLES_PER_FRAME
union lpc10_coder_pvt::@183 lpc10
struct lpc10_decoder_state * create_lpc10_decoder_state(void)
Configuration File Parser.
short buf[BUFFER_SAMPLES]
static struct ast_translator lintolpc10
struct sla_ringing_trunk * last
#define ast_register_translator(t)
See __ast_register_translator()
int ast_unregister_translator(struct ast_translator *t)
Unregister a translator Unregisters the given tranlator.
struct lpc10_encoder_state * enc
static struct ast_frame * lintolpc10_frameout(struct ast_trans_pvt *pvt)
A set of macros to manage forward-linked lists.
static void lpc10_destroy(struct ast_trans_pvt *arg)
union ast_trans_pvt::@327 outbuf
int lpc10_decode(INT32 *bits, real *speech, struct lpc10_decoder_state *st)
static void extract_bits(INT32 *bits, unsigned char *c)
Default structure for translators, with the basic fields and buffers, all allocated as part of the sa...
static int len(struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t buflen)
static struct ast_frame * lpc10_sample(void)
static int lpc10_dec_new(struct ast_trans_pvt *pvt)
struct lpc10_encoder_state * create_lpc10_encoder_state(void)
Copyright (C) 2008, Digium, Inc.
Module has failed to load, may be in an inconsistent state.
static int unload_module(void)
static void build_bits(unsigned char *c, INT32 *bits)
AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_GLOBAL_SYMBOLS|AST_MODFLAG_LOAD_ORDER, "HTTP Phone Provisioning",.support_level=AST_MODULE_SUPPORT_EXTENDED,.load=load_module,.unload=unload_module,.reload=reload,.load_pri=AST_MODPRI_CHANNEL_DEPEND,.requires="http",)
Data structure associated with a single frame of data.
union ast_frame::@263 data
struct lpc10_decoder_state * dec
#define ASTERISK_GPL_KEY
The text the key() function should return.
Asterisk module definitions.
static int load_module(void)