Benny Prijono | a4bf021 | 2006-02-10 15:57:08 +0000 | [diff] [blame] | 1 | /* $Id$ */ |
| 2 | /* |
Benny Prijono | 844653c | 2008-12-23 17:27:53 +0000 | [diff] [blame] | 3 | * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) |
| 4 | * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> |
Benny Prijono | a4bf021 | 2006-02-10 15:57:08 +0000 | [diff] [blame] | 5 | * |
| 6 | * This program is free software; you can redistribute it and/or modify |
| 7 | * it under the terms of the GNU General Public License as published by |
| 8 | * the Free Software Foundation; either version 2 of the License, or |
| 9 | * (at your option) any later version. |
| 10 | * |
| 11 | * This program is distributed in the hope that it will be useful, |
| 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 14 | * GNU General Public License for more details. |
| 15 | * |
| 16 | * You should have received a copy of the GNU General Public License |
| 17 | * along with this program; if not, write to the Free Software |
| 18 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
| 19 | */ |
| 20 | #ifndef __PJMEDIA_CODEC_CONFIG_H__ |
| 21 | #define __PJMEDIA_CODEC_CONFIG_H__ |
| 22 | |
Benny Prijono | 2e8cf63 | 2009-08-13 15:57:26 +0000 | [diff] [blame] | 23 | /** |
| 24 | * @file config.h |
| 25 | * @brief PJMEDIA-CODEC compile time settings |
| 26 | */ |
| 27 | |
| 28 | /** |
| 29 | * @defgroup pjmedia_codec_config PJMEDIA-CODEC Compile Time Settings |
| 30 | * @ingroup PJMEDIA_CODEC |
| 31 | * @brief Various compile time settings such as to enable/disable codecs |
| 32 | * @{ |
| 33 | */ |
| 34 | |
Benny Prijono | a4bf021 | 2006-02-10 15:57:08 +0000 | [diff] [blame] | 35 | #include <pjmedia/types.h> |
| 36 | |
Benny Prijono | 2e8cf63 | 2009-08-13 15:57:26 +0000 | [diff] [blame] | 37 | |
Benny Prijono | fe9bffd | 2007-01-27 17:44:13 +0000 | [diff] [blame] | 38 | /* |
| 39 | * Include config_auto.h if autoconf is used (PJ_AUTOCONF is set) |
| 40 | */ |
| 41 | #if defined(PJ_AUTOCONF) |
| 42 | # include <pjmedia-codec/config_auto.h> |
| 43 | #endif |
Benny Prijono | a4bf021 | 2006-02-10 15:57:08 +0000 | [diff] [blame] | 44 | |
Benny Prijono | 4381efe | 2006-03-16 14:24:26 +0000 | [diff] [blame] | 45 | /** |
Benny Prijono | a837c30 | 2006-04-27 22:36:40 +0000 | [diff] [blame] | 46 | * Unless specified otherwise, L16 codec is included by default. |
| 47 | */ |
| 48 | #ifndef PJMEDIA_HAS_L16_CODEC |
| 49 | # define PJMEDIA_HAS_L16_CODEC 1 |
| 50 | #endif |
| 51 | |
| 52 | |
| 53 | /** |
Benny Prijono | 4381efe | 2006-03-16 14:24:26 +0000 | [diff] [blame] | 54 | * Unless specified otherwise, GSM codec is included by default. |
Benny Prijono | a4bf021 | 2006-02-10 15:57:08 +0000 | [diff] [blame] | 55 | */ |
Benny Prijono | 4381efe | 2006-03-16 14:24:26 +0000 | [diff] [blame] | 56 | #ifndef PJMEDIA_HAS_GSM_CODEC |
| 57 | # define PJMEDIA_HAS_GSM_CODEC 1 |
Benny Prijono | a4bf021 | 2006-02-10 15:57:08 +0000 | [diff] [blame] | 58 | #endif |
| 59 | |
| 60 | |
Benny Prijono | 4381efe | 2006-03-16 14:24:26 +0000 | [diff] [blame] | 61 | /** |
| 62 | * Unless specified otherwise, Speex codec is included by default. |
Benny Prijono | eb30bf5 | 2006-03-04 20:43:52 +0000 | [diff] [blame] | 63 | */ |
Benny Prijono | 4381efe | 2006-03-16 14:24:26 +0000 | [diff] [blame] | 64 | #ifndef PJMEDIA_HAS_SPEEX_CODEC |
| 65 | # define PJMEDIA_HAS_SPEEX_CODEC 1 |
Benny Prijono | eb30bf5 | 2006-03-04 20:43:52 +0000 | [diff] [blame] | 66 | #endif |
| 67 | |
Nanang Izzuddin | 829ac02 | 2008-05-27 00:24:26 +0000 | [diff] [blame] | 68 | /** |
| 69 | * Speex codec default complexity setting. |
| 70 | */ |
| 71 | #ifndef PJMEDIA_CODEC_SPEEX_DEFAULT_COMPLEXITY |
| 72 | # define PJMEDIA_CODEC_SPEEX_DEFAULT_COMPLEXITY 2 |
| 73 | #endif |
| 74 | |
| 75 | /** |
Nanang Izzuddin | 9dbad15 | 2008-06-10 18:56:10 +0000 | [diff] [blame] | 76 | * Speex codec default quality setting. Please note that pjsua-lib may override |
| 77 | * this setting via its codec quality setting (i.e PJSUA_DEFAULT_CODEC_QUALITY). |
Nanang Izzuddin | 829ac02 | 2008-05-27 00:24:26 +0000 | [diff] [blame] | 78 | */ |
| 79 | #ifndef PJMEDIA_CODEC_SPEEX_DEFAULT_QUALITY |
Nanang Izzuddin | 9dbad15 | 2008-06-10 18:56:10 +0000 | [diff] [blame] | 80 | # define PJMEDIA_CODEC_SPEEX_DEFAULT_QUALITY 8 |
Nanang Izzuddin | 829ac02 | 2008-05-27 00:24:26 +0000 | [diff] [blame] | 81 | #endif |
| 82 | |
Benny Prijono | eb30bf5 | 2006-03-04 20:43:52 +0000 | [diff] [blame] | 83 | |
Benny Prijono | 00cae61 | 2006-07-31 15:19:36 +0000 | [diff] [blame] | 84 | /** |
| 85 | * Unless specified otherwise, iLBC codec is included by default. |
| 86 | */ |
| 87 | #ifndef PJMEDIA_HAS_ILBC_CODEC |
| 88 | # define PJMEDIA_HAS_ILBC_CODEC 1 |
| 89 | #endif |
| 90 | |
| 91 | |
Benny Prijono | 7ffd775 | 2008-03-17 14:07:53 +0000 | [diff] [blame] | 92 | /** |
| 93 | * Unless specified otherwise, G.722 codec is included by default. |
| 94 | */ |
| 95 | #ifndef PJMEDIA_HAS_G722_CODEC |
| 96 | # define PJMEDIA_HAS_G722_CODEC 1 |
| 97 | #endif |
| 98 | |
Benny Prijono | a4bf021 | 2006-02-10 15:57:08 +0000 | [diff] [blame] | 99 | |
Nanang Izzuddin | 493a8db | 2008-08-15 13:17:39 +0000 | [diff] [blame] | 100 | /** |
Nanang Izzuddin | c742f4e | 2010-06-11 13:38:42 +0000 | [diff] [blame] | 101 | * Default G.722 codec encoder and decoder level adjustment. The G.722 |
| 102 | * specifies that it uses 14 bit PCM for input and output, while PJMEDIA |
| 103 | * normally uses 16 bit PCM, so the conversion is done by applying |
| 104 | * level adjustment. If the value is non-zero, then PCM input samples to |
| 105 | * the encoder will be shifted right by this value, and similarly PCM |
| 106 | * output samples from the decoder will be shifted left by this value. |
| 107 | * |
| 108 | * This can be changed at run-time after initialization by calling |
| 109 | * #pjmedia_codec_g722_set_pcm_shift(). |
| 110 | * |
| 111 | * Default: 2. |
| 112 | */ |
| 113 | #ifndef PJMEDIA_G722_DEFAULT_PCM_SHIFT |
| 114 | # define PJMEDIA_G722_DEFAULT_PCM_SHIFT 2 |
| 115 | #endif |
| 116 | |
| 117 | |
| 118 | /** |
| 119 | * Specifies whether G.722 PCM shifting should be stopped when clipping |
| 120 | * detected in the decoder. Enabling this feature can be useful when |
| 121 | * talking to G.722 implementation that uses 16 bit PCM for G.722 input/ |
| 122 | * output (for any reason it seems to work) and the PCM shifting causes |
| 123 | * audio clipping. |
| 124 | * |
| 125 | * See also #PJMEDIA_G722_DEFAULT_PCM_SHIFT. |
| 126 | * |
| 127 | * Default: enabled. |
| 128 | */ |
| 129 | #ifndef PJMEDIA_G722_STOP_PCM_SHIFT_ON_CLIPPING |
| 130 | # define PJMEDIA_G722_STOP_PCM_SHIFT_ON_CLIPPING 1 |
| 131 | #endif |
| 132 | |
| 133 | |
| 134 | /** |
Benny Prijono | a4e7cdd | 2008-08-19 15:01:48 +0000 | [diff] [blame] | 135 | * Enable the features provided by Intel IPP libraries, for example |
| 136 | * codecs such as G.729, G.723.1, G.726, G.728, G.722.1, and AMR. |
| 137 | * |
| 138 | * By default this is disabled. Please follow the instructions in |
| 139 | * http://trac.pjsip.org/repos/wiki/Intel_IPP_Codecs on how to setup |
| 140 | * Intel IPP with PJMEDIA. |
Nanang Izzuddin | 493a8db | 2008-08-15 13:17:39 +0000 | [diff] [blame] | 141 | */ |
Benny Prijono | a4e7cdd | 2008-08-19 15:01:48 +0000 | [diff] [blame] | 142 | #ifndef PJMEDIA_HAS_INTEL_IPP |
| 143 | # define PJMEDIA_HAS_INTEL_IPP 0 |
Nanang Izzuddin | 493a8db | 2008-08-15 13:17:39 +0000 | [diff] [blame] | 144 | #endif |
Benny Prijono | fe9bffd | 2007-01-27 17:44:13 +0000 | [diff] [blame] | 145 | |
Benny Prijono | a4e7cdd | 2008-08-19 15:01:48 +0000 | [diff] [blame] | 146 | |
Nanang Izzuddin | 493a8db | 2008-08-15 13:17:39 +0000 | [diff] [blame] | 147 | /** |
Benny Prijono | a4e7cdd | 2008-08-19 15:01:48 +0000 | [diff] [blame] | 148 | * Visual Studio only: when this option is set, the Intel IPP libraries |
| 149 | * will be automatically linked to application using pragma(comment) |
| 150 | * constructs. This is convenient, however it will only link with |
| 151 | * the stub libraries and the Intel IPP DLL's will be required when |
| 152 | * distributing the application. |
| 153 | * |
| 154 | * If application wants to link with the different types of the Intel IPP |
| 155 | * libraries (for example, the static libraries), it must set this option |
| 156 | * to zero and specify the Intel IPP libraries in the application's input |
| 157 | * library specification manually. |
| 158 | * |
| 159 | * Default 1. |
| 160 | */ |
| 161 | #ifndef PJMEDIA_AUTO_LINK_IPP_LIBS |
| 162 | # define PJMEDIA_AUTO_LINK_IPP_LIBS 1 |
| 163 | #endif |
| 164 | |
| 165 | |
| 166 | /** |
| 167 | * Enable Intel IPP AMR codec. This also needs to be enabled when AMR WB |
| 168 | * codec is enabled. This option is only used when PJMEDIA_HAS_INTEL_IPP |
| 169 | * is enabled. |
| 170 | * |
| 171 | * Default: 1 |
Nanang Izzuddin | 493a8db | 2008-08-15 13:17:39 +0000 | [diff] [blame] | 172 | */ |
| 173 | #ifndef PJMEDIA_HAS_INTEL_IPP_CODEC_AMR |
| 174 | # define PJMEDIA_HAS_INTEL_IPP_CODEC_AMR 1 |
| 175 | #endif |
| 176 | |
Benny Prijono | a4e7cdd | 2008-08-19 15:01:48 +0000 | [diff] [blame] | 177 | |
| 178 | /** |
| 179 | * Enable Intel IPP AMR wideband codec. The PJMEDIA_HAS_INTEL_IPP_CODEC_AMR |
| 180 | * option must also be enabled to use this codec. This option is only used |
| 181 | * when PJMEDIA_HAS_INTEL_IPP is enabled. |
| 182 | * |
| 183 | * Default: 1 |
| 184 | */ |
Nanang Izzuddin | df361e0 | 2008-08-16 06:46:08 +0000 | [diff] [blame] | 185 | #ifndef PJMEDIA_HAS_INTEL_IPP_CODEC_AMRWB |
| 186 | # define PJMEDIA_HAS_INTEL_IPP_CODEC_AMRWB 1 |
| 187 | #endif |
| 188 | |
Benny Prijono | a4e7cdd | 2008-08-19 15:01:48 +0000 | [diff] [blame] | 189 | |
| 190 | /** |
| 191 | * Enable Intel IPP G.729 codec. This option is only used when |
| 192 | * PJMEDIA_HAS_INTEL_IPP is enabled. |
| 193 | * |
| 194 | * Default: 1 |
| 195 | */ |
Nanang Izzuddin | 493a8db | 2008-08-15 13:17:39 +0000 | [diff] [blame] | 196 | #ifndef PJMEDIA_HAS_INTEL_IPP_CODEC_G729 |
| 197 | # define PJMEDIA_HAS_INTEL_IPP_CODEC_G729 1 |
| 198 | #endif |
| 199 | |
Benny Prijono | a4e7cdd | 2008-08-19 15:01:48 +0000 | [diff] [blame] | 200 | |
| 201 | /** |
| 202 | * Enable Intel IPP G.723.1 codec. This option is only used when |
| 203 | * PJMEDIA_HAS_INTEL_IPP is enabled. |
| 204 | * |
| 205 | * Default: 1 |
| 206 | */ |
| 207 | #ifndef PJMEDIA_HAS_INTEL_IPP_CODEC_G723_1 |
| 208 | # define PJMEDIA_HAS_INTEL_IPP_CODEC_G723_1 1 |
Nanang Izzuddin | 493a8db | 2008-08-15 13:17:39 +0000 | [diff] [blame] | 209 | #endif |
| 210 | |
Benny Prijono | a4e7cdd | 2008-08-19 15:01:48 +0000 | [diff] [blame] | 211 | |
| 212 | /** |
| 213 | * Enable Intel IPP G.726 codec. This option is only used when |
| 214 | * PJMEDIA_HAS_INTEL_IPP is enabled. |
| 215 | * |
| 216 | * Default: 1 |
| 217 | */ |
Nanang Izzuddin | 493a8db | 2008-08-15 13:17:39 +0000 | [diff] [blame] | 218 | #ifndef PJMEDIA_HAS_INTEL_IPP_CODEC_G726 |
| 219 | # define PJMEDIA_HAS_INTEL_IPP_CODEC_G726 1 |
| 220 | #endif |
| 221 | |
Benny Prijono | a4e7cdd | 2008-08-19 15:01:48 +0000 | [diff] [blame] | 222 | |
| 223 | /** |
| 224 | * Enable Intel IPP G.728 codec. This option is only used when |
| 225 | * PJMEDIA_HAS_INTEL_IPP is enabled. |
| 226 | * |
| 227 | * Default: 1 |
| 228 | */ |
Nanang Izzuddin | 493a8db | 2008-08-15 13:17:39 +0000 | [diff] [blame] | 229 | #ifndef PJMEDIA_HAS_INTEL_IPP_CODEC_G728 |
| 230 | # define PJMEDIA_HAS_INTEL_IPP_CODEC_G728 1 |
| 231 | #endif |
| 232 | |
Benny Prijono | a4e7cdd | 2008-08-19 15:01:48 +0000 | [diff] [blame] | 233 | |
| 234 | /** |
| 235 | * Enable Intel IPP G.722.1 codec. This option is only used when |
| 236 | * PJMEDIA_HAS_INTEL_IPP is enabled. |
| 237 | * |
| 238 | * Default: 1 |
| 239 | */ |
Nanang Izzuddin | 493a8db | 2008-08-15 13:17:39 +0000 | [diff] [blame] | 240 | #ifndef PJMEDIA_HAS_INTEL_IPP_CODEC_G722_1 |
| 241 | # define PJMEDIA_HAS_INTEL_IPP_CODEC_G722_1 1 |
| 242 | #endif |
| 243 | |
Nanang Izzuddin | 4e50262 | 2009-01-28 18:03:12 +0000 | [diff] [blame] | 244 | /** |
| 245 | * Enable Passthrough codecs. |
| 246 | * |
| 247 | * Default: 0 |
| 248 | */ |
| 249 | #ifndef PJMEDIA_HAS_PASSTHROUGH_CODECS |
| 250 | # define PJMEDIA_HAS_PASSTHROUGH_CODECS 0 |
| 251 | #endif |
Nanang Izzuddin | 493a8db | 2008-08-15 13:17:39 +0000 | [diff] [blame] | 252 | |
Benny Prijono | 2e8cf63 | 2009-08-13 15:57:26 +0000 | [diff] [blame] | 253 | /** |
| 254 | * Enable AMR passthrough codec. |
| 255 | * |
| 256 | * Default: 1 |
| 257 | */ |
Nanang Izzuddin | 8cdba46 | 2009-01-29 20:06:28 +0000 | [diff] [blame] | 258 | #ifndef PJMEDIA_HAS_PASSTHROUGH_CODEC_AMR |
| 259 | # define PJMEDIA_HAS_PASSTHROUGH_CODEC_AMR 1 |
| 260 | #endif |
| 261 | |
Benny Prijono | 2e8cf63 | 2009-08-13 15:57:26 +0000 | [diff] [blame] | 262 | /** |
| 263 | * Enable G.729 passthrough codec. |
| 264 | * |
| 265 | * Default: 1 |
| 266 | */ |
Nanang Izzuddin | 8cdba46 | 2009-01-29 20:06:28 +0000 | [diff] [blame] | 267 | #ifndef PJMEDIA_HAS_PASSTHROUGH_CODEC_G729 |
| 268 | # define PJMEDIA_HAS_PASSTHROUGH_CODEC_G729 1 |
| 269 | #endif |
| 270 | |
Benny Prijono | 2e8cf63 | 2009-08-13 15:57:26 +0000 | [diff] [blame] | 271 | /** |
| 272 | * Enable iLBC passthrough codec. |
| 273 | * |
| 274 | * Default: 1 |
| 275 | */ |
Nanang Izzuddin | 8cdba46 | 2009-01-29 20:06:28 +0000 | [diff] [blame] | 276 | #ifndef PJMEDIA_HAS_PASSTHROUGH_CODEC_ILBC |
| 277 | # define PJMEDIA_HAS_PASSTHROUGH_CODEC_ILBC 1 |
| 278 | #endif |
| 279 | |
Benny Prijono | 2e8cf63 | 2009-08-13 15:57:26 +0000 | [diff] [blame] | 280 | /** |
| 281 | * Enable PCMU passthrough codec. |
| 282 | * |
| 283 | * Default: 1 |
| 284 | */ |
Nanang Izzuddin | 8cdba46 | 2009-01-29 20:06:28 +0000 | [diff] [blame] | 285 | #ifndef PJMEDIA_HAS_PASSTHROUGH_CODEC_PCMU |
| 286 | # define PJMEDIA_HAS_PASSTHROUGH_CODEC_PCMU 1 |
| 287 | #endif |
| 288 | |
Benny Prijono | 2e8cf63 | 2009-08-13 15:57:26 +0000 | [diff] [blame] | 289 | /** |
| 290 | * Enable PCMA passthrough codec. |
| 291 | * |
| 292 | * Default: 1 |
| 293 | */ |
Nanang Izzuddin | 81db8c7 | 2009-02-05 10:59:14 +0000 | [diff] [blame] | 294 | #ifndef PJMEDIA_HAS_PASSTHROUGH_CODEC_PCMA |
Nanang Izzuddin | 8cdba46 | 2009-01-29 20:06:28 +0000 | [diff] [blame] | 295 | # define PJMEDIA_HAS_PASSTHROUGH_CODEC_PCMA 1 |
| 296 | #endif |
| 297 | |
Benny Prijono | 729d01a | 2009-03-18 12:49:18 +0000 | [diff] [blame] | 298 | /* If passthrough and PCMU/PCMA are enabled, disable the software |
| 299 | * G.711 codec |
| 300 | */ |
| 301 | #if PJMEDIA_HAS_PASSTHROUGH_CODECS && \ |
| 302 | (PJMEDIA_HAS_PASSTHROUGH_CODEC_PCMU || PJMEDIA_HAS_PASSTHROUGH_CODEC_PCMA) |
| 303 | # undef PJMEDIA_HAS_G711_CODEC |
| 304 | # define PJMEDIA_HAS_G711_CODEC 0 |
| 305 | #endif |
| 306 | |
| 307 | |
Nanang Izzuddin | 57b8857 | 2009-04-01 12:05:34 +0000 | [diff] [blame] | 308 | /** |
Nanang Izzuddin | e3cddc8 | 2009-05-06 19:13:16 +0000 | [diff] [blame] | 309 | * G.722.1 codec is disabled by default. |
Nanang Izzuddin | 57b8857 | 2009-04-01 12:05:34 +0000 | [diff] [blame] | 310 | */ |
| 311 | #ifndef PJMEDIA_HAS_G7221_CODEC |
Benny Prijono | 8496b93 | 2009-04-20 14:19:11 +0000 | [diff] [blame] | 312 | # define PJMEDIA_HAS_G7221_CODEC 0 |
Nanang Izzuddin | 57b8857 | 2009-04-01 12:05:34 +0000 | [diff] [blame] | 313 | #endif |
| 314 | |
Benny Prijono | 8496b93 | 2009-04-20 14:19:11 +0000 | [diff] [blame] | 315 | /** |
| 316 | * Default G.722.1 codec encoder and decoder level adjustment. |
| 317 | * If the value is non-zero, then PCM input samples to the encoder will |
| 318 | * be shifted right by this value, and similarly PCM output samples from |
| 319 | * the decoder will be shifted left by this value. |
| 320 | * |
| 321 | * This can be changed at run-time after initialization by calling |
| 322 | * #pjmedia_codec_g7221_set_pcm_shift(). |
| 323 | */ |
| 324 | #ifndef PJMEDIA_G7221_DEFAULT_PCM_SHIFT |
| 325 | # define PJMEDIA_G7221_DEFAULT_PCM_SHIFT 1 |
| 326 | #endif |
| 327 | |
| 328 | |
Nanang Izzuddin | e2cdc86 | 2009-06-16 10:46:03 +0000 | [diff] [blame] | 329 | /** |
| 330 | * Enabling both G.722.1 codec implementations, internal PJMEDIA and IPP, |
| 331 | * may cause problem in SDP, i.e: payload types duplications. So, let's |
| 332 | * just trap such case here at compile time. |
| 333 | * |
| 334 | * Application can control which implementation to be used by manipulating |
| 335 | * PJMEDIA_HAS_G7221_CODEC and PJMEDIA_HAS_INTEL_IPP_CODEC_G722_1 in |
| 336 | * config_site.h. |
| 337 | */ |
| 338 | #if (PJMEDIA_HAS_G7221_CODEC != 0) && (PJMEDIA_HAS_INTEL_IPP != 0) && \ |
| 339 | (PJMEDIA_HAS_INTEL_IPP_CODEC_G722_1 != 0) |
| 340 | # error Only one G.722.1 implementation can be enabled at the same time. \ |
| 341 | Please use PJMEDIA_HAS_G7221_CODEC and \ |
| 342 | PJMEDIA_HAS_INTEL_IPP_CODEC_G722_1 in your config_site.h \ |
| 343 | to control which implementation to be used. |
| 344 | #endif |
Nanang Izzuddin | 57b8857 | 2009-04-01 12:05:34 +0000 | [diff] [blame] | 345 | |
Benny Prijono | 2e8cf63 | 2009-08-13 15:57:26 +0000 | [diff] [blame] | 346 | /** |
| 347 | * @} |
| 348 | */ |
| 349 | |
Nanang Izzuddin | 493a8db | 2008-08-15 13:17:39 +0000 | [diff] [blame] | 350 | #endif /* __PJMEDIA_CODEC_CONFIG_H__ */ |