Skip to content
Browse files

Import pjproject-2.1

  • Loading branch information...
1 parent f3ab456 commit 483805f79570115ab95c69698792d238c1719b1b @qwell qwell committed Mar 11, 2013
Showing with 8,979 additions and 2,590 deletions.
  1. +279 −21 aconfigure
  2. +112 −18 aconfigure.ac
  3. +194 −191 build.symbian/pjlibU.def
  4. +1 −1 configure-bb10
  5. +1 −1 configure-iphone
  6. +1 −1 pjlib-util/build/Makefile
  7. +76 −1 pjlib-util/include/pjlib-util/stun_simple.h
  8. +98 −52 pjlib-util/src/pjlib-util/resolver.c
  9. +1 −2 pjlib-util/src/pjlib-util/scanner.c
  10. +35 −4 pjlib-util/src/pjlib-util/stun_simple_client.c
  11. +1 −1 pjlib/build/Makefile
  12. +7 −2 pjlib/include/pj/activesock.h
  13. +26 −1 pjlib/include/pj/addr_resolv.h
  14. +19 −3 pjlib/include/pj/config.h
  15. +4 −2 pjlib/include/pj/config_site_sample.h
  16. +6 −1 pjlib/include/pj/errno.h
  17. +20 −1 pjlib/include/pj/guid.h
  18. +37 −3 pjlib/include/pj/hash.h
  19. +14 −1 pjlib/include/pj/ioqueue.h
  20. +253 −1 pjlib/include/pj/lock.h
  21. +2 −2 pjlib/include/pj/pool.h
  22. +2 −2 pjlib/include/pj/pool_i.h
  23. +19 −1 pjlib/include/pj/sock.h
  24. +66 −2 pjlib/include/pj/timer.h
  25. +4 −1 pjlib/include/pj/types.h
  26. +54 −4 pjlib/src/pj/activesock.c
  27. +3 −2 pjlib/src/pj/errno.c
  28. +22 −1 pjlib/src/pj/guid.c
  29. +62 −33 pjlib/src/pj/hash.c
  30. +68 −48 pjlib/src/pj/ioqueue_common_abs.c
  31. +2 −1 pjlib/src/pj/ioqueue_common_abs.h
  32. +10 −10 pjlib/src/pj/ioqueue_epoll.c
  33. +71 −12 pjlib/src/pj/ioqueue_select.c
  34. +14 −1 pjlib/src/pj/ioqueue_symbian.cpp
  35. +14 −6 pjlib/src/pj/ip_helper_generic.c
  36. +518 −1 pjlib/src/pj/lock.c
  37. +102 −21 pjlib/src/pj/os_core_unix.c
  38. +4 −1 pjlib/src/pj/os_info.c
  39. +3 −3 pjlib/src/pj/pool.c
  40. +7 −3 pjlib/src/pj/pool_caching.c
  41. +4 −3 pjlib/src/pj/sock_bsd.c
  42. +88 −23 pjlib/src/pj/sock_common.c
  43. +296 −140 pjlib/src/pj/ssl_sock_ossl.c
  44. +107 −12 pjlib/src/pj/timer.c
  45. +30 −1 pjlib/src/pj/timer_symbian.cpp
  46. +2 −1 pjlib/src/pjlib-test/activesock.c
  47. +7 −7 pjlib/src/pjlib-test/ioq_tcp.c
  48. +4 −3 pjlib/src/pjlib-test/ioq_udp.c
  49. +24 −1 pjlib/src/pjlib-test/ssl_sock.c
  50. +4 −2 pjmedia/build/Makefile
  51. +10 −1 pjmedia/build/os-auto.mak.in
  52. +10 −2 pjmedia/build/pjmedia_codec.vcproj
  53. +7 −1 pjmedia/include/pjmedia-audiodev/audiodev.h
  54. +3 −2 pjmedia/include/pjmedia-codec.h
  55. +45 −3 pjmedia/include/pjmedia-codec/config.h
  56. +10 −1 pjmedia/include/pjmedia-codec/config_auto.h.in
  57. +146 −0 pjmedia/include/pjmedia-codec/opencore_amr.h
  58. +0 −89 pjmedia/include/pjmedia-codec/opencore_amrnb.h
  59. +133 −0 pjmedia/include/pjmedia-codec/silk.h
  60. +17 −13 pjmedia/include/pjmedia-codec/types.h
  61. +12 −1 pjmedia/include/pjmedia-videodev/config.h
  62. +14 −1 pjmedia/include/pjmedia/codec.h
  63. +32 −2 pjmedia/include/pjmedia/config.h
  64. +18 −1 pjmedia/include/pjmedia/sdp.h
  65. +25 −2 pjmedia/include/pjmedia/transport.h
  66. +7 −1 pjmedia/include/pjmedia/transport_ice.h
  67. +2 −2 pjmedia/src/pjmedia-audiodev/alsa_dev.c
  68. +269 −95 pjmedia/src/pjmedia-audiodev/bb10_dev.c
  69. +34 −24 pjmedia/src/pjmedia-audiodev/symb_aps_dev.cpp
  70. +37 −25 pjmedia/src/pjmedia-audiodev/symb_vas_dev.cpp
  71. +11 −4 pjmedia/src/pjmedia-codec/audio_codecs.c
  72. +11 −6 pjmedia/src/pjmedia-codec/ffmpeg_vid_codecs.c
  73. +301 −101 pjmedia/src/pjmedia-codec/{opencore_amrnb.c → opencore_amr.c}
  74. +953 −0 pjmedia/src/pjmedia-codec/silk.c
  75. +11 −6 pjmedia/src/pjmedia-videodev/dshow_dev.c
  76. +4 −2 pjmedia/src/pjmedia-videodev/sdl_dev.c
  77. +4 −1 pjmedia/src/pjmedia-videodev/v4l2_dev.c
  78. +37 −15 pjmedia/src/pjmedia/codec.c
  79. +3 −3 pjmedia/src/pjmedia/conference.c
  80. +3 −1 pjmedia/src/pjmedia/converter.c
  81. +7 −3 pjmedia/src/pjmedia/endpoint.c
  82. +4 −3 pjmedia/src/pjmedia/g711.c
  83. +7 −2 pjmedia/src/pjmedia/jbuf.c
  84. +3 −2 pjmedia/src/pjmedia/rtcp.c
  85. +1 −3 pjmedia/src/pjmedia/rtp.c
  86. +12 −2 pjmedia/src/pjmedia/sdp.c
  87. +2 −2 pjmedia/src/pjmedia/sdp_neg.c
  88. +86 −18 pjmedia/src/pjmedia/stream.c
  89. +6 −2 pjmedia/src/pjmedia/transport_ice.c
  90. +50 −19 pjmedia/src/pjmedia/transport_srtp.c
  91. +4 −4 pjmedia/src/pjmedia/transport_udp.c
  92. +3 −3 pjmedia/src/pjmedia/types.c
  93. +196 −94 pjmedia/src/pjmedia/vid_codec_util.c
  94. +7 −6 pjmedia/src/pjmedia/vid_port.c
  95. +13 −8 pjmedia/src/pjmedia/vid_stream.c
  96. +3 −2 pjmedia/src/pjmedia/vid_stream_info.c
  97. +43 −2 pjmedia/src/test/mips_test.c
  98. +3 −1 pjnath/build/Makefile
  99. +58 −0 pjnath/build/pjnath_test.vcproj
  100. +12 −1 pjnath/include/pjnath/config.h
  101. +6 −2 pjnath/include/pjnath/ice_session.h
  102. +9 −1 pjnath/include/pjnath/stun_config.h
  103. +9 −18 pjnath/include/pjnath/stun_session.h
  104. +24 −3 pjnath/include/pjnath/stun_sock.h
  105. +10 −5 pjnath/include/pjnath/stun_transaction.h
  106. +6 −2 pjnath/include/pjnath/turn_session.h
  107. +33 −1 pjnath/include/pjnath/turn_sock.h
  108. +367 −0 pjnath/src/pjnath-test/concur_test.c
  109. +205 −36 pjnath/src/pjnath-test/ice_test.c
  110. +3 −3 pjnath/src/pjnath-test/sess_auth.c
  111. +10 −4 pjnath/src/pjnath-test/stun_sock_test.c
  112. +33 −2 pjnath/src/pjnath-test/test.c
  113. +5 −1 pjnath/src/pjnath-test/test.h
  114. +230 −179 pjnath/src/pjnath/ice_session.c
  115. +98 −113 pjnath/src/pjnath/ice_strans.c
  116. +2 −2 pjnath/src/pjnath/nat_detect.c
  117. +214 −163 pjnath/src/pjnath/stun_session.c
  118. +160 −57 pjnath/src/pjnath/stun_sock.c
  119. +91 −66 pjnath/src/pjnath/stun_transaction.c
  120. +94 −90 pjnath/src/pjnath/turn_session.c
  121. +118 −55 pjnath/src/pjnath/turn_sock.c
  122. +2 −2 pjnath/src/pjturn-srv/allocation.c
  123. +3 −2 pjnath/src/pjturn-srv/server.c
  124. +177 −182 pjsip-apps/src/pjsua/pjsua_app.c
  125. +4 −3 pjsip-apps/src/python/setup.py
  126. +2 −1 pjsip-apps/src/samples/icedemo.c
  127. +7 −7 pjsip-apps/src/samples/pjsip-perf.c
  128. +5 −3 pjsip-apps/src/samples/proxy.h
  129. +0 −1 pjsip-apps/src/symbian_ua_gui/src/symbian_ua.cpp
  130. +1 −1 pjsip/build/Makefile
  131. +77 −2 pjsip/include/pjsip/sip_auth.h
  132. +46 −4 pjsip/include/pjsip/sip_config.h
  133. +72 −1 pjsip/include/pjsip/sip_endpoint.h
  134. +109 −1 pjsip/include/pjsip/sip_transport.h
  135. +40 −2 pjsip/include/pjsip/sip_transport_tls.h
  136. +5 −2 pjsip/include/pjsip/sip_types.h
  137. +5 −5 pjsip/include/pjsip/sip_uri.h
  138. +8 −1 pjsip/include/pjsip/sip_util.h
  139. +333 −13 pjsip/include/pjsua-lib/pjsua.h
  140. +27 −4 pjsip/include/pjsua-lib/pjsua_internal.h
  141. +6 −3 pjsip/src/pjsip-simple/publishc.c
  142. +3 −3 pjsip/src/pjsip-ua/sip_100rel.c
  143. +83 −17 pjsip/src/pjsip-ua/sip_inv.c
  144. +7 −4 pjsip/src/pjsip-ua/sip_reg.c
  145. +14 −5 pjsip/src/pjsip-ua/sip_replaces.c
  146. +28 −1 pjsip/src/pjsip-ua/sip_timer.c
  147. +8 −9 pjsip/src/pjsip/sip_auth_client.c
  148. +41 −6 pjsip/src/pjsip/sip_auth_server.c
  149. +3 −1 pjsip/src/pjsip/sip_config.c
  150. +12 −11 pjsip/src/pjsip/sip_dialog.c
  151. +111 −49 pjsip/src/pjsip/sip_endpoint.c
  152. +9 −2 pjsip/src/pjsip/sip_parser.c
  153. +4 −2 pjsip/src/pjsip/sip_tel_uri.c
  154. +22 −21 pjsip/src/pjsip/sip_transaction.c
  155. +216 −27 pjsip/src/pjsip/sip_transport.c
  156. +110 −64 pjsip/src/pjsip/sip_transport_tcp.c
  157. +130 −61 pjsip/src/pjsip/sip_transport_tls.c
  158. +28 −22 pjsip/src/pjsip/sip_ua_layer.c
  159. +5 −2 pjsip/src/pjsip/sip_uri.c
  160. +2 −2 pjsip/src/pjsip/sip_util_proxy.c
Sorry, we could not display the entire diff because it was too big.
View
300 aconfigure
@@ -623,8 +623,16 @@ LIBOBJS
ac_main_obj
ac_host
ac_linux_poll
+silk_present
+silk_h_present
+ac_no_silk
+opencore_amrwb_dec_present
+opencore_amrwb_dec_h_present
+opencore_amrwb_enc_present
+opencore_amrwb_enc_h_present
opencore_amrnb_present
opencore_amrnb_h_present
+ac_no_opencore_amrwb
ac_no_opencore_amrnb
libcrypto_present
libssl_present
@@ -778,7 +786,11 @@ with_ipp_arch
with_ssl
enable_ssl
with_opencore_amrnb
-enable_opencore_amrnb
+with_opencore_amr
+with_opencore_amrwbenc
+enable_opencore_amr
+with_silk
+enable_silk
'
ac_precious_vars='build_alias
host_alias
@@ -1435,10 +1447,12 @@ Optional Features:
--with-ipp-samples options
--disable-ssl Exclude SSL support the build (default: autodetect)
- --disable-opencore-amrnb
- Exclude OpenCORE AMR-NB support from the build
+ --disable-opencore-amr Exclude OpenCORE AMR support from the build
(default: autodetect)
+ --disable-silk Exclude SILK support from the build (default:
+ autodetect)
+
Optional Packages:
--with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
@@ -1466,7 +1480,12 @@ Optional Packages:
"em64t. Default is blank for IA32"
--with-ssl=DIR Specify alternate libssl prefix
--with-opencore-amrnb=DIR
- Specify alternate libopencore-amrnb prefix
+ This option is obsolete and replaced by
+ --with-opencore-amr=DIR
+ --with-opencore-amr=DIR Specify alternate libopencore-amr prefix
+ --with-opencore-amrwbenc=DIR
+ Specify alternate libvo-amrwbenc prefix
+ --with-silk=DIR Specify alternate SILK prefix
Some influential environment variables:
CC C compiler command
@@ -7100,38 +7119,70 @@ fi
# Check whether --with-opencore-amrnb was given.
if test "${with_opencore_amrnb+set}" = set; then :
- withval=$with_opencore_amrnb;
+ withval=$with_opencore_amrnb; as_fn_error $? "This option is obsolete and replaced by --with-opencore-amr=DIR" "$LINENO" 5
+fi
+
+
+
+# Check whether --with-opencore-amr was given.
+if test "${with_opencore_amr+set}" = set; then :
+ withval=$with_opencore_amr;
else
- with_opencore_amrnb=no
+ with_opencore_amr=no
fi
-if test "x$ac_cross_compile" != "x" -a "x$with_opencore_amrnb" = "xno"; then
- enable_opencore_amrnb=no
+if test "x$ac_cross_compile" != "x" -a "x$with_opencore_amr" = "xno"; then
+ enable_opencore_amr=no
+fi
+
+
+# Check whether --with-opencore-amrwbenc was given.
+if test "${with_opencore_amrwbenc+set}" = set; then :
+ withval=$with_opencore_amrwbenc;
+else
+ with_opencore_amrwbenc=no
+
fi
-# Check whether --enable-opencore_amrnb was given.
-if test "${enable_opencore_amrnb+set}" = set; then :
- enableval=$enable_opencore_amrnb;
- if test "$enable_opencore_amrnb" = "no"; then
+if test "x$ac_cross_compile" != "x" -a "x$with_opencore_amrwbenc" = "xno"; then
+ enable_opencore_amrwbenc=no
+fi
+
+
+
+
+# Check whether --enable-opencore_amr was given.
+if test "${enable_opencore_amr+set}" = set; then :
+ enableval=$enable_opencore_amr;
+ if test "$enable_opencore_amr" = "no"; then
ac_no_opencore_amrnb=1
+ ac_no_opencore_amrwb=1
$as_echo "#define PJMEDIA_HAS_OPENCORE_AMRNB_CODEC 0" >>confdefs.h
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: Checking if OpenCORE AMR-NB support is disabled... yes" >&5
-$as_echo "Checking if OpenCORE AMR-NB support is disabled... yes" >&6; }
+ $as_echo "#define PJMEDIA_HAS_OPENCORE_AMRWB_CODEC 0" >>confdefs.h
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: Checking if OpenCORE AMR support is disabled... yes" >&5
+$as_echo "Checking if OpenCORE AMR support is disabled... yes" >&6; }
fi
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: checking for OpenCORE AMR-NB installations.." >&5
-$as_echo "checking for OpenCORE AMR-NB installations.." >&6; }
- if test "x$with_opencore_amrnb" != "xno" -a "x$with_opencore_amrnb" != "x"; then
- CFLAGS="$CFLAGS -I$with_opencore_amrnb/include"
- LDFLAGS="$LDFLAGS -L$with_opencore_amrnb/lib"
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: Using OpenCORE AMR-NB prefix... $with_opencore_amrnb" >&5
-$as_echo "Using OpenCORE AMR-NB prefix... $with_opencore_amrnb" >&6; }
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: checking for OpenCORE AMR installations.." >&5
+$as_echo "checking for OpenCORE AMR installations.." >&6; }
+ if test "x$with_opencore_amr" != "xno" -a "x$with_opencore_amr" != "x"; then
+ CFLAGS="$CFLAGS -I$with_opencore_amr/include"
+ LDFLAGS="$LDFLAGS -L$with_opencore_amr/lib"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: Using OpenCORE AMR prefix... $with_opencore_amr" >&5
+$as_echo "Using OpenCORE AMR prefix... $with_opencore_amr" >&6; }
+ fi
+ if test "x$with_opencore_amrwbenc" != "xno" -a "x$with_opencore_amrwbenc" != "x"; then
+ CFLAGS="$CFLAGS -I$with_opencore_amrwbenc/include"
+ LDFLAGS="$LDFLAGS -L$with_opencore_amrwbenc/lib"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: Using OpenCORE AMRWB-enc prefix... $with_opencore_amrwbenc" >&5
+$as_echo "Using OpenCORE AMRWB-enc prefix... $with_opencore_amrwbenc" >&6; }
fi
@@ -7192,9 +7243,216 @@ $as_echo "OpenCORE AMR-NB library found, AMR-NB support enabled" >&6; }
fi
+
+
+
+ ac_fn_c_check_header_mongrel "$LINENO" "vo-amrwbenc/enc_if.h" "ac_cv_header_vo_amrwbenc_enc_if_h" "$ac_includes_default"
+if test "x$ac_cv_header_vo_amrwbenc_enc_if_h" = xyes; then :
+ opencore_amrwb_enc_h_present=1
fi
+ ac_fn_c_check_header_mongrel "$LINENO" "opencore-amrwb/dec_if.h" "ac_cv_header_opencore_amrwb_dec_if_h" "$ac_includes_default"
+if test "x$ac_cv_header_opencore_amrwb_dec_if_h" = xyes; then :
+ opencore_amrwb_dec_h_present=1
+fi
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for D_IF_init in -lopencore-amrwb" >&5
+$as_echo_n "checking for D_IF_init in -lopencore-amrwb... " >&6; }
+if ${ac_cv_lib_opencore_amrwb_D_IF_init+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lopencore-amrwb $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char D_IF_init ();
+int
+main ()
+{
+return D_IF_init ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_opencore_amrwb_D_IF_init=yes
+else
+ ac_cv_lib_opencore_amrwb_D_IF_init=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_opencore_amrwb_D_IF_init" >&5
+$as_echo "$ac_cv_lib_opencore_amrwb_D_IF_init" >&6; }
+if test "x$ac_cv_lib_opencore_amrwb_D_IF_init" = xyes; then :
+ opencore_amrwb_dec_present=1 && LIBS="$LIBS -lopencore-amrwb"
+fi
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for E_IF_init in -lvo-amrwbenc" >&5
+$as_echo_n "checking for E_IF_init in -lvo-amrwbenc... " >&6; }
+if ${ac_cv_lib_vo_amrwbenc_E_IF_init+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lvo-amrwbenc $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char E_IF_init ();
+int
+main ()
+{
+return E_IF_init ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_vo_amrwbenc_E_IF_init=yes
+else
+ ac_cv_lib_vo_amrwbenc_E_IF_init=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_vo_amrwbenc_E_IF_init" >&5
+$as_echo "$ac_cv_lib_vo_amrwbenc_E_IF_init" >&6; }
+if test "x$ac_cv_lib_vo_amrwbenc_E_IF_init" = xyes; then :
+ opencore_amrwb_enc_present=1 && LIBS="$LIBS -lvo-amrwbenc"
+fi
+
+ if test "x$opencore_amrwb_enc_h_present" = "x1" -a "x$opencore_amrwb_dec_h_present" = "x1" -a "x$opencore_amrwb_enc_present" = "x1" -a "x$opencore_amrwb_dec_present" = "x1"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: OpenCORE AMR-WB library found, AMR-WB support enabled" >&5
+$as_echo "OpenCORE AMR-WB library found, AMR-WB support enabled" >&6; }
+ $as_echo "#define PJMEDIA_HAS_OPENCORE_AMRWB_CODEC 1" >>confdefs.h
+
+ else
+ ac_no_opencore_amrwb=1
+ $as_echo "#define PJMEDIA_HAS_OPENCORE_AMRWB_CODEC 0" >>confdefs.h
+
+ fi
+
+
+fi
+
+
+
+# Check whether --with-silk was given.
+if test "${with_silk+set}" = set; then :
+ withval=$with_silk;
+else
+ with_silk=no
+
+fi
+
+
+if test "x$ac_cross_compile" != "x" -a "x$with_silk" = "xno"; then
+ enable_silk=no
+fi
+
+
+# Check whether --enable-silk was given.
+if test "${enable_silk+set}" = set; then :
+ enableval=$enable_silk;
+ if test "$enable_silk" = "no"; then
+ ac_no_silk=1
+ $as_echo "#define PJMEDIA_HAS_SILK_CODEC 0" >>confdefs.h
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: Checking if SILK support is disabled... yes" >&5
+$as_echo "Checking if SILK support is disabled... yes" >&6; }
+ fi
+
+else
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: checking for SILK installations.." >&5
+$as_echo "checking for SILK installations.." >&6; }
+ if test "x$with_silk" != "xno" -a "x$with_silk" != "x"; then
+ CFLAGS="$CFLAGS -I$with_silk/interface"
+ CPPFLAGS="$CPPFLAGS -I$with_silk/interface"
+ LDFLAGS="$LDFLAGS -L$with_silk"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: Using SILK prefix... $with_silk" >&5
+$as_echo "Using SILK prefix... $with_silk" >&6; }
+ fi
+
+
+ ac_fn_c_check_header_mongrel "$LINENO" "SKP_Silk_SDK_API.h" "ac_cv_header_SKP_Silk_SDK_API_h" "$ac_includes_default"
+if test "x$ac_cv_header_SKP_Silk_SDK_API_h" = xyes; then :
+ silk_h_present=1
+fi
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for SKP_Silk_SDK_get_version in -lSKP_SILK_SDK" >&5
+$as_echo_n "checking for SKP_Silk_SDK_get_version in -lSKP_SILK_SDK... " >&6; }
+if ${ac_cv_lib_SKP_SILK_SDK_SKP_Silk_SDK_get_version+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lSKP_SILK_SDK $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char SKP_Silk_SDK_get_version ();
+int
+main ()
+{
+return SKP_Silk_SDK_get_version ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_SKP_SILK_SDK_SKP_Silk_SDK_get_version=yes
+else
+ ac_cv_lib_SKP_SILK_SDK_SKP_Silk_SDK_get_version=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_SKP_SILK_SDK_SKP_Silk_SDK_get_version" >&5
+$as_echo "$ac_cv_lib_SKP_SILK_SDK_SKP_Silk_SDK_get_version" >&6; }
+if test "x$ac_cv_lib_SKP_SILK_SDK_SKP_Silk_SDK_get_version" = xyes; then :
+ silk_present=1 && LIBS="$LIBS -lSKP_SILK_SDK"
+fi
+
+ if test "x$silk_h_present" = "x1" -a "x$silk_present" = "x1"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: SILK library found, SILK support enabled" >&5
+$as_echo "SILK library found, SILK support enabled" >&6; }
+ $as_echo "#define PJMEDIA_HAS_SILK_CODEC 1" >>confdefs.h
+
+ else
+ ac_no_silk=1
+ $as_echo "#define PJMEDIA_HAS_SILK_CODEC 0" >>confdefs.h
+
+ fi
+
+fi
+
+
+
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if select() needs correct nfds" >&5
View
130 aconfigure.ac
@@ -1320,39 +1320,69 @@ AC_ARG_ENABLE(ssl,
fi
])
-dnl # opencore-amrnb alt prefix
+dnl # Obsolete option --with-opencore-amrnb
AC_ARG_WITH(opencore-amrnb,
AC_HELP_STRING([--with-opencore-amrnb=DIR],
- [Specify alternate libopencore-amrnb prefix]),
+ [This option is obsolete and replaced by --with-opencore-amr=DIR]),
+ [AC_MSG_ERROR(This option is obsolete and replaced by --with-opencore-amr=DIR)],
+ []
+ )
+
+dnl # opencore-amr alt prefix
+AC_ARG_WITH(opencore-amr,
+ AC_HELP_STRING([--with-opencore-amr=DIR],
+ [Specify alternate libopencore-amr prefix]),
+ [],
+ [with_opencore_amr=no]
+ )
+
+dnl # Do not use default opencore-amr installation if we are cross-compiling
+if test "x$ac_cross_compile" != "x" -a "x$with_opencore_amr" = "xno"; then
+ enable_opencore_amr=no
+fi
+
+dnl # vo-amrwbenc alt prefix
+AC_ARG_WITH(opencore-amrwbenc,
+ AC_HELP_STRING([--with-opencore-amrwbenc=DIR],
+ [Specify alternate libvo-amrwbenc prefix]),
[],
- [with_opencore_amrnb=no]
+ [with_opencore_amrwbenc=no]
)
-dnl # Do not use default opencore-amrnb installation if we are cross-compiling
-if test "x$ac_cross_compile" != "x" -a "x$with_opencore_amrnb" = "xno"; then
- enable_opencore_amrnb=no
+dnl # Do not use default vo-amrwbenc installation if we are cross-compiling
+if test "x$ac_cross_compile" != "x" -a "x$with_opencore_amrwbenc" = "xno"; then
+ enable_opencore_amrwbenc=no
fi
-dnl # Include opencore-amrnb support
+
+dnl # Include opencore-amr support
AC_SUBST(ac_no_opencore_amrnb)
-AC_ARG_ENABLE(opencore_amrnb,
- AC_HELP_STRING([--disable-opencore-amrnb],
- [Exclude OpenCORE AMR-NB support from the build (default: autodetect)])
+AC_SUBST(ac_no_opencore_amrwb)
+AC_ARG_ENABLE(opencore_amr,
+ AC_HELP_STRING([--disable-opencore-amr],
+ [Exclude OpenCORE AMR support from the build (default: autodetect)])
,
[
- if test "$enable_opencore_amrnb" = "no"; then
+ if test "$enable_opencore_amr" = "no"; then
[ac_no_opencore_amrnb=1]
+ [ac_no_opencore_amrwb=1]
AC_DEFINE(PJMEDIA_HAS_OPENCORE_AMRNB_CODEC,0)
- AC_MSG_RESULT([Checking if OpenCORE AMR-NB support is disabled... yes])
+ AC_DEFINE(PJMEDIA_HAS_OPENCORE_AMRWB_CODEC,0)
+ AC_MSG_RESULT([Checking if OpenCORE AMR support is disabled... yes])
fi
],
[
- AC_MSG_RESULT([checking for OpenCORE AMR-NB installations..])
- if test "x$with_opencore_amrnb" != "xno" -a "x$with_opencore_amrnb" != "x"; then
- CFLAGS="$CFLAGS -I$with_opencore_amrnb/include"
- LDFLAGS="$LDFLAGS -L$with_opencore_amrnb/lib"
- AC_MSG_RESULT([Using OpenCORE AMR-NB prefix... $with_opencore_amrnb])
- fi
+ AC_MSG_RESULT([checking for OpenCORE AMR installations..])
+ if test "x$with_opencore_amr" != "xno" -a "x$with_opencore_amr" != "x"; then
+ CFLAGS="$CFLAGS -I$with_opencore_amr/include"
+ LDFLAGS="$LDFLAGS -L$with_opencore_amr/lib"
+ AC_MSG_RESULT([Using OpenCORE AMR prefix... $with_opencore_amr])
+ fi
+ if test "x$with_opencore_amrwbenc" != "xno" -a "x$with_opencore_amrwbenc" != "x"; then
+ CFLAGS="$CFLAGS -I$with_opencore_amrwbenc/include"
+ LDFLAGS="$LDFLAGS -L$with_opencore_amrwbenc/lib"
+ AC_MSG_RESULT([Using OpenCORE AMRWB-enc prefix... $with_opencore_amrwbenc])
+ fi
AC_SUBST(opencore_amrnb_h_present)
AC_SUBST(opencore_amrnb_present)
AC_CHECK_HEADER(opencore-amrnb/interf_enc.h,[opencore_amrnb_h_present=1])
@@ -1364,8 +1394,72 @@ AC_ARG_ENABLE(opencore_amrnb,
[ac_no_opencore_amrnb=1]
AC_DEFINE(PJMEDIA_HAS_OPENCORE_AMRNB_CODEC,0)
fi
+ AC_SUBST(opencore_amrwb_enc_h_present)
+ AC_SUBST(opencore_amrwb_enc_present)
+ AC_SUBST(opencore_amrwb_dec_h_present)
+ AC_SUBST(opencore_amrwb_dec_present)
+ AC_CHECK_HEADER(vo-amrwbenc/enc_if.h,[opencore_amrwb_enc_h_present=1])
+ AC_CHECK_HEADER(opencore-amrwb/dec_if.h,[opencore_amrwb_dec_h_present=1])
+ AC_CHECK_LIB(opencore-amrwb,D_IF_init,[opencore_amrwb_dec_present=1 && LIBS="$LIBS -lopencore-amrwb"])
+ AC_CHECK_LIB(vo-amrwbenc,E_IF_init,[opencore_amrwb_enc_present=1 && LIBS="$LIBS -lvo-amrwbenc"])
+ if test "x$opencore_amrwb_enc_h_present" = "x1" -a "x$opencore_amrwb_dec_h_present" = "x1" -a "x$opencore_amrwb_enc_present" = "x1" -a "x$opencore_amrwb_dec_present" = "x1"; then
+ AC_MSG_RESULT([OpenCORE AMR-WB library found, AMR-WB support enabled])
+ AC_DEFINE(PJMEDIA_HAS_OPENCORE_AMRWB_CODEC,1)
+ else
+ [ac_no_opencore_amrwb=1]
+ AC_DEFINE(PJMEDIA_HAS_OPENCORE_AMRWB_CODEC,0)
+ fi
+
+ ])
+
+dnl # SILK prefix
+AC_ARG_WITH(silk,
+ AC_HELP_STRING([--with-silk=DIR],
+ [Specify alternate SILK prefix]),
+ [],
+ [with_silk=no]
+ )
+
+dnl # Do not use default SILK installation if we are cross-compiling
+if test "x$ac_cross_compile" != "x" -a "x$with_silk" = "xno"; then
+ enable_silk=no
+fi
+
+dnl # Include SILK support
+AC_SUBST(ac_no_silk)
+AC_ARG_ENABLE(silk,
+ AC_HELP_STRING([--disable-silk],
+ [Exclude SILK support from the build (default: autodetect)])
+ ,
+ [
+ if test "$enable_silk" = "no"; then
+ [ac_no_silk=1]
+ AC_DEFINE(PJMEDIA_HAS_SILK_CODEC,0)
+ AC_MSG_RESULT([Checking if SILK support is disabled... yes])
+ fi
+ ],
+ [
+ AC_MSG_RESULT([checking for SILK installations..])
+ if test "x$with_silk" != "xno" -a "x$with_silk" != "x"; then
+ CFLAGS="$CFLAGS -I$with_silk/interface"
+ CPPFLAGS="$CPPFLAGS -I$with_silk/interface"
+ LDFLAGS="$LDFLAGS -L$with_silk"
+ AC_MSG_RESULT([Using SILK prefix... $with_silk])
+ fi
+ AC_SUBST(silk_h_present)
+ AC_SUBST(silk_present)
+ AC_CHECK_HEADER(SKP_Silk_SDK_API.h,[silk_h_present=1])
+ AC_CHECK_LIB(SKP_SILK_SDK,SKP_Silk_SDK_get_version,[silk_present=1 && LIBS="$LIBS -lSKP_SILK_SDK"])
+ if test "x$silk_h_present" = "x1" -a "x$silk_present" = "x1"; then
+ AC_MSG_RESULT([SILK library found, SILK support enabled])
+ AC_DEFINE(PJMEDIA_HAS_SILK_CODEC,1)
+ else
+ [ac_no_silk=1]
+ AC_DEFINE(PJMEDIA_HAS_SILK_CODEC,0)
+ fi
])
+
dnl ##########################################
dnl #
dnl # MANUAL CONFIG
View
385 build.symbian/pjlibU.def
@@ -130,194 +130,197 @@ EXPORTS
pj_ioqueue_recv @ 129 NONAME
pj_ioqueue_recvfrom @ 130 NONAME
pj_ioqueue_register_sock @ 131 NONAME
- pj_ioqueue_send @ 132 NONAME
- pj_ioqueue_sendto @ 133 NONAME
- pj_ioqueue_set_lock @ 134 NONAME
- pj_ioqueue_set_user_data @ 135 NONAME
- pj_ioqueue_unregister @ 136 NONAME
- pj_leave_critical_section @ 137 NONAME
- pj_list_erase @ 138 NONAME
- pj_list_find_node @ 139 NONAME
- pj_list_insert_after @ 140 NONAME
- pj_list_insert_before @ 141 NONAME
- pj_list_insert_nodes_after @ 142 NONAME
- pj_list_insert_nodes_before @ 143 NONAME
- pj_list_merge_first @ 144 NONAME
- pj_list_merge_last @ 145 NONAME
- pj_list_search @ 146 NONAME
- pj_list_size @ 147 NONAME
- pj_lock_acquire @ 148 NONAME
- pj_lock_create_null_mutex @ 149 NONAME
- pj_lock_create_recursive_mutex @ 150 NONAME
- pj_lock_create_semaphore @ 151 NONAME
- pj_lock_create_simple_mutex @ 152 NONAME
- pj_lock_destroy @ 153 NONAME
- pj_lock_release @ 154 NONAME
- pj_lock_tryacquire @ 155 NONAME
- pj_log @ 156 NONAME
- pj_log_1 @ 157 NONAME
- pj_log_2 @ 158 NONAME
- pj_log_3 @ 159 NONAME
- pj_log_4 @ 160 NONAME
- pj_log_5 @ 161 NONAME
- pj_log_get_decor @ 162 NONAME
- pj_log_get_level @ 163 NONAME
- pj_log_get_log_func @ 164 NONAME
- pj_log_set_decor @ 165 NONAME
- pj_log_set_level @ 166 NONAME
- pj_log_set_log_func @ 167 NONAME
- pj_log_write @ 168 NONAME
- pj_mutex_create @ 169 NONAME
- pj_mutex_create_recursive @ 170 NONAME
- pj_mutex_create_simple @ 171 NONAME
- pj_mutex_destroy @ 172 NONAME
- pj_mutex_lock @ 173 NONAME
- pj_mutex_trylock @ 174 NONAME
- pj_mutex_unlock @ 175 NONAME
- pj_ntohl @ 176 NONAME
- pj_ntohs @ 177 NONAME
- pj_pool_alloc @ 178 NONAME
- pj_pool_alloc_from_block @ 179 NONAME
- pj_pool_allocate_find @ 180 NONAME
- pj_pool_calloc @ 181 NONAME
- pj_pool_create @ 182 NONAME
- pj_pool_create_int @ 183 NONAME
- pj_pool_create_on_buf @ 184 NONAME
- pj_pool_destroy_int @ 185 NONAME
- pj_pool_factory_default_policy @ 186 NONAME
- pj_pool_factory_get_default_policy @ 187 NONAME
- pj_pool_get_capacity @ 188 NONAME
- pj_pool_get_used_size @ 189 NONAME
- pj_pool_getobjname @ 190 NONAME
- pj_pool_init_int @ 191 NONAME
- pj_pool_release @ 192 NONAME
- pj_pool_reset @ 193 NONAME
- pj_rand @ 194 NONAME
- pj_rbtree_erase @ 195 NONAME
- pj_rbtree_find @ 196 NONAME
- pj_rbtree_first @ 197 NONAME
- pj_rbtree_init @ 198 NONAME
- pj_rbtree_insert @ 199 NONAME
- pj_rbtree_last @ 200 NONAME
- pj_rbtree_max_height @ 201 NONAME
- pj_rbtree_min_height @ 202 NONAME
- pj_rbtree_next @ 203 NONAME
- pj_rbtree_prev @ 204 NONAME
- pj_register_strerror @ 205 NONAME
- pj_rwmutex_create @ 206 NONAME
- pj_rwmutex_destroy @ 207 NONAME
- pj_rwmutex_lock_read @ 208 NONAME
- pj_rwmutex_lock_write @ 209 NONAME
- pj_rwmutex_unlock_read @ 210 NONAME
- pj_rwmutex_unlock_write @ 211 NONAME
- pj_sem_create @ 212 NONAME
- pj_sem_destroy @ 213 NONAME
- pj_sem_post @ 214 NONAME
- pj_sem_trywait @ 215 NONAME
- pj_sem_wait @ 216 NONAME
- pj_set_netos_error @ 217 NONAME
- pj_set_os_error @ 218 NONAME
- pj_shutdown @ 219 NONAME
- pj_sock_accept @ 220 NONAME
- pj_sock_bind @ 221 NONAME
- pj_sock_bind_in @ 222 NONAME
- pj_sock_close @ 223 NONAME
- pj_sock_connect @ 224 NONAME
- pj_sock_getpeername @ 225 NONAME
- pj_sock_getsockname @ 226 NONAME
- pj_sock_getsockopt @ 227 NONAME
- pj_sock_listen @ 228 NONAME
- pj_sock_recv @ 229 NONAME
- pj_sock_recvfrom @ 230 NONAME
- pj_sock_select @ 231 NONAME
- pj_sock_send @ 232 NONAME
- pj_sock_sendto @ 233 NONAME
- pj_sock_setsockopt @ 234 NONAME
- pj_sock_shutdown @ 235 NONAME
- pj_sock_socket @ 236 NONAME
- pj_sockaddr_cmp @ 237 NONAME
- pj_sockaddr_copy_addr @ 238 NONAME
- pj_sockaddr_get_addr @ 239 NONAME
- pj_sockaddr_get_addr_len @ 240 NONAME
- pj_sockaddr_get_len @ 241 NONAME
- pj_sockaddr_get_port @ 242 NONAME
- pj_sockaddr_has_addr @ 243 NONAME
- pj_sockaddr_in_get_addr @ 244 NONAME
- pj_sockaddr_in_get_port @ 245 NONAME
- pj_sockaddr_in_init @ 246 NONAME
- pj_sockaddr_in_set_addr @ 247 NONAME
- pj_sockaddr_in_set_port @ 248 NONAME
- pj_sockaddr_in_set_str_addr @ 249 NONAME
- pj_sockaddr_init @ 250 NONAME
- pj_sockaddr_print @ 251 NONAME
- pj_sockaddr_set_port @ 252 NONAME
- pj_sockaddr_set_str_addr @ 253 NONAME
- pj_srand @ 254 NONAME
- pj_str @ 255 NONAME
- pj_strassign @ 256 NONAME
- pj_strcat @ 257 NONAME
- pj_strcat2 @ 258 NONAME
- pj_strcmp @ 259 NONAME
- pj_strcmp2 @ 260 NONAME
- pj_strcpy @ 261 NONAME
- pj_strcpy2 @ 262 NONAME
- pj_strdup @ 263 NONAME
- pj_strdup2 @ 264 NONAME
- pj_strdup2_with_null @ 265 NONAME
- pj_strdup3 @ 266 NONAME
- pj_strdup_with_null @ 267 NONAME
- pj_strerror @ 268 NONAME
- pj_stricmp @ 269 NONAME
- pj_stricmp2 @ 270 NONAME
- pj_strltrim @ 271 NONAME
- pj_strncmp @ 272 NONAME
- pj_strncmp2 @ 273 NONAME
- pj_strncpy @ 274 NONAME
- pj_strncpy_with_null @ 275 NONAME
- pj_strnicmp @ 276 NONAME
- pj_strnicmp2 @ 277 NONAME
- pj_strrtrim @ 278 NONAME
- pj_strtoul @ 279 NONAME
- pj_strtoul2 @ 280 NONAME
- pj_strtrim @ 281 NONAME
- pj_symbianos_poll @ 282 NONAME
- pj_symbianos_set_params @ 283 NONAME
- pj_thread_check_stack @ 284 NONAME
- pj_thread_create @ 285 NONAME
- pj_thread_destroy @ 286 NONAME
- pj_thread_get_name @ 287 NONAME
- pj_thread_get_os_handle @ 288 NONAME
- pj_thread_get_stack_info @ 289 NONAME
- pj_thread_get_stack_max_usage @ 290 NONAME
- pj_thread_is_registered @ 291 NONAME
- pj_thread_join @ 292 NONAME
- pj_thread_local_alloc @ 293 NONAME
- pj_thread_local_free @ 294 NONAME
- pj_thread_local_get @ 295 NONAME
- pj_thread_local_set @ 296 NONAME
- pj_thread_register @ 297 NONAME
- pj_thread_resume @ 298 NONAME
- pj_thread_sleep @ 299 NONAME
- pj_thread_this @ 300 NONAME
- pj_time_decode @ 301 NONAME
- pj_time_encode @ 302 NONAME
- pj_time_gmt_to_local @ 303 NONAME
- pj_time_local_to_gmt @ 304 NONAME
- pj_time_val_normalize @ 305 NONAME
- pj_timer_entry_init @ 306 NONAME
- pj_timer_heap_cancel @ 307 NONAME
- pj_timer_heap_count @ 308 NONAME
- pj_timer_heap_create @ 309 NONAME
- pj_timer_heap_destroy @ 310 NONAME
- pj_timer_heap_earliest_time @ 311 NONAME
- pj_timer_heap_mem_size @ 312 NONAME
- pj_timer_heap_poll @ 313 NONAME
- pj_timer_heap_schedule @ 314 NONAME
- pj_timer_heap_set_lock @ 315 NONAME
- pj_timer_heap_set_max_timed_out_per_poll @ 316 NONAME
- pj_unicode_to_ansi @ 317 NONAME
- pj_utoa @ 318 NONAME
- pj_utoa_pad @ 319 NONAME
- platform_strerror @ 320 NONAME
- snprintf @ 321 NONAME
- vsnprintf @ 322 NONAME
+ pj_ioqueue_register_sock2 @ 132 NONAME
+ pj_ioqueue_send @ 133 NONAME
+ pj_ioqueue_sendto @ 134 NONAME
+ pj_ioqueue_set_lock @ 135 NONAME
+ pj_ioqueue_set_user_data @ 136 NONAME
+ pj_ioqueue_unregister @ 137 NONAME
+ pj_leave_critical_section @ 138 NONAME
+ pj_list_erase @ 139 NONAME
+ pj_list_find_node @ 140 NONAME
+ pj_list_insert_after @ 141 NONAME
+ pj_list_insert_before @ 142 NONAME
+ pj_list_insert_nodes_after @ 143 NONAME
+ pj_list_insert_nodes_before @ 144 NONAME
+ pj_list_merge_first @ 145 NONAME
+ pj_list_merge_last @ 146 NONAME
+ pj_list_search @ 147 NONAME
+ pj_list_size @ 148 NONAME
+ pj_lock_acquire @ 149 NONAME
+ pj_lock_create_null_mutex @ 150 NONAME
+ pj_lock_create_recursive_mutex @ 151 NONAME
+ pj_lock_create_semaphore @ 152 NONAME
+ pj_lock_create_simple_mutex @ 153 NONAME
+ pj_lock_destroy @ 154 NONAME
+ pj_lock_release @ 155 NONAME
+ pj_lock_tryacquire @ 156 NONAME
+ pj_log @ 157 NONAME
+ pj_log_1 @ 158 NONAME
+ pj_log_2 @ 159 NONAME
+ pj_log_3 @ 160 NONAME
+ pj_log_4 @ 161 NONAME
+ pj_log_5 @ 162 NONAME
+ pj_log_get_decor @ 163 NONAME
+ pj_log_get_level @ 164 NONAME
+ pj_log_get_log_func @ 165 NONAME
+ pj_log_set_decor @ 166 NONAME
+ pj_log_set_level @ 167 NONAME
+ pj_log_set_log_func @ 168 NONAME
+ pj_log_write @ 169 NONAME
+ pj_mutex_create @ 170 NONAME
+ pj_mutex_create_recursive @ 171 NONAME
+ pj_mutex_create_simple @ 172 NONAME
+ pj_mutex_destroy @ 173 NONAME
+ pj_mutex_lock @ 174 NONAME
+ pj_mutex_trylock @ 175 NONAME
+ pj_mutex_unlock @ 176 NONAME
+ pj_ntohl @ 177 NONAME
+ pj_ntohs @ 178 NONAME
+ pj_pool_alloc @ 179 NONAME
+ pj_pool_alloc_from_block @ 180 NONAME
+ pj_pool_allocate_find @ 181 NONAME
+ pj_pool_calloc @ 182 NONAME
+ pj_pool_create @ 183 NONAME
+ pj_pool_create_int @ 184 NONAME
+ pj_pool_create_on_buf @ 185 NONAME
+ pj_pool_destroy_int @ 186 NONAME
+ pj_pool_factory_default_policy @ 187 NONAME
+ pj_pool_factory_get_default_policy @ 188 NONAME
+ pj_pool_get_capacity @ 189 NONAME
+ pj_pool_get_used_size @ 190 NONAME
+ pj_pool_getobjname @ 191 NONAME
+ pj_pool_init_int @ 192 NONAME
+ pj_pool_release @ 193 NONAME
+ pj_pool_reset @ 194 NONAME
+ pj_rand @ 195 NONAME
+ pj_rbtree_erase @ 196 NONAME
+ pj_rbtree_find @ 197 NONAME
+ pj_rbtree_first @ 198 NONAME
+ pj_rbtree_init @ 199 NONAME
+ pj_rbtree_insert @ 200 NONAME
+ pj_rbtree_last @ 201 NONAME
+ pj_rbtree_max_height @ 202 NONAME
+ pj_rbtree_min_height @ 203 NONAME
+ pj_rbtree_next @ 204 NONAME
+ pj_rbtree_prev @ 205 NONAME
+ pj_register_strerror @ 206 NONAME
+ pj_rwmutex_create @ 207 NONAME
+ pj_rwmutex_destroy @ 208 NONAME
+ pj_rwmutex_lock_read @ 209 NONAME
+ pj_rwmutex_lock_write @ 210 NONAME
+ pj_rwmutex_unlock_read @ 211 NONAME
+ pj_rwmutex_unlock_write @ 212 NONAME
+ pj_sem_create @ 213 NONAME
+ pj_sem_destroy @ 214 NONAME
+ pj_sem_post @ 215 NONAME
+ pj_sem_trywait @ 216 NONAME
+ pj_sem_wait @ 217 NONAME
+ pj_set_netos_error @ 218 NONAME
+ pj_set_os_error @ 219 NONAME
+ pj_shutdown @ 220 NONAME
+ pj_sock_accept @ 221 NONAME
+ pj_sock_bind @ 222 NONAME
+ pj_sock_bind_in @ 223 NONAME
+ pj_sock_close @ 224 NONAME
+ pj_sock_connect @ 225 NONAME
+ pj_sock_getpeername @ 226 NONAME
+ pj_sock_getsockname @ 227 NONAME
+ pj_sock_getsockopt @ 228 NONAME
+ pj_sock_listen @ 229 NONAME
+ pj_sock_recv @ 230 NONAME
+ pj_sock_recvfrom @ 231 NONAME
+ pj_sock_select @ 232 NONAME
+ pj_sock_send @ 233 NONAME
+ pj_sock_sendto @ 234 NONAME
+ pj_sock_setsockopt @ 235 NONAME
+ pj_sock_shutdown @ 236 NONAME
+ pj_sock_socket @ 237 NONAME
+ pj_sockaddr_cmp @ 238 NONAME
+ pj_sockaddr_copy_addr @ 239 NONAME
+ pj_sockaddr_get_addr @ 240 NONAME
+ pj_sockaddr_get_addr_len @ 241 NONAME
+ pj_sockaddr_get_len @ 242 NONAME
+ pj_sockaddr_get_port @ 243 NONAME
+ pj_sockaddr_has_addr @ 244 NONAME
+ pj_sockaddr_in_get_addr @ 245 NONAME
+ pj_sockaddr_in_get_port @ 246 NONAME
+ pj_sockaddr_in_init @ 247 NONAME
+ pj_sockaddr_in_set_addr @ 248 NONAME
+ pj_sockaddr_in_set_port @ 249 NONAME
+ pj_sockaddr_in_set_str_addr @ 250 NONAME
+ pj_sockaddr_init @ 251 NONAME
+ pj_sockaddr_print @ 252 NONAME
+ pj_sockaddr_set_port @ 253 NONAME
+ pj_sockaddr_set_str_addr @ 254 NONAME
+ pj_srand @ 255 NONAME
+ pj_str @ 256 NONAME
+ pj_strassign @ 257 NONAME
+ pj_strcat @ 258 NONAME
+ pj_strcat2 @ 259 NONAME
+ pj_strcmp @ 260 NONAME
+ pj_strcmp2 @ 261 NONAME
+ pj_strcpy @ 262 NONAME
+ pj_strcpy2 @ 263 NONAME
+ pj_strdup @ 264 NONAME
+ pj_strdup2 @ 265 NONAME
+ pj_strdup2_with_null @ 266 NONAME
+ pj_strdup3 @ 267 NONAME
+ pj_strdup_with_null @ 268 NONAME
+ pj_strerror @ 269 NONAME
+ pj_stricmp @ 270 NONAME
+ pj_stricmp2 @ 271 NONAME
+ pj_strltrim @ 272 NONAME
+ pj_strncmp @ 273 NONAME
+ pj_strncmp2 @ 274 NONAME
+ pj_strncpy @ 275 NONAME
+ pj_strncpy_with_null @ 276 NONAME
+ pj_strnicmp @ 277 NONAME
+ pj_strnicmp2 @ 278 NONAME
+ pj_strrtrim @ 279 NONAME
+ pj_strtoul @ 280 NONAME
+ pj_strtoul2 @ 281 NONAME
+ pj_strtrim @ 282 NONAME
+ pj_symbianos_poll @ 283 NONAME
+ pj_symbianos_set_params @ 284 NONAME
+ pj_thread_check_stack @ 285 NONAME
+ pj_thread_create @ 286 NONAME
+ pj_thread_destroy @ 287 NONAME
+ pj_thread_get_name @ 288 NONAME
+ pj_thread_get_os_handle @ 289 NONAME
+ pj_thread_get_stack_info @ 290 NONAME
+ pj_thread_get_stack_max_usage @ 291 NONAME
+ pj_thread_is_registered @ 292 NONAME
+ pj_thread_join @ 293 NONAME
+ pj_thread_local_alloc @ 294 NONAME
+ pj_thread_local_free @ 295 NONAME
+ pj_thread_local_get @ 296 NONAME
+ pj_thread_local_set @ 297 NONAME
+ pj_thread_register @ 298 NONAME
+ pj_thread_resume @ 299 NONAME
+ pj_thread_sleep @ 300 NONAME
+ pj_thread_this @ 301 NONAME
+ pj_time_decode @ 302 NONAME
+ pj_time_encode @ 303 NONAME
+ pj_time_gmt_to_local @ 304 NONAME
+ pj_time_local_to_gmt @ 305 NONAME
+ pj_time_val_normalize @ 306 NONAME
+ pj_timer_entry_init @ 307 NONAME
+ pj_timer_heap_cancel @ 308 NONAME
+ pj_timer_heap_cancel_if_active @ 309 NONAME
+ pj_timer_heap_count @ 310 NONAME
+ pj_timer_heap_create @ 311 NONAME
+ pj_timer_heap_destroy @ 312 NONAME
+ pj_timer_heap_earliest_time @ 313 NONAME
+ pj_timer_heap_mem_size @ 314 NONAME
+ pj_timer_heap_poll @ 315 NONAME
+ pj_timer_heap_schedule @ 316 NONAME
+ pj_timer_heap_schedule_w_grp_lock @ 317 NONAME
+ pj_timer_heap_set_lock @ 318 NONAME
+ pj_timer_heap_set_max_timed_out_per_poll @ 319 NONAME
+ pj_unicode_to_ansi @ 320 NONAME
+ pj_utoa @ 321 NONAME
+ pj_utoa_pad @ 322 NONAME
+ platform_strerror @ 323 NONAME
+ snprintf @ 324 NONAME
+ vsnprintf @ 325 NONAME
View
2 configure-bb10
@@ -32,7 +32,7 @@ RANLIB="${QNX_HOST}/usr/bin/nto${TARGET_ARCH}-ranlib "
CPP="${QNX_HOST}/usr/bin/qcc -V4.6.3,gcc_nto${TARGET_ARCHEND}_cpp -E "
CC="${QNX_HOST}/usr/bin/qcc -V4.6.3,gcc_nto${TARGET_ARCHEND}_cpp "
LD="${QNX_HOST}/usr/bin/nto${TARGET_ARCH}-ld "
-export LDFLAGS=" -L${QNX_TARGET}/${LIBDIR}/usr/lib -L${QNX_TARGET}/${LIBDIR}/lib -L${QNX_HOST}/usr/lib/gcc/${TARGET_HOST}/4.6.3 -lgcc -lasound "
+export LDFLAGS=" -L${QNX_TARGET}/${LIBDIR}/usr/lib -L${QNX_TARGET}/${LIBDIR}/lib -L${QNX_HOST}/usr/lib/gcc/${TARGET_HOST}/4.6.3 -lgcc -lasound -laudio_manager"
export CFLAGS=" -g -fPIC -DPJMEDIA_AUDIO_DEV_HAS_BB10=1 "
./configure --host=${TARGET_HOST} --disable-oss $*
View
2 configure-iphone
@@ -133,7 +133,7 @@ if test "1" = "1"; then
fi
# And finally invoke the configure script itself
-./aconfigure --host=arm-apple-darwin9 --disable-floating-point --disable-sdl $*
+./aconfigure --host=arm-apple-darwin9 --disable-sdl $*
if test "$?" = "0"; then
echo "Done configuring for `basename $SDKPATH`"
View
2 pjlib-util/build/Makefile
@@ -74,7 +74,7 @@ distclean: realclean
pjlib-util:
$(MAKE) -f $(RULES_MAK) APP=PJLIB_UTIL app=pjlib-util $(PJLIB_UTIL_LIB)
-pjlib-util-test:
+pjlib-util-test: pjlib-util
$(MAKE) -f $(RULES_MAK) APP=UTIL_TEST app=pjlib-util-test $(UTIL_TEST_EXE)
.PHONY: ../lib/pjlib-util.ko
View
77 pjlib-util/include/pjlib-util/stun_simple.h
@@ -1,4 +1,4 @@
-/* $Id: stun_simple.h 3553 2011-05-05 06:14:19Z nanang $ */
+/* $Id: stun_simple.h 4224 2012-08-09 05:21:25Z nanang $ */
/*
* Copyright (C) 2008-2011 Teluu Inc. (http://www.teluu.com)
* Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org>
@@ -199,6 +199,81 @@ PJ_DECL(pj_status_t) pjstun_get_mapped_addr( pj_pool_factory *pf,
const pj_str_t *srv2, int port2,
pj_sockaddr_in mapped_addr[]);
+
+/*
+ * This structre describes configurable setting for requesting mapped address.
+ */
+typedef struct pjstun_setting
+{
+ /**
+ * Specifies whether STUN request generated by old STUN library should
+ * insert magic cookie (specified in RFC 5389) in the transaction ID.
+ */
+ pj_bool_t use_stun2;
+
+ /**
+ * Host name or IP address string of the first STUN server.
+ */
+ pj_str_t srv1;
+
+ /**
+ * The port number of the first STUN server.
+ */
+ int port1;
+
+ /**
+ * Host name or IP address string of the second STUN server.
+ */
+ pj_str_t srv2;
+
+ /**
+ * The port number of the second STUN server.
+ */
+ int port2;
+
+} pjstun_setting;
+
+
+/**
+ * Another version of mapped address resolution of local sockets to multiple
+ * STUN servers configured in #pjstun_setting. This function is able to find
+ * the mapped addresses of multiple sockets simultaneously, and for each
+ * socket, two requests will be sent to two different STUN servers to see if
+ * both servers get the same public address for the same socket. (Note that
+ * application can specify the same address for the two servers, but still
+ * two requests will be sent for each server).
+ *
+ * This function will perform necessary retransmissions of the requests if
+ * response is not received within a predetermined period. When all responses
+ * have been received, the function will compare the mapped addresses returned
+ * by the servers, and when both are equal, the address will be returned in
+ * \a mapped_addr argument.
+ *
+ * @param pf The pool factory where memory will be allocated from.
+ * @param opt The STUN settings.
+ * @param sock_cnt Number of sockets in the socket array.
+ * @param sock Array of local UDP sockets which public addresses are
+ * to be queried from the STUN servers.
+ * @param mapped_addr Array to receive the mapped public address of the local
+ * UDP sockets, when the function returns PJ_SUCCESS.
+ *
+ * @return This functions returns PJ_SUCCESS if responses are
+ * received from all servers AND all servers returned the
+ * same mapped public address. Otherwise this function may
+ * return one of the following error codes:
+ * - PJLIB_UTIL_ESTUNNOTRESPOND: no respons from servers.
+ * - PJLIB_UTIL_ESTUNSYMMETRIC: different mapped addresses
+ * are returned by servers.
+ * - etc.
+ *
+ */
+PJ_DECL(pj_status_t) pjstun_get_mapped_addr2( pj_pool_factory *pf,
+ const pjstun_setting *opt,
+ int sock_cnt,
+ pj_sock_t sock[],
+ pj_sockaddr_in mapped_addr[]);
+
+
PJ_END_DECL
/**
View
150 pjlib-util/src/pjlib-util/resolver.c
@@ -1,4 +1,4 @@
-/* $Id: resolver.c 3553 2011-05-05 06:14:19Z nanang $ */
+/* $Id: resolver.c 4333 2013-01-23 09:53:39Z nanang $ */
/*
* Copyright (C) 2008-2011 Teluu Inc. (http://www.teluu.com)
* Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org>
@@ -180,7 +180,8 @@ struct pj_dns_resolver
unsigned char udp_rx_pkt[UDPSZ];/**< UDP receive buffer. */
unsigned char udp_tx_pkt[UDPSZ];/**< UDP receive buffer. */
pj_ssize_t udp_len; /**< Length of received packet. */
- pj_ioqueue_op_key_t udp_op_key; /**< UDP read operation key. */
+ pj_ioqueue_op_key_t udp_op_rx_key; /**< UDP read operation key. */
+ pj_ioqueue_op_key_t udp_op_tx_key; /**< UDP write operation key. */
pj_sockaddr_in udp_src_addr; /**< Source address of packet */
int udp_addr_len; /**< Source address length. */
@@ -223,6 +224,63 @@ static pj_status_t select_nameservers(pj_dns_resolver *resolver,
unsigned servers[]);
+/* Close UDP socket */
+static void close_sock(pj_dns_resolver *resv)
+{
+ /* Close existing socket */
+ if (resv->udp_key != NULL) {
+ pj_ioqueue_unregister(resv->udp_key);
+ resv->udp_key = NULL;
+ resv->udp_sock = PJ_INVALID_SOCKET;
+ } else if (resv->udp_sock != PJ_INVALID_SOCKET) {
+ pj_sock_close(resv->udp_sock);
+ resv->udp_sock = PJ_INVALID_SOCKET;
+ }
+}
+
+
+/* Initialize UDP socket */
+static pj_status_t init_sock(pj_dns_resolver *resv)
+{
+ pj_ioqueue_callback socket_cb;
+ pj_status_t status;
+
+ /* Create the UDP socket */
+ status = pj_sock_socket(pj_AF_INET(), pj_SOCK_DGRAM(), 0, &resv->udp_sock);
+ if (status != PJ_SUCCESS)
+ return status;
+
+ /* Bind to any address/port */
+ status = pj_sock_bind_in(resv->udp_sock, 0, 0);
+ if (status != PJ_SUCCESS)
+ return status;
+
+ /* Register to ioqueue */
+ pj_bzero(&socket_cb, sizeof(socket_cb));
+ socket_cb.on_read_complete = &on_read_complete;
+ status = pj_ioqueue_register_sock(resv->pool, resv->ioqueue,
+ resv->udp_sock, resv, &socket_cb,
+ &resv->udp_key);
+ if (status != PJ_SUCCESS)
+ return status;
+
+ pj_ioqueue_op_key_init(&resv->udp_op_rx_key, sizeof(resv->udp_op_rx_key));
+ pj_ioqueue_op_key_init(&resv->udp_op_tx_key, sizeof(resv->udp_op_tx_key));
+
+ /* Start asynchronous read to the UDP socket */
+ resv->udp_len = sizeof(resv->udp_rx_pkt);
+ resv->udp_addr_len = sizeof(resv->udp_src_addr);
+ status = pj_ioqueue_recvfrom(resv->udp_key, &resv->udp_op_rx_key,
+ resv->udp_rx_pkt, &resv->udp_len,
+ PJ_IOQUEUE_ALWAYS_ASYNC,
+ &resv->udp_src_addr, &resv->udp_addr_len);
+ if (status != PJ_EPENDING)
+ return status;
+
+ return PJ_SUCCESS;
+}
+
+
/* Initialize DNS settings with default values */
PJ_DEF(void) pj_dns_settings_default(pj_dns_settings *s)
{
@@ -247,7 +305,6 @@ PJ_DEF(pj_status_t) pj_dns_resolver_create( pj_pool_factory *pf,
{
pj_pool_t *pool;
pj_dns_resolver *resv;
- pj_ioqueue_callback socket_cb;
pj_status_t status;
/* Sanity check */
@@ -302,37 +359,11 @@ PJ_DEF(pj_status_t) pj_dns_resolver_create( pj_pool_factory *pf,
resv->hquerybyres = pj_hash_create(pool, Q_HASH_TABLE_SIZE);
pj_list_init(&resv->query_free_nodes);
- /* Create the UDP socket */
- status = pj_sock_socket(pj_AF_INET(), pj_SOCK_DGRAM(), 0, &resv->udp_sock);
- if (status != PJ_SUCCESS)
- goto on_error;
-
- /* Bind to any address/port */
- status = pj_sock_bind_in(resv->udp_sock, 0, 0);
+ /* Initialize the UDP socket */
+ status = init_sock(resv);
if (status != PJ_SUCCESS)
goto on_error;
- /* Register to ioqueue */
- pj_bzero(&socket_cb, sizeof(socket_cb));
- socket_cb.on_read_complete = &on_read_complete;
- status = pj_ioqueue_register_sock(pool, resv->ioqueue, resv->udp_sock,
- resv, &socket_cb, &resv->udp_key);
- if (status != PJ_SUCCESS)
- goto on_error;
-
- pj_ioqueue_op_key_init(&resv->udp_op_key, sizeof(resv->udp_op_key));
-
- /* Start asynchronous read to the UDP socket */
- resv->udp_len = sizeof(resv->udp_rx_pkt);
- resv->udp_addr_len = sizeof(resv->udp_src_addr);
- status = pj_ioqueue_recvfrom(resv->udp_key, &resv->udp_op_key,
- resv->udp_rx_pkt, &resv->udp_len,
- PJ_IOQUEUE_ALWAYS_ASYNC,
- &resv->udp_src_addr, &resv->udp_addr_len);
- if (status != PJ_EPENDING)
- goto on_error;
-
-
/* Looks like everything is okay */
*p_resolver = resv;
return PJ_SUCCESS;
@@ -392,14 +423,7 @@ PJ_DEF(pj_status_t) pj_dns_resolver_destroy( pj_dns_resolver *resolver,
resolver->timer = NULL;
}
- if (resolver->udp_key != NULL) {
- pj_ioqueue_unregister(resolver->udp_key);
- resolver->udp_key = NULL;
- resolver->udp_sock = PJ_INVALID_SOCKET;
- } else if (resolver->udp_sock != PJ_INVALID_SOCKET) {
- pj_sock_close(resolver->udp_sock);
- resolver->udp_sock = PJ_INVALID_SOCKET;
- }
+ close_sock(resolver);
if (resolver->own_ioqueue && resolver->ioqueue) {
pj_ioqueue_destroy(resolver->ioqueue);
@@ -561,15 +585,6 @@ static pj_status_t transmit_query(pj_dns_resolver *resolver,
pj_time_val delay;
pj_status_t status;
- /* Create DNS query packet */
- pkt_size = sizeof(resolver->udp_tx_pkt);
- name = pj_str(q->key.name);
- status = pj_dns_make_query(resolver->udp_tx_pkt, &pkt_size,
- q->id, q->key.qtype, &name);
- if (status != PJ_SUCCESS) {
- return status;
- }
-
/* Select which nameserver(s) to send requests to. */
server_cnt = PJ_ARRAY_SIZE(servers);
status = select_nameservers(resolver, &server_cnt, servers);
@@ -595,6 +610,28 @@ static pj_status_t transmit_query(pj_dns_resolver *resolver,
return status;
}
+ /* Check if the socket is available for sending */
+ if (pj_ioqueue_is_pending(resolver->udp_key, &resolver->udp_op_tx_key)) {
+ ++q->transmit_cnt;
+ PJ_LOG(4,(resolver->name.ptr,
+ "Socket busy in transmitting DNS %s query for %s%s",
+ pj_dns_get_type_name(q->key.qtype),
+ q->key.name,
+ (q->transmit_cnt < resolver->settings.qretr_count?
+ ", will try again later":"")));
+ return PJ_SUCCESS;
+ }
+
+ /* Create DNS query packet */
+ pkt_size = sizeof(resolver->udp_tx_pkt);
+ name = pj_str(q->key.name);
+ status = pj_dns_make_query(resolver->udp_tx_pkt, &pkt_size,
+ q->id, q->key.qtype, &name);
+ if (status != PJ_SUCCESS) {
+ pj_timer_heap_cancel(resolver->timer, &q->timer_entry);
+ return status;
+ }
+
/* Get current time. */
pj_gettimeofday(&now);
@@ -603,13 +640,16 @@ static pj_status_t transmit_query(pj_dns_resolver *resolver,
pj_ssize_t sent = (pj_ssize_t) pkt_size;
struct nameserver *ns = &resolver->ns[servers[i]];
- pj_sock_sendto(resolver->udp_sock, resolver->udp_tx_pkt, &sent, 0,
- &resolver->ns[servers[i]].addr, sizeof(pj_sockaddr_in));
+ status = pj_ioqueue_sendto(resolver->udp_key,
+ &resolver->udp_op_tx_key,
+ resolver->udp_tx_pkt, &sent, 0,
+ &resolver->ns[servers[i]].addr,
+ sizeof(pj_sockaddr_in));
- PJ_LOG(4,(resolver->name.ptr,
+ PJ_PERROR(4,(resolver->name.ptr, status,
"%s %d bytes to NS %d (%s:%d): DNS %s query for %s",
(q->transmit_cnt==0? "Transmitting":"Re-transmitting"),
- (int)sent, servers[i],
+ (int)pkt_size, servers[i],
pj_inet_ntoa(ns->addr.sin_addr),
(int)pj_ntohs(ns->addr.sin_port),
pj_dns_get_type_name(q->key.qtype),
@@ -1248,6 +1288,9 @@ static void on_timeout( pj_timer_heap_t *timer_heap,
pj_hash_set(NULL, resolver->hquerybyid, &q->id, sizeof(q->id), 0, NULL);
pj_hash_set(NULL, resolver->hquerybyres, &q->key, sizeof(q->key), 0, NULL);
+ /* Workaround for deadlock problem in #1565 (similar to #1108) */
+ pj_mutex_unlock(resolver->mutex);
+
/* Call application callback, if any. */
if (q->cb)
(*q->cb)(q->user_data, PJ_ETIMEDOUT, NULL);
@@ -1260,6 +1303,9 @@ static void on_timeout( pj_timer_heap_t *timer_heap,
cq = cq->next;
}
+ /* Workaround for deadlock problem in #1565 (similar to #1108) */
+ pj_mutex_lock(resolver->mutex);
+
/* Clear data */
q->timer_entry.id = 0;
q->user_data = NULL;
View
3 pjlib-util/src/pjlib-util/scanner.c
@@ -1,4 +1,4 @@
-/* $Id: scanner.c 3553 2011-05-05 06:14:19Z nanang $ */
+/* $Id: scanner.c 4209 2012-07-18 10:21:00Z ming $ */
/*
* Copyright (C) 2008-2011 Teluu Inc. (http://www.teluu.com)
* Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org>
@@ -393,7 +393,6 @@ PJ_DEF(void) pj_scan_get_quotes(pj_scanner *scanner,
}
/* break from main loop if we have odd number of backslashes */
if (((unsigned)(q-r) & 0x01) == 1) {
- ++s;
break;
}
++s;
View
39 pjlib-util/src/pjlib-util/stun_simple_client.c
@@ -1,4 +1,4 @@
-/* $Id: stun_simple_client.c 3999 2012-03-30 07:10:13Z bennylp $ */
+/* $Id: stun_simple_client.c 4297 2012-11-13 08:46:42Z bennylp $ */
/*
* Copyright (C) 2008-2011 Teluu Inc. (http://www.teluu.com)
* Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org>
@@ -42,7 +42,27 @@ PJ_DEF(pj_status_t) pjstun_get_mapped_addr( pj_pool_factory *pf,
const pj_str_t *srv2, int port2,
pj_sockaddr_in mapped_addr[])
{
+ pjstun_setting opt;
+
+ pj_bzero(&opt, sizeof(opt));
+ opt.use_stun2 = PJ_FALSE;
+ opt.srv1 = *srv1;
+ opt.port1 = port1;
+ opt.srv2 = *srv2;
+ opt.port2 = port2;
+
+ return pjstun_get_mapped_addr2(pf, &opt, sock_cnt, sock, mapped_addr);
+}
+
+PJ_DEF(pj_status_t) pjstun_get_mapped_addr2(pj_pool_factory *pf,
+ const pjstun_setting *opt,
+ int sock_cnt,
+ pj_sock_t sock[],
+ pj_sockaddr_in mapped_addr[])
+{
unsigned srv_cnt;
+ const pj_str_t *srv1, *srv2;
+ int port1, port2;
pj_sockaddr_in srv_addr[2];
int i, send_cnt = 0, nfds;
pj_pool_t *pool;
@@ -59,6 +79,11 @@ PJ_DEF(pj_status_t) pjstun_get_mapped_addr( pj_pool_factory *pf,
PJ_CHECK_STACK();
+ srv1 = &opt->srv1;
+ port1 = opt->port1;
+ srv2 = &opt->srv1;
+ port2 = opt->port2;
+
TRACE_((THIS_FILE, "Entering pjstun_get_mapped_addr()"));
/* Create pool. */
@@ -82,6 +107,12 @@ PJ_DEF(pj_status_t) pjstun_get_mapped_addr( pj_pool_factory *pf,
if (status != PJ_SUCCESS)
goto on_error;
+ /* Insert magic cookie (specified in RFC 5389) when requested to. */
+ if (opt->use_stun2) {
+ pjstun_msg_hdr *hdr = (pjstun_msg_hdr*)out_msg;
+ hdr->tsx[0] = pj_htonl(STUN_MAGIC);
+ }
+
TRACE_((THIS_FILE, " Binding request created."));
/* Resolve servers. */
@@ -162,15 +193,15 @@ PJ_DEF(pj_status_t) pjstun_get_mapped_addr( pj_pool_factory *pf,
TRACE_((THIS_FILE, " Request(s) sent, counter=%d", send_cnt));
/* Calculate time of next retransmission. */
- pj_gettimeofday(&next_tx);
+ pj_gettickcount(&next_tx);
next_tx.sec += (stun_timer[send_cnt]/1000);
next_tx.msec += (stun_timer[send_cnt]%1000);
pj_time_val_normalize(&next_tx);
- for (pj_gettimeofday(&now), select_rc=1;
+ for (pj_gettickcount(&now), select_rc=1;
status==PJ_SUCCESS && select_rc>=1 && wait_resp>0
&& PJ_TIME_VAL_LT(now, next_tx);
- pj_gettimeofday(&now))
+ pj_gettickcount(&now))
{
pj_time_val timeout;
View
2 pjlib/build/Makefile
@@ -87,7 +87,7 @@ pjlib: ../include/pj/config_site.h
../include/pj/config_site.h:
touch ../include/pj/config_site.h
-pjlib-test:
+pjlib-test: pjlib
$(MAKE) -f $(RULES_MAK) APP=TEST app=pjlib-test $(TEST_EXE)
.PHONY: ../lib/pjlib.ko
View
9 pjlib/include/pj/activesock.h
@@ -1,4 +1,4 @@
-/* $Id: activesock.h 3553 2011-05-05 06:14:19Z nanang $ */
+/* $Id: activesock.h 4359 2013-02-21 11:18:36Z bennylp $ */
/*
* Copyright (C) 2008-2011 Teluu Inc. (http://www.teluu.com)
* Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org>
@@ -174,6 +174,11 @@ typedef struct pj_activesock_cb
typedef struct pj_activesock_cfg
{
/**
+ * Optional group lock to be assigned to the ioqueue key.
+ */
+ pj_grp_lock_t *grp_lock;
+
+ /**
* Number of concurrent asynchronous operations that is to be supported
* by the active socket. This value only affects socket receive and
* accept operations -- the active socket will issue one or more
@@ -290,7 +295,6 @@ PJ_DECL(pj_status_t) pj_activesock_create_udp(pj_pool_t *pool,
pj_activesock_t **p_asock,
pj_sockaddr *bound_addr);
-
/**
* Close the active socket. This will unregister the socket from the
* ioqueue and ultimately close the socket.
@@ -548,6 +552,7 @@ PJ_DECL(pj_status_t) pj_activesock_start_connect(pj_activesock_t *asock,
const pj_sockaddr_t *remaddr,
int addr_len);
+
#endif /* PJ_HAS_TCP */
/**
View
27 pjlib/include/pj/addr_resolv.h
@@ -1,4 +1,4 @@
-/* $Id: addr_resolv.h 3553 2011-05-05 06:14:19Z nanang $ */
+/* $Id: addr_resolv.h 4218 2012-08-07 02:18:15Z bennylp $ */
/*
* Copyright (C) 2008-2011 Teluu Inc. (http://www.teluu.com)
* Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org>
@@ -117,6 +117,31 @@ PJ_DECL(pj_status_t) pj_gethostip(int af, pj_sockaddr *addr);
/**
+ * Get the interface IP address to send data to the specified destination.
+ *
+ * @param af The desired address family to query. Valid values
+ * are pj_AF_INET() or pj_AF_INET6().
+ * @param dst The destination host.
+ * @param itf_addr On successful resolution, the address family and address
+ * part of this socket address will be filled up with the host
+ * IP address, in network byte order. Other parts of the socket
+ * address should be ignored.
+ * @param allow_resolve If \a dst may contain hostname (instead of IP
+ * address), specify whether hostname resolution should
+ * be performed. If not, default interface address will
+ * be returned.
+ * @param p_dst_addr If not NULL, it will be filled with the IP address of
+ * the destination host.
+ *
+ * @return PJ_SUCCESS on success, or the appropriate error code.
+ */
+PJ_DECL(pj_status_t) pj_getipinterface(int af,
+ const pj_str_t *dst,
+ pj_sockaddr *itf_addr,
+ pj_bool_t allow_resolve,
+ pj_sockaddr *p_dst_addr);
+
+/**
* Get the IP address of the default interface. Default interface is the
* interface of the default route.
*
View
22 pjlib/include/pj/config.h
@@ -1,4 +1,4 @@
-/* $Id: config.h 4189 2012-07-03 03:11:24Z ming $ */
+/* $Id: config.h 4415 2013-03-05 08:34:45Z ming $ */
/*
* Copyright (C) 2008-2011 Teluu Inc. (http://www.teluu.com)
* Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org>
@@ -488,6 +488,14 @@
/**
+ * Set this to 1 to enable debugging on the group lock. Default: 0
+ */
+#ifndef PJ_GRP_LOCK_DEBUG
+# define PJ_GRP_LOCK_DEBUG 0
+#endif
+
+
+/**
* Specify this as \a stack_size argument in #pj_thread_create() to specify
* that thread should use default stack size for the current platform.
*
@@ -1122,6 +1130,14 @@
#endif
/**
+ * Simulate race condition by sleeping the thread in strategic locations.
+ * Default: no!
+ */
+#ifndef PJ_RACE_ME
+# define PJ_RACE_ME(x)
+#endif
+
+/**
* Function attributes to inform that the function may throw exception.
*
* @param x The exception list, enclosed in parenthesis.
@@ -1167,10 +1183,10 @@ PJ_BEGIN_DECL
#define PJ_VERSION_NUM_MAJOR 2
/** PJLIB version minor number. */
-#define PJ_VERSION_NUM_MINOR 0
+#define PJ_VERSION_NUM_MINOR 1
/** PJLIB version revision number. */
-#define PJ_VERSION_NUM_REV 1
+#define PJ_VERSION_NUM_REV 0
/**
* Extra suffix for the version (e.g. "-trunk"), or empty for
View
6 pjlib/include/pj/config_site_sample.h
@@ -302,8 +302,10 @@
* PJLIB settings.
*/
- /* Disable floating point support */
- #define PJ_HAS_FLOATING_POINT 0
+ /* Both armv6 and armv7 has FP hardware support.
+ * See https://trac.pjsip.org/repos/ticket/1589 for more info
+ */
+ #define PJ_HAS_FLOATING_POINT 1
/*
* PJMEDIA settings
View
7 pjlib/include/pj/errno.h
@@ -1,4 +1,4 @@
-/* $Id: errno.h 3664 2011-07-19 03:42:28Z nanang $ */
+/* $Id: errno.h 4359 2013-02-21 11:18:36Z bennylp $ */
/*
* Copyright (C) 2008-2011 Teluu Inc. (http://www.teluu.com)
* Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org>
@@ -422,6 +422,11 @@ PJ_DECL(pj_status_t) pj_register_strerror(pj_status_t start_code,
* Unsupported address family
*/
#define PJ_EAFNOTSUP (PJ_ERRNO_START_STATUS + 22)/* 70022 */
+/**
+ * @hideinitializer
+ * Object no longer exists
+ */
+#define PJ_EGONE (PJ_ERRNO_START_STATUS + 23)/* 70023 */
/** @} */ /* pj_errnum */
View
21 pjlib/include/pj/guid.h
@@ -1,4 +1,4 @@
-/* $Id: guid.h 3553 2011-05-05 06:14:19Z nanang $ */
+/* $Id: guid.h 4208 2012-07-18 07:52:33Z ming $ */
/*
* Copyright (C) 2008-2011 Teluu Inc. (http://www.teluu.com)
* Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org>
@@ -83,13 +83,32 @@ PJ_DECL(unsigned) pj_GUID_STRING_LENGTH(void);
PJ_DECL(pj_str_t*) pj_generate_unique_string(pj_str_t *str);
/**
+ * Create a globally unique string in lowercase, which length is
+ * PJ_GUID_STRING_LENGTH characters. Caller is responsible for preallocating
+ * the storage used in the string.
+ *
+ * @param str The string to store the result.
+ *
+ * @return The string.
+ */
+PJ_DECL(pj_str_t*) pj_generate_unique_string_lower(pj_str_t *str);
+
+/**
* Generate a unique string.
*
* @param pool Pool to allocate memory from.
* @param str The string.
*/
PJ_DECL(void) pj_create_unique_string(pj_pool_t *pool, pj_str_t *str);
+/**
+ * Generate a unique string in lowercase.
+ *
+ * @param pool Pool to allocate memory from.
+ * @param str The string.
+ */
+PJ_DECL(void) pj_create_unique_string_lower(pj_pool_t *pool, pj_str_t *str);
+
/**
* @}
View
40 pjlib/include/pj/hash.h
@@ -1,4 +1,4 @@
-/* $Id: hash.h 3841 2011-10-24 09:28:13Z ming $ */
+/* $Id: hash.h 4208 2012-07-18 07:52:33Z ming $ */
/*
* Copyright (C) 2008-2011 Teluu Inc. (http://www.teluu.com)
* Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org>
@@ -75,8 +75,8 @@ PJ_DECL(pj_uint32_t) pj_hash_calc(pj_uint32_t hval,
* string is stored in \c result.
*
* @param hval The initial hash value, normally zero.
- * @param result Buffer to store the result, which must be enough to hold
- * the string.
+ * @param result Optional. Buffer to store the result, which must be enough
+ * to hold the string.
* @param key The input key to be converted and calculated.
*
* @return The hash value.
@@ -116,6 +116,17 @@ PJ_DECL(void *) pj_hash_get( pj_hash_table_t *ht,
/**
+ * Variant of #pj_hash_get() with the key being converted to lowercase when
+ * calculating the hash value.
+ *
+ * @see pj_hash_get()
+ */
+PJ_DECL(void *) pj_hash_get_lower( pj_hash_table_t *ht,
+ const void *key, unsigned keylen,
+ pj_uint32_t *hval );
+
+
+/**
* Associate/disassociate a value with the specified key. If value is not
* NULL and entry already exists, the entry's value will be overwritten.
* If value is not NULL and entry does not exist, a new one will be created
@@ -142,6 +153,17 @@ PJ_DECL(void) pj_hash_set( pj_pool_t *pool, pj_hash_table_t *ht,
/**
+ * Variant of #pj_hash_set() with the key being converted to lowercase when
+ * calculating the hash value.
+ *
+ * @see pj_hash_set()
+ */
+PJ_DECL(void) pj_hash_set_lower( pj_pool_t *pool, pj_hash_table_t *ht,
+ const void *key, unsigned keylen,
+ pj_uint32_t hval, void *value );
+
+
+/**
* Associate/disassociate a value with the specified key. This function works
* like #pj_hash_set(), except that it doesn't use pool (hence the np -- no
* pool suffix). If new entry needs to be allocated, it will use the entry_buf.
@@ -165,6 +187,18 @@ PJ_DECL(void) pj_hash_set_np(pj_hash_table_t *ht,
void *value);
/**
+ * Variant of #pj_hash_set_np() with the key being converted to lowercase
+ * when calculating the hash value.
+ *
+ * @see pj_hash_set_np()
+ */
+PJ_DECL(void) pj_hash_set_np_lower(pj_hash_table_t *ht,
+ const void *key, unsigned keylen,
+ pj_uint32_t hval,
+ pj_hash_entry_buf entry_buf,
+ void *value);
+
+/**
* Get the total number of entries in the hash table.
*
* @param ht the hash table.
View
15 pjlib/include/pj/ioqueue.h
@@ -1,4 +1,4 @@
-/* $Id: ioqueue.h 3553 2011-05-05 06:14:19Z nanang $
+/* $Id: ioqueue.h 4359 2013-02-21 11:18:36Z bennylp $
*/
/*
* Copyright (C) 2008-2011 Teluu Inc. (http://www.teluu.com)
@@ -405,6 +405,19 @@ PJ_DECL(pj_status_t) pj_ioqueue_register_sock( pj_pool_t *pool,
pj_ioqueue_key_t **key );
/**
+ * Variant of pj_ioqueue_register_sock() with additional group lock parameter.
+ * If group lock is set for the key, the key will add the reference counter
+ * when the socket is registered and decrease it when it is destroyed.
+ */
+PJ_DECL(pj_status_t) pj_ioqueue_register_sock2(pj_pool_t *pool,
+ pj_ioqueue_t *ioque,
+ pj_sock_t sock,
+ pj_grp_lock_t *grp_lock,
+ void *user_data,
+ const pj_ioqueue_callback *cb,
+ pj_ioqueue_key_t **key );
+
+/**
* Unregister from the I/O Queue framework. Caller must make sure that
* the key doesn't have any pending operations before calling this function,
* by calling #pj_ioqueue_is_pending() for all previously submitted
View
254 pjlib/include/pj/lock.h
@@ -1,4 +1,4 @@
-/* $Id: lock.h 3553 2011-05-05 06:14:19Z nanang $ */
+/* $Id: lock.h 4359 2013-02-21 11:18:36Z bennylp $ */
/*
* Copyright (C) 2008-2011 Teluu Inc. (http://www.teluu.com)
* Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org>
@@ -147,6 +147,258 @@ PJ_DECL(pj_status_t) pj_lock_destroy( pj_lock_t *lock );
/** @} */
+
+/**
+ * @defgroup PJ_GRP_LOCK Group Lock
+ * @ingroup PJ_LOCK
+ * @{
+ *
+ * Group lock is a synchronization object to manage concurrency among members
+ * within the same logical group. Example of such groups are:
+ *
+ * - dialog, which has members such as the dialog itself, an invite session,
+ * and several transactions
+ * - ICE, which has members such as ICE stream transport, ICE session, STUN
+ * socket, TURN socket, and down to ioqueue key
+ *
+ * Group lock has three functions:
+ *
+ * - mutual exclusion: to protect resources from being accessed by more than
+ * one threads at the same time
+ * - session management: to make sure that the resource is not destroyed
+ * while others are still using or about to use it.
+ * - lock coordinator: to provide uniform lock ordering among more than one
+ * lock objects, which is necessary to avoid deadlock.
+ *
+ * The requirements of the group lock are:
+ *
+ * - must satisfy all the functions above
+ * - must allow members to join or leave the group (for example,
+ * transaction may be added or removed from a dialog)
+ * - must be able to synchronize with external lock (for example, a dialog
+ * lock must be able to sync itself with PJSUA lock)
+ *
+ * Please see https://trac.pjsip.org/repos/wiki/Group_Lock for more info.
+ */
+
+/**
+ * Settings for creating the group lock.
+ */
+typedef struct pj_grp_lock_config
+{
+ /**
+ * Creation flags, currently must be zero.
+ */
+ unsigned flags;
+
+} pj_grp_lock_config;
+
+
+/**
+ * Initialize the config with the default values.
+ *
+ * @param cfg The config to be initialized.
+ */
+PJ_DECL(void) pj_grp_lock_config_default(pj_grp_lock_config *cfg);
+
+/**
+ * Create a group lock object. Initially the group lock will have reference
+ * counter of one.
+ *
+ * @param pool The group lock only uses the pool parameter to get
+ * the pool factory, from which it will create its own
+ * pool.
+ * @param cfg Optional configuration.
+ * @param p_grp_lock Pointer to receive the newly created group lock.
+ *
+ * @return PJ_SUCCESS or the appropriate error code.
+ */
+PJ_DECL(pj_status_t) pj_grp_lock_create(pj_pool_t *pool,
+ const pj_grp_lock_config *cfg,
+ pj_grp_lock_t **p_grp_lock);
+
+/**
+ * Forcibly destroy the group lock, ignoring the reference counter value.
+ *
+ * @param grp_lock The group lock.
+ *
+ * @return PJ_SUCCESS or the appropriate error code.
+ */
+PJ_DECL(pj_status_t) pj_grp_lock_destroy( pj_grp_lock_t *grp_lock);
+
+/**
+ * Move the contents of the old lock to the new lock and destroy the
+ * old lock.
+ *
+ * @param old_lock The old group lock to be destroyed.
+ * @param new_lock The new group lock.
+ *
+ * @return PJ_SUCCESS or the appropriate error code.
+ */
+PJ_DECL(pj_status_t) pj_grp_lock_replace(pj_grp_lock_t *old_lock,
+ pj_grp_lock_t *new_lock);
+
+/**
+ * Acquire lock on the specified group lock.
+ *
+ * @param grp_lock The group lock.
+ *
+ * @return PJ_SUCCESS or the appropriate error code.
+ */
+PJ_DECL(pj_status_t) pj_grp_lock_acquire( pj_grp_lock_t *grp_lock);
+
+/**
+ * Acquire lock on the specified group lock if it is available, otherwise
+ * return immediately wihout waiting.
+ *
+ * @param grp_lock The group lock.
+ *
+ * @return PJ_SUCCESS or the appropriate error code.
+ */
+PJ_DECL(pj_status_t) pj_grp_lock_tryacquire( pj_grp_lock_t *grp_lock);
+
+/**
+ * Release the previously held lock. This may cause the group lock
+ * to be destroyed if it is the last one to hold the reference counter.
+ * In that case, the function will return PJ_EGONE.
+ *
+ * @param grp_lock The group lock.
+ *
+ * @return PJ_SUCCESS or the appropriate error code.
+ */
+PJ_DECL(pj_status_t) pj_grp_lock_release( pj_grp_lock_t *grp_lock);
+
+/**
+ * Add a destructor handler, to be called by the group lock when it is
+ * about to be destroyed.
+ *
+ * @param grp_lock The group lock.
+ * @param pool Pool to allocate memory for the handler.
+ * @param member A pointer to be passed to the handler.
+ * @param handler The destroy handler.
+ *
+ * @return PJ_SUCCESS or the appropriate error code.
+ */
+PJ_DECL(pj_status_t) pj_grp_lock_add_handler(pj_grp_lock_t *grp_lock,
+ pj_pool_t *pool,
+ void *member,
+ void (*handler)(void *member));
+
+/**
+ * Remove previously registered handler. All parameters must be the same
+ * as when the handler was added.
+ *
+ * @param grp_lock The group lock.
+ * @param member A pointer to be passed to the handler.
+ * @param handler The destroy handler.
+ *
+ * @return PJ_SUCCESS or the appropriate error code.
+ */
+PJ_DECL(pj_status_t) pj_grp_lock_del_handler(pj_grp_lock_t *grp_lock,
+ void *member,
+ void (*handler)(void *member));
+
+/**
+ * Increment reference counter to prevent the group lock grom being destroyed.
+ *
+ * @param grp_lock The group lock.
+ *
+ * @return PJ_SUCCESS or the appropriate error code.
+ */
+#if !PJ_GRP_LOCK_DEBUG
+PJ_DECL(pj_status_t) pj_grp_lock_add_ref(pj_grp_lock_t *grp_lock);
+
+#define pj_grp_lock_add_ref_dbg(grp_lock, x, y) pj_grp_lock_add_ref(grp_lock)
+
+#else
+
+#define pj_grp_lock_add_ref(g) pj_grp_lock_add_ref_dbg(g, __FILE__, __LINE__)
+
+PJ_DECL(pj_status_t) pj_grp_lock_add_ref_dbg(pj_grp_lock_t *grp_lock,
+ const char *file,
+ int line);
+#endif
+
+/**
+ * Decrement the reference counter. When the counter value reaches zero, the
+ * group lock will be destroyed and all destructor handlers will be called.
+ *
+ * @param grp_lock The group lock.
+ *
+ * @return PJ_SUCCESS or the appropriate error code.
+ */
+#if !PJ_GRP_LOCK_DEBUG
+PJ_DECL(pj_status_t) pj_grp_lock_dec_ref(pj_grp_lock_t *grp_lock);
+
+#define pj_grp_lock_dec_ref_dbg(grp_lock, x, y) pj_grp_lock_dec_ref(grp_lock)
+#else
+
+#define pj_grp_lock_dec_ref(g) pj_grp_lock_dec_ref_dbg(g, __FILE__, __LINE__)
+
+PJ_DECL(pj_status_t) pj_grp_lock_dec_ref_dbg(pj_grp_lock_t *grp_lock,
+ const char *file,
+ int line);
+
+#endif
+
+/**
+ * Get current reference count value. This normally is only used for
+ * debugging purpose.
+ *
+ * @param grp_lock The group lock.
+ *
+ * @return The reference count value.
+ */
+PJ_DECL(int) pj_grp_lock_get_ref(pj_grp_lock_t *grp_lock);
+
+
+/**
+ * Dump group lock info for debugging purpose. If group lock debugging is
+ * enabled (via PJ_GRP_LOCK_DEBUG) macro, this will print the group lock
+ * reference counter value along with the source file and line. If
+ * debugging is disabled, this will only print the reference counter.
+ *
+ * @param grp_lock The group lock.
+ */
+PJ_DECL(void) pj_grp_lock_dump(pj_grp_lock_t *grp_lock);
+
+
+/**
+ * Synchronize an external lock with the group lock, by adding it to the
+ * list of locks to be acquired by the group lock when the group lock is
+ * acquired.
+ *
+ * The ''pos'' argument specifies the lock order and also the relative
+ * position with regard to lock ordering against the group lock. Locks with
+ * lower ''pos'' value will be locked first, and those with negative value
+ * will be locked before the group lock (the group lock's ''pos'' value is
+ * zero).
+ *
+ * @param grp_lock The group lock.
+ * @param ext_lock The external lock
+ * @param pos The position.
+ *
+ * @return PJ_SUCCESS or the appropriate error code.
+ */
+PJ_DECL(pj_status_t) pj_grp_lock_chain_lock(pj_grp_lock_t *grp_lock,
+ pj_lock_t *ext_lock,
+ int pos);
+