summaryrefslogtreecommitdiff
path: root/pjmedia/include/pjmedia-codec/config.h
blob: 2c71cc9f6ecefd0af5cadd40cc8a7b8916f85928 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
/* $Id: config.h 4070 2012-04-23 13:48:10Z bennylp $ */
/* 
 * Copyright (C) 2008-2011 Teluu Inc. (http://www.teluu.com)
 * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org>
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA 
 */
#ifndef __PJMEDIA_CODEC_CONFIG_H__
#define __PJMEDIA_CODEC_CONFIG_H__

/**
 * @file config.h
 * @brief PJMEDIA-CODEC compile time settings
 */

/**
 * @defgroup pjmedia_codec_config PJMEDIA-CODEC Compile Time Settings
 * @ingroup PJMEDIA_CODEC
 * @brief Various compile time settings such as to enable/disable codecs
 * @{
 */

#include <pjmedia/types.h>

/*
 * Include config_auto.h if autoconf is used (PJ_AUTOCONF is set)
 */
#if defined(PJ_AUTOCONF)
#   include <pjmedia-codec/config_auto.h>
#endif


/**
 * Unless specified otherwise, L16 codec is included by default.
 */
#ifndef PJMEDIA_HAS_L16_CODEC
#   define PJMEDIA_HAS_L16_CODEC    1
#endif


/**
 * Unless specified otherwise, GSM codec is included by default.
 */
#ifndef PJMEDIA_HAS_GSM_CODEC
#   define PJMEDIA_HAS_GSM_CODEC    1
#endif


/**
 * Unless specified otherwise, Speex codec is included by default.
 */
#ifndef PJMEDIA_HAS_SPEEX_CODEC
#   define PJMEDIA_HAS_SPEEX_CODEC    1
#endif

/**
 * Speex codec default complexity setting.
 */
#ifndef PJMEDIA_CODEC_SPEEX_DEFAULT_COMPLEXITY
#   define PJMEDIA_CODEC_SPEEX_DEFAULT_COMPLEXITY   2
#endif

/**
 * Speex codec default quality setting. Please note that pjsua-lib may override
 * this setting via its codec quality setting (i.e PJSUA_DEFAULT_CODEC_QUALITY).
 */
#ifndef PJMEDIA_CODEC_SPEEX_DEFAULT_QUALITY
#   define PJMEDIA_CODEC_SPEEX_DEFAULT_QUALITY	    8
#endif


/**
 * Unless specified otherwise, iLBC codec is included by default.
 */
#ifndef PJMEDIA_HAS_ILBC_CODEC
#   define PJMEDIA_HAS_ILBC_CODEC    1
#endif


/**
 * Unless specified otherwise, G.722 codec is included by default.
 */
#ifndef PJMEDIA_HAS_G722_CODEC
#   define PJMEDIA_HAS_G722_CODEC    1
#endif


/**
 * Default G.722 codec encoder and decoder level adjustment. The G.722
 * specifies that it uses 14 bit PCM for input and output, while PJMEDIA
 * normally uses 16 bit PCM, so the conversion is done by applying
 * level adjustment. If the value is non-zero, then PCM input samples to
 * the encoder will be shifted right by this value, and similarly PCM
 * output samples from the decoder will be shifted left by this value.
 *
 * This can be changed at run-time after initialization by calling
 * #pjmedia_codec_g722_set_pcm_shift().
 *
 * Default: 2.
 */
#ifndef PJMEDIA_G722_DEFAULT_PCM_SHIFT
#   define PJMEDIA_G722_DEFAULT_PCM_SHIFT	    2
#endif


/**
 * Specifies whether G.722 PCM shifting should be stopped when clipping
 * detected in the decoder. Enabling this feature can be useful when
 * talking to G.722 implementation that uses 16 bit PCM for G.722 input/
 * output (for any reason it seems to work) and the PCM shifting causes
 * audio clipping.
 *
 * See also #PJMEDIA_G722_DEFAULT_PCM_SHIFT.
 *
 * Default: enabled.
 */
#ifndef PJMEDIA_G722_STOP_PCM_SHIFT_ON_CLIPPING
#   define PJMEDIA_G722_STOP_PCM_SHIFT_ON_CLIPPING  1
#endif


/**
 * Enable the features provided by Intel IPP libraries, for example
 * codecs such as G.729, G.723.1, G.726, G.728, G.722.1, and AMR.
 *
 * By default this is disabled. Please follow the instructions in
 * http://trac.pjsip.org/repos/wiki/Intel_IPP_Codecs on how to setup
 * Intel IPP with PJMEDIA.
 */
#ifndef PJMEDIA_HAS_INTEL_IPP
#   define PJMEDIA_HAS_INTEL_IPP		0
#endif


/**
 * Visual Studio only: when this option is set, the Intel IPP libraries
 * will be automatically linked to application using pragma(comment)
 * constructs. This is convenient, however it will only link with
 * the stub libraries and the Intel IPP DLL's will be required when
 * distributing the application.
 *
 * If application wants to link with the different types of the Intel IPP
 * libraries (for example, the static libraries), it must set this option
 * to zero and specify the Intel IPP libraries in the application's input
 * library specification manually.
 *
 * Default 1.
 */
#ifndef PJMEDIA_AUTO_LINK_IPP_LIBS
#   define PJMEDIA_AUTO_LINK_IPP_LIBS		1
#endif


/**
 * Enable Intel IPP AMR codec. This also needs to be enabled when AMR WB
 * codec is enabled. This option is only used when PJMEDIA_HAS_INTEL_IPP 
 * is enabled.
 *
 * Default: 1
 */
#ifndef PJMEDIA_HAS_INTEL_IPP_CODEC_AMR
#   define PJMEDIA_HAS_INTEL_IPP_CODEC_AMR	1
#endif


/**
 * Enable Intel IPP AMR wideband codec. The PJMEDIA_HAS_INTEL_IPP_CODEC_AMR
 * option must also be enabled to use this codec. This option is only used 
 * when PJMEDIA_HAS_INTEL_IPP is enabled.
 *
 * Default: 1
 */
#ifndef PJMEDIA_HAS_INTEL_IPP_CODEC_AMRWB
#   define PJMEDIA_HAS_INTEL_IPP_CODEC_AMRWB	1
#endif


/**
 * Enable Intel IPP G.729 codec. This option is only used when
 * PJMEDIA_HAS_INTEL_IPP is enabled.
 *
 * Default: 1
 */
#ifndef PJMEDIA_HAS_INTEL_IPP_CODEC_G729
#   define PJMEDIA_HAS_INTEL_IPP_CODEC_G729	1
#endif


/**
 * Enable Intel IPP G.723.1 codec. This option is only used when
 * PJMEDIA_HAS_INTEL_IPP is enabled.
 *
 * Default: 1
 */
#ifndef PJMEDIA_HAS_INTEL_IPP_CODEC_G723_1
#   define PJMEDIA_HAS_INTEL_IPP_CODEC_G723_1	1
#endif


/**
 * Enable Intel IPP G.726 codec. This option is only used when
 * PJMEDIA_HAS_INTEL_IPP is enabled.
 *
 * Default: 1
 */
#ifndef PJMEDIA_HAS_INTEL_IPP_CODEC_G726
#   define PJMEDIA_HAS_INTEL_IPP_CODEC_G726	1
#endif


/**
 * Enable Intel IPP G.728 codec. This option is only used when
 * PJMEDIA_HAS_INTEL_IPP is enabled.
 *
 * Default: 1
 */
#ifndef PJMEDIA_HAS_INTEL_IPP_CODEC_G728
#   define PJMEDIA_HAS_INTEL_IPP_CODEC_G728	1
#endif


/**
 * Enable Intel IPP G.722.1 codec. This option is only used when
 * PJMEDIA_HAS_INTEL_IPP is enabled.
 *
 * Default: 1
 */
#ifndef PJMEDIA_HAS_INTEL_IPP_CODEC_G722_1
#   define PJMEDIA_HAS_INTEL_IPP_CODEC_G722_1	1
#endif

/**
 * Enable Passthrough codecs.
 *
 * Default: 0
 */
#ifndef PJMEDIA_HAS_PASSTHROUGH_CODECS
#   define PJMEDIA_HAS_PASSTHROUGH_CODECS	0
#endif

/**
 * Enable AMR passthrough codec.
 *
 * Default: 1
 */
#ifndef PJMEDIA_HAS_PASSTHROUGH_CODEC_AMR
#   define PJMEDIA_HAS_PASSTHROUGH_CODEC_AMR	1
#endif

/**
 * Enable G.729 passthrough codec.
 *
 * Default: 1
 */
#ifndef PJMEDIA_HAS_PASSTHROUGH_CODEC_G729
#   define PJMEDIA_HAS_PASSTHROUGH_CODEC_G729	1
#endif

/**
 * Enable iLBC passthrough codec.
 *
 * Default: 1
 */
#ifndef PJMEDIA_HAS_PASSTHROUGH_CODEC_ILBC
#   define PJMEDIA_HAS_PASSTHROUGH_CODEC_ILBC	1
#endif

/**
 * Enable PCMU passthrough codec.
 *
 * Default: 1
 */
#ifndef PJMEDIA_HAS_PASSTHROUGH_CODEC_PCMU
#   define PJMEDIA_HAS_PASSTHROUGH_CODEC_PCMU	1
#endif

/**
 * Enable PCMA passthrough codec.
 *
 * Default: 1
 */
#ifndef PJMEDIA_HAS_PASSTHROUGH_CODEC_PCMA
#   define PJMEDIA_HAS_PASSTHROUGH_CODEC_PCMA	1
#endif

/* If passthrough and PCMU/PCMA are enabled, disable the software
 * G.711 codec
 */
#if PJMEDIA_HAS_PASSTHROUGH_CODECS && \
    (PJMEDIA_HAS_PASSTHROUGH_CODEC_PCMU || PJMEDIA_HAS_PASSTHROUGH_CODEC_PCMA)
#   undef PJMEDIA_HAS_G711_CODEC
#   define PJMEDIA_HAS_G711_CODEC		0
#endif


/**
 * G.722.1 codec is disabled by default.
 */
#ifndef PJMEDIA_HAS_G7221_CODEC
#   define PJMEDIA_HAS_G7221_CODEC		0
#endif

/**
 * Enable OpenCORE AMR-NB codec.
 * See https://trac.pjsip.org/repos/ticket/1388 for some info.
 *
 * Default: 0
 */
#ifndef PJMEDIA_HAS_OPENCORE_AMRNB_CODEC
#   define PJMEDIA_HAS_OPENCORE_AMRNB_CODEC	0
#endif

/**
 * Link with libopencore-amrXX via pragma comment on Visual Studio.
 * This option only makes sense if PJMEDIA_HAS_OPENCORE_AMRNB_CODEC
 * is enabled.
 *
 * Default: 1
 */
#ifndef PJMEDIA_AUTO_LINK_OPENCORE_AMR_LIBS
#  define PJMEDIA_AUTO_LINK_OPENCORE_AMR_LIBS	1
#endif

/**
 * Link with libopencore-amrXX.a that has been produced with gcc.
 * This option only makes sense if PJMEDIA_HAS_OPENCORE_AMRNB_CODEC
 * and PJMEDIA_AUTO_LINK_OPENCORE_AMR_LIBS are enabled.
 *
 * Default: 1
 */
#ifndef PJMEDIA_OPENCORE_AMR_BUILT_WITH_GCC
#   define PJMEDIA_OPENCORE_AMR_BUILT_WITH_GCC	1
#endif


/**
 * Default G.722.1 codec encoder and decoder level adjustment. 
 * If the value is non-zero, then PCM input samples to the encoder will 
 * be shifted right by this value, and similarly PCM output samples from
 * the decoder will be shifted left by this value.
 *
 * This can be changed at run-time after initialization by calling
 * #pjmedia_codec_g7221_set_pcm_shift().
 */
#ifndef PJMEDIA_G7221_DEFAULT_PCM_SHIFT
#   define PJMEDIA_G7221_DEFAULT_PCM_SHIFT	1
#endif


/**
 * Enabling both G.722.1 codec implementations, internal PJMEDIA and IPP,
 * may cause problem in SDP, i.e: payload types duplications. So, let's 
 * just trap such case here at compile time.
 *
 * Application can control which implementation to be used by manipulating
 * PJMEDIA_HAS_G7221_CODEC and PJMEDIA_HAS_INTEL_IPP_CODEC_G722_1 in
 * config_site.h.
 */
#if (PJMEDIA_HAS_G7221_CODEC != 0) && (PJMEDIA_HAS_INTEL_IPP != 0) && \
    (PJMEDIA_HAS_INTEL_IPP_CODEC_G722_1 != 0)
#   error Only one G.722.1 implementation can be enabled at the same time. \
	  Please use PJMEDIA_HAS_G7221_CODEC and \
	  PJMEDIA_HAS_INTEL_IPP_CODEC_G722_1 in your config_site.h \
	  to control which implementation to be used.
#endif


/**
 * Specify if FFMPEG codecs are available.
 *
 * Default: PJMEDIA_HAS_LIBAVCODEC
 */
#ifndef PJMEDIA_HAS_FFMPEG_CODEC
#   define PJMEDIA_HAS_FFMPEG_CODEC		PJMEDIA_HAS_LIBAVCODEC
#endif


/**
 * Specify if FFMPEG video codecs are available.
 *
 * Default: PJMEDIA_HAS_FFMPEG_CODEC
 */
#ifndef PJMEDIA_HAS_FFMPEG_VID_CODEC
#   define PJMEDIA_HAS_FFMPEG_VID_CODEC		PJMEDIA_HAS_FFMPEG_CODEC
#endif

/**
 * Enable FFMPEG H263+/H263-1998 codec.
 *
 * Default: 1
 */
#ifndef PJMEDIA_HAS_FFMPEG_CODEC_H263P
#   define PJMEDIA_HAS_FFMPEG_CODEC_H263P	PJMEDIA_HAS_FFMPEG_VID_CODEC
#endif

/**
 * Enable FFMPEG H264 codec (requires libx264).
 *
 * Default: 0
 */
#ifndef PJMEDIA_HAS_FFMPEG_CODEC_H264
#   define PJMEDIA_HAS_FFMPEG_CODEC_H264	PJMEDIA_HAS_FFMPEG_VID_CODEC
#endif

/**
 * @}
 */



#endif	/* __PJMEDIA_CODEC_CONFIG_H__ */