pjsip logo pjsip.org
Open source SIP stack and media stack for presence, im/instant messaging, and multimedia communication

HOME

SIP/media Features
High Performance SIP
Small Footprint SIP
Symbian Port

FAQ

Documentation

Licensing

Download

Development (Trac)

Projects using pjsip

Mailing List

Open Source Links


About: PJLIB, PJLIB-UTIL, PJSIP, and PJMEDIA are created by: Benny Prijono
<bennylp@pjsip.org>


 

Home --> Documentations --> PJMEDIA Reference

Compile time configuration
[Base Types and Configurations]


Detailed Description


Defines

#define PJMEDIA_SOUND_NULL_SOUND   0
#define PJMEDIA_SOUND_PORTAUDIO_SOUND   1
#define PJMEDIA_SOUND_WIN32_DIRECT_SOUND   2
#define PJMEDIA_SOUND_WIN32_MME_SOUND   3
#define PJMEDIA_SOUND_EXTERNAL   255
#define PJMEDIA_SOUND_IMPLEMENTATION   PJMEDIA_SOUND_PORTAUDIO_SOUND
#define PJMEDIA_PREFER_DIRECT_SOUND   0
#define PJMEDIA_SND_DEFAULT_REC_LATENCY   100
#define PJMEDIA_SND_DEFAULT_PLAY_LATENCY   100
#define PJMEDIA_SOUND_USE_DELAYBUF   0
#define PJMEDIA_WSOLA_IMP_NULL   0
#define PJMEDIA_WSOLA_IMP_WSOLA   1
#define PJMEDIA_WSOLA_IMP_WSOLA_LITE   2
#define PJMEDIA_WSOLA_IMP   PJMEDIA_WSOLA_IMP_WSOLA
#define PJMEDIA_SOUND_BUFFER_COUNT   6
#define PJMEDIA_HAS_ALAW_ULAW_TABLE   1
#define PJMEDIA_HAS_G711_CODEC   1
#define PJMEDIA_RESAMPLE_NONE   1
#define PJMEDIA_RESAMPLE_LIBRESAMPLE   2
#define PJMEDIA_RESAMPLE_SPEEX   3
#define PJMEDIA_RESAMPLE_LIBSAMPLERATE   4
#define PJMEDIA_RESAMPLE_IMP   PJMEDIA_RESAMPLE_LIBRESAMPLE
#define PJMEDIA_FILE_PORT_BUFSIZE   4000
#define PJMEDIA_MAX_FRAME_DURATION_MS   200
#define PJMEDIA_MAX_MTU   1500
#define PJMEDIA_DTMF_DURATION   1600
#define PJMEDIA_RTP_NAT_PROBATION_CNT   10
#define PJMEDIA_ADVERTISE_RTCP   1
#define PJMEDIA_RTCP_INTERVAL   5000
#define PJMEDIA_RTCP_IGNORE_FIRST_PACKETS   25
#define PJMEDIA_HAS_RTCP_XR   0
#define PJMEDIA_STREAM_ENABLE_XR   0
#define PJMEDIA_STREAM_VAD_SUSPEND_MSEC   600
#define PJMEDIA_CODEC_MAX_SILENCE_PERIOD   5000
#define PJMEDIA_SILENCE_DET_THRESHOLD   4
#define PJMEDIA_SILENCE_DET_MAX_THRESHOLD   25
#define PJMEDIA_HAS_SPEEX_AEC   1
#define PJMEDIA_SDP_NEG_PREFER_REMOTE_CODEC_ORDER   1
#define PJMEDIA_HAS_RTCP_IN_SDP   (PJMEDIA_ADVERTISE_RTCP)
#define PJMEDIA_ADD_RTPMAP_FOR_STATIC_PT   1
#define PJMEDIA_RTP_PT_TELEPHONE_EVENTS   101
#define PJMEDIA_RTP_PT_TELEPHONE_EVENTS_STR   "101"
#define PJMEDIA_TONEGEN_MAX_DIGITS   32
#define PJMEDIA_TONEGEN_SINE   1
#define PJMEDIA_TONEGEN_FLOATING_POINT   2
#define PJMEDIA_TONEGEN_FIXED_POINT_CORDIC   3
#define PJMEDIA_TONEGEN_FAST_FIXED_POINT   4
#define PJMEDIA_TONEGEN_ALG   PJMEDIA_TONEGEN_FIXED_POINT_CORDIC
#define PJMEDIA_TONEGEN_FIXED_POINT_CORDIC_LOOP   10
#define PJMEDIA_TONEGEN_FADE_IN_TIME   1
#define PJMEDIA_TONEGEN_FADE_OUT_TIME   2
#define PJMEDIA_TONEGEN_VOLUME   12288
#define PJMEDIA_HANDLE_G722_MPEG_BUG   1
#define PJMEDIA_TRANSPORT_SPECIFIC_INFO_MAXCNT   4
#define PJMEDIA_TRANSPORT_SPECIFIC_INFO_MAXSIZE   (16*sizeof(long))


Define Documentation

#define PJMEDIA_SOUND_NULL_SOUND   0

Constant for NULL sound backend.

#define PJMEDIA_SOUND_PORTAUDIO_SOUND   1

Constant for PortAudio sound backend.

#define PJMEDIA_SOUND_WIN32_DIRECT_SOUND   2

Constant for Win32 DirectSound sound backend.

#define PJMEDIA_SOUND_WIN32_MME_SOUND   3

Constant for Win32 MME sound backend.

#define PJMEDIA_SOUND_EXTERNAL   255

When this is set, pjmedia will not provide any sound device backend. Application will have to provide its own sound device backend and link the application with it.

#define PJMEDIA_SOUND_IMPLEMENTATION   PJMEDIA_SOUND_PORTAUDIO_SOUND

Unless specified otherwise, sound device uses PortAudio implementation by default.

#define PJMEDIA_PREFER_DIRECT_SOUND   0

Specify whether we prefer to use DirectSound on Windows.

Default: 0

#define PJMEDIA_SND_DEFAULT_REC_LATENCY   100

Specify sound device latency default, in milisecond.

#define PJMEDIA_SOUND_USE_DELAYBUF   0

Specify whether delay buffer is used for sound device. When delay buffer is enabled, the sound device callback will be called one after another evenly. The delay buffer also performs the best delay calculation for the sound device, and will try to limit the delay caused by uneven callback calls to this delay.

When this setting is enabled, the PJMEDIA_SOUND_BUFFER_COUNT macro will specify the maximum size of the delay buffer.

#define PJMEDIA_WSOLA_IMP_NULL   0

This denotes implementation of WSOLA using null algorithm. Expansion will generate zero frames, and compression will just discard some samples from the input.

This type of implementation may be used as it requires the least processing power.

#define PJMEDIA_WSOLA_IMP_WSOLA   1

This denotes implementation of WSOLA using fixed or floating point WSOLA algorithm. This implementation provides the best quality of the result, at the expense of one frame delay and intensive processing power requirement.

#define PJMEDIA_WSOLA_IMP_WSOLA_LITE   2

This denotes implementation of WSOLA algorithm with faster waveform similarity calculation. This implementation provides fair quality of the result with the main advantage of low processing power requirement.

#define PJMEDIA_WSOLA_IMP   PJMEDIA_WSOLA_IMP_WSOLA

Specify type of Waveform based Similarity Overlap and Add (WSOLA) backend implementation to be used. WSOLA is an algorithm to expand and/or compress audio frames without changing the pitch, and used by the delaybuf and as PLC backend algorithm.

Default is PJMEDIA_WSOLA_IMP_WSOLA

#define PJMEDIA_SOUND_BUFFER_COUNT   6

Specify number of sound buffers. Larger number is better for sound stability and to accommodate sound devices that are unable to send frames in timely manner, however it would probably cause more audio delay (and definitely will take more memory). One individual buffer is normally 10ms or 20 ms long, depending on ptime settings (samples_per_frame value).

The setting here currently is used by the conference bridge, the splitter combiner port, and dsound.c.

Default: 6

#define PJMEDIA_HAS_ALAW_ULAW_TABLE   1

Specify which A-law/U-law conversion algorithm to use. By default the conversion algorithm uses A-law/U-law table which gives the best performance, at the expense of 33 KBytes of static data. If this option is disabled, a smaller but slower algorithm will be used.

#define PJMEDIA_HAS_G711_CODEC   1

Unless specified otherwise, G711 codec is included by default.

#define PJMEDIA_RESAMPLE_NONE   1

No resampling.

#define PJMEDIA_RESAMPLE_LIBRESAMPLE   2

Sample rate conversion using libresample.

#define PJMEDIA_RESAMPLE_SPEEX   3

Sample rate conversion using Speex.

#define PJMEDIA_RESAMPLE_LIBSAMPLERATE   4

Sample rate conversion using libsamplerate (a.k.a Secret Rabbit Code)

#define PJMEDIA_RESAMPLE_IMP   PJMEDIA_RESAMPLE_LIBRESAMPLE

Select which resample implementation to use. Currently pjmedia supports:

Default is PJMEDIA_RESAMPLE_LIBRESAMPLE

#define PJMEDIA_FILE_PORT_BUFSIZE   4000

Specify whether libsamplerate, when used, should be linked statically into the application. This option is only useful for Visual Studio projects, and when this static linking is enabled Default file player/writer buffer size.

#define PJMEDIA_MAX_FRAME_DURATION_MS   200

Maximum frame duration (in msec) to be supported. This (among other thing) will affect the size of buffers to be allocated for outgoing packets.

#define PJMEDIA_MAX_MTU   1500

Max packet size to support.

#define PJMEDIA_DTMF_DURATION   1600

DTMF/telephone-event duration, in timestamp.

#define PJMEDIA_RTP_NAT_PROBATION_CNT   10

Number of packets received from different source IP address from the remote address required to make the stream switch transmission to the source address.

#define PJMEDIA_ADVERTISE_RTCP   1

Specify whether RTCP should be advertised in SDP. This setting would affect whether RTCP candidate will be added in SDP when ICE is used. Application might want to disable RTCP advertisement in SDP to reduce the message size.

Default: 1 (yes)

#define PJMEDIA_RTCP_INTERVAL   5000

Interval to send RTCP packets, in msec

#define PJMEDIA_RTCP_IGNORE_FIRST_PACKETS   25

Tell RTCP to ignore the first N packets when calculating the jitter statistics. From experimentation, the first few packets (25 or so) have relatively big jitter, possibly because during this time, the program is also busy setting up the signaling, so they make the average jitter big.

Default: 25.

#define PJMEDIA_HAS_RTCP_XR   0

Specify whether RTCP XR support should be built into PJMEDIA. Disabling this feature will reduce footprint slightly. Note that even when this setting is enabled, RTCP XR processing will only be performed in stream if it is enabled on run-time on per stream basis. See PJMEDIA_STREAM_ENABLE_XR setting for more info.

Default: 1 (yes).

#define PJMEDIA_STREAM_ENABLE_XR   0

The RTCP XR feature is activated and used by stream if enable_rtcp_xr field of pjmedia_stream_info structure is non-zero. This setting controls the default value of this field.

Default: 0 (disabled)

#define PJMEDIA_STREAM_VAD_SUSPEND_MSEC   600

Specify how long (in miliseconds) the stream should suspend the silence detector/voice activity detector (VAD) during the initial period of the session. This feature is useful to open bindings in all NAT routers between local and remote endpoint since most NATs do not allow incoming packet to get in before local endpoint sends outgoing packets.

Specify zero to disable this feature.

Default: 600 msec (which gives good probability that some RTP packets will reach the destination, but without filling up the jitter buffer on the remote end).

#define PJMEDIA_CODEC_MAX_SILENCE_PERIOD   5000

Specify the maximum duration of silence period in the codec, in msec. This is useful for example to keep NAT binding open in the firewall and to prevent server from disconnecting the call because no RTP packet is received.

This only applies to codecs that use PJMEDIA's VAD (pretty much everything including iLBC, except Speex, which has its own DTX mechanism).

Use (-1) to disable this feature.

Default: 5000 ms

#define PJMEDIA_SILENCE_DET_THRESHOLD   4

Suggested or default threshold to be set for fixed silence detection or as starting threshold for adaptive silence detection. The threshold has the range from zero to 255.

#define PJMEDIA_SILENCE_DET_MAX_THRESHOLD   25

Maximum silence threshold in the silence detector. The silence detector will not cut the audio transmission if the audio level is above this level.

Default: 25

#define PJMEDIA_HAS_SPEEX_AEC   1

Speex Accoustic Echo Cancellation (AEC). By default is enabled.

#define PJMEDIA_SDP_NEG_PREFER_REMOTE_CODEC_ORDER   1

This specifies the behavior of the SDP negotiator when responding to an offer, whether it should rather use the codec preference as set by remote, or should it rather use the codec preference as specified by local endpoint.

For example, suppose incoming call has codec order "8 0 3", while local codec order is "3 0 8". If remote codec order is preferable, the selected codec will be 8, while if local codec order is preferable, the selected codec will be 3.

If set to non-zero, the negotiator will use the codec order as specified by remote in the offer.

Note that this behavior can be changed during run-time by calling pjmedia_sdp_neg_set_prefer_remote_codec_order().

Default is 1 (to maintain backward compatibility)

#define PJMEDIA_HAS_RTCP_IN_SDP   (PJMEDIA_ADVERTISE_RTCP)

Support for sending and decoding RTCP port in SDP (RFC 3605). Default is equal to PJMEDIA_ADVERTISE_RTCP setting.

#define PJMEDIA_ADD_RTPMAP_FOR_STATIC_PT   1

This macro controls whether pjmedia should include SDP rtpmap attribute for static payload types. SDP rtpmap for static payload types are optional, although they are normally included for interoperability reason.

Note that there is also a run-time variable to turn this setting on or off, defined in endpoint.c. To access this variable, use the following construct

    extern pj_bool_t pjmedia_add_rtpmap_for_static_pt;

    // Do not include rtpmap for static payload types (<96)
    pjmedia_add_rtpmap_for_static_pt = PJ_FALSE;
 

Default: 1 (yes)

#define PJMEDIA_RTP_PT_TELEPHONE_EVENTS   101

This macro declares the payload type for telephone-event that is advertised by PJMEDIA for outgoing SDP. If this macro is set to zero, telephone events would not be advertised nor supported.

If this value is changed to other number, please update the PJMEDIA_RTP_PT_TELEPHONE_EVENTS_STR too.

#define PJMEDIA_RTP_PT_TELEPHONE_EVENTS_STR   "101"

Macro to get the string representation of the telephone-event payload type.

#define PJMEDIA_TONEGEN_MAX_DIGITS   32

Maximum tones/digits that can be enqueued in the tone generator.

#define PJMEDIA_TONEGEN_SINE   1

The math's sine(), floating point. This has very good precision but it's the slowest and requires floating point support and linking with the math library.

#define PJMEDIA_TONEGEN_FLOATING_POINT   2

Floating point approximation of sine(). This has relatively good precision and much faster than plain sine(), but it requires floating- point support and linking with the math library.

#define PJMEDIA_TONEGEN_FIXED_POINT_CORDIC   3

Fixed point using sine signal generated by Cordic algorithm. This algorithm can be tuned to provide balance between precision and performance by tuning the PJMEDIA_TONEGEN_FIXED_POINT_CORDIC_LOOP setting, and may be suitable for platforms that lack floating-point support.

#define PJMEDIA_TONEGEN_FAST_FIXED_POINT   4

Fast fixed point using some approximation to generate sine waves. The tone generated by this algorithm is not very precise, however the algorithm is very fast.

#define PJMEDIA_TONEGEN_ALG   PJMEDIA_TONEGEN_FIXED_POINT_CORDIC

Specify the tone generator algorithm to be used. Please see http://trac.pjsip.org/repos/wiki/Tone_Generator for the performance analysis results of the various tone generator algorithms.

Default value:

  • PJMEDIA_TONEGEN_FLOATING_POINT when PJ_HAS_FLOATING_POINT is set
  • PJMEDIA_TONEGEN_FIXED_POINT_CORDIC when PJ_HAS_FLOATING_POINT is not set

#define PJMEDIA_TONEGEN_FIXED_POINT_CORDIC_LOOP   10

Specify the number of calculation loops to generate the tone, when PJMEDIA_TONEGEN_FIXED_POINT_CORDIC algorithm is used. With more calculation loops, the tone signal gets more precise, but this will add more processing.

Valid values are 1 to 28.

Default value: 10

#define PJMEDIA_TONEGEN_FADE_IN_TIME   1

Enable high quality of tone generation, the better quality will cost more CPU load. This is only applied to floating point enabled machines.

By default it is enabled when PJ_HAS_FLOATING_POINT is set.

This macro has been deprecated in version 1.0-rc3. Fade-in duration for the tone, in milliseconds. Set to zero to disable this feature.

Default: 1 (msec)

#define PJMEDIA_TONEGEN_FADE_OUT_TIME   2

Fade-out duration for the tone, in milliseconds. Set to zero to disable this feature.

Default: 2 (msec)

#define PJMEDIA_TONEGEN_VOLUME   12288

The default tone generator amplitude (1-32767).

Default value: 12288

#define PJMEDIA_HANDLE_G722_MPEG_BUG   1

Enable support for SRTP media transport. This will require linking with libsrtp from the third_party directory.

By default it is enabled. Enable support to handle codecs with inconsistent clock rate between clock rate in SDP/RTP & the clock rate that is actually used. This happens for example with G.722 and MPEG audio codecs. See:

  • G.722 : RFC 3551 4.5.2
  • MPEG audio : RFC 3551 4.5.13 & RFC 3119

Also when this feature is enabled, some handling will be performed to deal with clock rate incompatibilities of some phones.

By default it is enabled.

#define PJMEDIA_TRANSPORT_SPECIFIC_INFO_MAXCNT   4

Transport info (pjmedia_transport_info) contains a socket info and list of transport specific info, since transports can be chained together (for example, SRTP transport uses UDP transport as the underlying transport). This constant specifies maximum number of transport specific infos that can be held in a transport info.

#define PJMEDIA_TRANSPORT_SPECIFIC_INFO_MAXSIZE   (16*sizeof(long))

Maximum size in bytes of storage buffer of a transport specific info.

 


PJMEDIA small footprint Open Source media stack
(C)2003-2008 Benny Prijono