blob: 1480e2258cfd7683fed199dddb03583ea28a33fd [file] [log] [blame]
Benny Prijonoa4bf0212006-02-10 15:57:08 +00001/* $Id$ */
2/*
Benny Prijono844653c2008-12-23 17:27:53 +00003 * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com)
4 * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org>
Benny Prijonoa4bf0212006-02-10 15:57:08 +00005 *
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 Prijono2e8cf632009-08-13 15:57:26 +000023/**
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 Prijonoa4bf0212006-02-10 15:57:08 +000035#include <pjmedia/types.h>
36
Benny Prijonofe9bffd2007-01-27 17:44:13 +000037/*
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
Benny Prijonoa4bf0212006-02-10 15:57:08 +000043
Benny Prijonoc45d9512010-12-10 11:04:30 +000044
Benny Prijono4381efe2006-03-16 14:24:26 +000045/**
Benny Prijonoa837c302006-04-27 22:36:40 +000046 * 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 Prijono4381efe2006-03-16 14:24:26 +000054 * Unless specified otherwise, GSM codec is included by default.
Benny Prijonoa4bf0212006-02-10 15:57:08 +000055 */
Benny Prijono4381efe2006-03-16 14:24:26 +000056#ifndef PJMEDIA_HAS_GSM_CODEC
57# define PJMEDIA_HAS_GSM_CODEC 1
Benny Prijonoa4bf0212006-02-10 15:57:08 +000058#endif
59
60
Benny Prijono4381efe2006-03-16 14:24:26 +000061/**
62 * Unless specified otherwise, Speex codec is included by default.
Benny Prijonoeb30bf52006-03-04 20:43:52 +000063 */
Benny Prijono4381efe2006-03-16 14:24:26 +000064#ifndef PJMEDIA_HAS_SPEEX_CODEC
65# define PJMEDIA_HAS_SPEEX_CODEC 1
Benny Prijonoeb30bf52006-03-04 20:43:52 +000066#endif
67
Nanang Izzuddin829ac022008-05-27 00:24:26 +000068/**
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 Izzuddin9dbad152008-06-10 18:56:10 +000076 * 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 Izzuddin829ac022008-05-27 00:24:26 +000078 */
79#ifndef PJMEDIA_CODEC_SPEEX_DEFAULT_QUALITY
Nanang Izzuddin9dbad152008-06-10 18:56:10 +000080# define PJMEDIA_CODEC_SPEEX_DEFAULT_QUALITY 8
Nanang Izzuddin829ac022008-05-27 00:24:26 +000081#endif
82
Benny Prijonoeb30bf52006-03-04 20:43:52 +000083
Benny Prijono00cae612006-07-31 15:19:36 +000084/**
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 Prijono7ffd7752008-03-17 14:07:53 +000092/**
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 Prijonoa4bf0212006-02-10 15:57:08 +000099
Nanang Izzuddin493a8db2008-08-15 13:17:39 +0000100/**
Nanang Izzuddinc742f4e2010-06-11 13:38:42 +0000101 * 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 Prijonoa4e7cdd2008-08-19 15:01:48 +0000135 * 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 Izzuddin493a8db2008-08-15 13:17:39 +0000141 */
Benny Prijonoa4e7cdd2008-08-19 15:01:48 +0000142#ifndef PJMEDIA_HAS_INTEL_IPP
143# define PJMEDIA_HAS_INTEL_IPP 0
Nanang Izzuddin493a8db2008-08-15 13:17:39 +0000144#endif
Benny Prijonofe9bffd2007-01-27 17:44:13 +0000145
Benny Prijonoa4e7cdd2008-08-19 15:01:48 +0000146
Nanang Izzuddin493a8db2008-08-15 13:17:39 +0000147/**
Benny Prijonoa4e7cdd2008-08-19 15:01:48 +0000148 * 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 Izzuddin493a8db2008-08-15 13:17:39 +0000172 */
173#ifndef PJMEDIA_HAS_INTEL_IPP_CODEC_AMR
174# define PJMEDIA_HAS_INTEL_IPP_CODEC_AMR 1
175#endif
176
Benny Prijonoa4e7cdd2008-08-19 15:01:48 +0000177
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 Izzuddindf361e02008-08-16 06:46:08 +0000185#ifndef PJMEDIA_HAS_INTEL_IPP_CODEC_AMRWB
186# define PJMEDIA_HAS_INTEL_IPP_CODEC_AMRWB 1
187#endif
188
Benny Prijonoa4e7cdd2008-08-19 15:01:48 +0000189
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 Izzuddin493a8db2008-08-15 13:17:39 +0000196#ifndef PJMEDIA_HAS_INTEL_IPP_CODEC_G729
197# define PJMEDIA_HAS_INTEL_IPP_CODEC_G729 1
198#endif
199
Benny Prijonoa4e7cdd2008-08-19 15:01:48 +0000200
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 Izzuddin493a8db2008-08-15 13:17:39 +0000209#endif
210
Benny Prijonoa4e7cdd2008-08-19 15:01:48 +0000211
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 Izzuddin493a8db2008-08-15 13:17:39 +0000218#ifndef PJMEDIA_HAS_INTEL_IPP_CODEC_G726
219# define PJMEDIA_HAS_INTEL_IPP_CODEC_G726 1
220#endif
221
Benny Prijonoa4e7cdd2008-08-19 15:01:48 +0000222
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 Izzuddin493a8db2008-08-15 13:17:39 +0000229#ifndef PJMEDIA_HAS_INTEL_IPP_CODEC_G728
230# define PJMEDIA_HAS_INTEL_IPP_CODEC_G728 1
231#endif
232
Benny Prijonoa4e7cdd2008-08-19 15:01:48 +0000233
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 Izzuddin493a8db2008-08-15 13:17:39 +0000240#ifndef PJMEDIA_HAS_INTEL_IPP_CODEC_G722_1
241# define PJMEDIA_HAS_INTEL_IPP_CODEC_G722_1 1
242#endif
243
Nanang Izzuddin4e502622009-01-28 18:03:12 +0000244/**
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 Izzuddin493a8db2008-08-15 13:17:39 +0000252
Benny Prijono2e8cf632009-08-13 15:57:26 +0000253/**
254 * Enable AMR passthrough codec.
255 *
256 * Default: 1
257 */
Nanang Izzuddin8cdba462009-01-29 20:06:28 +0000258#ifndef PJMEDIA_HAS_PASSTHROUGH_CODEC_AMR
259# define PJMEDIA_HAS_PASSTHROUGH_CODEC_AMR 1
260#endif
261
Benny Prijono2e8cf632009-08-13 15:57:26 +0000262/**
263 * Enable G.729 passthrough codec.
264 *
265 * Default: 1
266 */
Nanang Izzuddin8cdba462009-01-29 20:06:28 +0000267#ifndef PJMEDIA_HAS_PASSTHROUGH_CODEC_G729
268# define PJMEDIA_HAS_PASSTHROUGH_CODEC_G729 1
269#endif
270
Benny Prijono2e8cf632009-08-13 15:57:26 +0000271/**
272 * Enable iLBC passthrough codec.
273 *
274 * Default: 1
275 */
Nanang Izzuddin8cdba462009-01-29 20:06:28 +0000276#ifndef PJMEDIA_HAS_PASSTHROUGH_CODEC_ILBC
277# define PJMEDIA_HAS_PASSTHROUGH_CODEC_ILBC 1
278#endif
279
Benny Prijono2e8cf632009-08-13 15:57:26 +0000280/**
281 * Enable PCMU passthrough codec.
282 *
283 * Default: 1
284 */
Nanang Izzuddin8cdba462009-01-29 20:06:28 +0000285#ifndef PJMEDIA_HAS_PASSTHROUGH_CODEC_PCMU
286# define PJMEDIA_HAS_PASSTHROUGH_CODEC_PCMU 1
287#endif
288
Benny Prijono2e8cf632009-08-13 15:57:26 +0000289/**
290 * Enable PCMA passthrough codec.
291 *
292 * Default: 1
293 */
Nanang Izzuddin81db8c72009-02-05 10:59:14 +0000294#ifndef PJMEDIA_HAS_PASSTHROUGH_CODEC_PCMA
Nanang Izzuddin8cdba462009-01-29 20:06:28 +0000295# define PJMEDIA_HAS_PASSTHROUGH_CODEC_PCMA 1
296#endif
297
Benny Prijono729d01a2009-03-18 12:49:18 +0000298/* 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 Izzuddin57b88572009-04-01 12:05:34 +0000308/**
Nanang Izzuddine3cddc82009-05-06 19:13:16 +0000309 * G.722.1 codec is disabled by default.
Nanang Izzuddin57b88572009-04-01 12:05:34 +0000310 */
311#ifndef PJMEDIA_HAS_G7221_CODEC
Benny Prijono8496b932009-04-20 14:19:11 +0000312# define PJMEDIA_HAS_G7221_CODEC 0
Nanang Izzuddin57b88572009-04-01 12:05:34 +0000313#endif
314
Benny Prijono8496b932009-04-20 14:19:11 +0000315/**
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 Izzuddine2cdc862009-06-16 10:46:03 +0000329/**
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 Izzuddin57b88572009-04-01 12:05:34 +0000345
Benny Prijonoc45d9512010-12-10 11:04:30 +0000346
347/**
348 * Specify if FFMPEG codecs are available.
349 *
350 * Default: PJMEDIA_HAS_LIBAVCODEC
351 */
352#ifndef PJMEDIA_HAS_FFMPEG_CODEC
353# define PJMEDIA_HAS_FFMPEG_CODEC PJMEDIA_HAS_LIBAVCODEC
354#endif
355
Benny Prijono2e8cf632009-08-13 15:57:26 +0000356/**
357 * @}
358 */
359
Benny Prijonoc45d9512010-12-10 11:04:30 +0000360
361
Nanang Izzuddin493a8db2008-08-15 13:17:39 +0000362#endif /* __PJMEDIA_CODEC_CONFIG_H__ */