|size of outbuf, in bytes. Mandatory. The wrapper code will also allocate an AST_FRIENDLY_OFFSET space before. |
|size of outbuf, in samples. Leave it 0 if you want the framein callback deal with the frame. Set it appropriately if you want the code to checks if the incoming frame fits the outbuf (this is e.g. required for plc). |
|void(*||destroy )(struct ast_trans_pvt *pvt)|
|int(*||framein )(struct ast_trans_pvt *pvt, struct ast_frame *in)|
|struct ast_frame *(*||frameout )(struct ast_trans_pvt *pvt)|
|struct ast_translator * next|
|struct ast_module *||module|
|const char||name |
|int(*||newpvt )(struct ast_trans_pvt *)|
|struct ast_frame *(*||sample )(void)|
Name, callbacks, and various options related to run-time operation (size of buffers, auxiliary descriptors, etc).
A codec registers itself by filling the relevant fields of a structure and passing it as an argument to ast_register_translator(). The structure should not be modified after a successful registration, and its address must be used as an argument to ast_unregister_translator().
As a minimum, a translator should supply name, srcfmt and dstfmt, the required buf_size (in bytes) and buffer_samples (in samples), and a few callbacks (framein, frameout, sample). The outbuf is automatically prepended by AST_FRIENDLY_OFFSET spare bytes so generic routines can place data in there.
Note, the translator is not supposed to do any memory allocation or deallocation, nor any locking, because all of this is done in the generic code.
Translators using generic plc (packet loss concealment) should supply a non-zero plc_samples indicating the size (in samples) of artificially generated frames and incoming data. Generic plc is only available for dstfmt = SLINEAR
size of outbuf, in bytes. Mandatory. The wrapper code will also allocate an AST_FRIENDLY_OFFSET space before.
size of outbuf, in samples. Leave it 0 if you want the framein callback deal with the frame. Set it appropriately if you want the code to checks if the incoming frame fits the outbuf (this is e.g. required for plc).
Destination format (note: bit position, converted to index during registration)
Referenced by __ast_register_translator(), ast_trans_frameout(), ast_translate_path_to_str(), ast_translator_build_path(), ast_unregister_translator(), calc_cost(), dahdi_decoder_frameout(), dahdi_encoder_frameout(), dahdi_new(), drop_translator(), rebuild_matrix(), and register_translator().
|const char name|
Source format (note: bit position, converted to index during registration)