Tristan Matthews | 0a329cc | 2013-07-17 13:20:14 -0400 | [diff] [blame] | 1 | /* $Id$ */ |
| 2 | /* |
| 3 | * Copyright (C) 2011-2011 Teluu Inc. (http://www.teluu.com) |
| 4 | * |
| 5 | * This program is free software; you can redistribute it and/or modify |
| 6 | * it under the terms of the GNU General Public License as published by |
| 7 | * the Free Software Foundation; either version 2 of the License, or |
| 8 | * (at your option) any later version. |
| 9 | * |
| 10 | * This program is distributed in the hope that it will be useful, |
| 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 13 | * GNU General Public License for more details. |
| 14 | * |
| 15 | * You should have received a copy of the GNU General Public License |
| 16 | * along with this program; if not, write to the Free Software |
| 17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
| 18 | */ |
| 19 | #ifndef __PJMEDIA_CODEC_ALL_CODECS_H__ |
| 20 | #define __PJMEDIA_CODEC_ALL_CODECS_H__ |
| 21 | |
| 22 | /** |
| 23 | * @file pjmedia-codec/all_codecs.h |
| 24 | * @brief Helper function to register all codecs |
| 25 | */ |
| 26 | #include <pjmedia/endpoint.h> |
| 27 | #include <pjmedia-codec/passthrough.h> |
| 28 | |
| 29 | |
| 30 | PJ_BEGIN_DECL |
| 31 | |
| 32 | /** |
| 33 | * @defgroup PJMEDIA_CODEC_REGISTER_ALL Codec registration helper |
| 34 | * @ingroup PJMEDIA_CODEC_CODECS |
| 35 | * @brief Helper function to register all codecs |
| 36 | * @{ |
| 37 | * |
| 38 | * Helper function to register all codecs that are implemented in |
| 39 | * PJMEDIA-CODEC library. |
| 40 | */ |
| 41 | |
| 42 | /** |
| 43 | * Codec configuration. Call #pjmedia_audio_codec_config_default() to initialize |
| 44 | * this structure with the default values. |
| 45 | */ |
| 46 | typedef struct pjmedia_audio_codec_config |
| 47 | { |
| 48 | /** Speex codec settings. See #pjmedia_codec_speex_init() for more info */ |
| 49 | struct { |
| 50 | unsigned option; /**< Bitmask of options. */ |
| 51 | int quality; /**< Codec quality. */ |
| 52 | int complexity; /**< Codec complexity. */ |
| 53 | } speex; |
| 54 | |
| 55 | /** iLBC settings */ |
| 56 | struct { |
| 57 | unsigned mode; /**< iLBC mode. */ |
| 58 | } ilbc; |
| 59 | |
| 60 | /** Passthrough */ |
| 61 | struct { |
| 62 | pjmedia_codec_passthrough_setting setting; /**< Passthrough */ |
| 63 | } passthrough; |
| 64 | |
| 65 | } pjmedia_audio_codec_config; |
| 66 | |
| 67 | |
| 68 | /** |
| 69 | * Initialize pjmedia_audio_codec_config structure with default values. |
| 70 | * |
| 71 | * @param cfg The codec config to be initialized. |
| 72 | */ |
| 73 | PJ_DECL(void) |
| 74 | pjmedia_audio_codec_config_default(pjmedia_audio_codec_config *cfg); |
| 75 | |
| 76 | /** |
| 77 | * Register all known audio codecs implemented in PJMEDA-CODEC library to the |
| 78 | * specified media endpoint. |
| 79 | * |
| 80 | * @param endpt The media endpoint. |
| 81 | * @param c Optional codec configuration, or NULL to use default |
| 82 | * values. |
| 83 | * |
| 84 | * @return PJ_SUCCESS on success or the appropriate error code. |
| 85 | */ |
| 86 | PJ_DECL(pj_status_t) |
| 87 | pjmedia_codec_register_audio_codecs(pjmedia_endpt *endpt, |
| 88 | const pjmedia_audio_codec_config *c); |
| 89 | |
| 90 | |
| 91 | /** |
| 92 | * @} PJMEDIA_CODEC_REGISTER_ALL |
| 93 | */ |
| 94 | |
| 95 | |
| 96 | PJ_END_DECL |
| 97 | |
| 98 | #endif /* __PJMEDIA_CODEC_ALL_CODECS_H__ */ |