1
/* $Id: config.h 4130 2012-05-17 08:35:51Z nanang $ */
3
* Copyright (C) 2008-2011 Teluu Inc. (http://www.teluu.com)
4
* Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org>
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.
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.
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
20
#ifndef __PJMEDIA_CONFIG_H__
21
#define __PJMEDIA_CONFIG_H__
24
* @file pjmedia/config.h Compile time config
25
* @brief Contains some compile time constants.
27
#include <pj/config.h>
30
* @defgroup PJMEDIA_BASE Base Types and Configurations
34
* @defgroup PJMEDIA_CONFIG Compile time configuration
35
* @ingroup PJMEDIA_BASE
36
* @brief Some compile time configuration settings.
41
* Include config_auto.h if autoconf is used (PJ_AUTOCONF is set)
43
#if defined(PJ_AUTOCONF)
44
# include <pjmedia/config_auto.h>
48
* Specify whether we prefer to use audio switch board rather than
51
* Audio switch board is a kind of simplified version of conference
52
* bridge, but not really the subset of conference bridge. It has
53
* stricter rules on audio routing among the pjmedia ports and has
54
* no audio mixing capability. The power of it is it could work with
55
* encoded audio frames where conference brigde couldn't.
59
#ifndef PJMEDIA_CONF_USE_SWITCH_BOARD
60
# define PJMEDIA_CONF_USE_SWITCH_BOARD 0
64
* Types of sound stream backends.
68
* This macro has been deprecated in releasee 1.1. Please see
69
* http://trac.pjsip.org/repos/wiki/Audio_Dev_API for more information.
71
#if defined(PJMEDIA_SOUND_IMPLEMENTATION)
72
# error PJMEDIA_SOUND_IMPLEMENTATION has been deprecated
76
* This macro has been deprecated in releasee 1.1. Please see
77
* http://trac.pjsip.org/repos/wiki/Audio_Dev_API for more information.
79
#if defined(PJMEDIA_PREFER_DIRECT_SOUND)
80
# error PJMEDIA_PREFER_DIRECT_SOUND has been deprecated
84
* This macro controls whether the legacy sound device API is to be
85
* implemented, for applications that still use the old sound device
86
* API (sound.h). If this macro is set to non-zero, the sound_legacy.c
87
* will be included in the compilation. The sound_legacy.c is an
88
* implementation of old sound device (sound.h) using the new Audio
91
* Please see http://trac.pjsip.org/repos/wiki/Audio_Dev_API for more
94
#ifndef PJMEDIA_HAS_LEGACY_SOUND_API
95
# define PJMEDIA_HAS_LEGACY_SOUND_API 1
99
* Specify default sound device latency, in milisecond.
101
#ifndef PJMEDIA_SND_DEFAULT_REC_LATENCY
102
# define PJMEDIA_SND_DEFAULT_REC_LATENCY 100
106
* Specify default sound device latency, in milisecond.
108
* Default is 160ms for Windows Mobile and 140ms for other platforms.
110
#ifndef PJMEDIA_SND_DEFAULT_PLAY_LATENCY
111
# if defined(PJ_WIN32_WINCE) && PJ_WIN32_WINCE!=0
112
# define PJMEDIA_SND_DEFAULT_PLAY_LATENCY 160
114
# define PJMEDIA_SND_DEFAULT_PLAY_LATENCY 140
120
* Types of WSOLA backend algorithm.
124
* This denotes implementation of WSOLA using null algorithm. Expansion
125
* will generate zero frames, and compression will just discard some
126
* samples from the input.
128
* This type of implementation may be used as it requires the least
131
#define PJMEDIA_WSOLA_IMP_NULL 0
134
* This denotes implementation of WSOLA using fixed or floating point WSOLA
135
* algorithm. This implementation provides the best quality of the result,
136
* at the expense of one frame delay and intensive processing power
139
#define PJMEDIA_WSOLA_IMP_WSOLA 1
142
* This denotes implementation of WSOLA algorithm with faster waveform
143
* similarity calculation. This implementation provides fair quality of
144
* the result with the main advantage of low processing power requirement.
146
#define PJMEDIA_WSOLA_IMP_WSOLA_LITE 2
149
* Specify type of Waveform based Similarity Overlap and Add (WSOLA) backend
150
* implementation to be used. WSOLA is an algorithm to expand and/or compress
151
* audio frames without changing the pitch, and used by the delaybuf and as PLC
154
* Default is PJMEDIA_WSOLA_IMP_WSOLA
156
#ifndef PJMEDIA_WSOLA_IMP
157
# define PJMEDIA_WSOLA_IMP PJMEDIA_WSOLA_IMP_WSOLA
162
* Specify the default maximum duration of synthetic audio that is generated
163
* by WSOLA. This value should be long enough to cover burst of packet losses.
164
* but not too long, because as the duration increases the quality would
165
* degrade considerably.
167
* Note that this limit is only applied when fading is enabled in the WSOLA
172
#ifndef PJMEDIA_WSOLA_MAX_EXPAND_MSEC
173
# define PJMEDIA_WSOLA_MAX_EXPAND_MSEC 80
178
* Specify WSOLA template length, in milliseconds. The longer the template,
179
* the smoother signal to be generated at the expense of more computation
180
* needed, since the algorithm will have to compare more samples to find
181
* the most similar pitch.
185
#ifndef PJMEDIA_WSOLA_TEMPLATE_LENGTH_MSEC
186
# define PJMEDIA_WSOLA_TEMPLATE_LENGTH_MSEC 5
191
* Specify WSOLA algorithm delay, in milliseconds. The algorithm delay is
192
* used to merge synthetic samples with real samples in the transition
193
* between real to synthetic and vice versa. The longer the delay, the
194
* smoother signal to be generated, at the expense of longer latency and
195
* a slighty more computation.
199
#ifndef PJMEDIA_WSOLA_DELAY_MSEC
200
# define PJMEDIA_WSOLA_DELAY_MSEC 5
205
* Set this to non-zero to disable fade-out/in effect in the PLC when it
206
* instructs WSOLA to generate synthetic frames. The use of fading may
207
* or may not improve the quality of audio, depending on the nature of
208
* packet loss and the type of audio input (e.g. speech vs music).
209
* Disabling fading also implicitly remove the maximum limit of synthetic
210
* audio samples generated by WSOLA (see PJMEDIA_WSOLA_MAX_EXPAND_MSEC).
214
#ifndef PJMEDIA_WSOLA_PLC_NO_FADING
215
# define PJMEDIA_WSOLA_PLC_NO_FADING 0
220
* Limit the number of calls by stream to the PLC to generate synthetic
221
* frames to this duration. If packets are still lost after this maximum
222
* duration, silence will be generated by the stream instead. Since the
223
* PLC normally should have its own limit on the maximum duration of
224
* synthetic frames to be generated (for PJMEDIA's PLC, the limit is
225
* PJMEDIA_WSOLA_MAX_EXPAND_MSEC), we can set this value to a large number
226
* to give additional flexibility should the PLC wants to do something
227
* clever with the lost frames.
231
#ifndef PJMEDIA_MAX_PLC_DURATION_MSEC
232
# define PJMEDIA_MAX_PLC_DURATION_MSEC 240
237
* Specify number of sound buffers. Larger number is better for sound
238
* stability and to accommodate sound devices that are unable to send frames
239
* in timely manner, however it would probably cause more audio delay (and
240
* definitely will take more memory). One individual buffer is normally 10ms
241
* or 20 ms long, depending on ptime settings (samples_per_frame value).
243
* The setting here currently is used by the conference bridge, the splitter
244
* combiner port, and dsound.c.
246
* Default: (PJMEDIA_SND_DEFAULT_PLAY_LATENCY+20)/20
248
#ifndef PJMEDIA_SOUND_BUFFER_COUNT
249
# define PJMEDIA_SOUND_BUFFER_COUNT ((PJMEDIA_SND_DEFAULT_PLAY_LATENCY+20)/20)
254
* Specify which A-law/U-law conversion algorithm to use.
255
* By default the conversion algorithm uses A-law/U-law table which gives
256
* the best performance, at the expense of 33 KBytes of static data.
257
* If this option is disabled, a smaller but slower algorithm will be used.
259
#ifndef PJMEDIA_HAS_ALAW_ULAW_TABLE
260
# define PJMEDIA_HAS_ALAW_ULAW_TABLE 1
265
* Unless specified otherwise, G711 codec is included by default.
267
#ifndef PJMEDIA_HAS_G711_CODEC
268
# define PJMEDIA_HAS_G711_CODEC 1
273
* Warn about obsolete macros.
275
* PJMEDIA_HAS_SMALL_FILTER has been deprecated in 0.7.
277
#if defined(PJMEDIA_HAS_SMALL_FILTER)
279
# pragma message("Warning: PJMEDIA_HAS_SMALL_FILTER macro is deprecated"\
280
" and has no effect")
282
# warning "PJMEDIA_HAS_SMALL_FILTER macro is deprecated and has no effect"
288
* Warn about obsolete macros.
290
* PJMEDIA_HAS_LARGE_FILTER has been deprecated in 0.7.
292
#if defined(PJMEDIA_HAS_LARGE_FILTER)
294
# pragma message("Warning: PJMEDIA_HAS_LARGE_FILTER macro is deprecated"\
295
" and has no effect")
297
# warning "PJMEDIA_HAS_LARGE_FILTER macro is deprecated"
303
* These macros are obsolete in 0.7.1 so it will trigger compilation error.
304
* Please use PJMEDIA_RESAMPLE_IMP to select the resample implementation
307
#ifdef PJMEDIA_HAS_LIBRESAMPLE
308
# error "PJMEDIA_HAS_LIBRESAMPLE macro is deprecated. Use '#define PJMEDIA_RESAMPLE_IMP PJMEDIA_RESAMPLE_LIBRESAMPLE'"
311
#ifdef PJMEDIA_HAS_SPEEX_RESAMPLE
312
# error "PJMEDIA_HAS_SPEEX_RESAMPLE macro is deprecated. Use '#define PJMEDIA_RESAMPLE_IMP PJMEDIA_RESAMPLE_SPEEX'"
317
* Sample rate conversion backends.
318
* Select one of these backends in PJMEDIA_RESAMPLE_IMP.
320
#define PJMEDIA_RESAMPLE_NONE 1 /**< No resampling. */
321
#define PJMEDIA_RESAMPLE_LIBRESAMPLE 2 /**< Sample rate conversion
322
using libresample. */
323
#define PJMEDIA_RESAMPLE_SPEEX 3 /**< Sample rate conversion
325
#define PJMEDIA_RESAMPLE_LIBSAMPLERATE 4 /**< Sample rate conversion
327
(a.k.a Secret Rabbit Code)
331
* Select which resample implementation to use. Currently pjmedia supports:
332
* - #PJMEDIA_RESAMPLE_LIBRESAMPLE, to use libresample-1.7, this is the default
333
* implementation to be used.
334
* - #PJMEDIA_RESAMPLE_LIBSAMPLERATE, to use libsamplerate implementation
335
* (a.k.a. Secret Rabbit Code).
336
* - #PJMEDIA_RESAMPLE_SPEEX, to use experimental sample rate conversion in
338
* - #PJMEDIA_RESAMPLE_NONE, to disable sample rate conversion. Any calls to
339
* resample function will return error.
341
* Default is PJMEDIA_RESAMPLE_LIBRESAMPLE
343
#ifndef PJMEDIA_RESAMPLE_IMP
344
# define PJMEDIA_RESAMPLE_IMP PJMEDIA_RESAMPLE_LIBRESAMPLE
349
* Specify whether libsamplerate, when used, should be linked statically
350
* into the application. This option is only useful for Visual Studio
351
* projects, and when this static linking is enabled
356
* Default file player/writer buffer size.
358
#ifndef PJMEDIA_FILE_PORT_BUFSIZE
359
# define PJMEDIA_FILE_PORT_BUFSIZE 4000
364
* Maximum frame duration (in msec) to be supported.
365
* This (among other thing) will affect the size of buffers to be allocated
366
* for outgoing packets.
368
#ifndef PJMEDIA_MAX_FRAME_DURATION_MS
369
# define PJMEDIA_MAX_FRAME_DURATION_MS 200
374
* Max packet size to support.
376
#ifndef PJMEDIA_MAX_MTU
377
# define PJMEDIA_MAX_MTU 1500
382
* DTMF/telephone-event duration, in timestamp.
384
#ifndef PJMEDIA_DTMF_DURATION
385
# define PJMEDIA_DTMF_DURATION 1600 /* in timestamp */
390
* Number of RTP packets received from different source IP address from the
391
* remote address required to make the stream switch transmission
392
* to the source address.
394
#ifndef PJMEDIA_RTP_NAT_PROBATION_CNT
395
# define PJMEDIA_RTP_NAT_PROBATION_CNT 10
400
* Number of RTCP packets received from different source IP address from the
401
* remote address required to make the stream switch RTCP transmission
402
* to the source address.
404
#ifndef PJMEDIA_RTCP_NAT_PROBATION_CNT
405
# define PJMEDIA_RTCP_NAT_PROBATION_CNT 3
410
* Specify whether RTCP should be advertised in SDP. This setting would
411
* affect whether RTCP candidate will be added in SDP when ICE is used.
412
* Application might want to disable RTCP advertisement in SDP to
413
* reduce the message size.
417
#ifndef PJMEDIA_ADVERTISE_RTCP
418
# define PJMEDIA_ADVERTISE_RTCP 1
423
* Interval to send RTCP packets, in msec
425
#ifndef PJMEDIA_RTCP_INTERVAL
426
# define PJMEDIA_RTCP_INTERVAL 5000 /* msec*/
431
* Tell RTCP to ignore the first N packets when calculating the
432
* jitter statistics. From experimentation, the first few packets
433
* (25 or so) have relatively big jitter, possibly because during
434
* this time, the program is also busy setting up the signaling,
435
* so they make the average jitter big.
439
#ifndef PJMEDIA_RTCP_IGNORE_FIRST_PACKETS
440
# define PJMEDIA_RTCP_IGNORE_FIRST_PACKETS 25
445
* Specify whether RTCP statistics includes raw jitter statistics.
446
* Raw jitter is defined as absolute value of network transit time
447
* difference of two consecutive packets; refering to "difference D"
448
* term in interarrival jitter calculation in RFC 3550 section 6.4.1.
452
#ifndef PJMEDIA_RTCP_STAT_HAS_RAW_JITTER
453
# define PJMEDIA_RTCP_STAT_HAS_RAW_JITTER 0
457
* Specify the factor with wich RTCP RTT statistics should be normalized
458
* if exceptionally high. For e.g. mobile networks with potentially large
459
* fluctuations, this might be unwanted.
461
* Use (0) to disable this feature.
465
#ifndef PJMEDIA_RTCP_NORMALIZE_FACTOR
466
# define PJMEDIA_RTCP_NORMALIZE_FACTOR 3
471
* Specify whether RTCP statistics includes IP Delay Variation statistics.
472
* IPDV is defined as network transit time difference of two consecutive
473
* packets. The IPDV statistic can be useful to inspect clock skew existance
474
* and level, e.g: when the IPDV mean values were stable in positive numbers,
475
* then the remote clock (used in sending RTP packets) is faster than local
476
* system clock. Ideally, the IPDV mean values are always equal to 0.
480
#ifndef PJMEDIA_RTCP_STAT_HAS_IPDV
481
# define PJMEDIA_RTCP_STAT_HAS_IPDV 0
486
* Specify whether RTCP XR support should be built into PJMEDIA. Disabling
487
* this feature will reduce footprint slightly. Note that even when this
488
* setting is enabled, RTCP XR processing will only be performed in stream
489
* if it is enabled on run-time on per stream basis. See
490
* PJMEDIA_STREAM_ENABLE_XR setting for more info.
494
#ifndef PJMEDIA_HAS_RTCP_XR
495
# define PJMEDIA_HAS_RTCP_XR 0
500
* The RTCP XR feature is activated and used by stream if \a enable_rtcp_xr
501
* field of \a pjmedia_stream_info structure is non-zero. This setting
502
* controls the default value of this field.
504
* Default: 0 (disabled)
506
#ifndef PJMEDIA_STREAM_ENABLE_XR
507
# define PJMEDIA_STREAM_ENABLE_XR 0
512
* Specify the buffer length for storing any received RTCP SDES text
513
* in a stream session. Usually RTCP contains only the mandatory SDES
518
#ifndef PJMEDIA_RTCP_RX_SDES_BUF_LEN
519
# define PJMEDIA_RTCP_RX_SDES_BUF_LEN 64
524
* Specify how long (in miliseconds) the stream should suspend the
525
* silence detector/voice activity detector (VAD) during the initial
526
* period of the session. This feature is useful to open bindings in
527
* all NAT routers between local and remote endpoint since most NATs
528
* do not allow incoming packet to get in before local endpoint sends
531
* Specify zero to disable this feature.
533
* Default: 600 msec (which gives good probability that some RTP
534
* packets will reach the destination, but without
535
* filling up the jitter buffer on the remote end).
537
#ifndef PJMEDIA_STREAM_VAD_SUSPEND_MSEC
538
# define PJMEDIA_STREAM_VAD_SUSPEND_MSEC 600
542
* Perform RTP payload type checking in the stream. Normally the peer
543
* MUST send RTP with payload type as we specified in our SDP. Certain
544
* agents may not be able to follow this hence the only way to have
545
* communication is to disable this check.
549
#ifndef PJMEDIA_STREAM_CHECK_RTP_PT
550
# define PJMEDIA_STREAM_CHECK_RTP_PT 1
554
* Reserve some space for application extra data, e.g: SRTP auth tag,
555
* in RTP payload, so the total payload length will not exceed the MTU.
557
#ifndef PJMEDIA_STREAM_RESV_PAYLOAD_LEN
558
# define PJMEDIA_STREAM_RESV_PAYLOAD_LEN 20
563
* Specify the maximum duration of silence period in the codec, in msec.
564
* This is useful for example to keep NAT binding open in the firewall
565
* and to prevent server from disconnecting the call because no
566
* RTP packet is received.
568
* This only applies to codecs that use PJMEDIA's VAD (pretty much
569
* everything including iLBC, except Speex, which has its own DTX
572
* Use (-1) to disable this feature.
577
#ifndef PJMEDIA_CODEC_MAX_SILENCE_PERIOD
578
# define PJMEDIA_CODEC_MAX_SILENCE_PERIOD 5000
583
* Suggested or default threshold to be set for fixed silence detection
584
* or as starting threshold for adaptive silence detection. The threshold
585
* has the range from zero to 0xFFFF.
587
#ifndef PJMEDIA_SILENCE_DET_THRESHOLD
588
# define PJMEDIA_SILENCE_DET_THRESHOLD 4
593
* Maximum silence threshold in the silence detector. The silence detector
594
* will not cut the audio transmission if the audio level is above this
597
* Use 0x10000 (or greater) to disable this feature.
599
* Default: 0x10000 (disabled)
601
#ifndef PJMEDIA_SILENCE_DET_MAX_THRESHOLD
602
# define PJMEDIA_SILENCE_DET_MAX_THRESHOLD 0x10000
607
* Speex Accoustic Echo Cancellation (AEC).
608
* By default is enabled.
610
#ifndef PJMEDIA_HAS_SPEEX_AEC
611
# define PJMEDIA_HAS_SPEEX_AEC 1
616
* Maximum number of parameters in SDP fmtp attribute.
620
#ifndef PJMEDIA_CODEC_MAX_FMTP_CNT
621
# define PJMEDIA_CODEC_MAX_FMTP_CNT 16
626
* This specifies the behavior of the SDP negotiator when responding to an
627
* offer, whether it should rather use the codec preference as set by
628
* remote, or should it rather use the codec preference as specified by
631
* For example, suppose incoming call has codec order "8 0 3", while
632
* local codec order is "3 0 8". If remote codec order is preferable,
633
* the selected codec will be 8, while if local codec order is preferable,
634
* the selected codec will be 3.
636
* If set to non-zero, the negotiator will use the codec order as specified
637
* by remote in the offer.
639
* Note that this behavior can be changed during run-time by calling
640
* pjmedia_sdp_neg_set_prefer_remote_codec_order().
642
* Default is 1 (to maintain backward compatibility)
644
#ifndef PJMEDIA_SDP_NEG_PREFER_REMOTE_CODEC_ORDER
645
# define PJMEDIA_SDP_NEG_PREFER_REMOTE_CODEC_ORDER 1
650
* This specifies the maximum number of the customized SDP format
651
* negotiation callbacks.
653
#ifndef PJMEDIA_SDP_NEG_MAX_CUSTOM_FMT_NEG_CB
654
# define PJMEDIA_SDP_NEG_MAX_CUSTOM_FMT_NEG_CB 8
659
* This specifies if the SDP negotiator should rewrite answer payload
660
* type numbers to use the same payload type numbers as the remote offer
661
* for all matched codecs.
665
#ifndef PJMEDIA_SDP_NEG_ANSWER_SYMMETRIC_PT
666
# define PJMEDIA_SDP_NEG_ANSWER_SYMMETRIC_PT 1
671
* Support for sending and decoding RTCP port in SDP (RFC 3605).
672
* Default is equal to PJMEDIA_ADVERTISE_RTCP setting.
674
#ifndef PJMEDIA_HAS_RTCP_IN_SDP
675
# define PJMEDIA_HAS_RTCP_IN_SDP (PJMEDIA_ADVERTISE_RTCP)
680
* This macro controls whether pjmedia should include SDP rtpmap
681
* attribute for static payload types. SDP rtpmap for static
682
* payload types are optional, although they are normally included
683
* for interoperability reason.
685
* Note that there is also a run-time variable to turn this setting
686
* on or off, defined in endpoint.c. To access this variable, use
687
* the following construct
690
extern pj_bool_t pjmedia_add_rtpmap_for_static_pt;
692
// Do not include rtpmap for static payload types (<96)
693
pjmedia_add_rtpmap_for_static_pt = PJ_FALSE;
698
#ifndef PJMEDIA_ADD_RTPMAP_FOR_STATIC_PT
699
# define PJMEDIA_ADD_RTPMAP_FOR_STATIC_PT 1
704
* This macro declares the payload type for telephone-event
705
* that is advertised by PJMEDIA for outgoing SDP. If this macro
706
* is set to zero, telephone events would not be advertised nor
709
* If this value is changed to other number, please update the
710
* PJMEDIA_RTP_PT_TELEPHONE_EVENTS_STR too.
712
#ifndef PJMEDIA_RTP_PT_TELEPHONE_EVENTS
713
# define PJMEDIA_RTP_PT_TELEPHONE_EVENTS 96
718
* Macro to get the string representation of the telephone-event
721
#ifndef PJMEDIA_RTP_PT_TELEPHONE_EVENTS_STR
722
# define PJMEDIA_RTP_PT_TELEPHONE_EVENTS_STR "96"
727
* Maximum tones/digits that can be enqueued in the tone generator.
729
#ifndef PJMEDIA_TONEGEN_MAX_DIGITS
730
# define PJMEDIA_TONEGEN_MAX_DIGITS 32
735
* Below specifies the various tone generator backend algorithm.
739
* The math's sine(), floating point. This has very good precision
740
* but it's the slowest and requires floating point support and
741
* linking with the math library.
743
#define PJMEDIA_TONEGEN_SINE 1
746
* Floating point approximation of sine(). This has relatively good
747
* precision and much faster than plain sine(), but it requires floating-
748
* point support and linking with the math library.
750
#define PJMEDIA_TONEGEN_FLOATING_POINT 2
753
* Fixed point using sine signal generated by Cordic algorithm. This
754
* algorithm can be tuned to provide balance between precision and
755
* performance by tuning the PJMEDIA_TONEGEN_FIXED_POINT_CORDIC_LOOP
756
* setting, and may be suitable for platforms that lack floating-point
759
#define PJMEDIA_TONEGEN_FIXED_POINT_CORDIC 3
762
* Fast fixed point using some approximation to generate sine waves.
763
* The tone generated by this algorithm is not very precise, however
764
* the algorithm is very fast.
766
#define PJMEDIA_TONEGEN_FAST_FIXED_POINT 4
770
* Specify the tone generator algorithm to be used. Please see
771
* http://trac.pjsip.org/repos/wiki/Tone_Generator for the performance
772
* analysis results of the various tone generator algorithms.
775
* - PJMEDIA_TONEGEN_FLOATING_POINT when PJ_HAS_FLOATING_POINT is set
776
* - PJMEDIA_TONEGEN_FIXED_POINT_CORDIC when PJ_HAS_FLOATING_POINT is not set
778
#ifndef PJMEDIA_TONEGEN_ALG
779
# if defined(PJ_HAS_FLOATING_POINT) && PJ_HAS_FLOATING_POINT
780
# define PJMEDIA_TONEGEN_ALG PJMEDIA_TONEGEN_FLOATING_POINT
782
# define PJMEDIA_TONEGEN_ALG PJMEDIA_TONEGEN_FIXED_POINT_CORDIC
788
* Specify the number of calculation loops to generate the tone, when
789
* PJMEDIA_TONEGEN_FIXED_POINT_CORDIC algorithm is used. With more calculation
790
* loops, the tone signal gets more precise, but this will add more
793
* Valid values are 1 to 28.
797
#ifndef PJMEDIA_TONEGEN_FIXED_POINT_CORDIC_LOOP
798
# define PJMEDIA_TONEGEN_FIXED_POINT_CORDIC_LOOP 10
803
* Enable high quality of tone generation, the better quality will cost
804
* more CPU load. This is only applied to floating point enabled machines.
806
* By default it is enabled when PJ_HAS_FLOATING_POINT is set.
808
* This macro has been deprecated in version 1.0-rc3.
810
#ifdef PJMEDIA_USE_HIGH_QUALITY_TONEGEN
811
# error "The PJMEDIA_USE_HIGH_QUALITY_TONEGEN macro is obsolete"
816
* Fade-in duration for the tone, in milliseconds. Set to zero to disable
821
#ifndef PJMEDIA_TONEGEN_FADE_IN_TIME
822
# define PJMEDIA_TONEGEN_FADE_IN_TIME 1
827
* Fade-out duration for the tone, in milliseconds. Set to zero to disable
832
#ifndef PJMEDIA_TONEGEN_FADE_OUT_TIME
833
# define PJMEDIA_TONEGEN_FADE_OUT_TIME 2
838
* The default tone generator amplitude (1-32767).
840
* Default value: 12288
842
#ifndef PJMEDIA_TONEGEN_VOLUME
843
# define PJMEDIA_TONEGEN_VOLUME 12288
848
* Enable support for SRTP media transport. This will require linking
849
* with libsrtp from the third_party directory.
851
* By default it is enabled.
853
#ifndef PJMEDIA_HAS_SRTP
854
# define PJMEDIA_HAS_SRTP 1
859
* Enable support to handle codecs with inconsistent clock rate
860
* between clock rate in SDP/RTP & the clock rate that is actually used.
861
* This happens for example with G.722 and MPEG audio codecs.
863
* - G.722 : RFC 3551 4.5.2
864
* - MPEG audio : RFC 3551 4.5.13 & RFC 3119
866
* Also when this feature is enabled, some handling will be performed
867
* to deal with clock rate incompatibilities of some phones.
869
* By default it is enabled.
871
#ifndef PJMEDIA_HANDLE_G722_MPEG_BUG
872
# define PJMEDIA_HANDLE_G722_MPEG_BUG 1
877
* Transport info (pjmedia_transport_info) contains a socket info and list
878
* of transport specific info, since transports can be chained together
879
* (for example, SRTP transport uses UDP transport as the underlying
880
* transport). This constant specifies maximum number of transport specific
881
* infos that can be held in a transport info.
883
#ifndef PJMEDIA_TRANSPORT_SPECIFIC_INFO_MAXCNT
884
# define PJMEDIA_TRANSPORT_SPECIFIC_INFO_MAXCNT 4
889
* Maximum size in bytes of storage buffer of a transport specific info.
891
#ifndef PJMEDIA_TRANSPORT_SPECIFIC_INFO_MAXSIZE
892
# define PJMEDIA_TRANSPORT_SPECIFIC_INFO_MAXSIZE (36*sizeof(long))
897
* Value to be specified in PJMEDIA_STREAM_ENABLE_KA setting.
898
* This indicates that an empty RTP packet should be used as
899
* the keep-alive packet.
901
#define PJMEDIA_STREAM_KA_EMPTY_RTP 1
904
* Value to be specified in PJMEDIA_STREAM_ENABLE_KA setting.
905
* This indicates that a user defined packet should be used
906
* as the keep-alive packet. The content of the user-defined
907
* packet is specified by PJMEDIA_STREAM_KA_USER_PKT. Default
908
* content is a CR-LF packet.
910
#define PJMEDIA_STREAM_KA_USER 2
913
* The content of the user defined keep-alive packet. The format
914
* of the packet is initializer to pj_str_t structure. Note that
915
* the content may contain NULL character.
917
#ifndef PJMEDIA_STREAM_KA_USER_PKT
918
# define PJMEDIA_STREAM_KA_USER_PKT { "\r\n", 2 }
922
* Specify another type of keep-alive and NAT hole punching
923
* mechanism (the other type is PJMEDIA_STREAM_VAD_SUSPEND_MSEC
924
* and PJMEDIA_CODEC_MAX_SILENCE_PERIOD) to be used by stream.
925
* When this feature is enabled, the stream will initially
926
* transmit one packet to punch a hole in NAT, and periodically
927
* transmit keep-alive packets.
929
* When this alternative keep-alive mechanism is used, application
930
* may disable the other keep-alive mechanisms, i.e: by setting
931
* PJMEDIA_STREAM_VAD_SUSPEND_MSEC to zero and
932
* PJMEDIA_CODEC_MAX_SILENCE_PERIOD to -1.
934
* The value of this macro specifies the type of packet used
935
* for the keep-alive mechanism. Valid values are
936
* PJMEDIA_STREAM_KA_EMPTY_RTP and PJMEDIA_STREAM_KA_USER.
938
* The duration of the keep-alive interval further can be set
939
* with PJMEDIA_STREAM_KA_INTERVAL setting.
941
* Default: 0 (disabled)
943
#ifndef PJMEDIA_STREAM_ENABLE_KA
944
# define PJMEDIA_STREAM_ENABLE_KA 0
949
* Specify the keep-alive interval of PJMEDIA_STREAM_ENABLE_KA
950
* mechanism, in seconds.
954
#ifndef PJMEDIA_STREAM_KA_INTERVAL
955
# define PJMEDIA_STREAM_KA_INTERVAL 5
960
* .... new stuffs ...
968
* Top level option to enable/disable video features.
970
* Default: 0 (disabled)
972
#ifndef PJMEDIA_HAS_VIDEO
973
# define PJMEDIA_HAS_VIDEO 0
978
* Specify if FFMPEG is available. The value here will be used as the default
979
* value for other FFMPEG settings below.
983
#ifndef PJMEDIA_HAS_FFMPEG
984
# define PJMEDIA_HAS_FFMPEG 0
988
* Specify if FFMPEG libavformat is available.
990
* Default: PJMEDIA_HAS_FFMPEG (or detected by configure)
992
#ifndef PJMEDIA_HAS_LIBAVFORMAT
993
# define PJMEDIA_HAS_LIBAVFORMAT PJMEDIA_HAS_FFMPEG
997
* Specify if FFMPEG libavformat is available.
999
* Default: PJMEDIA_HAS_FFMPEG (or detected by configure)
1001
#ifndef PJMEDIA_HAS_LIBAVCODEC
1002
# define PJMEDIA_HAS_LIBAVCODEC PJMEDIA_HAS_FFMPEG
1006
* Specify if FFMPEG libavutil is available.
1008
* Default: PJMEDIA_HAS_FFMPEG (or detected by configure)
1010
#ifndef PJMEDIA_HAS_LIBAVUTIL
1011
# define PJMEDIA_HAS_LIBAVUTIL PJMEDIA_HAS_FFMPEG
1015
* Specify if FFMPEG libswscale is available.
1017
* Default: PJMEDIA_HAS_FFMPEG (or detected by configure)
1019
#ifndef PJMEDIA_HAS_LIBSWSCALE
1020
# define PJMEDIA_HAS_LIBSWSCALE PJMEDIA_HAS_FFMPEG
1024
* Specify if FFMPEG libavdevice is available.
1026
* Default: PJMEDIA_HAS_FFMPEG (or detected by configure)
1028
#ifndef PJMEDIA_HAS_LIBAVDEVICE
1029
# define PJMEDIA_HAS_LIBAVDEVICE PJMEDIA_HAS_FFMPEG
1033
* Specify if FFMPEG libavcore is available.
1035
* Default: PJMEDIA_HAS_FFMPEG (or detected by configure)
1037
#ifndef PJMEDIA_HAS_LIBAVCORE
1038
# define PJMEDIA_HAS_LIBAVCORE PJMEDIA_HAS_FFMPEG
1042
* Maximum video planes.
1046
#ifndef PJMEDIA_MAX_VIDEO_PLANES
1047
# define PJMEDIA_MAX_VIDEO_PLANES 4
1051
* Maximum number of video formats.
1055
#ifndef PJMEDIA_MAX_VIDEO_FORMATS
1056
# define PJMEDIA_MAX_VIDEO_FORMATS 32
1060
* Specify the maximum time difference (in ms) for synchronization between
1061
* two medias. If the synchronization media source is ahead of time
1062
* greater than this duration, it is considered to make a very large jump
1063
* and the synchronization will be reset.
1067
#ifndef PJMEDIA_CLOCK_SYNC_MAX_SYNC_MSEC
1068
# define PJMEDIA_CLOCK_SYNC_MAX_SYNC_MSEC 20000
1072
* Maximum video frame size.
1075
#ifndef PJMEDIA_MAX_VIDEO_ENC_FRAME_SIZE
1076
# define PJMEDIA_MAX_VIDEO_ENC_FRAME_SIZE (1<<17)
1081
* Specify the maximum duration (in ms) for resynchronization. When a media
1082
* is late to another media it is supposed to be synchronized to, it is
1083
* guaranteed to be synchronized again after this duration. While if the
1084
* media is ahead/early by t ms, it is guaranteed to be synchronized after
1085
* t + this duration. This timing only applies if there is no additional
1086
* resynchronization required during the specified duration.
1090
#ifndef PJMEDIA_CLOCK_SYNC_MAX_RESYNC_DURATION
1091
# define PJMEDIA_CLOCK_SYNC_MAX_RESYNC_DURATION 2000
1096
* Minimum gap between two consecutive discards in jitter buffer,
1101
#ifndef PJMEDIA_JBUF_DISC_MIN_GAP
1102
# define PJMEDIA_JBUF_DISC_MIN_GAP 200
1107
* Minimum burst level reference used for calculating discard duration
1108
* in jitter buffer progressive discard algorithm, in frames.
1112
#ifndef PJMEDIA_JBUF_PRO_DISC_MIN_BURST
1113
# define PJMEDIA_JBUF_PRO_DISC_MIN_BURST 1
1118
* Maximum burst level reference used for calculating discard duration
1119
* in jitter buffer progressive discard algorithm, in frames.
1121
* Default: 200 frames
1123
#ifndef PJMEDIA_JBUF_PRO_DISC_MAX_BURST
1124
# define PJMEDIA_JBUF_PRO_DISC_MAX_BURST 100
1129
* Duration for progressive discard algotithm in jitter buffer to discard
1130
* an excessive frame when burst is equal to or lower than
1131
* PJMEDIA_JBUF_PRO_DISC_MIN_BURST, in milliseconds.
1135
#ifndef PJMEDIA_JBUF_PRO_DISC_T1
1136
# define PJMEDIA_JBUF_PRO_DISC_T1 2000
1141
* Duration for progressive discard algotithm in jitter buffer to discard
1142
* an excessive frame when burst is equal to or greater than
1143
* PJMEDIA_JBUF_PRO_DISC_MAX_BURST, in milliseconds.
1147
#ifndef PJMEDIA_JBUF_PRO_DISC_T2
1148
# define PJMEDIA_JBUF_PRO_DISC_T2 10000
1153
* Video stream will discard old picture from the jitter buffer as soon as
1154
* new picture is received, to reduce latency.
1158
#ifndef PJMEDIA_VID_STREAM_SKIP_PACKETS_TO_REDUCE_LATENCY
1159
# define PJMEDIA_VID_STREAM_SKIP_PACKETS_TO_REDUCE_LATENCY 0
1164
* Maximum video payload size. Note that this must not be greater than
1167
* Default: (PJMEDIA_MAX_MTU - 100)
1169
#ifndef PJMEDIA_MAX_VID_PAYLOAD_SIZE
1170
# define PJMEDIA_MAX_VID_PAYLOAD_SIZE (PJMEDIA_MAX_MTU - 100)
1179
#endif /* __PJMEDIA_CONFIG_H__ */