45 #include <codec2/codec2.h> 47 #define BUFFER_SAMPLES 8000 48 #define CODEC2_SAMPLES 160 49 #define CODEC2_FRAME_LEN 6 64 tmp->
state = codec2_create(CODEC2_MODE_2400);
81 unsigned char *src = f->
data.
ptr + x;
84 codec2_decode(tmp->
state, dst, src);
146 codec2_destroy(tmp->
state);
151 .
name =
"codec2tolin",
173 .
name =
"lintocodec2",
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
static struct ast_translator codec2tolin
#define AST_MODULE_INFO_STANDARD(keystr, desc)
Asterisk main include file. File version handling, generic pbx functions.
int16_t buf[BUFFER_SAMPLES]
Descriptor of a translator.
Support for translation of data formats. translate.c.
static struct ast_frame * lintocodec2_frameout(struct ast_trans_pvt *pvt)
encode and produce a frame
#define AST_LIST_NEXT(elm, field)
Returns the next entry in the list after the given entry.
static struct ast_frame * slin8_sample(void)
static int lintocodec2_framein(struct ast_trans_pvt *pvt, struct ast_frame *f)
store samples into working buffer for later decode
static int unload_module(void)
int ast_rtp_engine_unload_format(struct ast_format *format)
Formats requiring the use of a format attribute interface must have that interface registered in orde...
struct sla_ringing_trunk * last
#define ast_register_translator(t)
See __ast_register_translator()
Asterisk internal frame definitions.
int ast_unregister_translator(struct ast_translator *t)
Unregister a translator Unregisters the given tranlator.
A set of macros to manage forward-linked lists.
union ast_trans_pvt::@327 outbuf
static struct ast_translator lintocodec2
Default structure for translators, with the basic fields and buffers, all allocated as part of the sa...
static struct ast_frame * codec2_sample(void)
static int load_module(void)
Module has failed to load, may be in an inconsistent state.
static int codec2_new(struct ast_trans_pvt *pvt)
Support for logging to various files, console and syslog Configuration in file logger.conf.
Data structure associated with a single frame of data.
static void codec2_destroy_stuff(struct ast_trans_pvt *pvt)
int ast_rtp_engine_load_format(struct ast_format *format)
Custom formats declared in codecs.conf at startup must be communicated to the rtp_engine so their mim...
union ast_frame::@263 data
static int codec2tolin_framein(struct ast_trans_pvt *pvt, struct ast_frame *f)
decode and store in outbuf.
#define ASTERISK_GPL_KEY
The text the key() function should return.
Pluggable RTP Architecture.
Asterisk module definitions.