Asterisk - The Open Source Telephony Project
18.5.0
|
Frame smoother manipulation routines. More...
#include "asterisk.h"
#include "asterisk/_private.h"
#include "asterisk/frame.h"
#include "asterisk/astobj2.h"
#include "asterisk/time.h"
#include "asterisk/utils.h"
#include "asterisk/format.h"
#include "asterisk/codec.h"
#include "asterisk/smoother.h"
Go to the source code of this file.
Data Structures | |
struct | ast_smoother |
Macros | |
#define | SMOOTHER_SIZE 8000 |
Functions | |
int | __ast_smoother_feed (struct ast_smoother *s, struct ast_frame *f, int swap) |
void | ast_smoother_free (struct ast_smoother *s) |
int | ast_smoother_get_flags (struct ast_smoother *s) |
struct ast_smoother * | ast_smoother_new (int size) |
struct ast_frame * | ast_smoother_read (struct ast_smoother *s) |
void | ast_smoother_reconfigure (struct ast_smoother *s, int bytes) |
Reconfigure an existing smoother to output a different number of bytes per frame. More... | |
void | ast_smoother_reset (struct ast_smoother *s, int bytes) |
void | ast_smoother_set_flags (struct ast_smoother *s, int flags) |
int | ast_smoother_test_flag (struct ast_smoother *s, int flag) |
static int | smoother_frame_feed (struct ast_smoother *s, struct ast_frame *f, int swap) |
Frame smoother manipulation routines.
Definition in file smoother.c.
#define SMOOTHER_SIZE 8000 |
Definition at line 41 of file smoother.c.
Referenced by __ast_smoother_feed().
int __ast_smoother_feed | ( | struct ast_smoother * | s, |
struct ast_frame * | f, | ||
int | swap | ||
) |
Definition at line 133 of file smoother.c.
References ao2_bump, ast_format_cmp(), AST_FORMAT_CMP_NOT_EQUAL, ast_format_get_name(), AST_FRAME_VOICE, ast_log, AST_MIN_OFFSET, AST_SMOOTHER_FLAG_G729, ast_swapcopy_samples(), ast_frame::data, ast_frame::datalen, ast_smoother::f, ast_smoother::flags, ast_smoother::format, ast_frame_subclass::format, ast_frame::frametype, ast_smoother::len, LOG_WARNING, ast_frame::offset, ast_smoother::opt, ast_smoother::opt_needs_swap, ast_frame::ptr, ast_frame::samples, ast_smoother::samplesperbyte, ast_smoother::size, smoother_frame_feed(), SMOOTHER_SIZE, and ast_frame::subclass.
void ast_smoother_free | ( | struct ast_smoother * | s | ) |
Definition at line 220 of file smoother.c.
References ao2_cleanup, ast_free, and ast_smoother::format.
Referenced by ast_rtp_destroy(), ast_rtp_dtmf_end_with_duration(), ast_rtp_local_bridge(), ast_rtp_write(), destroy_session(), generic_fax_exec(), mbl_load_device(), multicast_rtp_destroy(), and unload_module().
int ast_smoother_get_flags | ( | struct ast_smoother * | s | ) |
Definition at line 118 of file smoother.c.
References ast_smoother::flags.
struct ast_smoother* ast_smoother_new | ( | int | size | ) |
Definition at line 108 of file smoother.c.
References ast_calloc, ast_smoother_reset(), and NULL.
Referenced by ast_rtp_write(), generic_fax_exec(), mbl_load_device(), and multicast_rtp_write().
struct ast_frame* ast_smoother_read | ( | struct ast_smoother * | s | ) |
Definition at line 169 of file smoother.c.
References ast_format_get_sample_rate(), AST_FRAME_VOICE, AST_FRIENDLY_OFFSET, ast_log, ast_samp2tv(), AST_SMOOTHER_FLAG_G729, ast_tvadd(), ast_tvzero(), ast_smoother::data, ast_frame::data, ast_frame::datalen, ast_smoother::delivery, ast_frame::delivery, ast_smoother::f, ast_smoother::flags, ast_smoother::format, ast_frame_subclass::format, ast_smoother::framedata, ast_frame::frametype, ast_smoother::len, LOG_WARNING, NULL, ast_frame::offset, ast_smoother::opt, ast_frame::ptr, ast_frame::samples, ast_smoother::samplesperbyte, ast_smoother::size, and ast_frame::subclass.
Referenced by ast_rtp_write(), generic_fax_exec(), mbl_read(), mbl_write(), and multicast_rtp_write().
void ast_smoother_reconfigure | ( | struct ast_smoother * | s, |
int | bytes | ||
) |
Reconfigure an existing smoother to output a different number of bytes per frame.
s | the smoother to reconfigure |
bytes | the desired number of bytes per output frame |
Definition at line 86 of file smoother.c.
References NULL, ast_smoother::opt, ast_smoother::opt_needs_swap, ast_smoother::size, and smoother_frame_feed().
void ast_smoother_reset | ( | struct ast_smoother * | s, |
int | bytes | ||
) |
Definition at line 79 of file smoother.c.
References ao2_cleanup, ast_smoother::format, and ast_smoother::size.
Referenced by ast_smoother_new(), and mbl_new().
void ast_smoother_set_flags | ( | struct ast_smoother * | s, |
int | flags | ||
) |
Definition at line 123 of file smoother.c.
References ast_smoother::flags.
Referenced by ast_rtp_write(), and multicast_rtp_write().
int ast_smoother_test_flag | ( | struct ast_smoother * | s, |
int | flag | ||
) |
Definition at line 128 of file smoother.c.
References ast_smoother::flags.
Referenced by ast_rtp_write(), and multicast_rtp_write().
|
static |
Definition at line 57 of file smoother.c.
References ast_log, AST_SMOOTHER_FLAG_G729, ast_swapcopy_samples(), ast_tvzero(), ast_smoother::data, ast_frame::data, ast_frame::datalen, ast_smoother::delivery, ast_frame::delivery, ast_smoother::flags, ast_smoother::len, LOG_NOTICE, ast_frame::ptr, and ast_frame::samples.
Referenced by __ast_smoother_feed(), and ast_smoother_reconfigure().