add an API so that translators can activate/deactivate themselves when needed

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@46714 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Kevin P. Fleming
2006-10-31 21:47:48 +00:00
parent 160a0448c2
commit f532d2f198
2 changed files with 56 additions and 6 deletions

View File

@@ -108,6 +108,7 @@ struct ast_translator {
struct ast_module *module; /* opaque reference to the parent module */
int cost; /*!< Cost in milliseconds for encoding/decoding 1 second of sound */
int active; /*!< Whether this translator should be used or not */
AST_LIST_ENTRY(ast_translator) list; /*!< link field */
};
@@ -166,6 +167,24 @@ int __ast_register_translator(struct ast_translator *t, struct ast_module *modul
*/
int ast_unregister_translator(struct ast_translator *t);
/*!
* \brief Activate a previously deactivated translator
* \param t translator to activate
* \return nothing
*
* Enables the specified translator for use.
*/
void ast_translator_activate(struct ast_translator *t);
/*!
* \brief Deactivate a translator
* \param t translator to deactivate
* \return nothing
*
* Disables the specified translator from being used.
*/
void ast_translator_deactivate(struct ast_translator *t);
/*!
* \brief Chooses the best translation path
*