#include <asterisk/lock.h>
#include <asterisk/channel.h>
#include <asterisk/channel_pvt.h>
#include <asterisk/logger.h>
#include <asterisk/translate.h>
#include <asterisk/options.h>
#include <asterisk/frame.h>
#include <asterisk/sched.h>
#include <asterisk/cli.h>
#include <asterisk/term.h>
#include <sys/socket.h>
#include <sys/time.h>
#include <unistd.h>
#include <stdlib.h>
#include <pthread.h>
#include <string.h>
#include <stdio.h>
Include dependency graph for translate.c:
Go to the source code of this file.
Data Structures | |
struct | ast_translator_dir |
struct | ast_frame_delivery |
struct | ast_trans_pvt |
Defines | |
#define | MAX_RECALC 200 /* max sample recalc */ |
#define | SHOW_TRANS 11 |
Functions | |
AST_MUTEX_DEFINE_STATIC (list_lock) | |
void | ast_translator_free_path (struct ast_trans_pvt *p) |
Frees a translator path. | |
ast_trans_pvt * | ast_translator_build_path (int dest, int source) |
Builds a translator path. | |
ast_frame * | ast_translate (struct ast_trans_pvt *path, struct ast_frame *f, int consume) |
translates one or more frames | |
int | ast_register_translator (struct ast_translator *t) |
Register a translator. | |
int | ast_unregister_translator (struct ast_translator *t) |
Unregister a translator. | |
int | ast_translator_best_choice (int *dst, int *srcs) |
Chooses the best translation path. |
|
Definition at line 32 of file translate.c. |
|
|
|
|
|
Register a translator.
Definition at line 389 of file translate.c. References ast_cli_register(), ast_getformatname(), ast_log(), ast_mutex_lock, ast_mutex_unlock, ast_verbose(), COLOR_BLACK, COLOR_MAGENTA, ast_translator::cost, ast_translator::dstfmt, LOG_WARNING, MAX_FORMAT, ast_translator::name, ast_translator::next, option_verbose, ast_translator::srcfmt, term_color(), and VERBOSE_PREFIX_2.
|
|
translates one or more frames
Definition at line 138 of file translate.c. References ast_frfree(), ast_log(), ast_frame::delivery, ast_translator::framein, LOG_WARNING, ast_frame::samples, and ast_trans_pvt::step. Referenced by ast_read(), ast_write(), and ast_writestream().
|
|
Chooses the best translation path. Given a list of sources, and a designed destination format, which should I choose? Returns 0 on success, -1 if no path could be found. Modifies dests and srcs in place Definition at line 437 of file translate.c. References ast_mutex_lock, ast_mutex_unlock, ast_translator_dir::cost, MAX_FORMAT, and ast_translator_dir::step. Referenced by ast_channel_make_compatible(), ast_request(), ast_set_read_format(), and ast_set_write_format().
|
|
Builds a translator path.
Definition at line 88 of file translate.c. References ast_getformatname(), ast_log(), free, LOG_WARNING, malloc, ast_translator::new, and ast_translator_dir::step. Referenced by ast_set_read_format(), ast_set_write_format(), and ast_writestream().
|
|
Frees a translator path.
Definition at line 75 of file translate.c. References ast_translator::destroy, free, ast_trans_pvt::next, and ast_trans_pvt::step. Referenced by ast_channel_free(), ast_closestream(), ast_set_read_format(), ast_set_write_format(), and ast_writestream().
|
|
Unregister a translator.
Definition at line 413 of file translate.c. References ast_getformatname(), ast_mutex_lock, ast_mutex_unlock, ast_verbose(), COLOR_BLACK, COLOR_MAGENTA, ast_translator::dstfmt, ast_translator::name, ast_translator::next, option_verbose, ast_translator::srcfmt, term_color(), and VERBOSE_PREFIX_2.
|