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 sla_ringing_trunk * last
Asterisk main include file. File version handling, generic pbx functions.
static struct ast_frame * lintocodec2_frameout(struct ast_trans_pvt *pvt)
encode and produce a frame
static struct ast_translator codec2tolin
static int codec2_new(struct ast_trans_pvt *pvt)
static void codec2_destroy_stuff(struct ast_trans_pvt *pvt)
static struct ast_translator lintocodec2
static int lintocodec2_framein(struct ast_trans_pvt *pvt, struct ast_frame *f)
store samples into working buffer for later decode
static int codec2tolin_framein(struct ast_trans_pvt *pvt, struct ast_frame *f)
decode and store in outbuf.
static int load_module(void)
static int unload_module(void)
static struct ast_frame * codec2_sample(void)
Asterisk internal frame definitions.
Support for logging to various files, console and syslog Configuration in file logger....
A set of macros to manage forward-linked lists.
#define AST_LIST_NEXT(elm, field)
Returns the next entry in the list after the given entry.
Asterisk module definitions.
#define AST_MODULE_INFO_STANDARD(keystr, desc)
#define ASTERISK_GPL_KEY
The text the key() function should return.
@ AST_MODULE_LOAD_SUCCESS
@ AST_MODULE_LOAD_DECLINE
Module has failed to load, may be in an inconsistent state.
Pluggable RTP Architecture.
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...
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...
static struct ast_frame * slin8_sample(void)
Data structure associated with a single frame of data.
union ast_frame::@226 data
Default structure for translators, with the basic fields and buffers, all allocated as part of the sa...
int datalen
actual space used in outbuf
union ast_trans_pvt::@287 outbuf
Descriptor of a translator.
int16_t buf[BUFFER_SAMPLES]
Support for translation of data formats. translate.c.
#define ast_register_translator(t)
See __ast_register_translator()
int ast_unregister_translator(struct ast_translator *t)
Unregister a translator Unregisters the given translator.
struct ast_frame * ast_trans_frameout(struct ast_trans_pvt *pvt, int datalen, int samples)
generic frameout function