channels/iax2/include/format_compatibility.h

Go to the documentation of this file.
00001 /*
00002  * Asterisk -- An open source telephony toolkit.
00003  *
00004  * Copyright (C) 2014, Digium, Inc.
00005  *
00006  * Joshua Colp <jcolp@digium.com>
00007  *
00008  * See http://www.asterisk.org for more information about
00009  * the Asterisk project. Please do not directly contact
00010  * any of the maintainers of this project for assistance;
00011  * the project provides a web site, mailing lists and IRC
00012  * channels for your use.
00013  *
00014  * This program is free software, distributed under the terms of
00015  * the GNU General Public License Version 2. See the LICENSE file
00016  * at the top of the source tree.
00017  */
00018 
00019 /*!
00020  * \file
00021  * \brief Media Format Bitfield Compatibility API
00022  *
00023  * \author Joshua Colp <jcolp@digium.com>
00024  */
00025 
00026 #ifndef _IAX2_FORMAT_COMPATIBILITY_H_
00027 #define _IAX2_FORMAT_COMPATIBILITY_H_
00028 
00029 struct ast_format;
00030 struct ast_format_cap;
00031 
00032 /*!
00033  * \brief Convert a format capabilities structure to a bitfield
00034  *
00035  * \param cap Capabilities structure containing formats
00036  *
00037  * \retval non-zero success
00038  * \retval zero no formats present or no formats supported
00039  */
00040 uint64_t iax2_format_compatibility_cap2bitfield(const struct ast_format_cap *cap);
00041 
00042 /*!
00043  * \brief Convert a bitfield to a format capabilities structure
00044  *
00045  * \param bitfield The bitfield for the media formats
00046  * \param cap Capabilities structure to place formats into
00047  *
00048  * \retval 0 on success.
00049  * \retval -1 on error.
00050  *
00051  * \note If failure occurs the capabilities structure may contain a partial set of formats
00052  */
00053 int iax2_format_compatibility_bitfield2cap(uint64_t bitfield, struct ast_format_cap *cap);
00054 
00055 /*!
00056  * \brief Pick the best format from the given bitfield formats.
00057  *
00058  * \param formats The bitfield for the media formats
00059  *
00060  * \retval non-zero Best format out of the given formats.
00061  * \retval zero No formats present or no formats considered best.
00062  */
00063 uint64_t iax2_format_compatibility_best(uint64_t formats);
00064 
00065 #endif /* _IAX2_FORMAT_COMPATIBILITY_H */

Generated on Thu Apr 16 06:27:34 2015 for Asterisk - The Open Source Telephony Project by  doxygen 1.5.6