config_site_sample.h 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485
  1. /*
  2. * This file contains several sample settings especially for Windows
  3. * Mobile and Symbian targets. You can include this file in your
  4. * <pj/config_site.h> file.
  5. *
  6. * The Windows Mobile and Symbian settings will be activated
  7. * automatically if you include this file.
  8. *
  9. * In addition, you may specify one of these macros (before including
  10. * this file) to activate additional settings:
  11. *
  12. * #define PJ_CONFIG_NOKIA_APS_DIRECT
  13. * Use this macro to activate the APS-Direct feature. Please see
  14. * http://trac.pjsip.org/repos/wiki/Nokia_APS_VAS_Direct for more
  15. * info.
  16. *
  17. * #define PJ_CONFIG_WIN32_WMME_DIRECT
  18. * Configuration to activate "APS-Direct" media mode on Windows or
  19. * Windows Mobile, useful for testing purposes only.
  20. */
  21. /*
  22. * Typical configuration for WinCE target.
  23. */
  24. #if defined(PJ_WIN32_WINCE) && PJ_WIN32_WINCE!=0
  25. /*
  26. * PJLIB settings.
  27. */
  28. /* Disable floating point support */
  29. #define PJ_HAS_FLOATING_POINT 0
  30. /*
  31. * PJMEDIA settings
  32. */
  33. /* Select codecs to disable */
  34. #define PJMEDIA_HAS_L16_CODEC 0
  35. #define PJMEDIA_HAS_ILBC_CODEC 0
  36. /* We probably need more buffers on WM, so increase the limit */
  37. #define PJMEDIA_SOUND_BUFFER_COUNT 32
  38. /* Fine tune Speex's default settings for best performance/quality */
  39. #define PJMEDIA_CODEC_SPEEX_DEFAULT_QUALITY 5
  40. /* For CPU reason, disable speex AEC and use the echo suppressor. */
  41. #define PJMEDIA_HAS_SPEEX_AEC 0
  42. /* Previously, resampling is disabled due to performance reason and
  43. * this condition prevented some 'light' wideband codecs (e.g: G722.1)
  44. * to work along with narrowband codecs. Lately, some tests showed
  45. * that 16kHz <-> 8kHz resampling using libresample small filter was
  46. * affordable on ARM9 260 MHz, so here we decided to enable resampling.
  47. * Note that it is important to make sure that libresample is created
  48. * using small filter. For example PJSUA_DEFAULT_CODEC_QUALITY must
  49. * be set to 3 or 4 so pjsua-lib will apply small filter resampling.
  50. */
  51. //#define PJMEDIA_RESAMPLE_IMP PJMEDIA_RESAMPLE_NONE
  52. #define PJMEDIA_RESAMPLE_IMP PJMEDIA_RESAMPLE_LIBRESAMPLE
  53. /* Use the lighter WSOLA implementation */
  54. #define PJMEDIA_WSOLA_IMP PJMEDIA_WSOLA_IMP_WSOLA_LITE
  55. /*
  56. * PJSIP settings.
  57. */
  58. /* Set maximum number of dialog/transaction/calls to minimum to reduce
  59. * memory usage
  60. */
  61. #define PJSIP_MAX_TSX_COUNT 31
  62. #define PJSIP_MAX_DIALOG_COUNT 31
  63. #define PJSUA_MAX_CALLS 4
  64. /*
  65. * PJSUA settings
  66. */
  67. /* Default codec quality, previously was set to 5, however it is now
  68. * set to 4 to make sure pjsua instantiates resampler with small filter.
  69. */
  70. #define PJSUA_DEFAULT_CODEC_QUALITY 4
  71. /* Set maximum number of objects to minimum to reduce memory usage */
  72. #define PJSUA_MAX_ACC 4
  73. #define PJSUA_MAX_PLAYERS 4
  74. #define PJSUA_MAX_RECORDERS 4
  75. #define PJSUA_MAX_CONF_PORTS (PJSUA_MAX_CALLS+2*PJSUA_MAX_PLAYERS)
  76. #define PJSUA_MAX_BUDDIES 32
  77. #endif /* PJ_WIN32_WINCE */
  78. /*
  79. * Typical configuration for Symbian OS target
  80. */
  81. #if defined(PJ_SYMBIAN) && PJ_SYMBIAN!=0
  82. /*
  83. * PJLIB settings.
  84. */
  85. /* Disable floating point support */
  86. #define PJ_HAS_FLOATING_POINT 0
  87. /* Misc PJLIB setting */
  88. #define PJ_MAXPATH 80
  89. /* This is important for Symbian. Symbian lacks vsnprintf(), so
  90. * if the log buffer is not long enough it's possible that
  91. * large incoming packet will corrupt memory when the log tries
  92. * to log the packet.
  93. */
  94. #define PJ_LOG_MAX_SIZE (PJSIP_MAX_PKT_LEN+500)
  95. /* Since we don't have threads, log buffer can use static buffer
  96. * rather than stack
  97. */
  98. #define PJ_LOG_USE_STACK_BUFFER 0
  99. /* Disable check stack since it increases footprint */
  100. #define PJ_OS_HAS_CHECK_STACK 0
  101. /*
  102. * PJMEDIA settings
  103. */
  104. /* Disable non-Symbian audio devices */
  105. #define PJMEDIA_AUDIO_DEV_HAS_PORTAUDIO 0
  106. #define PJMEDIA_AUDIO_DEV_HAS_WMME 0
  107. /* Select codecs to disable */
  108. #define PJMEDIA_HAS_L16_CODEC 0
  109. #define PJMEDIA_HAS_ILBC_CODEC 0
  110. #define PJMEDIA_HAS_G722_CODEC 0
  111. /* Fine tune Speex's default settings for best performance/quality */
  112. #define PJMEDIA_CODEC_SPEEX_DEFAULT_QUALITY 5
  113. /* For CPU reason, disable speex AEC and use the echo suppressor. */
  114. #define PJMEDIA_HAS_SPEEX_AEC 0
  115. /* Previously, resampling is disabled due to performance reason and
  116. * this condition prevented some 'light' wideband codecs (e.g: G722.1)
  117. * to work along with narrowband codecs. Lately, some tests showed
  118. * that 16kHz <-> 8kHz resampling using libresample small filter was
  119. * affordable on ARM9 222 MHz, so here we decided to enable resampling.
  120. * Note that it is important to make sure that libresample is created
  121. * using small filter. For example PJSUA_DEFAULT_CODEC_QUALITY must
  122. * be set to 3 or 4 so pjsua-lib will apply small filter resampling.
  123. */
  124. //#define PJMEDIA_RESAMPLE_IMP PJMEDIA_RESAMPLE_NONE
  125. #define PJMEDIA_RESAMPLE_IMP PJMEDIA_RESAMPLE_LIBRESAMPLE
  126. /* Use the lighter WSOLA implementation */
  127. #define PJMEDIA_WSOLA_IMP PJMEDIA_WSOLA_IMP_WSOLA_LITE
  128. /* We probably need more buffers especially if MDA audio backend
  129. * is used, so increase the limit
  130. */
  131. #define PJMEDIA_SOUND_BUFFER_COUNT 32
  132. /*
  133. * PJSIP settings.
  134. */
  135. /* Disable safe module access, since we don't use multithreading */
  136. #define PJSIP_SAFE_MODULE 0
  137. /* Use large enough packet size */
  138. #define PJSIP_MAX_PKT_LEN 2000
  139. /* Symbian has problem with too many large blocks */
  140. #define PJSIP_POOL_LEN_ENDPT 1000
  141. #define PJSIP_POOL_INC_ENDPT 1000
  142. #define PJSIP_POOL_RDATA_LEN 2000
  143. #define PJSIP_POOL_RDATA_INC 2000
  144. #define PJSIP_POOL_LEN_TDATA 2000
  145. #define PJSIP_POOL_INC_TDATA 512
  146. #define PJSIP_POOL_LEN_UA 2000
  147. #define PJSIP_POOL_INC_UA 1000
  148. #define PJSIP_POOL_TSX_LAYER_LEN 256
  149. #define PJSIP_POOL_TSX_LAYER_INC 256
  150. #define PJSIP_POOL_TSX_LEN 512
  151. #define PJSIP_POOL_TSX_INC 128
  152. /*
  153. * PJSUA settings.
  154. */
  155. /* Default codec quality, previously was set to 5, however it is now
  156. * set to 4 to make sure pjsua instantiates resampler with small filter.
  157. */
  158. #define PJSUA_DEFAULT_CODEC_QUALITY 4
  159. /* Set maximum number of dialog/transaction/calls to minimum */
  160. #define PJSIP_MAX_TSX_COUNT 31
  161. #define PJSIP_MAX_DIALOG_COUNT 31
  162. #define PJSUA_MAX_CALLS 4
  163. /* Other pjsua settings */
  164. #define PJSUA_MAX_ACC 4
  165. #define PJSUA_MAX_PLAYERS 4
  166. #define PJSUA_MAX_RECORDERS 4
  167. #define PJSUA_MAX_CONF_PORTS (PJSUA_MAX_CALLS+2*PJSUA_MAX_PLAYERS)
  168. #define PJSUA_MAX_BUDDIES 32
  169. #endif
  170. /*
  171. * Additional configuration to activate APS-Direct feature for
  172. * Nokia S60 target
  173. *
  174. * Please see http://trac.pjsip.org/repos/wiki/Nokia_APS_VAS_Direct
  175. */
  176. #ifdef PJ_CONFIG_NOKIA_APS_DIRECT
  177. /* MUST use switchboard rather than the conference bridge */
  178. #define PJMEDIA_CONF_USE_SWITCH_BOARD 1
  179. /* Enable APS sound device backend and disable MDA & VAS */
  180. #define PJMEDIA_AUDIO_DEV_HAS_SYMB_MDA 0
  181. #define PJMEDIA_AUDIO_DEV_HAS_SYMB_APS 1
  182. #define PJMEDIA_AUDIO_DEV_HAS_SYMB_VAS 0
  183. /* Enable passthrough codec framework */
  184. #define PJMEDIA_HAS_PASSTHROUGH_CODECS 1
  185. /* And selectively enable which codecs are supported by the handset */
  186. #define PJMEDIA_HAS_PASSTHROUGH_CODEC_PCMU 1
  187. #define PJMEDIA_HAS_PASSTHROUGH_CODEC_PCMA 1
  188. #define PJMEDIA_HAS_PASSTHROUGH_CODEC_AMR 1
  189. #define PJMEDIA_HAS_PASSTHROUGH_CODEC_G729 1
  190. #define PJMEDIA_HAS_PASSTHROUGH_CODEC_ILBC 1
  191. #endif
  192. /*
  193. * Additional configuration to activate VAS-Direct feature for
  194. * Nokia S60 target
  195. *
  196. * Please see http://trac.pjsip.org/repos/wiki/Nokia_APS_VAS_Direct
  197. */
  198. #ifdef PJ_CONFIG_NOKIA_VAS_DIRECT
  199. /* MUST use switchboard rather than the conference bridge */
  200. #define PJMEDIA_CONF_USE_SWITCH_BOARD 1
  201. /* Enable VAS sound device backend and disable MDA & APS */
  202. #define PJMEDIA_AUDIO_DEV_HAS_SYMB_MDA 0
  203. #define PJMEDIA_AUDIO_DEV_HAS_SYMB_APS 0
  204. #define PJMEDIA_AUDIO_DEV_HAS_SYMB_VAS 1
  205. /* Enable passthrough codec framework */
  206. #define PJMEDIA_HAS_PASSTHROUGH_CODECS 1
  207. /* And selectively enable which codecs are supported by the handset */
  208. #define PJMEDIA_HAS_PASSTHROUGH_CODEC_PCMU 1
  209. #define PJMEDIA_HAS_PASSTHROUGH_CODEC_PCMA 1
  210. #define PJMEDIA_HAS_PASSTHROUGH_CODEC_AMR 1
  211. #define PJMEDIA_HAS_PASSTHROUGH_CODEC_G729 1
  212. #define PJMEDIA_HAS_PASSTHROUGH_CODEC_ILBC 1
  213. #endif
  214. /*
  215. * Configuration to activate "APS-Direct" media mode on Windows,
  216. * useful for testing purposes only.
  217. */
  218. #ifdef PJ_CONFIG_WIN32_WMME_DIRECT
  219. /* MUST use switchboard rather than the conference bridge */
  220. #define PJMEDIA_CONF_USE_SWITCH_BOARD 1
  221. /* Only WMME supports the "direct" feature */
  222. #define PJMEDIA_AUDIO_DEV_HAS_PORTAUDIO 0
  223. #define PJMEDIA_AUDIO_DEV_HAS_WMME 1
  224. /* Enable passthrough codec framework */
  225. #define PJMEDIA_HAS_PASSTHROUGH_CODECS 1
  226. /* Only PCMA and PCMU are supported by WMME-direct */
  227. #define PJMEDIA_HAS_PASSTHROUGH_CODEC_PCMU 1
  228. #define PJMEDIA_HAS_PASSTHROUGH_CODEC_PCMA 1
  229. #define PJMEDIA_HAS_PASSTHROUGH_CODEC_AMR 0
  230. #define PJMEDIA_HAS_PASSTHROUGH_CODEC_G729 0
  231. #define PJMEDIA_HAS_PASSTHROUGH_CODEC_ILBC 0
  232. #endif
  233. /*
  234. * iPhone sample settings.
  235. */
  236. #if PJ_CONFIG_IPHONE
  237. /*
  238. * PJLIB settings.
  239. */
  240. /* Both armv6 and armv7 has FP hardware support.
  241. * See https://github.com/pjsip/pjproject/issues/1589 for more info
  242. */
  243. #define PJ_HAS_FLOATING_POINT 1
  244. /*
  245. * PJMEDIA settings
  246. */
  247. /* We have our own native CoreAudio backend */
  248. #define PJMEDIA_AUDIO_DEV_HAS_PORTAUDIO 0
  249. #define PJMEDIA_AUDIO_DEV_HAS_WMME 0
  250. #define PJMEDIA_AUDIO_DEV_HAS_COREAUDIO 1
  251. /* The CoreAudio backend has built-in echo canceller! */
  252. #define PJMEDIA_HAS_SPEEX_AEC 0
  253. /* Disable some codecs */
  254. #define PJMEDIA_HAS_L16_CODEC 0
  255. //#define PJMEDIA_HAS_G722_CODEC 0
  256. /* Use the built-in CoreAudio's iLBC codec (yay!) */
  257. #define PJMEDIA_HAS_ILBC_CODEC 1
  258. #define PJMEDIA_ILBC_CODEC_USE_COREAUDIO 1
  259. /* Fine tune Speex's default settings for best performance/quality */
  260. #define PJMEDIA_CODEC_SPEEX_DEFAULT_QUALITY 5
  261. /*
  262. * PJSIP settings.
  263. */
  264. /* Increase allowable packet size, just in case */
  265. //#define PJSIP_MAX_PKT_LEN 2000
  266. /*
  267. * PJSUA settings.
  268. */
  269. /* Default codec quality, previously was set to 5, however it is now
  270. * set to 4 to make sure pjsua instantiates resampler with small filter.
  271. */
  272. #define PJSUA_DEFAULT_CODEC_QUALITY 4
  273. /* Set maximum number of dialog/transaction/calls to minimum */
  274. #define PJSIP_MAX_TSX_COUNT 31
  275. #define PJSIP_MAX_DIALOG_COUNT 31
  276. #define PJSUA_MAX_CALLS 4
  277. /* Other pjsua settings */
  278. #define PJSUA_MAX_ACC 4
  279. #define PJSUA_MAX_PLAYERS 4
  280. #define PJSUA_MAX_RECORDERS 4
  281. #define PJSUA_MAX_CONF_PORTS (PJSUA_MAX_CALLS+2*PJSUA_MAX_PLAYERS)
  282. #define PJSUA_MAX_BUDDIES 32
  283. #endif
  284. /*
  285. * Android sample settings.
  286. */
  287. #if PJ_CONFIG_ANDROID
  288. /*
  289. * PJLIB settings.
  290. */
  291. /* Disable floating point support */
  292. #undef PJ_HAS_FLOATING_POINT
  293. #define PJ_HAS_FLOATING_POINT 0
  294. /*
  295. * PJMEDIA settings
  296. */
  297. /* We have our own OpenSL ES backend */
  298. #define PJMEDIA_AUDIO_DEV_HAS_PORTAUDIO 0
  299. #define PJMEDIA_AUDIO_DEV_HAS_WMME 0
  300. #define PJMEDIA_AUDIO_DEV_HAS_OPENSL 0
  301. #define PJMEDIA_AUDIO_DEV_HAS_ANDROID_JNI 1
  302. /* Disable some codecs */
  303. #define PJMEDIA_HAS_L16_CODEC 0
  304. //#define PJMEDIA_HAS_G722_CODEC 0
  305. /* Fine tune Speex's default settings for best performance/quality */
  306. #define PJMEDIA_CODEC_SPEEX_DEFAULT_QUALITY 5
  307. /*
  308. * PJSIP settings.
  309. */
  310. /* Increase allowable packet size, just in case */
  311. //#define PJSIP_MAX_PKT_LEN 2000
  312. /*
  313. * PJSUA settings.
  314. */
  315. /* Default codec quality, previously was set to 5, however it is now
  316. * set to 4 to make sure pjsua instantiates resampler with small filter.
  317. */
  318. #define PJSUA_DEFAULT_CODEC_QUALITY 4
  319. /* Set maximum number of dialog/transaction/calls to minimum */
  320. #define PJSIP_MAX_TSX_COUNT 31
  321. #define PJSIP_MAX_DIALOG_COUNT 31
  322. #define PJSUA_MAX_CALLS 4
  323. /* Separate worker thread for timer and ioqueue */
  324. // #define PJSUA_SEPARATE_WORKER_FOR_TIMER 1
  325. /* Other pjsua settings */
  326. #define PJSUA_MAX_ACC 4
  327. #define PJSUA_MAX_PLAYERS 4
  328. #define PJSUA_MAX_RECORDERS 4
  329. #define PJSUA_MAX_CONF_PORTS (PJSUA_MAX_CALLS+2*PJSUA_MAX_PLAYERS)
  330. #define PJSUA_MAX_BUDDIES 32
  331. #endif
  332. /*
  333. * BB10
  334. */
  335. #if defined(PJ_CONFIG_BB10) && PJ_CONFIG_BB10
  336. /* Quality 3 - 4 to use resampling small filter */
  337. #define PJSUA_DEFAULT_CODEC_QUALITY 4
  338. #define PJMEDIA_HAS_LEGACY_SOUND_API 0
  339. #undef PJMEDIA_HAS_SPEEX_AEC
  340. #define PJMEDIA_HAS_SPEEX_AEC 0
  341. #undef PJMEDIA_AUDIO_DEV_HAS_PORTAUDIO
  342. #define PJMEDIA_AUDIO_DEV_HAS_PORTAUDIO 0
  343. #undef PJMEDIA_AUDIO_DEV_HAS_ALSA
  344. #define PJMEDIA_AUDIO_DEV_HAS_ALSA 0
  345. #endif
  346. /*
  347. * Minimum size
  348. */
  349. #ifdef PJ_CONFIG_MINIMAL_SIZE
  350. # undef PJ_OS_HAS_CHECK_STACK
  351. # define PJ_OS_HAS_CHECK_STACK 0
  352. # define PJ_LOG_MAX_LEVEL 0
  353. # define PJ_HAS_ERROR_STRING 0
  354. # undef PJ_IOQUEUE_MAX_HANDLES
  355. /* Putting max handles to lower than 32 will make pj_fd_set_t size smaller
  356. * than native fdset_t and will trigger assertion on sock_select.c.
  357. */
  358. # define PJ_IOQUEUE_MAX_HANDLES 32
  359. # define PJ_CRC32_HAS_TABLES 0
  360. # define PJSIP_MAX_TSX_COUNT 15
  361. # define PJSIP_MAX_DIALOG_COUNT 15
  362. # define PJSIP_UDP_SO_SNDBUF_SIZE 4000
  363. # define PJSIP_UDP_SO_RCVBUF_SIZE 4000
  364. # define PJMEDIA_HAS_ALAW_ULAW_TABLE 0
  365. #elif defined(PJ_CONFIG_MAXIMUM_SPEED)
  366. # define PJ_SCANNER_USE_BITWISE 0
  367. # undef PJ_OS_HAS_CHECK_STACK
  368. # define PJ_OS_HAS_CHECK_STACK 0
  369. # define PJ_LOG_MAX_LEVEL 3
  370. # define PJ_IOQUEUE_MAX_HANDLES 5000
  371. # define PJSIP_MAX_TSX_COUNT ((640*1024)-1)
  372. # define PJSIP_MAX_DIALOG_COUNT ((640*1024)-1)
  373. # define PJSIP_UDP_SO_SNDBUF_SIZE (24*1024*1024)
  374. # define PJSIP_UDP_SO_RCVBUF_SIZE (24*1024*1024)
  375. # define PJ_DEBUG 0
  376. # define PJSIP_SAFE_MODULE 0
  377. # define PJ_HAS_STRICMP_ALNUM 0
  378. # define PJSIP_UNESCAPE_IN_PLACE 1
  379. # if defined(PJ_WIN32) || defined(PJ_WIN64)
  380. # define PJSIP_MAX_NET_EVENTS 10
  381. # endif
  382. # define PJSUA_MAX_CALLS 512
  383. #endif