Benny Prijono | eb30bf5 | 2006-03-04 20:43:52 +0000 | [diff] [blame] | 1 | /* $Id$ */ |
| 2 | /* |
| 3 | * Copyright (C)2003-2006 Benny Prijono <benny@prijono.org> |
| 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_SPEEX_H__ |
| 20 | #define __PJMEDIA_CODEC_SPEEX_H__ |
| 21 | |
Benny Prijono | 37235af | 2006-06-18 02:02:36 +0000 | [diff] [blame] | 22 | /** |
| 23 | * @file speex.h |
| 24 | * @brief Speex codec header. |
| 25 | */ |
| 26 | |
Benny Prijono | eb30bf5 | 2006-03-04 20:43:52 +0000 | [diff] [blame] | 27 | #include <pjmedia-codec/types.h> |
| 28 | |
Benny Prijono | 37235af | 2006-06-18 02:02:36 +0000 | [diff] [blame] | 29 | /** |
Benny Prijono | 1ec70b3 | 2006-06-20 15:39:07 +0000 | [diff] [blame] | 30 | * @defgroup PJMED_SPEEX Speex Codec Family |
Benny Prijono | 37235af | 2006-06-18 02:02:36 +0000 | [diff] [blame] | 31 | * @ingroup PJMEDIA_CODEC |
| 32 | * @brief Implementation of Speex codecs (narrow/wide/ultrawide-band). |
| 33 | * @{ |
| 34 | * This section describes functions to register and register speex codec |
| 35 | * factory to the codec manager. After the codec factory has been registered, |
| 36 | * application can use @ref PJMEDIA_CODEC API to manipulate the codec. |
| 37 | * |
| 38 | * By default, the speex codec factory registers three Speex codecs: |
| 39 | * "speex/8000" narrowband codec, "speex/16000" wideband codec, and |
| 40 | * "speex/32000" ultra-wideband codec. This behavior can be changed by |
| 41 | * specifying #pjmedia_speex_options flags during initialization. |
| 42 | */ |
Benny Prijono | eb30bf5 | 2006-03-04 20:43:52 +0000 | [diff] [blame] | 43 | |
| 44 | PJ_BEGIN_DECL |
| 45 | |
| 46 | |
| 47 | /** |
| 48 | * Bitmask options to be passed during Speex codec factory initialization. |
| 49 | */ |
| 50 | enum pjmedia_speex_options |
| 51 | { |
| 52 | PJMEDIA_SPEEX_NO_NB = 1, /**< Disable narrowband mode. */ |
| 53 | PJMEDIA_SPEEX_NO_WB = 2, /**< Disable wideband mode. */ |
| 54 | PJMEDIA_SPEEX_NO_UWB = 4, /**< Disable ultra-wideband mode. */ |
| 55 | }; |
| 56 | |
| 57 | |
| 58 | /** |
| 59 | * Initialize and register Speex codec factory to pjmedia endpoint. |
| 60 | * |
| 61 | * @param endpt The pjmedia endpoint. |
| 62 | * @param options Bitmask of pjmedia_speex_options (default=0). |
| 63 | * @param quality Specify encoding quality, or use -1 for default |
| 64 | * (default=8). |
| 65 | * @param complexity Specify encoding complexity , or use -1 for default |
| 66 | * (default=8). |
| 67 | * |
| 68 | * @return PJ_SUCCESS on success. |
| 69 | */ |
| 70 | PJ_DECL(pj_status_t) pjmedia_codec_speex_init( pjmedia_endpt *endpt, |
| 71 | unsigned options, |
| 72 | int quality, |
| 73 | int complexity ); |
| 74 | |
| 75 | |
| 76 | /** |
| 77 | * Initialize Speex codec factory using default settings and register to |
| 78 | * pjmedia endpoint. |
| 79 | * |
| 80 | * @param endpt The pjmedia endpoint. |
Benny Prijono | eb30bf5 | 2006-03-04 20:43:52 +0000 | [diff] [blame] | 81 | * |
| 82 | * @return PJ_SUCCESS on success. |
| 83 | */ |
| 84 | PJ_DECL(pj_status_t) pjmedia_codec_speex_init_default(pjmedia_endpt *endpt); |
| 85 | |
| 86 | |
| 87 | |
| 88 | /** |
| 89 | * Unregister Speex codec factory from pjmedia endpoint and deinitialize |
| 90 | * the Speex codec library. |
| 91 | * |
| 92 | * @return PJ_SUCCESS on success. |
| 93 | */ |
| 94 | PJ_DECL(pj_status_t) pjmedia_codec_speex_deinit(void); |
| 95 | |
| 96 | |
| 97 | PJ_END_DECL |
| 98 | |
Benny Prijono | 37235af | 2006-06-18 02:02:36 +0000 | [diff] [blame] | 99 | /** |
| 100 | * @} |
| 101 | */ |
Benny Prijono | eb30bf5 | 2006-03-04 20:43:52 +0000 | [diff] [blame] | 102 | |
| 103 | #endif /* __PJMEDIA_CODEC_SPEEX_H__ */ |
| 104 | |