Alexandre Lision | 8af73cb | 2013-12-10 14:11:20 -0500 | [diff] [blame] | 1 | /* $Id$ */ |
| 2 | /* |
| 3 | * Copyright (C) 2008-2011 Teluu Inc. (http://www.teluu.com) |
| 4 | * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> |
| 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 | |
| 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 | |
| 35 | #include <pjmedia/types.h> |
| 36 | |
| 37 | /* |
| 38 | * Include config_auto.h if autoconf is used (PJ_AUTOCONF is set) |
| 39 | */ |
| 40 | #if defined(PJ_AUTOCONF) |
| 41 | # include <pjmedia-codec/config_auto.h> |
| 42 | #endif |
| 43 | |
| 44 | |
| 45 | /** |
| 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 | /** |
| 54 | * Unless specified otherwise, GSM codec is included by default. |
| 55 | */ |
| 56 | #ifndef PJMEDIA_HAS_GSM_CODEC |
| 57 | # define PJMEDIA_HAS_GSM_CODEC 1 |
| 58 | #endif |
| 59 | |
| 60 | |
| 61 | /** |
| 62 | * Unless specified otherwise, Speex codec is included by default. |
| 63 | */ |
| 64 | #ifndef PJMEDIA_HAS_SPEEX_CODEC |
| 65 | # define PJMEDIA_HAS_SPEEX_CODEC 1 |
| 66 | #endif |
| 67 | |
| 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 | /** |
| 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). |
| 78 | */ |
| 79 | #ifndef PJMEDIA_CODEC_SPEEX_DEFAULT_QUALITY |
| 80 | # define PJMEDIA_CODEC_SPEEX_DEFAULT_QUALITY 8 |
| 81 | #endif |
| 82 | |
| 83 | |
| 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 | |
| 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 | |
| 99 | |
| 100 | /** |
| 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 | /** |
| 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. |
| 141 | */ |
| 142 | #ifndef PJMEDIA_HAS_INTEL_IPP |
| 143 | # define PJMEDIA_HAS_INTEL_IPP 0 |
| 144 | #endif |
| 145 | |
| 146 | |
| 147 | /** |
| 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 |
| 172 | */ |
| 173 | #ifndef PJMEDIA_HAS_INTEL_IPP_CODEC_AMR |
| 174 | # define PJMEDIA_HAS_INTEL_IPP_CODEC_AMR 1 |
| 175 | #endif |
| 176 | |
| 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 | */ |
| 185 | #ifndef PJMEDIA_HAS_INTEL_IPP_CODEC_AMRWB |
| 186 | # define PJMEDIA_HAS_INTEL_IPP_CODEC_AMRWB 1 |
| 187 | #endif |
| 188 | |
| 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 | */ |
| 196 | #ifndef PJMEDIA_HAS_INTEL_IPP_CODEC_G729 |
| 197 | # define PJMEDIA_HAS_INTEL_IPP_CODEC_G729 1 |
| 198 | #endif |
| 199 | |
| 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 |
| 209 | #endif |
| 210 | |
| 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 | */ |
| 218 | #ifndef PJMEDIA_HAS_INTEL_IPP_CODEC_G726 |
| 219 | # define PJMEDIA_HAS_INTEL_IPP_CODEC_G726 1 |
| 220 | #endif |
| 221 | |
| 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 | */ |
| 229 | #ifndef PJMEDIA_HAS_INTEL_IPP_CODEC_G728 |
| 230 | # define PJMEDIA_HAS_INTEL_IPP_CODEC_G728 1 |
| 231 | #endif |
| 232 | |
| 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 | */ |
| 240 | #ifndef PJMEDIA_HAS_INTEL_IPP_CODEC_G722_1 |
| 241 | # define PJMEDIA_HAS_INTEL_IPP_CODEC_G722_1 1 |
| 242 | #endif |
| 243 | |
| 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 |
| 252 | |
| 253 | /** |
| 254 | * Enable AMR passthrough codec. |
| 255 | * |
| 256 | * Default: 1 |
| 257 | */ |
| 258 | #ifndef PJMEDIA_HAS_PASSTHROUGH_CODEC_AMR |
| 259 | # define PJMEDIA_HAS_PASSTHROUGH_CODEC_AMR 1 |
| 260 | #endif |
| 261 | |
| 262 | /** |
| 263 | * Enable G.729 passthrough codec. |
| 264 | * |
| 265 | * Default: 1 |
| 266 | */ |
| 267 | #ifndef PJMEDIA_HAS_PASSTHROUGH_CODEC_G729 |
| 268 | # define PJMEDIA_HAS_PASSTHROUGH_CODEC_G729 1 |
| 269 | #endif |
| 270 | |
| 271 | /** |
| 272 | * Enable iLBC passthrough codec. |
| 273 | * |
| 274 | * Default: 1 |
| 275 | */ |
| 276 | #ifndef PJMEDIA_HAS_PASSTHROUGH_CODEC_ILBC |
| 277 | # define PJMEDIA_HAS_PASSTHROUGH_CODEC_ILBC 1 |
| 278 | #endif |
| 279 | |
| 280 | /** |
| 281 | * Enable PCMU passthrough codec. |
| 282 | * |
| 283 | * Default: 1 |
| 284 | */ |
| 285 | #ifndef PJMEDIA_HAS_PASSTHROUGH_CODEC_PCMU |
| 286 | # define PJMEDIA_HAS_PASSTHROUGH_CODEC_PCMU 1 |
| 287 | #endif |
| 288 | |
| 289 | /** |
| 290 | * Enable PCMA passthrough codec. |
| 291 | * |
| 292 | * Default: 1 |
| 293 | */ |
| 294 | #ifndef PJMEDIA_HAS_PASSTHROUGH_CODEC_PCMA |
| 295 | # define PJMEDIA_HAS_PASSTHROUGH_CODEC_PCMA 1 |
| 296 | #endif |
| 297 | |
| 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 | |
| 308 | /** |
| 309 | * G.722.1 codec is disabled by default. |
| 310 | */ |
| 311 | #ifndef PJMEDIA_HAS_G7221_CODEC |
| 312 | # define PJMEDIA_HAS_G7221_CODEC 0 |
| 313 | #endif |
| 314 | |
| 315 | /** |
| 316 | * Enable OpenCORE AMR-NB codec. |
| 317 | * See https://trac.pjsip.org/repos/ticket/1388 for some info. |
| 318 | * |
| 319 | * Default: 0 |
| 320 | */ |
| 321 | #ifndef PJMEDIA_HAS_OPENCORE_AMRNB_CODEC |
| 322 | # define PJMEDIA_HAS_OPENCORE_AMRNB_CODEC 0 |
| 323 | #endif |
| 324 | |
| 325 | /** |
| 326 | * Enable OpenCORE AMR-WB codec. |
| 327 | * See https://trac.pjsip.org/repos/ticket/1608 for some info. |
| 328 | * |
| 329 | * Default: 0 |
| 330 | */ |
| 331 | #ifndef PJMEDIA_HAS_OPENCORE_AMRWB_CODEC |
| 332 | # define PJMEDIA_HAS_OPENCORE_AMRWB_CODEC 0 |
| 333 | #endif |
| 334 | |
| 335 | /** |
| 336 | * Link with libopencore-amrXX via pragma comment on Visual Studio. |
| 337 | * This option only makes sense if PJMEDIA_HAS_OPENCORE_AMRNB/WB_CODEC |
| 338 | * is enabled. |
| 339 | * |
| 340 | * Default: 1 |
| 341 | */ |
| 342 | #ifndef PJMEDIA_AUTO_LINK_OPENCORE_AMR_LIBS |
| 343 | # define PJMEDIA_AUTO_LINK_OPENCORE_AMR_LIBS 1 |
| 344 | #endif |
| 345 | |
| 346 | /** |
| 347 | * Link with libopencore-amrXX.a that has been produced with gcc. |
| 348 | * This option only makes sense if PJMEDIA_HAS_OPENCORE_AMRNB/WB_CODEC |
| 349 | * and PJMEDIA_AUTO_LINK_OPENCORE_AMR_LIBS are enabled. |
| 350 | * |
| 351 | * Default: 1 |
| 352 | */ |
| 353 | #ifndef PJMEDIA_OPENCORE_AMR_BUILT_WITH_GCC |
| 354 | # define PJMEDIA_OPENCORE_AMR_BUILT_WITH_GCC 1 |
| 355 | #endif |
| 356 | |
| 357 | |
| 358 | /** |
| 359 | * Default G.722.1 codec encoder and decoder level adjustment. |
| 360 | * If the value is non-zero, then PCM input samples to the encoder will |
| 361 | * be shifted right by this value, and similarly PCM output samples from |
| 362 | * the decoder will be shifted left by this value. |
| 363 | * |
| 364 | * This can be changed at run-time after initialization by calling |
| 365 | * #pjmedia_codec_g7221_set_pcm_shift(). |
| 366 | */ |
| 367 | #ifndef PJMEDIA_G7221_DEFAULT_PCM_SHIFT |
| 368 | # define PJMEDIA_G7221_DEFAULT_PCM_SHIFT 1 |
| 369 | #endif |
| 370 | |
| 371 | |
| 372 | /** |
| 373 | * Enabling both G.722.1 codec implementations, internal PJMEDIA and IPP, |
| 374 | * may cause problem in SDP, i.e: payload types duplications. So, let's |
| 375 | * just trap such case here at compile time. |
| 376 | * |
| 377 | * Application can control which implementation to be used by manipulating |
| 378 | * PJMEDIA_HAS_G7221_CODEC and PJMEDIA_HAS_INTEL_IPP_CODEC_G722_1 in |
| 379 | * config_site.h. |
| 380 | */ |
| 381 | #if (PJMEDIA_HAS_G7221_CODEC != 0) && (PJMEDIA_HAS_INTEL_IPP != 0) && \ |
| 382 | (PJMEDIA_HAS_INTEL_IPP_CODEC_G722_1 != 0) |
| 383 | # error Only one G.722.1 implementation can be enabled at the same time. \ |
| 384 | Please use PJMEDIA_HAS_G7221_CODEC and \ |
| 385 | PJMEDIA_HAS_INTEL_IPP_CODEC_G722_1 in your config_site.h \ |
| 386 | to control which implementation to be used. |
| 387 | #endif |
| 388 | |
| 389 | |
| 390 | /** |
| 391 | * Enable SILK codec. |
| 392 | * |
| 393 | * Default: 0 |
| 394 | */ |
| 395 | #ifndef PJMEDIA_HAS_SILK_CODEC |
| 396 | # define PJMEDIA_HAS_SILK_CODEC 0 |
| 397 | #endif |
| 398 | |
| 399 | |
| 400 | /** |
| 401 | * SILK codec default complexity setting, valid values are 0 (lowest), 1, |
| 402 | * and 2. |
| 403 | * |
| 404 | * Default: 2 |
| 405 | */ |
| 406 | #ifndef PJMEDIA_CODEC_SILK_DEFAULT_COMPLEXITY |
| 407 | # define PJMEDIA_CODEC_SILK_DEFAULT_COMPLEXITY 2 |
| 408 | #endif |
| 409 | |
| 410 | /** |
| 411 | * SILK codec default quality setting, valid values are ranging from |
| 412 | * 0 (lowest) to 10. Please note that pjsua-lib may override this setting |
| 413 | * via its codec quality setting (i.e PJSUA_DEFAULT_CODEC_QUALITY). |
| 414 | * |
| 415 | * Default: 10 |
| 416 | */ |
| 417 | #ifndef PJMEDIA_CODEC_SILK_DEFAULT_QUALITY |
| 418 | # define PJMEDIA_CODEC_SILK_DEFAULT_QUALITY 10 |
| 419 | #endif |
| 420 | |
| 421 | |
| 422 | /** |
| 423 | * Specify if FFMPEG codecs are available. |
| 424 | * |
| 425 | * Default: PJMEDIA_HAS_LIBAVCODEC |
| 426 | */ |
| 427 | #ifndef PJMEDIA_HAS_FFMPEG_CODEC |
| 428 | # define PJMEDIA_HAS_FFMPEG_CODEC PJMEDIA_HAS_LIBAVCODEC |
| 429 | #endif |
| 430 | |
| 431 | |
| 432 | /** |
| 433 | * Specify if FFMPEG video codecs are available. |
| 434 | * |
| 435 | * Default: PJMEDIA_HAS_FFMPEG_CODEC |
| 436 | */ |
| 437 | #ifndef PJMEDIA_HAS_FFMPEG_VID_CODEC |
| 438 | # define PJMEDIA_HAS_FFMPEG_VID_CODEC PJMEDIA_HAS_FFMPEG_CODEC |
| 439 | #endif |
| 440 | |
| 441 | /** |
| 442 | * Enable FFMPEG H263+/H263-1998 codec. |
| 443 | * |
| 444 | * Default: 1 |
| 445 | */ |
| 446 | #ifndef PJMEDIA_HAS_FFMPEG_CODEC_H263P |
| 447 | # define PJMEDIA_HAS_FFMPEG_CODEC_H263P PJMEDIA_HAS_FFMPEG_VID_CODEC |
| 448 | #endif |
| 449 | |
| 450 | /** |
| 451 | * Enable FFMPEG H264 codec (requires libx264). |
| 452 | * |
| 453 | * Default: 0 |
| 454 | */ |
| 455 | #ifndef PJMEDIA_HAS_FFMPEG_CODEC_H264 |
| 456 | # define PJMEDIA_HAS_FFMPEG_CODEC_H264 PJMEDIA_HAS_FFMPEG_VID_CODEC |
| 457 | #endif |
| 458 | |
| 459 | /** |
| 460 | * @} |
| 461 | */ |
| 462 | |
| 463 | |
| 464 | |
| 465 | #endif /* __PJMEDIA_CODEC_CONFIG_H__ */ |