diff options
author | kpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-04-17 16:42:03 +0000 |
---|---|---|
committer | kpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-04-17 16:42:03 +0000 |
commit | 34fbed82538f271aae21f2dfd53f27d2bc824f18 (patch) | |
tree | b735c7926aa7d05b342681178456bb8047404cf0 /include/asterisk/translate.h | |
parent | 07ac7ea7852bce07a852618734723b389a9b6b2b (diff) |
add an API so that the number of steps required for a translation path can be acquired
don't transcode via SLINEAR when the option is enabled but there is a direct path from the source to the destination
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@20962 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'include/asterisk/translate.h')
-rw-r--r-- | include/asterisk/translate.h | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/include/asterisk/translate.h b/include/asterisk/translate.h index a83cfa41e..21643fe32 100644 --- a/include/asterisk/translate.h +++ b/include/asterisk/translate.h @@ -1,7 +1,7 @@ /* * Asterisk -- An open source telephony toolkit. * - * Copyright (C) 1999 - 2005, Digium, Inc. + * Copyright (C) 1999 - 2006, Digium, Inc. * * Mark Spencer <markster@digium.com> * @@ -145,7 +145,7 @@ struct ast_trans_pvt; * \brief Register a translator * \param t populated ast_translator structure * This registers a codec translator with asterisk - * Returns 0 on success, -1 on failure + * \return 0 on success, -1 on failure */ int ast_register_translator(struct ast_translator *t, void *module); @@ -153,7 +153,7 @@ int ast_register_translator(struct ast_translator *t, void *module); * \brief Unregister a translator * \param t translator to unregister * Unregisters the given tranlator - * Returns 0 on success, -1 on failure + * \return 0 on success, -1 on failure */ int ast_unregister_translator(struct ast_translator *t); @@ -171,7 +171,7 @@ int ast_translator_best_choice(int *dsts, int *srcs); * \param dest destination format * \param source source format * Build a path (possibly NULL) from source to dest - * Returns ast_trans_pvt on success, NULL on failure + * \return ast_trans_pvt on success, NULL on failure * */ struct ast_trans_pvt *ast_translator_build_path(int dest, int source); @@ -189,10 +189,18 @@ void ast_translator_free_path(struct ast_trans_pvt *tr); * \param consume Whether or not to free the original frame * Apply an input frame into the translator and receive zero or one output frames. Consume * determines whether the original frame should be freed - * Returns an ast_frame of the new translation format on success, NULL on failure + * \return an ast_frame of the new translation format on success, NULL on failure */ struct ast_frame *ast_translate(struct ast_trans_pvt *tr, struct ast_frame *f, int consume); +/*! + * \brief Returns the number of steps required to convert from 'src' to 'dest'. + * \param dest Destination format + * \param src Source format + * \return the number of translation steps required, or -1 if no path is available + */ +unsigned int ast_translate_path_steps(unsigned int dest, unsigned int src); + #if defined(__cplusplus) || defined(c_plusplus) } #endif |