| Asterisk - The Open Source Telephony Project GIT-master-27fb039
    | 
Translate between signed linear and Speex (Open Codec) More...
#include "asterisk.h"#include <speex/speex.h>#include "asterisk/translate.h"#include "asterisk/module.h"#include "asterisk/config.h"#include "asterisk/utils.h"#include "asterisk/frame.h"#include "asterisk/linkedlists.h"#include "asterisk/rtp_engine.h"#include "asterisk/slin.h"#include "ex_speex.h"
Go to the source code of this file.
| Data Structures | |
| struct | speex_coder_pvt | 
| Macros | |
| #define | BUFFER_SAMPLES 8000 | 
| #define | SPEEX_SAMPLES 160 | 
| #define | TYPE_HIGH 0x0 | 
| #define | TYPE_LOW 0x1 | 
| #define | TYPE_MASK 0x3 | 
| #define | TYPE_SILENCE 0x2 | 
| Functions | |
| static void | __reg_module (void) | 
| static void | __unreg_module (void) | 
| struct ast_module * | AST_MODULE_SELF_SYM (void) | 
| static int | lin16tospeexwb_new (struct ast_trans_pvt *pvt) | 
| static int | lin32tospeexuwb_new (struct ast_trans_pvt *pvt) | 
| static void | lintospeex_destroy (struct ast_trans_pvt *arg) | 
| static void | lintospeex_feedback (struct ast_trans_pvt *pvt, struct ast_frame *feedback) | 
| handle incoming RTCP feedback and possibly edit encoder settings | |
| static int | lintospeex_framein (struct ast_trans_pvt *pvt, struct ast_frame *f) | 
| store input frame in work buffer | |
| static struct ast_frame * | lintospeex_frameout (struct ast_trans_pvt *pvt) | 
| convert work buffer and produce output frame | |
| static int | lintospeex_new (struct ast_trans_pvt *pvt) | 
| static int | load_module (void) | 
| static int | parse_config (int reload) | 
| static int | reload (void) | 
| static int | speex_decoder_construct (struct ast_trans_pvt *pvt, const SpeexMode *profile) | 
| static int | speex_encoder_construct (struct ast_trans_pvt *pvt, const SpeexMode *profile, int sampling_rate) | 
| static void | speextolin_destroy (struct ast_trans_pvt *arg) | 
| static int | speextolin_framein (struct ast_trans_pvt *pvt, struct ast_frame *f) | 
| convert and store into outbuf | |
| static int | speextolin_new (struct ast_trans_pvt *pvt) | 
| static int | speexuwbtolin32_new (struct ast_trans_pvt *pvt) | 
| static int | speexwbtolin16_new (struct ast_trans_pvt *pvt) | 
| static int | unload_module (void) | 
| Variables | |
| static struct ast_module_info | __mod_info = { .name = AST_MODULE, .flags = AST_MODFLAG_DEFAULT , .description = "Speex Coder/Decoder" , .key = ASTERISK_GPL_KEY , .buildopt_sum = AST_BUILDOPT_SUM, .support_level = AST_MODULE_SUPPORT_CORE, .load = load_module, .unload = unload_module, .reload = reload, } | 
| static int | abr = 0 | 
| static const struct ast_module_info * | ast_module_info = &__mod_info | 
| static int | complexity = 2 | 
| static int | dtx = 0 | 
| static int | enhancement = 0 | 
| static int | exp_rtcp_fb = 0 | 
| static struct ast_translator | lin16tospeexwb | 
| static struct ast_translator | lin32tospeexuwb | 
| static struct ast_translator | lintospeex | 
| static int | pp_agc = 0 | 
| static float | pp_agc_level = 8000 | 
| static int | pp_denoise = 0 | 
| static int | pp_dereverb = 0 | 
| static float | pp_dereverb_decay = 0.4 | 
| static float | pp_dereverb_level = 0.3 | 
| static int | pp_vad = 0 | 
| static int | preproc = 0 | 
| static int | quality = 3 | 
| static struct ast_translator | speextolin | 
| static struct ast_translator | speexuwbtolin32 | 
| static struct ast_translator | speexwbtolin16 | 
| static int | vad = 0 | 
| static int | vbr = 0 | 
| static float | vbr_quality = 4 | 
Translate between signed linear and Speex (Open Codec)
The Speex library - http://www.speex.org
Definition in file codec_speex.c.
| #define BUFFER_SAMPLES 8000 | 
Definition at line 86 of file codec_speex.c.
| #define SPEEX_SAMPLES 160 | 
Definition at line 87 of file codec_speex.c.
| #define TYPE_HIGH 0x0 | 
Definition at line 82 of file codec_speex.c.
| #define TYPE_LOW 0x1 | 
Definition at line 83 of file codec_speex.c.
| #define TYPE_MASK 0x3 | 
Definition at line 84 of file codec_speex.c.
| #define TYPE_SILENCE 0x2 | 
Definition at line 81 of file codec_speex.c.
| 
 | static | 
Definition at line 730 of file codec_speex.c.
| 
 | static | 
Definition at line 730 of file codec_speex.c.
| struct ast_module * AST_MODULE_SELF_SYM | ( | void | ) | 
Definition at line 730 of file codec_speex.c.
| 
 | static | 
Definition at line 162 of file codec_speex.c.
References speex_encoder_construct().
| 
 | static | 
Definition at line 167 of file codec_speex.c.
References speex_encoder_construct().
| 
 | static | 
Definition at line 435 of file codec_speex.c.
References speex_coder_pvt::bits, preproc, ast_trans_pvt::pvt, and speex_coder_pvt::speex.
| 
 | static | 
handle incoming RTCP feedback and possibly edit encoder settings
Definition at line 360 of file codec_speex.c.
References ast_debug, AST_RTP_RTCP_RR, AST_RTP_RTCP_SR, ast_frame::data, speex_coder_pvt::default_quality, exp_rtcp_fb, ast_rtp_rtcp_report_block::fraction, speex_coder_pvt::fraction_lost, ast_frame_subclass::integer, ast_rtp_rtcp_report_block::lost_count, ast_frame::ptr, ast_trans_pvt::pvt, speex_coder_pvt::quality, ast_rtp_rtcp_report::reception_report_count, ast_rtp_rtcp_report::report_block, speex_coder_pvt::speex, ast_frame::subclass, and vbr.
| 
 | static | 
store input frame in work buffer
Definition at line 260 of file codec_speex.c.
References speex_coder_pvt::buf, ast_frame::data, ast_frame::datalen, ast_frame::ptr, ast_trans_pvt::pvt, ast_frame::samples, and ast_trans_pvt::samples.
| 
 | static | 
convert work buffer and produce output frame
Definition at line 273 of file codec_speex.c.
References AST_FRAME_CNG, ast_frisolate, AST_LIST_NEXT, ast_trans_frameout(), speex_coder_pvt::bits, speex_coder_pvt::buf, ast_translator::buf_size, ast_trans_pvt::c, current, ast_frame::datalen, dtx, speex_coder_pvt::framesize, ast_frame::frametype, last, ast_translator::name, NULL, ast_trans_pvt::outbuf, preproc, ast_trans_pvt::pvt, result, ast_frame::samples, ast_trans_pvt::samples, speex_coder_pvt::silent_state, speex_coder_pvt::speex, and ast_trans_pvt::t.
| 
 | static | 
Definition at line 157 of file codec_speex.c.
References speex_encoder_construct().
| 
 | static | 
Definition at line 702 of file codec_speex.c.
References AST_MODULE_LOAD_DECLINE, AST_MODULE_LOAD_SUCCESS, ast_register_translator, lin16tospeexwb, lin32tospeexuwb, lintospeex, parse_config(), speextolin, speexuwbtolin32, speexwbtolin16, and unload_module().
| 
 | static | 
Definition at line 585 of file codec_speex.c.
References abr, abs, ast_config_destroy(), ast_config_load, ast_log, ast_true(), ast_variable_browse(), ast_verb, complexity, CONFIG_FLAG_FILEUNCHANGED, CONFIG_STATUS_FILEINVALID, CONFIG_STATUS_FILEMISSING, CONFIG_STATUS_FILEUNCHANGED, dtx, enhancement, exp_rtcp_fb, LOG_ERROR, ast_variable::next, pp_agc, pp_agc_level, pp_denoise, pp_dereverb, pp_dereverb_decay, pp_dereverb_level, pp_vad, preproc, quality, reload(), vad, var, vbr, and vbr_quality.
| 
 | static | 
Definition at line 683 of file codec_speex.c.
References AST_MODULE_LOAD_DECLINE, AST_MODULE_LOAD_SUCCESS, and parse_config().
Referenced by parse_config().
| 
 | static | 
Definition at line 172 of file codec_speex.c.
References speex_coder_pvt::bits, enhancement, speex_coder_pvt::framesize, ast_trans_pvt::pvt, and speex_coder_pvt::speex.
Referenced by speextolin_new(), speexuwbtolin32_new(), and speexwbtolin16_new().
| 
 | static | 
Definition at line 111 of file codec_speex.c.
References abr, ast_debug, speex_coder_pvt::bits, complexity, speex_coder_pvt::default_quality, dtx, speex_coder_pvt::fraction_lost, speex_coder_pvt::framesize, pp_agc, pp_agc_level, pp_denoise, pp_dereverb, pp_dereverb_decay, pp_dereverb_level, pp_vad, preproc, ast_trans_pvt::pvt, quality, speex_coder_pvt::quality, speex_coder_pvt::silent_state, speex_coder_pvt::speex, vad, vbr, and vbr_quality.
Referenced by lin16tospeexwb_new(), lin32tospeexuwb_new(), and lintospeex_new().
| 
 | static | 
Definition at line 427 of file codec_speex.c.
References speex_coder_pvt::bits, ast_trans_pvt::pvt, and speex_coder_pvt::speex.
| 
 | static | 
convert and store into outbuf
Definition at line 203 of file codec_speex.c.
References ast_log, speex_coder_pvt::bits, BUFFER_SAMPLES, ast_frame::data, ast_frame::datalen, ast_trans_pvt::datalen, speex_coder_pvt::framesize, ast_trans_pvt::i16, LOG_WARNING, NULL, ast_trans_pvt::outbuf, ast_frame::ptr, ast_trans_pvt::pvt, ast_trans_pvt::samples, and speex_coder_pvt::speex.
| 
 | static | 
Definition at line 187 of file codec_speex.c.
References speex_decoder_construct().
| 
 | static | 
Definition at line 197 of file codec_speex.c.
References speex_decoder_construct().
| 
 | static | 
Definition at line 192 of file codec_speex.c.
References speex_decoder_construct().
| 
 | static | 
Definition at line 690 of file codec_speex.c.
References ast_unregister_translator(), lin16tospeexwb, lin32tospeexuwb, lintospeex, speextolin, speexuwbtolin32, and speexwbtolin16.
Referenced by load_module().
| 
 | static | 
Definition at line 730 of file codec_speex.c.
| 
 | static | 
Definition at line 68 of file codec_speex.c.
Referenced by parse_config(), and speex_encoder_construct().
| 
 | static | 
Definition at line 730 of file codec_speex.c.
| 
 | static | 
Definition at line 63 of file codec_speex.c.
Referenced by parse_config(), and speex_encoder_construct().
| 
 | static | 
Definition at line 69 of file codec_speex.c.
Referenced by lintospeex_frameout(), parse_config(), and speex_encoder_construct().
| 
 | static | 
Definition at line 64 of file codec_speex.c.
Referenced by parse_config(), and speex_decoder_construct().
| 
 | static | 
Definition at line 70 of file codec_speex.c.
Referenced by lintospeex_feedback(), and parse_config().
| 
 | static | 
Definition at line 516 of file codec_speex.c.
Referenced by load_module(), and unload_module().
| 
 | static | 
Definition at line 562 of file codec_speex.c.
Referenced by load_module(), and unload_module().
| 
 | static | 
Definition at line 469 of file codec_speex.c.
Referenced by load_module(), and unload_module().
| 
 | static | 
Definition at line 74 of file codec_speex.c.
Referenced by parse_config(), and speex_encoder_construct().
| 
 | static | 
Definition at line 75 of file codec_speex.c.
Referenced by parse_config(), and speex_encoder_construct().
| 
 | static | 
Definition at line 76 of file codec_speex.c.
Referenced by parse_config(), and speex_encoder_construct().
| 
 | static | 
Definition at line 77 of file codec_speex.c.
Referenced by parse_config(), and speex_encoder_construct().
| 
 | static | 
Definition at line 78 of file codec_speex.c.
Referenced by parse_config(), and speex_encoder_construct().
| 
 | static | 
Definition at line 79 of file codec_speex.c.
Referenced by parse_config(), and speex_encoder_construct().
| 
 | static | 
Definition at line 73 of file codec_speex.c.
Referenced by parse_config(), and speex_encoder_construct().
| 
 | static | 
Definition at line 72 of file codec_speex.c.
Referenced by lintospeex_destroy(), lintospeex_frameout(), parse_config(), and speex_encoder_construct().
| 
 | static | 
Definition at line 62 of file codec_speex.c.
Referenced by ast_rtp_instance_set_stats_vars(), parse_config(), speex_encoder_construct(), speex_resampler_get_quality(), speex_resampler_init(), speex_resampler_init_frac(), and speex_resampler_set_quality().
| 
 | static | 
Definition at line 446 of file codec_speex.c.
Referenced by load_module(), and unload_module().
| 
 | static | 
Definition at line 540 of file codec_speex.c.
Referenced by load_module(), and unload_module().
| 
 | static | 
Definition at line 493 of file codec_speex.c.
Referenced by load_module(), and unload_module().
| 
 | static | 
Definition at line 65 of file codec_speex.c.
Referenced by parse_config(), and speex_encoder_construct().
| 
 | static | 
Definition at line 66 of file codec_speex.c.
Referenced by lintospeex_feedback(), parse_config(), and speex_encoder_construct().
| 
 | static | 
Definition at line 67 of file codec_speex.c.
Referenced by parse_config(), and speex_encoder_construct().