24#ifndef _ASTERISK_TRANSLATE_H
25#define _ASTERISK_TRANSLATE_H
27#if defined(__cplusplus) || defined(c_plusplus)
258#define ast_register_translator(t) __ast_register_translator(t, AST_MODULE_SELF)
376#if defined(__cplusplus) || defined(c_plusplus)
Asterisk internal frame definitions.
A set of macros to manage forward-linked lists.
#define AST_LIST_ENTRY(type)
Declare a forward link structure inside a list entry.
SpanDSP - a series of DSP components for telephony.
Represents a media codec within Asterisk.
Data structure associated with a single frame of data.
Support for dynamic strings.
Default structure for translators, with the basic fields and buffers, all allocated as part of the sa...
struct ast_trans_pvt * next
struct ast_translator * t
struct ast_format * explicit_dst
int datalen
actual space used in outbuf
union ast_trans_pvt::@287 outbuf
Descriptor of a translator.
struct ast_codec * core_src_codec
void(* destroy)(struct ast_trans_pvt *pvt)
void(* feedback)(struct ast_trans_pvt *pvt, struct ast_frame *feedback)
int buffer_samples
size of outbuf, in samples. Leave it 0 if you want the framein callback deal with the frame....
int buf_size
size of outbuf, in bytes. Mandatory. The wrapper code will also allocate an AST_FRIENDLY_OFFSET space...
struct ast_translator::@286 list
int(* framein)(struct ast_trans_pvt *pvt, struct ast_frame *in)
struct ast_codec src_codec
struct ast_module * module
struct ast_codec * core_dst_codec
int(* newpvt)(struct ast_trans_pvt *)
struct ast_codec dst_codec
int __ast_register_translator(struct ast_translator *t, struct ast_module *module)
Register a translator This registers a codec translator with asterisk.
void ast_translator_activate(struct ast_translator *t)
Activate a previously deactivated translator.
int ast_unregister_translator(struct ast_translator *t)
Unregister a translator Unregisters the given translator.
struct ast_frame * ast_translate(struct ast_trans_pvt *tr, struct ast_frame *f, int consume)
translates one or more frames Apply an input frame into the translator and receive zero or one output...
struct ast_frame * ast_trans_frameout(struct ast_trans_pvt *pvt, int datalen, int samples)
generic frameout function
void ast_translate_available_formats(struct ast_format_cap *dest, struct ast_format_cap *src, struct ast_format_cap *result)
Find available formats.
void ast_translator_deactivate(struct ast_translator *t)
Deactivate a translator.
int ast_translator_best_choice(struct ast_format_cap *dst_cap, struct ast_format_cap *src_cap, struct ast_format **dst_fmt_out, struct ast_format **src_fmt_out)
Chooses the best translation path.
ast_trans_cost_table
Translator Cost Table definition.
@ AST_TRANS_COST_LY_LY_DOWNSAMP
@ AST_TRANS_COST_LL_LL_DOWNSAMP
@ AST_TRANS_COST_LY_LY_ORIGSAMP
@ AST_TRANS_COST_LL_LL_UPSAMP
@ AST_TRANS_COST_LY_LL_ORIGSAMP
@ AST_TRANS_COST_LL_UNKNOWN
@ AST_TRANS_COST_LY_LL_DOWNSAMP
@ AST_TRANS_COST_LL_LY_DOWNSAMP
@ AST_TRANS_COST_LL_LY_ORIGSAMP
@ AST_TRANS_COST_LY_UNKNOWN
@ AST_TRANS_COST_LL_LY_UPSAMP
@ AST_TRANS_COST_LY_LY_UPSAMP
@ AST_TRANS_COST_LY_LL_UPSAMP
@ AST_TRANS_COST_LL_LL_ORIGSAMP
void ast_translator_free_path(struct ast_trans_pvt *tr)
Frees a translator path Frees the given translator path structure.
const char * ast_translate_path_to_str(struct ast_trans_pvt *t, struct ast_str **str)
Puts a string representation of the translation path into outbuf.
struct ast_trans_pvt * ast_translator_build_path(struct ast_format *dest, struct ast_format *source)
Builds a translator path Build a path (possibly NULL) from source to dest.
unsigned int ast_translate_path_steps(struct ast_format *dest, struct ast_format *src)
Returns the number of steps required to convert from 'src' to 'dest'.
int ast_translate_init(void)
Initialize the translation matrix and index to format conversion table.