From 5f5faa310a0f95523b9df5e429e4ee8369dead34 Mon Sep 17 00:00:00 2001 From: "Kevin P. Fleming" Date: Wed, 25 Oct 2006 14:55:11 +0000 Subject: Merged revisions 46082-46083,46152-46153 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r46082 | kpfleming | 2006-10-23 22:45:42 -0500 (Mon, 23 Oct 2006) | 2 lines add an API call to allow channel drivers to determine which media formats are compatible (passthrough or transcode) with the format an existing channel is already using ........ r46083 | kpfleming | 2006-10-23 22:53:32 -0500 (Mon, 23 Oct 2006) | 2 lines ensure that the translation matrix is properly lock-protected every place it is used ........ r46152 | kpfleming | 2006-10-24 18:45:19 -0500 (Tue, 24 Oct 2006) | 2 lines if multiple translators are registered for the same source/dest combination, ensure that the lowest-cost one is always inserted earlier in the list ........ r46153 | kpfleming | 2006-10-24 19:10:54 -0500 (Tue, 24 Oct 2006) | 2 lines code zone experiment: don't offer formats in the outbound INVITE that aren't either passthrough or translatable ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@46203 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- include/asterisk/translate.h | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'include/asterisk') diff --git a/include/asterisk/translate.h b/include/asterisk/translate.h index 07c0ae1c2..a03f54ef2 100644 --- a/include/asterisk/translate.h +++ b/include/asterisk/translate.h @@ -205,12 +205,26 @@ struct ast_frame *ast_translate(struct ast_trans_pvt *tr, struct ast_frame *f, i /*! * \brief Returns the number of steps required to convert from 'src' to 'dest'. - * \param dest Destination format - * \param src Source format + * \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); +/*! + * \brief Mask off unavailable formats from a format bitmask + * \param dest possible destination formats + * \param src source formats + * \return the destination formats that are available in the source or translatable + * + * The result will include all formats from 'dest' that are either present + * in 'src' or translatable from a format present in 'src'. + * + * Note that only a single audio format and a single video format can be + * present in 'src', or the function will produce unexpected results. + */ +unsigned int ast_translate_available_formats(unsigned int dest, unsigned int src); + #if defined(__cplusplus) || defined(c_plusplus) } #endif -- cgit v1.2.3