diff --git a/sflphone-common/globals.mak b/sflphone-common/globals.mak index bcbb63eb257e6d4e7aaac61e40ba22f8639f5592..23f700e61f5cad26b71d0550c4a5ce63c3955780 100644 --- a/sflphone-common/globals.mak +++ b/sflphone-common/globals.mak @@ -14,15 +14,15 @@ PJSIP_LIBS= \ -L$(src)/libs/pjproject/pjlib/lib/ \ -L$(src)/libs/pjproject/pjlib-util/lib/ \ -L$(src)/libs/pjproject/pjmedia/lib/ \ - -lpjnath-sfl-$(target) \ - -lpjsua-sfl-$(target) \ - -lpjsip-sfl-$(target) \ - -lpjmedia-sfl-$(target) \ - -lpjsip-simple-sfl-$(target) \ - -lpjsip-ua-sfl-$(target) \ - -lpjmedia-codec-sfl-$(target) \ - -lpjlib-util-sfl-$(target) \ - -lpj-sfl-$(target) + -lpjnath-$(target) \ + -lpjsua-$(target) \ + -lpjsip-$(target) \ + -lpjmedia-$(target) \ + -lpjsip-simple-$(target) \ + -lpjsip-ua-$(target) \ + -lpjmedia-codec-$(target) \ + -lpjlib-util-$(target) \ + -lpj-$(target) SIP_CFLAGS=-I$(src)/libs/pjproject/pjsip/include \ -I$(src)/libs/pjproject/pjlib/include \ diff --git a/sflphone-common/libs/pjproject/Makefile b/sflphone-common/libs/pjproject/Makefile index 50f4da18e7c2c60459b47fe896bee13899388915..f8ed4b0de0d58def49de07bf0983cd19787e6fd3 100644 --- a/sflphone-common/libs/pjproject/Makefile +++ b/sflphone-common/libs/pjproject/Makefile @@ -29,17 +29,17 @@ doc: fi; \ done -LIBS = pjlib/lib/libpj-sfl-$(TARGET_NAME).a \ - pjlib-util/lib/libpjlib-util-sfl-$(TARGET_NAME).a \ - pjnath/lib/libpjnath-sfl-$(TARGET_NAME).a \ - pjmedia/lib/libpjmedia-sfl-$(TARGET_NAME).a \ - pjmedia/lib/libpjmedia-audiodev-sfl-$(TARGET_NAME).a \ - pjmedia/lib/libpjmedia-codec-sfl-$(TARGET_NAME).a \ - pjsip/lib/libpjsip-sfl-$(TARGET_NAME).a \ - pjsip/lib/libpjsip-ua-sfl-$(TARGET_NAME).a \ - pjsip/lib/libpjsip-simple-sfl-$(TARGET_NAME).a \ - pjsip/lib/libpjsua-sfl-$(TARGET_NAME).a -BINS = pjsip-apps/bin/pjsua-sfl-$(TARGET_NAME)$(HOST_EXE) +LIBS = pjlib/lib/libpj-$(TARGET_NAME).a \ + pjlib-util/lib/libpjlib-util-$(TARGET_NAME).a \ + pjnath/lib/libpjnath-$(TARGET_NAME).a \ + pjmedia/lib/libpjmedia-$(TARGET_NAME).a \ + pjmedia/lib/libpjmedia-audiodev-$(TARGET_NAME).a \ + pjmedia/lib/libpjmedia-codec-$(TARGET_NAME).a \ + pjsip/lib/libpjsip-$(TARGET_NAME).a \ + pjsip/lib/libpjsip-ua-$(TARGET_NAME).a \ + pjsip/lib/libpjsip-simple-$(TARGET_NAME).a \ + pjsip/lib/libpjsua-$(TARGET_NAME).a +BINS = pjsip-apps/bin/pjsua-$(TARGET_NAME)$(HOST_EXE) size: @echo -n 'Date: ' @@ -70,6 +70,27 @@ xhdrid: cp /tmp/id $$f; \ done +selftest: pjlib-test pjlib-util-test pjnath-test pjmedia-test pjsip-test pjsua-test + +pjlib-test: pjlib/bin/pjlib-test-$(TARGET_NAME) + cd pjlib/build && ../bin/pjlib-test-$(TARGET_NAME) + +pjlib-util-test: pjlib-util/bin/pjlib-util-test-$(TARGET_NAME) + cd pjlib-util/build && ../bin/pjlib-util-test-$(TARGET_NAME) + +pjnath-test: pjnath/bin/pjnath-test-$(TARGET_NAME) + cd pjnath/build && ../bin/pjnath-test-$(TARGET_NAME) + +pjmedia-test: pjmedia/bin/pjmedia-test-$(TARGET_NAME) + cd pjmedia/build && ../bin/pjmedia-test-$(TARGET_NAME) + +pjsip-test: pjsip/bin/pjsip-test-$(TARGET_NAME) + cd pjsip/build && ../bin/pjsip-test-$(TARGET_NAME) + +pjsua-test: + cd tests/pjsua && python runall.py + +prefix = /usr/local install: mkdir -p $(DESTDIR)$(prefix)/lib cp -L $$(find . -name '*.a') $(DESTDIR)$(prefix)/lib @@ -79,4 +100,4 @@ install: ln -s $$i $$(echo $$i | sed -e "s/-$(TARGET_NAME)//");\ done mkdir -p $(DESTDIR)$(prefix)/lib/pkgconfig - sed -e "s!@PREFIX@!$(DESTDIR)$(prefix)!" libpj-sfl.pc.in > $(DESTDIR)/$(prefix)/lib/pkgconfig/libpj-sfl.pc + sed -e "s!@PREFIX@!$(DESTDIR)$(prefix)!" libpj.pc.in > $(DESTDIR)/$(prefix)/lib/pkgconfig/libpj.pc diff --git a/sflphone-common/libs/pjproject/aconfigure b/sflphone-common/libs/pjproject/aconfigure index 67e64d34bf2202ff74f386fc56484c071051ccf2..3ae02b02d2c4f274bd9eb5bf772c34dc5b0f5be8 100755 --- a/sflphone-common/libs/pjproject/aconfigure +++ b/sflphone-common/libs/pjproject/aconfigure @@ -1,81 +1,60 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.64 for pjproject 1.0. +# Generated by GNU Autoconf 2.61 for pjproject 1.0. # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, -# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software -# Foundation, Inc. -# +# 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. -## -------------------- ## -## M4sh Initialization. ## -## -------------------- ## +## --------------------- ## +## M4sh Initialization. ## +## --------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: - # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else - case `(set -o) 2>/dev/null` in #( - *posix*) : - set -o posix ;; #( - *) : - ;; + case `(set -o) 2>/dev/null` in + *posix*) set -o posix ;; esac + fi -as_nl=' -' -export as_nl -# Printing a long string crashes Solaris 7 /usr/bin/printf. -as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' -as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo -as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo -# Prefer a ksh shell builtin over an external printf program on Solaris, -# but without wasting forks for bash or zsh. -if test -z "$BASH_VERSION$ZSH_VERSION" \ - && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then - as_echo='print -r --' - as_echo_n='print -rn --' -elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then - as_echo='printf %s\n' - as_echo_n='printf %s' -else - if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then - as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' - as_echo_n='/usr/ucb/echo -n' + + +# PATH needs CR +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + echo "#! /bin/sh" >conf$$.sh + echo "exit 0" >>conf$$.sh + chmod +x conf$$.sh + if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then + PATH_SEPARATOR=';' else - as_echo_body='eval expr "X$1" : "X\\(.*\\)"' - as_echo_n_body='eval - arg=$1; - case $arg in #( - *"$as_nl"*) - expr "X$arg" : "X\\(.*\\)$as_nl"; - arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; - esac; - expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" - ' - export as_echo_n_body - as_echo_n='sh -c $as_echo_n_body as_echo' + PATH_SEPARATOR=: fi - export as_echo_body - as_echo='sh -c $as_echo_body as_echo' + rm -f conf$$.sh fi -# The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then - PATH_SEPARATOR=: - (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { - (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || - PATH_SEPARATOR=';' - } +# Support unset when possible. +if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then + as_unset=unset +else + as_unset=false fi @@ -84,18 +63,20 @@ fi # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) +as_nl=' +' IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. -case $0 in #(( +case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break - done + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break +done IFS=$as_save_IFS ;; @@ -106,321 +87,354 @@ if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then - $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 - exit 1 + echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + { (exit 1); exit 1; } fi -# Unset variables that we do not need and which cause bugs (e.g. in -# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" -# suppresses any "Segmentation fault" message there. '((' could -# trigger a bug in pdksh 5.2.14. -for as_var in BASH_ENV ENV MAIL MAILPATH -do eval test x\${$as_var+set} = xset \ - && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +# Work around bugs in pre-3.0 UWIN ksh. +for as_var in ENV MAIL MAILPATH +do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. -LC_ALL=C -export LC_ALL -LANGUAGE=C -export LANGUAGE +for as_var in \ + LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ + LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ + LC_TELEPHONE LC_TIME +do + if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then + eval $as_var=C; export $as_var + else + ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var + fi +done + +# Required to use basename. +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + + +# Name of the executable. +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` # CDPATH. -(unset CDPATH) >/dev/null 2>&1 && unset CDPATH +$as_unset CDPATH + if test "x$CONFIG_SHELL" = x; then - as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : - emulate sh - NULLCMD=: - # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which - # is contrary to our usage. Disable this feature. - alias -g '\${1+\"\$@\"}'='\"\$@\"' - setopt NO_GLOB_SUBST + if (eval ":") 2>/dev/null; then + as_have_required=yes else - case \`(set -o) 2>/dev/null\` in #( - *posix*) : - set -o posix ;; #( - *) : - ;; -esac + as_have_required=no fi -" - as_required="as_fn_return () { (exit \$1); } -as_fn_success () { as_fn_return 0; } -as_fn_failure () { as_fn_return 1; } -as_fn_ret_success () { return 0; } -as_fn_ret_failure () { return 1; } + + if test $as_have_required = yes && (eval ": +(as_func_return () { + (exit \$1) +} +as_func_success () { + as_func_return 0 +} +as_func_failure () { + as_func_return 1 +} +as_func_ret_success () { + return 0 +} +as_func_ret_failure () { + return 1 +} exitcode=0 -as_fn_success || { exitcode=1; echo as_fn_success failed.; } -as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } -as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } -as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } -if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : - -else - exitcode=1; echo positional parameters were not saved. -fi -test x\$exitcode = x0 || exit 1" - as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO - as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO - eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && - test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 -test \$(( 1 + 1 )) = 2 || exit 1" - if (eval "$as_required") 2>/dev/null; then : - as_have_required=yes +if as_func_success; then + : else - as_have_required=no + exitcode=1 + echo as_func_success failed. fi - if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : +if as_func_failure; then + exitcode=1 + echo as_func_failure succeeded. +fi + +if as_func_ret_success; then + : +else + exitcode=1 + echo as_func_ret_success failed. +fi + +if as_func_ret_failure; then + exitcode=1 + echo as_func_ret_failure succeeded. +fi + +if ( set x; as_func_ret_success y && test x = \"\$1\" ); then + : +else + exitcode=1 + echo positional parameters were not saved. +fi + +test \$exitcode = 0) || { (exit 1); exit 1; } + +( + as_lineno_1=\$LINENO + as_lineno_2=\$LINENO + test \"x\$as_lineno_1\" != \"x\$as_lineno_2\" && + test \"x\`expr \$as_lineno_1 + 1\`\" = \"x\$as_lineno_2\") || { (exit 1); exit 1; } +") 2> /dev/null; then + : else - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -as_found=false + as_candidate_shells= + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - as_found=: - case $as_dir in #( + case $as_dir in /*) for as_base in sh bash ksh sh5; do - # Try only shells that exist, to save several forks. - as_shell=$as_dir/$as_base - if { test -f "$as_shell" || test -f "$as_shell.exe"; } && - { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : - CONFIG_SHELL=$as_shell as_have_required=yes - if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : - break 2 -fi -fi + as_candidate_shells="$as_candidate_shells $as_dir/$as_base" done;; esac - as_found=false done -$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && - { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : - CONFIG_SHELL=$SHELL as_have_required=yes -fi; } IFS=$as_save_IFS - if test "x$CONFIG_SHELL" != x; then : - # We cannot yet assume a decent shell, so we have to provide a - # neutralization value for shells without unset; and this also - # works around shells that cannot unset nonexistent variables. - BASH_ENV=/dev/null - ENV=/dev/null - (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV - export CONFIG_SHELL - exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} -fi + for as_shell in $as_candidate_shells $SHELL; do + # Try only shells that exist, to save several forks. + if { test -f "$as_shell" || test -f "$as_shell.exe"; } && + { ("$as_shell") 2> /dev/null <<\_ASEOF +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in + *posix*) set -o posix ;; +esac - if test x$as_have_required = xno; then : - $as_echo "$0: This script requires a shell more modern than all" - $as_echo "$0: the shells that I found on your system." - if test x${ZSH_VERSION+set} = xset ; then - $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" - $as_echo "$0: be upgraded to zsh 4.3.4 or later." - else - $as_echo "$0: Please tell bug-autoconf@gnu.org about your system, -$0: including any error possibly output before this -$0: message. Then install a modern shell, or manually run -$0: the script under such a shell if you do have one." - fi - exit 1 -fi fi + + +: +_ASEOF +}; then + CONFIG_SHELL=$as_shell + as_have_required=yes + if { "$as_shell" 2> /dev/null <<\_ASEOF +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in + *posix*) set -o posix ;; +esac + fi -SHELL=${CONFIG_SHELL-/bin/sh} -export SHELL -# Unset more variables known to interfere with behavior of common tools. -CLICOLOR_FORCE= GREP_OPTIONS= -unset CLICOLOR_FORCE GREP_OPTIONS -## --------------------- ## -## M4sh Shell Functions. ## -## --------------------- ## -# as_fn_unset VAR -# --------------- -# Portably unset VAR. -as_fn_unset () -{ - { eval $1=; unset $1;} + +: +(as_func_return () { + (exit $1) +} +as_func_success () { + as_func_return 0 +} +as_func_failure () { + as_func_return 1 +} +as_func_ret_success () { + return 0 +} +as_func_ret_failure () { + return 1 } -as_unset=as_fn_unset -# as_fn_set_status STATUS -# ----------------------- -# Set $? to STATUS, without forking. -as_fn_set_status () -{ - return $1 -} # as_fn_set_status +exitcode=0 +if as_func_success; then + : +else + exitcode=1 + echo as_func_success failed. +fi -# as_fn_exit STATUS -# ----------------- -# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. -as_fn_exit () -{ - set +e - as_fn_set_status $1 - exit $1 -} # as_fn_exit - -# as_fn_mkdir_p -# ------------- -# Create "$as_dir" as a directory, including parents if necessary. -as_fn_mkdir_p () -{ +if as_func_failure; then + exitcode=1 + echo as_func_failure succeeded. +fi - case $as_dir in #( - -*) as_dir=./$as_dir;; - esac - test -d "$as_dir" || eval $as_mkdir_p || { - as_dirs= - while :; do - case $as_dir in #( - *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( - *) as_qdir=$as_dir;; - esac - as_dirs="'$as_qdir' $as_dirs" - as_dir=`$as_dirname -- "$as_dir" || -$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$as_dir" : 'X\(//\)[^/]' \| \ - X"$as_dir" : 'X\(//\)$' \| \ - X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$as_dir" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - test -d "$as_dir" && break - done - test -z "$as_dirs" || eval "mkdir $as_dirs" - } || test -d "$as_dir" || as_fn_error "cannot create directory $as_dir" - - -} # as_fn_mkdir_p -# as_fn_append VAR VALUE -# ---------------------- -# Append the text in VALUE to the end of the definition contained in VAR. Take -# advantage of any shell optimizations that allow amortized linear growth over -# repeated appends, instead of the typical quadratic growth present in naive -# implementations. -if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : - eval 'as_fn_append () - { - eval $1+=\$2 - }' +if as_func_ret_success; then + : else - as_fn_append () - { - eval $1=\$$1\$2 - } -fi # as_fn_append - -# as_fn_arith ARG... -# ------------------ -# Perform arithmetic evaluation on the ARGs, and store the result in the -# global $as_val. Take advantage of shells that can avoid forks. The arguments -# must be portable across $(()) and expr. -if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : - eval 'as_fn_arith () - { - as_val=$(( $* )) - }' + exitcode=1 + echo as_func_ret_success failed. +fi + +if as_func_ret_failure; then + exitcode=1 + echo as_func_ret_failure succeeded. +fi + +if ( set x; as_func_ret_success y && test x = "$1" ); then + : else - as_fn_arith () - { - as_val=`expr "$@" || test $? -eq 1` - } -fi # as_fn_arith + exitcode=1 + echo positional parameters were not saved. +fi +test $exitcode = 0) || { (exit 1); exit 1; } -# as_fn_error ERROR [LINENO LOG_FD] -# --------------------------------- -# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are -# provided, also output the error to LOG_FD, referencing LINENO. Then exit the -# script with status $?, using 1 if that was 0. -as_fn_error () -{ - as_status=$?; test $as_status -eq 0 && as_status=1 - if test "$3"; then - as_lineno=${as_lineno-"$2"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - $as_echo "$as_me:${as_lineno-$LINENO}: error: $1" >&$3 - fi - $as_echo "$as_me: error: $1" >&2 - as_fn_exit $as_status -} # as_fn_error +( + as_lineno_1=$LINENO + as_lineno_2=$LINENO + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2") || { (exit 1); exit 1; } -if expr a : '\(a\)' >/dev/null 2>&1 && - test "X`expr 00001 : '.*\(...\)'`" = X001; then - as_expr=expr +_ASEOF +}; then + break +fi + +fi + + done + + if test "x$CONFIG_SHELL" != x; then + for as_var in BASH_ENV ENV + do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var + done + export CONFIG_SHELL + exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} +fi + + + if test $as_have_required = no; then + echo This script requires a shell more modern than all the + echo shells that I found on your system. Please install a + echo modern shell, or manually run the script under such a + echo shell if you do have one. + { (exit 1); exit 1; } +fi + + +fi + +fi + + + +(eval "as_func_return () { + (exit \$1) +} +as_func_success () { + as_func_return 0 +} +as_func_failure () { + as_func_return 1 +} +as_func_ret_success () { + return 0 +} +as_func_ret_failure () { + return 1 +} + +exitcode=0 +if as_func_success; then + : else - as_expr=false + exitcode=1 + echo as_func_success failed. fi -if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then - as_basename=basename +if as_func_failure; then + exitcode=1 + echo as_func_failure succeeded. +fi + +if as_func_ret_success; then + : else - as_basename=false + exitcode=1 + echo as_func_ret_success failed. fi -if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then - as_dirname=dirname +if as_func_ret_failure; then + exitcode=1 + echo as_func_ret_failure succeeded. +fi + +if ( set x; as_func_ret_success y && test x = \"\$1\" ); then + : else - as_dirname=false + exitcode=1 + echo positional parameters were not saved. fi -as_me=`$as_basename -- "$0" || -$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ - X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X/"$0" | - sed '/^.*\/\([^/][^/]*\)\/*$/{ - s//\1/ - q - } - /^X\/\(\/\/\)$/{ - s//\1/ - q - } - /^X\/\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` +test \$exitcode = 0") || { + echo No shell found that supports shell functions. + echo Please tell autoconf@gnu.org about your system, + echo including any error possibly output before this + echo message +} -# Avoid depending upon Character Ranges. -as_cr_letters='abcdefghijklmnopqrstuvwxyz' -as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' -as_cr_Letters=$as_cr_letters$as_cr_LETTERS -as_cr_digits='0123456789' -as_cr_alnum=$as_cr_Letters$as_cr_digits - as_lineno_1=$LINENO as_lineno_1a=$LINENO - as_lineno_2=$LINENO as_lineno_2a=$LINENO - eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && - test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { - # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) + as_lineno_1=$LINENO + as_lineno_2=$LINENO + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { + + # Create $as_me.lineno as a copy of $as_myself, but with $LINENO + # uniformly replaced by the line number. The first 'sed' inserts a + # line-number line after each line using $LINENO; the second 'sed' + # does the real work. The second script uses 'N' to pair each + # line-number line with the line containing $LINENO, and appends + # trailing '-' during substitution so that $LINENO is not a special + # case at line end. + # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the + # scripts with optimization help from Paolo Bonzini. Blame Lee + # E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= @@ -437,7 +451,8 @@ as_cr_alnum=$as_cr_Letters$as_cr_digits s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || - { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } + { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 + { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the @@ -447,40 +462,49 @@ as_cr_alnum=$as_cr_Letters$as_cr_digits exit } -ECHO_C= ECHO_N= ECHO_T= -case `echo -n x` in #((((( --n*) - case `echo 'xy\c'` in - *c*) ECHO_T=' ';; # ECHO_T is single tab character. - xy) ECHO_C='\c';; - *) echo `echo ksh88 bug on AIX 6.1` > /dev/null - ECHO_T=' ';; + +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in +-n*) + case `echo 'x\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + *) ECHO_C='\c';; esac;; *) ECHO_N='-n';; esac +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir - mkdir conf$$.dir 2>/dev/null -fi -if (echo >conf$$.file) 2>/dev/null; then - if ln -s conf$$.file conf$$ 2>/dev/null; then - as_ln_s='ln -s' - # ... but there are two gotchas: - # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. - # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. - # In both cases, we have to default to `cp -p'. - ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || - as_ln_s='cp -p' - elif ln conf$$.file conf$$ 2>/dev/null; then - as_ln_s=ln - else + mkdir conf$$.dir +fi +echo >conf$$.file +if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -p'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' - fi +elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln else as_ln_s='cp -p' fi @@ -488,7 +512,7 @@ rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then - as_mkdir_p='mkdir -p "$as_dir"' + as_mkdir_p=: else test -d ./-p && rmdir ./-p as_mkdir_p=false @@ -505,12 +529,12 @@ else as_test_x=' eval sh -c '\'' if test -d "$1"; then - test -d "$1/."; + test -d "$1/."; else - case $1 in #( - -*)set "./$1";; + case $1 in + -*)set "./$1";; esac; - case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #(( + case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in ???[sx]*):;;*)false;;esac;fi '\'' sh ' @@ -524,6 +548,7 @@ as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + exec 7<&0 </dev/null 6>&1 # Name of the host. @@ -542,6 +567,7 @@ cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= +SHELL=${CONFIG_SHELL-/bin/sh} # Identity of this package. PACKAGE_NAME='pjproject' @@ -549,7 +575,6 @@ PACKAGE_TARNAME='pjproject' PACKAGE_VERSION='1.0' PACKAGE_STRING='pjproject 1.0' PACKAGE_BUGREPORT='' -PACKAGE_URL='' # Factoring default headers for most tests. ac_includes_default="\ @@ -587,119 +612,96 @@ ac_includes_default="\ # include <unistd.h> #endif" -ac_subst_vars='LTLIBOBJS -LIBOBJS -ac_main_obj -ac_host -ac_linux_poll -ac_cross_compile -libcrypto_present -libssl_present -openssl_h_present -ac_no_ssl -ac_no_ilbc_codec -ac_no_speex_codec -ac_no_g7221_codec -ac_no_g722_codec -ac_no_gsm_codec -ac_no_l16_codec -ac_no_g711_codec -ac_no_speex_aec -ac_no_large_filter -ac_no_small_filter -ac_pa_use_oss -ac_pa_use_alsa -ac_pa_cflags -ac_pjmedia_snd -ac_os_objs -EGREP -GREP -CPP -ac_build_mak_vars -ac_pjdir -ac_ct_CXX -CXXFLAGS -CXX -OBJEXT -EXEEXT -ac_ct_CC -CPPFLAGS -LDFLAGS -CFLAGS -CC -target_os -target_vendor -target_cpu -target -host_os -host_vendor -host_cpu -host -build_os -build_vendor -build_cpu -build -target_alias -host_alias -build_alias -LIBS -ECHO_T -ECHO_N -ECHO_C -DEFS -mandir -localedir -libdir -psdir -pdfdir -dvidir -htmldir -infodir -docdir -oldincludedir -includedir -localstatedir -sharedstatedir -sysconfdir -datadir -datarootdir -libexecdir -sbindir -bindir -program_transform_name -prefix -exec_prefix -PACKAGE_URL -PACKAGE_BUGREPORT -PACKAGE_STRING -PACKAGE_VERSION -PACKAGE_TARNAME -PACKAGE_NAME +ac_subst_vars='SHELL PATH_SEPARATOR -SHELL' +PACKAGE_NAME +PACKAGE_TARNAME +PACKAGE_VERSION +PACKAGE_STRING +PACKAGE_BUGREPORT +exec_prefix +prefix +program_transform_name +bindir +sbindir +libexecdir +datarootdir +datadir +sysconfdir +sharedstatedir +localstatedir +includedir +oldincludedir +docdir +infodir +htmldir +dvidir +pdfdir +psdir +libdir +localedir +mandir +DEFS +ECHO_C +ECHO_N +ECHO_T +LIBS +build_alias +host_alias +target_alias +build +build_cpu +build_vendor +build_os +host +host_cpu +host_vendor +host_os +target +target_cpu +target_vendor +target_os +CC +CFLAGS +LDFLAGS +CPPFLAGS +ac_ct_CC +EXEEXT +OBJEXT +CXX +CXXFLAGS +ac_ct_CXX +ac_pjdir +ac_build_mak_vars +CPP +GREP +EGREP +ac_os_objs +ac_pjmedia_snd +ac_pa_cflags +ac_pa_use_alsa +ac_pa_use_oss +ac_no_small_filter +ac_no_large_filter +ac_no_speex_aec +ac_no_g711_codec +ac_no_l16_codec +ac_no_gsm_codec +ac_no_g722_codec +ac_no_g7221_codec +ac_no_speex_codec +ac_no_ilbc_codec +ac_no_ssl +openssl_h_present +libssl_present +libcrypto_present +ac_cross_compile +ac_linux_poll +ac_host +ac_main_obj +LIBOBJS +LTLIBOBJS' ac_subst_files='' -ac_user_opts=' -enable_option_checking -enable_floating_point -enable_epoll -enable_sound -enable_oss -enable_ext_sound -enable_small_filter -enable_large_filter -enable_speex_aec -enable_g711_codec -enable_l16_codec -enable_gsm_codec -enable_g722_codec -enable_g7221_codec -enable_speex_codec -enable_ilbc_codec -enable_libsamplerate -enable_ipp -enable_ipp_samples -enable_ssl -' ac_precious_vars='build_alias host_alias target_alias @@ -717,8 +719,6 @@ CPP' # Initialize some variables set by options. ac_init_help= ac_init_version=false -ac_unrecognized_opts= -ac_unrecognized_sep= # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null @@ -817,20 +817,13 @@ do datarootdir=$ac_optarg ;; -disable-* | --disable-*) - ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` + ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. - expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error "invalid feature name: $ac_useropt" - ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` - case $ac_user_opts in - *" -"enable_$ac_useropt" -"*) ;; - *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" - ac_unrecognized_sep=', ';; - esac - eval enable_$ac_useropt=no ;; + expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid feature name: $ac_feature" >&2 + { (exit 1); exit 1; }; } + ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'` + eval enable_$ac_feature=no ;; -docdir | --docdir | --docdi | --doc | --do) ac_prev=docdir ;; @@ -843,20 +836,13 @@ do dvidir=$ac_optarg ;; -enable-* | --enable-*) - ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` + ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. - expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error "invalid feature name: $ac_useropt" - ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` - case $ac_user_opts in - *" -"enable_$ac_useropt" -"*) ;; - *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" - ac_unrecognized_sep=', ';; - esac - eval enable_$ac_useropt=\$ac_optarg ;; + expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid feature name: $ac_feature" >&2 + { (exit 1); exit 1; }; } + ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'` + eval enable_$ac_feature=\$ac_optarg ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ @@ -1047,36 +1033,22 @@ do ac_init_version=: ;; -with-* | --with-*) - ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` + ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. - expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error "invalid package name: $ac_useropt" - ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` - case $ac_user_opts in - *" -"with_$ac_useropt" -"*) ;; - *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" - ac_unrecognized_sep=', ';; - esac - eval with_$ac_useropt=\$ac_optarg ;; + expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid package name: $ac_package" >&2 + { (exit 1); exit 1; }; } + ac_package=`echo $ac_package | sed 's/[-.]/_/g'` + eval with_$ac_package=\$ac_optarg ;; -without-* | --without-*) - ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` + ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. - expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error "invalid package name: $ac_useropt" - ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` - case $ac_user_opts in - *" -"with_$ac_useropt" -"*) ;; - *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" - ac_unrecognized_sep=', ';; - esac - eval with_$ac_useropt=no ;; + expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid package name: $ac_package" >&2 + { (exit 1); exit 1; }; } + ac_package=`echo $ac_package | sed 's/[-.]/_/g'` + eval with_$ac_package=no ;; --x) # Obsolete; use --with-x. @@ -1096,25 +1068,25 @@ do | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; - -*) as_fn_error "unrecognized option: \`$ac_option' -Try \`$0 --help' for more information." + -*) { echo "$as_me: error: unrecognized option: $ac_option +Try \`$0 --help' for more information." >&2 + { (exit 1); exit 1; }; } ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. - case $ac_envvar in #( - '' | [0-9]* | *[!_$as_cr_alnum]* ) - as_fn_error "invalid variable name: \`$ac_envvar'" ;; - esac + expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 + { (exit 1); exit 1; }; } eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. - $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 + echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && - $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 + echo "$as_me: WARNING: invalid host type: $ac_option" >&2 : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} ;; @@ -1123,36 +1095,23 @@ done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` - as_fn_error "missing argument to $ac_option" -fi - -if test -n "$ac_unrecognized_opts"; then - case $enable_option_checking in - no) ;; - fatal) as_fn_error "unrecognized options: $ac_unrecognized_opts" ;; - *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; - esac + { echo "$as_me: error: missing argument to $ac_option" >&2 + { (exit 1); exit 1; }; } fi -# Check all directory arguments for consistency. +# Be sure to have absolute directory names. for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ libdir localedir mandir do eval ac_val=\$$ac_var - # Remove trailing slashes. - case $ac_val in - */ ) - ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` - eval $ac_var=\$ac_val;; - esac - # Be sure to have absolute directory names. case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac - as_fn_error "expected an absolute directory name for --$ac_var: $ac_val" + { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 + { (exit 1); exit 1; }; } done # There might be people who depend on the old broken behavior: `$host' @@ -1166,7 +1125,7 @@ target=$target_alias if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe - $as_echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. + echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. If a cross compiler is detected then cross compile mode will be used." >&2 elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes @@ -1182,21 +1141,23 @@ test "$silent" = yes && exec 6>/dev/null ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || - as_fn_error "working directory cannot be determined" + { echo "$as_me: error: Working directory cannot be determined" >&2 + { (exit 1); exit 1; }; } test "X$ac_ls_di" = "X$ac_pwd_ls_di" || - as_fn_error "pwd does not report name of working directory" + { echo "$as_me: error: pwd does not report name of working directory" >&2 + { (exit 1); exit 1; }; } # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then the parent directory. - ac_confdir=`$as_dirname -- "$as_myself" || -$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$as_myself" : 'X\(//\)[^/]' \| \ - X"$as_myself" : 'X\(//\)$' \| \ - X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$as_myself" | + ac_confdir=`$as_dirname -- "$0" || +$as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$0" : 'X\(//\)[^/]' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +echo X"$0" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q @@ -1223,11 +1184,13 @@ else fi if test ! -r "$srcdir/$ac_unique_file"; then test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." - as_fn_error "cannot find sources ($ac_unique_file) in $srcdir" + { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 + { (exit 1); exit 1; }; } fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( - cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error "$ac_msg" + cd "$srcdir" && test -r "./$ac_unique_file" || { echo "$as_me: error: $ac_msg" >&2 + { (exit 1); exit 1; }; } pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then @@ -1275,9 +1238,9 @@ Configuration: Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX - [$ac_default_prefix] + [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX - [PREFIX] + [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify @@ -1287,25 +1250,25 @@ for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: - --bindir=DIR user executables [EPREFIX/bin] - --sbindir=DIR system admin executables [EPREFIX/sbin] - --libexecdir=DIR program executables [EPREFIX/libexec] - --sysconfdir=DIR read-only single-machine data [PREFIX/etc] - --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] - --localstatedir=DIR modifiable single-machine data [PREFIX/var] - --libdir=DIR object code libraries [EPREFIX/lib] - --includedir=DIR C header files [PREFIX/include] - --oldincludedir=DIR C header files for non-gcc [/usr/include] - --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] - --datadir=DIR read-only architecture-independent data [DATAROOTDIR] - --infodir=DIR info documentation [DATAROOTDIR/info] - --localedir=DIR locale-dependent data [DATAROOTDIR/locale] - --mandir=DIR man documentation [DATAROOTDIR/man] - --docdir=DIR documentation root [DATAROOTDIR/doc/pjproject] - --htmldir=DIR html documentation [DOCDIR] - --dvidir=DIR dvi documentation [DOCDIR] - --pdfdir=DIR pdf documentation [DOCDIR] - --psdir=DIR ps documentation [DOCDIR] + --bindir=DIR user executables [EPREFIX/bin] + --sbindir=DIR system admin executables [EPREFIX/sbin] + --libexecdir=DIR program executables [EPREFIX/libexec] + --sysconfdir=DIR read-only single-machine data [PREFIX/etc] + --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] + --localstatedir=DIR modifiable single-machine data [PREFIX/var] + --libdir=DIR object code libraries [EPREFIX/lib] + --includedir=DIR C header files [PREFIX/include] + --oldincludedir=DIR C header files for non-gcc [/usr/include] + --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] + --datadir=DIR read-only architecture-independent data [DATAROOTDIR] + --infodir=DIR info documentation [DATAROOTDIR/info] + --localedir=DIR locale-dependent data [DATAROOTDIR/locale] + --mandir=DIR man documentation [DATAROOTDIR/man] + --docdir=DIR documentation root [DATAROOTDIR/doc/pjproject] + --htmldir=DIR html documentation [DOCDIR] + --dvidir=DIR dvi documentation [DOCDIR] + --pdfdir=DIR pdf documentation [DOCDIR] + --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF @@ -1324,7 +1287,6 @@ if test -n "$ac_init_help"; then cat <<\_ACEOF Optional Features: - --disable-option-checking ignore unrecognized --enable/--with options --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --disable-floating-point @@ -1370,7 +1332,6 @@ Some influential environment variables: Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. -Report bugs to the package provider. _ACEOF ac_status=$? fi @@ -1378,17 +1339,15 @@ fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue - test -d "$ac_dir" || - { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || - continue + test -d "$ac_dir" || continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) - ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A ".." for each directory in $ac_dir_suffix. - ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; @@ -1424,7 +1383,7 @@ ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix echo && $SHELL "$ac_srcdir/configure" --help=recursive else - $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 + echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done @@ -1434,362 +1393,40 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF pjproject configure 1.0 -generated by GNU Autoconf 2.64 +generated by GNU Autoconf 2.61 -Copyright (C) 2009 Free Software Foundation, Inc. +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, +2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF exit fi +cat >config.log <<_ACEOF +This file contains any messages produced by compilers while +running configure, to aid debugging if configure makes a mistake. -## ------------------------ ## -## Autoconf initialization. ## -## ------------------------ ## - -# ac_fn_c_try_compile LINENO -# -------------------------- -# Try to compile conftest.$ac_ext, and return whether this succeeded. -ac_fn_c_try_compile () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - rm -f conftest.$ac_objext - if { { ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_compile") 2>conftest.err - ac_status=$? - if test -s conftest.err; then - grep -v '^ *+' conftest.err >conftest.er1 - cat conftest.er1 >&5 - mv -f conftest.er1 conftest.err - fi - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then : - ac_retval=0 -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_retval=1 -fi - eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} - return $ac_retval +It was created by pjproject $as_me 1.0, which was +generated by GNU Autoconf 2.61. Invocation command line was -} # ac_fn_c_try_compile + $ $0 $@ -# ac_fn_cxx_try_compile LINENO -# ---------------------------- -# Try to compile conftest.$ac_ext, and return whether this succeeded. -ac_fn_cxx_try_compile () +_ACEOF +exec 5>>config.log { - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - rm -f conftest.$ac_objext - if { { ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_compile") 2>conftest.err - ac_status=$? - if test -s conftest.err; then - grep -v '^ *+' conftest.err >conftest.er1 - cat conftest.er1 >&5 - mv -f conftest.er1 conftest.err - fi - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && { - test -z "$ac_cxx_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then : - ac_retval=0 -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 +cat <<_ASUNAME +## --------- ## +## Platform. ## +## --------- ## - ac_retval=1 -fi - eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} - return $ac_retval +hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` +uname -m = `(uname -m) 2>/dev/null || echo unknown` +uname -r = `(uname -r) 2>/dev/null || echo unknown` +uname -s = `(uname -s) 2>/dev/null || echo unknown` +uname -v = `(uname -v) 2>/dev/null || echo unknown` -} # ac_fn_cxx_try_compile - -# ac_fn_c_try_link LINENO -# ----------------------- -# Try to link conftest.$ac_ext, and return whether this succeeded. -ac_fn_c_try_link () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - rm -f conftest.$ac_objext conftest$ac_exeext - if { { ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_link") 2>conftest.err - ac_status=$? - if test -s conftest.err; then - grep -v '^ *+' conftest.err >conftest.er1 - cat conftest.er1 >&5 - mv -f conftest.er1 conftest.err - fi - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then : - ac_retval=0 -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_retval=1 -fi - # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information - # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would - # interfere with the next link command; also delete a directory that is - # left behind by Apple's compiler. We do this before executing the actions. - rm -rf conftest.dSYM conftest_ipa8_conftest.oo - eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} - return $ac_retval - -} # ac_fn_c_try_link - -# ac_fn_c_try_run LINENO -# ---------------------- -# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes -# that executables *can* be run. -ac_fn_c_try_run () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - if { { ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' - { { case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; }; then : - ac_retval=0 -else - $as_echo "$as_me: program exited with status $ac_status" >&5 - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_retval=$ac_status -fi - rm -rf conftest.dSYM conftest_ipa8_conftest.oo - eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} - return $ac_retval - -} # ac_fn_c_try_run - -# ac_fn_c_try_cpp LINENO -# ---------------------- -# Try to preprocess conftest.$ac_ext, and return whether this succeeded. -ac_fn_c_try_cpp () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - if { { ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err - ac_status=$? - if test -s conftest.err; then - grep -v '^ *+' conftest.err >conftest.er1 - cat conftest.er1 >&5 - mv -f conftest.er1 conftest.err - fi - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then : - ac_retval=0 -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_retval=1 -fi - eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} - return $ac_retval - -} # ac_fn_c_try_cpp - -# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES -# ------------------------------------------------------- -# Tests whether HEADER exists and can be compiled using the include files in -# INCLUDES, setting the cache variable VAR accordingly. -ac_fn_c_check_header_compile () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -$as_echo_n "checking for $2... " >&6; } -if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -#include <$2> -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - eval "$3=yes" -else - eval "$3=no" -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } - eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} - -} # ac_fn_c_check_header_compile - -# ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES -# ------------------------------------------------------- -# Tests whether HEADER exists, giving a warning if it cannot be compiled using -# the include files in INCLUDES and setting the cache variable VAR -# accordingly. -ac_fn_c_check_header_mongrel () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -$as_echo_n "checking for $2... " >&6; } -if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : - $as_echo_n "(cached) " >&6 -fi -eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -else - # Is the header compilable? -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 -$as_echo_n "checking $2 usability... " >&6; } -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -#include <$2> -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_header_compiler=yes -else - ac_header_compiler=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 -$as_echo "$ac_header_compiler" >&6; } - -# Is the header present? -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 -$as_echo_n "checking $2 presence... " >&6; } -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include <$2> -_ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - ac_header_preproc=yes -else - ac_header_preproc=no -fi -rm -f conftest.err conftest.$ac_ext -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 -$as_echo "$ac_header_preproc" >&6; } - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #(( - yes:no: ) - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 -$as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} - ;; - no:yes:* ) - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 -$as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 -$as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 -$as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 -$as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} - ;; -esac - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -$as_echo_n "checking for $2... " >&6; } -if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : - $as_echo_n "(cached) " >&6 -else - eval "$3=\$ac_header_compiler" -fi -eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -fi - eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} - -} # ac_fn_c_check_header_mongrel -cat >config.log <<_ACEOF -This file contains any messages produced by compilers while -running configure, to aid debugging if configure makes a mistake. - -It was created by pjproject $as_me 1.0, which was -generated by GNU Autoconf 2.64. Invocation command line was - - $ $0 $@ - -_ACEOF -exec 5>>config.log -{ -cat <<_ASUNAME -## --------- ## -## Platform. ## -## --------- ## - -hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` -uname -m = `(uname -m) 2>/dev/null || echo unknown` -uname -r = `(uname -r) 2>/dev/null || echo unknown` -uname -s = `(uname -s) 2>/dev/null || echo unknown` -uname -v = `(uname -v) 2>/dev/null || echo unknown` - -/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` -/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` @@ -1806,8 +1443,8 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - $as_echo "PATH: $as_dir" - done + echo "PATH: $as_dir" +done IFS=$as_save_IFS } >&5 @@ -1841,12 +1478,12 @@ do | -silent | --silent | --silen | --sile | --sil) continue ;; *\'*) - ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in - 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; + 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; 2) - as_fn_append ac_configure_args1 " '$ac_arg'" + ac_configure_args1="$ac_configure_args1 '$ac_arg'" if test $ac_must_keep_next = true; then ac_must_keep_next=false # Got value, back to normal. else @@ -1862,13 +1499,13 @@ do -* ) ac_must_keep_next=true ;; esac fi - as_fn_append ac_configure_args " '$ac_arg'" + ac_configure_args="$ac_configure_args '$ac_arg'" ;; esac done done -{ ac_configure_args0=; unset ac_configure_args0;} -{ ac_configure_args1=; unset ac_configure_args1;} +$as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; } +$as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; } # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there @@ -1893,13 +1530,12 @@ _ASBOX case $ac_val in #( *${as_nl}*) case $ac_var in #( - *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 -$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 +echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( - BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( - *) { eval $ac_var=; unset $ac_var;} ;; + *) $as_unset $ac_var ;; esac ;; esac done @@ -1928,9 +1564,9 @@ _ASBOX do eval ac_val=\$$ac_var case $ac_val in - *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac - $as_echo "$ac_var='\''$ac_val'\''" + echo "$ac_var='\''$ac_val'\''" done | sort echo @@ -1945,9 +1581,9 @@ _ASBOX do eval ac_val=\$$ac_var case $ac_val in - *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac - $as_echo "$ac_var='\''$ac_val'\''" + echo "$ac_var='\''$ac_val'\''" done | sort echo fi @@ -1963,69 +1599,64 @@ _ASBOX echo fi test "$ac_signal" != 0 && - $as_echo "$as_me: caught signal $ac_signal" - $as_echo "$as_me: exit $exit_status" + echo "$as_me: caught signal $ac_signal" + echo "$as_me: exit $exit_status" } >&5 rm -f core *.core core.conftest.* && rm -f -r conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status ' 0 for ac_signal in 1 2 13 15; do - trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal + trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -f -r conftest* confdefs.h -$as_echo "/* confdefs.h */" > confdefs.h - # Predefined preprocessor variables. cat >>confdefs.h <<_ACEOF #define PACKAGE_NAME "$PACKAGE_NAME" _ACEOF + cat >>confdefs.h <<_ACEOF #define PACKAGE_TARNAME "$PACKAGE_TARNAME" _ACEOF + cat >>confdefs.h <<_ACEOF #define PACKAGE_VERSION "$PACKAGE_VERSION" _ACEOF + cat >>confdefs.h <<_ACEOF #define PACKAGE_STRING "$PACKAGE_STRING" _ACEOF -cat >>confdefs.h <<_ACEOF -#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" -_ACEOF cat >>confdefs.h <<_ACEOF -#define PACKAGE_URL "$PACKAGE_URL" +#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" _ACEOF # Let the site file select an alternate cache file if it wants to. -# Prefer an explicitly selected file to automatically selected ones. -ac_site_file1=NONE -ac_site_file2=NONE +# Prefer explicitly selected file to automatically selected ones. if test -n "$CONFIG_SITE"; then - ac_site_file1=$CONFIG_SITE + set x "$CONFIG_SITE" elif test "x$prefix" != xNONE; then - ac_site_file1=$prefix/share/config.site - ac_site_file2=$prefix/etc/config.site + set x "$prefix/share/config.site" "$prefix/etc/config.site" else - ac_site_file1=$ac_default_prefix/share/config.site - ac_site_file2=$ac_default_prefix/etc/config.site + set x "$ac_default_prefix/share/config.site" \ + "$ac_default_prefix/etc/config.site" fi -for ac_site_file in "$ac_site_file1" "$ac_site_file2" +shift +for ac_site_file do - test "x$ac_site_file" = xNONE && continue if test -r "$ac_site_file"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 -$as_echo "$as_me: loading site script $ac_site_file" >&6;} + { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 +echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" fi @@ -2035,16 +1666,16 @@ if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special # files actually), so we avoid doing that. if test -f "$cache_file"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 -$as_echo "$as_me: loading cache $cache_file" >&6;} + { echo "$as_me:$LINENO: loading cache $cache_file" >&5 +echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else - { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 -$as_echo "$as_me: creating cache $cache_file" >&6;} + { echo "$as_me:$LINENO: creating cache $cache_file" >&5 +echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi @@ -2058,56 +1689,68 @@ for ac_var in $ac_precious_vars; do eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) - { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 -$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} + { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 +echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) - { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 -$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} + { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 +echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then - # differences in whitespace do not lead to failure. - ac_old_val_w=`echo x $ac_old_val` - ac_new_val_w=`echo x $ac_new_val` - if test "$ac_old_val_w" != "$ac_new_val_w"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 -$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} - ac_cache_corrupted=: - else - { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 -$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} - eval $ac_var=\$ac_old_val - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 -$as_echo "$as_me: former value: \`$ac_old_val'" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 -$as_echo "$as_me: current value: \`$ac_new_val'" >&2;} + { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 +echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} + { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 +echo "$as_me: former value: $ac_old_val" >&2;} + { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 +echo "$as_me: current value: $ac_new_val" >&2;} + ac_cache_corrupted=: fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in - *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; + *\'*) ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. - *) as_fn_append ac_configure_args " '$ac_arg'" ;; + *) ac_configure_args="$ac_configure_args '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then - { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 -$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} - as_fn_error "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 + { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 +echo "$as_me: error: changes in the environment can compromise the build" >&2;} + { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 +echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} + { (exit 1); exit 1; }; } fi -## -------------------- ## -## Main body of script. ## -## -------------------- ## + + + + + + + + + + + + + + + + + + + + + + + + ac_ext=c ac_cpp='$CPP $CPPFLAGS' @@ -2121,16 +1764,24 @@ host_orig="$host" ac_aux_dir= for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do - for ac_t in install-sh install.sh shtool; do - if test -f "$ac_dir/$ac_t"; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/$ac_t -c" - break 2 - fi - done + if test -f "$ac_dir/install-sh"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install-sh -c" + break + elif test -f "$ac_dir/install.sh"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install.sh -c" + break + elif test -f "$ac_dir/shtool"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/shtool install -c" + break + fi done if test -z "$ac_aux_dir"; then - as_fn_error "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5 + { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&5 +echo "$as_me: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&2;} + { (exit 1); exit 1; }; } fi # These three variables are undocumented and unsupported, @@ -2144,27 +1795,35 @@ ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. # Make sure we can run config.sub. $SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || - as_fn_error "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5 + { { echo "$as_me:$LINENO: error: cannot run $SHELL $ac_aux_dir/config.sub" >&5 +echo "$as_me: error: cannot run $SHELL $ac_aux_dir/config.sub" >&2;} + { (exit 1); exit 1; }; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 -$as_echo_n "checking build system type... " >&6; } -if test "${ac_cv_build+set}" = set; then : - $as_echo_n "(cached) " >&6 +{ echo "$as_me:$LINENO: checking build system type" >&5 +echo $ECHO_N "checking build system type... $ECHO_C" >&6; } +if test "${ac_cv_build+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_build_alias=$build_alias test "x$ac_build_alias" = x && ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` test "x$ac_build_alias" = x && - as_fn_error "cannot guess build type; you must specify one" "$LINENO" 5 + { { echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5 +echo "$as_me: error: cannot guess build type; you must specify one" >&2;} + { (exit 1); exit 1; }; } ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || - as_fn_error "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5 + { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&5 +echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&2;} + { (exit 1); exit 1; }; } fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 -$as_echo "$ac_cv_build" >&6; } +{ echo "$as_me:$LINENO: result: $ac_cv_build" >&5 +echo "${ECHO_T}$ac_cv_build" >&6; } case $ac_cv_build in *-*-*) ;; -*) as_fn_error "invalid value of canonical build" "$LINENO" 5;; +*) { { echo "$as_me:$LINENO: error: invalid value of canonical build" >&5 +echo "$as_me: error: invalid value of canonical build" >&2;} + { (exit 1); exit 1; }; };; esac build=$ac_cv_build ac_save_IFS=$IFS; IFS='-' @@ -2180,24 +1839,28 @@ IFS=$ac_save_IFS case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 -$as_echo_n "checking host system type... " >&6; } -if test "${ac_cv_host+set}" = set; then : - $as_echo_n "(cached) " >&6 +{ echo "$as_me:$LINENO: checking host system type" >&5 +echo $ECHO_N "checking host system type... $ECHO_C" >&6; } +if test "${ac_cv_host+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "x$host_alias" = x; then ac_cv_host=$ac_cv_build else ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || - as_fn_error "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5 + { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&5 +echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&2;} + { (exit 1); exit 1; }; } fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 -$as_echo "$ac_cv_host" >&6; } +{ echo "$as_me:$LINENO: result: $ac_cv_host" >&5 +echo "${ECHO_T}$ac_cv_host" >&6; } case $ac_cv_host in *-*-*) ;; -*) as_fn_error "invalid value of canonical host" "$LINENO" 5;; +*) { { echo "$as_me:$LINENO: error: invalid value of canonical host" >&5 +echo "$as_me: error: invalid value of canonical host" >&2;} + { (exit 1); exit 1; }; };; esac host=$ac_cv_host ac_save_IFS=$IFS; IFS='-' @@ -2213,24 +1876,28 @@ IFS=$ac_save_IFS case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking target system type" >&5 -$as_echo_n "checking target system type... " >&6; } -if test "${ac_cv_target+set}" = set; then : - $as_echo_n "(cached) " >&6 +{ echo "$as_me:$LINENO: checking target system type" >&5 +echo $ECHO_N "checking target system type... $ECHO_C" >&6; } +if test "${ac_cv_target+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "x$target_alias" = x; then ac_cv_target=$ac_cv_host else ac_cv_target=`$SHELL "$ac_aux_dir/config.sub" $target_alias` || - as_fn_error "$SHELL $ac_aux_dir/config.sub $target_alias failed" "$LINENO" 5 + { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $target_alias failed" >&5 +echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $target_alias failed" >&2;} + { (exit 1); exit 1; }; } fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_target" >&5 -$as_echo "$ac_cv_target" >&6; } +{ echo "$as_me:$LINENO: result: $ac_cv_target" >&5 +echo "${ECHO_T}$ac_cv_target" >&6; } case $ac_cv_target in *-*-*) ;; -*) as_fn_error "invalid value of canonical target" "$LINENO" 5;; +*) { { echo "$as_me:$LINENO: error: invalid value of canonical target" >&5 +echo "$as_me: error: invalid value of canonical target" >&2;} + { (exit 1); exit 1; }; };; esac target=$ac_cv_target ac_save_IFS=$IFS; IFS='-' @@ -2274,10 +1941,10 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_CC+set}" = set; then : - $as_echo_n "(cached) " >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. @@ -2287,25 +1954,25 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do + for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}gcc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done - done +done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } + { echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi @@ -2314,10 +1981,10 @@ if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_CC+set}" = set; then : - $as_echo_n "(cached) " >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. @@ -2327,25 +1994,25 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do + for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="gcc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done - done +done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 -$as_echo "$ac_ct_CC" >&6; } + { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi if test "x$ac_ct_CC" = x; then @@ -2353,8 +2020,12 @@ fi else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&5 +echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC @@ -2367,10 +2038,10 @@ if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_CC+set}" = set; then : - $as_echo_n "(cached) " >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. @@ -2380,25 +2051,25 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do + for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}cc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done - done +done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } + { echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi @@ -2407,10 +2078,10 @@ fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_CC+set}" = set; then : - $as_echo_n "(cached) " >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. @@ -2421,18 +2092,18 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do + for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done - done +done IFS=$as_save_IFS if test $ac_prog_rejected = yes; then @@ -2451,11 +2122,11 @@ fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } + { echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi @@ -2466,10 +2137,10 @@ if test -z "$CC"; then do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_CC+set}" = set; then : - $as_echo_n "(cached) " >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. @@ -2479,25 +2150,25 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do + for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done - done +done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } + { echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi @@ -2510,10 +2181,10 @@ if test -z "$CC"; then do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_CC+set}" = set; then : - $as_echo_n "(cached) " >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. @@ -2523,25 +2194,25 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do + for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done - done +done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 -$as_echo "$ac_ct_CC" >&6; } + { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi @@ -2553,8 +2224,12 @@ done else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&5 +echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC @@ -2564,82 +2239,98 @@ fi fi -test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error "no acceptable C compiler found in \$PATH -See \`config.log' for more details." "$LINENO" 5; } +test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH +See \`config.log' for more details." >&5 +echo "$as_me: error: no acceptable C compiler found in \$PATH +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } # Provide some information about the compiler. -$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 -set X $ac_compile -ac_compiler=$2 -for ac_option in --version -v -V -qversion; do - { { ac_try="$ac_compiler $ac_option >&5" +echo "$as_me:$LINENO: checking for C compiler version" >&5 +ac_compiler=`set X $ac_compile; echo $2` +{ (ac_try="$ac_compiler --version >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_compiler $ac_option >&5") 2>conftest.err +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compiler --version >&5") 2>&5 ac_status=$? - if test -s conftest.err; then - sed '10a\ -... rest of stderr output deleted ... - 10q' conftest.err >conftest.er1 - cat conftest.er1 >&5 - rm -f conftest.er1 conftest.err - fi - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } -done + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (ac_try="$ac_compiler -v >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compiler -v >&5") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (ac_try="$ac_compiler -V >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compiler -V >&5") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } -cat confdefs.h - <<_ACEOF >conftest.$ac_ext +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include <stdio.h> + int main () { -FILE *f = fopen ("conftest.out", "w"); - return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files -ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out conftest.out" +ac_clean_files="$ac_clean_files a.out a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 -$as_echo_n "checking for C compiler default output file name... " >&6; } -ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` - -# The possible output files: -ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" - +{ echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 +echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6; } +ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` +# +# List of possible output files, starting from the most likely. +# The algorithm is not robust to junk in `.', hence go to wildcards (a.*) +# only as a last resort. b.out is created by i960 compilers. +ac_files='a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out' +# +# The IRIX 6 linker writes into existing files which may not be +# executable, retaining their permissions. Remove them first so a +# subsequent execution test works. ac_rmfiles= for ac_file in $ac_files do case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;; * ) ac_rmfiles="$ac_rmfiles $ac_file";; esac done rm -f $ac_rmfiles -if { { ac_try="$ac_link_default" +if { (ac_try="$ac_link_default" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link_default") 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then : + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. # So ignore a value of `no', otherwise this would lead to `EXEEXT = no' # in a Makefile. We should not override ac_cv_exeext if it was cached, @@ -2649,14 +2340,14 @@ for ac_file in $ac_files '' do test -f "$ac_file" || continue case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;; [ab].out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) - if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; + if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; then :; else ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` fi @@ -2675,75 +2366,78 @@ test "$ac_cv_exeext" = no && ac_cv_exeext= else ac_file='' fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 -$as_echo "$ac_file" >&6; } -if test -z "$ac_file"; then : - $as_echo "$as_me: failed program was:" >&5 + +{ echo "$as_me:$LINENO: result: $ac_file" >&5 +echo "${ECHO_T}$ac_file" >&6; } +if test -z "$ac_file"; then + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -{ as_fn_set_status 77 -as_fn_error "C compiler cannot create executables -See \`config.log' for more details." "$LINENO" 5; }; } +{ { echo "$as_me:$LINENO: error: C compiler cannot create executables +See \`config.log' for more details." >&5 +echo "$as_me: error: C compiler cannot create executables +See \`config.log' for more details." >&2;} + { (exit 77); exit 77; }; } fi + ac_exeext=$ac_cv_exeext # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 -$as_echo_n "checking whether the C compiler works... " >&6; } +{ echo "$as_me:$LINENO: checking whether the C compiler works" >&5 +echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6; } +# FIXME: These cross compiler hacks should be removed for Autoconf 3.0 # If not cross compiling, check that we can run a simple program. if test "$cross_compiling" != yes; then if { ac_try='./$ac_file' - { { case "(($ac_try" in + { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; }; then + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error "cannot run C compiled programs. + { { echo "$as_me:$LINENO: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. -See \`config.log' for more details." "$LINENO" 5; } +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot run C compiled programs. +If you meant to cross compile, use \`--host'. +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } fi fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } +{ echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } -rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out conftest.out +rm -f a.out a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 -$as_echo_n "checking whether we are cross compiling... " >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 -$as_echo "$cross_compiling" >&6; } - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 -$as_echo_n "checking for suffix of executables... " >&6; } -if { { ac_try="$ac_link" +{ echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 +echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6; } +{ echo "$as_me:$LINENO: result: $cross_compiling" >&5 +echo "${ECHO_T}$cross_compiling" >&6; } + +{ echo "$as_me:$LINENO: checking for suffix of executables" >&5 +echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6; } +if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then : + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will # work properly (i.e., refer to `conftest.exe'), while it won't with @@ -2751,31 +2445,37 @@ $as_echo "$ac_try_echo"; } >&5 for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` break;; * ) break;; esac done else - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error "cannot compute suffix of executables: cannot compile and link -See \`config.log' for more details." "$LINENO" 5; } + { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute suffix of executables: cannot compile and link +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } fi + rm -f conftest$ac_cv_exeext -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 -$as_echo "$ac_cv_exeext" >&6; } +{ echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 +echo "${ECHO_T}$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 -$as_echo_n "checking for suffix of object files... " >&6; } -if test "${ac_cv_objext+set}" = set; then : - $as_echo_n "(cached) " >&6 +{ echo "$as_me:$LINENO: checking for suffix of object files" >&5 +echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6; } +if test "${ac_cv_objext+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int @@ -2787,46 +2487,51 @@ main () } _ACEOF rm -f conftest.o conftest.obj -if { { ac_try="$ac_compile" +if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then : + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then for ac_file in conftest.o conftest.obj conftest.*; do test -f "$ac_file" || continue; case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error "cannot compute suffix of object files: cannot compile -See \`config.log' for more details." "$LINENO" 5; } +{ { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute suffix of object files: cannot compile +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } fi + rm -f conftest.$ac_cv_objext conftest.$ac_ext fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 -$as_echo "$ac_cv_objext" >&6; } +{ echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 +echo "${ECHO_T}$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 -$as_echo_n "checking whether we are using the GNU C compiler... " >&6; } -if test "${ac_cv_c_compiler_gnu+set}" = set; then : - $as_echo_n "(cached) " >&6 +{ echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 +echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6; } +if test "${ac_cv_c_compiler_gnu+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int @@ -2840,34 +2545,54 @@ main () return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_compiler_gnu=yes else - ac_compiler_gnu=no + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_compiler_gnu=no fi + rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 -$as_echo "$ac_cv_c_compiler_gnu" >&6; } -if test $ac_compiler_gnu = yes; then - GCC=yes -else - GCC= -fi +{ echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 +echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6; } +GCC=`test $ac_compiler_gnu = yes && echo yes` ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 -$as_echo_n "checking whether $CC accepts -g... " >&6; } -if test "${ac_cv_prog_cc_g+set}" = set; then : - $as_echo_n "(cached) " >&6 +{ echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 +echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6; } +if test "${ac_cv_prog_cc_g+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int @@ -2878,11 +2603,34 @@ main () return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_cv_prog_cc_g=yes else - CFLAGS="" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + CFLAGS="" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int @@ -2893,12 +2641,35 @@ main () return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + : else - ac_c_werror_flag=$ac_save_c_werror_flag + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int @@ -2909,18 +2680,42 @@ main () return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_cv_prog_cc_g=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + fi + rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi + rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi + rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 -$as_echo "$ac_cv_prog_cc_g" >&6; } +{ echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 +echo "${ECHO_T}$ac_cv_prog_cc_g" >&6; } if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then @@ -2936,14 +2731,18 @@ else CFLAGS= fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 -$as_echo_n "checking for $CC option to accept ISO C89... " >&6; } -if test "${ac_cv_prog_cc_c89+set}" = set; then : - $as_echo_n "(cached) " >&6 +{ echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5 +echo $ECHO_N "checking for $CC option to accept ISO C89... $ECHO_C" >&6; } +if test "${ac_cv_prog_cc_c89+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC -cat confdefs.h - <<_ACEOF >conftest.$ac_ext +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <stdarg.h> #include <stdio.h> @@ -3000,9 +2799,31 @@ for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" - if ac_fn_c_try_compile "$LINENO"; then : + rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_cv_prog_cc_c89=$ac_arg +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + fi + rm -f core conftest.err conftest.$ac_objext test "x$ac_cv_prog_cc_c89" != "xno" && break done @@ -3013,19 +2834,17 @@ fi # AC_CACHE_VAL case "x$ac_cv_prog_cc_c89" in x) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 -$as_echo "none needed" >&6; } ;; + { echo "$as_me:$LINENO: result: none needed" >&5 +echo "${ECHO_T}none needed" >&6; } ;; xno) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 -$as_echo "unsupported" >&6; } ;; + { echo "$as_me:$LINENO: result: unsupported" >&5 +echo "${ECHO_T}unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 -$as_echo "$ac_cv_prog_cc_c89" >&6; } ;; + { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5 +echo "${ECHO_T}$ac_cv_prog_cc_c89" >&6; } ;; esac -if test "x$ac_cv_prog_cc_c89" != xno; then : -fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' @@ -3047,10 +2866,10 @@ if test -z "$CXX"; then do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_CXX+set}" = set; then : - $as_echo_n "(cached) " >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_CXX+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CXX"; then ac_cv_prog_CXX="$CXX" # Let the user override the test. @@ -3060,25 +2879,25 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do + for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done - done +done IFS=$as_save_IFS fi fi CXX=$ac_cv_prog_CXX if test -n "$CXX"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5 -$as_echo "$CXX" >&6; } + { echo "$as_me:$LINENO: result: $CXX" >&5 +echo "${ECHO_T}$CXX" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi @@ -3091,10 +2910,10 @@ if test -z "$CXX"; then do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_CXX+set}" = set; then : - $as_echo_n "(cached) " >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_ac_ct_CXX+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CXX"; then ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test. @@ -3104,25 +2923,25 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do + for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CXX="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done - done +done IFS=$as_save_IFS fi fi ac_ct_CXX=$ac_cv_prog_ac_ct_CXX if test -n "$ac_ct_CXX"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CXX" >&5 -$as_echo "$ac_ct_CXX" >&6; } + { echo "$as_me:$LINENO: result: $ac_ct_CXX" >&5 +echo "${ECHO_T}$ac_ct_CXX" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi @@ -3134,8 +2953,12 @@ done else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&5 +echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac CXX=$ac_ct_CXX @@ -3145,36 +2968,49 @@ fi fi fi # Provide some information about the compiler. -$as_echo "$as_me:${as_lineno-$LINENO}: checking for C++ compiler version" >&5 -set X $ac_compile -ac_compiler=$2 -for ac_option in --version -v -V -qversion; do - { { ac_try="$ac_compiler $ac_option >&5" +echo "$as_me:$LINENO: checking for C++ compiler version" >&5 +ac_compiler=`set X $ac_compile; echo $2` +{ (ac_try="$ac_compiler --version >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_compiler $ac_option >&5") 2>conftest.err +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compiler --version >&5") 2>&5 ac_status=$? - if test -s conftest.err; then - sed '10a\ -... rest of stderr output deleted ... - 10q' conftest.err >conftest.er1 - cat conftest.er1 >&5 - rm -f conftest.er1 conftest.err - fi - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } -done + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (ac_try="$ac_compiler -v >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compiler -v >&5") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (ac_try="$ac_compiler -V >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compiler -V >&5") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C++ compiler" >&5 -$as_echo_n "checking whether we are using the GNU C++ compiler... " >&6; } -if test "${ac_cv_cxx_compiler_gnu+set}" = set; then : - $as_echo_n "(cached) " >&6 +{ echo "$as_me:$LINENO: checking whether we are using the GNU C++ compiler" >&5 +echo $ECHO_N "checking whether we are using the GNU C++ compiler... $ECHO_C" >&6; } +if test "${ac_cv_cxx_compiler_gnu+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int @@ -3188,34 +3024,54 @@ main () return 0; } _ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_compiler_gnu=yes else - ac_compiler_gnu=no + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_compiler_gnu=no fi + rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_cxx_compiler_gnu=$ac_compiler_gnu fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_compiler_gnu" >&5 -$as_echo "$ac_cv_cxx_compiler_gnu" >&6; } -if test $ac_compiler_gnu = yes; then - GXX=yes -else - GXX= -fi +{ echo "$as_me:$LINENO: result: $ac_cv_cxx_compiler_gnu" >&5 +echo "${ECHO_T}$ac_cv_cxx_compiler_gnu" >&6; } +GXX=`test $ac_compiler_gnu = yes && echo yes` ac_test_CXXFLAGS=${CXXFLAGS+set} ac_save_CXXFLAGS=$CXXFLAGS -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX accepts -g" >&5 -$as_echo_n "checking whether $CXX accepts -g... " >&6; } -if test "${ac_cv_prog_cxx_g+set}" = set; then : - $as_echo_n "(cached) " >&6 +{ echo "$as_me:$LINENO: checking whether $CXX accepts -g" >&5 +echo $ECHO_N "checking whether $CXX accepts -g... $ECHO_C" >&6; } +if test "${ac_cv_prog_cxx_g+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_save_cxx_werror_flag=$ac_cxx_werror_flag ac_cxx_werror_flag=yes ac_cv_prog_cxx_g=no CXXFLAGS="-g" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int @@ -3226,11 +3082,34 @@ main () return 0; } _ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_cv_prog_cxx_g=yes else - CXXFLAGS="" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + CXXFLAGS="" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int @@ -3241,12 +3120,35 @@ main () return 0; } _ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : - +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + : else - ac_cxx_werror_flag=$ac_save_cxx_werror_flag + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cxx_werror_flag=$ac_save_cxx_werror_flag CXXFLAGS="-g" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int @@ -3257,18 +3159,42 @@ main () return 0; } _ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_cv_prog_cxx_g=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + fi + rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi + rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi + rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cxx_werror_flag=$ac_save_cxx_werror_flag fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_g" >&5 -$as_echo "$ac_cv_prog_cxx_g" >&6; } +{ echo "$as_me:$LINENO: result: $ac_cv_prog_cxx_g" >&5 +echo "${ECHO_T}$ac_cv_prog_cxx_g" >&6; } if test "$ac_test_CXXFLAGS" = set; then CXXFLAGS=$ac_save_CXXFLAGS elif test $ac_cv_prog_cxx_g = yes; then @@ -3309,14 +3235,19 @@ case $target in esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_create in -lpthread" >&5 -$as_echo_n "checking for pthread_create in -lpthread... " >&6; } -if test "${ac_cv_lib_pthread_pthread_create+set}" = set; then : - $as_echo_n "(cached) " >&6 + +{ echo "$as_me:$LINENO: checking for pthread_create in -lpthread" >&5 +echo $ECHO_N "checking for pthread_create in -lpthread... $ECHO_C" >&6; } +if test "${ac_cv_lib_pthread_pthread_create+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lpthread $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. @@ -3334,18 +3265,39 @@ return pthread_create (); return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then ac_cv_lib_pthread_pthread_create=yes else - ac_cv_lib_pthread_pthread_create=no + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_lib_pthread_pthread_create=no fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_create" >&5 -$as_echo "$ac_cv_lib_pthread_pthread_create" >&6; } -if test "x$ac_cv_lib_pthread_pthread_create" = x""yes; then : +{ echo "$as_me:$LINENO: result: $ac_cv_lib_pthread_pthread_create" >&5 +echo "${ECHO_T}$ac_cv_lib_pthread_pthread_create" >&6; } +if test $ac_cv_lib_pthread_pthread_create = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBPTHREAD 1 _ACEOF @@ -3354,14 +3306,19 @@ _ACEOF fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for puts in -lwsock32" >&5 -$as_echo_n "checking for puts in -lwsock32... " >&6; } -if test "${ac_cv_lib_wsock32_puts+set}" = set; then : - $as_echo_n "(cached) " >&6 + +{ echo "$as_me:$LINENO: checking for puts in -lwsock32" >&5 +echo $ECHO_N "checking for puts in -lwsock32... $ECHO_C" >&6; } +if test "${ac_cv_lib_wsock32_puts+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lwsock32 $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. @@ -3379,18 +3336,39 @@ return puts (); return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then ac_cv_lib_wsock32_puts=yes else - ac_cv_lib_wsock32_puts=no + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_lib_wsock32_puts=no fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_wsock32_puts" >&5 -$as_echo "$ac_cv_lib_wsock32_puts" >&6; } -if test "x$ac_cv_lib_wsock32_puts" = x""yes; then : +{ echo "$as_me:$LINENO: result: $ac_cv_lib_wsock32_puts" >&5 +echo "${ECHO_T}$ac_cv_lib_wsock32_puts" >&6; } +if test $ac_cv_lib_wsock32_puts = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBWSOCK32 1 _ACEOF @@ -3399,14 +3377,19 @@ _ACEOF fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for puts in -lws2_32" >&5 -$as_echo_n "checking for puts in -lws2_32... " >&6; } -if test "${ac_cv_lib_ws2_32_puts+set}" = set; then : - $as_echo_n "(cached) " >&6 + +{ echo "$as_me:$LINENO: checking for puts in -lws2_32" >&5 +echo $ECHO_N "checking for puts in -lws2_32... $ECHO_C" >&6; } +if test "${ac_cv_lib_ws2_32_puts+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lws2_32 $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. @@ -3424,18 +3407,39 @@ return puts (); return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then ac_cv_lib_ws2_32_puts=yes else - ac_cv_lib_ws2_32_puts=no + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_lib_ws2_32_puts=no fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ws2_32_puts" >&5 -$as_echo "$ac_cv_lib_ws2_32_puts" >&6; } -if test "x$ac_cv_lib_ws2_32_puts" = x""yes; then : +{ echo "$as_me:$LINENO: result: $ac_cv_lib_ws2_32_puts" >&5 +echo "${ECHO_T}$ac_cv_lib_ws2_32_puts" >&6; } +if test $ac_cv_lib_ws2_32_puts = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBWS2_32 1 _ACEOF @@ -3444,14 +3448,19 @@ _ACEOF fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for puts in -lole32" >&5 -$as_echo_n "checking for puts in -lole32... " >&6; } -if test "${ac_cv_lib_ole32_puts+set}" = set; then : - $as_echo_n "(cached) " >&6 + +{ echo "$as_me:$LINENO: checking for puts in -lole32" >&5 +echo $ECHO_N "checking for puts in -lole32... $ECHO_C" >&6; } +if test "${ac_cv_lib_ole32_puts+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lole32 $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. @@ -3469,18 +3478,39 @@ return puts (); return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then ac_cv_lib_ole32_puts=yes else - ac_cv_lib_ole32_puts=no + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_lib_ole32_puts=no fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ole32_puts" >&5 -$as_echo "$ac_cv_lib_ole32_puts" >&6; } -if test "x$ac_cv_lib_ole32_puts" = x""yes; then : +{ echo "$as_me:$LINENO: result: $ac_cv_lib_ole32_puts" >&5 +echo "${ECHO_T}$ac_cv_lib_ole32_puts" >&6; } +if test $ac_cv_lib_ole32_puts = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBOLE32 1 _ACEOF @@ -3489,14 +3519,19 @@ _ACEOF fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for puts in -lwinmm" >&5 -$as_echo_n "checking for puts in -lwinmm... " >&6; } -if test "${ac_cv_lib_winmm_puts+set}" = set; then : - $as_echo_n "(cached) " >&6 + +{ echo "$as_me:$LINENO: checking for puts in -lwinmm" >&5 +echo $ECHO_N "checking for puts in -lwinmm... $ECHO_C" >&6; } +if test "${ac_cv_lib_winmm_puts+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lwinmm $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. @@ -3514,18 +3549,39 @@ return puts (); return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then ac_cv_lib_winmm_puts=yes else - ac_cv_lib_winmm_puts=no + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_lib_winmm_puts=no fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_winmm_puts" >&5 -$as_echo "$ac_cv_lib_winmm_puts" >&6; } -if test "x$ac_cv_lib_winmm_puts" = x""yes; then : +{ echo "$as_me:$LINENO: result: $ac_cv_lib_winmm_puts" >&5 +echo "${ECHO_T}$ac_cv_lib_winmm_puts" >&6; } +if test $ac_cv_lib_winmm_puts = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBWINMM 1 _ACEOF @@ -3534,14 +3590,19 @@ _ACEOF fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for puts in -lsocket" >&5 -$as_echo_n "checking for puts in -lsocket... " >&6; } -if test "${ac_cv_lib_socket_puts+set}" = set; then : - $as_echo_n "(cached) " >&6 + +{ echo "$as_me:$LINENO: checking for puts in -lsocket" >&5 +echo $ECHO_N "checking for puts in -lsocket... $ECHO_C" >&6; } +if test "${ac_cv_lib_socket_puts+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsocket $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. @@ -3559,18 +3620,39 @@ return puts (); return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then ac_cv_lib_socket_puts=yes else - ac_cv_lib_socket_puts=no + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_lib_socket_puts=no fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_socket_puts" >&5 -$as_echo "$ac_cv_lib_socket_puts" >&6; } -if test "x$ac_cv_lib_socket_puts" = x""yes; then : +{ echo "$as_me:$LINENO: result: $ac_cv_lib_socket_puts" >&5 +echo "${ECHO_T}$ac_cv_lib_socket_puts" >&6; } +if test $ac_cv_lib_socket_puts = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBSOCKET 1 _ACEOF @@ -3579,14 +3661,19 @@ _ACEOF fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for puts in -lrt" >&5 -$as_echo_n "checking for puts in -lrt... " >&6; } -if test "${ac_cv_lib_rt_puts+set}" = set; then : - $as_echo_n "(cached) " >&6 + +{ echo "$as_me:$LINENO: checking for puts in -lrt" >&5 +echo $ECHO_N "checking for puts in -lrt... $ECHO_C" >&6; } +if test "${ac_cv_lib_rt_puts+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lrt $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. @@ -3604,18 +3691,39 @@ return puts (); return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then ac_cv_lib_rt_puts=yes else - ac_cv_lib_rt_puts=no + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_lib_rt_puts=no fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_rt_puts" >&5 -$as_echo "$ac_cv_lib_rt_puts" >&6; } -if test "x$ac_cv_lib_rt_puts" = x""yes; then : +{ echo "$as_me:$LINENO: result: $ac_cv_lib_rt_puts" >&5 +echo "${ECHO_T}$ac_cv_lib_rt_puts" >&6; } +if test $ac_cv_lib_rt_puts = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBRT 1 _ACEOF @@ -3624,14 +3732,19 @@ _ACEOF fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for puts in -lnsl" >&5 -$as_echo_n "checking for puts in -lnsl... " >&6; } -if test "${ac_cv_lib_nsl_puts+set}" = set; then : - $as_echo_n "(cached) " >&6 + +{ echo "$as_me:$LINENO: checking for puts in -lnsl" >&5 +echo $ECHO_N "checking for puts in -lnsl... $ECHO_C" >&6; } +if test "${ac_cv_lib_nsl_puts+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lnsl $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. @@ -3649,18 +3762,39 @@ return puts (); return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then ac_cv_lib_nsl_puts=yes else - ac_cv_lib_nsl_puts=no + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_lib_nsl_puts=no fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_nsl_puts" >&5 -$as_echo "$ac_cv_lib_nsl_puts" >&6; } -if test "x$ac_cv_lib_nsl_puts" = x""yes; then : +{ echo "$as_me:$LINENO: result: $ac_cv_lib_nsl_puts" >&5 +echo "${ECHO_T}$ac_cv_lib_nsl_puts" >&6; } +if test $ac_cv_lib_nsl_puts = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBNSL 1 _ACEOF @@ -3669,14 +3803,19 @@ _ACEOF fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for uuid_generate in -luuid" >&5 -$as_echo_n "checking for uuid_generate in -luuid... " >&6; } -if test "${ac_cv_lib_uuid_uuid_generate+set}" = set; then : - $as_echo_n "(cached) " >&6 + +{ echo "$as_me:$LINENO: checking for uuid_generate in -luuid" >&5 +echo $ECHO_N "checking for uuid_generate in -luuid... $ECHO_C" >&6; } +if test "${ac_cv_lib_uuid_uuid_generate+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-luuid $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. @@ -3694,18 +3833,39 @@ return uuid_generate (); return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then ac_cv_lib_uuid_uuid_generate=yes else - ac_cv_lib_uuid_uuid_generate=no + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_lib_uuid_uuid_generate=no fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_uuid_uuid_generate" >&5 -$as_echo "$ac_cv_lib_uuid_uuid_generate" >&6; } -if test "x$ac_cv_lib_uuid_uuid_generate" = x""yes; then : +{ echo "$as_me:$LINENO: result: $ac_cv_lib_uuid_uuid_generate" >&5 +echo "${ECHO_T}$ac_cv_lib_uuid_uuid_generate" >&6; } +if test $ac_cv_lib_uuid_uuid_generate = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBUUID 1 _ACEOF @@ -3714,14 +3874,18 @@ _ACEOF fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for uuid_generate in -luuid" >&5 -$as_echo_n "checking for uuid_generate in -luuid... " >&6; } -if test "${ac_cv_lib_uuid_uuid_generate+set}" = set; then : - $as_echo_n "(cached) " >&6 +{ echo "$as_me:$LINENO: checking for uuid_generate in -luuid" >&5 +echo $ECHO_N "checking for uuid_generate in -luuid... $ECHO_C" >&6; } +if test "${ac_cv_lib_uuid_uuid_generate+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-luuid $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. @@ -3739,43 +3903,68 @@ return uuid_generate (); return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then ac_cv_lib_uuid_uuid_generate=yes else - ac_cv_lib_uuid_uuid_generate=no + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_lib_uuid_uuid_generate=no fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_uuid_uuid_generate" >&5 -$as_echo "$ac_cv_lib_uuid_uuid_generate" >&6; } -if test "x$ac_cv_lib_uuid_uuid_generate" = x""yes; then : +{ echo "$as_me:$LINENO: result: $ac_cv_lib_uuid_uuid_generate" >&5 +echo "${ECHO_T}$ac_cv_lib_uuid_uuid_generate" >&6; } +if test $ac_cv_lib_uuid_uuid_generate = yes; then ac_has_uuid_lib=1 fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: Setting PJ_M_NAME to $target_cpu" >&5 -$as_echo "Setting PJ_M_NAME to $target_cpu" >&6; } +{ echo "$as_me:$LINENO: result: Setting PJ_M_NAME to $target_cpu" >&5 +echo "${ECHO_T}Setting PJ_M_NAME to $target_cpu" >&6; } cat >>confdefs.h <<_ACEOF #define PJ_M_NAME "$target_cpu" _ACEOF -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking memory alignment" >&5 -$as_echo_n "checking memory alignment... " >&6; } +{ echo "$as_me:$LINENO: checking memory alignment" >&5 +echo $ECHO_N "checking memory alignment... $ECHO_C" >&6; } case $target in ia64-* | x86_64-* ) - $as_echo "#define PJ_POOL_ALIGNMENT 8" >>confdefs.h + cat >>confdefs.h <<\_ACEOF +#define PJ_POOL_ALIGNMENT 8 +_ACEOF - { $as_echo "$as_me:${as_lineno-$LINENO}: result: 8 bytes" >&5 -$as_echo "8 bytes" >&6; } + { echo "$as_me:$LINENO: result: 8 bytes" >&5 +echo "${ECHO_T}8 bytes" >&6; } ;; * ) - $as_echo "#define PJ_POOL_ALIGNMENT 4" >>confdefs.h + cat >>confdefs.h <<\_ACEOF +#define PJ_POOL_ALIGNMENT 4 +_ACEOF - { $as_echo "$as_me:${as_lineno-$LINENO}: result: 4 bytes (default)" >&5 -$as_echo "4 bytes (default)" >&6; } + { echo "$as_me:$LINENO: result: 4 bytes (default)" >&5 +echo "${ECHO_T}4 bytes (default)" >&6; } ;; esac @@ -3785,15 +3974,15 @@ ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 -$as_echo_n "checking how to run the C preprocessor... " >&6; } +{ echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 +echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then - if test "${ac_cv_prog_CPP+set}" = set; then : - $as_echo_n "(cached) " >&6 + if test "${ac_cv_prog_CPP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else # Double quotes because CPP needs to be expanded for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" @@ -3807,7 +3996,11 @@ do # <limits.h> exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include <limits.h> @@ -3816,34 +4009,76 @@ do #endif Syntax error _ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + : else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + # Broken: fails on valid input. continue fi + rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <ac_nonexistent.h> _ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then # Broken: success on invalid input. continue else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + # Passes both tests. ac_preproc_ok=: break fi + rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext -if $ac_preproc_ok; then : +if $ac_preproc_ok; then break fi @@ -3855,8 +4090,8 @@ fi else ac_cv_prog_CPP=$CPP fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 -$as_echo "$CPP" >&6; } +{ echo "$as_me:$LINENO: result: $CPP" >&5 +echo "${ECHO_T}$CPP" >&6; } ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do @@ -3866,7 +4101,11 @@ do # <limits.h> exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include <limits.h> @@ -3875,40 +4114,83 @@ do #endif Syntax error _ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + : else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + # Broken: fails on valid input. continue fi + rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <ac_nonexistent.h> _ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then # Broken: success on invalid input. continue else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + # Passes both tests. ac_preproc_ok=: break fi + rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext -if $ac_preproc_ok; then : - +if $ac_preproc_ok; then + : else - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error "C preprocessor \"$CPP\" fails sanity check -See \`config.log' for more details." "$LINENO" 5; } + { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check +See \`config.log' for more details." >&5 +echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } fi ac_ext=c @@ -3918,40 +4200,45 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $ ac_compiler_gnu=$ac_cv_c_compiler_gnu -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 -$as_echo_n "checking for grep that handles long lines and -e... " >&6; } -if test "${ac_cv_path_GREP+set}" = set; then : - $as_echo_n "(cached) " >&6 +{ echo "$as_me:$LINENO: checking for grep that handles long lines and -e" >&5 +echo $ECHO_N "checking for grep that handles long lines and -e... $ECHO_C" >&6; } +if test "${ac_cv_path_GREP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + # Extract the first word of "grep ggrep" to use in msg output +if test -z "$GREP"; then +set dummy grep ggrep; ac_prog_name=$2 +if test "${ac_cv_path_GREP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - if test -z "$GREP"; then ac_path_GREP_found=false - # Loop through the user's path and test for each of PROGNAME-LIST - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +# Loop through the user's path and test for each of PROGNAME-LIST +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_prog in grep ggrep; do - for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" - { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue -# Check for GNU ac_path_GREP and select it if it is found. + for ac_prog in grep ggrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" + { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue + # Check for GNU ac_path_GREP and select it if it is found. # Check for GNU $ac_path_GREP case `"$ac_path_GREP" --version 2>&1` in *GNU*) ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; *) ac_count=0 - $as_echo_n 0123456789 >"conftest.in" + echo $ECHO_N "0123456789$ECHO_C" >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" - $as_echo 'GREP' >> "conftest.nl" + echo 'GREP' >> "conftest.nl" "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break - as_fn_arith $ac_count + 1 && ac_count=$as_val + ac_count=`expr $ac_count + 1` if test $ac_count -gt ${ac_path_GREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_GREP="$ac_path_GREP" @@ -3963,61 +4250,77 @@ case `"$ac_path_GREP" --version 2>&1` in rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac - $ac_path_GREP_found && break 3 - done - done + + $ac_path_GREP_found && break 3 done +done + +done IFS=$as_save_IFS - if test -z "$ac_cv_path_GREP"; then - as_fn_error "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 - fi + + +fi + +GREP="$ac_cv_path_GREP" +if test -z "$GREP"; then + { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 +echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} + { (exit 1); exit 1; }; } +fi + else ac_cv_path_GREP=$GREP fi + fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 -$as_echo "$ac_cv_path_GREP" >&6; } +{ echo "$as_me:$LINENO: result: $ac_cv_path_GREP" >&5 +echo "${ECHO_T}$ac_cv_path_GREP" >&6; } GREP="$ac_cv_path_GREP" -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 -$as_echo_n "checking for egrep... " >&6; } -if test "${ac_cv_path_EGREP+set}" = set; then : - $as_echo_n "(cached) " >&6 +{ echo "$as_me:$LINENO: checking for egrep" >&5 +echo $ECHO_N "checking for egrep... $ECHO_C" >&6; } +if test "${ac_cv_path_EGREP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 then ac_cv_path_EGREP="$GREP -E" else - if test -z "$EGREP"; then + # Extract the first word of "egrep" to use in msg output +if test -z "$EGREP"; then +set dummy egrep; ac_prog_name=$2 +if test "${ac_cv_path_EGREP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else ac_path_EGREP_found=false - # Loop through the user's path and test for each of PROGNAME-LIST - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +# Loop through the user's path and test for each of PROGNAME-LIST +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_prog in egrep; do - for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" - { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue -# Check for GNU ac_path_EGREP and select it if it is found. + for ac_prog in egrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" + { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue + # Check for GNU ac_path_EGREP and select it if it is found. # Check for GNU $ac_path_EGREP case `"$ac_path_EGREP" --version 2>&1` in *GNU*) ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; *) ac_count=0 - $as_echo_n 0123456789 >"conftest.in" + echo $ECHO_N "0123456789$ECHO_C" >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" - $as_echo 'EGREP' >> "conftest.nl" + echo 'EGREP' >> "conftest.nl" "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break - as_fn_arith $ac_count + 1 && ac_count=$as_val + ac_count=`expr $ac_count + 1` if test $ac_count -gt ${ac_path_EGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_EGREP="$ac_path_EGREP" @@ -4029,31 +4332,46 @@ case `"$ac_path_EGREP" --version 2>&1` in rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac - $ac_path_EGREP_found && break 3 - done - done + + $ac_path_EGREP_found && break 3 done +done + +done IFS=$as_save_IFS - if test -z "$ac_cv_path_EGREP"; then - as_fn_error "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 - fi + + +fi + +EGREP="$ac_cv_path_EGREP" +if test -z "$EGREP"; then + { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 +echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} + { (exit 1); exit 1; }; } +fi + else ac_cv_path_EGREP=$EGREP fi + fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 -$as_echo "$ac_cv_path_EGREP" >&6; } +{ echo "$as_me:$LINENO: result: $ac_cv_path_EGREP" >&5 +echo "${ECHO_T}$ac_cv_path_EGREP" >&6; } EGREP="$ac_cv_path_EGREP" -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 -$as_echo_n "checking for ANSI C header files... " >&6; } -if test "${ac_cv_header_stdc+set}" = set; then : - $as_echo_n "(cached) " >&6 +{ echo "$as_me:$LINENO: checking for ANSI C header files" >&5 +echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6; } +if test "${ac_cv_header_stdc+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <stdlib.h> #include <stdarg.h> @@ -4068,23 +4386,47 @@ main () return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_cv_header_stdc=yes else - ac_cv_header_stdc=no + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_header_stdc=no fi + rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <string.h> _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "memchr" >/dev/null 2>&1; then : - + $EGREP "memchr" >/dev/null 2>&1; then + : else ac_cv_header_stdc=no fi @@ -4094,14 +4436,18 @@ fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <stdlib.h> _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "free" >/dev/null 2>&1; then : - + $EGREP "free" >/dev/null 2>&1; then + : else ac_cv_header_stdc=no fi @@ -4111,10 +4457,14 @@ fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. - if test "$cross_compiling" = yes; then : + if test "$cross_compiling" = yes; then : else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <ctype.h> #include <stdlib.h> @@ -4141,36 +4491,113 @@ main () return 0; } _ACEOF -if ac_fn_c_try_run "$LINENO"; then : - +rm -f conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + : else - ac_cv_header_stdc=no + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +ac_cv_header_stdc=no fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi + fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 -$as_echo "$ac_cv_header_stdc" >&6; } +{ echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 +echo "${ECHO_T}$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then -$as_echo "#define STDC_HEADERS 1" >>confdefs.h +cat >>confdefs.h <<\_ACEOF +#define STDC_HEADERS 1 +_ACEOF fi # On IRIX 5.3, sys/types and inttypes.h are conflicting. + + + + + + + + + for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ inttypes.h stdint.h unistd.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default -" -eval as_val=\$$as_ac_Header - if test "x$as_val" = x""yes; then : +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +{ echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default + +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + eval "$as_ac_Header=yes" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + eval "$as_ac_Header=no" +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi @@ -4178,254 +4605,280 @@ fi done - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether byte ordering is bigendian" >&5 -$as_echo_n "checking whether byte ordering is bigendian... " >&6; } -if test "${ac_cv_c_bigendian+set}" = set; then : - $as_echo_n "(cached) " >&6 +{ echo "$as_me:$LINENO: checking whether byte ordering is bigendian" >&5 +echo $ECHO_N "checking whether byte ordering is bigendian... $ECHO_C" >&6; } +if test "${ac_cv_c_bigendian+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - ac_cv_c_bigendian=unknown - # See if we're dealing with a universal compiler. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#ifndef __APPLE_CC__ - not a universal capable compiler - #endif - typedef int dummy; - -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - - # Check for potential -arch flags. It is not universal unless - # there are at least two -arch flags with different values. - ac_arch= - ac_prev= - for ac_word in $CC $CFLAGS $CPPFLAGS $LDFLAGS; do - if test -n "$ac_prev"; then - case $ac_word in - i?86 | x86_64 | ppc | ppc64) - if test -z "$ac_arch" || test "$ac_arch" = "$ac_word"; then - ac_arch=$ac_word - else - ac_cv_c_bigendian=universal - break - fi - ;; - esac - ac_prev= - elif test "x$ac_word" = "x-arch"; then - ac_prev=arch - fi - done -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - if test $ac_cv_c_bigendian = unknown; then - # See if sys/param.h defines the BYTE_ORDER macro. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + # See if sys/param.h defines the BYTE_ORDER macro. +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <sys/types.h> - #include <sys/param.h> +#include <sys/param.h> int main () { -#if ! (defined BYTE_ORDER && defined BIG_ENDIAN \ - && defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN \ - && LITTLE_ENDIAN) - bogus endian macros - #endif +#if ! (defined BYTE_ORDER && defined BIG_ENDIAN && defined LITTLE_ENDIAN \ + && BYTE_ORDER && BIG_ENDIAN && LITTLE_ENDIAN) + bogus endian macros +#endif ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then # It does; now see whether it defined to BIG_ENDIAN or not. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <sys/types.h> - #include <sys/param.h> +#include <sys/param.h> int main () { #if BYTE_ORDER != BIG_ENDIAN - not big endian - #endif + not big endian +#endif ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_cv_c_bigendian=yes else - ac_cv_c_bigendian=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_c_bigendian=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - fi - if test $ac_cv_c_bigendian = unknown; then - # See if <limits.h> defines _LITTLE_ENDIAN or _BIG_ENDIAN (e.g., Solaris). - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include <limits.h> -int -main () -{ -#if ! (defined _LITTLE_ENDIAN || defined _BIG_ENDIAN) - bogus endian macros - #endif +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 - ; - return 0; -} + # It does not; compile a test program. +if test "$cross_compiling" = yes; then + # try to guess the endianness by grepping values into an object file + ac_cv_c_bigendian=unknown + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - # It does; now see whether it defined to _BIG_ENDIAN or not. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include <limits.h> - +short int ascii_mm[] = { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 }; +short int ascii_ii[] = { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 }; +void _ascii () { char *s = (char *) ascii_mm; s = (char *) ascii_ii; } +short int ebcdic_ii[] = { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 }; +short int ebcdic_mm[] = { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 }; +void _ebcdic () { char *s = (char *) ebcdic_mm; s = (char *) ebcdic_ii; } int main () { -#ifndef _BIG_ENDIAN - not big endian - #endif - + _ascii (); _ebcdic (); ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + if grep BIGenDianSyS conftest.$ac_objext >/dev/null ; then ac_cv_c_bigendian=yes -else - ac_cv_c_bigendian=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then + if test "$ac_cv_c_bigendian" = unknown; then + ac_cv_c_bigendian=no + else + # finding both strings is unlikely to happen, but who knows? + ac_cv_c_bigendian=unknown + fi fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - fi - if test $ac_cv_c_bigendian = unknown; then - # Compile a test program. - if test "$cross_compiling" = yes; then : - # Try to guess by grepping values from an object file. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -short int ascii_mm[] = - { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 }; - short int ascii_ii[] = - { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 }; - int use_ascii (int i) { - return ascii_mm[i] + ascii_ii[i]; - } - short int ebcdic_ii[] = - { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 }; - short int ebcdic_mm[] = - { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 }; - int use_ebcdic (int i) { - return ebcdic_mm[i] + ebcdic_ii[i]; - } - extern int foo; +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + -int -main () -{ -return use_ascii (foo) == use_ebcdic (foo); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - if grep BIGenDianSyS conftest.$ac_objext >/dev/null; then - ac_cv_c_bigendian=yes - fi - if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then - if test "$ac_cv_c_bigendian" = unknown; then - ac_cv_c_bigendian=no - else - # finding both strings is unlikely to happen, but who knows? - ac_cv_c_bigendian=unknown - fi - fi fi + rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { - /* Are we little or big endian? From Harbison&Steele. */ - union - { - long int l; - char c[sizeof (long int)]; - } u; - u.l = 1; - return u.c[sizeof (long int) - 1] == 1; + /* Are we little or big endian? From Harbison&Steele. */ + union + { + long int l; + char c[sizeof (long int)]; + } u; + u.l = 1; + return u.c[sizeof (long int) - 1] == 1; ; return 0; } _ACEOF -if ac_fn_c_try_run "$LINENO"; then : +rm -f conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then ac_cv_c_bigendian=no else - ac_cv_c_bigendian=yes + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +ac_cv_c_bigendian=yes fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi - fi + fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_bigendian" >&5 -$as_echo "$ac_cv_c_bigendian" >&6; } - case $ac_cv_c_bigendian in #( - yes) - $as_echo "#define WORDS_BIGENDIAN 1" >>confdefs.h -;; #( - no) - ;; #( - universal) -$as_echo "#define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $ac_cv_c_bigendian" >&5 +echo "${ECHO_T}$ac_cv_c_bigendian" >&6; } +case $ac_cv_c_bigendian in + yes) - ;; #( - *) - as_fn_error "unknown endianness - presetting ac_cv_c_bigendian=no (or yes) will help" "$LINENO" 5 ;; - esac +cat >>confdefs.h <<\_ACEOF +#define WORDS_BIGENDIAN 1 +_ACEOF + ;; + no) + ;; + *) + { { echo "$as_me:$LINENO: error: unknown endianness +presetting ac_cv_c_bigendian=no (or yes) will help" >&5 +echo "$as_me: error: unknown endianness +presetting ac_cv_c_bigendian=no (or yes) will help" >&2;} + { (exit 1); exit 1; }; } ;; +esac case $target in *mingw* | *cygw* | *win32* | *w32* ) - $as_echo "#define PJ_WIN32 1" >>confdefs.h + cat >>confdefs.h <<\_ACEOF +#define PJ_WIN32 1 +_ACEOF - $as_echo "#define PJ_WIN32_WINNT 0x0400" >>confdefs.h + cat >>confdefs.h <<\_ACEOF +#define PJ_WIN32_WINNT 0x0400 +_ACEOF - $as_echo "#define WIN32_LEAN_AND_MEAN 1" >>confdefs.h + cat >>confdefs.h <<\_ACEOF +#define WIN32_LEAN_AND_MEAN 1 +_ACEOF ;; *darwin*) - $as_echo "#define PJ_DARWINOS 1" >>confdefs.h + cat >>confdefs.h <<\_ACEOF +#define PJ_DARWINOS 1 +_ACEOF ;; *linux*) - $as_echo "#define PJ_LINUX 1" >>confdefs.h + cat >>confdefs.h <<\_ACEOF +#define PJ_LINUX 1 +_ACEOF ;; *rtems*) - $as_echo "#define PJ_RTEMS 1" >>confdefs.h + cat >>confdefs.h <<\_ACEOF +#define PJ_RTEMS 1 +_ACEOF ;; *sunos* | *solaris* ) - $as_echo "#define PJ_SUNOS 1" >>confdefs.h + cat >>confdefs.h <<\_ACEOF +#define PJ_SUNOS 1 +_ACEOF ;; *) @@ -4436,27 +4889,36 @@ esac # Check whether --enable-floating-point was given. -if test "${enable_floating_point+set}" = set; then : +if test "${enable_floating_point+set}" = set; then enableval=$enable_floating_point; if test "$enable_floating_point" = "no"; then - $as_echo "#define PJ_HAS_FLOATING_POINT 0" >>confdefs.h + cat >>confdefs.h <<\_ACEOF +#define PJ_HAS_FLOATING_POINT 0 +_ACEOF - { $as_echo "$as_me:${as_lineno-$LINENO}: result: Checking if floating point is disabled... yes" >&5 -$as_echo "Checking if floating point is disabled... yes" >&6; } + { echo "$as_me:$LINENO: result: Checking if floating point is disabled... yes" >&5 +echo "${ECHO_T}Checking if floating point is disabled... yes" >&6; } fi else - $as_echo "#define PJ_HAS_FLOATING_POINT 1" >>confdefs.h + cat >>confdefs.h <<\_ACEOF +#define PJ_HAS_FLOATING_POINT 1 +_ACEOF + + { echo "$as_me:$LINENO: result: Checking if floating point is disabled... no" >&5 +echo "${ECHO_T}Checking if floating point is disabled... no" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: Checking if floating point is disabled... no" >&5 -$as_echo "Checking if floating point is disabled... no" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for fmod in -lm" >&5 -$as_echo_n "checking for fmod in -lm... " >&6; } -if test "${ac_cv_lib_m_fmod+set}" = set; then : - $as_echo_n "(cached) " >&6 +{ echo "$as_me:$LINENO: checking for fmod in -lm" >&5 +echo $ECHO_N "checking for fmod in -lm... $ECHO_C" >&6; } +if test "${ac_cv_lib_m_fmod+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lm $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. @@ -4474,18 +4936,39 @@ return fmod (); return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then ac_cv_lib_m_fmod=yes else - ac_cv_lib_m_fmod=no + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_lib_m_fmod=no fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_fmod" >&5 -$as_echo "$ac_cv_lib_m_fmod" >&6; } -if test "x$ac_cv_lib_m_fmod" = x""yes; then : +{ echo "$as_me:$LINENO: result: $ac_cv_lib_m_fmod" >&5 +echo "${ECHO_T}$ac_cv_lib_m_fmod" >&6; } +if test $ac_cv_lib_m_fmod = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBM 1 _ACEOF @@ -4499,303 +4982,4488 @@ fi -ac_fn_c_check_header_mongrel "$LINENO" "arpa/inet.h" "ac_cv_header_arpa_inet_h" "$ac_includes_default" -if test "x$ac_cv_header_arpa_inet_h" = x""yes; then : - $as_echo "#define PJ_HAS_ARPA_INET_H 1" >>confdefs.h +if test "${ac_cv_header_arpa_inet_h+set}" = set; then + { echo "$as_me:$LINENO: checking for arpa/inet.h" >&5 +echo $ECHO_N "checking for arpa/inet.h... $ECHO_C" >&6; } +if test "${ac_cv_header_arpa_inet_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +{ echo "$as_me:$LINENO: result: $ac_cv_header_arpa_inet_h" >&5 +echo "${ECHO_T}$ac_cv_header_arpa_inet_h" >&6; } +else + # Is the header compilable? +{ echo "$as_me:$LINENO: checking arpa/inet.h usability" >&5 +echo $ECHO_N "checking arpa/inet.h usability... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include <arpa/inet.h> +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_header_compiler=no fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } -ac_fn_c_check_header_mongrel "$LINENO" "assert.h" "ac_cv_header_assert_h" "$ac_includes_default" -if test "x$ac_cv_header_assert_h" = x""yes; then : - $as_echo "#define PJ_HAS_ASSERT_H 1" >>confdefs.h +# Is the header present? +{ echo "$as_me:$LINENO: checking arpa/inet.h presence" >&5 +echo $ECHO_N "checking arpa/inet.h presence... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <arpa/inet.h> +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_header_preproc=no fi +rm -f conftest.err conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } -ac_fn_c_check_header_mongrel "$LINENO" "ctype.h" "ac_cv_header_ctype_h" "$ac_includes_default" -if test "x$ac_cv_header_ctype_h" = x""yes; then : - $as_echo "#define PJ_HAS_CTYPE_H 1" >>confdefs.h +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: arpa/inet.h: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: arpa/inet.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: arpa/inet.h: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: arpa/inet.h: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: arpa/inet.h: present but cannot be compiled" >&5 +echo "$as_me: WARNING: arpa/inet.h: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: arpa/inet.h: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: arpa/inet.h: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: arpa/inet.h: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: arpa/inet.h: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: arpa/inet.h: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: arpa/inet.h: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: arpa/inet.h: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: arpa/inet.h: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: arpa/inet.h: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: arpa/inet.h: in the future, the compiler will take precedence" >&2;} + ;; +esac +{ echo "$as_me:$LINENO: checking for arpa/inet.h" >&5 +echo $ECHO_N "checking for arpa/inet.h... $ECHO_C" >&6; } +if test "${ac_cv_header_arpa_inet_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_header_arpa_inet_h=$ac_header_preproc fi +{ echo "$as_me:$LINENO: result: $ac_cv_header_arpa_inet_h" >&5 +echo "${ECHO_T}$ac_cv_header_arpa_inet_h" >&6; } +fi +if test $ac_cv_header_arpa_inet_h = yes; then + cat >>confdefs.h <<\_ACEOF +#define PJ_HAS_ARPA_INET_H 1 +_ACEOF +fi -case $target in - *mingw* | *cygw* | *win32* | *w32* ) - $as_echo "#define PJ_HAS_ERRNO_H 0" >>confdefs.h - ;; - *) - ac_fn_c_check_header_mongrel "$LINENO" "errno.h" "ac_cv_header_errno_h" "$ac_includes_default" -if test "x$ac_cv_header_errno_h" = x""yes; then : - $as_echo "#define PJ_HAS_ERRNO_H 1" >>confdefs.h +if test "${ac_cv_header_assert_h+set}" = set; then + { echo "$as_me:$LINENO: checking for assert.h" >&5 +echo $ECHO_N "checking for assert.h... $ECHO_C" >&6; } +if test "${ac_cv_header_assert_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +{ echo "$as_me:$LINENO: result: $ac_cv_header_assert_h" >&5 +echo "${ECHO_T}$ac_cv_header_assert_h" >&6; } +else + # Is the header compilable? +{ echo "$as_me:$LINENO: checking assert.h usability" >&5 +echo $ECHO_N "checking assert.h usability... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include <assert.h> +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_compiler=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } + +# Is the header present? +{ echo "$as_me:$LINENO: checking assert.h presence" >&5 +echo $ECHO_N "checking assert.h presence... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <assert.h> +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi + +rm -f conftest.err conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: assert.h: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: assert.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: assert.h: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: assert.h: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: assert.h: present but cannot be compiled" >&5 +echo "$as_me: WARNING: assert.h: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: assert.h: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: assert.h: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: assert.h: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: assert.h: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: assert.h: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: assert.h: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: assert.h: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: assert.h: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: assert.h: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: assert.h: in the future, the compiler will take precedence" >&2;} + + ;; +esac +{ echo "$as_me:$LINENO: checking for assert.h" >&5 +echo $ECHO_N "checking for assert.h... $ECHO_C" >&6; } +if test "${ac_cv_header_assert_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_header_assert_h=$ac_header_preproc +fi +{ echo "$as_me:$LINENO: result: $ac_cv_header_assert_h" >&5 +echo "${ECHO_T}$ac_cv_header_assert_h" >&6; } + +fi +if test $ac_cv_header_assert_h = yes; then + cat >>confdefs.h <<\_ACEOF +#define PJ_HAS_ASSERT_H 1 +_ACEOF + +fi + + +if test "${ac_cv_header_ctype_h+set}" = set; then + { echo "$as_me:$LINENO: checking for ctype.h" >&5 +echo $ECHO_N "checking for ctype.h... $ECHO_C" >&6; } +if test "${ac_cv_header_ctype_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +{ echo "$as_me:$LINENO: result: $ac_cv_header_ctype_h" >&5 +echo "${ECHO_T}$ac_cv_header_ctype_h" >&6; } +else + # Is the header compilable? +{ echo "$as_me:$LINENO: checking ctype.h usability" >&5 +echo $ECHO_N "checking ctype.h usability... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include <ctype.h> +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_compiler=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } + +# Is the header present? +{ echo "$as_me:$LINENO: checking ctype.h presence" >&5 +echo $ECHO_N "checking ctype.h presence... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <ctype.h> +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi + +rm -f conftest.err conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: ctype.h: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: ctype.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: ctype.h: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: ctype.h: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: ctype.h: present but cannot be compiled" >&5 +echo "$as_me: WARNING: ctype.h: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: ctype.h: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: ctype.h: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: ctype.h: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: ctype.h: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: ctype.h: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: ctype.h: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: ctype.h: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: ctype.h: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: ctype.h: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: ctype.h: in the future, the compiler will take precedence" >&2;} + + ;; +esac +{ echo "$as_me:$LINENO: checking for ctype.h" >&5 +echo $ECHO_N "checking for ctype.h... $ECHO_C" >&6; } +if test "${ac_cv_header_ctype_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_header_ctype_h=$ac_header_preproc +fi +{ echo "$as_me:$LINENO: result: $ac_cv_header_ctype_h" >&5 +echo "${ECHO_T}$ac_cv_header_ctype_h" >&6; } + +fi +if test $ac_cv_header_ctype_h = yes; then + cat >>confdefs.h <<\_ACEOF +#define PJ_HAS_CTYPE_H 1 +_ACEOF + +fi + + + +case $target in + *mingw* | *cygw* | *win32* | *w32* ) + cat >>confdefs.h <<\_ACEOF +#define PJ_HAS_ERRNO_H 0 +_ACEOF + + ;; + *) + if test "${ac_cv_header_errno_h+set}" = set; then + { echo "$as_me:$LINENO: checking for errno.h" >&5 +echo $ECHO_N "checking for errno.h... $ECHO_C" >&6; } +if test "${ac_cv_header_errno_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +{ echo "$as_me:$LINENO: result: $ac_cv_header_errno_h" >&5 +echo "${ECHO_T}$ac_cv_header_errno_h" >&6; } +else + # Is the header compilable? +{ echo "$as_me:$LINENO: checking errno.h usability" >&5 +echo $ECHO_N "checking errno.h usability... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include <errno.h> +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_compiler=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } + +# Is the header present? +{ echo "$as_me:$LINENO: checking errno.h presence" >&5 +echo $ECHO_N "checking errno.h presence... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <errno.h> +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi + +rm -f conftest.err conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: errno.h: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: errno.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: errno.h: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: errno.h: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: errno.h: present but cannot be compiled" >&5 +echo "$as_me: WARNING: errno.h: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: errno.h: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: errno.h: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: errno.h: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: errno.h: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: errno.h: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: errno.h: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: errno.h: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: errno.h: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: errno.h: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: errno.h: in the future, the compiler will take precedence" >&2;} + + ;; +esac +{ echo "$as_me:$LINENO: checking for errno.h" >&5 +echo $ECHO_N "checking for errno.h... $ECHO_C" >&6; } +if test "${ac_cv_header_errno_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_header_errno_h=$ac_header_preproc +fi +{ echo "$as_me:$LINENO: result: $ac_cv_header_errno_h" >&5 +echo "${ECHO_T}$ac_cv_header_errno_h" >&6; } + +fi +if test $ac_cv_header_errno_h = yes; then + cat >>confdefs.h <<\_ACEOF +#define PJ_HAS_ERRNO_H 1 +_ACEOF + +fi + + + ;; +esac + +if test "${ac_cv_header_fcntl_h+set}" = set; then + { echo "$as_me:$LINENO: checking for fcntl.h" >&5 +echo $ECHO_N "checking for fcntl.h... $ECHO_C" >&6; } +if test "${ac_cv_header_fcntl_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +{ echo "$as_me:$LINENO: result: $ac_cv_header_fcntl_h" >&5 +echo "${ECHO_T}$ac_cv_header_fcntl_h" >&6; } +else + # Is the header compilable? +{ echo "$as_me:$LINENO: checking fcntl.h usability" >&5 +echo $ECHO_N "checking fcntl.h usability... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include <fcntl.h> +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_compiler=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } + +# Is the header present? +{ echo "$as_me:$LINENO: checking fcntl.h presence" >&5 +echo $ECHO_N "checking fcntl.h presence... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <fcntl.h> +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi + +rm -f conftest.err conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: fcntl.h: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: fcntl.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: fcntl.h: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: fcntl.h: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: fcntl.h: present but cannot be compiled" >&5 +echo "$as_me: WARNING: fcntl.h: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: fcntl.h: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: fcntl.h: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: fcntl.h: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: fcntl.h: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: fcntl.h: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: fcntl.h: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: fcntl.h: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: fcntl.h: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: fcntl.h: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: fcntl.h: in the future, the compiler will take precedence" >&2;} + + ;; +esac +{ echo "$as_me:$LINENO: checking for fcntl.h" >&5 +echo $ECHO_N "checking for fcntl.h... $ECHO_C" >&6; } +if test "${ac_cv_header_fcntl_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_header_fcntl_h=$ac_header_preproc +fi +{ echo "$as_me:$LINENO: result: $ac_cv_header_fcntl_h" >&5 +echo "${ECHO_T}$ac_cv_header_fcntl_h" >&6; } + +fi +if test $ac_cv_header_fcntl_h = yes; then + cat >>confdefs.h <<\_ACEOF +#define PJ_HAS_FCNTL_H 1 +_ACEOF + +fi + + +if test "${ac_cv_header_linux_socket_h+set}" = set; then + { echo "$as_me:$LINENO: checking for linux/socket.h" >&5 +echo $ECHO_N "checking for linux/socket.h... $ECHO_C" >&6; } +if test "${ac_cv_header_linux_socket_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +{ echo "$as_me:$LINENO: result: $ac_cv_header_linux_socket_h" >&5 +echo "${ECHO_T}$ac_cv_header_linux_socket_h" >&6; } +else + # Is the header compilable? +{ echo "$as_me:$LINENO: checking linux/socket.h usability" >&5 +echo $ECHO_N "checking linux/socket.h usability... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include <linux/socket.h> +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_compiler=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } + +# Is the header present? +{ echo "$as_me:$LINENO: checking linux/socket.h presence" >&5 +echo $ECHO_N "checking linux/socket.h presence... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <linux/socket.h> +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi + +rm -f conftest.err conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: linux/socket.h: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: linux/socket.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: linux/socket.h: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: linux/socket.h: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: linux/socket.h: present but cannot be compiled" >&5 +echo "$as_me: WARNING: linux/socket.h: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: linux/socket.h: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: linux/socket.h: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: linux/socket.h: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: linux/socket.h: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: linux/socket.h: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: linux/socket.h: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: linux/socket.h: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: linux/socket.h: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: linux/socket.h: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: linux/socket.h: in the future, the compiler will take precedence" >&2;} + + ;; +esac +{ echo "$as_me:$LINENO: checking for linux/socket.h" >&5 +echo $ECHO_N "checking for linux/socket.h... $ECHO_C" >&6; } +if test "${ac_cv_header_linux_socket_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_header_linux_socket_h=$ac_header_preproc +fi +{ echo "$as_me:$LINENO: result: $ac_cv_header_linux_socket_h" >&5 +echo "${ECHO_T}$ac_cv_header_linux_socket_h" >&6; } + +fi +if test $ac_cv_header_linux_socket_h = yes; then + cat >>confdefs.h <<\_ACEOF +#define PJ_HAS_LINUX_SOCKET_H 1 +_ACEOF + +fi + + +if test "${ac_cv_header_malloc_h+set}" = set; then + { echo "$as_me:$LINENO: checking for malloc.h" >&5 +echo $ECHO_N "checking for malloc.h... $ECHO_C" >&6; } +if test "${ac_cv_header_malloc_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +{ echo "$as_me:$LINENO: result: $ac_cv_header_malloc_h" >&5 +echo "${ECHO_T}$ac_cv_header_malloc_h" >&6; } +else + # Is the header compilable? +{ echo "$as_me:$LINENO: checking malloc.h usability" >&5 +echo $ECHO_N "checking malloc.h usability... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include <malloc.h> +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_compiler=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } + +# Is the header present? +{ echo "$as_me:$LINENO: checking malloc.h presence" >&5 +echo $ECHO_N "checking malloc.h presence... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <malloc.h> +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi + +rm -f conftest.err conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: malloc.h: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: malloc.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: malloc.h: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: malloc.h: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: malloc.h: present but cannot be compiled" >&5 +echo "$as_me: WARNING: malloc.h: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: malloc.h: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: malloc.h: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: malloc.h: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: malloc.h: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: malloc.h: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: malloc.h: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: malloc.h: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: malloc.h: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: malloc.h: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: malloc.h: in the future, the compiler will take precedence" >&2;} + + ;; +esac +{ echo "$as_me:$LINENO: checking for malloc.h" >&5 +echo $ECHO_N "checking for malloc.h... $ECHO_C" >&6; } +if test "${ac_cv_header_malloc_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_header_malloc_h=$ac_header_preproc +fi +{ echo "$as_me:$LINENO: result: $ac_cv_header_malloc_h" >&5 +echo "${ECHO_T}$ac_cv_header_malloc_h" >&6; } + +fi +if test $ac_cv_header_malloc_h = yes; then + cat >>confdefs.h <<\_ACEOF +#define PJ_HAS_MALLOC_H 1 +_ACEOF + +fi + + +if test "${ac_cv_header_netdb_h+set}" = set; then + { echo "$as_me:$LINENO: checking for netdb.h" >&5 +echo $ECHO_N "checking for netdb.h... $ECHO_C" >&6; } +if test "${ac_cv_header_netdb_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +{ echo "$as_me:$LINENO: result: $ac_cv_header_netdb_h" >&5 +echo "${ECHO_T}$ac_cv_header_netdb_h" >&6; } +else + # Is the header compilable? +{ echo "$as_me:$LINENO: checking netdb.h usability" >&5 +echo $ECHO_N "checking netdb.h usability... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include <netdb.h> +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_compiler=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } + +# Is the header present? +{ echo "$as_me:$LINENO: checking netdb.h presence" >&5 +echo $ECHO_N "checking netdb.h presence... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <netdb.h> +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi + +rm -f conftest.err conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: netdb.h: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: netdb.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: netdb.h: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: netdb.h: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: netdb.h: present but cannot be compiled" >&5 +echo "$as_me: WARNING: netdb.h: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: netdb.h: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: netdb.h: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: netdb.h: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: netdb.h: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: netdb.h: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: netdb.h: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: netdb.h: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: netdb.h: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: netdb.h: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: netdb.h: in the future, the compiler will take precedence" >&2;} + + ;; +esac +{ echo "$as_me:$LINENO: checking for netdb.h" >&5 +echo $ECHO_N "checking for netdb.h... $ECHO_C" >&6; } +if test "${ac_cv_header_netdb_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_header_netdb_h=$ac_header_preproc +fi +{ echo "$as_me:$LINENO: result: $ac_cv_header_netdb_h" >&5 +echo "${ECHO_T}$ac_cv_header_netdb_h" >&6; } + +fi +if test $ac_cv_header_netdb_h = yes; then + cat >>confdefs.h <<\_ACEOF +#define PJ_HAS_NETDB_H 1 +_ACEOF + +fi + + +if test "${ac_cv_header_netinet_in_systm_h+set}" = set; then + { echo "$as_me:$LINENO: checking for netinet/in_systm.h" >&5 +echo $ECHO_N "checking for netinet/in_systm.h... $ECHO_C" >&6; } +if test "${ac_cv_header_netinet_in_systm_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +{ echo "$as_me:$LINENO: result: $ac_cv_header_netinet_in_systm_h" >&5 +echo "${ECHO_T}$ac_cv_header_netinet_in_systm_h" >&6; } +else + # Is the header compilable? +{ echo "$as_me:$LINENO: checking netinet/in_systm.h usability" >&5 +echo $ECHO_N "checking netinet/in_systm.h usability... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include <netinet/in_systm.h> +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_compiler=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } + +# Is the header present? +{ echo "$as_me:$LINENO: checking netinet/in_systm.h presence" >&5 +echo $ECHO_N "checking netinet/in_systm.h presence... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <netinet/in_systm.h> +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi + +rm -f conftest.err conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: netinet/in_systm.h: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: netinet/in_systm.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: netinet/in_systm.h: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: netinet/in_systm.h: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: netinet/in_systm.h: present but cannot be compiled" >&5 +echo "$as_me: WARNING: netinet/in_systm.h: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: netinet/in_systm.h: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: netinet/in_systm.h: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: netinet/in_systm.h: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: netinet/in_systm.h: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: netinet/in_systm.h: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: netinet/in_systm.h: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: netinet/in_systm.h: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: netinet/in_systm.h: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: netinet/in_systm.h: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: netinet/in_systm.h: in the future, the compiler will take precedence" >&2;} + + ;; +esac +{ echo "$as_me:$LINENO: checking for netinet/in_systm.h" >&5 +echo $ECHO_N "checking for netinet/in_systm.h... $ECHO_C" >&6; } +if test "${ac_cv_header_netinet_in_systm_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_header_netinet_in_systm_h=$ac_header_preproc +fi +{ echo "$as_me:$LINENO: result: $ac_cv_header_netinet_in_systm_h" >&5 +echo "${ECHO_T}$ac_cv_header_netinet_in_systm_h" >&6; } + +fi +if test $ac_cv_header_netinet_in_systm_h = yes; then + cat >>confdefs.h <<\_ACEOF +#define PJ_HAS_NETINET_IN_SYSTM_H 1 +_ACEOF + +fi + + +if test "${ac_cv_header_netinet_in_h+set}" = set; then + { echo "$as_me:$LINENO: checking for netinet/in.h" >&5 +echo $ECHO_N "checking for netinet/in.h... $ECHO_C" >&6; } +if test "${ac_cv_header_netinet_in_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +{ echo "$as_me:$LINENO: result: $ac_cv_header_netinet_in_h" >&5 +echo "${ECHO_T}$ac_cv_header_netinet_in_h" >&6; } +else + # Is the header compilable? +{ echo "$as_me:$LINENO: checking netinet/in.h usability" >&5 +echo $ECHO_N "checking netinet/in.h usability... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include <netinet/in.h> +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_compiler=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } + +# Is the header present? +{ echo "$as_me:$LINENO: checking netinet/in.h presence" >&5 +echo $ECHO_N "checking netinet/in.h presence... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <netinet/in.h> +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi + +rm -f conftest.err conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: netinet/in.h: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: netinet/in.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: netinet/in.h: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: netinet/in.h: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: netinet/in.h: present but cannot be compiled" >&5 +echo "$as_me: WARNING: netinet/in.h: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: netinet/in.h: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: netinet/in.h: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: netinet/in.h: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: netinet/in.h: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: netinet/in.h: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: netinet/in.h: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: netinet/in.h: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: netinet/in.h: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: netinet/in.h: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: netinet/in.h: in the future, the compiler will take precedence" >&2;} + + ;; +esac +{ echo "$as_me:$LINENO: checking for netinet/in.h" >&5 +echo $ECHO_N "checking for netinet/in.h... $ECHO_C" >&6; } +if test "${ac_cv_header_netinet_in_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_header_netinet_in_h=$ac_header_preproc +fi +{ echo "$as_me:$LINENO: result: $ac_cv_header_netinet_in_h" >&5 +echo "${ECHO_T}$ac_cv_header_netinet_in_h" >&6; } + +fi +if test $ac_cv_header_netinet_in_h = yes; then + cat >>confdefs.h <<\_ACEOF +#define PJ_HAS_NETINET_IN_H 1 +_ACEOF + +fi + + +{ echo "$as_me:$LINENO: checking for netinet/ip.h" >&5 +echo $ECHO_N "checking for netinet/ip.h... $ECHO_C" >&6; } +if test "${ac_cv_header_netinet_ip_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#if PJ_HAS_NETINET_IN_SYSTM_H + # include <netinet/in_systm.h> + #endif + + +#include <netinet/ip.h> +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_header_netinet_ip_h=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_header_netinet_ip_h=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $ac_cv_header_netinet_ip_h" >&5 +echo "${ECHO_T}$ac_cv_header_netinet_ip_h" >&6; } +if test $ac_cv_header_netinet_ip_h = yes; then + cat >>confdefs.h <<\_ACEOF +#define PJ_HAS_NETINET_IP_H 1 +_ACEOF + +fi + + +if test "${ac_cv_header_netinet_tcp_h+set}" = set; then + { echo "$as_me:$LINENO: checking for netinet/tcp.h" >&5 +echo $ECHO_N "checking for netinet/tcp.h... $ECHO_C" >&6; } +if test "${ac_cv_header_netinet_tcp_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +{ echo "$as_me:$LINENO: result: $ac_cv_header_netinet_tcp_h" >&5 +echo "${ECHO_T}$ac_cv_header_netinet_tcp_h" >&6; } +else + # Is the header compilable? +{ echo "$as_me:$LINENO: checking netinet/tcp.h usability" >&5 +echo $ECHO_N "checking netinet/tcp.h usability... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include <netinet/tcp.h> +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_compiler=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } + +# Is the header present? +{ echo "$as_me:$LINENO: checking netinet/tcp.h presence" >&5 +echo $ECHO_N "checking netinet/tcp.h presence... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <netinet/tcp.h> +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi + +rm -f conftest.err conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: netinet/tcp.h: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: netinet/tcp.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: netinet/tcp.h: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: netinet/tcp.h: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: netinet/tcp.h: present but cannot be compiled" >&5 +echo "$as_me: WARNING: netinet/tcp.h: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: netinet/tcp.h: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: netinet/tcp.h: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: netinet/tcp.h: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: netinet/tcp.h: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: netinet/tcp.h: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: netinet/tcp.h: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: netinet/tcp.h: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: netinet/tcp.h: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: netinet/tcp.h: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: netinet/tcp.h: in the future, the compiler will take precedence" >&2;} + + ;; +esac +{ echo "$as_me:$LINENO: checking for netinet/tcp.h" >&5 +echo $ECHO_N "checking for netinet/tcp.h... $ECHO_C" >&6; } +if test "${ac_cv_header_netinet_tcp_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_header_netinet_tcp_h=$ac_header_preproc +fi +{ echo "$as_me:$LINENO: result: $ac_cv_header_netinet_tcp_h" >&5 +echo "${ECHO_T}$ac_cv_header_netinet_tcp_h" >&6; } + +fi +if test $ac_cv_header_netinet_tcp_h = yes; then + cat >>confdefs.h <<\_ACEOF +#define PJ_HAS_NETINET_TCP_H 1 +_ACEOF + +fi + + +if test "${ac_cv_header_ifaddrs_h+set}" = set; then + { echo "$as_me:$LINENO: checking for ifaddrs.h" >&5 +echo $ECHO_N "checking for ifaddrs.h... $ECHO_C" >&6; } +if test "${ac_cv_header_ifaddrs_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +{ echo "$as_me:$LINENO: result: $ac_cv_header_ifaddrs_h" >&5 +echo "${ECHO_T}$ac_cv_header_ifaddrs_h" >&6; } +else + # Is the header compilable? +{ echo "$as_me:$LINENO: checking ifaddrs.h usability" >&5 +echo $ECHO_N "checking ifaddrs.h usability... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include <ifaddrs.h> +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_compiler=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } + +# Is the header present? +{ echo "$as_me:$LINENO: checking ifaddrs.h presence" >&5 +echo $ECHO_N "checking ifaddrs.h presence... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <ifaddrs.h> +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi + +rm -f conftest.err conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: ifaddrs.h: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: ifaddrs.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: ifaddrs.h: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: ifaddrs.h: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: ifaddrs.h: present but cannot be compiled" >&5 +echo "$as_me: WARNING: ifaddrs.h: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: ifaddrs.h: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: ifaddrs.h: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: ifaddrs.h: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: ifaddrs.h: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: ifaddrs.h: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: ifaddrs.h: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: ifaddrs.h: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: ifaddrs.h: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: ifaddrs.h: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: ifaddrs.h: in the future, the compiler will take precedence" >&2;} + + ;; +esac +{ echo "$as_me:$LINENO: checking for ifaddrs.h" >&5 +echo $ECHO_N "checking for ifaddrs.h... $ECHO_C" >&6; } +if test "${ac_cv_header_ifaddrs_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_header_ifaddrs_h=$ac_header_preproc +fi +{ echo "$as_me:$LINENO: result: $ac_cv_header_ifaddrs_h" >&5 +echo "${ECHO_T}$ac_cv_header_ifaddrs_h" >&6; } + +fi +if test $ac_cv_header_ifaddrs_h = yes; then + cat >>confdefs.h <<\_ACEOF +#define PJ_HAS_IFADDRS_H 1 +_ACEOF + +fi + + +if test "${ac_cv_header_semaphore_h+set}" = set; then + { echo "$as_me:$LINENO: checking for semaphore.h" >&5 +echo $ECHO_N "checking for semaphore.h... $ECHO_C" >&6; } +if test "${ac_cv_header_semaphore_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +{ echo "$as_me:$LINENO: result: $ac_cv_header_semaphore_h" >&5 +echo "${ECHO_T}$ac_cv_header_semaphore_h" >&6; } +else + # Is the header compilable? +{ echo "$as_me:$LINENO: checking semaphore.h usability" >&5 +echo $ECHO_N "checking semaphore.h usability... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include <semaphore.h> +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_compiler=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } + +# Is the header present? +{ echo "$as_me:$LINENO: checking semaphore.h presence" >&5 +echo $ECHO_N "checking semaphore.h presence... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <semaphore.h> +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi + +rm -f conftest.err conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: semaphore.h: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: semaphore.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: semaphore.h: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: semaphore.h: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: semaphore.h: present but cannot be compiled" >&5 +echo "$as_me: WARNING: semaphore.h: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: semaphore.h: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: semaphore.h: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: semaphore.h: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: semaphore.h: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: semaphore.h: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: semaphore.h: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: semaphore.h: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: semaphore.h: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: semaphore.h: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: semaphore.h: in the future, the compiler will take precedence" >&2;} + + ;; +esac +{ echo "$as_me:$LINENO: checking for semaphore.h" >&5 +echo $ECHO_N "checking for semaphore.h... $ECHO_C" >&6; } +if test "${ac_cv_header_semaphore_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_header_semaphore_h=$ac_header_preproc +fi +{ echo "$as_me:$LINENO: result: $ac_cv_header_semaphore_h" >&5 +echo "${ECHO_T}$ac_cv_header_semaphore_h" >&6; } + +fi +if test $ac_cv_header_semaphore_h = yes; then + cat >>confdefs.h <<\_ACEOF +#define PJ_HAS_SEMAPHORE_H 1 +_ACEOF + +fi + + +if test "${ac_cv_header_setjmp_h+set}" = set; then + { echo "$as_me:$LINENO: checking for setjmp.h" >&5 +echo $ECHO_N "checking for setjmp.h... $ECHO_C" >&6; } +if test "${ac_cv_header_setjmp_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +{ echo "$as_me:$LINENO: result: $ac_cv_header_setjmp_h" >&5 +echo "${ECHO_T}$ac_cv_header_setjmp_h" >&6; } +else + # Is the header compilable? +{ echo "$as_me:$LINENO: checking setjmp.h usability" >&5 +echo $ECHO_N "checking setjmp.h usability... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include <setjmp.h> +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_compiler=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } + +# Is the header present? +{ echo "$as_me:$LINENO: checking setjmp.h presence" >&5 +echo $ECHO_N "checking setjmp.h presence... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <setjmp.h> +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi + +rm -f conftest.err conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: setjmp.h: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: setjmp.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: setjmp.h: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: setjmp.h: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: setjmp.h: present but cannot be compiled" >&5 +echo "$as_me: WARNING: setjmp.h: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: setjmp.h: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: setjmp.h: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: setjmp.h: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: setjmp.h: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: setjmp.h: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: setjmp.h: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: setjmp.h: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: setjmp.h: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: setjmp.h: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: setjmp.h: in the future, the compiler will take precedence" >&2;} + + ;; +esac +{ echo "$as_me:$LINENO: checking for setjmp.h" >&5 +echo $ECHO_N "checking for setjmp.h... $ECHO_C" >&6; } +if test "${ac_cv_header_setjmp_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_header_setjmp_h=$ac_header_preproc +fi +{ echo "$as_me:$LINENO: result: $ac_cv_header_setjmp_h" >&5 +echo "${ECHO_T}$ac_cv_header_setjmp_h" >&6; } + +fi +if test $ac_cv_header_setjmp_h = yes; then + cat >>confdefs.h <<\_ACEOF +#define PJ_HAS_SETJMP_H 1 +_ACEOF + +fi + + +if test "${ac_cv_header_stdarg_h+set}" = set; then + { echo "$as_me:$LINENO: checking for stdarg.h" >&5 +echo $ECHO_N "checking for stdarg.h... $ECHO_C" >&6; } +if test "${ac_cv_header_stdarg_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +{ echo "$as_me:$LINENO: result: $ac_cv_header_stdarg_h" >&5 +echo "${ECHO_T}$ac_cv_header_stdarg_h" >&6; } +else + # Is the header compilable? +{ echo "$as_me:$LINENO: checking stdarg.h usability" >&5 +echo $ECHO_N "checking stdarg.h usability... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include <stdarg.h> +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_compiler=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } + +# Is the header present? +{ echo "$as_me:$LINENO: checking stdarg.h presence" >&5 +echo $ECHO_N "checking stdarg.h presence... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <stdarg.h> +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi + +rm -f conftest.err conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: stdarg.h: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: stdarg.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: stdarg.h: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: stdarg.h: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: stdarg.h: present but cannot be compiled" >&5 +echo "$as_me: WARNING: stdarg.h: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: stdarg.h: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: stdarg.h: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: stdarg.h: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: stdarg.h: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: stdarg.h: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: stdarg.h: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: stdarg.h: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: stdarg.h: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: stdarg.h: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: stdarg.h: in the future, the compiler will take precedence" >&2;} + + ;; +esac +{ echo "$as_me:$LINENO: checking for stdarg.h" >&5 +echo $ECHO_N "checking for stdarg.h... $ECHO_C" >&6; } +if test "${ac_cv_header_stdarg_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_header_stdarg_h=$ac_header_preproc +fi +{ echo "$as_me:$LINENO: result: $ac_cv_header_stdarg_h" >&5 +echo "${ECHO_T}$ac_cv_header_stdarg_h" >&6; } + +fi +if test $ac_cv_header_stdarg_h = yes; then + cat >>confdefs.h <<\_ACEOF +#define PJ_HAS_STDARG_H 1 +_ACEOF + +fi + + +if test "${ac_cv_header_stddef_h+set}" = set; then + { echo "$as_me:$LINENO: checking for stddef.h" >&5 +echo $ECHO_N "checking for stddef.h... $ECHO_C" >&6; } +if test "${ac_cv_header_stddef_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +{ echo "$as_me:$LINENO: result: $ac_cv_header_stddef_h" >&5 +echo "${ECHO_T}$ac_cv_header_stddef_h" >&6; } +else + # Is the header compilable? +{ echo "$as_me:$LINENO: checking stddef.h usability" >&5 +echo $ECHO_N "checking stddef.h usability... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include <stddef.h> +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_compiler=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } + +# Is the header present? +{ echo "$as_me:$LINENO: checking stddef.h presence" >&5 +echo $ECHO_N "checking stddef.h presence... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <stddef.h> +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi + +rm -f conftest.err conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: stddef.h: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: stddef.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: stddef.h: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: stddef.h: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: stddef.h: present but cannot be compiled" >&5 +echo "$as_me: WARNING: stddef.h: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: stddef.h: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: stddef.h: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: stddef.h: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: stddef.h: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: stddef.h: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: stddef.h: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: stddef.h: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: stddef.h: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: stddef.h: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: stddef.h: in the future, the compiler will take precedence" >&2;} + + ;; +esac +{ echo "$as_me:$LINENO: checking for stddef.h" >&5 +echo $ECHO_N "checking for stddef.h... $ECHO_C" >&6; } +if test "${ac_cv_header_stddef_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_header_stddef_h=$ac_header_preproc +fi +{ echo "$as_me:$LINENO: result: $ac_cv_header_stddef_h" >&5 +echo "${ECHO_T}$ac_cv_header_stddef_h" >&6; } + +fi +if test $ac_cv_header_stddef_h = yes; then + cat >>confdefs.h <<\_ACEOF +#define PJ_HAS_STDDEF_H 1 +_ACEOF + +fi + + +if test "${ac_cv_header_stdio_h+set}" = set; then + { echo "$as_me:$LINENO: checking for stdio.h" >&5 +echo $ECHO_N "checking for stdio.h... $ECHO_C" >&6; } +if test "${ac_cv_header_stdio_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +{ echo "$as_me:$LINENO: result: $ac_cv_header_stdio_h" >&5 +echo "${ECHO_T}$ac_cv_header_stdio_h" >&6; } +else + # Is the header compilable? +{ echo "$as_me:$LINENO: checking stdio.h usability" >&5 +echo $ECHO_N "checking stdio.h usability... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include <stdio.h> +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_compiler=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } + +# Is the header present? +{ echo "$as_me:$LINENO: checking stdio.h presence" >&5 +echo $ECHO_N "checking stdio.h presence... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <stdio.h> +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi + +rm -f conftest.err conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: stdio.h: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: stdio.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: stdio.h: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: stdio.h: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: stdio.h: present but cannot be compiled" >&5 +echo "$as_me: WARNING: stdio.h: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: stdio.h: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: stdio.h: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: stdio.h: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: stdio.h: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: stdio.h: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: stdio.h: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: stdio.h: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: stdio.h: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: stdio.h: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: stdio.h: in the future, the compiler will take precedence" >&2;} + + ;; +esac +{ echo "$as_me:$LINENO: checking for stdio.h" >&5 +echo $ECHO_N "checking for stdio.h... $ECHO_C" >&6; } +if test "${ac_cv_header_stdio_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_header_stdio_h=$ac_header_preproc +fi +{ echo "$as_me:$LINENO: result: $ac_cv_header_stdio_h" >&5 +echo "${ECHO_T}$ac_cv_header_stdio_h" >&6; } + +fi +if test $ac_cv_header_stdio_h = yes; then + cat >>confdefs.h <<\_ACEOF +#define PJ_HAS_STDIO_H 1 +_ACEOF + +fi + + +if test "${ac_cv_header_stdint_h+set}" = set; then + { echo "$as_me:$LINENO: checking for stdint.h" >&5 +echo $ECHO_N "checking for stdint.h... $ECHO_C" >&6; } +if test "${ac_cv_header_stdint_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +{ echo "$as_me:$LINENO: result: $ac_cv_header_stdint_h" >&5 +echo "${ECHO_T}$ac_cv_header_stdint_h" >&6; } +else + # Is the header compilable? +{ echo "$as_me:$LINENO: checking stdint.h usability" >&5 +echo $ECHO_N "checking stdint.h usability... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include <stdint.h> +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_compiler=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } + +# Is the header present? +{ echo "$as_me:$LINENO: checking stdint.h presence" >&5 +echo $ECHO_N "checking stdint.h presence... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <stdint.h> +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi + +rm -f conftest.err conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: stdint.h: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: stdint.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: stdint.h: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: stdint.h: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: stdint.h: present but cannot be compiled" >&5 +echo "$as_me: WARNING: stdint.h: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: stdint.h: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: stdint.h: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: stdint.h: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: stdint.h: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: stdint.h: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: stdint.h: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: stdint.h: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: stdint.h: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: stdint.h: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: stdint.h: in the future, the compiler will take precedence" >&2;} + + ;; +esac +{ echo "$as_me:$LINENO: checking for stdint.h" >&5 +echo $ECHO_N "checking for stdint.h... $ECHO_C" >&6; } +if test "${ac_cv_header_stdint_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_header_stdint_h=$ac_header_preproc +fi +{ echo "$as_me:$LINENO: result: $ac_cv_header_stdint_h" >&5 +echo "${ECHO_T}$ac_cv_header_stdint_h" >&6; } + +fi +if test $ac_cv_header_stdint_h = yes; then + cat >>confdefs.h <<\_ACEOF +#define PJ_HAS_STDINT_H 1 +_ACEOF + +fi + + +if test "${ac_cv_header_stdlib_h+set}" = set; then + { echo "$as_me:$LINENO: checking for stdlib.h" >&5 +echo $ECHO_N "checking for stdlib.h... $ECHO_C" >&6; } +if test "${ac_cv_header_stdlib_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +{ echo "$as_me:$LINENO: result: $ac_cv_header_stdlib_h" >&5 +echo "${ECHO_T}$ac_cv_header_stdlib_h" >&6; } +else + # Is the header compilable? +{ echo "$as_me:$LINENO: checking stdlib.h usability" >&5 +echo $ECHO_N "checking stdlib.h usability... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include <stdlib.h> +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_compiler=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } + +# Is the header present? +{ echo "$as_me:$LINENO: checking stdlib.h presence" >&5 +echo $ECHO_N "checking stdlib.h presence... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <stdlib.h> +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi + +rm -f conftest.err conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: stdlib.h: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: stdlib.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: stdlib.h: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: stdlib.h: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: stdlib.h: present but cannot be compiled" >&5 +echo "$as_me: WARNING: stdlib.h: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: stdlib.h: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: stdlib.h: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: stdlib.h: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: stdlib.h: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: stdlib.h: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: stdlib.h: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: stdlib.h: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: stdlib.h: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: stdlib.h: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: stdlib.h: in the future, the compiler will take precedence" >&2;} + + ;; +esac +{ echo "$as_me:$LINENO: checking for stdlib.h" >&5 +echo $ECHO_N "checking for stdlib.h... $ECHO_C" >&6; } +if test "${ac_cv_header_stdlib_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_header_stdlib_h=$ac_header_preproc +fi +{ echo "$as_me:$LINENO: result: $ac_cv_header_stdlib_h" >&5 +echo "${ECHO_T}$ac_cv_header_stdlib_h" >&6; } + +fi +if test $ac_cv_header_stdlib_h = yes; then + cat >>confdefs.h <<\_ACEOF +#define PJ_HAS_STDLIB_H 1 +_ACEOF + +fi + + +if test "${ac_cv_header_string_h+set}" = set; then + { echo "$as_me:$LINENO: checking for string.h" >&5 +echo $ECHO_N "checking for string.h... $ECHO_C" >&6; } +if test "${ac_cv_header_string_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +{ echo "$as_me:$LINENO: result: $ac_cv_header_string_h" >&5 +echo "${ECHO_T}$ac_cv_header_string_h" >&6; } +else + # Is the header compilable? +{ echo "$as_me:$LINENO: checking string.h usability" >&5 +echo $ECHO_N "checking string.h usability... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include <string.h> +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_compiler=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } + +# Is the header present? +{ echo "$as_me:$LINENO: checking string.h presence" >&5 +echo $ECHO_N "checking string.h presence... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <string.h> +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi + +rm -f conftest.err conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: string.h: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: string.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: string.h: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: string.h: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: string.h: present but cannot be compiled" >&5 +echo "$as_me: WARNING: string.h: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: string.h: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: string.h: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: string.h: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: string.h: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: string.h: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: string.h: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: string.h: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: string.h: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: string.h: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: string.h: in the future, the compiler will take precedence" >&2;} + + ;; +esac +{ echo "$as_me:$LINENO: checking for string.h" >&5 +echo $ECHO_N "checking for string.h... $ECHO_C" >&6; } +if test "${ac_cv_header_string_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_header_string_h=$ac_header_preproc +fi +{ echo "$as_me:$LINENO: result: $ac_cv_header_string_h" >&5 +echo "${ECHO_T}$ac_cv_header_string_h" >&6; } + +fi +if test $ac_cv_header_string_h = yes; then + cat >>confdefs.h <<\_ACEOF +#define PJ_HAS_STRING_H 1 +_ACEOF + +fi + + +if test "${ac_cv_header_sys_ioctl_h+set}" = set; then + { echo "$as_me:$LINENO: checking for sys/ioctl.h" >&5 +echo $ECHO_N "checking for sys/ioctl.h... $ECHO_C" >&6; } +if test "${ac_cv_header_sys_ioctl_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +{ echo "$as_me:$LINENO: result: $ac_cv_header_sys_ioctl_h" >&5 +echo "${ECHO_T}$ac_cv_header_sys_ioctl_h" >&6; } +else + # Is the header compilable? +{ echo "$as_me:$LINENO: checking sys/ioctl.h usability" >&5 +echo $ECHO_N "checking sys/ioctl.h usability... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include <sys/ioctl.h> +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_compiler=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } + +# Is the header present? +{ echo "$as_me:$LINENO: checking sys/ioctl.h presence" >&5 +echo $ECHO_N "checking sys/ioctl.h presence... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <sys/ioctl.h> +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi + +rm -f conftest.err conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: sys/ioctl.h: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: sys/ioctl.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: sys/ioctl.h: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: sys/ioctl.h: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: sys/ioctl.h: present but cannot be compiled" >&5 +echo "$as_me: WARNING: sys/ioctl.h: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: sys/ioctl.h: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: sys/ioctl.h: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: sys/ioctl.h: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: sys/ioctl.h: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: sys/ioctl.h: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: sys/ioctl.h: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: sys/ioctl.h: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: sys/ioctl.h: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: sys/ioctl.h: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: sys/ioctl.h: in the future, the compiler will take precedence" >&2;} + + ;; +esac +{ echo "$as_me:$LINENO: checking for sys/ioctl.h" >&5 +echo $ECHO_N "checking for sys/ioctl.h... $ECHO_C" >&6; } +if test "${ac_cv_header_sys_ioctl_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_header_sys_ioctl_h=$ac_header_preproc +fi +{ echo "$as_me:$LINENO: result: $ac_cv_header_sys_ioctl_h" >&5 +echo "${ECHO_T}$ac_cv_header_sys_ioctl_h" >&6; } + +fi +if test $ac_cv_header_sys_ioctl_h = yes; then + cat >>confdefs.h <<\_ACEOF +#define PJ_HAS_SYS_IOCTL_H 1 +_ACEOF + +fi + + +if test "${ac_cv_header_sys_select_h+set}" = set; then + { echo "$as_me:$LINENO: checking for sys/select.h" >&5 +echo $ECHO_N "checking for sys/select.h... $ECHO_C" >&6; } +if test "${ac_cv_header_sys_select_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +{ echo "$as_me:$LINENO: result: $ac_cv_header_sys_select_h" >&5 +echo "${ECHO_T}$ac_cv_header_sys_select_h" >&6; } +else + # Is the header compilable? +{ echo "$as_me:$LINENO: checking sys/select.h usability" >&5 +echo $ECHO_N "checking sys/select.h usability... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include <sys/select.h> +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_compiler=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } + +# Is the header present? +{ echo "$as_me:$LINENO: checking sys/select.h presence" >&5 +echo $ECHO_N "checking sys/select.h presence... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <sys/select.h> +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi + +rm -f conftest.err conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: sys/select.h: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: sys/select.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: sys/select.h: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: sys/select.h: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: sys/select.h: present but cannot be compiled" >&5 +echo "$as_me: WARNING: sys/select.h: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: sys/select.h: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: sys/select.h: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: sys/select.h: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: sys/select.h: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: sys/select.h: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: sys/select.h: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: sys/select.h: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: sys/select.h: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: sys/select.h: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: sys/select.h: in the future, the compiler will take precedence" >&2;} + + ;; +esac +{ echo "$as_me:$LINENO: checking for sys/select.h" >&5 +echo $ECHO_N "checking for sys/select.h... $ECHO_C" >&6; } +if test "${ac_cv_header_sys_select_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_header_sys_select_h=$ac_header_preproc +fi +{ echo "$as_me:$LINENO: result: $ac_cv_header_sys_select_h" >&5 +echo "${ECHO_T}$ac_cv_header_sys_select_h" >&6; } + +fi +if test $ac_cv_header_sys_select_h = yes; then + cat >>confdefs.h <<\_ACEOF +#define PJ_HAS_SYS_SELECT_H 1 +_ACEOF + +fi + + +if test "${ac_cv_header_sys_socket_h+set}" = set; then + { echo "$as_me:$LINENO: checking for sys/socket.h" >&5 +echo $ECHO_N "checking for sys/socket.h... $ECHO_C" >&6; } +if test "${ac_cv_header_sys_socket_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +{ echo "$as_me:$LINENO: result: $ac_cv_header_sys_socket_h" >&5 +echo "${ECHO_T}$ac_cv_header_sys_socket_h" >&6; } +else + # Is the header compilable? +{ echo "$as_me:$LINENO: checking sys/socket.h usability" >&5 +echo $ECHO_N "checking sys/socket.h usability... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include <sys/socket.h> +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_compiler=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } + +# Is the header present? +{ echo "$as_me:$LINENO: checking sys/socket.h presence" >&5 +echo $ECHO_N "checking sys/socket.h presence... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <sys/socket.h> +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi + +rm -f conftest.err conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: sys/socket.h: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: sys/socket.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: sys/socket.h: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: sys/socket.h: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: sys/socket.h: present but cannot be compiled" >&5 +echo "$as_me: WARNING: sys/socket.h: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: sys/socket.h: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: sys/socket.h: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: sys/socket.h: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: sys/socket.h: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: sys/socket.h: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: sys/socket.h: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: sys/socket.h: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: sys/socket.h: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: sys/socket.h: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: sys/socket.h: in the future, the compiler will take precedence" >&2;} + + ;; +esac +{ echo "$as_me:$LINENO: checking for sys/socket.h" >&5 +echo $ECHO_N "checking for sys/socket.h... $ECHO_C" >&6; } +if test "${ac_cv_header_sys_socket_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_header_sys_socket_h=$ac_header_preproc +fi +{ echo "$as_me:$LINENO: result: $ac_cv_header_sys_socket_h" >&5 +echo "${ECHO_T}$ac_cv_header_sys_socket_h" >&6; } + +fi +if test $ac_cv_header_sys_socket_h = yes; then + cat >>confdefs.h <<\_ACEOF +#define PJ_HAS_SYS_SOCKET_H 1 +_ACEOF + +fi + + +if test "${ac_cv_header_sys_time_h+set}" = set; then + { echo "$as_me:$LINENO: checking for sys/time.h" >&5 +echo $ECHO_N "checking for sys/time.h... $ECHO_C" >&6; } +if test "${ac_cv_header_sys_time_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +{ echo "$as_me:$LINENO: result: $ac_cv_header_sys_time_h" >&5 +echo "${ECHO_T}$ac_cv_header_sys_time_h" >&6; } +else + # Is the header compilable? +{ echo "$as_me:$LINENO: checking sys/time.h usability" >&5 +echo $ECHO_N "checking sys/time.h usability... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include <sys/time.h> +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_compiler=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } + +# Is the header present? +{ echo "$as_me:$LINENO: checking sys/time.h presence" >&5 +echo $ECHO_N "checking sys/time.h presence... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <sys/time.h> +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi + +rm -f conftest.err conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: sys/time.h: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: sys/time.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: sys/time.h: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: sys/time.h: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: sys/time.h: present but cannot be compiled" >&5 +echo "$as_me: WARNING: sys/time.h: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: sys/time.h: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: sys/time.h: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: sys/time.h: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: sys/time.h: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: sys/time.h: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: sys/time.h: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: sys/time.h: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: sys/time.h: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: sys/time.h: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: sys/time.h: in the future, the compiler will take precedence" >&2;} + + ;; +esac +{ echo "$as_me:$LINENO: checking for sys/time.h" >&5 +echo $ECHO_N "checking for sys/time.h... $ECHO_C" >&6; } +if test "${ac_cv_header_sys_time_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_header_sys_time_h=$ac_header_preproc +fi +{ echo "$as_me:$LINENO: result: $ac_cv_header_sys_time_h" >&5 +echo "${ECHO_T}$ac_cv_header_sys_time_h" >&6; } + +fi +if test $ac_cv_header_sys_time_h = yes; then + cat >>confdefs.h <<\_ACEOF +#define PJ_HAS_SYS_TIME_H 1 +_ACEOF + +fi + + +if test "${ac_cv_header_sys_timeb_h+set}" = set; then + { echo "$as_me:$LINENO: checking for sys/timeb.h" >&5 +echo $ECHO_N "checking for sys/timeb.h... $ECHO_C" >&6; } +if test "${ac_cv_header_sys_timeb_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +{ echo "$as_me:$LINENO: result: $ac_cv_header_sys_timeb_h" >&5 +echo "${ECHO_T}$ac_cv_header_sys_timeb_h" >&6; } +else + # Is the header compilable? +{ echo "$as_me:$LINENO: checking sys/timeb.h usability" >&5 +echo $ECHO_N "checking sys/timeb.h usability... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include <sys/timeb.h> +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_compiler=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } + +# Is the header present? +{ echo "$as_me:$LINENO: checking sys/timeb.h presence" >&5 +echo $ECHO_N "checking sys/timeb.h presence... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <sys/timeb.h> +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi + +rm -f conftest.err conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: sys/timeb.h: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: sys/timeb.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: sys/timeb.h: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: sys/timeb.h: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: sys/timeb.h: present but cannot be compiled" >&5 +echo "$as_me: WARNING: sys/timeb.h: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: sys/timeb.h: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: sys/timeb.h: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: sys/timeb.h: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: sys/timeb.h: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: sys/timeb.h: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: sys/timeb.h: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: sys/timeb.h: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: sys/timeb.h: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: sys/timeb.h: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: sys/timeb.h: in the future, the compiler will take precedence" >&2;} + + ;; +esac +{ echo "$as_me:$LINENO: checking for sys/timeb.h" >&5 +echo $ECHO_N "checking for sys/timeb.h... $ECHO_C" >&6; } +if test "${ac_cv_header_sys_timeb_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_header_sys_timeb_h=$ac_header_preproc +fi +{ echo "$as_me:$LINENO: result: $ac_cv_header_sys_timeb_h" >&5 +echo "${ECHO_T}$ac_cv_header_sys_timeb_h" >&6; } + +fi +if test $ac_cv_header_sys_timeb_h = yes; then + cat >>confdefs.h <<\_ACEOF +#define PJ_HAS_SYS_TIMEB_H 1 +_ACEOF + +fi + + +if test "${ac_cv_header_sys_types_h+set}" = set; then + { echo "$as_me:$LINENO: checking for sys/types.h" >&5 +echo $ECHO_N "checking for sys/types.h... $ECHO_C" >&6; } +if test "${ac_cv_header_sys_types_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +{ echo "$as_me:$LINENO: result: $ac_cv_header_sys_types_h" >&5 +echo "${ECHO_T}$ac_cv_header_sys_types_h" >&6; } +else + # Is the header compilable? +{ echo "$as_me:$LINENO: checking sys/types.h usability" >&5 +echo $ECHO_N "checking sys/types.h usability... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include <sys/types.h> +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_compiler=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } + +# Is the header present? +{ echo "$as_me:$LINENO: checking sys/types.h presence" >&5 +echo $ECHO_N "checking sys/types.h presence... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <sys/types.h> +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi + +rm -f conftest.err conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: sys/types.h: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: sys/types.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: sys/types.h: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: sys/types.h: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: sys/types.h: present but cannot be compiled" >&5 +echo "$as_me: WARNING: sys/types.h: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: sys/types.h: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: sys/types.h: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: sys/types.h: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: sys/types.h: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: sys/types.h: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: sys/types.h: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: sys/types.h: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: sys/types.h: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: sys/types.h: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: sys/types.h: in the future, the compiler will take precedence" >&2;} + + ;; +esac +{ echo "$as_me:$LINENO: checking for sys/types.h" >&5 +echo $ECHO_N "checking for sys/types.h... $ECHO_C" >&6; } +if test "${ac_cv_header_sys_types_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_header_sys_types_h=$ac_header_preproc +fi +{ echo "$as_me:$LINENO: result: $ac_cv_header_sys_types_h" >&5 +echo "${ECHO_T}$ac_cv_header_sys_types_h" >&6; } + +fi +if test $ac_cv_header_sys_types_h = yes; then + cat >>confdefs.h <<\_ACEOF +#define PJ_HAS_SYS_TYPES_H 1 +_ACEOF + +fi + + +if test "${ac_cv_header_time_h+set}" = set; then + { echo "$as_me:$LINENO: checking for time.h" >&5 +echo $ECHO_N "checking for time.h... $ECHO_C" >&6; } +if test "${ac_cv_header_time_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +{ echo "$as_me:$LINENO: result: $ac_cv_header_time_h" >&5 +echo "${ECHO_T}$ac_cv_header_time_h" >&6; } +else + # Is the header compilable? +{ echo "$as_me:$LINENO: checking time.h usability" >&5 +echo $ECHO_N "checking time.h usability... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include <time.h> +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_compiler=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } + +# Is the header present? +{ echo "$as_me:$LINENO: checking time.h presence" >&5 +echo $ECHO_N "checking time.h presence... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <time.h> +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi + +rm -f conftest.err conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: time.h: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: time.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: time.h: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: time.h: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: time.h: present but cannot be compiled" >&5 +echo "$as_me: WARNING: time.h: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: time.h: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: time.h: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: time.h: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: time.h: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: time.h: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: time.h: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: time.h: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: time.h: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: time.h: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: time.h: in the future, the compiler will take precedence" >&2;} + + ;; +esac +{ echo "$as_me:$LINENO: checking for time.h" >&5 +echo $ECHO_N "checking for time.h... $ECHO_C" >&6; } +if test "${ac_cv_header_time_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_header_time_h=$ac_header_preproc +fi +{ echo "$as_me:$LINENO: result: $ac_cv_header_time_h" >&5 +echo "${ECHO_T}$ac_cv_header_time_h" >&6; } + +fi +if test $ac_cv_header_time_h = yes; then + cat >>confdefs.h <<\_ACEOF +#define PJ_HAS_TIME_H 1 +_ACEOF + +fi + + +if test "${ac_cv_header_unistd_h+set}" = set; then + { echo "$as_me:$LINENO: checking for unistd.h" >&5 +echo $ECHO_N "checking for unistd.h... $ECHO_C" >&6; } +if test "${ac_cv_header_unistd_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +{ echo "$as_me:$LINENO: result: $ac_cv_header_unistd_h" >&5 +echo "${ECHO_T}$ac_cv_header_unistd_h" >&6; } +else + # Is the header compilable? +{ echo "$as_me:$LINENO: checking unistd.h usability" >&5 +echo $ECHO_N "checking unistd.h usability... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include <unistd.h> +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_compiler=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } + +# Is the header present? +{ echo "$as_me:$LINENO: checking unistd.h presence" >&5 +echo $ECHO_N "checking unistd.h presence... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <unistd.h> +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi + +rm -f conftest.err conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: unistd.h: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: unistd.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: unistd.h: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: unistd.h: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: unistd.h: present but cannot be compiled" >&5 +echo "$as_me: WARNING: unistd.h: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: unistd.h: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: unistd.h: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: unistd.h: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: unistd.h: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: unistd.h: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: unistd.h: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: unistd.h: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: unistd.h: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: unistd.h: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: unistd.h: in the future, the compiler will take precedence" >&2;} + + ;; +esac +{ echo "$as_me:$LINENO: checking for unistd.h" >&5 +echo $ECHO_N "checking for unistd.h... $ECHO_C" >&6; } +if test "${ac_cv_header_unistd_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_header_unistd_h=$ac_header_preproc +fi +{ echo "$as_me:$LINENO: result: $ac_cv_header_unistd_h" >&5 +echo "${ECHO_T}$ac_cv_header_unistd_h" >&6; } + +fi +if test $ac_cv_header_unistd_h = yes; then + cat >>confdefs.h <<\_ACEOF +#define PJ_HAS_UNISTD_H 1 +_ACEOF + +fi + + +if test "${ac_cv_header_winsock_h+set}" = set; then + { echo "$as_me:$LINENO: checking for winsock.h" >&5 +echo $ECHO_N "checking for winsock.h... $ECHO_C" >&6; } +if test "${ac_cv_header_winsock_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +{ echo "$as_me:$LINENO: result: $ac_cv_header_winsock_h" >&5 +echo "${ECHO_T}$ac_cv_header_winsock_h" >&6; } +else + # Is the header compilable? +{ echo "$as_me:$LINENO: checking winsock.h usability" >&5 +echo $ECHO_N "checking winsock.h usability... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include <winsock.h> +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_header_compiler=no fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } - ;; +# Is the header present? +{ echo "$as_me:$LINENO: checking winsock.h presence" >&5 +echo $ECHO_N "checking winsock.h presence... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <winsock.h> +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 -ac_fn_c_check_header_mongrel "$LINENO" "fcntl.h" "ac_cv_header_fcntl_h" "$ac_includes_default" -if test "x$ac_cv_header_fcntl_h" = x""yes; then : - $as_echo "#define PJ_HAS_FCNTL_H 1" >>confdefs.h - + ac_header_preproc=no fi +rm -f conftest.err conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } -ac_fn_c_check_header_mongrel "$LINENO" "linux/socket.h" "ac_cv_header_linux_socket_h" "$ac_includes_default" -if test "x$ac_cv_header_linux_socket_h" = x""yes; then : - $as_echo "#define PJ_HAS_LINUX_SOCKET_H 1" >>confdefs.h +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: winsock.h: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: winsock.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: winsock.h: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: winsock.h: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: winsock.h: present but cannot be compiled" >&5 +echo "$as_me: WARNING: winsock.h: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: winsock.h: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: winsock.h: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: winsock.h: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: winsock.h: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: winsock.h: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: winsock.h: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: winsock.h: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: winsock.h: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: winsock.h: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: winsock.h: in the future, the compiler will take precedence" >&2;} + ;; +esac +{ echo "$as_me:$LINENO: checking for winsock.h" >&5 +echo $ECHO_N "checking for winsock.h... $ECHO_C" >&6; } +if test "${ac_cv_header_winsock_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_header_winsock_h=$ac_header_preproc fi - - -ac_fn_c_check_header_mongrel "$LINENO" "malloc.h" "ac_cv_header_malloc_h" "$ac_includes_default" -if test "x$ac_cv_header_malloc_h" = x""yes; then : - $as_echo "#define PJ_HAS_MALLOC_H 1" >>confdefs.h +{ echo "$as_me:$LINENO: result: $ac_cv_header_winsock_h" >&5 +echo "${ECHO_T}$ac_cv_header_winsock_h" >&6; } fi - - -ac_fn_c_check_header_mongrel "$LINENO" "netdb.h" "ac_cv_header_netdb_h" "$ac_includes_default" -if test "x$ac_cv_header_netdb_h" = x""yes; then : - $as_echo "#define PJ_HAS_NETDB_H 1" >>confdefs.h +if test $ac_cv_header_winsock_h = yes; then + cat >>confdefs.h <<\_ACEOF +#define PJ_HAS_WINSOCK_H 1 +_ACEOF fi -ac_fn_c_check_header_mongrel "$LINENO" "netinet/in_systm.h" "ac_cv_header_netinet_in_systm_h" "$ac_includes_default" -if test "x$ac_cv_header_netinet_in_systm_h" = x""yes; then : - $as_echo "#define PJ_HAS_NETINET_IN_SYSTM_H 1" >>confdefs.h - +if test "${ac_cv_header_winsock2_h+set}" = set; then + { echo "$as_me:$LINENO: checking for winsock2.h" >&5 +echo $ECHO_N "checking for winsock2.h... $ECHO_C" >&6; } +if test "${ac_cv_header_winsock2_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 fi +{ echo "$as_me:$LINENO: result: $ac_cv_header_winsock2_h" >&5 +echo "${ECHO_T}$ac_cv_header_winsock2_h" >&6; } +else + # Is the header compilable? +{ echo "$as_me:$LINENO: checking winsock2.h usability" >&5 +echo $ECHO_N "checking winsock2.h usability... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include <winsock2.h> +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 - -ac_fn_c_check_header_mongrel "$LINENO" "netinet/in.h" "ac_cv_header_netinet_in_h" "$ac_includes_default" -if test "x$ac_cv_header_netinet_in_h" = x""yes; then : - $as_echo "#define PJ_HAS_NETINET_IN_H 1" >>confdefs.h - + ac_header_compiler=no fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } -ac_fn_c_check_header_compile "$LINENO" "netinet/ip.h" "ac_cv_header_netinet_ip_h" "#if PJ_HAS_NETINET_IN_SYSTM_H - # include <netinet/in_systm.h> - #endif - -" -if test "x$ac_cv_header_netinet_ip_h" = x""yes; then : - $as_echo "#define PJ_HAS_NETINET_IP_H 1" >>confdefs.h +# Is the header present? +{ echo "$as_me:$LINENO: checking winsock2.h presence" >&5 +echo $ECHO_N "checking winsock2.h presence... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <winsock2.h> +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_header_preproc=no fi +rm -f conftest.err conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } -ac_fn_c_check_header_mongrel "$LINENO" "ifaddrs.h" "ac_cv_header_ifaddrs_h" "$ac_includes_default" -if test "x$ac_cv_header_ifaddrs_h" = x""yes; then : - $as_echo "#define PJ_HAS_IFADDRS_H 1" >>confdefs.h +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: winsock2.h: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: winsock2.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: winsock2.h: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: winsock2.h: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: winsock2.h: present but cannot be compiled" >&5 +echo "$as_me: WARNING: winsock2.h: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: winsock2.h: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: winsock2.h: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: winsock2.h: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: winsock2.h: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: winsock2.h: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: winsock2.h: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: winsock2.h: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: winsock2.h: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: winsock2.h: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: winsock2.h: in the future, the compiler will take precedence" >&2;} + ;; +esac +{ echo "$as_me:$LINENO: checking for winsock2.h" >&5 +echo $ECHO_N "checking for winsock2.h... $ECHO_C" >&6; } +if test "${ac_cv_header_winsock2_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_header_winsock2_h=$ac_header_preproc fi - - -ac_fn_c_check_header_mongrel "$LINENO" "semaphore.h" "ac_cv_header_semaphore_h" "$ac_includes_default" -if test "x$ac_cv_header_semaphore_h" = x""yes; then : - $as_echo "#define PJ_HAS_SEMAPHORE_H 1" >>confdefs.h +{ echo "$as_me:$LINENO: result: $ac_cv_header_winsock2_h" >&5 +echo "${ECHO_T}$ac_cv_header_winsock2_h" >&6; } fi - - -ac_fn_c_check_header_mongrel "$LINENO" "setjmp.h" "ac_cv_header_setjmp_h" "$ac_includes_default" -if test "x$ac_cv_header_setjmp_h" = x""yes; then : - $as_echo "#define PJ_HAS_SETJMP_H 1" >>confdefs.h +if test $ac_cv_header_winsock2_h = yes; then + cat >>confdefs.h <<\_ACEOF +#define PJ_HAS_WINSOCK2_H 1 +_ACEOF fi -ac_fn_c_check_header_mongrel "$LINENO" "stdarg.h" "ac_cv_header_stdarg_h" "$ac_includes_default" -if test "x$ac_cv_header_stdarg_h" = x""yes; then : - $as_echo "#define PJ_HAS_STDARG_H 1" >>confdefs.h - -fi +{ echo "$as_me:$LINENO: checking for mswsock.h" >&5 +echo $ECHO_N "checking for mswsock.h... $ECHO_C" >&6; } +if test "${ac_cv_header_mswsock_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#if PJ_HAS_WINSOCK2_H + # include <winsock2.h> + #elif PJ_HAS_WINSOCK_H + # include <winsock.h> + #endif -ac_fn_c_check_header_mongrel "$LINENO" "stddef.h" "ac_cv_header_stddef_h" "$ac_includes_default" -if test "x$ac_cv_header_stddef_h" = x""yes; then : - $as_echo "#define PJ_HAS_STDDEF_H 1" >>confdefs.h +#include <mswsock.h> +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_header_mswsock_h=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_cv_header_mswsock_h=no fi - -ac_fn_c_check_header_mongrel "$LINENO" "stdio.h" "ac_cv_header_stdio_h" "$ac_includes_default" -if test "x$ac_cv_header_stdio_h" = x""yes; then : - $as_echo "#define PJ_HAS_STDIO_H 1" >>confdefs.h - +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi - - -ac_fn_c_check_header_mongrel "$LINENO" "stdint.h" "ac_cv_header_stdint_h" "$ac_includes_default" -if test "x$ac_cv_header_stdint_h" = x""yes; then : - $as_echo "#define PJ_HAS_STDINT_H 1" >>confdefs.h +{ echo "$as_me:$LINENO: result: $ac_cv_header_mswsock_h" >&5 +echo "${ECHO_T}$ac_cv_header_mswsock_h" >&6; } +if test $ac_cv_header_mswsock_h = yes; then + cat >>confdefs.h <<\_ACEOF +#define PJ_HAS_MSWSOCK_H 1 +_ACEOF fi -ac_fn_c_check_header_mongrel "$LINENO" "stdlib.h" "ac_cv_header_stdlib_h" "$ac_includes_default" -if test "x$ac_cv_header_stdlib_h" = x""yes; then : - $as_echo "#define PJ_HAS_STDLIB_H 1" >>confdefs.h - +if test "${ac_cv_header_ws2tcpip_h+set}" = set; then + { echo "$as_me:$LINENO: checking for ws2tcpip.h" >&5 +echo $ECHO_N "checking for ws2tcpip.h... $ECHO_C" >&6; } +if test "${ac_cv_header_ws2tcpip_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 fi +{ echo "$as_me:$LINENO: result: $ac_cv_header_ws2tcpip_h" >&5 +echo "${ECHO_T}$ac_cv_header_ws2tcpip_h" >&6; } +else + # Is the header compilable? +{ echo "$as_me:$LINENO: checking ws2tcpip.h usability" >&5 +echo $ECHO_N "checking ws2tcpip.h usability... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include <ws2tcpip.h> +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 - -ac_fn_c_check_header_mongrel "$LINENO" "string.h" "ac_cv_header_string_h" "$ac_includes_default" -if test "x$ac_cv_header_string_h" = x""yes; then : - $as_echo "#define PJ_HAS_STRING_H 1" >>confdefs.h - + ac_header_compiler=no fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } -ac_fn_c_check_header_mongrel "$LINENO" "sys/ioctl.h" "ac_cv_header_sys_ioctl_h" "$ac_includes_default" -if test "x$ac_cv_header_sys_ioctl_h" = x""yes; then : - $as_echo "#define PJ_HAS_SYS_IOCTL_H 1" >>confdefs.h +# Is the header present? +{ echo "$as_me:$LINENO: checking ws2tcpip.h presence" >&5 +echo $ECHO_N "checking ws2tcpip.h presence... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <ws2tcpip.h> +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_header_preproc=no fi +rm -f conftest.err conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } -ac_fn_c_check_header_mongrel "$LINENO" "sys/select.h" "ac_cv_header_sys_select_h" "$ac_includes_default" -if test "x$ac_cv_header_sys_select_h" = x""yes; then : - $as_echo "#define PJ_HAS_SYS_SELECT_H 1" >>confdefs.h +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: ws2tcpip.h: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: ws2tcpip.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: ws2tcpip.h: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: ws2tcpip.h: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: ws2tcpip.h: present but cannot be compiled" >&5 +echo "$as_me: WARNING: ws2tcpip.h: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: ws2tcpip.h: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: ws2tcpip.h: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: ws2tcpip.h: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: ws2tcpip.h: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: ws2tcpip.h: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: ws2tcpip.h: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: ws2tcpip.h: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: ws2tcpip.h: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: ws2tcpip.h: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: ws2tcpip.h: in the future, the compiler will take precedence" >&2;} + ;; +esac +{ echo "$as_me:$LINENO: checking for ws2tcpip.h" >&5 +echo $ECHO_N "checking for ws2tcpip.h... $ECHO_C" >&6; } +if test "${ac_cv_header_ws2tcpip_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_header_ws2tcpip_h=$ac_header_preproc fi - - -ac_fn_c_check_header_mongrel "$LINENO" "sys/socket.h" "ac_cv_header_sys_socket_h" "$ac_includes_default" -if test "x$ac_cv_header_sys_socket_h" = x""yes; then : - $as_echo "#define PJ_HAS_SYS_SOCKET_H 1" >>confdefs.h +{ echo "$as_me:$LINENO: result: $ac_cv_header_ws2tcpip_h" >&5 +echo "${ECHO_T}$ac_cv_header_ws2tcpip_h" >&6; } fi - - -ac_fn_c_check_header_mongrel "$LINENO" "sys/time.h" "ac_cv_header_sys_time_h" "$ac_includes_default" -if test "x$ac_cv_header_sys_time_h" = x""yes; then : - $as_echo "#define PJ_HAS_SYS_TIME_H 1" >>confdefs.h +if test $ac_cv_header_ws2tcpip_h = yes; then + cat >>confdefs.h <<\_ACEOF +#define PJ_HAS_WS2TCPIP_H 1 +_ACEOF fi -ac_fn_c_check_header_mongrel "$LINENO" "sys/timeb.h" "ac_cv_header_sys_timeb_h" "$ac_includes_default" -if test "x$ac_cv_header_sys_timeb_h" = x""yes; then : - $as_echo "#define PJ_HAS_SYS_TIMEB_H 1" >>confdefs.h - +if test "${ac_cv_header_uuid_uuid_h+set}" = set; then + { echo "$as_me:$LINENO: checking for uuid/uuid.h" >&5 +echo $ECHO_N "checking for uuid/uuid.h... $ECHO_C" >&6; } +if test "${ac_cv_header_uuid_uuid_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 fi +{ echo "$as_me:$LINENO: result: $ac_cv_header_uuid_uuid_h" >&5 +echo "${ECHO_T}$ac_cv_header_uuid_uuid_h" >&6; } +else + # Is the header compilable? +{ echo "$as_me:$LINENO: checking uuid/uuid.h usability" >&5 +echo $ECHO_N "checking uuid/uuid.h usability... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include <uuid/uuid.h> +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 - -ac_fn_c_check_header_mongrel "$LINENO" "sys/types.h" "ac_cv_header_sys_types_h" "$ac_includes_default" -if test "x$ac_cv_header_sys_types_h" = x""yes; then : - $as_echo "#define PJ_HAS_SYS_TYPES_H 1" >>confdefs.h - + ac_header_compiler=no fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } -ac_fn_c_check_header_mongrel "$LINENO" "time.h" "ac_cv_header_time_h" "$ac_includes_default" -if test "x$ac_cv_header_time_h" = x""yes; then : - $as_echo "#define PJ_HAS_TIME_H 1" >>confdefs.h +# Is the header present? +{ echo "$as_me:$LINENO: checking uuid/uuid.h presence" >&5 +echo $ECHO_N "checking uuid/uuid.h presence... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <uuid/uuid.h> +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_header_preproc=no fi +rm -f conftest.err conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } -ac_fn_c_check_header_mongrel "$LINENO" "unistd.h" "ac_cv_header_unistd_h" "$ac_includes_default" -if test "x$ac_cv_header_unistd_h" = x""yes; then : - $as_echo "#define PJ_HAS_UNISTD_H 1" >>confdefs.h +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: uuid/uuid.h: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: uuid/uuid.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: uuid/uuid.h: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: uuid/uuid.h: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: uuid/uuid.h: present but cannot be compiled" >&5 +echo "$as_me: WARNING: uuid/uuid.h: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: uuid/uuid.h: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: uuid/uuid.h: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: uuid/uuid.h: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: uuid/uuid.h: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: uuid/uuid.h: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: uuid/uuid.h: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: uuid/uuid.h: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: uuid/uuid.h: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: uuid/uuid.h: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: uuid/uuid.h: in the future, the compiler will take precedence" >&2;} + ;; +esac +{ echo "$as_me:$LINENO: checking for uuid/uuid.h" >&5 +echo $ECHO_N "checking for uuid/uuid.h... $ECHO_C" >&6; } +if test "${ac_cv_header_uuid_uuid_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_header_uuid_uuid_h=$ac_header_preproc fi - - -ac_fn_c_check_header_mongrel "$LINENO" "winsock.h" "ac_cv_header_winsock_h" "$ac_includes_default" -if test "x$ac_cv_header_winsock_h" = x""yes; then : - $as_echo "#define PJ_HAS_WINSOCK_H 1" >>confdefs.h +{ echo "$as_me:$LINENO: result: $ac_cv_header_uuid_uuid_h" >&5 +echo "${ECHO_T}$ac_cv_header_uuid_uuid_h" >&6; } fi - - -ac_fn_c_check_header_mongrel "$LINENO" "winsock2.h" "ac_cv_header_winsock2_h" "$ac_includes_default" -if test "x$ac_cv_header_winsock2_h" = x""yes; then : - $as_echo "#define PJ_HAS_WINSOCK2_H 1" >>confdefs.h - +if test $ac_cv_header_uuid_uuid_h = yes; then + ac_has_uuid_h=1 fi -ac_fn_c_check_header_compile "$LINENO" "mswsock.h" "ac_cv_header_mswsock_h" "#if PJ_HAS_WINSOCK2_H - # include <winsock2.h> - #elif PJ_HAS_WINSOCK_H - # include <winsock.h> +{ echo "$as_me:$LINENO: checking for net/if.h" >&5 +echo $ECHO_N "checking for net/if.h... $ECHO_C" >&6; } +if test "${ac_cv_header_net_if_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#if PJ_HAS_SYS_SOCKET_H + # include <sys/socket.h> #endif -" -if test "x$ac_cv_header_mswsock_h" = x""yes; then : - $as_echo "#define PJ_HAS_MSWSOCK_H 1" >>confdefs.h - -fi - -ac_fn_c_check_header_mongrel "$LINENO" "ws2tcpip.h" "ac_cv_header_ws2tcpip_h" "$ac_includes_default" -if test "x$ac_cv_header_ws2tcpip_h" = x""yes; then : - $as_echo "#define PJ_HAS_WS2TCPIP_H 1" >>confdefs.h +#include <net/if.h> +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_header_net_if_h=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_cv_header_net_if_h=no fi - -ac_fn_c_check_header_mongrel "$LINENO" "uuid/uuid.h" "ac_cv_header_uuid_uuid_h" "$ac_includes_default" -if test "x$ac_cv_header_uuid_uuid_h" = x""yes; then : - ac_has_uuid_h=1 +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi - - -ac_fn_c_check_header_compile "$LINENO" "net/if.h" "ac_cv_header_net_if_h" "#if PJ_HAS_SYS_SOCKET_H - # include <sys/socket.h> - #endif - -" -if test "x$ac_cv_header_net_if_h" = x""yes; then : - $as_echo "#define PJ_HAS_NET_IF_H 1" >>confdefs.h +{ echo "$as_me:$LINENO: result: $ac_cv_header_net_if_h" >&5 +echo "${ECHO_T}$ac_cv_header_net_if_h" >&6; } +if test $ac_cv_header_net_if_h = yes; then + cat >>confdefs.h <<\_ACEOF +#define PJ_HAS_NET_IF_H 1 +_ACEOF fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: Setting PJ_OS_NAME to $target" >&5 -$as_echo "Setting PJ_OS_NAME to $target" >&6; } +{ echo "$as_me:$LINENO: result: Setting PJ_OS_NAME to $target" >&5 +echo "${ECHO_T}Setting PJ_OS_NAME to $target" >&6; } cat >>confdefs.h <<_ACEOF #define PJ_OS_NAME "$target" _ACEOF -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: Setting PJ_HAS_ERRNO_VAR to 1" >&5 -$as_echo "Setting PJ_HAS_ERRNO_VAR to 1" >&6; } -$as_echo "#define PJ_HAS_ERRNO_VAR 1" >>confdefs.h +{ echo "$as_me:$LINENO: result: Setting PJ_HAS_ERRNO_VAR to 1" >&5 +echo "${ECHO_T}Setting PJ_HAS_ERRNO_VAR to 1" >&6; } +cat >>confdefs.h <<\_ACEOF +#define PJ_HAS_ERRNO_VAR 1 +_ACEOF -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: Setting PJ_HAS_HIGH_RES_TIMER to 1" >&5 -$as_echo "Setting PJ_HAS_HIGH_RES_TIMER to 1" >&6; } -$as_echo "#define PJ_HAS_HIGH_RES_TIMER 1" >>confdefs.h +{ echo "$as_me:$LINENO: result: Setting PJ_HAS_HIGH_RES_TIMER to 1" >&5 +echo "${ECHO_T}Setting PJ_HAS_HIGH_RES_TIMER to 1" >&6; } +cat >>confdefs.h <<\_ACEOF +#define PJ_HAS_HIGH_RES_TIMER 1 +_ACEOF -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: Setting PJ_HAS_MALLOC to 1" >&5 -$as_echo "Setting PJ_HAS_MALLOC to 1" >&6; } -$as_echo "#define PJ_HAS_MALLOC 1" >>confdefs.h +{ echo "$as_me:$LINENO: result: Setting PJ_HAS_MALLOC to 1" >&5 +echo "${ECHO_T}Setting PJ_HAS_MALLOC to 1" >&6; } +cat >>confdefs.h <<\_ACEOF +#define PJ_HAS_MALLOC 1 +_ACEOF -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: Setting PJ_NATIVE_STRING_IS_UNICODE to 0" >&5 -$as_echo "Setting PJ_NATIVE_STRING_IS_UNICODE to 0" >&6; } -$as_echo "#define PJ_NATIVE_STRING_IS_UNICODE 0" >>confdefs.h +{ echo "$as_me:$LINENO: result: Setting PJ_NATIVE_STRING_IS_UNICODE to 0" >&5 +echo "${ECHO_T}Setting PJ_NATIVE_STRING_IS_UNICODE to 0" >&6; } +cat >>confdefs.h <<\_ACEOF +#define PJ_NATIVE_STRING_IS_UNICODE 0 +_ACEOF -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: Setting PJ_ATOMIC_VALUE_TYPE to long" >&5 -$as_echo "Setting PJ_ATOMIC_VALUE_TYPE to long" >&6; } -$as_echo "#define PJ_ATOMIC_VALUE_TYPE long" >>confdefs.h +{ echo "$as_me:$LINENO: result: Setting PJ_ATOMIC_VALUE_TYPE to long" >&5 +echo "${ECHO_T}Setting PJ_ATOMIC_VALUE_TYPE to long" >&6; } +cat >>confdefs.h <<\_ACEOF +#define PJ_ATOMIC_VALUE_TYPE long +_ACEOF -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if inet_aton() is available" >&5 -$as_echo_n "checking if inet_aton() is available... " >&6; } -cat confdefs.h - <<_ACEOF >conftest.$ac_ext +{ echo "$as_me:$LINENO: checking if inet_aton() is available" >&5 +echo $ECHO_N "checking if inet_aton() is available... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <sys/types.h> #include <sys/socket.h> @@ -4808,20 +9476,46 @@ inet_aton(0, 0); return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - $as_echo "#define PJ_SOCK_HAS_INET_ATON 1" >>confdefs.h +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + cat >>confdefs.h <<\_ACEOF +#define PJ_SOCK_HAS_INET_ATON 1 +_ACEOF - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi + rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if inet_pton() is available" >&5 -$as_echo_n "checking if inet_pton() is available... " >&6; } -cat confdefs.h - <<_ACEOF >conftest.$ac_ext +{ echo "$as_me:$LINENO: checking if inet_pton() is available" >&5 +echo $ECHO_N "checking if inet_pton() is available... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <sys/types.h> #include <sys/socket.h> @@ -4834,20 +9528,46 @@ inet_pton(0, 0, 0); return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - $as_echo "#define PJ_SOCK_HAS_INET_PTON 1" >>confdefs.h +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + cat >>confdefs.h <<\_ACEOF +#define PJ_SOCK_HAS_INET_PTON 1 +_ACEOF - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi + rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if inet_ntop() is available" >&5 -$as_echo_n "checking if inet_ntop() is available... " >&6; } -cat confdefs.h - <<_ACEOF >conftest.$ac_ext +{ echo "$as_me:$LINENO: checking if inet_ntop() is available" >&5 +echo $ECHO_N "checking if inet_ntop() is available... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <sys/types.h> #include <sys/socket.h> @@ -4860,20 +9580,46 @@ inet_ntop(0, 0, 0, 0); return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - $as_echo "#define PJ_SOCK_HAS_INET_NTOP 1" >>confdefs.h +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + cat >>confdefs.h <<\_ACEOF +#define PJ_SOCK_HAS_INET_NTOP 1 +_ACEOF - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi + rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if getaddrinfo() is available" >&5 -$as_echo_n "checking if getaddrinfo() is available... " >&6; } -cat confdefs.h - <<_ACEOF >conftest.$ac_ext +{ echo "$as_me:$LINENO: checking if getaddrinfo() is available" >&5 +echo $ECHO_N "checking if getaddrinfo() is available... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <sys/types.h> #include <sys/socket.h> @@ -4886,20 +9632,46 @@ getaddrinfo(0, 0, 0, 0); return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - $as_echo "#define PJ_SOCK_HAS_GETADDRINFO 1" >>confdefs.h +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + cat >>confdefs.h <<\_ACEOF +#define PJ_SOCK_HAS_GETADDRINFO 1 +_ACEOF - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi + rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if sockaddr_in has sin_len member" >&5 -$as_echo_n "checking if sockaddr_in has sin_len member... " >&6; } -cat confdefs.h - <<_ACEOF >conftest.$ac_ext +{ echo "$as_me:$LINENO: checking if sockaddr_in has sin_len member" >&5 +echo $ECHO_N "checking if sockaddr_in has sin_len member... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <sys/types.h> #include <sys/socket.h> @@ -4913,20 +9685,46 @@ struct sockaddr_in a; a.sin_len=0; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - $as_echo "#define PJ_SOCKADDR_HAS_LEN 1" >>confdefs.h +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + cat >>confdefs.h <<\_ACEOF +#define PJ_SOCKADDR_HAS_LEN 1 +_ACEOF - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi + rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if socklen_t is available" >&5 -$as_echo_n "checking if socklen_t is available... " >&6; } -cat confdefs.h - <<_ACEOF >conftest.$ac_ext +{ echo "$as_me:$LINENO: checking if socklen_t is available" >&5 +echo $ECHO_N "checking if socklen_t is available... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <sys/socket.h> int @@ -4937,28 +9735,56 @@ socklen_t xxx = 0; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - $as_echo "#define PJ_HAS_SOCKLEN_T 1" >>confdefs.h +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + cat >>confdefs.h <<\_ACEOF +#define PJ_HAS_SOCKLEN_T 1 +_ACEOF - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi + rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if SO_ERROR is available" >&5 -$as_echo_n "checking if SO_ERROR is available... " >&6; } +{ echo "$as_me:$LINENO: checking if SO_ERROR is available" >&5 +echo $ECHO_N "checking if SO_ERROR is available... $ECHO_C" >&6; } case $target in *mingw* | *cygw* | *win32* | *w32* ) - $as_echo "#define PJ_HAS_SO_ERROR 1" >>confdefs.h + cat >>confdefs.h <<\_ACEOF +#define PJ_HAS_SO_ERROR 1 +_ACEOF - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } ;; *) - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <sys/types.h> #include <sys/socket.h> @@ -4972,23 +9798,49 @@ int i=SO_ERROR; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - $as_echo "#define PJ_HAS_SO_ERROR 1" >>confdefs.h +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + cat >>confdefs.h <<\_ACEOF +#define PJ_HAS_SO_ERROR 1 +_ACEOF - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi + rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ;; esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if pthread_rwlock_t is available" >&5 -$as_echo_n "checking if pthread_rwlock_t is available... " >&6; } -cat confdefs.h - <<_ACEOF >conftest.$ac_ext +{ echo "$as_me:$LINENO: checking if pthread_rwlock_t is available" >&5 +echo $ECHO_N "checking if pthread_rwlock_t is available... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <pthread.h> int @@ -4999,25 +9851,53 @@ pthread_rwlock_t *x; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - $as_echo "#define PJ_EMULATE_RWMUTEX 0" >>confdefs.h +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + cat >>confdefs.h <<\_ACEOF +#define PJ_EMULATE_RWMUTEX 0 +_ACEOF ac_rwmutex="yes" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } else - $as_echo "#define PJ_EMULATE_RWMUTEX 1" >>confdefs.h + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + cat >>confdefs.h <<\_ACEOF +#define PJ_EMULATE_RWMUTEX 1 +_ACEOF ac_rwmutex="no" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi + rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test "$ac_rwmutex" = "no"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if pthread_rwlock_t is available with _POSIX_READER_WRITER_LOCKS" >&5 -$as_echo_n "checking if pthread_rwlock_t is available with _POSIX_READER_WRITER_LOCKS... " >&6; } - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + { echo "$as_me:$LINENO: checking if pthread_rwlock_t is available with _POSIX_READER_WRITER_LOCKS" >&5 +echo $ECHO_N "checking if pthread_rwlock_t is available with _POSIX_READER_WRITER_LOCKS... $ECHO_C" >&6; } + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #define _POSIX_READER_WRITER_LOCKS #include <pthread.h> @@ -5029,24 +9909,52 @@ pthread_rwlock_t *x; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - $as_echo "#define PJ_EMULATE_RWMUTEX 0" >>confdefs.h +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + cat >>confdefs.h <<\_ACEOF +#define PJ_EMULATE_RWMUTEX 0 +_ACEOF CFLAGS="$CFLAGS -D_POSIX_THREADS -D_POSIX_READER_WRITER_LOCKS" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } else - $as_echo "#define PJ_EMULATE_RWMUTEX 1" >>confdefs.h + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + cat >>confdefs.h <<\_ACEOF +#define PJ_EMULATE_RWMUTEX 1 +_ACEOF - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi + rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if pthread_mutexattr_settype() is available" >&5 -$as_echo_n "checking if pthread_mutexattr_settype() is available... " >&6; } -cat confdefs.h - <<_ACEOF >conftest.$ac_ext +{ echo "$as_me:$LINENO: checking if pthread_mutexattr_settype() is available" >&5 +echo $ECHO_N "checking if pthread_mutexattr_settype() is available... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <pthread.h> int @@ -5057,20 +9965,46 @@ pthread_mutexattr_settype(0,PTHREAD_MUTEX_FAST_NP); return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - $as_echo "#define PJ_HAS_PTHREAD_MUTEXATTR_SETTYPE 1" >>confdefs.h +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + cat >>confdefs.h <<\_ACEOF +#define PJ_HAS_PTHREAD_MUTEXATTR_SETTYPE 1 +_ACEOF - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi + rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if pthread_mutexattr_t has recursive member" >&5 -$as_echo_n "checking if pthread_mutexattr_t has recursive member... " >&6; } -cat confdefs.h - <<_ACEOF >conftest.$ac_ext +{ echo "$as_me:$LINENO: checking if pthread_mutexattr_t has recursive member" >&5 +echo $ECHO_N "checking if pthread_mutexattr_t has recursive member... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <pthread.h> int @@ -5082,82 +10016,476 @@ pthread_mutexattr_t attr; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - $as_echo "#define PJ_PTHREAD_MUTEXATTR_T_HAS_RECURSIVE 1" >>confdefs.h +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + cat >>confdefs.h <<\_ACEOF +#define PJ_PTHREAD_MUTEXATTR_T_HAS_RECURSIVE 1 +_ACEOF + + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + + +{ echo "$as_me:$LINENO: checking ioqueue backend" >&5 +echo $ECHO_N "checking ioqueue backend... $ECHO_C" >&6; } +# Check whether --enable-epoll was given. +if test "${enable_epoll+set}" = set; then + enableval=$enable_epoll; + ac_os_objs=ioqueue_epoll.o + { echo "$as_me:$LINENO: result: /dev/epoll" >&5 +echo "${ECHO_T}/dev/epoll" >&6; } + +else + + ac_os_objs=ioqueue_select.o + { echo "$as_me:$LINENO: result: select()" >&5 +echo "${ECHO_T}select()" >&6; } + +fi + + + +case $target in + *mingw* | *cygw* | *win32* | *w32* ) + ac_os_objs="$ac_os_objs file_access_win32.o file_io_win32.o os_core_win32.o os_error_win32.o os_time_win32.o os_timestamp_win32.o guid_win32.o" + ;; + *) + ac_os_objs="$ac_os_objs file_access_unistd.o file_io_ansi.o os_core_unix.o os_error_unix.o os_time_unix.o os_timestamp_posix.o" + # UUID + if test "$ac_has_uuid_lib" = "1" -a "$ac_has_uuid_h" = "1"; then + ac_os_objs="$ac_os_objs guid_uuid.o" + else + ac_os_objs="$ac_os_objs guid_simple.o" + fi + ;; +esac + + + + + +# Check whether --enable-sound was given. +if test "${enable_sound+set}" = set; then + enableval=$enable_sound; if test "$enable_sound" = "no"; then + ac_pjmedia_snd=null + { echo "$as_me:$LINENO: result: Checking if sound is disabled... yes" >&5 +echo "${ECHO_T}Checking if sound is disabled... yes" >&6; } + fi + +fi + + + +if test "${ac_cv_header_sys_soundcard_h+set}" = set; then + { echo "$as_me:$LINENO: checking for sys/soundcard.h" >&5 +echo $ECHO_N "checking for sys/soundcard.h... $ECHO_C" >&6; } +if test "${ac_cv_header_sys_soundcard_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +{ echo "$as_me:$LINENO: result: $ac_cv_header_sys_soundcard_h" >&5 +echo "${ECHO_T}$ac_cv_header_sys_soundcard_h" >&6; } +else + # Is the header compilable? +{ echo "$as_me:$LINENO: checking sys/soundcard.h usability" >&5 +echo $ECHO_N "checking sys/soundcard.h usability... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include <sys/soundcard.h> +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_compiler=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } + +# Is the header present? +{ echo "$as_me:$LINENO: checking sys/soundcard.h presence" >&5 +echo $ECHO_N "checking sys/soundcard.h presence... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <sys/soundcard.h> +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi + +rm -f conftest.err conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: sys/soundcard.h: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: sys/soundcard.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: sys/soundcard.h: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: sys/soundcard.h: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: sys/soundcard.h: present but cannot be compiled" >&5 +echo "$as_me: WARNING: sys/soundcard.h: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: sys/soundcard.h: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: sys/soundcard.h: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: sys/soundcard.h: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: sys/soundcard.h: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: sys/soundcard.h: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: sys/soundcard.h: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: sys/soundcard.h: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: sys/soundcard.h: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: sys/soundcard.h: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: sys/soundcard.h: in the future, the compiler will take precedence" >&2;} + + ;; +esac +{ echo "$as_me:$LINENO: checking for sys/soundcard.h" >&5 +echo $ECHO_N "checking for sys/soundcard.h... $ECHO_C" >&6; } +if test "${ac_cv_header_sys_soundcard_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_header_sys_soundcard_h=$ac_header_preproc +fi +{ echo "$as_me:$LINENO: result: $ac_cv_header_sys_soundcard_h" >&5 +echo "${ECHO_T}$ac_cv_header_sys_soundcard_h" >&6; } + +fi +if test $ac_cv_header_sys_soundcard_h = yes; then + ac_pa_cflags="$ac_pa_cflags -DHAVE_SYS_SOUNDCARD_H" +fi + + +if test "${ac_cv_header_linux_soundcard_h+set}" = set; then + { echo "$as_me:$LINENO: checking for linux/soundcard.h" >&5 +echo $ECHO_N "checking for linux/soundcard.h... $ECHO_C" >&6; } +if test "${ac_cv_header_linux_soundcard_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +{ echo "$as_me:$LINENO: result: $ac_cv_header_linux_soundcard_h" >&5 +echo "${ECHO_T}$ac_cv_header_linux_soundcard_h" >&6; } +else + # Is the header compilable? +{ echo "$as_me:$LINENO: checking linux/soundcard.h usability" >&5 +echo $ECHO_N "checking linux/soundcard.h usability... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include <linux/soundcard.h> +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_compiler=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } +# Is the header present? +{ echo "$as_me:$LINENO: checking linux/soundcard.h presence" >&5 +echo $ECHO_N "checking linux/soundcard.h presence... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <linux/soundcard.h> +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + ac_header_preproc=yes else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f conftest.err conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking ioqueue backend" >&5 -$as_echo_n "checking ioqueue backend... " >&6; } -# Check whether --enable-epoll was given. -if test "${enable_epoll+set}" = set; then : - enableval=$enable_epoll; - ac_os_objs=ioqueue_epoll.o - { $as_echo "$as_me:${as_lineno-$LINENO}: result: /dev/epoll" >&5 -$as_echo "/dev/epoll" >&6; } +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: linux/soundcard.h: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: linux/soundcard.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: linux/soundcard.h: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: linux/soundcard.h: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: linux/soundcard.h: present but cannot be compiled" >&5 +echo "$as_me: WARNING: linux/soundcard.h: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: linux/soundcard.h: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: linux/soundcard.h: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: linux/soundcard.h: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: linux/soundcard.h: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: linux/soundcard.h: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: linux/soundcard.h: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: linux/soundcard.h: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: linux/soundcard.h: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: linux/soundcard.h: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: linux/soundcard.h: in the future, the compiler will take precedence" >&2;} + ;; +esac +{ echo "$as_me:$LINENO: checking for linux/soundcard.h" >&5 +echo $ECHO_N "checking for linux/soundcard.h... $ECHO_C" >&6; } +if test "${ac_cv_header_linux_soundcard_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - - ac_os_objs=ioqueue_select.o - { $as_echo "$as_me:${as_lineno-$LINENO}: result: select()" >&5 -$as_echo "select()" >&6; } - + ac_cv_header_linux_soundcard_h=$ac_header_preproc fi +{ echo "$as_me:$LINENO: result: $ac_cv_header_linux_soundcard_h" >&5 +echo "${ECHO_T}$ac_cv_header_linux_soundcard_h" >&6; } +fi +if test $ac_cv_header_linux_soundcard_h = yes; then + ac_pa_cflags="$ac_pa_cflags -DHAVE_LINUX_SOUNDCARD_H" +fi -case $target in - *mingw* | *cygw* | *win32* | *w32* ) - ac_os_objs="$ac_os_objs file_access_win32.o file_io_win32.o os_core_win32.o os_error_win32.o os_time_win32.o os_timestamp_win32.o guid_win32.o" - ;; - *) - ac_os_objs="$ac_os_objs file_access_unistd.o file_io_ansi.o os_core_unix.o os_error_unix.o os_time_unix.o os_timestamp_posix.o" - # UUID - if test "$ac_has_uuid_lib" = "1" -a "$ac_has_uuid_h" = "1"; then - ac_os_objs="$ac_os_objs guid_uuid.o" - else - ac_os_objs="$ac_os_objs guid_simple.o" - fi - ;; +if test "${ac_cv_header_machine_soundcard_h+set}" = set; then + { echo "$as_me:$LINENO: checking for machine/soundcard.h" >&5 +echo $ECHO_N "checking for machine/soundcard.h... $ECHO_C" >&6; } +if test "${ac_cv_header_machine_soundcard_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +{ echo "$as_me:$LINENO: result: $ac_cv_header_machine_soundcard_h" >&5 +echo "${ECHO_T}$ac_cv_header_machine_soundcard_h" >&6; } +else + # Is the header compilable? +{ echo "$as_me:$LINENO: checking machine/soundcard.h usability" >&5 +echo $ECHO_N "checking machine/soundcard.h usability... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include <machine/soundcard.h> +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_header_compiler=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } +# Is the header present? +{ echo "$as_me:$LINENO: checking machine/soundcard.h presence" >&5 +echo $ECHO_N "checking machine/soundcard.h presence... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <machine/soundcard.h> +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 - -# Check whether --enable-sound was given. -if test "${enable_sound+set}" = set; then : - enableval=$enable_sound; if test "$enable_sound" = "no"; then - ac_pjmedia_snd=null - { $as_echo "$as_me:${as_lineno-$LINENO}: result: Checking if sound is disabled... yes" >&5 -$as_echo "Checking if sound is disabled... yes" >&6; } - fi - + ac_header_preproc=no fi +rm -f conftest.err conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: machine/soundcard.h: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: machine/soundcard.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: machine/soundcard.h: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: machine/soundcard.h: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: machine/soundcard.h: present but cannot be compiled" >&5 +echo "$as_me: WARNING: machine/soundcard.h: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: machine/soundcard.h: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: machine/soundcard.h: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: machine/soundcard.h: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: machine/soundcard.h: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: machine/soundcard.h: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: machine/soundcard.h: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: machine/soundcard.h: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: machine/soundcard.h: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: machine/soundcard.h: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: machine/soundcard.h: in the future, the compiler will take precedence" >&2;} -ac_fn_c_check_header_mongrel "$LINENO" "sys/soundcard.h" "ac_cv_header_sys_soundcard_h" "$ac_includes_default" -if test "x$ac_cv_header_sys_soundcard_h" = x""yes; then : - ac_pa_cflags="$ac_pa_cflags -DHAVE_SYS_SOUNDCARD_H" + ;; +esac +{ echo "$as_me:$LINENO: checking for machine/soundcard.h" >&5 +echo $ECHO_N "checking for machine/soundcard.h... $ECHO_C" >&6; } +if test "${ac_cv_header_machine_soundcard_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_header_machine_soundcard_h=$ac_header_preproc fi +{ echo "$as_me:$LINENO: result: $ac_cv_header_machine_soundcard_h" >&5 +echo "${ECHO_T}$ac_cv_header_machine_soundcard_h" >&6; } - -ac_fn_c_check_header_mongrel "$LINENO" "linux/soundcard.h" "ac_cv_header_linux_soundcard_h" "$ac_includes_default" -if test "x$ac_cv_header_linux_soundcard_h" = x""yes; then : - ac_pa_cflags="$ac_pa_cflags -DHAVE_LINUX_SOUNDCARD_H" fi - - -ac_fn_c_check_header_mongrel "$LINENO" "machine/soundcard.h" "ac_cv_header_machine_soundcard_h" "$ac_includes_default" -if test "x$ac_cv_header_machine_soundcard_h" = x""yes; then : +if test $ac_cv_header_machine_soundcard_h = yes; then ac_pa_cflags="$ac_pa_cflags -DHAVE_MACHINE_SOUNDCARD_H" fi @@ -5179,28 +10507,152 @@ else #ac_pa_cflags="$ac_pa_cflags -DPA_OLD_CORE_AUDIO -DMOSX_USE_NON_ATOMIC_FLAG_BITS" #AC_MSG_RESULT([Setting additional PortAudio CFLAGS.. -DPA_OLD_CORE_AUDIO -DMOSX_USE_NON_ATOMIC_FLAG_BITS]) ac_pjmedia_snd=pa_old_darwinos - { $as_echo "$as_me:${as_lineno-$LINENO}: result: Checking sound device backend... old coreaudio" >&5 -$as_echo "Checking sound device backend... old coreaudio" >&6; } + { echo "$as_me:$LINENO: result: Checking sound device backend... old coreaudio" >&5 +echo "${ECHO_T}Checking sound device backend... old coreaudio" >&6; } else ac_pjmedia_snd=pa_darwinos - { $as_echo "$as_me:${as_lineno-$LINENO}: result: Checking sound device backend... coreaudio" >&5 -$as_echo "Checking sound device backend... coreaudio" >&6; } + { echo "$as_me:$LINENO: result: Checking sound device backend... coreaudio" >&5 +echo "${ECHO_T}Checking sound device backend... coreaudio" >&6; } fi ;; *cygwin* | *mingw*) ac_pjmedia_snd=pa_win32 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: Checking sound device backend... win32 sound" >&5 -$as_echo "Checking sound device backend... win32 sound" >&6; } + { echo "$as_me:$LINENO: result: Checking sound device backend... win32 sound" >&5 +echo "${ECHO_T}Checking sound device backend... win32 sound" >&6; } ;; *rtems*) ac_pjmedia_snd=null - { $as_echo "$as_me:${as_lineno-$LINENO}: result: Checking sound device backend... null sound" >&5 -$as_echo "Checking sound device backend... null sound" >&6; } + { echo "$as_me:$LINENO: result: Checking sound device backend... null sound" >&5 +echo "${ECHO_T}Checking sound device backend... null sound" >&6; } ;; *) ac_pjmedia_snd=pa_unix - ac_fn_c_check_header_mongrel "$LINENO" "alsa/version.h" "ac_cv_header_alsa_version_h" "$ac_includes_default" -if test "x$ac_cv_header_alsa_version_h" = x""yes; then : + if test "${ac_cv_header_alsa_version_h+set}" = set; then + { echo "$as_me:$LINENO: checking for alsa/version.h" >&5 +echo $ECHO_N "checking for alsa/version.h... $ECHO_C" >&6; } +if test "${ac_cv_header_alsa_version_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +{ echo "$as_me:$LINENO: result: $ac_cv_header_alsa_version_h" >&5 +echo "${ECHO_T}$ac_cv_header_alsa_version_h" >&6; } +else + # Is the header compilable? +{ echo "$as_me:$LINENO: checking alsa/version.h usability" >&5 +echo $ECHO_N "checking alsa/version.h usability... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include <alsa/version.h> +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_compiler=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } + +# Is the header present? +{ echo "$as_me:$LINENO: checking alsa/version.h presence" >&5 +echo $ECHO_N "checking alsa/version.h presence... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <alsa/version.h> +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi + +rm -f conftest.err conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: alsa/version.h: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: alsa/version.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: alsa/version.h: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: alsa/version.h: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: alsa/version.h: present but cannot be compiled" >&5 +echo "$as_me: WARNING: alsa/version.h: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: alsa/version.h: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: alsa/version.h: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: alsa/version.h: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: alsa/version.h: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: alsa/version.h: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: alsa/version.h: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: alsa/version.h: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: alsa/version.h: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: alsa/version.h: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: alsa/version.h: in the future, the compiler will take precedence" >&2;} + + ;; +esac +{ echo "$as_me:$LINENO: checking for alsa/version.h" >&5 +echo $ECHO_N "checking for alsa/version.h... $ECHO_C" >&6; } +if test "${ac_cv_header_alsa_version_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_header_alsa_version_h=$ac_header_preproc +fi +{ echo "$as_me:$LINENO: result: $ac_cv_header_alsa_version_h" >&5 +echo "${ECHO_T}$ac_cv_header_alsa_version_h" >&6; } + +fi +if test $ac_cv_header_alsa_version_h = yes; then ac_pa_use_alsa=1 LIBS="$LIBS -lasound" @@ -5211,18 +10663,18 @@ else fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: Checking sound device backend... unix" >&5 -$as_echo "Checking sound device backend... unix" >&6; } + { echo "$as_me:$LINENO: result: Checking sound device backend... unix" >&5 +echo "${ECHO_T}Checking sound device backend... unix" >&6; } ac_pa_use_oss=1 # Check whether --enable-oss was given. -if test "${enable_oss+set}" = set; then : +if test "${enable_oss+set}" = set; then enableval=$enable_oss; if test "$enable_oss" = "no"; then ac_pa_use_oss=0 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: Checking if OSS audio is disabled... yes" >&5 -$as_echo "Checking if OSS audio is disabled... yes" >&6; } + { echo "$as_me:$LINENO: result: Checking if OSS audio is disabled... yes" >&5 +echo "${ECHO_T}Checking if OSS audio is disabled... yes" >&6; } fi fi @@ -5232,11 +10684,11 @@ fi fi # Check whether --enable-ext_sound was given. -if test "${enable_ext_sound+set}" = set; then : +if test "${enable_ext_sound+set}" = set; then enableval=$enable_ext_sound; if test "$enable_ext_sound" = "yes"; then ac_pjmedia_snd=external - { $as_echo "$as_me:${as_lineno-$LINENO}: result: Checking if external sound is set... yes" >&5 -$as_echo "Checking if external sound is set... yes" >&6; } + { echo "$as_me:$LINENO: result: Checking if external sound is set... yes" >&5 +echo "${ECHO_T}Checking if external sound is set... yes" >&6; } fi fi @@ -5244,177 +10696,189 @@ fi # Check whether --enable-small-filter was given. -if test "${enable_small_filter+set}" = set; then : +if test "${enable_small_filter+set}" = set; then enableval=$enable_small_filter; if test "$enable_small_filter" = "no"; then ac_no_small_filter='-DPJMEDIA_HAS_SMALL_FILTER=0' - { $as_echo "$as_me:${as_lineno-$LINENO}: result: Checking if small filter is disabled... yes" >&5 -$as_echo "Checking if small filter is disabled... yes" >&6; } + { echo "$as_me:$LINENO: result: Checking if small filter is disabled... yes" >&5 +echo "${ECHO_T}Checking if small filter is disabled... yes" >&6; } fi else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: Checking if small filter is disabled... no" >&5 -$as_echo "Checking if small filter is disabled... no" >&6; } + { echo "$as_me:$LINENO: result: Checking if small filter is disabled... no" >&5 +echo "${ECHO_T}Checking if small filter is disabled... no" >&6; } fi # Check whether --enable-large-filter was given. -if test "${enable_large_filter+set}" = set; then : +if test "${enable_large_filter+set}" = set; then enableval=$enable_large_filter; if test "$enable_large_filter" = "no"; then ac_no_large_filter='-DPJMEDIA_HAS_LARGE_FILTER=0' - { $as_echo "$as_me:${as_lineno-$LINENO}: result: Checking if large filter is disabled... yes" >&5 -$as_echo "Checking if large filter is disabled... yes" >&6; } + { echo "$as_me:$LINENO: result: Checking if large filter is disabled... yes" >&5 +echo "${ECHO_T}Checking if large filter is disabled... yes" >&6; } fi else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: Checking if large filter is disabled... no" >&5 -$as_echo "Checking if large filter is disabled... no" >&6; } + { echo "$as_me:$LINENO: result: Checking if large filter is disabled... no" >&5 +echo "${ECHO_T}Checking if large filter is disabled... no" >&6; } fi # Check whether --enable-speex-aec was given. -if test "${enable_speex_aec+set}" = set; then : +if test "${enable_speex_aec+set}" = set; then enableval=$enable_speex_aec; if test "$enable_speex_aec" = "no"; then ac_no_speex_aec='-DPJMEDIA_HAS_SPEEX_AEC=0' - { $as_echo "$as_me:${as_lineno-$LINENO}: result: Checking if Speex AEC is disabled...yes" >&5 -$as_echo "Checking if Speex AEC is disabled...yes" >&6; } + { echo "$as_me:$LINENO: result: Checking if Speex AEC is disabled...yes" >&5 +echo "${ECHO_T}Checking if Speex AEC is disabled...yes" >&6; } fi else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: Checking if Speex AEC is disabled...no" >&5 -$as_echo "Checking if Speex AEC is disabled...no" >&6; } + { echo "$as_me:$LINENO: result: Checking if Speex AEC is disabled...no" >&5 +echo "${ECHO_T}Checking if Speex AEC is disabled...no" >&6; } fi # Check whether --enable-g711-codec was given. -if test "${enable_g711_codec+set}" = set; then : +if test "${enable_g711_codec+set}" = set; then enableval=$enable_g711_codec; if test "$enable_g711_codec" = "no"; then ac_no_g711_codec=1 - $as_echo "#define PJMEDIA_HAS_G711_CODEC 0" >>confdefs.h + cat >>confdefs.h <<\_ACEOF +#define PJMEDIA_HAS_G711_CODEC 0 +_ACEOF - { $as_echo "$as_me:${as_lineno-$LINENO}: result: Checking if G.711 codec is disabled...yes" >&5 -$as_echo "Checking if G.711 codec is disabled...yes" >&6; } + { echo "$as_me:$LINENO: result: Checking if G.711 codec is disabled...yes" >&5 +echo "${ECHO_T}Checking if G.711 codec is disabled...yes" >&6; } fi else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: Checking if G.711 codec is disabled...no" >&5 -$as_echo "Checking if G.711 codec is disabled...no" >&6; } + { echo "$as_me:$LINENO: result: Checking if G.711 codec is disabled...no" >&5 +echo "${ECHO_T}Checking if G.711 codec is disabled...no" >&6; } fi # Check whether --enable-l16-codec was given. -if test "${enable_l16_codec+set}" = set; then : +if test "${enable_l16_codec+set}" = set; then enableval=$enable_l16_codec; if test "$enable_l16_codec" = "no"; then ac_no_l16_codec=1 - $as_echo "#define PJMEDIA_HAS_L16_CODEC 0" >>confdefs.h + cat >>confdefs.h <<\_ACEOF +#define PJMEDIA_HAS_L16_CODEC 0 +_ACEOF - { $as_echo "$as_me:${as_lineno-$LINENO}: result: Checking if L16 codecs are disabled...yes" >&5 -$as_echo "Checking if L16 codecs are disabled...yes" >&6; } + { echo "$as_me:$LINENO: result: Checking if L16 codecs are disabled...yes" >&5 +echo "${ECHO_T}Checking if L16 codecs are disabled...yes" >&6; } fi else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: Checking if L16 codec is disabled...no" >&5 -$as_echo "Checking if L16 codec is disabled...no" >&6; } + { echo "$as_me:$LINENO: result: Checking if L16 codec is disabled...no" >&5 +echo "${ECHO_T}Checking if L16 codec is disabled...no" >&6; } fi # Check whether --enable-gsm-codec was given. -if test "${enable_gsm_codec+set}" = set; then : +if test "${enable_gsm_codec+set}" = set; then enableval=$enable_gsm_codec; if test "$enable_gsm_codec" = "no"; then ac_no_gsm_codec=1 - $as_echo "#define PJMEDIA_HAS_GSM_CODEC 0" >>confdefs.h + cat >>confdefs.h <<\_ACEOF +#define PJMEDIA_HAS_GSM_CODEC 0 +_ACEOF - { $as_echo "$as_me:${as_lineno-$LINENO}: result: Checking if GSM codec is disabled...yes" >&5 -$as_echo "Checking if GSM codec is disabled...yes" >&6; } + { echo "$as_me:$LINENO: result: Checking if GSM codec is disabled...yes" >&5 +echo "${ECHO_T}Checking if GSM codec is disabled...yes" >&6; } fi else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: Checking if GSM codec is disabled...no" >&5 -$as_echo "Checking if GSM codec is disabled...no" >&6; } + { echo "$as_me:$LINENO: result: Checking if GSM codec is disabled...no" >&5 +echo "${ECHO_T}Checking if GSM codec is disabled...no" >&6; } fi # Check whether --enable-g722-codec was given. -if test "${enable_g722_codec+set}" = set; then : +if test "${enable_g722_codec+set}" = set; then enableval=$enable_g722_codec; if test "$enable_g722_codec" = "no"; then ac_no_g722_codec=1 - $as_echo "#define PJMEDIA_HAS_G722_CODEC 0" >>confdefs.h + cat >>confdefs.h <<\_ACEOF +#define PJMEDIA_HAS_G722_CODEC 0 +_ACEOF - { $as_echo "$as_me:${as_lineno-$LINENO}: result: Checking if G.722 codec is disabled...yes" >&5 -$as_echo "Checking if G.722 codec is disabled...yes" >&6; } + { echo "$as_me:$LINENO: result: Checking if G.722 codec is disabled...yes" >&5 +echo "${ECHO_T}Checking if G.722 codec is disabled...yes" >&6; } fi else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: Checking if G.722 codec is disabled...no" >&5 -$as_echo "Checking if G.722 codec is disabled...no" >&6; } + { echo "$as_me:$LINENO: result: Checking if G.722 codec is disabled...no" >&5 +echo "${ECHO_T}Checking if G.722 codec is disabled...no" >&6; } fi # Check whether --enable-g7221-codec was given. -if test "${enable_g7221_codec+set}" = set; then : +if test "${enable_g7221_codec+set}" = set; then enableval=$enable_g7221_codec; if test "$enable_g7221_codec" = "no"; then ac_no_g7221_codec=1 - $as_echo "#define PJMEDIA_HAS_G7221_CODEC 0" >>confdefs.h + cat >>confdefs.h <<\_ACEOF +#define PJMEDIA_HAS_G7221_CODEC 0 +_ACEOF - { $as_echo "$as_me:${as_lineno-$LINENO}: result: Checking if G.722.1 codec is disabled...yes" >&5 -$as_echo "Checking if G.722.1 codec is disabled...yes" >&6; } + { echo "$as_me:$LINENO: result: Checking if G.722.1 codec is disabled...yes" >&5 +echo "${ECHO_T}Checking if G.722.1 codec is disabled...yes" >&6; } fi else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: Checking if G.722.1 codec is disabled...no" >&5 -$as_echo "Checking if G.722.1 codec is disabled...no" >&6; } + { echo "$as_me:$LINENO: result: Checking if G.722.1 codec is disabled...no" >&5 +echo "${ECHO_T}Checking if G.722.1 codec is disabled...no" >&6; } fi # Check whether --enable-speex-codec was given. -if test "${enable_speex_codec+set}" = set; then : +if test "${enable_speex_codec+set}" = set; then enableval=$enable_speex_codec; if test "$enable_speex_codec" = "no"; then ac_no_speex_codec=1 - $as_echo "#define PJMEDIA_HAS_SPEEX_CODEC 0" >>confdefs.h + cat >>confdefs.h <<\_ACEOF +#define PJMEDIA_HAS_SPEEX_CODEC 0 +_ACEOF - { $as_echo "$as_me:${as_lineno-$LINENO}: result: Checking if Speex codec is disabled...yes" >&5 -$as_echo "Checking if Speex codec is disabled...yes" >&6; } + { echo "$as_me:$LINENO: result: Checking if Speex codec is disabled...yes" >&5 +echo "${ECHO_T}Checking if Speex codec is disabled...yes" >&6; } fi else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: Checking if Speex codec is disabled...no" >&5 -$as_echo "Checking if Speex codec is disabled...no" >&6; } + { echo "$as_me:$LINENO: result: Checking if Speex codec is disabled...no" >&5 +echo "${ECHO_T}Checking if Speex codec is disabled...no" >&6; } fi -#AC_DEFINE(ac_no_ilbc_codec, 1) -#AC_DEFINE(PJMEDIA_HAS_ILBC_CODEC, 0) -#AC_MSG_RESULT([Checking if iLBC codec is disabled...yes]) - # Check whether --enable-ilbc-codec was given. -if test "${enable_ilbc_codec+set}" = set; then : +if test "${enable_ilbc_codec+set}" = set; then enableval=$enable_ilbc_codec; if test "$enable_ilbc_codec" = "no"; then ac_no_ilbc_codec=1 - $as_echo "#define PJMEDIA_HAS_ILBC_CODEC 0" >>confdefs.h + cat >>confdefs.h <<\_ACEOF +#define PJMEDIA_HAS_ILBC_CODEC 0 +_ACEOF - { $as_echo "$as_me:${as_lineno-$LINENO}: result: Checking if iLBC codec is disabled...yes" >&5 -$as_echo "Checking if iLBC codec is disabled...yes" >&6; } + { echo "$as_me:$LINENO: result: Checking if iLBC codec is disabled...yes" >&5 +echo "${ECHO_T}Checking if iLBC codec is disabled...yes" >&6; } fi else - ac_no_ilbc_codec=1 - $as_echo "#define PJMEDIA_HAS_ILBC_CODEC 0" >>confdefs.h - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: Checking if iLBC codec is disabled...yes" >&5 -$as_echo "Checking if iLBC codec is disabled...yes" >&6; } + { echo "$as_me:$LINENO: result: Checking if iLBC codec is disabled...no" >&5 +echo "${ECHO_T}Checking if iLBC codec is disabled...no" >&6; } fi # Check whether --enable-libsamplerate was given. -if test "${enable_libsamplerate+set}" = set; then : - enableval=$enable_libsamplerate; { $as_echo "$as_me:${as_lineno-$LINENO}: checking for src_new in -lsamplerate" >&5 -$as_echo_n "checking for src_new in -lsamplerate... " >&6; } -if test "${ac_cv_lib_samplerate_src_new+set}" = set; then : - $as_echo_n "(cached) " >&6 +if test "${enable_libsamplerate+set}" = set; then + enableval=$enable_libsamplerate; +{ echo "$as_me:$LINENO: checking for src_new in -lsamplerate" >&5 +echo $ECHO_N "checking for src_new in -lsamplerate... $ECHO_C" >&6; } +if test "${ac_cv_lib_samplerate_src_new+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsamplerate $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. @@ -5432,18 +10896,39 @@ return src_new (); return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then ac_cv_lib_samplerate_src_new=yes else - ac_cv_lib_samplerate_src_new=no + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_lib_samplerate_src_new=no fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_samplerate_src_new" >&5 -$as_echo "$ac_cv_lib_samplerate_src_new" >&6; } -if test "x$ac_cv_lib_samplerate_src_new" = x""yes; then : +{ echo "$as_me:$LINENO: result: $ac_cv_lib_samplerate_src_new" >&5 +echo "${ECHO_T}$ac_cv_lib_samplerate_src_new" >&6; } +if test $ac_cv_lib_samplerate_src_new = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBSAMPLERATE 1 _ACEOF @@ -5453,15 +10938,15 @@ _ACEOF fi else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: Skipping libsamplerate detection" >&5 -$as_echo "Skipping libsamplerate detection" >&6; } + { echo "$as_me:$LINENO: result: Skipping libsamplerate detection" >&5 +echo "${ECHO_T}Skipping libsamplerate detection" >&6; } fi # Check whether --enable-ipp was given. -if test "${enable_ipp+set}" = set; then : +if test "${enable_ipp+set}" = set; then enableval=$enable_ipp; else enable_ipp=no @@ -5470,7 +10955,7 @@ fi # Check whether --enable-ipp was given. -if test "${enable_ipp+set}" = set; then : +if test "${enable_ipp+set}" = set; then enableval=$enable_ipp; else with_ipp=no @@ -5479,7 +10964,7 @@ fi # Check whether --enable-ipp-samples was given. -if test "${enable_ipp_samples+set}" = set; then : +if test "${enable_ipp_samples+set}" = set; then enableval=$enable_ipp_samples; else with_ipp_samples=no @@ -5488,30 +10973,36 @@ fi if test "x$enable_ipp" != "xno"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking Intel IPP location" >&5 -$as_echo_n "checking Intel IPP location... " >&6; } + { echo "$as_me:$LINENO: checking Intel IPP location" >&5 +echo $ECHO_N "checking Intel IPP location... $ECHO_C" >&6; } if test "x$with_ipp" != "xno" -a "x$with_ipp" != "x"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_ipp" >&5 -$as_echo "$with_ipp" >&6; } + { echo "$as_me:$LINENO: result: $with_ipp" >&5 +echo "${ECHO_T}$with_ipp" >&6; } IPPROOT=$with_ipp elif test "x$IPPROOT" = "x"; then if test -d /opt/intel/ipp; then IPPROOT=`ls -d /opt/intel/ipp/*/* | head -1` - { $as_echo "$as_me:${as_lineno-$LINENO}: result: autodetected in $IPPROOT" >&5 -$as_echo "autodetected in $IPPROOT" >&6; } + { echo "$as_me:$LINENO: result: autodetected in $IPPROOT" >&5 +echo "${ECHO_T}autodetected in $IPPROOT" >&6; } fi else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $IPPROOT" >&5 -$as_echo "$IPPROOT" >&6; } + { echo "$as_me:$LINENO: result: $IPPROOT" >&5 +echo "${ECHO_T}$IPPROOT" >&6; } fi if test x$IPPROOT = x; then - as_fn_error "the location is neither specified nor can be guessed. Please specify with IPPROOT env var or with --with-ipp option" "$LINENO" 5 + { { echo "$as_me:$LINENO: error: the location is neither specified nor can be guessed. Please specify with IPPROOT env var or with --with-ipp option" >&5 +echo "$as_me: error: the location is neither specified nor can be guessed. Please specify with IPPROOT env var or with --with-ipp option" >&2;} + { (exit 1); exit 1; }; } elif test ! -d $IPPROOT; then - as_fn_error "not found" "$LINENO" 5 + { { echo "$as_me:$LINENO: error: not found" >&5 +echo "$as_me: error: not found" >&2;} + { (exit 1); exit 1; }; } elif test ! -d $IPPROOT/include; then - as_fn_error "directory doesn't seem to be valid" "$LINENO" 5 + { { echo "$as_me:$LINENO: error: directory doesn't seem to be valid" >&5 +echo "$as_me: error: directory doesn't seem to be valid" >&2;} + { (exit 1); exit 1; }; } else # IPP directory looks okay. # Remove trailing backslash @@ -5532,9 +11023,13 @@ $as_echo "$IPPROOT" >&6; } LIBS="$IPP_LIBS $LIBS" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking Intel IPP usability" >&5 -$as_echo_n "checking Intel IPP usability... " >&6; } - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + { echo "$as_me:$LINENO: checking Intel IPP usability" >&5 +echo $ECHO_N "checking Intel IPP usability... $ECHO_C" >&6; } + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <ippcore.h> @@ -5546,69 +11041,99 @@ ippStaticInit(); return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 -$as_echo "ok" >&6; } +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + { echo "$as_me:$LINENO: result: ok" >&5 +echo "${ECHO_T}ok" >&6; } else - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error "failed -See \`config.log' for more details." "$LINENO" 5; } + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + { { echo "$as_me:$LINENO: error: failed +See \`config.log' for more details." >&5 +echo "$as_me: error: failed +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext CFLAGS="$SAVED_CFLAGS" LDFLAGS="$SAVED_LDFLAGS" LIBS="$SAVED_LIBS" fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking Intel IPP samples location" >&5 -$as_echo_n "checking Intel IPP samples location... " >&6; } + { echo "$as_me:$LINENO: checking Intel IPP samples location" >&5 +echo $ECHO_N "checking Intel IPP samples location... $ECHO_C" >&6; } if test "x$with_ipp_samples" != "xno" -a "x$with_ipp_samples" != "x"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_ipp_samples" >&5 -$as_echo "$with_ipp_samples" >&6; } + { echo "$as_me:$LINENO: result: $with_ipp_samples" >&5 +echo "${ECHO_T}$with_ipp_samples" >&6; } IPPSAMPLES=$with_ipp_samples elif test "x$IPPSAMPLES" = "x"; then if test -d /opt/intel/ipp-samples; then IPPSAMPLES=/opt/intel/ipp-samples - { $as_echo "$as_me:${as_lineno-$LINENO}: result: autodetected in $IPPSAMPLES" >&5 -$as_echo "autodetected in $IPPSAMPLES" >&6; } + { echo "$as_me:$LINENO: result: autodetected in $IPPSAMPLES" >&5 +echo "${ECHO_T}autodetected in $IPPSAMPLES" >&6; } fi else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $IPPSAMPLES" >&5 -$as_echo "$IPPSAMPLES" >&6; } + { echo "$as_me:$LINENO: result: $IPPSAMPLES" >&5 +echo "${ECHO_T}$IPPSAMPLES" >&6; } fi if test x$IPPSAMPLES = x; then - as_fn_error "the location is neither specified nor can be guessed. Please specify with IPPSAMPLES env var or with --with-ipp-samples option" "$LINENO" 5 + { { echo "$as_me:$LINENO: error: the location is neither specified nor can be guessed. Please specify with IPPSAMPLES env var or with --with-ipp-samples option" >&5 +echo "$as_me: error: the location is neither specified nor can be guessed. Please specify with IPPSAMPLES env var or with --with-ipp-samples option" >&2;} + { (exit 1); exit 1; }; } elif test ! -d $IPPSAMPLES; then - as_fn_error "not found" "$LINENO" 5 + { { echo "$as_me:$LINENO: error: not found" >&5 +echo "$as_me: error: not found" >&2;} + { (exit 1); exit 1; }; } elif test ! -d $IPPSAMPLES/speech-codecs; then - as_fn_error "directory doesn't seem to be valid" "$LINENO" 5 + { { echo "$as_me:$LINENO: error: directory doesn't seem to be valid" >&5 +echo "$as_me: error: directory doesn't seem to be valid" >&2;} + { (exit 1); exit 1; }; } else # Remove trailing backslash IPPSAMPLES=`echo $IPPSAMPLES | sed 's/\/$//'` # Guess the libusc.a build location - { $as_echo "$as_me:${as_lineno-$LINENO}: checking Intel IPP USC build location" >&5 -$as_echo_n "checking Intel IPP USC build location... " >&6; } + { echo "$as_me:$LINENO: checking Intel IPP USC build location" >&5 +echo $ECHO_N "checking Intel IPP USC build location... $ECHO_C" >&6; } IPPSAMPLESLIB=`ls -d $IPPSAMPLES/speech-codecs/bin/*gcc*/lib | head -1` if test ! -d $IPPSAMPLESLIB; then - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error "the $IPPSAMPLES/speech-codecs/bin/*gcc*/lib directory not found. Have you built the samples? -See \`config.log' for more details." "$LINENO" 5; } + { { echo "$as_me:$LINENO: error: the $IPPSAMPLES/speech-codecs/bin/*gcc*/lib directory not found. Have you built the samples? +See \`config.log' for more details." >&5 +echo "$as_me: error: the $IPPSAMPLES/speech-codecs/bin/*gcc*/lib directory not found. Have you built the samples? +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } fi if test ! -f $IPPSAMPLESLIB/libusc.a; then - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error "libusc.a doesn't exist in $IPPSAMPLESLIB -See \`config.log' for more details." "$LINENO" 5; } + { { echo "$as_me:$LINENO: error: libusc.a doesn't exist in $IPPSAMPLESLIB +See \`config.log' for more details." >&5 +echo "$as_me: error: libusc.a doesn't exist in $IPPSAMPLESLIB +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $IPPSAMPLESLIB" >&5 -$as_echo "$IPPSAMPLESLIB" >&6; } + { echo "$as_me:$LINENO: result: $IPPSAMPLESLIB" >&5 +echo "${ECHO_T}$IPPSAMPLESLIB" >&6; } SAVED_CFLAGS="$CFLAGS" SAVED_LDFLAGS="$LDFLAGS" @@ -5619,9 +11144,13 @@ $as_echo "$IPPSAMPLESLIB" >&6; } LDFLAGS="$LDFLAGS -L$IPPSAMPLESLIB" LIBS="-lusc $LIBS" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking Intel IPP USC usability" >&5 -$as_echo_n "checking Intel IPP USC usability... " >&6; } - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + { echo "$as_me:$LINENO: checking Intel IPP USC usability" >&5 +echo $ECHO_N "checking Intel IPP USC usability... $ECHO_C" >&6; } + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <usc.h> @@ -5633,17 +11162,39 @@ extern USC_Fxns USC_G729AFP_Fxns; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 -$as_echo "ok" >&6; } +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + { echo "$as_me:$LINENO: result: ok" >&5 +echo "${ECHO_T}ok" >&6; } else - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error "failed -See \`config.log' for more details." "$LINENO" 5; } + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + { { echo "$as_me:$LINENO: error: failed +See \`config.log' for more details." >&5 +echo "$as_me: error: failed +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext CFLAGS="$SAVED_CFLAGS" LDFLAGS="\$(IPP_LDFLAGS) $SAVED_LDFLAGS" @@ -5659,43 +11210,171 @@ export IPP_CFLAGS=$IPP_CFLAGS\n\ export IPP_LDFLAGS=$IPP_LDFLAGS\n\ export IPP_LIBS=$IPP_LIBS" else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: Skipping Intel IPP settings (not wanted)" >&5 -$as_echo "Skipping Intel IPP settings (not wanted)" >&6; } + { echo "$as_me:$LINENO: result: Skipping Intel IPP settings (not wanted)" >&5 +echo "${ECHO_T}Skipping Intel IPP settings (not wanted)" >&6; } fi # Check whether --enable-ssl was given. -if test "${enable_ssl+set}" = set; then : +if test "${enable_ssl+set}" = set; then enableval=$enable_ssl; if test "$enable_ssl" = "no"; then ac_no_ssl=1 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: Checking if SSL support is disabled... yes" >&5 -$as_echo "Checking if SSL support is disabled... yes" >&6; } + { echo "$as_me:$LINENO: result: Checking if SSL support is disabled... yes" >&5 +echo "${ECHO_T}Checking if SSL support is disabled... yes" >&6; } fi else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: checking for OpenSSL installations.." >&5 -$as_echo "checking for OpenSSL installations.." >&6; } + { echo "$as_me:$LINENO: result: checking for OpenSSL installations.." >&5 +echo "${ECHO_T}checking for OpenSSL installations.." >&6; } + + + + if test "${ac_cv_header_openssl_ssl_h+set}" = set; then + { echo "$as_me:$LINENO: checking for openssl/ssl.h" >&5 +echo $ECHO_N "checking for openssl/ssl.h... $ECHO_C" >&6; } +if test "${ac_cv_header_openssl_ssl_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +{ echo "$as_me:$LINENO: result: $ac_cv_header_openssl_ssl_h" >&5 +echo "${ECHO_T}$ac_cv_header_openssl_ssl_h" >&6; } +else + # Is the header compilable? +{ echo "$as_me:$LINENO: checking openssl/ssl.h usability" >&5 +echo $ECHO_N "checking openssl/ssl.h usability... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include <openssl/ssl.h> +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_compiler=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } + +# Is the header present? +{ echo "$as_me:$LINENO: checking openssl/ssl.h presence" >&5 +echo $ECHO_N "checking openssl/ssl.h presence... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <openssl/ssl.h> +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi + +rm -f conftest.err conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: openssl/ssl.h: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: openssl/ssl.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: openssl/ssl.h: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: openssl/ssl.h: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: openssl/ssl.h: present but cannot be compiled" >&5 +echo "$as_me: WARNING: openssl/ssl.h: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: openssl/ssl.h: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: openssl/ssl.h: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: openssl/ssl.h: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: openssl/ssl.h: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: openssl/ssl.h: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: openssl/ssl.h: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: openssl/ssl.h: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: openssl/ssl.h: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: openssl/ssl.h: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: openssl/ssl.h: in the future, the compiler will take precedence" >&2;} + ;; +esac +{ echo "$as_me:$LINENO: checking for openssl/ssl.h" >&5 +echo $ECHO_N "checking for openssl/ssl.h... $ECHO_C" >&6; } +if test "${ac_cv_header_openssl_ssl_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_header_openssl_ssl_h=$ac_header_preproc +fi +{ echo "$as_me:$LINENO: result: $ac_cv_header_openssl_ssl_h" >&5 +echo "${ECHO_T}$ac_cv_header_openssl_ssl_h" >&6; } - ac_fn_c_check_header_mongrel "$LINENO" "openssl/ssl.h" "ac_cv_header_openssl_ssl_h" "$ac_includes_default" -if test "x$ac_cv_header_openssl_ssl_h" = x""yes; then : +fi +if test $ac_cv_header_openssl_ssl_h = yes; then openssl_h_present=1 fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for SSL_library_init in -lssl" >&5 -$as_echo_n "checking for SSL_library_init in -lssl... " >&6; } -if test "${ac_cv_lib_ssl_SSL_library_init+set}" = set; then : - $as_echo_n "(cached) " >&6 + { echo "$as_me:$LINENO: checking for SSL_library_init in -lssl" >&5 +echo $ECHO_N "checking for SSL_library_init in -lssl... $ECHO_C" >&6; } +if test "${ac_cv_lib_ssl_SSL_library_init+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lssl $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. @@ -5713,29 +11392,54 @@ return SSL_library_init (); return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then ac_cv_lib_ssl_SSL_library_init=yes else - ac_cv_lib_ssl_SSL_library_init=no + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_lib_ssl_SSL_library_init=no fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ssl_SSL_library_init" >&5 -$as_echo "$ac_cv_lib_ssl_SSL_library_init" >&6; } -if test "x$ac_cv_lib_ssl_SSL_library_init" = x""yes; then : +{ echo "$as_me:$LINENO: result: $ac_cv_lib_ssl_SSL_library_init" >&5 +echo "${ECHO_T}$ac_cv_lib_ssl_SSL_library_init" >&6; } +if test $ac_cv_lib_ssl_SSL_library_init = yes; then libssl_present=1 && LIBS="$LIBS -lssl" fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ERR_load_BIO_strings in -lcrypto" >&5 -$as_echo_n "checking for ERR_load_BIO_strings in -lcrypto... " >&6; } -if test "${ac_cv_lib_crypto_ERR_load_BIO_strings+set}" = set; then : - $as_echo_n "(cached) " >&6 + { echo "$as_me:$LINENO: checking for ERR_load_BIO_strings in -lcrypto" >&5 +echo $ECHO_N "checking for ERR_load_BIO_strings in -lcrypto... $ECHO_C" >&6; } +if test "${ac_cv_lib_crypto_ERR_load_BIO_strings+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcrypto $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. @@ -5753,29 +11457,54 @@ return ERR_load_BIO_strings (); return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then ac_cv_lib_crypto_ERR_load_BIO_strings=yes else - ac_cv_lib_crypto_ERR_load_BIO_strings=no + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_lib_crypto_ERR_load_BIO_strings=no fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_ERR_load_BIO_strings" >&5 -$as_echo "$ac_cv_lib_crypto_ERR_load_BIO_strings" >&6; } -if test "x$ac_cv_lib_crypto_ERR_load_BIO_strings" = x""yes; then : +{ echo "$as_me:$LINENO: result: $ac_cv_lib_crypto_ERR_load_BIO_strings" >&5 +echo "${ECHO_T}$ac_cv_lib_crypto_ERR_load_BIO_strings" >&6; } +if test $ac_cv_lib_crypto_ERR_load_BIO_strings = yes; then libcrypto_present=1 && LIBS="$LIBS -lcrypto" fi if test "x$openssl_h_present" = "x1" -a "x$libssl_present" = "x1" -a "x$libcrypto_present" = "x1"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: OpenSSL library found, SSL support enabled" >&5 -$as_echo "OpenSSL library found, SSL support enabled" >&6; } - $as_echo "#define PJSIP_HAS_TLS_TRANSPORT 1" >>confdefs.h + { echo "$as_me:$LINENO: result: OpenSSL library found, SSL support enabled" >&5 +echo "${ECHO_T}OpenSSL library found, SSL support enabled" >&6; } + # PJSIP_HAS_TLS_TRANSPORT setting follows PJ_HAS_SSL_SOCK + #AC_DEFINE(PJSIP_HAS_TLS_TRANSPORT, 1) + cat >>confdefs.h <<\_ACEOF +#define PJ_HAS_SSL_SOCK 1 +_ACEOF else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: ** OpenSSL libraries not found, disabling SSL support **" >&5 -$as_echo "** OpenSSL libraries not found, disabling SSL support **" >&6; } + { echo "$as_me:$LINENO: result: ** OpenSSL libraries not found, disabling SSL support **" >&5 +echo "${ECHO_T}** OpenSSL libraries not found, disabling SSL support **" >&6; } fi fi @@ -5784,74 +11513,94 @@ fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if select() needs correct nfds" >&5 -$as_echo_n "checking if select() needs correct nfds... " >&6; } +{ echo "$as_me:$LINENO: checking if select() needs correct nfds" >&5 +echo $ECHO_N "checking if select() needs correct nfds... $ECHO_C" >&6; } case $target in - *rtems*) $as_echo "#define PJ_SELECT_NEEDS_NFDS 1" >>confdefs.h + *rtems*) cat >>confdefs.h <<\_ACEOF +#define PJ_SELECT_NEEDS_NFDS 1 +_ACEOF - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } ;; - *) $as_echo "#define PJ_SELECT_NEEDS_NFDS 0" >>confdefs.h + *) cat >>confdefs.h <<\_ACEOF +#define PJ_SELECT_NEEDS_NFDS 0 +_ACEOF - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no (default)" >&5 -$as_echo "no (default)" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: ** Decided that select() doesn't need correct nfds (please check)" >&5 -$as_echo "** Decided that select() doesn't need correct nfds (please check)" >&6; } + { echo "$as_me:$LINENO: result: no (default)" >&5 +echo "${ECHO_T}no (default)" >&6; } + { echo "$as_me:$LINENO: result: ** Decided that select() doesn't need correct nfds (please check)" >&5 +echo "${ECHO_T}** Decided that select() doesn't need correct nfds (please check)" >&6; } ;; esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if pj_thread_create() should enforce stack size" >&5 -$as_echo_n "checking if pj_thread_create() should enforce stack size... " >&6; } +{ echo "$as_me:$LINENO: checking if pj_thread_create() should enforce stack size" >&5 +echo $ECHO_N "checking if pj_thread_create() should enforce stack size... $ECHO_C" >&6; } case $target in - *rtems*) $as_echo "#define PJ_THREAD_SET_STACK_SIZE 1" >>confdefs.h + *rtems*) cat >>confdefs.h <<\_ACEOF +#define PJ_THREAD_SET_STACK_SIZE 1 +_ACEOF - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } ;; - *) $as_echo "#define PJ_THREAD_SET_STACK_SIZE 0" >>confdefs.h + *) cat >>confdefs.h <<\_ACEOF +#define PJ_THREAD_SET_STACK_SIZE 0 +_ACEOF - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no (default)" >&5 -$as_echo "no (default)" >&6; } + { echo "$as_me:$LINENO: result: no (default)" >&5 +echo "${ECHO_T}no (default)" >&6; } ;; esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if pj_thread_create() should allocate stack" >&5 -$as_echo_n "checking if pj_thread_create() should allocate stack... " >&6; } +{ echo "$as_me:$LINENO: checking if pj_thread_create() should allocate stack" >&5 +echo $ECHO_N "checking if pj_thread_create() should allocate stack... $ECHO_C" >&6; } case $target in - *rtems*) $as_echo "#define PJ_THREAD_ALLOCATE_STACK 1" >>confdefs.h + *rtems*) cat >>confdefs.h <<\_ACEOF +#define PJ_THREAD_ALLOCATE_STACK 1 +_ACEOF - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } ;; - *) $as_echo "#define PJ_THREAD_ALLOCATE_STACK 0" >>confdefs.h + *) cat >>confdefs.h <<\_ACEOF +#define PJ_THREAD_ALLOCATE_STACK 0 +_ACEOF - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no (default)" >&5 -$as_echo "no (default)" >&6; } + { echo "$as_me:$LINENO: result: no (default)" >&5 +echo "${ECHO_T}no (default)" >&6; } ;; esac case $target in *mingw* | *cygw* | *win32* | *w32* ) - $as_echo "#define PJ_BLOCKING_ERROR_VAL WSAEWOULDBLOCK" >>confdefs.h + cat >>confdefs.h <<\_ACEOF +#define PJ_BLOCKING_ERROR_VAL WSAEWOULDBLOCK +_ACEOF ;; - *) $as_echo "#define PJ_BLOCKING_ERROR_VAL EAGAIN" >>confdefs.h + *) cat >>confdefs.h <<\_ACEOF +#define PJ_BLOCKING_ERROR_VAL EAGAIN +_ACEOF - { $as_echo "$as_me:${as_lineno-$LINENO}: result: ** Setting non-blocking recv() retval to EAGAIN (please check)" >&5 -$as_echo "** Setting non-blocking recv() retval to EAGAIN (please check)" >&6; } + { echo "$as_me:$LINENO: result: ** Setting non-blocking recv() retval to EAGAIN (please check)" >&5 +echo "${ECHO_T}** Setting non-blocking recv() retval to EAGAIN (please check)" >&6; } ;; esac case $target in *mingw* | *cygw* | *win32* | *w32* ) - $as_echo "#define PJ_BLOCKING_CONNECT_ERROR_VAL WSAEWOULDBLOCK" >>confdefs.h + cat >>confdefs.h <<\_ACEOF +#define PJ_BLOCKING_CONNECT_ERROR_VAL WSAEWOULDBLOCK +_ACEOF ;; - *) $as_echo "#define PJ_BLOCKING_CONNECT_ERROR_VAL EINPROGRESS" >>confdefs.h + *) cat >>confdefs.h <<\_ACEOF +#define PJ_BLOCKING_CONNECT_ERROR_VAL EINPROGRESS +_ACEOF - { $as_echo "$as_me:${as_lineno-$LINENO}: result: ** Setting non-blocking connect() retval to EINPROGRESS (please check)" >&5 -$as_echo "** Setting non-blocking connect() retval to EINPROGRESS (please check)" >&6; } + { echo "$as_me:$LINENO: result: ** Setting non-blocking connect() retval to EINPROGRESS (please check)" >&5 +echo "${ECHO_T}** Setting non-blocking connect() retval to EINPROGRESS (please check)" >&6; } ;; esac @@ -5906,13 +11655,12 @@ _ACEOF case $ac_val in #( *${as_nl}*) case $ac_var in #( - *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 -$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 +echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( - BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( - *) { eval $ac_var=; unset $ac_var;} ;; + *) $as_unset $ac_var ;; esac ;; esac done @@ -5920,8 +11668,8 @@ $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) - # `set' does not quote correctly, so add quotes: double-quote - # substitution turns \\\\ into \\, and sed turns \\ into \. + # `set' does not quote correctly, so add quotes (double-quote + # substitution turns \\\\ into \\, and sed turns \\ into \). sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" @@ -5944,12 +11692,12 @@ $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then test "x$cache_file" != "x/dev/null" && - { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 -$as_echo "$as_me: updating cache $cache_file" >&6;} + { echo "$as_me:$LINENO: updating cache $cache_file" >&5 +echo "$as_me: updating cache $cache_file" >&6;} cat confcache >$cache_file else - { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 -$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} + { echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5 +echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache @@ -5965,11 +11713,11 @@ ac_ltlibobjs= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' - ac_i=`$as_echo "$ac_i" | sed "$ac_script"` + ac_i=`echo "$ac_i" | sed "$ac_script"` # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR # will be set to the directory where LIBOBJS objects are built. - as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" - as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' + ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext" + ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs @@ -5977,15 +11725,12 @@ LTLIBOBJS=$ac_ltlibobjs - : ${CONFIG_STATUS=./config.status} -ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" -{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 -$as_echo "$as_me: creating $CONFIG_STATUS" >&6;} -as_write_fail=0 -cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 +{ echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 +echo "$as_me: creating $CONFIG_STATUS" >&6;} +cat >$CONFIG_STATUS <<_ACEOF #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. @@ -5995,79 +11740,59 @@ cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 debug=false ac_cs_recheck=false ac_cs_silent=false - SHELL=\${CONFIG_SHELL-$SHELL} -export SHELL -_ASEOF -cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 -## -------------------- ## -## M4sh Initialization. ## -## -------------------- ## +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF +## --------------------- ## +## M4sh Initialization. ## +## --------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: - # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else - case `(set -o) 2>/dev/null` in #( - *posix*) : - set -o posix ;; #( - *) : - ;; + case `(set -o) 2>/dev/null` in + *posix*) set -o posix ;; esac + fi -as_nl=' -' -export as_nl -# Printing a long string crashes Solaris 7 /usr/bin/printf. -as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' -as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo -as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo -# Prefer a ksh shell builtin over an external printf program on Solaris, -# but without wasting forks for bash or zsh. -if test -z "$BASH_VERSION$ZSH_VERSION" \ - && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then - as_echo='print -r --' - as_echo_n='print -rn --' -elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then - as_echo='printf %s\n' - as_echo_n='printf %s' -else - if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then - as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' - as_echo_n='/usr/ucb/echo -n' + + +# PATH needs CR +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + echo "#! /bin/sh" >conf$$.sh + echo "exit 0" >>conf$$.sh + chmod +x conf$$.sh + if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then + PATH_SEPARATOR=';' else - as_echo_body='eval expr "X$1" : "X\\(.*\\)"' - as_echo_n_body='eval - arg=$1; - case $arg in #( - *"$as_nl"*) - expr "X$arg" : "X\\(.*\\)$as_nl"; - arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; - esac; - expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" - ' - export as_echo_n_body - as_echo_n='sh -c $as_echo_n_body as_echo' + PATH_SEPARATOR=: fi - export as_echo_body - as_echo='sh -c $as_echo_body as_echo' + rm -f conf$$.sh fi -# The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then - PATH_SEPARATOR=: - (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { - (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || - PATH_SEPARATOR=';' - } +# Support unset when possible. +if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then + as_unset=unset +else + as_unset=false fi @@ -6076,18 +11801,20 @@ fi # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) +as_nl=' +' IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. -case $0 in #(( +case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break - done + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break +done IFS=$as_save_IFS ;; @@ -6098,111 +11825,32 @@ if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then - $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 - exit 1 + echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + { (exit 1); exit 1; } fi -# Unset variables that we do not need and which cause bugs (e.g. in -# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" -# suppresses any "Segmentation fault" message there. '((' could -# trigger a bug in pdksh 5.2.14. -for as_var in BASH_ENV ENV MAIL MAILPATH -do eval test x\${$as_var+set} = xset \ - && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +# Work around bugs in pre-3.0 UWIN ksh. +for as_var in ENV MAIL MAILPATH +do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. -LC_ALL=C -export LC_ALL -LANGUAGE=C -export LANGUAGE - -# CDPATH. -(unset CDPATH) >/dev/null 2>&1 && unset CDPATH - - -# as_fn_error ERROR [LINENO LOG_FD] -# --------------------------------- -# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are -# provided, also output the error to LOG_FD, referencing LINENO. Then exit the -# script with status $?, using 1 if that was 0. -as_fn_error () -{ - as_status=$?; test $as_status -eq 0 && as_status=1 - if test "$3"; then - as_lineno=${as_lineno-"$2"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - $as_echo "$as_me:${as_lineno-$LINENO}: error: $1" >&$3 +for as_var in \ + LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ + LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ + LC_TELEPHONE LC_TIME +do + if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then + eval $as_var=C; export $as_var + else + ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var fi - $as_echo "$as_me: error: $1" >&2 - as_fn_exit $as_status -} # as_fn_error - - -# as_fn_set_status STATUS -# ----------------------- -# Set $? to STATUS, without forking. -as_fn_set_status () -{ - return $1 -} # as_fn_set_status - -# as_fn_exit STATUS -# ----------------- -# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. -as_fn_exit () -{ - set +e - as_fn_set_status $1 - exit $1 -} # as_fn_exit - -# as_fn_unset VAR -# --------------- -# Portably unset VAR. -as_fn_unset () -{ - { eval $1=; unset $1;} -} -as_unset=as_fn_unset -# as_fn_append VAR VALUE -# ---------------------- -# Append the text in VALUE to the end of the definition contained in VAR. Take -# advantage of any shell optimizations that allow amortized linear growth over -# repeated appends, instead of the typical quadratic growth present in naive -# implementations. -if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : - eval 'as_fn_append () - { - eval $1+=\$2 - }' -else - as_fn_append () - { - eval $1=\$$1\$2 - } -fi # as_fn_append - -# as_fn_arith ARG... -# ------------------ -# Perform arithmetic evaluation on the ARGs, and store the result in the -# global $as_val. Take advantage of shells that can avoid forks. The arguments -# must be portable across $(()) and expr. -if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : - eval 'as_fn_arith () - { - as_val=$(( $* )) - }' -else - as_fn_arith () - { - as_val=`expr "$@" || test $? -eq 1` - } -fi # as_fn_arith - +done +# Required to use basename. if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr @@ -6216,17 +11864,13 @@ else as_basename=false fi -if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then - as_dirname=dirname -else - as_dirname=false -fi +# Name of the executable. as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X/"$0" | +echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q @@ -6241,103 +11885,104 @@ $as_echo X/"$0" | } s/.*/./; q'` -# Avoid depending upon Character Ranges. -as_cr_letters='abcdefghijklmnopqrstuvwxyz' -as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' -as_cr_Letters=$as_cr_letters$as_cr_LETTERS -as_cr_digits='0123456789' -as_cr_alnum=$as_cr_Letters$as_cr_digits +# CDPATH. +$as_unset CDPATH + + + + as_lineno_1=$LINENO + as_lineno_2=$LINENO + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { + + # Create $as_me.lineno as a copy of $as_myself, but with $LINENO + # uniformly replaced by the line number. The first 'sed' inserts a + # line-number line after each line using $LINENO; the second 'sed' + # does the real work. The second script uses 'N' to pair each + # line-number line with the line containing $LINENO, and appends + # trailing '-' during substitution so that $LINENO is not a special + # case at line end. + # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the + # scripts with optimization help from Paolo Bonzini. Blame Lee + # E. McMahon (1931-1989) for sed's syntax. :-) + sed -n ' + p + /[$]LINENO/= + ' <$as_myself | + sed ' + s/[$]LINENO.*/&-/ + t lineno + b + :lineno + N + :loop + s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ + t loop + s/-\n.*// + ' >$as_me.lineno && + chmod +x "$as_me.lineno" || + { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 + { (exit 1); exit 1; }; } + + # Don't try to exec as it changes $[0], causing all sort of problems + # (the dirname of $[0] is not the place where we might find the + # original and so on. Autoconf is especially sensitive to this). + . "./$as_me.lineno" + # Exit status is that of the last command. + exit +} + + +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi ECHO_C= ECHO_N= ECHO_T= -case `echo -n x` in #((((( +case `echo -n x` in -n*) - case `echo 'xy\c'` in + case `echo 'x\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. - xy) ECHO_C='\c';; - *) echo `echo ksh88 bug on AIX 6.1` > /dev/null - ECHO_T=' ';; + *) ECHO_C='\c';; esac;; *) ECHO_N='-n';; esac +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir - mkdir conf$$.dir 2>/dev/null -fi -if (echo >conf$$.file) 2>/dev/null; then - if ln -s conf$$.file conf$$ 2>/dev/null; then - as_ln_s='ln -s' - # ... but there are two gotchas: - # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. - # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. - # In both cases, we have to default to `cp -p'. - ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || - as_ln_s='cp -p' - elif ln conf$$.file conf$$ 2>/dev/null; then - as_ln_s=ln - else + mkdir conf$$.dir +fi +echo >conf$$.file +if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -p'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' - fi +elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null - -# as_fn_mkdir_p -# ------------- -# Create "$as_dir" as a directory, including parents if necessary. -as_fn_mkdir_p () -{ - - case $as_dir in #( - -*) as_dir=./$as_dir;; - esac - test -d "$as_dir" || eval $as_mkdir_p || { - as_dirs= - while :; do - case $as_dir in #( - *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( - *) as_qdir=$as_dir;; - esac - as_dirs="'$as_qdir' $as_dirs" - as_dir=`$as_dirname -- "$as_dir" || -$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$as_dir" : 'X\(//\)[^/]' \| \ - X"$as_dir" : 'X\(//\)$' \| \ - X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$as_dir" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - test -d "$as_dir" && break - done - test -z "$as_dirs" || eval "mkdir $as_dirs" - } || test -d "$as_dir" || as_fn_error "cannot create directory $as_dir" - - -} # as_fn_mkdir_p if mkdir -p . 2>/dev/null; then - as_mkdir_p='mkdir -p "$as_dir"' + as_mkdir_p=: else test -d ./-p && rmdir ./-p as_mkdir_p=false @@ -6354,12 +11999,12 @@ else as_test_x=' eval sh -c '\'' if test -d "$1"; then - test -d "$1/."; + test -d "$1/."; else - case $1 in #( - -*)set "./$1";; + case $1 in + -*)set "./$1";; esac; - case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #(( + case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in ???[sx]*):;;*)false;;esac;fi '\'' sh ' @@ -6374,19 +12019,13 @@ as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 6>&1 -## ----------------------------------- ## -## Main body of $CONFIG_STATUS script. ## -## ----------------------------------- ## -_ASEOF -test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -# Save the log message, to keep $0 and so on meaningful, and to +# Save the log message, to keep $[0] and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" This file was extended by pjproject $as_me 1.0, which was -generated by GNU Autoconf 2.64. Invocation command line was +generated by GNU Autoconf 2.61. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS @@ -6399,40 +12038,29 @@ on `(hostname || uname -n) 2>/dev/null | sed 1q` _ACEOF -case $ac_config_files in *" -"*) set x $ac_config_files; shift; ac_config_files=$*;; -esac - -case $ac_config_headers in *" -"*) set x $ac_config_headers; shift; ac_config_headers=$*;; -esac - - -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +cat >>$CONFIG_STATUS <<_ACEOF # Files that config.status was made for. config_files="$ac_config_files" config_headers="$ac_config_headers" _ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +cat >>$CONFIG_STATUS <<\_ACEOF ac_cs_usage="\ -\`$as_me' instantiates files and other configuration actions -from templates according to the current configuration. Unless the files -and actions are specified as TAGs, all are instantiated by default. +\`$as_me' instantiates files from templates according to the +current configuration. -Usage: $0 [OPTION]... [TAG]... +Usage: $0 [OPTIONS] [FILE]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit - -q, --quiet, --silent - do not print progress messages + -q, --quiet do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions - --file=FILE[:TEMPLATE] - instantiate the configuration file FILE - --header=FILE[:TEMPLATE] - instantiate the configuration header FILE + --file=FILE[:TEMPLATE] + instantiate the configuration file FILE + --header=FILE[:TEMPLATE] + instantiate the configuration header FILE Configuration files: $config_files @@ -6440,26 +12068,26 @@ $config_files Configuration headers: $config_headers -Report bugs to the package provider." +Report bugs to <bug-autoconf@gnu.org>." _ACEOF -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ pjproject config.status 1.0 -configured by $0, generated by GNU Autoconf 2.64, - with options \\"`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" +configured by $0, generated by GNU Autoconf 2.61, + with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" -Copyright (C) 2009 Free Software Foundation, Inc. +Copyright (C) 2006 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." ac_pwd='$ac_pwd' srcdir='$srcdir' -test -n "\$AWK" || AWK=awk _ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -# The default lists apply if the user does not specify any file. +cat >>$CONFIG_STATUS <<\_ACEOF +# If no file are specified by the user, then we need to provide default +# value. By we need to know if files were specified by the user. ac_need_defaults=: while test $# != 0 do @@ -6481,38 +12109,34 @@ do -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) - $as_echo "$ac_cs_version"; exit ;; + echo "$ac_cs_version"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift - case $ac_optarg in - *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; - esac - as_fn_append CONFIG_FILES " '$ac_optarg'" + CONFIG_FILES="$CONFIG_FILES $ac_optarg" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift - case $ac_optarg in - *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; - esac - as_fn_append CONFIG_HEADERS " '$ac_optarg'" + CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg" ac_need_defaults=false;; --he | --h) # Conflict between --help and --header - as_fn_error "ambiguous option: \`$1' -Try \`$0 --help' for more information.";; + { echo "$as_me: error: ambiguous option: $1 +Try \`$0 --help' for more information." >&2 + { (exit 1); exit 1; }; };; --help | --hel | -h ) - $as_echo "$ac_cs_usage"; exit ;; + echo "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. - -*) as_fn_error "unrecognized option: \`$1' -Try \`$0 --help' for more information." ;; + -*) { echo "$as_me: error: unrecognized option: $1 +Try \`$0 --help' for more information." >&2 + { (exit 1); exit 1; }; } ;; - *) as_fn_append ac_config_targets " $1" + *) ac_config_targets="$ac_config_targets $1" ac_need_defaults=false ;; esac @@ -6527,32 +12151,30 @@ if $ac_cs_silent; then fi _ACEOF -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +cat >>$CONFIG_STATUS <<_ACEOF if \$ac_cs_recheck; then - set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion - shift - \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 - CONFIG_SHELL='$SHELL' + echo "running CONFIG_SHELL=$SHELL $SHELL $0 "$ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 + CONFIG_SHELL=$SHELL export CONFIG_SHELL - exec "\$@" + exec $SHELL "$0"$ac_configure_args \$ac_configure_extra_args --no-create --no-recursion fi _ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +cat >>$CONFIG_STATUS <<\_ACEOF exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX - $as_echo "$ac_log" + echo "$ac_log" } >&5 _ACEOF -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +cat >>$CONFIG_STATUS <<_ACEOF _ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +cat >>$CONFIG_STATUS <<\_ACEOF # Handling of arguments. for ac_config_target in $ac_config_targets @@ -6572,7 +12194,9 @@ do "third_party/build/portaudio/os-auto.mak") CONFIG_FILES="$CONFIG_FILES third_party/build/portaudio/os-auto.mak" ;; "third_party/build/os-auto.mak") CONFIG_FILES="$CONFIG_FILES third_party/build/os-auto.mak" ;; - *) as_fn_error "invalid argument: \`$ac_config_target'" "$LINENO" 5;; + *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 +echo "$as_me: error: invalid argument: $ac_config_target" >&2;} + { (exit 1); exit 1; }; };; esac done @@ -6598,7 +12222,7 @@ $debug || trap 'exit_status=$? { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status ' 0 - trap 'as_fn_exit 1' 1 2 13 15 + trap '{ (exit 1); exit 1; }' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. @@ -6609,140 +12233,156 @@ $debug || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") -} || as_fn_error "cannot create a temporary directory in ." "$LINENO" 5 - -# Set up the scripts for CONFIG_FILES section. -# No need to generate them if there are no CONFIG_FILES. -# This happens for instance with `./config.status config.h'. -if test -n "$CONFIG_FILES"; then +} || +{ + echo "$me: cannot create a temporary directory in ." >&2 + { (exit 1); exit 1; } +} +# +# Set up the sed scripts for CONFIG_FILES section. +# -ac_cr=`echo X | tr X '\015'` -# On cygwin, bash can eat \r inside `` if the user requested igncr. -# But we know of no other shell where ac_cr would be empty at this -# point, so we can use a bashism as a fallback. -if test "x$ac_cr" = x; then - eval ac_cr=\$\'\\r\' -fi -ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' </dev/null 2>/dev/null` -if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then - ac_cs_awk_cr='\r' -else - ac_cs_awk_cr=$ac_cr -fi +# No need to generate the scripts if there are no CONFIG_FILES. +# This happens for instance when ./config.status config.h +if test -n "$CONFIG_FILES"; then -echo 'BEGIN {' >"$tmp/subs1.awk" && _ACEOF -{ - echo "cat >conf$$subs.awk <<_ACEOF" && - echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && - echo "_ACEOF" -} >conf$$subs.sh || - as_fn_error "could not make $CONFIG_STATUS" "$LINENO" 5 -ac_delim_num=`echo "$ac_subst_vars" | grep -c '$'` + ac_delim='%!_!# ' for ac_last_try in false false false false false :; do - . ./conf$$subs.sh || - as_fn_error "could not make $CONFIG_STATUS" "$LINENO" 5 + cat >conf$$subs.sed <<_ACEOF +SHELL!$SHELL$ac_delim +PATH_SEPARATOR!$PATH_SEPARATOR$ac_delim +PACKAGE_NAME!$PACKAGE_NAME$ac_delim +PACKAGE_TARNAME!$PACKAGE_TARNAME$ac_delim +PACKAGE_VERSION!$PACKAGE_VERSION$ac_delim +PACKAGE_STRING!$PACKAGE_STRING$ac_delim +PACKAGE_BUGREPORT!$PACKAGE_BUGREPORT$ac_delim +exec_prefix!$exec_prefix$ac_delim +prefix!$prefix$ac_delim +program_transform_name!$program_transform_name$ac_delim +bindir!$bindir$ac_delim +sbindir!$sbindir$ac_delim +libexecdir!$libexecdir$ac_delim +datarootdir!$datarootdir$ac_delim +datadir!$datadir$ac_delim +sysconfdir!$sysconfdir$ac_delim +sharedstatedir!$sharedstatedir$ac_delim +localstatedir!$localstatedir$ac_delim +includedir!$includedir$ac_delim +oldincludedir!$oldincludedir$ac_delim +docdir!$docdir$ac_delim +infodir!$infodir$ac_delim +htmldir!$htmldir$ac_delim +dvidir!$dvidir$ac_delim +pdfdir!$pdfdir$ac_delim +psdir!$psdir$ac_delim +libdir!$libdir$ac_delim +localedir!$localedir$ac_delim +mandir!$mandir$ac_delim +DEFS!$DEFS$ac_delim +ECHO_C!$ECHO_C$ac_delim +ECHO_N!$ECHO_N$ac_delim +ECHO_T!$ECHO_T$ac_delim +LIBS!$LIBS$ac_delim +build_alias!$build_alias$ac_delim +host_alias!$host_alias$ac_delim +target_alias!$target_alias$ac_delim +build!$build$ac_delim +build_cpu!$build_cpu$ac_delim +build_vendor!$build_vendor$ac_delim +build_os!$build_os$ac_delim +host!$host$ac_delim +host_cpu!$host_cpu$ac_delim +host_vendor!$host_vendor$ac_delim +host_os!$host_os$ac_delim +target!$target$ac_delim +target_cpu!$target_cpu$ac_delim +target_vendor!$target_vendor$ac_delim +target_os!$target_os$ac_delim +CC!$CC$ac_delim +CFLAGS!$CFLAGS$ac_delim +LDFLAGS!$LDFLAGS$ac_delim +CPPFLAGS!$CPPFLAGS$ac_delim +ac_ct_CC!$ac_ct_CC$ac_delim +EXEEXT!$EXEEXT$ac_delim +OBJEXT!$OBJEXT$ac_delim +CXX!$CXX$ac_delim +CXXFLAGS!$CXXFLAGS$ac_delim +ac_ct_CXX!$ac_ct_CXX$ac_delim +ac_pjdir!$ac_pjdir$ac_delim +ac_build_mak_vars!$ac_build_mak_vars$ac_delim +CPP!$CPP$ac_delim +GREP!$GREP$ac_delim +EGREP!$EGREP$ac_delim +ac_os_objs!$ac_os_objs$ac_delim +ac_pjmedia_snd!$ac_pjmedia_snd$ac_delim +ac_pa_cflags!$ac_pa_cflags$ac_delim +ac_pa_use_alsa!$ac_pa_use_alsa$ac_delim +ac_pa_use_oss!$ac_pa_use_oss$ac_delim +ac_no_small_filter!$ac_no_small_filter$ac_delim +ac_no_large_filter!$ac_no_large_filter$ac_delim +ac_no_speex_aec!$ac_no_speex_aec$ac_delim +ac_no_g711_codec!$ac_no_g711_codec$ac_delim +ac_no_l16_codec!$ac_no_l16_codec$ac_delim +ac_no_gsm_codec!$ac_no_gsm_codec$ac_delim +ac_no_g722_codec!$ac_no_g722_codec$ac_delim +ac_no_g7221_codec!$ac_no_g7221_codec$ac_delim +ac_no_speex_codec!$ac_no_speex_codec$ac_delim +ac_no_ilbc_codec!$ac_no_ilbc_codec$ac_delim +ac_no_ssl!$ac_no_ssl$ac_delim +openssl_h_present!$openssl_h_present$ac_delim +libssl_present!$libssl_present$ac_delim +libcrypto_present!$libcrypto_present$ac_delim +ac_cross_compile!$ac_cross_compile$ac_delim +ac_linux_poll!$ac_linux_poll$ac_delim +ac_host!$ac_host$ac_delim +ac_main_obj!$ac_main_obj$ac_delim +LIBOBJS!$LIBOBJS$ac_delim +LTLIBOBJS!$LTLIBOBJS$ac_delim +_ACEOF - ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` - if test $ac_delim_n = $ac_delim_num; then + if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 89; then break elif $ac_last_try; then - as_fn_error "could not make $CONFIG_STATUS" "$LINENO" 5 + { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 +echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} + { (exit 1); exit 1; }; } else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done -rm -f conf$$subs.sh - -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -cat >>"\$tmp/subs1.awk" <<\\_ACAWK && -_ACEOF -sed -n ' -h -s/^/S["/; s/!.*/"]=/ -p -g -s/^[^!]*!// -:repl -t repl -s/'"$ac_delim"'$// -t delim -:nl -h -s/\(.\{148\}\).*/\1/ -t more1 -s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ -p -n -b repl -:more1 -s/["\\]/\\&/g; s/^/"/; s/$/"\\/ -p -g -s/.\{148\}// -t nl -:delim -h -s/\(.\{148\}\).*/\1/ -t more2 -s/["\\]/\\&/g; s/^/"/; s/$/"/ -p -b -:more2 -s/["\\]/\\&/g; s/^/"/; s/$/"\\/ -p -g -s/.\{148\}// -t delim -' <conf$$subs.awk | sed ' -/^[^""]/{ - N - s/\n// -} -' >>$CONFIG_STATUS || ac_write_fail=1 -rm -f conf$$subs.awk -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -_ACAWK -cat >>"\$tmp/subs1.awk" <<_ACAWK && - for (key in S) S_is_set[key] = 1 - FS = "" -} -{ - line = $ 0 - nfields = split(line, field, "@") - substed = 0 - len = length(field[1]) - for (i = 2; i < nfields; i++) { - key = field[i] - keylen = length(key) - if (S_is_set[key]) { - value = S[key] - line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) - len += length(value) + length(field[++i]) - substed = 1 - } else - len += 1 + keylen - } - - print line -} +ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed` +if test -n "$ac_eof"; then + ac_eof=`echo "$ac_eof" | sort -nru | sed 1q` + ac_eof=`expr $ac_eof + 1` +fi -_ACAWK +cat >>$CONFIG_STATUS <<_ACEOF +cat >"\$tmp/subs-1.sed" <<\CEOF$ac_eof +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b end _ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then - sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" -else - cat -fi < "$tmp/subs1.awk" > "$tmp/subs.awk" \ - || as_fn_error "could not setup config files machinery" "$LINENO" 5 +sed ' +s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g +s/^/s,@/; s/!/@,|#_!!_#|/ +:n +t n +s/'"$ac_delim"'$/,g/; t +s/$/\\/; p +N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n +' >>$CONFIG_STATUS <conf$$subs.sed +rm -f conf$$subs.sed +cat >>$CONFIG_STATUS <<_ACEOF +:end +s/|#_!!_#|//g +CEOF$ac_eof _ACEOF + # VPATH may cause trouble with some makes, so we remove $(srcdir), # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty @@ -6758,128 +12398,20 @@ s/^[^=]*=[ ]*$// }' fi -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +cat >>$CONFIG_STATUS <<\_ACEOF fi # test -n "$CONFIG_FILES" -# Set up the scripts for CONFIG_HEADERS section. -# No need to generate them if there are no CONFIG_HEADERS. -# This happens for instance with `./config.status Makefile'. -if test -n "$CONFIG_HEADERS"; then -cat >"$tmp/defines.awk" <<\_ACAWK || -BEGIN { -_ACEOF - -# Transform confdefs.h into an awk script `defines.awk', embedded as -# here-document in config.status, that substitutes the proper values into -# config.h.in to produce config.h. - -# Create a delimiter string that does not exist in confdefs.h, to ease -# handling of long lines. -ac_delim='%!_!# ' -for ac_last_try in false false :; do - ac_t=`sed -n "/$ac_delim/p" confdefs.h` - if test -z "$ac_t"; then - break - elif $ac_last_try; then - as_fn_error "could not make $CONFIG_HEADERS" "$LINENO" 5 - else - ac_delim="$ac_delim!$ac_delim _$ac_delim!! " - fi -done - -# For the awk script, D is an array of macro values keyed by name, -# likewise P contains macro parameters if any. Preserve backslash -# newline sequences. - -ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* -sed -n ' -s/.\{148\}/&'"$ac_delim"'/g -t rset -:rset -s/^[ ]*#[ ]*define[ ][ ]*/ / -t def -d -:def -s/\\$// -t bsnl -s/["\\]/\\&/g -s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ -D["\1"]=" \3"/p -s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p -d -:bsnl -s/["\\]/\\&/g -s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ -D["\1"]=" \3\\\\\\n"\\/p -t cont -s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p -t cont -d -:cont -n -s/.\{148\}/&'"$ac_delim"'/g -t clear -:clear -s/\\$// -t bsnlc -s/["\\]/\\&/g; s/^/"/; s/$/"/p -d -:bsnlc -s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p -b cont -' <confdefs.h | sed ' -s/'"$ac_delim"'/"\\\ -"/g' >>$CONFIG_STATUS || ac_write_fail=1 - -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 - for (key in D) D_is_set[key] = 1 - FS = "" -} -/^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { - line = \$ 0 - split(line, arg, " ") - if (arg[1] == "#") { - defundef = arg[2] - mac1 = arg[3] - } else { - defundef = substr(arg[1], 2) - mac1 = arg[2] - } - split(mac1, mac2, "(") #) - macro = mac2[1] - prefix = substr(line, 1, index(line, defundef) - 1) - if (D_is_set[macro]) { - # Preserve the white space surrounding the "#". - print prefix "define", macro P[macro] D[macro] - next - } else { - # Replace #undef with comments. This is necessary, for example, - # in the case of _POSIX_SOURCE, which is predefined and required - # on some systems where configure will not decide to define it. - if (defundef == "undef") { - print "/*", prefix defundef, macro, "*/" - next - } - } -} -{ print } -_ACAWK -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 - as_fn_error "could not setup config headers machinery" "$LINENO" 5 -fi # test -n "$CONFIG_HEADERS" - -eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS " -shift -for ac_tag +for ac_tag in :F $CONFIG_FILES :H $CONFIG_HEADERS do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; - :L* | :C*:*) as_fn_error "invalid tag \`$ac_tag'" "$LINENO" 5;; + :L* | :C*:*) { { echo "$as_me:$LINENO: error: Invalid tag $ac_tag." >&5 +echo "$as_me: error: Invalid tag $ac_tag." >&2;} + { (exit 1); exit 1; }; };; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac @@ -6907,34 +12439,26 @@ do [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || - as_fn_error "cannot find input file: \`$ac_f'" "$LINENO" 5;; + { { echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5 +echo "$as_me: error: cannot find input file: $ac_f" >&2;} + { (exit 1); exit 1; }; };; esac - case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac - as_fn_append ac_file_inputs " '$ac_f'" + ac_file_inputs="$ac_file_inputs $ac_f" done # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ - configure_input='Generated from '` - $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' - `' by configure.' + configure_input="Generated from "`IFS=: + echo $* | sed 's|^[^:]*/||;s|:[^:]*/|, |g'`" by configure." if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" - { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 -$as_echo "$as_me: creating $ac_file" >&6;} + { echo "$as_me:$LINENO: creating $ac_file" >&5 +echo "$as_me: creating $ac_file" >&6;} fi - # Neutralize special characters interpreted by sed in replacement strings. - case $configure_input in #( - *\&* | *\|* | *\\* ) - ac_sed_conf_input=`$as_echo "$configure_input" | - sed 's/[\\\\&|]/\\\\&/g'`;; #( - *) ac_sed_conf_input=$configure_input;; - esac case $ac_tag in - *:-:* | *:-) cat >"$tmp/stdin" \ - || as_fn_error "could not create $ac_file" "$LINENO" 5 ;; + *:-:* | *:-) cat >"$tmp/stdin";; esac ;; esac @@ -6944,7 +12468,42 @@ $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$ac_file" | +echo X"$ac_file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + { as_dir="$ac_dir" + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q @@ -6962,15 +12521,20 @@ $as_echo X"$ac_file" | q } s/.*/./; q'` - as_dir="$ac_dir"; as_fn_mkdir_p + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 +echo "$as_me: error: cannot create directory $as_dir" >&2;} + { (exit 1); exit 1; }; }; } ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) - ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A ".." for each directory in $ac_dir_suffix. - ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; @@ -7006,12 +12570,12 @@ ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix _ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +cat >>$CONFIG_STATUS <<\_ACEOF # If the template does not know about datarootdir, expand it. # FIXME: This hack should be removed a few years after 2.60. ac_datarootdir_hack=; ac_datarootdir_seen= -ac_sed_dataroot=' -/datarootdir/ { + +case `sed -n '/datarootdir/ { p q } @@ -7019,37 +12583,36 @@ ac_sed_dataroot=' /@docdir@/p /@infodir@/p /@localedir@/p -/@mandir@/p' -case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in +/@mandir@/p +' $ac_file_inputs` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 -$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 +echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +cat >>$CONFIG_STATUS <<_ACEOF ac_datarootdir_hack=' s&@datadir@&$datadir&g s&@docdir@&$docdir&g s&@infodir@&$infodir&g s&@localedir@&$localedir&g s&@mandir@&$mandir&g - s&\\\${datarootdir}&$datarootdir&g' ;; + s&\\\${datarootdir}&$datarootdir&g' ;; esac _ACEOF # Neutralize VPATH when `$srcdir' = `.'. # Shell code in configure.ac might set extrasub. # FIXME: do we really want to maintain this feature? -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -ac_sed_extra="$ac_vpsub +cat >>$CONFIG_STATUS <<_ACEOF + sed "$ac_vpsub $extrasub _ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +cat >>$CONFIG_STATUS <<\_ACEOF :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b -s|@configure_input@|$ac_sed_conf_input|;t t +s&@configure_input@&$configure_input&;t t s&@top_builddir@&$ac_top_builddir_sub&;t t -s&@top_build_prefix@&$ac_top_build_prefix&;t t s&@srcdir@&$ac_srcdir&;t t s&@abs_srcdir@&$ac_abs_srcdir&;t t s&@top_srcdir@&$ac_top_srcdir&;t t @@ -7058,48 +12621,119 @@ s&@builddir@&$ac_builddir&;t t s&@abs_builddir@&$ac_abs_builddir&;t t s&@abs_top_builddir@&$ac_abs_top_builddir&;t t $ac_datarootdir_hack -" -eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$tmp/subs.awk" >$tmp/out \ - || as_fn_error "could not create $ac_file" "$LINENO" 5 +" $ac_file_inputs | sed -f "$tmp/subs-1.sed" >$tmp/out test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } && - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' + { echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined." >&5 -$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' +echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined." >&2;} rm -f "$tmp/stdin" case $ac_file in - -) cat "$tmp/out" && rm -f "$tmp/out";; - *) rm -f "$ac_file" && mv "$tmp/out" "$ac_file";; - esac \ - || as_fn_error "could not create $ac_file" "$LINENO" 5 + -) cat "$tmp/out"; rm -f "$tmp/out";; + *) rm -f "$ac_file"; mv "$tmp/out" $ac_file;; + esac ;; :H) # # CONFIG_HEADER # +_ACEOF + +# Transform confdefs.h into a sed script `conftest.defines', that +# substitutes the proper values into config.h.in to produce config.h. +rm -f conftest.defines conftest.tail +# First, append a space to every undef/define line, to ease matching. +echo 's/$/ /' >conftest.defines +# Then, protect against being on the right side of a sed subst, or in +# an unquoted here document, in config.status. If some macros were +# called several times there might be several #defines for the same +# symbol, which is useless. But do not sort them, since the last +# AC_DEFINE must be honored. +ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* +# These sed commands are passed to sed as "A NAME B PARAMS C VALUE D", where +# NAME is the cpp macro being defined, VALUE is the value it is being given. +# PARAMS is the parameter list in the macro definition--in most cases, it's +# just an empty string. +ac_dA='s,^\\([ #]*\\)[^ ]*\\([ ]*' +ac_dB='\\)[ (].*,\\1define\\2' +ac_dC=' ' +ac_dD=' ,' + +uniq confdefs.h | + sed -n ' + t rset + :rset + s/^[ ]*#[ ]*define[ ][ ]*// + t ok + d + :ok + s/[\\&,]/\\&/g + s/^\('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/ '"$ac_dA"'\1'"$ac_dB"'\2'"${ac_dC}"'\3'"$ac_dD"'/p + s/^\('"$ac_word_re"'\)[ ]*\(.*\)/'"$ac_dA"'\1'"$ac_dB$ac_dC"'\2'"$ac_dD"'/p + ' >>conftest.defines + +# Remove the space that was appended to ease matching. +# Then replace #undef with comments. This is necessary, for +# example, in the case of _POSIX_SOURCE, which is predefined and required +# on some systems where configure will not decide to define it. +# (The regexp can be short, since the line contains either #define or #undef.) +echo 's/ $// +s,^[ #]*u.*,/* & */,' >>conftest.defines + +# Break up conftest.defines: +ac_max_sed_lines=50 + +# First sed command is: sed -f defines.sed $ac_file_inputs >"$tmp/out1" +# Second one is: sed -f defines.sed "$tmp/out1" >"$tmp/out2" +# Third one will be: sed -f defines.sed "$tmp/out2" >"$tmp/out1" +# et cetera. +ac_in='$ac_file_inputs' +ac_out='"$tmp/out1"' +ac_nxt='"$tmp/out2"' + +while : +do + # Write a here document: + cat >>$CONFIG_STATUS <<_ACEOF + # First, check the format of the line: + cat >"\$tmp/defines.sed" <<\\CEOF +/^[ ]*#[ ]*undef[ ][ ]*$ac_word_re[ ]*\$/b def +/^[ ]*#[ ]*define[ ][ ]*$ac_word_re[( ]/b def +b +:def +_ACEOF + sed ${ac_max_sed_lines}q conftest.defines >>$CONFIG_STATUS + echo 'CEOF + sed -f "$tmp/defines.sed"' "$ac_in >$ac_out" >>$CONFIG_STATUS + ac_in=$ac_out; ac_out=$ac_nxt; ac_nxt=$ac_in + sed 1,${ac_max_sed_lines}d conftest.defines >conftest.tail + grep . conftest.tail >/dev/null || break + rm -f conftest.defines + mv conftest.tail conftest.defines +done +rm -f conftest.defines conftest.tail + +echo "ac_result=$ac_in" >>$CONFIG_STATUS +cat >>$CONFIG_STATUS <<\_ACEOF if test x"$ac_file" != x-; then - { - $as_echo "/* $configure_input */" \ - && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" - } >"$tmp/config.h" \ - || as_fn_error "could not create $ac_file" "$LINENO" 5 - if diff "$ac_file" "$tmp/config.h" >/dev/null 2>&1; then - { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 -$as_echo "$as_me: $ac_file is unchanged" >&6;} + echo "/* $configure_input */" >"$tmp/config.h" + cat "$ac_result" >>"$tmp/config.h" + if diff $ac_file "$tmp/config.h" >/dev/null 2>&1; then + { echo "$as_me:$LINENO: $ac_file is unchanged" >&5 +echo "$as_me: $ac_file is unchanged" >&6;} else - rm -f "$ac_file" - mv "$tmp/config.h" "$ac_file" \ - || as_fn_error "could not create $ac_file" "$LINENO" 5 + rm -f $ac_file + mv "$tmp/config.h" $ac_file fi else - $as_echo "/* $configure_input */" \ - && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" \ - || as_fn_error "could not create -" "$LINENO" 5 + echo "/* $configure_input */" + cat "$ac_result" fi + rm -f "$tmp/out12" ;; @@ -7108,13 +12742,11 @@ $as_echo "$as_me: $ac_file is unchanged" >&6;} done # for ac_tag -as_fn_exit 0 +{ (exit 0); exit 0; } _ACEOF +chmod +x $CONFIG_STATUS ac_clean_files=$ac_clean_files_save -test $ac_write_fail = 0 || - as_fn_error "write failure creating $CONFIG_STATUS" "$LINENO" 5 - # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. @@ -7134,16 +12766,12 @@ if test "$no_create" != yes; then exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. - $ac_cs_success || as_fn_exit $? -fi -if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 -$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} + $ac_cs_success || { (exit 1); exit 1; } fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: +{ echo "$as_me:$LINENO: result: Configurations for current target have been written to 'build.mak', and 'os-auto.mak' in various build directories, and pjlib/include/pj/compat/os_auto.h. @@ -7153,7 +12781,7 @@ Further customizations can be put in: The next step now is to run 'make dep' and 'make'. " >&5 -$as_echo " +echo "${ECHO_T} Configurations for current target have been written to 'build.mak', and 'os-auto.mak' in various build directories, and pjlib/include/pj/compat/os_auto.h. diff --git a/sflphone-common/libs/pjproject/aconfigure.ac b/sflphone-common/libs/pjproject/aconfigure.ac index b8b7914f25ff93c29dc68d3179dee808dd1fb98c..7f579e7fe6b8cb8513cb3679a89f736a1315a5d0 100644 --- a/sflphone-common/libs/pjproject/aconfigure.ac +++ b/sflphone-common/libs/pjproject/aconfigure.ac @@ -150,6 +150,7 @@ AC_CHECK_HEADER(netinet/ip.h,[AC_DEFINE(PJ_HAS_NETINET_IP_H,1)],[], # include <netinet/in_systm.h> #endif ]) +AC_CHECK_HEADER(netinet/tcp.h,[AC_DEFINE(PJ_HAS_NETINET_TCP_H,1)]) AC_CHECK_HEADER(ifaddrs.h,[AC_DEFINE(PJ_HAS_IFADDRS_H,1)]) AC_CHECK_HEADER(semaphore.h,[AC_DEFINE(PJ_HAS_SEMAPHORE_H,1)]) AC_CHECK_HEADER(setjmp.h,[AC_DEFINE(PJ_HAS_SETJMP_H,1)]) @@ -559,10 +560,6 @@ AC_ARG_ENABLE(speex-codec, dnl # Include iLBC codec AC_SUBST(ac_no_ilbc_codec) -#AC_DEFINE(ac_no_ilbc_codec, 1) -#AC_DEFINE(PJMEDIA_HAS_ILBC_CODEC, 0) -#AC_MSG_RESULT([Checking if iLBC codec is disabled...yes]) - AC_ARG_ENABLE(ilbc-codec, AC_HELP_STRING([--disable-ilbc-codec], [Exclude iLBC codec in the build]), @@ -571,9 +568,7 @@ AC_ARG_ENABLE(ilbc-codec, AC_DEFINE(PJMEDIA_HAS_ILBC_CODEC,0) AC_MSG_RESULT([Checking if iLBC codec is disabled...yes]) fi], - [ac_no_ilbc_codec=1] - AC_DEFINE(PJMEDIA_HAS_ILBC_CODEC,0) - AC_MSG_RESULT([Checking if iLBC codec is disabled...yes])) + AC_MSG_RESULT([Checking if iLBC codec is disabled...no])) dnl # Include libsamplerate AC_ARG_ENABLE(libsamplerate, @@ -763,7 +758,9 @@ AC_ARG_ENABLE(ssl, AC_CHECK_LIB(crypto,ERR_load_BIO_strings,[libcrypto_present=1 && LIBS="$LIBS -lcrypto"]) if test "x$openssl_h_present" = "x1" -a "x$libssl_present" = "x1" -a "x$libcrypto_present" = "x1"; then AC_MSG_RESULT([OpenSSL library found, SSL support enabled]) - AC_DEFINE(PJSIP_HAS_TLS_TRANSPORT, 1) + # PJSIP_HAS_TLS_TRANSPORT setting follows PJ_HAS_SSL_SOCK + #AC_DEFINE(PJSIP_HAS_TLS_TRANSPORT, 1) + AC_DEFINE(PJ_HAS_SSL_SOCK, 1) else AC_MSG_RESULT([** OpenSSL libraries not found, disabling SSL support **]) fi diff --git a/sflphone-common/libs/pjproject/autogen.sh b/sflphone-common/libs/pjproject/autogen.sh deleted file mode 100755 index 695c27e85ee6a3fd11a52bae54b04f11ab6579b7..0000000000000000000000000000000000000000 --- a/sflphone-common/libs/pjproject/autogen.sh +++ /dev/null @@ -1,26 +0,0 @@ -#!/bin/bash -##################################################### -# File Name: autogen.sh -# -# Purpose : -# -# Author: Julien Bonjean (julien@bonjean.info) -# -# Creation Date: 2009-05-26 -# Last Modified: 2009-06-01 18:25:28 -0400 -##################################################### - -if [ -e /usr/share/misc/config.guess ]; then - rm -f config.sub config.guess - ln -s /usr/share/misc/config.sub . - ln -s /usr/share/misc/config.guess . -elif [ -e /usr/lib/rpm/config.guess ]; then - rm -f config.sub config.guess - ln -s /usr/lib/rpm/config.sub . - ln -s /usr/lib/rpm/config.guess . -else - aclocal --force - automake --add-missing --force-missing --copy -fi - -exit 0 diff --git a/sflphone-common/libs/pjproject/build.mak.in b/sflphone-common/libs/pjproject/build.mak.in index d9e9e09cbf6abf2b40e52bc06e999fc0cc92e1f8..e393eb71743cfc497edec5e07c42d1381964d837 100644 --- a/sflphone-common/libs/pjproject/build.mak.in +++ b/sflphone-common/libs/pjproject/build.mak.in @@ -10,8 +10,8 @@ export LINUX_POLL := @ac_linux_poll@ LIB_SUFFIX = $(TARGET_NAME).a # Determine which party libraries to use -export APP_THIRD_PARTY_LIBS := -lresample-$(TARGET_NAME) -lsrtp-$(TARGET_NAME) -export APP_THIRD_PARTY_LIB_FILES = $(PJ_DIR)/third_party/lib/libresample-$(LIB_SUFFIX) $(PJ_DIR)/third_party/lib/libsrtp-$(LIB_SUFFIX) +export APP_THIRD_PARTY_LIBS := -lresample-$(TARGET_NAME) -lmilenage-$(TARGET_NAME) -lsrtp-$(TARGET_NAME) +export APP_THIRD_PARTY_LIB_FILES = $(PJ_DIR)/third_party/lib/libresample-$(LIB_SUFFIX) $(PJ_DIR)/third_party/lib/libmilenage-$(LIB_SUFFIX) $(PJ_DIR)/third_party/lib/libsrtp-$(LIB_SUFFIX) ifneq (@ac_no_gsm_codec@,1) APP_THIRD_PARTY_LIBS += -lgsmcodec-$(TARGET_NAME) @@ -59,29 +59,29 @@ export APP_LDFLAGS := -L$(PJDIR)/pjlib/lib\ -L$(PJDIR)/pjsip/lib\ -L$(PJDIR)/third_party/lib\ @LDFLAGS@ -export APP_LDLIBS := -lpjsua-sfl-$(TARGET_NAME)\ - -lpjsip-ua-sfl-$(TARGET_NAME)\ - -lpjsip-simple-sfl-$(TARGET_NAME)\ - -lpjsip-sfl-$(TARGET_NAME)\ - -lpjmedia-codec-sfl-$(TARGET_NAME)\ - -lpjmedia-sfl-$(TARGET_NAME)\ - -lpjmedia-audiodev-sfl-$(TARGET_NAME)\ - -lpjnath-sfl-$(TARGET_NAME)\ - -lpjlib-util-sfl-$(TARGET_NAME)\ +export APP_LDLIBS := -lpjsua-$(TARGET_NAME)\ + -lpjsip-ua-$(TARGET_NAME)\ + -lpjsip-simple-$(TARGET_NAME)\ + -lpjsip-$(TARGET_NAME)\ + -lpjmedia-codec-$(TARGET_NAME)\ + -lpjmedia-$(TARGET_NAME)\ + -lpjmedia-audiodev-$(TARGET_NAME)\ + -lpjnath-$(TARGET_NAME)\ + -lpjlib-util-$(TARGET_NAME)\ $(APP_THIRD_PARTY_LIBS)\ - -lpj-sfl-$(TARGET_NAME)\ + -lpj-$(TARGET_NAME)\ @LIBS@ -export APP_LIB_FILES = $(PJ_DIR)/pjsip/lib/libpjsua-sfl-$(LIB_SUFFIX) \ - $(PJ_DIR)/pjsip/lib/libpjsip-ua-sfl-$(LIB_SUFFIX) \ - $(PJ_DIR)/pjsip/lib/libpjsip-simple-sfl-$(LIB_SUFFIX) \ - $(PJ_DIR)/pjsip/lib/libpjsip-sfl-$(LIB_SUFFIX) \ - $(PJ_DIR)/pjmedia/lib/libpjmedia-codec-sfl-$(LIB_SUFFIX) \ - $(PJ_DIR)/pjmedia/lib/libpjmedia-sfl-$(LIB_SUFFIX) \ - $(PJ_DIR)/pjmedia/lib/libpjmedia-audiodev-sfl-$(LIB_SUFFIX) \ - $(PJ_DIR)/pjnath/lib/libpjnath-sfl-$(LIB_SUFFIX) \ - $(PJ_DIR)/pjlib-util/lib/libpjlib-util-sfl-$(LIB_SUFFIX) \ +export APP_LIB_FILES = $(PJ_DIR)/pjsip/lib/libpjsua-$(LIB_SUFFIX) \ + $(PJ_DIR)/pjsip/lib/libpjsip-ua-$(LIB_SUFFIX) \ + $(PJ_DIR)/pjsip/lib/libpjsip-simple-$(LIB_SUFFIX) \ + $(PJ_DIR)/pjsip/lib/libpjsip-$(LIB_SUFFIX) \ + $(PJ_DIR)/pjmedia/lib/libpjmedia-codec-$(LIB_SUFFIX) \ + $(PJ_DIR)/pjmedia/lib/libpjmedia-$(LIB_SUFFIX) \ + $(PJ_DIR)/pjmedia/lib/libpjmedia-audiodev-$(LIB_SUFFIX) \ + $(PJ_DIR)/pjnath/lib/libpjnath-$(LIB_SUFFIX) \ + $(PJ_DIR)/pjlib-util/lib/libpjlib-util-$(LIB_SUFFIX) \ $(APP_THIRD_PARTY_LIB_FILES) \ - $(PJ_DIR)/pjlib/lib/libpj-sfl-$(LIB_SUFFIX) + $(PJ_DIR)/pjlib/lib/libpj-$(LIB_SUFFIX) export PJ_DIR := $(PJDIR) export PJ_CC := $(APP_CC) diff --git a/sflphone-common/libs/pjproject/build.symbian/bld.inf b/sflphone-common/libs/pjproject/build.symbian/bld.inf index b516a1d9cf66984f9096e7b75dc1b145e5f0af57..7e26998768706f551cc33cd9cf8c06c0a8384658 100644 --- a/sflphone-common/libs/pjproject/build.symbian/bld.inf +++ b/sflphone-common/libs/pjproject/build.symbian/bld.inf @@ -1,6 +1,6 @@ prj_platforms winscw -//armv5 +armv5 gcce prj_mmpfiles @@ -30,7 +30,6 @@ libresample.mmp pjmedia_audiodev.mmp /* Applications */ -//pjlib_test.mmp //symsndtest.mmp symbian_ua.mmp ..\pjsip-apps\src\symbian_ua_gui\group\symbian_ua_gui.mmp diff --git a/sflphone-common/libs/pjproject/build.symbian/libg7221codec.mmp b/sflphone-common/libs/pjproject/build.symbian/libg7221codec.mmp index 95d379591fa1d795f1da432edf5353c375c0126f..814fcae6ee1d626fb840b6beaf89eb227730393f 100644 --- a/sflphone-common/libs/pjproject/build.symbian/libg7221codec.mmp +++ b/sflphone-common/libs/pjproject/build.symbian/libg7221codec.mmp @@ -3,6 +3,7 @@ TARGETTYPE lib //OPTION CW -lang c++ OPTION GCCE -O2 -fno-unit-at-a-time +OPTION ARMCC --gnu MACRO PJ_M_I386=1 MACRO PJ_SYMBIAN=1 diff --git a/sflphone-common/libs/pjproject/build.symbian/libgsmcodec.mmp b/sflphone-common/libs/pjproject/build.symbian/libgsmcodec.mmp index 754bceac372cc4e51ad34d524c834088e3c2c174..1b301f8c39e06bf2c0b9dc7c52d80891e0f3ff8b 100644 --- a/sflphone-common/libs/pjproject/build.symbian/libgsmcodec.mmp +++ b/sflphone-common/libs/pjproject/build.symbian/libgsmcodec.mmp @@ -19,6 +19,7 @@ TARGETTYPE lib #endif //OPTION CW -lang c++ +OPTION ARMCC --gnu MACRO PJ_M_I386=1 MACRO PJ_SYMBIAN=1 diff --git a/sflphone-common/libs/pjproject/build.symbian/libpassthroughcodec.mmp b/sflphone-common/libs/pjproject/build.symbian/libpassthroughcodec.mmp index c4fb2775520173aa722828a1ad2839e1c00d6f18..3a1911714e466b178cf71acc01ef4f988f1871d6 100644 --- a/sflphone-common/libs/pjproject/build.symbian/libpassthroughcodec.mmp +++ b/sflphone-common/libs/pjproject/build.symbian/libpassthroughcodec.mmp @@ -9,6 +9,7 @@ MACRO PJ_SYMBIAN=1 // GCCE optimization setting // OPTION GCCE -O2 -fno-unit-at-a-time +OPTION ARMCC --gnu // // Passthrough codecs wrapper for pjmedia-codec diff --git a/sflphone-common/libs/pjproject/build.symbian/libresample.mmp b/sflphone-common/libs/pjproject/build.symbian/libresample.mmp index 1498714685a4e65620d094e67a2814756c060be4..0dd074ff08189bade7c9a3ccc750adcc7ba834d1 100644 --- a/sflphone-common/libs/pjproject/build.symbian/libresample.mmp +++ b/sflphone-common/libs/pjproject/build.symbian/libresample.mmp @@ -7,6 +7,7 @@ SOURCEPATH ..\third_party\resample\src // GCCE optimization setting // OPTION GCCE -O2 -fno-unit-at-a-time +OPTION ARMCC --gnu MACRO PJ_M_I386=1 MACRO PJ_SYMBIAN=1 diff --git a/sflphone-common/libs/pjproject/build.symbian/libspeexcodec.mmp b/sflphone-common/libs/pjproject/build.symbian/libspeexcodec.mmp index 1be8a19eea4e78053cbc9b60132be6977b0f7838..816d805370ec8773b65cdf8887a90ee6780fad33 100644 --- a/sflphone-common/libs/pjproject/build.symbian/libspeexcodec.mmp +++ b/sflphone-common/libs/pjproject/build.symbian/libspeexcodec.mmp @@ -9,6 +9,7 @@ MACRO PJ_SYMBIAN=1 // GCCE optimization setting // OPTION GCCE -O2 -fno-unit-at-a-time +OPTION ARMCC --gnu // // Speex files diff --git a/sflphone-common/libs/pjproject/build.symbian/libsrtp.mmp b/sflphone-common/libs/pjproject/build.symbian/libsrtp.mmp index 11384d22dfd1feaaa414d232c0540ee3743d50d5..4309e6dc10fc9f0276d88cde19ac89f7ba4fa419 100644 --- a/sflphone-common/libs/pjproject/build.symbian/libsrtp.mmp +++ b/sflphone-common/libs/pjproject/build.symbian/libsrtp.mmp @@ -8,6 +8,7 @@ MACRO PJ_SYMBIAN=1 // GCCE optimization setting // OPTION GCCE -O2 -fno-unit-at-a-time +OPTION ARMCC --gnu // // Speex files diff --git a/sflphone-common/libs/pjproject/build.symbian/null_audio.mmp b/sflphone-common/libs/pjproject/build.symbian/null_audio.mmp index ea935bb236641bc9fddbcbd18672fffa660533ed..de1dcbdc69bfb7850edea16e53efb6aedb520295 100644 --- a/sflphone-common/libs/pjproject/build.symbian/null_audio.mmp +++ b/sflphone-common/libs/pjproject/build.symbian/null_audio.mmp @@ -22,6 +22,7 @@ TARGETTYPE lib SOURCEPATH ..\pjmedia\src\pjmedia OPTION CW -lang c++ +OPTION ARMCC --gnu MACRO PJ_M_I386=1 MACRO PJ_SYMBIAN=1 diff --git a/sflphone-common/libs/pjproject/build.symbian/pjlib.mmp b/sflphone-common/libs/pjproject/build.symbian/pjlib.mmp index ec4a9902cec2857ebde9fbb644787b5d0f6e97a9..65ffcc5a09faa49659049cf170317026162e2084 100644 --- a/sflphone-common/libs/pjproject/build.symbian/pjlib.mmp +++ b/sflphone-common/libs/pjproject/build.symbian/pjlib.mmp @@ -24,7 +24,7 @@ MACRO PJ_SYMBIAN=1 // Must compile as C++, otherwise exception would not work OPTION CW -lang c++ -OPTION ARMCC --cpp +OPTION ARMCC --cpp --gnu OPTION GCC -x c++ OPTION GCCE -x c++ @@ -50,6 +50,7 @@ SOURCE pool_caching.c SOURCE rand.c SOURCE rbtree.c SOURCE sock_common.c +SOURCE sock_qos_common.c SOURCE types.c @@ -71,8 +72,11 @@ SOURCE os_timestamp_common.c SOURCE os_time_unix.c SOURCE os_timestamp_posix.c SOURCE pool_policy_new.cpp +SOURCE ssl_sock_common.c +SOURCE ssl_sock_symbian.cpp SOURCE sock_symbian.cpp SOURCE sock_select_symbian.cpp +SOURCE sock_qos_symbian.cpp SOURCE timer_symbian.cpp SOURCE unicode_symbian.cpp diff --git a/sflphone-common/libs/pjproject/build.symbian/pjlib_test.mmp b/sflphone-common/libs/pjproject/build.symbian/pjlib_test.mmp index 406b0d509397596071b4433e2c342307fbda2052..e48a332cc7dc6ff4200b0168e5d0578570fed899 100644 --- a/sflphone-common/libs/pjproject/build.symbian/pjlib_test.mmp +++ b/sflphone-common/libs/pjproject/build.symbian/pjlib_test.mmp @@ -10,7 +10,7 @@ MACRO PJ_SYMBIAN=1 // Must compile as C++, otherwise exception would not work OPTION CW -lang c++ -OPTION ARMCC --cpp +OPTION ARMCC --cpp --gnu OPTION GCC -x c++ OPTION GCCE -x c++ @@ -46,6 +46,7 @@ SOURCE select.c SOURCE sleep.c SOURCE sock.c SOURCE sock_perf.c +SOURCE ssl_sock.c SOURCE string.c SOURCE test_wrap.cpp SOURCE thread.c @@ -68,7 +69,7 @@ SYSTEMINCLUDE ..\pjlib\include SYSTEMINCLUDE \epoc32\include SYSTEMINCLUDE \epoc32\include\libc -LIBRARY esock.lib insock.lib charconv.lib euser.lib estlib.lib +LIBRARY esock.lib insock.lib charconv.lib euser.lib estlib.lib securesocket.lib #ifdef WINSCW STATICLIBRARY eexe.lib ecrt0.lib #endif @@ -76,3 +77,4 @@ STATICLIBRARY eexe.lib ecrt0.lib // Need a bit of mem for logging in the app. EPOCSTACKSIZE 32768 +CAPABILITY NetworkServices LocalServices ReadUserData WriteUserData UserEnvironment diff --git a/sflphone-common/libs/pjproject/build.symbian/pjlib_util.mmp b/sflphone-common/libs/pjproject/build.symbian/pjlib_util.mmp index 5dac2f8f9dbfe1206f92b4f2ffde06a852339948..3eb3701ac91365b7377dfd2f4db7c7bfc4fd0292 100644 --- a/sflphone-common/libs/pjproject/build.symbian/pjlib_util.mmp +++ b/sflphone-common/libs/pjproject/build.symbian/pjlib_util.mmp @@ -24,7 +24,7 @@ MACRO PJ_SYMBIAN=1 // Must compile as C++, otherwise exception would not work OPTION CW -lang c++ -OPTION ARMCC --cpp +OPTION ARMCC --cpp --gnu OPTION GCC -x c++ OPTION GCCE -x c++ diff --git a/sflphone-common/libs/pjproject/build.symbian/pjmedia.mmp b/sflphone-common/libs/pjproject/build.symbian/pjmedia.mmp index 7dd9fc79654048001e4b72d471de69cb7352ea42..b72934345adfe4d61ebab5be77d6652f873b5955 100644 --- a/sflphone-common/libs/pjproject/build.symbian/pjmedia.mmp +++ b/sflphone-common/libs/pjproject/build.symbian/pjmedia.mmp @@ -30,7 +30,7 @@ MACRO PJ_SYMBIAN=1 // Must compile as C++, otherwise exception would not work OPTION CW -lang c++ -OPTION ARMCC --cpp +OPTION ARMCC --cpp --gnu OPTION GCC -x c++ OPTION GCCE -x c++ diff --git a/sflphone-common/libs/pjproject/build.symbian/pjmedia_audiodev.mmp b/sflphone-common/libs/pjproject/build.symbian/pjmedia_audiodev.mmp index da98b05effa7e62f46bc1e2f742dd714897aa164..f4e25d210fb1060d5af9fcbe2e123b48fa771888 100644 --- a/sflphone-common/libs/pjproject/build.symbian/pjmedia_audiodev.mmp +++ b/sflphone-common/libs/pjproject/build.symbian/pjmedia_audiodev.mmp @@ -7,6 +7,7 @@ SOURCEPATH ..\pjmedia\src\pjmedia-audiodev // GCCE optimization setting // //OPTION GCCE -O2 -fno-unit-at-a-time +OPTION ARMCC --gnu MACRO PJ_M_I386=1 MACRO PJ_SYMBIAN=1 diff --git a/sflphone-common/libs/pjproject/build.symbian/pjnath.mmp b/sflphone-common/libs/pjproject/build.symbian/pjnath.mmp index 7168313d19077f92057add6d8d4fe842b5c78fe2..76b64dda88d4fd29c2ff9c1ce4d175d9d1489054 100644 --- a/sflphone-common/libs/pjproject/build.symbian/pjnath.mmp +++ b/sflphone-common/libs/pjproject/build.symbian/pjnath.mmp @@ -17,6 +17,8 @@ TARGETTYPE lib #endif +OPTION ARMCC --gnu + SOURCEPATH ..\pjnath\src\pjnath MACRO PJ_M_I386=1 diff --git a/sflphone-common/libs/pjproject/build.symbian/pjsdp.mmp b/sflphone-common/libs/pjproject/build.symbian/pjsdp.mmp index 25f3db19fe68e86ad0fdca67f7721aa0ecae4cfd..e165704ee7875c542bf1ea2986d3a5491f1178f9 100644 --- a/sflphone-common/libs/pjproject/build.symbian/pjsdp.mmp +++ b/sflphone-common/libs/pjproject/build.symbian/pjsdp.mmp @@ -24,7 +24,7 @@ MACRO PJ_SYMBIAN=1 // Must compile as C++, otherwise exception would not work OPTION CW -lang c++ -OPTION ARMCC --cpp +OPTION ARMCC --cpp --gnu OPTION GCC -x c++ OPTION GCCE -x c++ diff --git a/sflphone-common/libs/pjproject/build.symbian/pjsip.mmp b/sflphone-common/libs/pjproject/build.symbian/pjsip.mmp index 785a799f36f35e61e79948a6afc8b5ae9eaae02b..6269b47df9434c8c87e483ed045d28bd7b687238 100644 --- a/sflphone-common/libs/pjproject/build.symbian/pjsip.mmp +++ b/sflphone-common/libs/pjproject/build.symbian/pjsip.mmp @@ -27,7 +27,7 @@ MACRO PJ_SYMBIAN=1 // Must compile as C++, otherwise exception would not work OPTION CW -lang c++ -OPTION ARMCC --cpp +OPTION ARMCC --cpp --gnu OPTION GCC -x c++ OPTION GCCE -x c++ @@ -51,6 +51,7 @@ SOURCE sip_transport_wrap.cpp SOURCE sip_transport_loop.c SOURCE sip_transport_tcp.c SOURCE sip_transport_udp.c +SOURCE sip_transport_tls.c SOURCE sip_ua_layer.c SOURCE sip_uri.c SOURCE sip_util_wrap.cpp diff --git a/sflphone-common/libs/pjproject/build.symbian/pjsip_simple.mmp b/sflphone-common/libs/pjproject/build.symbian/pjsip_simple.mmp index a6ddbf2d1328918d48544489485c06f2edadf1c9..9b83a9df97ee54ede312aa0429a06947a02b4da4 100644 --- a/sflphone-common/libs/pjproject/build.symbian/pjsip_simple.mmp +++ b/sflphone-common/libs/pjproject/build.symbian/pjsip_simple.mmp @@ -27,7 +27,7 @@ MACRO PJ_SYMBIAN=1 // Must compile as C++, otherwise exception would not work OPTION CW -lang c++ -OPTION ARMCC --cpp +OPTION ARMCC --cpp --gnu OPTION GCC -x c++ OPTION GCCE -x c++ @@ -37,6 +37,7 @@ SOURCE errno.c SOURCE evsub.c SOURCE evsub_msg.c SOURCE iscomposing.c +SOURCE mwi.c SOURCE pidf.c SOURCE presence.c SOURCE presence_body.c diff --git a/sflphone-common/libs/pjproject/build.symbian/pjsip_ua.mmp b/sflphone-common/libs/pjproject/build.symbian/pjsip_ua.mmp index 59293049b3552a0284fd988bf5c825237d7842d2..609c0a39475abe40891043cb913de3fd0304bd32 100644 --- a/sflphone-common/libs/pjproject/build.symbian/pjsip_ua.mmp +++ b/sflphone-common/libs/pjproject/build.symbian/pjsip_ua.mmp @@ -27,7 +27,7 @@ MACRO PJ_SYMBIAN=1 // Must compile as C++, otherwise exception would not work OPTION CW -lang c++ -OPTION ARMCC --cpp +OPTION ARMCC --cpp --gnu OPTION GCC -x c++ OPTION GCCE -x c++ diff --git a/sflphone-common/libs/pjproject/build.symbian/pjstun_client.mmp b/sflphone-common/libs/pjproject/build.symbian/pjstun_client.mmp index fedb7a250c680d7e2f98d52e18cffc193cc04e62..6ca5eabcaee42ad64034ec50b00ffcc851c7592b 100644 --- a/sflphone-common/libs/pjproject/build.symbian/pjstun_client.mmp +++ b/sflphone-common/libs/pjproject/build.symbian/pjstun_client.mmp @@ -2,6 +2,8 @@ TARGET pjstun_client.exe TARGETTYPE exe UID 0x0 0xA000000A +OPTION ARMCC --gnu + SOURCEPATH ..\pjnath\src\pjstun-client MACRO PJ_M_I386=1 diff --git a/sflphone-common/libs/pjproject/build.symbian/pjsua_lib.mmp b/sflphone-common/libs/pjproject/build.symbian/pjsua_lib.mmp index 0b197819574e70fff63fa66aece6234a9a43fb43..ee7c6b085158154df17a29d1c8285b22560446aa 100644 --- a/sflphone-common/libs/pjproject/build.symbian/pjsua_lib.mmp +++ b/sflphone-common/libs/pjproject/build.symbian/pjsua_lib.mmp @@ -27,7 +27,7 @@ MACRO PJ_SYMBIAN=1 // Must compile as C++, otherwise exception would not work OPTION CW -lang c++ -OPTION ARMCC --cpp +OPTION ARMCC --cpp --gnu OPTION GCC -x c++ OPTION GCCE -x c++ diff --git a/sflphone-common/libs/pjproject/build.symbian/symbian_audio.mmp b/sflphone-common/libs/pjproject/build.symbian/symbian_audio.mmp index e53f4e893795d2a59332c916a6f1652cf95ce70b..bba9ce5fa08c5064f9703fa6cbac5e15f9638357 100644 --- a/sflphone-common/libs/pjproject/build.symbian/symbian_audio.mmp +++ b/sflphone-common/libs/pjproject/build.symbian/symbian_audio.mmp @@ -25,6 +25,7 @@ SOURCEPATH ..\pjmedia\src\pjmedia OPTION CW -lang c++ OPTION GCCE -O2 -fno-unit-at-a-time +OPTION ARMCC --gnu MACRO PJ_M_I386=1 MACRO PJ_SYMBIAN=1 diff --git a/sflphone-common/libs/pjproject/build.symbian/symbian_ua.mmp b/sflphone-common/libs/pjproject/build.symbian/symbian_ua.mmp index 8ef9f73f31b2871fe13f2a5bb003e7ba4bad651e..9514cde3aa59b5310f2fccc20aeed488276032ef 100644 --- a/sflphone-common/libs/pjproject/build.symbian/symbian_ua.mmp +++ b/sflphone-common/libs/pjproject/build.symbian/symbian_ua.mmp @@ -9,6 +9,8 @@ UID 0x0 0xA000000D SOURCEPATH ..\pjsip-apps\src\symbian_ua +OPTION ARMCC --gnu + MACRO PJ_M_I386=1 MACRO PJ_SYMBIAN=1 @@ -69,7 +71,7 @@ STATICLIBRARY libresample.lib STATICLIBRARY eexe.lib ecrt0.lib #endif -LIBRARY esock.lib insock.lib charconv.lib euser.lib estlib.lib commdb.lib apengine.lib +LIBRARY esock.lib insock.lib charconv.lib euser.lib estlib.lib commdb.lib apengine.lib securesocket.lib // The default 8KB seems to be insufficient with all bells and // whistles turned on diff --git a/sflphone-common/libs/pjproject/build.symbian/symsndtest.mmp b/sflphone-common/libs/pjproject/build.symbian/symsndtest.mmp index 415807df318baf4d9d1df67e0061282d3531b95a..c729e1c52b1d527a2d7c14b78584e80994c8d611 100644 --- a/sflphone-common/libs/pjproject/build.symbian/symsndtest.mmp +++ b/sflphone-common/libs/pjproject/build.symbian/symsndtest.mmp @@ -5,6 +5,8 @@ TARGET symsndtest.exe TARGETTYPE exe UID 0x0 0xA000000E +OPTION ARMCC --gnu + SOURCEPATH ..\pjsip-apps\src\symsndtest MACRO PJ_M_I386=1 diff --git a/sflphone-common/libs/pjproject/build/os-auto.mak b/sflphone-common/libs/pjproject/build/os-auto.mak deleted file mode 100644 index 6fa43bda1b515dc5e4392a211e5d3a06d5814b3d..0000000000000000000000000000000000000000 --- a/sflphone-common/libs/pjproject/build/os-auto.mak +++ /dev/null @@ -1,11 +0,0 @@ -# build/os-auto.mak. Generated from os-auto.mak.in by configure. - -export OS_CFLAGS := $(CC_DEF)PJ_AUTOCONF=1 -O2 - -export OS_CXXFLAGS := $(CC_DEF)PJ_AUTOCONF=1 -O2 - -export OS_LDFLAGS := -lm -luuid -lnsl -lrt -lpthread -lasound -lssl -lcrypto - -export OS_SOURCES := - - diff --git a/sflphone-common/libs/pjproject/config.guess b/sflphone-common/libs/pjproject/config.guess deleted file mode 120000 index f42b0a5a40bce9574720756960dac396d7d88e01..0000000000000000000000000000000000000000 --- a/sflphone-common/libs/pjproject/config.guess +++ /dev/null @@ -1 +0,0 @@ -/usr/share/misc/config.guess \ No newline at end of file diff --git a/sflphone-common/libs/pjproject/config.guess b/sflphone-common/libs/pjproject/config.guess new file mode 100755 index 0000000000000000000000000000000000000000..dff9e481b70f9505b49ce999629a168a19976f4f --- /dev/null +++ b/sflphone-common/libs/pjproject/config.guess @@ -0,0 +1,1317 @@ +#! /bin/sh +# Attempt to guess a canonical system name. +# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 +# Free Software Foundation, Inc. + +timestamp='2001-09-04' + +# This file is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# Written by Per Bothner <bothner@cygnus.com>. +# Please send patches to <config-patches@gnu.org>. +# +# This script attempts to guess a canonical system name similar to +# config.sub. If it succeeds, it prints the system name on stdout, and +# exits with 0. Otherwise, it exits with 1. +# +# The plan is that this can be called by configure scripts if you +# don't specify an explicit build system type. + +me=`echo "$0" | sed -e 's,.*/,,'` + +usage="\ +Usage: $0 [OPTION] + +Output the configuration name of the system \`$me' is run on. + +Operation modes: + -h, --help print this help, then exit + -t, --time-stamp print date of last modification, then exit + -v, --version print version number, then exit + +Report bugs and patches to <config-patches@gnu.org>." + +version="\ +GNU config.guess ($timestamp) + +Originally written by Per Bothner. +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 +Free Software Foundation, Inc. + +This is free software; see the source for copying conditions. There is NO +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." + +help=" +Try \`$me --help' for more information." + +# Parse command line +while test $# -gt 0 ; do + case $1 in + --time-stamp | --time* | -t ) + echo "$timestamp" ; exit 0 ;; + --version | -v ) + echo "$version" ; exit 0 ;; + --help | --h* | -h ) + echo "$usage"; exit 0 ;; + -- ) # Stop option processing + shift; break ;; + - ) # Use stdin as input. + break ;; + -* ) + echo "$me: invalid option $1$help" >&2 + exit 1 ;; + * ) + break ;; + esac +done + +if test $# != 0; then + echo "$me: too many arguments$help" >&2 + exit 1 +fi + + +dummy=dummy-$$ +trap 'rm -f $dummy.c $dummy.o $dummy.rel $dummy; exit 1' 1 2 15 + +# CC_FOR_BUILD -- compiler used by this script. +# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still +# use `HOST_CC' if defined, but it is deprecated. + +set_cc_for_build='case $CC_FOR_BUILD,$HOST_CC,$CC in + ,,) echo "int dummy(){}" > $dummy.c ; + for c in cc gcc c89 ; do + ($c $dummy.c -c -o $dummy.o) >/dev/null 2>&1 ; + if test $? = 0 ; then + CC_FOR_BUILD="$c"; break ; + fi ; + done ; + rm -f $dummy.c $dummy.o $dummy.rel ; + if test x"$CC_FOR_BUILD" = x ; then + CC_FOR_BUILD=no_compiler_found ; + fi + ;; + ,,*) CC_FOR_BUILD=$CC ;; + ,*,*) CC_FOR_BUILD=$HOST_CC ;; +esac' + +# This is needed to find uname on a Pyramid OSx when run in the BSD universe. +# (ghazi@noc.rutgers.edu 1994-08-24) +if (test -f /.attbin/uname) >/dev/null 2>&1 ; then + PATH=$PATH:/.attbin ; export PATH +fi + +UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown +UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown +UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown +UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown + +# Note: order is significant - the case branches are not exclusive. + +case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in + *:NetBSD:*:*) + # Netbsd (nbsd) targets should (where applicable) match one or + # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*, + # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently + # switched to ELF, *-*-netbsd* would select the old + # object file format. This provides both forward + # compatibility and a consistent mechanism for selecting the + # object file format. + # Determine the machine/vendor (is the vendor relevant). + case "${UNAME_MACHINE}" in + amiga) machine=m68k-unknown ;; + arm32) machine=arm-unknown ;; + atari*) machine=m68k-atari ;; + sun3*) machine=m68k-sun ;; + mac68k) machine=m68k-apple ;; + macppc) machine=powerpc-apple ;; + hp3[0-9][05]) machine=m68k-hp ;; + ibmrt|romp-ibm) machine=romp-ibm ;; + *) machine=${UNAME_MACHINE}-unknown ;; + esac + # The Operating System including object format, if it has switched + # to ELF recently, or will in the future. + case "${UNAME_MACHINE}" in + i386|sparc|amiga|arm*|hp300|mvme68k|vax|atari|luna68k|mac68k|news68k|next68k|pc532|sun3*|x68k) + eval $set_cc_for_build + if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep __ELF__ >/dev/null + then + # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). + # Return netbsd for either. FIX? + os=netbsd + else + os=netbsdelf + fi + ;; + *) + os=netbsd + ;; + esac + # The OS release + release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` + # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: + # contains redundant information, the shorter form: + # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. + echo "${machine}-${os}${release}" + exit 0 ;; + alpha:OSF1:*:*) + if test $UNAME_RELEASE = "V4.0"; then + UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` + fi + # A Vn.n version is a released version. + # A Tn.n version is a released field test version. + # A Xn.n version is an unreleased experimental baselevel. + # 1.2 uses "1.2" for uname -r. + cat <<EOF >$dummy.s + .data +\$Lformat: + .byte 37,100,45,37,120,10,0 # "%d-%x\n" + + .text + .globl main + .align 4 + .ent main +main: + .frame \$30,16,\$26,0 + ldgp \$29,0(\$27) + .prologue 1 + .long 0x47e03d80 # implver \$0 + lda \$2,-1 + .long 0x47e20c21 # amask \$2,\$1 + lda \$16,\$Lformat + mov \$0,\$17 + not \$1,\$18 + jsr \$26,printf + ldgp \$29,0(\$26) + mov 0,\$16 + jsr \$26,exit + .end main +EOF + eval $set_cc_for_build + $CC_FOR_BUILD $dummy.s -o $dummy 2>/dev/null + if test "$?" = 0 ; then + case `./$dummy` in + 0-0) + UNAME_MACHINE="alpha" + ;; + 1-0) + UNAME_MACHINE="alphaev5" + ;; + 1-1) + UNAME_MACHINE="alphaev56" + ;; + 1-101) + UNAME_MACHINE="alphapca56" + ;; + 2-303) + UNAME_MACHINE="alphaev6" + ;; + 2-307) + UNAME_MACHINE="alphaev67" + ;; + 2-1307) + UNAME_MACHINE="alphaev68" + ;; + esac + fi + rm -f $dummy.s $dummy + echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + exit 0 ;; + Alpha\ *:Windows_NT*:*) + # How do we know it's Interix rather than the generic POSIX subsystem? + # Should we change UNAME_MACHINE based on the output of uname instead + # of the specific Alpha model? + echo alpha-pc-interix + exit 0 ;; + 21064:Windows_NT:50:3) + echo alpha-dec-winnt3.5 + exit 0 ;; + Amiga*:UNIX_System_V:4.0:*) + echo m68k-unknown-sysv4 + exit 0;; + amiga:OpenBSD:*:*) + echo m68k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + *:[Aa]miga[Oo][Ss]:*:*) + echo ${UNAME_MACHINE}-unknown-amigaos + exit 0 ;; + arc64:OpenBSD:*:*) + echo mips64el-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + arc:OpenBSD:*:*) + echo mipsel-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + hkmips:OpenBSD:*:*) + echo mips-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + pmax:OpenBSD:*:*) + echo mipsel-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + sgi:OpenBSD:*:*) + echo mips-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + wgrisc:OpenBSD:*:*) + echo mipsel-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + *:OS/390:*:*) + echo i370-ibm-openedition + exit 0 ;; + arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) + echo arm-acorn-riscix${UNAME_RELEASE} + exit 0;; + SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) + echo hppa1.1-hitachi-hiuxmpp + exit 0;; + Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) + # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. + if test "`(/bin/universe) 2>/dev/null`" = att ; then + echo pyramid-pyramid-sysv3 + else + echo pyramid-pyramid-bsd + fi + exit 0 ;; + NILE*:*:*:dcosx) + echo pyramid-pyramid-svr4 + exit 0 ;; + sun4H:SunOS:5.*:*) + echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit 0 ;; + sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) + echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit 0 ;; + i86pc:SunOS:5.*:*) + echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit 0 ;; + sun4*:SunOS:6*:*) + # According to config.sub, this is the proper way to canonicalize + # SunOS6. Hard to guess exactly what SunOS6 will be like, but + # it's likely to be more like Solaris than SunOS4. + echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit 0 ;; + sun4*:SunOS:*:*) + case "`/usr/bin/arch -k`" in + Series*|S4*) + UNAME_RELEASE=`uname -v` + ;; + esac + # Japanese Language versions have a version number like `4.1.3-JL'. + echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` + exit 0 ;; + sun3*:SunOS:*:*) + echo m68k-sun-sunos${UNAME_RELEASE} + exit 0 ;; + sun*:*:4.2BSD:*) + UNAME_RELEASE=`(head -1 /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` + test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 + case "`/bin/arch`" in + sun3) + echo m68k-sun-sunos${UNAME_RELEASE} + ;; + sun4) + echo sparc-sun-sunos${UNAME_RELEASE} + ;; + esac + exit 0 ;; + aushp:SunOS:*:*) + echo sparc-auspex-sunos${UNAME_RELEASE} + exit 0 ;; + sparc*:NetBSD:*) + echo `uname -p`-unknown-netbsd${UNAME_RELEASE} + exit 0 ;; + atari*:OpenBSD:*:*) + echo m68k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + # The situation for MiNT is a little confusing. The machine name + # can be virtually everything (everything which is not + # "atarist" or "atariste" at least should have a processor + # > m68000). The system name ranges from "MiNT" over "FreeMiNT" + # to the lowercase version "mint" (or "freemint"). Finally + # the system name "TOS" denotes a system which is actually not + # MiNT. But MiNT is downward compatible to TOS, so this should + # be no problem. + atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit 0 ;; + atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit 0 ;; + *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit 0 ;; + milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) + echo m68k-milan-mint${UNAME_RELEASE} + exit 0 ;; + hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) + echo m68k-hades-mint${UNAME_RELEASE} + exit 0 ;; + *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) + echo m68k-unknown-mint${UNAME_RELEASE} + exit 0 ;; + sun3*:OpenBSD:*:*) + echo m68k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + mac68k:OpenBSD:*:*) + echo m68k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + mvme68k:OpenBSD:*:*) + echo m68k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + mvme88k:OpenBSD:*:*) + echo m88k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + powerpc:machten:*:*) + echo powerpc-apple-machten${UNAME_RELEASE} + exit 0 ;; + RISC*:Mach:*:*) + echo mips-dec-mach_bsd4.3 + exit 0 ;; + RISC*:ULTRIX:*:*) + echo mips-dec-ultrix${UNAME_RELEASE} + exit 0 ;; + VAX*:ULTRIX*:*:*) + echo vax-dec-ultrix${UNAME_RELEASE} + exit 0 ;; + 2020:CLIX:*:* | 2430:CLIX:*:*) + echo clipper-intergraph-clix${UNAME_RELEASE} + exit 0 ;; + mips:*:*:UMIPS | mips:*:*:RISCos) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c +#ifdef __cplusplus +#include <stdio.h> /* for printf() prototype */ + int main (int argc, char *argv[]) { +#else + int main (argc, argv) int argc; char *argv[]; { +#endif + #if defined (host_mips) && defined (MIPSEB) + #if defined (SYSTYPE_SYSV) + printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); + #endif + #if defined (SYSTYPE_SVR4) + printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); + #endif + #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) + printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); + #endif + #endif + exit (-1); + } +EOF + $CC_FOR_BUILD $dummy.c -o $dummy \ + && ./$dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \ + && rm -f $dummy.c $dummy && exit 0 + rm -f $dummy.c $dummy + echo mips-mips-riscos${UNAME_RELEASE} + exit 0 ;; + Motorola:PowerMAX_OS:*:*) + echo powerpc-motorola-powermax + exit 0 ;; + Night_Hawk:Power_UNIX:*:*) + echo powerpc-harris-powerunix + exit 0 ;; + m88k:CX/UX:7*:*) + echo m88k-harris-cxux7 + exit 0 ;; + m88k:*:4*:R4*) + echo m88k-motorola-sysv4 + exit 0 ;; + m88k:*:3*:R3*) + echo m88k-motorola-sysv3 + exit 0 ;; + AViiON:dgux:*:*) + # DG/UX returns AViiON for all architectures + UNAME_PROCESSOR=`/usr/bin/uname -p` + if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] + then + if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ + [ ${TARGET_BINARY_INTERFACE}x = x ] + then + echo m88k-dg-dgux${UNAME_RELEASE} + else + echo m88k-dg-dguxbcs${UNAME_RELEASE} + fi + else + echo i586-dg-dgux${UNAME_RELEASE} + fi + exit 0 ;; + M88*:DolphinOS:*:*) # DolphinOS (SVR3) + echo m88k-dolphin-sysv3 + exit 0 ;; + M88*:*:R3*:*) + # Delta 88k system running SVR3 + echo m88k-motorola-sysv3 + exit 0 ;; + XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) + echo m88k-tektronix-sysv3 + exit 0 ;; + Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) + echo m68k-tektronix-bsd + exit 0 ;; + *:IRIX*:*:*) + echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` + exit 0 ;; + ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. + echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id + exit 0 ;; # Note that: echo "'`uname -s`'" gives 'AIX ' + i*86:AIX:*:*) + echo i386-ibm-aix + exit 0 ;; + ia64:AIX:*:*) + if [ -x /usr/bin/oslevel ] ; then + IBM_REV=`/usr/bin/oslevel` + else + IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} + fi + echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} + exit 0 ;; + *:AIX:2:3) + if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #include <sys/systemcfg.h> + + main() + { + if (!__power_pc()) + exit(1); + puts("powerpc-ibm-aix3.2.5"); + exit(0); + } +EOF + $CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm -f $dummy.c $dummy && exit 0 + rm -f $dummy.c $dummy + echo rs6000-ibm-aix3.2.5 + elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then + echo rs6000-ibm-aix3.2.4 + else + echo rs6000-ibm-aix3.2 + fi + exit 0 ;; + *:AIX:*:[45]) + IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | head -1 | awk '{ print $1 }'` + if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then + IBM_ARCH=rs6000 + else + IBM_ARCH=powerpc + fi + if [ -x /usr/bin/oslevel ] ; then + IBM_REV=`/usr/bin/oslevel` + else + IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} + fi + echo ${IBM_ARCH}-ibm-aix${IBM_REV} + exit 0 ;; + *:AIX:*:*) + echo rs6000-ibm-aix + exit 0 ;; + ibmrt:4.4BSD:*|romp-ibm:BSD:*) + echo romp-ibm-bsd4.4 + exit 0 ;; + ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and + echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to + exit 0 ;; # report: romp-ibm BSD 4.3 + *:BOSX:*:*) + echo rs6000-bull-bosx + exit 0 ;; + DPX/2?00:B.O.S.:*:*) + echo m68k-bull-sysv3 + exit 0 ;; + 9000/[34]??:4.3bsd:1.*:*) + echo m68k-hp-bsd + exit 0 ;; + hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) + echo m68k-hp-bsd4.4 + exit 0 ;; + 9000/[34678]??:HP-UX:*:*) + HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` + case "${UNAME_MACHINE}" in + 9000/31? ) HP_ARCH=m68000 ;; + 9000/[34]?? ) HP_ARCH=m68k ;; + 9000/[678][0-9][0-9]) + case "${HPUX_REV}" in + 11.[0-9][0-9]) + if [ -x /usr/bin/getconf ]; then + sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` + sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` + case "${sc_cpu_version}" in + 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 + 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 + 532) # CPU_PA_RISC2_0 + case "${sc_kernel_bits}" in + 32) HP_ARCH="hppa2.0n" ;; + 64) HP_ARCH="hppa2.0w" ;; + esac ;; + esac + fi ;; + esac + if [ "${HP_ARCH}" = "" ]; then + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + + #define _HPUX_SOURCE + #include <stdlib.h> + #include <unistd.h> + + int main () + { + #if defined(_SC_KERNEL_BITS) + long bits = sysconf(_SC_KERNEL_BITS); + #endif + long cpu = sysconf (_SC_CPU_VERSION); + + switch (cpu) + { + case CPU_PA_RISC1_0: puts ("hppa1.0"); break; + case CPU_PA_RISC1_1: puts ("hppa1.1"); break; + case CPU_PA_RISC2_0: + #if defined(_SC_KERNEL_BITS) + switch (bits) + { + case 64: puts ("hppa2.0w"); break; + case 32: puts ("hppa2.0n"); break; + default: puts ("hppa2.0"); break; + } break; + #else /* !defined(_SC_KERNEL_BITS) */ + puts ("hppa2.0"); break; + #endif + default: puts ("hppa1.0"); break; + } + exit (0); + } +EOF + (CCOPTS= $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null ) && HP_ARCH=`./$dummy` + if test -z "$HP_ARCH"; then HP_ARCH=hppa; fi + rm -f $dummy.c $dummy + fi ;; + esac + echo ${HP_ARCH}-hp-hpux${HPUX_REV} + exit 0 ;; + ia64:HP-UX:*:*) + HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` + echo ia64-hp-hpux${HPUX_REV} + exit 0 ;; + 3050*:HI-UX:*:*) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #include <unistd.h> + int + main () + { + long cpu = sysconf (_SC_CPU_VERSION); + /* The order matters, because CPU_IS_HP_MC68K erroneously returns + true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct + results, however. */ + if (CPU_IS_PA_RISC (cpu)) + { + switch (cpu) + { + case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; + case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; + case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; + default: puts ("hppa-hitachi-hiuxwe2"); break; + } + } + else if (CPU_IS_HP_MC68K (cpu)) + puts ("m68k-hitachi-hiuxwe2"); + else puts ("unknown-hitachi-hiuxwe2"); + exit (0); + } +EOF + $CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm -f $dummy.c $dummy && exit 0 + rm -f $dummy.c $dummy + echo unknown-hitachi-hiuxwe2 + exit 0 ;; + 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) + echo hppa1.1-hp-bsd + exit 0 ;; + 9000/8??:4.3bsd:*:*) + echo hppa1.0-hp-bsd + exit 0 ;; + *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) + echo hppa1.0-hp-mpeix + exit 0 ;; + hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) + echo hppa1.1-hp-osf + exit 0 ;; + hp8??:OSF1:*:*) + echo hppa1.0-hp-osf + exit 0 ;; + i*86:OSF1:*:*) + if [ -x /usr/sbin/sysversion ] ; then + echo ${UNAME_MACHINE}-unknown-osf1mk + else + echo ${UNAME_MACHINE}-unknown-osf1 + fi + exit 0 ;; + parisc*:Lites*:*:*) + echo hppa1.1-hp-lites + exit 0 ;; + hppa*:OpenBSD:*:*) + echo hppa-unknown-openbsd + exit 0 ;; + C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) + echo c1-convex-bsd + exit 0 ;; + C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) + if getsysinfo -f scalar_acc + then echo c32-convex-bsd + else echo c2-convex-bsd + fi + exit 0 ;; + C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) + echo c34-convex-bsd + exit 0 ;; + C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) + echo c38-convex-bsd + exit 0 ;; + C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) + echo c4-convex-bsd + exit 0 ;; + CRAY*X-MP:*:*:*) + echo xmp-cray-unicos + exit 0 ;; + CRAY*Y-MP:*:*:*) + echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit 0 ;; + CRAY*[A-Z]90:*:*:*) + echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ + | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ + -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ + -e 's/\.[^.]*$/.X/' + exit 0 ;; + CRAY*TS:*:*:*) + echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit 0 ;; + CRAY*T3D:*:*:*) + echo alpha-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit 0 ;; + CRAY*T3E:*:*:*) + echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit 0 ;; + CRAY*SV1:*:*:*) + echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit 0 ;; + CRAY-2:*:*:*) + echo cray2-cray-unicos + exit 0 ;; + F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) + FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` + FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` + echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" + exit 0 ;; + hp300:OpenBSD:*:*) + echo m68k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) + echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} + exit 0 ;; + sparc*:BSD/OS:*:*) + echo sparc-unknown-bsdi${UNAME_RELEASE} + exit 0 ;; + *:BSD/OS:*:*) + echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} + exit 0 ;; + *:FreeBSD:*:*) + echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` + exit 0 ;; + *:OpenBSD:*:*) + echo ${UNAME_MACHINE}-unknown-openbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` + exit 0 ;; + i*:CYGWIN*:*) + echo ${UNAME_MACHINE}-pc-cygwin + exit 0 ;; + i*:MINGW*:*) + echo ${UNAME_MACHINE}-pc-mingw32 + exit 0 ;; + i*:PW*:*) + echo ${UNAME_MACHINE}-pc-pw32 + exit 0 ;; + i*:Windows_NT*:* | Pentium*:Windows_NT*:*) + # How do we know it's Interix rather than the generic POSIX subsystem? + # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we + # UNAME_MACHINE based on the output of uname instead of i386? + echo i386-pc-interix + exit 0 ;; + i*:UWIN*:*) + echo ${UNAME_MACHINE}-pc-uwin + exit 0 ;; + p*:CYGWIN*:*) + echo powerpcle-unknown-cygwin + exit 0 ;; + prep*:SunOS:5.*:*) + echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit 0 ;; + *:GNU:*:*) + echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` + exit 0 ;; + i*86:Minix:*:*) + echo ${UNAME_MACHINE}-pc-minix + exit 0 ;; + arm*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit 0 ;; + ia64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux + exit 0 ;; + m68*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit 0 ;; + mips:Linux:*:*) + case `sed -n '/^byte/s/^.*: \(.*\) endian/\1/p' < /proc/cpuinfo` in + big) echo mips-unknown-linux-gnu && exit 0 ;; + little) echo mipsel-unknown-linux-gnu && exit 0 ;; + esac + ;; + ppc:Linux:*:*) + echo powerpc-unknown-linux-gnu + exit 0 ;; + ppc64:Linux:*:*) + echo powerpc64-unknown-linux-gnu + exit 0 ;; + alpha:Linux:*:*) + case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in + EV5) UNAME_MACHINE=alphaev5 ;; + EV56) UNAME_MACHINE=alphaev56 ;; + PCA56) UNAME_MACHINE=alphapca56 ;; + PCA57) UNAME_MACHINE=alphapca56 ;; + EV6) UNAME_MACHINE=alphaev6 ;; + EV67) UNAME_MACHINE=alphaev67 ;; + EV68*) UNAME_MACHINE=alphaev68 ;; + esac + objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null + if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi + echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} + exit 0 ;; + parisc:Linux:*:* | hppa:Linux:*:*) + # Look for CPU level + case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in + PA7*) echo hppa1.1-unknown-linux-gnu ;; + PA8*) echo hppa2.0-unknown-linux-gnu ;; + *) echo hppa-unknown-linux-gnu ;; + esac + exit 0 ;; + parisc64:Linux:*:* | hppa64:Linux:*:*) + echo hppa64-unknown-linux-gnu + exit 0 ;; + s390:Linux:*:* | s390x:Linux:*:*) + echo ${UNAME_MACHINE}-ibm-linux + exit 0 ;; + sh*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit 0 ;; + sparc:Linux:*:* | sparc64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit 0 ;; + x86_64:Linux:*:*) + echo x86_64-unknown-linux-gnu + exit 0 ;; + i*86:Linux:*:*) + # The BFD linker knows what the default object file format is, so + # first see if it will tell us. cd to the root directory to prevent + # problems with other programs or directories called `ld' in the path. + ld_supported_targets=`cd /; ld --help 2>&1 \ + | sed -ne '/supported targets:/!d + s/[ ][ ]*/ /g + s/.*supported targets: *// + s/ .*// + p'` + case "$ld_supported_targets" in + elf32-i386) + TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu" + ;; + a.out-i386-linux) + echo "${UNAME_MACHINE}-pc-linux-gnuaout" + exit 0 ;; + coff-i386) + echo "${UNAME_MACHINE}-pc-linux-gnucoff" + exit 0 ;; + "") + # Either a pre-BFD a.out linker (linux-gnuoldld) or + # one that does not give us useful --help. + echo "${UNAME_MACHINE}-pc-linux-gnuoldld" + exit 0 ;; + esac + # Determine whether the default compiler is a.out or elf + eval $set_cc_for_build + cat >$dummy.c <<EOF +#include <features.h> +#ifdef __cplusplus +#include <stdio.h> /* for printf() prototype */ + int main (int argc, char *argv[]) { +#else + int main (argc, argv) int argc; char *argv[]; { +#endif +#ifdef __ELF__ +# ifdef __GLIBC__ +# if __GLIBC__ >= 2 + printf ("%s-pc-linux-gnu\n", argv[1]); +# else + printf ("%s-pc-linux-gnulibc1\n", argv[1]); +# endif +# else + printf ("%s-pc-linux-gnulibc1\n", argv[1]); +# endif +#else + printf ("%s-pc-linux-gnuaout\n", argv[1]); +#endif + return 0; +} +EOF + $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy "${UNAME_MACHINE}" && rm -f $dummy.c $dummy && exit 0 + rm -f $dummy.c $dummy + test x"${TENTATIVE}" != x && echo "${TENTATIVE}" && exit 0 + ;; + i*86:DYNIX/ptx:4*:*) + # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. + # earlier versions are messed up and put the nodename in both + # sysname and nodename. + echo i386-sequent-sysv4 + exit 0 ;; + i*86:UNIX_SV:4.2MP:2.*) + # Unixware is an offshoot of SVR4, but it has its own version + # number series starting with 2... + # I am not positive that other SVR4 systems won't match this, + # I just have to hope. -- rms. + # Use sysv4.2uw... so that sysv4* matches it. + echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} + exit 0 ;; + i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) + UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` + if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then + echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} + else + echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} + fi + exit 0 ;; + i*86:*:5:[78]*) + case `/bin/uname -X | grep "^Machine"` in + *486*) UNAME_MACHINE=i486 ;; + *Pentium) UNAME_MACHINE=i586 ;; + *Pent*|*Celeron) UNAME_MACHINE=i686 ;; + esac + echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} + exit 0 ;; + i*86:*:3.2:*) + if test -f /usr/options/cb.name; then + UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name` + echo ${UNAME_MACHINE}-pc-isc$UNAME_REL + elif /bin/uname -X 2>/dev/null >/dev/null ; then + UNAME_REL=`(/bin/uname -X|egrep Release|sed -e 's/.*= //')` + (/bin/uname -X|egrep i80486 >/dev/null) && UNAME_MACHINE=i486 + (/bin/uname -X|egrep '^Machine.*Pentium' >/dev/null) \ + && UNAME_MACHINE=i586 + (/bin/uname -X|egrep '^Machine.*Pent ?II' >/dev/null) \ + && UNAME_MACHINE=i686 + (/bin/uname -X|egrep '^Machine.*Pentium Pro' >/dev/null) \ + && UNAME_MACHINE=i686 + echo ${UNAME_MACHINE}-pc-sco$UNAME_REL + else + echo ${UNAME_MACHINE}-pc-sysv32 + fi + exit 0 ;; + i*86:*DOS:*:*) + echo ${UNAME_MACHINE}-pc-msdosdjgpp + exit 0 ;; + pc:*:*:*) + # Left here for compatibility: + # uname -m prints for DJGPP always 'pc', but it prints nothing about + # the processor, so we play safe by assuming i386. + echo i386-pc-msdosdjgpp + exit 0 ;; + Intel:Mach:3*:*) + echo i386-pc-mach3 + exit 0 ;; + paragon:*:*:*) + echo i860-intel-osf1 + exit 0 ;; + i860:*:4.*:*) # i860-SVR4 + if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then + echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 + else # Add other i860-SVR4 vendors below as they are discovered. + echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 + fi + exit 0 ;; + mini*:CTIX:SYS*5:*) + # "miniframe" + echo m68010-convergent-sysv + exit 0 ;; + M68*:*:R3V[567]*:*) + test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;; + 3[34]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 4850:*:4.0:3.0) + OS_REL='' + test -r /etc/.relid \ + && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && echo i486-ncr-sysv4.3${OS_REL} && exit 0 + /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ + && echo i586-ncr-sysv4.3${OS_REL} && exit 0 ;; + 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && echo i486-ncr-sysv4 && exit 0 ;; + m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) + echo m68k-unknown-lynxos${UNAME_RELEASE} + exit 0 ;; + mc68030:UNIX_System_V:4.*:*) + echo m68k-atari-sysv4 + exit 0 ;; + i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*) + echo i386-unknown-lynxos${UNAME_RELEASE} + exit 0 ;; + TSUNAMI:LynxOS:2.*:*) + echo sparc-unknown-lynxos${UNAME_RELEASE} + exit 0 ;; + rs6000:LynxOS:2.*:*) + echo rs6000-unknown-lynxos${UNAME_RELEASE} + exit 0 ;; + PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*) + echo powerpc-unknown-lynxos${UNAME_RELEASE} + exit 0 ;; + SM[BE]S:UNIX_SV:*:*) + echo mips-dde-sysv${UNAME_RELEASE} + exit 0 ;; + RM*:ReliantUNIX-*:*:*) + echo mips-sni-sysv4 + exit 0 ;; + RM*:SINIX-*:*:*) + echo mips-sni-sysv4 + exit 0 ;; + *:SINIX-*:*:*) + if uname -p 2>/dev/null >/dev/null ; then + UNAME_MACHINE=`(uname -p) 2>/dev/null` + echo ${UNAME_MACHINE}-sni-sysv4 + else + echo ns32k-sni-sysv + fi + exit 0 ;; + PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort + # says <Richard.M.Bartel@ccMail.Census.GOV> + echo i586-unisys-sysv4 + exit 0 ;; + *:UNIX_System_V:4*:FTX*) + # From Gerald Hewes <hewes@openmarket.com>. + # How about differentiating between stratus architectures? -djm + echo hppa1.1-stratus-sysv4 + exit 0 ;; + *:*:*:FTX*) + # From seanf@swdc.stratus.com. + echo i860-stratus-sysv4 + exit 0 ;; + *:VOS:*:*) + # From Paul.Green@stratus.com. + echo hppa1.1-stratus-vos + exit 0 ;; + mc68*:A/UX:*:*) + echo m68k-apple-aux${UNAME_RELEASE} + exit 0 ;; + news*:NEWS-OS:6*:*) + echo mips-sony-newsos6 + exit 0 ;; + R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) + if [ -d /usr/nec ]; then + echo mips-nec-sysv${UNAME_RELEASE} + else + echo mips-unknown-sysv${UNAME_RELEASE} + fi + exit 0 ;; + BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. + echo powerpc-be-beos + exit 0 ;; + BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. + echo powerpc-apple-beos + exit 0 ;; + BePC:BeOS:*:*) # BeOS running on Intel PC compatible. + echo i586-pc-beos + exit 0 ;; + SX-4:SUPER-UX:*:*) + echo sx4-nec-superux${UNAME_RELEASE} + exit 0 ;; + SX-5:SUPER-UX:*:*) + echo sx5-nec-superux${UNAME_RELEASE} + exit 0 ;; + Power*:Rhapsody:*:*) + echo powerpc-apple-rhapsody${UNAME_RELEASE} + exit 0 ;; + *:Rhapsody:*:*) + echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} + exit 0 ;; + *:Darwin:*:*) + echo `uname -p`-apple-darwin${UNAME_RELEASE} + exit 0 ;; + *:procnto*:*:* | *:QNX:[0123456789]*:*) + if test "${UNAME_MACHINE}" = "x86pc"; then + UNAME_MACHINE=pc + fi + echo `uname -p`-${UNAME_MACHINE}-nto-qnx + exit 0 ;; + *:QNX:*:4*) + echo i386-pc-qnx + exit 0 ;; + NSR-[KW]:NONSTOP_KERNEL:*:*) + echo nsr-tandem-nsk${UNAME_RELEASE} + exit 0 ;; + *:NonStop-UX:*:*) + echo mips-compaq-nonstopux + exit 0 ;; + BS2000:POSIX*:*:*) + echo bs2000-siemens-sysv + exit 0 ;; + DS/*:UNIX_System_V:*:*) + echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} + exit 0 ;; + *:Plan9:*:*) + # "uname -m" is not consistent, so use $cputype instead. 386 + # is converted to i386 for consistency with other x86 + # operating systems. + if test "$cputype" = "386"; then + UNAME_MACHINE=i386 + else + UNAME_MACHINE="$cputype" + fi + echo ${UNAME_MACHINE}-unknown-plan9 + exit 0 ;; + i*86:OS/2:*:*) + # If we were able to find `uname', then EMX Unix compatibility + # is probably installed. + echo ${UNAME_MACHINE}-pc-os2-emx + exit 0 ;; + *:TOPS-10:*:*) + echo pdp10-unknown-tops10 + exit 0 ;; + *:TENEX:*:*) + echo pdp10-unknown-tenex + exit 0 ;; + KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) + echo pdp10-dec-tops20 + exit 0 ;; + XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) + echo pdp10-xkl-tops20 + exit 0 ;; + *:TOPS-20:*:*) + echo pdp10-unknown-tops20 + exit 0 ;; + *:ITS:*:*) + echo pdp10-unknown-its + exit 0 ;; + i*86:XTS-300:*:STOP) + echo ${UNAME_MACHINE}-unknown-stop + exit 0 ;; + i*86:atheos:*:*) + echo ${UNAME_MACHINE}-unknown-atheos + exit 0 ;; +esac + +#echo '(No uname command or uname output not recognized.)' 1>&2 +#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 + +eval $set_cc_for_build +cat >$dummy.c <<EOF +#ifdef _SEQUENT_ +# include <sys/types.h> +# include <sys/utsname.h> +#endif +main () +{ +#if defined (sony) +#if defined (MIPSEB) + /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, + I don't know.... */ + printf ("mips-sony-bsd\n"); exit (0); +#else +#include <sys/param.h> + printf ("m68k-sony-newsos%s\n", +#ifdef NEWSOS4 + "4" +#else + "" +#endif + ); exit (0); +#endif +#endif + +#if defined (__arm) && defined (__acorn) && defined (__unix) + printf ("arm-acorn-riscix"); exit (0); +#endif + +#if defined (hp300) && !defined (hpux) + printf ("m68k-hp-bsd\n"); exit (0); +#endif + +#if defined (NeXT) +#if !defined (__ARCHITECTURE__) +#define __ARCHITECTURE__ "m68k" +#endif + int version; + version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; + if (version < 4) + printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); + else + printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); + exit (0); +#endif + +#if defined (MULTIMAX) || defined (n16) +#if defined (UMAXV) + printf ("ns32k-encore-sysv\n"); exit (0); +#else +#if defined (CMU) + printf ("ns32k-encore-mach\n"); exit (0); +#else + printf ("ns32k-encore-bsd\n"); exit (0); +#endif +#endif +#endif + +#if defined (__386BSD__) + printf ("i386-pc-bsd\n"); exit (0); +#endif + +#if defined (sequent) +#if defined (i386) + printf ("i386-sequent-dynix\n"); exit (0); +#endif +#if defined (ns32000) + printf ("ns32k-sequent-dynix\n"); exit (0); +#endif +#endif + +#if defined (_SEQUENT_) + struct utsname un; + + uname(&un); + + if (strncmp(un.version, "V2", 2) == 0) { + printf ("i386-sequent-ptx2\n"); exit (0); + } + if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ + printf ("i386-sequent-ptx1\n"); exit (0); + } + printf ("i386-sequent-ptx\n"); exit (0); + +#endif + +#if defined (vax) +# if !defined (ultrix) +# include <sys/param.h> +# if defined (BSD) +# if BSD == 43 + printf ("vax-dec-bsd4.3\n"); exit (0); +# else +# if BSD == 199006 + printf ("vax-dec-bsd4.3reno\n"); exit (0); +# else + printf ("vax-dec-bsd\n"); exit (0); +# endif +# endif +# else + printf ("vax-dec-bsd\n"); exit (0); +# endif +# else + printf ("vax-dec-ultrix\n"); exit (0); +# endif +#endif + +#if defined (alliant) && defined (i860) + printf ("i860-alliant-bsd\n"); exit (0); +#endif + + exit (1); +} +EOF + +$CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy && rm -f $dummy.c $dummy && exit 0 +rm -f $dummy.c $dummy + +# Apollos put the system type in the environment. + +test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit 0; } + +# Convex versions that predate uname can use getsysinfo(1) + +if [ -x /usr/convex/getsysinfo ] +then + case `getsysinfo -f cpu_type` in + c1*) + echo c1-convex-bsd + exit 0 ;; + c2*) + if getsysinfo -f scalar_acc + then echo c32-convex-bsd + else echo c2-convex-bsd + fi + exit 0 ;; + c34*) + echo c34-convex-bsd + exit 0 ;; + c38*) + echo c38-convex-bsd + exit 0 ;; + c4*) + echo c4-convex-bsd + exit 0 ;; + esac +fi + +cat >&2 <<EOF +$0: unable to guess system type + +This script, last modified $timestamp, has failed to recognize +the operating system you are using. It is advised that you +download the most up to date version of the config scripts from + + ftp://ftp.gnu.org/pub/gnu/config/ + +If the version you run ($0) is already up to date, please +send the following data and any information you think might be +pertinent to <config-patches@gnu.org> in order to provide the needed +information to handle your system. + +config.guess timestamp = $timestamp + +uname -m = `(uname -m) 2>/dev/null || echo unknown` +uname -r = `(uname -r) 2>/dev/null || echo unknown` +uname -s = `(uname -s) 2>/dev/null || echo unknown` +uname -v = `(uname -v) 2>/dev/null || echo unknown` + +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null` + +hostinfo = `(hostinfo) 2>/dev/null` +/bin/universe = `(/bin/universe) 2>/dev/null` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` +/bin/arch = `(/bin/arch) 2>/dev/null` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` + +UNAME_MACHINE = ${UNAME_MACHINE} +UNAME_RELEASE = ${UNAME_RELEASE} +UNAME_SYSTEM = ${UNAME_SYSTEM} +UNAME_VERSION = ${UNAME_VERSION} +EOF + +exit 1 + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "timestamp='" +# time-stamp-format: "%:y-%02m-%02d" +# time-stamp-end: "'" +# End: diff --git a/sflphone-common/libs/pjproject/config.sub b/sflphone-common/libs/pjproject/config.sub deleted file mode 120000 index 04fd6e297dd1d34bdeef7379188d6f7f61419426..0000000000000000000000000000000000000000 --- a/sflphone-common/libs/pjproject/config.sub +++ /dev/null @@ -1 +0,0 @@ -/usr/share/misc/config.sub \ No newline at end of file diff --git a/sflphone-common/libs/pjproject/config.sub b/sflphone-common/libs/pjproject/config.sub new file mode 100755 index 0000000000000000000000000000000000000000..746ee208a175a4f263cc9a186f5dc8f420524274 --- /dev/null +++ b/sflphone-common/libs/pjproject/config.sub @@ -0,0 +1,1572 @@ +#! /bin/sh +# Configuration validation subroutine script. +# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, +# 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. + +timestamp='2005-04-22' + +# This file is (in principle) common to ALL GNU software. +# The presence of a machine in this file suggests that SOME GNU software +# can handle that machine. It does not imply ALL GNU software can. +# +# This file is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, +# Boston, MA 02111-1307, USA. + +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# Please send patches to <config-patches@gnu.org>. Submit a context +# diff and a properly formatted ChangeLog entry. +# +# Configuration subroutine to validate and canonicalize a configuration type. +# Supply the specified configuration type as an argument. +# If it is invalid, we print an error message on stderr and exit with code 1. +# Otherwise, we print the canonical config type on stdout and succeed. + +# This file is supposed to be the same for all GNU packages +# and recognize all the CPU types, system types and aliases +# that are meaningful with *any* GNU software. +# Each package is responsible for reporting which valid configurations +# it does not support. The user should be able to distinguish +# a failure to support a valid configuration from a meaningless +# configuration. + +# The goal of this file is to map all the various variations of a given +# machine specification into a single specification in the form: +# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM +# or in some cases, the newer four-part form: +# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM +# It is wrong to echo any other type of specification. + +me=`echo "$0" | sed -e 's,.*/,,'` + +usage="\ +Usage: $0 [OPTION] CPU-MFR-OPSYS + $0 [OPTION] ALIAS + +Canonicalize a configuration name. + +Operation modes: + -h, --help print this help, then exit + -t, --time-stamp print date of last modification, then exit + -v, --version print version number, then exit + +Report bugs and patches to <config-patches@gnu.org>." + +version="\ +GNU config.sub ($timestamp) + +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 +Free Software Foundation, Inc. + +This is free software; see the source for copying conditions. There is NO +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." + +help=" +Try \`$me --help' for more information." + +# Parse command line +while test $# -gt 0 ; do + case $1 in + --time-stamp | --time* | -t ) + echo "$timestamp" ; exit 0 ;; + --version | -v ) + echo "$version" ; exit 0 ;; + --help | --h* | -h ) + echo "$usage"; exit 0 ;; + -- ) # Stop option processing + shift; break ;; + - ) # Use stdin as input. + break ;; + -* ) + echo "$me: invalid option $1$help" + exit 1 ;; + + *local*) + # First pass through any local machine types. + echo $1 + exit 0;; + + * ) + break ;; + esac +done + +case $# in + 0) echo "$me: missing argument$help" >&2 + exit 1;; + 1) ;; + *) echo "$me: too many arguments$help" >&2 + exit 1;; +esac + +# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). +# Here we must recognize all the valid KERNEL-OS combinations. +maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` +case $maybe_os in + nto-qnx* | linux-gnu* | linux-dietlibc | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | \ + kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | storm-chaos* | os2-emx* | rtmk-nova*) + os=-$maybe_os + basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` + ;; + *) + basic_machine=`echo $1 | sed 's/-[^-]*$//'` + if [ $basic_machine != $1 ] + then os=`echo $1 | sed 's/.*-/-/'` + else os=; fi + ;; +esac + +### Let's recognize common machines as not being operating systems so +### that things like config.sub decstation-3100 work. We also +### recognize some manufacturers as not being operating systems, so we +### can provide default operating systems below. +case $os in + -sun*os*) + # Prevent following clause from handling this invalid input. + ;; + -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ + -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ + -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ + -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ + -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ + -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ + -apple | -axis | -knuth | -cray) + os= + basic_machine=$1 + ;; + -sim | -cisco | -oki | -wec | -winbond) + os= + basic_machine=$1 + ;; + -scout) + ;; + -wrs) + os=-vxworks + basic_machine=$1 + ;; + -chorusos*) + os=-chorusos + basic_machine=$1 + ;; + -chorusrdb) + os=-chorusrdb + basic_machine=$1 + ;; + -hiux*) + os=-hiuxwe2 + ;; + -sco5) + os=-sco3.2v5 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco4) + os=-sco3.2v4 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco3.2.[4-9]*) + os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco3.2v[4-9]*) + # Don't forget version if it is 3.2v4 or newer. + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco*) + os=-sco3.2v2 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -udk*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -isc) + os=-isc2.2 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -clix*) + basic_machine=clipper-intergraph + ;; + -isc*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -lynx*) + os=-lynxos + ;; + -ptx*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` + ;; + -windowsnt*) + os=`echo $os | sed -e 's/windowsnt/winnt/'` + ;; + -psos*) + os=-psos + ;; + -mint | -mint[0-9]*) + basic_machine=m68k-atari + os=-mint + ;; +esac + +# Decode aliases for certain CPU-COMPANY combinations. +case $basic_machine in + # Recognize the basic CPU types without company name. + # Some are omitted here because they have special meanings below. + 1750a | 580 \ + | a29k \ + | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ + | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ + | am33_2.0 \ + | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \ + | bfin \ + | c4x | clipper \ + | d10v | d30v | dlx | dsp16xx \ + | fr30 | frv \ + | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ + | i370 | i860 | i960 | ia64 \ + | ip2k | iq2000 \ + | m32r | m32rle | m68000 | m68k | m88k | maxq | mcore \ + | mips | mipsbe | mipseb | mipsel | mipsle \ + | mips16 \ + | mips64 | mips64el \ + | mips64vr | mips64vrel \ + | mips64orion | mips64orionel \ + | mips64vr4100 | mips64vr4100el \ + | mips64vr4300 | mips64vr4300el \ + | mips64vr5000 | mips64vr5000el \ + | mipsisa32 | mipsisa32el \ + | mipsisa32r2 | mipsisa32r2el \ + | mipsisa64 | mipsisa64el \ + | mipsisa64r2 | mipsisa64r2el \ + | mipsisa64sb1 | mipsisa64sb1el \ + | mipsisa64sr71k | mipsisa64sr71kel \ + | mipstx39 | mipstx39el \ + | mn10200 | mn10300 \ + | msp430 \ + | ns16k | ns32k \ + | openrisc | or32 \ + | pdp10 | pdp11 | pj | pjl \ + | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ + | pyramid \ + | sh | sh[1234] | sh[23]e | sh[34]eb | shbe | shle | sh[1234]le | sh3ele \ + | sh64 | sh64le \ + | sparc | sparc64 | sparc64b | sparc86x | sparclet | sparclite \ + | sparcv8 | sparcv9 | sparcv9b \ + | strongarm \ + | tahoe | thumb | tic4x | tic80 | tron \ + | v850 | v850e \ + | we32k \ + | x86 | xscale | xscalee[bl] | xstormy16 | xtensa \ + | z8k) + basic_machine=$basic_machine-unknown + ;; + m6811 | m68hc11 | m6812 | m68hc12) + # Motorola 68HC11/12. + basic_machine=$basic_machine-unknown + os=-none + ;; + m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) + ;; + + # We use `pc' rather than `unknown' + # because (1) that's what they normally are, and + # (2) the word "unknown" tends to confuse beginning users. + i*86 | x86_64) + basic_machine=$basic_machine-pc + ;; + # Object if more than one company name word. + *-*-*) + echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 + exit 1 + ;; + # Recognize the basic CPU types with company name. + 580-* \ + | a29k-* \ + | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ + | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ + | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ + | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ + | avr-* \ + | bfin-* | bs2000-* \ + | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \ + | clipper-* | craynv-* | cydra-* \ + | d10v-* | d30v-* | dlx-* \ + | elxsi-* \ + | f30[01]-* | f700-* | fr30-* | frv-* | fx80-* \ + | h8300-* | h8500-* \ + | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ + | i*86-* | i860-* | i960-* | ia64-* \ + | ip2k-* | iq2000-* \ + | m32r-* | m32rle-* \ + | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ + | m88110-* | m88k-* | maxq-* | mcore-* \ + | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ + | mips16-* \ + | mips64-* | mips64el-* \ + | mips64vr-* | mips64vrel-* \ + | mips64orion-* | mips64orionel-* \ + | mips64vr4100-* | mips64vr4100el-* \ + | mips64vr4300-* | mips64vr4300el-* \ + | mips64vr5000-* | mips64vr5000el-* \ + | mipsisa32-* | mipsisa32el-* \ + | mipsisa32r2-* | mipsisa32r2el-* \ + | mipsisa64-* | mipsisa64el-* \ + | mipsisa64r2-* | mipsisa64r2el-* \ + | mipsisa64sb1-* | mipsisa64sb1el-* \ + | mipsisa64sr71k-* | mipsisa64sr71kel-* \ + | mipstx39-* | mipstx39el-* \ + | mmix-* \ + | msp430-* \ + | none-* | np1-* | ns16k-* | ns32k-* \ + | orion-* \ + | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ + | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ + | pyramid-* \ + | romp-* | rs6000-* \ + | sh-* | sh[1234]-* | sh[23]e-* | sh[34]eb-* | shbe-* \ + | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ + | sparc-* | sparc64-* | sparc64b-* | sparc86x-* | sparclet-* \ + | sparclite-* \ + | sparcv8-* | sparcv9-* | sparcv9b-* | strongarm-* | sv1-* | sx?-* \ + | tahoe-* | thumb-* \ + | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ + | tron-* \ + | v850-* | v850e-* | vax-* \ + | we32k-* \ + | x86-* | x86_64-* | xps100-* | xscale-* | xscalee[bl]-* \ + | xstormy16-* | xtensa-* \ + | ymp-* \ + | z8k-*) + ;; + # Recognize the various machine names and aliases which stand + # for a CPU type and a company and sometimes even an OS. + 386bsd) + basic_machine=i386-unknown + os=-bsd + ;; + 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) + basic_machine=m68000-att + ;; + 3b*) + basic_machine=we32k-att + ;; + a29khif) + basic_machine=a29k-amd + os=-udi + ;; + abacus) + basic_machine=abacus-unknown + ;; + adobe68k) + basic_machine=m68010-adobe + os=-scout + ;; + alliant | fx80) + basic_machine=fx80-alliant + ;; + altos | altos3068) + basic_machine=m68k-altos + ;; + am29k) + basic_machine=a29k-none + os=-bsd + ;; + amd64) + basic_machine=x86_64-pc + ;; + amd64-*) + basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + amdahl) + basic_machine=580-amdahl + os=-sysv + ;; + amiga | amiga-*) + basic_machine=m68k-unknown + ;; + amigaos | amigados) + basic_machine=m68k-unknown + os=-amigaos + ;; + amigaunix | amix) + basic_machine=m68k-unknown + os=-sysv4 + ;; + apollo68) + basic_machine=m68k-apollo + os=-sysv + ;; + apollo68bsd) + basic_machine=m68k-apollo + os=-bsd + ;; + aux) + basic_machine=m68k-apple + os=-aux + ;; + balance) + basic_machine=ns32k-sequent + os=-dynix + ;; + c90) + basic_machine=c90-cray + os=-unicos + ;; + convex-c1) + basic_machine=c1-convex + os=-bsd + ;; + convex-c2) + basic_machine=c2-convex + os=-bsd + ;; + convex-c32) + basic_machine=c32-convex + os=-bsd + ;; + convex-c34) + basic_machine=c34-convex + os=-bsd + ;; + convex-c38) + basic_machine=c38-convex + os=-bsd + ;; + cray | j90) + basic_machine=j90-cray + os=-unicos + ;; + craynv) + basic_machine=craynv-cray + os=-unicosmp + ;; + cr16c) + basic_machine=cr16c-unknown + os=-elf + ;; + crds | unos) + basic_machine=m68k-crds + ;; + crisv32 | crisv32-* | etraxfs*) + basic_machine=crisv32-axis + ;; + cris | cris-* | etrax*) + basic_machine=cris-axis + ;; + crx) + basic_machine=crx-unknown + os=-elf + ;; + da30 | da30-*) + basic_machine=m68k-da30 + ;; + decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) + basic_machine=mips-dec + ;; + decsystem10* | dec10*) + basic_machine=pdp10-dec + os=-tops10 + ;; + decsystem20* | dec20*) + basic_machine=pdp10-dec + os=-tops20 + ;; + delta | 3300 | motorola-3300 | motorola-delta \ + | 3300-motorola | delta-motorola) + basic_machine=m68k-motorola + ;; + delta88) + basic_machine=m88k-motorola + os=-sysv3 + ;; + djgpp) + basic_machine=i586-pc + os=-msdosdjgpp + ;; + dpx20 | dpx20-*) + basic_machine=rs6000-bull + os=-bosx + ;; + dpx2* | dpx2*-bull) + basic_machine=m68k-bull + os=-sysv3 + ;; + ebmon29k) + basic_machine=a29k-amd + os=-ebmon + ;; + elxsi) + basic_machine=elxsi-elxsi + os=-bsd + ;; + encore | umax | mmax) + basic_machine=ns32k-encore + ;; + es1800 | OSE68k | ose68k | ose | OSE) + basic_machine=m68k-ericsson + os=-ose + ;; + fx2800) + basic_machine=i860-alliant + ;; + genix) + basic_machine=ns32k-ns + ;; + gmicro) + basic_machine=tron-gmicro + os=-sysv + ;; + go32) + basic_machine=i386-pc + os=-go32 + ;; + h3050r* | hiux*) + basic_machine=hppa1.1-hitachi + os=-hiuxwe2 + ;; + h8300hms) + basic_machine=h8300-hitachi + os=-hms + ;; + h8300xray) + basic_machine=h8300-hitachi + os=-xray + ;; + h8500hms) + basic_machine=h8500-hitachi + os=-hms + ;; + harris) + basic_machine=m88k-harris + os=-sysv3 + ;; + hp300-*) + basic_machine=m68k-hp + ;; + hp300bsd) + basic_machine=m68k-hp + os=-bsd + ;; + hp300hpux) + basic_machine=m68k-hp + os=-hpux + ;; + hp3k9[0-9][0-9] | hp9[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hp9k2[0-9][0-9] | hp9k31[0-9]) + basic_machine=m68000-hp + ;; + hp9k3[2-9][0-9]) + basic_machine=m68k-hp + ;; + hp9k6[0-9][0-9] | hp6[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hp9k7[0-79][0-9] | hp7[0-79][0-9]) + basic_machine=hppa1.1-hp + ;; + hp9k78[0-9] | hp78[0-9]) + # FIXME: really hppa2.0-hp + basic_machine=hppa1.1-hp + ;; + hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) + # FIXME: really hppa2.0-hp + basic_machine=hppa1.1-hp + ;; + hp9k8[0-9][13679] | hp8[0-9][13679]) + basic_machine=hppa1.1-hp + ;; + hp9k8[0-9][0-9] | hp8[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hppa-next) + os=-nextstep3 + ;; + hppaosf) + basic_machine=hppa1.1-hp + os=-osf + ;; + hppro) + basic_machine=hppa1.1-hp + os=-proelf + ;; + i370-ibm* | ibm*) + basic_machine=i370-ibm + ;; +# I'm not sure what "Sysv32" means. Should this be sysv3.2? + i*86v32) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv32 + ;; + i*86v4*) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv4 + ;; + i*86v) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv + ;; + i*86sol2) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-solaris2 + ;; + i386mach) + basic_machine=i386-mach + os=-mach + ;; + i386-vsta | vsta) + basic_machine=i386-unknown + os=-vsta + ;; + iris | iris4d) + basic_machine=mips-sgi + case $os in + -irix*) + ;; + *) + os=-irix4 + ;; + esac + ;; + isi68 | isi) + basic_machine=m68k-isi + os=-sysv + ;; + m88k-omron*) + basic_machine=m88k-omron + ;; + magnum | m3230) + basic_machine=mips-mips + os=-sysv + ;; + merlin) + basic_machine=ns32k-utek + os=-sysv + ;; + mingw32) + basic_machine=i386-pc + os=-mingw32 + ;; + miniframe) + basic_machine=m68000-convergent + ;; + *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) + basic_machine=m68k-atari + os=-mint + ;; + mips3*-*) + basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` + ;; + mips3*) + basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown + ;; + monitor) + basic_machine=m68k-rom68k + os=-coff + ;; + morphos) + basic_machine=powerpc-unknown + os=-morphos + ;; + msdos) + basic_machine=i386-pc + os=-msdos + ;; + mvs) + basic_machine=i370-ibm + os=-mvs + ;; + ncr3000) + basic_machine=i486-ncr + os=-sysv4 + ;; + netbsd386) + basic_machine=i386-unknown + os=-netbsd + ;; + netwinder) + basic_machine=armv4l-rebel + os=-linux + ;; + news | news700 | news800 | news900) + basic_machine=m68k-sony + os=-newsos + ;; + news1000) + basic_machine=m68030-sony + os=-newsos + ;; + news-3600 | risc-news) + basic_machine=mips-sony + os=-newsos + ;; + necv70) + basic_machine=v70-nec + os=-sysv + ;; + next | m*-next ) + basic_machine=m68k-next + case $os in + -nextstep* ) + ;; + -ns2*) + os=-nextstep2 + ;; + *) + os=-nextstep3 + ;; + esac + ;; + nh3000) + basic_machine=m68k-harris + os=-cxux + ;; + nh[45]000) + basic_machine=m88k-harris + os=-cxux + ;; + nindy960) + basic_machine=i960-intel + os=-nindy + ;; + mon960) + basic_machine=i960-intel + os=-mon960 + ;; + nonstopux) + basic_machine=mips-compaq + os=-nonstopux + ;; + np1) + basic_machine=np1-gould + ;; + nsr-tandem) + basic_machine=nsr-tandem + ;; + op50n-* | op60c-*) + basic_machine=hppa1.1-oki + os=-proelf + ;; + or32 | or32-*) + basic_machine=or32-unknown + os=-coff + ;; + os400) + basic_machine=powerpc-ibm + os=-os400 + ;; + OSE68000 | ose68000) + basic_machine=m68000-ericsson + os=-ose + ;; + os68k) + basic_machine=m68k-none + os=-os68k + ;; + pa-hitachi) + basic_machine=hppa1.1-hitachi + os=-hiuxwe2 + ;; + paragon) + basic_machine=i860-intel + os=-osf + ;; + pbd) + basic_machine=sparc-tti + ;; + pbb) + basic_machine=m68k-tti + ;; + pc532 | pc532-*) + basic_machine=ns32k-pc532 + ;; + pentium | p5 | k5 | k6 | nexgen | viac3) + basic_machine=i586-pc + ;; + pentiumpro | p6 | 6x86 | athlon | athlon_*) + basic_machine=i686-pc + ;; + pentiumii | pentium2 | pentiumiii | pentium3) + basic_machine=i686-pc + ;; + pentium4) + basic_machine=i786-pc + ;; + pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) + basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentiumpro-* | p6-* | 6x86-* | athlon-*) + basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) + basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentium4-*) + basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pn) + basic_machine=pn-gould + ;; + power) basic_machine=power-ibm + ;; + ppc) basic_machine=powerpc-unknown + ;; + ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppcle | powerpclittle | ppc-le | powerpc-little) + basic_machine=powerpcle-unknown + ;; + ppcle-* | powerpclittle-*) + basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppc64) basic_machine=powerpc64-unknown + ;; + ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppc64le | powerpc64little | ppc64-le | powerpc64-little) + basic_machine=powerpc64le-unknown + ;; + ppc64le-* | powerpc64little-*) + basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ps2) + basic_machine=i386-ibm + ;; + pw32) + basic_machine=i586-unknown + os=-pw32 + ;; + rom68k) + basic_machine=m68k-rom68k + os=-coff + ;; + rm[46]00) + basic_machine=mips-siemens + ;; + rtpc | rtpc-*) + basic_machine=romp-ibm + ;; + s390 | s390-*) + basic_machine=s390-ibm + ;; + s390x | s390x-*) + basic_machine=s390x-ibm + ;; + sa29200) + basic_machine=a29k-amd + os=-udi + ;; + sb1) + basic_machine=mipsisa64sb1-unknown + ;; + sb1el) + basic_machine=mipsisa64sb1el-unknown + ;; + sei) + basic_machine=mips-sei + os=-seiux + ;; + sequent) + basic_machine=i386-sequent + ;; + sh) + basic_machine=sh-hitachi + os=-hms + ;; + sh64) + basic_machine=sh64-unknown + ;; + sparclite-wrs | simso-wrs) + basic_machine=sparclite-wrs + os=-vxworks + ;; + sps7) + basic_machine=m68k-bull + os=-sysv2 + ;; + spur) + basic_machine=spur-unknown + ;; + st2000) + basic_machine=m68k-tandem + ;; + stratus) + basic_machine=i860-stratus + os=-sysv4 + ;; + sun2) + basic_machine=m68000-sun + ;; + sun2os3) + basic_machine=m68000-sun + os=-sunos3 + ;; + sun2os4) + basic_machine=m68000-sun + os=-sunos4 + ;; + sun3os3) + basic_machine=m68k-sun + os=-sunos3 + ;; + sun3os4) + basic_machine=m68k-sun + os=-sunos4 + ;; + sun4os3) + basic_machine=sparc-sun + os=-sunos3 + ;; + sun4os4) + basic_machine=sparc-sun + os=-sunos4 + ;; + sun4sol2) + basic_machine=sparc-sun + os=-solaris2 + ;; + sun3 | sun3-*) + basic_machine=m68k-sun + ;; + sun4) + basic_machine=sparc-sun + ;; + sun386 | sun386i | roadrunner) + basic_machine=i386-sun + ;; + sv1) + basic_machine=sv1-cray + os=-unicos + ;; + symmetry) + basic_machine=i386-sequent + os=-dynix + ;; + t3e) + basic_machine=alphaev5-cray + os=-unicos + ;; + t90) + basic_machine=t90-cray + os=-unicos + ;; + tic54x | c54x*) + basic_machine=tic54x-unknown + os=-coff + ;; + tic55x | c55x*) + basic_machine=tic55x-unknown + os=-coff + ;; + tic6x | c6x*) + basic_machine=tic6x-unknown + os=-coff + ;; + tx39) + basic_machine=mipstx39-unknown + ;; + tx39el) + basic_machine=mipstx39el-unknown + ;; + toad1) + basic_machine=pdp10-xkl + os=-tops20 + ;; + tower | tower-32) + basic_machine=m68k-ncr + ;; + tpf) + basic_machine=s390x-ibm + os=-tpf + ;; + udi29k) + basic_machine=a29k-amd + os=-udi + ;; + ultra3) + basic_machine=a29k-nyu + os=-sym1 + ;; + v810 | necv810) + basic_machine=v810-nec + os=-none + ;; + vaxv) + basic_machine=vax-dec + os=-sysv + ;; + vms) + basic_machine=vax-dec + os=-vms + ;; + vpp*|vx|vx-*) + basic_machine=f301-fujitsu + ;; + vxworks960) + basic_machine=i960-wrs + os=-vxworks + ;; + vxworks68) + basic_machine=m68k-wrs + os=-vxworks + ;; + vxworks29k) + basic_machine=a29k-wrs + os=-vxworks + ;; + w65*) + basic_machine=w65-wdc + os=-none + ;; + w89k-*) + basic_machine=hppa1.1-winbond + os=-proelf + ;; + xbox) + basic_machine=i686-pc + os=-mingw32 + ;; + xps | xps100) + basic_machine=xps100-honeywell + ;; + ymp) + basic_machine=ymp-cray + os=-unicos + ;; + z8k-*-coff) + basic_machine=z8k-unknown + os=-sim + ;; + none) + basic_machine=none-none + os=-none + ;; + +# Here we handle the default manufacturer of certain CPU types. It is in +# some cases the only manufacturer, in others, it is the most popular. + w89k) + basic_machine=hppa1.1-winbond + ;; + op50n) + basic_machine=hppa1.1-oki + ;; + op60c) + basic_machine=hppa1.1-oki + ;; + romp) + basic_machine=romp-ibm + ;; + mmix) + basic_machine=mmix-knuth + ;; + rs6000) + basic_machine=rs6000-ibm + ;; + vax) + basic_machine=vax-dec + ;; + pdp10) + # there are many clones, so DEC is not a safe bet + basic_machine=pdp10-unknown + ;; + pdp11) + basic_machine=pdp11-dec + ;; + we32k) + basic_machine=we32k-att + ;; + sh3 | sh4 | sh[34]eb | sh[1234]le | sh[23]ele) + basic_machine=sh-unknown + ;; + sh64) + basic_machine=sh64-unknown + ;; + sparc | sparcv8 | sparcv9 | sparcv9b) + basic_machine=sparc-sun + ;; + cydra) + basic_machine=cydra-cydrome + ;; + orion) + basic_machine=orion-highlevel + ;; + orion105) + basic_machine=clipper-highlevel + ;; + mac | mpw | mac-mpw) + basic_machine=m68k-apple + ;; + pmac | pmac-mpw) + basic_machine=powerpc-apple + ;; + nios2*) + basic_machine=nios2-altera + ;; + *-unknown) + # Make sure to match an already-canonicalized machine name. + ;; + *) + echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 + exit 1 + ;; +esac + +# Here we canonicalize certain aliases for manufacturers. +case $basic_machine in + *-digital*) + basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` + ;; + *-commodore*) + basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` + ;; + *) + ;; +esac + +# Decode manufacturer-specific aliases for certain operating systems. + +if [ x"$os" != x"" ] +then +case $os in + # First match some system type aliases + # that might get confused with valid system types. + # -solaris* is a basic system type, with this one exception. + -solaris1 | -solaris1.*) + os=`echo $os | sed -e 's|solaris1|sunos4|'` + ;; + -solaris) + os=-solaris2 + ;; + -svr4*) + os=-sysv4 + ;; + -unixware*) + os=-sysv4.2uw + ;; + -gnu/linux*) + os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` + ;; + # First accept the basic system types. + # The portable systems comes first. + # Each alternative MUST END IN A *, to match a version number. + # -sysv* is not here because it comes later, after sysvr4. + -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ + | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\ + | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \ + | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ + | -aos* \ + | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ + | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ + | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* | -openbsd* \ + | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ + | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ + | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ + | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ + | -chorusos* | -chorusrdb* \ + | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ + | -mingw32* | -linux-gnu* | -linux-uclibc* | -uxpv* | -beos* | -mpeix* | -udk* \ + | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ + | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ + | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ + | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ + | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ + | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly*) + # Remember, each alternative MUST END IN *, to match a version number. + ;; + -qnx*) + case $basic_machine in + x86-* | i*86-*) + ;; + *) + os=-nto$os + ;; + esac + ;; + -nto-qnx*) + ;; + -nto*) + os=`echo $os | sed -e 's|nto|nto-qnx|'` + ;; + -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ + | -windows* | -osx | -abug | -netware* | -os9* | -beos* \ + | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) + ;; + -mac*) + os=`echo $os | sed -e 's|mac|macos|'` + ;; + -linux-dietlibc) + os=-linux-dietlibc + ;; + -linux*) + os=`echo $os | sed -e 's|linux|linux-gnu|'` + ;; + -sunos5*) + os=`echo $os | sed -e 's|sunos5|solaris2|'` + ;; + -sunos6*) + os=`echo $os | sed -e 's|sunos6|solaris3|'` + ;; + -opened*) + os=-openedition + ;; + -os400*) + os=-os400 + ;; + -wince*) + os=-wince + ;; + -osfrose*) + os=-osfrose + ;; + -osf*) + os=-osf + ;; + -utek*) + os=-bsd + ;; + -dynix*) + os=-bsd + ;; + -acis*) + os=-aos + ;; + -atheos*) + os=-atheos + ;; + -syllable*) + os=-syllable + ;; + -386bsd) + os=-bsd + ;; + -ctix* | -uts*) + os=-sysv + ;; + -nova*) + os=-rtmk-nova + ;; + -ns2 ) + os=-nextstep2 + ;; + -nsk*) + os=-nsk + ;; + # Preserve the version number of sinix5. + -sinix5.*) + os=`echo $os | sed -e 's|sinix|sysv|'` + ;; + -sinix*) + os=-sysv4 + ;; + -tpf*) + os=-tpf + ;; + -triton*) + os=-sysv3 + ;; + -oss*) + os=-sysv3 + ;; + -svr4) + os=-sysv4 + ;; + -svr3) + os=-sysv3 + ;; + -sysvr4) + os=-sysv4 + ;; + # This must come after -sysvr4. + -sysv*) + ;; + -ose*) + os=-ose + ;; + -es1800*) + os=-ose + ;; + -xenix) + os=-xenix + ;; + -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) + os=-mint + ;; + -aros*) + os=-aros + ;; + -kaos*) + os=-kaos + ;; + -zvmoe) + os=-zvmoe + ;; + -none) + ;; + *) + # Get rid of the `-' at the beginning of $os. + os=`echo $os | sed 's/[^-]*-//'` + echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 + exit 1 + ;; +esac +else + +# Here we handle the default operating systems that come with various machines. +# The value should be what the vendor currently ships out the door with their +# machine or put another way, the most popular os provided with the machine. + +# Note that if you're going to try to match "-MANUFACTURER" here (say, +# "-sun"), then you have to tell the case statement up towards the top +# that MANUFACTURER isn't an operating system. Otherwise, code above +# will signal an error saying that MANUFACTURER isn't an operating +# system, and we'll never get to this point. + +case $basic_machine in + *-acorn) + os=-riscix1.2 + ;; + arm*-rebel) + os=-linux + ;; + arm*-semi) + os=-aout + ;; + c4x-* | tic4x-*) + os=-coff + ;; + # This must come before the *-dec entry. + pdp10-*) + os=-tops20 + ;; + pdp11-*) + os=-none + ;; + *-dec | vax-*) + os=-ultrix4.2 + ;; + m68*-apollo) + os=-domain + ;; + i386-sun) + os=-sunos4.0.2 + ;; + m68000-sun) + os=-sunos3 + # This also exists in the configure program, but was not the + # default. + # os=-sunos4 + ;; + m68*-cisco) + os=-aout + ;; + mips*-cisco) + os=-elf + ;; + mips*-*) + os=-elf + ;; + or32-*) + os=-coff + ;; + *-tti) # must be before sparc entry or we get the wrong os. + os=-sysv3 + ;; + sparc-* | *-sun) + os=-sunos4.1.1 + ;; + *-be) + os=-beos + ;; + *-ibm) + os=-aix + ;; + *-knuth) + os=-mmixware + ;; + *-wec) + os=-proelf + ;; + *-winbond) + os=-proelf + ;; + *-oki) + os=-proelf + ;; + *-hp) + os=-hpux + ;; + *-hitachi) + os=-hiux + ;; + i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) + os=-sysv + ;; + *-cbm) + os=-amigaos + ;; + *-dg) + os=-dgux + ;; + *-dolphin) + os=-sysv3 + ;; + m68k-ccur) + os=-rtu + ;; + m88k-omron*) + os=-luna + ;; + *-next ) + os=-nextstep + ;; + *-sequent) + os=-ptx + ;; + *-crds) + os=-unos + ;; + *-ns) + os=-genix + ;; + i370-*) + os=-mvs + ;; + *-next) + os=-nextstep3 + ;; + *-gould) + os=-sysv + ;; + *-highlevel) + os=-bsd + ;; + *-encore) + os=-bsd + ;; + *-sgi) + os=-irix + ;; + *-siemens) + os=-sysv4 + ;; + *-masscomp) + os=-rtu + ;; + f30[01]-fujitsu | f700-fujitsu) + os=-uxpv + ;; + *-rom68k) + os=-coff + ;; + *-*bug) + os=-coff + ;; + *-apple) + os=-macos + ;; + *-atari*) + os=-mint + ;; + *) + os=-none + ;; +esac +fi + +# Here we handle the case where we know the os, and the CPU type, but not the +# manufacturer. We pick the logical manufacturer. +vendor=unknown +case $basic_machine in + *-unknown) + case $os in + -riscix*) + vendor=acorn + ;; + -sunos*) + vendor=sun + ;; + -aix*) + vendor=ibm + ;; + -beos*) + vendor=be + ;; + -hpux*) + vendor=hp + ;; + -mpeix*) + vendor=hp + ;; + -hiux*) + vendor=hitachi + ;; + -unos*) + vendor=crds + ;; + -dgux*) + vendor=dg + ;; + -luna*) + vendor=omron + ;; + -genix*) + vendor=ns + ;; + -mvs* | -opened*) + vendor=ibm + ;; + -os400*) + vendor=ibm + ;; + -ptx*) + vendor=sequent + ;; + -tpf*) + vendor=ibm + ;; + -vxsim* | -vxworks* | -windiss*) + vendor=wrs + ;; + -aux*) + vendor=apple + ;; + -hms*) + vendor=hitachi + ;; + -mpw* | -macos*) + vendor=apple + ;; + -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) + vendor=atari + ;; + -vos*) + vendor=stratus + ;; + esac + basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` + ;; +esac + +echo $basic_machine$os +exit 0 + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "timestamp='" +# time-stamp-format: "%:y-%02m-%02d" +# time-stamp-end: "'" +# End: diff --git a/sflphone-common/libs/pjproject/configure.ac b/sflphone-common/libs/pjproject/configure.ac deleted file mode 100644 index bf1644033a4f5cb86b7e9dc8e49804bfa092ee58..0000000000000000000000000000000000000000 --- a/sflphone-common/libs/pjproject/configure.ac +++ /dev/null @@ -1,5 +0,0 @@ -dnl Dummy configure.ac for autotools - -AC_INIT -LT_INIT -AC_OUTPUT diff --git a/sflphone-common/libs/pjproject/libpj-sfl.pc.in b/sflphone-common/libs/pjproject/libpj-sfl.pc.in deleted file mode 100644 index 8fa8d809cde3d2e8df03acdc7793ac68e5933094..0000000000000000000000000000000000000000 --- a/sflphone-common/libs/pjproject/libpj-sfl.pc.in +++ /dev/null @@ -1,12 +0,0 @@ -# Package Information for pkg-config - -prefix=@PREFIX@ -exec_prefix=${prefix} -libdir=${exec_prefix}/lib -includedir=${prefix}/include - -Name: libpj-sfl -Description: Multimedia communication library -Version: 0.5.10.3 -Libs: -L${libdir} -lpjsua-sfl -lpjsip-sfl -lpjmedia-sfl -lpjsip-ua-sfl -lpjsip-simple-sfl -lpjsip-ua-sfl -lpjmedia-codec-sfl -lpjlib-util-sfl -lpj-sfl -Cflags: -I${includedir} diff --git a/sflphone-common/libs/pjproject/pjlib-util/build/Makefile b/sflphone-common/libs/pjproject/pjlib-util/build/Makefile index 7dd8a9b27cb2a1345418fabe484be9aa2dc787e6..ef0939af690d2c30f6f230168b319f379b2e1323 100644 --- a/sflphone-common/libs/pjproject/pjlib-util/build/Makefile +++ b/sflphone-common/libs/pjproject/pjlib-util/build/Makefile @@ -7,8 +7,8 @@ include $(PJDIR)/build/common.mak RULES_MAK := $(PJDIR)/build/rules.mak -PJLIB_LIB:=$(PJDIR)/pjlib/lib/libpj-sfl-$(TARGET_NAME)$(LIBEXT) -export PJLIB_UTIL_LIB:=../lib/libpjlib-util-sfl-$(TARGET_NAME)$(LIBEXT) +PJLIB_LIB:=$(PJDIR)/pjlib/lib/libpj-$(TARGET_NAME)$(LIBEXT) +export PJLIB_UTIL_LIB:=../lib/libpjlib-util-$(TARGET_NAME)$(LIBEXT) ############################################################################### # Gather all flags. diff --git a/sflphone-common/libs/pjproject/pjlib-util/build/os-auto.mak b/sflphone-common/libs/pjproject/pjlib-util/build/os-auto.mak deleted file mode 100644 index fe7975b64497ac781be78cb52d8fcbd9cb2a9842..0000000000000000000000000000000000000000 --- a/sflphone-common/libs/pjproject/pjlib-util/build/os-auto.mak +++ /dev/null @@ -1,3 +0,0 @@ -# pjlib-util/build/os-auto.mak. Generated from os-auto.mak.in by configure. -export UTIL_TEST_OBJS = main.o - diff --git a/sflphone-common/libs/pjproject/pjlib-util/include/pjlib-util/config.h b/sflphone-common/libs/pjproject/pjlib-util/include/pjlib-util/config.h index 84259301c0dac413dc4510a52d7398234373866f..f1e5b1e9937d7317795ef6342d8fed0efea112aa 100644 --- a/sflphone-common/libs/pjproject/pjlib-util/include/pjlib-util/config.h +++ b/sflphone-common/libs/pjproject/pjlib-util/include/pjlib-util/config.h @@ -1,5 +1,5 @@ /* $Id: config.h 2394 2008-12-23 17:27:53Z bennylp $ */ -/* +/* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> * @@ -15,7 +15,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef __PJLIB_UTIL_CONFIG_H__ #define __PJLIB_UTIL_CONFIG_H__ @@ -59,7 +59,7 @@ * (the #pj_dns_packet_dup() function). * * Generally name compression is desired, since it saves some memory (see - * PJ_DNS_RESOLVER_RES_BUF_SIZE setting). However it comes at the expense of + * PJ_DNS_RESOLVER_RES_BUF_SIZE setting). However it comes at the expense of * a little processing overhead to perform name scanning and also a little * bit more stack usage (8 bytes per entry on 32bit platform). * @@ -84,7 +84,7 @@ /** - * Default retransmission delay, in miliseconds. The combination of + * Default retransmission delay, in miliseconds. The combination of * retransmission delay and count determines the query timeout. * * Default: 2000 (2 seconds, according to RFC 1035) @@ -106,8 +106,8 @@ /** - * Maximum life-time of DNS response in the resolver response cache, - * in seconds. If the value is zero, then DNS response caching will be + * Maximum life-time of DNS response in the resolver response cache, + * in seconds. If the value is zero, then DNS response caching will be * disabled. * * Default is 300 seconds (5 minutes). @@ -120,8 +120,8 @@ /** * The life-time of invalid DNS response in the resolver response cache. - * An invalid DNS response is a response which RCODE is non-zero and - * response without any answer section. These responses can be put in + * An invalid DNS response is a response which RCODE is non-zero and + * response without any answer section. These responses can be put in * the cache too to minimize message round-trip. * * Default: 60 (one minute). @@ -133,7 +133,7 @@ #endif /** - * The interval on which nameservers which are known to be good to be + * The interval on which nameservers which are known to be good to be * probed again to determine whether they are still good. Note that * this applies to both active nameserver (the one currently being used) * and idle nameservers (good nameservers that are not currently selected). diff --git a/sflphone-common/libs/pjproject/pjlib-util/include/pjlib-util/srv_resolver.h b/sflphone-common/libs/pjproject/pjlib-util/include/pjlib-util/srv_resolver.h index 45e05357896f975ce8c393a55d7d446b38bf9b39..216e91b9e5d525d9807b1d26cd4896b639fba186 100644 --- a/sflphone-common/libs/pjproject/pjlib-util/include/pjlib-util/srv_resolver.h +++ b/sflphone-common/libs/pjproject/pjlib-util/include/pjlib-util/srv_resolver.h @@ -104,19 +104,7 @@ typedef enum pj_dns_srv_option * this option is not specified, the SRV resolver will query * the DNS A record for the target instead. */ - PJ_DNS_SRV_RESOLVE_AAAA = 4, - - /** - * Specify if the resolver should fallback to getaddrinfo - * under IPV4 mode if DNS A fails after DNS SRV. - */ - PJ_DNS_SRV_FALLBACK_GETADDRINFO_IPV4 = 8, - - /** - * Specify if the resolver should fallback to getaddrinfo - * under IPV6 mode if DNS A fails after DNS SRV. - */ - PJ_DNS_SRV_FALLBACK_GETADDRINFO_IPV6 = 16, + PJ_DNS_SRV_RESOLVE_AAAA = 4 } pj_dns_srv_option; diff --git a/sflphone-common/libs/pjproject/pjlib-util/src/pjlib-util/resolver_wrap.cpp b/sflphone-common/libs/pjproject/pjlib-util/src/pjlib-util/resolver_wrap.cpp index 19d306e1d0f872325d28a522f86970cce0c7e750..aece5356d7ae6cd2f685ba31f776372bfacfead5 100644 --- a/sflphone-common/libs/pjproject/pjlib-util/src/pjlib-util/resolver_wrap.cpp +++ b/sflphone-common/libs/pjproject/pjlib-util/src/pjlib-util/resolver_wrap.cpp @@ -1,5 +1,5 @@ /* $Id: resolver_wrap.cpp 2873 2009-08-13 11:54:35Z nanang $ */ -/* +/* * Copyright (C) 2009 Teluu Inc. (http://www.teluu.com) * * This program is free software; you can redistribute it and/or modify @@ -14,7 +14,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* diff --git a/sflphone-common/libs/pjproject/pjlib-util/src/pjlib-util/srv_resolver.c b/sflphone-common/libs/pjproject/pjlib-util/src/pjlib-util/srv_resolver.c index df15eb903318d0b0459962fb0678f8516bbd40b4..83963495574d53a1b9cfdaa596d02629eda89e1d 100644 --- a/sflphone-common/libs/pjproject/pjlib-util/src/pjlib-util/srv_resolver.c +++ b/sflphone-common/libs/pjproject/pjlib-util/src/pjlib-util/srv_resolver.c @@ -19,7 +19,6 @@ */ #include <pjlib-util/srv_resolver.h> #include <pjlib-util/errno.h> -#include <pj/addr_resolv.h> #include <pj/array.h> #include <pj/assert.h> #include <pj/log.h> @@ -584,53 +583,13 @@ static void dns_callback(void *user_data, } else if (status != PJ_SUCCESS) { char errmsg[PJ_ERR_MSG_SIZE]; - if ((query_job->option & - (PJ_DNS_SRV_FALLBACK_GETADDRINFO_IPV4 | PJ_DNS_SRV_FALLBACK_GETADDRINFO_IPV6))) - { - pj_strerror(status, errmsg, sizeof(errmsg)); - PJ_LOG(4,(query_job->objname, - "DNS A record resolution failed: %s," - " trying getaddrinfo()", - errmsg)); - - pj_addrinfo ai; - unsigned count; - int af; - - if ((query_job->option & PJ_DNS_SRV_FALLBACK_GETADDRINFO_IPV6)) { - af = pj_AF_INET6(); - } else { - af = pj_AF_INET(); - } - - count = 1; - status = pj_getaddrinfo(af, &query_job->domain_part, &count, &ai); - if (status != PJ_SUCCESS) { - query_job->last_error = status; - pj_strerror(status, errmsg, sizeof(errmsg)); - PJ_LOG(4,(query_job->objname, "DNS resolution failed with getaddrinfo(): %s", - errmsg)); - } else { - - if (srv->addr_cnt < ADDR_MAX_COUNT) { - srv->addr[srv->addr_cnt++].s_addr = ai.ai_addr.ipv4.sin_addr.s_addr; - } - - PJ_LOG(5,(query_job->objname, - "DNS getaddrinfo() for %.*s: %s", - (int)srv->target_name.slen, - srv->target_name.ptr, - pj_inet_ntoa(srv->addr[srv->addr_cnt]))); - } - } else { - /* Update last error */ - query_job->last_error = status; - - /* Log error */ - pj_strerror(status, errmsg, sizeof(errmsg)); - PJ_LOG(4,(query_job->objname, "DNS A record resolution failed: %s", - errmsg)); - } + /* Update last error */ + query_job->last_error = status; + + /* Log error */ + pj_strerror(status, errmsg, sizeof(errmsg)); + PJ_LOG(4,(query_job->objname, "DNS A record resolution failed: %s", + errmsg)); } ++query_job->host_resolved; diff --git a/sflphone-common/libs/pjproject/pjlib-util/src/pjlib-util/xml_wrap.cpp b/sflphone-common/libs/pjproject/pjlib-util/src/pjlib-util/xml_wrap.cpp index 66c9273931b692113d6cc3d48d0283cae24fdd29..b33e4d3cf145876a10313ff81af241f8e08a08cd 100644 --- a/sflphone-common/libs/pjproject/pjlib-util/src/pjlib-util/xml_wrap.cpp +++ b/sflphone-common/libs/pjproject/pjlib-util/src/pjlib-util/xml_wrap.cpp @@ -1,5 +1,5 @@ /* $Id: xml_wrap.cpp 2873 2009-08-13 11:54:35Z nanang $ */ -/* +/* * Copyright (C) 2009 Teluu Inc. (http://www.teluu.com) * * This program is free software; you can redistribute it and/or modify @@ -14,7 +14,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* diff --git a/sflphone-common/libs/pjproject/pjlib/build/Makefile b/sflphone-common/libs/pjproject/pjlib/build/Makefile index 5fed97cd5cc3c55bc366c82c9cab422b4796ec7a..a3482e005e59827a8303613daaaeae73bed60f47 100644 --- a/sflphone-common/libs/pjproject/pjlib/build/Makefile +++ b/sflphone-common/libs/pjproject/pjlib/build/Makefile @@ -4,7 +4,7 @@ include $(PJDIR)/build/common.mak RULES_MAK := $(PJDIR)/build/rules.mak -export PJLIB_LIB := ../lib/libpj-sfl-$(TARGET_NAME)$(LIBEXT) +export PJLIB_LIB := ../lib/libpj-$(TARGET_NAME)$(LIBEXT) ############################################################################### # Gather all flags. @@ -25,7 +25,8 @@ export PJLIB_OBJS += $(OS_OBJS) $(M_OBJS) $(CC_OBJS) $(HOST_OBJS) \ activesock.o array.o config.o ctype.o errno.o except.o fifobuf.o \ guid.o hash.o ip_helper_generic.o list.o lock.o log.o os_time_common.o \ pool.o pool_buf.o pool_caching.o pool_dbg.o rand.o \ - rbtree.o sock_common.o string.o timer.o types.o + rbtree.o sock_common.o sock_qos_common.o sock_qos_bsd.o \ + ssl_sock_common.o ssl_sock_ossl.o string.o timer.o types.o export PJLIB_CFLAGS += $(_CFLAGS) ############################################################################### @@ -36,7 +37,7 @@ export TEST_OBJS += activesock.o atomic.o echo_clt.o errno.o exception.o \ fifobuf.o file.o hash_test.o ioq_perf.o ioq_udp.o \ ioq_unreg.o ioq_tcp.o \ list.o mutex.o os.o pool.o pool_perf.o rand.o rbtree.o \ - select.o sleep.o sock.o sock_perf.o \ + select.o sleep.o sock.o sock_perf.o ssl_sock.o \ string.o test.o thread.o timer.o timestamp.o \ udp_echo_srv_sync.o udp_echo_srv_ioqueue.o \ util.o diff --git a/sflphone-common/libs/pjproject/pjlib/build/cacert.pem b/sflphone-common/libs/pjproject/pjlib/build/cacert.pem new file mode 100644 index 0000000000000000000000000000000000000000..0a2ee45bd6a3bbc342b001e88f11fcef37e9e6c6 --- /dev/null +++ b/sflphone-common/libs/pjproject/pjlib/build/cacert.pem @@ -0,0 +1,21 @@ +-----BEGIN CERTIFICATE----- +MIIDXzCCAkegAwIBAgIJAPqAwYU5OQLXMA0GCSqGSIb3DQEBBQUAMEYxCzAJBgNV +BAYTAkFVMRMwEQYDVQQIDApTb21lLVN0YXRlMQ4wDAYDVQQKDAVwanNpcDESMBAG +A1UEAwwJcGpzaXAubGFiMB4XDTA5MTAyMjE3MTczN1oXDTE5MTAyMDE3MTczN1ow +RjELMAkGA1UEBhMCQVUxEzARBgNVBAgMClNvbWUtU3RhdGUxDjAMBgNVBAoMBXBq +c2lwMRIwEAYDVQQDDAlwanNpcC5sYWIwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAw +ggEKAoIBAQDWWvnL+oSC0Q6OwGLt2YuhXTEzIVv3B+SGQ7tajB6H3WXVeq+1NmU9 +Yzca33g4FRrU7n4smYmKLzm1aniBhNmJjA+t+gbyizKnLMaCLoG52tUoULcANGKU +aGwlmvZFugDn2eVg6UfUfRzEGbV3q3a/PzSsOEPwsMeF3YMQJPhkoyPQLtWgUXgP +89Nyq3XjGGtw/qmUgQjE8a6/P0yXc+myI0hmApmZ9nB3YmlB5W3q6WoU2gGhLXf4 +12rH/LgdnPhM4ijS554Kv9EcUDdQTTrm6bYg66tj+qTet7DolUOlTZ3vKpuCK3tt +eK9CbNPVzsMsB3yCALSLzQ347pIwfLaJAgMBAAGjUDBOMB0GA1UdDgQWBBRE/VNp +kNQmLEXKQ+NM4bOVj95zYTAfBgNVHSMEGDAWgBRE/VNpkNQmLEXKQ+NM4bOVj95z +YTAMBgNVHRMEBTADAQH/MA0GCSqGSIb3DQEBBQUAA4IBAQCj/gzJKTOZDEBD+zr7 +lvbVctiYE9o8ObxZQsnl/6zI2V9H/2yc1sqQyjBupzw6c37ehvk30yIyUfD3ts87 +2xaJ5VgtgUI3FI5DQ+ASyQXmDawUEmXIGqHb2gDrXBQLd6uMpvNDNW+7TouuniyA +F12JUCNITeXaVJ0c8d4A9J9DlszBfYUzI45yIQu1gbpnpH74Sp/hG77EMxrRau+x +EFFmV7gAmkCgOBnXm8jTKqNre/GfLfO7w2xoLsubSLnK46U3iLGBIJJRVGu3UQuN +k1o7CiIKf0SSWj1bQI99ipTj8obBKRqj1nSbgKF/U6FIfd8DGcVvbJCSAG2czzyA +5tdA +-----END CERTIFICATE----- diff --git a/sflphone-common/libs/pjproject/pjlib/build/os-auto.mak b/sflphone-common/libs/pjproject/pjlib/build/os-auto.mak deleted file mode 100644 index fc6b33eb281a26cda527f76732eccd3b3fceada5..0000000000000000000000000000000000000000 --- a/sflphone-common/libs/pjproject/pjlib/build/os-auto.mak +++ /dev/null @@ -1,35 +0,0 @@ -# pjlib/build/os-auto.mak. Generated from os-auto.mak.in by configure. - -# Determine OS specific files -AC_OS_OBJS=ioqueue_select.o file_access_unistd.o file_io_ansi.o os_core_unix.o os_error_unix.o os_time_unix.o os_timestamp_posix.o guid_uuid.o - -# -# PJLIB_OBJS specified here are object files to be included in PJLIB -# (the library) for this specific operating system. Object files common -# to all operating systems should go in Makefile instead. -# -export PJLIB_OBJS += $(AC_OS_OBJS) \ - addr_resolv_sock.o \ - log_writer_stdout.o \ - os_timestamp_common.o \ - pool_policy_malloc.o sock_bsd.o sock_select.o - -# -# TEST_OBJS are operating system specific object files to be included in -# the test application. -# -export TEST_OBJS += main.o - -# -# Additional LDFLAGS for pjlib-test -# -export TEST_LDFLAGS += -lm -luuid -lnsl -lrt -lpthread -lasound -lssl -lcrypto - -# -# TARGETS are make targets in the Makefile, to be executed for this given -# operating system. -# -export TARGETS = pjlib pjlib-test - - - diff --git a/sflphone-common/libs/pjproject/pjlib/build/os-win32.mak b/sflphone-common/libs/pjproject/pjlib/build/os-win32.mak index b495bb212654b6c964552aeb4ad6d7aff8b8e720..0290fea955c5ed1c14c2a5c4d667bc0d9eadd9c5 100644 --- a/sflphone-common/libs/pjproject/pjlib/build/os-win32.mak +++ b/sflphone-common/libs/pjproject/pjlib/build/os-win32.mak @@ -13,8 +13,8 @@ export PJLIB_OBJS += addr_resolv_sock.o guid_win32.o \ os_timestamp_win32.o \ pool_policy_malloc.o sock_bsd.o sock_select.o -export PJLIB_OBJS += ioqueue_winnt.o -#export PJLIB_OBJS += ioqueue_select.o +#export PJLIB_OBJS += ioqueue_winnt.o +export PJLIB_OBJS += ioqueue_select.o export PJLIB_OBJS += file_io_win32.o file_access_win32.o #export PJLIB_OBJS += file_io_ansi.o diff --git a/sflphone-common/libs/pjproject/pjlib/build/pjlib.dsp b/sflphone-common/libs/pjproject/pjlib/build/pjlib.dsp index 39d800cd26c46c51f205605958e62d61ca26b567..6977f8a9324cff54f9fdbdf4352961221743ac01 100644 --- a/sflphone-common/libs/pjproject/pjlib/build/pjlib.dsp +++ b/sflphone-common/libs/pjproject/pjlib/build/pjlib.dsp @@ -240,28 +240,11 @@ SOURCE=..\src\pj\ioqueue_common_abs.h # Begin Source File SOURCE=..\src\pj\ioqueue_select.c - -!IF "$(CFG)" == "pjlib - Win32 Release" - -# PROP Exclude_From_Build 1 - -!ELSEIF "$(CFG)" == "pjlib - Win32 Debug" - -!ENDIF - # End Source File # Begin Source File SOURCE=..\src\pj\ioqueue_winnt.c - -!IF "$(CFG)" == "pjlib - Win32 Release" - -!ELSEIF "$(CFG)" == "pjlib - Win32 Debug" - # PROP Exclude_From_Build 1 - -!ENDIF - # End Source File # Begin Source File @@ -341,10 +324,26 @@ SOURCE=..\src\pj\sock_common.c # End Source File # Begin Source File +SOURCE=..\src\pj\sock_qos_bsd.c +# End Source File +# Begin Source File + +SOURCE=..\src\pj\sock_qos_common.c +# End Source File +# Begin Source File + SOURCE=..\src\pj\sock_select.c # End Source File # Begin Source File +SOURCE=..\src\pj\ssl_sock_common.c +# End Source File +# Begin Source File + +SOURCE=..\src\pj\ssl_sock_ossl.c +# End Source File +# Begin Source File + SOURCE=..\src\pj\string.c # End Source File # Begin Source File @@ -589,10 +588,18 @@ SOURCE=..\include\pj\sock.h # End Source File # Begin Source File +SOURCE=..\include\pj\sock_qos.h +# End Source File +# Begin Source File + SOURCE=..\include\pj\sock_select.h # End Source File # Begin Source File +SOURCE=..\include\pj\ssl_sock.h +# End Source File +# Begin Source File + SOURCE=..\include\pj\string.h # End Source File # Begin Source File diff --git a/sflphone-common/libs/pjproject/pjlib/build/pjlib.vcproj b/sflphone-common/libs/pjproject/pjlib/build/pjlib.vcproj index 2f0360398a7af945d7e3b701036370d475d5390a..d151dfbbf589a71a333a42ad443d62dd6f0c9ea6 100644 --- a/sflphone-common/libs/pjproject/pjlib/build/pjlib.vcproj +++ b/sflphone-common/libs/pjproject/pjlib/build/pjlib.vcproj @@ -34,11 +34,11 @@ <Configurations> <Configuration Name="Debug|Win32" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-win32-common-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="2" ConfigurationType="4" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-win32-common-defaults.vsprops" UseOfMFC="0" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="2" > <Tool Name="VCPreBuildEventTool" @@ -57,8 +57,8 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" AdditionalIncludeDirectories="../include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -91,10 +91,10 @@ </Configuration> <Configuration Name="Debug|Windows Mobile 6 Standard SDK (ARMV4I)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm6-common-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" ConfigurationType="4" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm6-common-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -113,9 +113,9 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" ExecutionBucket="7" AdditionalIncludeDirectories="../include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -129,7 +129,7 @@ /> <Tool Name="VCLibrarianTool" - OutputFile="..\lib\$(ProjectName)-$(TargetCPU)-wm6std-vc$(VSVer)-$(ConfigurationName).lib" + OutputFile="..\lib\$(ProjectName)-$(TargetCPU)-wm6std-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -157,10 +157,10 @@ </Configuration> <Configuration Name="Debug|Windows Mobile 6 Professional SDK (ARMV4I)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm6-common-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" ConfigurationType="4" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm6-common-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -179,9 +179,9 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" ExecutionBucket="7" AdditionalIncludeDirectories="../include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -195,7 +195,7 @@ /> <Tool Name="VCLibrarianTool" - OutputFile="..\lib\$(ProjectName)-$(TargetCPU)-wm6pro-vc$(VSVer)-$(ConfigurationName).lib" + OutputFile="..\lib\$(ProjectName)-$(TargetCPU)-wm6pro-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -222,12 +222,11 @@ /> </Configuration> <Configuration - Name="Release|Win32" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-win32-release-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="2" + Name="Debug|Pocket PC 2003 (ARMV4)" ConfigurationType="4" - UseOfMFC="0" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm2003-common-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -246,8 +245,9 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" + ExecutionBucket="7" AdditionalIncludeDirectories="../include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -261,6 +261,7 @@ /> <Tool Name="VCLibrarianTool" + OutputFile="..\lib\$(ProjectName)-$(TargetCPU)-wm2003ppc-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -272,18 +273,26 @@ Name="VCBscMakeTool" /> <Tool - Name="VCFxCopTool" + Name="VCCodeSignTool" /> <Tool Name="VCPostBuildEventTool" /> + <DeploymentTool + ForceDirty="-1" + RemoteDirectory="" + RegisterOutput="0" + AdditionalFiles="" + /> + <DebuggerTool + /> </Configuration> <Configuration - Name="Release|Windows Mobile 6 Standard SDK (ARMV4I)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm6-release-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Debug|Smartphone 2003 (ARMV4)" ConfigurationType="4" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm2003-common-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -302,9 +311,9 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" ExecutionBucket="7" AdditionalIncludeDirectories="../include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -318,7 +327,7 @@ /> <Tool Name="VCLibrarianTool" - OutputFile="..\lib\$(ProjectName)-$(TargetCPU)-wm6std-vc$(VSVer)-$(ConfigurationName).lib" + OutputFile="..\lib\$(ProjectName)-$(TargetCPU)-wm2003sp-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -345,11 +354,11 @@ /> </Configuration> <Configuration - Name="Release|Windows Mobile 6 Professional SDK (ARMV4I)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm6-release-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ConfigurationType="4" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm5-common-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -368,9 +377,9 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" ExecutionBucket="7" AdditionalIncludeDirectories="../include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -384,7 +393,7 @@ /> <Tool Name="VCLibrarianTool" - OutputFile="..\lib\$(ProjectName)-$(TargetCPU)-wm6pro-vc$(VSVer)-$(ConfigurationName).lib" + OutputFile="..\lib\$(ProjectName)-$(TargetCPU)-wm5ppc-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -411,12 +420,11 @@ /> </Configuration> <Configuration - Name="Debug-Static|Win32" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-win32-common-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="2" + Name="Debug|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ConfigurationType="4" - UseOfMFC="0" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm5-common-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -435,8 +443,9 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" + ExecutionBucket="7" AdditionalIncludeDirectories="../include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -450,6 +459,7 @@ /> <Tool Name="VCLibrarianTool" + OutputFile="..\lib\$(ProjectName)-$(TargetCPU)-wm5sp-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -461,18 +471,27 @@ Name="VCBscMakeTool" /> <Tool - Name="VCFxCopTool" + Name="VCCodeSignTool" /> <Tool Name="VCPostBuildEventTool" /> + <DeploymentTool + ForceDirty="-1" + RemoteDirectory="" + RegisterOutput="0" + AdditionalFiles="" + /> + <DebuggerTool + /> </Configuration> <Configuration - Name="Debug-Static|Windows Mobile 6 Standard SDK (ARMV4I)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm6-common-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Release|Win32" ConfigurationType="4" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-win32-release-defaults.vsprops" + UseOfMFC="0" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="2" > <Tool Name="VCPreBuildEventTool" @@ -491,9 +510,8 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" - ExecutionBucket="7" AdditionalIncludeDirectories="../include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -507,7 +525,6 @@ /> <Tool Name="VCLibrarianTool" - OutputFile="..\lib\$(ProjectName)-$(TargetCPU)-wm6std-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -519,26 +536,18 @@ Name="VCBscMakeTool" /> <Tool - Name="VCCodeSignTool" + Name="VCFxCopTool" /> <Tool Name="VCPostBuildEventTool" /> - <DeploymentTool - ForceDirty="-1" - RemoteDirectory="" - RegisterOutput="0" - AdditionalFiles="" - /> - <DebuggerTool - /> </Configuration> <Configuration - Name="Debug-Static|Windows Mobile 6 Professional SDK (ARMV4I)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm6-common-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Release|Windows Mobile 6 Standard SDK (ARMV4I)" ConfigurationType="4" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm6-release-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -557,9 +566,9 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" ExecutionBucket="7" AdditionalIncludeDirectories="../include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -573,7 +582,7 @@ /> <Tool Name="VCLibrarianTool" - OutputFile="..\lib\$(ProjectName)-$(TargetCPU)-wm6pro-vc$(VSVer)-$(ConfigurationName).lib" + OutputFile="..\lib\$(ProjectName)-$(TargetCPU)-wm6std-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -600,12 +609,11 @@ /> </Configuration> <Configuration - Name="Release-Dynamic|Win32" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-win32-release-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="2" + Name="Release|Windows Mobile 6 Professional SDK (ARMV4I)" ConfigurationType="4" - UseOfMFC="0" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm6-release-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -624,8 +632,9 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" + ExecutionBucket="7" AdditionalIncludeDirectories="../include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -639,6 +648,7 @@ /> <Tool Name="VCLibrarianTool" + OutputFile="..\lib\$(ProjectName)-$(TargetCPU)-wm6pro-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -650,18 +660,26 @@ Name="VCBscMakeTool" /> <Tool - Name="VCFxCopTool" + Name="VCCodeSignTool" /> <Tool Name="VCPostBuildEventTool" /> + <DeploymentTool + ForceDirty="-1" + RemoteDirectory="" + RegisterOutput="0" + AdditionalFiles="" + /> + <DebuggerTool + /> </Configuration> <Configuration - Name="Release-Dynamic|Windows Mobile 6 Standard SDK (ARMV4I)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm6-release-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Release|Pocket PC 2003 (ARMV4)" ConfigurationType="4" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm2003-release-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -680,9 +698,9 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" ExecutionBucket="7" AdditionalIncludeDirectories="../include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -696,7 +714,7 @@ /> <Tool Name="VCLibrarianTool" - OutputFile="..\lib\$(ProjectName)-$(TargetCPU)-wm6std-vc$(VSVer)-$(ConfigurationName).lib" + OutputFile="..\lib\$(ProjectName)-$(TargetCPU)-wm2003ppc-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -723,11 +741,11 @@ /> </Configuration> <Configuration - Name="Release-Dynamic|Windows Mobile 6 Professional SDK (ARMV4I)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm6-release-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Release|Smartphone 2003 (ARMV4)" ConfigurationType="4" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm2003-release-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -746,9 +764,9 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" ExecutionBucket="7" AdditionalIncludeDirectories="../include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -762,7 +780,7 @@ /> <Tool Name="VCLibrarianTool" - OutputFile="..\lib\$(ProjectName)-$(TargetCPU)-wm6pro-vc$(VSVer)-$(ConfigurationName).lib" + OutputFile="..\lib\$(ProjectName)-$(TargetCPU)-wm2003sp-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -789,12 +807,11 @@ /> </Configuration> <Configuration - Name="Debug-Dynamic|Win32" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-win32-common-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="2" + Name="Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ConfigurationType="4" - UseOfMFC="0" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm5-release-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -813,8 +830,9 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" + ExecutionBucket="7" AdditionalIncludeDirectories="../include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -828,6 +846,7 @@ /> <Tool Name="VCLibrarianTool" + OutputFile="..\lib\$(ProjectName)-$(TargetCPU)-wm5ppc-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -839,18 +858,26 @@ Name="VCBscMakeTool" /> <Tool - Name="VCFxCopTool" + Name="VCCodeSignTool" /> <Tool Name="VCPostBuildEventTool" /> + <DeploymentTool + ForceDirty="-1" + RemoteDirectory="" + RegisterOutput="0" + AdditionalFiles="" + /> + <DebuggerTool + /> </Configuration> <Configuration - Name="Debug-Dynamic|Windows Mobile 6 Standard SDK (ARMV4I)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm6-common-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Release|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ConfigurationType="4" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm5-release-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -869,9 +896,9 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" ExecutionBucket="7" AdditionalIncludeDirectories="../include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -885,7 +912,7 @@ /> <Tool Name="VCLibrarianTool" - OutputFile="..\lib\$(ProjectName)-$(TargetCPU)-wm6std-vc$(VSVer)-$(ConfigurationName).lib" + OutputFile="..\lib\$(ProjectName)-$(TargetCPU)-wm5sp-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -912,11 +939,12 @@ /> </Configuration> <Configuration - Name="Debug-Dynamic|Windows Mobile 6 Professional SDK (ARMV4I)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm6-common-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Debug-Static|Win32" ConfigurationType="4" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-win32-common-defaults.vsprops" + UseOfMFC="0" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="2" > <Tool Name="VCPreBuildEventTool" @@ -935,9 +963,8 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" - ExecutionBucket="7" AdditionalIncludeDirectories="../include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -951,7 +978,6 @@ /> <Tool Name="VCLibrarianTool" - OutputFile="..\lib\$(ProjectName)-$(TargetCPU)-wm6pro-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -963,27 +989,18 @@ Name="VCBscMakeTool" /> <Tool - Name="VCCodeSignTool" + Name="VCFxCopTool" /> <Tool Name="VCPostBuildEventTool" /> - <DeploymentTool - ForceDirty="-1" - RemoteDirectory="" - RegisterOutput="0" - AdditionalFiles="" - /> - <DebuggerTool - /> </Configuration> <Configuration - Name="Release-Static|Win32" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-win32-release-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="2" + Name="Debug-Static|Windows Mobile 6 Standard SDK (ARMV4I)" ConfigurationType="4" - UseOfMFC="0" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm6-common-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -1002,8 +1019,9 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" + ExecutionBucket="7" AdditionalIncludeDirectories="../include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -1017,6 +1035,7 @@ /> <Tool Name="VCLibrarianTool" + OutputFile="..\lib\$(ProjectName)-$(TargetCPU)-wm6std-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -1028,18 +1047,26 @@ Name="VCBscMakeTool" /> <Tool - Name="VCFxCopTool" + Name="VCCodeSignTool" /> <Tool Name="VCPostBuildEventTool" /> + <DeploymentTool + ForceDirty="-1" + RemoteDirectory="" + RegisterOutput="0" + AdditionalFiles="" + /> + <DebuggerTool + /> </Configuration> <Configuration - Name="Release-Static|Windows Mobile 6 Standard SDK (ARMV4I)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm6-release-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Debug-Static|Windows Mobile 6 Professional SDK (ARMV4I)" ConfigurationType="4" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm6-common-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -1058,9 +1085,9 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" ExecutionBucket="7" AdditionalIncludeDirectories="../include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -1074,7 +1101,7 @@ /> <Tool Name="VCLibrarianTool" - OutputFile="..\lib\$(ProjectName)-$(TargetCPU)-wm6std-vc$(VSVer)-$(ConfigurationName).lib" + OutputFile="..\lib\$(ProjectName)-$(TargetCPU)-wm6pro-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -1101,11 +1128,11 @@ /> </Configuration> <Configuration - Name="Release-Static|Windows Mobile 6 Professional SDK (ARMV4I)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm6-release-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Debug-Static|Pocket PC 2003 (ARMV4)" ConfigurationType="4" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm2003-common-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -1124,9 +1151,9 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" ExecutionBucket="7" AdditionalIncludeDirectories="../include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -1140,7 +1167,7 @@ /> <Tool Name="VCLibrarianTool" - OutputFile="..\lib\$(ProjectName)-$(TargetCPU)-wm6pro-vc$(VSVer)-$(ConfigurationName).lib" + OutputFile="..\lib\$(ProjectName)-$(TargetCPU)-wm2003ppc-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -1167,11 +1194,11 @@ /> </Configuration> <Configuration - Name="Debug|Pocket PC 2003 (ARMV4)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm2003-common-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Debug-Static|Smartphone 2003 (ARMV4)" ConfigurationType="4" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm2003-common-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -1190,9 +1217,9 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" ExecutionBucket="7" AdditionalIncludeDirectories="../include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -1206,7 +1233,7 @@ /> <Tool Name="VCLibrarianTool" - OutputFile="..\lib\$(ProjectName)-$(TargetCPU)-wm2003ppc-vc$(VSVer)-$(ConfigurationName).lib" + OutputFile="..\lib\$(ProjectName)-$(TargetCPU)-wm2003sp-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -1233,11 +1260,11 @@ /> </Configuration> <Configuration - Name="Release|Pocket PC 2003 (ARMV4)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm2003-release-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Debug-Static|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ConfigurationType="4" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm5-common-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -1256,9 +1283,9 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" ExecutionBucket="7" AdditionalIncludeDirectories="../include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -1272,7 +1299,7 @@ /> <Tool Name="VCLibrarianTool" - OutputFile="..\lib\$(ProjectName)-$(TargetCPU)-wm2003ppc-vc$(VSVer)-$(ConfigurationName).lib" + OutputFile="..\lib\$(ProjectName)-$(TargetCPU)-wm5ppc-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -1299,11 +1326,11 @@ /> </Configuration> <Configuration - Name="Debug-Static|Pocket PC 2003 (ARMV4)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm2003-common-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Debug-Static|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ConfigurationType="4" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm5-common-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -1322,9 +1349,9 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" ExecutionBucket="7" AdditionalIncludeDirectories="../include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -1338,7 +1365,7 @@ /> <Tool Name="VCLibrarianTool" - OutputFile="..\lib\$(ProjectName)-$(TargetCPU)-wm2003ppc-vc$(VSVer)-$(ConfigurationName).lib" + OutputFile="..\lib\$(ProjectName)-$(TargetCPU)-wm5sp-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -1365,11 +1392,12 @@ /> </Configuration> <Configuration - Name="Release-Dynamic|Pocket PC 2003 (ARMV4)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm2003-release-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Release-Dynamic|Win32" ConfigurationType="4" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-win32-release-defaults.vsprops" + UseOfMFC="0" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="2" > <Tool Name="VCPreBuildEventTool" @@ -1388,9 +1416,8 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" - ExecutionBucket="7" AdditionalIncludeDirectories="../include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -1404,7 +1431,6 @@ /> <Tool Name="VCLibrarianTool" - OutputFile="..\lib\$(ProjectName)-$(TargetCPU)-wm2003ppc-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -1416,26 +1442,18 @@ Name="VCBscMakeTool" /> <Tool - Name="VCCodeSignTool" + Name="VCFxCopTool" /> <Tool Name="VCPostBuildEventTool" /> - <DeploymentTool - ForceDirty="-1" - RemoteDirectory="" - RegisterOutput="0" - AdditionalFiles="" - /> - <DebuggerTool - /> </Configuration> <Configuration - Name="Debug-Dynamic|Pocket PC 2003 (ARMV4)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm2003-common-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Release-Dynamic|Windows Mobile 6 Standard SDK (ARMV4I)" ConfigurationType="4" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm6-release-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -1454,9 +1472,9 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" ExecutionBucket="7" AdditionalIncludeDirectories="../include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -1470,7 +1488,7 @@ /> <Tool Name="VCLibrarianTool" - OutputFile="..\lib\$(ProjectName)-$(TargetCPU)-wm2003ppc-vc$(VSVer)-$(ConfigurationName).lib" + OutputFile="..\lib\$(ProjectName)-$(TargetCPU)-wm6std-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -1497,11 +1515,11 @@ /> </Configuration> <Configuration - Name="Release-Static|Pocket PC 2003 (ARMV4)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm2003-release-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Release-Dynamic|Windows Mobile 6 Professional SDK (ARMV4I)" ConfigurationType="4" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm6-release-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -1520,9 +1538,9 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" ExecutionBucket="7" AdditionalIncludeDirectories="../include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -1536,7 +1554,7 @@ /> <Tool Name="VCLibrarianTool" - OutputFile="..\lib\$(ProjectName)-$(TargetCPU)-wm2003ppc-vc$(VSVer)-$(ConfigurationName).lib" + OutputFile="..\lib\$(ProjectName)-$(TargetCPU)-wm6pro-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -1563,11 +1581,11 @@ /> </Configuration> <Configuration - Name="Debug|Smartphone 2003 (ARMV4)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm2003-common-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Release-Dynamic|Pocket PC 2003 (ARMV4)" ConfigurationType="4" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm2003-release-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -1586,9 +1604,9 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" ExecutionBucket="7" AdditionalIncludeDirectories="../include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -1602,7 +1620,7 @@ /> <Tool Name="VCLibrarianTool" - OutputFile="..\lib\$(ProjectName)-$(TargetCPU)-wm2003sp-vc$(VSVer)-$(ConfigurationName).lib" + OutputFile="..\lib\$(ProjectName)-$(TargetCPU)-wm2003ppc-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -1629,11 +1647,11 @@ /> </Configuration> <Configuration - Name="Release|Smartphone 2003 (ARMV4)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm2003-release-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Release-Dynamic|Smartphone 2003 (ARMV4)" ConfigurationType="4" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm2003-release-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -1652,9 +1670,9 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" ExecutionBucket="7" AdditionalIncludeDirectories="../include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -1668,7 +1686,7 @@ /> <Tool Name="VCLibrarianTool" - OutputFile="..\lib\$(ProjectName)-$(TargetCPU)-wm2003sp-vc$(VSVer)-$(ConfigurationName).lib" + OutputFile="..\lib\$(ProjectName)-$(TargetCPU)-wm2003sp-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -1695,11 +1713,11 @@ /> </Configuration> <Configuration - Name="Debug-Static|Smartphone 2003 (ARMV4)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm2003-common-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Release-Dynamic|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ConfigurationType="4" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm5-release-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -1718,9 +1736,9 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" ExecutionBucket="7" AdditionalIncludeDirectories="../include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -1734,7 +1752,7 @@ /> <Tool Name="VCLibrarianTool" - OutputFile="..\lib\$(ProjectName)-$(TargetCPU)-wm2003sp-vc$(VSVer)-$(ConfigurationName).lib" + OutputFile="..\lib\$(ProjectName)-$(TargetCPU)-wm5ppc-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -1761,11 +1779,11 @@ /> </Configuration> <Configuration - Name="Release-Dynamic|Smartphone 2003 (ARMV4)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm2003-release-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Release-Dynamic|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ConfigurationType="4" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm5-release-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -1784,9 +1802,9 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" ExecutionBucket="7" AdditionalIncludeDirectories="../include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -1800,7 +1818,7 @@ /> <Tool Name="VCLibrarianTool" - OutputFile="..\lib\$(ProjectName)-$(TargetCPU)-wm2003sp-vc$(VSVer)-$(ConfigurationName).lib" + OutputFile="..\lib\$(ProjectName)-$(TargetCPU)-wm5sp-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -1827,11 +1845,12 @@ /> </Configuration> <Configuration - Name="Debug-Dynamic|Smartphone 2003 (ARMV4)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm2003-common-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Debug-Dynamic|Win32" ConfigurationType="4" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-win32-common-defaults.vsprops" + UseOfMFC="0" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="2" > <Tool Name="VCPreBuildEventTool" @@ -1850,9 +1869,8 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" - ExecutionBucket="7" AdditionalIncludeDirectories="../include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -1866,7 +1884,6 @@ /> <Tool Name="VCLibrarianTool" - OutputFile="..\lib\$(ProjectName)-$(TargetCPU)-wm2003sp-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -1878,26 +1895,18 @@ Name="VCBscMakeTool" /> <Tool - Name="VCCodeSignTool" + Name="VCFxCopTool" /> <Tool Name="VCPostBuildEventTool" /> - <DeploymentTool - ForceDirty="-1" - RemoteDirectory="" - RegisterOutput="0" - AdditionalFiles="" - /> - <DebuggerTool - /> </Configuration> <Configuration - Name="Release-Static|Smartphone 2003 (ARMV4)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm2003-release-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Debug-Dynamic|Windows Mobile 6 Standard SDK (ARMV4I)" ConfigurationType="4" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm6-common-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -1916,9 +1925,9 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" ExecutionBucket="7" AdditionalIncludeDirectories="../include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -1932,7 +1941,7 @@ /> <Tool Name="VCLibrarianTool" - OutputFile="..\lib\$(ProjectName)-$(TargetCPU)-wm2003sp-vc$(VSVer)-$(ConfigurationName).lib" + OutputFile="..\lib\$(ProjectName)-$(TargetCPU)-wm6std-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -1959,11 +1968,11 @@ /> </Configuration> <Configuration - Name="Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm5-common-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Debug-Dynamic|Windows Mobile 6 Professional SDK (ARMV4I)" ConfigurationType="4" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm6-common-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -1982,9 +1991,9 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" ExecutionBucket="7" AdditionalIncludeDirectories="../include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -1998,7 +2007,7 @@ /> <Tool Name="VCLibrarianTool" - OutputFile="..\lib\$(ProjectName)-$(TargetCPU)-wm5ppc-vc$(VSVer)-$(ConfigurationName).lib" + OutputFile="..\lib\$(ProjectName)-$(TargetCPU)-wm6pro-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -2025,11 +2034,11 @@ /> </Configuration> <Configuration - Name="Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm5-release-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Debug-Dynamic|Pocket PC 2003 (ARMV4)" ConfigurationType="4" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm2003-common-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -2048,9 +2057,9 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" ExecutionBucket="7" AdditionalIncludeDirectories="../include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -2064,7 +2073,7 @@ /> <Tool Name="VCLibrarianTool" - OutputFile="..\lib\$(ProjectName)-$(TargetCPU)-wm5ppc-vc$(VSVer)-$(ConfigurationName).lib" + OutputFile="..\lib\$(ProjectName)-$(TargetCPU)-wm2003ppc-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -2091,11 +2100,11 @@ /> </Configuration> <Configuration - Name="Debug-Static|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm5-common-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Debug-Dynamic|Smartphone 2003 (ARMV4)" ConfigurationType="4" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm2003-common-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -2114,9 +2123,9 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" ExecutionBucket="7" AdditionalIncludeDirectories="../include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -2130,7 +2139,7 @@ /> <Tool Name="VCLibrarianTool" - OutputFile="..\lib\$(ProjectName)-$(TargetCPU)-wm5ppc-vc$(VSVer)-$(ConfigurationName).lib" + OutputFile="..\lib\$(ProjectName)-$(TargetCPU)-wm2003sp-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -2157,11 +2166,11 @@ /> </Configuration> <Configuration - Name="Release-Dynamic|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm5-release-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Debug-Dynamic|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ConfigurationType="4" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm5-common-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -2180,9 +2189,9 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" ExecutionBucket="7" AdditionalIncludeDirectories="../include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -2196,7 +2205,7 @@ /> <Tool Name="VCLibrarianTool" - OutputFile="..\lib\$(ProjectName)-$(TargetCPU)-wm5ppc-vc$(VSVer)-$(ConfigurationName).lib" + OutputFile="..\lib\$(ProjectName)-$(TargetCPU)-wm5ppc-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -2223,11 +2232,11 @@ /> </Configuration> <Configuration - Name="Debug-Dynamic|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm5-common-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Debug-Dynamic|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ConfigurationType="4" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm5-common-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -2246,9 +2255,9 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" ExecutionBucket="7" AdditionalIncludeDirectories="../include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -2262,7 +2271,7 @@ /> <Tool Name="VCLibrarianTool" - OutputFile="..\lib\$(ProjectName)-$(TargetCPU)-wm5ppc-vc$(VSVer)-$(ConfigurationName).lib" + OutputFile="..\lib\$(ProjectName)-$(TargetCPU)-wm5sp-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -2289,11 +2298,12 @@ /> </Configuration> <Configuration - Name="Release-Static|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm5-release-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Release-Static|Win32" ConfigurationType="4" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-win32-release-defaults.vsprops" + UseOfMFC="0" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="2" > <Tool Name="VCPreBuildEventTool" @@ -2312,9 +2322,8 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" - ExecutionBucket="7" AdditionalIncludeDirectories="../include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -2328,7 +2337,6 @@ /> <Tool Name="VCLibrarianTool" - OutputFile="..\lib\$(ProjectName)-$(TargetCPU)-wm5ppc-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -2340,26 +2348,18 @@ Name="VCBscMakeTool" /> <Tool - Name="VCCodeSignTool" + Name="VCFxCopTool" /> <Tool Name="VCPostBuildEventTool" /> - <DeploymentTool - ForceDirty="-1" - RemoteDirectory="" - RegisterOutput="0" - AdditionalFiles="" - /> - <DebuggerTool - /> </Configuration> <Configuration - Name="Debug|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm5-common-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Release-Static|Windows Mobile 6 Standard SDK (ARMV4I)" ConfigurationType="4" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm6-release-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -2378,9 +2378,9 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" ExecutionBucket="7" AdditionalIncludeDirectories="../include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -2394,7 +2394,7 @@ /> <Tool Name="VCLibrarianTool" - OutputFile="..\lib\$(ProjectName)-$(TargetCPU)-wm5sp-vc$(VSVer)-$(ConfigurationName).lib" + OutputFile="..\lib\$(ProjectName)-$(TargetCPU)-wm6std-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -2421,11 +2421,11 @@ /> </Configuration> <Configuration - Name="Release|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm5-release-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Release-Static|Windows Mobile 6 Professional SDK (ARMV4I)" ConfigurationType="4" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm6-release-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -2444,9 +2444,9 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" ExecutionBucket="7" AdditionalIncludeDirectories="../include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -2460,7 +2460,7 @@ /> <Tool Name="VCLibrarianTool" - OutputFile="..\lib\$(ProjectName)-$(TargetCPU)-wm5sp-vc$(VSVer)-$(ConfigurationName).lib" + OutputFile="..\lib\$(ProjectName)-$(TargetCPU)-wm6pro-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -2487,11 +2487,11 @@ /> </Configuration> <Configuration - Name="Debug-Static|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm5-common-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Release-Static|Pocket PC 2003 (ARMV4)" ConfigurationType="4" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm2003-release-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -2510,9 +2510,9 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" ExecutionBucket="7" AdditionalIncludeDirectories="../include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -2526,7 +2526,7 @@ /> <Tool Name="VCLibrarianTool" - OutputFile="..\lib\$(ProjectName)-$(TargetCPU)-wm5sp-vc$(VSVer)-$(ConfigurationName).lib" + OutputFile="..\lib\$(ProjectName)-$(TargetCPU)-wm2003ppc-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -2553,11 +2553,11 @@ /> </Configuration> <Configuration - Name="Release-Dynamic|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm5-release-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Release-Static|Smartphone 2003 (ARMV4)" ConfigurationType="4" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm2003-release-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -2576,9 +2576,9 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" ExecutionBucket="7" AdditionalIncludeDirectories="../include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -2592,7 +2592,7 @@ /> <Tool Name="VCLibrarianTool" - OutputFile="..\lib\$(ProjectName)-$(TargetCPU)-wm5sp-vc$(VSVer)-$(ConfigurationName).lib" + OutputFile="..\lib\$(ProjectName)-$(TargetCPU)-wm2003sp-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -2619,11 +2619,11 @@ /> </Configuration> <Configuration - Name="Debug-Dynamic|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm5-common-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Release-Static|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ConfigurationType="4" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm5-release-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -2642,9 +2642,9 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" ExecutionBucket="7" AdditionalIncludeDirectories="../include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -2658,7 +2658,7 @@ /> <Tool Name="VCLibrarianTool" - OutputFile="..\lib\$(ProjectName)-$(TargetCPU)-wm5sp-vc$(VSVer)-$(ConfigurationName).lib" + OutputFile="..\lib\$(ProjectName)-$(TargetCPU)-wm5ppc-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -2686,10 +2686,10 @@ </Configuration> <Configuration Name="Release-Static|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm5-release-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" ConfigurationType="4" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm5-release-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -2708,9 +2708,9 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" ExecutionBucket="7" AdditionalIncludeDirectories="../include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -2724,7 +2724,7 @@ /> <Tool Name="VCLibrarianTool" - OutputFile="..\lib\$(ProjectName)-$(TargetCPU)-wm5sp-vc$(VSVer)-$(ConfigurationName).lib" + OutputFile="..\lib\$(ProjectName)-$(TargetCPU)-wm5sp-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -3256,17 +3256,15 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Win32" + Name="Debug|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Release|Windows Mobile 6 Standard SDK (ARMV4I)" + Name="Debug|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -3274,7 +3272,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Windows Mobile 6 Professional SDK (ARMV4I)" + Name="Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -3282,25 +3280,25 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Win32" + Name="Debug|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Windows Mobile 6 Standard SDK (ARMV4I)" + Name="Release|Win32" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Windows Mobile 6 Professional SDK (ARMV4I)" + Name="Release|Windows Mobile 6 Standard SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -3308,17 +3306,15 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Win32" + Name="Release|Windows Mobile 6 Professional SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Windows Mobile 6 Standard SDK (ARMV4I)" + Name="Release|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -3326,7 +3322,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Windows Mobile 6 Professional SDK (ARMV4I)" + Name="Release|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -3334,17 +3330,15 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Win32" + Name="Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Windows Mobile 6 Standard SDK (ARMV4I)" + Name="Release|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -3352,25 +3346,25 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Windows Mobile 6 Professional SDK (ARMV4I)" + Name="Debug-Static|Win32" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Win32" + Name="Debug-Static|Windows Mobile 6 Standard SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Windows Mobile 6 Standard SDK (ARMV4I)" + Name="Debug-Static|Windows Mobile 6 Professional SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -3378,7 +3372,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Windows Mobile 6 Professional SDK (ARMV4I)" + Name="Debug-Static|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -3386,7 +3380,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug|Pocket PC 2003 (ARMV4)" + Name="Debug-Static|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -3394,7 +3388,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Pocket PC 2003 (ARMV4)" + Name="Debug-Static|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -3402,7 +3396,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Pocket PC 2003 (ARMV4)" + Name="Debug-Static|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -3410,15 +3404,17 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Pocket PC 2003 (ARMV4)" + Name="Release-Dynamic|Win32" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Pocket PC 2003 (ARMV4)" + Name="Release-Dynamic|Windows Mobile 6 Standard SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -3426,7 +3422,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Pocket PC 2003 (ARMV4)" + Name="Release-Dynamic|Windows Mobile 6 Professional SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -3434,7 +3430,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug|Smartphone 2003 (ARMV4)" + Name="Release-Dynamic|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -3442,7 +3438,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Smartphone 2003 (ARMV4)" + Name="Release-Dynamic|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -3450,7 +3446,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Smartphone 2003 (ARMV4)" + Name="Release-Dynamic|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -3458,7 +3454,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Smartphone 2003 (ARMV4)" + Name="Release-Dynamic|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -3466,15 +3462,17 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Smartphone 2003 (ARMV4)" + Name="Debug-Dynamic|Win32" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Smartphone 2003 (ARMV4)" + Name="Debug-Dynamic|Windows Mobile 6 Standard SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -3482,7 +3480,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Debug-Dynamic|Windows Mobile 6 Professional SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -3490,7 +3488,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Debug-Dynamic|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -3498,7 +3496,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Debug-Dynamic|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -3506,7 +3504,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Debug-Dynamic|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -3514,7 +3512,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Debug-Dynamic|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -3522,15 +3520,17 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Release-Static|Win32" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Debug|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" + Name="Release-Static|Windows Mobile 6 Standard SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -3538,7 +3538,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" + Name="Release-Static|Windows Mobile 6 Professional SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -3546,7 +3546,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" + Name="Release-Static|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -3554,7 +3554,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" + Name="Release-Static|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -3562,7 +3562,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" + Name="Release-Static|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -3840,17 +3840,15 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Win32" + Name="Debug|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Release|Windows Mobile 6 Standard SDK (ARMV4I)" + Name="Debug|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -3858,7 +3856,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Windows Mobile 6 Professional SDK (ARMV4I)" + Name="Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -3866,25 +3864,25 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Win32" + Name="Debug|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Windows Mobile 6 Standard SDK (ARMV4I)" + Name="Release|Win32" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Windows Mobile 6 Professional SDK (ARMV4I)" + Name="Release|Windows Mobile 6 Standard SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -3892,17 +3890,15 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Win32" + Name="Release|Windows Mobile 6 Professional SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Windows Mobile 6 Standard SDK (ARMV4I)" + Name="Release|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -3910,7 +3906,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Windows Mobile 6 Professional SDK (ARMV4I)" + Name="Release|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -3918,17 +3914,15 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Win32" + Name="Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Windows Mobile 6 Standard SDK (ARMV4I)" + Name="Release|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -3936,25 +3930,25 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Windows Mobile 6 Professional SDK (ARMV4I)" + Name="Debug-Static|Win32" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Win32" + Name="Debug-Static|Windows Mobile 6 Standard SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Windows Mobile 6 Standard SDK (ARMV4I)" + Name="Debug-Static|Windows Mobile 6 Professional SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -3962,7 +3956,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Windows Mobile 6 Professional SDK (ARMV4I)" + Name="Debug-Static|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -3970,7 +3964,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug|Pocket PC 2003 (ARMV4)" + Name="Debug-Static|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -3978,7 +3972,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Pocket PC 2003 (ARMV4)" + Name="Debug-Static|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -3986,7 +3980,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Pocket PC 2003 (ARMV4)" + Name="Debug-Static|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -3994,15 +3988,17 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Pocket PC 2003 (ARMV4)" + Name="Release-Dynamic|Win32" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Pocket PC 2003 (ARMV4)" + Name="Release-Dynamic|Windows Mobile 6 Standard SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -4010,7 +4006,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Pocket PC 2003 (ARMV4)" + Name="Release-Dynamic|Windows Mobile 6 Professional SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -4018,7 +4014,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug|Smartphone 2003 (ARMV4)" + Name="Release-Dynamic|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -4026,7 +4022,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Smartphone 2003 (ARMV4)" + Name="Release-Dynamic|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -4034,7 +4030,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Smartphone 2003 (ARMV4)" + Name="Release-Dynamic|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -4042,7 +4038,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Smartphone 2003 (ARMV4)" + Name="Release-Dynamic|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -4050,15 +4046,17 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Smartphone 2003 (ARMV4)" + Name="Debug-Dynamic|Win32" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Smartphone 2003 (ARMV4)" + Name="Debug-Dynamic|Windows Mobile 6 Standard SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -4066,7 +4064,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Debug-Dynamic|Windows Mobile 6 Professional SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -4074,7 +4072,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Debug-Dynamic|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -4082,7 +4080,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Debug-Dynamic|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -4090,7 +4088,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Debug-Dynamic|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -4098,7 +4096,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Debug-Dynamic|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -4106,15 +4104,17 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Release-Static|Win32" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Debug|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" + Name="Release-Static|Windows Mobile 6 Standard SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -4122,7 +4122,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" + Name="Release-Static|Windows Mobile 6 Professional SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -4130,7 +4130,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" + Name="Release-Static|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -4138,7 +4138,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" + Name="Release-Static|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -4146,7 +4146,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" + Name="Release-Static|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -4180,7 +4180,6 @@ </FileConfiguration> <FileConfiguration Name="Release|Win32" - ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" @@ -4199,7 +4198,6 @@ </FileConfiguration> <FileConfiguration Name="Release-Dynamic|Win32" - ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" @@ -4218,7 +4216,6 @@ </FileConfiguration> <FileConfiguration Name="Release-Static|Win32" - ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" @@ -4257,16 +4254,15 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Win32" + Name="Debug|Pocket PC 2003 (ARMV4)" + ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Release|Windows Mobile 6 Standard SDK (ARMV4I)" + Name="Debug|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -4274,7 +4270,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Windows Mobile 6 Professional SDK (ARMV4I)" + Name="Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -4282,25 +4278,25 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Win32" + Name="Debug|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Windows Mobile 6 Standard SDK (ARMV4I)" + Name="Release|Win32" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Windows Mobile 6 Professional SDK (ARMV4I)" + Name="Release|Windows Mobile 6 Standard SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -4308,16 +4304,15 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Win32" + Name="Release|Windows Mobile 6 Professional SDK (ARMV4I)" + ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Windows Mobile 6 Standard SDK (ARMV4I)" + Name="Release|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -4325,7 +4320,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Windows Mobile 6 Professional SDK (ARMV4I)" + Name="Release|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -4333,17 +4328,15 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Win32" + Name="Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Windows Mobile 6 Standard SDK (ARMV4I)" + Name="Release|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -4351,24 +4344,25 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Windows Mobile 6 Professional SDK (ARMV4I)" + Name="Debug-Static|Win32" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Win32" + Name="Debug-Static|Windows Mobile 6 Standard SDK (ARMV4I)" + ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Windows Mobile 6 Standard SDK (ARMV4I)" + Name="Debug-Static|Windows Mobile 6 Professional SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -4376,7 +4370,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Windows Mobile 6 Professional SDK (ARMV4I)" + Name="Debug-Static|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -4384,7 +4378,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug|Pocket PC 2003 (ARMV4)" + Name="Debug-Static|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -4392,7 +4386,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Pocket PC 2003 (ARMV4)" + Name="Debug-Static|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -4400,7 +4394,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Pocket PC 2003 (ARMV4)" + Name="Debug-Static|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -4408,15 +4402,17 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Pocket PC 2003 (ARMV4)" + Name="Release-Dynamic|Win32" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Pocket PC 2003 (ARMV4)" + Name="Release-Dynamic|Windows Mobile 6 Standard SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -4424,7 +4420,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Pocket PC 2003 (ARMV4)" + Name="Release-Dynamic|Windows Mobile 6 Professional SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -4432,7 +4428,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug|Smartphone 2003 (ARMV4)" + Name="Release-Dynamic|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -4440,7 +4436,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Smartphone 2003 (ARMV4)" + Name="Release-Dynamic|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -4448,7 +4444,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Smartphone 2003 (ARMV4)" + Name="Release-Dynamic|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -4456,7 +4452,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Smartphone 2003 (ARMV4)" + Name="Release-Dynamic|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -4464,15 +4460,17 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Smartphone 2003 (ARMV4)" + Name="Debug-Dynamic|Win32" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Smartphone 2003 (ARMV4)" + Name="Debug-Dynamic|Windows Mobile 6 Standard SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -4480,7 +4478,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Debug-Dynamic|Windows Mobile 6 Professional SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -4488,7 +4486,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Debug-Dynamic|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -4496,7 +4494,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Debug-Dynamic|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -4504,7 +4502,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Debug-Dynamic|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -4512,7 +4510,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Debug-Dynamic|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -4520,15 +4518,17 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Release-Static|Win32" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Debug|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" + Name="Release-Static|Windows Mobile 6 Standard SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -4536,7 +4536,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" + Name="Release-Static|Windows Mobile 6 Professional SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -4544,7 +4544,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" + Name="Release-Static|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -4552,7 +4552,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" + Name="Release-Static|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -4560,7 +4560,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" + Name="Release-Static|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -5570,6 +5570,22 @@ RelativePath="..\src\pj\sock_common.c" > </File> + <File + RelativePath="..\src\pj\sock_qos_bsd.c" + > + </File> + <File + RelativePath="..\src\pj\sock_qos_common.c" + > + </File> + <File + RelativePath="..\src\pj\sock_qos_dummy.c" + > + </File> + <File + RelativePath="..\src\pj\sock_qos_wm.c" + > + </File> <File RelativePath="..\src\pj\sock_select.c" > @@ -5628,6 +5644,14 @@ /> </FileConfiguration> </File> + <File + RelativePath="..\src\pj\ssl_sock_common.c" + > + </File> + <File + RelativePath="..\src\pj\ssl_sock_ossl.c" + > + </File> <File RelativePath="..\src\pj\string.c" > @@ -5893,17 +5917,15 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Win32" + Name="Debug|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Release|Windows Mobile 6 Standard SDK (ARMV4I)" + Name="Debug|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -5911,7 +5933,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Windows Mobile 6 Professional SDK (ARMV4I)" + Name="Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -5919,25 +5941,25 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Win32" + Name="Debug|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Windows Mobile 6 Standard SDK (ARMV4I)" + Name="Release|Win32" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Windows Mobile 6 Professional SDK (ARMV4I)" + Name="Release|Windows Mobile 6 Standard SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -5945,17 +5967,15 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Win32" + Name="Release|Windows Mobile 6 Professional SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Windows Mobile 6 Standard SDK (ARMV4I)" + Name="Release|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -5963,7 +5983,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Windows Mobile 6 Professional SDK (ARMV4I)" + Name="Release|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -5971,17 +5991,15 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Win32" + Name="Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Windows Mobile 6 Standard SDK (ARMV4I)" + Name="Release|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -5989,25 +6007,25 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Windows Mobile 6 Professional SDK (ARMV4I)" + Name="Debug-Static|Win32" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Win32" + Name="Debug-Static|Windows Mobile 6 Standard SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Windows Mobile 6 Standard SDK (ARMV4I)" + Name="Debug-Static|Windows Mobile 6 Professional SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -6015,7 +6033,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Windows Mobile 6 Professional SDK (ARMV4I)" + Name="Debug-Static|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -6023,7 +6041,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug|Pocket PC 2003 (ARMV4)" + Name="Debug-Static|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -6031,7 +6049,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Pocket PC 2003 (ARMV4)" + Name="Debug-Static|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -6039,7 +6057,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Pocket PC 2003 (ARMV4)" + Name="Debug-Static|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -6047,15 +6065,17 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Pocket PC 2003 (ARMV4)" + Name="Release-Dynamic|Win32" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Pocket PC 2003 (ARMV4)" + Name="Release-Dynamic|Windows Mobile 6 Standard SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -6063,7 +6083,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Pocket PC 2003 (ARMV4)" + Name="Release-Dynamic|Windows Mobile 6 Professional SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -6071,7 +6091,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug|Smartphone 2003 (ARMV4)" + Name="Release-Dynamic|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -6079,7 +6099,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Smartphone 2003 (ARMV4)" + Name="Release-Dynamic|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -6087,7 +6107,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Smartphone 2003 (ARMV4)" + Name="Release-Dynamic|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -6095,7 +6115,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Smartphone 2003 (ARMV4)" + Name="Release-Dynamic|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -6103,15 +6123,17 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Smartphone 2003 (ARMV4)" + Name="Debug-Dynamic|Win32" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Smartphone 2003 (ARMV4)" + Name="Debug-Dynamic|Windows Mobile 6 Standard SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -6119,7 +6141,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Debug-Dynamic|Windows Mobile 6 Professional SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -6127,7 +6149,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Debug-Dynamic|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -6135,7 +6157,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Debug-Dynamic|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -6143,7 +6165,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Debug-Dynamic|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -6151,7 +6173,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Debug-Dynamic|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -6159,15 +6181,17 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Release-Static|Win32" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Debug|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" + Name="Release-Static|Windows Mobile 6 Standard SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -6175,7 +6199,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" + Name="Release-Static|Windows Mobile 6 Professional SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -6183,7 +6207,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" + Name="Release-Static|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -6191,7 +6215,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" + Name="Release-Static|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -6199,7 +6223,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" + Name="Release-Static|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -6245,17 +6269,15 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Win32" + Name="Debug|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Release|Windows Mobile 6 Standard SDK (ARMV4I)" + Name="Debug|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -6263,7 +6285,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Windows Mobile 6 Professional SDK (ARMV4I)" + Name="Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -6271,25 +6293,25 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Win32" + Name="Debug|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Windows Mobile 6 Standard SDK (ARMV4I)" + Name="Release|Win32" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Windows Mobile 6 Professional SDK (ARMV4I)" + Name="Release|Windows Mobile 6 Standard SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -6297,17 +6319,15 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Win32" + Name="Release|Windows Mobile 6 Professional SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Windows Mobile 6 Standard SDK (ARMV4I)" + Name="Release|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -6315,7 +6335,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Windows Mobile 6 Professional SDK (ARMV4I)" + Name="Release|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -6323,17 +6343,15 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Win32" + Name="Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Windows Mobile 6 Standard SDK (ARMV4I)" + Name="Release|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -6341,25 +6359,25 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Windows Mobile 6 Professional SDK (ARMV4I)" + Name="Debug-Static|Win32" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Win32" + Name="Debug-Static|Windows Mobile 6 Standard SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Windows Mobile 6 Standard SDK (ARMV4I)" + Name="Debug-Static|Windows Mobile 6 Professional SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -6367,7 +6385,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Windows Mobile 6 Professional SDK (ARMV4I)" + Name="Debug-Static|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -6375,7 +6393,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug|Pocket PC 2003 (ARMV4)" + Name="Debug-Static|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -6383,7 +6401,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Pocket PC 2003 (ARMV4)" + Name="Debug-Static|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -6391,7 +6409,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Pocket PC 2003 (ARMV4)" + Name="Debug-Static|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -6399,15 +6417,17 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Pocket PC 2003 (ARMV4)" + Name="Release-Dynamic|Win32" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Pocket PC 2003 (ARMV4)" + Name="Release-Dynamic|Windows Mobile 6 Standard SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -6415,7 +6435,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Pocket PC 2003 (ARMV4)" + Name="Release-Dynamic|Windows Mobile 6 Professional SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -6423,7 +6443,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug|Smartphone 2003 (ARMV4)" + Name="Release-Dynamic|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -6431,7 +6451,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Smartphone 2003 (ARMV4)" + Name="Release-Dynamic|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -6439,7 +6459,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Smartphone 2003 (ARMV4)" + Name="Release-Dynamic|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -6447,7 +6467,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Smartphone 2003 (ARMV4)" + Name="Release-Dynamic|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -6455,15 +6475,17 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Smartphone 2003 (ARMV4)" + Name="Debug-Dynamic|Win32" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Smartphone 2003 (ARMV4)" + Name="Debug-Dynamic|Windows Mobile 6 Standard SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -6471,7 +6493,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Debug-Dynamic|Windows Mobile 6 Professional SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -6479,7 +6501,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Debug-Dynamic|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -6487,7 +6509,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Debug-Dynamic|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -6495,7 +6517,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Debug-Dynamic|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -6503,7 +6525,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Debug-Dynamic|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -6511,15 +6533,17 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Release-Static|Win32" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Debug|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" + Name="Release-Static|Windows Mobile 6 Standard SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -6527,7 +6551,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" + Name="Release-Static|Windows Mobile 6 Professional SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -6535,7 +6559,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" + Name="Release-Static|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -6543,7 +6567,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" + Name="Release-Static|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -6551,7 +6575,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" + Name="Release-Static|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -6597,17 +6621,15 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Win32" + Name="Debug|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Release|Windows Mobile 6 Standard SDK (ARMV4I)" + Name="Debug|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -6615,7 +6637,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Windows Mobile 6 Professional SDK (ARMV4I)" + Name="Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -6623,25 +6645,25 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Win32" + Name="Debug|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Windows Mobile 6 Standard SDK (ARMV4I)" + Name="Release|Win32" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Windows Mobile 6 Professional SDK (ARMV4I)" + Name="Release|Windows Mobile 6 Standard SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -6649,17 +6671,15 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Win32" + Name="Release|Windows Mobile 6 Professional SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Windows Mobile 6 Standard SDK (ARMV4I)" + Name="Release|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -6667,7 +6687,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Windows Mobile 6 Professional SDK (ARMV4I)" + Name="Release|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -6675,17 +6695,15 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Win32" + Name="Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Windows Mobile 6 Standard SDK (ARMV4I)" + Name="Release|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -6693,25 +6711,25 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Windows Mobile 6 Professional SDK (ARMV4I)" + Name="Debug-Static|Win32" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Win32" + Name="Debug-Static|Windows Mobile 6 Standard SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Windows Mobile 6 Standard SDK (ARMV4I)" + Name="Debug-Static|Windows Mobile 6 Professional SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -6719,7 +6737,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Windows Mobile 6 Professional SDK (ARMV4I)" + Name="Debug-Static|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -6727,7 +6745,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug|Pocket PC 2003 (ARMV4)" + Name="Debug-Static|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -6735,7 +6753,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Pocket PC 2003 (ARMV4)" + Name="Debug-Static|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -6743,7 +6761,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Pocket PC 2003 (ARMV4)" + Name="Debug-Static|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -6751,15 +6769,17 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Pocket PC 2003 (ARMV4)" + Name="Release-Dynamic|Win32" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Pocket PC 2003 (ARMV4)" + Name="Release-Dynamic|Windows Mobile 6 Standard SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -6767,7 +6787,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Pocket PC 2003 (ARMV4)" + Name="Release-Dynamic|Windows Mobile 6 Professional SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -6775,7 +6795,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug|Smartphone 2003 (ARMV4)" + Name="Release-Dynamic|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -6783,7 +6803,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Smartphone 2003 (ARMV4)" + Name="Release-Dynamic|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -6791,7 +6811,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Smartphone 2003 (ARMV4)" + Name="Release-Dynamic|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -6799,7 +6819,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Smartphone 2003 (ARMV4)" + Name="Release-Dynamic|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -6807,15 +6827,17 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Smartphone 2003 (ARMV4)" + Name="Debug-Dynamic|Win32" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Smartphone 2003 (ARMV4)" + Name="Debug-Dynamic|Windows Mobile 6 Standard SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -6823,7 +6845,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Debug-Dynamic|Windows Mobile 6 Professional SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -6831,7 +6853,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Debug-Dynamic|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -6839,7 +6861,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Debug-Dynamic|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -6847,7 +6869,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Debug-Dynamic|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -6855,7 +6877,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Debug-Dynamic|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -6863,15 +6885,17 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Release-Static|Win32" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Debug|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" + Name="Release-Static|Windows Mobile 6 Standard SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -6879,7 +6903,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" + Name="Release-Static|Windows Mobile 6 Professional SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -6887,7 +6911,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" + Name="Release-Static|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -6895,7 +6919,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" + Name="Release-Static|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -6903,7 +6927,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" + Name="Release-Static|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -6949,17 +6973,15 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Win32" + Name="Debug|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Release|Windows Mobile 6 Standard SDK (ARMV4I)" + Name="Debug|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -6967,7 +6989,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Windows Mobile 6 Professional SDK (ARMV4I)" + Name="Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -6975,25 +6997,25 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Win32" + Name="Debug|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Windows Mobile 6 Standard SDK (ARMV4I)" + Name="Release|Win32" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Windows Mobile 6 Professional SDK (ARMV4I)" + Name="Release|Windows Mobile 6 Standard SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -7001,17 +7023,15 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Win32" + Name="Release|Windows Mobile 6 Professional SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Windows Mobile 6 Standard SDK (ARMV4I)" + Name="Release|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -7019,7 +7039,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Windows Mobile 6 Professional SDK (ARMV4I)" + Name="Release|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -7027,17 +7047,15 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Win32" + Name="Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Windows Mobile 6 Standard SDK (ARMV4I)" + Name="Release|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -7045,25 +7063,25 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Windows Mobile 6 Professional SDK (ARMV4I)" + Name="Debug-Static|Win32" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Win32" + Name="Debug-Static|Windows Mobile 6 Standard SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Windows Mobile 6 Standard SDK (ARMV4I)" + Name="Debug-Static|Windows Mobile 6 Professional SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -7071,7 +7089,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Windows Mobile 6 Professional SDK (ARMV4I)" + Name="Debug-Static|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -7079,7 +7097,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug|Pocket PC 2003 (ARMV4)" + Name="Debug-Static|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -7087,7 +7105,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Pocket PC 2003 (ARMV4)" + Name="Debug-Static|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -7095,7 +7113,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Pocket PC 2003 (ARMV4)" + Name="Debug-Static|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -7103,15 +7121,17 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Pocket PC 2003 (ARMV4)" + Name="Release-Dynamic|Win32" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Pocket PC 2003 (ARMV4)" + Name="Release-Dynamic|Windows Mobile 6 Standard SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -7119,7 +7139,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Pocket PC 2003 (ARMV4)" + Name="Release-Dynamic|Windows Mobile 6 Professional SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -7127,7 +7147,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug|Smartphone 2003 (ARMV4)" + Name="Release-Dynamic|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -7135,7 +7155,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Smartphone 2003 (ARMV4)" + Name="Release-Dynamic|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -7143,7 +7163,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Smartphone 2003 (ARMV4)" + Name="Release-Dynamic|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -7151,7 +7171,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Smartphone 2003 (ARMV4)" + Name="Release-Dynamic|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -7159,15 +7179,17 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Smartphone 2003 (ARMV4)" + Name="Debug-Dynamic|Win32" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Smartphone 2003 (ARMV4)" + Name="Debug-Dynamic|Windows Mobile 6 Standard SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -7175,7 +7197,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Debug-Dynamic|Windows Mobile 6 Professional SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -7183,7 +7205,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Debug-Dynamic|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -7191,7 +7213,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Debug-Dynamic|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -7199,7 +7221,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Debug-Dynamic|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -7207,7 +7229,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Debug-Dynamic|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -7215,15 +7237,17 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Release-Static|Win32" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Debug|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" + Name="Release-Static|Windows Mobile 6 Standard SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -7231,7 +7255,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" + Name="Release-Static|Windows Mobile 6 Professional SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -7239,7 +7263,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" + Name="Release-Static|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -7247,7 +7271,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" + Name="Release-Static|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -7255,7 +7279,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" + Name="Release-Static|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -7299,7 +7323,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Win32" + Name="Debug|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -7307,7 +7331,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Windows Mobile 6 Standard SDK (ARMV4I)" + Name="Debug|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -7315,7 +7339,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Windows Mobile 6 Professional SDK (ARMV4I)" + Name="Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -7323,7 +7347,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Win32" + Name="Debug|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -7331,7 +7355,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Windows Mobile 6 Standard SDK (ARMV4I)" + Name="Release|Win32" ExcludedFromBuild="true" > <Tool @@ -7339,7 +7363,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Windows Mobile 6 Professional SDK (ARMV4I)" + Name="Release|Windows Mobile 6 Standard SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -7347,7 +7371,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Win32" + Name="Release|Windows Mobile 6 Professional SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -7355,7 +7379,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Windows Mobile 6 Standard SDK (ARMV4I)" + Name="Release|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -7363,7 +7387,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Windows Mobile 6 Professional SDK (ARMV4I)" + Name="Release|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -7371,7 +7395,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Win32" + Name="Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -7379,7 +7403,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Windows Mobile 6 Standard SDK (ARMV4I)" + Name="Release|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -7387,7 +7411,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Windows Mobile 6 Professional SDK (ARMV4I)" + Name="Debug-Static|Win32" ExcludedFromBuild="true" > <Tool @@ -7395,7 +7419,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Win32" + Name="Debug-Static|Windows Mobile 6 Standard SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -7403,7 +7427,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Windows Mobile 6 Standard SDK (ARMV4I)" + Name="Debug-Static|Windows Mobile 6 Professional SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -7411,7 +7435,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Windows Mobile 6 Professional SDK (ARMV4I)" + Name="Debug-Static|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -7419,7 +7443,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug|Pocket PC 2003 (ARMV4)" + Name="Debug-Static|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -7427,7 +7451,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Pocket PC 2003 (ARMV4)" + Name="Debug-Static|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -7435,7 +7459,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Pocket PC 2003 (ARMV4)" + Name="Debug-Static|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -7443,7 +7467,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Pocket PC 2003 (ARMV4)" + Name="Release-Dynamic|Win32" ExcludedFromBuild="true" > <Tool @@ -7451,7 +7475,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Pocket PC 2003 (ARMV4)" + Name="Release-Dynamic|Windows Mobile 6 Standard SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -7459,7 +7483,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Pocket PC 2003 (ARMV4)" + Name="Release-Dynamic|Windows Mobile 6 Professional SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -7467,7 +7491,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug|Smartphone 2003 (ARMV4)" + Name="Release-Dynamic|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -7475,7 +7499,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Smartphone 2003 (ARMV4)" + Name="Release-Dynamic|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -7483,7 +7507,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Smartphone 2003 (ARMV4)" + Name="Release-Dynamic|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -7491,7 +7515,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Smartphone 2003 (ARMV4)" + Name="Release-Dynamic|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -7499,7 +7523,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Smartphone 2003 (ARMV4)" + Name="Debug-Dynamic|Win32" ExcludedFromBuild="true" > <Tool @@ -7507,7 +7531,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Smartphone 2003 (ARMV4)" + Name="Debug-Dynamic|Windows Mobile 6 Standard SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -7515,7 +7539,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Debug-Dynamic|Windows Mobile 6 Professional SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -7523,7 +7547,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Debug-Dynamic|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -7531,7 +7555,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Debug-Dynamic|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -7539,7 +7563,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Debug-Dynamic|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -7547,7 +7571,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Debug-Dynamic|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -7555,7 +7579,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Release-Static|Win32" ExcludedFromBuild="true" > <Tool @@ -7563,7 +7587,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" + Name="Release-Static|Windows Mobile 6 Standard SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -7571,7 +7595,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" + Name="Release-Static|Windows Mobile 6 Professional SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -7579,7 +7603,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" + Name="Release-Static|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -7587,7 +7611,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" + Name="Release-Static|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -7595,7 +7619,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" + Name="Release-Static|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -7641,17 +7665,15 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Win32" + Name="Debug|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Release|Windows Mobile 6 Standard SDK (ARMV4I)" + Name="Debug|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -7659,7 +7681,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Windows Mobile 6 Professional SDK (ARMV4I)" + Name="Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -7667,25 +7689,25 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Win32" + Name="Debug|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Windows Mobile 6 Standard SDK (ARMV4I)" + Name="Release|Win32" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Windows Mobile 6 Professional SDK (ARMV4I)" + Name="Release|Windows Mobile 6 Standard SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -7693,17 +7715,15 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Win32" + Name="Release|Windows Mobile 6 Professional SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Windows Mobile 6 Standard SDK (ARMV4I)" + Name="Release|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -7711,7 +7731,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Windows Mobile 6 Professional SDK (ARMV4I)" + Name="Release|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -7719,17 +7739,15 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Win32" + Name="Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Windows Mobile 6 Standard SDK (ARMV4I)" + Name="Release|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -7737,25 +7755,25 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Windows Mobile 6 Professional SDK (ARMV4I)" + Name="Debug-Static|Win32" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Win32" + Name="Debug-Static|Windows Mobile 6 Standard SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Windows Mobile 6 Standard SDK (ARMV4I)" + Name="Debug-Static|Windows Mobile 6 Professional SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -7763,7 +7781,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Windows Mobile 6 Professional SDK (ARMV4I)" + Name="Debug-Static|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -7771,7 +7789,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug|Pocket PC 2003 (ARMV4)" + Name="Debug-Static|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -7779,7 +7797,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Pocket PC 2003 (ARMV4)" + Name="Debug-Static|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -7787,7 +7805,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Pocket PC 2003 (ARMV4)" + Name="Debug-Static|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -7795,15 +7813,17 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Pocket PC 2003 (ARMV4)" + Name="Release-Dynamic|Win32" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Pocket PC 2003 (ARMV4)" + Name="Release-Dynamic|Windows Mobile 6 Standard SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -7811,7 +7831,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Pocket PC 2003 (ARMV4)" + Name="Release-Dynamic|Windows Mobile 6 Professional SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -7819,7 +7839,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug|Smartphone 2003 (ARMV4)" + Name="Release-Dynamic|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -7827,7 +7847,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Smartphone 2003 (ARMV4)" + Name="Release-Dynamic|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -7835,7 +7855,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Smartphone 2003 (ARMV4)" + Name="Release-Dynamic|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -7843,7 +7863,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Smartphone 2003 (ARMV4)" + Name="Release-Dynamic|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -7851,15 +7871,17 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Smartphone 2003 (ARMV4)" + Name="Debug-Dynamic|Win32" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Smartphone 2003 (ARMV4)" + Name="Debug-Dynamic|Windows Mobile 6 Standard SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -7867,7 +7889,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Debug-Dynamic|Windows Mobile 6 Professional SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -7875,7 +7897,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Debug-Dynamic|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -7883,7 +7905,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Debug-Dynamic|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -7891,7 +7913,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Debug-Dynamic|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -7899,7 +7921,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Debug-Dynamic|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -7907,15 +7929,17 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Release-Static|Win32" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Debug|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" + Name="Release-Static|Windows Mobile 6 Standard SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -7923,7 +7947,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" + Name="Release-Static|Windows Mobile 6 Professional SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -7931,7 +7955,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" + Name="Release-Static|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -7939,7 +7963,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" + Name="Release-Static|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -7947,7 +7971,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" + Name="Release-Static|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -7993,17 +8017,15 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Win32" + Name="Debug|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Release|Windows Mobile 6 Standard SDK (ARMV4I)" + Name="Debug|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -8011,7 +8033,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Windows Mobile 6 Professional SDK (ARMV4I)" + Name="Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -8019,25 +8041,25 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Win32" + Name="Debug|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Windows Mobile 6 Standard SDK (ARMV4I)" + Name="Release|Win32" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Windows Mobile 6 Professional SDK (ARMV4I)" + Name="Release|Windows Mobile 6 Standard SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -8045,17 +8067,15 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Win32" + Name="Release|Windows Mobile 6 Professional SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Windows Mobile 6 Standard SDK (ARMV4I)" + Name="Release|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -8063,7 +8083,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Windows Mobile 6 Professional SDK (ARMV4I)" + Name="Release|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -8071,17 +8091,15 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Win32" + Name="Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Windows Mobile 6 Standard SDK (ARMV4I)" + Name="Release|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -8089,25 +8107,25 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Windows Mobile 6 Professional SDK (ARMV4I)" + Name="Debug-Static|Win32" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Win32" + Name="Debug-Static|Windows Mobile 6 Standard SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Windows Mobile 6 Standard SDK (ARMV4I)" + Name="Debug-Static|Windows Mobile 6 Professional SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -8115,7 +8133,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Windows Mobile 6 Professional SDK (ARMV4I)" + Name="Debug-Static|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -8123,7 +8141,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug|Pocket PC 2003 (ARMV4)" + Name="Debug-Static|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -8131,7 +8149,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Pocket PC 2003 (ARMV4)" + Name="Debug-Static|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -8139,7 +8157,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Pocket PC 2003 (ARMV4)" + Name="Debug-Static|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -8147,15 +8165,17 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Pocket PC 2003 (ARMV4)" + Name="Release-Dynamic|Win32" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Pocket PC 2003 (ARMV4)" + Name="Release-Dynamic|Windows Mobile 6 Standard SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -8163,7 +8183,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Pocket PC 2003 (ARMV4)" + Name="Release-Dynamic|Windows Mobile 6 Professional SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -8171,7 +8191,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug|Smartphone 2003 (ARMV4)" + Name="Release-Dynamic|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -8179,7 +8199,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Smartphone 2003 (ARMV4)" + Name="Release-Dynamic|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -8187,7 +8207,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Smartphone 2003 (ARMV4)" + Name="Release-Dynamic|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -8195,7 +8215,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Smartphone 2003 (ARMV4)" + Name="Release-Dynamic|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -8203,15 +8223,17 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Smartphone 2003 (ARMV4)" + Name="Debug-Dynamic|Win32" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Smartphone 2003 (ARMV4)" + Name="Debug-Dynamic|Windows Mobile 6 Standard SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -8219,7 +8241,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Debug-Dynamic|Windows Mobile 6 Professional SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -8227,7 +8249,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Debug-Dynamic|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -8235,7 +8257,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Debug-Dynamic|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -8243,7 +8265,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Debug-Dynamic|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -8251,7 +8273,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Debug-Dynamic|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -8259,15 +8281,17 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Release-Static|Win32" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Debug|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" + Name="Release-Static|Windows Mobile 6 Standard SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -8275,7 +8299,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" + Name="Release-Static|Windows Mobile 6 Professional SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -8283,7 +8307,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" + Name="Release-Static|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -8291,7 +8315,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" + Name="Release-Static|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -8299,7 +8323,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" + Name="Release-Static|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -8345,17 +8369,15 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Win32" + Name="Debug|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Release|Windows Mobile 6 Standard SDK (ARMV4I)" + Name="Debug|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -8363,7 +8385,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Windows Mobile 6 Professional SDK (ARMV4I)" + Name="Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -8371,25 +8393,25 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Win32" + Name="Debug|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Windows Mobile 6 Standard SDK (ARMV4I)" + Name="Release|Win32" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Windows Mobile 6 Professional SDK (ARMV4I)" + Name="Release|Windows Mobile 6 Standard SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -8397,17 +8419,15 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Win32" + Name="Release|Windows Mobile 6 Professional SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Windows Mobile 6 Standard SDK (ARMV4I)" + Name="Release|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -8415,7 +8435,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Windows Mobile 6 Professional SDK (ARMV4I)" + Name="Release|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -8423,17 +8443,15 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Win32" + Name="Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Windows Mobile 6 Standard SDK (ARMV4I)" + Name="Release|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -8441,25 +8459,25 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Windows Mobile 6 Professional SDK (ARMV4I)" + Name="Debug-Static|Win32" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Win32" + Name="Debug-Static|Windows Mobile 6 Standard SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Windows Mobile 6 Standard SDK (ARMV4I)" + Name="Debug-Static|Windows Mobile 6 Professional SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -8467,7 +8485,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Windows Mobile 6 Professional SDK (ARMV4I)" + Name="Debug-Static|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -8475,7 +8493,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug|Pocket PC 2003 (ARMV4)" + Name="Debug-Static|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -8483,7 +8501,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Pocket PC 2003 (ARMV4)" + Name="Debug-Static|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -8491,7 +8509,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Pocket PC 2003 (ARMV4)" + Name="Debug-Static|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -8499,15 +8517,17 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Pocket PC 2003 (ARMV4)" + Name="Release-Dynamic|Win32" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Pocket PC 2003 (ARMV4)" + Name="Release-Dynamic|Windows Mobile 6 Standard SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -8515,7 +8535,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Pocket PC 2003 (ARMV4)" + Name="Release-Dynamic|Windows Mobile 6 Professional SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -8523,7 +8543,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug|Smartphone 2003 (ARMV4)" + Name="Release-Dynamic|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -8531,7 +8551,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Smartphone 2003 (ARMV4)" + Name="Release-Dynamic|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -8539,7 +8559,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Smartphone 2003 (ARMV4)" + Name="Release-Dynamic|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -8547,7 +8567,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Smartphone 2003 (ARMV4)" + Name="Release-Dynamic|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -8555,15 +8575,17 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Smartphone 2003 (ARMV4)" + Name="Debug-Dynamic|Win32" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Smartphone 2003 (ARMV4)" + Name="Debug-Dynamic|Windows Mobile 6 Standard SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -8571,7 +8593,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Debug-Dynamic|Windows Mobile 6 Professional SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -8579,7 +8601,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Debug-Dynamic|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -8587,7 +8609,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Debug-Dynamic|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -8595,7 +8617,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Debug-Dynamic|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -8603,7 +8625,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Debug-Dynamic|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -8611,15 +8633,17 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Release-Static|Win32" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Debug|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" + Name="Release-Static|Windows Mobile 6 Standard SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -8627,7 +8651,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" + Name="Release-Static|Windows Mobile 6 Professional SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -8635,7 +8659,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" + Name="Release-Static|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -8643,7 +8667,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" + Name="Release-Static|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -8651,7 +8675,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" + Name="Release-Static|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -8697,17 +8721,15 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Win32" + Name="Debug|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Release|Windows Mobile 6 Standard SDK (ARMV4I)" + Name="Debug|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -8715,7 +8737,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Windows Mobile 6 Professional SDK (ARMV4I)" + Name="Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -8723,25 +8745,25 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Win32" + Name="Debug|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Windows Mobile 6 Standard SDK (ARMV4I)" + Name="Release|Win32" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Windows Mobile 6 Professional SDK (ARMV4I)" + Name="Release|Windows Mobile 6 Standard SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -8749,17 +8771,15 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Win32" + Name="Release|Windows Mobile 6 Professional SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Windows Mobile 6 Standard SDK (ARMV4I)" + Name="Release|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -8767,7 +8787,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Windows Mobile 6 Professional SDK (ARMV4I)" + Name="Release|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -8775,17 +8795,15 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Win32" + Name="Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Windows Mobile 6 Standard SDK (ARMV4I)" + Name="Release|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -8793,25 +8811,25 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Windows Mobile 6 Professional SDK (ARMV4I)" + Name="Debug-Static|Win32" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Win32" + Name="Debug-Static|Windows Mobile 6 Standard SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Windows Mobile 6 Standard SDK (ARMV4I)" + Name="Debug-Static|Windows Mobile 6 Professional SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -8819,7 +8837,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Windows Mobile 6 Professional SDK (ARMV4I)" + Name="Debug-Static|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -8827,7 +8845,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug|Pocket PC 2003 (ARMV4)" + Name="Debug-Static|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -8835,7 +8853,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Pocket PC 2003 (ARMV4)" + Name="Debug-Static|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -8843,7 +8861,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Pocket PC 2003 (ARMV4)" + Name="Debug-Static|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -8851,15 +8869,17 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Pocket PC 2003 (ARMV4)" + Name="Release-Dynamic|Win32" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Pocket PC 2003 (ARMV4)" + Name="Release-Dynamic|Windows Mobile 6 Standard SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -8867,7 +8887,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Pocket PC 2003 (ARMV4)" + Name="Release-Dynamic|Windows Mobile 6 Professional SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -8875,7 +8895,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug|Smartphone 2003 (ARMV4)" + Name="Release-Dynamic|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -8883,7 +8903,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Smartphone 2003 (ARMV4)" + Name="Release-Dynamic|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -8891,7 +8911,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Smartphone 2003 (ARMV4)" + Name="Release-Dynamic|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -8899,7 +8919,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Smartphone 2003 (ARMV4)" + Name="Release-Dynamic|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -8907,15 +8927,17 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Smartphone 2003 (ARMV4)" + Name="Debug-Dynamic|Win32" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Smartphone 2003 (ARMV4)" + Name="Debug-Dynamic|Windows Mobile 6 Standard SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -8923,7 +8945,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Debug-Dynamic|Windows Mobile 6 Professional SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -8931,7 +8953,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Debug-Dynamic|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -8939,7 +8961,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Debug-Dynamic|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -8947,7 +8969,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Debug-Dynamic|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -8955,7 +8977,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Debug-Dynamic|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -8963,15 +8985,17 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Release-Static|Win32" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Debug|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" + Name="Release-Static|Windows Mobile 6 Standard SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -8979,7 +9003,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" + Name="Release-Static|Windows Mobile 6 Professional SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -8987,7 +9011,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" + Name="Release-Static|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -8995,7 +9019,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" + Name="Release-Static|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -9003,7 +9027,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" + Name="Release-Static|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -9049,17 +9073,15 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Win32" + Name="Debug|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Release|Windows Mobile 6 Standard SDK (ARMV4I)" + Name="Debug|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -9067,7 +9089,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Windows Mobile 6 Professional SDK (ARMV4I)" + Name="Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -9075,25 +9097,25 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Win32" + Name="Debug|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Windows Mobile 6 Standard SDK (ARMV4I)" + Name="Release|Win32" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Windows Mobile 6 Professional SDK (ARMV4I)" + Name="Release|Windows Mobile 6 Standard SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -9101,17 +9123,15 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Win32" + Name="Release|Windows Mobile 6 Professional SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Windows Mobile 6 Standard SDK (ARMV4I)" + Name="Release|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -9119,7 +9139,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Windows Mobile 6 Professional SDK (ARMV4I)" + Name="Release|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -9127,17 +9147,15 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Win32" + Name="Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Windows Mobile 6 Standard SDK (ARMV4I)" + Name="Release|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -9145,25 +9163,25 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Windows Mobile 6 Professional SDK (ARMV4I)" + Name="Debug-Static|Win32" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Win32" + Name="Debug-Static|Windows Mobile 6 Standard SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Windows Mobile 6 Standard SDK (ARMV4I)" + Name="Debug-Static|Windows Mobile 6 Professional SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -9171,7 +9189,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Windows Mobile 6 Professional SDK (ARMV4I)" + Name="Debug-Static|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -9179,7 +9197,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug|Pocket PC 2003 (ARMV4)" + Name="Debug-Static|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -9187,7 +9205,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Pocket PC 2003 (ARMV4)" + Name="Debug-Static|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -9195,7 +9213,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Pocket PC 2003 (ARMV4)" + Name="Debug-Static|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -9203,15 +9221,17 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Pocket PC 2003 (ARMV4)" + Name="Release-Dynamic|Win32" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Pocket PC 2003 (ARMV4)" + Name="Release-Dynamic|Windows Mobile 6 Standard SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -9219,7 +9239,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Pocket PC 2003 (ARMV4)" + Name="Release-Dynamic|Windows Mobile 6 Professional SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -9227,7 +9247,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug|Smartphone 2003 (ARMV4)" + Name="Release-Dynamic|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -9235,7 +9255,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Smartphone 2003 (ARMV4)" + Name="Release-Dynamic|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -9243,7 +9263,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Smartphone 2003 (ARMV4)" + Name="Release-Dynamic|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -9251,7 +9271,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Smartphone 2003 (ARMV4)" + Name="Release-Dynamic|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -9259,15 +9279,17 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Smartphone 2003 (ARMV4)" + Name="Debug-Dynamic|Win32" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Smartphone 2003 (ARMV4)" + Name="Debug-Dynamic|Windows Mobile 6 Standard SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -9275,7 +9297,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Debug-Dynamic|Windows Mobile 6 Professional SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -9283,7 +9305,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Debug-Dynamic|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -9291,7 +9313,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Debug-Dynamic|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -9299,7 +9321,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Debug-Dynamic|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -9307,7 +9329,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Debug-Dynamic|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -9315,15 +9337,17 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Release-Static|Win32" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Debug|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" + Name="Release-Static|Windows Mobile 6 Standard SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -9331,7 +9355,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" + Name="Release-Static|Windows Mobile 6 Professional SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -9339,7 +9363,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" + Name="Release-Static|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -9347,7 +9371,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" + Name="Release-Static|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -9355,7 +9379,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" + Name="Release-Static|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -9401,17 +9425,15 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Win32" + Name="Debug|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Release|Windows Mobile 6 Standard SDK (ARMV4I)" + Name="Debug|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -9419,7 +9441,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Windows Mobile 6 Professional SDK (ARMV4I)" + Name="Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -9427,25 +9449,25 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Win32" + Name="Debug|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Windows Mobile 6 Standard SDK (ARMV4I)" + Name="Release|Win32" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Windows Mobile 6 Professional SDK (ARMV4I)" + Name="Release|Windows Mobile 6 Standard SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -9453,17 +9475,15 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Win32" + Name="Release|Windows Mobile 6 Professional SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Windows Mobile 6 Standard SDK (ARMV4I)" + Name="Release|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -9471,7 +9491,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Windows Mobile 6 Professional SDK (ARMV4I)" + Name="Release|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -9479,17 +9499,15 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Win32" + Name="Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Windows Mobile 6 Standard SDK (ARMV4I)" + Name="Release|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -9497,25 +9515,25 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Windows Mobile 6 Professional SDK (ARMV4I)" + Name="Debug-Static|Win32" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Win32" + Name="Debug-Static|Windows Mobile 6 Standard SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Windows Mobile 6 Standard SDK (ARMV4I)" + Name="Debug-Static|Windows Mobile 6 Professional SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -9523,7 +9541,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Windows Mobile 6 Professional SDK (ARMV4I)" + Name="Debug-Static|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -9531,7 +9549,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug|Pocket PC 2003 (ARMV4)" + Name="Debug-Static|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -9539,7 +9557,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Pocket PC 2003 (ARMV4)" + Name="Debug-Static|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -9547,7 +9565,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Pocket PC 2003 (ARMV4)" + Name="Debug-Static|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -9555,15 +9573,17 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Pocket PC 2003 (ARMV4)" + Name="Release-Dynamic|Win32" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Pocket PC 2003 (ARMV4)" + Name="Release-Dynamic|Windows Mobile 6 Standard SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -9571,7 +9591,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Pocket PC 2003 (ARMV4)" + Name="Release-Dynamic|Windows Mobile 6 Professional SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -9579,7 +9599,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug|Smartphone 2003 (ARMV4)" + Name="Release-Dynamic|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -9587,7 +9607,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Smartphone 2003 (ARMV4)" + Name="Release-Dynamic|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -9595,7 +9615,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Smartphone 2003 (ARMV4)" + Name="Release-Dynamic|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -9603,7 +9623,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Smartphone 2003 (ARMV4)" + Name="Release-Dynamic|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -9611,15 +9631,17 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Smartphone 2003 (ARMV4)" + Name="Debug-Dynamic|Win32" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Smartphone 2003 (ARMV4)" + Name="Debug-Dynamic|Windows Mobile 6 Standard SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -9627,7 +9649,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Debug-Dynamic|Windows Mobile 6 Professional SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -9635,7 +9657,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Debug-Dynamic|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -9643,7 +9665,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Debug-Dynamic|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -9651,7 +9673,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Debug-Dynamic|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -9659,7 +9681,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Debug-Dynamic|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -9667,15 +9689,17 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Release-Static|Win32" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Debug|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" + Name="Release-Static|Windows Mobile 6 Standard SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -9683,7 +9707,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" + Name="Release-Static|Windows Mobile 6 Professional SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -9691,7 +9715,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" + Name="Release-Static|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -9699,7 +9723,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" + Name="Release-Static|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -9707,7 +9731,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" + Name="Release-Static|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -9753,17 +9777,15 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Win32" + Name="Debug|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Release|Windows Mobile 6 Standard SDK (ARMV4I)" + Name="Debug|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -9771,7 +9793,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Windows Mobile 6 Professional SDK (ARMV4I)" + Name="Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -9779,25 +9801,25 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Win32" + Name="Debug|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Windows Mobile 6 Standard SDK (ARMV4I)" + Name="Release|Win32" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Windows Mobile 6 Professional SDK (ARMV4I)" + Name="Release|Windows Mobile 6 Standard SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -9805,17 +9827,15 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Win32" + Name="Release|Windows Mobile 6 Professional SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Windows Mobile 6 Standard SDK (ARMV4I)" + Name="Release|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -9823,7 +9843,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Windows Mobile 6 Professional SDK (ARMV4I)" + Name="Release|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -9831,17 +9851,15 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Win32" + Name="Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Windows Mobile 6 Standard SDK (ARMV4I)" + Name="Release|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -9849,25 +9867,25 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Windows Mobile 6 Professional SDK (ARMV4I)" + Name="Debug-Static|Win32" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Win32" + Name="Debug-Static|Windows Mobile 6 Standard SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Windows Mobile 6 Standard SDK (ARMV4I)" + Name="Debug-Static|Windows Mobile 6 Professional SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -9875,7 +9893,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Windows Mobile 6 Professional SDK (ARMV4I)" + Name="Debug-Static|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -9883,7 +9901,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug|Pocket PC 2003 (ARMV4)" + Name="Debug-Static|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -9891,7 +9909,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Pocket PC 2003 (ARMV4)" + Name="Debug-Static|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -9899,7 +9917,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Pocket PC 2003 (ARMV4)" + Name="Debug-Static|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -9907,15 +9925,17 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Pocket PC 2003 (ARMV4)" + Name="Release-Dynamic|Win32" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Pocket PC 2003 (ARMV4)" + Name="Release-Dynamic|Windows Mobile 6 Standard SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -9923,7 +9943,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Pocket PC 2003 (ARMV4)" + Name="Release-Dynamic|Windows Mobile 6 Professional SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -9931,7 +9951,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug|Smartphone 2003 (ARMV4)" + Name="Release-Dynamic|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -9939,7 +9959,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Smartphone 2003 (ARMV4)" + Name="Release-Dynamic|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -9947,7 +9967,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Smartphone 2003 (ARMV4)" + Name="Release-Dynamic|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -9955,7 +9975,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Smartphone 2003 (ARMV4)" + Name="Release-Dynamic|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -9963,15 +9983,17 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Smartphone 2003 (ARMV4)" + Name="Debug-Dynamic|Win32" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Smartphone 2003 (ARMV4)" + Name="Debug-Dynamic|Windows Mobile 6 Standard SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -9979,7 +10001,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Debug-Dynamic|Windows Mobile 6 Professional SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -9987,7 +10009,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Debug-Dynamic|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -9995,7 +10017,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Debug-Dynamic|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -10003,7 +10025,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Debug-Dynamic|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -10011,7 +10033,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Debug-Dynamic|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -10019,15 +10041,17 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Release-Static|Win32" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Debug|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" + Name="Release-Static|Windows Mobile 6 Standard SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -10035,7 +10059,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" + Name="Release-Static|Windows Mobile 6 Professional SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -10043,7 +10067,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" + Name="Release-Static|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -10051,7 +10075,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" + Name="Release-Static|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -10059,7 +10083,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" + Name="Release-Static|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -10105,17 +10129,15 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Win32" + Name="Debug|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Release|Windows Mobile 6 Standard SDK (ARMV4I)" + Name="Debug|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -10123,7 +10145,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Windows Mobile 6 Professional SDK (ARMV4I)" + Name="Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -10131,25 +10153,25 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Win32" + Name="Debug|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Windows Mobile 6 Standard SDK (ARMV4I)" + Name="Release|Win32" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Windows Mobile 6 Professional SDK (ARMV4I)" + Name="Release|Windows Mobile 6 Standard SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -10157,17 +10179,15 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Win32" + Name="Release|Windows Mobile 6 Professional SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Windows Mobile 6 Standard SDK (ARMV4I)" + Name="Release|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -10175,7 +10195,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Windows Mobile 6 Professional SDK (ARMV4I)" + Name="Release|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -10183,17 +10203,15 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Win32" + Name="Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Windows Mobile 6 Standard SDK (ARMV4I)" + Name="Release|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -10201,25 +10219,25 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Windows Mobile 6 Professional SDK (ARMV4I)" + Name="Debug-Static|Win32" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Win32" + Name="Debug-Static|Windows Mobile 6 Standard SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Windows Mobile 6 Standard SDK (ARMV4I)" + Name="Debug-Static|Windows Mobile 6 Professional SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -10227,7 +10245,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Windows Mobile 6 Professional SDK (ARMV4I)" + Name="Debug-Static|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -10235,7 +10253,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug|Pocket PC 2003 (ARMV4)" + Name="Debug-Static|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -10243,7 +10261,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Pocket PC 2003 (ARMV4)" + Name="Debug-Static|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -10251,7 +10269,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Pocket PC 2003 (ARMV4)" + Name="Debug-Static|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -10259,15 +10277,17 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Pocket PC 2003 (ARMV4)" + Name="Release-Dynamic|Win32" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Pocket PC 2003 (ARMV4)" + Name="Release-Dynamic|Windows Mobile 6 Standard SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -10275,7 +10295,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Pocket PC 2003 (ARMV4)" + Name="Release-Dynamic|Windows Mobile 6 Professional SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -10283,7 +10303,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug|Smartphone 2003 (ARMV4)" + Name="Release-Dynamic|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -10291,7 +10311,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Smartphone 2003 (ARMV4)" + Name="Release-Dynamic|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -10299,7 +10319,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Smartphone 2003 (ARMV4)" + Name="Release-Dynamic|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -10307,7 +10327,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Smartphone 2003 (ARMV4)" + Name="Release-Dynamic|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -10315,15 +10335,17 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Smartphone 2003 (ARMV4)" + Name="Debug-Dynamic|Win32" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Smartphone 2003 (ARMV4)" + Name="Debug-Dynamic|Windows Mobile 6 Standard SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -10331,7 +10353,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Debug-Dynamic|Windows Mobile 6 Professional SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -10339,7 +10361,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Debug-Dynamic|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -10347,7 +10369,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Debug-Dynamic|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -10355,7 +10377,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Debug-Dynamic|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -10363,7 +10385,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Debug-Dynamic|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -10371,15 +10393,17 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Release-Static|Win32" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Debug|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" + Name="Release-Static|Windows Mobile 6 Standard SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -10387,7 +10411,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" + Name="Release-Static|Windows Mobile 6 Professional SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -10395,7 +10419,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" + Name="Release-Static|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -10403,7 +10427,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" + Name="Release-Static|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -10411,7 +10435,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" + Name="Release-Static|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -10457,17 +10481,15 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Win32" + Name="Debug|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Release|Windows Mobile 6 Standard SDK (ARMV4I)" + Name="Debug|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -10475,7 +10497,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Windows Mobile 6 Professional SDK (ARMV4I)" + Name="Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -10483,25 +10505,25 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Win32" + Name="Debug|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Windows Mobile 6 Standard SDK (ARMV4I)" + Name="Release|Win32" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Windows Mobile 6 Professional SDK (ARMV4I)" + Name="Release|Windows Mobile 6 Standard SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -10509,17 +10531,15 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Win32" + Name="Release|Windows Mobile 6 Professional SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Windows Mobile 6 Standard SDK (ARMV4I)" + Name="Release|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -10527,7 +10547,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Windows Mobile 6 Professional SDK (ARMV4I)" + Name="Release|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -10535,17 +10555,15 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Win32" + Name="Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Windows Mobile 6 Standard SDK (ARMV4I)" + Name="Release|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -10553,25 +10571,25 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Windows Mobile 6 Professional SDK (ARMV4I)" + Name="Debug-Static|Win32" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Win32" + Name="Debug-Static|Windows Mobile 6 Standard SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Windows Mobile 6 Standard SDK (ARMV4I)" + Name="Debug-Static|Windows Mobile 6 Professional SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -10579,7 +10597,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Windows Mobile 6 Professional SDK (ARMV4I)" + Name="Debug-Static|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -10587,7 +10605,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug|Pocket PC 2003 (ARMV4)" + Name="Debug-Static|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -10595,7 +10613,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Pocket PC 2003 (ARMV4)" + Name="Debug-Static|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -10603,7 +10621,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Pocket PC 2003 (ARMV4)" + Name="Debug-Static|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -10611,15 +10629,17 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Pocket PC 2003 (ARMV4)" + Name="Release-Dynamic|Win32" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Pocket PC 2003 (ARMV4)" + Name="Release-Dynamic|Windows Mobile 6 Standard SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -10627,7 +10647,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Pocket PC 2003 (ARMV4)" + Name="Release-Dynamic|Windows Mobile 6 Professional SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -10635,7 +10655,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug|Smartphone 2003 (ARMV4)" + Name="Release-Dynamic|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -10643,7 +10663,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Smartphone 2003 (ARMV4)" + Name="Release-Dynamic|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -10651,7 +10671,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Smartphone 2003 (ARMV4)" + Name="Release-Dynamic|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -10659,7 +10679,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Smartphone 2003 (ARMV4)" + Name="Release-Dynamic|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -10667,15 +10687,17 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Smartphone 2003 (ARMV4)" + Name="Debug-Dynamic|Win32" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Smartphone 2003 (ARMV4)" + Name="Debug-Dynamic|Windows Mobile 6 Standard SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -10683,7 +10705,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Debug-Dynamic|Windows Mobile 6 Professional SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -10691,7 +10713,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Debug-Dynamic|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -10699,7 +10721,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Debug-Dynamic|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -10707,7 +10729,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Debug-Dynamic|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -10715,7 +10737,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Debug-Dynamic|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -10723,15 +10745,17 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Release-Static|Win32" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Debug|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" + Name="Release-Static|Windows Mobile 6 Standard SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -10739,7 +10763,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" + Name="Release-Static|Windows Mobile 6 Professional SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -10747,7 +10771,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" + Name="Release-Static|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -10755,7 +10779,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" + Name="Release-Static|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -10763,7 +10787,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" + Name="Release-Static|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -10809,17 +10833,15 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Win32" + Name="Debug|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Release|Windows Mobile 6 Standard SDK (ARMV4I)" + Name="Debug|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -10827,7 +10849,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Windows Mobile 6 Professional SDK (ARMV4I)" + Name="Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -10835,25 +10857,25 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Win32" + Name="Debug|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Windows Mobile 6 Standard SDK (ARMV4I)" + Name="Release|Win32" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Windows Mobile 6 Professional SDK (ARMV4I)" + Name="Release|Windows Mobile 6 Standard SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -10861,17 +10883,15 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Win32" + Name="Release|Windows Mobile 6 Professional SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Windows Mobile 6 Standard SDK (ARMV4I)" + Name="Release|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -10879,7 +10899,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Windows Mobile 6 Professional SDK (ARMV4I)" + Name="Release|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -10887,17 +10907,15 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Win32" + Name="Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Windows Mobile 6 Standard SDK (ARMV4I)" + Name="Release|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -10905,25 +10923,25 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Windows Mobile 6 Professional SDK (ARMV4I)" + Name="Debug-Static|Win32" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Win32" + Name="Debug-Static|Windows Mobile 6 Standard SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Windows Mobile 6 Standard SDK (ARMV4I)" + Name="Debug-Static|Windows Mobile 6 Professional SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -10931,7 +10949,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Windows Mobile 6 Professional SDK (ARMV4I)" + Name="Debug-Static|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -10939,7 +10957,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug|Pocket PC 2003 (ARMV4)" + Name="Debug-Static|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -10947,7 +10965,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Pocket PC 2003 (ARMV4)" + Name="Debug-Static|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -10955,7 +10973,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Pocket PC 2003 (ARMV4)" + Name="Debug-Static|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -10963,15 +10981,17 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Pocket PC 2003 (ARMV4)" + Name="Release-Dynamic|Win32" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Pocket PC 2003 (ARMV4)" + Name="Release-Dynamic|Windows Mobile 6 Standard SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -10979,7 +10999,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Pocket PC 2003 (ARMV4)" + Name="Release-Dynamic|Windows Mobile 6 Professional SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -10987,7 +11007,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug|Smartphone 2003 (ARMV4)" + Name="Release-Dynamic|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -10995,7 +11015,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Smartphone 2003 (ARMV4)" + Name="Release-Dynamic|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -11003,7 +11023,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Smartphone 2003 (ARMV4)" + Name="Release-Dynamic|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -11011,7 +11031,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Smartphone 2003 (ARMV4)" + Name="Release-Dynamic|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -11019,15 +11039,17 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Smartphone 2003 (ARMV4)" + Name="Debug-Dynamic|Win32" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Smartphone 2003 (ARMV4)" + Name="Debug-Dynamic|Windows Mobile 6 Standard SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -11035,7 +11057,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Debug-Dynamic|Windows Mobile 6 Professional SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -11043,7 +11065,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Debug-Dynamic|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -11051,7 +11073,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Debug-Dynamic|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -11059,7 +11081,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Debug-Dynamic|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -11067,7 +11089,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Debug-Dynamic|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -11075,15 +11097,17 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Release-Static|Win32" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Debug|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" + Name="Release-Static|Windows Mobile 6 Standard SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -11091,7 +11115,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" + Name="Release-Static|Windows Mobile 6 Professional SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -11099,7 +11123,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" + Name="Release-Static|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -11107,7 +11131,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" + Name="Release-Static|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -11115,7 +11139,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" + Name="Release-Static|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -11161,17 +11185,15 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Win32" + Name="Debug|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Release|Windows Mobile 6 Standard SDK (ARMV4I)" + Name="Debug|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -11179,7 +11201,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Windows Mobile 6 Professional SDK (ARMV4I)" + Name="Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -11187,25 +11209,25 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Win32" + Name="Debug|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Windows Mobile 6 Standard SDK (ARMV4I)" + Name="Release|Win32" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Windows Mobile 6 Professional SDK (ARMV4I)" + Name="Release|Windows Mobile 6 Standard SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -11213,17 +11235,15 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Win32" + Name="Release|Windows Mobile 6 Professional SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Windows Mobile 6 Standard SDK (ARMV4I)" + Name="Release|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -11231,7 +11251,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Windows Mobile 6 Professional SDK (ARMV4I)" + Name="Release|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -11239,17 +11259,15 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Win32" + Name="Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Windows Mobile 6 Standard SDK (ARMV4I)" + Name="Release|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -11257,25 +11275,25 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Windows Mobile 6 Professional SDK (ARMV4I)" + Name="Debug-Static|Win32" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Win32" + Name="Debug-Static|Windows Mobile 6 Standard SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Windows Mobile 6 Standard SDK (ARMV4I)" + Name="Debug-Static|Windows Mobile 6 Professional SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -11283,7 +11301,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Windows Mobile 6 Professional SDK (ARMV4I)" + Name="Debug-Static|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -11291,7 +11309,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug|Pocket PC 2003 (ARMV4)" + Name="Debug-Static|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -11299,7 +11317,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Pocket PC 2003 (ARMV4)" + Name="Debug-Static|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -11307,7 +11325,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Pocket PC 2003 (ARMV4)" + Name="Debug-Static|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -11315,15 +11333,17 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Pocket PC 2003 (ARMV4)" + Name="Release-Dynamic|Win32" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Pocket PC 2003 (ARMV4)" + Name="Release-Dynamic|Windows Mobile 6 Standard SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -11331,7 +11351,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Pocket PC 2003 (ARMV4)" + Name="Release-Dynamic|Windows Mobile 6 Professional SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -11339,7 +11359,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug|Smartphone 2003 (ARMV4)" + Name="Release-Dynamic|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -11347,7 +11367,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Smartphone 2003 (ARMV4)" + Name="Release-Dynamic|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -11355,7 +11375,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Smartphone 2003 (ARMV4)" + Name="Release-Dynamic|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -11363,7 +11383,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Smartphone 2003 (ARMV4)" + Name="Release-Dynamic|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -11371,15 +11391,17 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Smartphone 2003 (ARMV4)" + Name="Debug-Dynamic|Win32" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Smartphone 2003 (ARMV4)" + Name="Debug-Dynamic|Windows Mobile 6 Standard SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -11387,7 +11409,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Debug-Dynamic|Windows Mobile 6 Professional SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -11395,7 +11417,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Debug-Dynamic|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -11403,7 +11425,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Debug-Dynamic|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -11411,7 +11433,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Debug-Dynamic|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -11419,7 +11441,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Debug-Dynamic|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -11427,15 +11449,17 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Release-Static|Win32" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Debug|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" + Name="Release-Static|Windows Mobile 6 Standard SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -11443,7 +11467,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" + Name="Release-Static|Windows Mobile 6 Professional SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -11451,7 +11475,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" + Name="Release-Static|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -11459,7 +11483,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" + Name="Release-Static|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -11467,7 +11491,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" + Name="Release-Static|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -11613,10 +11637,18 @@ RelativePath="..\include\pj\sock.h" > </File> + <File + RelativePath="..\include\pj\sock_qos.h" + > + </File> <File RelativePath="..\include\pj\sock_select.h" > </File> + <File + RelativePath="..\include\pj\ssl_sock.h" + > + </File> <File RelativePath="..\include\pj\string.h" > diff --git a/sflphone-common/libs/pjproject/pjlib/build/pjlib_test.dsp b/sflphone-common/libs/pjproject/pjlib/build/pjlib_test.dsp index 8252f12fd3be924e4c73872b5c0a292ba3b2f81a..067dea1d258772ab4f62cd203dc4a35553f3895c 100644 --- a/sflphone-common/libs/pjproject/pjlib/build/pjlib_test.dsp +++ b/sflphone-common/libs/pjproject/pjlib/build/pjlib_test.dsp @@ -74,7 +74,7 @@ BSC32=bscmake.exe # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept -# ADD LINK32 netapi32.lib mswsock.lib ws2_32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /out:"../bin/pjlib-test-i386-win32-vc6-debug.exe" /pdbtype:sept +# ADD LINK32 netapi32.lib mswsock.lib ws2_32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib libeay32MT.lib ssleay32MT.lib /nologo /subsystem:console /debug /machine:I386 /out:"../bin/pjlib-test-i386-win32-vc6-debug.exe" /pdbtype:sept !ENDIF @@ -193,6 +193,10 @@ SOURCE="..\src\pjlib-test\sock_perf.c" # End Source File # Begin Source File +SOURCE="..\src\pjlib-test\ssl_sock.c" +# End Source File +# Begin Source File + SOURCE="..\src\pjlib-test\string.c" # End Source File # Begin Source File diff --git a/sflphone-common/libs/pjproject/pjlib/build/pjlib_test.vcproj b/sflphone-common/libs/pjproject/pjlib/build/pjlib_test.vcproj index 6156d7ce7a187e96d22a9e7d39b8e12fbd24674c..050f67920c4a7c074ee37defedfa3f1570c31ee4 100644 --- a/sflphone-common/libs/pjproject/pjlib/build/pjlib_test.vcproj +++ b/sflphone-common/libs/pjproject/pjlib/build/pjlib_test.vcproj @@ -34,11 +34,11 @@ <Configurations> <Configuration Name="Debug|Win32" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-win32-common-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="2" ConfigurationType="1" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-win32-common-defaults.vsprops" UseOfMFC="0" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="2" > <Tool Name="VCPreBuildEventTool" @@ -57,8 +57,8 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_CONSOLE;" AdditionalIncludeDirectories="../include" + PreprocessorDefinitions="_CONSOLE;" PrecompiledHeaderFile="" /> <Tool @@ -73,7 +73,7 @@ <Tool Name="VCLinkerTool" AdditionalDependencies="netapi32.lib mswsock.lib ws2_32.lib odbc32.lib odbccp32.lib oleaut32.lib ole32.lib" - OutputFile="..\bin\pjlib-test-$(TargetCPU)-$(PlatformName)-vc$(VSVer)-$(ConfigurationName).exe" + OutputFile="..\bin\pjlib-test-$(TargetCPU)-$(PlatformName)-vc$(VSVer)-$(ConfigurationName).exe" /> <Tool Name="VCALinkTool" @@ -102,10 +102,10 @@ </Configuration> <Configuration Name="Debug|Windows Mobile 6 Standard SDK (ARMV4I)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm6-common-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" ConfigurationType="1" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm6-common-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -140,7 +140,7 @@ <Tool Name="VCLinkerTool" AdditionalDependencies="ws2.lib" - OutputFile="..\bin\pjlib-test-$(TargetCPU)-wm6std-vc$(VSVer)-$(ConfigurationName).exe" + OutputFile="..\bin\pjlib-test-$(TargetCPU)-wm6std-vc$(VSVer)-$(ConfigurationName).exe" /> <Tool Name="VCALinkTool" @@ -168,10 +168,10 @@ </Configuration> <Configuration Name="Debug|Windows Mobile 6 Professional SDK (ARMV4I)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm6-common-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" ConfigurationType="1" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm6-common-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -206,7 +206,7 @@ <Tool Name="VCLinkerTool" AdditionalDependencies="ws2.lib" - OutputFile="..\bin\pjlib-test-$(TargetCPU)-wm6pro-vc$(VSVer)-$(ConfigurationName).exe" + OutputFile="..\bin\pjlib-test-$(TargetCPU)-wm6pro-vc$(VSVer)-$(ConfigurationName).exe" /> <Tool Name="VCALinkTool" @@ -233,12 +233,11 @@ /> </Configuration> <Configuration - Name="Release|Win32" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-win32-release-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="2" + Name="Debug|Pocket PC 2003 (ARMV4)" ConfigurationType="1" - UseOfMFC="0" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm2003-common-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -257,7 +256,7 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_CONSOLE;" + ExecutionBucket="7" AdditionalIncludeDirectories="../include" PrecompiledHeaderFile="" /> @@ -272,15 +271,12 @@ /> <Tool Name="VCLinkerTool" - AdditionalDependencies="netapi32.lib mswsock.lib ws2_32.lib odbc32.lib odbccp32.lib oleaut32.lib ole32.lib" - OutputFile="..\bin\pjlib-test-$(TargetCPU)-$(PlatformName)-vc$(VSVer)-$(ConfigurationName).exe" + AdditionalDependencies="ws2.lib" + OutputFile="..\bin\pjlib-test-$(TargetCPU)-wm2003ppc-vc$(VSVer)-$(ConfigurationName).exe" /> <Tool Name="VCALinkTool" /> - <Tool - Name="VCManifestTool" - /> <Tool Name="VCXDCMakeTool" /> @@ -288,24 +284,26 @@ Name="VCBscMakeTool" /> <Tool - Name="VCFxCopTool" + Name="VCCodeSignTool" /> <Tool - Name="VCAppVerifierTool" + Name="VCPostBuildEventTool" /> - <Tool - Name="VCWebDeploymentTool" + <DeploymentTool + ForceDirty="-1" + RemoteDirectory="" + RegisterOutput="0" + AdditionalFiles="" /> - <Tool - Name="VCPostBuildEventTool" + <DebuggerTool /> </Configuration> <Configuration - Name="Release|Windows Mobile 6 Standard SDK (ARMV4I)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm6-release-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Debug|Smartphone 2003 (ARMV4)" ConfigurationType="1" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm2003-common-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -340,7 +338,7 @@ <Tool Name="VCLinkerTool" AdditionalDependencies="ws2.lib" - OutputFile="..\bin\pjlib-test-$(TargetCPU)-wm6std-vc$(VSVer)-$(ConfigurationName).exe" + OutputFile="..\bin\pjlib-test-$(TargetCPU)-wm2003sp-vc$(VSVer)-$(ConfigurationName).exe" /> <Tool Name="VCALinkTool" @@ -367,11 +365,11 @@ /> </Configuration> <Configuration - Name="Release|Windows Mobile 6 Professional SDK (ARMV4I)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm6-release-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ConfigurationType="1" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm5-common-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -406,7 +404,7 @@ <Tool Name="VCLinkerTool" AdditionalDependencies="ws2.lib" - OutputFile="..\bin\pjlib-test-$(TargetCPU)-wm6pro-vc$(VSVer)-$(ConfigurationName).exe" + OutputFile="..\bin\pjlib-test-$(TargetCPU)-wm5ppc-vc$(VSVer)-$(ConfigurationName).exe" /> <Tool Name="VCALinkTool" @@ -433,12 +431,11 @@ /> </Configuration> <Configuration - Name="Debug-Static|Win32" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-win32-common-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="2" + Name="Debug|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ConfigurationType="1" - UseOfMFC="0" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm5-common-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -457,7 +454,7 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_CONSOLE;" + ExecutionBucket="7" AdditionalIncludeDirectories="../include" PrecompiledHeaderFile="" /> @@ -472,15 +469,12 @@ /> <Tool Name="VCLinkerTool" - AdditionalDependencies="netapi32.lib mswsock.lib ws2_32.lib odbc32.lib odbccp32.lib oleaut32.lib ole32.lib" - OutputFile="..\bin\pjlib-test-$(TargetCPU)-$(PlatformName)-vc$(VSVer)-$(ConfigurationName).exe" + AdditionalDependencies="ws2.lib" + OutputFile="..\bin\pjlib-test-$(TargetCPU)-wm5sp-vc$(VSVer)-$(ConfigurationName).exe" /> <Tool Name="VCALinkTool" /> - <Tool - Name="VCManifestTool" - /> <Tool Name="VCXDCMakeTool" /> @@ -488,24 +482,27 @@ Name="VCBscMakeTool" /> <Tool - Name="VCFxCopTool" + Name="VCCodeSignTool" /> <Tool - Name="VCAppVerifierTool" + Name="VCPostBuildEventTool" /> - <Tool - Name="VCWebDeploymentTool" + <DeploymentTool + ForceDirty="-1" + RemoteDirectory="" + RegisterOutput="0" + AdditionalFiles="" /> - <Tool - Name="VCPostBuildEventTool" + <DebuggerTool /> </Configuration> <Configuration - Name="Debug-Static|Windows Mobile 6 Standard SDK (ARMV4I)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm6-common-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Release|Win32" ConfigurationType="1" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-win32-release-defaults.vsprops" + UseOfMFC="0" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="2" > <Tool Name="VCPreBuildEventTool" @@ -524,8 +521,8 @@ /> <Tool Name="VCCLCompilerTool" - ExecutionBucket="7" AdditionalIncludeDirectories="../include" + PreprocessorDefinitions="_CONSOLE;" PrecompiledHeaderFile="" /> <Tool @@ -539,12 +536,15 @@ /> <Tool Name="VCLinkerTool" - AdditionalDependencies="ws2.lib" - OutputFile="..\bin\pjlib-test-$(TargetCPU)-wm6std-vc$(VSVer)-$(ConfigurationName).exe" + AdditionalDependencies="netapi32.lib mswsock.lib ws2_32.lib odbc32.lib odbccp32.lib oleaut32.lib ole32.lib" + OutputFile="..\bin\pjlib-test-$(TargetCPU)-$(PlatformName)-vc$(VSVer)-$(ConfigurationName).exe" /> <Tool Name="VCALinkTool" /> + <Tool + Name="VCManifestTool" + /> <Tool Name="VCXDCMakeTool" /> @@ -552,26 +552,24 @@ Name="VCBscMakeTool" /> <Tool - Name="VCCodeSignTool" + Name="VCFxCopTool" /> <Tool - Name="VCPostBuildEventTool" + Name="VCAppVerifierTool" /> - <DeploymentTool - ForceDirty="-1" - RemoteDirectory="" - RegisterOutput="0" - AdditionalFiles="" + <Tool + Name="VCWebDeploymentTool" /> - <DebuggerTool + <Tool + Name="VCPostBuildEventTool" /> </Configuration> <Configuration - Name="Debug-Static|Windows Mobile 6 Professional SDK (ARMV4I)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm6-common-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Release|Windows Mobile 6 Standard SDK (ARMV4I)" ConfigurationType="1" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm6-release-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -606,7 +604,7 @@ <Tool Name="VCLinkerTool" AdditionalDependencies="ws2.lib" - OutputFile="..\bin\pjlib-test-$(TargetCPU)-wm6pro-vc$(VSVer)-$(ConfigurationName).exe" + OutputFile="..\bin\pjlib-test-$(TargetCPU)-wm6std-vc$(VSVer)-$(ConfigurationName).exe" /> <Tool Name="VCALinkTool" @@ -633,12 +631,11 @@ /> </Configuration> <Configuration - Name="Release-Dynamic|Win32" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-win32-release-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="2" + Name="Release|Windows Mobile 6 Professional SDK (ARMV4I)" ConfigurationType="1" - UseOfMFC="0" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm6-release-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -657,7 +654,7 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_CONSOLE;" + ExecutionBucket="7" AdditionalIncludeDirectories="../include" PrecompiledHeaderFile="" /> @@ -672,15 +669,12 @@ /> <Tool Name="VCLinkerTool" - AdditionalDependencies="netapi32.lib mswsock.lib ws2_32.lib odbc32.lib odbccp32.lib oleaut32.lib ole32.lib" - OutputFile="..\bin\pjlib-test-$(TargetCPU)-$(PlatformName)-vc$(VSVer)-$(ConfigurationName).exe" + AdditionalDependencies="ws2.lib" + OutputFile="..\bin\pjlib-test-$(TargetCPU)-wm6pro-vc$(VSVer)-$(ConfigurationName).exe" /> <Tool Name="VCALinkTool" /> - <Tool - Name="VCManifestTool" - /> <Tool Name="VCXDCMakeTool" /> @@ -688,24 +682,26 @@ Name="VCBscMakeTool" /> <Tool - Name="VCFxCopTool" + Name="VCCodeSignTool" /> <Tool - Name="VCAppVerifierTool" + Name="VCPostBuildEventTool" /> - <Tool - Name="VCWebDeploymentTool" + <DeploymentTool + ForceDirty="-1" + RemoteDirectory="" + RegisterOutput="0" + AdditionalFiles="" /> - <Tool - Name="VCPostBuildEventTool" + <DebuggerTool /> </Configuration> <Configuration - Name="Release-Dynamic|Windows Mobile 6 Standard SDK (ARMV4I)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm6-release-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Release|Pocket PC 2003 (ARMV4)" ConfigurationType="1" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm2003-release-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -740,7 +736,7 @@ <Tool Name="VCLinkerTool" AdditionalDependencies="ws2.lib" - OutputFile="..\bin\pjlib-test-$(TargetCPU)-wm6std-vc$(VSVer)-$(ConfigurationName).exe" + OutputFile="..\bin\pjlib-test-$(TargetCPU)-wm2003ppc-vc$(VSVer)-$(ConfigurationName).exe" /> <Tool Name="VCALinkTool" @@ -767,11 +763,11 @@ /> </Configuration> <Configuration - Name="Release-Dynamic|Windows Mobile 6 Professional SDK (ARMV4I)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm6-release-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Release|Smartphone 2003 (ARMV4)" ConfigurationType="1" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm2003-release-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -806,7 +802,7 @@ <Tool Name="VCLinkerTool" AdditionalDependencies="ws2.lib" - OutputFile="..\bin\pjlib-test-$(TargetCPU)-wm6pro-vc$(VSVer)-$(ConfigurationName).exe" + OutputFile="..\bin\pjlib-test-$(TargetCPU)-wm2003sp-vc$(VSVer)-$(ConfigurationName).exe" /> <Tool Name="VCALinkTool" @@ -833,12 +829,11 @@ /> </Configuration> <Configuration - Name="Debug-Dynamic|Win32" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-win32-common-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="2" + Name="Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ConfigurationType="1" - UseOfMFC="0" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm5-release-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -857,7 +852,7 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_CONSOLE;" + ExecutionBucket="7" AdditionalIncludeDirectories="../include" PrecompiledHeaderFile="" /> @@ -872,15 +867,12 @@ /> <Tool Name="VCLinkerTool" - AdditionalDependencies="netapi32.lib mswsock.lib ws2_32.lib odbc32.lib odbccp32.lib oleaut32.lib ole32.lib" - OutputFile="..\bin\pjlib-test-$(TargetCPU)-$(PlatformName)-vc$(VSVer)-$(ConfigurationName).exe" + AdditionalDependencies="ws2.lib" + OutputFile="..\bin\pjlib-test-$(TargetCPU)-wm5ppc-vc$(VSVer)-$(ConfigurationName).exe" /> <Tool Name="VCALinkTool" /> - <Tool - Name="VCManifestTool" - /> <Tool Name="VCXDCMakeTool" /> @@ -888,24 +880,26 @@ Name="VCBscMakeTool" /> <Tool - Name="VCFxCopTool" + Name="VCCodeSignTool" /> <Tool - Name="VCAppVerifierTool" + Name="VCPostBuildEventTool" /> - <Tool - Name="VCWebDeploymentTool" + <DeploymentTool + ForceDirty="-1" + RemoteDirectory="" + RegisterOutput="0" + AdditionalFiles="" /> - <Tool - Name="VCPostBuildEventTool" + <DebuggerTool /> </Configuration> <Configuration - Name="Debug-Dynamic|Windows Mobile 6 Standard SDK (ARMV4I)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm6-common-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Release|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ConfigurationType="1" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm5-release-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -940,7 +934,7 @@ <Tool Name="VCLinkerTool" AdditionalDependencies="ws2.lib" - OutputFile="..\bin\pjlib-test-$(TargetCPU)-wm6std-vc$(VSVer)-$(ConfigurationName).exe" + OutputFile="..\bin\pjlib-test-$(TargetCPU)-wm5sp-vc$(VSVer)-$(ConfigurationName).exe" /> <Tool Name="VCALinkTool" @@ -967,11 +961,12 @@ /> </Configuration> <Configuration - Name="Debug-Dynamic|Windows Mobile 6 Professional SDK (ARMV4I)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm6-common-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Debug-Static|Win32" ConfigurationType="1" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-win32-common-defaults.vsprops" + UseOfMFC="0" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="2" > <Tool Name="VCPreBuildEventTool" @@ -990,8 +985,8 @@ /> <Tool Name="VCCLCompilerTool" - ExecutionBucket="7" AdditionalIncludeDirectories="../include" + PreprocessorDefinitions="_CONSOLE;" PrecompiledHeaderFile="" /> <Tool @@ -1005,12 +1000,15 @@ /> <Tool Name="VCLinkerTool" - AdditionalDependencies="ws2.lib" - OutputFile="..\bin\pjlib-test-$(TargetCPU)-wm6pro-vc$(VSVer)-$(ConfigurationName).exe" + AdditionalDependencies="netapi32.lib mswsock.lib ws2_32.lib odbc32.lib odbccp32.lib oleaut32.lib ole32.lib" + OutputFile="..\bin\pjlib-test-$(TargetCPU)-$(PlatformName)-vc$(VSVer)-$(ConfigurationName).exe" /> <Tool Name="VCALinkTool" /> + <Tool + Name="VCManifestTool" + /> <Tool Name="VCXDCMakeTool" /> @@ -1018,27 +1016,24 @@ Name="VCBscMakeTool" /> <Tool - Name="VCCodeSignTool" + Name="VCFxCopTool" /> <Tool - Name="VCPostBuildEventTool" + Name="VCAppVerifierTool" /> - <DeploymentTool - ForceDirty="-1" - RemoteDirectory="" - RegisterOutput="0" - AdditionalFiles="" + <Tool + Name="VCWebDeploymentTool" /> - <DebuggerTool + <Tool + Name="VCPostBuildEventTool" /> </Configuration> <Configuration - Name="Release-Static|Win32" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-win32-release-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="2" + Name="Debug-Static|Windows Mobile 6 Standard SDK (ARMV4I)" ConfigurationType="1" - UseOfMFC="0" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm6-common-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -1057,7 +1052,7 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_CONSOLE;" + ExecutionBucket="7" AdditionalIncludeDirectories="../include" PrecompiledHeaderFile="" /> @@ -1072,15 +1067,12 @@ /> <Tool Name="VCLinkerTool" - AdditionalDependencies="netapi32.lib mswsock.lib ws2_32.lib odbc32.lib odbccp32.lib oleaut32.lib ole32.lib" - OutputFile="..\bin\pjlib-test-$(TargetCPU)-$(PlatformName)-vc$(VSVer)-$(ConfigurationName).exe" + AdditionalDependencies="ws2.lib" + OutputFile="..\bin\pjlib-test-$(TargetCPU)-wm6std-vc$(VSVer)-$(ConfigurationName).exe" /> <Tool Name="VCALinkTool" /> - <Tool - Name="VCManifestTool" - /> <Tool Name="VCXDCMakeTool" /> @@ -1088,24 +1080,26 @@ Name="VCBscMakeTool" /> <Tool - Name="VCFxCopTool" + Name="VCCodeSignTool" /> <Tool - Name="VCAppVerifierTool" + Name="VCPostBuildEventTool" /> - <Tool - Name="VCWebDeploymentTool" + <DeploymentTool + ForceDirty="-1" + RemoteDirectory="" + RegisterOutput="0" + AdditionalFiles="" /> - <Tool - Name="VCPostBuildEventTool" + <DebuggerTool /> </Configuration> <Configuration - Name="Release-Static|Windows Mobile 6 Standard SDK (ARMV4I)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm6-release-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Debug-Static|Windows Mobile 6 Professional SDK (ARMV4I)" ConfigurationType="1" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm6-common-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -1140,7 +1134,7 @@ <Tool Name="VCLinkerTool" AdditionalDependencies="ws2.lib" - OutputFile="..\bin\pjlib-test-$(TargetCPU)-wm6std-vc$(VSVer)-$(ConfigurationName).exe" + OutputFile="..\bin\pjlib-test-$(TargetCPU)-wm6pro-vc$(VSVer)-$(ConfigurationName).exe" /> <Tool Name="VCALinkTool" @@ -1167,11 +1161,11 @@ /> </Configuration> <Configuration - Name="Release-Static|Windows Mobile 6 Professional SDK (ARMV4I)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm6-release-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Debug-Static|Pocket PC 2003 (ARMV4)" ConfigurationType="1" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm2003-common-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -1206,7 +1200,7 @@ <Tool Name="VCLinkerTool" AdditionalDependencies="ws2.lib" - OutputFile="..\bin\pjlib-test-$(TargetCPU)-wm6pro-vc$(VSVer)-$(ConfigurationName).exe" + OutputFile="..\bin\pjlib-test-$(TargetCPU)-wm2003ppc-vc$(VSVer)-$(ConfigurationName).exe" /> <Tool Name="VCALinkTool" @@ -1233,11 +1227,11 @@ /> </Configuration> <Configuration - Name="Debug|Pocket PC 2003 (ARMV4)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm2003-common-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Debug-Static|Smartphone 2003 (ARMV4)" ConfigurationType="1" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm2003-common-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -1272,7 +1266,7 @@ <Tool Name="VCLinkerTool" AdditionalDependencies="ws2.lib" - OutputFile="..\bin\pjlib-test-$(TargetCPU)-wm2003ppc-vc$(VSVer)-$(ConfigurationName).exe" + OutputFile="..\bin\pjlib-test-$(TargetCPU)-wm2003sp-vc$(VSVer)-$(ConfigurationName).exe" /> <Tool Name="VCALinkTool" @@ -1299,11 +1293,11 @@ /> </Configuration> <Configuration - Name="Release|Pocket PC 2003 (ARMV4)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm2003-release-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Debug-Static|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ConfigurationType="1" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm5-common-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -1338,7 +1332,7 @@ <Tool Name="VCLinkerTool" AdditionalDependencies="ws2.lib" - OutputFile="..\bin\pjlib-test-$(TargetCPU)-wm2003ppc-vc$(VSVer)-$(ConfigurationName).exe" + OutputFile="..\bin\pjlib-test-$(TargetCPU)-wm5ppc-vc$(VSVer)-$(ConfigurationName).exe" /> <Tool Name="VCALinkTool" @@ -1365,11 +1359,11 @@ /> </Configuration> <Configuration - Name="Debug-Static|Pocket PC 2003 (ARMV4)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm2003-common-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Debug-Static|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ConfigurationType="1" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm5-common-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -1404,7 +1398,7 @@ <Tool Name="VCLinkerTool" AdditionalDependencies="ws2.lib" - OutputFile="..\bin\pjlib-test-$(TargetCPU)-wm2003ppc-vc$(VSVer)-$(ConfigurationName).exe" + OutputFile="..\bin\pjlib-test-$(TargetCPU)-wm5sp-vc$(VSVer)-$(ConfigurationName).exe" /> <Tool Name="VCALinkTool" @@ -1431,11 +1425,12 @@ /> </Configuration> <Configuration - Name="Release-Dynamic|Pocket PC 2003 (ARMV4)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm2003-release-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Release-Dynamic|Win32" ConfigurationType="1" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-win32-release-defaults.vsprops" + UseOfMFC="0" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="2" > <Tool Name="VCPreBuildEventTool" @@ -1454,8 +1449,8 @@ /> <Tool Name="VCCLCompilerTool" - ExecutionBucket="7" AdditionalIncludeDirectories="../include" + PreprocessorDefinitions="_CONSOLE;" PrecompiledHeaderFile="" /> <Tool @@ -1469,12 +1464,15 @@ /> <Tool Name="VCLinkerTool" - AdditionalDependencies="ws2.lib" - OutputFile="..\bin\pjlib-test-$(TargetCPU)-wm2003ppc-vc$(VSVer)-$(ConfigurationName).exe" + AdditionalDependencies="netapi32.lib mswsock.lib ws2_32.lib odbc32.lib odbccp32.lib oleaut32.lib ole32.lib" + OutputFile="..\bin\pjlib-test-$(TargetCPU)-$(PlatformName)-vc$(VSVer)-$(ConfigurationName).exe" /> <Tool Name="VCALinkTool" /> + <Tool + Name="VCManifestTool" + /> <Tool Name="VCXDCMakeTool" /> @@ -1482,26 +1480,24 @@ Name="VCBscMakeTool" /> <Tool - Name="VCCodeSignTool" + Name="VCFxCopTool" /> <Tool - Name="VCPostBuildEventTool" + Name="VCAppVerifierTool" /> - <DeploymentTool - ForceDirty="-1" - RemoteDirectory="" - RegisterOutput="0" - AdditionalFiles="" + <Tool + Name="VCWebDeploymentTool" /> - <DebuggerTool + <Tool + Name="VCPostBuildEventTool" /> </Configuration> <Configuration - Name="Debug-Dynamic|Pocket PC 2003 (ARMV4)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm2003-common-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Release-Dynamic|Windows Mobile 6 Standard SDK (ARMV4I)" ConfigurationType="1" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm6-release-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -1536,7 +1532,7 @@ <Tool Name="VCLinkerTool" AdditionalDependencies="ws2.lib" - OutputFile="..\bin\pjlib-test-$(TargetCPU)-wm2003ppc-vc$(VSVer)-$(ConfigurationName).exe" + OutputFile="..\bin\pjlib-test-$(TargetCPU)-wm6std-vc$(VSVer)-$(ConfigurationName).exe" /> <Tool Name="VCALinkTool" @@ -1563,11 +1559,11 @@ /> </Configuration> <Configuration - Name="Release-Static|Pocket PC 2003 (ARMV4)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm2003-release-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Release-Dynamic|Windows Mobile 6 Professional SDK (ARMV4I)" ConfigurationType="1" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm6-release-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -1602,7 +1598,7 @@ <Tool Name="VCLinkerTool" AdditionalDependencies="ws2.lib" - OutputFile="..\bin\pjlib-test-$(TargetCPU)-wm2003ppc-vc$(VSVer)-$(ConfigurationName).exe" + OutputFile="..\bin\pjlib-test-$(TargetCPU)-wm6pro-vc$(VSVer)-$(ConfigurationName).exe" /> <Tool Name="VCALinkTool" @@ -1629,11 +1625,11 @@ /> </Configuration> <Configuration - Name="Debug|Smartphone 2003 (ARMV4)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm2003-common-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Release-Dynamic|Pocket PC 2003 (ARMV4)" ConfigurationType="1" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm2003-release-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -1668,7 +1664,7 @@ <Tool Name="VCLinkerTool" AdditionalDependencies="ws2.lib" - OutputFile="..\bin\pjlib-test-$(TargetCPU)-wm2003sp-vc$(VSVer)-$(ConfigurationName).exe" + OutputFile="..\bin\pjlib-test-$(TargetCPU)-wm2003ppc-vc$(VSVer)-$(ConfigurationName).exe" /> <Tool Name="VCALinkTool" @@ -1695,11 +1691,11 @@ /> </Configuration> <Configuration - Name="Release|Smartphone 2003 (ARMV4)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm2003-release-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Release-Dynamic|Smartphone 2003 (ARMV4)" ConfigurationType="1" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm2003-release-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -1734,7 +1730,7 @@ <Tool Name="VCLinkerTool" AdditionalDependencies="ws2.lib" - OutputFile="..\bin\pjlib-test-$(TargetCPU)-wm2003sp-vc$(VSVer)-$(ConfigurationName).exe" + OutputFile="..\bin\pjlib-test-$(TargetCPU)-wm2003sp-vc$(VSVer)-$(ConfigurationName).exe" /> <Tool Name="VCALinkTool" @@ -1761,11 +1757,11 @@ /> </Configuration> <Configuration - Name="Debug-Static|Smartphone 2003 (ARMV4)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm2003-common-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Release-Dynamic|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ConfigurationType="1" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm5-release-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -1800,7 +1796,7 @@ <Tool Name="VCLinkerTool" AdditionalDependencies="ws2.lib" - OutputFile="..\bin\pjlib-test-$(TargetCPU)-wm2003sp-vc$(VSVer)-$(ConfigurationName).exe" + OutputFile="..\bin\pjlib-test-$(TargetCPU)-wm5ppc-vc$(VSVer)-$(ConfigurationName).exe" /> <Tool Name="VCALinkTool" @@ -1827,11 +1823,11 @@ /> </Configuration> <Configuration - Name="Release-Dynamic|Smartphone 2003 (ARMV4)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm2003-release-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Release-Dynamic|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ConfigurationType="1" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm5-release-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -1866,7 +1862,7 @@ <Tool Name="VCLinkerTool" AdditionalDependencies="ws2.lib" - OutputFile="..\bin\pjlib-test-$(TargetCPU)-wm2003sp-vc$(VSVer)-$(ConfigurationName).exe" + OutputFile="..\bin\pjlib-test-$(TargetCPU)-wm5sp-vc$(VSVer)-$(ConfigurationName).exe" /> <Tool Name="VCALinkTool" @@ -1893,11 +1889,12 @@ /> </Configuration> <Configuration - Name="Debug-Dynamic|Smartphone 2003 (ARMV4)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm2003-common-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Debug-Dynamic|Win32" ConfigurationType="1" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-win32-common-defaults.vsprops" + UseOfMFC="0" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="2" > <Tool Name="VCPreBuildEventTool" @@ -1916,8 +1913,8 @@ /> <Tool Name="VCCLCompilerTool" - ExecutionBucket="7" AdditionalIncludeDirectories="../include" + PreprocessorDefinitions="_CONSOLE;" PrecompiledHeaderFile="" /> <Tool @@ -1931,12 +1928,15 @@ /> <Tool Name="VCLinkerTool" - AdditionalDependencies="ws2.lib" - OutputFile="..\bin\pjlib-test-$(TargetCPU)-wm2003sp-vc$(VSVer)-$(ConfigurationName).exe" + AdditionalDependencies="netapi32.lib mswsock.lib ws2_32.lib odbc32.lib odbccp32.lib oleaut32.lib ole32.lib" + OutputFile="..\bin\pjlib-test-$(TargetCPU)-$(PlatformName)-vc$(VSVer)-$(ConfigurationName).exe" /> <Tool Name="VCALinkTool" /> + <Tool + Name="VCManifestTool" + /> <Tool Name="VCXDCMakeTool" /> @@ -1944,26 +1944,24 @@ Name="VCBscMakeTool" /> <Tool - Name="VCCodeSignTool" + Name="VCFxCopTool" /> <Tool - Name="VCPostBuildEventTool" + Name="VCAppVerifierTool" /> - <DeploymentTool - ForceDirty="-1" - RemoteDirectory="" - RegisterOutput="0" - AdditionalFiles="" + <Tool + Name="VCWebDeploymentTool" /> - <DebuggerTool + <Tool + Name="VCPostBuildEventTool" /> </Configuration> <Configuration - Name="Release-Static|Smartphone 2003 (ARMV4)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm2003-release-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Debug-Dynamic|Windows Mobile 6 Standard SDK (ARMV4I)" ConfigurationType="1" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm6-common-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -1998,7 +1996,7 @@ <Tool Name="VCLinkerTool" AdditionalDependencies="ws2.lib" - OutputFile="..\bin\pjlib-test-$(TargetCPU)-wm2003sp-vc$(VSVer)-$(ConfigurationName).exe" + OutputFile="..\bin\pjlib-test-$(TargetCPU)-wm6std-vc$(VSVer)-$(ConfigurationName).exe" /> <Tool Name="VCALinkTool" @@ -2025,11 +2023,11 @@ /> </Configuration> <Configuration - Name="Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm5-common-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Debug-Dynamic|Windows Mobile 6 Professional SDK (ARMV4I)" ConfigurationType="1" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm6-common-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -2064,7 +2062,7 @@ <Tool Name="VCLinkerTool" AdditionalDependencies="ws2.lib" - OutputFile="..\bin\pjlib-test-$(TargetCPU)-wm5ppc-vc$(VSVer)-$(ConfigurationName).exe" + OutputFile="..\bin\pjlib-test-$(TargetCPU)-wm6pro-vc$(VSVer)-$(ConfigurationName).exe" /> <Tool Name="VCALinkTool" @@ -2091,11 +2089,11 @@ /> </Configuration> <Configuration - Name="Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm5-release-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Debug-Dynamic|Pocket PC 2003 (ARMV4)" ConfigurationType="1" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm2003-common-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -2130,7 +2128,7 @@ <Tool Name="VCLinkerTool" AdditionalDependencies="ws2.lib" - OutputFile="..\bin\pjlib-test-$(TargetCPU)-wm5ppc-vc$(VSVer)-$(ConfigurationName).exe" + OutputFile="..\bin\pjlib-test-$(TargetCPU)-wm2003ppc-vc$(VSVer)-$(ConfigurationName).exe" /> <Tool Name="VCALinkTool" @@ -2157,11 +2155,11 @@ /> </Configuration> <Configuration - Name="Debug-Static|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm5-common-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Debug-Dynamic|Smartphone 2003 (ARMV4)" ConfigurationType="1" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm2003-common-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -2196,7 +2194,7 @@ <Tool Name="VCLinkerTool" AdditionalDependencies="ws2.lib" - OutputFile="..\bin\pjlib-test-$(TargetCPU)-wm5ppc-vc$(VSVer)-$(ConfigurationName).exe" + OutputFile="..\bin\pjlib-test-$(TargetCPU)-wm2003sp-vc$(VSVer)-$(ConfigurationName).exe" /> <Tool Name="VCALinkTool" @@ -2223,11 +2221,11 @@ /> </Configuration> <Configuration - Name="Release-Dynamic|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm5-release-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Debug-Dynamic|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ConfigurationType="1" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm5-common-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -2262,7 +2260,7 @@ <Tool Name="VCLinkerTool" AdditionalDependencies="ws2.lib" - OutputFile="..\bin\pjlib-test-$(TargetCPU)-wm5ppc-vc$(VSVer)-$(ConfigurationName).exe" + OutputFile="..\bin\pjlib-test-$(TargetCPU)-wm5ppc-vc$(VSVer)-$(ConfigurationName).exe" /> <Tool Name="VCALinkTool" @@ -2289,11 +2287,11 @@ /> </Configuration> <Configuration - Name="Debug-Dynamic|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm5-common-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Debug-Dynamic|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ConfigurationType="1" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm5-common-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -2328,7 +2326,7 @@ <Tool Name="VCLinkerTool" AdditionalDependencies="ws2.lib" - OutputFile="..\bin\pjlib-test-$(TargetCPU)-wm5ppc-vc$(VSVer)-$(ConfigurationName).exe" + OutputFile="..\bin\pjlib-test-$(TargetCPU)-wm5sp-vc$(VSVer)-$(ConfigurationName).exe" /> <Tool Name="VCALinkTool" @@ -2355,11 +2353,12 @@ /> </Configuration> <Configuration - Name="Release-Static|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm5-release-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Release-Static|Win32" ConfigurationType="1" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-win32-release-defaults.vsprops" + UseOfMFC="0" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="2" > <Tool Name="VCPreBuildEventTool" @@ -2378,8 +2377,8 @@ /> <Tool Name="VCCLCompilerTool" - ExecutionBucket="7" AdditionalIncludeDirectories="../include" + PreprocessorDefinitions="_CONSOLE;" PrecompiledHeaderFile="" /> <Tool @@ -2393,12 +2392,15 @@ /> <Tool Name="VCLinkerTool" - AdditionalDependencies="ws2.lib" - OutputFile="..\bin\pjlib-test-$(TargetCPU)-wm5ppc-vc$(VSVer)-$(ConfigurationName).exe" + AdditionalDependencies="netapi32.lib mswsock.lib ws2_32.lib odbc32.lib odbccp32.lib oleaut32.lib ole32.lib" + OutputFile="..\bin\pjlib-test-$(TargetCPU)-$(PlatformName)-vc$(VSVer)-$(ConfigurationName).exe" /> <Tool Name="VCALinkTool" /> + <Tool + Name="VCManifestTool" + /> <Tool Name="VCXDCMakeTool" /> @@ -2406,26 +2408,24 @@ Name="VCBscMakeTool" /> <Tool - Name="VCCodeSignTool" + Name="VCFxCopTool" /> <Tool - Name="VCPostBuildEventTool" + Name="VCAppVerifierTool" /> - <DeploymentTool - ForceDirty="-1" - RemoteDirectory="" - RegisterOutput="0" - AdditionalFiles="" + <Tool + Name="VCWebDeploymentTool" /> - <DebuggerTool + <Tool + Name="VCPostBuildEventTool" /> </Configuration> <Configuration - Name="Debug|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm5-common-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Release-Static|Windows Mobile 6 Standard SDK (ARMV4I)" ConfigurationType="1" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm6-release-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -2460,7 +2460,7 @@ <Tool Name="VCLinkerTool" AdditionalDependencies="ws2.lib" - OutputFile="..\bin\pjlib-test-$(TargetCPU)-wm5sp-vc$(VSVer)-$(ConfigurationName).exe" + OutputFile="..\bin\pjlib-test-$(TargetCPU)-wm6std-vc$(VSVer)-$(ConfigurationName).exe" /> <Tool Name="VCALinkTool" @@ -2487,11 +2487,11 @@ /> </Configuration> <Configuration - Name="Release|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm5-release-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Release-Static|Windows Mobile 6 Professional SDK (ARMV4I)" ConfigurationType="1" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm6-release-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -2526,7 +2526,7 @@ <Tool Name="VCLinkerTool" AdditionalDependencies="ws2.lib" - OutputFile="..\bin\pjlib-test-$(TargetCPU)-wm5sp-vc$(VSVer)-$(ConfigurationName).exe" + OutputFile="..\bin\pjlib-test-$(TargetCPU)-wm6pro-vc$(VSVer)-$(ConfigurationName).exe" /> <Tool Name="VCALinkTool" @@ -2553,11 +2553,11 @@ /> </Configuration> <Configuration - Name="Debug-Static|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm5-common-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Release-Static|Pocket PC 2003 (ARMV4)" ConfigurationType="1" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm2003-release-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -2592,7 +2592,7 @@ <Tool Name="VCLinkerTool" AdditionalDependencies="ws2.lib" - OutputFile="..\bin\pjlib-test-$(TargetCPU)-wm5sp-vc$(VSVer)-$(ConfigurationName).exe" + OutputFile="..\bin\pjlib-test-$(TargetCPU)-wm2003ppc-vc$(VSVer)-$(ConfigurationName).exe" /> <Tool Name="VCALinkTool" @@ -2619,11 +2619,11 @@ /> </Configuration> <Configuration - Name="Release-Dynamic|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm5-release-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Release-Static|Smartphone 2003 (ARMV4)" ConfigurationType="1" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm2003-release-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -2658,7 +2658,7 @@ <Tool Name="VCLinkerTool" AdditionalDependencies="ws2.lib" - OutputFile="..\bin\pjlib-test-$(TargetCPU)-wm5sp-vc$(VSVer)-$(ConfigurationName).exe" + OutputFile="..\bin\pjlib-test-$(TargetCPU)-wm2003sp-vc$(VSVer)-$(ConfigurationName).exe" /> <Tool Name="VCALinkTool" @@ -2685,11 +2685,11 @@ /> </Configuration> <Configuration - Name="Debug-Dynamic|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm5-common-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Release-Static|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ConfigurationType="1" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm5-release-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -2724,7 +2724,7 @@ <Tool Name="VCLinkerTool" AdditionalDependencies="ws2.lib" - OutputFile="..\bin\pjlib-test-$(TargetCPU)-wm5sp-vc$(VSVer)-$(ConfigurationName).exe" + OutputFile="..\bin\pjlib-test-$(TargetCPU)-wm5ppc-vc$(VSVer)-$(ConfigurationName).exe" /> <Tool Name="VCALinkTool" @@ -2752,10 +2752,10 @@ </Configuration> <Configuration Name="Release-Static|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm5-release-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" ConfigurationType="1" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm5-release-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -2790,7 +2790,7 @@ <Tool Name="VCLinkerTool" AdditionalDependencies="ws2.lib" - OutputFile="..\bin\pjlib-test-$(TargetCPU)-wm5sp-vc$(VSVer)-$(ConfigurationName).exe" + OutputFile="..\bin\pjlib-test-$(TargetCPU)-wm5sp-vc$(VSVer)-$(ConfigurationName).exe" /> <Tool Name="VCALinkTool" @@ -3499,16 +3499,15 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Win32" + Name="Debug|Pocket PC 2003 (ARMV4)" + ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Release|Windows Mobile 6 Standard SDK (ARMV4I)" + Name="Debug|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -3516,7 +3515,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Windows Mobile 6 Professional SDK (ARMV4I)" + Name="Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -3524,24 +3523,24 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Win32" + Name="Debug|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" + ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Windows Mobile 6 Standard SDK (ARMV4I)" - ExcludedFromBuild="true" + Name="Release|Win32" > <Tool Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Windows Mobile 6 Professional SDK (ARMV4I)" + Name="Release|Windows Mobile 6 Standard SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -3549,16 +3548,15 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Win32" + Name="Release|Windows Mobile 6 Professional SDK (ARMV4I)" + ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Windows Mobile 6 Standard SDK (ARMV4I)" + Name="Release|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -3566,7 +3564,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Windows Mobile 6 Professional SDK (ARMV4I)" + Name="Release|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -3574,16 +3572,15 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Win32" + Name="Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Windows Mobile 6 Standard SDK (ARMV4I)" + Name="Release|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -3591,24 +3588,24 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Windows Mobile 6 Professional SDK (ARMV4I)" - ExcludedFromBuild="true" + Name="Debug-Static|Win32" > <Tool Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Win32" + Name="Debug-Static|Windows Mobile 6 Standard SDK (ARMV4I)" + ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Windows Mobile 6 Standard SDK (ARMV4I)" + Name="Debug-Static|Windows Mobile 6 Professional SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -3616,7 +3613,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Windows Mobile 6 Professional SDK (ARMV4I)" + Name="Debug-Static|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -3624,7 +3621,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug|Pocket PC 2003 (ARMV4)" + Name="Debug-Static|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -3632,7 +3629,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Pocket PC 2003 (ARMV4)" + Name="Debug-Static|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -3640,7 +3637,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Pocket PC 2003 (ARMV4)" + Name="Debug-Static|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -3648,15 +3645,16 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Pocket PC 2003 (ARMV4)" - ExcludedFromBuild="true" + Name="Release-Dynamic|Win32" > <Tool Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Pocket PC 2003 (ARMV4)" + Name="Release-Dynamic|Windows Mobile 6 Standard SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -3664,7 +3662,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Pocket PC 2003 (ARMV4)" + Name="Release-Dynamic|Windows Mobile 6 Professional SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -3672,7 +3670,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug|Smartphone 2003 (ARMV4)" + Name="Release-Dynamic|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -3680,7 +3678,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Smartphone 2003 (ARMV4)" + Name="Release-Dynamic|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -3688,7 +3686,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Smartphone 2003 (ARMV4)" + Name="Release-Dynamic|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -3696,7 +3694,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Smartphone 2003 (ARMV4)" + Name="Release-Dynamic|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -3704,15 +3702,16 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Smartphone 2003 (ARMV4)" - ExcludedFromBuild="true" + Name="Debug-Dynamic|Win32" > <Tool Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Smartphone 2003 (ARMV4)" + Name="Debug-Dynamic|Windows Mobile 6 Standard SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -3720,7 +3719,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Debug-Dynamic|Windows Mobile 6 Professional SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -3728,7 +3727,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Debug-Dynamic|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -3736,7 +3735,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Debug-Dynamic|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -3744,7 +3743,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Debug-Dynamic|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -3752,7 +3751,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Debug-Dynamic|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -3760,15 +3759,16 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" - ExcludedFromBuild="true" + Name="Release-Static|Win32" > <Tool Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Debug|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" + Name="Release-Static|Windows Mobile 6 Standard SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -3776,7 +3776,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" + Name="Release-Static|Windows Mobile 6 Professional SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -3784,7 +3784,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" + Name="Release-Static|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -3792,7 +3792,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" + Name="Release-Static|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -3800,7 +3800,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" + Name="Release-Static|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -3846,17 +3846,15 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Win32" + Name="Debug|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Release|Windows Mobile 6 Standard SDK (ARMV4I)" + Name="Debug|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -3864,7 +3862,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Windows Mobile 6 Professional SDK (ARMV4I)" + Name="Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -3872,25 +3870,25 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Win32" + Name="Debug|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Windows Mobile 6 Standard SDK (ARMV4I)" + Name="Release|Win32" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Windows Mobile 6 Professional SDK (ARMV4I)" + Name="Release|Windows Mobile 6 Standard SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -3898,17 +3896,15 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Win32" + Name="Release|Windows Mobile 6 Professional SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Windows Mobile 6 Standard SDK (ARMV4I)" + Name="Release|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -3916,7 +3912,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Windows Mobile 6 Professional SDK (ARMV4I)" + Name="Release|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -3924,17 +3920,15 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Win32" + Name="Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Windows Mobile 6 Standard SDK (ARMV4I)" + Name="Release|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -3942,25 +3936,25 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Windows Mobile 6 Professional SDK (ARMV4I)" + Name="Debug-Static|Win32" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Win32" + Name="Debug-Static|Windows Mobile 6 Standard SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Windows Mobile 6 Standard SDK (ARMV4I)" + Name="Debug-Static|Windows Mobile 6 Professional SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -3968,7 +3962,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Windows Mobile 6 Professional SDK (ARMV4I)" + Name="Debug-Static|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -3976,7 +3970,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug|Pocket PC 2003 (ARMV4)" + Name="Debug-Static|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -3984,7 +3978,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Pocket PC 2003 (ARMV4)" + Name="Debug-Static|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -3992,7 +3986,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Pocket PC 2003 (ARMV4)" + Name="Debug-Static|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -4000,15 +3994,17 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Pocket PC 2003 (ARMV4)" + Name="Release-Dynamic|Win32" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Pocket PC 2003 (ARMV4)" + Name="Release-Dynamic|Windows Mobile 6 Standard SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -4016,7 +4012,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Pocket PC 2003 (ARMV4)" + Name="Release-Dynamic|Windows Mobile 6 Professional SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -4024,7 +4020,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug|Smartphone 2003 (ARMV4)" + Name="Release-Dynamic|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -4032,7 +4028,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Smartphone 2003 (ARMV4)" + Name="Release-Dynamic|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -4040,7 +4036,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Smartphone 2003 (ARMV4)" + Name="Release-Dynamic|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -4048,7 +4044,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Smartphone 2003 (ARMV4)" + Name="Release-Dynamic|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -4056,15 +4052,17 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Smartphone 2003 (ARMV4)" + Name="Debug-Dynamic|Win32" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Smartphone 2003 (ARMV4)" + Name="Debug-Dynamic|Windows Mobile 6 Standard SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -4072,7 +4070,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Debug-Dynamic|Windows Mobile 6 Professional SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -4080,7 +4078,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Debug-Dynamic|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -4088,7 +4086,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Debug-Dynamic|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -4096,7 +4094,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Debug-Dynamic|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -4104,7 +4102,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Debug-Dynamic|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -4112,15 +4110,17 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Release-Static|Win32" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Debug|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" + Name="Release-Static|Windows Mobile 6 Standard SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -4128,7 +4128,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" + Name="Release-Static|Windows Mobile 6 Professional SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -4136,7 +4136,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" + Name="Release-Static|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -4144,7 +4144,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" + Name="Release-Static|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -4152,7 +4152,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" + Name="Release-Static|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -4812,6 +4812,10 @@ /> </FileConfiguration> </File> + <File + RelativePath="..\src\pjlib-test\ssl_sock.c" + > + </File> <File RelativePath="..\src\pjlib-test\string.c" > diff --git a/sflphone-common/libs/pjproject/pjlib/build/privkey.pem b/sflphone-common/libs/pjproject/pjlib/build/privkey.pem new file mode 100644 index 0000000000000000000000000000000000000000..3241be208c6e216306bf716b0f40646cdcf2a2ad --- /dev/null +++ b/sflphone-common/libs/pjproject/pjlib/build/privkey.pem @@ -0,0 +1,27 @@ +-----BEGIN RSA PRIVATE KEY----- +MIIEpQIBAAKCAQEA1lr5y/qEgtEOjsBi7dmLoV0xMyFb9wfkhkO7Woweh91l1Xqv +tTZlPWM3Gt94OBUa1O5+LJmJii85tWp4gYTZiYwPrfoG8osypyzGgi6BudrVKFC3 +ADRilGhsJZr2RboA59nlYOlH1H0cxBm1d6t2vz80rDhD8LDHhd2DECT4ZKMj0C7V +oFF4D/PTcqt14xhrcP6plIEIxPGuvz9Ml3PpsiNIZgKZmfZwd2JpQeVt6ulqFNoB +oS13+Ndqx/y4HZz4TOIo0ueeCr/RHFA3UE065um2IOurY/qk3rew6JVDpU2d7yqb +git7bXivQmzT1c7DLAd8ggC0i80N+O6SMHy2iQIDAQABAoIBAQCAke7Ujz2d7WDq +9LAh8+NRdUFGZtLvd9d1RPkCVZsWaRBknIL5kVfmGzV5M+K62MXQRACAJdOeg7b8 +fpErNpD4dH8PHjG+lwlZxnyGpvh+jqhd1xP81m7ujzeW0ry2k9tpNYPkveespyJy +6Oy0i67dBT9FsTXnD1GNlJDBRTuLuEkTTBqbn/2s3+gUfChJ4HPmYMeO9HU4PcfM +yUsHatBiIkXiCKdDZVMDr5AUVD0Wo3uHPGJ8ZreURAjH+ldG09+/EsVoPberbrDZ +ZxJ70VKG+ZZTY8HZr9OsZhDZDrHiw9PdG7Hvg7bCvv+gDzZ/z8F+7YHjRjmD5Tp5 +Ex5hDco1AoGBAPfdfzwmqb79AXwYH0HZkkl2EXpzbR9LRgvWlOMSN3GlZhusvGQR +up6iGk9QnmoEtQS2IAuK4JT3r+yoM/20Nadq5ZUpkZ49SHuZ6+eZpotv3Fh8Oay8 +TAi2vBGM7EQPUOjPOWMRaYGBz3FT/GvUGPTeQ8jYt1gy8F18+A8xD8pTAoGBAN1j +7+yTly+M47U6mIUXcwoelaS4f/kMcwKHO0O182S4ktfjzc3TpQbHm68ws1rB3iFZ +SFOP/d04tVxZqPBhN2SpXRHGqTJxXthdTbu3scLMedlf4jY11SRiHX4PDnoBQ1GJ +NpdkMoex25Fw3AqSVpP61zo8sJkqpqjFfeQDbfgzAoGBAKyGx1ZmDwc6cjsfSzp5 +p+JsRVQ3XcBHk9UPooi/mEoJd55RyLvav0xFxwxoMCvZZOqHnpyKKTJniVOv7Khu +NF55AJ6n1Y0QWRB3ngWSJKOv0+7fYQHD+yShlRyeO6JQCuBRxT8Y0phrc6oNbIjd +lBV1VDdL6aqBol9gagWg/72zAoGBAK1rAx1F3z+YFSZ459AZNjvPCVkmTNhBMDXi +yEGZ3TYgfqYuA6AfET3mTcVFWLjW87EbxtPuDuWi7i2Q7gydmk53fDfYbeDdfXXu +YF2S3uPAWBI2UXQ1ZuhBEukT0jsvkhPkb6bXDd3NLDkZNsPxLXBtJPqxX4QbLME3 +Mg3RweqRAoGAJ4iXP2b4XWhg17qpDtpn8nhFxLNdhxdaDSKRL8oKQLteds3wS0fi +ZlaU1P9a3ygTpNquKlmdLJTQEDAVjV5DDlrQAPxtSSytHulNzXRMQFaeydar3Ssv +J07BPdQs6JEgV071rGGzBcL8ulo7qCdnGxU6GmhLkS4MBbTuqR6jmgU= +-----END RSA PRIVATE KEY----- diff --git a/sflphone-common/libs/pjproject/pjlib/include/pj/addr_resolv.h b/sflphone-common/libs/pjproject/pjlib/include/pj/addr_resolv.h index 71c0640cbf9f798048f9d957fbde8f34a624b941..04db2f08515a8a87d25c10c2190da84b704f0cac 100644 --- a/sflphone-common/libs/pjproject/pjlib/include/pj/addr_resolv.h +++ b/sflphone-common/libs/pjproject/pjlib/include/pj/addr_resolv.h @@ -1,4 +1,4 @@ -/* $Id: addr_resolv.h 2394 2008-12-23 17:27:53Z bennylp $ */ +/* $Id: addr_resolv.h 2908 2009-08-22 11:18:50Z bennylp $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> @@ -89,7 +89,8 @@ typedef struct pj_addrinfo * For host resolution function that also works with IPv6, please see * #pj_getaddrinfo(). * - * @param name Host name, or IPv4 address in standard dot notation. + * @param name Host name to resolve. Specifying IPv4 address here + * may fail on some platforms (e.g. Windows) * @param he The pj_hostent structure to be filled. Note that * the pointers in this structure points to temporary * variables which value will be reset upon subsequent diff --git a/sflphone-common/libs/pjproject/pjlib/include/pj/compat/cc_armcc.h b/sflphone-common/libs/pjproject/pjlib/include/pj/compat/cc_armcc.h index 7bf1c91bad1be4426dbacfc27983f18394a9f931..a6b8dfe90711e8fb542e0fb65e047d136d98a4d2 100644 --- a/sflphone-common/libs/pjproject/pjlib/include/pj/compat/cc_armcc.h +++ b/sflphone-common/libs/pjproject/pjlib/include/pj/compat/cc_armcc.h @@ -1,4 +1,4 @@ -/* $Id: cc_armcc.h 2407 2009-01-01 20:56:36Z bennylp $ */ +/* $Id: cc_armcc.h 3046 2010-01-06 08:34:41Z bennylp $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> @@ -30,9 +30,9 @@ #endif #define PJ_CC_NAME "armcc" -#define PJ_CC_VER_1 __ARMCC__ -#define PJ_CC_VER_2 __ARMCC_MINOR__ -#define PJ_CC_VER_3 __ARMCC_PATCHLEVEL__ +#define PJ_CC_VER_1 (__ARMCC_VERSION/100000) +#define PJ_CC_VER_2 ((__ARMCC_VERSION%100000)/10000) +#define PJ_CC_VER_3 (__ARMCC_VERSION%10000) #ifdef __cplusplus # define PJ_INLINE_SPECIFIER inline diff --git a/sflphone-common/libs/pjproject/pjlib/include/pj/compat/os_auto.h.in b/sflphone-common/libs/pjproject/pjlib/include/pj/compat/os_auto.h.in index e922a9b952a8bd9b7f9e7bb9a1d4c1223b52f837..187717519014d146281e6152995052f5251a7c4a 100644 --- a/sflphone-common/libs/pjproject/pjlib/include/pj/compat/os_auto.h.in +++ b/sflphone-common/libs/pjproject/pjlib/include/pj/compat/os_auto.h.in @@ -1,4 +1,4 @@ -/* $Id: os_auto.h.in 2394 2008-12-23 17:27:53Z bennylp $ */ +/* $Id: os_auto.h.in 2970 2009-10-26 15:47:52Z nanang $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> @@ -54,6 +54,7 @@ #undef PJ_HAS_NETINET_IN_SYSTM_H #undef PJ_HAS_NETINET_IN_H #undef PJ_HAS_NETINET_IP_H +#undef PJ_HAS_NETINET_TCP_H #undef PJ_HAS_NET_IF_H #undef PJ_HAS_IFADDRS_H #undef PJ_HAS_SEMAPHORE_H @@ -180,5 +181,11 @@ */ #undef PJ_THREAD_ALLOCATE_STACK +/* SSL socket availability. */ +#ifndef PJ_HAS_SSL_SOCK +#undef PJ_HAS_SSL_SOCK +#endif + + #endif /* __PJ_COMPAT_OS_AUTO_H__ */ diff --git a/sflphone-common/libs/pjproject/pjlib/include/pj/compat/os_darwinos.h b/sflphone-common/libs/pjproject/pjlib/include/pj/compat/os_darwinos.h index 6fff31157966dbf56de4c5527299a1c5a10c0bb4..4afbe02aa6f45f102f54386f70b94f3910685db1 100644 --- a/sflphone-common/libs/pjproject/pjlib/include/pj/compat/os_darwinos.h +++ b/sflphone-common/libs/pjproject/pjlib/include/pj/compat/os_darwinos.h @@ -1,4 +1,4 @@ -/* $Id: os_darwinos.h 2394 2008-12-23 17:27:53Z bennylp $ */ +/* $Id: os_darwinos.h 2962 2009-10-24 00:00:40Z bennylp $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> @@ -35,6 +35,7 @@ #define PJ_HAS_MALLOC_H 0 #define PJ_HAS_NETDB_H 1 #define PJ_HAS_NETINET_IN_H 1 +#define PJ_HAS_NETINET_TCP_H 1 #define PJ_HAS_SETJMP_H 1 #define PJ_HAS_STDARG_H 1 #define PJ_HAS_STDDEF_H 1 diff --git a/sflphone-common/libs/pjproject/pjlib/include/pj/compat/os_symbian.h b/sflphone-common/libs/pjproject/pjlib/include/pj/compat/os_symbian.h index c5c4e4b509eabacb27d05e205bbe9fc1a958e856..727cbc153d8d2b89757b4515785c3c43f0d960d6 100644 --- a/sflphone-common/libs/pjproject/pjlib/include/pj/compat/os_symbian.h +++ b/sflphone-common/libs/pjproject/pjlib/include/pj/compat/os_symbian.h @@ -1,4 +1,4 @@ -/* $Id: os_symbian.h 2506 2009-03-12 18:11:37Z bennylp $ */ +/* $Id: os_symbian.h 2962 2009-10-24 00:00:40Z bennylp $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> @@ -35,6 +35,7 @@ #define PJ_HAS_MALLOC_H 0 #define PJ_HAS_NETDB_H 1 #define PJ_HAS_NETINET_IN_H 1 +#define PJ_HAS_NETINET_TCP_H 0 #define PJ_HAS_SETJMP_H 1 #define PJ_HAS_STDARG_H 1 #define PJ_HAS_STDDEF_H 1 diff --git a/sflphone-common/libs/pjproject/pjlib/include/pj/compat/os_win32.h b/sflphone-common/libs/pjproject/pjlib/include/pj/compat/os_win32.h index 8283491ec688ecf0916f1bda481da3386314d6c0..496d4780506ad1c2fc23fda1239428466dfdaa1f 100644 --- a/sflphone-common/libs/pjproject/pjlib/include/pj/compat/os_win32.h +++ b/sflphone-common/libs/pjproject/pjlib/include/pj/compat/os_win32.h @@ -1,4 +1,4 @@ -/* $Id: os_win32.h 2394 2008-12-23 17:27:53Z bennylp $ */ +/* $Id: os_win32.h 3002 2009-11-10 04:30:46Z bennylp $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> @@ -41,6 +41,7 @@ #define PJ_HAS_MALLOC_H 1 #define PJ_HAS_NETDB_H 0 #define PJ_HAS_NETINET_IN_H 0 +#define PJ_HAS_NETINET_TCP_H 0 #define PJ_HAS_SETJMP_H 1 #define PJ_HAS_STDARG_H 1 #define PJ_HAS_STDDEF_H 1 @@ -110,7 +111,12 @@ #ifndef PJ_OS_HAS_CHECK_STACK # define PJ_OS_HAS_CHECK_STACK 1 #endif -#define PJ_NATIVE_STRING_IS_UNICODE 0 + +#ifdef UNICODE +# define PJ_NATIVE_STRING_IS_UNICODE 1 +#else +# define PJ_NATIVE_STRING_IS_UNICODE 0 +#endif #define PJ_ATOMIC_VALUE_TYPE long diff --git a/sflphone-common/libs/pjproject/pjlib/include/pj/compat/os_win32_wince.h b/sflphone-common/libs/pjproject/pjlib/include/pj/compat/os_win32_wince.h index 3dd00125944a69a656e0fb0d7797c1a90c6083a1..16d3019479b33654bdce848c8738db6e72eff316 100644 --- a/sflphone-common/libs/pjproject/pjlib/include/pj/compat/os_win32_wince.h +++ b/sflphone-common/libs/pjproject/pjlib/include/pj/compat/os_win32_wince.h @@ -1,4 +1,4 @@ -/* $Id: os_win32_wince.h 2660 2009-04-28 19:38:43Z nanang $ */ +/* $Id: os_win32_wince.h 2962 2009-10-24 00:00:40Z bennylp $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> @@ -40,6 +40,7 @@ #define PJ_HAS_MALLOC_H 1 #define PJ_HAS_NETDB_H 0 #define PJ_HAS_NETINET_IN_H 0 +#define PJ_HAS_NETINET_TCP_H 0 #define PJ_HAS_SETJMP_H 1 #define PJ_HAS_STDARG_H 1 #define PJ_HAS_STDDEF_H 1 diff --git a/sflphone-common/libs/pjproject/pjlib/include/pj/compat/socket.h b/sflphone-common/libs/pjproject/pjlib/include/pj/compat/socket.h index 3f2e787f86f19ded0b714717972d4322f877158f..b091c40ba69fcb51e23e2e66619df9c9162a615b 100644 --- a/sflphone-common/libs/pjproject/pjlib/include/pj/compat/socket.h +++ b/sflphone-common/libs/pjproject/pjlib/include/pj/compat/socket.h @@ -1,4 +1,4 @@ -/* $Id: socket.h 2394 2008-12-23 17:27:53Z bennylp $ */ +/* $Id: socket.h 2962 2009-10-24 00:00:40Z bennylp $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> @@ -104,6 +104,11 @@ # include <netinet/ip.h> #endif +#if defined(PJ_HAS_NETINET_TCP_H) && PJ_HAS_NETINET_TCP_H != 0 +/* To pull in TCP_NODELAY constants */ +# include <netinet/tcp.h> +#endif + #if defined(PJ_HAS_NET_IF_H) && PJ_HAS_NET_IF_H != 0 /* For interface enumeration in ip_helper */ # include <net/if.h> diff --git a/sflphone-common/libs/pjproject/pjlib/include/pj/compat/string.h b/sflphone-common/libs/pjproject/pjlib/include/pj/compat/string.h index e0ceb53f894b2c6eaad6e52dfe51e45524fe382c..198fbe98509b59bc742fbbc707d7a96d012ae786 100644 --- a/sflphone-common/libs/pjproject/pjlib/include/pj/compat/string.h +++ b/sflphone-common/libs/pjproject/pjlib/include/pj/compat/string.h @@ -52,8 +52,8 @@ # define wcsicmp _wcsicmp # define wcsnicmp _wcsnicmp #else -// # define stricmp strcasecmp -// # define strnicmp strncasecmp +# define stricmp strcasecmp +# define strnicmp strncasecmp # if defined(PJ_NATIVE_STRING_IS_UNICODE) && PJ_NATIVE_STRING_IS_UNICODE!=0 # error "Implement Unicode string functions" diff --git a/sflphone-common/libs/pjproject/pjlib/include/pj/config.h b/sflphone-common/libs/pjproject/pjlib/include/pj/config.h index aba3fa7070bfbd35d07634196d76276fdfa76ff8..7c21e8efa31bfbee83deb2c7676c1c986ce29210 100644 --- a/sflphone-common/libs/pjproject/pjlib/include/pj/config.h +++ b/sflphone-common/libs/pjproject/pjlib/include/pj/config.h @@ -1,5 +1,5 @@ -/* $Id: config.h 2843 2009-07-22 11:12:35Z bennylp $ */ -/* +/* $Id: config.h 2970 2009-10-26 15:47:52Z nanang $ */ +/* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> * @@ -15,7 +15,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef __PJ_CONFIG_H__ #define __PJ_CONFIG_H__ @@ -49,78 +49,78 @@ * Include target OS specific configuration. */ #if defined(PJ_AUTOCONF) -/* - * Autoconf - */ + /* + * Autoconf + */ # include <pj/compat/os_auto.h> #elif defined(PJ_SYMBIAN) && PJ_SYMBIAN!=0 -/* - * SymbianOS - */ + /* + * SymbianOS + */ # include <pj/compat/os_symbian.h> #elif defined(PJ_WIN32_WINCE) || defined(_WIN32_WCE) || defined(UNDER_CE) -/* - * Windows CE - */ + /* + * Windows CE + */ # undef PJ_WIN32_WINCE # define PJ_WIN32_WINCE 1 # include <pj/compat/os_win32_wince.h> -/* Also define Win32 */ + /* Also define Win32 */ # define PJ_WIN32 1 #elif defined(PJ_WIN32) || defined(_WIN32) || defined(__WIN32__) || \ defined(_WIN64) || defined(WIN32) || defined(__TOS_WIN__) -/* - * Win32 - */ + /* + * Win32 + */ # undef PJ_WIN32 # define PJ_WIN32 1 # include <pj/compat/os_win32.h> #elif defined(PJ_LINUX_KERNEL) && PJ_LINUX_KERNEL!=0 -/* - * Linux kernel - */ + /* + * Linux kernel + */ # include <pj/compat/os_linux_kernel.h> #elif defined(PJ_LINUX) || defined(linux) || defined(__linux) -/* - * Linux - */ + /* + * Linux + */ # undef PJ_LINUX # define PJ_LINUX 1 # include <pj/compat/os_linux.h> #elif defined(PJ_PALMOS) && PJ_PALMOS!=0 -/* - * Palm - */ + /* + * Palm + */ # include <pj/compat/os_palmos.h> #elif defined(PJ_SUNOS) || defined(sun) || defined(__sun) -/* - * SunOS - */ + /* + * SunOS + */ # undef PJ_SUNOS # define PJ_SUNOS 1 # include <pj/compat/os_sunos.h> #elif defined(PJ_DARWINOS) || defined(__MACOSX__) || \ defined (__APPLE__) || defined (__MACH__) -/* - * MacOS X - */ + /* + * MacOS X + */ # undef PJ_DARWINOS # define PJ_DARWINOS 1 # include <pj/compat/os_darwinos.h> #elif defined(PJ_RTEMS) && PJ_RTEMS!=0 -/* - * RTEMS - */ + /* + * RTEMS + */ # include <pj/compat/os_rtems.h> #else # error "Please specify target os." @@ -131,17 +131,17 @@ * Target machine specific configuration. */ #if defined(PJ_AUTOCONF) -/* - * Autoconf configured - */ + /* + * Autoconf configured + */ #include <pj/compat/m_auto.h> #elif defined (PJ_M_I386) || defined(_i386_) || defined(i_386_) || \ defined(_X86_) || defined(x86) || defined(__i386__) || \ defined(__i386) || defined(_M_IX86) || defined(__I86__) -/* - * Generic i386 processor family, little-endian - */ + /* + * Generic i386 processor family, little-endian + */ # undef PJ_M_I386 # define PJ_M_I386 1 # define PJ_M_NAME "i386" @@ -152,9 +152,9 @@ #elif defined (PJ_M_X86_64) || defined(__amd64__) || defined(__amd64) || \ defined(__x86_64__) || defined(__x86_64) -/* - * AMD 64bit processor, little endian - */ + /* + * AMD 64bit processor, little endian + */ # undef PJ_M_X86_64 # define PJ_M_X86_64 1 # define PJ_M_NAME "x86_64" @@ -164,9 +164,9 @@ #elif defined(PJ_M_IA64) || defined(__ia64__) || defined(_IA64) || \ defined(__IA64__) || defined( _M_IA64) -/* - * Intel IA64 processor, little endian - */ + /* + * Intel IA64 processor, little endian + */ # undef PJ_M_IA64 # define PJ_M_IA64 1 # define PJ_M_NAME "ia64" @@ -176,9 +176,9 @@ #elif defined (PJ_M_M68K) && PJ_M_M68K != 0 -/* - * Motorola m64k processor, little endian - */ + /* + * Motorola m64k processor, little endian + */ # undef PJ_M_M68K # define PJ_M_M68K 1 # define PJ_M_NAME "m68k" @@ -189,9 +189,9 @@ #elif defined (PJ_M_ALPHA) || defined (__alpha__) || defined (__alpha) || \ defined (_M_ALPHA) -/* - * DEC Alpha processor, little endian - */ + /* + * DEC Alpha processor, little endian + */ # undef PJ_M_ALPHA # define PJ_M_ALPHA 1 # define PJ_M_NAME "alpha" @@ -202,9 +202,9 @@ #elif defined(PJ_M_MIPS) || defined(__mips__) || defined(__mips) || \ defined(__MIPS__) || defined(MIPS) || defined(_MIPS_) -/* - * MIPS, default to little endian - */ + /* + * MIPS, default to little endian + */ # undef PJ_M_MIPS # define PJ_M_MIPS 1 # define PJ_M_NAME "mips" @@ -216,9 +216,9 @@ #elif defined (PJ_M_SPARC) || defined( __sparc__) || defined(__sparc) -/* - * Sun Sparc, big endian - */ + /* + * Sun Sparc, big endian + */ # undef PJ_M_SPARC # define PJ_M_SPARC 1 # define PJ_M_NAME "sparc" @@ -228,9 +228,9 @@ #elif defined (PJ_M_ARMV4) || defined(ARM) || defined(_ARM_) || \ defined(ARMV4) || defined(__arm__) -/* - * ARM, default to little endian - */ + /* + * ARM, default to little endian + */ # undef PJ_M_ARMV4 # define PJ_M_ARMV4 1 # define PJ_M_NAME "armv4" @@ -243,9 +243,9 @@ #elif defined (PJ_M_POWERPC) || defined(__powerpc) || defined(__powerpc__) || \ defined(__POWERPC__) || defined(__ppc__) || defined(_M_PPC) || \ defined(_ARCH_PPC) -/* - * PowerPC, big endian - */ + /* + * PowerPC, big endian + */ # undef PJ_M_POWERPC # define PJ_M_POWERPC 1 # define PJ_M_NAME "powerpc" @@ -255,16 +255,16 @@ #elif defined (PJ_M_NIOS2) || defined(__nios2) || defined(__nios2__) || \ defined(__NIOS2__) || defined(__M_NIOS2) || defined(_ARCH_NIOS2) -/* - * Nios2, little endian - */ + /* + * Nios2, little endian + */ # undef PJ_M_NIOS2 # define PJ_M_NIOS2 1 # define PJ_M_NAME "nios2" # define PJ_HAS_PENTIUM 0 # define PJ_IS_LITTLE_ENDIAN 1 # define PJ_IS_BIG_ENDIAN 0 - + #else # error "Please specify target machine." #endif @@ -420,7 +420,7 @@ * in the application. * * This will slow down pool creation and destruction and will add - * few bytes of overhead, so application would normally want to + * few bytes of overhead, so application would normally want to * disable this feature on release build. * * Default: 0 @@ -449,14 +449,14 @@ * * Default: 8192 */ -#ifndef PJ_THREAD_DEFAULT_STACK_SIZE +#ifndef PJ_THREAD_DEFAULT_STACK_SIZE # define PJ_THREAD_DEFAULT_STACK_SIZE 8192 #endif /** - * Specify if PJ_CHECK_STACK() macro is enabled to check the sanity of - * the stack. The OS implementation may check that no stack overflow + * Specify if PJ_CHECK_STACK() macro is enabled to check the sanity of + * the stack. The OS implementation may check that no stack overflow * occurs, and it also may collect statistic about stack usage. Note * that this will increase the footprint of the libraries since it * tracks the filename and line number of each functions. @@ -486,7 +486,7 @@ #endif /** - * Support IPv6 in the library. If this support is disabled, some IPv6 + * Support IPv6 in the library. If this support is disabled, some IPv6 * related functions will return PJ_EIPV6NOTSUP. * * Default: 0 (disabled, for now) @@ -495,21 +495,21 @@ # define PJ_HAS_IPV6 0 #endif -/** -* Maximum hostname length. -* Libraries sometimes needs to make copy of an address to stack buffer; -* the value here affects the stack usage. -* -* Default: 128 -*/ + /** + * Maximum hostname length. + * Libraries sometimes needs to make copy of an address to stack buffer; + * the value here affects the stack usage. + * + * Default: 128 + */ #ifndef PJ_MAX_HOSTNAME # define PJ_MAX_HOSTNAME (128) #endif /** * Constants for declaring the maximum handles that can be supported by - * a single IOQ framework. This constant might not be relevant to the - * underlying I/O queue impelementation, but still, developers should be + * a single IOQ framework. This constant might not be relevant to the + * underlying I/O queue impelementation, but still, developers should be * aware of this constant, to make sure that the program will not break when * the underlying implementation changes. */ @@ -523,8 +523,8 @@ * things to ensure thread safety of handle unregistration operation by * employing reference counter to each handle. * - * In addition, the ioqueue will preallocate memory for the handles, - * according to the maximum number of handles that is specified during + * In addition, the ioqueue will preallocate memory for the handles, + * according to the maximum number of handles that is specified during * ioqueue creation. * * All applications would normally want this enabled, but you may disable @@ -545,7 +545,7 @@ * concurrently/in parallel. The default is yes, which means that if there * are more than one pending operations complete simultaneously, more * than one threads may call the key's callback at the same time. This - * generally would promote good scalability for application, at the + * generally would promote good scalability for application, at the * expense of more complexity to manage the concurrent accesses. * * Please see the ioqueue documentation for more info. @@ -600,14 +600,14 @@ * set to value lower than FD_SETSIZE. */ #if PJ_FD_SETSIZE_SETABLE -/* Only override FD_SETSIZE if the value has not been set */ + /* Only override FD_SETSIZE if the value has not been set */ # ifndef FD_SETSIZE # define FD_SETSIZE PJ_IOQUEUE_MAX_HANDLES # endif #else -/* When FD_SETSIZE is not changeable, check if PJ_IOQUEUE_MAX_HANDLES - * is lower than FD_SETSIZE value. - */ + /* When FD_SETSIZE is not changeable, check if PJ_IOQUEUE_MAX_HANDLES + * is lower than FD_SETSIZE value. + */ # ifdef FD_SETSIZE # if PJ_IOQUEUE_MAX_HANDLES > FD_SETSIZE # error "PJ_IOQUEUE_MAX_HANDLES is greater than FD_SETSIZE" @@ -724,7 +724,7 @@ #ifndef PJ_NATIVE_ERR_POSITIVE # define PJ_NATIVE_ERR_POSITIVE 1 #endif - + /** * Include error message string in the library (pj_strerror()). * This is very much desirable! @@ -741,13 +741,56 @@ * functions to compare alnum strings. On some systems, they're faster * then stricmp/strcasecmp, but they can be slower on other systems. * When disabled, pjlib will fallback to stricmp/strnicmp. - * + * * Default: 0 */ #ifndef PJ_HAS_STRICMP_ALNUM # define PJ_HAS_STRICMP_ALNUM 0 #endif + +/* + * Types of QoS backend implementation. + */ + +/** + * Dummy QoS backend implementation, will always return error on all + * the APIs. + */ +#define PJ_QOS_DUMMY 1 + +/** QoS backend based on setsockopt(IP_TOS) */ +#define PJ_QOS_BSD 2 + +/** QoS backend for Windows Mobile 6 */ +#define PJ_QOS_WM 3 + +/** QoS backend for Symbian */ +#define PJ_QOS_SYMBIAN 4 + +/** + * Force the use of some QoS backend API for some platforms. + */ +#ifndef PJ_QOS_IMPLEMENTATION +# if defined(PJ_WIN32_WINCE) && PJ_WIN32_WINCE && _WIN32_WCE >= 0x502 + /* Windows Mobile 6 or later */ +# define PJ_QOS_IMPLEMENTATION PJ_QOS_WM +# endif +#endif + + +/** + * Enable secure socket. For most platforms, this is implemented using + * OpenSSL, so this will require OpenSSL to be installed. For Symbian + * platform, this is implemented natively using CSecureSocket. + * + * Default: 0 (for now) + */ +#ifndef PJ_HAS_SSL_SOCK +# define PJ_HAS_SSL_SOCK 0 +#endif + + /** @} */ /******************************************************************** @@ -761,7 +804,7 @@ * * The libraries support generation of dynamic link libraries for * Symbian ABIv2 target (.dso/Dynamic Shared Object files, in Symbian - * terms). Similar procedures may be applied for Win32 DLL with some + * terms). Similar procedures may be applied for Win32 DLL with some * modification. * * Depending on the platforms, these steps may be necessary in order to @@ -769,7 +812,7 @@ * - Create the (Visual Studio) projects to produce DLL output. PJLIB * does not provide ready to use project files to produce DLL, so * you need to create these projects yourself. For Symbian, the MMP - * files have been setup to produce DSO files for targets that + * files have been setup to produce DSO files for targets that * require them. * - In the (Visual Studio) projects, some macros need to be declared * so that appropriate modifiers are added to symbol declarations @@ -778,49 +821,49 @@ * MMP files. * - Some build systems require .DEF file to be specified when creating * the DLL. For Symbian, .DEF files are included in pjlib distribution, - * in <tt>pjlib/build.symbian</tt> directory. These DEF files are + * in <tt>pjlib/build.symbian</tt> directory. These DEF files are * created by running <tt>./makedef.sh all</tt> from this directory, * inside Mingw. * * Macros related for building DLL/DSO files: * - For platforms that supports dynamic link libraries generation, * it must declare <tt>PJ_EXPORT_SPECIFIER</tt> macro which value contains - * the prefix to be added to symbol definition, to export this + * the prefix to be added to symbol definition, to export this * symbol in the DLL/DSO. For example, on Win32/Visual Studio, the - * value of this macro is \a __declspec(dllexport), and for ARM - * ABIv2/Symbian, the value is \a EXPORT_C. + * value of this macro is \a __declspec(dllexport), and for ARM + * ABIv2/Symbian, the value is \a EXPORT_C. * - For platforms that supports linking with dynamic link libraries, * it must declare <tt>PJ_IMPORT_SPECIFIER</tt> macro which value contains - * the prefix to be added to symbol declaration, to import this + * the prefix to be added to symbol declaration, to import this * symbol from a DLL/DSO. For example, on Win32/Visual Studio, the - * value of this macro is \a __declspec(dllimport), and for ARM - * ABIv2/Symbian, the value is \a IMPORT_C. - * - Both <tt>PJ_EXPORT_SPECIFIER</tt> and <tt>PJ_IMPORT_SPECIFIER</tt> + * value of this macro is \a __declspec(dllimport), and for ARM + * ABIv2/Symbian, the value is \a IMPORT_C. + * - Both <tt>PJ_EXPORT_SPECIFIER</tt> and <tt>PJ_IMPORT_SPECIFIER</tt> * macros above can be declared in your \a config_site.h if they are not * declared by pjlib. - * - When PJLIB is built as DLL/DSO, both <tt>PJ_DLL</tt> and - * <tt>PJ_EXPORTING</tt> macros must be declared, so that + * - When PJLIB is built as DLL/DSO, both <tt>PJ_DLL</tt> and + * <tt>PJ_EXPORTING</tt> macros must be declared, so that * <tt>PJ_EXPORT_SPECIFIER</tt> modifier will be added into function * definition. * - When application wants to link dynamically with PJLIB, then it * must declare <tt>PJ_DLL</tt> macro when using/including PJLIB header, - * so that <tt>PJ_IMPORT_SPECIFIER</tt> modifier is properly added into + * so that <tt>PJ_IMPORT_SPECIFIER</tt> modifier is properly added into * symbol declarations. * * When <b>PJ_DLL</b> macro is not declared, static linking is assumed. * * For example, here are some settings to produce DLLs with Visual Studio * on Windows/Win32: - * - Create Visual Studio projects to produce DLL. Add the appropriate + * - Create Visual Studio projects to produce DLL. Add the appropriate * project dependencies to avoid link errors. - * - In the projects, declare <tt>PJ_DLL</tt> and <tt>PJ_EXPORTING</tt> + * - In the projects, declare <tt>PJ_DLL</tt> and <tt>PJ_EXPORTING</tt> * macros. * - Declare these macros in your <tt>config_site.h</tt>: \verbatim #define PJ_EXPORT_SPECIFIER __declspec(dllexport) #define PJ_IMPORT_SPECIFIER __declspec(dllimport) \endverbatim - * - And in the application (that links with the DLL) project, add + * - And in the application (that links with the DLL) project, add * <tt>PJ_DLL</tt> in the macro declarations. */ @@ -844,7 +887,7 @@ * is built as dynamic library. * * This macro should have been added by platform specific headers, - * if the platform supports building dynamic library target. + * if the platform supports building dynamic library target. */ #ifndef PJ_EXPORT_DECL_SPECIFIER # define PJ_EXPORT_DECL_SPECIFIER @@ -857,7 +900,7 @@ * is built as dynamic library. * * This macro should have been added by platform specific headers, - * if the platform supports building dynamic library target. + * if the platform supports building dynamic library target. */ #ifndef PJ_EXPORT_DEF_SPECIFIER # define PJ_EXPORT_DEF_SPECIFIER @@ -952,7 +995,7 @@ * @def PJ_DECL_DATA(type) * @param type The data type. * Declare a global data. - */ + */ #if defined(PJ_DLL) # if defined(PJ_EXPORTING) # define PJ_DECL_DATA(type) PJ_EXPORT_DECL_SPECIFIER extern type @@ -968,7 +1011,7 @@ * @def PJ_DEF_DATA(type) * @param type The data type. * Define a global data. - */ + */ #if defined(PJ_DLL) && defined(PJ_EXPORTING) # define PJ_DEF_DATA(type) PJ_EXPORT_DEF_SPECIFIER type #elif !defined(PJ_DEF_DATA) @@ -1058,19 +1101,19 @@ PJ_BEGIN_DECL /** * PJLIB version string constant. @see pj_get_version() */ -PJ_DECL_DATA (const char*) PJ_VERSION; +PJ_DECL_DATA(const char*) PJ_VERSION; /** * Get PJLIB version string. * * @return #PJ_VERSION constant. */ -PJ_DECL (const char*) pj_get_version (void); +PJ_DECL(const char*) pj_get_version(void); /** * Dump configuration to log with verbosity equal to info(3). */ -PJ_DECL (void) pj_dump_config (void); +PJ_DECL(void) pj_dump_config(void); PJ_END_DECL diff --git a/sflphone-common/libs/pjproject/pjlib/include/pj/config_site.h b/sflphone-common/libs/pjproject/pjlib/include/pj/config_site.h deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/sflphone-common/libs/pjproject/pjlib/include/pj/errno.h b/sflphone-common/libs/pjproject/pjlib/include/pj/errno.h index fdc6cdf76c507ab46009b32ed3a598078a46e8c4..7576a4cf7accd1e6a974ef5e7a3a4b42313db806 100644 --- a/sflphone-common/libs/pjproject/pjlib/include/pj/errno.h +++ b/sflphone-common/libs/pjproject/pjlib/include/pj/errno.h @@ -1,4 +1,4 @@ -/* $Id: errno.h 2506 2009-03-12 18:11:37Z bennylp $ */ +/* $Id: errno.h 2992 2009-11-09 04:09:13Z bennylp $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> @@ -22,21 +22,24 @@ /** * @file errno.h - * @brief PJLIB Error Codes + * @brief PJLIB Error Subsystem */ #include <pj/types.h> #include <pj/compat/errno.h> +#include <stdarg.h> PJ_BEGIN_DECL /** - * @defgroup pj_errno Error Codes + * @defgroup pj_errno Error Subsystem * @{ * - * In PJLIB, error/status codes from operating system are translated - * into PJLIB error namespace, and stored in @a pj_status_t. All functions - * that work with @a pj_status_t expect to get PJLIB error code instead - * of native codes. + * The PJLIB Error Subsystem is a framework to unify all error codes + * produced by all components into a single error space, and provide + * uniform set of APIs to access them. With this framework, any error + * codes are encoded as pj_status_t value. The framework is extensible, + * application may register new error spaces to be recognized by + * the framework. * * @section pj_errno_retval Return Values * @@ -47,20 +50,33 @@ PJ_BEGIN_DECL * #PJ_STATUS_FROM_OS() macro. The function will do this automatically * before returning the error to caller. * - * @section pj_errno_errmsg Error Message + * @section err_services Retrieving and Displaying Error Messages * - * To get the error message corresponding to a particular code, use function - * #pj_strerror(). This function expects error code in PJLIB error namespace, - * not the native error code. Application can pass the value from the - * following sources to this function: - * - #pj_get_os_error() - * - #pj_get_netos_error() - * - any return value from function returning @a pj_status_t. + * The framework provides the following APIs to retrieve and/or display + * error messages: * - * Application MUST NOT pass native error code (such as error code from + * - #pj_strerror(): this is the base API to retrieve error string + * description for the specified pj_status_t error code. + * + * - #PJ_PERROR() macro: use this macro similar to PJ_LOG to format + * an error message and display them to the log + * + * - #pj_perror(): this function is similar to PJ_PERROR() but unlike + * #PJ_PERROR(), this function will always be included in the + * link process. Due to this reason, prefer to use #PJ_PERROR() + * if the application is concerned about the executable size. + * + * Application MUST NOT pass native error codes (such as error code from * functions like GetLastError() or errno) to PJLIB functions expecting * @a pj_status_t. * + * @section err_extending Extending the Error Space + * + * Application may register new error space to be recognized by the + * framework by using #pj_register_strerror(). Use the range started + * from PJ_ERRNO_START_USER to avoid conflict with existing error + * spaces. + * */ /** @@ -68,6 +84,14 @@ PJ_BEGIN_DECL */ #define PJ_ERR_MSG_SIZE 80 +/** + * Buffer for title string of #PJ_PERROR(). + */ +#ifndef PJ_PERROR_TITLE_BUF_SIZE +# define PJ_PERROR_TITLE_BUF_SIZE 120 +#endif + + /** * Get the last platform error/status, folded into pj_status_t. * @return OS dependent error code, folded into pj_status_t. @@ -111,6 +135,74 @@ PJ_DECL(void) pj_set_netos_error(pj_status_t code); PJ_DECL(pj_str_t) pj_strerror( pj_status_t statcode, char *buf, pj_size_t bufsize); +/** + * A utility macro to print error message pertaining to the specified error + * code to the log. This macro will construct the error message title + * according to the 'title_fmt' argument, and add the error string pertaining + * to the error code after the title string. A colon (':') will be added + * automatically between the title and the error string. + * + * This function is similar to pj_perror() function, but has the advantage + * that the function call can be omitted from the link process if the + * log level argument is below PJ_LOG_MAX_LEVEL threshold. + * + * Note that the title string constructed from the title_fmt will be built on + * a string buffer which size is PJ_PERROR_TITLE_BUF_SIZE, which normally is + * allocated from the stack. By default this buffer size is small (around + * 120 characters). Application MUST ensure that the constructed title string + * will not exceed this limit, since not all platforms support truncating + * the string. + * + * @see pj_perror() + * + * @param level The logging verbosity level, valid values are 0-6. Lower + * number indicates higher importance, with level zero + * indicates fatal error. Only numeral argument is + * permitted (e.g. not variable). + * @param arg Enclosed 'printf' like arguments, with the following + * arguments: + * - the sender (NULL terminated string), + * - the error code (pj_status_t) + * - the format string (title_fmt), and + * - optional variable number of arguments suitable for the + * format string. + * + * Sample: + * \verbatim + PJ_PERROR(2, (__FILE__, PJ_EBUSY, "Error making %s", "coffee")); + \endverbatim + * @hideinitializer + */ +#define PJ_PERROR(level,arg) do { \ + pj_perror_wrapper_##level(arg); \ + } while (0) + +/** + * A utility function to print error message pertaining to the specified error + * code to the log. This function will construct the error message title + * according to the 'title_fmt' argument, and add the error string pertaining + * to the error code after the title string. A colon (':') will be added + * automatically between the title and the error string. + * + * Unlike the PJ_PERROR() macro, this function takes the \a log_level argument + * as a normal argument, unlike in PJ_PERROR() where a numeral value must be + * given. However this function will always be linked to the executable, + * unlike PJ_PERROR() which can be omitted when the level is below the + * PJ_LOG_MAX_LEVEL. + * + * Note that the title string constructed from the title_fmt will be built on + * a string buffer which size is PJ_PERROR_TITLE_BUF_SIZE, which normally is + * allocated from the stack. By default this buffer size is small (around + * 120 characters). Application MUST ensure that the constructed title string + * will not exceed this limit, since not all platforms support truncating + * the string. + * + * @see PJ_PERROR() + */ +PJ_DECL(void) pj_perror(int log_level, const char *sender, pj_status_t status, + const char *title_fmt, ...); + + /** * Type of callback to be specified in #pj_register_strerror() * @@ -381,6 +473,102 @@ PJ_DECL(pj_status_t) pj_register_strerror(pj_status_t start_code, /* Internal */ void pj_errno_clear_handlers(void); + +/****** Internal for PJ_PERROR *******/ + +/** + * @def pj_perror_wrapper_1(arg) + * Internal function to write log with verbosity 1. Will evaluate to + * empty expression if PJ_LOG_MAX_LEVEL is below 1. + * @param arg Log expression. + */ +#if PJ_LOG_MAX_LEVEL >= 1 + #define pj_perror_wrapper_1(arg) pj_perror_1 arg + /** Internal function. */ + PJ_DECL(void) pj_perror_1(const char *sender, pj_status_t status, + const char *title_fmt, ...); +#else + #define pj_perror_wrapper_1(arg) +#endif + +/** + * @def pj_perror_wrapper_2(arg) + * Internal function to write log with verbosity 2. Will evaluate to + * empty expression if PJ_LOG_MAX_LEVEL is below 2. + * @param arg Log expression. + */ +#if PJ_LOG_MAX_LEVEL >= 2 + #define pj_perror_wrapper_2(arg) pj_perror_2 arg + /** Internal function. */ + PJ_DECL(void) pj_perror_2(const char *sender, pj_status_t status, + const char *title_fmt, ...); +#else + #define pj_perror_wrapper_2(arg) +#endif + +/** + * @def pj_perror_wrapper_3(arg) + * Internal function to write log with verbosity 3. Will evaluate to + * empty expression if PJ_LOG_MAX_LEVEL is below 3. + * @param arg Log expression. + */ +#if PJ_LOG_MAX_LEVEL >= 3 + #define pj_perror_wrapper_3(arg) pj_perror_3 arg + /** Internal function. */ + PJ_DECL(void) pj_perror_3(const char *sender, pj_status_t status, + const char *title_fmt, ...); +#else + #define pj_perror_wrapper_3(arg) +#endif + +/** + * @def pj_perror_wrapper_4(arg) + * Internal function to write log with verbosity 4. Will evaluate to + * empty expression if PJ_LOG_MAX_LEVEL is below 4. + * @param arg Log expression. + */ +#if PJ_LOG_MAX_LEVEL >= 4 + #define pj_perror_wrapper_4(arg) pj_perror_4 arg + /** Internal function. */ + PJ_DECL(void) pj_perror_4(const char *sender, pj_status_t status, + const char *title_fmt, ...); +#else + #define pj_perror_wrapper_4(arg) +#endif + +/** + * @def pj_perror_wrapper_5(arg) + * Internal function to write log with verbosity 5. Will evaluate to + * empty expression if PJ_LOG_MAX_LEVEL is below 5. + * @param arg Log expression. + */ +#if PJ_LOG_MAX_LEVEL >= 5 + #define pj_perror_wrapper_5(arg) pj_perror_5 arg + /** Internal function. */ + PJ_DECL(void) pj_perror_5(const char *sender, pj_status_t status, + const char *title_fmt, ...); +#else + #define pj_perror_wrapper_5(arg) +#endif + +/** + * @def pj_perror_wrapper_6(arg) + * Internal function to write log with verbosity 6. Will evaluate to + * empty expression if PJ_LOG_MAX_LEVEL is below 6. + * @param arg Log expression. + */ +#if PJ_LOG_MAX_LEVEL >= 6 + #define pj_perror_wrapper_6(arg) pj_perror_6 arg + /** Internal function. */ + PJ_DECL(void) pj_perror_6(const char *sender, pj_status_t status, + const char *title_fmt, ...); +#else + #define pj_perror_wrapper_6(arg) +#endif + + + + PJ_END_DECL #endif /* __PJ_ERRNO_H__ */ diff --git a/sflphone-common/libs/pjproject/pjlib/include/pj/sock.h b/sflphone-common/libs/pjproject/pjlib/include/pj/sock.h index b0bbfe283c8e24342368a136954fd2468a094e0a..90c9f05ce8efdbf33344f25ffd8cc8dd7cff64f8 100644 --- a/sflphone-common/libs/pjproject/pjlib/include/pj/sock.h +++ b/sflphone-common/libs/pjproject/pjlib/include/pj/sock.h @@ -1,4 +1,4 @@ -/* $Id: sock.h 2863 2009-08-12 10:56:06Z bennylp $ */ +/* $Id: sock.h 2966 2009-10-25 09:02:07Z bennylp $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> @@ -290,6 +290,17 @@ extern const pj_uint16_t PJ_SO_RCVBUF; /** Buffer size for send. @see pj_SO_SNDBUF() */ extern const pj_uint16_t PJ_SO_SNDBUF; +/** Disables the Nagle algorithm for send coalescing. @see pj_TCP_NODELAY */ +extern const pj_uint16_t PJ_TCP_NODELAY; + +/** Allows the socket to be bound to an address that is already in use. + * @see pj_SO_REUSEADDR */ +extern const pj_uint16_t PJ_SO_REUSEADDR; + +/** Set the protocol-defined priority for all packets to be sent on socket. + */ +extern const pj_uint16_t PJ_SO_PRIORITY; + /** IP multicast interface. @see pj_IP_MULTICAST_IF() */ extern const pj_uint16_t PJ_IP_MULTICAST_IF; @@ -316,6 +327,15 @@ extern const pj_uint16_t PJ_IP_DROP_MEMBERSHIP; /** Get #PJ_SO_SNDBUF constant */ PJ_DECL(pj_uint16_t) pj_SO_SNDBUF(void); + /** Get #PJ_TCP_NODELAY constant */ + PJ_DECL(pj_uint16_t) pj_TCP_NODELAY(void); + + /** Get #PJ_SO_REUSEADDR constant */ + PJ_DECL(pj_uint16_t) pj_SO_REUSEADDR(void); + + /** Get #PJ_SO_PRIORITY constant */ + PJ_DECL(pj_uint16_t) pj_SO_PRIORITY(void); + /** Get #PJ_IP_MULTICAST_IF constant */ PJ_DECL(pj_uint16_t) pj_IP_MULTICAST_IF(void); @@ -340,6 +360,15 @@ extern const pj_uint16_t PJ_IP_DROP_MEMBERSHIP; /** Get #PJ_SO_SNDBUF constant */ # define pj_SO_SNDBUF() PJ_SO_SNDBUF + /** Get #PJ_TCP_NODELAY constant */ +# define pj_TCP_NODELAY() PJ_TCP_NODELAY + + /** Get #PJ_SO_REUSEADDR constant */ +# define pj_SO_REUSEADDR() PJ_SO_REUSEADDR + + /** Get #PJ_SO_PRIORITY constant */ +# define pj_SO_PRIORITY() PJ_SO_PRIORITY + /** Get #PJ_IP_MULTICAST_IF constant */ # define pj_IP_MULTICAST_IF() PJ_IP_MULTICAST_IF diff --git a/sflphone-common/libs/pjproject/pjlib/include/pj/sock_qos.h b/sflphone-common/libs/pjproject/pjlib/include/pj/sock_qos.h new file mode 100644 index 0000000000000000000000000000000000000000..4422253b6853f85a21166892f9df4e41724c0646 --- /dev/null +++ b/sflphone-common/libs/pjproject/pjlib/include/pj/sock_qos.h @@ -0,0 +1,427 @@ +/* $Id: sock_qos.h 2967 2009-10-25 10:50:17Z bennylp $ */ +/* + * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) + * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ +#ifndef __PJ_SOCK_QOS_H__ +#define __PJ_SOCK_QOS_H__ + +/** + * @file sock_qos.h + * @brief Socket QoS API + */ + +#include <pj/sock.h> + +PJ_BEGIN_DECL + + +/** + * @defgroup socket_qos Socket Quality of Service (QoS) API: TOS, DSCP, WMM, IEEE 802.1p + * @ingroup PJ_SOCK + * @{ + + + \section intro QoS Technologies + + QoS settings are available for both Layer 2 and 3 of TCP/IP protocols: + + \subsection intro_ieee8021p Layer 2: IEEE 802.1p for Ethernet + + IEEE 802.1p tagging will mark frames sent by a host for prioritized + delivery using a 3-bit Priority field in the virtual local area network + (VLAN) header of the Ethernet frame. The VLAN header is placed inside + the Ethernet header, between the Source Address field and either the + Length field (for an IEEE 802.3 frame) or the EtherType field (for an + Ethernet II frame). + + \subsection intro_wmm Layer 2: WMM + + At the Network Interface layer for IEEE 802.11 wireless, the Wi-Fi + Alliance certification for Wi-Fi Multimedia (WMM) defines four access + categories for prioritizing network traffic. These access categories + are (in order of highest to lowest priority) voice, video, best-effort, + and background. Host support for WMM prioritization requires that both + wireless network adapters and their drivers support WMM. Wireless + access points (APs) must have WMM enabled. + + \subsection intro_dscp Layer 3: DSCP + + At the Internet layer, you can use Differentiated Services/Diffserv and + set the value of the Differentiated Services Code Point (DSCP) in the + IP header. As defined in RFC 2474, the DSCP value is the high-order 6 bits + of the IP version 4 (IPv4) TOS field and the IP version 6 (IPv6) Traffic + Class field. + + \subsection intro_other Layer 3: Other + + Other mechanisms exist (such as RSVP, IntServ) but this will not be + implemented. + + + \section availability QoS Availability + + \subsection linux Linux + + DSCP is available via IP TOS option. + + Ethernet 802.1p tagging is done by setting setsockopt(SO_PRIORITY) option + of the socket, then with the set_egress_map option of the vconfig utility + to convert this to set vlan-qos field of the packet. + + WMM is not known to be available. + + \subsection windows Windows and Windows Mobile + + (It's a mess!) + + DSCP is settable with setsockopt() on Windows 2000 or older, but Windows + would silently ignore this call on WinXP or later, unless administrator + modifies the registry. On Windows 2000, Windows XP, and Windows Server + 2003, GQoS (Generic QoS) API is the standard API, but this API may not be + supported in the future. On Vista and Windows 7, the is a new QoS2 API, + also known as Quality Windows Audio-Video Experience (qWAVE). + + IEEE 802.1p tagging is available via Traffic Control (TC) API, available + on Windows XP SP2, but this needs administrator access. For Vista and + later, it's in qWAVE. + + WMM is available for mobile platforms on Windows Mobile 6 platform and + Windows Embedded CE 6, via setsockopt(IP_DSCP_TRAFFIC_TYPE). qWAVE + supports this as well. + + \subsection symbian Symbian S60 3rd Ed + + Both DSCP and WMM is supported via RSocket::SetOpt() with will set both + Layer 2 and Layer 3 QoS settings accordingly. Internally, PJLIB sets the + DSCP field of the socket, and based on certain DSCP values mapping, + Symbian will set the WMM tag accordingly. + + \section api PJLIB's QoS API Abstraction + + Based on the above, the following API is implemented. + + Declare the following "standard" traffic types. + + \code + typedef enum pj_qos_type + { + PJ_QOS_TYPE_BEST_EFFORT, + PJ_QOS_TYPE_BACKGROUND, + PJ_QOS_TYPE_VIDEO, + PJ_QOS_TYPE_VOICE, + PJ_QOS_TYPE_CONTROL + } pj_qos_type; + \endcode + + The traffic classes above will determine how the Layer 2 and 3 QoS + settings will be used. The standard mapping between the classes above + to the corresponding Layer 2 and 3 settings are as follows: + + \code + ================================================================= + PJLIB Traffic Type IP DSCP WMM 802.1p + ----------------------------------------------------------------- + BEST_EFFORT 0x00 BE (Bulk Effort) 0 + BACKGROUND 0x08 BK (Bulk) 2 + VIDEO 0x28 VI (Video) 5 + VOICE 0x30 VO (Voice) 6 + CONTROL 0x38 VO (Voice) 7 + ================================================================= + \endcode + + There are two sets of API provided to manipulate the QoS parameters. + + \subsection portable_api Portable API + + The first set of API is: + + \code + // Set QoS parameters + PJ_DECL(pj_status_t) pj_sock_set_qos_type(pj_sock_t sock, + pj_qos_type val); + + // Get QoS parameters + PJ_DECL(pj_status_t) pj_sock_get_qos_type(pj_sock_t sock, + pj_qos_type *p_val); + \endcode + + The API will set the traffic type according to the DSCP class, for both + Layer 2 and Layer 3 QoS settings, where it's available. If any of the + layer QoS setting is not settable, the API will silently ignore it. + If both layers are not setable, the API will return error. + + The API above is the recommended use of QoS, since it is the most + portable across all platforms. + + \subsection detail_api Fine Grained Control API + + The second set of API is intended for application that wants to fine + tune the QoS parameters. + + The Layer 2 and 3 QoS parameters are stored in pj_qos_params structure: + + \code + typedef enum pj_qos_flag + { + PJ_QOS_PARAM_HAS_DSCP = 1, + PJ_QOS_PARAM_HAS_SO_PRIO = 2, + PJ_QOS_PARAM_HAS_WMM = 4 + } pj_qos_flag; + + typedef enum pj_qos_wmm_prio + { + PJ_QOS_WMM_PRIO_BULK_EFFORT, + PJ_QOS_WMM_PRIO_BULK, + PJ_QOS_WMM_PRIO_VIDEO, + PJ_QOS_WMM_PRIO_VOICE + } pj_qos_wmm_prio; + + typedef struct pj_qos_params + { + pj_uint8_t flags; // Determines which values to + // set, bitmask of pj_qos_flag + pj_uint8_t dscp_val; // The 6 bits DSCP value to set + pj_uint8_t so_prio; // SO_PRIORITY value + pj_qos_wmm_prio wmm_prio; // WMM priority value + } pj_qos_params; + \endcode + + The second set of API with more fine-grained control over the parameters + are: + + \code + // Retrieve QoS params for the specified traffic type + PJ_DECL(pj_status_t) pj_qos_get_params(pj_qos_type type, + pj_qos_params *p); + + // Set QoS parameters to the socket + PJ_DECL(pj_status_t) pj_sock_set_qos_params(pj_sock_t sock, + const pj_qos_params *p); + + // Get QoS parameters from the socket + PJ_DECL(pj_status_t) pj_sock_get_qos_params(pj_sock_t sock, + pj_qos_params *p); + \endcode + + + Important: + + The pj_sock_set/get_qos_params() APIs are not portable, and it's probably + only going to be implemented on Linux. Application should always try to + use pj_sock_set_qos_type() instead. + */ + + +/** + * High level traffic classification. + */ +typedef enum pj_qos_type +{ + PJ_QOS_TYPE_BEST_EFFORT, /**< Best effort traffic (default value). + Any QoS function calls with specifying + this value are effectively no-op */ + PJ_QOS_TYPE_BACKGROUND, /**< Background traffic. */ + PJ_QOS_TYPE_VIDEO, /**< Video traffic. */ + PJ_QOS_TYPE_VOICE, /**< Voice traffic. */ + PJ_QOS_TYPE_CONTROL /**< Control traffic. */ +} pj_qos_type; + +/** + * Bitmask flag to indicate which QoS layer setting is set in the + * \a flags field of the #pj_qos_params structure. + */ +typedef enum pj_qos_flag +{ + PJ_QOS_PARAM_HAS_DSCP = 1, /**< DSCP field is set. */ + PJ_QOS_PARAM_HAS_SO_PRIO = 2, /**< Socket SO_PRIORITY */ + PJ_QOS_PARAM_HAS_WMM = 4 /**< WMM field is set. */ +} pj_qos_flag; + + +/** + * Standard WMM priorities. + */ +typedef enum pj_qos_wmm_prio +{ + PJ_QOS_WMM_PRIO_BULK_EFFORT, /**< Bulk effort priority */ + PJ_QOS_WMM_PRIO_BULK, /**< Bulk priority. */ + PJ_QOS_WMM_PRIO_VIDEO, /**< Video priority */ + PJ_QOS_WMM_PRIO_VOICE /**< Voice priority */ +} pj_qos_wmm_prio; + + +/** + * QoS parameters to be set or retrieved to/from the socket. + */ +typedef struct pj_qos_params +{ + pj_uint8_t flags; /**< Determines which values to + set, bitmask of pj_qos_flag */ + pj_uint8_t dscp_val; /**< The 6 bits DSCP value to set */ + pj_uint8_t so_prio; /**< SO_PRIORITY value */ + pj_qos_wmm_prio wmm_prio; /**< WMM priority value */ +} pj_qos_params; + + + +/** + * This is the high level and portable API to enable QoS on the specified + * socket, by setting the traffic type to the specified parameter. + * + * @param sock The socket. + * @param type Traffic type to be set. + * + * @return PJ_SUCCESS if at least Layer 2 or Layer 3 setting is + * successfully set. If both Layer 2 and Layer 3 settings + * can't be set, this function will return error. + */ +PJ_DECL(pj_status_t) pj_sock_set_qos_type(pj_sock_t sock, + pj_qos_type type); + +/** + * This is the high level and portable API to get the traffic type that has + * been set on the socket. On occasions where the Layer 2 or Layer 3 settings + * were modified by using low level API, this function may return approximation + * of the closest QoS type that matches the settings. + * + * @param sock The socket. + * @param p_type Pointer to receive the traffic type of the socket. + * + * @return PJ_SUCCESS if traffic type for the socket can be obtained + * or approximated.. + */ +PJ_DECL(pj_status_t) pj_sock_get_qos_type(pj_sock_t sock, + pj_qos_type *p_type); + + +/** + * This is a convenience function to apply QoS to the socket, and print error + * logging if the operations failed. Both QoS traffic type and the low level + * QoS parameters can be applied with this function. + * + * @param sock The socket handle. + * @param qos_type QoS traffic type. The QoS traffic type will be applied + * only if the value is not PJ_QOS_TYPE_BEST_EFFORT, + * @param qos_params Optional low-level QoS parameters. This will be + * applied only if this argument is not NULL and the + * flags inside the structure is non-zero. Upon return, + * the flags will indicate which parameters have been + * applied successfully. + * @param log_level This function will print to log at this level upon + * encountering errors. + * @param log_sender Optional sender name in the log. + * @param sock_name Optional name to help identify the socket in the log. + * + * @return PJ_SUCCESS if at least Layer 2 or Layer 3 setting is + * successfully set. If both Layer 2 and Layer 3 settings + * can't be set, this function will return error. + * + * @see pj_sock_apply_qos2() + */ +PJ_DECL(pj_status_t) pj_sock_apply_qos(pj_sock_t sock, + pj_qos_type qos_type, + pj_qos_params *qos_params, + unsigned log_level, + const char *log_sender, + const char *sock_name); + +/** + * Variant of #pj_sock_apply_qos() where the \a qos_params parameter is + * const. + * + * @see pj_sock_apply_qos() + */ +PJ_DECL(pj_status_t) pj_sock_apply_qos2(pj_sock_t sock, + pj_qos_type qos_type, + const pj_qos_params *qos_params, + unsigned log_level, + const char *log_sender, + const char *sock_name); + +/** + * Retrieve the standard mapping of QoS params for the specified traffic + * type. + * + * @param type The traffic type from which the QoS parameters + * are to be retrieved. + * @param p_param Pointer to receive the QoS parameters. + * + * @return PJ_SUCCESS on success or the appropriate error code. + */ +PJ_DECL(pj_status_t) pj_qos_get_params(pj_qos_type type, + pj_qos_params *p_param); + + +/** + * Retrieve the traffic type that matches the specified QoS parameters. + * If no exact matching is found, this function will return an + * approximation of the closest matching traffic type for the specified + * QoS parameters. + * + * @param param Structure containing QoS parameters to map into + * "standard" traffic types. + * @param p_type Pointer to receive the traffic type. + * + * @return PJ_SUCCESS on success or the appropriate error code. + */ +PJ_DECL(pj_status_t) pj_qos_get_type(const pj_qos_params *param, + pj_qos_type *p_type); + + +/** + * This is a low level API to set QoS parameters to the socket. + * + * @param sock The socket. + * @param param Structure containing QoS parameters to be applied + * to the socket. Upon return, the \a flags field + * of this structure will be set with bitmask value + * indicating which QoS settings have successfully + * been applied to the socket. + * + * @return PJ_SUCCESS if at least one field setting has been + * successfully set. If no setting can't be set, + * this function will return error. + */ +PJ_DECL(pj_status_t) pj_sock_set_qos_params(pj_sock_t sock, + pj_qos_params *param); + +/** + * This is a low level API to get QoS parameters from the socket. + * + * @param sock The socket. + * @param p_param Pointer to receive the parameters. Upon returning + * successfully, the \a flags field of this structure + * will be initialized with the appropriate bitmask + * to indicate which fields have been successfully + * retrieved. + * + * @return PJ_SUCCESS on success or the appropriate error code. + */ +PJ_DECL(pj_status_t) pj_sock_get_qos_params(pj_sock_t sock, + pj_qos_params *p_param); + + +/** + * @} + */ + + +PJ_END_DECL + +#endif /* __PJ_SOCK_QOS_H__ */ + diff --git a/sflphone-common/libs/pjproject/pjlib/include/pj/ssl_sock.h b/sflphone-common/libs/pjproject/pjlib/include/pj/ssl_sock.h new file mode 100644 index 0000000000000000000000000000000000000000..3ac2b7f2bfc54aaf249d2db25ac301eac8eec605 --- /dev/null +++ b/sflphone-common/libs/pjproject/pjlib/include/pj/ssl_sock.h @@ -0,0 +1,874 @@ +/* $Id: ssl_sock.h 2998 2009-11-09 08:51:34Z bennylp $ */ +/* + * Copyright (C) 2009 Teluu Inc. (http://www.teluu.com) + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ +#ifndef __PJ_SSL_SOCK_H__ +#define __PJ_SSL_SOCK_H__ + +/** + * @file ssl_sock.h + * @brief Secure socket + */ + +#include <pj/ioqueue.h> +#include <pj/sock.h> +#include <pj/sock_qos.h> + + +PJ_BEGIN_DECL + +/** + * @defgroup PJ_SSL_SOCK Secure socket I/O + * @brief Secure socket provides security on socket operation using standard + * security protocols such as SSL and TLS. + * @ingroup PJ_IO + * @{ + * + * Secure socket wraps normal socket and applies security features, i.e: + * privacy and data integrity, on the socket traffic, using standard security + * protocols such as SSL and TLS. + * + * Secure socket employs active socket operations, which is similar to (and + * described more detail) in \ref PJ_ACTIVESOCK. + */ + + + /** + * This opaque structure describes the secure socket. + */ +typedef struct pj_ssl_sock_t pj_ssl_sock_t; + + +/** + * Opaque declaration of endpoint certificate or credentials. This may contains + * certificate, private key, and trusted Certificate Authorities list. + */ +typedef struct pj_ssl_cert_t pj_ssl_cert_t; + + +/** + * Describe structure of certificate info. + */ +typedef struct pj_ssl_cert_info { + pj_str_t subject; /**< Subject. */ + pj_str_t issuer; /**< Issuer. */ + unsigned version; /**< Certificate version. */ + pj_time_val validity_start; /**< Validity start. */ + pj_time_val validity_end; /**< Validity end. */ + pj_bool_t validity_use_gmt; /**< Flag if validity date/time + use GMT. */ +} pj_ssl_cert_info; + + +/** + * Create credential from files. + * + * @param CA_file The file of trusted CA list. + * @param cert_file The file of certificate. + * @param privkey_file The file of private key. + * @param privkey_pass The password of private key, if any. + * @param p_cert Pointer to credential instance to be created. + * + * @return PJ_SUCCESS when successful. + */ +PJ_DECL(pj_status_t) pj_ssl_cert_load_from_files(pj_pool_t *pool, + const pj_str_t *CA_file, + const pj_str_t *cert_file, + const pj_str_t *privkey_file, + const pj_str_t *privkey_pass, + pj_ssl_cert_t **p_cert); + + +/** + * Cipher suites enumeration. + */ +typedef enum pj_ssl_cipher { + + /* NULL */ + TLS_NULL_WITH_NULL_NULL = 0x00000000, + + /* TLS/SSLv3 */ + TLS_RSA_WITH_NULL_MD5 = 0x00000001, + TLS_RSA_WITH_NULL_SHA = 0x00000002, + TLS_RSA_WITH_NULL_SHA256 = 0x0000003B, + TLS_RSA_WITH_RC4_128_MD5 = 0x00000004, + TLS_RSA_WITH_RC4_128_SHA = 0x00000005, + TLS_RSA_WITH_3DES_EDE_CBC_SHA = 0x0000000A, + TLS_RSA_WITH_AES_128_CBC_SHA = 0x0000002F, + TLS_RSA_WITH_AES_256_CBC_SHA = 0x00000035, + TLS_RSA_WITH_AES_128_CBC_SHA256 = 0x0000003C, + TLS_RSA_WITH_AES_256_CBC_SHA256 = 0x0000003D, + TLS_DH_DSS_WITH_3DES_EDE_CBC_SHA = 0x0000000D, + TLS_DH_RSA_WITH_3DES_EDE_CBC_SHA = 0x00000010, + TLS_DHE_DSS_WITH_3DES_EDE_CBC_SHA = 0x00000013, + TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA = 0x00000016, + TLS_DH_DSS_WITH_AES_128_CBC_SHA = 0x00000030, + TLS_DH_RSA_WITH_AES_128_CBC_SHA = 0x00000031, + TLS_DHE_DSS_WITH_AES_128_CBC_SHA = 0x00000032, + TLS_DHE_RSA_WITH_AES_128_CBC_SHA = 0x00000033, + TLS_DH_DSS_WITH_AES_256_CBC_SHA = 0x00000036, + TLS_DH_RSA_WITH_AES_256_CBC_SHA = 0x00000037, + TLS_DHE_DSS_WITH_AES_256_CBC_SHA = 0x00000038, + TLS_DHE_RSA_WITH_AES_256_CBC_SHA = 0x00000039, + TLS_DH_DSS_WITH_AES_128_CBC_SHA256 = 0x0000003E, + TLS_DH_RSA_WITH_AES_128_CBC_SHA256 = 0x0000003F, + TLS_DHE_DSS_WITH_AES_128_CBC_SHA256 = 0x00000040, + TLS_DHE_RSA_WITH_AES_128_CBC_SHA256 = 0x00000067, + TLS_DH_DSS_WITH_AES_256_CBC_SHA256 = 0x00000068, + TLS_DH_RSA_WITH_AES_256_CBC_SHA256 = 0x00000069, + TLS_DHE_DSS_WITH_AES_256_CBC_SHA256 = 0x0000006A, + TLS_DHE_RSA_WITH_AES_256_CBC_SHA256 = 0x0000006B, + TLS_DH_anon_WITH_RC4_128_MD5 = 0x00000018, + TLS_DH_anon_WITH_3DES_EDE_CBC_SHA = 0x0000001B, + TLS_DH_anon_WITH_AES_128_CBC_SHA = 0x00000034, + TLS_DH_anon_WITH_AES_256_CBC_SHA = 0x0000003A, + TLS_DH_anon_WITH_AES_128_CBC_SHA256 = 0x0000006C, + TLS_DH_anon_WITH_AES_256_CBC_SHA256 = 0x0000006D, + + /* TLS (deprecated) */ + TLS_RSA_EXPORT_WITH_RC4_40_MD5 = 0x00000003, + TLS_RSA_EXPORT_WITH_RC2_CBC_40_MD5 = 0x00000006, + TLS_RSA_WITH_IDEA_CBC_SHA = 0x00000007, + TLS_RSA_EXPORT_WITH_DES40_CBC_SHA = 0x00000008, + TLS_RSA_WITH_DES_CBC_SHA = 0x00000009, + TLS_DH_DSS_EXPORT_WITH_DES40_CBC_SHA = 0x0000000B, + TLS_DH_DSS_WITH_DES_CBC_SHA = 0x0000000C, + TLS_DH_RSA_EXPORT_WITH_DES40_CBC_SHA = 0x0000000E, + TLS_DH_RSA_WITH_DES_CBC_SHA = 0x0000000F, + TLS_DHE_DSS_EXPORT_WITH_DES40_CBC_SHA = 0x00000011, + TLS_DHE_DSS_WITH_DES_CBC_SHA = 0x00000012, + TLS_DHE_RSA_EXPORT_WITH_DES40_CBC_SHA = 0x00000014, + TLS_DHE_RSA_WITH_DES_CBC_SHA = 0x00000015, + TLS_DH_anon_EXPORT_WITH_RC4_40_MD5 = 0x00000017, + TLS_DH_anon_EXPORT_WITH_DES40_CBC_SHA = 0x00000019, + TLS_DH_anon_WITH_DES_CBC_SHA = 0x0000001A, + + /* SSLv3 */ + SSL_FORTEZZA_KEA_WITH_NULL_SHA = 0x0000001C, + SSL_FORTEZZA_KEA_WITH_FORTEZZA_CBC_SHA= 0x0000001D, + SSL_FORTEZZA_KEA_WITH_RC4_128_SHA = 0x0000001E, + + /* SSLv2 */ + SSL_CK_RC4_128_WITH_MD5 = 0x00010080, + SSL_CK_RC4_128_EXPORT40_WITH_MD5 = 0x00020080, + SSL_CK_RC2_128_CBC_WITH_MD5 = 0x00030080, + SSL_CK_RC2_128_CBC_EXPORT40_WITH_MD5 = 0x00040080, + SSL_CK_IDEA_128_CBC_WITH_MD5 = 0x00050080, + SSL_CK_DES_64_CBC_WITH_MD5 = 0x00060040, + SSL_CK_DES_192_EDE3_CBC_WITH_MD5 = 0x000700C0 + +} pj_ssl_cipher; + + +/** + * Get cipher list supported by SSL/TLS backend. + * + * @param ciphers The ciphers buffer to receive cipher list. + * @param cipher_num Maximum number of ciphers to be received. + * + * @return PJ_SUCCESS when successful. + */ +PJ_DECL(pj_status_t) pj_ssl_cipher_get_availables(pj_ssl_cipher ciphers[], + unsigned *cipher_num); + + +/** + * Get cipher name string. + * + * @param cipher The cipher. + * + * @return The cipher name or NULL if cipher is not recognized. + */ +PJ_DECL(const char*) pj_ssl_cipher_name(pj_ssl_cipher cipher); + + +/** + * This structure contains the callbacks to be called by the secure socket. + */ +typedef struct pj_ssl_sock_cb +{ + /** + * This callback is called when a data arrives as the result of + * pj_ssl_sock_start_read(). + * + * @param ssock The secure socket. + * @param data The buffer containing the new data, if any. If + * the status argument is non-PJ_SUCCESS, this + * argument may be NULL. + * @param size The length of data in the buffer. + * @param status The status of the read operation. This may contain + * non-PJ_SUCCESS for example when the TCP connection + * has been closed. In this case, the buffer may + * contain left over data from previous callback which + * the application may want to process. + * @param remainder If application wishes to leave some data in the + * buffer (common for TCP applications), it should + * move the remainder data to the front part of the + * buffer and set the remainder length here. The value + * of this parameter will be ignored for datagram + * sockets. + * + * @return PJ_TRUE if further read is desired, and PJ_FALSE + * when application no longer wants to receive data. + * Application may destroy the secure socket in the + * callback and return PJ_FALSE here. + */ + pj_bool_t (*on_data_read)(pj_ssl_sock_t *ssock, + void *data, + pj_size_t size, + pj_status_t status, + pj_size_t *remainder); + /** + * This callback is called when a packet arrives as the result of + * pj_ssl_sock_start_recvfrom(). + * + * @param ssock The secure socket. + * @param data The buffer containing the packet, if any. If + * the status argument is non-PJ_SUCCESS, this + * argument will be set to NULL. + * @param size The length of packet in the buffer. If + * the status argument is non-PJ_SUCCESS, this + * argument will be set to zero. + * @param src_addr Source address of the packet. + * @param addr_len Length of the source address. + * @param status This contains + * + * @return PJ_TRUE if further read is desired, and PJ_FALSE + * when application no longer wants to receive data. + * Application may destroy the secure socket in the + * callback and return PJ_FALSE here. + */ + pj_bool_t (*on_data_recvfrom)(pj_ssl_sock_t *ssock, + void *data, + pj_size_t size, + const pj_sockaddr_t *src_addr, + int addr_len, + pj_status_t status); + + /** + * This callback is called when data has been sent. + * + * @param ssock The secure socket. + * @param send_key Key associated with the send operation. + * @param sent If value is positive non-zero it indicates the + * number of data sent. When the value is negative, + * it contains the error code which can be retrieved + * by negating the value (i.e. status=-sent). + * + * @return Application may destroy the secure socket in the + * callback and return PJ_FALSE here. + */ + pj_bool_t (*on_data_sent)(pj_ssl_sock_t *ssock, + pj_ioqueue_op_key_t *send_key, + pj_ssize_t sent); + + /** + * This callback is called when new connection arrives as the result + * of pj_ssl_sock_start_accept(). + * + * @param ssock The secure socket. + * @param newsock The new incoming secure socket. + * @param src_addr The source address of the connection. + * @param addr_len Length of the source address. + * + * @return PJ_TRUE if further accept() is desired, and PJ_FALSE + * when application no longer wants to accept incoming + * connection. Application may destroy the secure socket + * in the callback and return PJ_FALSE here. + */ + pj_bool_t (*on_accept_complete)(pj_ssl_sock_t *ssock, + pj_ssl_sock_t *newsock, + const pj_sockaddr_t *src_addr, + int src_addr_len); + + /** + * This callback is called when pending connect operation has been + * completed. + * + * @param ssock The secure socket. + * @param status The connection result. If connection has been + * successfully established, the status will contain + * PJ_SUCCESS. + * + * @return Application may destroy the secure socket in the + * callback and return PJ_FALSE here. + */ + pj_bool_t (*on_connect_complete)(pj_ssl_sock_t *ssock, + pj_status_t status); + +} pj_ssl_sock_cb; + + +/** + * Enumeration of secure socket protocol types. + */ +typedef enum pj_ssl_sock_proto +{ + PJ_SSL_SOCK_PROTO_DEFAULT, /**< Default protocol of backend. */ + PJ_SSL_SOCK_PROTO_TLS1, /**< TLSv1.0 protocol. */ + PJ_SSL_SOCK_PROTO_SSL3, /**< SSLv3.0 protocol. */ + PJ_SSL_SOCK_PROTO_SSL23, /**< SSLv3.0 but can roll back to + SSLv2.0. */ + PJ_SSL_SOCK_PROTO_SSL2, /**< SSLv2.0 protocol. */ + PJ_SSL_SOCK_PROTO_DTLS1 /**< DTLSv1.0 protocol. */ +} pj_ssl_sock_proto; + + +/** + * Definition of secure socket info structure. + */ +typedef struct pj_ssl_sock_info +{ + /** + * Describes whether secure socket connection is established, i.e: TLS/SSL + * handshaking has been done successfully. + */ + pj_bool_t established; + + /** + * Describes secure socket protocol being used. + */ + pj_ssl_sock_proto proto; + + /** + * Describes cipher suite being used, this will only be set when connection + * is established. + */ + pj_ssl_cipher cipher; + + /** + * Describes local address. + */ + pj_sockaddr local_addr; + + /** + * Describes remote address. + */ + pj_sockaddr remote_addr; + + /** + * Describes active local certificate info. + */ + pj_ssl_cert_info local_cert_info; + + /** + * Describes active remote certificate info. + */ + pj_ssl_cert_info remote_cert_info; + +} pj_ssl_sock_info; + + +/** + * Definition of secure socket creation parameters. + */ +typedef struct pj_ssl_sock_param +{ + /** + * Specifies socket address family, either pj_AF_INET() and pj_AF_INET6(). + * + * Default is pj_AF_INET(). + */ + int sock_af; + + /** + * Specify socket type, either pj_SOCK_DGRAM() or pj_SOCK_STREAM(). + * + * Default is pj_SOCK_STREAM(). + */ + int sock_type; + + /** + * Specify the ioqueue to use. Secure socket uses the ioqueue to perform + * active socket operations, see \ref PJ_ACTIVESOCK for more detail. + */ + pj_ioqueue_t *ioqueue; + + /** + * Specify the timer heap to use. Secure socket uses the timer to provide + * auto cancelation on asynchronous operation when it takes longer time + * than specified timeout period, e.g: security negotiation timeout. + */ + pj_timer_heap_t *timer_heap; + + /** + * Specify secure socket callbacks, see #pj_ssl_sock_cb. + */ + pj_ssl_sock_cb cb; + + /** + * Specify secure socket user data. + */ + void *user_data; + + /** + * Specify security protocol to use, see #pj_ssl_sock_proto. + * + * Default is PJ_SSL_SOCK_PROTO_DEFAULT. + */ + pj_ssl_sock_proto proto; + + /** + * Number of concurrent asynchronous operations that is to be supported + * by the secure socket. This value only affects socket receive and + * accept operations -- the secure socket will issue one or more + * asynchronous read and accept operations based on the value of this + * field. Setting this field to more than one will allow more than one + * incoming data or incoming connections to be processed simultaneously + * on multiprocessor systems, when the ioqueue is polled by more than + * one threads. + * + * The default value is 1. + */ + unsigned async_cnt; + + /** + * The ioqueue concurrency to be forced on the socket when it is + * registered to the ioqueue. See #pj_ioqueue_set_concurrency() for more + * info about ioqueue concurrency. + * + * When this value is -1, the concurrency setting will not be forced for + * this socket, and the socket will inherit the concurrency setting of + * the ioqueue. When this value is zero, the secure socket will disable + * concurrency for the socket. When this value is +1, the secure socket + * will enable concurrency for the socket. + * + * The default value is -1. + */ + int concurrency; + + /** + * If this option is specified, the secure socket will make sure that + * asynchronous send operation with stream oriented socket will only + * call the callback after all data has been sent. This means that the + * secure socket will automatically resend the remaining data until + * all data has been sent. + * + * Please note that when this option is specified, it is possible that + * error is reported after partial data has been sent. Also setting + * this will disable the ioqueue concurrency for the socket. + * + * Default value is 1. + */ + pj_bool_t whole_data; + + /** + * Specify buffer size for sending operation. Buffering sending data + * is used for allowing application to perform multiple outstanding + * send operations. Whenever application specifies this setting too + * small, sending operation may return PJ_ENOMEM. + * + * Default value is 8192 bytes. + */ + pj_size_t send_buffer_size; + + /** + * Specify buffer size for receiving encrypted (and perhaps compressed) + * data on underlying socket. This setting is unused on Symbian, since + * SSL/TLS Symbian backend, CSecureSocket, can use application buffer + * directly. + * + * Default value is 1500. + */ + pj_size_t read_buffer_size; + + /** + * Number of ciphers contained in the specified cipher preference. + * If this is set to zero, then default cipher list of the backend + * will be used. + */ + unsigned ciphers_num; + + /** + * Ciphers and order preference. If empty, then default cipher list and + * its default order of the backend will be used. + */ + pj_ssl_cipher *ciphers; + + /** + * Security negotiation timeout. If this is set to zero (both sec and + * msec), the negotiation doesn't have a timeout. + * + * Default value is zero. + */ + pj_time_val timeout; + + /** + * Specify whether endpoint should verify peer certificate. + * + * Default value is PJ_FALSE. + */ + pj_bool_t verify_peer; + + /** + * When secure socket is acting as server (handles incoming connection), + * it will require the client to provide certificate. + * + * Default value is PJ_FALSE. + */ + pj_bool_t require_client_cert; + + /** + * When secure socket is acting as client (perform outgoing connection) + * and it needs to verify server name (e.g: host or domain name) by + * matching it to the name specified in the server certificate. This + * setting is useful when the server is hosting multiple domains for + * the same listening socket. + * + * Default value is zero/not-set. + */ + pj_str_t server_name; + + /** + * QoS traffic type to be set on this transport. When application wants + * to apply QoS tagging to the transport, it's preferable to set this + * field rather than \a qos_param fields since this is more portable. + * + * Default value is PJ_QOS_TYPE_BEST_EFFORT. + */ + pj_qos_type qos_type; + + /** + * Set the low level QoS parameters to the transport. This is a lower + * level operation than setting the \a qos_type field and may not be + * supported on all platforms. + * + * By default all settings in this structure are disabled. + */ + pj_qos_params qos_params; + + /** + * Specify if the transport should ignore any errors when setting the QoS + * traffic type/parameters. + * + * Default: PJ_TRUE + */ + pj_bool_t qos_ignore_error; + + +} pj_ssl_sock_param; + + +/** + * Initialize the secure socket parameters for its creation with + * the default values. + * + * @param param The parameter to be initialized. + */ +PJ_DECL(void) pj_ssl_sock_param_default(pj_ssl_sock_param *param); + + +/** + * Create secure socket instance. + * + * @param pool The pool for allocating secure socket instance. + * @param param The secure socket parameter, see #pj_ssl_sock_param. + * @param p_ssock Pointer to secure socket instance to be created. + * + * @return PJ_SUCCESS when successful. + */ +PJ_DECL(pj_status_t) pj_ssl_sock_create(pj_pool_t *pool, + const pj_ssl_sock_param *param, + pj_ssl_sock_t **p_ssock); + + +/** + * Set secure socket certificate or credentials. Credentials may include + * certificate, private key and trusted Certification Authorities list. + * Normally, server socket must provide certificate (and private key). + * Socket client may also need to provide certificate in case requested + * by the server. + * + * @param ssock The secure socket instance. + * @param pool The pool. + * @param cert The endpoint certificate/credentials, see + * #pj_ssl_cert_t. + * + * @return PJ_SUCCESS if the operation has been successful, + * or the appropriate error code on failure. + */ +PJ_DECL(pj_status_t) pj_ssl_sock_set_certificate( + pj_ssl_sock_t *ssock, + pj_pool_t *pool, + const pj_ssl_cert_t *cert); + + +/** + * Close and destroy the secure socket. + * + * @param ssock The secure socket. + * + * @return PJ_SUCCESS if the operation has been successful, + * or the appropriate error code on failure. + */ +PJ_DECL(pj_status_t) pj_ssl_sock_close(pj_ssl_sock_t *ssock); + + +/** + * Associate arbitrary data with the secure socket. Application may + * inspect this data in the callbacks and associate it with higher + * level processing. + * + * @param ssock The secure socket. + * @param user_data The user data to be associated with the secure + * socket. + * + * @return PJ_SUCCESS if the operation has been successful, + * or the appropriate error code on failure. + */ +PJ_DECL(pj_status_t) pj_ssl_sock_set_user_data(pj_ssl_sock_t *ssock, + void *user_data); + +/** + * Retrieve the user data previously associated with this secure + * socket. + * + * @param ssock The secure socket. + * + * @return The user data. + */ +PJ_DECL(void*) pj_ssl_sock_get_user_data(pj_ssl_sock_t *ssock); + + +/** + * Retrieve the local address and port used by specified secure socket. + * + * @param ssock The secure socket. + * @param info The info buffer to be set, see #pj_ssl_sock_info. + * + * @return PJ_SUCCESS on successful. + */ +PJ_DECL(pj_status_t) pj_ssl_sock_get_info(pj_ssl_sock_t *ssock, + pj_ssl_sock_info *info); + + +/** + * Starts read operation on this secure socket. This function will create + * \a async_cnt number of buffers (the \a async_cnt parameter was given + * in \a pj_ssl_sock_create() function) where each buffer is \a buff_size + * long. The buffers are allocated from the specified \a pool. Once the + * buffers are created, it then issues \a async_cnt number of asynchronous + * \a recv() operations to the socket and returns back to caller. Incoming + * data on the socket will be reported back to application via the + * \a on_data_read() callback. + * + * Application only needs to call this function once to initiate read + * operations. Further read operations will be done automatically by the + * secure socket when \a on_data_read() callback returns non-zero. + * + * @param ssock The secure socket. + * @param pool Pool used to allocate buffers for incoming data. + * @param buff_size The size of each buffer, in bytes. + * @param flags Flags to be given to pj_ioqueue_recv(). + * + * @return PJ_SUCCESS if the operation has been successful, + * or the appropriate error code on failure. + */ +PJ_DECL(pj_status_t) pj_ssl_sock_start_read(pj_ssl_sock_t *ssock, + pj_pool_t *pool, + unsigned buff_size, + pj_uint32_t flags); + +/** + * Same as #pj_ssl_sock_start_read(), except that the application + * supplies the buffers for the read operation so that the acive socket + * does not have to allocate the buffers. + * + * @param ssock The secure socket. + * @param pool Pool used to allocate buffers for incoming data. + * @param buff_size The size of each buffer, in bytes. + * @param readbuf Array of packet buffers, each has buff_size size. + * @param flags Flags to be given to pj_ioqueue_recv(). + * + * @return PJ_SUCCESS if the operation has been successful, + * or the appropriate error code on failure. + */ +PJ_DECL(pj_status_t) pj_ssl_sock_start_read2(pj_ssl_sock_t *ssock, + pj_pool_t *pool, + unsigned buff_size, + void *readbuf[], + pj_uint32_t flags); + +/** + * Same as pj_ssl_sock_start_read(), except that this function is used + * only for datagram sockets, and it will trigger \a on_data_recvfrom() + * callback instead. + * + * @param ssock The secure socket. + * @param pool Pool used to allocate buffers for incoming data. + * @param buff_size The size of each buffer, in bytes. + * @param flags Flags to be given to pj_ioqueue_recvfrom(). + * + * @return PJ_SUCCESS if the operation has been successful, + * or the appropriate error code on failure. + */ +PJ_DECL(pj_status_t) pj_ssl_sock_start_recvfrom(pj_ssl_sock_t *ssock, + pj_pool_t *pool, + unsigned buff_size, + pj_uint32_t flags); + +/** + * Same as #pj_ssl_sock_start_recvfrom() except that the recvfrom() + * operation takes the buffer from the argument rather than creating + * new ones. + * + * @param ssock The secure socket. + * @param pool Pool used to allocate buffers for incoming data. + * @param buff_size The size of each buffer, in bytes. + * @param readbuf Array of packet buffers, each has buff_size size. + * @param flags Flags to be given to pj_ioqueue_recvfrom(). + * + * @return PJ_SUCCESS if the operation has been successful, + * or the appropriate error code on failure. + */ +PJ_DECL(pj_status_t) pj_ssl_sock_start_recvfrom2(pj_ssl_sock_t *ssock, + pj_pool_t *pool, + unsigned buff_size, + void *readbuf[], + pj_uint32_t flags); + +/** + * Send data using the socket. + * + * @param ssock The secure socket. + * @param send_key The operation key to send the data, which is useful + * if application wants to submit multiple pending + * send operations and want to track which exact data + * has been sent in the \a on_data_sent() callback. + * @param data The data to be sent. This data must remain valid + * until the data has been sent. + * @param size The size of the data. + * @param flags Flags to be given to pj_ioqueue_send(). + * + * @return PJ_SUCCESS if data has been sent immediately, or + * PJ_EPENDING if data cannot be sent immediately or + * PJ_ENOMEM when sending buffer could not handle all + * queued data, see \a send_buffer_size. The callback + * \a on_data_sent() will be called when data is actually + * sent. Any other return value indicates error condition. + */ +PJ_DECL(pj_status_t) pj_ssl_sock_send(pj_ssl_sock_t *ssock, + pj_ioqueue_op_key_t *send_key, + const void *data, + pj_ssize_t *size, + unsigned flags); + +/** + * Send datagram using the socket. + * + * @param ssock The secure socket. + * @param send_key The operation key to send the data, which is useful + * if application wants to submit multiple pending + * send operations and want to track which exact data + * has been sent in the \a on_data_sent() callback. + * @param data The data to be sent. This data must remain valid + * until the data has been sent. + * @param size The size of the data. + * @param flags Flags to be given to pj_ioqueue_send(). + * @param addr The destination address. + * @param addr_len Length of buffer containing destination address. + * + * @return PJ_SUCCESS if data has been sent immediately, or + * PJ_EPENDING if data cannot be sent immediately. In + * this case the \a on_data_sent() callback will be + * called when data is actually sent. Any other return + * value indicates error condition. + */ +PJ_DECL(pj_status_t) pj_ssl_sock_sendto(pj_ssl_sock_t *ssock, + pj_ioqueue_op_key_t *send_key, + const void *data, + pj_ssize_t *size, + unsigned flags, + const pj_sockaddr_t *addr, + int addr_len); + + +/** + * Starts asynchronous socket accept() operations on this secure socket. + * This function will issue \a async_cnt number of asynchronous \a accept() + * operations to the socket and returns back to caller. Incoming + * connection on the socket will be reported back to application via the + * \a on_accept_complete() callback. + * + * Application only needs to call this function once to initiate accept() + * operations. Further accept() operations will be done automatically by + * the secure socket when \a on_accept_complete() callback returns non-zero. + * + * @param ssock The secure socket. + * @param pool Pool used to allocate some internal data for the + * operation. + * @param localaddr Local address to bind on. + * @param addr_len Length of buffer containing local address. + * + * @return PJ_SUCCESS if the operation has been successful, + * or the appropriate error code on failure. + */ +PJ_DECL(pj_status_t) pj_ssl_sock_start_accept(pj_ssl_sock_t *ssock, + pj_pool_t *pool, + const pj_sockaddr_t *local_addr, + int addr_len); + + +/** + * Starts asynchronous socket connect() operation and SSL/TLS handshaking + * for this socket. Once the connection is done (either successfully or not), + * the \a on_connect_complete() callback will be called. + * + * @param ssock The secure socket. + * @param pool The pool to allocate some internal data for the + * operation. + * @param localaddr Local address. + * @param remaddr Remote address. + * @param addr_len Length of buffer containing above addresses. + * + * @return PJ_SUCCESS if connection can be established immediately + * or PJ_EPENDING if connection cannot be established + * immediately. In this case the \a on_connect_complete() + * callback will be called when connection is complete. + * Any other return value indicates error condition. + */ +PJ_DECL(pj_status_t) pj_ssl_sock_start_connect(pj_ssl_sock_t *ssock, + pj_pool_t *pool, + const pj_sockaddr_t *localaddr, + const pj_sockaddr_t *remaddr, + int addr_len); + + +/** + * Starts SSL/TLS renegotiation over an already established SSL connection + * for this socket. This operation is performed transparently, no callback + * will be called once the renegotiation completed successfully. However, + * when the renegotiation fails, the connection will be closed and callback + * \a on_data_read() will be invoked with non-PJ_SUCCESS status code. + * + * @param ssock The secure socket. + * + * @return PJ_SUCCESS if renegotiation is completed immediately, + * or PJ_EPENDING if renegotiation has been started and + * waiting for completion, or the appropriate error code + * on failure. + */ +PJ_DECL(pj_status_t) pj_ssl_sock_renegotiate(pj_ssl_sock_t *ssock); + + +/** + * @} + */ + +PJ_END_DECL + +#endif /* __PJ_SSL_SOCK_H__ */ diff --git a/sflphone-common/libs/pjproject/pjlib/include/pj/timer.h b/sflphone-common/libs/pjproject/pjlib/include/pj/timer.h index b0cbdb6ef19a3cb7050f36fc27adcd4bbdc68afa..dfb8bb489426788e0b7d5b3a1bb9c080ae5d4fdb 100644 --- a/sflphone-common/libs/pjproject/pjlib/include/pj/timer.h +++ b/sflphone-common/libs/pjproject/pjlib/include/pj/timer.h @@ -1,4 +1,4 @@ -/* $Id: timer.h 2512 2009-03-13 15:49:06Z bennylp $ */ +/* $Id: timer.h 3034 2009-12-16 13:30:34Z bennylp $ */ /* * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -64,11 +64,7 @@ PJ_BEGIN_DECL /** * The type for internal timer ID. */ -#if defined(PJ_SYMBIAN) && PJ_SYMBIAN!=0 -typedef void *pj_timer_id_t; -#else typedef int pj_timer_id_t; -#endif /** * Forward declaration for pj_timer_entry. diff --git a/sflphone-common/libs/pjproject/pjlib/include/pjlib.h b/sflphone-common/libs/pjproject/pjlib/include/pjlib.h index acc12c426b5f324851ed502490de8421debe8ef0..dcfa3bed96faa38468bb18407868bc2a10ea2992 100644 --- a/sflphone-common/libs/pjproject/pjlib/include/pjlib.h +++ b/sflphone-common/libs/pjproject/pjlib/include/pjlib.h @@ -1,4 +1,4 @@ -/* $Id: pjlib.h 2394 2008-12-23 17:27:53Z bennylp $ */ +/* $Id: pjlib.h 2970 2009-10-26 15:47:52Z nanang $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> @@ -50,7 +50,9 @@ #include <pj/rand.h> #include <pj/rbtree.h> #include <pj/sock.h> +#include <pj/sock_qos.h> #include <pj/sock_select.h> +#include <pj/ssl_sock.h> #include <pj/string.h> #include <pj/timer.h> #include <pj/unicode.h> diff --git a/sflphone-common/libs/pjproject/pjlib/src/pj/activesock.c b/sflphone-common/libs/pjproject/pjlib/src/pj/activesock.c index 3d7451af7b5559082e1a860f6f36a80114fb1c88..2c19fc9fc016901f7341898c82147d17ec74e170 100644 --- a/sflphone-common/libs/pjproject/pjlib/src/pj/activesock.c +++ b/sflphone-common/libs/pjproject/pjlib/src/pj/activesock.c @@ -1,4 +1,4 @@ -/* $Id: activesock.c 2394 2008-12-23 17:27:53Z bennylp $ */ +/* $Id: activesock.c 2980 2009-11-03 12:58:54Z nanang $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> @@ -458,8 +458,15 @@ static void ioqueue_on_read_complete(pj_ioqueue_key_t *key, * connection. * If there is no remainder data, set the packet to NULL. */ - ret = (*asock->cb.on_data_read)(asock, (r->size? r->pkt:NULL), - r->size, status, &remainder); + + /* Shouldn't set the packet to NULL, as there may be active + * socket user, such as SSL socket, that needs to have access + * to the read buffer packet. + */ + //ret = (*asock->cb.on_data_read)(asock, (r->size? r->pkt:NULL), + // r->size, status, &remainder); + ret = (*asock->cb.on_data_read)(asock, r->pkt, r->size, + status, &remainder); } else if (asock->read_type == TYPE_RECV_FROM && asock->cb.on_data_recvfrom) @@ -711,12 +718,14 @@ static void ioqueue_on_accept_complete(pj_ioqueue_key_t *key, pj_activesock_t *asock = (pj_activesock_t*) pj_ioqueue_get_user_data(key); struct accept_op *accept_op = (struct accept_op*) op_key; + PJ_UNUSED_ARG(new_sock); + do { if (status==PJ_SUCCESS && asock->cb.on_accept_complete) { pj_bool_t ret; /* Notify callback */ - ret = (*asock->cb.on_accept_complete)(asock, new_sock, + ret = (*asock->cb.on_accept_complete)(asock, accept_op->new_sock, &accept_op->rem_addr, accept_op->rem_addr_len); diff --git a/sflphone-common/libs/pjproject/pjlib/src/pj/addr_resolv_sock.c b/sflphone-common/libs/pjproject/pjlib/src/pj/addr_resolv_sock.c index bdce279ee348cdccc3acf74eb7417a6cf2c8cd22..3c3a946741cb3bb20c2f2694e51da3f7c394c964 100644 --- a/sflphone-common/libs/pjproject/pjlib/src/pj/addr_resolv_sock.c +++ b/sflphone-common/libs/pjproject/pjlib/src/pj/addr_resolv_sock.c @@ -1,4 +1,4 @@ -/* $Id: addr_resolv_sock.c 2394 2008-12-23 17:27:53Z bennylp $ */ +/* $Id: addr_resolv_sock.c 3044 2010-01-04 16:54:50Z nanang $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> @@ -73,18 +73,28 @@ PJ_DEF(pj_status_t) pj_getaddrinfo(int af, const pj_str_t *nodename, /* Check if nodename is IP address */ pj_bzero(&ai[0], sizeof(ai[0])); - ai[0].ai_addr.addr.sa_family = (pj_uint16_t)af; - if (pj_inet_pton(af, nodename, pj_sockaddr_get_addr(&ai[0].ai_addr)) - == PJ_SUCCESS) - { - pj_str_t tmp; + if (af == PJ_AF_UNSPEC) { + if (pj_inet_pton(PJ_AF_INET, nodename, + &ai[0].ai_addr.ipv4.sin_addr) == PJ_SUCCESS) + { + af = PJ_AF_INET; + } + else if (pj_inet_pton(PJ_AF_INET6, nodename, + &ai[0].ai_addr.ipv6.sin6_addr) == PJ_SUCCESS) + { + af = PJ_AF_INET6; + } - tmp.ptr = ai[0].ai_canonname; - pj_strncpy_with_null(&tmp, nodename, PJ_MAX_HOSTNAME); - ai[0].ai_addr.addr.sa_family = (pj_uint16_t)af; - *count = 1; + if (af != PJ_AF_UNSPEC) { + pj_str_t tmp; - return PJ_SUCCESS; + tmp.ptr = ai[0].ai_canonname; + pj_strncpy_with_null(&tmp, nodename, PJ_MAX_HOSTNAME); + ai[0].ai_addr.addr.sa_family = (pj_uint16_t)af; + *count = 1; + + return PJ_SUCCESS; + } } /* Copy node name to null terminated string. */ @@ -121,6 +131,7 @@ PJ_DEF(pj_status_t) pj_getaddrinfo(int af, const pj_str_t *nodename, /* Store address */ PJ_ASSERT_ON_FAIL(res->ai_addrlen <= sizeof(pj_sockaddr), continue); pj_memcpy(&ai[i].ai_addr, res->ai_addr, res->ai_addrlen); + PJ_SOCKADDR_RESET_LEN(&ai[i].ai_addr); /* Next slot */ ++i; @@ -139,18 +150,28 @@ PJ_DEF(pj_status_t) pj_getaddrinfo(int af, const pj_str_t *nodename, /* Check if nodename is IP address */ pj_bzero(&ai[0], sizeof(ai[0])); - ai[0].ai_addr.addr.sa_family = (pj_uint16_t)af; - if (pj_inet_pton(af, nodename, pj_sockaddr_get_addr(&ai[0].ai_addr)) - == PJ_SUCCESS) - { - pj_str_t tmp; + if (af == PJ_AF_UNSPEC) { + if (pj_inet_pton(PJ_AF_INET, nodename, + &ai[0].ai_addr.ipv4.sin_addr) == PJ_SUCCESS) + { + af = PJ_AF_INET; + } + else if (pj_inet_pton(PJ_AF_INET6, nodename, + &ai[0].ai_addr.ipv6.sin6_addr) == PJ_SUCCESS) + { + af = PJ_AF_INET6; + } - tmp.ptr = ai[0].ai_canonname; - pj_strncpy_with_null(&tmp, nodename, PJ_MAX_HOSTNAME); - ai[0].ai_addr.addr.sa_family = (pj_uint16_t)af; - *count = 1; + if (af != PJ_AF_UNSPEC) { + pj_str_t tmp; - return PJ_SUCCESS; + tmp.ptr = ai[0].ai_canonname; + pj_strncpy_with_null(&tmp, nodename, PJ_MAX_HOSTNAME); + ai[0].ai_addr.addr.sa_family = (pj_uint16_t)af; + *count = 1; + + return PJ_SUCCESS; + } } if (af == PJ_AF_INET || af == PJ_AF_UNSPEC) { @@ -180,6 +201,7 @@ PJ_DEF(pj_status_t) pj_getaddrinfo(int af, const pj_str_t *nodename, ai[*count].ai_addr.ipv4.sin_family = PJ_AF_INET; pj_memcpy(&ai[*count].ai_addr.ipv4.sin_addr, he.h_addr_list[i], he.h_length); + PJ_SOCKADDR_RESET_LEN(&ai[*count].ai_addr); (*count)++; } diff --git a/sflphone-common/libs/pjproject/pjlib/src/pj/addr_resolv_symbian.cpp b/sflphone-common/libs/pjproject/pjlib/src/pj/addr_resolv_symbian.cpp index 98833dbedbc5ce0ae58fed8d41bba59eca827a0a..a0f4453dcef2545167dacd407b60f9560aadf640 100644 --- a/sflphone-common/libs/pjproject/pjlib/src/pj/addr_resolv_symbian.cpp +++ b/sflphone-common/libs/pjproject/pjlib/src/pj/addr_resolv_symbian.cpp @@ -1,5 +1,5 @@ /* $Id: addr_resolv_symbian.cpp 2888 2009-08-17 11:29:39Z nanang $ */ -/* +/* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> * @@ -15,7 +15,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include <pj/addr_resolv.h> #include <pj/assert.h> @@ -27,199 +27,175 @@ #include <pj/unicode.h> #include "os_symbian.h" - + #define THIS_FILE "addr_resolv_symbian.cpp" #define TRACE_ME 0 // PJLIB API: resolve hostname -PJ_DEF (pj_status_t) pj_gethostbyname (const pj_str_t *name, pj_hostent *he) +PJ_DEF(pj_status_t) pj_gethostbyname(const pj_str_t *name, pj_hostent *he) { static pj_addrinfo ai; static char *aliases[2]; static char *addrlist[2]; unsigned count = 1; pj_status_t status; - - status = pj_getaddrinfo (PJ_AF_INET, name, &count, &ai); - + + status = pj_getaddrinfo(PJ_AF_INET, name, &count, &ai); if (status != PJ_SUCCESS) - return status; - + return status; + aliases[0] = ai.ai_canonname; - aliases[1] = NULL; - + addrlist[0] = (char*) &ai.ai_addr.ipv4.sin_addr; - addrlist[1] = NULL; - - pj_bzero (he, sizeof (*he)); - + + pj_bzero(he, sizeof(*he)); he->h_name = aliases[0]; - he->h_aliases = aliases; - he->h_addrtype = PJ_AF_INET; - he->h_length = 4; - he->h_addr_list = addrlist; - + return PJ_SUCCESS; } // Resolve for specific address family -static pj_status_t getaddrinfo_by_af (int af, const pj_str_t *name, - unsigned *count, pj_addrinfo ai[]) +static pj_status_t getaddrinfo_by_af(int af, const pj_str_t *name, + unsigned *count, pj_addrinfo ai[]) { unsigned i; pj_status_t status; - - PJ_ASSERT_RETURN (name && count && ai, PJ_EINVAL); + + PJ_ASSERT_RETURN(name && count && ai, PJ_EINVAL); #if !defined(PJ_HAS_IPV6) || !PJ_HAS_IPV6 - if (af == PJ_AF_INET6) - return PJ_EIPV6NOTSUP; - + return PJ_EIPV6NOTSUP; #endif - + // Return failure if access point is marked as down by app. PJ_SYMBIAN_CHECK_CONNECTION(); // Get resolver for the specified address family - RHostResolver &resv = PjSymbianOS::Instance()->GetResolver (af); + RHostResolver &resv = PjSymbianOS::Instance()->GetResolver(af); // Convert name to Unicode wchar_t name16[PJ_MAX_HOSTNAME]; - - pj_ansi_to_unicode (name->ptr, name->slen, name16, PJ_ARRAY_SIZE (name16)); - - TPtrC16 data ( (const TUint16*) name16); + pj_ansi_to_unicode(name->ptr, name->slen, name16, PJ_ARRAY_SIZE(name16)); + TPtrC16 data((const TUint16*)name16); // Resolve! TNameEntry nameEntry; - TRequestStatus reqStatus; - - resv.GetByName (data, nameEntry, reqStatus); - - User::WaitForRequest (reqStatus); - + + resv.GetByName(data, nameEntry, reqStatus); + User::WaitForRequest(reqStatus); + // Iterate each result i = 0; - while (reqStatus == KErrNone && i < *count) { - - // Get the resolved TInetAddr - TInetAddr inetAddr (nameEntry().iAddr); - int addrlen; + + // Get the resolved TInetAddr + TInetAddr inetAddr(nameEntry().iAddr); + int addrlen; #if TRACE_ME - - if (1) { - pj_sockaddr a; - char ipaddr[PJ_INET6_ADDRSTRLEN+2]; - int namelen; - - namelen = sizeof (pj_sockaddr); - - if (PjSymbianOS::Addr2pj (inetAddr, a, &namelen, - PJ_FALSE) == PJ_SUCCESS) { - PJ_LOG (5, (THIS_FILE, "resolve %.*s: %s", - (int) name->slen, name->ptr, - pj_sockaddr_print (&a, ipaddr, sizeof (ipaddr), 2))); - } - } - + if (1) { + pj_sockaddr a; + char ipaddr[PJ_INET6_ADDRSTRLEN+2]; + int namelen; + + namelen = sizeof(pj_sockaddr); + if (PjSymbianOS::Addr2pj(inetAddr, a, &namelen, + PJ_FALSE) == PJ_SUCCESS) + { + PJ_LOG(5,(THIS_FILE, "resolve %.*s: %s", + (int)name->slen, name->ptr, + pj_sockaddr_print(&a, ipaddr, sizeof(ipaddr), 2))); + } + } #endif - - // Ignore if this is not the same address family - // Not a good idea, as Symbian mapps IPv4 to IPv6. - //fam = inetAddr.Family(); - //if (fam != af) { - // resv.Next(nameEntry, reqStatus); - // User::WaitForRequest(reqStatus); - // continue; - //} - - // Convert IP address first to get IPv4 mapped address - addrlen = sizeof (ai[i].ai_addr); - - status = PjSymbianOS::Addr2pj (inetAddr, ai[i].ai_addr, - &addrlen, PJ_TRUE); - - if (status != PJ_SUCCESS) - return status; - - // Ignore if address family doesn't match - if (ai[i].ai_addr.addr.sa_family != af) { - resv.Next (nameEntry, reqStatus); - User::WaitForRequest (reqStatus); - continue; - } - - // Convert the official address to ANSI. - pj_unicode_to_ansi ( (const wchar_t*) nameEntry().iName.Ptr(), - nameEntry().iName.Length(), - ai[i].ai_canonname, sizeof (ai[i].ai_canonname)); - - // Next - ++i; - - resv.Next (nameEntry, reqStatus); - - User::WaitForRequest (reqStatus); + + // Ignore if this is not the same address family + // Not a good idea, as Symbian mapps IPv4 to IPv6. + //fam = inetAddr.Family(); + //if (fam != af) { + // resv.Next(nameEntry, reqStatus); + // User::WaitForRequest(reqStatus); + // continue; + //} + + // Convert IP address first to get IPv4 mapped address + addrlen = sizeof(ai[i].ai_addr); + status = PjSymbianOS::Addr2pj(inetAddr, ai[i].ai_addr, + &addrlen, PJ_TRUE); + if (status != PJ_SUCCESS) + return status; + + // Ignore if address family doesn't match + if (ai[i].ai_addr.addr.sa_family != af) { + resv.Next(nameEntry, reqStatus); + User::WaitForRequest(reqStatus); + continue; + } + + // Convert the official address to ANSI. + pj_unicode_to_ansi((const wchar_t*)nameEntry().iName.Ptr(), + nameEntry().iName.Length(), + ai[i].ai_canonname, sizeof(ai[i].ai_canonname)); + + // Next + ++i; + resv.Next(nameEntry, reqStatus); + User::WaitForRequest(reqStatus); } *count = i; - return PJ_SUCCESS; } /* Resolve IPv4/IPv6 address */ -PJ_DEF (pj_status_t) pj_getaddrinfo (int af, const pj_str_t *nodename, - unsigned *count, pj_addrinfo ai[]) +PJ_DEF(pj_status_t) pj_getaddrinfo(int af, const pj_str_t *nodename, + unsigned *count, pj_addrinfo ai[]) { unsigned start; pj_status_t status = PJ_EAFNOTSUP; - - PJ_ASSERT_RETURN (af==PJ_AF_INET || af==PJ_AF_INET6 || af==PJ_AF_UNSPEC, - PJ_EAFNOTSUP); - PJ_ASSERT_RETURN (nodename && count && *count && ai, PJ_EINVAL); - + + PJ_ASSERT_RETURN(af==PJ_AF_INET || af==PJ_AF_INET6 || af==PJ_AF_UNSPEC, + PJ_EAFNOTSUP); + PJ_ASSERT_RETURN(nodename && count && *count && ai, PJ_EINVAL); + start = 0; - + if (af==PJ_AF_INET6 || af==PJ_AF_UNSPEC) { unsigned max = *count; - status = getaddrinfo_by_af (PJ_AF_INET6, nodename, - &max, &ai[start]); - - if (status == PJ_SUCCESS) { - (*count) -= max; - start += max; - } + status = getaddrinfo_by_af(PJ_AF_INET6, nodename, + &max, &ai[start]); + if (status == PJ_SUCCESS) { + (*count) -= max; + start += max; + } } - + if (af==PJ_AF_INET || af==PJ_AF_UNSPEC) { unsigned max = *count; - status = getaddrinfo_by_af (PJ_AF_INET, nodename, - &max, &ai[start]); - - if (status == PJ_SUCCESS) { - (*count) -= max; - start += max; - } + status = getaddrinfo_by_af(PJ_AF_INET, nodename, + &max, &ai[start]); + if (status == PJ_SUCCESS) { + (*count) -= max; + start += max; + } } - + *count = start; - + if (*count) { - return PJ_SUCCESS; + return PJ_SUCCESS; } else { - return status!=PJ_SUCCESS ? status : PJ_ENOTFOUND; + return status!=PJ_SUCCESS ? status : PJ_ENOTFOUND; } } diff --git a/sflphone-common/libs/pjproject/pjlib/src/pj/config.c b/sflphone-common/libs/pjproject/pjlib/src/pj/config.c index 92079b5b46bfca969c314b255ab8f6c6f7e1edba..a8d3517444189380b90565a8b9e51a101a8907e6 100644 --- a/sflphone-common/libs/pjproject/pjlib/src/pj/config.c +++ b/sflphone-common/libs/pjproject/pjlib/src/pj/config.c @@ -1,4 +1,4 @@ -/* $Id: config.c 2900 2009-08-17 21:30:15Z bennylp $ */ +/* $Id: config.c 3054 2010-01-11 09:42:39Z ismangil $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> @@ -22,7 +22,7 @@ #include <pj/ioqueue.h> static const char *id = "config.c"; -PJ_DEF_DATA(const char*) PJ_VERSION = "1.4"; +PJ_DEF_DATA(const char*) PJ_VERSION = "1.5.5"; /* * Get PJLIB version string. diff --git a/sflphone-common/libs/pjproject/pjlib/src/pj/errno.c b/sflphone-common/libs/pjproject/pjlib/src/pj/errno.c index 37a9cfb7ea1949aed359ddce744eefdcbc2b6650..3d44f6e378e10a2952069bb8c75868c96de155e3 100644 --- a/sflphone-common/libs/pjproject/pjlib/src/pj/errno.c +++ b/sflphone-common/libs/pjproject/pjlib/src/pj/errno.c @@ -1,4 +1,4 @@ -/* $Id: errno.c 2394 2008-12-23 17:27:53Z bennylp $ */ +/* $Id: errno.c 2992 2009-11-09 04:09:13Z bennylp $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> @@ -18,8 +18,10 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include <pj/errno.h> +#include <pj/log.h> #include <pj/string.h> #include <pj/compat/string.h> +#include <pj/compat/stdarg.h> #include <pj/assert.h> /* Prototype for platform specific error message, which will be defined @@ -196,3 +198,113 @@ PJ_DEF(pj_str_t) pj_strerror( pj_status_t statcode, return errstr; } +#if PJ_LOG_MAX_LEVEL >= 1 +static void invoke_log(const char *sender, int level, const char *format, ...) +{ + va_list arg; + va_start(arg, format); + pj_log(sender, level, format, arg); + va_end(arg); +} + +static void pj_perror_imp(int log_level, const char *sender, + pj_status_t status, + const char *title_fmt, va_list marker) +{ + char titlebuf[PJ_PERROR_TITLE_BUF_SIZE]; + char errmsg[PJ_ERR_MSG_SIZE]; + int len; + + /* Build the title */ + len = pj_ansi_vsnprintf(titlebuf, sizeof(titlebuf), title_fmt, marker); + if (len < 0 || len >= sizeof(titlebuf)) + pj_ansi_strcpy(titlebuf, "Error"); + + /* Get the error */ + pj_strerror(status, errmsg, sizeof(errmsg)); + + /* Send to log */ + invoke_log(sender, log_level, "%s: %s", titlebuf, errmsg); +} + +PJ_DEF(void) pj_perror(int log_level, const char *sender, pj_status_t status, + const char *title_fmt, ...) +{ + va_list marker; + va_start(marker, title_fmt); + pj_perror_imp(log_level, sender, status, title_fmt, marker); + va_end(marker); +} + +PJ_DEF(void) pj_perror_1(const char *sender, pj_status_t status, + const char *title_fmt, ...) +{ + va_list marker; + va_start(marker, title_fmt); + pj_perror_imp(1, sender, status, title_fmt, marker); + va_end(marker); +} + +#else /* #if PJ_LOG_MAX_LEVEL >= 1 */ +PJ_DEF(void) pj_perror(int log_level, const char *sender, pj_status_t status, + const char *title_fmt, ...) +{ +} +#endif /* #if PJ_LOG_MAX_LEVEL >= 1 */ + + +#if PJ_LOG_MAX_LEVEL >= 2 +PJ_DEF(void) pj_perror_2(const char *sender, pj_status_t status, + const char *title_fmt, ...) +{ + va_list marker; + va_start(marker, title_fmt); + pj_perror_imp(2, sender, status, title_fmt, marker); + va_end(marker); +} +#endif + +#if PJ_LOG_MAX_LEVEL >= 3 +PJ_DEF(void) pj_perror_3(const char *sender, pj_status_t status, + const char *title_fmt, ...) +{ + va_list marker; + va_start(marker, title_fmt); + pj_perror_imp(3, sender, status, title_fmt, marker); + va_end(marker); +} +#endif + +#if PJ_LOG_MAX_LEVEL >= 4 +PJ_DEF(void) pj_perror_4(const char *sender, pj_status_t status, + const char *title_fmt, ...) +{ + va_list marker; + va_start(marker, title_fmt); + pj_perror_imp(4, sender, status, title_fmt, marker); + va_end(marker); +} +#endif + +#if PJ_LOG_MAX_LEVEL >= 5 +PJ_DEF(void) pj_perror_5(const char *sender, pj_status_t status, + const char *title_fmt, ...) +{ + va_list marker; + va_start(marker, title_fmt); + pj_perror_imp(5, sender, status, title_fmt, marker); + va_end(marker); +} +#endif + +#if PJ_LOG_MAX_LEVEL >= 6 +PJ_DEF(void) pj_perror_6(const char *sender, pj_status_t status, + const char *title_fmt, ...) +{ + va_list marker; + va_start(marker, title_fmt); + pj_perror_imp(6, sender, status, title_fmt, marker); + va_end(marker); +} +#endif + diff --git a/sflphone-common/libs/pjproject/pjlib/src/pj/exception_symbian.cpp b/sflphone-common/libs/pjproject/pjlib/src/pj/exception_symbian.cpp index 14ded02ed9c7f93154068aef65904015728dc4b1..e54cebddf940cd73896ee81e1f59afad48d16d74 100644 --- a/sflphone-common/libs/pjproject/pjlib/src/pj/exception_symbian.cpp +++ b/sflphone-common/libs/pjproject/pjlib/src/pj/exception_symbian.cpp @@ -1,5 +1,5 @@ /* $Id: exception_symbian.cpp 2394 2008-12-23 17:27:53Z bennylp $ */ -/* +/* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> * @@ -15,7 +15,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include <pj/except.h> #include <pj/os.h> @@ -25,19 +25,19 @@ #if defined(PJ_HAS_EXCEPTION_NAMES) && PJ_HAS_EXCEPTION_NAMES != 0 -static const char *exception_id_names[PJ_MAX_EXCEPTION_ID]; + static const char *exception_id_names[PJ_MAX_EXCEPTION_ID]; #else -/* - * Start from 1 (not 0)!!! - * Exception 0 is reserved for normal path of setjmp()!!! - */ -static int last_exception_id = 1; + /* + * Start from 1 (not 0)!!! + * Exception 0 is reserved for normal path of setjmp()!!! + */ + static int last_exception_id = 1; #endif /* PJ_HAS_EXCEPTION_NAMES */ #if defined(PJ_HAS_EXCEPTION_NAMES) && PJ_HAS_EXCEPTION_NAMES != 0 -PJ_DEF (pj_status_t) pj_exception_id_alloc (const char *name, - pj_exception_id_t *id) +PJ_DEF(pj_status_t) pj_exception_id_alloc( const char *name, + pj_exception_id_t *id) { unsigned i; @@ -47,7 +47,6 @@ PJ_DEF (pj_status_t) pj_exception_id_alloc (const char *name, * Start from 1 (not 0)!!! * Exception 0 is reserved for normal path of setjmp()!!! */ - for (i=1; i<PJ_MAX_EXCEPTION_ID; ++i) { if (exception_id_names[i] == NULL) { exception_id_names[i] = name; @@ -58,18 +57,17 @@ PJ_DEF (pj_status_t) pj_exception_id_alloc (const char *name, } pj_leave_critical_section(); - return PJ_ETOOMANY; } -PJ_DEF (pj_status_t) pj_exception_id_free (pj_exception_id_t id) +PJ_DEF(pj_status_t) pj_exception_id_free( pj_exception_id_t id ) { /* * Start from 1 (not 0)!!! * Exception 0 is reserved for normal path of setjmp()!!! */ - PJ_ASSERT_RETURN (id>0 && id<PJ_MAX_EXCEPTION_ID, PJ_EINVAL); - + PJ_ASSERT_RETURN(id>0 && id<PJ_MAX_EXCEPTION_ID, PJ_EINVAL); + pj_enter_critical_section(); exception_id_names[id] = NULL; pj_leave_critical_section(); @@ -78,13 +76,13 @@ PJ_DEF (pj_status_t) pj_exception_id_free (pj_exception_id_t id) } -PJ_DEF (const char*) pj_exception_id_name (pj_exception_id_t id) +PJ_DEF(const char*) pj_exception_id_name(pj_exception_id_t id) { /* * Start from 1 (not 0)!!! * Exception 0 is reserved for normal path of setjmp()!!! */ - PJ_ASSERT_RETURN (id>0 && id<PJ_MAX_EXCEPTION_ID, "<Invalid ID>"); + PJ_ASSERT_RETURN(id>0 && id<PJ_MAX_EXCEPTION_ID, "<Invalid ID>"); if (exception_id_names[id] == NULL) return "<Unallocated ID>"; @@ -93,21 +91,21 @@ PJ_DEF (const char*) pj_exception_id_name (pj_exception_id_t id) } #else /* PJ_HAS_EXCEPTION_NAMES */ -PJ_DEF (pj_status_t) pj_exception_id_alloc (const char *name, - pj_exception_id_t *id) +PJ_DEF(pj_status_t) pj_exception_id_alloc( const char *name, + pj_exception_id_t *id) { - PJ_ASSERT_RETURN (last_exception_id < PJ_MAX_EXCEPTION_ID-1, PJ_ETOOMANY); + PJ_ASSERT_RETURN(last_exception_id < PJ_MAX_EXCEPTION_ID-1, PJ_ETOOMANY); *id = last_exception_id++; return PJ_SUCCESS; } -PJ_DEF (pj_status_t) pj_exception_id_free (pj_exception_id_t id) +PJ_DEF(pj_status_t) pj_exception_id_free( pj_exception_id_t id ) { return PJ_SUCCESS; } -PJ_DEF (const char*) pj_exception_id_name (pj_exception_id_t id) +PJ_DEF(const char*) pj_exception_id_name(pj_exception_id_t id) { return ""; } diff --git a/sflphone-common/libs/pjproject/pjlib/src/pj/ioqueue_symbian.cpp b/sflphone-common/libs/pjproject/pjlib/src/pj/ioqueue_symbian.cpp index 4acbd9619b6c0e66565af39076dfe987b65090a3..c436d4c45836f7c21e5b7bd6930eba005942d01d 100644 --- a/sflphone-common/libs/pjproject/pjlib/src/pj/ioqueue_symbian.cpp +++ b/sflphone-common/libs/pjproject/pjlib/src/pj/ioqueue_symbian.cpp @@ -1,5 +1,5 @@ /* $Id: ioqueue_symbian.cpp 2771 2009-06-17 13:31:13Z bennylp $ */ -/* +/* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> * @@ -15,7 +15,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include <pj/ioqueue.h> #include <pj/assert.h> @@ -32,8 +32,8 @@ class CIoqueueCallback; /* * IO Queue structure. */ - -struct pj_ioqueue_t { +struct pj_ioqueue_t +{ int eventCount; }; @@ -41,144 +41,148 @@ struct pj_ioqueue_t { ///////////////////////////////////////////////////////////////////////////// // Class to encapsulate asynchronous socket operation. // - class CIoqueueCallback : public CActive { +public: + static CIoqueueCallback* NewL(pj_ioqueue_t *ioqueue, + pj_ioqueue_key_t *key, + pj_sock_t sock, + const pj_ioqueue_callback *cb, + void *user_data); + + // + // Start asynchronous recv() operation + // + pj_status_t StartRead(pj_ioqueue_op_key_t *op_key, + void *buf, pj_ssize_t *size, unsigned flags, + pj_sockaddr_t *addr, int *addrlen); + + // + // Start asynchronous accept() operation. + // + pj_status_t StartAccept(pj_ioqueue_op_key_t *op_key, + pj_sock_t *new_sock, + pj_sockaddr_t *local, + pj_sockaddr_t *remote, + int *addrlen ); + + // + // Completion callback. + // + void RunL(); + + // + // CActive's DoCancel() + // + void DoCancel(); + + // + // Cancel operation and call callback. + // + void CancelOperation(pj_ioqueue_op_key_t *op_key, + pj_ssize_t bytes_status); + + // + // Accessors + // + void* get_user_data() const + { + return user_data_; + } + void set_user_data(void *user_data) + { + user_data_ = user_data; + } + pj_ioqueue_op_key_t *get_op_key() const + { + return pending_data_.common_.op_key_; + } + CPjSocket* get_pj_socket() + { + return sock_; + } + +private: + // Type of pending operation. + enum Type { + TYPE_NONE, + TYPE_READ, + TYPE_ACCEPT, + }; + + // Static data. + pj_ioqueue_t *ioqueue_; + pj_ioqueue_key_t *key_; + CPjSocket *sock_; + pj_ioqueue_callback cb_; + void *user_data_; + + // Symbian data. + TPtr8 aBufferPtr_; + TInetAddr aAddress_; + + // Application data. + Type type_; + + union Pending_Data + { + struct Common + { + pj_ioqueue_op_key_t *op_key_; + } common_; + + struct Pending_Read + { + pj_ioqueue_op_key_t *op_key_; + pj_sockaddr_t *addr_; + int *addrlen_; + } read_; + + struct Pending_Accept + { + pj_ioqueue_op_key_t *op_key_; + pj_sock_t *new_sock_; + pj_sockaddr_t *local_; + pj_sockaddr_t *remote_; + int *addrlen_; + } accept_; + }; + + union Pending_Data pending_data_; + RSocket blank_sock_; + + CIoqueueCallback(pj_ioqueue_t *ioqueue, + pj_ioqueue_key_t *key, pj_sock_t sock, + const pj_ioqueue_callback *cb, void *user_data) + : CActive(CActive::EPriorityStandard), + ioqueue_(ioqueue), key_(key), sock_((CPjSocket*)sock), + user_data_(user_data), aBufferPtr_(NULL, 0), type_(TYPE_NONE) + { + pj_memcpy(&cb_, cb, sizeof(*cb)); + } - public: - static CIoqueueCallback* NewL (pj_ioqueue_t *ioqueue, - pj_ioqueue_key_t *key, - pj_sock_t sock, - const pj_ioqueue_callback *cb, - void *user_data); - - // - // Start asynchronous recv() operation - // - pj_status_t StartRead (pj_ioqueue_op_key_t *op_key, - void *buf, pj_ssize_t *size, unsigned flags, - pj_sockaddr_t *addr, int *addrlen); - - // - // Start asynchronous accept() operation. - // - pj_status_t StartAccept (pj_ioqueue_op_key_t *op_key, - pj_sock_t *new_sock, - pj_sockaddr_t *local, - pj_sockaddr_t *remote, - int *addrlen); - - // - // Completion callback. - // - void RunL(); - - // - // CActive's DoCancel() - // - void DoCancel(); - - // - // Cancel operation and call callback. - // - void CancelOperation (pj_ioqueue_op_key_t *op_key, - pj_ssize_t bytes_status); - - // - // Accessors - // - void* get_user_data() const { - return user_data_; - } - - void set_user_data (void *user_data) { - user_data_ = user_data; - } - - pj_ioqueue_op_key_t *get_op_key() const { - return pending_data_.common_.op_key_; - } - - CPjSocket* get_pj_socket() { - return sock_; - } - - private: - // Type of pending operation. - enum Type { - TYPE_NONE, - TYPE_READ, - TYPE_ACCEPT, - }; - - // Static data. - pj_ioqueue_t *ioqueue_; - pj_ioqueue_key_t *key_; - CPjSocket *sock_; - pj_ioqueue_callback cb_; - void *user_data_; - - // Symbian data. - TPtr8 aBufferPtr_; - TInetAddr aAddress_; - - // Application data. - Type type_; - - union Pending_Data { - - struct Common { - pj_ioqueue_op_key_t *op_key_; - } common_; - - struct Pending_Read { - pj_ioqueue_op_key_t *op_key_; - pj_sockaddr_t *addr_; - int *addrlen_; - } read_; - - struct Pending_Accept { - pj_ioqueue_op_key_t *op_key_; - pj_sock_t *new_sock_; - pj_sockaddr_t *local_; - pj_sockaddr_t *remote_; - int *addrlen_; - } accept_; - }; - - union Pending_Data pending_data_; - RSocket blank_sock_; - - CIoqueueCallback (pj_ioqueue_t *ioqueue, - pj_ioqueue_key_t *key, pj_sock_t sock, - const pj_ioqueue_callback *cb, void *user_data) - : CActive (CActive::EPriorityStandard), - ioqueue_ (ioqueue), key_ (key), sock_ ( (CPjSocket*) sock), - user_data_ (user_data), aBufferPtr_ (NULL, 0), type_ (TYPE_NONE) { - pj_memcpy (&cb_, cb, sizeof (*cb)); - } - - - void ConstructL() { - CActiveScheduler::Add (this); - } - - void HandleReadCompletion(); - CPjSocket *HandleAcceptCompletion(); + + void ConstructL() + { + CActiveScheduler::Add(this); + } + + void HandleReadCompletion(); + CPjSocket *HandleAcceptCompletion(); }; -CIoqueueCallback* CIoqueueCallback::NewL (pj_ioqueue_t *ioqueue, - pj_ioqueue_key_t *key, - pj_sock_t sock, - const pj_ioqueue_callback *cb, - void *user_data) +CIoqueueCallback* CIoqueueCallback::NewL(pj_ioqueue_t *ioqueue, + pj_ioqueue_key_t *key, + pj_sock_t sock, + const pj_ioqueue_callback *cb, + void *user_data) { - CIoqueueCallback *self = new CIoqueueCallback (ioqueue, key, sock, - cb, user_data); - CleanupStack::PushL (self); + CIoqueueCallback *self = new CIoqueueCallback(ioqueue, key, sock, + cb, user_data); + CleanupStack::PushL(self); self->ConstructL(); - CleanupStack::Pop (self); + CleanupStack::Pop(self); return self; } @@ -187,13 +191,13 @@ CIoqueueCallback* CIoqueueCallback::NewL (pj_ioqueue_t *ioqueue, // // Start asynchronous recv() operation // -pj_status_t CIoqueueCallback::StartRead (pj_ioqueue_op_key_t *op_key, - void *buf, pj_ssize_t *size, - unsigned flags, - pj_sockaddr_t *addr, int *addrlen) +pj_status_t CIoqueueCallback::StartRead(pj_ioqueue_op_key_t *op_key, + void *buf, pj_ssize_t *size, + unsigned flags, + pj_sockaddr_t *addr, int *addrlen) { - PJ_ASSERT_RETURN (IsActive() ==false, PJ_EBUSY); - PJ_ASSERT_RETURN (pending_data_.common_.op_key_==NULL, PJ_EBUSY); + PJ_ASSERT_RETURN(IsActive()==false, PJ_EBUSY); + PJ_ASSERT_RETURN(pending_data_.common_.op_key_==NULL, PJ_EBUSY); flags &= ~PJ_IOQUEUE_ALWAYS_ASYNC; @@ -201,29 +205,27 @@ pj_status_t CIoqueueCallback::StartRead (pj_ioqueue_op_key_t *op_key, pending_data_.read_.addr_ = addr; pending_data_.read_.addrlen_ = addrlen; - aBufferPtr_.Set ( (TUint8*) buf, 0, (TInt) *size); + aBufferPtr_.Set((TUint8*)buf, 0, (TInt)*size); type_ = TYPE_READ; - if (addr && addrlen) { - sock_->Socket().RecvFrom (aBufferPtr_, aAddress_, flags, iStatus); + sock_->Socket().RecvFrom(aBufferPtr_, aAddress_, flags, iStatus); } else { - aAddress_.SetAddress (0); - aAddress_.SetPort (0); - - if (sock_->IsDatagram()) { - sock_->Socket().Recv (aBufferPtr_, flags, iStatus); - } else { - // Using static like this is not pretty, but we don't need to use - // the value anyway, hence doing it like this is probably most - // optimal. - static TSockXfrLength len; - sock_->Socket().RecvOneOrMore (aBufferPtr_, flags, iStatus, len); - } + aAddress_.SetAddress(0); + aAddress_.SetPort(0); + + if (sock_->IsDatagram()) { + sock_->Socket().Recv(aBufferPtr_, flags, iStatus); + } else { + // Using static like this is not pretty, but we don't need to use + // the value anyway, hence doing it like this is probably most + // optimal. + static TSockXfrLength len; + sock_->Socket().RecvOneOrMore(aBufferPtr_, flags, iStatus, len); + } } SetActive(); - return PJ_EPENDING; } @@ -231,19 +233,19 @@ pj_status_t CIoqueueCallback::StartRead (pj_ioqueue_op_key_t *op_key, // // Start asynchronous accept() operation. // -pj_status_t CIoqueueCallback::StartAccept (pj_ioqueue_op_key_t *op_key, - pj_sock_t *new_sock, - pj_sockaddr_t *local, - pj_sockaddr_t *remote, - int *addrlen) +pj_status_t CIoqueueCallback::StartAccept(pj_ioqueue_op_key_t *op_key, + pj_sock_t *new_sock, + pj_sockaddr_t *local, + pj_sockaddr_t *remote, + int *addrlen ) { - PJ_ASSERT_RETURN (IsActive() ==false, PJ_EBUSY); - PJ_ASSERT_RETURN (pending_data_.common_.op_key_==NULL, PJ_EBUSY); + PJ_ASSERT_RETURN(IsActive()==false, PJ_EBUSY); + PJ_ASSERT_RETURN(pending_data_.common_.op_key_==NULL, PJ_EBUSY); // addrlen must be specified if local or remote is specified - PJ_ASSERT_RETURN ( (!local && !remote) || - (addrlen && *addrlen), PJ_EINVAL); - + PJ_ASSERT_RETURN((!local && !remote) || + (addrlen && *addrlen), PJ_EINVAL); + pending_data_.accept_.op_key_ = op_key; pending_data_.accept_.new_sock_ = new_sock; pending_data_.accept_.local_ = local; @@ -251,10 +253,10 @@ pj_status_t CIoqueueCallback::StartAccept (pj_ioqueue_op_key_t *op_key, pending_data_.accept_.addrlen_ = addrlen; // Create blank socket - blank_sock_.Open (PjSymbianOS::Instance()->SocketServ()); + blank_sock_.Open(PjSymbianOS::Instance()->SocketServ()); type_ = TYPE_ACCEPT; - sock_->Socket().Accept (blank_sock_, iStatus); + sock_->Socket().Accept(blank_sock_, iStatus); SetActive(); return PJ_EPENDING; @@ -264,16 +266,16 @@ pj_status_t CIoqueueCallback::StartAccept (pj_ioqueue_op_key_t *op_key, // // Handle asynchronous RecvFrom() completion // -void CIoqueueCallback::HandleReadCompletion() +void CIoqueueCallback::HandleReadCompletion() { if (pending_data_.read_.addr_ && pending_data_.read_.addrlen_) { - PjSymbianOS::Addr2pj (aAddress_, - * (pj_sockaddr*) pending_data_.read_.addr_, - pending_data_.read_.addrlen_); - pending_data_.read_.addr_ = NULL; - pending_data_.read_.addrlen_ = NULL; + PjSymbianOS::Addr2pj(aAddress_, + *(pj_sockaddr*)pending_data_.read_.addr_, + pending_data_.read_.addrlen_); + pending_data_.read_.addr_ = NULL; + pending_data_.read_.addrlen_ = NULL; } - + pending_data_.read_.op_key_ = NULL; } @@ -281,57 +283,55 @@ void CIoqueueCallback::HandleReadCompletion() // // Handle asynchronous Accept() completion. // -CPjSocket *CIoqueueCallback::HandleAcceptCompletion() +CPjSocket *CIoqueueCallback::HandleAcceptCompletion() { - CPjSocket *pjNewSock = new CPjSocket (get_pj_socket()->GetAf(), - get_pj_socket()->GetSockType(), - blank_sock_); - int addrlen = 0; - - if (pending_data_.accept_.new_sock_) { - *pending_data_.accept_.new_sock_ = (pj_sock_t) pjNewSock; - pending_data_.accept_.new_sock_ = NULL; - } - - if (pending_data_.accept_.local_) { - TInetAddr aAddr; - pj_sockaddr *ptr_sockaddr; - - blank_sock_.LocalName (aAddr); - ptr_sockaddr = (pj_sockaddr*) pending_data_.accept_.local_; - addrlen = *pending_data_.accept_.addrlen_; - PjSymbianOS::Addr2pj (aAddr, *ptr_sockaddr, &addrlen); - pending_data_.accept_.local_ = NULL; - } - - if (pending_data_.accept_.remote_) { - TInetAddr aAddr; - pj_sockaddr *ptr_sockaddr; - - blank_sock_.RemoteName (aAddr); - ptr_sockaddr = (pj_sockaddr*) pending_data_.accept_.remote_; - addrlen = *pending_data_.accept_.addrlen_; - PjSymbianOS::Addr2pj (aAddr, *ptr_sockaddr, &addrlen); - pending_data_.accept_.remote_ = NULL; - } - - if (pending_data_.accept_.addrlen_) { - if (addrlen == 0) { - if (pjNewSock->GetAf() == PJ_AF_INET) - addrlen = sizeof (pj_sockaddr_in); - else if (pjNewSock->GetAf() == PJ_AF_INET6) - addrlen = sizeof (pj_sockaddr_in6); - else { - pj_assert (!"Unsupported address family"); - } - } - - *pending_data_.accept_.addrlen_ = addrlen; - - pending_data_.accept_.addrlen_ = NULL; - } - - return pjNewSock; + CPjSocket *pjNewSock = new CPjSocket(get_pj_socket()->GetAf(), + get_pj_socket()->GetSockType(), + blank_sock_); + int addrlen = 0; + + if (pending_data_.accept_.new_sock_) { + *pending_data_.accept_.new_sock_ = (pj_sock_t)pjNewSock; + pending_data_.accept_.new_sock_ = NULL; + } + + if (pending_data_.accept_.local_) { + TInetAddr aAddr; + pj_sockaddr *ptr_sockaddr; + + blank_sock_.LocalName(aAddr); + ptr_sockaddr = (pj_sockaddr*)pending_data_.accept_.local_; + addrlen = *pending_data_.accept_.addrlen_; + PjSymbianOS::Addr2pj(aAddr, *ptr_sockaddr, &addrlen); + pending_data_.accept_.local_ = NULL; + } + + if (pending_data_.accept_.remote_) { + TInetAddr aAddr; + pj_sockaddr *ptr_sockaddr; + + blank_sock_.RemoteName(aAddr); + ptr_sockaddr = (pj_sockaddr*)pending_data_.accept_.remote_; + addrlen = *pending_data_.accept_.addrlen_; + PjSymbianOS::Addr2pj(aAddr, *ptr_sockaddr, &addrlen); + pending_data_.accept_.remote_ = NULL; + } + + if (pending_data_.accept_.addrlen_) { + if (addrlen == 0) { + if (pjNewSock->GetAf() == PJ_AF_INET) + addrlen = sizeof(pj_sockaddr_in); + else if (pjNewSock->GetAf() == PJ_AF_INET6) + addrlen = sizeof(pj_sockaddr_in6); + else { + pj_assert(!"Unsupported address family"); + } + } + *pending_data_.accept_.addrlen_ = addrlen; + pending_data_.accept_.addrlen_ = NULL; + } + + return pjNewSock; } @@ -345,64 +345,58 @@ void CIoqueueCallback::RunL() type_ = TYPE_NONE; if (cur_type == TYPE_READ) { - // - // Completion of asynchronous RecvFrom() - // - - /* Clear op_key (save it to temp variable first!) */ - pj_ioqueue_op_key_t *op_key = pending_data_.read_.op_key_; - pending_data_.read_.op_key_ = NULL; - - // Handle failure condition - - if (iStatus != KErrNone) { - if (cb_.on_read_complete) { - cb_.on_read_complete (key_, op_key, - -PJ_RETURN_OS_ERROR (iStatus.Int())); - } - - return; - } - - HandleReadCompletion(); - - /* Call callback */ - - if (cb_.on_read_complete) { - cb_.on_read_complete (key_, op_key, aBufferPtr_.Length()); - } + // + // Completion of asynchronous RecvFrom() + // + + /* Clear op_key (save it to temp variable first!) */ + pj_ioqueue_op_key_t *op_key = pending_data_.read_.op_key_; + pending_data_.read_.op_key_ = NULL; + + // Handle failure condition + if (iStatus != KErrNone) { + if (cb_.on_read_complete) { + cb_.on_read_complete( key_, op_key, + -PJ_RETURN_OS_ERROR(iStatus.Int())); + } + return; + } + + HandleReadCompletion(); + + /* Call callback */ + if (cb_.on_read_complete) { + cb_.on_read_complete(key_, op_key, aBufferPtr_.Length()); + } } else if (cur_type == TYPE_ACCEPT) { - // - // Completion of asynchronous Accept() - // - - /* Clear op_key (save it to temp variable first!) */ - pj_ioqueue_op_key_t *op_key = pending_data_.read_.op_key_; - pending_data_.read_.op_key_ = NULL; - - // Handle failure condition - - if (iStatus != KErrNone) { - if (pending_data_.accept_.new_sock_) - *pending_data_.accept_.new_sock_ = PJ_INVALID_SOCKET; - - if (cb_.on_accept_complete) { - cb_.on_accept_complete (key_, op_key, PJ_INVALID_SOCKET, - -PJ_RETURN_OS_ERROR (iStatus.Int())); - } - - return; - } - - CPjSocket *pjNewSock = HandleAcceptCompletion(); - - // Call callback. - - if (cb_.on_accept_complete) { - cb_.on_accept_complete (key_, op_key, (pj_sock_t) pjNewSock, - PJ_SUCCESS); - } + // + // Completion of asynchronous Accept() + // + + /* Clear op_key (save it to temp variable first!) */ + pj_ioqueue_op_key_t *op_key = pending_data_.read_.op_key_; + pending_data_.read_.op_key_ = NULL; + + // Handle failure condition + if (iStatus != KErrNone) { + if (pending_data_.accept_.new_sock_) + *pending_data_.accept_.new_sock_ = PJ_INVALID_SOCKET; + + if (cb_.on_accept_complete) { + cb_.on_accept_complete( key_, op_key, PJ_INVALID_SOCKET, + -PJ_RETURN_OS_ERROR(iStatus.Int())); + } + return; + } + + CPjSocket *pjNewSock = HandleAcceptCompletion(); + + // Call callback. + if (cb_.on_accept_complete) { + cb_.on_accept_complete( key_, op_key, (pj_sock_t)pjNewSock, + PJ_SUCCESS); + } } ioqueue_->eventCount++; @@ -414,32 +408,31 @@ void CIoqueueCallback::RunL() void CIoqueueCallback::DoCancel() { if (type_ == TYPE_READ) - sock_->Socket().CancelRecv(); + sock_->Socket().CancelRecv(); else if (type_ == TYPE_ACCEPT) - sock_->Socket().CancelAccept(); + sock_->Socket().CancelAccept(); type_ = TYPE_NONE; - pending_data_.common_.op_key_ = NULL; } // // Cancel operation and call callback. // -void CIoqueueCallback::CancelOperation (pj_ioqueue_op_key_t *op_key, - pj_ssize_t bytes_status) +void CIoqueueCallback::CancelOperation(pj_ioqueue_op_key_t *op_key, + pj_ssize_t bytes_status) { Type cur_type = type_; - pj_assert (op_key == pending_data_.common_.op_key_); + pj_assert(op_key == pending_data_.common_.op_key_); Cancel(); if (cur_type == TYPE_READ) { - if (cb_.on_read_complete) - cb_.on_read_complete (key_, op_key, bytes_status); + if (cb_.on_read_complete) + cb_.on_read_complete(key_, op_key, bytes_status); } else if (cur_type == TYPE_ACCEPT) - ; + ; } @@ -447,8 +440,8 @@ void CIoqueueCallback::CancelOperation (pj_ioqueue_op_key_t *op_key, /* * IO Queue key structure. */ - -struct pj_ioqueue_key_t { +struct pj_ioqueue_key_t +{ CIoqueueCallback *cbObj; }; @@ -456,7 +449,7 @@ struct pj_ioqueue_key_t { /* * Return the name of the ioqueue implementation. */ -PJ_DEF (const char*) pj_ioqueue_name (void) +PJ_DEF(const char*) pj_ioqueue_name(void) { return "ioqueue-symbian"; } @@ -465,15 +458,15 @@ PJ_DEF (const char*) pj_ioqueue_name (void) /* * Create a new I/O Queue framework. */ -PJ_DEF (pj_status_t) pj_ioqueue_create (pj_pool_t *pool, - pj_size_t max_fd, - pj_ioqueue_t **p_ioqueue) +PJ_DEF(pj_status_t) pj_ioqueue_create( pj_pool_t *pool, + pj_size_t max_fd, + pj_ioqueue_t **p_ioqueue) { pj_ioqueue_t *ioq; - PJ_UNUSED_ARG (max_fd); + PJ_UNUSED_ARG(max_fd); - ioq = PJ_POOL_ZALLOC_T (pool, pj_ioqueue_t); + ioq = PJ_POOL_ZALLOC_T(pool, pj_ioqueue_t); *p_ioqueue = ioq; return PJ_SUCCESS; } @@ -482,80 +475,79 @@ PJ_DEF (pj_status_t) pj_ioqueue_create (pj_pool_t *pool, /* * Destroy the I/O queue. */ -PJ_DEF (pj_status_t) pj_ioqueue_destroy (pj_ioqueue_t *ioq) +PJ_DEF(pj_status_t) pj_ioqueue_destroy( pj_ioqueue_t *ioq ) { - PJ_UNUSED_ARG (ioq); + PJ_UNUSED_ARG(ioq); return PJ_SUCCESS; } /* - * Set the lock object to be used by the I/O Queue. + * Set the lock object to be used by the I/O Queue. */ -PJ_DEF (pj_status_t) pj_ioqueue_set_lock (pj_ioqueue_t *ioq, - pj_lock_t *lock, - pj_bool_t auto_delete) +PJ_DEF(pj_status_t) pj_ioqueue_set_lock( pj_ioqueue_t *ioq, + pj_lock_t *lock, + pj_bool_t auto_delete ) { /* Don't really need lock for now */ - PJ_UNUSED_ARG (ioq); - + PJ_UNUSED_ARG(ioq); + if (auto_delete) { - pj_lock_destroy (lock); + pj_lock_destroy(lock); } return PJ_SUCCESS; } -PJ_DEF (pj_status_t) pj_ioqueue_set_default_concurrency (pj_ioqueue_t *ioqueue, - pj_bool_t allow) +PJ_DEF(pj_status_t) pj_ioqueue_set_default_concurrency(pj_ioqueue_t *ioqueue, + pj_bool_t allow) { - /* Not supported, just return PJ_SUCCESS silently */ - PJ_UNUSED_ARG (ioqueue); - PJ_UNUSED_ARG (allow); - return PJ_SUCCESS; + /* Not supported, just return PJ_SUCCESS silently */ + PJ_UNUSED_ARG(ioqueue); + PJ_UNUSED_ARG(allow); + return PJ_SUCCESS; } /* - * Register a socket to the I/O queue framework. + * Register a socket to the I/O queue framework. */ -PJ_DEF (pj_status_t) pj_ioqueue_register_sock (pj_pool_t *pool, - pj_ioqueue_t *ioq, - pj_sock_t sock, - void *user_data, - const pj_ioqueue_callback *cb, - pj_ioqueue_key_t **p_key) +PJ_DEF(pj_status_t) pj_ioqueue_register_sock( pj_pool_t *pool, + pj_ioqueue_t *ioq, + pj_sock_t sock, + void *user_data, + const pj_ioqueue_callback *cb, + pj_ioqueue_key_t **p_key ) { pj_ioqueue_key_t *key; - key = PJ_POOL_ZALLOC_T (pool, pj_ioqueue_key_t); - key->cbObj = CIoqueueCallback::NewL (ioq, key, sock, cb, user_data); + key = PJ_POOL_ZALLOC_T(pool, pj_ioqueue_key_t); + key->cbObj = CIoqueueCallback::NewL(ioq, key, sock, cb, user_data); *p_key = key; return PJ_SUCCESS; } /* - * Unregister from the I/O Queue framework. + * Unregister from the I/O Queue framework. */ -PJ_DEF (pj_status_t) pj_ioqueue_unregister (pj_ioqueue_key_t *key) +PJ_DEF(pj_status_t) pj_ioqueue_unregister( pj_ioqueue_key_t *key ) { if (key == NULL || key->cbObj == NULL) - return PJ_SUCCESS; + return PJ_SUCCESS; // Cancel pending async object if (key->cbObj) { - key->cbObj->Cancel(); + key->cbObj->Cancel(); } // Close socket. key->cbObj->get_pj_socket()->Socket().Close(); - delete key->cbObj->get_pj_socket(); // Delete async object. if (key->cbObj) { - delete key->cbObj; - key->cbObj = NULL; + delete key->cbObj; + key->cbObj = NULL; } return PJ_SUCCESS; @@ -565,7 +557,7 @@ PJ_DEF (pj_status_t) pj_ioqueue_unregister (pj_ioqueue_key_t *key) /* * Get user data associated with an ioqueue key. */ -PJ_DEF (void*) pj_ioqueue_get_user_data (pj_ioqueue_key_t *key) +PJ_DEF(void*) pj_ioqueue_get_user_data( pj_ioqueue_key_t *key ) { return key->cbObj->get_user_data(); } @@ -575,14 +567,13 @@ PJ_DEF (void*) pj_ioqueue_get_user_data (pj_ioqueue_key_t *key) * Set or change the user data to be associated with the file descriptor or * handle or socket descriptor. */ -PJ_DEF (pj_status_t) pj_ioqueue_set_user_data (pj_ioqueue_key_t *key, - void *user_data, - void **old_data) +PJ_DEF(pj_status_t) pj_ioqueue_set_user_data( pj_ioqueue_key_t *key, + void *user_data, + void **old_data) { if (old_data) - *old_data = key->cbObj->get_user_data(); - - key->cbObj->set_user_data (user_data); + *old_data = key->cbObj->get_user_data(); + key->cbObj->set_user_data(user_data); return PJ_SUCCESS; } @@ -591,91 +582,88 @@ PJ_DEF (pj_status_t) pj_ioqueue_set_user_data (pj_ioqueue_key_t *key, /* * Initialize operation key. */ -PJ_DEF (void) pj_ioqueue_op_key_init (pj_ioqueue_op_key_t *op_key, - pj_size_t size) +PJ_DEF(void) pj_ioqueue_op_key_init( pj_ioqueue_op_key_t *op_key, + pj_size_t size ) { - pj_bzero (op_key, size); + pj_bzero(op_key, size); } /* * Check if operation is pending on the specified operation key. */ -PJ_DEF (pj_bool_t) pj_ioqueue_is_pending (pj_ioqueue_key_t *key, - pj_ioqueue_op_key_t *op_key) +PJ_DEF(pj_bool_t) pj_ioqueue_is_pending( pj_ioqueue_key_t *key, + pj_ioqueue_op_key_t *op_key ) { - return key->cbObj->get_op_key() ==op_key && - key->cbObj->IsActive(); + return key->cbObj->get_op_key()==op_key && + key->cbObj->IsActive(); } /* * Post completion status to the specified operation key and call the - * appropriate callback. + * appropriate callback. */ -PJ_DEF (pj_status_t) pj_ioqueue_post_completion (pj_ioqueue_key_t *key, - pj_ioqueue_op_key_t *op_key, - pj_ssize_t bytes_status) +PJ_DEF(pj_status_t) pj_ioqueue_post_completion( pj_ioqueue_key_t *key, + pj_ioqueue_op_key_t *op_key, + pj_ssize_t bytes_status ) { - if (pj_ioqueue_is_pending (key, op_key)) { - key->cbObj->CancelOperation (op_key, bytes_status); + if (pj_ioqueue_is_pending(key, op_key)) { + key->cbObj->CancelOperation(op_key, bytes_status); } - return PJ_SUCCESS; } #if defined(PJ_HAS_TCP) && PJ_HAS_TCP != 0 /** - * Instruct I/O Queue to accept incoming connection on the specified + * Instruct I/O Queue to accept incoming connection on the specified * listening socket. */ -PJ_DEF (pj_status_t) pj_ioqueue_accept (pj_ioqueue_key_t *key, - pj_ioqueue_op_key_t *op_key, - pj_sock_t *new_sock, - pj_sockaddr_t *local, - pj_sockaddr_t *remote, - int *addrlen) +PJ_DEF(pj_status_t) pj_ioqueue_accept( pj_ioqueue_key_t *key, + pj_ioqueue_op_key_t *op_key, + pj_sock_t *new_sock, + pj_sockaddr_t *local, + pj_sockaddr_t *remote, + int *addrlen ) { - - return key->cbObj->StartAccept (op_key, new_sock, local, remote, addrlen); + + return key->cbObj->StartAccept(op_key, new_sock, local, remote, addrlen); } /* * Initiate non-blocking socket connect. */ -PJ_DEF (pj_status_t) pj_ioqueue_connect (pj_ioqueue_key_t *key, - const pj_sockaddr_t *addr, - int addrlen) +PJ_DEF(pj_status_t) pj_ioqueue_connect( pj_ioqueue_key_t *key, + const pj_sockaddr_t *addr, + int addrlen ) { pj_status_t status; - + RSocket &rSock = key->cbObj->get_pj_socket()->Socket(); TInetAddr inetAddr; TRequestStatus reqStatus; // Return failure if access point is marked as down by app. PJ_SYMBIAN_CHECK_CONNECTION(); - + // Convert address - status = PjSymbianOS::pj2Addr (* (const pj_sockaddr*) addr, addrlen, - inetAddr); - + status = PjSymbianOS::pj2Addr(*(const pj_sockaddr*)addr, addrlen, + inetAddr); if (status != PJ_SUCCESS) - return status; - + return status; + // We don't support async connect for now. - PJ_TODO (IOQUEUE_SUPPORT_ASYNC_CONNECT); + PJ_TODO(IOQUEUE_SUPPORT_ASYNC_CONNECT); - rSock.Connect (inetAddr, reqStatus); - - User::WaitForRequest (reqStatus); + rSock.Connect(inetAddr, reqStatus); + User::WaitForRequest(reqStatus); if (reqStatus == KErrNone) - return PJ_SUCCESS; + return PJ_SUCCESS; - return PJ_RETURN_OS_ERROR (reqStatus.Int()); + return PJ_RETURN_OS_ERROR(reqStatus.Int()); } @@ -684,14 +672,14 @@ PJ_DEF (pj_status_t) pj_ioqueue_connect (pj_ioqueue_key_t *key, /* * Poll the I/O Queue for completed events. */ -PJ_DEF (int) pj_ioqueue_poll (pj_ioqueue_t *ioq, - const pj_time_val *timeout) +PJ_DEF(int) pj_ioqueue_poll( pj_ioqueue_t *ioq, + const pj_time_val *timeout) { /* Polling is not necessary on Symbian, since all async activities * are registered to active scheduler. */ - PJ_UNUSED_ARG (ioq); - PJ_UNUSED_ARG (timeout); + PJ_UNUSED_ARG(ioq); + PJ_UNUSED_ARG(timeout); return 0; } @@ -699,20 +687,19 @@ PJ_DEF (int) pj_ioqueue_poll (pj_ioqueue_t *ioq, /* * Instruct the I/O Queue to read from the specified handle. */ -PJ_DEF (pj_status_t) pj_ioqueue_recv (pj_ioqueue_key_t *key, - pj_ioqueue_op_key_t *op_key, - void *buffer, - pj_ssize_t *length, - pj_uint32_t flags) +PJ_DEF(pj_status_t) pj_ioqueue_recv( pj_ioqueue_key_t *key, + pj_ioqueue_op_key_t *op_key, + void *buffer, + pj_ssize_t *length, + pj_uint32_t flags ) { // If socket has reader, delete it. if (key->cbObj->get_pj_socket()->Reader()) - key->cbObj->get_pj_socket()->DestroyReader(); - + key->cbObj->get_pj_socket()->DestroyReader(); + // Clear flag flags &= ~PJ_IOQUEUE_ALWAYS_ASYNC; - - return key->cbObj->StartRead (op_key, buffer, length, flags, NULL, NULL); + return key->cbObj->StartRead(op_key, buffer, length, flags, NULL, NULL); } @@ -721,60 +708,57 @@ PJ_DEF (pj_status_t) pj_ioqueue_recv (pj_ioqueue_key_t *key, * normally called for socket, and the remote address will also be returned * along with the data. */ -PJ_DEF (pj_status_t) pj_ioqueue_recvfrom (pj_ioqueue_key_t *key, - pj_ioqueue_op_key_t *op_key, - void *buffer, - pj_ssize_t *length, - pj_uint32_t flags, - pj_sockaddr_t *addr, - int *addrlen) +PJ_DEF(pj_status_t) pj_ioqueue_recvfrom( pj_ioqueue_key_t *key, + pj_ioqueue_op_key_t *op_key, + void *buffer, + pj_ssize_t *length, + pj_uint32_t flags, + pj_sockaddr_t *addr, + int *addrlen) { CPjSocket *sock = key->cbObj->get_pj_socket(); - + // If address is specified, check that the length match the // address family - if (addr || addrlen) { - PJ_ASSERT_RETURN (addr && addrlen && *addrlen, PJ_EINVAL); - - if (sock->GetAf() == PJ_AF_INET) { - PJ_ASSERT_RETURN (*addrlen>= (int) sizeof (pj_sockaddr_in), PJ_EINVAL); - } else if (sock->GetAf() == PJ_AF_INET6) { - PJ_ASSERT_RETURN (*addrlen>= (int) sizeof (pj_sockaddr_in6), PJ_EINVAL); - } + PJ_ASSERT_RETURN(addr && addrlen && *addrlen, PJ_EINVAL); + if (sock->GetAf() == PJ_AF_INET) { + PJ_ASSERT_RETURN(*addrlen>=(int)sizeof(pj_sockaddr_in), PJ_EINVAL); + } else if (sock->GetAf() == PJ_AF_INET6) { + PJ_ASSERT_RETURN(*addrlen>=(int)sizeof(pj_sockaddr_in6), PJ_EINVAL); + } } - + // If socket has reader, delete it. if (sock->Reader()) - sock->DestroyReader(); - + sock->DestroyReader(); + if (key->cbObj->IsActive()) - return PJ_EBUSY; + return PJ_EBUSY; // Clear flag flags &= ~PJ_IOQUEUE_ALWAYS_ASYNC; - - return key->cbObj->StartRead (op_key, buffer, length, flags, addr, addrlen); + return key->cbObj->StartRead(op_key, buffer, length, flags, addr, addrlen); } /* * Instruct the I/O Queue to write to the handle. */ -PJ_DEF (pj_status_t) pj_ioqueue_send (pj_ioqueue_key_t *key, - pj_ioqueue_op_key_t *op_key, - const void *data, - pj_ssize_t *length, - pj_uint32_t flags) +PJ_DEF(pj_status_t) pj_ioqueue_send( pj_ioqueue_key_t *key, + pj_ioqueue_op_key_t *op_key, + const void *data, + pj_ssize_t *length, + pj_uint32_t flags ) { TRequestStatus reqStatus; - TPtrC8 aBuffer ( (const TUint8*) data, (TInt) *length); + TPtrC8 aBuffer((const TUint8*)data, (TInt)*length); TSockXfrLength aLen; - - PJ_UNUSED_ARG (op_key); + + PJ_UNUSED_ARG(op_key); // Forcing pending operation is not supported. - PJ_ASSERT_RETURN ( (flags & PJ_IOQUEUE_ALWAYS_ASYNC) ==0, PJ_EINVAL); + PJ_ASSERT_RETURN((flags & PJ_IOQUEUE_ALWAYS_ASYNC)==0, PJ_EINVAL); // Return failure if access point is marked as down by app. PJ_SYMBIAN_CHECK_CONNECTION(); @@ -782,11 +766,11 @@ PJ_DEF (pj_status_t) pj_ioqueue_send (pj_ioqueue_key_t *key, // Clear flag flags &= ~PJ_IOQUEUE_ALWAYS_ASYNC; - key->cbObj->get_pj_socket()->Socket().Send (aBuffer, flags, reqStatus, aLen); - User::WaitForRequest (reqStatus); + key->cbObj->get_pj_socket()->Socket().Send(aBuffer, flags, reqStatus, aLen); + User::WaitForRequest(reqStatus); if (reqStatus.Int() != KErrNone) - return PJ_RETURN_OS_ERROR (reqStatus.Int()); + return PJ_RETURN_OS_ERROR(reqStatus.Int()); //At least in UIQ Emulator, aLen.Length() reports incorrect length //for UDP (some newlc.com users seem to have reported this too). @@ -798,48 +782,45 @@ PJ_DEF (pj_status_t) pj_ioqueue_send (pj_ioqueue_key_t *key, /* * Instruct the I/O Queue to write to the handle. */ -PJ_DEF (pj_status_t) pj_ioqueue_sendto (pj_ioqueue_key_t *key, - pj_ioqueue_op_key_t *op_key, - const void *data, - pj_ssize_t *length, - pj_uint32_t flags, - const pj_sockaddr_t *addr, - int addrlen) +PJ_DEF(pj_status_t) pj_ioqueue_sendto( pj_ioqueue_key_t *key, + pj_ioqueue_op_key_t *op_key, + const void *data, + pj_ssize_t *length, + pj_uint32_t flags, + const pj_sockaddr_t *addr, + int addrlen) { TRequestStatus reqStatus; TPtrC8 aBuffer; TInetAddr inetAddr; TSockXfrLength aLen; pj_status_t status; - - PJ_UNUSED_ARG (op_key); + + PJ_UNUSED_ARG(op_key); // Forcing pending operation is not supported. - PJ_ASSERT_RETURN ( (flags & PJ_IOQUEUE_ALWAYS_ASYNC) ==0, PJ_EINVAL); + PJ_ASSERT_RETURN((flags & PJ_IOQUEUE_ALWAYS_ASYNC)==0, PJ_EINVAL); // Return failure if access point is marked as down by app. PJ_SYMBIAN_CHECK_CONNECTION(); // Convert address - status = PjSymbianOS::pj2Addr (* (const pj_sockaddr*) addr, addrlen, - inetAddr); - + status = PjSymbianOS::pj2Addr(*(const pj_sockaddr*)addr, addrlen, + inetAddr); if (status != PJ_SUCCESS) - return status; - + return status; + // Clear flag flags &= ~PJ_IOQUEUE_ALWAYS_ASYNC; - aBuffer.Set ( (const TUint8*) data, (TInt) *length); - + aBuffer.Set((const TUint8*)data, (TInt)*length); CPjSocket *pjSock = key->cbObj->get_pj_socket(); - pjSock->Socket().SendTo (aBuffer, inetAddr, flags, reqStatus, aLen); - - User::WaitForRequest (reqStatus); + pjSock->Socket().SendTo(aBuffer, inetAddr, flags, reqStatus, aLen); + User::WaitForRequest(reqStatus); if (reqStatus.Int() != KErrNone) - return PJ_RETURN_OS_ERROR (reqStatus.Int()); + return PJ_RETURN_OS_ERROR(reqStatus.Int()); //At least in UIQ Emulator, aLen.Length() reports incorrect length //for UDP (some newlc.com users seem to have reported this too). @@ -847,25 +828,25 @@ PJ_DEF (pj_status_t) pj_ioqueue_sendto (pj_ioqueue_key_t *key, return PJ_SUCCESS; } -PJ_DEF (pj_status_t) pj_ioqueue_set_concurrency (pj_ioqueue_key_t *key, - pj_bool_t allow) +PJ_DEF(pj_status_t) pj_ioqueue_set_concurrency(pj_ioqueue_key_t *key, + pj_bool_t allow) { - /* Not supported, just return PJ_SUCCESS silently */ - PJ_UNUSED_ARG (key); - PJ_UNUSED_ARG (allow); - return PJ_SUCCESS; + /* Not supported, just return PJ_SUCCESS silently */ + PJ_UNUSED_ARG(key); + PJ_UNUSED_ARG(allow); + return PJ_SUCCESS; } -PJ_DEF (pj_status_t) pj_ioqueue_lock_key (pj_ioqueue_key_t *key) +PJ_DEF(pj_status_t) pj_ioqueue_lock_key(pj_ioqueue_key_t *key) { - /* Not supported, just return PJ_SUCCESS silently */ - PJ_UNUSED_ARG (key); - return PJ_SUCCESS; + /* Not supported, just return PJ_SUCCESS silently */ + PJ_UNUSED_ARG(key); + return PJ_SUCCESS; } -PJ_DEF (pj_status_t) pj_ioqueue_unlock_key (pj_ioqueue_key_t *key) +PJ_DEF(pj_status_t) pj_ioqueue_unlock_key(pj_ioqueue_key_t *key) { - /* Not supported, just return PJ_SUCCESS silently */ - PJ_UNUSED_ARG (key); - return PJ_SUCCESS; + /* Not supported, just return PJ_SUCCESS silently */ + PJ_UNUSED_ARG(key); + return PJ_SUCCESS; } diff --git a/sflphone-common/libs/pjproject/pjlib/src/pj/ioqueue_winnt.c b/sflphone-common/libs/pjproject/pjlib/src/pj/ioqueue_winnt.c index 1d0e7e06fd9a1aa5dd6b7180bf0ec4d42db31f6e..f9bd1a60dd0ccd4525c5a12cd8d1832d1eee342b 100644 --- a/sflphone-common/libs/pjproject/pjlib/src/pj/ioqueue_winnt.c +++ b/sflphone-common/libs/pjproject/pjlib/src/pj/ioqueue_winnt.c @@ -1,4 +1,4 @@ -/* $Id: ioqueue_winnt.c 2394 2008-12-23 17:27:53Z bennylp $ */ +/* $Id: ioqueue_winnt.c 3051 2010-01-08 13:08:05Z nanang $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> @@ -167,14 +167,27 @@ static void scan_closing_keys(pj_ioqueue_t *ioqueue); /* * Process the socket when the overlapped accept() completed. */ -static void ioqueue_on_accept_complete(ioqueue_accept_rec *accept_overlapped) +static void ioqueue_on_accept_complete(pj_ioqueue_key_t *key, + ioqueue_accept_rec *accept_overlapped) { struct sockaddr *local; struct sockaddr *remote; int locallen, remotelen; + pj_status_t status; PJ_CHECK_STACK(); + /* On WinXP or later, use SO_UPDATE_ACCEPT_CONTEXT so that socket + * addresses can be obtained with getsockname() and getpeername(). + */ + status = setsockopt(accept_overlapped->newsock, SOL_SOCKET, + SO_UPDATE_ACCEPT_CONTEXT, + (char*)&key->hnd, + sizeof(SOCKET)); + /* SO_UPDATE_ACCEPT_CONTEXT is for WinXP or later. + * So ignore the error status. + */ + /* Operation complete immediately. */ if (accept_overlapped->addrlen) { GetAcceptExSockaddrs( accept_overlapped->accept_buf, @@ -706,7 +719,7 @@ static pj_bool_t poll_iocp( HANDLE hIocp, DWORD dwTimeout, #if PJ_HAS_TCP case PJ_IOQUEUE_OP_ACCEPT: /* special case for accept. */ - ioqueue_on_accept_complete((ioqueue_accept_rec*)pOv); + ioqueue_on_accept_complete(key, (ioqueue_accept_rec*)pOv); if (key->cb.on_accept_complete) { ioqueue_accept_rec *accept_rec = (ioqueue_accept_rec*)pOv; pj_status_t status = PJ_SUCCESS; @@ -1208,14 +1221,25 @@ PJ_DEF(pj_status_t) pj_ioqueue_accept( pj_ioqueue_key_t *key, sock = WSAAccept((SOCKET)key->hnd, remote, addrlen, NULL, 0); if (sock != INVALID_SOCKET) { /* Yes! New socket is available! */ - int status; - - status = getsockname(sock, local, addrlen); - if (status != 0) { - DWORD dwError = WSAGetLastError(); - closesocket(sock); - return PJ_RETURN_OS_ERROR(dwError); - } + if (local && addrlen) { + int status; + + /* On WinXP or later, use SO_UPDATE_ACCEPT_CONTEXT so that socket + * addresses can be obtained with getsockname() and getpeername(). + */ + status = setsockopt(sock, SOL_SOCKET, SO_UPDATE_ACCEPT_CONTEXT, + (char*)&key->hnd, sizeof(SOCKET)); + /* SO_UPDATE_ACCEPT_CONTEXT is for WinXP or later. + * So ignore the error status. + */ + + status = getsockname(sock, local, addrlen); + if (status != 0) { + DWORD dwError = WSAGetLastError(); + closesocket(sock); + return PJ_RETURN_OS_ERROR(dwError); + } + } *new_sock = sock; return PJ_SUCCESS; @@ -1238,16 +1262,6 @@ PJ_DEF(pj_status_t) pj_ioqueue_accept( pj_ioqueue_key_t *key, if (status != PJ_SUCCESS) return status; - /* On WinXP or later, use SO_UPDATE_ACCEPT_CONTEXT so that socket - * addresses can be obtained with getsockname() and getpeername(). - */ - status = setsockopt(op_key_rec->accept.newsock, SOL_SOCKET, - SO_UPDATE_ACCEPT_CONTEXT, - (char*)&key->hnd, sizeof(SOCKET)); - /* SO_UPDATE_ACCEPT_CONTEXT is for WinXP or later. - * So ignore the error status. - */ - op_key_rec->accept.operation = PJ_IOQUEUE_OP_ACCEPT; op_key_rec->accept.addrlen = addrlen; op_key_rec->accept.local = local; @@ -1263,7 +1277,7 @@ PJ_DEF(pj_status_t) pj_ioqueue_accept( pj_ioqueue_key_t *key, &op_key_rec->accept.overlapped ); if (rc == TRUE) { - ioqueue_on_accept_complete(&op_key_rec->accept); + ioqueue_on_accept_complete(key, &op_key_rec->accept); return PJ_SUCCESS; } else { DWORD dwStatus = WSAGetLastError(); diff --git a/sflphone-common/libs/pjproject/pjlib/src/pj/ip_helper_generic.c b/sflphone-common/libs/pjproject/pjlib/src/pj/ip_helper_generic.c index ea67e5d9a0731fe9ce0eab45f5fdabfcfa59c0f0..d9f98694f73ee16b04d249724859aa62d8488da0 100644 --- a/sflphone-common/libs/pjproject/pjlib/src/pj/ip_helper_generic.c +++ b/sflphone-common/libs/pjproject/pjlib/src/pj/ip_helper_generic.c @@ -1,4 +1,4 @@ -/* $Id: ip_helper_generic.c 2394 2008-12-23 17:27:53Z bennylp $ */ +/* $Id: ip_helper_generic.c 3044 2010-01-04 16:54:50Z nanang $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> @@ -121,6 +121,7 @@ static pj_status_t if_enum_by_af(int af, pj_bzero(&ifs[*p_cnt], sizeof(ifs[0])); pj_memcpy(&ifs[*p_cnt], ad, pj_sockaddr_get_len(ad)); + PJ_SOCKADDR_RESET_LEN(&ifs[*p_cnt]); (*p_cnt)++; } @@ -215,6 +216,7 @@ static pj_status_t if_enum_by_af(int af, pj_bzero(&ifs[*p_cnt], sizeof(ifs[0])); pj_memcpy(&ifs[*p_cnt], ad, pj_sockaddr_get_len(ad)); + PJ_SOCKADDR_RESET_LEN(&ifs[*p_cnt]); (*p_cnt)++; } @@ -305,6 +307,7 @@ static pj_status_t if_enum_by_af(int af, unsigned *p_cnt, pj_sockaddr ifs[]) pj_bzero(&ifs[*p_cnt], sizeof(ifs[0])); pj_memcpy(&ifs[*p_cnt], ad, pj_sockaddr_get_len(ad)); + PJ_SOCKADDR_RESET_LEN(&ifs[*p_cnt]); (*p_cnt)++; } diff --git a/sflphone-common/libs/pjproject/pjlib/src/pj/ip_helper_symbian.cpp b/sflphone-common/libs/pjproject/pjlib/src/pj/ip_helper_symbian.cpp index 3cf3845870b18cd5c36fc34521f947dad2721b60..9f634a0b8b152df42b2736a63ca1a612d8028edb 100644 --- a/sflphone-common/libs/pjproject/pjlib/src/pj/ip_helper_symbian.cpp +++ b/sflphone-common/libs/pjproject/pjlib/src/pj/ip_helper_symbian.cpp @@ -1,5 +1,5 @@ /* $Id: ip_helper_symbian.cpp 2394 2008-12-23 17:27:53Z bennylp $ */ -/* +/* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> * @@ -15,7 +15,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include <pj/ip_helper.h> #include <pj/addr_resolv.h> @@ -31,123 +31,119 @@ #define THIS_FILE "ip_helper_symbian.cpp" #define TRACE_ME 0 -static pj_status_t rsock_enum_interface (int af, - unsigned *p_cnt, - pj_sockaddr ifs[]) +static pj_status_t rsock_enum_interface(int af, + unsigned *p_cnt, + pj_sockaddr ifs[]) { TInt rc; RSocket rSock; TPckgBuf<TSoInetInterfaceInfo> info; unsigned i; - + if (PjSymbianOS::Instance()->Connection()) { - - rc = rSock.Open (PjSymbianOS::Instance()->SocketServ(), - af, PJ_SOCK_DGRAM, KProtocolInetUdp, - *PjSymbianOS::Instance()->Connection()); + + rc = rSock.Open(PjSymbianOS::Instance()->SocketServ(), + af, PJ_SOCK_DGRAM, KProtocolInetUdp, + *PjSymbianOS::Instance()->Connection()); } else { - - rc = rSock.Open (PjSymbianOS::Instance()->SocketServ(), - af, PJ_SOCK_DGRAM, KProtocolInetUdp); - + + rc = rSock.Open(PjSymbianOS::Instance()->SocketServ(), + af, PJ_SOCK_DGRAM, KProtocolInetUdp); + } - + if (rc != KErrNone) - return PJ_RETURN_OS_ERROR (rc); - - rSock.SetOpt (KSoInetEnumInterfaces, KSolInetIfCtrl); - + return PJ_RETURN_OS_ERROR(rc); + + rSock.SetOpt(KSoInetEnumInterfaces, KSolInetIfCtrl); + for (i=0; i<*p_cnt && - rSock.GetOpt (KSoInetNextInterface, KSolInetIfCtrl, - info) == KErrNone;) { - TInetAddr &iAddress = info().iAddress; - int namelen; + rSock.GetOpt(KSoInetNextInterface, KSolInetIfCtrl, + info) == KErrNone; ) + { + TInetAddr &iAddress = info().iAddress; + int namelen; #if TRACE_ME - - if (1) { - pj_sockaddr a; - char ipaddr[PJ_INET6_ADDRSTRLEN+2]; - - namelen = sizeof (pj_sockaddr); - - if (PjSymbianOS::Addr2pj (iAddress, a, &namelen, - PJ_FALSE) == PJ_SUCCESS) { - PJ_LOG (5, (THIS_FILE, "Enum: found address %s", - pj_sockaddr_print (&a, ipaddr, sizeof (ipaddr), 2))); - } - } - + if (1) { + pj_sockaddr a; + char ipaddr[PJ_INET6_ADDRSTRLEN+2]; + + namelen = sizeof(pj_sockaddr); + if (PjSymbianOS::Addr2pj(iAddress, a, &namelen, + PJ_FALSE) == PJ_SUCCESS) + { + PJ_LOG(5,(THIS_FILE, "Enum: found address %s", + pj_sockaddr_print(&a, ipaddr, sizeof(ipaddr), 2))); + } + } #endif - - namelen = sizeof (ifs[i]); - - if (PjSymbianOS::Addr2pj (iAddress, ifs[i], &namelen, - PJ_TRUE) != PJ_SUCCESS) { - continue; - } - - if (ifs[i].addr.sa_family != af) - continue; - - ++i; + + namelen = sizeof(ifs[i]); + if (PjSymbianOS::Addr2pj(iAddress, ifs[i], &namelen, + PJ_TRUE) != PJ_SUCCESS) + { + continue; + } + + if (ifs[i].addr.sa_family != af) + continue; + + ++i; } - + rSock.Close(); - + // Done *p_cnt = i; - + return PJ_SUCCESS; } - + /* * Enumerate the local IP interface currently active in the host. */ -PJ_DEF (pj_status_t) pj_enum_ip_interface (int af, - unsigned *p_cnt, - pj_sockaddr ifs[]) +PJ_DEF(pj_status_t) pj_enum_ip_interface(int af, + unsigned *p_cnt, + pj_sockaddr ifs[]) { unsigned start; pj_status_t status = PJ_SUCCESS; start = 0; - + /* Get IPv6 interface first. */ - if (af==PJ_AF_INET6 || af==PJ_AF_UNSPEC) { - unsigned max = *p_cnt; - status = rsock_enum_interface (PJ_AF_INET6, &max, &ifs[start]); - - if (status == PJ_SUCCESS) { - (*p_cnt) -= max; - start += max; - } + unsigned max = *p_cnt; + status = rsock_enum_interface(PJ_AF_INET6, &max, &ifs[start]); + if (status == PJ_SUCCESS) { + (*p_cnt) -= max; + start += max; + } } - + /* Get IPv4 interface. */ if (af==PJ_AF_INET || af==PJ_AF_UNSPEC) { - unsigned max = *p_cnt; - status = rsock_enum_interface (PJ_AF_INET, &max, &ifs[start]); - - if (status == PJ_SUCCESS) { - (*p_cnt) -= max; - start += max; - } + unsigned max = *p_cnt; + status = rsock_enum_interface(PJ_AF_INET, &max, &ifs[start]); + if (status == PJ_SUCCESS) { + (*p_cnt) -= max; + start += max; + } } - + *p_cnt = start; - + return start ? PJ_SUCCESS : PJ_ENOTFOUND; } /* * Enumerate the IP routing table for this host. */ -PJ_DEF (pj_status_t) pj_enum_ip_route (unsigned *p_cnt, - pj_ip_route_entry routes[]) +PJ_DEF(pj_status_t) pj_enum_ip_route(unsigned *p_cnt, + pj_ip_route_entry routes[]) { - PJ_ASSERT_RETURN (p_cnt && *p_cnt > 0 && routes, PJ_EINVAL); + PJ_ASSERT_RETURN(p_cnt && *p_cnt > 0 && routes, PJ_EINVAL); *p_cnt = 0; return PJ_ENOTSUP; } diff --git a/sflphone-common/libs/pjproject/pjlib/src/pj/ip_helper_win32.c b/sflphone-common/libs/pjproject/pjlib/src/pj/ip_helper_win32.c index e02b6027e9071af1094a821f74474c9c966539bc..67168791ef11bd0d9beba742274e203b83390c01 100644 --- a/sflphone-common/libs/pjproject/pjlib/src/pj/ip_helper_win32.c +++ b/sflphone-common/libs/pjproject/pjlib/src/pj/ip_helper_win32.c @@ -1,4 +1,4 @@ -/* $Id: ip_helper_win32.c 2394 2008-12-23 17:27:53Z bennylp $ */ +/* $Id: ip_helper_win32.c 3040 2009-12-30 08:39:14Z bennylp $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> @@ -41,16 +41,53 @@ #include <pj/errno.h> #include <pj/string.h> +/* Dealing with Unicode quirks: + + There seems to be a difference with GetProcAddress() API signature between + Windows (i.e. Win32) and Windows CE (e.g. Windows Mobile). On Windows, the + API is declared as: + + FARPROC GetProcAddress( + HMODULE hModule, + LPCSTR lpProcName); + + while on Windows CE: + + FARPROC GetProcAddress( + HMODULE hModule, + LPCWSTR lpProcName); + + Notice the difference with lpProcName argument type. This means that on + Windows, even on Unicode Windows, the lpProcName always takes ANSI format, + while on Windows CE, the argument follows the UNICODE setting. + + Because of this, we use a different Unicode treatment here than the usual + PJ_NATIVE_STRING_IS_UNICODE PJLIB setting (<pj/unicode.h>): + - GPA_TEXT macro: convert literal string to platform's native literal + string + - gpa_char: the platform native character type + + Note that "GPA" and "gpa" are abbreviations for GetProcAddress. +*/ +#if defined(PJ_WIN32_WINCE) && PJ_WIN32_WINCE!=0 + /* on CE, follow the PJLIB Unicode setting */ +# define GPA_TEXT(x) PJ_T(x) +# define gpa_char pj_char_t +#else + /* on non-CE, always use ANSI format */ +# define GPA_TEXT(x) x +# define gpa_char char +#endif + + typedef DWORD (WINAPI *PFN_GetIpAddrTable)(PMIB_IPADDRTABLE pIpAddrTable, PULONG pdwSize, BOOL bOrder); -#if defined(PJ_HAS_IPV6) && PJ_HAS_IPV6!=0 typedef DWORD (WINAPI *PFN_GetAdapterAddresses)(ULONG Family, ULONG Flags, PVOID Reserved, PIP_ADAPTER_ADDRESSES AdapterAddresses, PULONG SizePointer); -#endif /* PJ_HAS_IPV6 */ typedef DWORD (WINAPI *PFN_GetIpForwardTable)(PMIB_IPFORWARDTABLE pIpForwardTable, PULONG pdwSize, BOOL bOrder); @@ -58,9 +95,7 @@ typedef DWORD (WINAPI *PFN_GetIfEntry)(PMIB_IFROW pIfRow); static HANDLE s_hDLL; static PFN_GetIpAddrTable s_pfnGetIpAddrTable; -#if defined(PJ_HAS_IPV6) && PJ_HAS_IPV6!=0 - static PFN_GetAdapterAddresses s_pfnGetAdapterAddresses; -#endif /* PJ_HAS_IPV6 */ +static PFN_GetAdapterAddresses s_pfnGetAdapterAddresses; static PFN_GetIpForwardTable s_pfnGetIpForwardTable; static PFN_GetIfEntry s_pfnGetIfEntry; @@ -72,12 +107,10 @@ static void unload_iphlp_module(void) s_pfnGetIpAddrTable = NULL; s_pfnGetIpForwardTable = NULL; s_pfnGetIfEntry = NULL; -#if defined(PJ_HAS_IPV6) && PJ_HAS_IPV6!=0 s_pfnGetAdapterAddresses = NULL; -#endif } -static FARPROC GetIpHlpApiProc(pj_char_t *lpProcName) +static FARPROC GetIpHlpApiProc(gpa_char *lpProcName) { if(NULL == s_hDLL) { s_hDLL = LoadLibrary(PJ_T("IpHlpApi")); @@ -98,7 +131,7 @@ static DWORD MyGetIpAddrTable(PMIB_IPADDRTABLE pIpAddrTable, { if(NULL == s_pfnGetIpAddrTable) { s_pfnGetIpAddrTable = (PFN_GetIpAddrTable) - GetIpHlpApiProc(PJ_T("GetIpAddrTable")); + GetIpHlpApiProc(GPA_TEXT("GetIpAddrTable")); } if(NULL != s_pfnGetIpAddrTable) { @@ -108,7 +141,6 @@ static DWORD MyGetIpAddrTable(PMIB_IPADDRTABLE pIpAddrTable, return ERROR_NOT_SUPPORTED; } -#if defined(PJ_HAS_IPV6) && PJ_HAS_IPV6!=0 static DWORD MyGetAdapterAddresses(ULONG Family, ULONG Flags, PVOID Reserved, @@ -117,7 +149,7 @@ static DWORD MyGetAdapterAddresses(ULONG Family, { if(NULL == s_pfnGetAdapterAddresses) { s_pfnGetAdapterAddresses = (PFN_GetAdapterAddresses) - GetIpHlpApiProc(PJ_T("GetAdapterAddresses")); + GetIpHlpApiProc(GPA_TEXT("GetAdaptersAddresses")); } if(NULL != s_pfnGetAdapterAddresses) { @@ -127,14 +159,13 @@ static DWORD MyGetAdapterAddresses(ULONG Family, return ERROR_NOT_SUPPORTED; } -#endif /* PJ_HAS_IPV6 */ #if PJ_IP_HELPER_IGNORE_LOOPBACK_IF static DWORD MyGetIfEntry(MIB_IFROW *pIfRow) { if(NULL == s_pfnGetIfEntry) { s_pfnGetIfEntry = (PFN_GetIfEntry) - GetIpHlpApiProc(PJ_T("GetIfEntry")); + GetIpHlpApiProc(GPA_TEXT("GetIfEntry")); } if(NULL != s_pfnGetIfEntry) { @@ -152,7 +183,7 @@ static DWORD MyGetIpForwardTable(PMIB_IPFORWARDTABLE pIpForwardTable, { if(NULL == s_pfnGetIpForwardTable) { s_pfnGetIpForwardTable = (PFN_GetIpForwardTable) - GetIpHlpApiProc(PJ_T("GetIpForwardTable")); + GetIpHlpApiProc(GPA_TEXT("GetIpForwardTable")); } if(NULL != s_pfnGetIpForwardTable) { @@ -168,25 +199,30 @@ static DWORD MyGetIpForwardTable(PMIB_IPFORWARDTABLE pIpForwardTable, static pj_status_t enum_ipv4_interface(unsigned *p_cnt, pj_sockaddr ifs[]) { - /* Provide enough buffer or otherwise it will fail with - * error 22 ("Not Enough Buffer") error. - */ - char ipTabBuff[1024]; - MIB_IPADDRTABLE *pTab; - ULONG tabSize; + char ipTabBuff[512]; + MIB_IPADDRTABLE *pTab = (MIB_IPADDRTABLE*)ipTabBuff; + ULONG tabSize = sizeof(ipTabBuff); unsigned i, count; DWORD rc = NO_ERROR; PJ_ASSERT_RETURN(p_cnt && ifs, PJ_EINVAL); - pTab = (MIB_IPADDRTABLE*)ipTabBuff; - /* Get IP address table */ - tabSize = sizeof(ipTabBuff); - rc = MyGetIpAddrTable(pTab, &tabSize, FALSE); - if (rc != NO_ERROR) - return PJ_RETURN_OS_ERROR(rc); + if (rc != NO_ERROR) { + if (rc == ERROR_INSUFFICIENT_BUFFER) { + /* Retry with larger buffer */ + pTab = (MIB_IPADDRTABLE*)malloc(tabSize); + if (pTab) + rc = MyGetIpAddrTable(pTab, &tabSize, FALSE); + } + + if (rc != NO_ERROR) { + if (pTab != (MIB_IPADDRTABLE*)ipTabBuff) + free(pTab); + return PJ_RETURN_OS_ERROR(rc); + } + } /* Reset result */ pj_bzero(ifs, sizeof(ifs[0]) * (*p_cnt)); @@ -223,37 +259,103 @@ static pj_status_t enum_ipv4_interface(unsigned *p_cnt, (*p_cnt)++; } + if (pTab != (MIB_IPADDRTABLE*)ipTabBuff) + free(pTab); + return (*p_cnt) ? PJ_SUCCESS : PJ_ENOTFOUND; } - /* Enumerate local IP interface using GetAdapterAddresses(), * which works for both IPv4 and IPv6. */ -#if defined(PJ_HAS_IPV6) && PJ_HAS_IPV6!=0 static pj_status_t enum_ipv4_ipv6_interface(int af, unsigned *p_cnt, pj_sockaddr ifs[]) { - pj_uint8_t buffer[1024]; + pj_uint8_t buffer[600]; IP_ADAPTER_ADDRESSES *adapter = (IP_ADAPTER_ADDRESSES*)buffer; ULONG size = sizeof(buffer); + ULONG flags; unsigned i; DWORD rc; - rc = MyGetAdapterAddresses(af, 0, NULL, adapter, &size); - if (rc != ERROR_SUCCESS) - return PJ_RETURN_OS_ERROR(rc); + flags = GAA_FLAG_SKIP_FRIENDLY_NAME | + GAA_FLAG_SKIP_DNS_SERVER | + GAA_FLAG_SKIP_MULTICAST; + + rc = MyGetAdapterAddresses(af, flags, NULL, adapter, &size); + if (rc != ERROR_SUCCESS) { + if (rc == ERROR_BUFFER_OVERFLOW) { + /* Retry with larger memory size */ + adapter = (IP_ADAPTER_ADDRESSES*) malloc(size); + if (adapter != NULL) + rc = MyGetAdapterAddresses(af, flags, NULL, adapter, &size); + } + + if (rc != ERROR_SUCCESS) { + if (adapter != (IP_ADAPTER_ADDRESSES*)buffer) + free(adapter); + return PJ_RETURN_OS_ERROR(rc); + } + } + + /* Reset result */ + pj_bzero(ifs, sizeof(ifs[0]) * (*p_cnt)); + + /* Enumerate interface */ + for (i=0; i<*p_cnt && adapter; adapter = adapter->Next) { + if (adapter->FirstUnicastAddress) { + SOCKET_ADDRESS *pAddr = &adapter->FirstUnicastAddress->Address; + + /* Ignore address family which we didn't request, just in case */ + if (pAddr->lpSockaddr->sa_family != PJ_AF_INET && + pAddr->lpSockaddr->sa_family != PJ_AF_INET6) + { + continue; + } + + /* Apply some filtering to known IPv4 unusable addresses */ + if (pAddr->lpSockaddr->sa_family == PJ_AF_INET) { + const pj_sockaddr_in *addr_in = + (const pj_sockaddr_in*)pAddr->lpSockaddr; + + /* Ignore 0.0.0.0 address (interface is down?) */ + if (addr_in->sin_addr.s_addr == 0) + continue; + + /* Ignore 0.0.0.0/8 address. This is a special address + * which doesn't seem to have practical use. + */ + if ((pj_ntohl(addr_in->sin_addr.s_addr) >> 24) == 0) + continue; + } + +#if PJ_IP_HELPER_IGNORE_LOOPBACK_IF + /* Ignore loopback interfaces */ + /* This should have been IF_TYPE_SOFTWARE_LOOPBACK according to + * MSDN, and this macro should have been declared in Ipifcons.h, + * but some SDK versions don't have it. + */ + if (adapter->IfType == MIB_IF_TYPE_LOOPBACK) + continue; +#endif + + /* Ignore down interface */ + if (adapter->OperStatus != IfOperStatusUp) + continue; - for (i=0; i<*p_cnt && adapter; ++i, adapter = adapter->Next) { - SOCKET_ADDRESS *pAddr = &adapter->FirstUnicastAddress->Address; - ifs[i].addr.sa_family = pAddr->lpSockaddr->sa_family; - pj_memcpy(&ifs[i], pAddr->lpSockaddr, pAddr->iSockaddrLength); + ifs[i].addr.sa_family = pAddr->lpSockaddr->sa_family; + pj_memcpy(&ifs[i], pAddr->lpSockaddr, pAddr->iSockaddrLength); + ++i; + } } - return PJ_SUCCESS; + if (adapter != (IP_ADAPTER_ADDRESSES*)buffer) + free(adapter); + + *p_cnt = i; + return (*p_cnt) ? PJ_SUCCESS : PJ_ENOTFOUND; } -#endif /* @@ -269,20 +371,10 @@ PJ_DEF(pj_status_t) pj_enum_ip_interface(int af, PJ_ASSERT_RETURN(af==PJ_AF_UNSPEC || af==PJ_AF_INET || af==PJ_AF_INET6, PJ_EAFNOTSUP); -#if defined(PJ_HAS_IPV6) && PJ_HAS_IPV6!=0 status = enum_ipv4_ipv6_interface(af, p_cnt, ifs); if (status != PJ_SUCCESS && (af==PJ_AF_INET || af==PJ_AF_UNSPEC)) status = enum_ipv4_interface(p_cnt, ifs); return status; -#else - if (af==PJ_AF_INET6) - return PJ_EIPV6NOTSUP; - else if (af != PJ_AF_INET && af != PJ_AF_UNSPEC) - return PJ_EAFNOTSUP; - - status = enum_ipv4_interface(p_cnt, ifs); - return status; -#endif } /* diff --git a/sflphone-common/libs/pjproject/pjlib/src/pj/log_writer_symbian_console.cpp b/sflphone-common/libs/pjproject/pjlib/src/pj/log_writer_symbian_console.cpp index 34d4a40254363c3c1b25142accf7622a4040f1da..8f627cf149067127f7bf0402c0268f77f748361d 100644 --- a/sflphone-common/libs/pjproject/pjlib/src/pj/log_writer_symbian_console.cpp +++ b/sflphone-common/libs/pjproject/pjlib/src/pj/log_writer_symbian_console.cpp @@ -1,5 +1,5 @@ /* $Id: log_writer_symbian_console.cpp 2394 2008-12-23 17:27:53Z bennylp $ */ -/* +/* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> * @@ -15,7 +15,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include <pj/log.h> #include <pj/os.h> @@ -24,21 +24,21 @@ #include "os_symbian.h" #include <e32cons.h> -PJ_DEF (void) pj_log_write (int level, const char *buffer, int len) +PJ_DEF(void) pj_log_write(int level, const char *buffer, int len) { #if 0 wchar_t wbuffer[PJ_LOG_MAX_SIZE]; CConsoleBase *cons = PjSymbianOS::Instance->Console(); - pj_ansi_to_unicode (buffer, len, wbuffer, PJ_ARRAY_SIZE (wbuffer)); + pj_ansi_to_unicode(buffer, len, wbuffer, PJ_ARRAY_SIZE(wbuffer)); - - TPtrC16 aPtr ( (TUint16*) wbuffer, len); - console->Write (aPtr); + + TPtrC16 aPtr((TUint16*)wbuffer, len); + console->Write(aPtr); #else - PJ_UNUSED_ARG (level); - PJ_UNUSED_ARG (buffer); - PJ_UNUSED_ARG (len); + PJ_UNUSED_ARG(level); + PJ_UNUSED_ARG(buffer); + PJ_UNUSED_ARG(len); #endif } diff --git a/sflphone-common/libs/pjproject/pjlib/src/pj/os_core_symbian.cpp b/sflphone-common/libs/pjproject/pjlib/src/pj/os_core_symbian.cpp index 96478ec4edfc5c87ecdd0a9e6ddf73bc9024c133..8b036152180cccc77692b806e202ce82b63dcf80 100644 --- a/sflphone-common/libs/pjproject/pjlib/src/pj/os_core_symbian.cpp +++ b/sflphone-common/libs/pjproject/pjlib/src/pj/os_core_symbian.cpp @@ -1,5 +1,5 @@ /* $Id: os_core_symbian.cpp 2853 2009-08-05 10:58:02Z bennylp $ */ -/* +/* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> * @@ -15,7 +15,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include <pj/os.h> @@ -35,14 +35,15 @@ #define DUMMY_MUTEX ((pj_mutex_t*)101) #define DUMMY_SEMAPHORE ((pj_sem_t*)102) #define THIS_FILE "os_core_symbian.c" - + /* * Note: * * The Symbian implementation does not support threading! - */ + */ -struct pj_thread_t { +struct pj_thread_t +{ char obj_name[PJ_MAX_OBJ_NAME]; void *tls_values[PJ_MAX_TLS]; @@ -56,11 +57,13 @@ struct pj_thread_t { } main_thread; -struct pj_atomic_t { +struct pj_atomic_t +{ pj_atomic_value_t value; }; -struct pj_sem_t { +struct pj_sem_t +{ int value; int max; }; @@ -70,7 +73,7 @@ static int tls_vars[PJ_MAX_TLS]; /* atexit handlers */ static unsigned atexit_count; -static void (*atexit_func[32]) (void); +static void (*atexit_func[32])(void); @@ -81,7 +84,7 @@ static void (*atexit_func[32]) (void); // CPjTimeoutTimer::CPjTimeoutTimer() - : CActive (PJ_SYMBIAN_TIMER_PRIORITY), hasTimedOut_ (PJ_FALSE) +: CActive(PJ_SYMBIAN_TIMER_PRIORITY), hasTimedOut_(PJ_FALSE) { } @@ -95,27 +98,27 @@ void CPjTimeoutTimer::ConstructL() { hasTimedOut_ = PJ_FALSE; timer_.CreateLocal(); - CActiveScheduler::Add (this); + CActiveScheduler::Add(this); } CPjTimeoutTimer *CPjTimeoutTimer::NewL() { CPjTimeoutTimer *self = new CPjTimeoutTimer; - CleanupStack::PushL (self); + CleanupStack::PushL(self); self->ConstructL(); - CleanupStack::Pop (self); + CleanupStack::Pop(self); return self; } -void CPjTimeoutTimer::StartTimer (TUint miliSeconds) +void CPjTimeoutTimer::StartTimer(TUint miliSeconds) { Cancel(); hasTimedOut_ = PJ_FALSE; - timer_.After (iStatus, miliSeconds * 1000); + timer_.After(iStatus, miliSeconds * 1000); SetActive(); } @@ -134,9 +137,9 @@ void CPjTimeoutTimer::DoCancel() timer_.Cancel(); } -TInt CPjTimeoutTimer::RunError (TInt aError) +TInt CPjTimeoutTimer::RunError(TInt aError) { - PJ_UNUSED_ARG (aError); + PJ_UNUSED_ARG(aError); return KErrNone; } @@ -148,16 +151,16 @@ TInt CPjTimeoutTimer::RunError (TInt aError) // PjSymbianOS::PjSymbianOS() - : isConnectionUp_ (false), - isSocketServInitialized_ (false), isResolverInitialized_ (false), - console_ (NULL), selectTimeoutTimer_ (NULL), - appSocketServ_ (NULL), appConnection_ (NULL), appHostResolver_ (NULL), - appHostResolver6_ (NULL) +: isConnectionUp_(false), + isSocketServInitialized_(false), isResolverInitialized_(false), + console_(NULL), selectTimeoutTimer_(NULL), + appSocketServ_(NULL), appConnection_(NULL), appHostResolver_(NULL), + appHostResolver6_(NULL) { } // Set parameters -void PjSymbianOS::SetParameters (pj_symbianos_params *params) +void PjSymbianOS::SetParameters(pj_symbianos_params *params) { appSocketServ_ = (RSocketServ*) params->rsocketserv; appConnection_ = (RConnection*) params->rconnection; @@ -181,57 +184,54 @@ TInt PjSymbianOS::Initialize() selectTimeoutTimer_ = CPjTimeoutTimer::NewL(); #if 0 - pj_assert (console_ == NULL); - TRAPD (err, console_ = Console::NewL (_L ("PJLIB"), - TSize (KConsFullScreen,KConsFullScreen))); + pj_assert(console_ == NULL); + TRAPD(err, console_ = Console::NewL(_L("PJLIB"), + TSize(KConsFullScreen,KConsFullScreen))); return err; #endif /* Only create RSocketServ if application doesn't specify it * in the parameters */ - if (!isSocketServInitialized_ && appSocketServ_ == NULL) { - err = socketServ_.Connect(); - - if (err != KErrNone) - goto on_error; + err = socketServ_.Connect(); + if (err != KErrNone) + goto on_error; - isSocketServInitialized_ = true; + isSocketServInitialized_ = true; } if (!isResolverInitialized_) { - if (appHostResolver_ == NULL) { - if (Connection()) - err = hostResolver_.Open (SocketServ(), KAfInet, KSockStream, - *Connection()); - else - err = hostResolver_.Open (SocketServ(), KAfInet, KSockStream); - - if (err != KErrNone) - goto on_error; - } - + if (appHostResolver_ == NULL) { + if (Connection()) + err = hostResolver_.Open(SocketServ(), KAfInet, KSockStream, + *Connection()); + else + err = hostResolver_.Open(SocketServ(), KAfInet, KSockStream); + + if (err != KErrNone) + goto on_error; + } + #if defined(PJ_HAS_IPV6) && PJ_HAS_IPV6!=0 - if (appHostResolver6_ == NULL) { - if (Connection()) - err = hostResolver6_.Open (SocketServ(), KAfInet6, KSockStream, - *Connection()); - else - err = hostResolver6_.Open (SocketServ(), KAfInet6, KSockStream); - - if (err != KErrNone) - goto on_error; - } - + if (appHostResolver6_ == NULL) { + if (Connection()) + err = hostResolver6_.Open(SocketServ(), KAfInet6, KSockStream, + *Connection()); + else + err = hostResolver6_.Open(SocketServ(), KAfInet6, KSockStream); + + if (err != KErrNone) + goto on_error; + } #endif - - - isResolverInitialized_ = true; + + + isResolverInitialized_ = true; } isConnectionUp_ = true; - + return KErrNone; on_error: @@ -243,27 +243,26 @@ on_error: void PjSymbianOS::Shutdown() { isConnectionUp_ = false; - + if (isResolverInitialized_) { - hostResolver_.Close(); + hostResolver_.Close(); #if defined(PJ_HAS_IPV6) && PJ_HAS_IPV6!=0 - hostResolver6_.Close(); + hostResolver6_.Close(); #endif - isResolverInitialized_ = false; + isResolverInitialized_ = false; } if (isSocketServInitialized_) { - socketServ_.Close(); - isSocketServInitialized_ = false; + socketServ_.Close(); + isSocketServInitialized_ = false; } delete console_; - console_ = NULL; delete selectTimeoutTimer_; selectTimeoutTimer_ = NULL; - + appSocketServ_ = NULL; appConnection_ = NULL; appHostResolver_ = NULL; @@ -271,24 +270,24 @@ void PjSymbianOS::Shutdown() } // Convert to Unicode -TInt PjSymbianOS::ConvertToUnicode (TDes16 &aUnicode, const TDesC8 &aForeign) +TInt PjSymbianOS::ConvertToUnicode(TDes16 &aUnicode, const TDesC8 &aForeign) { #if 0 - pj_assert (conv_ != NULL); - return conv_->ConvertToUnicode (aUnicode, aForeign, convToUnicodeState_); + pj_assert(conv_ != NULL); + return conv_->ConvertToUnicode(aUnicode, aForeign, convToUnicodeState_); #else - return CnvUtfConverter::ConvertToUnicodeFromUtf8 (aUnicode, aForeign); + return CnvUtfConverter::ConvertToUnicodeFromUtf8(aUnicode, aForeign); #endif } // Convert from Unicode -TInt PjSymbianOS::ConvertFromUnicode (TDes8 &aForeign, const TDesC16 &aUnicode) +TInt PjSymbianOS::ConvertFromUnicode(TDes8 &aForeign, const TDesC16 &aUnicode) { #if 0 - pj_assert (conv_ != NULL); - return conv_->ConvertFromUnicode (aForeign, aUnicode, convToAnsiState_); + pj_assert(conv_ != NULL); + return conv_->ConvertFromUnicode(aForeign, aUnicode, convToAnsiState_); #else - return CnvUtfConverter::ConvertFromUnicodeToUtf8 (aForeign, aUnicode); + return CnvUtfConverter::ConvertFromUnicodeToUtf8(aForeign, aUnicode); #endif } @@ -298,25 +297,25 @@ TInt PjSymbianOS::ConvertFromUnicode (TDes8 &aForeign, const TDesC16 &aUnicode) // PJLIB os.h implementation // -PJ_DEF (pj_uint32_t) pj_getpid (void) +PJ_DEF(pj_uint32_t) pj_getpid(void) { return 0; } /* Set Symbian specific parameters */ -PJ_DEF (pj_status_t) pj_symbianos_set_params (pj_symbianos_params *prm) +PJ_DEF(pj_status_t) pj_symbianos_set_params(pj_symbianos_params *prm) { - PJ_ASSERT_RETURN (prm != NULL, PJ_EINVAL); - PjSymbianOS::Instance()->SetParameters (prm); + PJ_ASSERT_RETURN(prm != NULL, PJ_EINVAL); + PjSymbianOS::Instance()->SetParameters(prm); return PJ_SUCCESS; } /* Set connection status */ -PJ_DEF (void) pj_symbianos_set_connection_status (pj_bool_t up) +PJ_DEF(void) pj_symbianos_set_connection_status(pj_bool_t up) { - PjSymbianOS::Instance()->SetConnectionStatus (up != 0); + PjSymbianOS::Instance()->SetConnectionStatus(up != 0); } @@ -324,180 +323,169 @@ PJ_DEF (void) pj_symbianos_set_connection_status (pj_bool_t up) * pj_init(void). * Init PJLIB! */ -PJ_DEF (pj_status_t) pj_init (void) +PJ_DEF(pj_status_t) pj_init(void) { - char stack_ptr; + char stack_ptr; pj_status_t status; - - pj_ansi_strcpy (main_thread.obj_name, "pjthread"); + + pj_ansi_strcpy(main_thread.obj_name, "pjthread"); // Init main thread - pj_memset (&main_thread, 0, sizeof (main_thread)); + pj_memset(&main_thread, 0, sizeof(main_thread)); // Initialize PjSymbianOS instance PjSymbianOS *os = PjSymbianOS::Instance(); - PJ_LOG (4, (THIS_FILE, "Initializing PJLIB for Symbian OS..")); + PJ_LOG(4,(THIS_FILE, "Initializing PJLIB for Symbian OS..")); - TInt err; + TInt err; err = os->Initialize(); - if (err != KErrNone) - return PJ_RETURN_OS_ERROR (err); + return PJ_RETURN_OS_ERROR(err); /* Init logging */ pj_log_init(); - /* Initialize exception ID for the pool. + /* Initialize exception ID for the pool. * Must do so after critical section is configured. - */ - status = pj_exception_id_alloc ("PJLIB/No memory", &PJ_NO_MEMORY_EXCEPTION); - + */ + status = pj_exception_id_alloc("PJLIB/No memory", &PJ_NO_MEMORY_EXCEPTION); if (status != PJ_SUCCESS) goto on_error; #if defined(PJ_OS_HAS_CHECK_STACK) && PJ_OS_HAS_CHECK_STACK!=0 main_thread.stk_start = &stack_ptr; - main_thread.stk_size = 0xFFFFFFFFUL; - main_thread.stk_max_usage = 0; - #else stack_ptr = '\0'; - #endif - PJ_LOG (5, (THIS_FILE, "PJLIB initialized.")); - + PJ_LOG(5,(THIS_FILE, "PJLIB initialized.")); return PJ_SUCCESS; on_error: pj_shutdown(); - - return PJ_RETURN_OS_ERROR (err); + return PJ_RETURN_OS_ERROR(err); } -PJ_DEF (pj_status_t) pj_atexit (pj_exit_callback func) +PJ_DEF(pj_status_t) pj_atexit(pj_exit_callback func) { - if (atexit_count >= PJ_ARRAY_SIZE (atexit_func)) - return PJ_ETOOMANY; + if (atexit_count >= PJ_ARRAY_SIZE(atexit_func)) + return PJ_ETOOMANY; atexit_func[atexit_count++] = func; - return PJ_SUCCESS; } -PJ_DEF (void) pj_shutdown (void) +PJ_DEF(void) pj_shutdown(void) { /* Call atexit() functions */ while (atexit_count > 0) { - (*atexit_func[atexit_count-1]) (); - --atexit_count; + (*atexit_func[atexit_count-1])(); + --atexit_count; } /* Free exception ID */ if (PJ_NO_MEMORY_EXCEPTION != -1) { - pj_exception_id_free (PJ_NO_MEMORY_EXCEPTION); - PJ_NO_MEMORY_EXCEPTION = -1; + pj_exception_id_free(PJ_NO_MEMORY_EXCEPTION); + PJ_NO_MEMORY_EXCEPTION = -1; } /* Clear static variables */ pj_errno_clear_handlers(); PjSymbianOS *os = PjSymbianOS::Instance(); - os->Shutdown(); } ///////////////////////////////////////////////////////////////////////////// -class CPollTimeoutTimer : public CActive +class CPollTimeoutTimer : public CActive { +public: + static CPollTimeoutTimer* NewL(int msec, TInt prio); + ~CPollTimeoutTimer(); + + virtual void RunL(); + virtual void DoCancel(); - public: - static CPollTimeoutTimer* NewL (int msec, TInt prio); - ~CPollTimeoutTimer(); - - virtual void RunL(); - virtual void DoCancel(); - - private: - RTimer rtimer_; - - explicit CPollTimeoutTimer (TInt prio); - void ConstructL (int msec); +private: + RTimer rtimer_; + + explicit CPollTimeoutTimer(TInt prio); + void ConstructL(int msec); }; -CPollTimeoutTimer::CPollTimeoutTimer (TInt prio) - : CActive (prio) +CPollTimeoutTimer::CPollTimeoutTimer(TInt prio) +: CActive(prio) { } -CPollTimeoutTimer::~CPollTimeoutTimer() +CPollTimeoutTimer::~CPollTimeoutTimer() { rtimer_.Close(); } -void CPollTimeoutTimer::ConstructL (int msec) +void CPollTimeoutTimer::ConstructL(int msec) { rtimer_.CreateLocal(); - CActiveScheduler::Add (this); - rtimer_.After (iStatus, msec*1000); + CActiveScheduler::Add(this); + rtimer_.After(iStatus, msec*1000); SetActive(); } -CPollTimeoutTimer* CPollTimeoutTimer::NewL (int msec, TInt prio) +CPollTimeoutTimer* CPollTimeoutTimer::NewL(int msec, TInt prio) { - CPollTimeoutTimer *self = new CPollTimeoutTimer (prio); - CleanupStack::PushL (self); - self->ConstructL (msec); - CleanupStack::Pop (self); + CPollTimeoutTimer *self = new CPollTimeoutTimer(prio); + CleanupStack::PushL(self); + self->ConstructL(msec); + CleanupStack::Pop(self); return self; } -void CPollTimeoutTimer::RunL() +void CPollTimeoutTimer::RunL() { } -void CPollTimeoutTimer::DoCancel() +void CPollTimeoutTimer::DoCancel() { - rtimer_.Cancel(); + rtimer_.Cancel(); } /* - * Wait the completion of any Symbian active objects. + * Wait the completion of any Symbian active objects. */ -PJ_DEF (pj_bool_t) pj_symbianos_poll (int priority, int ms_timeout) +PJ_DEF(pj_bool_t) pj_symbianos_poll(int priority, int ms_timeout) { CPollTimeoutTimer *timer = NULL; - + if (priority==-1) - priority = EPriorityNull; - + priority = EPriorityNull; + if (ms_timeout >= 0) { - timer = CPollTimeoutTimer::NewL (ms_timeout, priority); + timer = CPollTimeoutTimer::NewL(ms_timeout, priority); } - - PjSymbianOS::Instance()->WaitForActiveObjects (priority); - + + PjSymbianOS::Instance()->WaitForActiveObjects(priority); + if (timer) { bool timer_is_active = timer->IsActive(); - - timer->Cancel(); - + + timer->Cancel(); + delete timer; - - return timer_is_active ? PJ_TRUE : PJ_FALSE; - + + return timer_is_active ? PJ_TRUE : PJ_FALSE; + } else { - return PJ_TRUE; + return PJ_TRUE; } } @@ -505,7 +493,7 @@ PJ_DEF (pj_bool_t) pj_symbianos_poll (int priority, int ms_timeout) /* * pj_thread_is_registered() */ -PJ_DEF (pj_bool_t) pj_thread_is_registered (void) +PJ_DEF(pj_bool_t) pj_thread_is_registered(void) { return PJ_FALSE; } @@ -514,9 +502,9 @@ PJ_DEF (pj_bool_t) pj_thread_is_registered (void) /* * Get thread priority value for the thread. */ -PJ_DEF (int) pj_thread_get_prio (pj_thread_t *thread) +PJ_DEF(int) pj_thread_get_prio(pj_thread_t *thread) { - PJ_UNUSED_ARG (thread); + PJ_UNUSED_ARG(thread); return 1; } @@ -524,10 +512,10 @@ PJ_DEF (int) pj_thread_get_prio (pj_thread_t *thread) /* * Set the thread priority. */ -PJ_DEF (pj_status_t) pj_thread_set_prio (pj_thread_t *thread, int prio) +PJ_DEF(pj_status_t) pj_thread_set_prio(pj_thread_t *thread, int prio) { - PJ_UNUSED_ARG (thread); - PJ_UNUSED_ARG (prio); + PJ_UNUSED_ARG(thread); + PJ_UNUSED_ARG(prio); return PJ_SUCCESS; } @@ -535,9 +523,9 @@ PJ_DEF (pj_status_t) pj_thread_set_prio (pj_thread_t *thread, int prio) /* * Get the lowest priority value available on this system. */ -PJ_DEF (int) pj_thread_get_prio_min (pj_thread_t *thread) +PJ_DEF(int) pj_thread_get_prio_min(pj_thread_t *thread) { - PJ_UNUSED_ARG (thread); + PJ_UNUSED_ARG(thread); return 1; } @@ -545,9 +533,9 @@ PJ_DEF (int) pj_thread_get_prio_min (pj_thread_t *thread) /* * Get the highest priority value available on this system. */ -PJ_DEF (int) pj_thread_get_prio_max (pj_thread_t *thread) +PJ_DEF(int) pj_thread_get_prio_max(pj_thread_t *thread) { - PJ_UNUSED_ARG (thread); + PJ_UNUSED_ARG(thread); return 1; } @@ -555,22 +543,22 @@ PJ_DEF (int) pj_thread_get_prio_max (pj_thread_t *thread) /* * pj_thread_get_os_handle() */ -PJ_DEF (void*) pj_thread_get_os_handle (pj_thread_t *thread) +PJ_DEF(void*) pj_thread_get_os_handle(pj_thread_t *thread) { - PJ_UNUSED_ARG (thread); + PJ_UNUSED_ARG(thread); return NULL; } /* * pj_thread_register(..) */ -PJ_DEF (pj_status_t) pj_thread_register (const char *cstr_thread_name, - pj_thread_desc desc, - pj_thread_t **thread_ptr) +PJ_DEF(pj_status_t) pj_thread_register ( const char *cstr_thread_name, + pj_thread_desc desc, + pj_thread_t **thread_ptr) { - PJ_UNUSED_ARG (cstr_thread_name); - PJ_UNUSED_ARG (desc); - PJ_UNUSED_ARG (thread_ptr); + PJ_UNUSED_ARG(cstr_thread_name); + PJ_UNUSED_ARG(desc); + PJ_UNUSED_ARG(thread_ptr); return PJ_EINVALIDOP; } @@ -578,21 +566,21 @@ PJ_DEF (pj_status_t) pj_thread_register (const char *cstr_thread_name, /* * pj_thread_create(...) */ -PJ_DEF (pj_status_t) pj_thread_create (pj_pool_t *pool, - const char *thread_name, - pj_thread_proc *proc, - void *arg, - pj_size_t stack_size, - unsigned flags, - pj_thread_t **ptr_thread) -{ - PJ_UNUSED_ARG (pool); - PJ_UNUSED_ARG (thread_name); - PJ_UNUSED_ARG (proc); - PJ_UNUSED_ARG (arg); - PJ_UNUSED_ARG (stack_size); - PJ_UNUSED_ARG (flags); - PJ_UNUSED_ARG (ptr_thread); +PJ_DEF(pj_status_t) pj_thread_create( pj_pool_t *pool, + const char *thread_name, + pj_thread_proc *proc, + void *arg, + pj_size_t stack_size, + unsigned flags, + pj_thread_t **ptr_thread) +{ + PJ_UNUSED_ARG(pool); + PJ_UNUSED_ARG(thread_name); + PJ_UNUSED_ARG(proc); + PJ_UNUSED_ARG(arg); + PJ_UNUSED_ARG(stack_size); + PJ_UNUSED_ARG(flags); + PJ_UNUSED_ARG(ptr_thread); /* Sorry mate, we don't support threading */ return PJ_ENOTSUP; @@ -601,25 +589,25 @@ PJ_DEF (pj_status_t) pj_thread_create (pj_pool_t *pool, /* * pj_thread-get_name() */ -PJ_DEF (const char*) pj_thread_get_name (pj_thread_t *p) +PJ_DEF(const char*) pj_thread_get_name(pj_thread_t *p) { - pj_assert (p == &main_thread); + pj_assert(p == &main_thread); return p->obj_name; } /* * pj_thread_resume() */ -PJ_DEF (pj_status_t) pj_thread_resume (pj_thread_t *p) +PJ_DEF(pj_status_t) pj_thread_resume(pj_thread_t *p) { - PJ_UNUSED_ARG (p); + PJ_UNUSED_ARG(p); return PJ_EINVALIDOP; } /* * pj_thread_this() */ -PJ_DEF (pj_thread_t*) pj_thread_this (void) +PJ_DEF(pj_thread_t*) pj_thread_this(void) { return &main_thread; } @@ -627,27 +615,27 @@ PJ_DEF (pj_thread_t*) pj_thread_this (void) /* * pj_thread_join() */ -PJ_DEF (pj_status_t) pj_thread_join (pj_thread_t *rec) +PJ_DEF(pj_status_t) pj_thread_join(pj_thread_t *rec) { - PJ_UNUSED_ARG (rec); + PJ_UNUSED_ARG(rec); return PJ_EINVALIDOP; } /* * pj_thread_destroy() */ -PJ_DEF (pj_status_t) pj_thread_destroy (pj_thread_t *rec) +PJ_DEF(pj_status_t) pj_thread_destroy(pj_thread_t *rec) { - PJ_UNUSED_ARG (rec); + PJ_UNUSED_ARG(rec); return PJ_EINVALIDOP; } /* * pj_thread_sleep() */ -PJ_DEF (pj_status_t) pj_thread_sleep (unsigned msec) +PJ_DEF(pj_status_t) pj_thread_sleep(unsigned msec) { - User::After (msec*1000); + User::After(msec*1000); return PJ_SUCCESS; } @@ -658,22 +646,20 @@ PJ_DEF (pj_status_t) pj_thread_sleep (unsigned msec) * pj_thread_local_alloc() */ -PJ_DEF (pj_status_t) pj_thread_local_alloc (long *index) +PJ_DEF(pj_status_t) pj_thread_local_alloc(long *index) { unsigned i; /* Find unused TLS variable */ - - for (i=0; i<PJ_ARRAY_SIZE (tls_vars); ++i) { - if (tls_vars[i] == 0) - break; + for (i=0; i<PJ_ARRAY_SIZE(tls_vars); ++i) { + if (tls_vars[i] == 0) + break; } - if (i == PJ_ARRAY_SIZE (tls_vars)) - return PJ_ETOOMANY; + if (i == PJ_ARRAY_SIZE(tls_vars)) + return PJ_ETOOMANY; tls_vars[i] = 1; - *index = i; return PJ_SUCCESS; @@ -682,10 +668,10 @@ PJ_DEF (pj_status_t) pj_thread_local_alloc (long *index) /* * pj_thread_local_free() */ -PJ_DEF (void) pj_thread_local_free (long index) +PJ_DEF(void) pj_thread_local_free(long index) { - PJ_ASSERT_ON_FAIL (index >= 0 && index < (int) PJ_ARRAY_SIZE (tls_vars) && - tls_vars[index] != 0, return); + PJ_ASSERT_ON_FAIL(index >= 0 && index < (int)PJ_ARRAY_SIZE(tls_vars) && + tls_vars[index] != 0, return); tls_vars[index] = 0; } @@ -694,12 +680,12 @@ PJ_DEF (void) pj_thread_local_free (long index) /* * pj_thread_local_set() */ -PJ_DEF (pj_status_t) pj_thread_local_set (long index, void *value) +PJ_DEF(pj_status_t) pj_thread_local_set(long index, void *value) { pj_thread_t *rec = pj_thread_this(); - PJ_ASSERT_RETURN (index >= 0 && index < (int) PJ_ARRAY_SIZE (tls_vars) && - tls_vars[index] != 0, PJ_EINVAL); + PJ_ASSERT_RETURN(index >= 0 && index < (int)PJ_ARRAY_SIZE(tls_vars) && + tls_vars[index] != 0, PJ_EINVAL); rec->tls_values[index] = value; return PJ_SUCCESS; @@ -708,12 +694,12 @@ PJ_DEF (pj_status_t) pj_thread_local_set (long index, void *value) /* * pj_thread_local_get() */ -PJ_DEF (void*) pj_thread_local_get (long index) +PJ_DEF(void*) pj_thread_local_get(long index) { pj_thread_t *rec = pj_thread_this(); - PJ_ASSERT_RETURN (index >= 0 && index < (int) PJ_ARRAY_SIZE (tls_vars) && - tls_vars[index] != 0, NULL); + PJ_ASSERT_RETURN(index >= 0 && index < (int)PJ_ARRAY_SIZE(tls_vars) && + tls_vars[index] != 0, NULL); return rec->tls_values[index]; } @@ -723,11 +709,11 @@ PJ_DEF (void*) pj_thread_local_get (long index) /* * Create atomic variable. */ -PJ_DEF (pj_status_t) pj_atomic_create (pj_pool_t *pool, - pj_atomic_value_t initial, - pj_atomic_t **atomic) +PJ_DEF(pj_status_t) pj_atomic_create( pj_pool_t *pool, + pj_atomic_value_t initial, + pj_atomic_t **atomic ) { - *atomic = (pj_atomic_t*) pj_pool_alloc (pool, sizeof (struct pj_atomic_t)); + *atomic = (pj_atomic_t*)pj_pool_alloc(pool, sizeof(struct pj_atomic_t)); (*atomic)->value = initial; return PJ_SUCCESS; } @@ -736,9 +722,9 @@ PJ_DEF (pj_status_t) pj_atomic_create (pj_pool_t *pool, /* * Destroy atomic variable. */ -PJ_DEF (pj_status_t) pj_atomic_destroy (pj_atomic_t *atomic_var) +PJ_DEF(pj_status_t) pj_atomic_destroy( pj_atomic_t *atomic_var ) { - PJ_UNUSED_ARG (atomic_var); + PJ_UNUSED_ARG(atomic_var); return PJ_SUCCESS; } @@ -746,8 +732,8 @@ PJ_DEF (pj_status_t) pj_atomic_destroy (pj_atomic_t *atomic_var) /* * Set the value of an atomic type, and return the previous value. */ -PJ_DEF (void) pj_atomic_set (pj_atomic_t *atomic_var, - pj_atomic_value_t value) +PJ_DEF(void) pj_atomic_set( pj_atomic_t *atomic_var, + pj_atomic_value_t value) { atomic_var->value = value; } @@ -756,7 +742,7 @@ PJ_DEF (void) pj_atomic_set (pj_atomic_t *atomic_var, /* * Get the value of an atomic type. */ -PJ_DEF (pj_atomic_value_t) pj_atomic_get (pj_atomic_t *atomic_var) +PJ_DEF(pj_atomic_value_t) pj_atomic_get(pj_atomic_t *atomic_var) { return atomic_var->value; } @@ -765,7 +751,7 @@ PJ_DEF (pj_atomic_value_t) pj_atomic_get (pj_atomic_t *atomic_var) /* * Increment the value of an atomic type. */ -PJ_DEF (void) pj_atomic_inc (pj_atomic_t *atomic_var) +PJ_DEF(void) pj_atomic_inc(pj_atomic_t *atomic_var) { ++atomic_var->value; } @@ -774,7 +760,7 @@ PJ_DEF (void) pj_atomic_inc (pj_atomic_t *atomic_var) /* * Increment the value of an atomic type and get the result. */ -PJ_DEF (pj_atomic_value_t) pj_atomic_inc_and_get (pj_atomic_t *atomic_var) +PJ_DEF(pj_atomic_value_t) pj_atomic_inc_and_get(pj_atomic_t *atomic_var) { return ++atomic_var->value; } @@ -783,16 +769,16 @@ PJ_DEF (pj_atomic_value_t) pj_atomic_inc_and_get (pj_atomic_t *atomic_var) /* * Decrement the value of an atomic type. */ -PJ_DEF (void) pj_atomic_dec (pj_atomic_t *atomic_var) +PJ_DEF(void) pj_atomic_dec(pj_atomic_t *atomic_var) { --atomic_var->value; -} +} /* * Decrement the value of an atomic type and get the result. */ -PJ_DEF (pj_atomic_value_t) pj_atomic_dec_and_get (pj_atomic_t *atomic_var) +PJ_DEF(pj_atomic_value_t) pj_atomic_dec_and_get(pj_atomic_t *atomic_var) { return --atomic_var->value; } @@ -801,8 +787,8 @@ PJ_DEF (pj_atomic_value_t) pj_atomic_dec_and_get (pj_atomic_t *atomic_var) /* * Add a value to an atomic type. */ -PJ_DEF (void) pj_atomic_add (pj_atomic_t *atomic_var, - pj_atomic_value_t value) +PJ_DEF(void) pj_atomic_add( pj_atomic_t *atomic_var, + pj_atomic_value_t value) { atomic_var->value += value; } @@ -811,8 +797,8 @@ PJ_DEF (void) pj_atomic_add (pj_atomic_t *atomic_var, /* * Add a value to an atomic type and get the result. */ -PJ_DEF (pj_atomic_value_t) pj_atomic_add_and_get (pj_atomic_t *atomic_var, - pj_atomic_value_t value) +PJ_DEF(pj_atomic_value_t) pj_atomic_add_and_get( pj_atomic_t *atomic_var, + pj_atomic_value_t value) { atomic_var->value += value; return atomic_var->value; @@ -822,14 +808,14 @@ PJ_DEF (pj_atomic_value_t) pj_atomic_add_and_get (pj_atomic_t *atomic_var, ///////////////////////////////////////////////////////////////////////////// -PJ_DEF (pj_status_t) pj_mutex_create (pj_pool_t *pool, - const char *name, - int type, - pj_mutex_t **mutex) +PJ_DEF(pj_status_t) pj_mutex_create( pj_pool_t *pool, + const char *name, + int type, + pj_mutex_t **mutex) { - PJ_UNUSED_ARG (pool); - PJ_UNUSED_ARG (name); - PJ_UNUSED_ARG (type); + PJ_UNUSED_ARG(pool); + PJ_UNUSED_ARG(name); + PJ_UNUSED_ARG(type); *mutex = DUMMY_MUTEX; return PJ_SUCCESS; @@ -838,55 +824,55 @@ PJ_DEF (pj_status_t) pj_mutex_create (pj_pool_t *pool, /* * pj_mutex_create_simple() */ -PJ_DEF (pj_status_t) pj_mutex_create_simple (pj_pool_t *pool, - const char *name, - pj_mutex_t **mutex) +PJ_DEF(pj_status_t) pj_mutex_create_simple( pj_pool_t *pool, + const char *name, + pj_mutex_t **mutex ) { - return pj_mutex_create (pool, name, PJ_MUTEX_SIMPLE, mutex); + return pj_mutex_create(pool, name, PJ_MUTEX_SIMPLE, mutex); } -PJ_DEF (pj_status_t) pj_mutex_create_recursive (pj_pool_t *pool, - const char *name, - pj_mutex_t **mutex) +PJ_DEF(pj_status_t) pj_mutex_create_recursive( pj_pool_t *pool, + const char *name, + pj_mutex_t **mutex ) { - return pj_mutex_create (pool, name, PJ_MUTEX_RECURSE, mutex); + return pj_mutex_create(pool, name, PJ_MUTEX_RECURSE, mutex); } /* * pj_mutex_lock() */ -PJ_DEF (pj_status_t) pj_mutex_lock (pj_mutex_t *mutex) +PJ_DEF(pj_status_t) pj_mutex_lock(pj_mutex_t *mutex) { - pj_assert (mutex == DUMMY_MUTEX); + pj_assert(mutex == DUMMY_MUTEX); return PJ_SUCCESS; } /* * pj_mutex_trylock() */ -PJ_DEF (pj_status_t) pj_mutex_trylock (pj_mutex_t *mutex) +PJ_DEF(pj_status_t) pj_mutex_trylock(pj_mutex_t *mutex) { - pj_assert (mutex == DUMMY_MUTEX); + pj_assert(mutex == DUMMY_MUTEX); return PJ_SUCCESS; } /* * pj_mutex_unlock() */ -PJ_DEF (pj_status_t) pj_mutex_unlock (pj_mutex_t *mutex) +PJ_DEF(pj_status_t) pj_mutex_unlock(pj_mutex_t *mutex) { - pj_assert (mutex == DUMMY_MUTEX); + pj_assert(mutex == DUMMY_MUTEX); return PJ_SUCCESS; } /* * pj_mutex_destroy() */ -PJ_DEF (pj_status_t) pj_mutex_destroy (pj_mutex_t *mutex) +PJ_DEF(pj_status_t) pj_mutex_destroy(pj_mutex_t *mutex) { - pj_assert (mutex == DUMMY_MUTEX); + pj_assert(mutex == DUMMY_MUTEX); return PJ_SUCCESS; } @@ -903,7 +889,7 @@ PJ_DEF (pj_status_t) pj_mutex_destroy (pj_mutex_t *mutex) /* * Enter critical section. */ -PJ_DEF (void) pj_enter_critical_section (void) +PJ_DEF(void) pj_enter_critical_section(void) { /* Nothing to do */ } @@ -912,7 +898,7 @@ PJ_DEF (void) pj_enter_critical_section (void) /* * Leave critical section. */ -PJ_DEF (void) pj_leave_critical_section (void) +PJ_DEF(void) pj_leave_critical_section(void) { /* Nothing to do */ } @@ -923,17 +909,17 @@ PJ_DEF (void) pj_leave_critical_section (void) /* * Create semaphore. */ -PJ_DEF (pj_status_t) pj_sem_create (pj_pool_t *pool, - const char *name, - unsigned initial, - unsigned max, - pj_sem_t **p_sem) +PJ_DEF(pj_status_t) pj_sem_create( pj_pool_t *pool, + const char *name, + unsigned initial, + unsigned max, + pj_sem_t **p_sem) { pj_sem_t *sem; + + PJ_UNUSED_ARG(name); - PJ_UNUSED_ARG (name); - - sem = (pj_sem_t*) pj_pool_zalloc (pool, sizeof (pj_sem_t)); + sem = (pj_sem_t*) pj_pool_zalloc(pool, sizeof(pj_sem_t)); sem->value = initial; sem->max = max; @@ -946,14 +932,14 @@ PJ_DEF (pj_status_t) pj_sem_create (pj_pool_t *pool, /* * Wait for semaphore. */ -PJ_DEF (pj_status_t) pj_sem_wait (pj_sem_t *sem) +PJ_DEF(pj_status_t) pj_sem_wait(pj_sem_t *sem) { if (sem->value > 0) { - sem->value--; - return PJ_SUCCESS; + sem->value--; + return PJ_SUCCESS; } else { - pj_assert (!"Unexpected!"); - return PJ_EINVALIDOP; + pj_assert(!"Unexpected!"); + return PJ_EINVALIDOP; } } @@ -961,14 +947,14 @@ PJ_DEF (pj_status_t) pj_sem_wait (pj_sem_t *sem) /* * Try wait for semaphore. */ -PJ_DEF (pj_status_t) pj_sem_trywait (pj_sem_t *sem) +PJ_DEF(pj_status_t) pj_sem_trywait(pj_sem_t *sem) { if (sem->value > 0) { - sem->value--; - return PJ_SUCCESS; + sem->value--; + return PJ_SUCCESS; } else { - pj_assert (!"Unexpected!"); - return PJ_EINVALIDOP; + pj_assert(!"Unexpected!"); + return PJ_EINVALIDOP; } } @@ -976,7 +962,7 @@ PJ_DEF (pj_status_t) pj_sem_trywait (pj_sem_t *sem) /* * Release semaphore. */ -PJ_DEF (pj_status_t) pj_sem_post (pj_sem_t *sem) +PJ_DEF(pj_status_t) pj_sem_post(pj_sem_t *sem) { sem->value++; return PJ_SUCCESS; @@ -986,57 +972,56 @@ PJ_DEF (pj_status_t) pj_sem_post (pj_sem_t *sem) /* * Destroy semaphore. */ -PJ_DEF (pj_status_t) pj_sem_destroy (pj_sem_t *sem) +PJ_DEF(pj_status_t) pj_sem_destroy(pj_sem_t *sem) { - PJ_UNUSED_ARG (sem); + PJ_UNUSED_ARG(sem); return PJ_SUCCESS; } #if defined(PJ_OS_HAS_CHECK_STACK) && PJ_OS_HAS_CHECK_STACK != 0 /* - * The implementation of stack checking. + * The implementation of stack checking. */ -PJ_DEF (void) pj_thread_check_stack (const char *file, int line) +PJ_DEF(void) pj_thread_check_stack(const char *file, int line) { char stk_ptr; pj_uint32_t usage; pj_thread_t *thread = pj_thread_this(); - pj_assert (thread); + pj_assert(thread); /* Calculate current usage. */ usage = (&stk_ptr > thread->stk_start) ? &stk_ptr - thread->stk_start : - thread->stk_start - &stk_ptr; + thread->stk_start - &stk_ptr; /* Assert if stack usage is dangerously high. */ - pj_assert ("STACK OVERFLOW!! " && (usage <= thread->stk_size - 128)); + pj_assert("STACK OVERFLOW!! " && (usage <= thread->stk_size - 128)); /* Keep statistic. */ - if (usage > thread->stk_max_usage) { - thread->stk_max_usage = usage; - thread->caller_file = file; - thread->caller_line = line; + thread->stk_max_usage = usage; + thread->caller_file = file; + thread->caller_line = line; } } /* - * Get maximum stack usage statistic. + * Get maximum stack usage statistic. */ -PJ_DEF (pj_uint32_t) pj_thread_get_stack_max_usage (pj_thread_t *thread) +PJ_DEF(pj_uint32_t) pj_thread_get_stack_max_usage(pj_thread_t *thread) { return thread->stk_max_usage; } /* - * Dump thread stack status. + * Dump thread stack status. */ -PJ_DEF (pj_status_t) pj_thread_get_stack_info (pj_thread_t *thread, - const char **file, - int *line) +PJ_DEF(pj_status_t) pj_thread_get_stack_info(pj_thread_t *thread, + const char **file, + int *line) { - pj_assert (thread); + pj_assert(thread); *file = thread->caller_file; *line = thread->caller_line; diff --git a/sflphone-common/libs/pjproject/pjlib/src/pj/os_core_win32.c b/sflphone-common/libs/pjproject/pjlib/src/pj/os_core_win32.c index 5dc3b394a19da7801eec86fe2384b767c0c233a0..51af335105f1ab196d63e1cec6fd50c44da65c97 100644 --- a/sflphone-common/libs/pjproject/pjlib/src/pj/os_core_win32.c +++ b/sflphone-common/libs/pjproject/pjlib/src/pj/os_core_win32.c @@ -1,4 +1,4 @@ -/* $Id: os_core_win32.c 2853 2009-08-05 10:58:02Z bennylp $ */ +/* $Id: os_core_win32.c 3023 2009-11-23 15:04:18Z bennylp $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> @@ -1037,6 +1037,7 @@ PJ_DEF(pj_bool_t) pj_mutex_is_locked(pj_mutex_t *mutex) #if PJ_DEBUG return mutex->owner == pj_thread_this(); #else + PJ_UNUSED_ARG(mutex); pj_assert(!"PJ_DEBUG is not set!"); return 1; #endif diff --git a/sflphone-common/libs/pjproject/pjlib/src/pj/os_error_symbian.cpp b/sflphone-common/libs/pjproject/pjlib/src/pj/os_error_symbian.cpp index bb57cd9663c507be0d5feb5c3368a99843db3bae..31707b97c377903df1c5561cdbcda4101e5b935c 100644 --- a/sflphone-common/libs/pjproject/pjlib/src/pj/os_error_symbian.cpp +++ b/sflphone-common/libs/pjproject/pjlib/src/pj/os_error_symbian.cpp @@ -1,5 +1,5 @@ /* $Id: os_error_symbian.cpp 2394 2008-12-23 17:27:53Z bennylp $ */ -/* +/* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> * @@ -15,7 +15,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include <pj/errno.h> #include <pj/assert.h> @@ -28,70 +28,68 @@ #if defined(PJ_HAS_ERROR_STRING) && (PJ_HAS_ERROR_STRING!=0) - static const struct { pj_os_err_type code; const char *msg; } gaErrorList[] = { - /* * Generic error -1 to -46 */ - PJ_BUILD_ERR (KErrNotFound, "Unable to find the specified object"), - PJ_BUILD_ERR (KErrGeneral, "General (unspecified) error"), - PJ_BUILD_ERR (KErrCancel, "The operation was cancelled"), - PJ_BUILD_ERR (KErrNoMemory, "Not enough memory"), - PJ_BUILD_ERR (KErrNotSupported, "The operation requested is not supported"), - PJ_BUILD_ERR (KErrArgument, "Bad request"), - PJ_BUILD_ERR (KErrTotalLossOfPrecision, "Total loss of precision"), - PJ_BUILD_ERR (KErrBadHandle, "Bad object"), - PJ_BUILD_ERR (KErrOverflow, "Overflow"), - PJ_BUILD_ERR (KErrUnderflow, "Underflow"), - PJ_BUILD_ERR (KErrAlreadyExists,"Already exists"), - PJ_BUILD_ERR (KErrPathNotFound, "Unable to find the specified folder"), - PJ_BUILD_ERR (KErrDied, "Closed"), - PJ_BUILD_ERR (KErrInUse, "The specified object is currently in use by another program"), - PJ_BUILD_ERR (KErrServerTerminated, "Server has closed"), - PJ_BUILD_ERR (KErrServerBusy, "Server busy"), - PJ_BUILD_ERR (KErrCompletion, "Completion error"), - PJ_BUILD_ERR (KErrNotReady, "Not ready"), - PJ_BUILD_ERR (KErrUnknown, "Unknown error"), - PJ_BUILD_ERR (KErrCorrupt, "Corrupt"), - PJ_BUILD_ERR (KErrAccessDenied, "Access denied"), - PJ_BUILD_ERR (KErrLocked, "Locked"), - PJ_BUILD_ERR (KErrWrite, "Failed to write"), - PJ_BUILD_ERR (KErrDisMounted, "Wrong disk present"), - PJ_BUILD_ERR (KErrEof, "Unexpected end of file"), - PJ_BUILD_ERR (KErrDiskFull, "Disk full"), - PJ_BUILD_ERR (KErrBadDriver, "Bad device driver"), - PJ_BUILD_ERR (KErrBadName, "Bad name"), - PJ_BUILD_ERR (KErrCommsLineFail,"Comms line failed"), - PJ_BUILD_ERR (KErrCommsFrame, "Comms frame error"), - PJ_BUILD_ERR (KErrCommsOverrun, "Comms overrun error"), - PJ_BUILD_ERR (KErrCommsParity, "Comms parity error"), - PJ_BUILD_ERR (KErrTimedOut, "Timed out"), - PJ_BUILD_ERR (KErrCouldNotConnect, "Failed to connect"), - PJ_BUILD_ERR (KErrCouldNotDisconnect, "Failed to disconnect"), - PJ_BUILD_ERR (KErrDisconnected, "Disconnected"), - PJ_BUILD_ERR (KErrBadLibraryEntryPoint, "Bad library entry point"), - PJ_BUILD_ERR (KErrBadDescriptor,"Bad descriptor"), - PJ_BUILD_ERR (KErrAbort, "Interrupted"), - PJ_BUILD_ERR (KErrTooBig, "Too big"), - PJ_BUILD_ERR (KErrDivideByZero, "Divide by zero"), - PJ_BUILD_ERR (KErrBadPower, "Batteries too low"), - PJ_BUILD_ERR (KErrDirFull, "Folder full"), - PJ_BUILD_ERR (KErrHardwareNotAvailable, ""), - PJ_BUILD_ERR (KErrSessionClosed, ""), - PJ_BUILD_ERR (KErrPermissionDenied, ""), + PJ_BUILD_ERR( KErrNotFound, "Unable to find the specified object"), + PJ_BUILD_ERR( KErrGeneral, "General (unspecified) error"), + PJ_BUILD_ERR( KErrCancel, "The operation was cancelled"), + PJ_BUILD_ERR( KErrNoMemory, "Not enough memory"), + PJ_BUILD_ERR( KErrNotSupported, "The operation requested is not supported"), + PJ_BUILD_ERR( KErrArgument, "Bad request"), + PJ_BUILD_ERR( KErrTotalLossOfPrecision, "Total loss of precision"), + PJ_BUILD_ERR( KErrBadHandle, "Bad object"), + PJ_BUILD_ERR( KErrOverflow, "Overflow"), + PJ_BUILD_ERR( KErrUnderflow, "Underflow"), + PJ_BUILD_ERR( KErrAlreadyExists,"Already exists"), + PJ_BUILD_ERR( KErrPathNotFound, "Unable to find the specified folder"), + PJ_BUILD_ERR( KErrDied, "Closed"), + PJ_BUILD_ERR( KErrInUse, "The specified object is currently in use by another program"), + PJ_BUILD_ERR( KErrServerTerminated, "Server has closed"), + PJ_BUILD_ERR( KErrServerBusy, "Server busy"), + PJ_BUILD_ERR( KErrCompletion, "Completion error"), + PJ_BUILD_ERR( KErrNotReady, "Not ready"), + PJ_BUILD_ERR( KErrUnknown, "Unknown error"), + PJ_BUILD_ERR( KErrCorrupt, "Corrupt"), + PJ_BUILD_ERR( KErrAccessDenied, "Access denied"), + PJ_BUILD_ERR( KErrLocked, "Locked"), + PJ_BUILD_ERR( KErrWrite, "Failed to write"), + PJ_BUILD_ERR( KErrDisMounted, "Wrong disk present"), + PJ_BUILD_ERR( KErrEof, "Unexpected end of file"), + PJ_BUILD_ERR( KErrDiskFull, "Disk full"), + PJ_BUILD_ERR( KErrBadDriver, "Bad device driver"), + PJ_BUILD_ERR( KErrBadName, "Bad name"), + PJ_BUILD_ERR( KErrCommsLineFail,"Comms line failed"), + PJ_BUILD_ERR( KErrCommsFrame, "Comms frame error"), + PJ_BUILD_ERR( KErrCommsOverrun, "Comms overrun error"), + PJ_BUILD_ERR( KErrCommsParity, "Comms parity error"), + PJ_BUILD_ERR( KErrTimedOut, "Timed out"), + PJ_BUILD_ERR( KErrCouldNotConnect, "Failed to connect"), + PJ_BUILD_ERR( KErrCouldNotDisconnect, "Failed to disconnect"), + PJ_BUILD_ERR( KErrDisconnected, "Disconnected"), + PJ_BUILD_ERR( KErrBadLibraryEntryPoint, "Bad library entry point"), + PJ_BUILD_ERR( KErrBadDescriptor,"Bad descriptor"), + PJ_BUILD_ERR( KErrAbort, "Interrupted"), + PJ_BUILD_ERR( KErrTooBig, "Too big"), + PJ_BUILD_ERR( KErrDivideByZero, "Divide by zero"), + PJ_BUILD_ERR( KErrBadPower, "Batteries too low"), + PJ_BUILD_ERR( KErrDirFull, "Folder full"), + PJ_BUILD_ERR( KErrHardwareNotAvailable, ""), + PJ_BUILD_ERR( KErrSessionClosed, ""), + PJ_BUILD_ERR( KErrPermissionDenied, ""), /* * Socket errors (-190 - -1000) */ - PJ_BUILD_ERR (KErrNetUnreach, "Could not connect to the network. Currently unreachable"), - PJ_BUILD_ERR (KErrHostUnreach, "Could not connect to the specified server"), - PJ_BUILD_ERR (KErrNoProtocolOpt,"The specified server refuses the selected protocol"), - PJ_BUILD_ERR (KErrUrgentData, ""), - PJ_BUILD_ERR (KErrWouldBlock, "Conflicts with KErrExtended, but cannot occur in practice"), + PJ_BUILD_ERR( KErrNetUnreach, "Could not connect to the network. Currently unreachable"), + PJ_BUILD_ERR( KErrHostUnreach, "Could not connect to the specified server"), + PJ_BUILD_ERR( KErrNoProtocolOpt,"The specified server refuses the selected protocol"), + PJ_BUILD_ERR( KErrUrgentData, ""), + PJ_BUILD_ERR( KErrWouldBlock, "Conflicts with KErrExtended, but cannot occur in practice"), {0, NULL} }; @@ -99,45 +97,45 @@ static const struct { #endif /* PJ_HAS_ERROR_STRING */ -PJ_DEF (pj_status_t) pj_get_os_error (void) +PJ_DEF(pj_status_t) pj_get_os_error(void) { return -1; } -PJ_DEF (void) pj_set_os_error (pj_status_t code) +PJ_DEF(void) pj_set_os_error(pj_status_t code) { - PJ_UNUSED_ARG (code); + PJ_UNUSED_ARG(code); } -PJ_DEF (pj_status_t) pj_get_netos_error (void) +PJ_DEF(pj_status_t) pj_get_netos_error(void) { return -1; } -PJ_DEF (void) pj_set_netos_error (pj_status_t code) +PJ_DEF(void) pj_set_netos_error(pj_status_t code) { - PJ_UNUSED_ARG (code); + PJ_UNUSED_ARG(code); } PJ_BEGIN_DECL -PJ_DECL (int) platform_strerror (pj_os_err_type os_errcode, - char *buf, pj_size_t bufsize); + PJ_DECL(int) platform_strerror( pj_os_err_type os_errcode, + char *buf, pj_size_t bufsize); PJ_END_DECL -/* +/* * platform_strerror() * - * Platform specific error message. This file is called by pj_strerror() - * in errno.c + * Platform specific error message. This file is called by pj_strerror() + * in errno.c */ -PJ_DEF (int) platform_strerror (pj_os_err_type os_errcode, - char *buf, pj_size_t bufsize) +PJ_DEF(int) platform_strerror( pj_os_err_type os_errcode, + char *buf, pj_size_t bufsize) { int len = 0; - pj_assert (buf != NULL); - pj_assert (bufsize >= 0); + pj_assert(buf != NULL); + pj_assert(bufsize >= 0); /* * MUST NOT check stack here. @@ -147,31 +145,26 @@ PJ_DEF (int) platform_strerror (pj_os_err_type os_errcode, if (!len) { #if defined(PJ_HAS_ERROR_STRING) && (PJ_HAS_ERROR_STRING!=0) - int i; - + int i; for (i = 0; gaErrorList[i].msg; ++i) { if (gaErrorList[i].code == os_errcode) { - len = strlen (gaErrorList[i].msg); - - if ( (pj_size_t) len >= bufsize) { - len = bufsize-1; - } - - pj_memcpy (buf, gaErrorList[i].msg, len); - - buf[len] = '\0'; + len = strlen(gaErrorList[i].msg); + if ((pj_size_t)len >= bufsize) { + len = bufsize-1; + } + pj_memcpy(buf, gaErrorList[i].msg, len); + buf[len] = '\0'; break; } } - #endif /* PJ_HAS_ERROR_STRING */ } if (!len) { - len = pj_ansi_snprintf (buf, bufsize, "Symbian native error %d", - os_errcode); - buf[len] = '\0'; + len = pj_ansi_snprintf( buf, bufsize, "Symbian native error %d", + os_errcode); + buf[len] = '\0'; } return len; diff --git a/sflphone-common/libs/pjproject/pjlib/src/pj/pool.c b/sflphone-common/libs/pjproject/pjlib/src/pj/pool.c index 7c1e5564b27660549dad71bee4110c1fac3df975..2ab100caad3a58cb57a92ae05cbba4f1656989af 100644 --- a/sflphone-common/libs/pjproject/pjlib/src/pj/pool.c +++ b/sflphone-common/libs/pjproject/pjlib/src/pj/pool.c @@ -1,4 +1,4 @@ -/* $Id: pool.c 2394 2008-12-23 17:27:53Z bennylp $ */ +/* $Id: pool.c 2963 2009-10-24 02:06:40Z bennylp $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> @@ -66,10 +66,15 @@ static pj_pool_block *pj_pool_create_block( pj_pool_t *pool, pj_size_t size) /* Add capacity. */ pool->capacity += size; - /* Set block attribytes. */ - block->cur = block->buf = ((unsigned char*)block) + sizeof(pj_pool_block); + /* Set start and end of buffer. */ + block->buf = ((unsigned char*)block) + sizeof(pj_pool_block); block->end = ((unsigned char*)block) + size; + /* Set the start pointer, aligning it as needed */ + block->cur = (unsigned char*) + (((unsigned long)block->buf + PJ_POOL_ALIGNMENT - 1) & + ~(PJ_POOL_ALIGNMENT - 1)); + /* Insert in the front of the list. */ pj_list_insert_after(&pool->block_list, block); @@ -111,11 +116,15 @@ PJ_DEF(void*) pj_pool_allocate_find(pj_pool_t *pool, unsigned size) /* If pool is configured to expand, but the increment size * is less than the required size, expand the pool by multiple - * increment size + * increment size. Also count the size wasted due to aligning + * the block. */ - if (pool->increment_size < size + sizeof(pj_pool_block)) { + if (pool->increment_size < + size + sizeof(pj_pool_block) + PJ_POOL_ALIGNMENT) + { unsigned count; - count = (size + pool->increment_size + sizeof(pj_pool_block)) / + count = (size + pool->increment_size + sizeof(pj_pool_block) + + PJ_POOL_ALIGNMENT) / pool->increment_size; block_size = count * pool->increment_size; diff --git a/sflphone-common/libs/pjproject/pjlib/src/pj/pool_policy_new.cpp b/sflphone-common/libs/pjproject/pjlib/src/pj/pool_policy_new.cpp index 6f99c068c3beede2da7c6348c89476cf1e20851b..e22040a2f42be5a2f401f2a8a9b3dffd6c305919 100644 --- a/sflphone-common/libs/pjproject/pjlib/src/pj/pool_policy_new.cpp +++ b/sflphone-common/libs/pjproject/pjlib/src/pj/pool_policy_new.cpp @@ -1,5 +1,5 @@ /* $Id: pool_policy_new.cpp 2394 2008-12-23 17:27:53Z bennylp $ */ -/* +/* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> * @@ -15,7 +15,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include <pj/pool.h> #include <pj/except.h> @@ -27,78 +27,76 @@ * This file contains pool default policy definition and implementation. */ #include "pool_signature.h" + - -static void *operator_new (pj_pool_factory *factory, pj_size_t size) +static void *operator_new(pj_pool_factory *factory, pj_size_t size) { void *mem; PJ_CHECK_STACK(); if (factory->on_block_alloc) { - int rc; - rc = factory->on_block_alloc (factory, size); - - if (!rc) - return NULL; + int rc; + rc = factory->on_block_alloc(factory, size); + if (!rc) + return NULL; } - - mem = (void*) new char[size+ (SIG_SIZE << 1) ]; - + + mem = (void*) new char[size+(SIG_SIZE << 1)]; + /* Exception for new operator may be disabled, so.. */ - if (mem) { - /* Apply signature when PJ_SAFE_POOL is set. It will move - * "mem" pointer forward. - */ - APPLY_SIG (mem, size); + /* Apply signature when PJ_SAFE_POOL is set. It will move + * "mem" pointer forward. + */ + APPLY_SIG(mem, size); } return mem; } -static void operator_delete (pj_pool_factory *factory, void *mem, pj_size_t size) +static void operator_delete(pj_pool_factory *factory, void *mem, pj_size_t size) { PJ_CHECK_STACK(); - if (factory->on_block_free) - factory->on_block_free (factory, size); - + if (factory->on_block_free) + factory->on_block_free(factory, size); + /* Check and remove signature when PJ_SAFE_POOL is set. It will * move "mem" pointer backward. */ - REMOVE_SIG (mem, size); + REMOVE_SIG(mem, size); /* Note that when PJ_SAFE_POOL is set, the actual size of the block * is size + SIG_SIZE*2. */ - char *p = (char*) mem; - + char *p = (char*)mem; delete [] p; } -static void default_pool_callback (pj_pool_t *pool, pj_size_t size) +static void default_pool_callback(pj_pool_t *pool, pj_size_t size) { PJ_CHECK_STACK(); - PJ_UNUSED_ARG (pool); - PJ_UNUSED_ARG (size); + PJ_UNUSED_ARG(pool); + PJ_UNUSED_ARG(size); - PJ_THROW (PJ_NO_MEMORY_EXCEPTION); + PJ_THROW(PJ_NO_MEMORY_EXCEPTION); } -PJ_DEF_DATA (pj_pool_factory_policy) pj_pool_factory_default_policy = { +PJ_DEF_DATA(pj_pool_factory_policy) pj_pool_factory_default_policy = +{ &operator_new, &operator_delete, &default_pool_callback, 0 }; -PJ_DEF (const pj_pool_factory_policy*) pj_pool_factory_get_default_policy (void) +PJ_DEF(const pj_pool_factory_policy*) pj_pool_factory_get_default_policy(void) { return &pj_pool_factory_default_policy; } - + #endif /* PJ_HAS_POOL_ALT_API */ diff --git a/sflphone-common/libs/pjproject/pjlib/src/pj/sock_bsd.c b/sflphone-common/libs/pjproject/pjlib/src/pj/sock_bsd.c index 93f2511a2acf07ef61eccf1e2f34bde9ba637557..f7d69a7f44fbaf5cce1943696af0fa57587e310f 100644 --- a/sflphone-common/libs/pjproject/pjlib/src/pj/sock_bsd.c +++ b/sflphone-common/libs/pjproject/pjlib/src/pj/sock_bsd.c @@ -1,4 +1,4 @@ -/* $Id: sock_bsd.c 2394 2008-12-23 17:27:53Z bennylp $ */ +/* $Id: sock_bsd.c 2966 2009-10-25 09:02:07Z bennylp $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> @@ -60,26 +60,43 @@ const pj_uint16_t PJ_SOCK_RDM = SOCK_RDM; const pj_uint16_t PJ_SOL_SOCKET = SOL_SOCKET; #ifdef SOL_IP const pj_uint16_t PJ_SOL_IP = SOL_IP; +#elif defined(PJ_WIN32) && PJ_WIN32 +const pj_uint16_t PJ_SOL_IP = IPPROTO_IP; #else -const pj_uint16_t PJ_SOL_IP = 0xFFFF; +const pj_uint16_t PJ_SOL_IP = 0; #endif /* SOL_IP */ + #if defined(SOL_TCP) const pj_uint16_t PJ_SOL_TCP = SOL_TCP; #elif defined(IPPROTO_TCP) const pj_uint16_t PJ_SOL_TCP = IPPROTO_TCP; +#elif defined(PJ_WIN32) && PJ_WIN32 +const pj_uint16_t PJ_SOL_TCP = IPPROTO_TCP; #else -const pj_uint16_t PJ_SOL_TCP = 0xFFFF; +const pj_uint16_t PJ_SOL_TCP = 6; #endif /* SOL_TCP */ + #ifdef SOL_UDP const pj_uint16_t PJ_SOL_UDP = SOL_UDP; +#elif defined(IPPROTO_UDP) +const pj_uint16_t PJ_SOL_UDP = IPPROTO_UDP; +#elif defined(PJ_WIN32) && PJ_WIN32 +const pj_uint16_t PJ_SOL_UDP = IPPROTO_UDP; #else -const pj_uint16_t PJ_SOL_UDP = 0xFFFF; -#endif +const pj_uint16_t PJ_SOL_UDP = 17; +#endif /* SOL_UDP */ + #ifdef SOL_IPV6 const pj_uint16_t PJ_SOL_IPV6 = SOL_IPV6; +#elif defined(PJ_WIN32) && PJ_WIN32 +# if defined(IPPROTO_IPV6) || (_WIN32_WINNT >= 0x0501) + const pj_uint16_t PJ_SOL_IPV6 = IPPROTO_IPV6; +# else + const pj_uint16_t PJ_SOL_IPV6 = 41; +# endif #else -const pj_uint16_t PJ_SOL_IPV6 = 0xFFFF; -#endif +const pj_uint16_t PJ_SOL_IPV6 = 41; +#endif /* SOL_IPV6 */ /* IP_TOS */ #ifdef IP_TOS @@ -116,6 +133,15 @@ const pj_uint16_t PJ_IPTOS_MINCOST = 0x02; const pj_uint16_t PJ_SO_TYPE = SO_TYPE; const pj_uint16_t PJ_SO_RCVBUF = SO_RCVBUF; const pj_uint16_t PJ_SO_SNDBUF = SO_SNDBUF; +const pj_uint16_t PJ_TCP_NODELAY= TCP_NODELAY; +const pj_uint16_t PJ_SO_REUSEADDR= SO_REUSEADDR; +#if defined(SO_PRIORITY) +const pj_uint16_t PJ_SO_PRIORITY = SO_PRIORITY; +#else +/* This is from Linux, YMMV */ +const pj_uint16_t PJ_SO_PRIORITY = 12; +#endif + /* Multicasting is not supported e.g. in PocketPC 2003 SDK */ #ifdef IP_MULTICAST_IF const pj_uint16_t PJ_IP_MULTICAST_IF = IP_MULTICAST_IF; diff --git a/sflphone-common/libs/pjproject/pjlib/src/pj/sock_common.c b/sflphone-common/libs/pjproject/pjlib/src/pj/sock_common.c index 84fdb71d00c127b0c2e7acb559b0dc7057828bca..f4442cfa161d72f6ec5cea0702645feaacb17b02 100644 --- a/sflphone-common/libs/pjproject/pjlib/src/pj/sock_common.c +++ b/sflphone-common/libs/pjproject/pjlib/src/pj/sock_common.c @@ -1,4 +1,4 @@ -/* $Id: sock_common.c 2886 2009-08-17 10:10:31Z bennylp $ */ +/* $Id: sock_common.c 3037 2009-12-29 16:53:33Z bennylp $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> @@ -338,7 +338,7 @@ PJ_DEF(pj_bool_t) pj_sockaddr_has_addr(const pj_sockaddr_t *addr) * This may break some parts of upper layer libraries. */ //PJ_ASSERT_RETURN(a->addr.sa_family == PJ_AF_INET || - // a->addr.sa_family == PJ_AF_INET6, PJ_EAFNOTSUP); + // a->addr.sa_family == PJ_AF_INET6, PJ_FALSE); if (a->addr.sa_family!=PJ_AF_INET && a->addr.sa_family!=PJ_AF_INET6) { return PJ_FALSE; @@ -372,7 +372,7 @@ PJ_DEF(unsigned) pj_sockaddr_get_addr_len(const pj_sockaddr_t *addr) { const pj_sockaddr *a = (const pj_sockaddr*) addr; PJ_ASSERT_RETURN(a->addr.sa_family == PJ_AF_INET || - a->addr.sa_family == PJ_AF_INET6, PJ_EAFNOTSUP); + a->addr.sa_family == PJ_AF_INET6, 0); return a->addr.sa_family == PJ_AF_INET6 ? sizeof(pj_in6_addr) : sizeof(pj_in_addr); } @@ -384,7 +384,7 @@ PJ_DEF(unsigned) pj_sockaddr_get_len(const pj_sockaddr_t *addr) { const pj_sockaddr *a = (const pj_sockaddr*) addr; PJ_ASSERT_RETURN(a->addr.sa_family == PJ_AF_INET || - a->addr.sa_family == PJ_AF_INET6, PJ_EAFNOTSUP); + a->addr.sa_family == PJ_AF_INET6, 0); return a->addr.sa_family == PJ_AF_INET6 ? sizeof(pj_sockaddr_in6) : sizeof(pj_sockaddr_in); } @@ -1062,6 +1062,21 @@ PJ_DEF(pj_uint16_t) pj_SO_SNDBUF(void) return PJ_SO_SNDBUF; } +PJ_DEF(pj_uint16_t) pj_TCP_NODELAY(void) +{ + return PJ_TCP_NODELAY; +} + +PJ_DEF(pj_uint16_t) pj_SO_REUSEADDR(void) +{ + return PJ_SO_REUSEADDR; +} + +PJ_DEF(pj_uint16_t) pj_SO_PRIORITY(void) +{ + return PJ_SO_PRIORITY; +} + PJ_DEF(pj_uint16_t) pj_IP_MULTICAST_IF(void) { return PJ_IP_MULTICAST_IF; diff --git a/sflphone-common/libs/pjproject/pjlib/src/pj/sock_qos_bsd.c b/sflphone-common/libs/pjproject/pjlib/src/pj/sock_qos_bsd.c new file mode 100644 index 0000000000000000000000000000000000000000..59bfc9faf60d8643608f4aeab2796c23ca53edf4 --- /dev/null +++ b/sflphone-common/libs/pjproject/pjlib/src/pj/sock_qos_bsd.c @@ -0,0 +1,132 @@ +/* $Id: sock_qos_bsd.c 2967 2009-10-25 10:50:17Z bennylp $ */ +/* + * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ +#include <pj/sock_qos.h> +#include <pj/assert.h> +#include <pj/errno.h> +#include <pj/string.h> + +/* This is the implementation of QoS with BSD socket's setsockopt(), + * using IP_TOS and SO_PRIORITY + */ +#if !defined(PJ_QOS_IMPLEMENTATION) || PJ_QOS_IMPLEMENTATION==PJ_QOS_BSD + +PJ_DEF(pj_status_t) pj_sock_set_qos_params(pj_sock_t sock, + pj_qos_params *param) +{ + pj_status_t last_err = PJ_ENOTSUP; + pj_status_t status; + + /* No op? */ + if (!param->flags) + return PJ_SUCCESS; + + /* Clear WMM field since we don't support it */ + param->flags &= ~(PJ_QOS_PARAM_HAS_WMM); + + /* Set TOS/DSCP */ + if (param->flags & PJ_QOS_PARAM_HAS_DSCP) { + /* Value is dscp_val << 2 */ + int val = (param->dscp_val << 2); + status = pj_sock_setsockopt(sock, pj_SOL_IP(), pj_IP_TOS(), + &val, sizeof(val)); + if (status != PJ_SUCCESS) { + param->flags &= ~(PJ_QOS_PARAM_HAS_DSCP); + last_err = status; + } + } + + /* Set SO_PRIORITY */ + if (param->flags & PJ_QOS_PARAM_HAS_SO_PRIO) { + int val = param->so_prio; + status = pj_sock_setsockopt(sock, pj_SOL_SOCKET(), pj_SO_PRIORITY(), + &val, sizeof(val)); + if (status != PJ_SUCCESS) { + param->flags &= ~(PJ_QOS_PARAM_HAS_SO_PRIO); + last_err = status; + } + } + + return param->flags ? PJ_SUCCESS : last_err; +} + +PJ_DEF(pj_status_t) pj_sock_set_qos_type(pj_sock_t sock, + pj_qos_type type) +{ + pj_qos_params param; + pj_status_t status; + + status = pj_qos_get_params(type, ¶m); + if (status != PJ_SUCCESS) + return status; + + return pj_sock_set_qos_params(sock, ¶m); +} + + +PJ_DEF(pj_status_t) pj_sock_get_qos_params(pj_sock_t sock, + pj_qos_params *p_param) +{ + pj_status_t last_err = PJ_ENOTSUP; + int val, optlen; + pj_status_t status; + + pj_bzero(p_param, sizeof(*p_param)); + + /* Get DSCP/TOS value */ + optlen = sizeof(val); + status = pj_sock_getsockopt(sock, pj_SOL_IP(), pj_IP_TOS(), + &val, &optlen); + if (status == PJ_SUCCESS) { + p_param->flags |= PJ_QOS_PARAM_HAS_DSCP; + p_param->dscp_val = (pj_uint8_t)(val >> 2); + } else { + last_err = status; + } + + /* Get SO_PRIORITY */ + optlen = sizeof(val); + status = pj_sock_getsockopt(sock, pj_SOL_SOCKET(), pj_SO_PRIORITY(), + &val, &optlen); + if (status == PJ_SUCCESS) { + p_param->flags |= PJ_QOS_PARAM_HAS_SO_PRIO; + p_param->so_prio = (pj_uint8_t)val; + } else { + last_err = status; + } + + /* WMM is not supported */ + + return p_param->flags ? PJ_SUCCESS : last_err; +} + +PJ_DEF(pj_status_t) pj_sock_get_qos_type(pj_sock_t sock, + pj_qos_type *p_type) +{ + pj_qos_params param; + pj_status_t status; + + status = pj_sock_get_qos_params(sock, ¶m); + if (status != PJ_SUCCESS) + return status; + + return pj_qos_get_type(¶m, p_type); +} + +#endif /* PJ_QOS_IMPLEMENTATION */ + diff --git a/sflphone-common/libs/pjproject/pjlib/src/pj/sock_qos_common.c b/sflphone-common/libs/pjproject/pjlib/src/pj/sock_qos_common.c new file mode 100644 index 0000000000000000000000000000000000000000..80711c541304050ddd6e4bdadf15bbf82b459fe8 --- /dev/null +++ b/sflphone-common/libs/pjproject/pjlib/src/pj/sock_qos_common.c @@ -0,0 +1,151 @@ +/* $Id: sock_qos_common.c 2993 2009-11-09 04:32:33Z bennylp $ */ +/* + * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ +#include <pj/sock_qos.h> +#include <pj/assert.h> +#include <pj/errno.h> +#include <pj/log.h> +#include <pj/string.h> + +#define THIS_FILE "sock_qos_common.c" +#define ALL_FLAGS (PJ_QOS_PARAM_HAS_DSCP | PJ_QOS_PARAM_HAS_SO_PRIO | \ + PJ_QOS_PARAM_HAS_WMM) + +/* "Standard" mapping between traffic type and QoS params */ +static const pj_qos_params qos_map[] = +{ + /* flags dscp prio wmm_prio */ + {ALL_FLAGS, 0x00, 0, PJ_QOS_WMM_PRIO_BULK_EFFORT}, /* BE */ + {ALL_FLAGS, 0x08, 2, PJ_QOS_WMM_PRIO_BULK}, /* BK */ + {ALL_FLAGS, 0x28, 5, PJ_QOS_WMM_PRIO_VIDEO}, /* VI */ + {ALL_FLAGS, 0x30, 6, PJ_QOS_WMM_PRIO_VOICE}, /* VO */ + {ALL_FLAGS, 0x38, 7, PJ_QOS_WMM_PRIO_VOICE} /* CO */ +}; + + +/* Retrieve the mapping for the specified type */ +PJ_DEF(pj_status_t) pj_qos_get_params(pj_qos_type type, + pj_qos_params *p_param) +{ + PJ_ASSERT_RETURN(type<=PJ_QOS_TYPE_CONTROL && p_param, PJ_EINVAL); + pj_memcpy(p_param, &qos_map[type], sizeof(*p_param)); + return PJ_SUCCESS; +} + +/* Get the matching traffic type */ +PJ_DEF(pj_status_t) pj_qos_get_type( const pj_qos_params *param, + pj_qos_type *p_type) +{ + unsigned dscp_type = PJ_QOS_TYPE_BEST_EFFORT, + prio_type = PJ_QOS_TYPE_BEST_EFFORT, + wmm_type = PJ_QOS_TYPE_BEST_EFFORT; + unsigned i, count=0; + + PJ_ASSERT_RETURN(param && p_type, PJ_EINVAL); + + if (param->flags & PJ_QOS_PARAM_HAS_DSCP) { + for (i=0; i<=PJ_QOS_TYPE_CONTROL; ++i) { + if (param->dscp_val >= qos_map[i].dscp_val) + dscp_type = (pj_qos_type)i; + } + ++count; + } + + if (param->flags & PJ_QOS_PARAM_HAS_SO_PRIO) { + for (i=0; i<=PJ_QOS_TYPE_CONTROL; ++i) { + if (param->so_prio >= qos_map[i].so_prio) + prio_type = (pj_qos_type)i; + } + ++count; + } + + if (param->flags & PJ_QOS_PARAM_HAS_WMM) { + for (i=0; i<=PJ_QOS_TYPE_CONTROL; ++i) { + if (param->wmm_prio >= qos_map[i].wmm_prio) + wmm_type = (pj_qos_type)i; + } + ++count; + } + + if (count) + *p_type = (pj_qos_type)((dscp_type + prio_type + wmm_type) / count); + else + *p_type = PJ_QOS_TYPE_BEST_EFFORT; + + return PJ_SUCCESS; +} + +/* Apply QoS */ +PJ_DEF(pj_status_t) pj_sock_apply_qos( pj_sock_t sock, + pj_qos_type qos_type, + pj_qos_params *qos_params, + unsigned log_level, + const char *log_sender, + const char *sock_name) +{ + pj_status_t qos_type_rc = PJ_SUCCESS, + qos_params_rc = PJ_SUCCESS; + + if (!log_sender) + log_sender = THIS_FILE; + if (!sock_name) + sock_name = "socket"; + + if (qos_type != PJ_QOS_TYPE_BEST_EFFORT) { + qos_type_rc = pj_sock_set_qos_type(sock, qos_type); + + if (qos_type_rc != PJ_SUCCESS) { + pj_perror(log_level, log_sender, qos_type_rc, + "Error setting QoS type %d to %s", + qos_type, sock_name); + } + } + + if (qos_params && qos_params->flags) { + qos_params_rc = pj_sock_set_qos_params(sock, qos_params); + if (qos_params_rc != PJ_SUCCESS) { + pj_perror(log_level, log_sender, qos_params_rc, + "Error setting QoS params (flags=%d) to %s", + qos_params->flags, sock_name); + if (qos_type_rc != PJ_SUCCESS) + return qos_params_rc; + } + } else if (qos_type_rc != PJ_SUCCESS) + return qos_type_rc; + + return PJ_SUCCESS; +} + + +PJ_DEF(pj_status_t) pj_sock_apply_qos2( pj_sock_t sock, + pj_qos_type qos_type, + const pj_qos_params *qos_params, + unsigned log_level, + const char *log_sender, + const char *sock_name) +{ + pj_qos_params qos_params_buf, *qos_params_copy = NULL; + + if (qos_params) { + pj_memcpy(&qos_params_buf, qos_params, sizeof(*qos_params)); + qos_params_copy = &qos_params_buf; + } + + return pj_sock_apply_qos(sock, qos_type, qos_params_copy, + log_level, log_sender, sock_name); +} diff --git a/sflphone-common/libs/pjproject/pjlib/src/pj/sock_qos_dummy.c b/sflphone-common/libs/pjproject/pjlib/src/pj/sock_qos_dummy.c new file mode 100644 index 0000000000000000000000000000000000000000..200d53b9aed0dde87adfb305776ddf1a98cb690b --- /dev/null +++ b/sflphone-common/libs/pjproject/pjlib/src/pj/sock_qos_dummy.c @@ -0,0 +1,76 @@ +/* $Id: sock_qos_dummy.c 2966 2009-10-25 09:02:07Z bennylp $ */ +/* + * Copyright (C) 2009 Teluu Inc. (http://www.teluu.com) + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ +#include <pj/sock_qos.h> +#include <pj/errno.h> +#include <pj/log.h> + +/* Dummy implementation of QoS API. + * (this is controlled by pjlib's config.h) + */ +#if defined(PJ_QOS_IMPLEMENTATION) && PJ_QOS_IMPLEMENTATION==PJ_QOS_DUMMY + +#define THIS_FILE "sock_qos_dummy.c" + + +PJ_DEF(pj_status_t) pj_sock_set_qos_params(pj_sock_t sock, + pj_qos_params *param) +{ + PJ_UNUSED_ARG(sock); + PJ_UNUSED_ARG(param); + + PJ_LOG(4,(THIS_FILE, "pj_sock_set_qos_params() is not implemented " + "for this platform")); + return PJ_ENOTSUP; +} + +PJ_DEF(pj_status_t) pj_sock_set_qos_type(pj_sock_t sock, + pj_qos_type type) +{ + PJ_UNUSED_ARG(sock); + PJ_UNUSED_ARG(type); + + PJ_LOG(4,(THIS_FILE, "pj_sock_set_qos_type() is not implemented " + "for this platform")); + return PJ_ENOTSUP; +} + + +PJ_DEF(pj_status_t) pj_sock_get_qos_params(pj_sock_t sock, + pj_qos_params *p_param) +{ + PJ_UNUSED_ARG(sock); + PJ_UNUSED_ARG(p_param); + + PJ_LOG(4,(THIS_FILE, "pj_sock_get_qos_params() is not implemented " + "for this platform")); + return PJ_ENOTSUP; +} + +PJ_DEF(pj_status_t) pj_sock_get_qos_type(pj_sock_t sock, + pj_qos_type *p_type) +{ + PJ_UNUSED_ARG(sock); + PJ_UNUSED_ARG(p_type); + + PJ_LOG(4,(THIS_FILE, "pj_sock_get_qos_type() is not implemented " + "for this platform")); + return PJ_ENOTSUP; +} + +#endif /* PJ_QOS_DUMMY */ diff --git a/sflphone-common/libs/pjproject/pjlib/src/pj/sock_qos_symbian.cpp b/sflphone-common/libs/pjproject/pjlib/src/pj/sock_qos_symbian.cpp new file mode 100644 index 0000000000000000000000000000000000000000..55a41097540a88ee0e5c173b84fe8bee061ab635 --- /dev/null +++ b/sflphone-common/libs/pjproject/pjlib/src/pj/sock_qos_symbian.cpp @@ -0,0 +1,95 @@ +/* $Id: sock_qos_symbian.cpp 2998 2009-11-09 08:51:34Z bennylp $ */ +/* + * Copyright (C) 2009 Teluu Inc. (http://www.teluu.com) + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ +#include <pj/sock_qos.h> +#include "os_symbian.h" + +PJ_DEF(pj_status_t) pj_sock_set_qos_params(pj_sock_t sock, + pj_qos_params *param) +{ + PJ_ASSERT_RETURN(sock!=0 && sock!=PJ_INVALID_SOCKET, PJ_EINVAL); + + CPjSocket *pjsock = (CPjSocket*)sock; + RSocket & rsock = pjsock->Socket(); + pj_status_t last_err = PJ_ENOTSUP; + + /* SO_PRIORITY and WMM are not supported */ + param->flags &= ~(PJ_QOS_PARAM_HAS_SO_PRIO | PJ_QOS_PARAM_HAS_WMM); + + if (param->flags & PJ_QOS_PARAM_HAS_DSCP) { + TInt err; + + err = rsock.SetOpt(KSoIpTOS, KProtocolInetIp, + (param->dscp_val << 2)); + if (err != KErrNone) { + last_err = PJ_RETURN_OS_ERROR(err); + param->flags &= ~(PJ_QOS_PARAM_HAS_DSCP); + } + } + + return param->flags ? PJ_SUCCESS : last_err; +} + +PJ_DEF(pj_status_t) pj_sock_set_qos_type(pj_sock_t sock, + pj_qos_type type) +{ + pj_qos_params param; + pj_status_t status; + + status = pj_qos_get_params(type, ¶m); + if (status != PJ_SUCCESS) + return status; + + return pj_sock_set_qos_params(sock, ¶m); +} + + +PJ_DEF(pj_status_t) pj_sock_get_qos_params(pj_sock_t sock, + pj_qos_params *p_param) +{ + PJ_ASSERT_RETURN(sock!=0 && sock!=PJ_INVALID_SOCKET, PJ_EINVAL); + + CPjSocket *pjsock = (CPjSocket*)sock; + RSocket & rsock = pjsock->Socket(); + TInt err, dscp; + + pj_bzero(p_param, sizeof(*p_param)); + + err = rsock.GetOpt(KSoIpTOS, KProtocolInetIp, dscp); + if (err == KErrNone) { + p_param->flags |= PJ_QOS_PARAM_HAS_DSCP; + p_param->dscp_val = (dscp >> 2); + return PJ_SUCCESS; + } else { + return PJ_RETURN_OS_ERROR(err); + } +} + +PJ_DEF(pj_status_t) pj_sock_get_qos_type(pj_sock_t sock, + pj_qos_type *p_type) +{ + pj_qos_params param; + pj_status_t status; + + status = pj_sock_get_qos_params(sock, ¶m); + if (status != PJ_SUCCESS) + return status; + + return pj_qos_get_type(¶m, p_type); +} + diff --git a/sflphone-common/libs/pjproject/pjlib/src/pj/sock_qos_wm.c b/sflphone-common/libs/pjproject/pjlib/src/pj/sock_qos_wm.c new file mode 100644 index 0000000000000000000000000000000000000000..895d74f342bb13fd0667e221d992847853c1afbf --- /dev/null +++ b/sflphone-common/libs/pjproject/pjlib/src/pj/sock_qos_wm.c @@ -0,0 +1,103 @@ +/* $Id: sock_qos_wm.c 2966 2009-10-25 09:02:07Z bennylp $ */ +/* + * Copyright (C) 2009 Teluu Inc. (http://www.teluu.com) + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ +#include <pj/sock_qos.h> +#include <pj/assert.h> +#include <pj/errno.h> +#include <pj/log.h> + +#include <winsock.h> + +/* QoS implementation for Windows Mobile 6, must be enabled explicitly + * (this is controlled by pjlib's config.h) + */ +#if defined(PJ_QOS_IMPLEMENTATION) && PJ_QOS_IMPLEMENTATION==PJ_QOS_WM + +#define THIS_FILE "sock_qos_wm.c" + +/* Mapping between our traffic type and WM's DSCP traffic types */ +static const int dscp_map[] = +{ + DSCPBestEffort, + DSCPBackground, + DSCPVideo, + DSCPAudio, + DSCPControl +}; + +PJ_DEF(pj_status_t) pj_sock_set_qos_params(pj_sock_t sock, + pj_qos_params *param) +{ + PJ_UNUSED_ARG(sock); + PJ_UNUSED_ARG(param); + + PJ_LOG(4,(THIS_FILE, "pj_sock_set_qos_params() is not implemented " + "for this platform")); + return PJ_ENOTSUP; +} + +PJ_DEF(pj_status_t) pj_sock_set_qos_type(pj_sock_t sock, + pj_qos_type type) +{ + int value; + + PJ_ASSERT_RETURN(type < PJ_ARRAY_SIZE(dscp_map), PJ_EINVAL); + + value = dscp_map[type]; + return pj_sock_setsockopt(sock, IPPROTO_IP, IP_DSCP_TRAFFIC_TYPE, + &value, sizeof(value)); +} + + +PJ_DEF(pj_status_t) pj_sock_get_qos_params(pj_sock_t sock, + pj_qos_params *p_param) +{ + PJ_UNUSED_ARG(sock); + PJ_UNUSED_ARG(p_param); + + PJ_LOG(4,(THIS_FILE, "pj_sock_get_qos_params() is not implemented " + "for this platform")); + return PJ_ENOTSUP; +} + +PJ_DEF(pj_status_t) pj_sock_get_qos_type(pj_sock_t sock, + pj_qos_type *p_type) +{ + pj_status_t status; + int value, optlen; + unsigned i; + + optlen = sizeof(value); + value = 0; + status = pj_sock_getsockopt(sock, IPPROTO_IP, IP_DSCP_TRAFFIC_TYPE, + &value, &optlen); + if (status != PJ_SUCCESS) + return status; + + *p_type = PJ_QOS_TYPE_BEST_EFFORT; + for (i=0; i<PJ_ARRAY_SIZE(dscp_map); ++i) { + if (value == dscp_map[i]) { + *p_type = (pj_qos_type)i; + break; + } + } + + return PJ_SUCCESS; +} + +#endif /* PJ_QOS_IMPLEMENTATION */ diff --git a/sflphone-common/libs/pjproject/pjlib/src/pj/sock_select_symbian.cpp b/sflphone-common/libs/pjproject/pjlib/src/pj/sock_select_symbian.cpp index 48170ff6d014141c1914aa352a001d1e17eaf021..727bcfdf8b3783a3e984f2804c642d3ab86a37cb 100644 --- a/sflphone-common/libs/pjproject/pjlib/src/pj/sock_select_symbian.cpp +++ b/sflphone-common/libs/pjproject/pjlib/src/pj/sock_select_symbian.cpp @@ -1,5 +1,5 @@ /* $Id: sock_select_symbian.cpp 2394 2008-12-23 17:27:53Z bennylp $ */ -/* +/* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> * @@ -15,7 +15,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include <pj/sock_select.h> #include <pj/array.h> @@ -23,143 +23,140 @@ #include <pj/os.h> #include "os_symbian.h" - -struct symbian_fd_set { + +struct symbian_fd_set +{ unsigned count; CPjSocket *sock[PJ_IOQUEUE_MAX_HANDLES]; }; -PJ_DEF (void) PJ_FD_ZERO (pj_fd_set_t *fdsetp) +PJ_DEF(void) PJ_FD_ZERO(pj_fd_set_t *fdsetp) { - symbian_fd_set *fds = (symbian_fd_set *) fdsetp; + symbian_fd_set *fds = (symbian_fd_set *)fdsetp; fds->count = 0; } -PJ_DEF (void) PJ_FD_SET (pj_sock_t fd, pj_fd_set_t *fdsetp) +PJ_DEF(void) PJ_FD_SET(pj_sock_t fd, pj_fd_set_t *fdsetp) { - symbian_fd_set *fds = (symbian_fd_set *) fdsetp; + symbian_fd_set *fds = (symbian_fd_set *)fdsetp; - PJ_ASSERT_ON_FAIL (fds->count < PJ_IOQUEUE_MAX_HANDLES, return); - fds->sock[fds->count++] = (CPjSocket*) fd; + PJ_ASSERT_ON_FAIL(fds->count < PJ_IOQUEUE_MAX_HANDLES, return); + fds->sock[fds->count++] = (CPjSocket*)fd; } -PJ_DEF (void) PJ_FD_CLR (pj_sock_t fd, pj_fd_set_t *fdsetp) +PJ_DEF(void) PJ_FD_CLR(pj_sock_t fd, pj_fd_set_t *fdsetp) { - symbian_fd_set *fds = (symbian_fd_set *) fdsetp; + symbian_fd_set *fds = (symbian_fd_set *)fdsetp; unsigned i; - + for (i=0; i<fds->count; ++i) { - if (fds->sock[i] == (CPjSocket*) fd) { - pj_array_erase (fds->sock, sizeof (fds->sock[0]), fds->count, i); - --fds->count; - return; - } + if (fds->sock[i] == (CPjSocket*)fd) { + pj_array_erase(fds->sock, sizeof(fds->sock[0]), fds->count, i); + --fds->count; + return; + } } } -PJ_DEF (pj_bool_t) PJ_FD_ISSET (pj_sock_t fd, const pj_fd_set_t *fdsetp) +PJ_DEF(pj_bool_t) PJ_FD_ISSET(pj_sock_t fd, const pj_fd_set_t *fdsetp) { - symbian_fd_set *fds = (symbian_fd_set *) fdsetp; + symbian_fd_set *fds = (symbian_fd_set *)fdsetp; unsigned i; - + for (i=0; i<fds->count; ++i) { - if (fds->sock[i] == (CPjSocket*) fd) { - return PJ_TRUE; - } + if (fds->sock[i] == (CPjSocket*)fd) { + return PJ_TRUE; + } } return PJ_FALSE; } -PJ_DEF (pj_size_t) PJ_FD_COUNT (const pj_fd_set_t *fdsetp) +PJ_DEF(pj_size_t) PJ_FD_COUNT(const pj_fd_set_t *fdsetp) { - symbian_fd_set *fds = (symbian_fd_set *) fdsetp; + symbian_fd_set *fds = (symbian_fd_set *)fdsetp; return fds->count; } -PJ_DEF (int) pj_sock_select (int n, - pj_fd_set_t *readfds, - pj_fd_set_t *writefds, - pj_fd_set_t *exceptfds, - const pj_time_val *timeout) +PJ_DEF(int) pj_sock_select( int n, + pj_fd_set_t *readfds, + pj_fd_set_t *writefds, + pj_fd_set_t *exceptfds, + const pj_time_val *timeout) { CPjTimeoutTimer *pjTimer; unsigned i; - PJ_UNUSED_ARG (n); - PJ_UNUSED_ARG (writefds); - PJ_UNUSED_ARG (exceptfds); + PJ_UNUSED_ARG(n); + PJ_UNUSED_ARG(writefds); + PJ_UNUSED_ARG(exceptfds); if (timeout) { - pjTimer = PjSymbianOS::Instance()->SelectTimeoutTimer(); - pjTimer->StartTimer (timeout->sec*1000 + timeout->msec); + pjTimer = PjSymbianOS::Instance()->SelectTimeoutTimer(); + pjTimer->StartTimer(timeout->sec*1000 + timeout->msec); } else { - pjTimer = NULL; + pjTimer = NULL; } /* Scan for readable sockets */ if (readfds) { - symbian_fd_set *fds = (symbian_fd_set *) readfds; + symbian_fd_set *fds = (symbian_fd_set *)readfds; - do { - /* Scan sockets for readily available data */ - for (i=0; i<fds->count; ++i) { - CPjSocket *pjsock = fds->sock[i]; + do { + /* Scan sockets for readily available data */ + for (i=0; i<fds->count; ++i) { + CPjSocket *pjsock = fds->sock[i]; - if (pjsock->Reader()) { - if (pjsock->Reader()->HasData() && !pjsock->Reader()->IsActive()) { + if (pjsock->Reader()) { + if (pjsock->Reader()->HasData() && !pjsock->Reader()->IsActive()) { - /* Found socket with data ready */ - PJ_FD_ZERO (readfds); - PJ_FD_SET ( (pj_sock_t) pjsock, readfds); + /* Found socket with data ready */ + PJ_FD_ZERO(readfds); + PJ_FD_SET((pj_sock_t)pjsock, readfds); - /* Cancel timer, if any */ + /* Cancel timer, if any */ + if (pjTimer) { + pjTimer->Cancel(); + } - if (pjTimer) { - pjTimer->Cancel(); - } + /* Clear writable and exception fd_set */ + if (writefds) + PJ_FD_ZERO(writefds); + if (exceptfds) + PJ_FD_ZERO(exceptfds); - /* Clear writable and exception fd_set */ - if (writefds) - PJ_FD_ZERO (writefds); + return 1; - if (exceptfds) - PJ_FD_ZERO (exceptfds); + } else if (!pjsock->Reader()->IsActive()) + pjsock->Reader()->StartRecvFrom(); - return 1; + } else { + pjsock->CreateReader(); + pjsock->Reader()->StartRecvFrom(); + } + } - } else if (!pjsock->Reader()->IsActive()) - pjsock->Reader()->StartRecvFrom(); + PjSymbianOS::Instance()->WaitForActiveObjects(); - } else { - pjsock->CreateReader(); - pjsock->Reader()->StartRecvFrom(); - } - } - - PjSymbianOS::Instance()->WaitForActiveObjects(); - - } while (pjTimer==NULL || !pjTimer->HasTimedOut()); + } while (pjTimer==NULL || !pjTimer->HasTimedOut()); } /* Timeout */ if (readfds) - PJ_FD_ZERO (readfds); - + PJ_FD_ZERO(readfds); if (writefds) - PJ_FD_ZERO (writefds); - + PJ_FD_ZERO(writefds); if (exceptfds) - PJ_FD_ZERO (exceptfds); + PJ_FD_ZERO(exceptfds); return 0; } diff --git a/sflphone-common/libs/pjproject/pjlib/src/pj/sock_symbian.cpp b/sflphone-common/libs/pjproject/pjlib/src/pj/sock_symbian.cpp index af174cc85551b6b23beba92981108042ef90a6eb..b1c725c1493a28b5b227ce06ca0fa35ded9d36ff 100644 --- a/sflphone-common/libs/pjproject/pjlib/src/pj/sock_symbian.cpp +++ b/sflphone-common/libs/pjproject/pjlib/src/pj/sock_symbian.cpp @@ -1,5 +1,5 @@ -/* $Id: sock_symbian.cpp 2771 2009-06-17 13:31:13Z bennylp $ */ -/* +/* $Id: sock_symbian.cpp 2966 2009-10-25 09:02:07Z bennylp $ */ +/* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> * @@ -15,7 +15,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include <pj/sock.h> #include <pj/addr_resolv.h> @@ -47,7 +47,7 @@ const pj_uint16_t PJ_SOCK_DGRAM = KSockDatagram; const pj_uint16_t PJ_SOCK_RAW = 0xFFFF; const pj_uint16_t PJ_SOCK_RDM = 0xFFFF; -/* setsockop() is not really supported. */ +/* we don't support setsockopt(), these are just dummy values */ const pj_uint16_t PJ_SOL_SOCKET = 0xFFFF; const pj_uint16_t PJ_SOL_IP = 0xFFFF; const pj_uint16_t PJ_SOL_TCP = 0xFFFF; @@ -61,6 +61,11 @@ const pj_uint16_t PJ_IPTOS_THROUGHPUT = 0; const pj_uint16_t PJ_IPTOS_RELIABILITY = 0; const pj_uint16_t PJ_IPTOS_MINCOST = 0; +/* Misc */ +const pj_uint16_t PJ_TCP_NODELAY = 0xFFFF; +const pj_uint16_t PJ_SO_REUSEADDR = 0xFFFF; +const pj_uint16_t PJ_SO_PRIORITY = 0xFFFF; + /* ioctl() is also not supported. */ const pj_uint16_t PJ_SO_TYPE = 0xFFFF; const pj_uint16_t PJ_SO_RCVBUF = 0xFFFF; @@ -92,19 +97,19 @@ CPjSocket::~CPjSocket() // Create socket reader. -CPjSocketReader *CPjSocket::CreateReader (unsigned max_len) +CPjSocketReader *CPjSocket::CreateReader(unsigned max_len) { - pj_assert (sockReader_ == NULL); - return sockReader_ = CPjSocketReader::NewL (*this, max_len); + pj_assert(sockReader_ == NULL); + return sockReader_ = CPjSocketReader::NewL(*this, max_len); } // Delete socket reader when it's not wanted. -void CPjSocket::DestroyReader() +void CPjSocket::DestroyReader() { if (sockReader_) { - sockReader_->Cancel(); - delete sockReader_; - sockReader_ = NULL; + sockReader_->Cancel(); + delete sockReader_; + sockReader_ = NULL; } } @@ -116,28 +121,28 @@ void CPjSocket::DestroyReader() // -CPjSocketReader::CPjSocketReader (CPjSocket &sock) - : CActive (EPriorityStandard), - sock_ (sock), buffer_ (NULL, 0), readCb_ (NULL), key_ (NULL) +CPjSocketReader::CPjSocketReader(CPjSocket &sock) +: CActive(EPriorityStandard), + sock_(sock), buffer_(NULL, 0), readCb_(NULL), key_(NULL) { } -void CPjSocketReader::ConstructL (unsigned max_len) +void CPjSocketReader::ConstructL(unsigned max_len) { isDatagram_ = sock_.IsDatagram(); TUint8 *ptr = new TUint8[max_len]; - buffer_.Set (ptr, 0, (TInt) max_len); - CActiveScheduler::Add (this); + buffer_.Set(ptr, 0, (TInt)max_len); + CActiveScheduler::Add(this); } -CPjSocketReader *CPjSocketReader::NewL (CPjSocket &sock, unsigned max_len) +CPjSocketReader *CPjSocketReader::NewL(CPjSocket &sock, unsigned max_len) { - CPjSocketReader *self = new (ELeave) CPjSocketReader (sock); - CleanupStack::PushL (self); - self->ConstructL (max_len); - CleanupStack::Pop (self); + CPjSocketReader *self = new (ELeave) CPjSocketReader(sock); + CleanupStack::PushL(self); + self->ConstructL(max_len); + CleanupStack::Pop(self); return self; } @@ -149,29 +154,27 @@ CPjSocketReader::~CPjSocketReader() delete [] data; } -void CPjSocketReader::StartRecv (void (*cb) (void *key), - void *key, - TDes8 *aDesc, - TUint flags) +void CPjSocketReader::StartRecv(void (*cb)(void *key), + void *key, + TDes8 *aDesc, + TUint flags) { - StartRecvFrom (cb, key, aDesc, flags, NULL); + StartRecvFrom(cb, key, aDesc, flags, NULL); } -void CPjSocketReader::StartRecvFrom (void (*cb) (void *key), - void *key, - TDes8 *aDesc, - TUint flags, - TSockAddr *fromAddr) +void CPjSocketReader::StartRecvFrom(void (*cb)(void *key), + void *key, + TDes8 *aDesc, + TUint flags, + TSockAddr *fromAddr) { readCb_ = cb; key_ = key; if (aDesc == NULL) aDesc = &buffer_; - if (fromAddr == NULL) fromAddr = &recvAddr_; - sock_.Socket().RecvFrom (*aDesc, *fromAddr, flags, iStatus); - + sock_.Socket().RecvFrom(*aDesc, *fromAddr, flags, iStatus); SetActive(); } @@ -182,41 +185,40 @@ void CPjSocketReader::DoCancel() void CPjSocketReader::RunL() { - void (*old_cb) (void *key) = readCb_; + void (*old_cb)(void *key) = readCb_; void *old_key = key_; readCb_ = NULL; key_ = NULL; if (old_cb) { - (*old_cb) (old_key); + (*old_cb)(old_key); } } // Append data to aDesc, up to aDesc's maximum size. // If socket is datagram based, buffer_ will be clared. -void CPjSocketReader::ReadData (TDes8 &aDesc, TInetAddr *addr) +void CPjSocketReader::ReadData(TDes8 &aDesc, TInetAddr *addr) { if (isDatagram_) - aDesc.Zero(); + aDesc.Zero(); if (buffer_.Length() == 0) - return; + return; TInt size_to_copy = aDesc.MaxLength() - aDesc.Length(); - if (size_to_copy > buffer_.Length()) - size_to_copy = buffer_.Length(); + size_to_copy = buffer_.Length(); - aDesc.Append (buffer_.Ptr(), size_to_copy); + aDesc.Append(buffer_.Ptr(), size_to_copy); if (isDatagram_) - buffer_.Zero(); + buffer_.Zero(); else - buffer_.Delete (0, size_to_copy); + buffer_.Delete(0, size_to_copy); if (addr) - *addr = recvAddr_; + *addr = recvAddr_; } @@ -229,10 +231,10 @@ void CPjSocketReader::ReadData (TDes8 &aDesc, TInetAddr *addr) /* * Convert 16-bit value from network byte order to host byte order. */ -PJ_DEF (pj_uint16_t) pj_ntohs (pj_uint16_t netshort) +PJ_DEF(pj_uint16_t) pj_ntohs(pj_uint16_t netshort) { #if PJ_IS_LITTLE_ENDIAN - return pj_swap16 (netshort); + return pj_swap16(netshort); #else return netshort; #endif @@ -241,10 +243,10 @@ PJ_DEF (pj_uint16_t) pj_ntohs (pj_uint16_t netshort) /* * Convert 16-bit value from host byte order to network byte order. */ -PJ_DEF (pj_uint16_t) pj_htons (pj_uint16_t hostshort) +PJ_DEF(pj_uint16_t) pj_htons(pj_uint16_t hostshort) { #if PJ_IS_LITTLE_ENDIAN - return pj_swap16 (hostshort); + return pj_swap16(hostshort); #else return hostshort; #endif @@ -253,10 +255,10 @@ PJ_DEF (pj_uint16_t) pj_htons (pj_uint16_t hostshort) /* * Convert 32-bit value from network byte order to host byte order. */ -PJ_DEF (pj_uint32_t) pj_ntohl (pj_uint32_t netlong) +PJ_DEF(pj_uint32_t) pj_ntohl(pj_uint32_t netlong) { #if PJ_IS_LITTLE_ENDIAN - return pj_swap32 (netlong); + return pj_swap32(netlong); #else return netlong; #endif @@ -265,10 +267,10 @@ PJ_DEF (pj_uint32_t) pj_ntohl (pj_uint32_t netlong) /* * Convert 32-bit value from host byte order to network byte order. */ -PJ_DEF (pj_uint32_t) pj_htonl (pj_uint32_t hostlong) +PJ_DEF(pj_uint32_t) pj_htonl(pj_uint32_t hostlong) { #if PJ_IS_LITTLE_ENDIAN - return pj_swap32 (hostlong); + return pj_swap32(hostlong); #else return netlong; #endif @@ -278,25 +280,25 @@ PJ_DEF (pj_uint32_t) pj_htonl (pj_uint32_t hostlong) * Convert an Internet host address given in network byte order * to string in standard numbers and dots notation. */ -PJ_DEF (char*) pj_inet_ntoa (pj_in_addr inaddr) +PJ_DEF(char*) pj_inet_ntoa(pj_in_addr inaddr) { - static char str8[PJ_INET_ADDRSTRLEN]; - TBuf<PJ_INET_ADDRSTRLEN> str16 (0); + static char str8[PJ_INET_ADDRSTRLEN]; + TBuf<PJ_INET_ADDRSTRLEN> str16(0); /* (Symbian IP address is in host byte order) */ - TInetAddr temp_addr ( (TUint32) pj_ntohl (inaddr.s_addr), (TUint) 0); - temp_addr.Output (str16); - - return pj_unicode_to_ansi ( (const wchar_t*) str16.PtrZ(), str16.Length(), - str8, sizeof (str8)); + TInetAddr temp_addr((TUint32)pj_ntohl(inaddr.s_addr), (TUint)0); + temp_addr.Output(str16); + + return pj_unicode_to_ansi((const wchar_t*)str16.PtrZ(), str16.Length(), + str8, sizeof(str8)); } /* * This function converts the Internet host address cp from the standard * numbers-and-dots notation into binary data and stores it in the structure - * that inp points to. + * that inp points to. */ -PJ_DEF (int) pj_inet_aton (const pj_str_t *cp, struct pj_in_addr *inp) +PJ_DEF(int) pj_inet_aton(const pj_str_t *cp, struct pj_in_addr *inp) { enum { MAXIPLEN = PJ_INET_ADDRSTRLEN }; @@ -310,52 +312,48 @@ PJ_DEF (int) pj_inet_aton (const pj_str_t *cp, struct pj_in_addr *inp) * this function might be called with cp->slen >= 16 * (i.e. when called with hostname to check if it's an IP addr). */ - PJ_ASSERT_RETURN (cp && cp->slen && inp, 0); - + PJ_ASSERT_RETURN(cp && cp->slen && inp, 0); if (cp->slen >= 16) { - return 0; + return 0; } char tempaddr8[MAXIPLEN]; - - pj_memcpy (tempaddr8, cp->ptr, cp->slen); + pj_memcpy(tempaddr8, cp->ptr, cp->slen); tempaddr8[cp->slen] = '\0'; wchar_t tempaddr16[MAXIPLEN]; - pj_ansi_to_unicode (tempaddr8, pj_ansi_strlen (tempaddr8), - tempaddr16, sizeof (tempaddr16)); + pj_ansi_to_unicode(tempaddr8, pj_ansi_strlen(tempaddr8), + tempaddr16, sizeof(tempaddr16)); - TBuf<MAXIPLEN> ip_addr ( (const TText*) tempaddr16); + TBuf<MAXIPLEN> ip_addr((const TText*)tempaddr16); TInetAddr addr; - addr.Init (KAfInet); - - if (addr.Input (ip_addr) == KErrNone) { - /* Success (Symbian IP address is in host byte order) */ - inp->s_addr = pj_htonl (addr.Address()); - return 1; + addr.Init(KAfInet); + if (addr.Input(ip_addr) == KErrNone) { + /* Success (Symbian IP address is in host byte order) */ + inp->s_addr = pj_htonl(addr.Address()); + return 1; } else { - /* Error */ - return 0; + /* Error */ + return 0; } } /* * Convert text to IPv4/IPv6 address. */ -PJ_DEF (pj_status_t) pj_inet_pton (int af, const pj_str_t *src, void *dst) +PJ_DEF(pj_status_t) pj_inet_pton(int af, const pj_str_t *src, void *dst) { char tempaddr[PJ_INET6_ADDRSTRLEN]; - PJ_ASSERT_RETURN (af==PJ_AF_INET || af==PJ_AF_INET6, PJ_EINVAL); - PJ_ASSERT_RETURN (src && src->slen && dst, PJ_EINVAL); + PJ_ASSERT_RETURN(af==PJ_AF_INET || af==PJ_AF_INET6, PJ_EINVAL); + PJ_ASSERT_RETURN(src && src->slen && dst, PJ_EINVAL); - /* Initialize output with PJ_IN_ADDR_NONE for IPv4 (to be + /* Initialize output with PJ_IN_ADDR_NONE for IPv4 (to be * compatible with pj_inet_aton() */ - if (af==PJ_AF_INET) { - ( (pj_in_addr*) dst)->s_addr = PJ_INADDR_NONE; + ((pj_in_addr*)dst)->s_addr = PJ_INADDR_NONE; } /* Caution: @@ -363,96 +361,88 @@ PJ_DEF (pj_status_t) pj_inet_pton (int af, const pj_str_t *src, void *dst) * (i.e. when called with hostname to check if it's an IP addr). */ if (src->slen >= PJ_INET6_ADDRSTRLEN) { - return PJ_ENAMETOOLONG; + return PJ_ENAMETOOLONG; } - pj_memcpy (tempaddr, src->ptr, src->slen); - + pj_memcpy(tempaddr, src->ptr, src->slen); tempaddr[src->slen] = '\0'; wchar_t tempaddr16[PJ_INET6_ADDRSTRLEN]; - pj_ansi_to_unicode (tempaddr, pj_ansi_strlen (tempaddr), - tempaddr16, sizeof (tempaddr16)); + pj_ansi_to_unicode(tempaddr, pj_ansi_strlen(tempaddr), + tempaddr16, sizeof(tempaddr16)); - TBuf<PJ_INET6_ADDRSTRLEN> ip_addr ( (const TText*) tempaddr16); + TBuf<PJ_INET6_ADDRSTRLEN> ip_addr((const TText*)tempaddr16); TInetAddr addr; - addr.Init (KAfInet6); - - if (addr.Input (ip_addr) == KErrNone) { - if (af==PJ_AF_INET) { - /* Success (Symbian IP address is in host byte order) */ - pj_uint32_t ip = pj_htonl (addr.Address()); - pj_memcpy (dst, &ip, 4); - } else if (af==PJ_AF_INET6) { - const TIp6Addr & ip6 = addr.Ip6Address(); - pj_memcpy (dst, ip6.u.iAddr8, 16); - } else { - pj_assert (!"Unexpected!"); - return PJ_EBUG; - } - - return PJ_SUCCESS; + addr.Init(KAfInet6); + if (addr.Input(ip_addr) == KErrNone) { + if (af==PJ_AF_INET) { + /* Success (Symbian IP address is in host byte order) */ + pj_uint32_t ip = pj_htonl(addr.Address()); + pj_memcpy(dst, &ip, 4); + } else if (af==PJ_AF_INET6) { + const TIp6Addr & ip6 = addr.Ip6Address(); + pj_memcpy(dst, ip6.u.iAddr8, 16); + } else { + pj_assert(!"Unexpected!"); + return PJ_EBUG; + } + return PJ_SUCCESS; } else { - /* Error */ - return PJ_EINVAL; + /* Error */ + return PJ_EINVAL; } } /* * Convert IPv4/IPv6 address to text. */ -PJ_DEF (pj_status_t) pj_inet_ntop (int af, const void *src, - char *dst, int size) +PJ_DEF(pj_status_t) pj_inet_ntop(int af, const void *src, + char *dst, int size) { - PJ_ASSERT_RETURN (src && dst && size, PJ_EINVAL); + PJ_ASSERT_RETURN(src && dst && size, PJ_EINVAL); *dst = '\0'; if (af==PJ_AF_INET) { - TBuf<PJ_INET_ADDRSTRLEN> str16; - pj_in_addr inaddr; - - if (size < PJ_INET_ADDRSTRLEN) - return PJ_ETOOSMALL; + TBuf<PJ_INET_ADDRSTRLEN> str16; + pj_in_addr inaddr; - pj_memcpy (&inaddr, src, 4); + if (size < PJ_INET_ADDRSTRLEN) + return PJ_ETOOSMALL; - /* Symbian IP address is in host byte order */ - TInetAddr temp_addr ( (TUint32) pj_ntohl (inaddr.s_addr), (TUint) 0); + pj_memcpy(&inaddr, src, 4); - temp_addr.Output (str16); - - pj_unicode_to_ansi ( (const wchar_t*) str16.PtrZ(), str16.Length(), - dst, size); - - return PJ_SUCCESS; + /* Symbian IP address is in host byte order */ + TInetAddr temp_addr((TUint32)pj_ntohl(inaddr.s_addr), (TUint)0); + temp_addr.Output(str16); + + pj_unicode_to_ansi((const wchar_t*)str16.PtrZ(), str16.Length(), + dst, size); + return PJ_SUCCESS; } else if (af==PJ_AF_INET6) { - TBuf<PJ_INET6_ADDRSTRLEN> str16; - - if (size < PJ_INET6_ADDRSTRLEN) - return PJ_ETOOSMALL; - - TIp6Addr ip6; - - pj_memcpy (ip6.u.iAddr8, src, 16); - - TInetAddr temp_addr (ip6, (TUint) 0); + TBuf<PJ_INET6_ADDRSTRLEN> str16; - temp_addr.Output (str16); + if (size < PJ_INET6_ADDRSTRLEN) + return PJ_ETOOSMALL; - pj_unicode_to_ansi ( (const wchar_t*) str16.PtrZ(), str16.Length(), - dst, size); + TIp6Addr ip6; + pj_memcpy(ip6.u.iAddr8, src, 16); - return PJ_SUCCESS; + TInetAddr temp_addr(ip6, (TUint)0); + temp_addr.Output(str16); + + pj_unicode_to_ansi((const wchar_t*)str16.PtrZ(), str16.Length(), + dst, size); + return PJ_SUCCESS; } else { - pj_assert (!"Unsupport address family"); - return PJ_EINVAL; + pj_assert(!"Unsupport address family"); + return PJ_EINVAL; } } @@ -460,7 +450,7 @@ PJ_DEF (pj_status_t) pj_inet_ntop (int af, const void *src, /* * Get hostname. */ -PJ_DEF (const pj_str_t*) pj_gethostname (void) +PJ_DEF(const pj_str_t*) pj_gethostname(void) { static char buf[PJ_MAX_HOSTNAME]; static pj_str_t hostname; @@ -468,70 +458,66 @@ PJ_DEF (const pj_str_t*) pj_gethostname (void) PJ_CHECK_STACK(); if (hostname.ptr == NULL) { - RHostResolver &resv = PjSymbianOS::Instance()->GetResolver (PJ_AF_INET); - TRequestStatus reqStatus; - THostName tmpName; + RHostResolver &resv = PjSymbianOS::Instance()->GetResolver(PJ_AF_INET); + TRequestStatus reqStatus; + THostName tmpName; - // Return empty hostname if access point is marked as down by app. - PJ_SYMBIAN_CHECK_CONNECTION2 (&hostname); + // Return empty hostname if access point is marked as down by app. + PJ_SYMBIAN_CHECK_CONNECTION2(&hostname); - resv.GetHostName (tmpName, reqStatus); - User::WaitForRequest (reqStatus); + resv.GetHostName(tmpName, reqStatus); + User::WaitForRequest(reqStatus); - hostname.ptr = pj_unicode_to_ansi ( (const wchar_t*) tmpName.Ptr(), tmpName.Length(), - buf, sizeof (buf)); - hostname.slen = tmpName.Length(); + hostname.ptr = pj_unicode_to_ansi((const wchar_t*)tmpName.Ptr(), tmpName.Length(), + buf, sizeof(buf)); + hostname.slen = tmpName.Length(); } - return &hostname; } /* * Create new socket/endpoint for communication and returns a descriptor. */ -PJ_DEF (pj_status_t) pj_sock_socket (int af, - int type, - int proto, - pj_sock_t *p_sock) +PJ_DEF(pj_status_t) pj_sock_socket(int af, + int type, + int proto, + pj_sock_t *p_sock) { TInt rc; PJ_CHECK_STACK(); /* Sanity checks. */ - PJ_ASSERT_RETURN (p_sock!=NULL, PJ_EINVAL); + PJ_ASSERT_RETURN(p_sock!=NULL, PJ_EINVAL); // Return failure if access point is marked as down by app. PJ_SYMBIAN_CHECK_CONNECTION(); - + /* Set proto if none is specified. */ - if (proto == 0) { - if (type == pj_SOCK_STREAM()) - proto = KProtocolInetTcp; - else if (type == pj_SOCK_DGRAM()) - proto = KProtocolInetUdp; + if (type == pj_SOCK_STREAM()) + proto = KProtocolInetTcp; + else if (type == pj_SOCK_DGRAM()) + proto = KProtocolInetUdp; } /* Create Symbian RSocket */ RSocket rSock; - if (PjSymbianOS::Instance()->Connection()) - rc = rSock.Open (PjSymbianOS::Instance()->SocketServ(), - af, type, proto, - *PjSymbianOS::Instance()->Connection()); + rc = rSock.Open(PjSymbianOS::Instance()->SocketServ(), + af, type, proto, + *PjSymbianOS::Instance()->Connection()); else - rc = rSock.Open (PjSymbianOS::Instance()->SocketServ(), - af, type, proto); - + rc = rSock.Open(PjSymbianOS::Instance()->SocketServ(), + af, type, proto); + if (rc != KErrNone) - return PJ_RETURN_OS_ERROR (rc); + return PJ_RETURN_OS_ERROR(rc); /* Wrap Symbian RSocket into PJLIB's CPjSocket, and return to caller */ - CPjSocket *pjSock = new CPjSocket (af, type, rSock); - - *p_sock = (pj_sock_t) pjSock; + CPjSocket *pjSock = new CPjSocket(af, type, rSock); + *p_sock = (pj_sock_t)pjSock; return PJ_SUCCESS; } @@ -540,65 +526,64 @@ PJ_DEF (pj_status_t) pj_sock_socket (int af, /* * Bind socket. */ -PJ_DEF (pj_status_t) pj_sock_bind (pj_sock_t sock, - const pj_sockaddr_t *addr, - int len) +PJ_DEF(pj_status_t) pj_sock_bind( pj_sock_t sock, + const pj_sockaddr_t *addr, + int len) { pj_status_t status; TInt rc; PJ_CHECK_STACK(); - PJ_ASSERT_RETURN (sock != 0, PJ_EINVAL); - PJ_ASSERT_RETURN (addr && len>= (int) sizeof (pj_sockaddr_in), PJ_EINVAL); + PJ_ASSERT_RETURN(sock != 0, PJ_EINVAL); + PJ_ASSERT_RETURN(addr && len>=(int)sizeof(pj_sockaddr_in), PJ_EINVAL); // Convert PJLIB's pj_sockaddr into Symbian's TInetAddr TInetAddr inetAddr; - status = PjSymbianOS::pj2Addr (* (pj_sockaddr*) addr, len, inetAddr); - + status = PjSymbianOS::pj2Addr(*(pj_sockaddr*)addr, len, inetAddr); if (status != PJ_SUCCESS) - return status; + return status; // Get the RSocket instance - RSocket &rSock = ( (CPjSocket*) sock)->Socket(); + RSocket &rSock = ((CPjSocket*)sock)->Socket(); // Bind - rc = rSock.Bind (inetAddr); + rc = rSock.Bind(inetAddr); - return (rc==KErrNone) ? PJ_SUCCESS : PJ_RETURN_OS_ERROR (rc); + return (rc==KErrNone) ? PJ_SUCCESS : PJ_RETURN_OS_ERROR(rc); } /* * Bind socket. */ -PJ_DEF (pj_status_t) pj_sock_bind_in (pj_sock_t sock, - pj_uint32_t addr32, - pj_uint16_t port) +PJ_DEF(pj_status_t) pj_sock_bind_in( pj_sock_t sock, + pj_uint32_t addr32, + pj_uint16_t port) { pj_sockaddr_in addr; PJ_CHECK_STACK(); - pj_bzero (&addr, sizeof (addr)); + pj_bzero(&addr, sizeof(addr)); addr.sin_family = PJ_AF_INET; - addr.sin_addr.s_addr = pj_htonl (addr32); - addr.sin_port = pj_htons (port); + addr.sin_addr.s_addr = pj_htonl(addr32); + addr.sin_port = pj_htons(port); - return pj_sock_bind (sock, &addr, sizeof (pj_sockaddr_in)); + return pj_sock_bind(sock, &addr, sizeof(pj_sockaddr_in)); } /* * Close socket. */ -PJ_DEF (pj_status_t) pj_sock_close (pj_sock_t sock) +PJ_DEF(pj_status_t) pj_sock_close(pj_sock_t sock) { PJ_CHECK_STACK(); - PJ_ASSERT_RETURN (sock != 0, PJ_EINVAL); + PJ_ASSERT_RETURN(sock != 0, PJ_EINVAL); - CPjSocket *pjSock = (CPjSocket*) sock; + CPjSocket *pjSock = (CPjSocket*)sock; // This will close the socket. delete pjSock; @@ -609,334 +594,325 @@ PJ_DEF (pj_status_t) pj_sock_close (pj_sock_t sock) /* * Get remote's name. */ -PJ_DEF (pj_status_t) pj_sock_getpeername (pj_sock_t sock, - pj_sockaddr_t *addr, - int *namelen) +PJ_DEF(pj_status_t) pj_sock_getpeername( pj_sock_t sock, + pj_sockaddr_t *addr, + int *namelen) { PJ_CHECK_STACK(); + + PJ_ASSERT_RETURN(sock && addr && namelen && + *namelen>=(int)sizeof(pj_sockaddr_in), PJ_EINVAL); - PJ_ASSERT_RETURN (sock && addr && namelen && - *namelen>= (int) sizeof (pj_sockaddr_in), PJ_EINVAL); - - CPjSocket *pjSock = (CPjSocket*) sock; + CPjSocket *pjSock = (CPjSocket*)sock; RSocket &rSock = pjSock->Socket(); // Socket must be connected. - PJ_ASSERT_RETURN (pjSock->IsConnected(), PJ_EINVALIDOP); + PJ_ASSERT_RETURN(pjSock->IsConnected(), PJ_EINVALIDOP); TInetAddr inetAddr; - rSock.RemoteName (inetAddr); + rSock.RemoteName(inetAddr); - return PjSymbianOS::Addr2pj (inetAddr, * (pj_sockaddr*) addr, namelen); + return PjSymbianOS::Addr2pj(inetAddr, *(pj_sockaddr*)addr, namelen); } /* * Get socket name. */ -PJ_DEF (pj_status_t) pj_sock_getsockname (pj_sock_t sock, - pj_sockaddr_t *addr, - int *namelen) +PJ_DEF(pj_status_t) pj_sock_getsockname( pj_sock_t sock, + pj_sockaddr_t *addr, + int *namelen) { PJ_CHECK_STACK(); + + PJ_ASSERT_RETURN(sock && addr && namelen && + *namelen>=(int)sizeof(pj_sockaddr_in), PJ_EINVAL); - PJ_ASSERT_RETURN (sock && addr && namelen && - *namelen>= (int) sizeof (pj_sockaddr_in), PJ_EINVAL); - - CPjSocket *pjSock = (CPjSocket*) sock; + CPjSocket *pjSock = (CPjSocket*)sock; RSocket &rSock = pjSock->Socket(); TInetAddr inetAddr; - rSock.LocalName (inetAddr); + rSock.LocalName(inetAddr); - return PjSymbianOS::Addr2pj (inetAddr, * (pj_sockaddr*) addr, namelen); + return PjSymbianOS::Addr2pj(inetAddr, *(pj_sockaddr*)addr, namelen); } /* * Send data */ -PJ_DEF (pj_status_t) pj_sock_send (pj_sock_t sock, - const void *buf, - pj_ssize_t *len, - unsigned flags) +PJ_DEF(pj_status_t) pj_sock_send(pj_sock_t sock, + const void *buf, + pj_ssize_t *len, + unsigned flags) { PJ_CHECK_STACK(); - PJ_ASSERT_RETURN (sock && buf && len, PJ_EINVAL); + PJ_ASSERT_RETURN(sock && buf && len, PJ_EINVAL); // Return failure if access point is marked as down by app. PJ_SYMBIAN_CHECK_CONNECTION(); - - CPjSocket *pjSock = (CPjSocket*) sock; + + CPjSocket *pjSock = (CPjSocket*)sock; RSocket &rSock = pjSock->Socket(); // send() should only be called to connected socket - PJ_ASSERT_RETURN (pjSock->IsConnected(), PJ_EINVALIDOP); + PJ_ASSERT_RETURN(pjSock->IsConnected(), PJ_EINVALIDOP); - TPtrC8 data ( (const TUint8*) buf, (TInt) *len); + TPtrC8 data((const TUint8*)buf, (TInt)*len); TRequestStatus reqStatus; TSockXfrLength sentLen; - rSock.Send (data, flags, reqStatus, sentLen); - User::WaitForRequest (reqStatus); + rSock.Send(data, flags, reqStatus, sentLen); + User::WaitForRequest(reqStatus); - if (reqStatus.Int() ==KErrNone) { - //*len = (TInt) sentLen.Length(); - return PJ_SUCCESS; + if (reqStatus.Int()==KErrNone) { + //*len = (TInt) sentLen.Length(); + return PJ_SUCCESS; } else - return PJ_RETURN_OS_ERROR (reqStatus.Int()); + return PJ_RETURN_OS_ERROR(reqStatus.Int()); } /* * Send data. */ -PJ_DEF (pj_status_t) pj_sock_sendto (pj_sock_t sock, - const void *buf, - pj_ssize_t *len, - unsigned flags, - const pj_sockaddr_t *to, - int tolen) +PJ_DEF(pj_status_t) pj_sock_sendto(pj_sock_t sock, + const void *buf, + pj_ssize_t *len, + unsigned flags, + const pj_sockaddr_t *to, + int tolen) { pj_status_t status; - + PJ_CHECK_STACK(); - PJ_ASSERT_RETURN (sock && buf && len, PJ_EINVAL); + PJ_ASSERT_RETURN(sock && buf && len, PJ_EINVAL); // Return failure if access point is marked as down by app. PJ_SYMBIAN_CHECK_CONNECTION(); - - CPjSocket *pjSock = (CPjSocket*) sock; + + CPjSocket *pjSock = (CPjSocket*)sock; RSocket &rSock = pjSock->Socket(); // Only supports AF_INET for now - PJ_ASSERT_RETURN (tolen>= (int) sizeof (pj_sockaddr_in), PJ_EINVAL); + PJ_ASSERT_RETURN(tolen>=(int)sizeof(pj_sockaddr_in), PJ_EINVAL); TInetAddr inetAddr; - status = PjSymbianOS::pj2Addr (* (pj_sockaddr*) to, tolen, inetAddr); - + status = PjSymbianOS::pj2Addr(*(pj_sockaddr*)to, tolen, inetAddr); if (status != PJ_SUCCESS) - return status; - - TPtrC8 data ( (const TUint8*) buf, (TInt) *len); + return status; + TPtrC8 data((const TUint8*)buf, (TInt)*len); TRequestStatus reqStatus; - TSockXfrLength sentLen; - rSock.SendTo (data, inetAddr, flags, reqStatus, sentLen); - - User::WaitForRequest (reqStatus); + rSock.SendTo(data, inetAddr, flags, reqStatus, sentLen); + User::WaitForRequest(reqStatus); - if (reqStatus.Int() ==KErrNone) { - //For some reason TSockXfrLength is not returning correctly! - //*len = (TInt) sentLen.Length(); - return PJ_SUCCESS; - } else - return PJ_RETURN_OS_ERROR (reqStatus.Int()); + if (reqStatus.Int()==KErrNone) { + //For some reason TSockXfrLength is not returning correctly! + //*len = (TInt) sentLen.Length(); + return PJ_SUCCESS; + } else + return PJ_RETURN_OS_ERROR(reqStatus.Int()); } /* * Receive data. */ -PJ_DEF (pj_status_t) pj_sock_recv (pj_sock_t sock, - void *buf, - pj_ssize_t *len, - unsigned flags) +PJ_DEF(pj_status_t) pj_sock_recv(pj_sock_t sock, + void *buf, + pj_ssize_t *len, + unsigned flags) { PJ_CHECK_STACK(); - PJ_ASSERT_RETURN (sock && buf && len, PJ_EINVAL); - PJ_ASSERT_RETURN (*len > 0, PJ_EINVAL); + PJ_ASSERT_RETURN(sock && buf && len, PJ_EINVAL); + PJ_ASSERT_RETURN(*len > 0, PJ_EINVAL); // Return failure if access point is marked as down by app. PJ_SYMBIAN_CHECK_CONNECTION(); - CPjSocket *pjSock = (CPjSocket*) sock; + CPjSocket *pjSock = (CPjSocket*)sock; if (pjSock->Reader()) { - CPjSocketReader *reader = pjSock->Reader(); + CPjSocketReader *reader = pjSock->Reader(); - while (reader->IsActive() && !reader->HasData()) { - User::WaitForAnyRequest(); - } + while (reader->IsActive() && !reader->HasData()) { + User::WaitForAnyRequest(); + } - if (reader->HasData()) { - TPtr8 data ( (TUint8*) buf, (TInt) *len); - TInetAddr inetAddr; + if (reader->HasData()) { + TPtr8 data((TUint8*)buf, (TInt)*len); + TInetAddr inetAddr; - reader->ReadData (data, &inetAddr); + reader->ReadData(data, &inetAddr); - *len = data.Length(); - return PJ_SUCCESS; - } + *len = data.Length(); + return PJ_SUCCESS; + } } TRequestStatus reqStatus; - TSockXfrLength recvLen; - TPtr8 data ( (TUint8*) buf, (TInt) *len, (TInt) *len); + TPtr8 data((TUint8*)buf, (TInt)*len, (TInt)*len); if (pjSock->IsDatagram()) { - pjSock->Socket().Recv (data, flags, reqStatus); + pjSock->Socket().Recv(data, flags, reqStatus); } else { - // Using static like this is not pretty, but we don't need to use - // the value anyway, hence doing it like this is probably most - // optimal. - static TSockXfrLength len; - pjSock->Socket().RecvOneOrMore (data, flags, reqStatus, len); + // Using static like this is not pretty, but we don't need to use + // the value anyway, hence doing it like this is probably most + // optimal. + static TSockXfrLength len; + pjSock->Socket().RecvOneOrMore(data, flags, reqStatus, len); } - - User::WaitForRequest (reqStatus); + User::WaitForRequest(reqStatus); if (reqStatus == KErrNone) { - //*len = (TInt)recvLen.Length(); - *len = data.Length(); - return PJ_SUCCESS; + //*len = (TInt)recvLen.Length(); + *len = data.Length(); + return PJ_SUCCESS; } else { - *len = -1; - return PJ_RETURN_OS_ERROR (reqStatus.Int()); + *len = -1; + return PJ_RETURN_OS_ERROR(reqStatus.Int()); } } /* * Receive data. */ -PJ_DEF (pj_status_t) pj_sock_recvfrom (pj_sock_t sock, - void *buf, - pj_ssize_t *len, - unsigned flags, - pj_sockaddr_t *from, - int *fromlen) +PJ_DEF(pj_status_t) pj_sock_recvfrom(pj_sock_t sock, + void *buf, + pj_ssize_t *len, + unsigned flags, + pj_sockaddr_t *from, + int *fromlen) { PJ_CHECK_STACK(); - PJ_ASSERT_RETURN (sock && buf && len && from && fromlen, PJ_EINVAL); - PJ_ASSERT_RETURN (*len > 0, PJ_EINVAL); - PJ_ASSERT_RETURN (*fromlen >= (int) sizeof (pj_sockaddr_in), PJ_EINVAL); + PJ_ASSERT_RETURN(sock && buf && len && from && fromlen, PJ_EINVAL); + PJ_ASSERT_RETURN(*len > 0, PJ_EINVAL); + PJ_ASSERT_RETURN(*fromlen >= (int)sizeof(pj_sockaddr_in), PJ_EINVAL); // Return failure if access point is marked as down by app. PJ_SYMBIAN_CHECK_CONNECTION(); - CPjSocket *pjSock = (CPjSocket*) sock; + CPjSocket *pjSock = (CPjSocket*)sock; RSocket &rSock = pjSock->Socket(); if (pjSock->Reader()) { - CPjSocketReader *reader = pjSock->Reader(); + CPjSocketReader *reader = pjSock->Reader(); - while (reader->IsActive() && !reader->HasData()) { - User::WaitForAnyRequest(); - } + while (reader->IsActive() && !reader->HasData()) { + User::WaitForAnyRequest(); + } - if (reader->HasData()) { - TPtr8 data ( (TUint8*) buf, (TInt) *len); - TInetAddr inetAddr; + if (reader->HasData()) { + TPtr8 data((TUint8*)buf, (TInt)*len); + TInetAddr inetAddr; - reader->ReadData (data, &inetAddr); + reader->ReadData(data, &inetAddr); - *len = data.Length(); + *len = data.Length(); - if (from && fromlen) { - return PjSymbianOS::Addr2pj (inetAddr, * (pj_sockaddr*) from, - fromlen); - } else { - return PJ_SUCCESS; - } - } + if (from && fromlen) { + return PjSymbianOS::Addr2pj(inetAddr, *(pj_sockaddr*)from, + fromlen); + } else { + return PJ_SUCCESS; + } + } } TInetAddr inetAddr; - TRequestStatus reqStatus; TSockXfrLength recvLen; - TPtr8 data ( (TUint8*) buf, (TInt) *len, (TInt) *len); + TPtr8 data((TUint8*)buf, (TInt)*len, (TInt)*len); - rSock.RecvFrom (data, inetAddr, flags, reqStatus, recvLen); - User::WaitForRequest (reqStatus); + rSock.RecvFrom(data, inetAddr, flags, reqStatus, recvLen); + User::WaitForRequest(reqStatus); if (reqStatus == KErrNone) { - //*len = (TInt)recvLen.Length(); - *len = data.Length(); - return PjSymbianOS::Addr2pj (inetAddr, * (pj_sockaddr*) from, fromlen); + //*len = (TInt)recvLen.Length(); + *len = data.Length(); + return PjSymbianOS::Addr2pj(inetAddr, *(pj_sockaddr*)from, fromlen); } else { - *len = -1; - *fromlen = -1; - return PJ_RETURN_OS_ERROR (reqStatus.Int()); + *len = -1; + *fromlen = -1; + return PJ_RETURN_OS_ERROR(reqStatus.Int()); } } /* * Get socket option. */ -PJ_DEF (pj_status_t) pj_sock_getsockopt (pj_sock_t sock, - pj_uint16_t level, - pj_uint16_t optname, - void *optval, - int *optlen) +PJ_DEF(pj_status_t) pj_sock_getsockopt( pj_sock_t sock, + pj_uint16_t level, + pj_uint16_t optname, + void *optval, + int *optlen) { // Not supported for now. - PJ_UNUSED_ARG (sock); - PJ_UNUSED_ARG (level); - PJ_UNUSED_ARG (optname); - PJ_UNUSED_ARG (optval); - PJ_UNUSED_ARG (optlen); + PJ_UNUSED_ARG(sock); + PJ_UNUSED_ARG(level); + PJ_UNUSED_ARG(optname); + PJ_UNUSED_ARG(optval); + PJ_UNUSED_ARG(optlen); return PJ_EINVALIDOP; } /* * Set socket option. */ -PJ_DEF (pj_status_t) pj_sock_setsockopt (pj_sock_t sock, - pj_uint16_t level, - pj_uint16_t optname, - const void *optval, - int optlen) +PJ_DEF(pj_status_t) pj_sock_setsockopt( pj_sock_t sock, + pj_uint16_t level, + pj_uint16_t optname, + const void *optval, + int optlen) { // Not supported for now. - PJ_UNUSED_ARG (sock); - PJ_UNUSED_ARG (level); - PJ_UNUSED_ARG (optname); - PJ_UNUSED_ARG (optval); - PJ_UNUSED_ARG (optlen); + PJ_UNUSED_ARG(sock); + PJ_UNUSED_ARG(level); + PJ_UNUSED_ARG(optname); + PJ_UNUSED_ARG(optval); + PJ_UNUSED_ARG(optlen); return PJ_EINVALIDOP; } /* * Connect socket. */ -PJ_DEF (pj_status_t) pj_sock_connect (pj_sock_t sock, - const pj_sockaddr_t *addr, - int namelen) +PJ_DEF(pj_status_t) pj_sock_connect( pj_sock_t sock, + const pj_sockaddr_t *addr, + int namelen) { pj_status_t status; - + PJ_CHECK_STACK(); - PJ_ASSERT_RETURN (sock && addr && namelen, PJ_EINVAL); - PJ_ASSERT_RETURN ( ( (pj_sockaddr*) addr)->addr.sa_family == PJ_AF_INET, - PJ_EINVAL); + PJ_ASSERT_RETURN(sock && addr && namelen, PJ_EINVAL); + PJ_ASSERT_RETURN(((pj_sockaddr*)addr)->addr.sa_family == PJ_AF_INET, + PJ_EINVAL); // Return failure if access point is marked as down by app. PJ_SYMBIAN_CHECK_CONNECTION(); - - CPjSocket *pjSock = (CPjSocket*) sock; + + CPjSocket *pjSock = (CPjSocket*)sock; RSocket &rSock = pjSock->Socket(); TInetAddr inetAddr; TRequestStatus reqStatus; - status = PjSymbianOS::pj2Addr (* (pj_sockaddr*) addr, namelen, inetAddr); - + status = PjSymbianOS::pj2Addr(*(pj_sockaddr*)addr, namelen, inetAddr); if (status != PJ_SUCCESS) - return status; + return status; - rSock.Connect (inetAddr, reqStatus); - - User::WaitForRequest (reqStatus); + rSock.Connect(inetAddr, reqStatus); + User::WaitForRequest(reqStatus); if (reqStatus == KErrNone) { - pjSock->SetConnected (true); - return PJ_SUCCESS; + pjSock->SetConnected(true); + return PJ_SUCCESS; } else { - return PJ_RETURN_OS_ERROR (reqStatus.Int()); + return PJ_RETURN_OS_ERROR(reqStatus.Int()); } } @@ -945,104 +921,100 @@ PJ_DEF (pj_status_t) pj_sock_connect (pj_sock_t sock, * Shutdown socket. */ #if PJ_HAS_TCP -PJ_DEF (pj_status_t) pj_sock_shutdown (pj_sock_t sock, - int how) +PJ_DEF(pj_status_t) pj_sock_shutdown( pj_sock_t sock, + int how) { PJ_CHECK_STACK(); - PJ_ASSERT_RETURN (sock, PJ_EINVAL); + PJ_ASSERT_RETURN(sock, PJ_EINVAL); - CPjSocket *pjSock = (CPjSocket*) sock; + CPjSocket *pjSock = (CPjSocket*)sock; RSocket &rSock = pjSock->Socket(); RSocket::TShutdown aHow; - if (how == PJ_SD_RECEIVE) - aHow = RSocket::EStopInput; + aHow = RSocket::EStopInput; else if (how == PJ_SHUT_WR) - aHow = RSocket::EStopOutput; + aHow = RSocket::EStopOutput; else - aHow = RSocket::ENormal; + aHow = RSocket::ENormal; TRequestStatus reqStatus; - rSock.Shutdown (aHow, reqStatus); - - User::WaitForRequest (reqStatus); + rSock.Shutdown(aHow, reqStatus); + User::WaitForRequest(reqStatus); if (reqStatus == KErrNone) { - return PJ_SUCCESS; + return PJ_SUCCESS; } else { - return PJ_RETURN_OS_ERROR (reqStatus.Int()); + return PJ_RETURN_OS_ERROR(reqStatus.Int()); } } /* * Start listening to incoming connections. */ -PJ_DEF (pj_status_t) pj_sock_listen (pj_sock_t sock, - int backlog) +PJ_DEF(pj_status_t) pj_sock_listen( pj_sock_t sock, + int backlog) { PJ_CHECK_STACK(); - PJ_ASSERT_RETURN (sock && backlog, PJ_EINVAL); + PJ_ASSERT_RETURN(sock && backlog, PJ_EINVAL); - CPjSocket *pjSock = (CPjSocket*) sock; + CPjSocket *pjSock = (CPjSocket*)sock; RSocket &rSock = pjSock->Socket(); - TInt rc = rSock.Listen ( (TUint) backlog); + TInt rc = rSock.Listen((TUint)backlog); if (rc == KErrNone) { - return PJ_SUCCESS; + return PJ_SUCCESS; } else { - return PJ_RETURN_OS_ERROR (rc); + return PJ_RETURN_OS_ERROR(rc); } } /* * Accept incoming connections */ -PJ_DEF (pj_status_t) pj_sock_accept (pj_sock_t serverfd, - pj_sock_t *newsock, - pj_sockaddr_t *addr, - int *addrlen) +PJ_DEF(pj_status_t) pj_sock_accept( pj_sock_t serverfd, + pj_sock_t *newsock, + pj_sockaddr_t *addr, + int *addrlen) { PJ_CHECK_STACK(); - PJ_ASSERT_RETURN (serverfd && newsock, PJ_EINVAL); + PJ_ASSERT_RETURN(serverfd && newsock, PJ_EINVAL); - CPjSocket *pjSock = (CPjSocket*) serverfd; + CPjSocket *pjSock = (CPjSocket*)serverfd; RSocket &rSock = pjSock->Socket(); // Create a 'blank' socket RSocket newSock; - newSock.Open (PjSymbianOS::Instance()->SocketServ()); + newSock.Open(PjSymbianOS::Instance()->SocketServ()); // Call Accept() TRequestStatus reqStatus; - rSock.Accept (newSock, reqStatus); - User::WaitForRequest (reqStatus); + rSock.Accept(newSock, reqStatus); + User::WaitForRequest(reqStatus); if (reqStatus != KErrNone) { - return PJ_RETURN_OS_ERROR (reqStatus.Int()); + return PJ_RETURN_OS_ERROR(reqStatus.Int()); } // Create PJ socket - CPjSocket *newPjSock = new CPjSocket (pjSock->GetAf(), pjSock->GetSockType(), - newSock); - - newPjSock->SetConnected (true); + CPjSocket *newPjSock = new CPjSocket(pjSock->GetAf(), pjSock->GetSockType(), + newSock); + newPjSock->SetConnected(true); *newsock = (pj_sock_t) newPjSock; if (addr && addrlen) { - return pj_sock_getpeername (*newsock, addr, addrlen); + return pj_sock_getpeername(*newsock, addr, addrlen); } return PJ_SUCCESS; } - #endif /* PJ_HAS_TCP */ diff --git a/sflphone-common/libs/pjproject/pjlib/src/pj/ssl_sock_common.c b/sflphone-common/libs/pjproject/pjlib/src/pj/ssl_sock_common.c new file mode 100644 index 0000000000000000000000000000000000000000..8a983fc6f82b028d8efdfff5803c22071d1b7293 --- /dev/null +++ b/sflphone-common/libs/pjproject/pjlib/src/pj/ssl_sock_common.c @@ -0,0 +1,142 @@ +/* $Id: ssl_sock_common.c 2998 2009-11-09 08:51:34Z bennylp $ */ +/* + * Copyright (C) 2009 Teluu Inc. (http://www.teluu.com) + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ +#include <pj/ssl_sock.h> +#include <pj/errno.h> +#include <pj/string.h> + +/* Cipher name structure */ +typedef struct cipher_name_t { + pj_ssl_cipher cipher; + const char *name; +} cipher_name_t; + +/* Cipher name constants */ +static cipher_name_t cipher_names[] = +{ + {TLS_NULL_WITH_NULL_NULL, "NULL"}, + + /* TLS/SSLv3 */ + {TLS_RSA_WITH_NULL_MD5, "TLS_RSA_WITH_NULL_MD5"}, + {TLS_RSA_WITH_NULL_SHA, "TLS_RSA_WITH_NULL_SHA"}, + {TLS_RSA_WITH_NULL_SHA256, "TLS_RSA_WITH_NULL_SHA256"}, + {TLS_RSA_WITH_RC4_128_MD5, "TLS_RSA_WITH_RC4_128_MD5"}, + {TLS_RSA_WITH_RC4_128_SHA, "TLS_RSA_WITH_RC4_128_SHA"}, + {TLS_RSA_WITH_3DES_EDE_CBC_SHA, "TLS_RSA_WITH_3DES_EDE_CBC_SHA"}, + {TLS_RSA_WITH_AES_128_CBC_SHA, "TLS_RSA_WITH_AES_128_CBC_SHA"}, + {TLS_RSA_WITH_AES_256_CBC_SHA, "TLS_RSA_WITH_AES_256_CBC_SHA"}, + {TLS_RSA_WITH_AES_128_CBC_SHA256, "TLS_RSA_WITH_AES_128_CBC_SHA256"}, + {TLS_RSA_WITH_AES_256_CBC_SHA256, "TLS_RSA_WITH_AES_256_CBC_SHA256"}, + {TLS_DH_DSS_WITH_3DES_EDE_CBC_SHA, "TLS_DH_DSS_WITH_3DES_EDE_CBC_SHA"}, + {TLS_DH_RSA_WITH_3DES_EDE_CBC_SHA, "TLS_DH_RSA_WITH_3DES_EDE_CBC_SHA"}, + {TLS_DHE_DSS_WITH_3DES_EDE_CBC_SHA, "TLS_DHE_DSS_WITH_3DES_EDE_CBC_SHA"}, + {TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA, "TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA"}, + {TLS_DH_DSS_WITH_AES_128_CBC_SHA, "TLS_DH_DSS_WITH_AES_128_CBC_SHA"}, + {TLS_DH_RSA_WITH_AES_128_CBC_SHA, "TLS_DH_RSA_WITH_AES_128_CBC_SHA"}, + {TLS_DHE_DSS_WITH_AES_128_CBC_SHA, "TLS_DHE_DSS_WITH_AES_128_CBC_SHA"}, + {TLS_DHE_RSA_WITH_AES_128_CBC_SHA, "TLS_DHE_RSA_WITH_AES_128_CBC_SHA"}, + {TLS_DH_DSS_WITH_AES_256_CBC_SHA, "TLS_DH_DSS_WITH_AES_256_CBC_SHA"}, + {TLS_DH_RSA_WITH_AES_256_CBC_SHA, "TLS_DH_RSA_WITH_AES_256_CBC_SHA"}, + {TLS_DHE_DSS_WITH_AES_256_CBC_SHA, "TLS_DHE_DSS_WITH_AES_256_CBC_SHA"}, + {TLS_DHE_RSA_WITH_AES_256_CBC_SHA, "TLS_DHE_RSA_WITH_AES_256_CBC_SHA"}, + {TLS_DH_DSS_WITH_AES_128_CBC_SHA256, "TLS_DH_DSS_WITH_AES_128_CBC_SHA256"}, + {TLS_DH_RSA_WITH_AES_128_CBC_SHA256, "TLS_DH_RSA_WITH_AES_128_CBC_SHA256"}, + {TLS_DHE_DSS_WITH_AES_128_CBC_SHA256, "TLS_DHE_DSS_WITH_AES_128_CBC_SHA256"}, + {TLS_DHE_RSA_WITH_AES_128_CBC_SHA256, "TLS_DHE_RSA_WITH_AES_128_CBC_SHA256"}, + {TLS_DH_DSS_WITH_AES_256_CBC_SHA256, "TLS_DH_DSS_WITH_AES_256_CBC_SHA256"}, + {TLS_DH_RSA_WITH_AES_256_CBC_SHA256, "TLS_DH_RSA_WITH_AES_256_CBC_SHA256"}, + {TLS_DHE_DSS_WITH_AES_256_CBC_SHA256, "TLS_DHE_DSS_WITH_AES_256_CBC_SHA256"}, + {TLS_DHE_RSA_WITH_AES_256_CBC_SHA256, "TLS_DHE_RSA_WITH_AES_256_CBC_SHA256"}, + {TLS_DH_anon_WITH_RC4_128_MD5, "TLS_DH_anon_WITH_RC4_128_MD5"}, + {TLS_DH_anon_WITH_3DES_EDE_CBC_SHA, "TLS_DH_anon_WITH_3DES_EDE_CBC_SHA"}, + {TLS_DH_anon_WITH_AES_128_CBC_SHA, "TLS_DH_anon_WITH_AES_128_CBC_SHA"}, + {TLS_DH_anon_WITH_AES_256_CBC_SHA, "TLS_DH_anon_WITH_AES_256_CBC_SHA"}, + {TLS_DH_anon_WITH_AES_128_CBC_SHA256, "TLS_DH_anon_WITH_AES_128_CBC_SHA256"}, + {TLS_DH_anon_WITH_AES_256_CBC_SHA256, "TLS_DH_anon_WITH_AES_256_CBC_SHA256"}, + + /* TLS (deprecated) */ + {TLS_RSA_EXPORT_WITH_RC4_40_MD5, "TLS_RSA_EXPORT_WITH_RC4_40_MD5"}, + {TLS_RSA_EXPORT_WITH_RC2_CBC_40_MD5, "TLS_RSA_EXPORT_WITH_RC2_CBC_40_MD5"}, + {TLS_RSA_WITH_IDEA_CBC_SHA, "TLS_RSA_WITH_IDEA_CBC_SHA"}, + {TLS_RSA_EXPORT_WITH_DES40_CBC_SHA, "TLS_RSA_EXPORT_WITH_DES40_CBC_SHA"}, + {TLS_RSA_WITH_DES_CBC_SHA, "TLS_RSA_WITH_DES_CBC_SHA"}, + {TLS_DH_DSS_EXPORT_WITH_DES40_CBC_SHA, "TLS_DH_DSS_EXPORT_WITH_DES40_CBC_SHA"}, + {TLS_DH_DSS_WITH_DES_CBC_SHA, "TLS_DH_DSS_WITH_DES_CBC_SHA"}, + {TLS_DH_RSA_EXPORT_WITH_DES40_CBC_SHA, "TLS_DH_RSA_EXPORT_WITH_DES40_CBC_SHA"}, + {TLS_DH_RSA_WITH_DES_CBC_SHA, "TLS_DH_RSA_WITH_DES_CBC_SHA"}, + {TLS_DHE_DSS_EXPORT_WITH_DES40_CBC_SHA, "TLS_DHE_DSS_EXPORT_WITH_DES40_CBC_SHA"}, + {TLS_DHE_DSS_WITH_DES_CBC_SHA, "TLS_DHE_DSS_WITH_DES_CBC_SHA"}, + {TLS_DHE_RSA_EXPORT_WITH_DES40_CBC_SHA, "TLS_DHE_RSA_EXPORT_WITH_DES40_CBC_SHA"}, + {TLS_DHE_RSA_WITH_DES_CBC_SHA, "TLS_DHE_RSA_WITH_DES_CBC_SHA"}, + {TLS_DH_anon_EXPORT_WITH_RC4_40_MD5, "TLS_DH_anon_EXPORT_WITH_RC4_40_MD5"}, + {TLS_DH_anon_EXPORT_WITH_DES40_CBC_SHA, "TLS_DH_anon_EXPORT_WITH_DES40_CBC_SHA"}, + {TLS_DH_anon_WITH_DES_CBC_SHA, "TLS_DH_anon_WITH_DES_CBC_SHA"}, + + /* SSLv3 */ + {SSL_FORTEZZA_KEA_WITH_NULL_SHA, "SSL_FORTEZZA_KEA_WITH_NULL_SHA"}, + {SSL_FORTEZZA_KEA_WITH_FORTEZZA_CBC_SHA,"SSL_FORTEZZA_KEA_WITH_FORTEZZA_CBC_SHA"}, + {SSL_FORTEZZA_KEA_WITH_RC4_128_SHA, "SSL_FORTEZZA_KEA_WITH_RC4_128_SHA"}, + + /* SSLv2 */ + {SSL_CK_RC4_128_WITH_MD5, "SSL_CK_RC4_128_WITH_MD5"}, + {SSL_CK_RC4_128_EXPORT40_WITH_MD5, "SSL_CK_RC4_128_EXPORT40_WITH_MD5"}, + {SSL_CK_RC2_128_CBC_WITH_MD5, "SSL_CK_RC2_128_CBC_WITH_MD5"}, + {SSL_CK_RC2_128_CBC_EXPORT40_WITH_MD5, "SSL_CK_RC2_128_CBC_EXPORT40_WITH_MD5"}, + {SSL_CK_IDEA_128_CBC_WITH_MD5, "SSL_CK_IDEA_128_CBC_WITH_MD5"}, + {SSL_CK_DES_64_CBC_WITH_MD5, "SSL_CK_DES_64_CBC_WITH_MD5"}, + {SSL_CK_DES_192_EDE3_CBC_WITH_MD5, "SSL_CK_DES_192_EDE3_CBC_WITH_MD5"} +}; + + +/* + * Initialize the SSL socket configuration with the default values. + */ +PJ_DEF(void) pj_ssl_sock_param_default(pj_ssl_sock_param *param) +{ + pj_bzero(param, sizeof(*param)); + + /* Socket config */ + param->sock_af = PJ_AF_INET; + param->sock_type = pj_SOCK_STREAM(); + param->async_cnt = 1; + param->concurrency = -1; + param->whole_data = PJ_TRUE; + param->send_buffer_size = 8192; +#if !defined(PJ_SYMBIAN) || PJ_SYMBIAN==0 + param->read_buffer_size = 1500; +#endif + param->qos_type = PJ_QOS_TYPE_BEST_EFFORT; + param->qos_ignore_error = PJ_TRUE; + + /* Security config */ + param->proto = PJ_SSL_SOCK_PROTO_DEFAULT; +} + + +PJ_DEF(const char*) pj_ssl_cipher_name(pj_ssl_cipher cipher) +{ + unsigned i, n; + + n = PJ_ARRAY_SIZE(cipher_names); + for (i = 0; i < n; ++i) { + if (cipher == cipher_names[i].cipher) + return cipher_names[i].name; + } + + return NULL; +} diff --git a/sflphone-common/libs/pjproject/pjlib/src/pj/ssl_sock_ossl.c b/sflphone-common/libs/pjproject/pjlib/src/pj/ssl_sock_ossl.c new file mode 100644 index 0000000000000000000000000000000000000000..d97305a20dc10640d112d05b0f127be57b0ff796 --- /dev/null +++ b/sflphone-common/libs/pjproject/pjlib/src/pj/ssl_sock_ossl.c @@ -0,0 +1,2137 @@ +/* $Id: ssl_sock_ossl.c 3020 2009-11-20 07:48:41Z nanang $ */ +/* + * Copyright (C) 2009 Teluu Inc. (http://www.teluu.com) + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ +#include <pj/ssl_sock.h> +#include <pj/activesock.h> +#include <pj/compat/socket.h> +#include <pj/assert.h> +#include <pj/errno.h> +#include <pj/list.h> +#include <pj/lock.h> +#include <pj/log.h> +#include <pj/math.h> +#include <pj/os.h> +#include <pj/pool.h> +#include <pj/string.h> +#include <pj/timer.h> + + +/* Only build when PJ_HAS_SSL_SOCK is enabled */ +#if defined(PJ_HAS_SSL_SOCK) && PJ_HAS_SSL_SOCK!=0 + +#define THIS_FILE "ssl_sock_ossl.c" + +/* Workaround for ticket #985 */ +#define DELAYED_CLOSE_TIMEOUT 200 + +/* + * Include OpenSSL headers + */ +#include <openssl/bio.h> +#include <openssl/ssl.h> +#include <openssl/err.h> + + +#ifdef _MSC_VER +# ifdef _DEBUG +# pragma comment( lib, "libeay32MTd") +# pragma comment( lib, "ssleay32MTd") +#else +# pragma comment( lib, "libeay32MT") +# pragma comment( lib, "ssleay32MT") +# endif +#endif + + +/* + * SSL/TLS state enumeration. + */ +enum ssl_state { + SSL_STATE_NULL, + SSL_STATE_HANDSHAKING, + SSL_STATE_ESTABLISHED +}; + +/* + * Internal timer types. + */ +enum timer_id +{ + TIMER_NONE, + TIMER_HANDSHAKE_TIMEOUT, + TIMER_CLOSE +}; + +/* + * Structure of SSL socket read buffer. + */ +typedef struct read_data_t +{ + void *data; + pj_size_t len; +} read_data_t; + +/* + * Get the offset of pointer to read-buffer of SSL socket from read-buffer + * of active socket. Note that both SSL socket and active socket employ + * different but correlated read-buffers (as much as async_cnt for each), + * and to make it easier/faster to find corresponding SSL socket's read-buffer + * from known active socket's read-buffer, the pointer of corresponding + * SSL socket's read-buffer is stored right after the end of active socket's + * read-buffer. + */ +#define OFFSET_OF_READ_DATA_PTR(ssock, asock_rbuf) \ + (read_data_t**) \ + ((pj_int8_t*)(asock_rbuf) + \ + ssock->param.read_buffer_size) + +/* + * Structure of SSL socket write buffer. + */ +typedef struct write_data_t { + pj_ioqueue_op_key_t key; + pj_size_t record_len; + pj_ioqueue_op_key_t *app_key; + pj_size_t plain_data_len; + pj_size_t data_len; + union { + char content[1]; + const char *ptr; + } data; + unsigned flags; +} write_data_t; + +/* + * Structure of SSL socket write state. + */ +typedef struct write_state_t { + char *buf; + pj_size_t max_len; + char *start; + pj_size_t len; + write_data_t *last_data; +} write_state_t; + +/* + * Structure of write data pending. + */ +typedef struct write_pending_t { + PJ_DECL_LIST_MEMBER(struct write_pending_t); + write_data_t data; +} write_pending_t; + +/* + * Secure socket structure definition. + */ +struct pj_ssl_sock_t +{ + pj_pool_t *pool; + pj_ssl_sock_t *parent; + pj_ssl_sock_param param; + pj_ssl_cert_t *cert; + + pj_ssl_cert_info local_cert_info; + pj_ssl_cert_info remote_cert_info; + + pj_bool_t is_server; + enum ssl_state ssl_state; + pj_ioqueue_op_key_t handshake_op_key; + pj_timer_entry timer; + + pj_sock_t sock; + pj_activesock_t *asock; + + pj_sockaddr local_addr; + pj_sockaddr rem_addr; + int addr_len; + + pj_bool_t read_started; + pj_size_t read_size; + pj_uint32_t read_flags; + void **asock_rbuf; + read_data_t *ssock_rbuf; + + write_state_t write_state; + write_pending_t write_pending; + write_pending_t write_pending_empty; + pj_lock_t *write_mutex; /* protect write BIO and write_state */ + + SSL_CTX *ossl_ctx; + SSL *ossl_ssl; + BIO *ossl_rbio; + BIO *ossl_wbio; +}; + + +/* + * Certificate/credential structure definition. + */ +struct pj_ssl_cert_t +{ + pj_str_t CA_file; + pj_str_t cert_file; + pj_str_t privkey_file; + pj_str_t privkey_pass; +}; + + +static pj_status_t flush_delayed_send(pj_ssl_sock_t *ssock); + +/* + ******************************************************************* + * Static/internal functions. + ******************************************************************* + */ + +/** + * Mapping from OpenSSL error codes to pjlib error space. + */ + +#define PJ_SSL_ERRNO_START (PJ_ERRNO_START_USER + \ + PJ_ERRNO_SPACE_SIZE*6) + +#define PJ_SSL_ERRNO_SPACE_SIZE PJ_ERRNO_SPACE_SIZE + +#define GET_SSL_STATUS(status) { \ + unsigned long e = ERR_get_error();\ + status = ERR_GET_LIB(e)*300 + ERR_GET_REASON(e);\ + pj_assert(status < PJ_SSL_ERRNO_SPACE_SIZE);\ + if (status) status += PJ_SSL_ERRNO_START;\ +} + +/* + * Get error string of OpenSSL. + */ +static pj_str_t ssl_strerror(pj_status_t status, + char *buf, pj_size_t bufsize) +{ + pj_str_t errstr; + unsigned long ssl_err = status; + + if (ssl_err) { + unsigned long l, r; + ssl_err -= PJ_SSL_ERRNO_START; + l = ssl_err/300; + r = ssl_err%300; + ssl_err = ERR_PACK(l, 0, r); + } + +#if defined(PJ_HAS_ERROR_STRING) && (PJ_HAS_ERROR_STRING != 0) + + { + const char *tmp = NULL; + tmp = ERR_reason_error_string(ssl_err); + + if (tmp) { + pj_ansi_strncpy(buf, tmp, bufsize); + errstr = pj_str(buf); + return errstr; + } + } + +#endif /* PJ_HAS_ERROR_STRING */ + + errstr.ptr = buf; + errstr.slen = pj_ansi_snprintf(buf, bufsize, + "Unknown OpenSSL error %lu", + ssl_err); + + return errstr; +} + + +/* OpenSSL library initialization counter */ +static int openssl_init_count; +static int openssl_reg_strerr; + +/* OpenSSL available ciphers */ +static pj_ssl_cipher openssl_ciphers[100]; +static unsigned openssl_cipher_num; + + +/* Initialize OpenSSL */ +static pj_status_t init_openssl(void) +{ + if (openssl_init_count) + return PJ_SUCCESS; + + openssl_init_count = 1; + + /* Register error subsystem */ + if (!openssl_reg_strerr) { + pj_status_t status; + + openssl_reg_strerr = 1; + status = pj_register_strerror(PJ_SSL_ERRNO_START, + PJ_SSL_ERRNO_SPACE_SIZE, + &ssl_strerror); + pj_assert(status == PJ_SUCCESS); + } + + /* Init OpenSSL lib */ + SSL_library_init(); + SSL_load_error_strings(); + OpenSSL_add_all_algorithms(); + + /* Init available ciphers */ + if (openssl_cipher_num == 0) { + SSL_METHOD *meth = NULL; + SSL_CTX *ctx; + SSL *ssl; + STACK_OF(SSL_CIPHER) *sk_cipher; + unsigned i, n; + + meth = (SSL_METHOD*)SSLv23_server_method(); + if (!meth) + meth = (SSL_METHOD*)TLSv1_server_method(); + if (!meth) + meth = (SSL_METHOD*)SSLv3_server_method(); + if (!meth) + meth = (SSL_METHOD*)SSLv2_server_method(); + pj_assert(meth); + + ctx=SSL_CTX_new(meth); + SSL_CTX_set_cipher_list(ctx, "ALL"); + + ssl = SSL_new(ctx); + sk_cipher = SSL_get_ciphers(ssl); + + n = sk_SSL_CIPHER_num(sk_cipher); + if (n > PJ_ARRAY_SIZE(openssl_ciphers)) + n = PJ_ARRAY_SIZE(openssl_ciphers); + + for (i = 0; i < n; ++i) { + SSL_CIPHER *c; + c = sk_SSL_CIPHER_value(sk_cipher,i); + openssl_ciphers[i] = (pj_ssl_cipher) + (pj_uint32_t)c->id & 0x00FFFFFF; + //printf("%3u: %08x=%s\n", i+1, c->id, SSL_CIPHER_get_name(c)); + } + + SSL_free(ssl); + SSL_CTX_free(ctx); + + openssl_cipher_num = n; + } + + return PJ_SUCCESS; +} + + +/* Shutdown OpenSSL */ +static void shutdown_openssl(void) +{ + PJ_UNUSED_ARG(openssl_init_count); +} + + +/* SSL password callback. */ +static int password_cb(char *buf, int num, int rwflag, void *user_data) +{ + pj_ssl_cert_t *cert = (pj_ssl_cert_t*) user_data; + + PJ_UNUSED_ARG(rwflag); + + if(num < cert->privkey_pass.slen) + return 0; + + pj_memcpy(buf, cert->privkey_pass.ptr, cert->privkey_pass.slen); + return cert->privkey_pass.slen; +} + + +/* Create and initialize new SSL context */ +static pj_status_t create_ssl_ctx(pj_ssl_sock_t *ssock, SSL_CTX **p_ctx) +{ + SSL_METHOD *ssl_method; + SSL_CTX *ctx; + pj_ssl_cert_t *cert; + int mode, rc; + pj_status_t status; + + pj_assert(ssock && p_ctx); + + cert = ssock->cert; + + /* Make sure OpenSSL library has been initialized */ + init_openssl(); + + /* Determine SSL method to use */ + switch (ssock->param.proto) { + case PJ_SSL_SOCK_PROTO_DEFAULT: + case PJ_SSL_SOCK_PROTO_TLS1: + ssl_method = (SSL_METHOD*)TLSv1_method(); + break; + case PJ_SSL_SOCK_PROTO_SSL2: + ssl_method = (SSL_METHOD*)SSLv2_method(); + break; + case PJ_SSL_SOCK_PROTO_SSL3: + ssl_method = (SSL_METHOD*)SSLv3_method(); + break; + case PJ_SSL_SOCK_PROTO_SSL23: + ssl_method = (SSL_METHOD*)SSLv23_method(); + break; + //case PJ_SSL_SOCK_PROTO_DTLS1: + //ssl_method = (SSL_METHOD*)DTLSv1_method(); + //break; + default: + return PJ_EINVAL; + } + + /* Create SSL context for the listener */ + ctx = SSL_CTX_new(ssl_method); + if (ctx == NULL) { + GET_SSL_STATUS(status); + return status; + } + + /* Apply credentials */ + if (cert) { + /* Load CA list if one is specified. */ + if (cert->CA_file.slen) { + + rc = SSL_CTX_load_verify_locations(ctx, cert->CA_file.ptr, NULL); + + if (rc != 1) { + GET_SSL_STATUS(status); + PJ_LOG(1,(ssock->pool->obj_name, "Error loading CA list file " + "'%s'", cert->CA_file.ptr)); + SSL_CTX_free(ctx); + return status; + } + } + + /* Set password callback */ + if (cert->privkey_pass.slen) { + SSL_CTX_set_default_passwd_cb(ctx, password_cb); + SSL_CTX_set_default_passwd_cb_userdata(ctx, cert); + } + + + /* Load certificate if one is specified */ + if (cert->cert_file.slen) { + + /* Load certificate chain from file into ctx */ + rc = SSL_CTX_use_certificate_chain_file(ctx, cert->cert_file.ptr); + + if(rc != 1) { + GET_SSL_STATUS(status); + PJ_LOG(1,(ssock->pool->obj_name, "Error loading certificate " + "chain file '%s'", cert->cert_file.ptr)); + SSL_CTX_free(ctx); + return status; + } + } + + + /* Load private key if one is specified */ + if (cert->privkey_file.slen) { + /* Adds the first private key found in file to ctx */ + rc = SSL_CTX_use_PrivateKey_file(ctx, cert->privkey_file.ptr, + SSL_FILETYPE_PEM); + + if(rc != 1) { + GET_SSL_STATUS(status); + PJ_LOG(1,(ssock->pool->obj_name, "Error adding private key " + "from '%s'", cert->privkey_file.ptr)); + SSL_CTX_free(ctx); + return status; + } + } + } + + + /* SSL verification options */ + if (ssock->param.verify_peer) { + mode = SSL_VERIFY_PEER; + } else { + mode = SSL_VERIFY_NONE; + } + + if (ssock->is_server && ssock->param.require_client_cert) + mode |= SSL_VERIFY_FAIL_IF_NO_PEER_CERT | SSL_VERIFY_PEER; + + SSL_CTX_set_verify(ctx, mode, NULL); + + *p_ctx = ctx; + + return PJ_SUCCESS; +} + + +/* Destroy SSL context */ +static void destroy_ssl_ctx(SSL_CTX *ctx) +{ + SSL_CTX_free(ctx); + + /* Potentially shutdown OpenSSL library if this is the last + * context exists. + */ + shutdown_openssl(); +} + + +/* Reset SSL socket state */ +static void reset_ssl_sock_state(pj_ssl_sock_t *ssock) +{ + ssock->ssl_state = SSL_STATE_NULL; + + if (ssock->ossl_ssl) { + SSL_shutdown(ssock->ossl_ssl); + SSL_free(ssock->ossl_ssl); /* this will also close BIOs */ + ssock->ossl_ssl = NULL; + } + if (ssock->ossl_ctx) { + destroy_ssl_ctx(ssock->ossl_ctx); + ssock->ossl_ctx = NULL; + } + if (ssock->asock) { + pj_activesock_close(ssock->asock); + ssock->asock = NULL; + ssock->sock = PJ_INVALID_SOCKET; + } + if (ssock->sock != PJ_INVALID_SOCKET) { + pj_sock_close(ssock->sock); + ssock->sock = PJ_INVALID_SOCKET; + } + + /* Upon error, OpenSSL may leave any error description in the thread + * error queue, which sometime may cause next call to SSL API returning + * false error alarm, e.g: in Linux, SSL_CTX_use_certificate_chain_file() + * returning false error after a handshake error (in different SSL_CTX!). + * For now, just clear thread error queue here. + */ + ERR_clear_error(); +} + + +/* Generate cipher list with user preference order in OpenSSL format */ +static pj_status_t set_cipher_list(pj_ssl_sock_t *ssock) +{ + char buf[1024]; + pj_str_t cipher_list; + STACK_OF(SSL_CIPHER) *sk_cipher; + unsigned i; + int j, ret; + + if (ssock->param.ciphers_num == 0) + return PJ_SUCCESS; + + pj_strset(&cipher_list, buf, 0); + + /* Set SSL with ALL available ciphers */ + SSL_set_cipher_list(ssock->ossl_ssl, "ALL"); + + /* Generate user specified cipher list in OpenSSL format */ + sk_cipher = SSL_get_ciphers(ssock->ossl_ssl); + for (i = 0; i < ssock->param.ciphers_num; ++i) { + for (j = 0; j < sk_SSL_CIPHER_num(sk_cipher); ++j) { + SSL_CIPHER *c; + c = sk_SSL_CIPHER_value(sk_cipher, j); + if (ssock->param.ciphers[i] == (pj_ssl_cipher) + ((pj_uint32_t)c->id & 0x00FFFFFF)) + { + const char *c_name; + + c_name = SSL_CIPHER_get_name(c); + + /* Check buffer size */ + if (cipher_list.slen + pj_ansi_strlen(c_name) + 2 > sizeof(buf)) { + pj_assert(!"Insufficient temporary buffer for cipher"); + return PJ_ETOOMANY; + } + + /* Add colon separator */ + if (cipher_list.slen) + pj_strcat2(&cipher_list, ":"); + + /* Add the cipher */ + pj_strcat2(&cipher_list, c_name); + break; + } + } + } + + /* Put NULL termination in the generated cipher list */ + cipher_list.ptr[cipher_list.slen] = '\0'; + + /* Finally, set chosen cipher list */ + ret = SSL_set_cipher_list(ssock->ossl_ssl, buf); + if (ret < 1) { + pj_status_t status; + GET_SSL_STATUS(status); + return status; + } + + return PJ_SUCCESS; +} + + +/* Parse OpenSSL ASN1_TIME to pj_time_val and GMT info */ +static pj_bool_t parse_ossl_asn1_time(pj_time_val *tv, pj_bool_t *gmt, + const ASN1_TIME *tm) +{ + unsigned long parts[7] = {0}; + char *p, *end; + unsigned len; + pj_bool_t utc; + pj_parsed_time pt; + int i; + + utc = tm->type == V_ASN1_UTCTIME; + p = (char*)tm->data; + len = tm->length; + end = p + len - 1; + + /* GMT */ + *gmt = (*end == 'Z'); + + /* parse parts */ + for (i = 0; i < 7 && p < end; ++i) { + pj_str_t st; + + if (i==0 && !utc) { + /* 4 digits year part for non-UTC time format */ + st.slen = 4; + } else if (i==6) { + /* fraction of seconds */ + if (*p == '.') ++p; + st.slen = end - p + 1; + } else { + /* other parts always 2 digits length */ + st.slen = 2; + } + st.ptr = p; + + parts[i] = pj_strtoul(&st); + p += st.slen; + } + + /* encode parts to pj_time_val */ + pt.year = parts[0]; + if (utc) + pt.year += (pt.year < 50)? 2000:1900; + pt.mon = parts[1] - 1; + pt.day = parts[2]; + pt.hour = parts[3]; + pt.min = parts[4]; + pt.sec = parts[5]; + pt.msec = parts[6]; + + pj_time_encode(&pt, tv); + + return PJ_TRUE; +} + + +/* Get certificate info from OpenSSL X509 */ +static void get_cert_info(pj_pool_t *pool, pj_ssl_cert_info *ci, X509 *x) +{ + pj_ssl_cert_info info; + char buf1[256]; + char buf2[256]; + + pj_assert(pool && ci); + + if (!x) { + pj_bzero(ci, sizeof(pj_ssl_cert_info)); + return; + } + + pj_bzero(&info, sizeof(info)); + + /* Populate cert info */ + info.subject = pj_str(X509_NAME_oneline(X509_get_subject_name(x),buf1, + sizeof(buf1))); + info.issuer = pj_str(X509_NAME_oneline(X509_get_issuer_name(x), buf2, + sizeof(buf2))); + info.version = X509_get_version(x) + 1; + parse_ossl_asn1_time(&info.validity_start, &info.validity_use_gmt, + X509_get_notBefore(x)); + parse_ossl_asn1_time(&info.validity_end, &info.validity_use_gmt, + X509_get_notAfter(x)); + + /* Update certificate info */ + if (pj_strcmp(&ci->subject, &info.subject)) + pj_strdup(pool, &ci->subject, &info.subject); + if (pj_strcmp(&ci->issuer, &info.issuer)) + pj_strdup(pool, &ci->issuer, &info.issuer); + ci->version = info.version; + ci->validity_start = info.validity_start; + ci->validity_end = info.validity_end; + ci->validity_use_gmt = info.validity_use_gmt; +} + + +/* Update local & remote certificates info. This function should be + * called after handshake or renegotiation successfully completed. + */ +static void update_certs_info(pj_ssl_sock_t *ssock) +{ + X509 *x; + + pj_assert(ssock->ssl_state == SSL_STATE_ESTABLISHED); + + /* Active local certificate */ + x = SSL_get_certificate(ssock->ossl_ssl); + get_cert_info(ssock->pool, &ssock->local_cert_info, x); + /* Don't free local's X509! */ + + /* Active remote certificate */ + x = SSL_get_peer_certificate(ssock->ossl_ssl); + get_cert_info(ssock->pool, &ssock->remote_cert_info, x); + /* Free peer's X509 */ + X509_free(x); +} + + +/* When handshake completed: + * - notify application + * - if handshake failed, reset SSL state + * - return PJ_FALSE when SSL socket instance is destroyed by application. + */ +static pj_bool_t on_handshake_complete(pj_ssl_sock_t *ssock, + pj_status_t status) +{ + /* Cancel handshake timer */ + if (ssock->timer.id == TIMER_HANDSHAKE_TIMEOUT) { + pj_timer_heap_cancel(ssock->param.timer_heap, &ssock->timer); + ssock->timer.id = TIMER_NONE; + } + + /* Update certificates info on successful handshake */ + if (status == PJ_SUCCESS) + update_certs_info(ssock); + + /* Accepting */ + if (ssock->is_server) { + if (status != PJ_SUCCESS) { + /* Handshake failed in accepting, destroy our self silently. */ + + char errmsg[PJ_ERR_MSG_SIZE]; + char buf[PJ_INET6_ADDRSTRLEN+10]; + + pj_strerror(status, errmsg, sizeof(errmsg)); + PJ_LOG(3,(ssock->pool->obj_name, "Handshake failed in accepting " + "%s: %s", + pj_sockaddr_print(&ssock->rem_addr, buf, sizeof(buf), 3), + errmsg)); + + /* Workaround for ticket #985 */ +#if defined(PJ_WIN32) && PJ_WIN32!=0 + if (ssock->param.timer_heap) { + pj_time_val interval = {0, DELAYED_CLOSE_TIMEOUT}; + + reset_ssl_sock_state(ssock); + + ssock->timer.id = TIMER_CLOSE; + pj_time_val_normalize(&interval); + if (pj_timer_heap_schedule(ssock->param.timer_heap, + &ssock->timer, &interval) != 0) + { + ssock->timer.id = TIMER_NONE; + pj_ssl_sock_close(ssock); + } + } else +#endif /* PJ_WIN32 */ + { + pj_ssl_sock_close(ssock); + } + return PJ_FALSE; + } + /* Notify application the newly accepted SSL socket */ + if (ssock->param.cb.on_accept_complete) { + pj_bool_t ret; + ret = (*ssock->param.cb.on_accept_complete) + (ssock->parent, ssock, (pj_sockaddr_t*)&ssock->rem_addr, + pj_sockaddr_get_len((pj_sockaddr_t*)&ssock->rem_addr)); + if (ret == PJ_FALSE) + return PJ_FALSE; + } + } + + /* Connecting */ + else { + /* On failure, reset SSL socket state first, as app may try to + * reconnect in the callback. + */ + if (status != PJ_SUCCESS) { + reset_ssl_sock_state(ssock); + } + if (ssock->param.cb.on_connect_complete) { + pj_bool_t ret; + ret = (*ssock->param.cb.on_connect_complete)(ssock, status); + if (ret == PJ_FALSE) + return PJ_FALSE; + } + } + + return PJ_TRUE; +} + +/* Flush write BIO to network socket. Note that any access to write BIO + * MUST be serialized, so mutex protection must cover any call to OpenSSL + * API (that possibly generate data for write BIO) along with the call to + * this function (flushing all data in write BIO generated by above + * OpenSSL API call). + */ +static pj_status_t flush_write_bio(pj_ssl_sock_t *ssock, + pj_ioqueue_op_key_t *send_key, + pj_size_t orig_len, + unsigned flags) +{ + char *data; + pj_ssize_t len; + + write_state_t *write_st = &ssock->write_state; + write_data_t *wdata; + pj_size_t avail_len, needed_len, skipped_len = 0; + pj_status_t status; + + /* Check if there is data in write BIO, flush it if any */ + if (!BIO_pending(ssock->ossl_wbio)) + return PJ_SUCCESS; + + /* Get data and its length */ + len = BIO_get_mem_data(ssock->ossl_wbio, &data); + if (len == 0) + return PJ_SUCCESS; + + /* Calculate buffer size needed, and align it to 8 */ + needed_len = len + sizeof(write_data_t); + needed_len = ((needed_len + 7) >> 3) << 3; + + /* Check buffer availability */ + avail_len = write_st->max_len - write_st->len; + if (avail_len < needed_len) + return PJ_ENOMEM; + + /* More buffer availability check, note that the write data must be in + * a contigue buffer. + */ + if (write_st->len == 0) { + + write_st->start = write_st->buf; + wdata = (write_data_t*)write_st->start; + + } else { + + char *reg1, *reg2; + pj_size_t reg1_len, reg2_len; + + /* Unused slots may be wrapped/splitted into two regions, so let's + * analyze them if any region can hold the write data. + */ + reg1 = write_st->start + write_st->len; + if (reg1 >= write_st->buf + write_st->max_len) + reg1 -= write_st->max_len; + reg1_len = write_st->max_len - write_st->len; + if (reg1 + reg1_len > write_st->buf + write_st->max_len) { + reg1_len = write_st->buf + write_st->max_len - reg1; + reg2 = write_st->buf; + reg2_len = write_st->start - write_st->buf; + } else { + reg2 = NULL; + reg2_len = 0; + } + avail_len = PJ_MAX(reg1_len, reg2_len); + if (avail_len < needed_len) + return PJ_ENOMEM; + + /* Get write data pointer and update buffer length */ + if (reg1_len >= needed_len) { + wdata = (write_data_t*)reg1; + } else { + wdata = (write_data_t*)reg2; + /* Unused slot in region 1 is skipped as current write data + * doesn't fit it. + */ + skipped_len = reg1_len; + } + } + + /* Copy the data and set its properties into the buffer */ + pj_bzero(wdata, sizeof(write_data_t)); + wdata->app_key = send_key; + wdata->record_len = needed_len; + wdata->data_len = len; + wdata->plain_data_len = orig_len; + wdata->flags = flags; + pj_memcpy(&wdata->data, data, len); + + /* Send it */ + if (ssock->param.sock_type == pj_SOCK_STREAM()) { + status = pj_activesock_send(ssock->asock, &wdata->key, + wdata->data.content, &len, + flags); + } else { + status = pj_activesock_sendto(ssock->asock, &wdata->key, + wdata->data.content, &len, + flags, + (pj_sockaddr_t*)&ssock->rem_addr, + ssock->addr_len); + } + + /* Oh no, EWOULDBLOCK! */ + if (status == PJ_STATUS_FROM_OS(OSERR_EWOULDBLOCK)) { + /* Just return PJ_SUCCESS here, the pending data will be sent in next + * call of this function since the data is still stored in write BIO. + */ + return PJ_SUCCESS; + } + + /* Reset write BIO after flushed */ + BIO_reset(ssock->ossl_wbio); + + if (status == PJ_EPENDING) { + /* Update write state */ + pj_assert(skipped_len==0 || write_st->last_data); + write_st->len += needed_len + skipped_len; + if (write_st->last_data) + write_st->last_data->record_len += skipped_len; + write_st->last_data = wdata; + } + + return status; +} + + +static void on_timer(pj_timer_heap_t *th, struct pj_timer_entry *te) +{ + pj_ssl_sock_t *ssock = (pj_ssl_sock_t*)te->user_data; + int timer_id = te->id; + + te->id = TIMER_NONE; + + PJ_UNUSED_ARG(th); + + switch (timer_id) { + case TIMER_HANDSHAKE_TIMEOUT: + PJ_LOG(1,(ssock->pool->obj_name, "SSL handshake timeout after %d.%ds", + ssock->param.timeout.sec, ssock->param.timeout.msec)); + + on_handshake_complete(ssock, PJ_ETIMEDOUT); + break; + case TIMER_CLOSE: + pj_ssl_sock_close(ssock); + break; + default: + pj_assert(!"Unknown timer"); + break; + } +} + + +/* Asynchronouse handshake */ +static pj_status_t do_handshake(pj_ssl_sock_t *ssock) +{ + pj_status_t status; + int err; + + pj_lock_acquire(ssock->write_mutex); + + /* Perform SSL handshake */ + err = SSL_do_handshake(ssock->ossl_ssl); + if (err < 0) { + err = SSL_get_error(ssock->ossl_ssl, err); + if (err != SSL_ERROR_NONE && err != SSL_ERROR_WANT_READ) + { + /* Handshake fails */ + GET_SSL_STATUS(status); + pj_lock_release(ssock->write_mutex); + return status; + } + } + + /* SSL_do_handshake() may put some pending data into SSL write BIO, + * flush it if any. + */ + status = flush_write_bio(ssock, &ssock->handshake_op_key, 0, 0); + if (status != PJ_SUCCESS && status != PJ_EPENDING) { + pj_lock_release(ssock->write_mutex); + return status; + } + + pj_lock_release(ssock->write_mutex); + + /* Check if handshake has been completed */ + if (SSL_is_init_finished(ssock->ossl_ssl)) { + ssock->ssl_state = SSL_STATE_ESTABLISHED; + return PJ_SUCCESS; + } + + return PJ_EPENDING; +} + + +/* + ******************************************************************* + * Active socket callbacks. + ******************************************************************* + */ + +static pj_bool_t asock_on_data_read (pj_activesock_t *asock, + void *data, + pj_size_t size, + pj_status_t status, + pj_size_t *remainder) +{ + pj_ssl_sock_t *ssock = (pj_ssl_sock_t*) + pj_activesock_get_user_data(asock); + pj_size_t nwritten; + + /* Socket error or closed */ + if (data && size > 0) { + /* Consume the whole data */ + nwritten = BIO_write(ssock->ossl_rbio, data, size); + if (nwritten < size) { + GET_SSL_STATUS(status); + goto on_error; + } + } + + /* Check if SSL handshake hasn't finished yet */ + if (ssock->ssl_state == SSL_STATE_HANDSHAKING) { + pj_bool_t ret = PJ_TRUE; + + if (status == PJ_SUCCESS) + status = do_handshake(ssock); + + /* Not pending is either success or failed */ + if (status != PJ_EPENDING) + ret = on_handshake_complete(ssock, status); + + return ret; + } + + /* See if there is any decrypted data for the application */ + if (ssock->read_started) { + do { + read_data_t *buf = *(OFFSET_OF_READ_DATA_PTR(ssock, data)); + void *data_ = (pj_int8_t*)buf->data + buf->len; + int size_ = ssock->read_size - buf->len; + + /* SSL_read() may write some data to BIO write when re-negotiation + * is on progress, so let's protect it with write mutex. + */ + pj_lock_acquire(ssock->write_mutex); + size_ = SSL_read(ssock->ossl_ssl, data_, size_); + pj_lock_release(ssock->write_mutex); + + if (size_ > 0 || status != PJ_SUCCESS) { + if (ssock->param.cb.on_data_read) { + pj_bool_t ret; + pj_size_t remainder_ = 0; + + if (size_ > 0) + buf->len += size_; + + ret = (*ssock->param.cb.on_data_read)(ssock, buf->data, + buf->len, status, + &remainder_); + if (!ret) { + /* We've been destroyed */ + return PJ_FALSE; + } + + /* Application may have left some data to be consumed + * later. + */ + buf->len = remainder_; + } + + /* Active socket signalled connection closed/error, this has + * been signalled to the application along with any remaining + * buffer. So, let's just reset SSL socket now. + */ + if (status != PJ_SUCCESS) { + reset_ssl_sock_state(ssock); + return PJ_FALSE; + } + + } else { + + int err = SSL_get_error(ssock->ossl_ssl, size); + + /* SSL might just return SSL_ERROR_WANT_READ in + * re-negotiation. + */ + if (err != SSL_ERROR_NONE && err != SSL_ERROR_WANT_READ) + { + /* Reset SSL socket state, then return PJ_FALSE */ + GET_SSL_STATUS(status); + reset_ssl_sock_state(ssock); + goto on_error; + } + + status = do_handshake(ssock); + if (status == PJ_SUCCESS) { + /* Renegotiation completed */ + + /* Update certificates */ + update_certs_info(ssock); + + pj_lock_acquire(ssock->write_mutex); + status = flush_delayed_send(ssock); + pj_lock_release(ssock->write_mutex); + + if (status != PJ_SUCCESS && status != PJ_EPENDING) { + PJ_PERROR(1,(ssock->pool->obj_name, status, + "Failed to flush delayed send")); + goto on_error; + } + } else if (status != PJ_EPENDING) { + PJ_PERROR(1,(ssock->pool->obj_name, status, + "Renegotiation failed")); + goto on_error; + } + + break; + } + } while (1); + } + + return PJ_TRUE; + +on_error: + if (ssock->ssl_state == SSL_STATE_HANDSHAKING) + return on_handshake_complete(ssock, status); + + if (ssock->read_started && ssock->param.cb.on_data_read) { + pj_bool_t ret; + ret = (*ssock->param.cb.on_data_read)(ssock, NULL, 0, status, + remainder); + if (!ret) { + /* We've been destroyed */ + return PJ_FALSE; + } + } + + reset_ssl_sock_state(ssock); + return PJ_FALSE; +} + + +static pj_bool_t asock_on_data_sent (pj_activesock_t *asock, + pj_ioqueue_op_key_t *send_key, + pj_ssize_t sent) +{ + pj_ssl_sock_t *ssock = (pj_ssl_sock_t*) + pj_activesock_get_user_data(asock); + + PJ_UNUSED_ARG(send_key); + PJ_UNUSED_ARG(sent); + + if (ssock->ssl_state == SSL_STATE_HANDSHAKING) { + /* Initial handshaking */ + pj_status_t status; + + status = do_handshake(ssock); + /* Not pending is either success or failed */ + if (status != PJ_EPENDING) + return on_handshake_complete(ssock, status); + + } else if (send_key != &ssock->handshake_op_key) { + /* Some data has been sent, notify application */ + write_data_t *wdata = (write_data_t*)send_key; + if (ssock->param.cb.on_data_sent) { + pj_bool_t ret; + ret = (*ssock->param.cb.on_data_sent)(ssock, wdata->app_key, + wdata->plain_data_len); + if (!ret) { + /* We've been destroyed */ + return PJ_FALSE; + } + } + + /* Update write buffer state */ + pj_lock_acquire(ssock->write_mutex); + ssock->write_state.start += wdata->record_len; + ssock->write_state.len -= wdata->record_len; + if (ssock->write_state.last_data == wdata) { + pj_assert(ssock->write_state.len == 0); + ssock->write_state.last_data = NULL; + } + pj_lock_release(ssock->write_mutex); + + } else { + /* SSL re-negotiation is on-progress, just do nothing */ + } + + return PJ_TRUE; +} + + +static pj_bool_t asock_on_accept_complete (pj_activesock_t *asock, + pj_sock_t newsock, + const pj_sockaddr_t *src_addr, + int src_addr_len) +{ + pj_ssl_sock_t *ssock_parent = (pj_ssl_sock_t*) + pj_activesock_get_user_data(asock); + pj_ssl_sock_t *ssock; + pj_activesock_cb asock_cb; + pj_activesock_cfg asock_cfg; + unsigned i; + pj_status_t status; + + PJ_UNUSED_ARG(src_addr_len); + + /* Create new SSL socket instance */ + status = pj_ssl_sock_create(ssock_parent->pool, &ssock_parent->param, + &ssock); + if (status != PJ_SUCCESS) + goto on_return; + + /* Update new SSL socket attributes */ + ssock->sock = newsock; + ssock->parent = ssock_parent; + ssock->is_server = PJ_TRUE; + if (ssock_parent->cert) { + status = pj_ssl_sock_set_certificate(ssock, ssock->pool, + ssock_parent->cert); + if (status != PJ_SUCCESS) + goto on_return; + } + + /* Apply QoS, if specified */ + status = pj_sock_apply_qos2(ssock->sock, ssock->param.qos_type, + &ssock->param.qos_params, 1, + ssock->pool->obj_name, NULL); + if (status != PJ_SUCCESS && !ssock->param.qos_ignore_error) + goto on_return; + + /* Update local address */ + ssock->addr_len = src_addr_len; + status = pj_sock_getsockname(ssock->sock, &ssock->local_addr, + &ssock->addr_len); + if (status != PJ_SUCCESS) { + /* This fails on few envs, e.g: win IOCP, just tolerate this and + * use parent local address instead. + */ + pj_sockaddr_cp(&ssock->local_addr, &ssock_parent->local_addr); + } + + /* Set remote address */ + pj_sockaddr_cp(&ssock->rem_addr, src_addr); + + /* Create SSL context */ + status = create_ssl_ctx(ssock, &ssock->ossl_ctx); + if (status != PJ_SUCCESS) + goto on_return; + + /* Create SSL instance */ + ssock->ossl_ssl = SSL_new(ssock->ossl_ctx); + if (ssock->ossl_ssl == NULL) { + GET_SSL_STATUS(status); + goto on_return; + } + + /* Set cipher list */ + status = set_cipher_list(ssock); + if (status != PJ_SUCCESS) + goto on_return; + + /* Setup SSL BIOs */ + ssock->ossl_rbio = BIO_new(BIO_s_mem()); + ssock->ossl_wbio = BIO_new(BIO_s_mem()); + BIO_set_close(ssock->ossl_rbio, BIO_CLOSE); + BIO_set_close(ssock->ossl_wbio, BIO_CLOSE); + SSL_set_bio(ssock->ossl_ssl, ssock->ossl_rbio, ssock->ossl_wbio); + + /* Prepare read buffer */ + ssock->asock_rbuf = (void**)pj_pool_calloc(ssock->pool, + ssock->param.async_cnt, + sizeof(void*)); + for (i = 0; i<ssock->param.async_cnt; ++i) { + ssock->asock_rbuf[i] = (void*) pj_pool_alloc( + ssock->pool, + ssock->param.read_buffer_size + + sizeof(read_data_t*)); + } + + /* Create active socket */ + pj_activesock_cfg_default(&asock_cfg); + asock_cfg.async_cnt = ssock->param.async_cnt; + asock_cfg.concurrency = ssock->param.concurrency; + asock_cfg.whole_data = PJ_TRUE; + + pj_bzero(&asock_cb, sizeof(asock_cb)); + asock_cb.on_data_read = asock_on_data_read; + asock_cb.on_data_sent = asock_on_data_sent; + + status = pj_activesock_create(ssock->pool, + ssock->sock, + ssock->param.sock_type, + &asock_cfg, + ssock->param.ioqueue, + &asock_cb, + ssock, + &ssock->asock); + + if (status != PJ_SUCCESS) + goto on_return; + + /* Start read */ + status = pj_activesock_start_read2(ssock->asock, ssock->pool, + ssock->param.read_buffer_size, + ssock->asock_rbuf, + PJ_IOQUEUE_ALWAYS_ASYNC); + if (status != PJ_SUCCESS) + goto on_return; + + /* Prepare write/send state */ + pj_assert(ssock->write_state.max_len == 0); + ssock->write_state.buf = (char*) + pj_pool_alloc(ssock->pool, + ssock->param.send_buffer_size); + ssock->write_state.max_len = ssock->param.send_buffer_size; + ssock->write_state.start = ssock->write_state.buf; + ssock->write_state.len = 0; + + /* Start handshake timer */ + if (ssock->param.timer_heap && (ssock->param.timeout.sec != 0 || + ssock->param.timeout.msec != 0)) + { + pj_assert(ssock->timer.id == TIMER_NONE); + ssock->timer.id = TIMER_HANDSHAKE_TIMEOUT; + status = pj_timer_heap_schedule(ssock->param.timer_heap, + &ssock->timer, + &ssock->param.timeout); + if (status != PJ_SUCCESS) + ssock->timer.id = TIMER_NONE; + } + + /* Start SSL handshake */ + ssock->ssl_state = SSL_STATE_HANDSHAKING; + SSL_set_accept_state(ssock->ossl_ssl); + status = do_handshake(ssock); + +on_return: + if (ssock && status != PJ_EPENDING) + on_handshake_complete(ssock, status); + + /* Must return PJ_TRUE whatever happened, as active socket must + * continue listening. + */ + return PJ_TRUE; +} + + +static pj_bool_t asock_on_connect_complete (pj_activesock_t *asock, + pj_status_t status) +{ + pj_ssl_sock_t *ssock = (pj_ssl_sock_t*) + pj_activesock_get_user_data(asock); + unsigned i; + + if (status != PJ_SUCCESS) + goto on_return; + + /* Update local address */ + ssock->addr_len = sizeof(pj_sockaddr); + status = pj_sock_getsockname(ssock->sock, &ssock->local_addr, + &ssock->addr_len); + if (status != PJ_SUCCESS) + goto on_return; + + /* Create SSL context */ + status = create_ssl_ctx(ssock, &ssock->ossl_ctx); + if (status != PJ_SUCCESS) + goto on_return; + + /* Create SSL instance */ + ssock->ossl_ssl = SSL_new(ssock->ossl_ctx); + if (ssock->ossl_ssl == NULL) { + GET_SSL_STATUS(status); + goto on_return; + } + + /* Set cipher list */ + status = set_cipher_list(ssock); + if (status != PJ_SUCCESS) + goto on_return; + + /* Setup SSL BIOs */ + ssock->ossl_rbio = BIO_new(BIO_s_mem()); + ssock->ossl_wbio = BIO_new(BIO_s_mem()); + BIO_set_close(ssock->ossl_rbio, BIO_CLOSE); + BIO_set_close(ssock->ossl_wbio, BIO_CLOSE); + SSL_set_bio(ssock->ossl_ssl, ssock->ossl_rbio, ssock->ossl_wbio); + + /* Prepare read buffer */ + ssock->asock_rbuf = (void**)pj_pool_calloc(ssock->pool, + ssock->param.async_cnt, + sizeof(void*)); + for (i = 0; i<ssock->param.async_cnt; ++i) { + ssock->asock_rbuf[i] = (void*) pj_pool_alloc( + ssock->pool, + ssock->param.read_buffer_size + + sizeof(read_data_t*)); + } + + /* Start read */ + status = pj_activesock_start_read2(ssock->asock, ssock->pool, + ssock->param.read_buffer_size, + ssock->asock_rbuf, + PJ_IOQUEUE_ALWAYS_ASYNC); + if (status != PJ_SUCCESS) + goto on_return; + + /* Prepare write/send state */ + pj_assert(ssock->write_state.max_len == 0); + ssock->write_state.buf = (char*) + pj_pool_alloc(ssock->pool, + ssock->param.send_buffer_size); + ssock->write_state.max_len = ssock->param.send_buffer_size; + ssock->write_state.start = ssock->write_state.buf; + ssock->write_state.len = 0; + + /* Start handshake timer */ + if (ssock->param.timer_heap && (ssock->param.timeout.sec != 0 || + ssock->param.timeout.msec != 0)) + { + pj_assert(ssock->timer.id == TIMER_NONE); + ssock->timer.id = TIMER_HANDSHAKE_TIMEOUT; + status = pj_timer_heap_schedule(ssock->param.timer_heap, + &ssock->timer, + &ssock->param.timeout); + if (status != PJ_SUCCESS) + ssock->timer.id = TIMER_NONE; + } + +#ifdef SSL_set_tlsext_host_name + /* Set server name to connect */ + if (ssock->param.server_name.slen) { + /* Server name is null terminated already */ + if (!SSL_set_tlsext_host_name(ssock->ossl_ssl, + ssock->param.server_name.ptr)) + { + char err_str[PJ_ERR_MSG_SIZE]; + + ERR_error_string_n(ERR_get_error(), err_str, sizeof(err_str)); + PJ_LOG(3,(ssock->pool->obj_name, "SSL_set_tlsext_host_name() " + "failed: %s", err_str)); + } + } +#endif + + /* Start SSL handshake */ + ssock->ssl_state = SSL_STATE_HANDSHAKING; + SSL_set_connect_state(ssock->ossl_ssl); + + status = do_handshake(ssock); + if (status != PJ_EPENDING) + goto on_return; + + return PJ_TRUE; + +on_return: + return on_handshake_complete(ssock, status); +} + + + +/* + ******************************************************************* + * API + ******************************************************************* + */ + +/* Load credentials from files. */ +PJ_DEF(pj_status_t) pj_ssl_cert_load_from_files (pj_pool_t *pool, + const pj_str_t *CA_file, + const pj_str_t *cert_file, + const pj_str_t *privkey_file, + const pj_str_t *privkey_pass, + pj_ssl_cert_t **p_cert) +{ + pj_ssl_cert_t *cert; + + PJ_ASSERT_RETURN(pool && CA_file && cert_file && privkey_file, PJ_EINVAL); + + cert = PJ_POOL_ZALLOC_T(pool, pj_ssl_cert_t); + pj_strdup_with_null(pool, &cert->CA_file, CA_file); + pj_strdup_with_null(pool, &cert->cert_file, cert_file); + pj_strdup_with_null(pool, &cert->privkey_file, privkey_file); + pj_strdup_with_null(pool, &cert->privkey_pass, privkey_pass); + + *p_cert = cert; + + return PJ_SUCCESS; +} + + +/* Set SSL socket credentials. */ +PJ_DECL(pj_status_t) pj_ssl_sock_set_certificate( + pj_ssl_sock_t *ssock, + pj_pool_t *pool, + const pj_ssl_cert_t *cert) +{ + pj_ssl_cert_t *cert_; + + PJ_ASSERT_RETURN(ssock && pool && cert, PJ_EINVAL); + + cert_ = PJ_POOL_ZALLOC_T(pool, pj_ssl_cert_t); + pj_memcpy(cert_, cert, sizeof(cert)); + pj_strdup_with_null(pool, &cert_->CA_file, &cert->CA_file); + pj_strdup_with_null(pool, &cert_->cert_file, &cert->cert_file); + pj_strdup_with_null(pool, &cert_->privkey_file, &cert->privkey_file); + pj_strdup_with_null(pool, &cert_->privkey_pass, &cert->privkey_pass); + + ssock->cert = cert_; + + return PJ_SUCCESS; +} + + +/* Get available ciphers. */ +PJ_DEF(pj_status_t) pj_ssl_cipher_get_availables(pj_ssl_cipher ciphers[], + unsigned *cipher_num) +{ + unsigned i; + + PJ_ASSERT_RETURN(ciphers && cipher_num, PJ_EINVAL); + + if (openssl_cipher_num == 0) { + init_openssl(); + shutdown_openssl(); + } + + if (openssl_cipher_num == 0) + return PJ_ENOTFOUND; + + *cipher_num = PJ_MIN(*cipher_num, openssl_cipher_num); + + for (i = 0; i < *cipher_num; ++i) + ciphers[i] = openssl_ciphers[i]; + + return PJ_SUCCESS; +} + + +/* + * Create SSL socket instance. + */ +PJ_DEF(pj_status_t) pj_ssl_sock_create (pj_pool_t *pool, + const pj_ssl_sock_param *param, + pj_ssl_sock_t **p_ssock) +{ + pj_ssl_sock_t *ssock; + pj_status_t status; + + PJ_ASSERT_RETURN(pool && param && p_ssock, PJ_EINVAL); + PJ_ASSERT_RETURN(param->sock_type == pj_SOCK_STREAM(), PJ_ENOTSUP); + + pool = pj_pool_create(pool->factory, "ssl%p", 512, 512, NULL); + + /* Create secure socket */ + ssock = PJ_POOL_ZALLOC_T(pool, pj_ssl_sock_t); + ssock->pool = pool; + ssock->sock = PJ_INVALID_SOCKET; + ssock->ssl_state = SSL_STATE_NULL; + pj_list_init(&ssock->write_pending); + pj_list_init(&ssock->write_pending_empty); + pj_timer_entry_init(&ssock->timer, 0, ssock, &on_timer); + + /* Create secure socket mutex */ + status = pj_lock_create_recursive_mutex(pool, pool->obj_name, + &ssock->write_mutex); + if (status != PJ_SUCCESS) + return status; + + /* Init secure socket param */ + ssock->param = *param; + ssock->param.read_buffer_size = ((ssock->param.read_buffer_size+7)>>3)<<3; + if (param->ciphers_num > 0) { + unsigned i; + ssock->param.ciphers = (pj_ssl_cipher*) + pj_pool_calloc(pool, param->ciphers_num, + sizeof(pj_ssl_cipher)); + for (i = 0; i < param->ciphers_num; ++i) + ssock->param.ciphers[i] = param->ciphers[i]; + } + + /* Server name must be null-terminated */ + pj_strdup_with_null(pool, &ssock->param.server_name, + ¶m->server_name); + + /* Finally */ + *p_ssock = ssock; + + return PJ_SUCCESS; +} + + +/* + * Close the secure socket. This will unregister the socket from the + * ioqueue and ultimately close the socket. + */ +PJ_DEF(pj_status_t) pj_ssl_sock_close(pj_ssl_sock_t *ssock) +{ + pj_pool_t *pool; + + PJ_ASSERT_RETURN(ssock, PJ_EINVAL); + + if (!ssock->pool) + return PJ_SUCCESS; + + if (ssock->timer.id != TIMER_NONE) { + pj_timer_heap_cancel(ssock->param.timer_heap, &ssock->timer); + ssock->timer.id = TIMER_NONE; + } + + reset_ssl_sock_state(ssock); + pj_lock_destroy(ssock->write_mutex); + + pool = ssock->pool; + ssock->pool = NULL; + if (pool) + pj_pool_release(pool); + + return PJ_SUCCESS; +} + + +/* + * Associate arbitrary data with the secure socket. + */ +PJ_DEF(pj_status_t) pj_ssl_sock_set_user_data(pj_ssl_sock_t *ssock, + void *user_data) +{ + PJ_ASSERT_RETURN(ssock, PJ_EINVAL); + + ssock->param.user_data = user_data; + return PJ_SUCCESS; +} + + +/* + * Retrieve the user data previously associated with this secure + * socket. + */ +PJ_DEF(void*) pj_ssl_sock_get_user_data(pj_ssl_sock_t *ssock) +{ + PJ_ASSERT_RETURN(ssock, NULL); + + return ssock->param.user_data; +} + + +/* + * Retrieve the local address and port used by specified SSL socket. + */ +PJ_DEF(pj_status_t) pj_ssl_sock_get_info (pj_ssl_sock_t *ssock, + pj_ssl_sock_info *info) +{ + pj_bzero(info, sizeof(*info)); + + /* Established flag */ + info->established = (ssock->ssl_state == SSL_STATE_ESTABLISHED); + + /* Protocol */ + info->proto = ssock->param.proto; + + /* Local address */ + pj_sockaddr_cp(&info->local_addr, &ssock->local_addr); + + if (info->established) { + /* Current cipher */ + const SSL_CIPHER *cipher; + + cipher = SSL_get_current_cipher(ssock->ossl_ssl); + info->cipher = (cipher->id & 0x00FFFFFF); + + /* Remote address */ + pj_sockaddr_cp(&info->remote_addr, &ssock->rem_addr); + + /* Certificates info */ + info->local_cert_info = ssock->local_cert_info; + info->remote_cert_info = ssock->remote_cert_info; + } + + return PJ_SUCCESS; +} + + +/* + * Starts read operation on this secure socket. + */ +PJ_DEF(pj_status_t) pj_ssl_sock_start_read (pj_ssl_sock_t *ssock, + pj_pool_t *pool, + unsigned buff_size, + pj_uint32_t flags) +{ + void **readbuf; + unsigned i; + + PJ_ASSERT_RETURN(ssock && pool && buff_size, PJ_EINVAL); + PJ_ASSERT_RETURN(ssock->ssl_state==SSL_STATE_ESTABLISHED, PJ_EINVALIDOP); + + readbuf = (void**) pj_pool_calloc(pool, ssock->param.async_cnt, + sizeof(void*)); + + for (i=0; i<ssock->param.async_cnt; ++i) { + readbuf[i] = pj_pool_alloc(pool, buff_size); + } + + return pj_ssl_sock_start_read2(ssock, pool, buff_size, + readbuf, flags); +} + + +/* + * Same as #pj_ssl_sock_start_read(), except that the application + * supplies the buffers for the read operation so that the acive socket + * does not have to allocate the buffers. + */ +PJ_DEF(pj_status_t) pj_ssl_sock_start_read2 (pj_ssl_sock_t *ssock, + pj_pool_t *pool, + unsigned buff_size, + void *readbuf[], + pj_uint32_t flags) +{ + unsigned i; + + PJ_ASSERT_RETURN(ssock && pool && buff_size && readbuf, PJ_EINVAL); + PJ_ASSERT_RETURN(ssock->ssl_state==SSL_STATE_ESTABLISHED, PJ_EINVALIDOP); + + /* Create SSL socket read buffer */ + ssock->ssock_rbuf = (read_data_t*)pj_pool_calloc(pool, + ssock->param.async_cnt, + sizeof(read_data_t)); + + /* Store SSL socket read buffer pointer in the activesock read buffer */ + for (i=0; i<ssock->param.async_cnt; ++i) { + read_data_t **p_ssock_rbuf = + OFFSET_OF_READ_DATA_PTR(ssock, ssock->asock_rbuf[i]); + + ssock->ssock_rbuf[i].data = readbuf[i]; + ssock->ssock_rbuf[i].len = 0; + + *p_ssock_rbuf = &ssock->ssock_rbuf[i]; + } + + ssock->read_size = buff_size; + ssock->read_started = PJ_TRUE; + ssock->read_flags = flags; + + return PJ_SUCCESS; +} + + +/* + * Same as pj_ssl_sock_start_read(), except that this function is used + * only for datagram sockets, and it will trigger \a on_data_recvfrom() + * callback instead. + */ +PJ_DEF(pj_status_t) pj_ssl_sock_start_recvfrom (pj_ssl_sock_t *ssock, + pj_pool_t *pool, + unsigned buff_size, + pj_uint32_t flags) +{ + PJ_UNUSED_ARG(ssock); + PJ_UNUSED_ARG(pool); + PJ_UNUSED_ARG(buff_size); + PJ_UNUSED_ARG(flags); + + return PJ_ENOTSUP; +} + + +/* + * Same as #pj_ssl_sock_start_recvfrom() except that the recvfrom() + * operation takes the buffer from the argument rather than creating + * new ones. + */ +PJ_DEF(pj_status_t) pj_ssl_sock_start_recvfrom2 (pj_ssl_sock_t *ssock, + pj_pool_t *pool, + unsigned buff_size, + void *readbuf[], + pj_uint32_t flags) +{ + PJ_UNUSED_ARG(ssock); + PJ_UNUSED_ARG(pool); + PJ_UNUSED_ARG(buff_size); + PJ_UNUSED_ARG(readbuf); + PJ_UNUSED_ARG(flags); + + return PJ_ENOTSUP; +} + +/* Write plain data to SSL and flush write BIO. Note that accessing + * write BIO must be serialized, so a call to this function must be + * protected by write mutex of SSL socket. + */ +static pj_status_t ssl_write(pj_ssl_sock_t *ssock, + pj_ioqueue_op_key_t *send_key, + const void *data, + pj_ssize_t size, + unsigned flags) +{ + pj_status_t status; + int nwritten; + + /* Write the plain data to SSL, after SSL encrypts it, write BIO will + * contain the secured data to be sent via socket. Note that re- + * negotitation may be on progress, so sending data should be delayed + * until re-negotiation is completed. + */ + nwritten = SSL_write(ssock->ossl_ssl, data, size); + + if (nwritten == size) { + /* All data written, flush write BIO to network socket */ + status = flush_write_bio(ssock, send_key, size, flags); + } else if (nwritten <= 0) { + /* SSL failed to process the data, it may just that re-negotiation + * is on progress. + */ + int err; + err = SSL_get_error(ssock->ossl_ssl, nwritten); + if (err == SSL_ERROR_WANT_READ || err == SSL_ERROR_NONE) { + /* Re-negotiation is on progress, flush re-negotiation data */ + status = flush_write_bio(ssock, &ssock->handshake_op_key, 0, 0); + if (status == PJ_SUCCESS || status == PJ_EPENDING) + /* Just return PJ_EBUSY when re-negotiation is on progress */ + status = PJ_EBUSY; + } else { + /* Some problem occured */ + GET_SSL_STATUS(status); + } + } else { + /* nwritten < *size, shouldn't happen, unless write BIO cannot hold + * the whole secured data, perhaps because of insufficient memory. + */ + status = PJ_ENOMEM; + } + + return status; +} + +/* Flush delayed data sending in the write pending list. Note that accessing + * write pending list must be serialized, so a call to this function must be + * protected by write mutex of SSL socket. + */ +static pj_status_t flush_delayed_send(pj_ssl_sock_t *ssock) +{ + while (!pj_list_empty(&ssock->write_pending)) { + write_pending_t *wp; + pj_status_t status; + + wp = ssock->write_pending.next; + + status = ssl_write(ssock, &wp->data.key, wp->data.data.ptr, + wp->data.plain_data_len, wp->data.flags); + if (status != PJ_SUCCESS) + return status; + + pj_list_erase(wp); + pj_list_push_back(&ssock->write_pending_empty, wp); + } + + return PJ_SUCCESS; +} + +/* Sending is delayed, push back the sending data into pending list. Note that + * accessing write pending list must be serialized, so a call to this function + * must be protected by write mutex of SSL socket. + */ +static pj_status_t delay_send (pj_ssl_sock_t *ssock, + pj_ioqueue_op_key_t *send_key, + const void *data, + pj_ssize_t size, + unsigned flags) +{ + write_pending_t *wp; + + /* Init write pending instance */ + if (!pj_list_empty(&ssock->write_pending_empty)) { + wp = ssock->write_pending_empty.next; + pj_list_erase(wp); + } else { + wp = PJ_POOL_ZALLOC_T(ssock->pool, write_pending_t); + } + + wp->data.app_key = send_key; + wp->data.plain_data_len = size; + wp->data.data.ptr = data; + wp->data.flags = flags; + + pj_list_push_back(&ssock->write_pending, wp); + + /* Must return PJ_EPENDING */ + return PJ_EPENDING; +} + +/** + * Send data using the socket. + */ +PJ_DEF(pj_status_t) pj_ssl_sock_send (pj_ssl_sock_t *ssock, + pj_ioqueue_op_key_t *send_key, + const void *data, + pj_ssize_t *size, + unsigned flags) +{ + pj_status_t status; + + PJ_ASSERT_RETURN(ssock && data && size && (*size>0), PJ_EINVAL); + PJ_ASSERT_RETURN(ssock->ssl_state==SSL_STATE_ESTABLISHED, PJ_EINVALIDOP); + + pj_lock_acquire(ssock->write_mutex); + + /* Flush delayed send first. Sending data might be delayed when + * re-negotiation is on-progress. + */ + status = flush_delayed_send(ssock); + if (status == PJ_EBUSY) { + /* Re-negotiation is on progress, delay sending */ + status = delay_send(ssock, send_key, data, *size, flags); + goto on_return; + } else if (status != PJ_SUCCESS) { + goto on_return; + } + + /* Write data to SSL */ + status = ssl_write(ssock, send_key, data, *size, flags); + if (status == PJ_EBUSY) { + /* Re-negotiation is on progress, delay sending */ + status = delay_send(ssock, send_key, data, *size, flags); + } + +on_return: + pj_lock_release(ssock->write_mutex); + return status; +} + + +/** + * Send datagram using the socket. + */ +PJ_DEF(pj_status_t) pj_ssl_sock_sendto (pj_ssl_sock_t *ssock, + pj_ioqueue_op_key_t *send_key, + const void *data, + pj_ssize_t *size, + unsigned flags, + const pj_sockaddr_t *addr, + int addr_len) +{ + PJ_UNUSED_ARG(ssock); + PJ_UNUSED_ARG(send_key); + PJ_UNUSED_ARG(data); + PJ_UNUSED_ARG(size); + PJ_UNUSED_ARG(flags); + PJ_UNUSED_ARG(addr); + PJ_UNUSED_ARG(addr_len); + + return PJ_ENOTSUP; +} + + +/** + * Starts asynchronous socket accept() operations on this secure socket. + */ +PJ_DEF(pj_status_t) pj_ssl_sock_start_accept (pj_ssl_sock_t *ssock, + pj_pool_t *pool, + const pj_sockaddr_t *localaddr, + int addr_len) +{ + pj_activesock_cb asock_cb; + pj_activesock_cfg asock_cfg; + pj_status_t status; + + PJ_ASSERT_RETURN(ssock && pool && localaddr && addr_len, PJ_EINVAL); + + /* Create socket */ + status = pj_sock_socket(ssock->param.sock_af, ssock->param.sock_type, 0, + &ssock->sock); + if (status != PJ_SUCCESS) + goto on_error; + + /* Apply QoS, if specified */ + status = pj_sock_apply_qos2(ssock->sock, ssock->param.qos_type, + &ssock->param.qos_params, 2, + ssock->pool->obj_name, NULL); + if (status != PJ_SUCCESS && !ssock->param.qos_ignore_error) + goto on_error; + + /* Bind socket */ + status = pj_sock_bind(ssock->sock, localaddr, addr_len); + if (status != PJ_SUCCESS) + goto on_error; + + /* Start listening to the address */ + status = pj_sock_listen(ssock->sock, PJ_SOMAXCONN); + if (status != PJ_SUCCESS) + goto on_error; + + /* Create active socket */ + pj_activesock_cfg_default(&asock_cfg); + asock_cfg.async_cnt = ssock->param.async_cnt; + asock_cfg.concurrency = ssock->param.concurrency; + asock_cfg.whole_data = PJ_TRUE; + + pj_bzero(&asock_cb, sizeof(asock_cb)); + asock_cb.on_accept_complete = asock_on_accept_complete; + + status = pj_activesock_create(pool, + ssock->sock, + ssock->param.sock_type, + &asock_cfg, + ssock->param.ioqueue, + &asock_cb, + ssock, + &ssock->asock); + + if (status != PJ_SUCCESS) + goto on_error; + + /* Start accepting */ + status = pj_activesock_start_accept(ssock->asock, pool); + if (status != PJ_SUCCESS) + goto on_error; + + /* Update local address */ + ssock->addr_len = addr_len; + status = pj_sock_getsockname(ssock->sock, &ssock->local_addr, + &ssock->addr_len); + if (status != PJ_SUCCESS) + pj_sockaddr_cp(&ssock->local_addr, localaddr); + + ssock->is_server = PJ_TRUE; + + return PJ_SUCCESS; + +on_error: + reset_ssl_sock_state(ssock); + return status; +} + + +/** + * Starts asynchronous socket connect() operation. + */ +PJ_DECL(pj_status_t) pj_ssl_sock_start_connect(pj_ssl_sock_t *ssock, + pj_pool_t *pool, + const pj_sockaddr_t *localaddr, + const pj_sockaddr_t *remaddr, + int addr_len) +{ + pj_activesock_cb asock_cb; + pj_activesock_cfg asock_cfg; + pj_status_t status; + + PJ_ASSERT_RETURN(ssock && pool && localaddr && remaddr && addr_len, + PJ_EINVAL); + + /* Create socket */ + status = pj_sock_socket(ssock->param.sock_af, ssock->param.sock_type, 0, + &ssock->sock); + if (status != PJ_SUCCESS) + goto on_error; + + /* Apply QoS, if specified */ + status = pj_sock_apply_qos2(ssock->sock, ssock->param.qos_type, + &ssock->param.qos_params, 2, + ssock->pool->obj_name, NULL); + if (status != PJ_SUCCESS && !ssock->param.qos_ignore_error) + goto on_error; + + /* Bind socket */ + status = pj_sock_bind(ssock->sock, localaddr, addr_len); + if (status != PJ_SUCCESS) + goto on_error; + + /* Create active socket */ + pj_activesock_cfg_default(&asock_cfg); + asock_cfg.async_cnt = ssock->param.async_cnt; + asock_cfg.concurrency = ssock->param.concurrency; + asock_cfg.whole_data = PJ_TRUE; + + pj_bzero(&asock_cb, sizeof(asock_cb)); + asock_cb.on_connect_complete = asock_on_connect_complete; + asock_cb.on_data_read = asock_on_data_read; + asock_cb.on_data_sent = asock_on_data_sent; + + status = pj_activesock_create(pool, + ssock->sock, + ssock->param.sock_type, + &asock_cfg, + ssock->param.ioqueue, + &asock_cb, + ssock, + &ssock->asock); + + if (status != PJ_SUCCESS) + goto on_error; + + /* Save remote address */ + pj_sockaddr_cp(&ssock->rem_addr, remaddr); + + status = pj_activesock_start_connect(ssock->asock, pool, remaddr, + addr_len); + + if (status == PJ_SUCCESS) + asock_on_connect_complete(ssock->asock, PJ_SUCCESS); + else if (status != PJ_EPENDING) + goto on_error; + + /* Update local address */ + ssock->addr_len = addr_len; + status = pj_sock_getsockname(ssock->sock, &ssock->local_addr, + &ssock->addr_len); + /* Note that we may not get an IP address here. This can + * happen for example on Windows, where getsockname() + * would return 0.0.0.0 if socket has just started the + * async connect. In this case, just leave the local + * address with 0.0.0.0 for now; it will be updated + * once the socket is established. + */ + + /* Update SSL state */ + ssock->is_server = PJ_FALSE; + + return PJ_EPENDING; + +on_error: + reset_ssl_sock_state(ssock); + return status; +} + + +PJ_DEF(pj_status_t) pj_ssl_sock_renegotiate(pj_ssl_sock_t *ssock) +{ + int ret; + pj_status_t status; + + PJ_ASSERT_RETURN(ssock->ssl_state == SSL_STATE_ESTABLISHED, PJ_EINVALIDOP); + + if (SSL_renegotiate_pending(ssock->ossl_ssl)) + return PJ_EPENDING; + + ret = SSL_renegotiate(ssock->ossl_ssl); + if (ret <= 0) { + GET_SSL_STATUS(status); + } else { + status = do_handshake(ssock); + } + + return status; +} + +#endif /* PJ_HAS_SSL_SOCK */ + diff --git a/sflphone-common/libs/pjproject/pjlib/src/pj/ssl_sock_symbian.cpp b/sflphone-common/libs/pjproject/pjlib/src/pj/ssl_sock_symbian.cpp new file mode 100644 index 0000000000000000000000000000000000000000..684b2470cf5d39a9ba32c6f7ea8498c9e1781ab0 --- /dev/null +++ b/sflphone-common/libs/pjproject/pjlib/src/pj/ssl_sock_symbian.cpp @@ -0,0 +1,1117 @@ +/* $Id: ssl_sock_symbian.cpp 2998 2009-11-09 08:51:34Z bennylp $ */ +/* + * Copyright (C) 2009 Teluu Inc. (http://www.teluu.com) + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ +#include <pj/ssl_sock.h> +#include <pj/compat/socket.h> +#include <pj/assert.h> +#include <pj/errno.h> +#include <pj/math.h> +#include <pj/pool.h> +#include <pj/sock.h> +#include <pj/string.h> + +#include "os_symbian.h" +#include <securesocket.h> +#include <x509cert.h> +#include <e32des8.h> + +#define THIS_FILE "ssl_sock_symbian.cpp" + +typedef void (*CPjSSLSocket_cb)(int err, void *key); + +class CPjSSLSocketReader : public CActive +{ +public: + static CPjSSLSocketReader *NewL(CSecureSocket &sock) + { + CPjSSLSocketReader *self = new (ELeave) + CPjSSLSocketReader(sock); + CleanupStack::PushL(self); + self->ConstructL(); + CleanupStack::Pop(self); + return self; + } + + ~CPjSSLSocketReader() { + Cancel(); + } + + /* Asynchronous read from the socket. */ + int Read(CPjSSLSocket_cb cb, void *key, TPtr8 &data, TUint flags) + { + PJ_ASSERT_RETURN(!IsActive(), PJ_EBUSY); + + cb_ = cb; + key_ = key; + sock_.RecvOneOrMore(data, iStatus, len_received_); + SetActive(); + + return PJ_EPENDING; + } + +private: + CSecureSocket &sock_; + CPjSSLSocket_cb cb_; + void *key_; + TSockXfrLength len_received_; /* not really useful? */ + + void DoCancel() { + sock_.CancelAll(); + } + + void RunL() { + (*cb_)(iStatus.Int(), key_); + } + + CPjSSLSocketReader(CSecureSocket &sock) : + CActive(0), sock_(sock), cb_(NULL), key_(NULL) + {} + + void ConstructL() { + CActiveScheduler::Add(this); + } +}; + +class CPjSSLSocket : public CActive +{ +public: + enum ssl_state { + SSL_STATE_NULL, + SSL_STATE_CONNECTING, + SSL_STATE_HANDSHAKING, + SSL_STATE_ESTABLISHED + }; + + static CPjSSLSocket *NewL(const TDesC8 &ssl_proto, + pj_qos_type qos_type, + const pj_qos_params &qos_params) + { + CPjSSLSocket *self = new (ELeave) CPjSSLSocket(qos_type, qos_params); + CleanupStack::PushL(self); + self->ConstructL(ssl_proto); + CleanupStack::Pop(self); + return self; + } + + ~CPjSSLSocket() { + Cancel(); + CleanupSubObjects(); + } + + int Connect(CPjSSLSocket_cb cb, void *key, const TInetAddr &local_addr, + const TInetAddr &rem_addr, + const TDesC8 &servername = TPtrC8(NULL,0)); + int Send(CPjSSLSocket_cb cb, void *key, const TDesC8 &aDesc, TUint flags); + int SendSync(const TDesC8 &aDesc, TUint flags); + + CPjSSLSocketReader* GetReader(); + enum ssl_state GetState() const { return state_; } + const TInetAddr* GetLocalAddr() const { return &local_addr_; } + int GetCipher(TDes8 &cipher) const { + if (securesock_) + return securesock_->CurrentCipherSuite(cipher); + return KErrNotFound; + } + +private: + enum ssl_state state_; + pj_sock_t sock_; + CSecureSocket *securesock_; + bool is_connected_; + + pj_qos_type qos_type_; + pj_qos_params qos_params_; + + CPjSSLSocketReader *reader_; + TBuf<32> ssl_proto_; + TInetAddr rem_addr_; + TPtrC8 servername_; + TInetAddr local_addr_; + TSockXfrLength sent_len_; + + CPjSSLSocket_cb cb_; + void *key_; + + void DoCancel(); + void RunL(); + + CPjSSLSocket(pj_qos_type qos_type, const pj_qos_params &qos_params) : + CActive(0), state_(SSL_STATE_NULL), sock_(PJ_INVALID_SOCKET), + securesock_(NULL), is_connected_(false), + qos_type_(qos_type), qos_params_(qos_params), + reader_(NULL), cb_(NULL), key_(NULL) + {} + + void ConstructL(const TDesC8 &ssl_proto) { + ssl_proto_.Copy(ssl_proto); + CActiveScheduler::Add(this); + } + + void CleanupSubObjects() { + delete reader_; + reader_ = NULL; + if (securesock_) { + securesock_->Close(); + delete securesock_; + securesock_ = NULL; + } + if (sock_ != PJ_INVALID_SOCKET) { + pj_sock_close(sock_); + sock_ = PJ_INVALID_SOCKET; + } + } +}; + +int CPjSSLSocket::Connect(CPjSSLSocket_cb cb, void *key, + const TInetAddr &local_addr, + const TInetAddr &rem_addr, + const TDesC8 &servername) +{ + pj_status_t status; + + PJ_ASSERT_RETURN(state_ == SSL_STATE_NULL, PJ_EINVALIDOP); + + status = pj_sock_socket(rem_addr.Family(), pj_SOCK_STREAM(), 0, &sock_); + if (status != PJ_SUCCESS) + return status; + + // Apply QoS + status = pj_sock_apply_qos2(sock_, qos_type_, &qos_params_, + 2, THIS_FILE, NULL); + + RSocket &rSock = ((CPjSocket*)sock_)->Socket(); + + local_addr_ = local_addr; + + if (!local_addr_.IsUnspecified()) { + TInt err = rSock.Bind(local_addr_); + if (err != KErrNone) + return PJ_RETURN_OS_ERROR(err); + } + + cb_ = cb; + key_ = key; + rem_addr_ = rem_addr; + servername_.Set(servername); + state_ = SSL_STATE_CONNECTING; + + rSock.Connect(rem_addr_, iStatus); + SetActive(); + + rSock.LocalName(local_addr_); + + return PJ_EPENDING; +} + +int CPjSSLSocket::Send(CPjSSLSocket_cb cb, void *key, const TDesC8 &aDesc, + TUint flags) +{ + PJ_UNUSED_ARG(flags); + + PJ_ASSERT_RETURN(state_ == SSL_STATE_ESTABLISHED, PJ_EINVALIDOP); + + if (IsActive()) + return PJ_EBUSY; + + cb_ = cb; + key_ = key; + + securesock_->Send(aDesc, iStatus, sent_len_); + SetActive(); + + return PJ_EPENDING; +} + +int CPjSSLSocket::SendSync(const TDesC8 &aDesc, TUint flags) +{ + PJ_UNUSED_ARG(flags); + + PJ_ASSERT_RETURN(state_ == SSL_STATE_ESTABLISHED, PJ_EINVALIDOP); + + TRequestStatus reqStatus; + securesock_->Send(aDesc, reqStatus, sent_len_); + User::WaitForRequest(reqStatus); + + return PJ_RETURN_OS_ERROR(reqStatus.Int()); +} + +CPjSSLSocketReader* CPjSSLSocket::GetReader() +{ + PJ_ASSERT_RETURN(state_ == SSL_STATE_ESTABLISHED, NULL); + + if (reader_) + return reader_; + + TRAPD(err, reader_ = CPjSSLSocketReader::NewL(*securesock_)); + if (err != KErrNone) + return NULL; + + return reader_; +} + +void CPjSSLSocket::DoCancel() +{ + /* Operation to be cancelled depends on current state */ + switch (state_) { + case SSL_STATE_CONNECTING: + { + RSocket &rSock = ((CPjSocket*)sock_)->Socket(); + rSock.CancelConnect(); + + CleanupSubObjects(); + + state_ = SSL_STATE_NULL; + } + break; + case SSL_STATE_HANDSHAKING: + { + securesock_->CancelHandshake(); + securesock_->Close(); + + CleanupSubObjects(); + + state_ = SSL_STATE_NULL; + } + break; + case SSL_STATE_ESTABLISHED: + securesock_->CancelSend(); + break; + default: + break; + } +} + +void CPjSSLSocket::RunL() +{ + switch (state_) { + case SSL_STATE_CONNECTING: + if (iStatus != KErrNone) { + CleanupSubObjects(); + state_ = SSL_STATE_NULL; + /* Dispatch connect failure notification */ + if (cb_) (*cb_)(iStatus.Int(), key_); + } else { + RSocket &rSock = ((CPjSocket*)sock_)->Socket(); + + /* Get local addr */ + rSock.LocalName(local_addr_); + + /* Prepare and start handshake */ + securesock_ = CSecureSocket::NewL(rSock, ssl_proto_); + securesock_->SetDialogMode(EDialogModeAttended); + if (servername_.Length() > 0) + securesock_->SetOpt(KSoSSLDomainName, KSolInetSSL, + servername_); + securesock_->FlushSessionCache(); + securesock_->StartClientHandshake(iStatus); + SetActive(); + state_ = SSL_STATE_HANDSHAKING; + } + break; + case SSL_STATE_HANDSHAKING: + if (iStatus == KErrNone) { + state_ = SSL_STATE_ESTABLISHED; + } else { + state_ = SSL_STATE_NULL; + CleanupSubObjects(); + } + /* Dispatch connect status notification */ + if (cb_) (*cb_)(iStatus.Int(), key_); + break; + case SSL_STATE_ESTABLISHED: + /* Dispatch data sent notification */ + if (cb_) (*cb_)(iStatus.Int(), key_); + break; + default: + pj_assert(0); + break; + } +} + +typedef void (*CPjTimer_cb)(void *user_data); + +class CPjTimer : public CActive +{ +public: + CPjTimer(const pj_time_val *delay, CPjTimer_cb cb, void *user_data) : + CActive(0), cb_(cb), user_data_(user_data) + { + CActiveScheduler::Add(this); + + rtimer_.CreateLocal(); + pj_int32_t interval = PJ_TIME_VAL_MSEC(*delay) * 1000; + if (interval < 0) { + interval = 0; + } + rtimer_.After(iStatus, interval); + SetActive(); + } + + ~CPjTimer() { Cancel(); } + +private: + RTimer rtimer_; + CPjTimer_cb cb_; + void *user_data_; + + void RunL() { if (cb_) (*cb_)(user_data_); } + void DoCancel() { rtimer_.Cancel(); } +}; + +/* + * Structure of recv/read state. + */ +typedef struct read_state_t { + TPtr8 *read_buf; + TPtr8 *orig_buf; + pj_uint32_t flags; +} read_state_t; + +/* + * Structure of send/write data. + */ +typedef struct write_data_t { + pj_size_t len; + pj_ioqueue_op_key_t *key; + pj_size_t data_len; + char data[1]; +} write_data_t; + +/* + * Structure of send/write state. + */ +typedef struct write_state_t { + char *buf; + pj_size_t max_len; + char *start; + pj_size_t len; + write_data_t *current_data; + TPtrC8 send_ptr; +} write_state_t; + +/* + * Secure socket structure definition. + */ +struct pj_ssl_sock_t +{ + pj_ssl_sock_cb cb; + void *user_data; + + pj_bool_t established; + write_state_t write_state; + read_state_t read_state; + CPjTimer *connect_timer; + + CPjSSLSocket *sock; + int sock_af; + int sock_type; + pj_sockaddr local_addr; + pj_sockaddr rem_addr; + + /* QoS settings */ + pj_qos_type qos_type; + pj_qos_params qos_params; + pj_bool_t qos_ignore_error; + + + pj_ssl_sock_proto proto; + pj_time_val timeout; + unsigned ciphers_num; + pj_ssl_cipher *ciphers; + pj_str_t servername; +}; + + +/* + * Get cipher list supported by SSL/TLS backend. + */ +PJ_DEF(pj_status_t) pj_ssl_cipher_get_availables (pj_ssl_cipher ciphers[], + unsigned *cipher_num) +{ + /* Available ciphers */ + static pj_ssl_cipher ciphers_[64]; + static unsigned ciphers_num_ = 0; + unsigned i; + + PJ_ASSERT_RETURN(ciphers && cipher_num, PJ_EINVAL); + + if (ciphers_num_ == 0) { + RSocket sock; + CSecureSocket *secure_sock; + TPtrC16 proto(_L16("TLS1.0")); + + secure_sock = CSecureSocket::NewL(sock, proto); + if (secure_sock) { + TBuf8<128> ciphers_buf(0); + secure_sock->AvailableCipherSuites(ciphers_buf); + + ciphers_num_ = ciphers_buf.Length() / 2; + if (ciphers_num_ > PJ_ARRAY_SIZE(ciphers_)) + ciphers_num_ = PJ_ARRAY_SIZE(ciphers_); + for (i = 0; i < ciphers_num_; ++i) + ciphers_[i] = (pj_ssl_cipher)(ciphers_buf[i*2]*10 + + ciphers_buf[i*2+1]); + } + + delete secure_sock; + } + + if (ciphers_num_ == 0) { + return PJ_ENOTFOUND; + } + + *cipher_num = PJ_MIN(*cipher_num, ciphers_num_); + for (i = 0; i < *cipher_num; ++i) + ciphers[i] = ciphers_[i]; + + return PJ_SUCCESS; +} + +/* + * Create SSL socket instance. + */ +PJ_DEF(pj_status_t) pj_ssl_sock_create (pj_pool_t *pool, + const pj_ssl_sock_param *param, + pj_ssl_sock_t **p_ssock) +{ + pj_ssl_sock_t *ssock; + + PJ_ASSERT_RETURN(param->async_cnt == 1, PJ_EINVAL); + PJ_ASSERT_RETURN(pool && param && p_ssock, PJ_EINVAL); + + /* Allocate secure socket */ + ssock = PJ_POOL_ZALLOC_T(pool, pj_ssl_sock_t); + + /* Allocate write buffer */ + ssock->write_state.buf = (char*)pj_pool_alloc(pool, + param->send_buffer_size); + ssock->write_state.max_len = param->send_buffer_size; + ssock->write_state.start = ssock->write_state.buf; + + /* Init secure socket */ + ssock->sock_af = param->sock_af; + ssock->sock_type = param->sock_type; + ssock->cb = param->cb; + ssock->user_data = param->user_data; + ssock->ciphers_num = param->ciphers_num; + if (param->ciphers_num > 0) { + unsigned i; + ssock->ciphers = (pj_ssl_cipher*) + pj_pool_calloc(pool, param->ciphers_num, + sizeof(pj_ssl_cipher)); + for (i = 0; i < param->ciphers_num; ++i) + ssock->ciphers[i] = param->ciphers[i]; + } + pj_strdup_with_null(pool, &ssock->servername, ¶m->server_name); + + ssock->qos_type = param->qos_type; + ssock->qos_ignore_error = param->qos_ignore_error; + pj_memcpy(&ssock->qos_params, ¶m->qos_params, + sizeof(param->qos_params)); + + /* Finally */ + *p_ssock = ssock; + + return PJ_SUCCESS; +} + + +PJ_DEF(pj_status_t) pj_ssl_cert_load_from_files(pj_pool_t *pool, + const pj_str_t *CA_file, + const pj_str_t *cert_file, + const pj_str_t *privkey_file, + const pj_str_t *privkey_pass, + pj_ssl_cert_t **p_cert) +{ + PJ_UNUSED_ARG(pool); + PJ_UNUSED_ARG(CA_file); + PJ_UNUSED_ARG(cert_file); + PJ_UNUSED_ARG(privkey_file); + PJ_UNUSED_ARG(privkey_pass); + PJ_UNUSED_ARG(p_cert); + return PJ_ENOTSUP; +} + +/* + * Set SSL socket credential. + */ +PJ_DEF(pj_status_t) pj_ssl_sock_set_certificate( + pj_ssl_sock_t *ssock, + pj_pool_t *pool, + const pj_ssl_cert_t *cert) +{ + PJ_UNUSED_ARG(ssock); + PJ_UNUSED_ARG(pool); + PJ_UNUSED_ARG(cert); + return PJ_ENOTSUP; +} + +/* + * Close the SSL socket. + */ +PJ_DEF(pj_status_t) pj_ssl_sock_close(pj_ssl_sock_t *ssock) +{ + PJ_ASSERT_RETURN(ssock, PJ_EINVAL); + + delete ssock->connect_timer; + ssock->connect_timer = NULL; + + delete ssock->sock; + ssock->sock = NULL; + + delete ssock->read_state.read_buf; + delete ssock->read_state.orig_buf; + ssock->read_state.read_buf = NULL; + ssock->read_state.orig_buf = NULL; + + return PJ_SUCCESS; +} + + +/* + * Associate arbitrary data with the SSL socket. + */ +PJ_DEF(pj_status_t) pj_ssl_sock_set_user_data (pj_ssl_sock_t *ssock, + void *user_data) +{ + PJ_ASSERT_RETURN(ssock, PJ_EINVAL); + + ssock->user_data = user_data; + + return PJ_SUCCESS; +} + + +/* + * Retrieve the user data previously associated with this SSL + * socket. + */ +PJ_DEF(void*) pj_ssl_sock_get_user_data(pj_ssl_sock_t *ssock) +{ + PJ_ASSERT_RETURN(ssock, NULL); + + return ssock->user_data; +} + + +/* + * Retrieve the local address and port used by specified SSL socket. + */ +PJ_DEF(pj_status_t) pj_ssl_sock_get_info (pj_ssl_sock_t *ssock, + pj_ssl_sock_info *info) +{ + PJ_ASSERT_RETURN(ssock && info, PJ_EINVAL); + + pj_bzero(info, sizeof(*info)); + + info->established = ssock->established; + + /* Local address */ + if (ssock->sock) { + const TInetAddr* local_addr_ = ssock->sock->GetLocalAddr(); + int addrlen = sizeof(pj_sockaddr); + pj_status_t status; + + status = PjSymbianOS::Addr2pj(*local_addr_, info->local_addr, &addrlen); + if (status != PJ_SUCCESS) + return status; + } else { + pj_sockaddr_cp(&info->local_addr, &ssock->local_addr); + } + + if (info->established) { + /* Cipher suite */ + TBuf8<4> cipher; + if (ssock->sock->GetCipher(cipher) == KErrNone) { + info->cipher = (pj_ssl_cipher)cipher[1]; + } + + /* Remote address */ + pj_sockaddr_cp((pj_sockaddr_t*)&info->remote_addr, + (pj_sockaddr_t*)&ssock->rem_addr); + } + + /* Protocol */ + info->proto = ssock->proto; + + return PJ_SUCCESS; +} + + +/* + * Starts read operation on this SSL socket. + */ +PJ_DEF(pj_status_t) pj_ssl_sock_start_read (pj_ssl_sock_t *ssock, + pj_pool_t *pool, + unsigned buff_size, + pj_uint32_t flags) +{ + PJ_ASSERT_RETURN(ssock && pool && buff_size, PJ_EINVAL); + PJ_ASSERT_RETURN(ssock->established, PJ_EINVALIDOP); + + /* Reading is already started */ + if (ssock->read_state.orig_buf) { + return PJ_SUCCESS; + } + + void *readbuf[1]; + readbuf[0] = pj_pool_alloc(pool, buff_size); + return pj_ssl_sock_start_read2(ssock, pool, buff_size, readbuf, flags); +} + +static void read_cb(int err, void *key) +{ + pj_ssl_sock_t *ssock = (pj_ssl_sock_t*)key; + pj_status_t status; + + status = (err == KErrNone)? PJ_SUCCESS : PJ_RETURN_OS_ERROR(err); + + /* Check connection status */ + if (err == KErrEof || !PjSymbianOS::Instance()->IsConnectionUp() || + !ssock->established) + { + status = PJ_EEOF; + } + + /* Notify data arrival */ + if (ssock->cb.on_data_read) { + pj_size_t remainder = 0; + char *data = (char*)ssock->read_state.orig_buf->Ptr(); + pj_size_t data_len = ssock->read_state.read_buf->Length() + + ssock->read_state.read_buf->Ptr() - + ssock->read_state.orig_buf->Ptr(); + + if (data_len > 0) { + /* Notify received data */ + pj_bool_t ret = (*ssock->cb.on_data_read)(ssock, data, data_len, + status, &remainder); + if (!ret) { + /* We've been destroyed */ + return; + } + + /* Calculate available data for next READ operation */ + if (remainder > 0) { + pj_size_t data_maxlen = ssock->read_state.orig_buf->MaxLength(); + + /* There is some data left unconsumed by application, we give + * smaller buffer for next READ operation. + */ + ssock->read_state.read_buf->Set((TUint8*)data+remainder, 0, + data_maxlen - remainder); + } else { + /* Give all buffer for next READ operation. + */ + ssock->read_state.read_buf->Set(*ssock->read_state.orig_buf); + } + } + } + + if (status == PJ_SUCCESS) { + /* Perform the "next" READ operation */ + CPjSSLSocketReader *reader = ssock->sock->GetReader(); + ssock->read_state.read_buf->SetLength(0); + status = reader->Read(&read_cb, ssock, *ssock->read_state.read_buf, + ssock->read_state.flags); + if (status != PJ_EPENDING) { + /* Notify error */ + (*ssock->cb.on_data_read)(ssock, NULL, 0, status, NULL); + } + } + + if (status != PJ_SUCCESS && status != PJ_EPENDING) { + /* Connection closed or something goes wrong */ + delete ssock->read_state.read_buf; + delete ssock->read_state.orig_buf; + ssock->read_state.read_buf = NULL; + ssock->read_state.orig_buf = NULL; + ssock->established = PJ_FALSE; + } +} + +/* + * Same as #pj_ssl_sock_start_read(), except that the application + * supplies the buffers for the read operation so that the acive socket + * does not have to allocate the buffers. + */ +PJ_DEF(pj_status_t) pj_ssl_sock_start_read2 (pj_ssl_sock_t *ssock, + pj_pool_t *pool, + unsigned buff_size, + void *readbuf[], + pj_uint32_t flags) +{ + PJ_ASSERT_RETURN(ssock && buff_size && readbuf, PJ_EINVAL); + PJ_ASSERT_RETURN(ssock->established, PJ_EINVALIDOP); + + /* Return failure if access point is marked as down by app. */ + PJ_SYMBIAN_CHECK_CONNECTION(); + + /* Reading is already started */ + if (ssock->read_state.orig_buf) { + return PJ_SUCCESS; + } + + PJ_UNUSED_ARG(pool); + + /* Get reader instance */ + CPjSSLSocketReader *reader = ssock->sock->GetReader(); + if (!reader) + return PJ_ENOMEM; + + /* We manage two buffer pointers here: + * 1. orig_buf keeps the orginal buffer address (and its max length). + * 2. read_buf provides buffer for READ operation, mind that there may be + * some remainder data left by application. + */ + ssock->read_state.read_buf = new TPtr8((TUint8*)readbuf[0], 0, buff_size); + ssock->read_state.orig_buf = new TPtr8((TUint8*)readbuf[0], 0, buff_size); + ssock->read_state.flags = flags; + + pj_status_t status; + status = reader->Read(&read_cb, ssock, *ssock->read_state.read_buf, + ssock->read_state.flags); + + if (status != PJ_SUCCESS && status != PJ_EPENDING) { + delete ssock->read_state.read_buf; + delete ssock->read_state.orig_buf; + ssock->read_state.read_buf = NULL; + ssock->read_state.orig_buf = NULL; + + return status; + } + + return PJ_SUCCESS; +} + +/* + * Same as pj_ssl_sock_start_read(), except that this function is used + * only for datagram sockets, and it will trigger \a on_data_recvfrom() + * callback instead. + */ +PJ_DEF(pj_status_t) pj_ssl_sock_start_recvfrom (pj_ssl_sock_t *ssock, + pj_pool_t *pool, + unsigned buff_size, + pj_uint32_t flags) +{ + PJ_UNUSED_ARG(ssock); + PJ_UNUSED_ARG(pool); + PJ_UNUSED_ARG(buff_size); + PJ_UNUSED_ARG(flags); + return PJ_ENOTSUP; +} + +/* + * Same as #pj_ssl_sock_start_recvfrom() except that the recvfrom() + * operation takes the buffer from the argument rather than creating + * new ones. + */ +PJ_DEF(pj_status_t) pj_ssl_sock_start_recvfrom2 (pj_ssl_sock_t *ssock, + pj_pool_t *pool, + unsigned buff_size, + void *readbuf[], + pj_uint32_t flags) +{ + PJ_UNUSED_ARG(ssock); + PJ_UNUSED_ARG(pool); + PJ_UNUSED_ARG(buff_size); + PJ_UNUSED_ARG(readbuf); + PJ_UNUSED_ARG(flags); + return PJ_ENOTSUP; +} + +static void send_cb(int err, void *key) +{ + pj_ssl_sock_t *ssock = (pj_ssl_sock_t*)key; + write_state_t *st = &ssock->write_state; + + /* Check connection status */ + if (err != KErrNone || !PjSymbianOS::Instance()->IsConnectionUp() || + !ssock->established) + { + ssock->established = PJ_FALSE; + return; + } + + /* Remove sent data from buffer */ + st->start += st->current_data->len; + st->len -= st->current_data->len; + + /* Reset current outstanding send */ + st->current_data = NULL; + + /* Let's check if there is pending data to send */ + if (st->len) { + write_data_t *wdata = (write_data_t*)st->start; + pj_status_t status; + + st->send_ptr.Set((TUint8*)wdata->data, (TInt)wdata->data_len); + st->current_data = wdata; + status = ssock->sock->Send(&send_cb, ssock, st->send_ptr, 0); + if (status != PJ_EPENDING) { + ssock->established = PJ_FALSE; + st->len = 0; + return; + } + } +} + +/* + * Send data using the socket. + */ +PJ_DEF(pj_status_t) pj_ssl_sock_send (pj_ssl_sock_t *ssock, + pj_ioqueue_op_key_t *send_key, + const void *data, + pj_ssize_t *size, + unsigned flags) +{ + PJ_CHECK_STACK(); + PJ_ASSERT_RETURN(ssock && data && size, PJ_EINVAL); + PJ_ASSERT_RETURN(ssock->write_state.max_len == 0 || + ssock->write_state.max_len >= (pj_size_t)*size, + PJ_ETOOSMALL); + + /* Check connection status */ + if (!PjSymbianOS::Instance()->IsConnectionUp() || !ssock->established) + { + ssock->established = PJ_FALSE; + return PJ_ECANCELLED; + } + + write_state_t *st = &ssock->write_state; + + /* Synchronous mode */ + if (st->max_len == 0) { + st->send_ptr.Set((TUint8*)data, (TInt)*size); + return ssock->sock->SendSync(st->send_ptr, flags); + } + + /* CSecureSocket only allows one outstanding send operation, so + * we use buffering mechanism to allow application to perform send + * operations at any time. + */ + + pj_size_t avail_len = st->max_len - st->len; + pj_size_t needed_len = *size + sizeof(write_data_t) - 1; + + /* Align needed_len to be multiplication of 4 */ + needed_len = ((needed_len + 3) >> 2) << 2; + + /* Block until there is buffer slot available! */ + while (needed_len >= avail_len) { + pj_symbianos_poll(-1, -1); + avail_len = st->max_len - st->len; + } + + /* Ok, make sure the new data will not get wrapped */ + if (st->start + st->len + needed_len > st->buf + st->max_len) { + /* Align buffer left */ + pj_memmove(st->buf, st->start, st->len); + st->start = st->buf; + } + + /* Push back the send data into the buffer */ + write_data_t *wdata = (write_data_t*)(st->start + st->len); + + wdata->len = needed_len; + wdata->key = send_key; + wdata->data_len = (pj_size_t)*size; + pj_memcpy(wdata->data, data, *size); + st->len += needed_len; + + /* If no outstanding send, send it */ + if (st->current_data == NULL) { + pj_status_t status; + + wdata = (write_data_t*)st->start; + st->current_data = wdata; + st->send_ptr.Set((TUint8*)wdata->data, (TInt)wdata->data_len); + status = ssock->sock->Send(&send_cb, ssock, st->send_ptr, flags); + + if (status != PJ_EPENDING) { + *size = -status; + return status; + } + } + + return PJ_SUCCESS; +} + +/* + * Send datagram using the socket. + */ +PJ_DEF(pj_status_t) pj_ssl_sock_sendto (pj_ssl_sock_t *ssock, + pj_ioqueue_op_key_t *send_key, + const void *data, + pj_ssize_t *size, + unsigned flags, + const pj_sockaddr_t *addr, + int addr_len) +{ + PJ_UNUSED_ARG(ssock); + PJ_UNUSED_ARG(send_key); + PJ_UNUSED_ARG(data); + PJ_UNUSED_ARG(size); + PJ_UNUSED_ARG(flags); + PJ_UNUSED_ARG(addr); + PJ_UNUSED_ARG(addr_len); + return PJ_ENOTSUP; +} + +/* + * Starts asynchronous socket accept() operations on this SSL socket. + */ +PJ_DEF(pj_status_t) pj_ssl_sock_start_accept (pj_ssl_sock_t *ssock, + pj_pool_t *pool, + const pj_sockaddr_t *local_addr, + int addr_len) +{ + PJ_UNUSED_ARG(ssock); + PJ_UNUSED_ARG(pool); + PJ_UNUSED_ARG(local_addr); + PJ_UNUSED_ARG(addr_len); + + return PJ_ENOTSUP; +} + +static void connect_cb(int err, void *key) +{ + pj_ssl_sock_t *ssock = (pj_ssl_sock_t*)key; + pj_status_t status; + + if (ssock->connect_timer) { + delete ssock->connect_timer; + ssock->connect_timer = NULL; + } + + status = (err == KErrNone)? PJ_SUCCESS : PJ_RETURN_OS_ERROR(err); + if (status == PJ_SUCCESS) { + ssock->established = PJ_TRUE; + } else { + delete ssock->sock; + ssock->sock = NULL; + } + + if (ssock->cb.on_connect_complete) { + pj_bool_t ret = (*ssock->cb.on_connect_complete)(ssock, status); + if (!ret) { + /* We've been destroyed */ + return; + } + } +} + +static void connect_timer_cb(void *key) +{ + connect_cb(KErrTimedOut, key); +} + +/* + * Starts asynchronous socket connect() operation and SSL/TLS handshaking + * for this socket. Once the connection is done (either successfully or not), + * the \a on_connect_complete() callback will be called. + */ +PJ_DEF(pj_status_t) pj_ssl_sock_start_connect (pj_ssl_sock_t *ssock, + pj_pool_t *pool, + const pj_sockaddr_t *localaddr, + const pj_sockaddr_t *remaddr, + int addr_len) +{ + CPjSSLSocket *sock = NULL; + pj_status_t status; + + PJ_ASSERT_RETURN(ssock && pool && localaddr && remaddr && addr_len, + PJ_EINVAL); + + /* Check connection status */ + PJ_SYMBIAN_CHECK_CONNECTION(); + + if (ssock->sock != NULL) { + CPjSSLSocket::ssl_state state = ssock->sock->GetState(); + switch (state) { + case CPjSSLSocket::SSL_STATE_ESTABLISHED: + return PJ_SUCCESS; + default: + return PJ_EPENDING; + } + } + + /* Set SSL protocol */ + TPtrC8 proto; + + if (ssock->proto == PJ_SSL_SOCK_PROTO_DEFAULT) + ssock->proto = PJ_SSL_SOCK_PROTO_TLS1; + + /* CSecureSocket only support TLS1.0 and SSL3.0 */ + switch(ssock->proto) { + case PJ_SSL_SOCK_PROTO_TLS1: + proto.Set((const TUint8*)"TLS1.0", 6); + break; + case PJ_SSL_SOCK_PROTO_SSL3: + proto.Set((const TUint8*)"SSL3.0", 6); + break; + default: + return PJ_ENOTSUP; + } + + /* Prepare addresses */ + TInetAddr localaddr_, remaddr_; + status = PjSymbianOS::pj2Addr(*(pj_sockaddr*)localaddr, addr_len, + localaddr_); + if (status != PJ_SUCCESS) + return status; + + status = PjSymbianOS::pj2Addr(*(pj_sockaddr*)remaddr, addr_len, + remaddr_); + if (status != PJ_SUCCESS) + return status; + + pj_sockaddr_cp((pj_sockaddr_t*)&ssock->rem_addr, remaddr); + + /* Init SSL engine */ + TRAPD(err, sock = CPjSSLSocket::NewL(proto, ssock->qos_type, + ssock->qos_params)); + if (err != KErrNone) + return PJ_ENOMEM; + + if (ssock->timeout.sec != 0 || ssock->timeout.msec != 0) { + ssock->connect_timer = new CPjTimer(&ssock->timeout, + &connect_timer_cb, ssock); + } + + /* Convert server name to Symbian descriptor */ + TPtrC8 servername_((TUint8*)ssock->servername.ptr, + ssock->servername.slen); + + /* Try to connect */ + status = sock->Connect(&connect_cb, ssock, localaddr_, remaddr_, + servername_); + if (status != PJ_SUCCESS && status != PJ_EPENDING) { + delete sock; + return status; + } + + ssock->sock = sock; + return status; +} + + +PJ_DEF(pj_status_t) pj_ssl_sock_renegotiate(pj_ssl_sock_t *ssock) +{ + PJ_UNUSED_ARG(ssock); + return PJ_ENOTSUP; +} diff --git a/sflphone-common/libs/pjproject/pjlib/src/pj/timer_symbian.cpp b/sflphone-common/libs/pjproject/pjlib/src/pj/timer_symbian.cpp index 4aff5f9564eed554d9d068ea04594cd4c5a7526d..9b1127761f5bf6fa6fc62e48d2e2d49f01b0319e 100644 --- a/sflphone-common/libs/pjproject/pjlib/src/pj/timer_symbian.cpp +++ b/sflphone-common/libs/pjproject/pjlib/src/pj/timer_symbian.cpp @@ -1,5 +1,5 @@ -/* $Id: timer_symbian.cpp 2394 2008-12-23 17:27:53Z bennylp $ */ -/* +/* $Id: timer_symbian.cpp 3034 2009-12-16 13:30:34Z bennylp $ */ +/* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> * @@ -15,7 +15,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include <pj/timer.h> #include <pj/pool.h> @@ -28,103 +28,241 @@ #define DEFAULT_MAX_TIMED_OUT_PER_POLL (64) +// Maximum number of miliseconds that RTimer.At() supports +#define MAX_RTIMER_INTERVAL 2147 + +/* Absolute maximum number of timer entries */ +#ifndef PJ_SYMBIAN_TIMER_MAX_COUNT +# define PJ_SYMBIAN_TIMER_MAX_COUNT 65535 +#endif + +/* Get the number of free slots in the timer heap */ +#define FREECNT(th) (th->max_size - th->cur_size) + +// Forward declaration +class CPjTimerEntry; /** * The implementation of timer heap. */ - -struct pj_timer_heap_t { +struct pj_timer_heap_t +{ /** Maximum size of the heap. */ pj_size_t max_size; /** Current size of the heap. */ pj_size_t cur_size; - /** Max timed out entries to process per poll. */ - unsigned max_entries_per_poll; + /** Array of timer entries. A scheduled timer will occupy one slot, and + * the slot number will be saved in entry->_timer_id + */ + CPjTimerEntry **entries; + + /** Array of free slot indexes in the "entries" array */ + int *free_slots; }; - -////////////////////////////////////////////////////////////////////////////// /** * Active object for each timer entry. */ - -class CPjTimerEntry : public CActive +class CPjTimerEntry : public CActive { +public: + pj_timer_entry *entry_; + + static CPjTimerEntry* NewL( pj_timer_heap_t *timer_heap, + pj_timer_entry *entry, + const pj_time_val *delay); + + ~CPjTimerEntry(); + + virtual void RunL(); + virtual void DoCancel(); + +private: + pj_timer_heap_t *timer_heap_; + RTimer rtimer_; + pj_uint32_t interval_left_; + + CPjTimerEntry(pj_timer_heap_t *timer_heap, pj_timer_entry *entry); + void ConstructL(const pj_time_val *delay); + void Schedule(); +}; - public: - static CPjTimerEntry* NewL (pj_timer_heap_t *timer_heap, - pj_timer_entry *entry, - const pj_time_val *delay); +////////////////////////////////////////////////////////////////////////////// +/* + * Implementation. + */ - ~CPjTimerEntry(); +/* Grow timer heap to the specified size */ +static pj_status_t realloc_timer_heap(pj_timer_heap_t *th, pj_size_t new_size) +{ + typedef CPjTimerEntry *entry_ptr; + CPjTimerEntry **entries = NULL; + int *free_slots = NULL; + unsigned i, j; + + if (new_size > PJ_SYMBIAN_TIMER_MAX_COUNT) { + /* Just some sanity limit */ + new_size = PJ_SYMBIAN_TIMER_MAX_COUNT; + if (new_size <= th->max_size) { + /* We've grown large enough */ + pj_assert(!"Too many timer heap entries"); + return PJ_ETOOMANY; + } + } + + /* Allocate entries, move entries from the old array if there is one */ + entries = new entry_ptr[new_size]; + if (th->entries) { + pj_memcpy(entries, th->entries, th->max_size * sizeof(th->entries[0])); + } + /* Initialize the remaining new area */ + pj_bzero(&entries[th->max_size], + (new_size - th->max_size) * sizeof(th->entries[0])); + + /* Allocate free slots array */ + free_slots = new int[new_size]; + if (th->free_slots) { + pj_memcpy(free_slots, th->free_slots, + FREECNT(th) * sizeof(th->free_slots[0])); + } + /* Initialize the remaining new area */ + for (i=FREECNT(th), j=th->max_size; j<new_size; ++i, ++j) { + free_slots[i] = j; + } + for ( ; i<new_size; ++i) { + free_slots[i] = -1; + } + + /* Apply */ + delete [] th->entries; + th->entries = entries; + th->max_size = new_size; + delete [] th->free_slots; + th->free_slots = free_slots; - virtual void RunL(); - virtual void DoCancel(); + return PJ_SUCCESS; +} - private: - pj_timer_heap_t *timer_heap_; - pj_timer_entry *entry_; - RTimer rtimer_; +/* Allocate and register an entry to timer heap for newly scheduled entry */ +static pj_status_t add_entry(pj_timer_heap_t *th, CPjTimerEntry *entry) +{ + pj_status_t status; + int slot; + + /* Check that there's still capacity left in the timer heap */ + if (FREECNT(th) < 1) { + // Grow the timer heap twice the capacity + status = realloc_timer_heap(th, th->max_size * 2); + if (status != PJ_SUCCESS) + return status; + } + + /* Allocate one free slot. Use LIFO */ + slot = th->free_slots[FREECNT(th)-1]; + PJ_ASSERT_RETURN((slot >= 0) && (slot < (int)th->max_size) && + (th->entries[slot]==NULL), PJ_EBUG); + + th->free_slots[FREECNT(th)-1] = -1; + th->entries[slot] = entry; + entry->entry_->_timer_id = slot; + ++th->cur_size; + + return PJ_SUCCESS; +} - CPjTimerEntry (pj_timer_heap_t *timer_heap, pj_timer_entry *entry); - void ConstructL (const pj_time_val *delay); -}; +/* Free a slot when an entry's timer has elapsed or cancel */ +static pj_status_t remove_entry(pj_timer_heap_t *th, CPjTimerEntry *entry) +{ + int slot = entry->entry_->_timer_id; + + PJ_ASSERT_RETURN(slot >= 0 && slot < (int)th->max_size, PJ_EBUG); + PJ_ASSERT_RETURN(FREECNT(th) < th->max_size, PJ_EBUG); + PJ_ASSERT_RETURN(th->entries[slot]==entry, PJ_EBUG); + PJ_ASSERT_RETURN(th->free_slots[FREECNT(th)]==-1, PJ_EBUG); + + th->entries[slot] = NULL; + th->free_slots[FREECNT(th)] = slot; + entry->entry_->_timer_id = -1; + --th->cur_size; + + return PJ_SUCCESS; +} -CPjTimerEntry::CPjTimerEntry (pj_timer_heap_t *timer_heap, - pj_timer_entry *entry) - : CActive (PJ_SYMBIAN_TIMER_PRIORITY), timer_heap_ (timer_heap), entry_ (entry) +CPjTimerEntry::CPjTimerEntry(pj_timer_heap_t *timer_heap, + pj_timer_entry *entry) +: CActive(PJ_SYMBIAN_TIMER_PRIORITY), entry_(entry), timer_heap_(timer_heap), + interval_left_(0) { } -CPjTimerEntry::~CPjTimerEntry() +CPjTimerEntry::~CPjTimerEntry() { Cancel(); rtimer_.Close(); } -void CPjTimerEntry::ConstructL (const pj_time_val *delay) +void CPjTimerEntry::Schedule() { - rtimer_.CreateLocal(); - CActiveScheduler::Add (this); - - pj_int32_t interval = PJ_TIME_VAL_MSEC (*delay) * 1000; - - if (interval < 0) { - interval = 0; + pj_int32_t interval; + + if (interval_left_ > MAX_RTIMER_INTERVAL) { + interval = MAX_RTIMER_INTERVAL; + } else { + interval = interval_left_; } - - rtimer_.After (iStatus, interval); - + + interval_left_ -= interval; + rtimer_.After(iStatus, interval * 1000); SetActive(); } -CPjTimerEntry* CPjTimerEntry::NewL (pj_timer_heap_t *timer_heap, - pj_timer_entry *entry, - const pj_time_val *delay) +void CPjTimerEntry::ConstructL(const pj_time_val *delay) { - CPjTimerEntry *self = new CPjTimerEntry (timer_heap, entry); - CleanupStack::PushL (self); - self->ConstructL (delay); - CleanupStack::Pop (self); + rtimer_.CreateLocal(); + CActiveScheduler::Add(this); + + interval_left_ = PJ_TIME_VAL_MSEC(*delay); + Schedule(); +} + +CPjTimerEntry* CPjTimerEntry::NewL(pj_timer_heap_t *timer_heap, + pj_timer_entry *entry, + const pj_time_val *delay) +{ + CPjTimerEntry *self = new CPjTimerEntry(timer_heap, entry); + CleanupStack::PushL(self); + self->ConstructL(delay); + CleanupStack::Pop(self); return self; } -void CPjTimerEntry::RunL() +void CPjTimerEntry::RunL() { - --timer_heap_->cur_size; - entry_->_timer_id = NULL; - entry_->cb (timer_heap_, entry_); - + if (interval_left_ > 0) { + Schedule(); + return; + } + + remove_entry(timer_heap_, this); + entry_->cb(timer_heap_, entry_); + // Finger's crossed! delete this; } -void CPjTimerEntry::DoCancel() +void CPjTimerEntry::DoCancel() { + /* It's possible that _timer_id is -1, see schedule(). In this case, + * the entry has not been added to the timer heap, so don't remove + * it. + */ + if (entry_ && entry_->_timer_id != -1) + remove_entry(timer_heap_, this); + rtimer_.Cancel(); } @@ -135,79 +273,91 @@ void CPjTimerEntry::DoCancel() /* * Calculate memory size required to create a timer heap. */ -PJ_DEF (pj_size_t) pj_timer_heap_mem_size (pj_size_t count) +PJ_DEF(pj_size_t) pj_timer_heap_mem_size(pj_size_t count) { return /* size of the timer heap itself: */ - sizeof (pj_timer_heap_t) + - /* size of each entry: */ - (count+2) * (sizeof (pj_timer_entry*) +sizeof (pj_timer_id_t)) + - /* lock, pool etc: */ - 132; + sizeof(pj_timer_heap_t) + + /* size of each entry: */ + (count+2) * (sizeof(void*)+sizeof(int)) + + /* lock, pool etc: */ + 132; } /* * Create a new timer heap. */ -PJ_DEF (pj_status_t) pj_timer_heap_create (pj_pool_t *pool, - pj_size_t size, - pj_timer_heap_t **p_heap) +PJ_DEF(pj_status_t) pj_timer_heap_create( pj_pool_t *pool, + pj_size_t size, + pj_timer_heap_t **p_heap) { pj_timer_heap_t *ht; + pj_status_t status; - PJ_ASSERT_RETURN (pool && p_heap, PJ_EINVAL); + PJ_ASSERT_RETURN(pool && p_heap, PJ_EINVAL); *p_heap = NULL; /* Allocate timer heap data structure from the pool */ - ht = PJ_POOL_ALLOC_T (pool, pj_timer_heap_t); - + ht = PJ_POOL_ZALLOC_T(pool, pj_timer_heap_t); if (!ht) return PJ_ENOMEM; - /* Initialize timer heap sizes */ - ht->max_size = size; - - ht->cur_size = 0; - - ht->max_entries_per_poll = DEFAULT_MAX_TIMED_OUT_PER_POLL; + /* Allocate slots */ + status = realloc_timer_heap(ht, size); + if (status != PJ_SUCCESS) + return status; *p_heap = ht; - return PJ_SUCCESS; } -PJ_DEF (void) pj_timer_heap_destroy (pj_timer_heap_t *ht) +PJ_DEF(void) pj_timer_heap_destroy( pj_timer_heap_t *ht ) { - PJ_UNUSED_ARG (ht); + /* Cancel and delete pending active objects */ + if (ht->entries) { + unsigned i; + for (i=0; i<ht->max_size; ++i) { + if (ht->entries[i]) { + ht->entries[i]->Cancel(); + delete ht->entries[i]; + ht->entries[i] = NULL; + } + } + } + + delete [] ht->entries; + delete [] ht->free_slots; + + ht->entries = NULL; + ht->free_slots = NULL; } -PJ_DEF (void) pj_timer_heap_set_lock (pj_timer_heap_t *ht, +PJ_DEF(void) pj_timer_heap_set_lock( pj_timer_heap_t *ht, pj_lock_t *lock, - pj_bool_t auto_del) + pj_bool_t auto_del ) { - PJ_UNUSED_ARG (ht); - + PJ_UNUSED_ARG(ht); if (auto_del) - pj_lock_destroy (lock); + pj_lock_destroy(lock); } -PJ_DEF (unsigned) pj_timer_heap_set_max_timed_out_per_poll (pj_timer_heap_t *ht, - unsigned count) +PJ_DEF(unsigned) pj_timer_heap_set_max_timed_out_per_poll(pj_timer_heap_t *ht, + unsigned count ) { - unsigned old_count = ht->max_entries_per_poll; - ht->max_entries_per_poll = count; - return old_count; + /* Not applicable */ + PJ_UNUSED_ARG(count); + return ht->max_size; } -PJ_DEF (pj_timer_entry*) pj_timer_entry_init (pj_timer_entry *entry, - int id, - void *user_data, - pj_timer_heap_callback *cb) +PJ_DEF(pj_timer_entry*) pj_timer_entry_init( pj_timer_entry *entry, + int id, + void *user_data, + pj_timer_heap_callback *cb ) { - pj_assert (entry && cb); + pj_assert(entry && cb); - entry->_timer_id = NULL; + entry->_timer_id = -1; entry->id = id; entry->user_data = user_data; entry->cb = cb; @@ -215,74 +365,81 @@ PJ_DEF (pj_timer_entry*) pj_timer_entry_init (pj_timer_entry *entry, return entry; } -PJ_DEF (pj_status_t) pj_timer_heap_schedule (pj_timer_heap_t *ht, - pj_timer_entry *entry, - const pj_time_val *delay) +PJ_DEF(pj_status_t) pj_timer_heap_schedule( pj_timer_heap_t *ht, + pj_timer_entry *entry, + const pj_time_val *delay) { CPjTimerEntry *timerObj; - - PJ_ASSERT_RETURN (ht && entry && delay, PJ_EINVAL); - PJ_ASSERT_RETURN (entry->cb != NULL, PJ_EINVAL); + pj_status_t status; + + PJ_ASSERT_RETURN(ht && entry && delay, PJ_EINVAL); + PJ_ASSERT_RETURN(entry->cb != NULL, PJ_EINVAL); /* Prevent same entry from being scheduled more than once */ - PJ_ASSERT_RETURN (entry->_timer_id == NULL, PJ_EINVALIDOP); - - timerObj = CPjTimerEntry::NewL (ht, entry, delay); - entry->_timer_id = (void*) timerObj; - - ++ht->cur_size; + PJ_ASSERT_RETURN(entry->_timer_id < 1, PJ_EINVALIDOP); + + entry->_timer_id = -1; + + timerObj = CPjTimerEntry::NewL(ht, entry, delay); + status = add_entry(ht, timerObj); + if (status != PJ_SUCCESS) { + timerObj->Cancel(); + delete timerObj; + return status; + } + return PJ_SUCCESS; } -PJ_DEF (int) pj_timer_heap_cancel (pj_timer_heap_t *ht, - pj_timer_entry *entry) +PJ_DEF(int) pj_timer_heap_cancel( pj_timer_heap_t *ht, + pj_timer_entry *entry) { - PJ_ASSERT_RETURN (ht && entry, PJ_EINVAL); - - if (entry->_timer_id != NULL) { - CPjTimerEntry *timerObj = (CPjTimerEntry*) entry->_timer_id; - timerObj->Cancel(); - delete timerObj; - entry->_timer_id = NULL; - --ht->cur_size; - return 1; + PJ_ASSERT_RETURN(ht && entry, PJ_EINVAL); + + if (entry->_timer_id >= 0 && entry->_timer_id < (int)ht->max_size) { + CPjTimerEntry *timerObj = ht->entries[entry->_timer_id]; + if (timerObj) { + timerObj->Cancel(); + delete timerObj; + return 1; + } else { + return 0; + } } else { - return 0; + return 0; } } -PJ_DEF (unsigned) pj_timer_heap_poll (pj_timer_heap_t *ht, - pj_time_val *next_delay) +PJ_DEF(unsigned) pj_timer_heap_poll( pj_timer_heap_t *ht, + pj_time_val *next_delay ) { /* Polling is not necessary on Symbian, since all async activities * are registered to active scheduler. */ - PJ_UNUSED_ARG (ht); - + PJ_UNUSED_ARG(ht); if (next_delay) { - next_delay->sec = 1; - next_delay->msec = 0; + next_delay->sec = 1; + next_delay->msec = 0; } - return 0; } -PJ_DEF (pj_size_t) pj_timer_heap_count (pj_timer_heap_t *ht) +PJ_DEF(pj_size_t) pj_timer_heap_count( pj_timer_heap_t *ht ) { - PJ_ASSERT_RETURN (ht, 0); + PJ_ASSERT_RETURN(ht, 0); return ht->cur_size; } -PJ_DEF (pj_status_t) pj_timer_heap_earliest_time (pj_timer_heap_t * ht, - pj_time_val *timeval) +PJ_DEF(pj_status_t) pj_timer_heap_earliest_time( pj_timer_heap_t * ht, + pj_time_val *timeval) { /* We don't support this! */ - PJ_UNUSED_ARG (ht); - + PJ_UNUSED_ARG(ht); + timeval->sec = 1; timeval->msec = 0; - + return PJ_SUCCESS; } diff --git a/sflphone-common/libs/pjproject/pjlib/src/pj/unicode_symbian.cpp b/sflphone-common/libs/pjproject/pjlib/src/pj/unicode_symbian.cpp index c1ce1e52e5a0f93886aa1ba60f22116695b8ce9b..b7404b4e9a74310bd20be0e00ae8fe098ee56f12 100644 --- a/sflphone-common/libs/pjproject/pjlib/src/pj/unicode_symbian.cpp +++ b/sflphone-common/libs/pjproject/pjlib/src/pj/unicode_symbian.cpp @@ -1,5 +1,5 @@ -/* $Id: unicode_symbian.cpp 2394 2008-12-23 17:27:53Z bennylp $ */ -/* +/* $Id: unicode_symbian.cpp 3047 2010-01-06 14:35:13Z bennylp $ */ +/* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> * @@ -15,7 +15,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include <pj/unicode.h> @@ -25,20 +25,23 @@ /* * Convert ANSI strings to Unicode strings. */ -PJ_DEF (wchar_t*) pj_ansi_to_unicode (const char *str, pj_size_t len, - wchar_t *wbuf, pj_size_t wbuf_count) +PJ_DEF(wchar_t*) pj_ansi_to_unicode( const char *str, pj_size_t len, + wchar_t *wbuf, pj_size_t wbuf_count) { - TPtrC8 aForeign ( (const TUint8*) str, (TInt) len); - TPtr16 aUnicode ( (TUint16*) wbuf, (TInt) (wbuf_count-1)); + TPtrC8 aForeign((const TUint8*)str, (TInt)len); + TPtr16 aUnicode((TUint16*)wbuf, (TInt)(wbuf_count-1)); TInt left; - left = PjSymbianOS::Instance()->ConvertToUnicode (aUnicode, aForeign); + left = PjSymbianOS::Instance()->ConvertToUnicode(aUnicode, aForeign); if (left != 0) { - // Error, or there are unconvertable characters - *wbuf = 0; + // Error, or there are unconvertable characters + *wbuf = 0; } else { - wbuf[len] = 0; + if (len < wbuf_count) + wbuf[len] = 0; + else + wbuf[len-1] = 0; } return wbuf; @@ -48,20 +51,23 @@ PJ_DEF (wchar_t*) pj_ansi_to_unicode (const char *str, pj_size_t len, /* * Convert Unicode string to ANSI string. */ -PJ_DEF (char*) pj_unicode_to_ansi (const wchar_t *wstr, pj_size_t len, - char *buf, pj_size_t buf_size) +PJ_DEF(char*) pj_unicode_to_ansi( const wchar_t *wstr, pj_size_t len, + char *buf, pj_size_t buf_size) { - TPtrC16 aUnicode ( (const TUint16*) wstr, (TInt) len); - TPtr8 aForeign ( (TUint8*) buf, (TInt) (buf_size-1)); + TPtrC16 aUnicode((const TUint16*)wstr, (TInt)len); + TPtr8 aForeign((TUint8*)buf, (TInt)(buf_size-1)); TInt left; - left = PjSymbianOS::Instance()->ConvertFromUnicode (aForeign, aUnicode); + left = PjSymbianOS::Instance()->ConvertFromUnicode(aForeign, aUnicode); if (left != 0) { - // Error, or there are unconvertable characters - buf[0] = '\0'; + // Error, or there are unconvertable characters + buf[0] = '\0'; } else { - buf[len] = '\0'; + if (len < buf_size) + buf[len] = '\0'; + else + buf[len-1] = '\0'; } return buf; diff --git a/sflphone-common/libs/pjproject/pjlib/src/pj/unicode_win32.c b/sflphone-common/libs/pjproject/pjlib/src/pj/unicode_win32.c index 3153a09bf6724e5454095872beb6c90ca961a956..47fa8c83fee0f84508bc5b7ae7f8d1465f4f2fa3 100644 --- a/sflphone-common/libs/pjproject/pjlib/src/pj/unicode_win32.c +++ b/sflphone-common/libs/pjproject/pjlib/src/pj/unicode_win32.c @@ -1,4 +1,4 @@ -/* $Id: unicode_win32.c 2394 2008-12-23 17:27:53Z bennylp $ */ +/* $Id: unicode_win32.c 3047 2010-01-06 14:35:13Z bennylp $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> @@ -30,7 +30,13 @@ PJ_DEF(wchar_t*) pj_ansi_to_unicode(const char *s, pj_size_t len, len = MultiByteToWideChar(CP_ACP, 0, s, len, buf, buf_count); - buf[len] = 0; + if (buf_count) { + if (len < buf_count) + buf[len] = 0; + else + buf[len-1] = 0; + } + return buf; } @@ -41,7 +47,13 @@ PJ_DEF(char*) pj_unicode_to_ansi( const wchar_t *wstr, pj_size_t len, PJ_ASSERT_RETURN(wstr && buf, NULL); len = WideCharToMultiByte(CP_ACP, 0, wstr, len, buf, buf_size, NULL, NULL); - buf[len] = '\0'; + if (buf_size) { + if (len < buf_size) + buf[len] = '\0'; + else + buf[len-1] = '\0'; + } + return buf; } diff --git a/sflphone-common/libs/pjproject/pjlib/src/pjlib++-test/main.cpp b/sflphone-common/libs/pjproject/pjlib/src/pjlib++-test/main.cpp index f69f4cc75a4bf3bcc3c7d2b753200a1e0d199257..6b749ad62dfba137f30cd89cc30c0d60113ab5e4 100644 --- a/sflphone-common/libs/pjproject/pjlib/src/pjlib++-test/main.cpp +++ b/sflphone-common/libs/pjproject/pjlib/src/pjlib++-test/main.cpp @@ -1,5 +1,5 @@ /* $Id */ -/* +/* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> * @@ -15,7 +15,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include <pj++/file.hpp> #include <pj++/list.hpp> @@ -42,20 +42,20 @@ int main() Pj_Caching_Pool mem; Pj_Pool the_pool; Pj_Pool *pool = &the_pool; + + the_pool.attach(mem.create_pool(4000,4000)); - the_pool.attach (mem.create_pool (4000,4000)); - - Pj_Semaphore_Lock lsem (pool); + Pj_Semaphore_Lock lsem(pool); Pj_Semaphore_Lock *plsem; - plsem = new (pool) Pj_Semaphore_Lock (pool); + plsem = new(pool) Pj_Semaphore_Lock(pool); delete plsem; - Pj_Proactor proactor (pool, 100, 100); + Pj_Proactor proactor(pool, 100, 100); - My_Event_Handler *event_handler = new (the_pool) My_Event_Handler; - proactor.register_socket_handler (pool, event_handler); - proactor.unregister_handler (event_handler); + My_Event_Handler *event_handler = new(the_pool) My_Event_Handler; + proactor.register_socket_handler(pool, event_handler); + proactor.unregister_handler(event_handler); return 0; } diff --git a/sflphone-common/libs/pjproject/pjlib/src/pjlib-test/activesock.c b/sflphone-common/libs/pjproject/pjlib/src/pjlib-test/activesock.c index 2b7320411348a46fc75fcc0cdb2e34860fee4837..42c5900666bb347e63efd2e196e394d346b9e9f0 100644 --- a/sflphone-common/libs/pjproject/pjlib/src/pjlib-test/activesock.c +++ b/sflphone-common/libs/pjproject/pjlib/src/pjlib-test/activesock.c @@ -1,4 +1,4 @@ -/* $Id: activesock.c 2771 2009-06-17 13:31:13Z bennylp $ */ +/* $Id: activesock.c 3048 2010-01-08 09:53:31Z bennylp $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> @@ -490,8 +490,6 @@ int activesock_test(void) { int ret; - ret = (int)&udp_ping_pong_test; - PJ_LOG(3,("", "..udp ping/pong test")); ret = udp_ping_pong_test(); if (ret != 0) diff --git a/sflphone-common/libs/pjproject/pjlib/src/pjlib-test/errno.c b/sflphone-common/libs/pjproject/pjlib/src/pjlib-test/errno.c index c0c5865f1aa78e9565beb39c38693718d46bfc1f..b6445f2952ef84408f51fb24ce2edd7a7bd3f7a2 100644 --- a/sflphone-common/libs/pjproject/pjlib/src/pjlib-test/errno.c +++ b/sflphone-common/libs/pjproject/pjlib/src/pjlib-test/errno.c @@ -1,4 +1,4 @@ -/* $Id: errno.c 2394 2008-12-23 17:27:53Z bennylp $ */ +/* $Id: errno.c 2992 2009-11-09 04:09:13Z bennylp $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> @@ -158,6 +158,10 @@ int errno_test(void) PJ_LOG(3,(THIS_FILE, "...msg for rc=PJ_EBUG, cut at %d chars: '%s'", CUT, errbuf)); + /* Perror */ + pj_perror(3, THIS_FILE, PJ_SUCCESS, "...testing %s", "pj_perror"); + PJ_PERROR(3,(THIS_FILE, PJ_SUCCESS, "...testing %s", "PJ_PERROR")); + return 0; } diff --git a/sflphone-common/libs/pjproject/pjlib/src/pjlib-test/exception_wrap.cpp b/sflphone-common/libs/pjproject/pjlib/src/pjlib-test/exception_wrap.cpp index d9e4b682e4a6b8441f08cf32af704dff42c401b4..ecc542e79b7a882260bead57d95e5aba1fa0802e 100644 --- a/sflphone-common/libs/pjproject/pjlib/src/pjlib-test/exception_wrap.cpp +++ b/sflphone-common/libs/pjproject/pjlib/src/pjlib-test/exception_wrap.cpp @@ -1,5 +1,5 @@ /* $Id: exception_wrap.cpp 2873 2009-08-13 11:54:35Z nanang $ */ -/* +/* * Copyright (C) 2009 Teluu Inc. (http://www.teluu.com) * * This program is free software; you can redistribute it and/or modify @@ -14,7 +14,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* diff --git a/sflphone-common/libs/pjproject/pjlib/src/pjlib-test/ioq_tcp.c b/sflphone-common/libs/pjproject/pjlib/src/pjlib-test/ioq_tcp.c index bf7f7f5b73ee10af79b0e456d0886014c4ac26d1..a699f54bdf18c405bcdc2745cbdf078f10436db0 100644 --- a/sflphone-common/libs/pjproject/pjlib/src/pjlib-test/ioq_tcp.c +++ b/sflphone-common/libs/pjproject/pjlib/src/pjlib-test/ioq_tcp.c @@ -1,4 +1,4 @@ -/* $Id: ioq_tcp.c 2394 2008-12-23 17:27:53Z bennylp $ */ +/* $Id: ioq_tcp.c 3051 2010-01-08 13:08:05Z nanang $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> @@ -97,6 +97,15 @@ static void on_ioqueue_accept(pj_ioqueue_key_t *key, "invalid socket and status is %d", status)); } } else { + pj_sockaddr addr; + int client_addr_len; + + client_addr_len = sizeof(addr); + status = pj_sock_getsockname(sock, &addr, &client_addr_len); + if (status != PJ_SUCCESS) { + app_perror("...ERROR in pj_sock_getsockname()", status); + } + callback_accept_key = key; callback_accept_op = op_key; callback_accept_status = status; @@ -757,30 +766,28 @@ static int compliance_test_2(pj_bool_t allow_concur) ++pending_op; } - } - - - // Poll until all connected - while (pending_op) { - pj_time_val timeout = {1, 0}; + // Poll until connection of this pair established + while (pending_op) { + pj_time_val timeout = {1, 0}; #ifdef PJ_SYMBIAN - status = pj_symbianos_poll(-1, 1000); + status = pj_symbianos_poll(-1, 1000); #else - status = pj_ioqueue_poll(ioque, &timeout); + status = pj_ioqueue_poll(ioque, &timeout); #endif - if (status > 0) { - if (status > pending_op) { - PJ_LOG(3,(THIS_FILE, - "...error: pj_ioqueue_poll() returned %d " - "(only expecting %d)", - status, pending_op)); - return -110; - } - pending_op -= status; - - if (pending_op == 0) { - status = 0; + if (status > 0) { + if (status > pending_op) { + PJ_LOG(3,(THIS_FILE, + "...error: pj_ioqueue_poll() returned %d " + "(only expecting %d)", + status, pending_op)); + return -110; + } + pending_op -= status; + + if (pending_op == 0) { + status = 0; + } } } } diff --git a/sflphone-common/libs/pjproject/pjlib/src/pjlib-test/main_symbian.cpp b/sflphone-common/libs/pjproject/pjlib/src/pjlib-test/main_symbian.cpp index a0b2ec7d1986c83b8ba8b90335b15a2123c4a8fd..a91b671f2cb11adf3d02369bb100a42dfa5e79fe 100644 --- a/sflphone-common/libs/pjproject/pjlib/src/pjlib-test/main_symbian.cpp +++ b/sflphone-common/libs/pjproject/pjlib/src/pjlib-test/main_symbian.cpp @@ -25,10 +25,8 @@ int main() //err = test_main(); if (err) - return err; - + return err; return exp; - //return 0; } @@ -48,31 +46,31 @@ LOCAL_D CConsoleBase* console; // write all messages to this class MyScheduler : public CActiveScheduler { +public: + MyScheduler() + {} - public: - MyScheduler() {} - - void Error (TInt aError) const; + void Error(TInt aError) const; }; -void MyScheduler::Error (TInt aError) const +void MyScheduler::Error(TInt aError) const { - PJ_UNUSED_ARG (aError); + PJ_UNUSED_ARG(aError); } LOCAL_C void DoStartL() -{ + { // Create active scheduler (to run active objects) CActiveScheduler* scheduler = new (ELeave) MyScheduler; - CleanupStack::PushL (scheduler); - CActiveScheduler::Install (scheduler); + CleanupStack::PushL(scheduler); + CActiveScheduler::Install(scheduler); test_main(); - CActiveScheduler::Install (NULL); - CleanupStack::Pop (scheduler); + CActiveScheduler::Install(NULL); + CleanupStack::Pop(scheduler); delete scheduler; -} + } #define WRITE_TO_DEBUG_CONSOLE @@ -81,59 +79,55 @@ LOCAL_C void DoStartL() #endif // Global Functions -static void log_writer (int level, const char *buf, int len) +static void log_writer(int level, const char *buf, int len) { static wchar_t buf16[PJ_LOG_MAX_SIZE]; - PJ_UNUSED_ARG (level); - - pj_ansi_to_unicode (buf, len, buf16, PJ_ARRAY_SIZE (buf16)); + PJ_UNUSED_ARG(level); + + pj_ansi_to_unicode(buf, len, buf16, PJ_ARRAY_SIZE(buf16)); buf16[len] = 0; buf16[len+1] = 0; - - TPtrC16 aBuf ( (const TUint16*) buf16, (TInt) len); - console->Write (aBuf); - + + TPtrC16 aBuf((const TUint16*)buf16, (TInt)len); + console->Write(aBuf); + #ifdef WRITE_TO_DEBUG_CONSOLE - RDebug::Print (aBuf); + RDebug::Print(aBuf); #endif } GLDEF_C TInt E32Main() -{ + { // Create cleanup stack __UHEAP_MARK; CTrapCleanup* cleanup = CTrapCleanup::New(); // Create output console - TRAPD (createError, console = Console::NewL (_L ("Console"), TSize (KConsFullScreen,KConsFullScreen))); - + TRAPD(createError, console = Console::NewL(_L("Console"), TSize(KConsFullScreen,KConsFullScreen))); if (createError) return createError; - pj_log_set_log_func (&log_writer); + pj_log_set_log_func(&log_writer); // Run application code inside TRAP harness, wait keypress when terminated - TRAPD (mainError, DoStartL()); - + TRAPD(mainError, DoStartL()); if (mainError) - console->Printf (_L (" failed, leave code = %d"), mainError); - - console->Printf (_L (" [press any key]\n")); - + console->Printf(_L(" failed, leave code = %d"), mainError); + + console->Printf(_L(" [press any key]\n")); console->Getch(); - + delete console; - delete cleanup; - - CloseSTDLIB(); - + + CloseSTDLIB(); + __UHEAP_MARKEND; - + return KErrNone; -} + } #endif /* if 0 */ diff --git a/sflphone-common/libs/pjproject/pjlib/src/pjlib-test/pool_wrap.cpp b/sflphone-common/libs/pjproject/pjlib/src/pjlib-test/pool_wrap.cpp index 93d64af92e08988cb64ad15063b1ea38c40caf60..381e42aee345d4da3a9025e6f150e30df638c6dc 100644 --- a/sflphone-common/libs/pjproject/pjlib/src/pjlib-test/pool_wrap.cpp +++ b/sflphone-common/libs/pjproject/pjlib/src/pjlib-test/pool_wrap.cpp @@ -1,5 +1,5 @@ /* $Id: pool_wrap.cpp 2873 2009-08-13 11:54:35Z nanang $ */ -/* +/* * Copyright (C) 2009 Teluu Inc. (http://www.teluu.com) * * This program is free software; you can redistribute it and/or modify @@ -14,7 +14,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* diff --git a/sflphone-common/libs/pjproject/pjlib/src/pjlib-test/sock.c b/sflphone-common/libs/pjproject/pjlib/src/pjlib-test/sock.c index 19ecd74a54b71317a199dddf4c67598c46830acb..ac5cc3333e7fada77f56db55e45143ab0a25ab4b 100644 --- a/sflphone-common/libs/pjproject/pjlib/src/pjlib-test/sock.c +++ b/sflphone-common/libs/pjproject/pjlib/src/pjlib-test/sock.c @@ -1,4 +1,4 @@ -/* $Id: sock.c 2863 2009-08-12 10:56:06Z bennylp $ */ +/* $Id: sock.c 3044 2010-01-04 16:54:50Z nanang $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> @@ -72,6 +72,18 @@ static char bigdata[BIG_DATA_LEN]; static char bigbuffer[BIG_DATA_LEN]; +/* Macro for checking the value of "sin_len" member of sockaddr + * (it must always be zero). + */ +#if defined(PJ_SOCKADDR_HAS_LEN) && PJ_SOCKADDR_HAS_LEN!=0 +# define CHECK_SA_ZERO_LEN(addr, ret) \ + if (((pj_addr_hdr*)(addr))->sa_zero_len != 0) \ + return ret +#else +# define CHECK_SA_ZERO_LEN(addr, ret) +#endif + + static int format_test(void) { pj_str_t s = pj_str(ADDRESS); @@ -167,6 +179,28 @@ static int format_test(void) /* pj_gethostaddr() */ + /* Various constants */ +#if !defined(PJ_SYMBIAN) || PJ_SYMBIAN==0 + if (PJ_AF_INET==0xFFFF) return -5500; + if (PJ_AF_INET6==0xFFFF) return -5501; + + /* 0xFFFF could be a valid SOL_SOCKET (e.g: on some Win or Mac) */ + //if (PJ_SOL_SOCKET==0xFFFF) return -5503; + + if (PJ_SOL_IP==0xFFFF) return -5502; + if (PJ_SOL_TCP==0xFFFF) return -5510; + if (PJ_SOL_UDP==0xFFFF) return -5520; + if (PJ_SOL_IPV6==0xFFFF) return -5530; + + if (PJ_SO_TYPE==0xFFFF) return -5540; + if (PJ_SO_RCVBUF==0xFFFF) return -5550; + if (PJ_SO_SNDBUF==0xFFFF) return -5560; + if (PJ_TCP_NODELAY==0xFFFF) return -5570; + if (PJ_SO_REUSEADDR==0xFFFF) return -5580; + + if (PJ_MSG_OOB==0xFFFF) return -5590; + if (PJ_MSG_PEEK==0xFFFF) return -5600; +#endif return 0; } @@ -262,6 +296,9 @@ static int parse_test(void) return -10; } + /* Check "sin_len" member of parse result */ + CHECK_SA_ZERO_LEN(&addr, -20); + /* Build the correct result */ status = pj_sockaddr_init(valid_tests[i].result_af, &result, @@ -290,6 +327,9 @@ static int parse_test(void) return -50; } + /* Check "sin_len" member of parse result */ + CHECK_SA_ZERO_LEN(&addr, -55); + /* Compare the result again */ if (pj_sockaddr_cmp(&addr, &result) != 0) { PJ_LOG(1,("test", ".... parsed result mismatched for %s", @@ -329,6 +369,68 @@ static int parse_test(void) return 0; } +static int purity_test(void) +{ + PJ_LOG(3,("test", "...purity_test()")); + +#if defined(PJ_SOCKADDR_HAS_LEN) && PJ_SOCKADDR_HAS_LEN!=0 + /* Check on "sin_len" member of sockaddr */ + { + const pj_str_t str_ip = {"1.1.1.1", 7}; + pj_sockaddr addr[16]; + pj_addrinfo ai[16]; + unsigned cnt; + pj_status_t rc; + + /* pj_enum_ip_interface() */ + cnt = PJ_ARRAY_SIZE(addr); + rc = pj_enum_ip_interface(pj_AF_UNSPEC(), &cnt, addr); + if (rc == PJ_SUCCESS) { + while (cnt--) + CHECK_SA_ZERO_LEN(&addr[cnt], -10); + } + + /* pj_gethostip() on IPv4 */ + rc = pj_gethostip(pj_AF_INET(), &addr[0]); + if (rc == PJ_SUCCESS) + CHECK_SA_ZERO_LEN(&addr[0], -20); + + /* pj_gethostip() on IPv6 */ + rc = pj_gethostip(pj_AF_INET6(), &addr[0]); + if (rc == PJ_SUCCESS) + CHECK_SA_ZERO_LEN(&addr[0], -30); + + /* pj_getdefaultipinterface() on IPv4 */ + rc = pj_getdefaultipinterface(pj_AF_INET(), &addr[0]); + if (rc == PJ_SUCCESS) + CHECK_SA_ZERO_LEN(&addr[0], -40); + + /* pj_getdefaultipinterface() on IPv6 */ + rc = pj_getdefaultipinterface(pj_AF_INET6(), &addr[0]); + if (rc == PJ_SUCCESS) + CHECK_SA_ZERO_LEN(&addr[0], -50); + + /* pj_getaddrinfo() on a host name */ + cnt = PJ_ARRAY_SIZE(ai); + rc = pj_getaddrinfo(pj_AF_UNSPEC(), pj_gethostname(), &cnt, ai); + if (rc == PJ_SUCCESS) { + while (cnt--) + CHECK_SA_ZERO_LEN(&ai[cnt].ai_addr, -60); + } + + /* pj_getaddrinfo() on an IP address */ + cnt = PJ_ARRAY_SIZE(ai); + rc = pj_getaddrinfo(pj_AF_UNSPEC(), &str_ip, &cnt, ai); + if (rc == PJ_SUCCESS) { + pj_assert(cnt == 1); + CHECK_SA_ZERO_LEN(&ai[0].ai_addr, -70); + } + } +#endif + + return 0; +} + static int simple_sock_test(void) { int types[2]; @@ -738,6 +840,10 @@ int sock_test() if (rc != 0) return rc; + rc = purity_test(); + if (rc != 0) + return rc; + rc = gethostbyname_test(); if (rc != 0) return rc; diff --git a/sflphone-common/libs/pjproject/pjlib/src/pjlib-test/ssl_sock.c b/sflphone-common/libs/pjproject/pjlib/src/pjlib-test/ssl_sock.c new file mode 100644 index 0000000000000000000000000000000000000000..691e48bfebe357e9fa5b4a892b2658fcd797f243 --- /dev/null +++ b/sflphone-common/libs/pjproject/pjlib/src/pjlib-test/ssl_sock.c @@ -0,0 +1,1196 @@ +/* $Id: ssl_sock.c 3018 2009-11-11 07:14:28Z nanang $ */ +/* + * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) + * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ +#include "test.h" +#include <pjlib.h> + + +#define CERT_DIR "../build/" +#define CERT_CA_FILE NULL +#define CERT_FILE CERT_DIR "cacert.pem" +#define CERT_PRIVKEY_FILE CERT_DIR "privkey.pem" +#define CERT_PRIVKEY_PASS "" + + +#if INCLUDE_SSLSOCK_TEST + +/* Global vars */ +static int clients_num; + +struct send_key { + pj_ioqueue_op_key_t op_key; +}; + + +static int get_cipher_list(void) { + pj_status_t status; + pj_ssl_cipher ciphers[100]; + unsigned cipher_num; + unsigned i; + + cipher_num = PJ_ARRAY_SIZE(ciphers); + status = pj_ssl_cipher_get_availables(ciphers, &cipher_num); + if (status != PJ_SUCCESS) { + app_perror("...FAILED to get available ciphers", status); + return status; + } + + PJ_LOG(3, ("", "...Found %u ciphers:", cipher_num)); + for (i = 0; i < cipher_num; ++i) { + const char* st; + st = pj_ssl_cipher_name(ciphers[i]); + if (st == NULL) + st = "[Unknown]"; + + PJ_LOG(3, ("", "...%3u: 0x%08x=%s", i+1, ciphers[i], st)); + } + + return PJ_SUCCESS; +} + + +struct test_state +{ + pj_pool_t *pool; /* pool */ + pj_bool_t is_server; /* server role flag */ + pj_bool_t is_verbose; /* verbose flag, e.g: cert info */ + pj_bool_t echo; /* echo received data */ + pj_status_t err; /* error flag */ + unsigned sent; /* bytes sent */ + unsigned recv; /* bytes received */ + pj_uint8_t read_buf[256]; /* read buffer */ + pj_bool_t done; /* test done flag */ + char *send_str; /* data to send once connected */ + unsigned send_str_len; /* send data length */ + pj_bool_t check_echo; /* flag to compare sent & echoed data */ + const char *check_echo_ptr; /* pointer/cursor for comparing data */ + struct send_key send_key; /* send op key */ +}; + +static void dump_cert_info(const char *prefix, const pj_ssl_cert_info *ci) +{ + const char *wdays[] = {"Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"}; + pj_parsed_time pt1; + pj_parsed_time pt2; + + pj_time_decode(&ci->validity_start, &pt1); + pj_time_decode(&ci->validity_end, &pt2); + + PJ_LOG(3, ("", "%sSubject : %.*s", prefix, ci->subject.slen, ci->subject.ptr)); + PJ_LOG(3, ("", "%sIssuer : %.*s", prefix, ci->issuer.slen, ci->issuer.ptr)); + PJ_LOG(3, ("", "%sVersion : v%d", prefix, ci->version)); + PJ_LOG(3, ("", "%sValid from : %s %4d-%02d-%02d %02d:%02d:%02d.%03d %s", + prefix, wdays[pt1.wday], pt1.year, pt1.mon+1, pt1.day, + pt1.hour, pt1.min, pt1.sec, pt1.msec, + (ci->validity_use_gmt? "GMT":""))); + PJ_LOG(3, ("", "%sValid to : %s %4d-%02d-%02d %02d:%02d:%02d.%03d %s", + prefix, wdays[pt2.wday], pt2.year, pt2.mon+1, pt2.day, + pt2.hour, pt2.min, pt2.sec, pt2.msec, + (ci->validity_use_gmt? "GMT":""))); +} + + +static pj_bool_t ssl_on_connect_complete(pj_ssl_sock_t *ssock, + pj_status_t status) +{ + struct test_state *st = (struct test_state*) + pj_ssl_sock_get_user_data(ssock); + void *read_buf[1]; + pj_ssl_sock_info info; + char buf1[64], buf2[64]; + + if (status != PJ_SUCCESS) { + app_perror("...ERROR ssl_on_connect_complete()", status); + goto on_return; + } + + status = pj_ssl_sock_get_info(ssock, &info); + if (status != PJ_SUCCESS) { + app_perror("...ERROR pj_ssl_sock_get_info()", status); + goto on_return; + } + + pj_sockaddr_print((pj_sockaddr_t*)&info.local_addr, buf1, sizeof(buf1), 1); + pj_sockaddr_print((pj_sockaddr_t*)&info.remote_addr, buf2, sizeof(buf2), 1); + PJ_LOG(3, ("", "...Connected %s -> %s!", buf1, buf2)); + + if (st->is_verbose) { + const char *tmp_st; + + /* Print cipher name */ + tmp_st = pj_ssl_cipher_name(info.cipher); + if (tmp_st == NULL) + tmp_st = "[Unknown]"; + PJ_LOG(3, ("", ".....Cipher: %s", tmp_st)); + + /* Print certificates info */ + if (info.local_cert_info.subject.slen) { + PJ_LOG(3, ("", ".....Local certificate info:")); + dump_cert_info(".......", &info.local_cert_info); + } + if (info.remote_cert_info.subject.slen) { + PJ_LOG(3, ("", ".....Remote certificate info:")); + dump_cert_info(".......", &info.remote_cert_info); + } + } + + /* Start reading data */ + read_buf[0] = st->read_buf; + status = pj_ssl_sock_start_read2(ssock, st->pool, sizeof(st->read_buf), (void**)read_buf, 0); + if (status != PJ_SUCCESS) { + app_perror("...ERROR pj_ssl_sock_start_read2()", status); + goto on_return; + } + + /* Start sending data */ + while (st->sent < st->send_str_len) { + pj_ssize_t size; + + size = st->send_str_len - st->sent; + status = pj_ssl_sock_send(ssock, (pj_ioqueue_op_key_t*)&st->send_key, + st->send_str + st->sent, &size, 0); + if (status != PJ_SUCCESS && status != PJ_EPENDING) { + app_perror("...ERROR pj_ssl_sock_send()", status); + goto on_return; + } + + if (status == PJ_SUCCESS) + st->sent += size; + else + break; + } + +on_return: + st->err = status; + + if (st->err != PJ_SUCCESS) { + pj_ssl_sock_close(ssock); + clients_num--; + return PJ_FALSE; + } + + return PJ_TRUE; +} + + +static pj_bool_t ssl_on_accept_complete(pj_ssl_sock_t *ssock, + pj_ssl_sock_t *newsock, + const pj_sockaddr_t *src_addr, + int src_addr_len) +{ + struct test_state *parent_st = (struct test_state*) + pj_ssl_sock_get_user_data(ssock); + struct test_state *st; + void *read_buf[1]; + pj_status_t status; + + PJ_UNUSED_ARG(src_addr_len); + + /* Duplicate parent test state to newly accepted test state */ + st = pj_pool_zalloc(parent_st->pool, sizeof(struct test_state)); + *st = *parent_st; + pj_ssl_sock_set_user_data(newsock, st); + + if (st->is_verbose) { + pj_ssl_sock_info info; + char buf[64]; + const char *tmp_st; + + status = pj_ssl_sock_get_info(newsock, &info); + if (status != PJ_SUCCESS) { + app_perror("...ERROR pj_ssl_sock_get_info()", status); + goto on_return; + } + + pj_sockaddr_print(src_addr, buf, sizeof(buf), 1); + PJ_LOG(3, ("", "...Accepted connection from %s", buf)); + + /* Print cipher name */ + tmp_st = pj_ssl_cipher_name(info.cipher); + if (tmp_st == NULL) + tmp_st = "[Unknown]"; + PJ_LOG(3, ("", ".....Cipher: %s", tmp_st)); + + /* Print certificates info */ + if (info.local_cert_info.subject.slen) { + PJ_LOG(3, ("", ".....Local certificate info:")); + dump_cert_info(".......", &info.local_cert_info); + } + if (info.remote_cert_info.subject.slen) { + PJ_LOG(3, ("", ".....Remote certificate info:")); + dump_cert_info(".......", &info.remote_cert_info); + } + } + + /* Start reading data */ + read_buf[0] = st->read_buf; + status = pj_ssl_sock_start_read2(newsock, st->pool, sizeof(st->read_buf), (void**)read_buf, 0); + if (status != PJ_SUCCESS) { + app_perror("...ERROR pj_ssl_sock_start_read2()", status); + goto on_return; + } + + /* Start sending data */ + while (st->sent < st->send_str_len) { + pj_ssize_t size; + + size = st->send_str_len - st->sent; + status = pj_ssl_sock_send(newsock, (pj_ioqueue_op_key_t*)&st->send_key, + st->send_str + st->sent, &size, 0); + if (status != PJ_SUCCESS && status != PJ_EPENDING) { + app_perror("...ERROR pj_ssl_sock_send()", status); + goto on_return; + } + + if (status == PJ_SUCCESS) + st->sent += size; + else + break; + } + +on_return: + st->err = status; + + if (st->err != PJ_SUCCESS) { + pj_ssl_sock_close(newsock); + return PJ_FALSE; + } + + return PJ_TRUE; +} + +static pj_bool_t ssl_on_data_read(pj_ssl_sock_t *ssock, + void *data, + pj_size_t size, + pj_status_t status, + pj_size_t *remainder) +{ + struct test_state *st = (struct test_state*) + pj_ssl_sock_get_user_data(ssock); + + PJ_UNUSED_ARG(remainder); + PJ_UNUSED_ARG(data); + + if (size > 0) { + pj_size_t consumed; + + /* Set random remainder */ + *remainder = pj_rand() % 100; + + /* Apply zero remainder if: + * - remainder is less than size, or + * - connection closed/error + * - echo/check_eco set + */ + if (*remainder > size || status != PJ_SUCCESS || st->echo || st->check_echo) + *remainder = 0; + + consumed = size - *remainder; + st->recv += consumed; + + //printf("%.*s", consumed, (char*)data); + + pj_memmove(data, (char*)data + consumed, *remainder); + + /* Echo data when specified to */ + if (st->echo) { + pj_ssize_t size_ = consumed; + status = pj_ssl_sock_send(ssock, (pj_ioqueue_op_key_t*)&st->send_key, data, &size_, 0); + if (status != PJ_SUCCESS && status != PJ_EPENDING) { + app_perror("...ERROR pj_ssl_sock_send()", status); + goto on_return; + } + + if (status == PJ_SUCCESS) + st->sent += size_; + } + + /* Verify echoed data when specified to */ + if (st->check_echo) { + if (!st->check_echo_ptr) + st->check_echo_ptr = st->send_str; + + if (pj_memcmp(st->check_echo_ptr, data, consumed)) { + status = PJ_EINVAL; + app_perror("...ERROR echoed data not exact", status); + goto on_return; + } + st->check_echo_ptr += consumed; + + /* Echo received completely */ + if (st->send_str_len == st->recv) { + pj_ssl_sock_info info; + char buf[64]; + + status = pj_ssl_sock_get_info(ssock, &info); + if (status != PJ_SUCCESS) { + app_perror("...ERROR pj_ssl_sock_get_info()", status); + goto on_return; + } + + pj_sockaddr_print((pj_sockaddr_t*)&info.local_addr, buf, sizeof(buf), 1); + PJ_LOG(3, ("", "...%s successfully recv %d bytes echo", buf, st->recv)); + st->done = PJ_TRUE; + } + } + } + + if (status != PJ_SUCCESS) { + if (status == PJ_EEOF) { + status = PJ_SUCCESS; + st->done = PJ_TRUE; + } else { + app_perror("...ERROR ssl_on_data_read()", status); + } + } + +on_return: + st->err = status; + + if (st->err != PJ_SUCCESS || st->done) { + pj_ssl_sock_close(ssock); + if (!st->is_server) + clients_num--; + return PJ_FALSE; + } + + return PJ_TRUE; +} + +static pj_bool_t ssl_on_data_sent(pj_ssl_sock_t *ssock, + pj_ioqueue_op_key_t *op_key, + pj_ssize_t sent) +{ + struct test_state *st = (struct test_state*) + pj_ssl_sock_get_user_data(ssock); + PJ_UNUSED_ARG(op_key); + + if (sent < 0) { + st->err = -sent; + } else { + st->sent += sent; + + /* Send more if any */ + while (st->sent < st->send_str_len) { + pj_ssize_t size; + pj_status_t status; + + size = st->send_str_len - st->sent; + status = pj_ssl_sock_send(ssock, (pj_ioqueue_op_key_t*)&st->send_key, + st->send_str + st->sent, &size, 0); + if (status != PJ_SUCCESS && status != PJ_EPENDING) { + app_perror("...ERROR pj_ssl_sock_send()", status); + st->err = status; + break; + } + + if (status == PJ_SUCCESS) + st->sent += size; + else + break; + } + } + + if (st->err != PJ_SUCCESS) { + pj_ssl_sock_close(ssock); + if (!st->is_server) + clients_num--; + return PJ_FALSE; + } + + return PJ_TRUE; +} + +#define HTTP_REQ "GET / HTTP/1.0\r\n\r\n"; +#define HTTP_SERVER_ADDR "trac.pjsip.org" +#define HTTP_SERVER_PORT 443 + +static int https_client_test(unsigned ms_timeout) +{ + pj_pool_t *pool = NULL; + pj_ioqueue_t *ioqueue = NULL; + pj_timer_heap_t *timer = NULL; + pj_ssl_sock_t *ssock = NULL; + pj_ssl_sock_param param; + pj_status_t status; + struct test_state state = {0}; + pj_sockaddr local_addr, rem_addr; + pj_str_t tmp_st; + + pool = pj_pool_create(mem, "https_get", 256, 256, NULL); + + status = pj_ioqueue_create(pool, 4, &ioqueue); + if (status != PJ_SUCCESS) { + goto on_return; + } + + status = pj_timer_heap_create(pool, 4, &timer); + if (status != PJ_SUCCESS) { + goto on_return; + } + + state.pool = pool; + state.send_str = HTTP_REQ; + state.send_str_len = pj_ansi_strlen(state.send_str); + state.is_verbose = PJ_TRUE; + + pj_ssl_sock_param_default(¶m); + param.cb.on_connect_complete = &ssl_on_connect_complete; + param.cb.on_data_read = &ssl_on_data_read; + param.cb.on_data_sent = &ssl_on_data_sent; + param.ioqueue = ioqueue; + param.user_data = &state; + param.server_name = pj_str((char*)HTTP_SERVER_ADDR); + param.timer_heap = timer; + param.timeout.sec = 0; + param.timeout.msec = ms_timeout; + pj_time_val_normalize(¶m.timeout); + + status = pj_ssl_sock_create(pool, ¶m, &ssock); + if (status != PJ_SUCCESS) { + goto on_return; + } + + pj_sockaddr_init(PJ_AF_INET, &local_addr, pj_strset2(&tmp_st, "0.0.0.0"), 0); + pj_sockaddr_init(PJ_AF_INET, &rem_addr, pj_strset2(&tmp_st, HTTP_SERVER_ADDR), HTTP_SERVER_PORT); + status = pj_ssl_sock_start_connect(ssock, pool, &local_addr, &rem_addr, sizeof(rem_addr)); + if (status == PJ_SUCCESS) { + ssl_on_connect_complete(ssock, PJ_SUCCESS); + } else if (status == PJ_EPENDING) { + status = PJ_SUCCESS; + } else { + goto on_return; + } + + /* Wait until everything has been sent/received */ + while (state.err == PJ_SUCCESS && !state.done) { +#ifdef PJ_SYMBIAN + pj_symbianos_poll(-1, 1000); +#else + pj_time_val delay = {0, 100}; + pj_ioqueue_poll(ioqueue, &delay); + pj_timer_heap_poll(timer, &delay); +#endif + } + + if (state.err) { + status = state.err; + goto on_return; + } + + PJ_LOG(3, ("", "...Done!")); + PJ_LOG(3, ("", ".....Sent/recv: %d/%d bytes", state.sent, state.recv)); + +on_return: + if (ssock && !state.err && !state.done) + pj_ssl_sock_close(ssock); + if (ioqueue) + pj_ioqueue_destroy(ioqueue); + if (timer) + pj_timer_heap_destroy(timer); + if (pool) + pj_pool_release(pool); + + return status; +} + + +static int echo_test(pj_ssl_sock_proto srv_proto, pj_ssl_sock_proto cli_proto, + pj_ssl_cipher srv_cipher, pj_ssl_cipher cli_cipher) +{ + pj_pool_t *pool = NULL; + pj_ioqueue_t *ioqueue = NULL; + pj_ssl_sock_t *ssock_serv = NULL; + pj_ssl_sock_t *ssock_cli = NULL; + pj_ssl_sock_param param; + struct test_state state_serv = { 0 }; + struct test_state state_cli = { 0 }; + pj_sockaddr addr, listen_addr; + pj_ssl_cipher ciphers[1]; + pj_ssl_cert_t *cert = NULL; + pj_status_t status; + + pool = pj_pool_create(mem, "ssl_echo", 256, 256, NULL); + + status = pj_ioqueue_create(pool, 4, &ioqueue); + if (status != PJ_SUCCESS) { + goto on_return; + } + + /* Set cert */ + { + pj_str_t tmp1, tmp2, tmp3, tmp4; + + status = pj_ssl_cert_load_from_files(pool, + pj_strset2(&tmp1, (char*)CERT_CA_FILE), + pj_strset2(&tmp2, (char*)CERT_FILE), + pj_strset2(&tmp3, (char*)CERT_PRIVKEY_FILE), + pj_strset2(&tmp4, (char*)CERT_PRIVKEY_PASS), + &cert); + if (status != PJ_SUCCESS) { + goto on_return; + } + } + + pj_ssl_sock_param_default(¶m); + param.cb.on_accept_complete = &ssl_on_accept_complete; + param.cb.on_connect_complete = &ssl_on_connect_complete; + param.cb.on_data_read = &ssl_on_data_read; + param.cb.on_data_sent = &ssl_on_data_sent; + param.ioqueue = ioqueue; + param.ciphers = ciphers; + + /* Init default bind address */ + { + pj_str_t tmp_st; + pj_sockaddr_init(PJ_AF_INET, &addr, pj_strset2(&tmp_st, "127.0.0.1"), 0); + } + + /* SERVER */ + param.proto = srv_proto; + param.user_data = &state_serv; + param.ciphers_num = (srv_cipher == -1)? 0 : 1; + ciphers[0] = srv_cipher; + + state_serv.pool = pool; + state_serv.echo = PJ_TRUE; + state_serv.is_server = PJ_TRUE; + state_serv.is_verbose = PJ_TRUE; + + status = pj_ssl_sock_create(pool, ¶m, &ssock_serv); + if (status != PJ_SUCCESS) { + goto on_return; + } + + status = pj_ssl_sock_set_certificate(ssock_serv, pool, cert); + if (status != PJ_SUCCESS) { + goto on_return; + } + + status = pj_ssl_sock_start_accept(ssock_serv, pool, &addr, pj_sockaddr_get_len(&addr)); + if (status != PJ_SUCCESS) { + goto on_return; + } + + /* Get listener address */ + { + pj_ssl_sock_info info; + + pj_ssl_sock_get_info(ssock_serv, &info); + pj_sockaddr_cp(&listen_addr, &info.local_addr); + } + + /* CLIENT */ + param.proto = cli_proto; + param.user_data = &state_cli; + param.ciphers_num = (cli_cipher == -1)? 0 : 1; + ciphers[0] = cli_cipher; + + state_cli.pool = pool; + state_cli.check_echo = PJ_TRUE; + state_cli.is_verbose = PJ_TRUE; + + { + pj_time_val now; + + pj_gettimeofday(&now); + pj_srand((unsigned)now.sec); + state_cli.send_str_len = (pj_rand() % 5 + 1) * 1024 + pj_rand() % 1024; + } + state_cli.send_str = pj_pool_alloc(pool, state_cli.send_str_len); + { + unsigned i; + for (i = 0; i < state_cli.send_str_len; ++i) + state_cli.send_str[i] = (char)(pj_rand() % 256); + } + + status = pj_ssl_sock_create(pool, ¶m, &ssock_cli); + if (status != PJ_SUCCESS) { + goto on_return; + } + + status = pj_ssl_sock_start_connect(ssock_cli, pool, &addr, &listen_addr, pj_sockaddr_get_len(&addr)); + if (status == PJ_SUCCESS) { + ssl_on_connect_complete(ssock_cli, PJ_SUCCESS); + } else if (status == PJ_EPENDING) { + status = PJ_SUCCESS; + } else { + goto on_return; + } + + /* Wait until everything has been sent/received or error */ + while (!state_serv.err && !state_cli.err && !state_serv.done && !state_cli.done) + { +#ifdef PJ_SYMBIAN + pj_symbianos_poll(-1, 1000); +#else + pj_time_val delay = {0, 100}; + pj_ioqueue_poll(ioqueue, &delay); +#endif + } + + /* Clean up sockets */ + { + pj_time_val delay = {0, 100}; + while (pj_ioqueue_poll(ioqueue, &delay) > 0); + } + + if (state_serv.err || state_cli.err) { + if (state_serv.err != PJ_SUCCESS) + status = state_serv.err; + else + status = state_cli.err; + + goto on_return; + } + + PJ_LOG(3, ("", "...Done!")); + PJ_LOG(3, ("", ".....Sent/recv: %d/%d bytes", state_cli.sent, state_cli.recv)); + +on_return: + if (ssock_serv) + pj_ssl_sock_close(ssock_serv); + if (ssock_cli && !state_cli.err && !state_cli.done) + pj_ssl_sock_close(ssock_cli); + if (ioqueue) + pj_ioqueue_destroy(ioqueue); + if (pool) + pj_pool_release(pool); + + return status; +} + + +static pj_bool_t asock_on_data_read(pj_activesock_t *asock, + void *data, + pj_size_t size, + pj_status_t status, + pj_size_t *remainder) +{ + struct test_state *st = (struct test_state*) + pj_activesock_get_user_data(asock); + + PJ_UNUSED_ARG(data); + PJ_UNUSED_ARG(size); + PJ_UNUSED_ARG(remainder); + + if (status != PJ_SUCCESS) { + if (status == PJ_EEOF) { + status = PJ_SUCCESS; + st->done = PJ_TRUE; + } else { + app_perror("...ERROR asock_on_data_read()", status); + } + } + + st->err = status; + + if (st->err != PJ_SUCCESS || st->done) { + pj_activesock_close(asock); + if (!st->is_server) + clients_num--; + return PJ_FALSE; + } + + return PJ_TRUE; +} + + +static pj_bool_t asock_on_connect_complete(pj_activesock_t *asock, + pj_status_t status) +{ + struct test_state *st = (struct test_state*) + pj_activesock_get_user_data(asock); + + if (status == PJ_SUCCESS) { + void *read_buf[1]; + + /* Start reading data */ + read_buf[0] = st->read_buf; + status = pj_activesock_start_read2(asock, st->pool, sizeof(st->read_buf), (void**)read_buf, 0); + if (status != PJ_SUCCESS) { + app_perror("...ERROR pj_ssl_sock_start_read2()", status); + } + } + + st->err = status; + + if (st->err != PJ_SUCCESS) { + pj_activesock_close(asock); + if (!st->is_server) + clients_num--; + return PJ_FALSE; + } + + return PJ_TRUE; +} + + +/* Raw TCP socket try to connect to SSL socket server, once + * connection established, it will just do nothing, SSL socket + * server should be able to close the connection after specified + * timeout period (set ms_timeout to 0 to disable timer). + */ +static int client_non_ssl(unsigned ms_timeout) +{ + pj_pool_t *pool = NULL; + pj_ioqueue_t *ioqueue = NULL; + pj_timer_heap_t *timer = NULL; + pj_ssl_sock_t *ssock_serv = NULL; + pj_activesock_t *asock_cli = NULL; + pj_activesock_cb asock_cb = { 0 }; + pj_sock_t sock = PJ_INVALID_SOCKET; + pj_ssl_sock_param param; + struct test_state state_serv = { 0 }; + struct test_state state_cli = { 0 }; + pj_sockaddr listen_addr; + pj_ssl_cert_t *cert = NULL; + pj_status_t status; + + pool = pj_pool_create(mem, "ssl_accept_raw_tcp", 256, 256, NULL); + + status = pj_ioqueue_create(pool, 4, &ioqueue); + if (status != PJ_SUCCESS) { + goto on_return; + } + + status = pj_timer_heap_create(pool, 4, &timer); + if (status != PJ_SUCCESS) { + goto on_return; + } + + /* Set cert */ + { + pj_str_t tmp1, tmp2, tmp3, tmp4; + status = pj_ssl_cert_load_from_files(pool, + pj_strset2(&tmp1, (char*)CERT_CA_FILE), + pj_strset2(&tmp2, (char*)CERT_FILE), + pj_strset2(&tmp3, (char*)CERT_PRIVKEY_FILE), + pj_strset2(&tmp4, (char*)CERT_PRIVKEY_PASS), + &cert); + if (status != PJ_SUCCESS) { + goto on_return; + } + } + + pj_ssl_sock_param_default(¶m); + param.cb.on_accept_complete = &ssl_on_accept_complete; + param.cb.on_data_read = &ssl_on_data_read; + param.cb.on_data_sent = &ssl_on_data_sent; + param.ioqueue = ioqueue; + param.timer_heap = timer; + param.timeout.sec = 0; + param.timeout.msec = ms_timeout; + pj_time_val_normalize(¶m.timeout); + + /* SERVER */ + param.user_data = &state_serv; + state_serv.pool = pool; + state_serv.is_server = PJ_TRUE; + state_serv.is_verbose = PJ_TRUE; + + status = pj_ssl_sock_create(pool, ¶m, &ssock_serv); + if (status != PJ_SUCCESS) { + goto on_return; + } + + status = pj_ssl_sock_set_certificate(ssock_serv, pool, cert); + if (status != PJ_SUCCESS) { + goto on_return; + } + + /* Init bind address */ + { + pj_str_t tmp_st; + pj_sockaddr_init(PJ_AF_INET, &listen_addr, pj_strset2(&tmp_st, "127.0.0.1"), 0); + } + + status = pj_ssl_sock_start_accept(ssock_serv, pool, &listen_addr, pj_sockaddr_get_len(&listen_addr)); + if (status != PJ_SUCCESS) { + goto on_return; + } + + /* Update listener address */ + { + pj_ssl_sock_info info; + + pj_ssl_sock_get_info(ssock_serv, &info); + pj_sockaddr_cp(&listen_addr, &info.local_addr); + } + + /* CLIENT */ + state_cli.pool = pool; + status = pj_sock_socket(pj_AF_INET(), pj_SOCK_STREAM(), 0, &sock); + if (status != PJ_SUCCESS) { + goto on_return; + } + + asock_cb.on_connect_complete = &asock_on_connect_complete; + asock_cb.on_data_read = &asock_on_data_read; + status = pj_activesock_create(pool, sock, pj_SOCK_STREAM(), NULL, + ioqueue, &asock_cb, &state_cli, &asock_cli); + if (status != PJ_SUCCESS) { + goto on_return; + } + + status = pj_activesock_start_connect(asock_cli, pool, (pj_sockaddr_t*)&listen_addr, + pj_sockaddr_get_len(&listen_addr)); + if (status == PJ_SUCCESS) { + asock_on_connect_complete(asock_cli, PJ_SUCCESS); + } else if (status == PJ_EPENDING) { + status = PJ_SUCCESS; + } else { + goto on_return; + } + + /* Wait until everything has been sent/received or error */ + while (!state_serv.err && !state_cli.err && !state_serv.done && !state_cli.done) + { +#ifdef PJ_SYMBIAN + pj_symbianos_poll(-1, 1000); +#else + pj_time_val delay = {0, 100}; + pj_ioqueue_poll(ioqueue, &delay); + pj_timer_heap_poll(timer, &delay); +#endif + } + + if (state_serv.err || state_cli.err) { + if (state_serv.err != PJ_SUCCESS) + status = state_serv.err; + else + status = state_cli.err; + + goto on_return; + } + + PJ_LOG(3, ("", "...Done!")); + +on_return: + if (ssock_serv) + pj_ssl_sock_close(ssock_serv); + if (asock_cli && !state_cli.err && !state_cli.done) + pj_activesock_close(asock_cli); + if (timer) + pj_timer_heap_destroy(timer); + if (ioqueue) + pj_ioqueue_destroy(ioqueue); + if (pool) + pj_pool_release(pool); + + return status; +} + + +/* Test will perform multiple clients trying to connect to single server. + * Once SSL connection established, echo test will be performed. + */ +static int perf_test(unsigned clients, unsigned ms_handshake_timeout) +{ + pj_pool_t *pool = NULL; + pj_ioqueue_t *ioqueue = NULL; + pj_timer_heap_t *timer = NULL; + pj_ssl_sock_t *ssock_serv = NULL; + pj_ssl_sock_t **ssock_cli = NULL; + pj_ssl_sock_param param; + struct test_state state_serv = { 0 }; + struct test_state *state_cli = NULL; + pj_sockaddr addr, listen_addr; + pj_ssl_cert_t *cert = NULL; + pj_status_t status; + unsigned i, cli_err = 0, tot_sent = 0, tot_recv = 0; + pj_time_val start; + + pool = pj_pool_create(mem, "ssl_perf", 256, 256, NULL); + + status = pj_ioqueue_create(pool, PJ_IOQUEUE_MAX_HANDLES, &ioqueue); + if (status != PJ_SUCCESS) { + goto on_return; + } + + status = pj_timer_heap_create(pool, PJ_IOQUEUE_MAX_HANDLES, &timer); + if (status != PJ_SUCCESS) { + goto on_return; + } + + /* Set cert */ + { + pj_str_t tmp1, tmp2, tmp3, tmp4; + + status = pj_ssl_cert_load_from_files(pool, + pj_strset2(&tmp1, (char*)CERT_CA_FILE), + pj_strset2(&tmp2, (char*)CERT_FILE), + pj_strset2(&tmp3, (char*)CERT_PRIVKEY_FILE), + pj_strset2(&tmp4, (char*)CERT_PRIVKEY_PASS), + &cert); + if (status != PJ_SUCCESS) { + goto on_return; + } + } + + pj_ssl_sock_param_default(¶m); + param.cb.on_accept_complete = &ssl_on_accept_complete; + param.cb.on_connect_complete = &ssl_on_connect_complete; + param.cb.on_data_read = &ssl_on_data_read; + param.cb.on_data_sent = &ssl_on_data_sent; + param.ioqueue = ioqueue; + param.timer_heap = timer; + param.timeout.sec = 0; + param.timeout.msec = ms_handshake_timeout; + pj_time_val_normalize(¶m.timeout); + + /* Init default bind address */ + { + pj_str_t tmp_st; + pj_sockaddr_init(PJ_AF_INET, &addr, pj_strset2(&tmp_st, "127.0.0.1"), 0); + } + + /* SERVER */ + param.user_data = &state_serv; + + state_serv.pool = pool; + state_serv.echo = PJ_TRUE; + state_serv.is_server = PJ_TRUE; + + status = pj_ssl_sock_create(pool, ¶m, &ssock_serv); + if (status != PJ_SUCCESS) { + goto on_return; + } + + status = pj_ssl_sock_set_certificate(ssock_serv, pool, cert); + if (status != PJ_SUCCESS) { + goto on_return; + } + + status = pj_ssl_sock_start_accept(ssock_serv, pool, &addr, pj_sockaddr_get_len(&addr)); + if (status != PJ_SUCCESS) { + goto on_return; + } + + /* Get listening address for clients to connect to */ + { + pj_ssl_sock_info info; + char buf[64]; + + pj_ssl_sock_get_info(ssock_serv, &info); + pj_sockaddr_cp(&listen_addr, &info.local_addr); + + pj_sockaddr_print((pj_sockaddr_t*)&listen_addr, buf, sizeof(buf), 1); + PJ_LOG(3, ("", "...Listener ready at %s", buf)); + } + + + /* CLIENTS */ + clients_num = clients; + param.timeout.sec = 0; + param.timeout.msec = 0; + + /* Init random seed */ + { + pj_time_val now; + + pj_gettimeofday(&now); + pj_srand((unsigned)now.sec); + } + + /* Allocate SSL socket pointers and test state */ + ssock_cli = pj_pool_calloc(pool, clients, sizeof(pj_ssl_sock_t*)); + state_cli = pj_pool_calloc(pool, clients, sizeof(struct test_state)); + + /* Setup clients */ + for (i = 0; i < clients; ++i) { + param.user_data = &state_cli[i]; + + state_cli[i].pool = pool; + state_cli[i].check_echo = PJ_TRUE; + state_cli[i].send_str_len = (pj_rand() % 5 + 1) * 1024 + pj_rand() % 1024; + state_cli[i].send_str = pj_pool_alloc(pool, state_cli[i].send_str_len); + { + unsigned j; + for (j = 0; j < state_cli[i].send_str_len; ++j) + state_cli[i].send_str[j] = (char)(pj_rand() % 256); + } + + status = pj_ssl_sock_create(pool, ¶m, &ssock_cli[i]); + if (status != PJ_SUCCESS) { + app_perror("...ERROR pj_ssl_sock_create()", status); + cli_err++; + clients_num--; + continue; + } + + status = pj_ssl_sock_start_connect(ssock_cli[i], pool, &addr, &listen_addr, pj_sockaddr_get_len(&addr)); + if (status == PJ_SUCCESS) { + ssl_on_connect_complete(ssock_cli[i], PJ_SUCCESS); + } else if (status == PJ_EPENDING) { + status = PJ_SUCCESS; + } else { + app_perror("...ERROR pj_ssl_sock_create()", status); + pj_ssl_sock_close(ssock_cli[i]); + ssock_cli[i] = NULL; + clients_num--; + cli_err++; + continue; + } + + /* Give chance to server to accept this client */ + { + unsigned n = 5; + +#ifdef PJ_SYMBIAN + while(n && pj_symbianos_poll(-1, 1000)) + n--; +#else + pj_time_val delay = {0, 100}; + while(n && pj_ioqueue_poll(ioqueue, &delay) > 0) + n--; +#endif + } + } + + /* Get start timestamp */ + pj_gettimeofday(&start); + + /* Wait until everything has been sent/received or error */ + while (clients_num) + { +#ifdef PJ_SYMBIAN + pj_symbianos_poll(-1, 1000); +#else + pj_time_val delay = {0, 100}; + pj_ioqueue_poll(ioqueue, &delay); + pj_timer_heap_poll(timer, &delay); +#endif + } + + /* Clean up sockets */ + { + pj_time_val delay = {0, 500}; + while (pj_ioqueue_poll(ioqueue, &delay) > 0); + } + + if (state_serv.err != PJ_SUCCESS) { + status = state_serv.err; + goto on_return; + } + + PJ_LOG(3, ("", "...Done!")); + + /* SSL setup and data transfer duration */ + { + pj_time_val stop; + + pj_gettimeofday(&stop); + PJ_TIME_VAL_SUB(stop, start); + + PJ_LOG(3, ("", ".....Setup & data transfer duration: %d.%03ds", stop.sec, stop.msec)); + } + + /* Check clients status */ + for (i = 0; i < clients; ++i) { + if (state_cli[i].err != PJ_SUCCESS) + cli_err++; + + tot_sent += state_cli[1].sent; + tot_recv += state_cli[1].recv; + } + + PJ_LOG(3, ("", ".....Clients: %d (%d errors)", clients, cli_err)); + PJ_LOG(3, ("", ".....Total sent/recv: %d/%d bytes", tot_sent, tot_recv)); + +on_return: + if (ssock_serv) + pj_ssl_sock_close(ssock_serv); + + for (i = 0; i < clients; ++i) { + if (ssock_cli[i] && !state_cli[i].err && !state_cli[i].done) + pj_ssl_sock_close(ssock_cli[i]); + } + if (ioqueue) + pj_ioqueue_destroy(ioqueue); + if (pool) + pj_pool_release(pool); + + return status; +} + + +int ssl_sock_test(void) +{ + int ret; + + PJ_LOG(3,("", "..get cipher list test")); + ret = get_cipher_list(); + if (ret != 0) + return ret; + + PJ_LOG(3,("", "..https client test")); + ret = https_client_test(30000); + // Ignore test result as internet connection may not be available. + //if (ret != 0) + //return ret; + +#ifndef PJ_SYMBIAN + + PJ_LOG(3,("", "..echo test w/ TLSv1 and TLS_RSA_WITH_DES_CBC_SHA cipher")); + ret = echo_test(PJ_SSL_SOCK_PROTO_TLS1, PJ_SSL_SOCK_PROTO_TLS1, + TLS_RSA_WITH_DES_CBC_SHA, TLS_RSA_WITH_DES_CBC_SHA); + if (ret != 0) + return ret; + + PJ_LOG(3,("", "..echo test w/ SSLv23 and TLS_RSA_WITH_AES_256_CBC_SHA cipher")); + ret = echo_test(PJ_SSL_SOCK_PROTO_SSL23, PJ_SSL_SOCK_PROTO_SSL23, + TLS_RSA_WITH_AES_256_CBC_SHA, TLS_RSA_WITH_AES_256_CBC_SHA); + if (ret != 0) + return ret; + + PJ_LOG(3,("", "..echo test w/ incompatible proto")); + ret = echo_test(PJ_SSL_SOCK_PROTO_TLS1, PJ_SSL_SOCK_PROTO_SSL3, + TLS_RSA_WITH_DES_CBC_SHA, TLS_RSA_WITH_DES_CBC_SHA); + if (ret == 0) + return PJ_EBUG; + + PJ_LOG(3,("", "..echo test w/ incompatible ciphers")); + ret = echo_test(PJ_SSL_SOCK_PROTO_DEFAULT, PJ_SSL_SOCK_PROTO_DEFAULT, + TLS_RSA_WITH_DES_CBC_SHA, TLS_RSA_WITH_AES_256_CBC_SHA); + if (ret == 0) + return PJ_EBUG; + + PJ_LOG(3,("", "..client non-SSL (handshake timeout 5 secs)")); + ret = client_non_ssl(5000); + if (ret != 0) + return ret; + + PJ_LOG(3,("", "..performance test")); + ret = perf_test(PJ_IOQUEUE_MAX_HANDLES/2 - 1, 0); + if (ret != 0) + return ret; + +#endif + + return 0; +} + +#else /* INCLUDE_SSLSOCK_TEST */ +/* To prevent warning about "translation unit is empty" + * when this test is disabled. + */ +int dummy_ssl_sock_test; +#endif /* INCLUDE_SSLSOCK_TEST */ + diff --git a/sflphone-common/libs/pjproject/pjlib/src/pjlib-test/test.c b/sflphone-common/libs/pjproject/pjlib/src/pjlib-test/test.c index cf41eeac0e44abd9ade4956d17f728d42172f77a..5db7346d910cbc0c2989ccff828140ab673f2f9f 100644 --- a/sflphone-common/libs/pjproject/pjlib/src/pjlib-test/test.c +++ b/sflphone-common/libs/pjproject/pjlib/src/pjlib-test/test.c @@ -1,4 +1,4 @@ -/* $Id: test.c 2769 2009-06-17 12:36:36Z bennylp $ */ +/* $Id: test.c 2970 2009-10-26 15:47:52Z nanang $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> @@ -167,6 +167,10 @@ int test_inner(void) DO_TEST( file_test() ); #endif +#if INCLUDE_SSLSOCK_TEST + DO_TEST( ssl_sock_test() ); +#endif + #if INCLUDE_ECHO_SERVER //echo_server(); //echo_srv_sync(); diff --git a/sflphone-common/libs/pjproject/pjlib/src/pjlib-test/test.h b/sflphone-common/libs/pjproject/pjlib/src/pjlib-test/test.h index 796ba6d07fde0c32f17e6c31117a471e6c6626b1..a35da79d3011db65c786098efbaa817408f5e085 100644 --- a/sflphone-common/libs/pjproject/pjlib/src/pjlib-test/test.h +++ b/sflphone-common/libs/pjproject/pjlib/src/pjlib-test/test.h @@ -1,4 +1,4 @@ -/* $Id: test.h 2394 2008-12-23 17:27:53Z bennylp $ */ +/* $Id: test.h 2970 2009-10-26 15:47:52Z nanang $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> @@ -54,6 +54,7 @@ #define INCLUDE_UDP_IOQUEUE_TEST GROUP_NETWORK #define INCLUDE_TCP_IOQUEUE_TEST GROUP_NETWORK #define INCLUDE_ACTIVESOCK_TEST GROUP_NETWORK +#define INCLUDE_SSLSOCK_TEST (PJ_HAS_SSL_SOCK && GROUP_NETWORK) #define INCLUDE_IOQUEUE_PERF_TEST (PJ_HAS_THREADS && GROUP_NETWORK) #define INCLUDE_IOQUEUE_UNREG_TEST (PJ_HAS_THREADS && GROUP_NETWORK) #define INCLUDE_FILE_TEST GROUP_FILE @@ -96,6 +97,7 @@ extern int tcp_ioqueue_test(void); extern int ioqueue_perf_test(void); extern int activesock_test(void); extern int file_test(void); +extern int ssl_sock_test(void); extern int echo_server(void); extern int echo_client(int sock_type, const char *server, int port); @@ -104,6 +106,7 @@ extern int echo_srv_sync(void); extern int udp_echo_srv_ioqueue(void); extern int echo_srv_common_loop(pj_atomic_t *bytes_counter); + extern pj_pool_factory *mem; extern int test_main(void); diff --git a/sflphone-common/libs/pjproject/pjlib/src/pjlib-test/test_wrap.cpp b/sflphone-common/libs/pjproject/pjlib/src/pjlib-test/test_wrap.cpp index 1f0cbc8316beaa7badb32983cda2516ea5e88f0b..788bd153b4ed6e8bcaee0e7bc5dd2c456319a3c5 100644 --- a/sflphone-common/libs/pjproject/pjlib/src/pjlib-test/test_wrap.cpp +++ b/sflphone-common/libs/pjproject/pjlib/src/pjlib-test/test_wrap.cpp @@ -1,5 +1,5 @@ /* $Id: test_wrap.cpp 2873 2009-08-13 11:54:35Z nanang $ */ -/* +/* * Copyright (C) 2009 Teluu Inc. (http://www.teluu.com) * * This program is free software; you can redistribute it and/or modify @@ -14,7 +14,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* diff --git a/sflphone-common/libs/pjproject/pjmedia/build/Makefile b/sflphone-common/libs/pjproject/pjmedia/build/Makefile index b3a960c400fbf121d5beb2921585cb4023a55497..dae6d61bcdf69aae9cc932b0251d169738363774 100644 --- a/sflphone-common/libs/pjproject/pjmedia/build/Makefile +++ b/sflphone-common/libs/pjproject/pjmedia/build/Makefile @@ -11,14 +11,14 @@ include $(PJDIR)/build/common.mak RULES_MAK := $(PJDIR)/build/rules.mak -PJLIB_LIB:=$(PJDIR)/pjlib/lib/libpj-sfl-$(TARGET_NAME)$(LIBEXT) -PJLIB_UTIL_LIB:=$(PJDIR)/pjlib-util/lib/libpjlib-util-sfl-$(TARGET_NAME)$(LIBEXT) -PJNATH_LIB:=$(PJDIR)/pjnath/lib/libpjnath-sfl-$(TARGET_NAME)$(LIBEXT) +PJLIB_LIB:=$(PJDIR)/pjlib/lib/libpj-$(TARGET_NAME)$(LIBEXT) +PJLIB_UTIL_LIB:=$(PJDIR)/pjlib-util/lib/libpjlib-util-$(TARGET_NAME)$(LIBEXT) +PJNATH_LIB:=$(PJDIR)/pjnath/lib/libpjnath-$(TARGET_NAME)$(LIBEXT) -export PJMEDIA_LIB:=../lib/libpjmedia-sfl-$(TARGET_NAME)$(LIBEXT) -export PJMEDIA_CODEC_LIB:=../lib/libpjmedia-codec-sfl-$(TARGET_NAME)$(LIBEXT) -export PJSDP_LIB:=../lib/libpjsdp-sfl-$(TARGET_NAME)$(LIBEXT) -export PJMEDIA_AUDIODEV_LIB:=../lib/libpjmedia-audiodev-sfl-$(TARGET_NAME)$(LIBEXT) +export PJMEDIA_LIB:=../lib/libpjmedia-$(TARGET_NAME)$(LIBEXT) +export PJMEDIA_CODEC_LIB:=../lib/libpjmedia-codec-$(TARGET_NAME)$(LIBEXT) +export PJSDP_LIB:=../lib/libpjsdp-$(TARGET_NAME)$(LIBEXT) +export PJMEDIA_AUDIODEV_LIB:=../lib/libpjmedia-audiodev-$(TARGET_NAME)$(LIBEXT) ############################################################################### @@ -30,7 +30,7 @@ export _CFLAGS := $(CC_CFLAGS) $(OS_CFLAGS) $(HOST_CFLAGS) $(M_CFLAGS) \ $(CC_INC)../../pjlib-util/include \ $(CC_INC)../../pjnath/include \ $(CC_INC)../.. \ - $(SRTP_INC) -O2 + $(SRTP_INC) export _CXXFLAGS:= $(_CFLAGS) $(CC_CXXFLAGS) $(OS_CXXFLAGS) $(M_CXXFLAGS) \ $(HOST_CXXFLAGS) $(CXXFLAGS) export _LDFLAGS := $(subst /,$(HOST_PSEP),$(PJMEDIA_LIB)) \ @@ -49,7 +49,7 @@ export _LDFLAGS := $(subst /,$(HOST_PSEP),$(PJMEDIA_LIB)) \ # export PJMEDIA_SRCDIR = ../src/pjmedia export PJMEDIA_OBJS += $(OS_OBJS) $(M_OBJS) $(CC_OBJS) $(HOST_OBJS) \ - alaw_ulaw.o alaw_ulaw_table.o clock_thread.o codec.o \ + alaw_ulaw.o alaw_ulaw_table.o bidirectional.o clock_thread.o codec.o \ conference.o conf_switch.o delaybuf.o echo_common.o \ echo_port.o echo_suppress.o endpoint.o errno.o \ g711.o jbuf.o master_port.o mem_capture.o mem_player.o \ @@ -177,14 +177,14 @@ realclean: $(subst @@,$(subst /,$(HOST_PSEP),.pjsdp-$(TARGET_NAME).depend),$(HOST_RMR)) $(MAKE) -f $(RULES_MAK) APP=PJMEDIA app=pjmedia $@ - $(MAKE) -f $(RULES_MAK) APP=PJMEDIA app=pjmedia-audiodev $@ + $(MAKE) -f $(RULES_MAK) APP=PJMEDIA_AUDIODEV app=pjmedia-audiodev $@ $(MAKE) -f $(RULES_MAK) APP=PJMEDIA_CODEC app=pjmedia-codec $@ $(MAKE) -f $(RULES_MAK) APP=PJMEDIA_TEST app=pjmedia-test $@ $(MAKE) -f $(RULES_MAK) APP=PJSDP app=pjsdp $@ depend: $(MAKE) -f $(RULES_MAK) APP=PJMEDIA app=pjmedia $@ - $(MAKE) -f $(RULES_MAK) APP=PJMEDIA app=pjmedia-audiodev $@ + $(MAKE) -f $(RULES_MAK) APP=PJMEDIA_AUDIODEV app=pjmedia-audiodev $@ $(MAKE) -f $(RULES_MAK) APP=PJMEDIA_CODEC app=pjmedia-codec $@ $(MAKE) -f $(RULES_MAK) APP=PJMEDIA_TEST app=pjmedia-test $@ $(MAKE) -f $(RULES_MAK) APP=PJSDP app=pjsdp $@ diff --git a/sflphone-common/libs/pjproject/pjmedia/include/pjmedia-audiodev/config.h b/sflphone-common/libs/pjproject/pjmedia/include/pjmedia-audiodev/config.h index 713f252af9d469dc09db1e95669a631840586664..2ab01f2718c457e9a0f955d670aa53d2ea2201d6 100644 --- a/sflphone-common/libs/pjproject/pjmedia/include/pjmedia-audiodev/config.h +++ b/sflphone-common/libs/pjproject/pjmedia/include/pjmedia-audiodev/config.h @@ -1,5 +1,5 @@ -/* $Id: config.h 2833 2009-07-14 14:33:39Z nanang $ */ -/* +/* $Id: config.h 2977 2009-10-29 09:39:17Z bennylp $ */ +/* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> * @@ -15,7 +15,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef __PJMEDIA_AUDIODEV_CONFIG_H__ #define __PJMEDIA_AUDIODEV_CONFIG_H__ @@ -44,9 +44,17 @@ PJ_BEGIN_DECL /** * This setting controls whether PortAudio support should be included. + * + * By default it is enabled except on Windows platforms (including + * Windows Mobile) and Symbian. */ #ifndef PJMEDIA_AUDIO_DEV_HAS_PORTAUDIO -# define PJMEDIA_AUDIO_DEV_HAS_PORTAUDIO 1 +# if (defined(PJ_WIN32) && PJ_WIN32!=0) || \ + (defined(PJ_SYMBIAN) && PJ_SYMBIAN!=0) +# define PJMEDIA_AUDIO_DEV_HAS_PORTAUDIO 0 +# else +# define PJMEDIA_AUDIO_DEV_HAS_PORTAUDIO 1 +# endif #endif @@ -85,7 +93,7 @@ PJ_BEGIN_DECL /** - * This setting controls whether Symbian audio (using built-in multimedia + * This setting controls whether Symbian audio (using built-in multimedia * framework) support should be included. */ #ifndef PJMEDIA_AUDIO_DEV_HAS_SYMB_MDA @@ -96,7 +104,7 @@ PJ_BEGIN_DECL /** * This setting controls whether the Audio Device API should support * device implementation that is based on the old sound device API - * (sound.h). + * (sound.h). * * Enable this API if: * - you have implemented your own sound device using the old sound @@ -130,7 +138,7 @@ PJ_END_DECL * @{ PJMEDIA Audio Device API is a cross-platform audio API appropriate for use with -VoIP applications and many other types of audio streaming applications. +VoIP applications and many other types of audio streaming applications. The API abstracts many different audio API's on various platforms, such as: - PortAudio back-end for Win32, Windows Mobile, Linux, Unix, dan MacOS X. @@ -140,45 +148,45 @@ The API abstracts many different audio API's on various platforms, such as: - null-audio implementation - and more to be implemented in the future -The Audio Device API/library is an evolution from PJMEDIA @ref PJMED_SND and +The Audio Device API/library is an evolution from PJMEDIA @ref PJMED_SND and contains many enhancements: - Forward compatibility: \n - The new API has been designed to be extensible, it will support new API's as - well as new features that may be introduced in the future without breaking - compatibility with applications that use this API as well as compatibility - with existing device implementations. + The new API has been designed to be extensible, it will support new API's as + well as new features that may be introduced in the future without breaking + compatibility with applications that use this API as well as compatibility + with existing device implementations. - Device capabilities: \n At the heart of the API is device capabilities management, where all possible audio capabilities of audio devices should be able to be handled in a generic - manner. With this framework, new capabilities that may be discovered in the - future can be handled in manner without breaking existing applications. + manner. With this framework, new capabilities that may be discovered in the + future can be handled in manner without breaking existing applications. - Built-in features: \n - The device capabilities framework enables applications to use and control + The device capabilities framework enables applications to use and control audio features built-in in the device, such as: - - echo cancellation, - - built-in codecs, + - echo cancellation, + - built-in codecs, - audio routing (e.g. to earpiece or loudspeaker), - volume control, - etc. - Codec support: \n - Some audio devices such as Nokia/Symbian Audio Proxy Server (APS) and Nokia + Some audio devices such as Nokia/Symbian Audio Proxy Server (APS) and Nokia VoIP Audio Services (VAS) support built-in hardware audio codecs (e.g. G.729, iLBC, and AMR), and application can use the sound device in encoded mode to - make use of these hardware codecs. + make use of these hardware codecs. - Multiple backends: \n - The new API supports multiple audio backends (called factories or drivers in - the code) to be active simultaneously, and audio backends may be added or - removed during run-time. + The new API supports multiple audio backends (called factories or drivers in + the code) to be active simultaneously, and audio backends may be added or + removed during run-time. @section using Overview on using the API @@ -186,11 +194,11 @@ contains many enhancements: @subsection getting_started Getting started -# <b>Configure the application's project settings</b>.\n - Add the following + Add the following include: \code #include <pjmedia_audiodev.h>\endcode\n - And add <b>pjmedia-audiodev</b> library to your application link + And add <b>pjmedia-audiodev</b> library to your application link specifications.\n -# <b>Compile time settings</b>.\n Use the compile time settings to enable or @@ -221,7 +229,7 @@ contains many enhancements: status = pjmedia_aud_dev_get_info(dev_idx, &info); printf("%d. %s (in=%d, out=%d)\n", - dev_idx, info.name, + dev_idx, info.name, info.input_count, info.output_count); } \endcode\n @@ -266,7 +274,7 @@ Capabilities are encoded as #pjmedia_aud_dev_cap enumeration. Please see -# Info: You can set the device settings when opening audio stream by setting the flags and the appropriate setting in #pjmedia_aud_param when calling #pjmedia_aud_stream_create()\n - -# Info: Once the audio stream is running, you can retrieve or change the stream + -# Info: Once the audio stream is running, you can retrieve or change the stream setting by specifying the capability in #pjmedia_aud_stream_get_cap() and #pjmedia_aud_stream_set_cap() respectively. @@ -321,12 +329,12 @@ or both. param.ext_fmt.vad = PJ_FALSE; \endcode\n -# Note that if non-PCM format is configured on the audio stream, the - capture and/or playback functions (#pjmedia_aud_rec_cb and + capture and/or playback functions (#pjmedia_aud_rec_cb and #pjmedia_aud_play_cb respectively) will report the audio frame as #pjmedia_frame_ext structure instead of the #pjmedia_frame. -# Optionally configure other device's capabilities. The following snippet shows how to enable echo cancellation on the device (note that this - snippet may not be necessary since the setting may have been enabled + snippet may not be necessary since the setting may have been enabled when calling #pjmedia_aud_dev_default_param() above): \code if (info.caps & PJMEDIA_AUD_DEV_CAP_EC) { @@ -339,7 +347,7 @@ or both. \code pjmedia_aud_stream *stream; - status = pjmedia_aud_stream_create(¶m, &rec_cb, &play_cb, + status = pjmedia_aud_stream_create(¶m, &rec_cb, &play_cb, user_data, &stream); \endcode @@ -362,7 +370,7 @@ or both. \code // Volume setting is an unsigned integer showing the level in percent. unsigned vol; - status = pjmedia_aud_stream_get_cap(stream, + status = pjmedia_aud_stream_get_cap(stream, PJMEDIA_AUD_DEV_CAP_OUTPUT_VOLUME_SETTING, &vol); \endcode @@ -371,7 +379,7 @@ or both. \code // Volume setting is an unsigned integer showing the level in percent. unsigned vol = 50; - status = pjmedia_aud_stream_set_cap(stream, + status = pjmedia_aud_stream_set_cap(stream, PJMEDIA_AUD_DEV_CAP_OUTPUT_VOLUME_SETTING, &vol); \endcode diff --git a/sflphone-common/libs/pjproject/pjmedia/include/pjmedia-codec/config.h b/sflphone-common/libs/pjproject/pjmedia/include/pjmedia-codec/config.h index fa47a23e79a6efdbc1ee863e5dd5d116563b7288..627f58882322304fdccdb033f8a75f89b83d17aa 100644 --- a/sflphone-common/libs/pjproject/pjmedia/include/pjmedia-codec/config.h +++ b/sflphone-common/libs/pjproject/pjmedia/include/pjmedia-codec/config.h @@ -1,5 +1,5 @@ /* $Id: config.h 2875 2009-08-13 15:57:26Z bennylp $ */ -/* +/* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> * @@ -15,7 +15,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef __PJMEDIA_CODEC_CONFIG_H__ #define __PJMEDIA_CODEC_CONFIG_H__ @@ -131,7 +131,7 @@ /** * Enable Intel IPP AMR codec. This also needs to be enabled when AMR WB - * codec is enabled. This option is only used when PJMEDIA_HAS_INTEL_IPP + * codec is enabled. This option is only used when PJMEDIA_HAS_INTEL_IPP * is enabled. * * Default: 1 @@ -143,7 +143,7 @@ /** * Enable Intel IPP AMR wideband codec. The PJMEDIA_HAS_INTEL_IPP_CODEC_AMR - * option must also be enabled to use this codec. This option is only used + * option must also be enabled to use this codec. This option is only used * when PJMEDIA_HAS_INTEL_IPP is enabled. * * Default: 1 @@ -279,8 +279,8 @@ #endif /** - * Default G.722.1 codec encoder and decoder level adjustment. - * If the value is non-zero, then PCM input samples to the encoder will + * Default G.722.1 codec encoder and decoder level adjustment. + * If the value is non-zero, then PCM input samples to the encoder will * be shifted right by this value, and similarly PCM output samples from * the decoder will be shifted left by this value. * @@ -294,7 +294,7 @@ /** * Enabling both G.722.1 codec implementations, internal PJMEDIA and IPP, - * may cause problem in SDP, i.e: payload types duplications. So, let's + * may cause problem in SDP, i.e: payload types duplications. So, let's * just trap such case here at compile time. * * Application can control which implementation to be used by manipulating diff --git a/sflphone-common/libs/pjproject/pjmedia/include/pjmedia/config.h b/sflphone-common/libs/pjproject/pjmedia/include/pjmedia/config.h index 0ddaa6d294038aa870c00155f328194c68cc81cd..d1c6e0364c80ba08f2c6eeaceb24345cdcd88167 100644 --- a/sflphone-common/libs/pjproject/pjmedia/include/pjmedia/config.h +++ b/sflphone-common/libs/pjproject/pjmedia/include/pjmedia/config.h @@ -1,5 +1,5 @@ -/* $Id: config.h 2850 2009-08-01 09:20:59Z bennylp $ */ -/* +/* $Id: config.h 2977 2009-10-29 09:39:17Z bennylp $ */ +/* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> * @@ -15,7 +15,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef __PJMEDIA_CONFIG_H__ #define __PJMEDIA_CONFIG_H__ @@ -45,11 +45,11 @@ #endif /** - * Specify whether we prefer to use audio switch board rather than + * Specify whether we prefer to use audio switch board rather than * conference bridge. * - * Audio switch board is a kind of simplified version of conference - * bridge, but not really the subset of conference bridge. It has + * Audio switch board is a kind of simplified version of conference + * bridge, but not really the subset of conference bridge. It has * stricter rules on audio routing among the pjmedia ports and has * no audio mixing capability. The power of it is it could work with * encoded audio frames where conference brigde couldn't. @@ -103,10 +103,16 @@ #endif /** - * Specify default sound device latency, in milisecond. + * Specify default sound device latency, in milisecond. + * + * Default is 160ms for Windows Mobile and 140ms for other platforms. */ #ifndef PJMEDIA_SND_DEFAULT_PLAY_LATENCY -# define PJMEDIA_SND_DEFAULT_PLAY_LATENCY 100 +# if defined(PJ_WIN32_WINCE) && PJ_WIN32_WINCE!=0 +# define PJMEDIA_SND_DEFAULT_PLAY_LATENCY 160 +# else +# define PJMEDIA_SND_DEFAULT_PLAY_LATENCY 140 +# endif #endif @@ -127,21 +133,21 @@ /** * 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 + * at the expense of one frame delay and intensive processing power * requirement. */ #define PJMEDIA_WSOLA_IMP_WSOLA 1 /** - * This denotes implementation of WSOLA algorithm with faster waveform - * similarity calculation. This implementation provides fair quality of + * 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_WSOLA_LITE 2 /** * Specify type of Waveform based Similarity Overlap and Add (WSOLA) backend - * implementation to be used. WSOLA is an algorithm to expand and/or compress + * 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. * @@ -154,8 +160,8 @@ /** * Specify the default maximum duration of synthetic audio that is generated - * by WSOLA. This value should be long enough to cover burst of packet losses. - * but not too long, because as the duration increases the quality would + * by WSOLA. This value should be long enough to cover burst of packet losses. + * but not too long, because as the duration increases the quality would * degrade considerably. * * Note that this limit is only applied when fading is enabled in the WSOLA @@ -184,7 +190,7 @@ /** * Specify WSOLA algorithm delay, in milliseconds. The algorithm delay is * used to merge synthetic samples with real samples in the transition - * between real to synthetic and vice versa. The longer the delay, the + * between real to synthetic and vice versa. The longer the delay, the * smoother signal to be generated, at the expense of longer latency and * a slighty more computation. * @@ -213,17 +219,17 @@ /** * 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 + * 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 + * Default: (PJMEDIA_SND_DEFAULT_PLAY_LATENCY+20)/20 */ #ifndef PJMEDIA_SOUND_BUFFER_COUNT -# define PJMEDIA_SOUND_BUFFER_COUNT 6 +# define PJMEDIA_SOUND_BUFFER_COUNT ((PJMEDIA_SND_DEFAULT_PLAY_LATENCY+20)/20) #endif @@ -296,13 +302,13 @@ */ #define PJMEDIA_RESAMPLE_NONE 1 /**< No resampling. */ #define PJMEDIA_RESAMPLE_LIBRESAMPLE 2 /**< Sample rate conversion -using libresample. */ + using libresample. */ #define PJMEDIA_RESAMPLE_SPEEX 3 /**< Sample rate conversion -using Speex. */ + using Speex. */ #define PJMEDIA_RESAMPLE_LIBSAMPLERATE 4 /**< Sample rate conversion -using libsamplerate -(a.k.a Secret Rabbit Code) -*/ + using libsamplerate + (a.k.a Secret Rabbit Code) + */ /** * Select which resample implementation to use. Currently pjmedia supports: @@ -342,7 +348,7 @@ using libsamplerate * This (among other thing) will affect the size of buffers to be allocated * for outgoing packets. */ -#ifndef PJMEDIA_MAX_FRAME_DURATION_MS +#ifndef PJMEDIA_MAX_FRAME_DURATION_MS # define PJMEDIA_MAX_FRAME_DURATION_MS 200 #endif @@ -350,7 +356,7 @@ using libsamplerate /** * Max packet size to support. */ -#ifndef PJMEDIA_MAX_MTU +#ifndef PJMEDIA_MAX_MTU # define PJMEDIA_MAX_MTU 1500 #endif @@ -358,7 +364,7 @@ using libsamplerate /** * DTMF/telephone-event duration, in timestamp. */ -#ifndef PJMEDIA_DTMF_DURATION +#ifndef PJMEDIA_DTMF_DURATION # define PJMEDIA_DTMF_DURATION 1600 /* in timestamp */ #endif @@ -368,7 +374,7 @@ using libsamplerate * remote address required to make the stream switch transmission * to the source address. */ -#ifndef PJMEDIA_RTP_NAT_PROBATION_CNT +#ifndef PJMEDIA_RTP_NAT_PROBATION_CNT # define PJMEDIA_RTP_NAT_PROBATION_CNT 10 #endif @@ -409,9 +415,9 @@ using libsamplerate /** * 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 + * 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). @@ -423,7 +429,7 @@ using libsamplerate /** * The RTCP XR feature is activated and used by stream if \a enable_rtcp_xr - * field of \a pjmedia_stream_info structure is non-zero. This setting + * field of \a pjmedia_stream_info structure is non-zero. This setting * controls the default value of this field. * * Default: 0 (disabled) @@ -442,7 +448,7 @@ using libsamplerate * * Specify zero to disable this feature. * - * Default: 600 msec (which gives good probability that some RTP + * 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). */ @@ -452,13 +458,13 @@ using libsamplerate /** - * Specify the maximum duration of silence period in the codec, in msec. + * 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 + * 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 + * everything including iLBC, except Speex, which has its own DTX * mechanism). * * Use (-1) to disable this feature. @@ -510,7 +516,7 @@ using libsamplerate * 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 + * 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. @@ -538,7 +544,7 @@ using libsamplerate /** - * This macro controls whether pjmedia should include SDP rtpmap + * 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. @@ -592,12 +598,12 @@ using libsamplerate #endif -/* +/* * Below specifies the various tone generator backend algorithm. */ -/** - * The math's sine(), floating point. This has very good precision +/** + * 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. */ @@ -613,7 +619,7 @@ using libsamplerate /** * 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 + * performance by tuning the PJMEDIA_TONEGEN_FIXED_POINT_CORDIC_LOOP * setting, and may be suitable for platforms that lack floating-point * support. */ @@ -628,7 +634,7 @@ using libsamplerate /** - * Specify the tone generator algorithm to be used. Please see + * 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. * @@ -648,7 +654,7 @@ using libsamplerate /** * 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 + * loops, the tone signal gets more precise, but this will add more * processing. * * Valid values are 1 to 28. @@ -736,8 +742,8 @@ using libsamplerate /** * 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 + * 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. */ @@ -780,22 +786,22 @@ using libsamplerate #endif /** - * Specify another type of keep-alive and NAT hole punching + * Specify another type of keep-alive and NAT hole punching * mechanism (the other type is PJMEDIA_STREAM_VAD_SUSPEND_MSEC - * and PJMEDIA_CODEC_MAX_SILENCE_PERIOD) to be used by stream. - * When this feature is enabled, the stream will initially + * and PJMEDIA_CODEC_MAX_SILENCE_PERIOD) to be used by stream. + * When this feature is enabled, the stream will initially * transmit one packet to punch a hole in NAT, and periodically * transmit keep-alive packets. * * When this alternative keep-alive mechanism is used, application - * may disable the other keep-alive mechanisms, i.e: by setting - * PJMEDIA_STREAM_VAD_SUSPEND_MSEC to zero and + * may disable the other keep-alive mechanisms, i.e: by setting + * PJMEDIA_STREAM_VAD_SUSPEND_MSEC to zero and * PJMEDIA_CODEC_MAX_SILENCE_PERIOD to -1. * * The value of this macro specifies the type of packet used * for the keep-alive mechanism. Valid values are * PJMEDIA_STREAM_KA_EMPTY_RTP and PJMEDIA_STREAM_KA_USER. - * + * * The duration of the keep-alive interval further can be set * with PJMEDIA_STREAM_KA_INTERVAL setting. * diff --git a/sflphone-common/libs/pjproject/pjmedia/include/pjmedia/config_auto.h b/sflphone-common/libs/pjproject/pjmedia/include/pjmedia/config_auto.h deleted file mode 100644 index 2f544be76e523e4b73a9b67434d3a65660a77fff..0000000000000000000000000000000000000000 --- a/sflphone-common/libs/pjproject/pjmedia/include/pjmedia/config_auto.h +++ /dev/null @@ -1,44 +0,0 @@ -/* pjmedia/include/pjmedia/config_auto.h. Generated from config_auto.h.in by configure. */ -/* $Id: config_auto.h.in 2394 2008-12-23 17:27:53Z bennylp $ */ -/* - * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) - * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ -#ifndef __PJMEDIA_CONFIG_AUTO_H_ -#define __PJMEDIA_CONFIG_AUTO_H_ - -/** - * @file config_auto.h - * @brief PJMEDIA configuration as set by autoconf script - */ - -/* - * Note: - * The configuration in config_site.h overrides any other settings, - * including the setting as detected by autoconf. - */ - -/* G711 codec */ -#ifndef PJMEDIA_HAS_G711_CODEC -/* #undef PJMEDIA_HAS_G711_CODEC */ -#endif - - -#endif /* __PJMEDIA_CONFIG_AUTO_H_ */ - - - diff --git a/sflphone-common/libs/pjproject/pjmedia/include/pjmedia/sdp.h b/sflphone-common/libs/pjproject/pjmedia/include/pjmedia/sdp.h index 8abfb125d0dbc7aaaf2b1d899f7a0dce8f12ea92..eaa40c885176154a20794856844221674e5d6ba8 100644 --- a/sflphone-common/libs/pjproject/pjmedia/include/pjmedia/sdp.h +++ b/sflphone-common/libs/pjproject/pjmedia/include/pjmedia/sdp.h @@ -1,4 +1,4 @@ -/* $Id: sdp.h 2394 2008-12-23 17:27:53Z bennylp $ */ +/* $Id: sdp.h 2995 2009-11-09 05:18:12Z bennylp $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> @@ -652,6 +652,18 @@ PJ_DECL(pj_status_t) pjmedia_sdp_session_cmp(const pjmedia_sdp_session *sd1, unsigned option); +/** + * Add new attribute to the session descriptor. + * + * @param s The SDP session description. + * @param attr Attribute to add. + * + * @return PJ_SUCCESS or the appropriate error code. + */ +PJ_DECL(pj_status_t) pjmedia_sdp_session_add_attr(pjmedia_sdp_session *m, + pjmedia_sdp_attr *attr); + + PJ_END_DECL /** diff --git a/sflphone-common/libs/pjproject/pjmedia/include/pjmedia/transport.h b/sflphone-common/libs/pjproject/pjmedia/include/pjmedia/transport.h index 0536f51d59f9fbddeb6aa698fe10b26e6eb101d0..c7f693f2ad41f3b2bcfffd39b14d1b2d8064aa3e 100644 --- a/sflphone-common/libs/pjproject/pjmedia/include/pjmedia/transport.h +++ b/sflphone-common/libs/pjproject/pjmedia/include/pjmedia/transport.h @@ -1,4 +1,4 @@ -/* $Id: transport.h 2394 2008-12-23 17:27:53Z bennylp $ */ +/* $Id: transport.h 2945 2009-10-14 13:13:18Z bennylp $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> @@ -503,7 +503,7 @@ struct pjmedia_transport_info /** * Specifies number of transport specific info included. */ - int specific_info_cnt; + unsigned specific_info_cnt; /** * Buffer storage of transport specific info. diff --git a/sflphone-common/libs/pjproject/pjmedia/include/pjmedia/transport_ice.h b/sflphone-common/libs/pjproject/pjmedia/include/pjmedia/transport_ice.h index 1c19b377bd5d29c0ebf74557fd785385478ff567..507d86db5b226c26a1302b4e1bff947cd46d119a 100644 --- a/sflphone-common/libs/pjproject/pjmedia/include/pjmedia/transport_ice.h +++ b/sflphone-common/libs/pjproject/pjmedia/include/pjmedia/transport_ice.h @@ -1,4 +1,4 @@ -/* $Id: transport_ice.h 2394 2008-12-23 17:27:53Z bennylp $ */ +/* $Id: transport_ice.h 2945 2009-10-14 13:13:18Z bennylp $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> @@ -62,6 +62,52 @@ typedef struct pjmedia_ice_cb } pjmedia_ice_cb; +/** + * This structure specifies ICE transport specific info. This structure + * will be filled in media transport specific info. + */ +typedef struct pjmedia_ice_transport_info +{ + /** + * ICE sesion state. + */ + pj_ice_strans_state sess_state; + + /** + * Session role. + */ + pj_ice_sess_role role; + + /** + * Number of components in the component array. Before ICE negotiation + * is complete, the number represents the number of components of the + * local agent. After ICE negotiation has been completed successfully, + * the number represents the number of common components between local + * and remote agents. + */ + unsigned comp_cnt; + + /** + * Array of ICE components. Typically the first element denotes RTP and + * second element denotes RTCP. + */ + struct + { + /** + * Local candidate type. + */ + pj_ice_cand_type lcand_type; + + /** + * Remote candidate type. + */ + pj_ice_cand_type rcand_type; + + } comp[2]; + +} pjmedia_ice_transport_info; + + /** * Options that can be specified when creating ICE transport. */ diff --git a/sflphone-common/libs/pjproject/pjmedia/src/pjmedia-audiodev/symb_aps_dev.cpp b/sflphone-common/libs/pjproject/pjmedia/src/pjmedia-audiodev/symb_aps_dev.cpp index 5b237e4c4d23f9f214f818ab34ddd360688501f1..a7587a3968473e569a285e5bfc09c853011b81b1 100644 --- a/sflphone-common/libs/pjproject/pjmedia/src/pjmedia-audiodev/symb_aps_dev.cpp +++ b/sflphone-common/libs/pjproject/pjmedia/src/pjmedia-audiodev/symb_aps_dev.cpp @@ -1,5 +1,5 @@ -/* $Id: symb_aps_dev.cpp 2677 2009-05-06 15:44:12Z nanang $ */ -/* +/* $Id: symb_aps_dev.cpp 2958 2009-10-20 14:54:57Z nanang $ */ +/* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> * @@ -15,7 +15,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include <pjmedia-audiodev/audiodev_imp.h> #include <pjmedia-audiodev/errno.h> @@ -35,7 +35,7 @@ #include <APSClientSession.h> #include <pjmedia-codec/amr_helper.h> -/* Pack/unpack G.729 frame of S60 DSP codec, taken from: +/* Pack/unpack G.729 frame of S60 DSP codec, taken from: * http://wiki.forum.nokia.com/index.php/TSS000776_-_Payload_conversion_for_G.729_audio_format */ #include "s60_g729_bitstream.h" @@ -59,8 +59,8 @@ static pj_uint8_t aps_g711_frame_len; /* APS factory */ - -struct aps_factory { +struct aps_factory +{ pjmedia_aud_dev_factory base; pj_pool_t *pool; pj_pool_factory *pf; @@ -69,16 +69,15 @@ struct aps_factory { /* Forward declaration of CPjAudioEngine */ - class CPjAudioEngine; /* APS stream. */ - -struct aps_stream { +struct aps_stream +{ // Base pjmedia_aud_stream base; /**< Base class. */ - + // Pool pj_pool_t *pool; /**< Memory pool. */ @@ -101,7 +100,7 @@ struct aps_stream { pj_uint16_t rec_buf_len; /**< Record buffer length. */ void *strm_data; /**< Stream data. */ - /* Resampling is needed, in case audio device is opened with clock rate + /* Resampling is needed, in case audio device is opened with clock rate * other than 8kHz (only for PCM format). */ pjmedia_resample *play_resample; /**< Resampler for playback. */ @@ -118,37 +117,38 @@ struct aps_stream { /* Prototypes */ -static pj_status_t factory_init (pjmedia_aud_dev_factory *f); -static pj_status_t factory_destroy (pjmedia_aud_dev_factory *f); -static unsigned factory_get_dev_count (pjmedia_aud_dev_factory *f); -static pj_status_t factory_get_dev_info (pjmedia_aud_dev_factory *f, - unsigned index, - pjmedia_aud_dev_info *info); -static pj_status_t factory_default_param (pjmedia_aud_dev_factory *f, - unsigned index, - pjmedia_aud_param *param); -static pj_status_t factory_create_stream (pjmedia_aud_dev_factory *f, - const pjmedia_aud_param *param, - pjmedia_aud_rec_cb rec_cb, - pjmedia_aud_play_cb play_cb, - void *user_data, - pjmedia_aud_stream **p_aud_strm); - -static pj_status_t stream_get_param (pjmedia_aud_stream *strm, - pjmedia_aud_param *param); -static pj_status_t stream_get_cap (pjmedia_aud_stream *strm, - pjmedia_aud_dev_cap cap, - void *value); -static pj_status_t stream_set_cap (pjmedia_aud_stream *strm, - pjmedia_aud_dev_cap cap, - const void *value); -static pj_status_t stream_start (pjmedia_aud_stream *strm); -static pj_status_t stream_stop (pjmedia_aud_stream *strm); -static pj_status_t stream_destroy (pjmedia_aud_stream *strm); +static pj_status_t factory_init(pjmedia_aud_dev_factory *f); +static pj_status_t factory_destroy(pjmedia_aud_dev_factory *f); +static unsigned factory_get_dev_count(pjmedia_aud_dev_factory *f); +static pj_status_t factory_get_dev_info(pjmedia_aud_dev_factory *f, + unsigned index, + pjmedia_aud_dev_info *info); +static pj_status_t factory_default_param(pjmedia_aud_dev_factory *f, + unsigned index, + pjmedia_aud_param *param); +static pj_status_t factory_create_stream(pjmedia_aud_dev_factory *f, + const pjmedia_aud_param *param, + pjmedia_aud_rec_cb rec_cb, + pjmedia_aud_play_cb play_cb, + void *user_data, + pjmedia_aud_stream **p_aud_strm); + +static pj_status_t stream_get_param(pjmedia_aud_stream *strm, + pjmedia_aud_param *param); +static pj_status_t stream_get_cap(pjmedia_aud_stream *strm, + pjmedia_aud_dev_cap cap, + void *value); +static pj_status_t stream_set_cap(pjmedia_aud_stream *strm, + pjmedia_aud_dev_cap cap, + const void *value); +static pj_status_t stream_start(pjmedia_aud_stream *strm); +static pj_status_t stream_stop(pjmedia_aud_stream *strm); +static pj_status_t stream_destroy(pjmedia_aud_stream *strm); /* Operations */ -static pjmedia_aud_dev_factory_op factory_op = { +static pjmedia_aud_dev_factory_op factory_op = +{ &factory_init, &factory_destroy, &factory_get_dev_count, @@ -157,7 +157,8 @@ static pjmedia_aud_dev_factory_op factory_op = { &factory_create_stream }; -static pjmedia_aud_stream_op stream_op = { +static pjmedia_aud_stream_op stream_op = +{ &stream_get_param, &stream_get_cap, &stream_set_cap, @@ -174,344 +175,297 @@ static pjmedia_aud_stream_op stream_op = { /* * Utility: print sound device error */ -static void snd_perror (const char *title, TInt rc) +static void snd_perror(const char *title, TInt rc) { - PJ_LOG (1, (THIS_FILE, "%s (error code=%d)", title, rc)); + PJ_LOG(1,(THIS_FILE, "%s (error code=%d)", title, rc)); } -typedef void (*PjAudioCallback) (TAPSCommBuffer &buf, void *user_data); +typedef void(*PjAudioCallback)(TAPSCommBuffer &buf, void *user_data); /** * Abstract class for handler of callbacks from APS client. */ - class MQueueHandlerObserver { - - public: - MQueueHandlerObserver (PjAudioCallback RecCb_, PjAudioCallback PlayCb_, - void *UserData_) - : RecCb (RecCb_), PlayCb (PlayCb_), UserData (UserData_) {} - - virtual void InputStreamInitialized (const TInt aStatus) = 0; - virtual void OutputStreamInitialized (const TInt aStatus) = 0; - virtual void NotifyError (const TInt aError) = 0; - - public: - PjAudioCallback RecCb; - PjAudioCallback PlayCb; - void *UserData; +public: + MQueueHandlerObserver(PjAudioCallback RecCb_, PjAudioCallback PlayCb_, + void *UserData_) + : RecCb(RecCb_), PlayCb(PlayCb_), UserData(UserData_) + {} + + virtual void InputStreamInitialized(const TInt aStatus) = 0; + virtual void OutputStreamInitialized(const TInt aStatus) = 0; + virtual void NotifyError(const TInt aError) = 0; + +public: + PjAudioCallback RecCb; + PjAudioCallback PlayCb; + void *UserData; }; /** * Handler for communication and data queue. */ - class CQueueHandler : public CActive { +public: + // Types of queue handler + enum TQueueHandlerType { + ERecordCommQueue, + EPlayCommQueue, + ERecordQueue, + EPlayQueue + }; + + // The order corresponds to the APS Server state, do not change! + enum TState { + EAPSPlayerInitialize = 1, + EAPSRecorderInitialize = 2, + EAPSPlayData = 3, + EAPSRecordData = 4, + EAPSPlayerInitComplete = 5, + EAPSRecorderInitComplete = 6 + }; + + static CQueueHandler* NewL(MQueueHandlerObserver* aObserver, + RMsgQueue<TAPSCommBuffer>* aQ, + RMsgQueue<TAPSCommBuffer>* aWriteQ, + TQueueHandlerType aType) + { + CQueueHandler* self = new (ELeave) CQueueHandler(aObserver, aQ, aWriteQ, + aType); + CleanupStack::PushL(self); + self->ConstructL(); + CleanupStack::Pop(self); + return self; + } - public: - // Types of queue handler - enum TQueueHandlerType { - ERecordCommQueue, - EPlayCommQueue, - ERecordQueue, - EPlayQueue - }; - - // The order corresponds to the APS Server state, do not change! - enum TState { - EAPSPlayerInitialize = 1, - EAPSRecorderInitialize = 2, - EAPSPlayData = 3, - EAPSRecordData = 4, - EAPSPlayerInitComplete = 5, - EAPSRecorderInitComplete = 6 - }; - - static CQueueHandler* NewL (MQueueHandlerObserver* aObserver, - RMsgQueue<TAPSCommBuffer>* aQ, - RMsgQueue<TAPSCommBuffer>* aWriteQ, - TQueueHandlerType aType) { - CQueueHandler* self = new (ELeave) CQueueHandler (aObserver, aQ, aWriteQ, - aType); - CleanupStack::PushL (self); - self->ConstructL(); - CleanupStack::Pop (self); - return self; - } + // Destructor + ~CQueueHandler() { Cancel(); } - // Destructor - ~CQueueHandler() { - Cancel(); - } + // Start listening queue event + void Start() { + iQ->NotifyDataAvailable(iStatus); + SetActive(); + } - // Start listening queue event - void Start() { - iQ->NotifyDataAvailable (iStatus); - SetActive(); - } +private: + // Constructor + CQueueHandler(MQueueHandlerObserver* aObserver, + RMsgQueue<TAPSCommBuffer>* aQ, + RMsgQueue<TAPSCommBuffer>* aWriteQ, + TQueueHandlerType aType) + : CActive(CActive::EPriorityHigh), + iQ(aQ), iWriteQ(aWriteQ), iObserver(aObserver), iType(aType) + { + CActiveScheduler::Add(this); + + // use lower priority for comm queues + if ((iType == ERecordCommQueue) || (iType == EPlayCommQueue)) + SetPriority(CActive::EPriorityStandard); + } - private: - // Constructor - CQueueHandler (MQueueHandlerObserver* aObserver, - RMsgQueue<TAPSCommBuffer>* aQ, - RMsgQueue<TAPSCommBuffer>* aWriteQ, - TQueueHandlerType aType) - : CActive (CActive::EPriorityHigh), - iQ (aQ), iWriteQ (aWriteQ), iObserver (aObserver), iType (aType) { - CActiveScheduler::Add (this); + // Second phase constructor + void ConstructL() {} - // use lower priority for comm queues + // Inherited from CActive + void DoCancel() { iQ->CancelDataAvailable(); } - if ( (iType == ERecordCommQueue) || (iType == EPlayCommQueue)) - SetPriority (CActive::EPriorityStandard); + void RunL() { + if (iStatus != KErrNone) { + iObserver->NotifyError(iStatus.Int()); + return; } - // Second phase constructor - void ConstructL() {} - - // Inherited from CActive - void DoCancel() { - iQ->CancelDataAvailable(); + TAPSCommBuffer buffer; + TInt ret = iQ->Receive(buffer); + + if (ret != KErrNone) { + iObserver->NotifyError(ret); + return; + } + + switch (iType) { + case ERecordQueue: + if (buffer.iCommand == EAPSRecordData) { + iObserver->RecCb(buffer, iObserver->UserData); + } else { + iObserver->NotifyError(buffer.iStatus); + } + break; + + // Callbacks from the APS main thread + case EPlayCommQueue: + switch (buffer.iCommand) { + case EAPSPlayData: + if (buffer.iStatus == KErrUnderflow) { + iObserver->PlayCb(buffer, iObserver->UserData); + iWriteQ->Send(buffer); + } + break; + case EAPSPlayerInitialize: + iObserver->NotifyError(buffer.iStatus); + break; + case EAPSPlayerInitComplete: + iObserver->OutputStreamInitialized(buffer.iStatus); + break; + case EAPSRecorderInitComplete: + iObserver->InputStreamInitialized(buffer.iStatus); + break; + default: + iObserver->NotifyError(buffer.iStatus); + break; + } + break; + + // Callbacks from the APS recorder thread + case ERecordCommQueue: + switch (buffer.iCommand) { + // The APS recorder thread will only report errors + // through this handler. All other callbacks will be + // sent from the APS main thread through EPlayCommQueue + case EAPSRecorderInitialize: + case EAPSRecordData: + default: + iObserver->NotifyError(buffer.iStatus); + break; + } + break; + + default: + break; } - void RunL() { - if (iStatus != KErrNone) { - iObserver->NotifyError (iStatus.Int()); - return; - } - - TAPSCommBuffer buffer; - - TInt ret = iQ->Receive (buffer); - - if (ret != KErrNone) { - iObserver->NotifyError (ret); - return; - } - - switch (iType) { - - case ERecordQueue: - - if (buffer.iCommand == EAPSRecordData) { - iObserver->RecCb (buffer, iObserver->UserData); - } else { - iObserver->NotifyError (buffer.iStatus); - } - - break; - - // Callbacks from the APS main thread - - case EPlayCommQueue: - - switch (buffer.iCommand) { - - case EAPSPlayData: - - if (buffer.iStatus == KErrUnderflow) { - iObserver->PlayCb (buffer, iObserver->UserData); - iWriteQ->Send (buffer); - } - - break; - - case EAPSPlayerInitialize: - iObserver->NotifyError (buffer.iStatus); - break; - - case EAPSPlayerInitComplete: - iObserver->OutputStreamInitialized (buffer.iStatus); - break; - - case EAPSRecorderInitComplete: - iObserver->InputStreamInitialized (buffer.iStatus); - break; - - default: - iObserver->NotifyError (buffer.iStatus); - break; - } - - break; - - // Callbacks from the APS recorder thread - - case ERecordCommQueue: - - switch (buffer.iCommand) { - // The APS recorder thread will only report errors - // through this handler. All other callbacks will be - // sent from the APS main thread through EPlayCommQueue - - case EAPSRecorderInitialize: - - case EAPSRecordData: - - default: - iObserver->NotifyError (buffer.iStatus); - break; - } - - break; - - default: - break; - } - - // issue next request - iQ->NotifyDataAvailable (iStatus); - - SetActive(); - } + // issue next request + iQ->NotifyDataAvailable(iStatus); + SetActive(); + } - TInt RunError (TInt) { - return 0; - } + TInt RunError(TInt) { + return 0; + } - // Data - RMsgQueue<TAPSCommBuffer> *iQ; // (not owned) - RMsgQueue<TAPSCommBuffer> *iWriteQ; // (not owned) - MQueueHandlerObserver *iObserver; // (not owned) - TQueueHandlerType iType; + // Data + RMsgQueue<TAPSCommBuffer> *iQ; // (not owned) + RMsgQueue<TAPSCommBuffer> *iWriteQ; // (not owned) + MQueueHandlerObserver *iObserver; // (not owned) + TQueueHandlerType iType; }; /* * Audio setting for CPjAudioEngine. */ - class CPjAudioSetting { - - public: - TFourCC fourcc; - TAPSCodecMode mode; - TBool plc; - TBool vad; - TBool cng; - TBool loudspk; +public: + TFourCC fourcc; + TAPSCodecMode mode; + TBool plc; + TBool vad; + TBool cng; + TBool loudspk; }; /* * Implementation: Symbian Input & Output Stream. */ - class CPjAudioEngine : public CBase, MQueueHandlerObserver { - - public: - enum State { - STATE_NULL, - STATE_INITIALIZING, - STATE_READY, - STATE_STREAMING, - STATE_PENDING_STOP - }; - - ~CPjAudioEngine(); - - static CPjAudioEngine *NewL (struct aps_stream *parent_strm, - PjAudioCallback rec_cb, - PjAudioCallback play_cb, - void *user_data, - const CPjAudioSetting &setting); - - TInt StartL(); - void Stop(); - - TInt ActivateSpeaker (TBool active); - - TInt SetVolume (TInt vol) { - return iSession.SetVolume (vol); - } - - TInt GetVolume() { - return iSession.Volume(); - } - - TInt GetMaxVolume() { - return iSession.MaxVolume(); - } - - TInt SetGain (TInt gain) { - return iSession.SetGain (gain); - } - - TInt GetGain() { - return iSession.Gain(); - } - - TInt GetMaxGain() { - return iSession.MaxGain(); - } - - private: - CPjAudioEngine (struct aps_stream *parent_strm, - PjAudioCallback rec_cb, - PjAudioCallback play_cb, - void *user_data, - const CPjAudioSetting &setting); - void ConstructL(); - - TInt InitPlayL(); - TInt InitRecL(); - TInt StartStreamL(); - - // Inherited from MQueueHandlerObserver - virtual void InputStreamInitialized (const TInt aStatus); - virtual void OutputStreamInitialized (const TInt aStatus); - virtual void NotifyError (const TInt aError); - - State state_; - - struct aps_stream *parentStrm_; - CPjAudioSetting setting_; - - RAPSSession iSession; - TAPSInitSettings iPlaySettings; - TAPSInitSettings iRecSettings; - - RMsgQueue<TAPSCommBuffer> iReadQ; - RMsgQueue<TAPSCommBuffer> iReadCommQ; - RMsgQueue<TAPSCommBuffer> iWriteQ; - RMsgQueue<TAPSCommBuffer> iWriteCommQ; - - CQueueHandler *iPlayCommHandler; - CQueueHandler *iRecCommHandler; - CQueueHandler *iRecHandler; +public: + enum State + { + STATE_NULL, + STATE_INITIALIZING, + STATE_READY, + STATE_STREAMING, + STATE_PENDING_STOP + }; + + ~CPjAudioEngine(); + + static CPjAudioEngine *NewL(struct aps_stream *parent_strm, + PjAudioCallback rec_cb, + PjAudioCallback play_cb, + void *user_data, + const CPjAudioSetting &setting); + + TInt StartL(); + void Stop(); + + TInt ActivateSpeaker(TBool active); + + TInt SetVolume(TInt vol) { return iSession.SetVolume(vol); } + TInt GetVolume() { return iSession.Volume(); } + TInt GetMaxVolume() { return iSession.MaxVolume(); } + + TInt SetGain(TInt gain) { return iSession.SetGain(gain); } + TInt GetGain() { return iSession.Gain(); } + TInt GetMaxGain() { return iSession.MaxGain(); } + +private: + CPjAudioEngine(struct aps_stream *parent_strm, + PjAudioCallback rec_cb, + PjAudioCallback play_cb, + void *user_data, + const CPjAudioSetting &setting); + void ConstructL(); + + TInt InitPlayL(); + TInt InitRecL(); + TInt StartStreamL(); + + // Inherited from MQueueHandlerObserver + virtual void InputStreamInitialized(const TInt aStatus); + virtual void OutputStreamInitialized(const TInt aStatus); + virtual void NotifyError(const TInt aError); + + State state_; + struct aps_stream *parentStrm_; + CPjAudioSetting setting_; + + RAPSSession iSession; + TAPSInitSettings iPlaySettings; + TAPSInitSettings iRecSettings; + + RMsgQueue<TAPSCommBuffer> iReadQ; + RMsgQueue<TAPSCommBuffer> iReadCommQ; + RMsgQueue<TAPSCommBuffer> iWriteQ; + RMsgQueue<TAPSCommBuffer> iWriteCommQ; + + CQueueHandler *iPlayCommHandler; + CQueueHandler *iRecCommHandler; + CQueueHandler *iRecHandler; }; -CPjAudioEngine* CPjAudioEngine::NewL (struct aps_stream *parent_strm, - PjAudioCallback rec_cb, - PjAudioCallback play_cb, - void *user_data, - const CPjAudioSetting &setting) +CPjAudioEngine* CPjAudioEngine::NewL(struct aps_stream *parent_strm, + PjAudioCallback rec_cb, + PjAudioCallback play_cb, + void *user_data, + const CPjAudioSetting &setting) { - CPjAudioEngine* self = new (ELeave) CPjAudioEngine (parent_strm, - rec_cb, play_cb, - user_data, - setting); - CleanupStack::PushL (self); + CPjAudioEngine* self = new (ELeave) CPjAudioEngine(parent_strm, + rec_cb, play_cb, + user_data, + setting); + CleanupStack::PushL(self); self->ConstructL(); - CleanupStack::Pop (self); + CleanupStack::Pop(self); return self; } -CPjAudioEngine::CPjAudioEngine (struct aps_stream *parent_strm, - PjAudioCallback rec_cb, - PjAudioCallback play_cb, - void *user_data, - const CPjAudioSetting &setting) - : MQueueHandlerObserver (rec_cb, play_cb, user_data), - state_ (STATE_NULL), - parentStrm_ (parent_strm), - setting_ (setting), - iPlayCommHandler (0), - iRecCommHandler (0), - iRecHandler (0) +CPjAudioEngine::CPjAudioEngine(struct aps_stream *parent_strm, + PjAudioCallback rec_cb, + PjAudioCallback play_cb, + void *user_data, + const CPjAudioSetting &setting) + : MQueueHandlerObserver(rec_cb, play_cb, user_data), + state_(STATE_NULL), + parentStrm_(parent_strm), + setting_(setting), + iPlayCommHandler(0), + iRecCommHandler(0), + iRecHandler(0) { } @@ -528,57 +482,49 @@ CPjAudioEngine::~CPjAudioEngine() // the client session. TTime start, now; enum { APS_CLOSE_WAIT_TIME = 200 }; /* in msecs */ - + start.UniversalTime(); - do { - pj_symbianos_poll (-1, APS_CLOSE_WAIT_TIME); - now.UniversalTime(); - } while (now.MicroSecondsFrom (start) < APS_CLOSE_WAIT_TIME * 1000); + pj_symbianos_poll(-1, APS_CLOSE_WAIT_TIME); + now.UniversalTime(); + } while (now.MicroSecondsFrom(start) < APS_CLOSE_WAIT_TIME * 1000); iSession.Close(); if (state_ == STATE_READY) { - if (parentStrm_->param.dir != PJMEDIA_DIR_PLAYBACK) { - iReadQ.Close(); - iReadCommQ.Close(); - } - - iWriteQ.Close(); - - iWriteCommQ.Close(); + if (parentStrm_->param.dir != PJMEDIA_DIR_PLAYBACK) { + iReadQ.Close(); + iReadCommQ.Close(); + } + iWriteQ.Close(); + iWriteCommQ.Close(); } - - TRACE_ ( (THIS_FILE, "Sound device destroyed")); + + TRACE_((THIS_FILE, "Sound device destroyed")); } TInt CPjAudioEngine::InitPlayL() { - TInt err = iSession.InitializePlayer (iPlaySettings); - + TInt err = iSession.InitializePlayer(iPlaySettings); if (err != KErrNone) { - snd_perror ("Failed to initialize player", err); - return err; + snd_perror("Failed to initialize player", err); + return err; } // Open message queues for the output stream TBuf<128> buf2 = iPlaySettings.iGlobal; - - buf2.Append (_L ("PlayQueue")); - + buf2.Append(_L("PlayQueue")); TBuf<128> buf3 = iPlaySettings.iGlobal; + buf3.Append(_L("PlayCommQueue")); - buf3.Append (_L ("PlayCommQueue")); - - while (iWriteQ.OpenGlobal (buf2)) - User::After (10); - - while (iWriteCommQ.OpenGlobal (buf3)) - User::After (10); + while (iWriteQ.OpenGlobal(buf2)) + User::After(10); + while (iWriteCommQ.OpenGlobal(buf3)) + User::After(10); // Construct message queue handler - iPlayCommHandler = CQueueHandler::NewL (this, &iWriteCommQ, &iWriteQ, - CQueueHandler::EPlayCommQueue); + iPlayCommHandler = CQueueHandler::NewL(this, &iWriteCommQ, &iWriteQ, + CQueueHandler::EPlayCommQueue); // Start observing APS callbacks on output stream message queue iPlayCommHandler->Start(); @@ -589,38 +535,32 @@ TInt CPjAudioEngine::InitPlayL() TInt CPjAudioEngine::InitRecL() { // Initialize input stream device - TInt err = iSession.InitializeRecorder (iRecSettings); - + TInt err = iSession.InitializeRecorder(iRecSettings); if (err != KErrNone && err != KErrAlreadyExists) { - snd_perror ("Failed to initialize recorder", err); - return err; + snd_perror("Failed to initialize recorder", err); + return err; } TBuf<128> buf1 = iRecSettings.iGlobal; - - buf1.Append (_L ("RecordQueue")); + buf1.Append(_L("RecordQueue")); TBuf<128> buf4 = iRecSettings.iGlobal; - buf4.Append (_L ("RecordCommQueue")); + buf4.Append(_L("RecordCommQueue")); // Must wait for APS thread to finish creating message queues // before we can open and use them. - - while (iReadQ.OpenGlobal (buf1)) - User::After (10); - - while (iReadCommQ.OpenGlobal (buf4)) - User::After (10); + while (iReadQ.OpenGlobal(buf1)) + User::After(10); + while (iReadCommQ.OpenGlobal(buf4)) + User::After(10); // Construct message queue handlers - iRecHandler = CQueueHandler::NewL (this, &iReadQ, NULL, - CQueueHandler::ERecordQueue); - - iRecCommHandler = CQueueHandler::NewL (this, &iReadCommQ, NULL, - CQueueHandler::ERecordCommQueue); + iRecHandler = CQueueHandler::NewL(this, &iReadQ, NULL, + CQueueHandler::ERecordQueue); + iRecCommHandler = CQueueHandler::NewL(this, &iReadCommQ, NULL, + CQueueHandler::ERecordCommQueue); // Start observing APS callbacks from on input stream message queue iRecHandler->Start(); - iRecCommHandler->Start(); return 0; @@ -629,10 +569,10 @@ TInt CPjAudioEngine::InitRecL() TInt CPjAudioEngine::StartL() { if (state_ == STATE_READY) - return StartStreamL(); - - PJ_ASSERT_RETURN (state_ == STATE_NULL, PJMEDIA_EAUD_INVOP); + return StartStreamL(); + PJ_ASSERT_RETURN(state_ == STATE_NULL, PJMEDIA_EAUD_INVOP); + // Even if only capturer are opened, playback thread of APS Server need // to be run(?). Since some messages will be delivered via play comm queue. state_ = STATE_INITIALIZING; @@ -643,18 +583,17 @@ TInt CPjAudioEngine::StartL() void CPjAudioEngine::Stop() { if (state_ == STATE_STREAMING) { - iSession.Stop(); - state_ = STATE_READY; - TRACE_ ( (THIS_FILE, "Sound device stopped")); + iSession.Stop(); + state_ = STATE_READY; + TRACE_((THIS_FILE, "Sound device stopped")); } else if (state_ == STATE_INITIALIZING) { - // Initialization is on progress, so let's set the state to - // STATE_PENDING_STOP to prevent it starting the stream. - state_ = STATE_PENDING_STOP; - - // Then wait until initialization done. - - while (state_ != STATE_READY) - pj_symbianos_poll (-1, 100); + // Initialization is on progress, so let's set the state to + // STATE_PENDING_STOP to prevent it starting the stream. + state_ = STATE_PENDING_STOP; + + // Then wait until initialization done. + while (state_ != STATE_READY) + pj_symbianos_poll(-1, 100); } } @@ -663,96 +602,94 @@ void CPjAudioEngine::ConstructL() // Recorder settings iRecSettings.iFourCC = setting_.fourcc; iRecSettings.iGlobal = APP_UID; - iRecSettings.iPriority = TMdaPriority (100); - iRecSettings.iPreference = TMdaPriorityPreference (0x05210001); + iRecSettings.iPriority = TMdaPriority(100); + iRecSettings.iPreference = TMdaPriorityPreference(0x05210001); iRecSettings.iSettings.iChannels = EMMFMono; iRecSettings.iSettings.iSampleRate = EMMFSampleRate8000Hz; // Player settings iPlaySettings.iFourCC = setting_.fourcc; iPlaySettings.iGlobal = APP_UID; - iPlaySettings.iPriority = TMdaPriority (100); - iPlaySettings.iPreference = TMdaPriorityPreference (0x05220001); + iPlaySettings.iPriority = TMdaPriority(100); + iPlaySettings.iPreference = TMdaPriorityPreference(0x05220001); iPlaySettings.iSettings.iChannels = EMMFMono; iPlaySettings.iSettings.iSampleRate = EMMFSampleRate8000Hz; iPlaySettings.iSettings.iVolume = 0; - User::LeaveIfError (iSession.Connect()); + User::LeaveIfError(iSession.Connect()); } TInt CPjAudioEngine::StartStreamL() { - pj_assert (state_==STATE_READY || state_==STATE_INITIALIZING); - - iSession.SetCng (setting_.cng); - iSession.SetVadMode (setting_.vad); - iSession.SetPlc (setting_.plc); - iSession.SetEncoderMode (setting_.mode); - iSession.SetDecoderMode (setting_.mode); - iSession.ActivateLoudspeaker (setting_.loudspk); + pj_assert(state_==STATE_READY || state_==STATE_INITIALIZING); + + iSession.SetCng(setting_.cng); + iSession.SetVadMode(setting_.vad); + iSession.SetPlc(setting_.plc); + iSession.SetEncoderMode(setting_.mode); + iSession.SetDecoderMode(setting_.mode); + iSession.ActivateLoudspeaker(setting_.loudspk); // Not only capture - if (parentStrm_->param.dir != PJMEDIA_DIR_CAPTURE) { - iSession.Write(); - TRACE_ ( (THIS_FILE, "Player started")); + iSession.Write(); + TRACE_((THIS_FILE, "Player started")); } // Not only playback if (parentStrm_->param.dir != PJMEDIA_DIR_PLAYBACK) { - iSession.Read(); - TRACE_ ( (THIS_FILE, "Recorder started")); + iSession.Read(); + TRACE_((THIS_FILE, "Recorder started")); } state_ = STATE_STREAMING; - + return 0; } -void CPjAudioEngine::InputStreamInitialized (const TInt aStatus) +void CPjAudioEngine::InputStreamInitialized(const TInt aStatus) { - TRACE_ ( (THIS_FILE, "Recorder initialized, err=%d", aStatus)); + TRACE_((THIS_FILE, "Recorder initialized, err=%d", aStatus)); if (aStatus == KErrNone) { - // Don't start the stream since Stop() has been requested. - if (state_ != STATE_PENDING_STOP) { - StartStreamL(); - } else { - state_ = STATE_READY; - } + // Don't start the stream since Stop() has been requested. + if (state_ != STATE_PENDING_STOP) { + StartStreamL(); + } else { + state_ = STATE_READY; + } } } -void CPjAudioEngine::OutputStreamInitialized (const TInt aStatus) +void CPjAudioEngine::OutputStreamInitialized(const TInt aStatus) { - TRACE_ ( (THIS_FILE, "Player initialized, err=%d", aStatus)); + TRACE_((THIS_FILE, "Player initialized, err=%d", aStatus)); if (aStatus == KErrNone) { - if (parentStrm_->param.dir == PJMEDIA_DIR_PLAYBACK) { - // Don't start the stream since Stop() has been requested. - if (state_ != STATE_PENDING_STOP) { - StartStreamL(); - } else { - state_ = STATE_READY; - } - } else - InitRecL(); + if (parentStrm_->param.dir == PJMEDIA_DIR_PLAYBACK) { + // Don't start the stream since Stop() has been requested. + if (state_ != STATE_PENDING_STOP) { + StartStreamL(); + } else { + state_ = STATE_READY; + } + } else + InitRecL(); } } -void CPjAudioEngine::NotifyError (const TInt aError) +void CPjAudioEngine::NotifyError(const TInt aError) { - snd_perror ("Error from CQueueHandler", aError); + snd_perror("Error from CQueueHandler", aError); } -TInt CPjAudioEngine::ActivateSpeaker (TBool active) +TInt CPjAudioEngine::ActivateSpeaker(TBool active) { if (state_ == STATE_READY || state_ == STATE_STREAMING) { - iSession.ActivateLoudspeaker (active); - TRACE_ ( (THIS_FILE, "Loudspeaker turned %s", (active? "on":"off"))); - return KErrNone; + iSession.ActivateLoudspeaker(active); + TRACE_((THIS_FILE, "Loudspeaker turned %s", (active? "on":"off"))); + return KErrNone; } - return KErrNotReady; } @@ -760,22 +697,20 @@ TInt CPjAudioEngine::ActivateSpeaker (TBool active) * Internal APS callbacks for PCM format */ -static void RecCbPcm (TAPSCommBuffer &buf, void *user_data) +static void RecCbPcm(TAPSCommBuffer &buf, void *user_data) { - struct aps_stream *strm = (struct aps_stream*) user_data; /* Buffer has to contain normal speech. */ - pj_assert (buf.iBuffer[0] == 1 && buf.iBuffer[1] == 0); + pj_assert(buf.iBuffer[0] == 1 && buf.iBuffer[1] == 0); /* Detect the recorder G.711 frame size, player frame size will follow * this recorder frame size. */ - if (aps_g711_frame_len == 0) { - aps_g711_frame_len = buf.iBuffer.Length() < 160? 80 : 160; - TRACE_ ( (THIS_FILE, "Detected APS G.711 frame size = %u samples", - aps_g711_frame_len)); + aps_g711_frame_len = buf.iBuffer.Length() < 160? 80 : 160; + TRACE_((THIS_FILE, "Detected APS G.711 frame size = %u samples", + aps_g711_frame_len)); } /* Decode APS buffer (coded in G.711) and put the PCM result into rec_buf. @@ -784,75 +719,68 @@ static void RecCbPcm (TAPSCommBuffer &buf, void *user_data) unsigned samples_processed = 0; while (samples_processed < aps_g711_frame_len) { - unsigned samples_to_process; - unsigned samples_req; - - samples_to_process = aps_g711_frame_len - samples_processed; - samples_req = (strm->param.samples_per_frame / - strm->param.channel_count / - strm->resample_factor) - - strm->rec_buf_len; - - if (samples_to_process > samples_req) - samples_to_process = samples_req; - - pjmedia_ulaw_decode (&strm->rec_buf[strm->rec_buf_len], - buf.iBuffer.Ptr() + 2 + samples_processed, - samples_to_process); - - strm->rec_buf_len += samples_to_process; - - samples_processed += samples_to_process; - - /* Buffer is full, time to call parent callback */ - if (strm->rec_buf_len == strm->param.samples_per_frame / - strm->param.channel_count / - strm->resample_factor) { - pjmedia_frame f; - - /* Need to resample clock rate? */ - - if (strm->rec_resample) { - unsigned resampled = 0; - - while (resampled < strm->rec_buf_len) { - pjmedia_resample_run (strm->rec_resample, - &strm->rec_buf[resampled], - strm->pcm_buf + - resampled * strm->resample_factor); - resampled += 80; - } - - f.buf = strm->pcm_buf; - } else { - f.buf = strm->rec_buf; - } - - /* Need to convert channel count? */ - if (strm->param.channel_count != 1) { - pjmedia_convert_channel_1ton ( (pj_int16_t*) f.buf, - (pj_int16_t*) f.buf, - strm->param.channel_count, - strm->param.samples_per_frame / - strm->param.channel_count, - 0); - } - - /* Call parent callback */ - f.type = PJMEDIA_FRAME_TYPE_AUDIO; - - f.size = strm->param.samples_per_frame << 1; - - strm->rec_cb (strm->user_data, &f); - - strm->rec_buf_len = 0; - } + unsigned samples_to_process; + unsigned samples_req; + + samples_to_process = aps_g711_frame_len - samples_processed; + samples_req = (strm->param.samples_per_frame / + strm->param.channel_count / + strm->resample_factor) - + strm->rec_buf_len; + if (samples_to_process > samples_req) + samples_to_process = samples_req; + + pjmedia_ulaw_decode(&strm->rec_buf[strm->rec_buf_len], + buf.iBuffer.Ptr() + 2 + samples_processed, + samples_to_process); + + strm->rec_buf_len += samples_to_process; + samples_processed += samples_to_process; + + /* Buffer is full, time to call parent callback */ + if (strm->rec_buf_len == strm->param.samples_per_frame / + strm->param.channel_count / + strm->resample_factor) + { + pjmedia_frame f; + + /* Need to resample clock rate? */ + if (strm->rec_resample) { + unsigned resampled = 0; + + while (resampled < strm->rec_buf_len) { + pjmedia_resample_run(strm->rec_resample, + &strm->rec_buf[resampled], + strm->pcm_buf + + resampled * strm->resample_factor); + resampled += 80; + } + f.buf = strm->pcm_buf; + } else { + f.buf = strm->rec_buf; + } + + /* Need to convert channel count? */ + if (strm->param.channel_count != 1) { + pjmedia_convert_channel_1ton((pj_int16_t*)f.buf, + (pj_int16_t*)f.buf, + strm->param.channel_count, + strm->param.samples_per_frame / + strm->param.channel_count, + 0); + } + + /* Call parent callback */ + f.type = PJMEDIA_FRAME_TYPE_AUDIO; + f.size = strm->param.samples_per_frame << 1; + strm->rec_cb(strm->user_data, &f); + strm->rec_buf_len = 0; + } } } -static void PlayCbPcm (TAPSCommBuffer &buf, void *user_data) +static void PlayCbPcm(TAPSCommBuffer &buf, void *user_data) { - struct aps_stream *strm = (struct aps_stream*) user_data; unsigned g711_frame_len = aps_g711_frame_len; @@ -860,84 +788,79 @@ static void PlayCbPcm (TAPSCommBuffer &buf, void *user_data) buf.iCommand = CQueueHandler::EAPSPlayData; buf.iStatus = 0; buf.iBuffer.Zero(); - buf.iBuffer.Append (1); - buf.iBuffer.Append (0); + buf.iBuffer.Append(1); + buf.iBuffer.Append(0); /* Assume frame size is 10ms if frame size hasn't been known. */ - if (g711_frame_len == 0) - g711_frame_len = 80; + g711_frame_len = 80; /* Call parent stream callback to get PCM samples to play, * encode the PCM samples into G.711 and put it into APS buffer. */ unsigned samples_processed = 0; - + while (samples_processed < g711_frame_len) { - /* Need more samples to play, time to call parent callback */ - if (strm->play_buf_len == 0) { - pjmedia_frame f; - unsigned samples_got; - - f.size = strm->param.samples_per_frame << 1; - - if (strm->play_resample || strm->param.channel_count != 1) - f.buf = strm->pcm_buf; - else - f.buf = strm->play_buf; - - /* Call parent callback */ - strm->play_cb (strm->user_data, &f); - - if (f.type != PJMEDIA_FRAME_TYPE_AUDIO) { - pjmedia_zero_samples ( (pj_int16_t*) f.buf, - strm->param.samples_per_frame); - } - - samples_got = strm->param.samples_per_frame / - - strm->param.channel_count / - strm->resample_factor; - - /* Need to convert channel count? */ - - if (strm->param.channel_count != 1) { - pjmedia_convert_channel_nto1 ( (pj_int16_t*) f.buf, - (pj_int16_t*) f.buf, - strm->param.channel_count, - strm->param.samples_per_frame, - PJ_FALSE, - 0); - } - - /* Need to resample clock rate? */ - if (strm->play_resample) { - unsigned resampled = 0; - - while (resampled < samples_got) { - pjmedia_resample_run (strm->play_resample, - strm->pcm_buf + - resampled * strm->resample_factor, - &strm->play_buf[resampled]); - resampled += 80; - } - } - - strm->play_buf_len = samples_got; - - strm->play_buf_start = 0; - } - - unsigned tmp; - - tmp = PJ_MIN (strm->play_buf_len, g711_frame_len - samples_processed); - pjmedia_ulaw_encode ( (pj_uint8_t*) &strm->play_buf[strm->play_buf_start], - &strm->play_buf[strm->play_buf_start], - tmp); - buf.iBuffer.Append ( (TUint8*) &strm->play_buf[strm->play_buf_start], tmp); - samples_processed += tmp; - strm->play_buf_len -= tmp; - strm->play_buf_start += tmp; + /* Need more samples to play, time to call parent callback */ + if (strm->play_buf_len == 0) { + pjmedia_frame f; + unsigned samples_got; + + f.size = strm->param.samples_per_frame << 1; + if (strm->play_resample || strm->param.channel_count != 1) + f.buf = strm->pcm_buf; + else + f.buf = strm->play_buf; + + /* Call parent callback */ + strm->play_cb(strm->user_data, &f); + if (f.type != PJMEDIA_FRAME_TYPE_AUDIO) { + pjmedia_zero_samples((pj_int16_t*)f.buf, + strm->param.samples_per_frame); + } + + samples_got = strm->param.samples_per_frame / + strm->param.channel_count / + strm->resample_factor; + + /* Need to convert channel count? */ + if (strm->param.channel_count != 1) { + pjmedia_convert_channel_nto1((pj_int16_t*)f.buf, + (pj_int16_t*)f.buf, + strm->param.channel_count, + strm->param.samples_per_frame, + PJ_FALSE, + 0); + } + + /* Need to resample clock rate? */ + if (strm->play_resample) { + unsigned resampled = 0; + + while (resampled < samples_got) + { + pjmedia_resample_run(strm->play_resample, + strm->pcm_buf + + resampled * strm->resample_factor, + &strm->play_buf[resampled]); + resampled += 80; + } + } + + strm->play_buf_len = samples_got; + strm->play_buf_start = 0; + } + + unsigned tmp; + + tmp = PJ_MIN(strm->play_buf_len, g711_frame_len - samples_processed); + pjmedia_ulaw_encode((pj_uint8_t*)&strm->play_buf[strm->play_buf_start], + &strm->play_buf[strm->play_buf_start], + tmp); + buf.iBuffer.Append((TUint8*)&strm->play_buf[strm->play_buf_start], tmp); + samples_processed += tmp; + strm->play_buf_len -= tmp; + strm->play_buf_start += tmp; } } @@ -945,138 +868,131 @@ static void PlayCbPcm (TAPSCommBuffer &buf, void *user_data) * Internal APS callbacks for non-PCM format */ -static void RecCb (TAPSCommBuffer &buf, void *user_data) +static void RecCb(TAPSCommBuffer &buf, void *user_data) { - struct aps_stream *strm = (struct aps_stream*) user_data; pjmedia_frame_ext *frame = (pjmedia_frame_ext*) strm->rec_buf; - - switch (strm->param.ext_fmt.id) { - - case PJMEDIA_FORMAT_AMR: { - const pj_uint8_t *p = (const pj_uint8_t*) buf.iBuffer.Ptr() + 1; - unsigned len = buf.iBuffer.Length() - 1; - - pjmedia_frame_ext_append_subframe (frame, p, len << 3, 160); - - if (frame->samples_cnt == strm->param.samples_per_frame) { - frame->base.type = PJMEDIA_FRAME_TYPE_EXTENDED; - strm->rec_cb (strm->user_data, (pjmedia_frame*) frame); - frame->samples_cnt = 0; - frame->subframe_cnt = 0; - } - } - - break; - - case PJMEDIA_FORMAT_G729: { - /* Check if we got a normal or SID frame. */ - if (buf.iBuffer[0] != 0 || buf.iBuffer[1] != 0) { - enum { NORMAL_LEN = 22, SID_LEN = 8 }; - TBitStream *bitstream = (TBitStream*) strm->strm_data; - unsigned src_len = buf.iBuffer.Length()- 2; - - pj_assert (src_len == NORMAL_LEN || src_len == SID_LEN); - - const TDesC8& p = bitstream->CompressG729Frame ( - buf.iBuffer.Right (src_len), - src_len == SID_LEN); - - pjmedia_frame_ext_append_subframe (frame, p.Ptr(), - p.Length() << 3, 80); - } else { /* We got null frame. */ - pjmedia_frame_ext_append_subframe (frame, NULL, 0, 80); - } - - if (frame->samples_cnt == strm->param.samples_per_frame) { - frame->base.type = PJMEDIA_FRAME_TYPE_EXTENDED; - strm->rec_cb (strm->user_data, (pjmedia_frame*) frame); - frame->samples_cnt = 0; - frame->subframe_cnt = 0; - } - } - - break; - - case PJMEDIA_FORMAT_ILBC: { - unsigned samples_got; - - samples_got = strm->param.ext_fmt.bitrate == 15200? 160 : 240; - - /* Check if we got a normal frame. */ - - if (buf.iBuffer[0] == 1 && buf.iBuffer[1] == 0) { - const pj_uint8_t *p = (const pj_uint8_t*) buf.iBuffer.Ptr() + 2; - unsigned len = buf.iBuffer.Length() - 2; - - pjmedia_frame_ext_append_subframe (frame, p, len << 3, - samples_got); - } else { /* We got null frame. */ - pjmedia_frame_ext_append_subframe (frame, NULL, 0, samples_got); - } - - if (frame->samples_cnt == strm->param.samples_per_frame) { - frame->base.type = PJMEDIA_FRAME_TYPE_EXTENDED; - strm->rec_cb (strm->user_data, (pjmedia_frame*) frame); - frame->samples_cnt = 0; - frame->subframe_cnt = 0; - } - } - - break; - - case PJMEDIA_FORMAT_PCMU: - - case PJMEDIA_FORMAT_PCMA: { - unsigned samples_processed = 0; - - /* Make sure it is normal frame. */ - pj_assert (buf.iBuffer[0] == 1 && buf.iBuffer[1] == 0); - - /* Detect the recorder G.711 frame size, player frame size will - * follow this recorder frame size. - */ - - if (aps_g711_frame_len == 0) { - aps_g711_frame_len = buf.iBuffer.Length() < 160? 80 : 160; - TRACE_ ( (THIS_FILE, "Detected APS G.711 frame size = %u samples", - aps_g711_frame_len)); - } - - /* Convert APS buffer format into pjmedia_frame_ext. Whenever - * samples count in the frame is equal to stream's samples per - * frame, call parent stream callback. - */ - while (samples_processed < aps_g711_frame_len) { - unsigned tmp; - const pj_uint8_t *pb = (const pj_uint8_t*) buf.iBuffer.Ptr() + - 2 + samples_processed; - - tmp = PJ_MIN (strm->param.samples_per_frame - frame->samples_cnt, - aps_g711_frame_len - samples_processed); - - pjmedia_frame_ext_append_subframe (frame, pb, tmp << 3, tmp); - samples_processed += tmp; - - if (frame->samples_cnt == strm->param.samples_per_frame) { - frame->base.type = PJMEDIA_FRAME_TYPE_EXTENDED; - strm->rec_cb (strm->user_data, (pjmedia_frame*) frame); - frame->samples_cnt = 0; - frame->subframe_cnt = 0; - } - } - } - - break; - - default: - break; + + switch(strm->param.ext_fmt.id) { + case PJMEDIA_FORMAT_AMR: + { + const pj_uint8_t *p = (const pj_uint8_t*)buf.iBuffer.Ptr() + 1; + unsigned len = buf.iBuffer.Length() - 1; + + pjmedia_frame_ext_append_subframe(frame, p, len << 3, 160); + if (frame->samples_cnt == strm->param.samples_per_frame) { + frame->base.type = PJMEDIA_FRAME_TYPE_EXTENDED; + strm->rec_cb(strm->user_data, (pjmedia_frame*)frame); + frame->samples_cnt = 0; + frame->subframe_cnt = 0; + } + } + break; + + case PJMEDIA_FORMAT_G729: + { + /* Check if we got a normal or SID frame. */ + if (buf.iBuffer[0] != 0 || buf.iBuffer[1] != 0) { + enum { NORMAL_LEN = 22, SID_LEN = 8 }; + TBitStream *bitstream = (TBitStream*)strm->strm_data; + unsigned src_len = buf.iBuffer.Length()- 2; + + pj_assert(src_len == NORMAL_LEN || src_len == SID_LEN); + + const TDesC8& p = bitstream->CompressG729Frame( + buf.iBuffer.Right(src_len), + src_len == SID_LEN); + + pjmedia_frame_ext_append_subframe(frame, p.Ptr(), + p.Length() << 3, 80); + } else { /* We got null frame. */ + pjmedia_frame_ext_append_subframe(frame, NULL, 0, 80); + } + + if (frame->samples_cnt == strm->param.samples_per_frame) { + frame->base.type = PJMEDIA_FRAME_TYPE_EXTENDED; + strm->rec_cb(strm->user_data, (pjmedia_frame*)frame); + frame->samples_cnt = 0; + frame->subframe_cnt = 0; + } + } + break; + + case PJMEDIA_FORMAT_ILBC: + { + unsigned samples_got; + + samples_got = strm->param.ext_fmt.bitrate == 15200? 160 : 240; + + /* Check if we got a normal frame. */ + if (buf.iBuffer[0] == 1 && buf.iBuffer[1] == 0) { + const pj_uint8_t *p = (const pj_uint8_t*)buf.iBuffer.Ptr() + 2; + unsigned len = buf.iBuffer.Length() - 2; + + pjmedia_frame_ext_append_subframe(frame, p, len << 3, + samples_got); + } else { /* We got null frame. */ + pjmedia_frame_ext_append_subframe(frame, NULL, 0, samples_got); + } + + if (frame->samples_cnt == strm->param.samples_per_frame) { + frame->base.type = PJMEDIA_FRAME_TYPE_EXTENDED; + strm->rec_cb(strm->user_data, (pjmedia_frame*)frame); + frame->samples_cnt = 0; + frame->subframe_cnt = 0; + } + } + break; + + case PJMEDIA_FORMAT_PCMU: + case PJMEDIA_FORMAT_PCMA: + { + unsigned samples_processed = 0; + + /* Make sure it is normal frame. */ + pj_assert(buf.iBuffer[0] == 1 && buf.iBuffer[1] == 0); + + /* Detect the recorder G.711 frame size, player frame size will + * follow this recorder frame size. + */ + if (aps_g711_frame_len == 0) { + aps_g711_frame_len = buf.iBuffer.Length() < 160? 80 : 160; + TRACE_((THIS_FILE, "Detected APS G.711 frame size = %u samples", + aps_g711_frame_len)); + } + + /* Convert APS buffer format into pjmedia_frame_ext. Whenever + * samples count in the frame is equal to stream's samples per + * frame, call parent stream callback. + */ + while (samples_processed < aps_g711_frame_len) { + unsigned tmp; + const pj_uint8_t *pb = (const pj_uint8_t*)buf.iBuffer.Ptr() + + 2 + samples_processed; + + tmp = PJ_MIN(strm->param.samples_per_frame - frame->samples_cnt, + aps_g711_frame_len - samples_processed); + + pjmedia_frame_ext_append_subframe(frame, pb, tmp << 3, tmp); + samples_processed += tmp; + + if (frame->samples_cnt == strm->param.samples_per_frame) { + frame->base.type = PJMEDIA_FRAME_TYPE_EXTENDED; + strm->rec_cb(strm->user_data, (pjmedia_frame*)frame); + frame->samples_cnt = 0; + frame->subframe_cnt = 0; + } + } + } + break; + + default: + break; } } -static void PlayCb (TAPSCommBuffer &buf, void *user_data) +static void PlayCb(TAPSCommBuffer &buf, void *user_data) { - struct aps_stream *strm = (struct aps_stream*) user_data; pjmedia_frame_ext *frame = (pjmedia_frame_ext*) strm->play_buf; @@ -1085,209 +1001,202 @@ static void PlayCb (TAPSCommBuffer &buf, void *user_data) buf.iStatus = 0; buf.iBuffer.Zero(); - switch (strm->param.ext_fmt.id) { - - case PJMEDIA_FORMAT_AMR: { - if (frame->samples_cnt == 0) { - frame->base.type = PJMEDIA_FRAME_TYPE_EXTENDED; - strm->play_cb (strm->user_data, (pjmedia_frame*) frame); - pj_assert (frame->base.type==PJMEDIA_FRAME_TYPE_EXTENDED || - frame->base.type==PJMEDIA_FRAME_TYPE_NONE); - } - - if (frame->base.type == PJMEDIA_FRAME_TYPE_EXTENDED) { - pjmedia_frame_ext_subframe *sf; - unsigned samples_cnt; - - sf = pjmedia_frame_ext_get_subframe (frame, 0); - samples_cnt = frame->samples_cnt / frame->subframe_cnt; - - if (sf->data && sf->bitlen) { - /* AMR header for APS is one byte, the format (may be!): - * 0xxxxy00, where xxxx:frame type, y:not sure. - */ - unsigned len = (sf->bitlen+7) >>3; - enum {SID_FT = 8 }; - pj_uint8_t amr_header = 4, ft = SID_FT; - - if (len >= pjmedia_codec_amrnb_framelen[0]) - ft = pjmedia_codec_amr_get_mode2 (PJ_TRUE, len); - - amr_header |= ft << 3; - - buf.iBuffer.Append (amr_header); - - buf.iBuffer.Append ( (TUint8*) sf->data, len); - } else { - buf.iBuffer.Append (0); - } - - pjmedia_frame_ext_pop_subframes (frame, 1); - - } else { /* PJMEDIA_FRAME_TYPE_NONE */ - buf.iBuffer.Append (0); - - frame->samples_cnt = 0; - frame->subframe_cnt = 0; - } - } - - break; - - case PJMEDIA_FORMAT_G729: { - if (frame->samples_cnt == 0) { - frame->base.type = PJMEDIA_FRAME_TYPE_EXTENDED; - strm->play_cb (strm->user_data, (pjmedia_frame*) frame); - pj_assert (frame->base.type==PJMEDIA_FRAME_TYPE_EXTENDED || - frame->base.type==PJMEDIA_FRAME_TYPE_NONE); - } - - if (frame->base.type == PJMEDIA_FRAME_TYPE_EXTENDED) { - pjmedia_frame_ext_subframe *sf; - unsigned samples_cnt; - - sf = pjmedia_frame_ext_get_subframe (frame, 0); - samples_cnt = frame->samples_cnt / frame->subframe_cnt; - - if (sf->data && sf->bitlen) { - enum { NORMAL_LEN = 10, SID_LEN = 2 }; - pj_bool_t sid_frame = ( (sf->bitlen >> 3) == SID_LEN); - TBitStream *bitstream = (TBitStream*) strm->strm_data; - const TPtrC8 src (sf->data, sf->bitlen>>3); - const TDesC8 &dst = bitstream->ExpandG729Frame (src, - sid_frame); - - if (sid_frame) { - buf.iBuffer.Append (0); - buf.iBuffer.Append (1); - } else { - buf.iBuffer.Append (1); - buf.iBuffer.Append (0); - } - - buf.iBuffer.Append (dst); - } else { - buf.iBuffer.Append (0); - buf.iBuffer.Append (0); - } - - pjmedia_frame_ext_pop_subframes (frame, 1); - - } else { /* PJMEDIA_FRAME_TYPE_NONE */ - buf.iBuffer.Append (0); - buf.iBuffer.Append (0); - - frame->samples_cnt = 0; - frame->subframe_cnt = 0; - } - } - - break; - - case PJMEDIA_FORMAT_ILBC: { - if (frame->samples_cnt == 0) { - frame->base.type = PJMEDIA_FRAME_TYPE_EXTENDED; - strm->play_cb (strm->user_data, (pjmedia_frame*) frame); - pj_assert (frame->base.type==PJMEDIA_FRAME_TYPE_EXTENDED || - frame->base.type==PJMEDIA_FRAME_TYPE_NONE); - } - - if (frame->base.type == PJMEDIA_FRAME_TYPE_EXTENDED) { - pjmedia_frame_ext_subframe *sf; - unsigned samples_cnt; - - sf = pjmedia_frame_ext_get_subframe (frame, 0); - samples_cnt = frame->samples_cnt / frame->subframe_cnt; - - pj_assert ( (strm->param.ext_fmt.bitrate == 15200 && - samples_cnt == 160) || - (strm->param.ext_fmt.bitrate != 15200 && - samples_cnt == 240)); - - if (sf->data && sf->bitlen) { - buf.iBuffer.Append (1); - buf.iBuffer.Append (0); - buf.iBuffer.Append ( (TUint8*) sf->data, sf->bitlen>>3); - } else { - buf.iBuffer.Append (0); - buf.iBuffer.Append (0); - } - - pjmedia_frame_ext_pop_subframes (frame, 1); - - } else { /* PJMEDIA_FRAME_TYPE_NONE */ - buf.iBuffer.Append (0); - buf.iBuffer.Append (0); - - frame->samples_cnt = 0; - frame->subframe_cnt = 0; - } - } - - break; - - case PJMEDIA_FORMAT_PCMU: - - case PJMEDIA_FORMAT_PCMA: { - unsigned samples_ready = 0; - unsigned samples_req = aps_g711_frame_len; - - /* Assume frame size is 10ms if frame size hasn't been known. */ - - if (samples_req == 0) - samples_req = 80; - - buf.iBuffer.Append (1); - - buf.iBuffer.Append (0); - - /* Call parent stream callback to get samples to play. */ - while (samples_ready < samples_req) { - if (frame->samples_cnt == 0) { - frame->base.type = PJMEDIA_FRAME_TYPE_EXTENDED; - strm->play_cb (strm->user_data, (pjmedia_frame*) frame); - pj_assert (frame->base.type==PJMEDIA_FRAME_TYPE_EXTENDED || - frame->base.type==PJMEDIA_FRAME_TYPE_NONE); - } - - if (frame->base.type == PJMEDIA_FRAME_TYPE_EXTENDED) { - pjmedia_frame_ext_subframe *sf; - unsigned samples_cnt; - - sf = pjmedia_frame_ext_get_subframe (frame, 0); - samples_cnt = frame->samples_cnt / frame->subframe_cnt; - - if (sf->data && sf->bitlen) { - buf.iBuffer.Append ( (TUint8*) sf->data, sf->bitlen>>3); - } else { - pj_uint8_t silc; - silc = (strm->param.ext_fmt.id==PJMEDIA_FORMAT_PCMU) ? - pjmedia_linear2ulaw (0) : pjmedia_linear2alaw (0); - buf.iBuffer.AppendFill (silc, samples_cnt); - } - - samples_ready += samples_cnt; - - pjmedia_frame_ext_pop_subframes (frame, 1); - - } else { /* PJMEDIA_FRAME_TYPE_NONE */ - pj_uint8_t silc; - - silc = (strm->param.ext_fmt.id==PJMEDIA_FORMAT_PCMU) ? - pjmedia_linear2ulaw (0) : pjmedia_linear2alaw (0); - buf.iBuffer.AppendFill (silc, samples_req - samples_ready); - - samples_ready = samples_req; - frame->samples_cnt = 0; - frame->subframe_cnt = 0; - } - } - } - - break; - - default: - break; + switch(strm->param.ext_fmt.id) { + case PJMEDIA_FORMAT_AMR: + { + if (frame->samples_cnt == 0) { + frame->base.type = PJMEDIA_FRAME_TYPE_EXTENDED; + strm->play_cb(strm->user_data, (pjmedia_frame*)frame); + pj_assert(frame->base.type==PJMEDIA_FRAME_TYPE_EXTENDED || + frame->base.type==PJMEDIA_FRAME_TYPE_NONE); + } + + if (frame->base.type == PJMEDIA_FRAME_TYPE_EXTENDED) { + pjmedia_frame_ext_subframe *sf; + unsigned samples_cnt; + + sf = pjmedia_frame_ext_get_subframe(frame, 0); + samples_cnt = frame->samples_cnt / frame->subframe_cnt; + + if (sf->data && sf->bitlen) { + /* AMR header for APS is one byte, the format (may be!): + * 0xxxxy00, where xxxx:frame type, y:not sure. + */ + unsigned len = (sf->bitlen+7)>>3; + enum {SID_FT = 8 }; + pj_uint8_t amr_header = 4, ft = SID_FT; + + if (len >= pjmedia_codec_amrnb_framelen[0]) + ft = pjmedia_codec_amr_get_mode2(PJ_TRUE, len); + + amr_header |= ft << 3; + buf.iBuffer.Append(amr_header); + + buf.iBuffer.Append((TUint8*)sf->data, len); + } else { + buf.iBuffer.Append(0); + } + + pjmedia_frame_ext_pop_subframes(frame, 1); + + } else { /* PJMEDIA_FRAME_TYPE_NONE */ + buf.iBuffer.Append(0); + + frame->samples_cnt = 0; + frame->subframe_cnt = 0; + } + } + break; + + case PJMEDIA_FORMAT_G729: + { + if (frame->samples_cnt == 0) { + frame->base.type = PJMEDIA_FRAME_TYPE_EXTENDED; + strm->play_cb(strm->user_data, (pjmedia_frame*)frame); + pj_assert(frame->base.type==PJMEDIA_FRAME_TYPE_EXTENDED || + frame->base.type==PJMEDIA_FRAME_TYPE_NONE); + } + + if (frame->base.type == PJMEDIA_FRAME_TYPE_EXTENDED) { + pjmedia_frame_ext_subframe *sf; + unsigned samples_cnt; + + sf = pjmedia_frame_ext_get_subframe(frame, 0); + samples_cnt = frame->samples_cnt / frame->subframe_cnt; + + if (sf->data && sf->bitlen) { + enum { NORMAL_LEN = 10, SID_LEN = 2 }; + pj_bool_t sid_frame = ((sf->bitlen >> 3) == SID_LEN); + TBitStream *bitstream = (TBitStream*)strm->strm_data; + const TPtrC8 src(sf->data, sf->bitlen>>3); + const TDesC8 &dst = bitstream->ExpandG729Frame(src, + sid_frame); + if (sid_frame) { + buf.iBuffer.Append(2); + buf.iBuffer.Append(0); + } else { + buf.iBuffer.Append(1); + buf.iBuffer.Append(0); + } + buf.iBuffer.Append(dst); + } else { + buf.iBuffer.Append(2); + buf.iBuffer.Append(0); + buf.iBuffer.AppendFill(0, 22); + } + + pjmedia_frame_ext_pop_subframes(frame, 1); + + } else { /* PJMEDIA_FRAME_TYPE_NONE */ + buf.iBuffer.Append(2); + buf.iBuffer.Append(0); + buf.iBuffer.AppendFill(0, 22); + + frame->samples_cnt = 0; + frame->subframe_cnt = 0; + } + } + break; + + case PJMEDIA_FORMAT_ILBC: + { + if (frame->samples_cnt == 0) { + frame->base.type = PJMEDIA_FRAME_TYPE_EXTENDED; + strm->play_cb(strm->user_data, (pjmedia_frame*)frame); + pj_assert(frame->base.type==PJMEDIA_FRAME_TYPE_EXTENDED || + frame->base.type==PJMEDIA_FRAME_TYPE_NONE); + } + + if (frame->base.type == PJMEDIA_FRAME_TYPE_EXTENDED) { + pjmedia_frame_ext_subframe *sf; + unsigned samples_cnt; + + sf = pjmedia_frame_ext_get_subframe(frame, 0); + samples_cnt = frame->samples_cnt / frame->subframe_cnt; + + pj_assert((strm->param.ext_fmt.bitrate == 15200 && + samples_cnt == 160) || + (strm->param.ext_fmt.bitrate != 15200 && + samples_cnt == 240)); + + if (sf->data && sf->bitlen) { + buf.iBuffer.Append(1); + buf.iBuffer.Append(0); + buf.iBuffer.Append((TUint8*)sf->data, sf->bitlen>>3); + } else { + buf.iBuffer.Append(0); + buf.iBuffer.Append(0); + } + + pjmedia_frame_ext_pop_subframes(frame, 1); + + } else { /* PJMEDIA_FRAME_TYPE_NONE */ + buf.iBuffer.Append(0); + buf.iBuffer.Append(0); + + frame->samples_cnt = 0; + frame->subframe_cnt = 0; + } + } + break; + + case PJMEDIA_FORMAT_PCMU: + case PJMEDIA_FORMAT_PCMA: + { + unsigned samples_ready = 0; + unsigned samples_req = aps_g711_frame_len; + + /* Assume frame size is 10ms if frame size hasn't been known. */ + if (samples_req == 0) + samples_req = 80; + + buf.iBuffer.Append(1); + buf.iBuffer.Append(0); + + /* Call parent stream callback to get samples to play. */ + while (samples_ready < samples_req) { + if (frame->samples_cnt == 0) { + frame->base.type = PJMEDIA_FRAME_TYPE_EXTENDED; + strm->play_cb(strm->user_data, (pjmedia_frame*)frame); + pj_assert(frame->base.type==PJMEDIA_FRAME_TYPE_EXTENDED || + frame->base.type==PJMEDIA_FRAME_TYPE_NONE); + } + + if (frame->base.type == PJMEDIA_FRAME_TYPE_EXTENDED) { + pjmedia_frame_ext_subframe *sf; + unsigned samples_cnt; + + sf = pjmedia_frame_ext_get_subframe(frame, 0); + samples_cnt = frame->samples_cnt / frame->subframe_cnt; + if (sf->data && sf->bitlen) { + buf.iBuffer.Append((TUint8*)sf->data, sf->bitlen>>3); + } else { + pj_uint8_t silc; + silc = (strm->param.ext_fmt.id==PJMEDIA_FORMAT_PCMU)? + pjmedia_linear2ulaw(0) : pjmedia_linear2alaw(0); + buf.iBuffer.AppendFill(silc, samples_cnt); + } + samples_ready += samples_cnt; + + pjmedia_frame_ext_pop_subframes(frame, 1); + + } else { /* PJMEDIA_FRAME_TYPE_NONE */ + pj_uint8_t silc; + + silc = (strm->param.ext_fmt.id==PJMEDIA_FORMAT_PCMU)? + pjmedia_linear2ulaw(0) : pjmedia_linear2alaw(0); + buf.iBuffer.AppendFill(silc, samples_req - samples_ready); + + samples_ready = samples_req; + frame->samples_cnt = 0; + frame->subframe_cnt = 0; + } + } + } + break; + + default: + break; } } @@ -1300,20 +1209,19 @@ static void PlayCb (TAPSCommBuffer &buf, void *user_data) * C compatible declaration of APS factory. */ PJ_BEGIN_DECL -PJ_DECL (pjmedia_aud_dev_factory*) pjmedia_aps_factory (pj_pool_factory *pf); +PJ_DECL(pjmedia_aud_dev_factory*) pjmedia_aps_factory(pj_pool_factory *pf); PJ_END_DECL /* * Init APS audio driver. */ -PJ_DEF (pjmedia_aud_dev_factory*) pjmedia_aps_factory (pj_pool_factory *pf) +PJ_DEF(pjmedia_aud_dev_factory*) pjmedia_aps_factory(pj_pool_factory *pf) { - struct aps_factory *f; pj_pool_t *pool; - pool = pj_pool_create (pf, "APS", 1000, 1000, NULL); - f = PJ_POOL_ZALLOC_T (pool, struct aps_factory); + pool = pj_pool_create(pf, "APS", 1000, 1000, NULL); + f = PJ_POOL_ZALLOC_T(pool, struct aps_factory); f->pf = pf; f->pool = pool; f->base.op = &factory_op; @@ -1322,21 +1230,20 @@ PJ_DEF (pjmedia_aud_dev_factory*) pjmedia_aps_factory (pj_pool_factory *pf) } /* API: init factory */ -static pj_status_t factory_init (pjmedia_aud_dev_factory *f) +static pj_status_t factory_init(pjmedia_aud_dev_factory *f) { + struct aps_factory *af = (struct aps_factory*)f; - struct aps_factory *af = (struct aps_factory*) f; - - pj_ansi_strcpy (af->dev_info.name, "S60 APS"); + pj_ansi_strcpy(af->dev_info.name, "S60 APS"); af->dev_info.default_samples_per_sec = 8000; af->dev_info.caps = PJMEDIA_AUD_DEV_CAP_EXT_FORMAT | - //PJMEDIA_AUD_DEV_CAP_INPUT_VOLUME_SETTING | - PJMEDIA_AUD_DEV_CAP_OUTPUT_VOLUME_SETTING | - PJMEDIA_AUD_DEV_CAP_OUTPUT_ROUTE | - PJMEDIA_AUD_DEV_CAP_VAD | - PJMEDIA_AUD_DEV_CAP_CNG; - af->dev_info.routes = PJMEDIA_AUD_DEV_ROUTE_EARPIECE | - PJMEDIA_AUD_DEV_ROUTE_LOUDSPEAKER; + //PJMEDIA_AUD_DEV_CAP_INPUT_VOLUME_SETTING | + PJMEDIA_AUD_DEV_CAP_OUTPUT_VOLUME_SETTING | + PJMEDIA_AUD_DEV_CAP_OUTPUT_ROUTE | + PJMEDIA_AUD_DEV_CAP_VAD | + PJMEDIA_AUD_DEV_CAP_CNG; + af->dev_info.routes = PJMEDIA_AUD_DEV_ROUTE_EARPIECE | + PJMEDIA_AUD_DEV_ROUTE_LOUDSPEAKER; af->dev_info.input_count = 1; af->dev_info.output_count = 1; @@ -1361,60 +1268,57 @@ static pj_status_t factory_init (pjmedia_aud_dev_factory *f) af->dev_info.ext_fmt[4].id = PJMEDIA_FORMAT_PCMA; af->dev_info.ext_fmt[4].bitrate = 64000; af->dev_info.ext_fmt[4].vad = PJ_FALSE; - - PJ_LOG (4, (THIS_FILE, "APS initialized")); + + PJ_LOG(4, (THIS_FILE, "APS initialized")); return PJ_SUCCESS; } /* API: destroy factory */ -static pj_status_t factory_destroy (pjmedia_aud_dev_factory *f) +static pj_status_t factory_destroy(pjmedia_aud_dev_factory *f) { - - struct aps_factory *af = (struct aps_factory*) f; + struct aps_factory *af = (struct aps_factory*)f; pj_pool_t *pool = af->pool; af->pool = NULL; - pj_pool_release (pool); - - PJ_LOG (4, (THIS_FILE, "APS destroyed")); + pj_pool_release(pool); + PJ_LOG(4, (THIS_FILE, "APS destroyed")); + return PJ_SUCCESS; } /* API: get number of devices */ -static unsigned factory_get_dev_count (pjmedia_aud_dev_factory *f) +static unsigned factory_get_dev_count(pjmedia_aud_dev_factory *f) { - PJ_UNUSED_ARG (f); + PJ_UNUSED_ARG(f); return 1; } /* API: get device info */ -static pj_status_t factory_get_dev_info (pjmedia_aud_dev_factory *f, - unsigned index, - pjmedia_aud_dev_info *info) +static pj_status_t factory_get_dev_info(pjmedia_aud_dev_factory *f, + unsigned index, + pjmedia_aud_dev_info *info) { + struct aps_factory *af = (struct aps_factory*)f; - struct aps_factory *af = (struct aps_factory*) f; + PJ_ASSERT_RETURN(index == 0, PJMEDIA_EAUD_INVDEV); - PJ_ASSERT_RETURN (index == 0, PJMEDIA_EAUD_INVDEV); - - pj_memcpy (info, &af->dev_info, sizeof (*info)); + pj_memcpy(info, &af->dev_info, sizeof(*info)); return PJ_SUCCESS; } /* API: create default device parameter */ -static pj_status_t factory_default_param (pjmedia_aud_dev_factory *f, - unsigned index, - pjmedia_aud_param *param) +static pj_status_t factory_default_param(pjmedia_aud_dev_factory *f, + unsigned index, + pjmedia_aud_param *param) { + struct aps_factory *af = (struct aps_factory*)f; - struct aps_factory *af = (struct aps_factory*) f; - - PJ_ASSERT_RETURN (index == 0, PJMEDIA_EAUD_INVDEV); + PJ_ASSERT_RETURN(index == 0, PJMEDIA_EAUD_INVDEV); - pj_bzero (param, sizeof (*param)); + pj_bzero(param, sizeof(*param)); param->dir = PJMEDIA_DIR_CAPTURE_PLAYBACK; param->rec_id = index; param->play_id = index; @@ -1430,17 +1334,15 @@ static pj_status_t factory_default_param (pjmedia_aud_dev_factory *f, /* API: create stream */ -static pj_status_t factory_create_stream (pjmedia_aud_dev_factory *f, - const pjmedia_aud_param *param, - pjmedia_aud_rec_cb rec_cb, - pjmedia_aud_play_cb play_cb, - void *user_data, - pjmedia_aud_stream **p_aud_strm) +static pj_status_t factory_create_stream(pjmedia_aud_dev_factory *f, + const pjmedia_aud_param *param, + pjmedia_aud_rec_cb rec_cb, + pjmedia_aud_play_cb play_cb, + void *user_data, + pjmedia_aud_stream **p_aud_strm) { - - struct aps_factory *af = (struct aps_factory*) f; + struct aps_factory *af = (struct aps_factory*)f; pj_pool_t *pool; - struct aps_stream *strm; CPjAudioSetting aps_setting; @@ -1448,413 +1350,382 @@ static pj_status_t factory_create_stream (pjmedia_aud_dev_factory *f, PjAudioCallback aps_play_cb; /* Can only support 16bits per sample */ - PJ_ASSERT_RETURN (param->bits_per_sample == BITS_PER_SAMPLE, PJ_EINVAL); + PJ_ASSERT_RETURN(param->bits_per_sample == BITS_PER_SAMPLE, PJ_EINVAL); /* Supported clock rates: - * - for non-PCM format: 8kHz - * - for PCM format: 8kHz and 16kHz + * - for non-PCM format: 8kHz + * - for PCM format: 8kHz and 16kHz */ - PJ_ASSERT_RETURN (param->clock_rate == 8000 || - (param->clock_rate == 16000 && - param->ext_fmt.id == PJMEDIA_FORMAT_L16), - PJ_EINVAL); + PJ_ASSERT_RETURN(param->clock_rate == 8000 || + (param->clock_rate == 16000 && + param->ext_fmt.id == PJMEDIA_FORMAT_L16), + PJ_EINVAL); /* Supported channels number: * - for non-PCM format: mono - * - for PCM format: mono and stereo + * - for PCM format: mono and stereo */ - PJ_ASSERT_RETURN (param->channel_count == 1 || - (param->channel_count == 2 && - param->ext_fmt.id == PJMEDIA_FORMAT_L16), - PJ_EINVAL); + PJ_ASSERT_RETURN(param->channel_count == 1 || + (param->channel_count == 2 && + param->ext_fmt.id == PJMEDIA_FORMAT_L16), + PJ_EINVAL); /* Create and Initialize stream descriptor */ - pool = pj_pool_create (af->pf, "aps-dev", 1000, 1000, NULL); - PJ_ASSERT_RETURN (pool, PJ_ENOMEM); + pool = pj_pool_create(af->pf, "aps-dev", 1000, 1000, NULL); + PJ_ASSERT_RETURN(pool, PJ_ENOMEM); - strm = PJ_POOL_ZALLOC_T (pool, struct aps_stream); + strm = PJ_POOL_ZALLOC_T(pool, struct aps_stream); strm->pool = pool; strm->param = *param; if (strm->param.flags & PJMEDIA_AUD_DEV_CAP_EXT_FORMAT == 0) - strm->param.ext_fmt.id = PJMEDIA_FORMAT_L16; - + strm->param.ext_fmt.id = PJMEDIA_FORMAT_L16; + /* Set audio engine fourcc. */ - switch (strm->param.ext_fmt.id) { - - case PJMEDIA_FORMAT_L16: - - case PJMEDIA_FORMAT_PCMU: - - case PJMEDIA_FORMAT_PCMA: - aps_setting.fourcc = TFourCC (KMCPFourCCIdG711); - break; - - case PJMEDIA_FORMAT_AMR: - aps_setting.fourcc = TFourCC (KMCPFourCCIdAMRNB); - break; - - case PJMEDIA_FORMAT_G729: - aps_setting.fourcc = TFourCC (KMCPFourCCIdG729); - break; - - case PJMEDIA_FORMAT_ILBC: - aps_setting.fourcc = TFourCC (KMCPFourCCIdILBC); - break; - - default: - aps_setting.fourcc = 0; - break; + switch(strm->param.ext_fmt.id) { + case PJMEDIA_FORMAT_L16: + case PJMEDIA_FORMAT_PCMU: + case PJMEDIA_FORMAT_PCMA: + aps_setting.fourcc = TFourCC(KMCPFourCCIdG711); + break; + case PJMEDIA_FORMAT_AMR: + aps_setting.fourcc = TFourCC(KMCPFourCCIdAMRNB); + break; + case PJMEDIA_FORMAT_G729: + aps_setting.fourcc = TFourCC(KMCPFourCCIdG729); + break; + case PJMEDIA_FORMAT_ILBC: + aps_setting.fourcc = TFourCC(KMCPFourCCIdILBC); + break; + default: + aps_setting.fourcc = 0; + break; } /* Set audio engine mode. */ - if (strm->param.ext_fmt.id == PJMEDIA_FORMAT_AMR) { - aps_setting.mode = (TAPSCodecMode) strm->param.ext_fmt.bitrate; - } else if (strm->param.ext_fmt.id == PJMEDIA_FORMAT_PCMU || - strm->param.ext_fmt.id == PJMEDIA_FORMAT_L16 || - (strm->param.ext_fmt.id == PJMEDIA_FORMAT_ILBC && - strm->param.ext_fmt.bitrate != 15200)) { - aps_setting.mode = EULawOr30ms; - } else if (strm->param.ext_fmt.id == PJMEDIA_FORMAT_PCMA || - (strm->param.ext_fmt.id == PJMEDIA_FORMAT_ILBC && - strm->param.ext_fmt.bitrate == 15200)) { - aps_setting.mode = EALawOr20ms; + if (strm->param.ext_fmt.id == PJMEDIA_FORMAT_AMR) + { + aps_setting.mode = (TAPSCodecMode)strm->param.ext_fmt.bitrate; + } + else if (strm->param.ext_fmt.id == PJMEDIA_FORMAT_PCMU || + strm->param.ext_fmt.id == PJMEDIA_FORMAT_L16 || + (strm->param.ext_fmt.id == PJMEDIA_FORMAT_ILBC && + strm->param.ext_fmt.bitrate != 15200)) + { + aps_setting.mode = EULawOr30ms; + } + else if (strm->param.ext_fmt.id == PJMEDIA_FORMAT_PCMA || + (strm->param.ext_fmt.id == PJMEDIA_FORMAT_ILBC && + strm->param.ext_fmt.bitrate == 15200)) + { + aps_setting.mode = EALawOr20ms; } - /* Disable VAD on L16, G711, and also G729 (G729's VAD potentially + /* Disable VAD on L16, G711, and also G729 (G729's VAD potentially * causes noise?). */ if (strm->param.ext_fmt.id == PJMEDIA_FORMAT_PCMU || - strm->param.ext_fmt.id == PJMEDIA_FORMAT_PCMA || - strm->param.ext_fmt.id == PJMEDIA_FORMAT_L16 || - strm->param.ext_fmt.id == PJMEDIA_FORMAT_G729) { - aps_setting.vad = EFalse; + strm->param.ext_fmt.id == PJMEDIA_FORMAT_PCMA || + strm->param.ext_fmt.id == PJMEDIA_FORMAT_L16 || + strm->param.ext_fmt.id == PJMEDIA_FORMAT_G729) + { + aps_setting.vad = EFalse; } else { - aps_setting.vad = strm->param.ext_fmt.vad; + aps_setting.vad = strm->param.ext_fmt.vad; } - + /* Set other audio engine attributes. */ aps_setting.plc = strm->param.plc_enabled; - aps_setting.cng = aps_setting.vad; - - aps_setting.loudspk = - strm->param.output_route==PJMEDIA_AUD_DEV_ROUTE_LOUDSPEAKER; + aps_setting.loudspk = + strm->param.output_route==PJMEDIA_AUD_DEV_ROUTE_LOUDSPEAKER; /* Set audio engine callbacks. */ if (strm->param.ext_fmt.id == PJMEDIA_FORMAT_L16) { - aps_play_cb = &PlayCbPcm; - aps_rec_cb = &RecCbPcm; + aps_play_cb = &PlayCbPcm; + aps_rec_cb = &RecCbPcm; } else { - aps_play_cb = &PlayCb; - aps_rec_cb = &RecCb; + aps_play_cb = &PlayCb; + aps_rec_cb = &RecCb; } strm->rec_cb = rec_cb; - strm->play_cb = play_cb; strm->user_data = user_data; strm->resample_factor = strm->param.clock_rate / 8000; /* play_buf size is samples per frame scaled in to 8kHz mono. */ - strm->play_buf = (pj_int16_t*) pj_pool_zalloc ( - pool, - (strm->param.samples_per_frame / - strm->resample_factor / - strm->param.channel_count) << 1); + strm->play_buf = (pj_int16_t*)pj_pool_zalloc( + pool, + (strm->param.samples_per_frame / + strm->resample_factor / + strm->param.channel_count) << 1); strm->play_buf_len = 0; strm->play_buf_start = 0; /* rec_buf size is samples per frame scaled in to 8kHz mono. */ - strm->rec_buf = (pj_int16_t*) pj_pool_zalloc ( - pool, - (strm->param.samples_per_frame / - strm->resample_factor / - strm->param.channel_count) << 1); + strm->rec_buf = (pj_int16_t*)pj_pool_zalloc( + pool, + (strm->param.samples_per_frame / + strm->resample_factor / + strm->param.channel_count) << 1); strm->rec_buf_len = 0; if (strm->param.ext_fmt.id == PJMEDIA_FORMAT_G729) { - TBitStream *g729_bitstream = new TBitStream; - - PJ_ASSERT_RETURN (g729_bitstream, PJ_ENOMEM); - strm->strm_data = (void*) g729_bitstream; + TBitStream *g729_bitstream = new TBitStream; + + PJ_ASSERT_RETURN(g729_bitstream, PJ_ENOMEM); + strm->strm_data = (void*)g729_bitstream; } - + /* Init resampler when format is PCM and clock rate is not 8kHz */ - if (strm->param.clock_rate != 8000 && - strm->param.ext_fmt.id == PJMEDIA_FORMAT_L16) { - pj_status_t status; - - if (strm->param.dir & PJMEDIA_DIR_CAPTURE) { - /* Create resample for recorder */ - status = pjmedia_resample_create (pool, PJ_TRUE, PJ_FALSE, 1, - 8000, - strm->param.clock_rate, - 80, - &strm->rec_resample); - - if (status != PJ_SUCCESS) - return status; - } - - if (strm->param.dir & PJMEDIA_DIR_PLAYBACK) { - /* Create resample for player */ - status = pjmedia_resample_create (pool, PJ_TRUE, PJ_FALSE, 1, - strm->param.clock_rate, - 8000, - 80 * strm->resample_factor, - &strm->play_resample); - - if (status != PJ_SUCCESS) - return status; - } + if (strm->param.clock_rate != 8000 && + strm->param.ext_fmt.id == PJMEDIA_FORMAT_L16) + { + pj_status_t status; + + if (strm->param.dir & PJMEDIA_DIR_CAPTURE) { + /* Create resample for recorder */ + status = pjmedia_resample_create( pool, PJ_TRUE, PJ_FALSE, 1, + 8000, + strm->param.clock_rate, + 80, + &strm->rec_resample); + if (status != PJ_SUCCESS) + return status; + } + + if (strm->param.dir & PJMEDIA_DIR_PLAYBACK) { + /* Create resample for player */ + status = pjmedia_resample_create( pool, PJ_TRUE, PJ_FALSE, 1, + strm->param.clock_rate, + 8000, + 80 * strm->resample_factor, + &strm->play_resample); + if (status != PJ_SUCCESS) + return status; + } } /* Create PCM buffer, when the clock rate is not 8kHz or not mono */ if (strm->param.ext_fmt.id == PJMEDIA_FORMAT_L16 && - (strm->resample_factor > 1 || strm->param.channel_count != 1)) { - strm->pcm_buf = (pj_int16_t*) pj_pool_zalloc (pool, - strm->param.samples_per_frame << 1); + (strm->resample_factor > 1 || strm->param.channel_count != 1)) + { + strm->pcm_buf = (pj_int16_t*)pj_pool_zalloc(pool, + strm->param.samples_per_frame << 1); } - + /* Create the audio engine. */ - TRAPD (err, strm->engine = CPjAudioEngine::NewL (strm, - aps_rec_cb, aps_play_cb, - strm, aps_setting)); - + TRAPD(err, strm->engine = CPjAudioEngine::NewL(strm, + aps_rec_cb, aps_play_cb, + strm, aps_setting)); if (err != KErrNone) { - pj_pool_release (pool); - return PJ_RETURN_OS_ERROR (err); + pj_pool_release(pool); + return PJ_RETURN_OS_ERROR(err); } /* Apply output volume setting if specified */ if (param->flags & PJMEDIA_AUD_DEV_CAP_OUTPUT_VOLUME_SETTING) { - stream_set_cap (&strm->base, PJMEDIA_AUD_DEV_CAP_OUTPUT_VOLUME_SETTING, - ¶m->output_vol); + stream_set_cap(&strm->base, PJMEDIA_AUD_DEV_CAP_OUTPUT_VOLUME_SETTING, + ¶m->output_vol); } /* Done */ strm->base.op = &stream_op; - *p_aud_strm = &strm->base; return PJ_SUCCESS; } /* API: Get stream info. */ -static pj_status_t stream_get_param (pjmedia_aud_stream *s, - pjmedia_aud_param *pi) +static pj_status_t stream_get_param(pjmedia_aud_stream *s, + pjmedia_aud_param *pi) { + struct aps_stream *strm = (struct aps_stream*)s; - struct aps_stream *strm = (struct aps_stream*) s; - - PJ_ASSERT_RETURN (strm && pi, PJ_EINVAL); + PJ_ASSERT_RETURN(strm && pi, PJ_EINVAL); - pj_memcpy (pi, &strm->param, sizeof (*pi)); + pj_memcpy(pi, &strm->param, sizeof(*pi)); /* Update the output volume setting */ - - if (stream_get_cap (s, PJMEDIA_AUD_DEV_CAP_OUTPUT_VOLUME_SETTING, - &pi->output_vol) == PJ_SUCCESS) { - pi->flags |= PJMEDIA_AUD_DEV_CAP_OUTPUT_VOLUME_SETTING; + if (stream_get_cap(s, PJMEDIA_AUD_DEV_CAP_OUTPUT_VOLUME_SETTING, + &pi->output_vol) == PJ_SUCCESS) + { + pi->flags |= PJMEDIA_AUD_DEV_CAP_OUTPUT_VOLUME_SETTING; } - + return PJ_SUCCESS; } /* API: get capability */ -static pj_status_t stream_get_cap (pjmedia_aud_stream *s, - pjmedia_aud_dev_cap cap, - void *pval) +static pj_status_t stream_get_cap(pjmedia_aud_stream *s, + pjmedia_aud_dev_cap cap, + void *pval) { - - struct aps_stream *strm = (struct aps_stream*) s; + struct aps_stream *strm = (struct aps_stream*)s; pj_status_t status = PJ_ENOTSUP; - PJ_ASSERT_RETURN (s && pval, PJ_EINVAL); + PJ_ASSERT_RETURN(s && pval, PJ_EINVAL); switch (cap) { - - case PJMEDIA_AUD_DEV_CAP_OUTPUT_ROUTE: - - if (strm->param.dir & PJMEDIA_DIR_PLAYBACK) { - * (pjmedia_aud_dev_route*) pval = strm->param.output_route; - status = PJ_SUCCESS; - } - - break; - - /* There is a case that GetMaxGain() stucks, e.g: in N95. */ - /* - case PJMEDIA_AUD_DEV_CAP_INPUT_VOLUME_SETTING: - if (strm->param.dir & PJMEDIA_DIR_CAPTURE) { - PJ_ASSERT_RETURN(strm->engine, PJ_EINVAL); - - TInt max_gain = strm->engine->GetMaxGain(); - TInt gain = strm->engine->GetGain(); - - if (max_gain > 0 && gain >= 0) { - *(unsigned*)pval = gain * 100 / max_gain; - status = PJ_SUCCESS; - } else { - status = PJMEDIA_EAUD_NOTREADY; - } - } - break; - */ - - case PJMEDIA_AUD_DEV_CAP_OUTPUT_VOLUME_SETTING: - - if (strm->param.dir & PJMEDIA_DIR_PLAYBACK) { - PJ_ASSERT_RETURN (strm->engine, PJ_EINVAL); - - TInt max_vol = strm->engine->GetMaxVolume(); - TInt vol = strm->engine->GetVolume(); - - if (max_vol > 0 && vol >= 0) { - * (unsigned*) pval = vol * 100 / max_vol; - status = PJ_SUCCESS; - } else { - status = PJMEDIA_EAUD_NOTREADY; - } - } - - break; - - default: - break; + case PJMEDIA_AUD_DEV_CAP_OUTPUT_ROUTE: + if (strm->param.dir & PJMEDIA_DIR_PLAYBACK) { + *(pjmedia_aud_dev_route*)pval = strm->param.output_route; + status = PJ_SUCCESS; + } + break; + + /* There is a case that GetMaxGain() stucks, e.g: in N95. */ + /* + case PJMEDIA_AUD_DEV_CAP_INPUT_VOLUME_SETTING: + if (strm->param.dir & PJMEDIA_DIR_CAPTURE) { + PJ_ASSERT_RETURN(strm->engine, PJ_EINVAL); + + TInt max_gain = strm->engine->GetMaxGain(); + TInt gain = strm->engine->GetGain(); + + if (max_gain > 0 && gain >= 0) { + *(unsigned*)pval = gain * 100 / max_gain; + status = PJ_SUCCESS; + } else { + status = PJMEDIA_EAUD_NOTREADY; + } + } + break; + */ + + case PJMEDIA_AUD_DEV_CAP_OUTPUT_VOLUME_SETTING: + if (strm->param.dir & PJMEDIA_DIR_PLAYBACK) { + PJ_ASSERT_RETURN(strm->engine, PJ_EINVAL); + + TInt max_vol = strm->engine->GetMaxVolume(); + TInt vol = strm->engine->GetVolume(); + + if (max_vol > 0 && vol >= 0) { + *(unsigned*)pval = vol * 100 / max_vol; + status = PJ_SUCCESS; + } else { + status = PJMEDIA_EAUD_NOTREADY; + } + } + break; + default: + break; } - + return status; } /* API: set capability */ -static pj_status_t stream_set_cap (pjmedia_aud_stream *s, - pjmedia_aud_dev_cap cap, - const void *pval) +static pj_status_t stream_set_cap(pjmedia_aud_stream *s, + pjmedia_aud_dev_cap cap, + const void *pval) { - - struct aps_stream *strm = (struct aps_stream*) s; + struct aps_stream *strm = (struct aps_stream*)s; pj_status_t status = PJ_ENOTSUP; - PJ_ASSERT_RETURN (s && pval, PJ_EINVAL); + PJ_ASSERT_RETURN(s && pval, PJ_EINVAL); switch (cap) { - - case PJMEDIA_AUD_DEV_CAP_OUTPUT_ROUTE: - - if (strm->param.dir & PJMEDIA_DIR_PLAYBACK) { - pjmedia_aud_dev_route r = * (const pjmedia_aud_dev_route*) pval; - TInt err; - - PJ_ASSERT_RETURN (strm->engine, PJ_EINVAL); - - switch (r) { - - case PJMEDIA_AUD_DEV_ROUTE_DEFAULT: - - case PJMEDIA_AUD_DEV_ROUTE_EARPIECE: - err = strm->engine->ActivateSpeaker (EFalse); - status = (err==KErrNone) ? PJ_SUCCESS:PJ_RETURN_OS_ERROR (err); - break; - - case PJMEDIA_AUD_DEV_ROUTE_LOUDSPEAKER: - err = strm->engine->ActivateSpeaker (ETrue); - status = (err==KErrNone) ? PJ_SUCCESS:PJ_RETURN_OS_ERROR (err); - break; - - default: - status = PJ_EINVAL; - break; - } - - if (status == PJ_SUCCESS) - strm->param.output_route = r; - } - - break; - - /* There is a case that GetMaxGain() stucks, e.g: in N95. */ - /* - case PJMEDIA_AUD_DEV_CAP_INPUT_VOLUME_SETTING: - if (strm->param.dir & PJMEDIA_DIR_CAPTURE) { - PJ_ASSERT_RETURN(strm->engine, PJ_EINVAL); - - TInt max_gain = strm->engine->GetMaxGain(); - if (max_gain > 0) { - TInt gain, err; - - gain = *(unsigned*)pval * max_gain / 100; - err = strm->engine->SetGain(gain); - status = (err==KErrNone)? PJ_SUCCESS:PJ_RETURN_OS_ERROR(err); - } else { - status = PJMEDIA_EAUD_NOTREADY; - } - if (status == PJ_SUCCESS) - strm->param.input_vol = *(unsigned*)pval; - } - break; - */ - - case PJMEDIA_AUD_DEV_CAP_OUTPUT_VOLUME_SETTING: - - if (strm->param.dir & PJMEDIA_DIR_PLAYBACK) { - PJ_ASSERT_RETURN (strm->engine, PJ_EINVAL); - - TInt max_vol = strm->engine->GetMaxVolume(); - - if (max_vol > 0) { - TInt vol, err; - - vol = * (unsigned*) pval * max_vol / 100; - err = strm->engine->SetVolume (vol); - status = (err==KErrNone) ? PJ_SUCCESS:PJ_RETURN_OS_ERROR (err); - } else { - status = PJMEDIA_EAUD_NOTREADY; - } - - if (status == PJ_SUCCESS) - strm->param.output_vol = * (unsigned*) pval; - } - - break; - - default: - break; + case PJMEDIA_AUD_DEV_CAP_OUTPUT_ROUTE: + if (strm->param.dir & PJMEDIA_DIR_PLAYBACK) { + pjmedia_aud_dev_route r = *(const pjmedia_aud_dev_route*)pval; + TInt err; + + PJ_ASSERT_RETURN(strm->engine, PJ_EINVAL); + + switch (r) { + case PJMEDIA_AUD_DEV_ROUTE_DEFAULT: + case PJMEDIA_AUD_DEV_ROUTE_EARPIECE: + err = strm->engine->ActivateSpeaker(EFalse); + status = (err==KErrNone)? PJ_SUCCESS:PJ_RETURN_OS_ERROR(err); + break; + case PJMEDIA_AUD_DEV_ROUTE_LOUDSPEAKER: + err = strm->engine->ActivateSpeaker(ETrue); + status = (err==KErrNone)? PJ_SUCCESS:PJ_RETURN_OS_ERROR(err); + break; + default: + status = PJ_EINVAL; + break; + } + if (status == PJ_SUCCESS) + strm->param.output_route = r; + } + break; + + /* There is a case that GetMaxGain() stucks, e.g: in N95. */ + /* + case PJMEDIA_AUD_DEV_CAP_INPUT_VOLUME_SETTING: + if (strm->param.dir & PJMEDIA_DIR_CAPTURE) { + PJ_ASSERT_RETURN(strm->engine, PJ_EINVAL); + + TInt max_gain = strm->engine->GetMaxGain(); + if (max_gain > 0) { + TInt gain, err; + + gain = *(unsigned*)pval * max_gain / 100; + err = strm->engine->SetGain(gain); + status = (err==KErrNone)? PJ_SUCCESS:PJ_RETURN_OS_ERROR(err); + } else { + status = PJMEDIA_EAUD_NOTREADY; + } + if (status == PJ_SUCCESS) + strm->param.input_vol = *(unsigned*)pval; + } + break; + */ + + case PJMEDIA_AUD_DEV_CAP_OUTPUT_VOLUME_SETTING: + if (strm->param.dir & PJMEDIA_DIR_PLAYBACK) { + PJ_ASSERT_RETURN(strm->engine, PJ_EINVAL); + + TInt max_vol = strm->engine->GetMaxVolume(); + if (max_vol > 0) { + TInt vol, err; + + vol = *(unsigned*)pval * max_vol / 100; + err = strm->engine->SetVolume(vol); + status = (err==KErrNone)? PJ_SUCCESS:PJ_RETURN_OS_ERROR(err); + } else { + status = PJMEDIA_EAUD_NOTREADY; + } + if (status == PJ_SUCCESS) + strm->param.output_vol = *(unsigned*)pval; + } + break; + default: + break; } - + return status; } /* API: Start stream. */ -static pj_status_t stream_start (pjmedia_aud_stream *strm) +static pj_status_t stream_start(pjmedia_aud_stream *strm) { + struct aps_stream *stream = (struct aps_stream*)strm; - struct aps_stream *stream = (struct aps_stream*) strm; - - PJ_ASSERT_RETURN (stream, PJ_EINVAL); + PJ_ASSERT_RETURN(stream, PJ_EINVAL); if (stream->engine) { - TInt err = stream->engine->StartL(); - - if (err != KErrNone) - return PJ_RETURN_OS_ERROR (err); + TInt err = stream->engine->StartL(); + if (err != KErrNone) + return PJ_RETURN_OS_ERROR(err); } return PJ_SUCCESS; } /* API: Stop stream. */ -static pj_status_t stream_stop (pjmedia_aud_stream *strm) +static pj_status_t stream_stop(pjmedia_aud_stream *strm) { + struct aps_stream *stream = (struct aps_stream*)strm; - struct aps_stream *stream = (struct aps_stream*) strm; - - PJ_ASSERT_RETURN (stream, PJ_EINVAL); + PJ_ASSERT_RETURN(stream, PJ_EINVAL); if (stream->engine) { - stream->engine->Stop(); + stream->engine->Stop(); } return PJ_SUCCESS; @@ -1862,31 +1733,28 @@ static pj_status_t stream_stop (pjmedia_aud_stream *strm) /* API: Destroy stream. */ -static pj_status_t stream_destroy (pjmedia_aud_stream *strm) +static pj_status_t stream_destroy(pjmedia_aud_stream *strm) { + struct aps_stream *stream = (struct aps_stream*)strm; - struct aps_stream *stream = (struct aps_stream*) strm; - - PJ_ASSERT_RETURN (stream, PJ_EINVAL); + PJ_ASSERT_RETURN(stream, PJ_EINVAL); - stream_stop (strm); + stream_stop(strm); delete stream->engine; stream->engine = NULL; if (stream->param.ext_fmt.id == PJMEDIA_FORMAT_G729) { - TBitStream *g729_bitstream = (TBitStream*) stream->strm_data; - stream->strm_data = NULL; - delete g729_bitstream; + TBitStream *g729_bitstream = (TBitStream*)stream->strm_data; + stream->strm_data = NULL; + delete g729_bitstream; } pj_pool_t *pool; - pool = stream->pool; - if (pool) { - stream->pool = NULL; - pj_pool_release (pool); + stream->pool = NULL; + pj_pool_release(pool); } return PJ_SUCCESS; diff --git a/sflphone-common/libs/pjproject/pjmedia/src/pjmedia-audiodev/symb_mda_dev.cpp b/sflphone-common/libs/pjproject/pjmedia/src/pjmedia-audiodev/symb_mda_dev.cpp index 44ba2f893edea6f7e70b438d4798e531b8eb6e05..d943f2bd25aa7c289c34e664a9aa6ff072e39a21 100644 --- a/sflphone-common/libs/pjproject/pjmedia/src/pjmedia-audiodev/symb_mda_dev.cpp +++ b/sflphone-common/libs/pjproject/pjmedia/src/pjmedia-audiodev/symb_mda_dev.cpp @@ -1,5 +1,5 @@ /* $Id: symb_mda_dev.cpp 2777 2009-06-19 09:15:59Z bennylp $ */ -/* +/* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> * @@ -15,7 +15,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include <pjmedia-audiodev/audiodev_imp.h> #include <pjmedia-audiodev/errno.h> @@ -32,7 +32,7 @@ * This file provides sound implementation for Symbian Audio Streaming * device. Application using this sound abstraction must link with: * - mediaclientaudiostream.lib, and - * - mediaclientaudioinputstream.lib + * - mediaclientaudioinputstream.lib */ #include <mda/common/audio.h> #include <mdaaudiooutputstream.h> @@ -52,8 +52,8 @@ /* MDA factory */ - -struct mda_factory { +struct mda_factory +{ pjmedia_aud_dev_factory base; pj_pool_t *pool; pj_pool_factory *pf; @@ -61,17 +61,15 @@ struct mda_factory { }; /* Forward declaration of internal engine. */ - class CPjAudioInputEngine; - class CPjAudioOutputEngine; /* MDA stream. */ - -struct mda_stream { +struct mda_stream +{ // Base pjmedia_aud_stream base; /**< Base class. */ - + // Pool pj_pool_t *pool; /**< Memory pool. */ @@ -85,37 +83,38 @@ struct mda_stream { /* Prototypes */ -static pj_status_t factory_init (pjmedia_aud_dev_factory *f); -static pj_status_t factory_destroy (pjmedia_aud_dev_factory *f); -static unsigned factory_get_dev_count (pjmedia_aud_dev_factory *f); -static pj_status_t factory_get_dev_info (pjmedia_aud_dev_factory *f, - unsigned index, - pjmedia_aud_dev_info *info); -static pj_status_t factory_default_param (pjmedia_aud_dev_factory *f, - unsigned index, - pjmedia_aud_param *param); -static pj_status_t factory_create_stream (pjmedia_aud_dev_factory *f, - const pjmedia_aud_param *param, - pjmedia_aud_rec_cb rec_cb, - pjmedia_aud_play_cb play_cb, - void *user_data, - pjmedia_aud_stream **p_aud_strm); - -static pj_status_t stream_get_param (pjmedia_aud_stream *strm, - pjmedia_aud_param *param); -static pj_status_t stream_get_cap (pjmedia_aud_stream *strm, - pjmedia_aud_dev_cap cap, - void *value); -static pj_status_t stream_set_cap (pjmedia_aud_stream *strm, - pjmedia_aud_dev_cap cap, - const void *value); -static pj_status_t stream_start (pjmedia_aud_stream *strm); -static pj_status_t stream_stop (pjmedia_aud_stream *strm); -static pj_status_t stream_destroy (pjmedia_aud_stream *strm); +static pj_status_t factory_init(pjmedia_aud_dev_factory *f); +static pj_status_t factory_destroy(pjmedia_aud_dev_factory *f); +static unsigned factory_get_dev_count(pjmedia_aud_dev_factory *f); +static pj_status_t factory_get_dev_info(pjmedia_aud_dev_factory *f, + unsigned index, + pjmedia_aud_dev_info *info); +static pj_status_t factory_default_param(pjmedia_aud_dev_factory *f, + unsigned index, + pjmedia_aud_param *param); +static pj_status_t factory_create_stream(pjmedia_aud_dev_factory *f, + const pjmedia_aud_param *param, + pjmedia_aud_rec_cb rec_cb, + pjmedia_aud_play_cb play_cb, + void *user_data, + pjmedia_aud_stream **p_aud_strm); + +static pj_status_t stream_get_param(pjmedia_aud_stream *strm, + pjmedia_aud_param *param); +static pj_status_t stream_get_cap(pjmedia_aud_stream *strm, + pjmedia_aud_dev_cap cap, + void *value); +static pj_status_t stream_set_cap(pjmedia_aud_stream *strm, + pjmedia_aud_dev_cap cap, + const void *value); +static pj_status_t stream_start(pjmedia_aud_stream *strm); +static pj_status_t stream_stop(pjmedia_aud_stream *strm); +static pj_status_t stream_destroy(pjmedia_aud_stream *strm); /* Operations */ -static pjmedia_aud_dev_factory_op factory_op = { +static pjmedia_aud_dev_factory_op factory_op = +{ &factory_init, &factory_destroy, &factory_get_dev_count, @@ -124,7 +123,8 @@ static pjmedia_aud_dev_factory_op factory_op = { &factory_create_stream }; -static pjmedia_aud_stream_op stream_op = { +static pjmedia_aud_stream_op stream_op = +{ &stream_get_param, &stream_get_cap, &stream_set_cap, @@ -137,171 +137,141 @@ static pjmedia_aud_stream_op stream_op = { /* * Convert clock rate to Symbian's TMdaAudioDataSettings capability. */ -static TInt get_clock_rate_cap (unsigned clock_rate) +static TInt get_clock_rate_cap(unsigned clock_rate) { switch (clock_rate) { - - case 8000: - return TMdaAudioDataSettings::ESampleRate8000Hz; - - case 11025: - return TMdaAudioDataSettings::ESampleRate11025Hz; - - case 12000: - return TMdaAudioDataSettings::ESampleRate12000Hz; - - case 16000: - return TMdaAudioDataSettings::ESampleRate16000Hz; - - case 22050: - return TMdaAudioDataSettings::ESampleRate22050Hz; - - case 24000: - return TMdaAudioDataSettings::ESampleRate24000Hz; - - case 32000: - return TMdaAudioDataSettings::ESampleRate32000Hz; - - case 44100: - return TMdaAudioDataSettings::ESampleRate44100Hz; - - case 48000: - return TMdaAudioDataSettings::ESampleRate48000Hz; - - case 64000: - return TMdaAudioDataSettings::ESampleRate64000Hz; - - case 96000: - return TMdaAudioDataSettings::ESampleRate96000Hz; - - default: - return 0; + case 8000: return TMdaAudioDataSettings::ESampleRate8000Hz; + case 11025: return TMdaAudioDataSettings::ESampleRate11025Hz; + case 12000: return TMdaAudioDataSettings::ESampleRate12000Hz; + case 16000: return TMdaAudioDataSettings::ESampleRate16000Hz; + case 22050: return TMdaAudioDataSettings::ESampleRate22050Hz; + case 24000: return TMdaAudioDataSettings::ESampleRate24000Hz; + case 32000: return TMdaAudioDataSettings::ESampleRate32000Hz; + case 44100: return TMdaAudioDataSettings::ESampleRate44100Hz; + case 48000: return TMdaAudioDataSettings::ESampleRate48000Hz; + case 64000: return TMdaAudioDataSettings::ESampleRate64000Hz; + case 96000: return TMdaAudioDataSettings::ESampleRate96000Hz; + default: + return 0; } } /* * Convert number of channels into Symbian's TMdaAudioDataSettings capability. */ -static TInt get_channel_cap (unsigned channel_count) +static TInt get_channel_cap(unsigned channel_count) { switch (channel_count) { - - case 1: - return TMdaAudioDataSettings::EChannelsMono; - - case 2: - return TMdaAudioDataSettings::EChannelsStereo; - - default: - return 0; + case 1: return TMdaAudioDataSettings::EChannelsMono; + case 2: return TMdaAudioDataSettings::EChannelsStereo; + default: + return 0; } } /* * Utility: print sound device error */ -static void snd_perror (const char *title, TInt rc) +static void snd_perror(const char *title, TInt rc) { - PJ_LOG (1, (THIS_FILE, "%s: error code %d", title, rc)); + PJ_LOG(1,(THIS_FILE, "%s: error code %d", title, rc)); } - + ////////////////////////////////////////////////////////////////////////////// // /* * Implementation: Symbian Input Stream. */ - class CPjAudioInputEngine : public CBase, MMdaAudioInputStreamCallback { +public: + enum State + { + STATE_INACTIVE, + STATE_ACTIVE, + }; + + ~CPjAudioInputEngine(); + + static CPjAudioInputEngine *NewL(struct mda_stream *parent_strm, + pjmedia_aud_rec_cb rec_cb, + void *user_data); + + static CPjAudioInputEngine *NewLC(struct mda_stream *parent_strm, + pjmedia_aud_rec_cb rec_cb, + void *user_data); + + pj_status_t StartRecord(); + void Stop(); + + pj_status_t SetGain(TInt gain) { + if (iInputStream_) { + iInputStream_->SetGain(gain); + return PJ_SUCCESS; + } else + return PJ_EINVALIDOP; + } + + TInt GetGain() { + if (iInputStream_) { + return iInputStream_->Gain(); + } else + return PJ_EINVALIDOP; + } - public: - enum State { - STATE_INACTIVE, - STATE_ACTIVE, - }; - - ~CPjAudioInputEngine(); - - static CPjAudioInputEngine *NewL (struct mda_stream *parent_strm, - pjmedia_aud_rec_cb rec_cb, - void *user_data); - - static CPjAudioInputEngine *NewLC (struct mda_stream *parent_strm, - pjmedia_aud_rec_cb rec_cb, - void *user_data); - - pj_status_t StartRecord(); - void Stop(); - - pj_status_t SetGain (TInt gain) { - if (iInputStream_) { - iInputStream_->SetGain (gain); - return PJ_SUCCESS; - } else - return PJ_EINVALIDOP; - } - - TInt GetGain() { - if (iInputStream_) { - return iInputStream_->Gain(); - } else - return PJ_EINVALIDOP; - } - - TInt GetMaxGain() { - if (iInputStream_) { - return iInputStream_->MaxGain(); - } else - return PJ_EINVALIDOP; - } - - private: - State state_; - - struct mda_stream *parentStrm_; - pjmedia_aud_rec_cb recCb_; - void *userData_; - CMdaAudioInputStream *iInputStream_; - HBufC8 *iStreamBuffer_; - TPtr8 iFramePtr_; - TInt lastError_; - pj_uint32_t timeStamp_; - - // cache variable - // to avoid calculating frame length repeatedly - TInt frameLen_; - - // sometimes recorded size != requested framesize, so let's - // provide a buffer to make sure the rec callback returning - // framesize as requested. - TUint8 *frameRecBuf_; - TInt frameRecBufLen_; - - CPjAudioInputEngine (struct mda_stream *parent_strm, - pjmedia_aud_rec_cb rec_cb, - void *user_data); - void ConstructL(); - TPtr8 & GetFrame(); - - public: - virtual void MaiscOpenComplete (TInt aError); - virtual void MaiscBufferCopied (TInt aError, const TDesC8 &aBuffer); - virtual void MaiscRecordComplete (TInt aError); + TInt GetMaxGain() { + if (iInputStream_) { + return iInputStream_->MaxGain(); + } else + return PJ_EINVALIDOP; + } + +private: + State state_; + struct mda_stream *parentStrm_; + pjmedia_aud_rec_cb recCb_; + void *userData_; + CMdaAudioInputStream *iInputStream_; + HBufC8 *iStreamBuffer_; + TPtr8 iFramePtr_; + TInt lastError_; + pj_uint32_t timeStamp_; + + // cache variable + // to avoid calculating frame length repeatedly + TInt frameLen_; + + // sometimes recorded size != requested framesize, so let's + // provide a buffer to make sure the rec callback returning + // framesize as requested. + TUint8 *frameRecBuf_; + TInt frameRecBufLen_; + + CPjAudioInputEngine(struct mda_stream *parent_strm, + pjmedia_aud_rec_cb rec_cb, + void *user_data); + void ConstructL(); + TPtr8 & GetFrame(); + +public: + virtual void MaiscOpenComplete(TInt aError); + virtual void MaiscBufferCopied(TInt aError, const TDesC8 &aBuffer); + virtual void MaiscRecordComplete(TInt aError); }; -CPjAudioInputEngine::CPjAudioInputEngine (struct mda_stream *parent_strm, - pjmedia_aud_rec_cb rec_cb, - void *user_data) - : state_ (STATE_INACTIVE), parentStrm_ (parent_strm), - recCb_ (rec_cb), userData_ (user_data), - iInputStream_ (NULL), iStreamBuffer_ (NULL), iFramePtr_ (0, 0), - lastError_ (KErrNone), timeStamp_ (0), - frameLen_ (parent_strm->param.samples_per_frame * - BYTES_PER_SAMPLE), - frameRecBuf_ (NULL), frameRecBufLen_ (0) +CPjAudioInputEngine::CPjAudioInputEngine(struct mda_stream *parent_strm, + pjmedia_aud_rec_cb rec_cb, + void *user_data) + : state_(STATE_INACTIVE), parentStrm_(parent_strm), + recCb_(rec_cb), userData_(user_data), + iInputStream_(NULL), iStreamBuffer_(NULL), iFramePtr_(0, 0), + lastError_(KErrNone), timeStamp_(0), + frameLen_(parent_strm->param.samples_per_frame * + BYTES_PER_SAMPLE), + frameRecBuf_(NULL), frameRecBufLen_(0) { } @@ -311,7 +281,7 @@ CPjAudioInputEngine::~CPjAudioInputEngine() delete iStreamBuffer_; iStreamBuffer_ = NULL; - + delete [] frameRecBuf_; frameRecBuf_ = NULL; frameRecBufLen_ = 0; @@ -319,33 +289,33 @@ CPjAudioInputEngine::~CPjAudioInputEngine() void CPjAudioInputEngine::ConstructL() { - iStreamBuffer_ = HBufC8::NewL (frameLen_); - CleanupStack::PushL (iStreamBuffer_); + iStreamBuffer_ = HBufC8::NewL(frameLen_); + CleanupStack::PushL(iStreamBuffer_); frameRecBuf_ = new TUint8[frameLen_*2]; - CleanupStack::PushL (frameRecBuf_); + CleanupStack::PushL(frameRecBuf_); } -CPjAudioInputEngine *CPjAudioInputEngine::NewLC (struct mda_stream *parent, - pjmedia_aud_rec_cb rec_cb, - void *user_data) +CPjAudioInputEngine *CPjAudioInputEngine::NewLC(struct mda_stream *parent, + pjmedia_aud_rec_cb rec_cb, + void *user_data) { - CPjAudioInputEngine* self = new (ELeave) CPjAudioInputEngine (parent, - rec_cb, - user_data); - CleanupStack::PushL (self); + CPjAudioInputEngine* self = new (ELeave) CPjAudioInputEngine(parent, + rec_cb, + user_data); + CleanupStack::PushL(self); self->ConstructL(); return self; } -CPjAudioInputEngine *CPjAudioInputEngine::NewL (struct mda_stream *parent, - pjmedia_aud_rec_cb rec_cb, - void *user_data) +CPjAudioInputEngine *CPjAudioInputEngine::NewL(struct mda_stream *parent, + pjmedia_aud_rec_cb rec_cb, + void *user_data) { - CPjAudioInputEngine *self = NewLC (parent, rec_cb, user_data); - CleanupStack::Pop (self->frameRecBuf_); - CleanupStack::Pop (self->iStreamBuffer_); - CleanupStack::Pop (self); + CPjAudioInputEngine *self = NewLC(parent, rec_cb, user_data); + CleanupStack::Pop(self->frameRecBuf_); + CleanupStack::Pop(self->iStreamBuffer_); + CleanupStack::Pop(self); return self; } @@ -355,50 +325,44 @@ pj_status_t CPjAudioInputEngine::StartRecord() // Ignore command if recording is in progress. if (state_ == STATE_ACTIVE) - return PJ_SUCCESS; + return PJ_SUCCESS; // According to Nokia's AudioStream example, some 2nd Edition, FP2 devices - // (such as Nokia 6630) require the stream to be reconstructed each time + // (such as Nokia 6630) require the stream to be reconstructed each time // before calling Open() - otherwise the callback never gets called. // For uniform behavior, lets just delete/re-create the stream for all // devices. // Destroy existing stream. if (iInputStream_) delete iInputStream_; - iInputStream_ = NULL; // Create the stream. - TRAPD (err, iInputStream_ = CMdaAudioInputStream::NewL (*this)); - + TRAPD(err, iInputStream_ = CMdaAudioInputStream::NewL(*this)); if (err != KErrNone) - return PJ_RETURN_OS_ERROR (err); + return PJ_RETURN_OS_ERROR(err); // Initialize settings. TMdaAudioDataSettings iStreamSettings; - - iStreamSettings.iChannels = - get_channel_cap (parentStrm_->param.channel_count); - - iStreamSettings.iSampleRate = - get_clock_rate_cap (parentStrm_->param.clock_rate); - - pj_assert (iStreamSettings.iChannels != 0 && - iStreamSettings.iSampleRate != 0); - - PJ_LOG (4, (THIS_FILE, "Opening sound device for capture, " - "clock rate=%d, channel count=%d..", - parentStrm_->param.clock_rate, - parentStrm_->param.channel_count)); - + iStreamSettings.iChannels = + get_channel_cap(parentStrm_->param.channel_count); + iStreamSettings.iSampleRate = + get_clock_rate_cap(parentStrm_->param.clock_rate); + + pj_assert(iStreamSettings.iChannels != 0 && + iStreamSettings.iSampleRate != 0); + + PJ_LOG(4,(THIS_FILE, "Opening sound device for capture, " + "clock rate=%d, channel count=%d..", + parentStrm_->param.clock_rate, + parentStrm_->param.channel_count)); + // Open stream. lastError_ = KRequestPending; - - iInputStream_->Open (&iStreamSettings); - + iInputStream_->Open(&iStreamSettings); + // Success - PJ_LOG (4, (THIS_FILE, "Sound capture started.")); - + PJ_LOG(4,(THIS_FILE, "Sound capture started.")); return PJ_SUCCESS; } @@ -407,121 +371,113 @@ void CPjAudioInputEngine::Stop() { // If capture is in progress, stop it. if (iInputStream_ && state_ == STATE_ACTIVE) { - lastError_ = KRequestPending; - iInputStream_->Stop(); + lastError_ = KRequestPending; + iInputStream_->Stop(); - // Wait until it's actually stopped - - while (lastError_ == KRequestPending) - pj_symbianos_poll (-1, 100); + // Wait until it's actually stopped + while (lastError_ == KRequestPending) + pj_symbianos_poll(-1, 100); } if (iInputStream_) { - delete iInputStream_; - iInputStream_ = NULL; + delete iInputStream_; + iInputStream_ = NULL; } - + state_ = STATE_INACTIVE; } -TPtr8 & CPjAudioInputEngine::GetFrame() +TPtr8 & CPjAudioInputEngine::GetFrame() { //iStreamBuffer_->Des().FillZ(frameLen_); - iFramePtr_.Set ( (TUint8*) (iStreamBuffer_->Ptr()), frameLen_, frameLen_); + iFramePtr_.Set((TUint8*)(iStreamBuffer_->Ptr()), frameLen_, frameLen_); return iFramePtr_; } -void CPjAudioInputEngine::MaiscOpenComplete (TInt aError) +void CPjAudioInputEngine::MaiscOpenComplete(TInt aError) { lastError_ = aError; - if (aError != KErrNone) { - snd_perror ("Error in MaiscOpenComplete()", aError); - return; + snd_perror("Error in MaiscOpenComplete()", aError); + return; } // set stream priority to normal and time sensitive - iInputStream_->SetPriority (EPriorityNormal, - EMdaPriorityPreferenceTime); + iInputStream_->SetPriority(EPriorityNormal, + EMdaPriorityPreferenceTime); // Read the first frame. TPtr8 & frm = GetFrame(); - - TRAPD (err2, iInputStream_->ReadL (frm)); - + TRAPD(err2, iInputStream_->ReadL(frm)); if (err2) { - PJ_LOG (4, (THIS_FILE, "Exception in iInputStream_->ReadL()")); + PJ_LOG(4,(THIS_FILE, "Exception in iInputStream_->ReadL()")); } } -void CPjAudioInputEngine::MaiscBufferCopied (TInt aError, - const TDesC8 &aBuffer) +void CPjAudioInputEngine::MaiscBufferCopied(TInt aError, + const TDesC8 &aBuffer) { lastError_ = aError; - if (aError != KErrNone) { - snd_perror ("Error in MaiscBufferCopied()", aError); - return; + snd_perror("Error in MaiscBufferCopied()", aError); + return; } if (frameRecBufLen_ || aBuffer.Length() < frameLen_) { - pj_memcpy (frameRecBuf_ + frameRecBufLen_, (void*) aBuffer.Ptr(), aBuffer.Length()); - frameRecBufLen_ += aBuffer.Length(); + pj_memcpy(frameRecBuf_ + frameRecBufLen_, (void*) aBuffer.Ptr(), aBuffer.Length()); + frameRecBufLen_ += aBuffer.Length(); } if (frameRecBufLen_) { - while (frameRecBufLen_ >= frameLen_) { - pjmedia_frame f; - - f.type = PJMEDIA_FRAME_TYPE_AUDIO; - f.buf = frameRecBuf_; - f.size = frameLen_; - f.timestamp.u32.lo = timeStamp_; - f.bit_info = 0; - - // Call the callback. - recCb_ (userData_, &f); - // Increment timestamp. - timeStamp_ += parentStrm_->param.samples_per_frame; - - frameRecBufLen_ -= frameLen_; - pj_memmove (frameRecBuf_, frameRecBuf_+frameLen_, frameRecBufLen_); - } + while (frameRecBufLen_ >= frameLen_) { + pjmedia_frame f; + + f.type = PJMEDIA_FRAME_TYPE_AUDIO; + f.buf = frameRecBuf_; + f.size = frameLen_; + f.timestamp.u32.lo = timeStamp_; + f.bit_info = 0; + + // Call the callback. + recCb_(userData_, &f); + // Increment timestamp. + timeStamp_ += parentStrm_->param.samples_per_frame; + + frameRecBufLen_ -= frameLen_; + pj_memmove(frameRecBuf_, frameRecBuf_+frameLen_, frameRecBufLen_); + } } else { - pjmedia_frame f; - - f.type = PJMEDIA_FRAME_TYPE_AUDIO; - f.buf = (void*) aBuffer.Ptr(); - f.size = aBuffer.Length(); - f.timestamp.u32.lo = timeStamp_; - f.bit_info = 0; - - // Call the callback. - recCb_ (userData_, &f); - - // Increment timestamp. - timeStamp_ += parentStrm_->param.samples_per_frame; + pjmedia_frame f; + + f.type = PJMEDIA_FRAME_TYPE_AUDIO; + f.buf = (void*)aBuffer.Ptr(); + f.size = aBuffer.Length(); + f.timestamp.u32.lo = timeStamp_; + f.bit_info = 0; + + // Call the callback. + recCb_(userData_, &f); + + // Increment timestamp. + timeStamp_ += parentStrm_->param.samples_per_frame; } // Record next frame TPtr8 & frm = GetFrame(); - - TRAPD (err2, iInputStream_->ReadL (frm)); - + TRAPD(err2, iInputStream_->ReadL(frm)); if (err2) { - PJ_LOG (4, (THIS_FILE, "Exception in iInputStream_->ReadL()")); + PJ_LOG(4,(THIS_FILE, "Exception in iInputStream_->ReadL()")); } } -void CPjAudioInputEngine::MaiscRecordComplete (TInt aError) +void CPjAudioInputEngine::MaiscRecordComplete(TInt aError) { lastError_ = aError; state_ = STATE_INACTIVE; - if (aError != KErrNone && aError != KErrCancel) { - snd_perror ("Error in MaiscRecordComplete()", aError); + snd_perror("Error in MaiscRecordComplete()", aError); } } @@ -536,78 +492,77 @@ void CPjAudioInputEngine::MaiscRecordComplete (TInt aError) class CPjAudioOutputEngine : public CBase, MMdaAudioOutputStreamCallback { +public: + enum State + { + STATE_INACTIVE, + STATE_ACTIVE, + }; + + ~CPjAudioOutputEngine(); + + static CPjAudioOutputEngine *NewL(struct mda_stream *parent_strm, + pjmedia_aud_play_cb play_cb, + void *user_data); + + static CPjAudioOutputEngine *NewLC(struct mda_stream *parent_strm, + pjmedia_aud_play_cb rec_cb, + void *user_data); + + pj_status_t StartPlay(); + void Stop(); + + pj_status_t SetVolume(TInt vol) { + if (iOutputStream_) { + iOutputStream_->SetVolume(vol); + return PJ_SUCCESS; + } else + return PJ_EINVALIDOP; + } + + TInt GetVolume() { + if (iOutputStream_) { + return iOutputStream_->Volume(); + } else + return PJ_EINVALIDOP; + } + + TInt GetMaxVolume() { + if (iOutputStream_) { + return iOutputStream_->MaxVolume(); + } else + return PJ_EINVALIDOP; + } - public: - enum State { - STATE_INACTIVE, - STATE_ACTIVE, - }; - - ~CPjAudioOutputEngine(); - - static CPjAudioOutputEngine *NewL (struct mda_stream *parent_strm, - pjmedia_aud_play_cb play_cb, - void *user_data); - - static CPjAudioOutputEngine *NewLC (struct mda_stream *parent_strm, - pjmedia_aud_play_cb rec_cb, - void *user_data); - - pj_status_t StartPlay(); - void Stop(); - - pj_status_t SetVolume (TInt vol) { - if (iOutputStream_) { - iOutputStream_->SetVolume (vol); - return PJ_SUCCESS; - } else - return PJ_EINVALIDOP; - } - - TInt GetVolume() { - if (iOutputStream_) { - return iOutputStream_->Volume(); - } else - return PJ_EINVALIDOP; - } - - TInt GetMaxVolume() { - if (iOutputStream_) { - return iOutputStream_->MaxVolume(); - } else - return PJ_EINVALIDOP; - } - - private: - State state_; - - struct mda_stream *parentStrm_; - pjmedia_aud_play_cb playCb_; - void *userData_; - CMdaAudioOutputStream *iOutputStream_; - TUint8 *frameBuf_; - unsigned frameBufSize_; - TPtrC8 frame_; - TInt lastError_; - unsigned timestamp_; - - CPjAudioOutputEngine (struct mda_stream *parent_strm, - pjmedia_aud_play_cb play_cb, - void *user_data); - void ConstructL(); - - virtual void MaoscOpenComplete (TInt aError); - virtual void MaoscBufferCopied (TInt aError, const TDesC8& aBuffer); - virtual void MaoscPlayComplete (TInt aError); +private: + State state_; + struct mda_stream *parentStrm_; + pjmedia_aud_play_cb playCb_; + void *userData_; + CMdaAudioOutputStream *iOutputStream_; + TUint8 *frameBuf_; + unsigned frameBufSize_; + TPtrC8 frame_; + TInt lastError_; + unsigned timestamp_; + + CPjAudioOutputEngine(struct mda_stream *parent_strm, + pjmedia_aud_play_cb play_cb, + void *user_data); + void ConstructL(); + + virtual void MaoscOpenComplete(TInt aError); + virtual void MaoscBufferCopied(TInt aError, const TDesC8& aBuffer); + virtual void MaoscPlayComplete(TInt aError); }; -CPjAudioOutputEngine::CPjAudioOutputEngine (struct mda_stream *parent_strm, - pjmedia_aud_play_cb play_cb, - void *user_data) - : state_ (STATE_INACTIVE), parentStrm_ (parent_strm), playCb_ (play_cb), - userData_ (user_data), iOutputStream_ (NULL), frameBuf_ (NULL), - lastError_ (KErrNone), timestamp_ (0) +CPjAudioOutputEngine::CPjAudioOutputEngine(struct mda_stream *parent_strm, + pjmedia_aud_play_cb play_cb, + void *user_data) +: state_(STATE_INACTIVE), parentStrm_(parent_strm), playCb_(play_cb), + userData_(user_data), iOutputStream_(NULL), frameBuf_(NULL), + lastError_(KErrNone), timestamp_(0) { } @@ -615,36 +570,36 @@ CPjAudioOutputEngine::CPjAudioOutputEngine (struct mda_stream *parent_strm, void CPjAudioOutputEngine::ConstructL() { frameBufSize_ = parentStrm_->param.samples_per_frame * - BYTES_PER_SAMPLE; + BYTES_PER_SAMPLE; frameBuf_ = new TUint8[frameBufSize_]; } CPjAudioOutputEngine::~CPjAudioOutputEngine() { Stop(); - delete [] frameBuf_; + delete [] frameBuf_; } CPjAudioOutputEngine * -CPjAudioOutputEngine::NewLC (struct mda_stream *parent_strm, - pjmedia_aud_play_cb play_cb, - void *user_data) +CPjAudioOutputEngine::NewLC(struct mda_stream *parent_strm, + pjmedia_aud_play_cb play_cb, + void *user_data) { - CPjAudioOutputEngine* self = new (ELeave) CPjAudioOutputEngine (parent_strm, - play_cb, - user_data); - CleanupStack::PushL (self); + CPjAudioOutputEngine* self = new (ELeave) CPjAudioOutputEngine(parent_strm, + play_cb, + user_data); + CleanupStack::PushL(self); self->ConstructL(); return self; } CPjAudioOutputEngine * -CPjAudioOutputEngine::NewL (struct mda_stream *parent_strm, - pjmedia_aud_play_cb play_cb, - void *user_data) +CPjAudioOutputEngine::NewL(struct mda_stream *parent_strm, + pjmedia_aud_play_cb play_cb, + void *user_data) { - CPjAudioOutputEngine *self = NewLC (parent_strm, play_cb, user_data); - CleanupStack::Pop (self); + CPjAudioOutputEngine *self = NewLC(parent_strm, play_cb, user_data); + CleanupStack::Pop(self); return self; } @@ -652,44 +607,38 @@ pj_status_t CPjAudioOutputEngine::StartPlay() { // Ignore command if playing is in progress. if (state_ == STATE_ACTIVE) - return PJ_SUCCESS; - + return PJ_SUCCESS; + // Destroy existing stream. if (iOutputStream_) delete iOutputStream_; - iOutputStream_ = NULL; - + // Create the stream - TRAPD (err, iOutputStream_ = CMdaAudioOutputStream::NewL (*this)); - + TRAPD(err, iOutputStream_ = CMdaAudioOutputStream::NewL(*this)); if (err != KErrNone) - return PJ_RETURN_OS_ERROR (err); - + return PJ_RETURN_OS_ERROR(err); + // Initialize settings. TMdaAudioDataSettings iStreamSettings; - - iStreamSettings.iChannels = - get_channel_cap (parentStrm_->param.channel_count); - - iStreamSettings.iSampleRate = - get_clock_rate_cap (parentStrm_->param.clock_rate); - - pj_assert (iStreamSettings.iChannels != 0 && - iStreamSettings.iSampleRate != 0); - - PJ_LOG (4, (THIS_FILE, "Opening sound device for playback, " - "clock rate=%d, channel count=%d..", - parentStrm_->param.clock_rate, - parentStrm_->param.channel_count)); + iStreamSettings.iChannels = + get_channel_cap(parentStrm_->param.channel_count); + iStreamSettings.iSampleRate = + get_clock_rate_cap(parentStrm_->param.clock_rate); + + pj_assert(iStreamSettings.iChannels != 0 && + iStreamSettings.iSampleRate != 0); + + PJ_LOG(4,(THIS_FILE, "Opening sound device for playback, " + "clock rate=%d, channel count=%d..", + parentStrm_->param.clock_rate, + parentStrm_->param.channel_count)); // Open stream. lastError_ = KRequestPending; - - iOutputStream_->Open (&iStreamSettings); + iOutputStream_->Open(&iStreamSettings); // Success - PJ_LOG (4, (THIS_FILE, "Sound playback started")); - + PJ_LOG(4,(THIS_FILE, "Sound playback started")); return PJ_SUCCESS; } @@ -698,137 +647,131 @@ void CPjAudioOutputEngine::Stop() { // Stop stream if it's playing if (iOutputStream_ && state_ != STATE_INACTIVE) { - lastError_ = KRequestPending; - iOutputStream_->Stop(); + lastError_ = KRequestPending; + iOutputStream_->Stop(); - // Wait until it's actually stopped - - while (lastError_ == KRequestPending) - pj_symbianos_poll (-1, 100); + // Wait until it's actually stopped + while (lastError_ == KRequestPending) + pj_symbianos_poll(-1, 100); } - - if (iOutputStream_) { - delete iOutputStream_; - iOutputStream_ = NULL; + + if (iOutputStream_) { + delete iOutputStream_; + iOutputStream_ = NULL; } - + state_ = STATE_INACTIVE; } -void CPjAudioOutputEngine::MaoscOpenComplete (TInt aError) +void CPjAudioOutputEngine::MaoscOpenComplete(TInt aError) { lastError_ = aError; - + if (aError==KErrNone) { - // output stream opened succesfully, set status to Active - state_ = STATE_ACTIVE; - - // set stream properties, 16bit 8KHz mono - TMdaAudioDataSettings iSettings; - iSettings.iChannels = - get_channel_cap (parentStrm_->param.channel_count); - iSettings.iSampleRate = - get_clock_rate_cap (parentStrm_->param.clock_rate); - - iOutputStream_->SetAudioPropertiesL (iSettings.iSampleRate, - iSettings.iChannels); - - // set volume to 1/2th of stream max volume - iOutputStream_->SetVolume (iOutputStream_->MaxVolume() /2); - - // set stream priority to normal and time sensitive - iOutputStream_->SetPriority (EPriorityNormal, - EMdaPriorityPreferenceTime); - - // Call callback to retrieve frame from upstream. - pjmedia_frame f; - pj_status_t status; - - f.type = PJMEDIA_FRAME_TYPE_AUDIO; - f.buf = frameBuf_; - f.size = frameBufSize_; - f.timestamp.u32.lo = timestamp_; - f.bit_info = 0; - - status = playCb_ (this->userData_, &f); - - if (status != PJ_SUCCESS) { - this->Stop(); - return; - } - - if (f.type != PJMEDIA_FRAME_TYPE_AUDIO) - pj_bzero (frameBuf_, frameBufSize_); - - // Increment timestamp. - timestamp_ += (frameBufSize_ / BYTES_PER_SAMPLE); - - // issue WriteL() to write the first audio data block, - // subsequent calls to WriteL() will be issued in - // MMdaAudioOutputStreamCallback::MaoscBufferCopied() - // until whole data buffer is written. - frame_.Set (frameBuf_, frameBufSize_); - - iOutputStream_->WriteL (frame_); + // output stream opened succesfully, set status to Active + state_ = STATE_ACTIVE; + + // set stream properties, 16bit 8KHz mono + TMdaAudioDataSettings iSettings; + iSettings.iChannels = + get_channel_cap(parentStrm_->param.channel_count); + iSettings.iSampleRate = + get_clock_rate_cap(parentStrm_->param.clock_rate); + + iOutputStream_->SetAudioPropertiesL(iSettings.iSampleRate, + iSettings.iChannels); + + // set volume to 1/2th of stream max volume + iOutputStream_->SetVolume(iOutputStream_->MaxVolume()/2); + + // set stream priority to normal and time sensitive + iOutputStream_->SetPriority(EPriorityNormal, + EMdaPriorityPreferenceTime); + + // Call callback to retrieve frame from upstream. + pjmedia_frame f; + pj_status_t status; + + f.type = PJMEDIA_FRAME_TYPE_AUDIO; + f.buf = frameBuf_; + f.size = frameBufSize_; + f.timestamp.u32.lo = timestamp_; + f.bit_info = 0; + + status = playCb_(this->userData_, &f); + if (status != PJ_SUCCESS) { + this->Stop(); + return; + } + + if (f.type != PJMEDIA_FRAME_TYPE_AUDIO) + pj_bzero(frameBuf_, frameBufSize_); + + // Increment timestamp. + timestamp_ += (frameBufSize_ / BYTES_PER_SAMPLE); + + // issue WriteL() to write the first audio data block, + // subsequent calls to WriteL() will be issued in + // MMdaAudioOutputStreamCallback::MaoscBufferCopied() + // until whole data buffer is written. + frame_.Set(frameBuf_, frameBufSize_); + iOutputStream_->WriteL(frame_); } else { - snd_perror ("Error in MaoscOpenComplete()", aError); + snd_perror("Error in MaoscOpenComplete()", aError); } } -void CPjAudioOutputEngine::MaoscBufferCopied (TInt aError, - const TDesC8& aBuffer) +void CPjAudioOutputEngine::MaoscBufferCopied(TInt aError, + const TDesC8& aBuffer) { - PJ_UNUSED_ARG (aBuffer); + PJ_UNUSED_ARG(aBuffer); if (aError==KErrNone) { - // Buffer successfully written, feed another one. - - // Call callback to retrieve frame from upstream. - pjmedia_frame f; - pj_status_t status; - - f.type = PJMEDIA_FRAME_TYPE_AUDIO; - f.buf = frameBuf_; - f.size = frameBufSize_; - f.timestamp.u32.lo = timestamp_; - f.bit_info = 0; - - status = playCb_ (this->userData_, &f); - - if (status != PJ_SUCCESS) { - this->Stop(); - return; - } - - if (f.type != PJMEDIA_FRAME_TYPE_AUDIO) - pj_bzero (frameBuf_, frameBufSize_); - - // Increment timestamp. - timestamp_ += (frameBufSize_ / BYTES_PER_SAMPLE); - - // Write to playback stream. - frame_.Set (frameBuf_, frameBufSize_); - - iOutputStream_->WriteL (frame_); + // Buffer successfully written, feed another one. + + // Call callback to retrieve frame from upstream. + pjmedia_frame f; + pj_status_t status; + + f.type = PJMEDIA_FRAME_TYPE_AUDIO; + f.buf = frameBuf_; + f.size = frameBufSize_; + f.timestamp.u32.lo = timestamp_; + f.bit_info = 0; + + status = playCb_(this->userData_, &f); + if (status != PJ_SUCCESS) { + this->Stop(); + return; + } + + if (f.type != PJMEDIA_FRAME_TYPE_AUDIO) + pj_bzero(frameBuf_, frameBufSize_); + + // Increment timestamp. + timestamp_ += (frameBufSize_ / BYTES_PER_SAMPLE); + + // Write to playback stream. + frame_.Set(frameBuf_, frameBufSize_); + iOutputStream_->WriteL(frame_); } else if (aError==KErrAbort) { - // playing was aborted, due to call to CMdaAudioOutputStream::Stop() - state_ = STATE_INACTIVE; + // playing was aborted, due to call to CMdaAudioOutputStream::Stop() + state_ = STATE_INACTIVE; } else { - // error writing data to output - lastError_ = aError; - state_ = STATE_INACTIVE; - snd_perror ("Error in MaoscBufferCopied()", aError); + // error writing data to output + lastError_ = aError; + state_ = STATE_INACTIVE; + snd_perror("Error in MaoscBufferCopied()", aError); } } -void CPjAudioOutputEngine::MaoscPlayComplete (TInt aError) +void CPjAudioOutputEngine::MaoscPlayComplete(TInt aError) { lastError_ = aError; state_ = STATE_INACTIVE; - if (aError != KErrNone && aError != KErrCancel) { - snd_perror ("Error in MaoscPlayComplete()", aError); + snd_perror("Error in MaoscPlayComplete()", aError); } } @@ -840,20 +783,19 @@ void CPjAudioOutputEngine::MaoscPlayComplete (TInt aError) * C compatible declaration of MDA factory. */ PJ_BEGIN_DECL -PJ_DECL (pjmedia_aud_dev_factory*) pjmedia_symb_mda_factory (pj_pool_factory *pf); +PJ_DECL(pjmedia_aud_dev_factory*) pjmedia_symb_mda_factory(pj_pool_factory *pf); PJ_END_DECL /* * Init Symbian audio driver. */ -pjmedia_aud_dev_factory* pjmedia_symb_mda_factory (pj_pool_factory *pf) +pjmedia_aud_dev_factory* pjmedia_symb_mda_factory(pj_pool_factory *pf) { - struct mda_factory *f; pj_pool_t *pool; - pool = pj_pool_create (pf, "symb_aud", 1000, 1000, NULL); - f = PJ_POOL_ZALLOC_T (pool, struct mda_factory); + pool = pj_pool_create(pf, "symb_aud", 1000, 1000, NULL); + f = PJ_POOL_ZALLOC_T(pool, struct mda_factory); f->pf = pf; f->pool = pool; f->base.op = &factory_op; @@ -862,71 +804,67 @@ pjmedia_aud_dev_factory* pjmedia_symb_mda_factory (pj_pool_factory *pf) } /* API: init factory */ -static pj_status_t factory_init (pjmedia_aud_dev_factory *f) +static pj_status_t factory_init(pjmedia_aud_dev_factory *f) { + struct mda_factory *af = (struct mda_factory*)f; - struct mda_factory *af = (struct mda_factory*) f; - - pj_ansi_strcpy (af->dev_info.name, "Symbian Audio"); + pj_ansi_strcpy(af->dev_info.name, "Symbian Audio"); af->dev_info.default_samples_per_sec = 8000; af->dev_info.caps = PJMEDIA_AUD_DEV_CAP_INPUT_VOLUME_SETTING | - PJMEDIA_AUD_DEV_CAP_OUTPUT_VOLUME_SETTING; + PJMEDIA_AUD_DEV_CAP_OUTPUT_VOLUME_SETTING; af->dev_info.input_count = 1; af->dev_info.output_count = 1; - PJ_LOG (4, (THIS_FILE, "Symb Mda initialized")); + PJ_LOG(4, (THIS_FILE, "Symb Mda initialized")); return PJ_SUCCESS; } /* API: destroy factory */ -static pj_status_t factory_destroy (pjmedia_aud_dev_factory *f) +static pj_status_t factory_destroy(pjmedia_aud_dev_factory *f) { - - struct mda_factory *af = (struct mda_factory*) f; + struct mda_factory *af = (struct mda_factory*)f; pj_pool_t *pool = af->pool; af->pool = NULL; - pj_pool_release (pool); - - PJ_LOG (4, (THIS_FILE, "Symbian Mda destroyed")); + pj_pool_release(pool); + PJ_LOG(4, (THIS_FILE, "Symbian Mda destroyed")); + return PJ_SUCCESS; } /* API: get number of devices */ -static unsigned factory_get_dev_count (pjmedia_aud_dev_factory *f) +static unsigned factory_get_dev_count(pjmedia_aud_dev_factory *f) { - PJ_UNUSED_ARG (f); + PJ_UNUSED_ARG(f); return 1; } /* API: get device info */ -static pj_status_t factory_get_dev_info (pjmedia_aud_dev_factory *f, - unsigned index, - pjmedia_aud_dev_info *info) +static pj_status_t factory_get_dev_info(pjmedia_aud_dev_factory *f, + unsigned index, + pjmedia_aud_dev_info *info) { + struct mda_factory *af = (struct mda_factory*)f; - struct mda_factory *af = (struct mda_factory*) f; + PJ_ASSERT_RETURN(index == 0, PJMEDIA_EAUD_INVDEV); - PJ_ASSERT_RETURN (index == 0, PJMEDIA_EAUD_INVDEV); - - pj_memcpy (info, &af->dev_info, sizeof (*info)); + pj_memcpy(info, &af->dev_info, sizeof(*info)); return PJ_SUCCESS; } /* API: create default device parameter */ -static pj_status_t factory_default_param (pjmedia_aud_dev_factory *f, - unsigned index, - pjmedia_aud_param *param) +static pj_status_t factory_default_param(pjmedia_aud_dev_factory *f, + unsigned index, + pjmedia_aud_param *param) { + struct mda_factory *af = (struct mda_factory*)f; - struct mda_factory *af = (struct mda_factory*) f; - - PJ_ASSERT_RETURN (index == 0, PJMEDIA_EAUD_INVDEV); + PJ_ASSERT_RETURN(index == 0, PJMEDIA_EAUD_INVDEV); - pj_bzero (param, sizeof (*param)); + pj_bzero(param, sizeof(*param)); param->dir = PJMEDIA_DIR_CAPTURE_PLAYBACK; param->rec_id = index; param->play_id = index; @@ -941,239 +879,210 @@ static pj_status_t factory_default_param (pjmedia_aud_dev_factory *f, /* API: create stream */ -static pj_status_t factory_create_stream (pjmedia_aud_dev_factory *f, - const pjmedia_aud_param *param, - pjmedia_aud_rec_cb rec_cb, - pjmedia_aud_play_cb play_cb, - void *user_data, - pjmedia_aud_stream **p_aud_strm) +static pj_status_t factory_create_stream(pjmedia_aud_dev_factory *f, + const pjmedia_aud_param *param, + pjmedia_aud_rec_cb rec_cb, + pjmedia_aud_play_cb play_cb, + void *user_data, + pjmedia_aud_stream **p_aud_strm) { - - struct mda_factory *mf = (struct mda_factory*) f; + struct mda_factory *mf = (struct mda_factory*)f; pj_pool_t *pool; - struct mda_stream *strm; /* Can only support 16bits per sample raw PCM format. */ - PJ_ASSERT_RETURN (param->bits_per_sample == BITS_PER_SAMPLE, PJ_EINVAL); - PJ_ASSERT_RETURN ( (param->flags & PJMEDIA_AUD_DEV_CAP_EXT_FORMAT) ==0 || - param->ext_fmt.id == PJMEDIA_FORMAT_L16, - PJ_ENOTSUP); - + PJ_ASSERT_RETURN(param->bits_per_sample == BITS_PER_SAMPLE, PJ_EINVAL); + PJ_ASSERT_RETURN((param->flags & PJMEDIA_AUD_DEV_CAP_EXT_FORMAT)==0 || + param->ext_fmt.id == PJMEDIA_FORMAT_L16, + PJ_ENOTSUP); + /* It seems that MDA recorder only supports for mono channel. */ - PJ_ASSERT_RETURN (param->channel_count == 1, PJ_EINVAL); + PJ_ASSERT_RETURN(param->channel_count == 1, PJ_EINVAL); /* Create and Initialize stream descriptor */ - pool = pj_pool_create (mf->pf, "symb_aud_dev", 1000, 1000, NULL); - PJ_ASSERT_RETURN (pool, PJ_ENOMEM); + pool = pj_pool_create(mf->pf, "symb_aud_dev", 1000, 1000, NULL); + PJ_ASSERT_RETURN(pool, PJ_ENOMEM); - strm = PJ_POOL_ZALLOC_T (pool, struct mda_stream); + strm = PJ_POOL_ZALLOC_T(pool, struct mda_stream); strm->pool = pool; strm->param = *param; // Create the output stream. - if (strm->param.dir & PJMEDIA_DIR_PLAYBACK) { - TRAPD (err, strm->out_engine = CPjAudioOutputEngine::NewL (strm, play_cb, - user_data)); - - if (err != KErrNone) { - pj_pool_release (pool); - return PJ_RETURN_OS_ERROR (err); - } + TRAPD(err, strm->out_engine = CPjAudioOutputEngine::NewL(strm, play_cb, + user_data)); + if (err != KErrNone) { + pj_pool_release(pool); + return PJ_RETURN_OS_ERROR(err); + } } // Create the input stream. if (strm->param.dir & PJMEDIA_DIR_CAPTURE) { - TRAPD (err, strm->in_engine = CPjAudioInputEngine::NewL (strm, rec_cb, - user_data)); - - if (err != KErrNone) { - strm->in_engine = NULL; - delete strm->out_engine; - strm->out_engine = NULL; - pj_pool_release (pool); - return PJ_RETURN_OS_ERROR (err); - } + TRAPD(err, strm->in_engine = CPjAudioInputEngine::NewL(strm, rec_cb, + user_data)); + if (err != KErrNone) { + strm->in_engine = NULL; + delete strm->out_engine; + strm->out_engine = NULL; + pj_pool_release(pool); + return PJ_RETURN_OS_ERROR(err); + } } - + /* Done */ strm->base.op = &stream_op; - *p_aud_strm = &strm->base; return PJ_SUCCESS; } /* API: Get stream info. */ -static pj_status_t stream_get_param (pjmedia_aud_stream *s, - pjmedia_aud_param *pi) +static pj_status_t stream_get_param(pjmedia_aud_stream *s, + pjmedia_aud_param *pi) { + struct mda_stream *strm = (struct mda_stream*)s; - struct mda_stream *strm = (struct mda_stream*) s; - - PJ_ASSERT_RETURN (strm && pi, PJ_EINVAL); - - pj_memcpy (pi, &strm->param, sizeof (*pi)); + PJ_ASSERT_RETURN(strm && pi, PJ_EINVAL); + pj_memcpy(pi, &strm->param, sizeof(*pi)); + return PJ_SUCCESS; } /* API: get capability */ -static pj_status_t stream_get_cap (pjmedia_aud_stream *s, - pjmedia_aud_dev_cap cap, - void *pval) +static pj_status_t stream_get_cap(pjmedia_aud_stream *s, + pjmedia_aud_dev_cap cap, + void *pval) { - - struct mda_stream *strm = (struct mda_stream*) s; + struct mda_stream *strm = (struct mda_stream*)s; pj_status_t status = PJ_ENOTSUP; - PJ_ASSERT_RETURN (s && pval, PJ_EINVAL); + PJ_ASSERT_RETURN(s && pval, PJ_EINVAL); switch (cap) { - - case PJMEDIA_AUD_DEV_CAP_INPUT_VOLUME_SETTING: - - if (strm->param.dir & PJMEDIA_DIR_CAPTURE) { - PJ_ASSERT_RETURN (strm->in_engine, PJ_EINVAL); - - TInt max_gain = strm->in_engine->GetMaxGain(); - TInt gain = strm->in_engine->GetGain(); - - if (max_gain > 0 && gain >= 0) { - * (unsigned*) pval = gain * 100 / max_gain; - status = PJ_SUCCESS; - } else { - status = PJMEDIA_EAUD_NOTREADY; - } - } - - break; - - case PJMEDIA_AUD_DEV_CAP_OUTPUT_VOLUME_SETTING: - - if (strm->param.dir & PJMEDIA_DIR_PLAYBACK) { - PJ_ASSERT_RETURN (strm->out_engine, PJ_EINVAL); - - TInt max_vol = strm->out_engine->GetMaxVolume(); - TInt vol = strm->out_engine->GetVolume(); - - if (max_vol > 0 && vol >= 0) { - * (unsigned*) pval = vol * 100 / max_vol; - status = PJ_SUCCESS; - } else { - status = PJMEDIA_EAUD_NOTREADY; - } - } - - break; - - default: - break; + case PJMEDIA_AUD_DEV_CAP_INPUT_VOLUME_SETTING: + if (strm->param.dir & PJMEDIA_DIR_CAPTURE) { + PJ_ASSERT_RETURN(strm->in_engine, PJ_EINVAL); + + TInt max_gain = strm->in_engine->GetMaxGain(); + TInt gain = strm->in_engine->GetGain(); + + if (max_gain > 0 && gain >= 0) { + *(unsigned*)pval = gain * 100 / max_gain; + status = PJ_SUCCESS; + } else { + status = PJMEDIA_EAUD_NOTREADY; + } + } + break; + case PJMEDIA_AUD_DEV_CAP_OUTPUT_VOLUME_SETTING: + if (strm->param.dir & PJMEDIA_DIR_PLAYBACK) { + PJ_ASSERT_RETURN(strm->out_engine, PJ_EINVAL); + + TInt max_vol = strm->out_engine->GetMaxVolume(); + TInt vol = strm->out_engine->GetVolume(); + + if (max_vol > 0 && vol >= 0) { + *(unsigned*)pval = vol * 100 / max_vol; + status = PJ_SUCCESS; + } else { + status = PJMEDIA_EAUD_NOTREADY; + } + } + break; + default: + break; } - + return status; } /* API: set capability */ -static pj_status_t stream_set_cap (pjmedia_aud_stream *s, - pjmedia_aud_dev_cap cap, - const void *pval) +static pj_status_t stream_set_cap(pjmedia_aud_stream *s, + pjmedia_aud_dev_cap cap, + const void *pval) { - - struct mda_stream *strm = (struct mda_stream*) s; + struct mda_stream *strm = (struct mda_stream*)s; pj_status_t status = PJ_ENOTSUP; - PJ_ASSERT_RETURN (s && pval, PJ_EINVAL); + PJ_ASSERT_RETURN(s && pval, PJ_EINVAL); switch (cap) { - - case PJMEDIA_AUD_DEV_CAP_INPUT_VOLUME_SETTING: - - if (strm->param.dir & PJMEDIA_DIR_CAPTURE) { - PJ_ASSERT_RETURN (strm->in_engine, PJ_EINVAL); - - TInt max_gain = strm->in_engine->GetMaxGain(); - - if (max_gain > 0) { - TInt gain; - - gain = * (unsigned*) pval * max_gain / 100; - status = strm->in_engine->SetGain (gain); - } else { - status = PJMEDIA_EAUD_NOTREADY; - } - } - - break; - - case PJMEDIA_AUD_DEV_CAP_OUTPUT_VOLUME_SETTING: - - if (strm->param.dir & PJMEDIA_DIR_CAPTURE) { - PJ_ASSERT_RETURN (strm->out_engine, PJ_EINVAL); - - TInt max_vol = strm->out_engine->GetMaxVolume(); - - if (max_vol > 0) { - TInt vol; - - vol = * (unsigned*) pval * max_vol / 100; - status = strm->out_engine->SetVolume (vol); - } else { - status = PJMEDIA_EAUD_NOTREADY; - } - } - - break; - - default: - break; + case PJMEDIA_AUD_DEV_CAP_INPUT_VOLUME_SETTING: + if (strm->param.dir & PJMEDIA_DIR_CAPTURE) { + PJ_ASSERT_RETURN(strm->in_engine, PJ_EINVAL); + + TInt max_gain = strm->in_engine->GetMaxGain(); + if (max_gain > 0) { + TInt gain; + + gain = *(unsigned*)pval * max_gain / 100; + status = strm->in_engine->SetGain(gain); + } else { + status = PJMEDIA_EAUD_NOTREADY; + } + } + break; + case PJMEDIA_AUD_DEV_CAP_OUTPUT_VOLUME_SETTING: + if (strm->param.dir & PJMEDIA_DIR_CAPTURE) { + PJ_ASSERT_RETURN(strm->out_engine, PJ_EINVAL); + + TInt max_vol = strm->out_engine->GetMaxVolume(); + if (max_vol > 0) { + TInt vol; + + vol = *(unsigned*)pval * max_vol / 100; + status = strm->out_engine->SetVolume(vol); + } else { + status = PJMEDIA_EAUD_NOTREADY; + } + } + break; + default: + break; } - + return status; } /* API: Start stream. */ -static pj_status_t stream_start (pjmedia_aud_stream *strm) +static pj_status_t stream_start(pjmedia_aud_stream *strm) { + struct mda_stream *stream = (struct mda_stream*)strm; - struct mda_stream *stream = (struct mda_stream*) strm; - - PJ_ASSERT_RETURN (stream, PJ_EINVAL); + PJ_ASSERT_RETURN(stream, PJ_EINVAL); if (stream->out_engine) { - pj_status_t status; - status = stream->out_engine->StartPlay(); - - if (status != PJ_SUCCESS) - return status; + pj_status_t status; + status = stream->out_engine->StartPlay(); + if (status != PJ_SUCCESS) + return status; } - + if (stream->in_engine) { - pj_status_t status; - status = stream->in_engine->StartRecord(); - - if (status != PJ_SUCCESS) - return status; + pj_status_t status; + status = stream->in_engine->StartRecord(); + if (status != PJ_SUCCESS) + return status; } return PJ_SUCCESS; } /* API: Stop stream. */ -static pj_status_t stream_stop (pjmedia_aud_stream *strm) +static pj_status_t stream_stop(pjmedia_aud_stream *strm) { + struct mda_stream *stream = (struct mda_stream*)strm; - struct mda_stream *stream = (struct mda_stream*) strm; - - PJ_ASSERT_RETURN (stream, PJ_EINVAL); + PJ_ASSERT_RETURN(stream, PJ_EINVAL); if (stream->in_engine) { - stream->in_engine->Stop(); + stream->in_engine->Stop(); } - + if (stream->out_engine) { - stream->out_engine->Stop(); + stream->out_engine->Stop(); } return PJ_SUCCESS; @@ -1181,14 +1090,13 @@ static pj_status_t stream_stop (pjmedia_aud_stream *strm) /* API: Destroy stream. */ -static pj_status_t stream_destroy (pjmedia_aud_stream *strm) +static pj_status_t stream_destroy(pjmedia_aud_stream *strm) { + struct mda_stream *stream = (struct mda_stream*)strm; - struct mda_stream *stream = (struct mda_stream*) strm; + PJ_ASSERT_RETURN(stream, PJ_EINVAL); - PJ_ASSERT_RETURN (stream, PJ_EINVAL); - - stream_stop (strm); + stream_stop(strm); delete stream->in_engine; stream->in_engine = NULL; @@ -1198,10 +1106,9 @@ static pj_status_t stream_destroy (pjmedia_aud_stream *strm) pj_pool_t *pool; pool = stream->pool; - if (pool) { - stream->pool = NULL; - pj_pool_release (pool); + stream->pool = NULL; + pj_pool_release(pool); } return PJ_SUCCESS; diff --git a/sflphone-common/libs/pjproject/pjmedia/src/pjmedia-audiodev/symb_vas_dev.cpp b/sflphone-common/libs/pjproject/pjmedia/src/pjmedia-audiodev/symb_vas_dev.cpp index a4c156bebb9f73e00f598a8ac271df2a65ac39de..93eb284404ee4d76d25c7abd9a9bb49386577e2f 100644 --- a/sflphone-common/libs/pjproject/pjmedia/src/pjmedia-audiodev/symb_vas_dev.cpp +++ b/sflphone-common/libs/pjproject/pjmedia/src/pjmedia-audiodev/symb_vas_dev.cpp @@ -1,5 +1,5 @@ -/* $Id: symb_vas_dev.cpp 2833 2009-07-14 14:33:39Z nanang $ */ -/* +/* $Id: symb_vas_dev.cpp 3025 2009-11-24 12:24:35Z nanang $ */ +/* * Copyright (C) 2009 Teluu Inc. (http://www.teluu.com) * * This program is free software; you can redistribute it and/or modify @@ -14,7 +14,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include <pjmedia-audiodev/audiodev_imp.h> #include <pjmedia-audiodev/errno.h> @@ -40,10 +40,10 @@ #include <VoIPILBCDecoderIntfc.h> #include <VoIPILBCEncoderIntfc.h> -/* AMR helper */ +/* AMR helper */ #include <pjmedia-codec/amr_helper.h> -/* Pack/unpack G.729 frame of S60 DSP codec, taken from: +/* Pack/unpack G.729 frame of S60 DSP codec, taken from: * http://wiki.forum.nokia.com/index.php/TSS000776_-_Payload_conversion_for_G.729_audio_format */ #include "s60_g729_bitstream.h" @@ -70,8 +70,8 @@ static pj_uint8_t vas_g711_frame_len; /* VAS factory */ - -struct vas_factory { +struct vas_factory +{ pjmedia_aud_dev_factory base; pj_pool_t *pool; pj_pool_factory *pf; @@ -80,16 +80,15 @@ struct vas_factory { /* Forward declaration of CPjAudioEngine */ - class CPjAudioEngine; /* VAS stream. */ - -struct vas_stream { +struct vas_stream +{ // Base pjmedia_aud_stream base; /**< Base class. */ - + // Pool pj_pool_t *pool; /**< Memory pool. */ @@ -112,7 +111,7 @@ struct vas_stream { pj_uint16_t rec_buf_len; /**< Record buffer length. */ void *strm_data; /**< Stream data. */ - /* Resampling is needed, in case audio device is opened with clock rate + /* Resampling is needed, in case audio device is opened with clock rate * other than 8kHz (only for PCM format). */ pjmedia_resample *play_resample; /**< Resampler for playback. */ @@ -129,37 +128,38 @@ struct vas_stream { /* Prototypes */ -static pj_status_t factory_init (pjmedia_aud_dev_factory *f); -static pj_status_t factory_destroy (pjmedia_aud_dev_factory *f); -static unsigned factory_get_dev_count (pjmedia_aud_dev_factory *f); -static pj_status_t factory_get_dev_info (pjmedia_aud_dev_factory *f, - unsigned index, - pjmedia_aud_dev_info *info); -static pj_status_t factory_default_param (pjmedia_aud_dev_factory *f, - unsigned index, - pjmedia_aud_param *param); -static pj_status_t factory_create_stream (pjmedia_aud_dev_factory *f, - const pjmedia_aud_param *param, - pjmedia_aud_rec_cb rec_cb, - pjmedia_aud_play_cb play_cb, - void *user_data, - pjmedia_aud_stream **p_aud_strm); - -static pj_status_t stream_get_param (pjmedia_aud_stream *strm, - pjmedia_aud_param *param); -static pj_status_t stream_get_cap (pjmedia_aud_stream *strm, - pjmedia_aud_dev_cap cap, - void *value); -static pj_status_t stream_set_cap (pjmedia_aud_stream *strm, - pjmedia_aud_dev_cap cap, - const void *value); -static pj_status_t stream_start (pjmedia_aud_stream *strm); -static pj_status_t stream_stop (pjmedia_aud_stream *strm); -static pj_status_t stream_destroy (pjmedia_aud_stream *strm); +static pj_status_t factory_init(pjmedia_aud_dev_factory *f); +static pj_status_t factory_destroy(pjmedia_aud_dev_factory *f); +static unsigned factory_get_dev_count(pjmedia_aud_dev_factory *f); +static pj_status_t factory_get_dev_info(pjmedia_aud_dev_factory *f, + unsigned index, + pjmedia_aud_dev_info *info); +static pj_status_t factory_default_param(pjmedia_aud_dev_factory *f, + unsigned index, + pjmedia_aud_param *param); +static pj_status_t factory_create_stream(pjmedia_aud_dev_factory *f, + const pjmedia_aud_param *param, + pjmedia_aud_rec_cb rec_cb, + pjmedia_aud_play_cb play_cb, + void *user_data, + pjmedia_aud_stream **p_aud_strm); + +static pj_status_t stream_get_param(pjmedia_aud_stream *strm, + pjmedia_aud_param *param); +static pj_status_t stream_get_cap(pjmedia_aud_stream *strm, + pjmedia_aud_dev_cap cap, + void *value); +static pj_status_t stream_set_cap(pjmedia_aud_stream *strm, + pjmedia_aud_dev_cap cap, + const void *value); +static pj_status_t stream_start(pjmedia_aud_stream *strm); +static pj_status_t stream_stop(pjmedia_aud_stream *strm); +static pj_status_t stream_destroy(pjmedia_aud_stream *strm); /* Operations */ -static pjmedia_aud_dev_factory_op factory_op = { +static pjmedia_aud_dev_factory_op factory_op = +{ &factory_init, &factory_destroy, &factory_get_dev_count, @@ -168,7 +168,8 @@ static pjmedia_aud_dev_factory_op factory_op = { &factory_create_stream }; -static pjmedia_aud_stream_op stream_op = { +static pjmedia_aud_stream_op stream_op = +{ &stream_get_param, &stream_get_cap, &stream_set_cap, @@ -185,303 +186,277 @@ static pjmedia_aud_stream_op stream_op = { /* * Utility: print sound device error */ -static void snd_perror (const char *title, TInt rc) +static void snd_perror(const char *title, TInt rc) { - PJ_LOG (1, (THIS_FILE, "%s (error code=%d)", title, rc)); + PJ_LOG(1,(THIS_FILE, "%s (error code=%d)", title, rc)); } -typedef void (*PjAudioCallback) (CVoIPDataBuffer *buf, void *user_data); +typedef void(*PjAudioCallback)(CVoIPDataBuffer *buf, void *user_data); /* * Audio setting for CPjAudioEngine. */ - class CPjAudioSetting { - - public: - TVoIPCodecFormat format; - TInt mode; - TBool plc; - TBool vad; - TBool cng; - TBool loudspk; +public: + TVoIPCodecFormat format; + TInt mode; + TBool plc; + TBool vad; + TBool cng; + TBool loudspk; }; /* * Implementation: Symbian Input & Output Stream. */ - class CPjAudioEngine : public CBase, - public MVoIPDownlinkObserver, - public MVoIPUplinkObserver, - public MVoIPFormatObserver + public MVoIPDownlinkObserver, + public MVoIPUplinkObserver, + public MVoIPFormatObserver { - - public: - enum State { - STATE_NULL, - STATE_STARTING, - STATE_READY, - STATE_STREAMING - }; - - ~CPjAudioEngine(); - - static CPjAudioEngine *NewL (struct vas_stream *parent_strm, - PjAudioCallback rec_cb, - PjAudioCallback play_cb, - void *user_data, - const CPjAudioSetting &setting); - - TInt Start(); - void Stop(); - - TInt ActivateSpeaker (TBool active); - - TInt SetVolume (TInt vol) { - return iVoIPDnlink->SetVolume (vol); - } - - TInt GetVolume() { - TInt vol; - iVoIPDnlink->GetVolume (vol); - return vol; - } - - TInt GetMaxVolume() { - TInt vol; - iVoIPDnlink->GetMaxVolume (vol); - return vol; - } - - TInt SetGain (TInt gain) { - return iVoIPUplink->SetGain (gain); - } - - TInt GetGain() { - TInt gain; - iVoIPUplink->GetGain (gain); - return gain; - } - - TInt GetMaxGain() { - TInt gain; - iVoIPUplink->GetMaxGain (gain); - return gain; - } - - private: - CPjAudioEngine (struct vas_stream *parent_strm, - PjAudioCallback rec_cb, - PjAudioCallback play_cb, - void *user_data, - const CPjAudioSetting &setting); - void ConstructL(); - - TInt InitPlay(); - TInt InitRec(); - - TInt StartPlay(); - TInt StartRec(); - - // From MVoIPDownlinkObserver - virtual void FillBuffer (const CVoIPAudioDownlinkStream& aSrc, - CVoIPDataBuffer* aBuffer); - virtual void Event (const CVoIPAudioDownlinkStream& aSrc, - TInt aEventType, - TInt aError); - - // From MVoIPUplinkObserver - virtual void EmptyBuffer (const CVoIPAudioUplinkStream& aSrc, - CVoIPDataBuffer* aBuffer); - virtual void Event (const CVoIPAudioUplinkStream& aSrc, - TInt aEventType, - TInt aError); - - // From MVoIPFormatObserver - virtual void Event (const CVoIPFormatIntfc& aSrc, TInt aEventType); - - State dn_state_; - State up_state_; - - struct vas_stream *parentStrm_; - CPjAudioSetting setting_; - PjAudioCallback rec_cb_; - PjAudioCallback play_cb_; - void *user_data_; - - // VAS objects - CVoIPUtilityFactory *iFactory; - CVoIPAudioDownlinkStream *iVoIPDnlink; - CVoIPAudioUplinkStream *iVoIPUplink; - CVoIPFormatIntfc *enc_fmt_if; - CVoIPFormatIntfc *dec_fmt_if; +public: + enum State + { + STATE_NULL, + STATE_STARTING, + STATE_READY, + STATE_STREAMING + }; + + ~CPjAudioEngine(); + + static CPjAudioEngine *NewL(struct vas_stream *parent_strm, + PjAudioCallback rec_cb, + PjAudioCallback play_cb, + void *user_data, + const CPjAudioSetting &setting); + + TInt Start(); + void Stop(); + + TInt ActivateSpeaker(TBool active); + + TInt SetVolume(TInt vol) { return iVoIPDnlink->SetVolume(vol); } + TInt GetVolume() { TInt vol;iVoIPDnlink->GetVolume(vol);return vol; } + TInt GetMaxVolume() { TInt vol;iVoIPDnlink->GetMaxVolume(vol);return vol; } + + TInt SetGain(TInt gain) { return iVoIPUplink->SetGain(gain); } + TInt GetGain() { TInt gain;iVoIPUplink->GetGain(gain);return gain; } + TInt GetMaxGain() { TInt gain;iVoIPUplink->GetMaxGain(gain);return gain; } + + TBool IsStarted(); + +private: + CPjAudioEngine(struct vas_stream *parent_strm, + PjAudioCallback rec_cb, + PjAudioCallback play_cb, + void *user_data, + const CPjAudioSetting &setting); + void ConstructL(); + + TInt InitPlay(); + TInt InitRec(); + + TInt StartPlay(); + TInt StartRec(); + + // From MVoIPDownlinkObserver + void FillBuffer(const CVoIPAudioDownlinkStream& aSrc, + CVoIPDataBuffer* aBuffer); + void Event(const CVoIPAudioDownlinkStream& aSrc, + TInt aEventType, + TInt aError); + + // From MVoIPUplinkObserver + void EmptyBuffer(const CVoIPAudioUplinkStream& aSrc, + CVoIPDataBuffer* aBuffer); + void Event(const CVoIPAudioUplinkStream& aSrc, + TInt aEventType, + TInt aError); + + // From MVoIPFormatObserver + void Event(const CVoIPFormatIntfc& aSrc, TInt aEventType); + + State dn_state_; + State up_state_; + struct vas_stream *parentStrm_; + CPjAudioSetting setting_; + PjAudioCallback rec_cb_; + PjAudioCallback play_cb_; + void *user_data_; + + // VAS objects + CVoIPUtilityFactory *iFactory; + CVoIPAudioDownlinkStream *iVoIPDnlink; + CVoIPAudioUplinkStream *iVoIPUplink; + CVoIPFormatIntfc *enc_fmt_if; + CVoIPFormatIntfc *dec_fmt_if; }; -CPjAudioEngine* CPjAudioEngine::NewL (struct vas_stream *parent_strm, - PjAudioCallback rec_cb, - PjAudioCallback play_cb, - void *user_data, - const CPjAudioSetting &setting) +CPjAudioEngine* CPjAudioEngine::NewL(struct vas_stream *parent_strm, + PjAudioCallback rec_cb, + PjAudioCallback play_cb, + void *user_data, + const CPjAudioSetting &setting) { - CPjAudioEngine* self = new (ELeave) CPjAudioEngine (parent_strm, - rec_cb, play_cb, - user_data, - setting); - CleanupStack::PushL (self); + CPjAudioEngine* self = new (ELeave) CPjAudioEngine(parent_strm, + rec_cb, play_cb, + user_data, + setting); + CleanupStack::PushL(self); self->ConstructL(); - CleanupStack::Pop (self); + CleanupStack::Pop(self); return self; } void CPjAudioEngine::ConstructL() { TInt err; - const TVersion ver (1, 0, 0); /* Not really used at this time */ + const TVersion ver(1, 0, 0); /* Not really used at this time */ - err = CVoIPUtilityFactory::CreateFactory (iFactory); - User::LeaveIfError (err); + err = CVoIPUtilityFactory::CreateFactory(iFactory); + User::LeaveIfError(err); if (parentStrm_->param.dir != PJMEDIA_DIR_CAPTURE) { - err = iFactory->CreateDownlinkStream (ver, - CVoIPUtilityFactory::EVoIPCall, - iVoIPDnlink); - User::LeaveIfError (err); + err = iFactory->CreateDownlinkStream(ver, + CVoIPUtilityFactory::EVoIPCall, + iVoIPDnlink); + User::LeaveIfError(err); } if (parentStrm_->param.dir != PJMEDIA_DIR_PLAYBACK) { - err = iFactory->CreateUplinkStream (ver, - CVoIPUtilityFactory::EVoIPCall, - iVoIPUplink); - User::LeaveIfError (err); + err = iFactory->CreateUplinkStream(ver, + CVoIPUtilityFactory::EVoIPCall, + iVoIPUplink); + User::LeaveIfError(err); } } -CPjAudioEngine::CPjAudioEngine (struct vas_stream *parent_strm, - PjAudioCallback rec_cb, - PjAudioCallback play_cb, - void *user_data, - const CPjAudioSetting &setting) - : dn_state_ (STATE_NULL), - up_state_ (STATE_NULL), - parentStrm_ (parent_strm), - setting_ (setting), - rec_cb_ (rec_cb), - play_cb_ (play_cb), - user_data_ (user_data), - iFactory (NULL), - iVoIPDnlink (NULL), - iVoIPUplink (NULL), - enc_fmt_if (NULL), - dec_fmt_if (NULL) +CPjAudioEngine::CPjAudioEngine(struct vas_stream *parent_strm, + PjAudioCallback rec_cb, + PjAudioCallback play_cb, + void *user_data, + const CPjAudioSetting &setting) + : dn_state_(STATE_NULL), + up_state_(STATE_NULL), + parentStrm_(parent_strm), + setting_(setting), + rec_cb_(rec_cb), + play_cb_(play_cb), + user_data_(user_data), + iFactory(NULL), + iVoIPDnlink(NULL), + iVoIPUplink(NULL), + enc_fmt_if(NULL), + dec_fmt_if(NULL) { } CPjAudioEngine::~CPjAudioEngine() { Stop(); - + if (iVoIPUplink) - iVoIPUplink->Close(); - + iVoIPUplink->Close(); + if (iVoIPDnlink) - iVoIPDnlink->Close(); + iVoIPDnlink->Close(); delete iVoIPDnlink; - delete iVoIPUplink; - delete iFactory; + + TRACE_((THIS_FILE, "Sound device destroyed")); +} - TRACE_ ( (THIS_FILE, "Sound device destroyed")); +TBool CPjAudioEngine::IsStarted() +{ + return ((((parentStrm_->param.dir & PJMEDIA_DIR_CAPTURE) == 0) || + up_state_ == STATE_STREAMING) && + (((parentStrm_->param.dir & PJMEDIA_DIR_PLAYBACK) == 0) || + dn_state_ == STATE_STREAMING)); } TInt CPjAudioEngine::InitPlay() { TInt err; - pj_assert (iVoIPDnlink); - - err = iVoIPDnlink->SetFormat (setting_.format, dec_fmt_if); + pj_assert(iVoIPDnlink); + err = iVoIPDnlink->SetFormat(setting_.format, dec_fmt_if); if (err != KErrNone) - return err; - - err = dec_fmt_if->SetObserver (*this); - + return err; + + err = dec_fmt_if->SetObserver(*this); if (err != KErrNone) - return err; + return err; - return iVoIPDnlink->Open (*this); + return iVoIPDnlink->Open(*this); } TInt CPjAudioEngine::InitRec() { TInt err; + + pj_assert(iVoIPUplink); - pj_assert (iVoIPUplink); - - err = iVoIPUplink->SetFormat (setting_.format, enc_fmt_if); - + err = iVoIPUplink->SetFormat(setting_.format, enc_fmt_if); if (err != KErrNone) - return err; - - err = enc_fmt_if->SetObserver (*this); - + return err; + + err = enc_fmt_if->SetObserver(*this); if (err != KErrNone) - return err; - - return iVoIPUplink->Open (*this); + return err; + + return iVoIPUplink->Open(*this); } TInt CPjAudioEngine::StartPlay() { TInt err; - - pj_assert (iVoIPDnlink); - pj_assert (dn_state_ == STATE_READY); + + pj_assert(iVoIPDnlink); + pj_assert(dn_state_ == STATE_READY); /* Configure specific codec setting */ - switch (setting_.format) { - - case EG711: { - CVoIPG711DecoderIntfc *g711dec_if = (CVoIPG711DecoderIntfc*) - dec_fmt_if; - err = g711dec_if->SetMode ( (CVoIPFormatIntfc::TG711CodecMode) - setting_.mode); - pj_assert (err == KErrNone); - } - - break; - - case EILBC: { - CVoIPILBCDecoderIntfc *ilbcdec_if = (CVoIPILBCDecoderIntfc*) - dec_fmt_if; - err = ilbcdec_if->SetMode ( (CVoIPFormatIntfc::TILBCCodecMode) - setting_.mode); - pj_assert (err == KErrNone); - } - - break; - - default: - break; + case EG711: + { + CVoIPG711DecoderIntfc *g711dec_if = (CVoIPG711DecoderIntfc*) + dec_fmt_if; + err = g711dec_if->SetMode((CVoIPFormatIntfc::TG711CodecMode) + setting_.mode); + pj_assert(err == KErrNone); + } + break; + + case EILBC: + { + CVoIPILBCDecoderIntfc *ilbcdec_if = (CVoIPILBCDecoderIntfc*) + dec_fmt_if; + err = ilbcdec_if->SetMode((CVoIPFormatIntfc::TILBCCodecMode) + setting_.mode); + pj_assert(err == KErrNone); + } + break; + + default: + break; } - + /* Configure audio routing */ - ActivateSpeaker (setting_.loudspk); + ActivateSpeaker(setting_.loudspk); /* Start player */ err = iVoIPDnlink->Start(); - + if (err == KErrNone) { - dn_state_ = STATE_STREAMING; - TRACE_ ( (THIS_FILE, "Downlink started")); + dn_state_ = STATE_STREAMING; + TRACE_((THIS_FILE, "Downlink started")); } else { - snd_perror ("Failed starting downlink", err); + snd_perror("Failed starting downlink", err); } return err; @@ -490,49 +465,47 @@ TInt CPjAudioEngine::StartPlay() TInt CPjAudioEngine::StartRec() { TInt err; - - pj_assert (iVoIPUplink); - pj_assert (up_state_ == STATE_READY); + + pj_assert(iVoIPUplink); + pj_assert(up_state_ == STATE_READY); /* Configure specific codec setting */ - switch (setting_.format) { - - case EG711: { - CVoIPG711EncoderIntfc *g711enc_if = (CVoIPG711EncoderIntfc*) - enc_fmt_if; - err = g711enc_if->SetMode ( (CVoIPFormatIntfc::TG711CodecMode) - setting_.mode); - pj_assert (err == KErrNone); - } - - break; - - case EILBC: { - CVoIPILBCEncoderIntfc *ilbcenc_if = (CVoIPILBCEncoderIntfc*) - enc_fmt_if; - err = ilbcenc_if->SetMode ( (CVoIPFormatIntfc::TILBCCodecMode) - setting_.mode); - pj_assert (err == KErrNone); - } - - break; - - default: - break; + case EG711: + { + CVoIPG711EncoderIntfc *g711enc_if = (CVoIPG711EncoderIntfc*) + enc_fmt_if; + err = g711enc_if->SetMode((CVoIPFormatIntfc::TG711CodecMode) + setting_.mode); + pj_assert(err == KErrNone); + } + break; + + case EILBC: + { + CVoIPILBCEncoderIntfc *ilbcenc_if = (CVoIPILBCEncoderIntfc*) + enc_fmt_if; + err = ilbcenc_if->SetMode((CVoIPFormatIntfc::TILBCCodecMode) + setting_.mode); + pj_assert(err == KErrNone); + } + break; + + default: + break; } - + /* Configure general codec setting */ - enc_fmt_if->SetVAD (setting_.vad); - + enc_fmt_if->SetVAD(setting_.vad); + /* Start recorder */ err = iVoIPUplink->Start(); - + if (err == KErrNone) { - up_state_ = STATE_STREAMING; - TRACE_ ( (THIS_FILE, "Uplink started")); + up_state_ = STATE_STREAMING; + TRACE_((THIS_FILE, "Uplink started")); } else { - snd_perror ("Failed starting uplink", err); + snd_perror("Failed starting uplink", err); } return err; @@ -541,49 +514,37 @@ TInt CPjAudioEngine::StartRec() TInt CPjAudioEngine::Start() { TInt err = KErrNone; - + if (iVoIPDnlink) { - switch (dn_state_) { - - case STATE_READY: - err = StartPlay(); - break; - - case STATE_NULL: - err = InitPlay(); - - if (err != KErrNone) - return err; - - dn_state_ = STATE_STARTING; - - break; - - default: - break; - } + switch(dn_state_) { + case STATE_READY: + err = StartPlay(); + break; + case STATE_NULL: + err = InitPlay(); + if (err != KErrNone) + return err; + dn_state_ = STATE_STARTING; + break; + default: + break; + } } - + if (iVoIPUplink) { - switch (up_state_) { - - case STATE_READY: - err = StartRec(); - break; - - case STATE_NULL: - err = InitRec(); - - if (err != KErrNone) - return err; - - up_state_ = STATE_STARTING; - - break; - - default: - break; - } + switch(up_state_) { + case STATE_READY: + err = StartRec(); + break; + case STATE_NULL: + err = InitRec(); + if (err != KErrNone) + return err; + up_state_ = STATE_STARTING; + break; + default: + break; + } } return err; @@ -592,147 +553,134 @@ TInt CPjAudioEngine::Start() void CPjAudioEngine::Stop() { if (iVoIPDnlink) { - switch (dn_state_) { - - case STATE_STREAMING: - iVoIPDnlink->Stop(); - dn_state_ = STATE_READY; - break; - - case STATE_STARTING: - dn_state_ = STATE_NULL; - break; - - default: - break; - } + switch(dn_state_) { + case STATE_STREAMING: + iVoIPDnlink->Stop(); + dn_state_ = STATE_READY; + break; + case STATE_STARTING: + dn_state_ = STATE_NULL; + break; + default: + break; + } } if (iVoIPUplink) { - switch (up_state_) { - - case STATE_STREAMING: - iVoIPUplink->Stop(); - up_state_ = STATE_READY; - break; - - case STATE_STARTING: - up_state_ = STATE_NULL; - break; - - default: - break; - } + switch(up_state_) { + case STATE_STREAMING: + iVoIPUplink->Stop(); + up_state_ = STATE_READY; + break; + case STATE_STARTING: + up_state_ = STATE_NULL; + break; + default: + break; + } } } -TInt CPjAudioEngine::ActivateSpeaker (TBool active) +TInt CPjAudioEngine::ActivateSpeaker(TBool active) { TInt err = KErrNotSupported; - + if (iVoIPDnlink) { - err = iVoIPDnlink->SetAudioDevice (active? - CVoIPAudioDownlinkStream::ELoudSpeaker : - CVoIPAudioDownlinkStream::EHandset); - TRACE_ ( (THIS_FILE, "Loudspeaker turned %s", (active? "on":"off"))); + err = iVoIPDnlink->SetAudioDevice(active? + CVoIPAudioDownlinkStream::ELoudSpeaker : + CVoIPAudioDownlinkStream::EHandset); + TRACE_((THIS_FILE, "Loudspeaker turned %s", (active? "on":"off"))); } - + return err; } // Callback from MVoIPDownlinkObserver -void CPjAudioEngine::FillBuffer (const CVoIPAudioDownlinkStream& aSrc, - CVoIPDataBuffer* aBuffer) +void CPjAudioEngine::FillBuffer(const CVoIPAudioDownlinkStream& aSrc, + CVoIPDataBuffer* aBuffer) { - play_cb_ (aBuffer, user_data_); - iVoIPDnlink->BufferFilled (aBuffer); + play_cb_(aBuffer, user_data_); + iVoIPDnlink->BufferFilled(aBuffer); } // Callback from MVoIPUplinkObserver -void CPjAudioEngine::EmptyBuffer (const CVoIPAudioUplinkStream& aSrc, - CVoIPDataBuffer* aBuffer) +void CPjAudioEngine::EmptyBuffer(const CVoIPAudioUplinkStream& aSrc, + CVoIPDataBuffer* aBuffer) { - rec_cb_ (aBuffer, user_data_); - iVoIPUplink->BufferEmptied (aBuffer); + rec_cb_(aBuffer, user_data_); + iVoIPUplink->BufferEmptied(aBuffer); } // Callback from MVoIPDownlinkObserver -void CPjAudioEngine::Event (const CVoIPAudioDownlinkStream& /*aSrc*/, - TInt aEventType, - TInt aError) +void CPjAudioEngine::Event(const CVoIPAudioDownlinkStream& /*aSrc*/, + TInt aEventType, + TInt aError) { switch (aEventType) { - - case MVoIPDownlinkObserver::KOpenComplete: - - if (aError == KErrNone) { - State last_state = dn_state_; - - dn_state_ = STATE_READY; - TRACE_ ( (THIS_FILE, "Downlink opened")); - - if (last_state == STATE_STARTING) - StartPlay(); - } - - break; - - case MVoIPDownlinkObserver::KDownlinkClosed: - dn_state_ = STATE_NULL; - TRACE_ ( (THIS_FILE, "Downlink closed")); - break; - - case MVoIPDownlinkObserver::KDownlinkError: - dn_state_ = STATE_READY; - snd_perror ("Downlink problem", aError); - break; - - default: - break; + case MVoIPDownlinkObserver::KOpenComplete: + if (aError == KErrNone) { + State last_state = dn_state_; + + dn_state_ = STATE_READY; + TRACE_((THIS_FILE, "Downlink opened")); + + if (last_state == STATE_STARTING) + StartPlay(); + } + break; + + case MVoIPDownlinkObserver::KDownlinkClosed: + dn_state_ = STATE_NULL; + TRACE_((THIS_FILE, "Downlink closed")); + break; + + case MVoIPDownlinkObserver::KDownlinkError: + dn_state_ = STATE_READY; + snd_perror("Downlink problem", aError); + break; + default: + break; } } // Callback from MVoIPUplinkObserver -void CPjAudioEngine::Event (const CVoIPAudioUplinkStream& /*aSrc*/, - TInt aEventType, - TInt aError) +void CPjAudioEngine::Event(const CVoIPAudioUplinkStream& /*aSrc*/, + TInt aEventType, + TInt aError) { switch (aEventType) { - - case MVoIPUplinkObserver::KOpenComplete: - - if (aError == KErrNone) { - State last_state = up_state_; - - up_state_ = STATE_READY; - TRACE_ ( (THIS_FILE, "Uplink opened")); - - if (last_state == STATE_STARTING) - StartRec(); - } - - break; - - case MVoIPUplinkObserver::KUplinkClosed: - up_state_ = STATE_NULL; - TRACE_ ( (THIS_FILE, "Uplink closed")); - break; - - case MVoIPUplinkObserver::KUplinkError: - up_state_ = STATE_READY; - snd_perror ("Uplink problem", aError); - break; - - default: - break; + case MVoIPUplinkObserver::KOpenComplete: + if (aError == KErrNone) { + State last_state = up_state_; + + up_state_ = STATE_READY; + TRACE_((THIS_FILE, "Uplink opened")); + + if (last_state == STATE_STARTING) + StartRec(); + } + break; + + case MVoIPUplinkObserver::KUplinkClosed: + up_state_ = STATE_NULL; + TRACE_((THIS_FILE, "Uplink closed")); + break; + + case MVoIPUplinkObserver::KUplinkError: + up_state_ = STATE_READY; + snd_perror("Uplink problem", aError); + break; + default: + break; } } // Callback from MVoIPFormatObserver -void CPjAudioEngine::Event (const CVoIPFormatIntfc& /*aSrc*/, - TInt /*aEventType*/) +void CPjAudioEngine::Event(const CVoIPFormatIntfc& /*aSrc*/, + TInt aEventType) { + snd_perror("Format event", aEventType); } /**************************************************************************** @@ -741,101 +689,89 @@ void CPjAudioEngine::Event (const CVoIPFormatIntfc& /*aSrc*/, #ifdef USE_NATIVE_PCM -static void RecCbPcm2 (CVoIPDataBuffer *buf, void *user_data) +static void RecCbPcm2(CVoIPDataBuffer *buf, void *user_data) { - struct vas_stream *strm = (struct vas_stream*) user_data; - TPtr8 buffer (0, 0, 0); + TPtr8 buffer(0, 0, 0); pj_int16_t *p_buf; unsigned buf_len; /* Get the buffer */ - buf->GetPayloadPtr (buffer); - + buf->GetPayloadPtr(buffer); + /* Call parent callback */ p_buf = (pj_int16_t*) buffer.Ptr(); buf_len = buffer.Length() >> 1; - while (buf_len) { - unsigned req; - - req = strm->param.samples_per_frame - strm->rec_buf_len; - - if (req > buf_len) - req = buf_len; - - pjmedia_copy_samples (strm->rec_buf + strm->rec_buf_len, p_buf, req); - - p_buf += req; - - buf_len -= req; - - strm->rec_buf_len += req; - - if (strm->rec_buf_len >= strm->param.samples_per_frame) { - pjmedia_frame f; - - f.buf = strm->rec_buf; - f.type = PJMEDIA_FRAME_TYPE_AUDIO; - f.size = strm->param.samples_per_frame << 1; - strm->rec_cb (strm->user_data, &f); - strm->rec_buf_len = 0; - } + unsigned req; + + req = strm->param.samples_per_frame - strm->rec_buf_len; + if (req > buf_len) + req = buf_len; + pjmedia_copy_samples(strm->rec_buf + strm->rec_buf_len, p_buf, req); + p_buf += req; + buf_len -= req; + strm->rec_buf_len += req; + + if (strm->rec_buf_len >= strm->param.samples_per_frame) { + pjmedia_frame f; + + f.buf = strm->rec_buf; + f.type = PJMEDIA_FRAME_TYPE_AUDIO; + f.size = strm->param.samples_per_frame << 1; + strm->rec_cb(strm->user_data, &f); + strm->rec_buf_len = 0; + } } } -static void PlayCbPcm2 (CVoIPDataBuffer *buf, void *user_data) +static void PlayCbPcm2(CVoIPDataBuffer *buf, void *user_data) { - struct vas_stream *strm = (struct vas_stream*) user_data; - TPtr8 buffer (0, 0, 0); + TPtr8 buffer(0, 0, 0); pjmedia_frame f; /* Get the buffer */ - buf->GetPayloadPtr (buffer); + buf->GetPayloadPtr(buffer); /* Call parent callback */ f.buf = strm->play_buf; f.size = strm->param.samples_per_frame << 1; - strm->play_cb (strm->user_data, &f); - + strm->play_cb(strm->user_data, &f); if (f.type != PJMEDIA_FRAME_TYPE_AUDIO) { - pjmedia_zero_samples ( (pj_int16_t*) f.buf, - strm->param.samples_per_frame); + pjmedia_zero_samples((pj_int16_t*)f.buf, + strm->param.samples_per_frame); } - f.size = strm->param.samples_per_frame << 1; /* Init buffer attributes and header. */ buffer.Zero(); - buffer.Append ( (TUint8*) f.buf, f.size); + buffer.Append((TUint8*)f.buf, f.size); /* Set the buffer */ - buf->SetPayloadPtr (buffer); + buf->SetPayloadPtr(buffer); } #else // not USE_NATIVE_PCM -static void RecCbPcm (CVoIPDataBuffer *buf, void *user_data) +static void RecCbPcm(CVoIPDataBuffer *buf, void *user_data) { - struct vas_stream *strm = (struct vas_stream*) user_data; - TPtr8 buffer (0, 0, 0); + TPtr8 buffer(0, 0, 0); /* Get the buffer */ - buf->GetPayloadPtr (buffer); - + buf->GetPayloadPtr(buffer); + /* Buffer has to contain normal speech. */ - pj_assert (buffer[0] == 1 && buffer[1] == 0); + pj_assert(buffer[0] == 1 && buffer[1] == 0); /* Detect the recorder G.711 frame size, player frame size will follow * this recorder frame size. */ - if (vas_g711_frame_len == 0) { - vas_g711_frame_len = buffer.Length() < 160? 80 : 160; - TRACE_ ( (THIS_FILE, "Detected VAS G.711 frame size = %u samples", - vas_g711_frame_len)); + vas_g711_frame_len = buffer.Length() < 160? 80 : 160; + TRACE_((THIS_FILE, "Detected VAS G.711 frame size = %u samples", + vas_g711_frame_len)); } /* Decode VAS buffer (coded in G.711) and put the PCM result into rec_buf. @@ -844,539 +780,511 @@ static void RecCbPcm (CVoIPDataBuffer *buf, void *user_data) unsigned samples_processed = 0; while (samples_processed < vas_g711_frame_len) { - unsigned samples_to_process; - unsigned samples_req; - - samples_to_process = vas_g711_frame_len - samples_processed; - samples_req = (strm->param.samples_per_frame / - strm->param.channel_count / - strm->resample_factor) - - strm->rec_buf_len; - - if (samples_to_process > samples_req) - samples_to_process = samples_req; - - pjmedia_ulaw_decode (&strm->rec_buf[strm->rec_buf_len], - buffer.Ptr() + 2 + samples_processed, - samples_to_process); - - strm->rec_buf_len += samples_to_process; - - samples_processed += samples_to_process; - - /* Buffer is full, time to call parent callback */ - if (strm->rec_buf_len == strm->param.samples_per_frame / - strm->param.channel_count / - strm->resample_factor) { - pjmedia_frame f; - - /* Need to resample clock rate? */ - - if (strm->rec_resample) { - unsigned resampled = 0; - - while (resampled < strm->rec_buf_len) { - pjmedia_resample_run (strm->rec_resample, - &strm->rec_buf[resampled], - strm->pcm_buf + - resampled * strm->resample_factor); - resampled += 80; - } - - f.buf = strm->pcm_buf; - } else { - f.buf = strm->rec_buf; - } - - /* Need to convert channel count? */ - if (strm->param.channel_count != 1) { - pjmedia_convert_channel_1ton ( (pj_int16_t*) f.buf, - (pj_int16_t*) f.buf, - strm->param.channel_count, - strm->param.samples_per_frame / - strm->param.channel_count, - 0); - } - - /* Call parent callback */ - f.type = PJMEDIA_FRAME_TYPE_AUDIO; - - f.size = strm->param.samples_per_frame << 1; - - strm->rec_cb (strm->user_data, &f); - - strm->rec_buf_len = 0; - } + unsigned samples_to_process; + unsigned samples_req; + + samples_to_process = vas_g711_frame_len - samples_processed; + samples_req = (strm->param.samples_per_frame / + strm->param.channel_count / + strm->resample_factor) - + strm->rec_buf_len; + if (samples_to_process > samples_req) + samples_to_process = samples_req; + + pjmedia_ulaw_decode(&strm->rec_buf[strm->rec_buf_len], + buffer.Ptr() + 2 + samples_processed, + samples_to_process); + + strm->rec_buf_len += samples_to_process; + samples_processed += samples_to_process; + + /* Buffer is full, time to call parent callback */ + if (strm->rec_buf_len == strm->param.samples_per_frame / + strm->param.channel_count / + strm->resample_factor) + { + pjmedia_frame f; + + /* Need to resample clock rate? */ + if (strm->rec_resample) { + unsigned resampled = 0; + + while (resampled < strm->rec_buf_len) { + pjmedia_resample_run(strm->rec_resample, + &strm->rec_buf[resampled], + strm->pcm_buf + + resampled * strm->resample_factor); + resampled += 80; + } + f.buf = strm->pcm_buf; + } else { + f.buf = strm->rec_buf; + } + + /* Need to convert channel count? */ + if (strm->param.channel_count != 1) { + pjmedia_convert_channel_1ton((pj_int16_t*)f.buf, + (pj_int16_t*)f.buf, + strm->param.channel_count, + strm->param.samples_per_frame / + strm->param.channel_count, + 0); + } + + /* Call parent callback */ + f.type = PJMEDIA_FRAME_TYPE_AUDIO; + f.size = strm->param.samples_per_frame << 1; + strm->rec_cb(strm->user_data, &f); + strm->rec_buf_len = 0; + } } } #endif // USE_NATIVE_PCM -static void PlayCbPcm (CVoIPDataBuffer *buf, void *user_data) +static void PlayCbPcm(CVoIPDataBuffer *buf, void *user_data) { - struct vas_stream *strm = (struct vas_stream*) user_data; unsigned g711_frame_len = vas_g711_frame_len; - TPtr8 buffer (0, 0, 0); + TPtr8 buffer(0, 0, 0); /* Get the buffer */ - buf->GetPayloadPtr (buffer); + buf->GetPayloadPtr(buffer); /* Init buffer attributes and header. */ buffer.Zero(); - buffer.Append (1); - buffer.Append (0); + buffer.Append(1); + buffer.Append(0); /* Assume frame size is 10ms if frame size hasn't been known. */ - if (g711_frame_len == 0) - g711_frame_len = 80; + g711_frame_len = 80; /* Call parent stream callback to get PCM samples to play, * encode the PCM samples into G.711 and put it into VAS buffer. */ unsigned samples_processed = 0; - + while (samples_processed < g711_frame_len) { - /* Need more samples to play, time to call parent callback */ - if (strm->play_buf_len == 0) { - pjmedia_frame f; - unsigned samples_got; - - f.size = strm->param.samples_per_frame << 1; - - if (strm->play_resample || strm->param.channel_count != 1) - f.buf = strm->pcm_buf; - else - f.buf = strm->play_buf; - - /* Call parent callback */ - strm->play_cb (strm->user_data, &f); - - if (f.type != PJMEDIA_FRAME_TYPE_AUDIO) { - pjmedia_zero_samples ( (pj_int16_t*) f.buf, - strm->param.samples_per_frame); - } - - samples_got = strm->param.samples_per_frame / - - strm->param.channel_count / - strm->resample_factor; - - /* Need to convert channel count? */ - - if (strm->param.channel_count != 1) { - pjmedia_convert_channel_nto1 ( (pj_int16_t*) f.buf, - (pj_int16_t*) f.buf, - strm->param.channel_count, - strm->param.samples_per_frame, - PJ_FALSE, - 0); - } - - /* Need to resample clock rate? */ - if (strm->play_resample) { - unsigned resampled = 0; - - while (resampled < samples_got) { - pjmedia_resample_run (strm->play_resample, - strm->pcm_buf + - resampled * strm->resample_factor, - &strm->play_buf[resampled]); - resampled += 80; - } - } - - strm->play_buf_len = samples_got; - - strm->play_buf_start = 0; - } - - unsigned tmp; - - tmp = PJ_MIN (strm->play_buf_len, g711_frame_len - samples_processed); - pjmedia_ulaw_encode ( (pj_uint8_t*) &strm->play_buf[strm->play_buf_start], - &strm->play_buf[strm->play_buf_start], - tmp); - buffer.Append ( (TUint8*) &strm->play_buf[strm->play_buf_start], tmp); - samples_processed += tmp; - strm->play_buf_len -= tmp; - strm->play_buf_start += tmp; + /* Need more samples to play, time to call parent callback */ + if (strm->play_buf_len == 0) { + pjmedia_frame f; + unsigned samples_got; + + f.size = strm->param.samples_per_frame << 1; + if (strm->play_resample || strm->param.channel_count != 1) + f.buf = strm->pcm_buf; + else + f.buf = strm->play_buf; + + /* Call parent callback */ + strm->play_cb(strm->user_data, &f); + if (f.type != PJMEDIA_FRAME_TYPE_AUDIO) { + pjmedia_zero_samples((pj_int16_t*)f.buf, + strm->param.samples_per_frame); + } + + samples_got = strm->param.samples_per_frame / + strm->param.channel_count / + strm->resample_factor; + + /* Need to convert channel count? */ + if (strm->param.channel_count != 1) { + pjmedia_convert_channel_nto1((pj_int16_t*)f.buf, + (pj_int16_t*)f.buf, + strm->param.channel_count, + strm->param.samples_per_frame, + PJ_FALSE, + 0); + } + + /* Need to resample clock rate? */ + if (strm->play_resample) { + unsigned resampled = 0; + + while (resampled < samples_got) + { + pjmedia_resample_run(strm->play_resample, + strm->pcm_buf + + resampled * strm->resample_factor, + &strm->play_buf[resampled]); + resampled += 80; + } + } + + strm->play_buf_len = samples_got; + strm->play_buf_start = 0; + } + + unsigned tmp; + + tmp = PJ_MIN(strm->play_buf_len, g711_frame_len - samples_processed); + pjmedia_ulaw_encode((pj_uint8_t*)&strm->play_buf[strm->play_buf_start], + &strm->play_buf[strm->play_buf_start], + tmp); + buffer.Append((TUint8*)&strm->play_buf[strm->play_buf_start], tmp); + samples_processed += tmp; + strm->play_buf_len -= tmp; + strm->play_buf_start += tmp; } /* Set the buffer */ - buf->SetPayloadPtr (buffer); + buf->SetPayloadPtr(buffer); } /**************************************************************************** * Internal VAS callbacks for non-PCM format */ -static void RecCb (CVoIPDataBuffer *buf, void *user_data) +static void RecCb(CVoIPDataBuffer *buf, void *user_data) { - struct vas_stream *strm = (struct vas_stream*) user_data; pjmedia_frame_ext *frame = (pjmedia_frame_ext*) strm->rec_buf; - TPtr8 buffer (0, 0, 0); + TPtr8 buffer(0, 0, 0); /* Get the buffer */ - buf->GetPayloadPtr (buffer); - - switch (strm->param.ext_fmt.id) { - - case PJMEDIA_FORMAT_AMR: { - const pj_uint8_t *p = (const pj_uint8_t*) buffer.Ptr() + 1; - unsigned len = buffer.Length() - 1; - - pjmedia_frame_ext_append_subframe (frame, p, len << 3, 160); - - if (frame->samples_cnt == strm->param.samples_per_frame) { - frame->base.type = PJMEDIA_FRAME_TYPE_EXTENDED; - strm->rec_cb (strm->user_data, (pjmedia_frame*) frame); - frame->samples_cnt = 0; - frame->subframe_cnt = 0; - } - } - - break; - - case PJMEDIA_FORMAT_G729: { - /* Check if we got a normal or SID frame. */ - if (buffer[0] != 0) { - enum { NORMAL_LEN = 22, SID_LEN = 8 }; - TBitStream *bitstream = (TBitStream*) strm->strm_data; - unsigned src_len = buffer.Length()- 2; - - pj_assert (src_len == NORMAL_LEN || src_len == SID_LEN); - - const TDesC8& p = bitstream->CompressG729Frame ( - buffer.Right (src_len), - src_len == SID_LEN); - - pjmedia_frame_ext_append_subframe (frame, p.Ptr(), - p.Length() << 3, 80); - } else { /* We got null frame. */ - pjmedia_frame_ext_append_subframe (frame, NULL, 0, 80); - } - - if (frame->samples_cnt == strm->param.samples_per_frame) { - frame->base.type = PJMEDIA_FRAME_TYPE_EXTENDED; - strm->rec_cb (strm->user_data, (pjmedia_frame*) frame); - frame->samples_cnt = 0; - frame->subframe_cnt = 0; - } - } - - break; - - case PJMEDIA_FORMAT_ILBC: { - unsigned samples_got; - - samples_got = strm->param.ext_fmt.bitrate == 15200? 160 : 240; - - /* Check if we got a normal or SID frame. */ - - if (buffer[0] != 0) { - const pj_uint8_t *p = (const pj_uint8_t*) buffer.Ptr() + 2; - unsigned len = buffer.Length() - 2; - - pjmedia_frame_ext_append_subframe (frame, p, len << 3, - samples_got); - } else { /* We got null frame. */ - pjmedia_frame_ext_append_subframe (frame, NULL, 0, samples_got); - } - - if (frame->samples_cnt == strm->param.samples_per_frame) { - frame->base.type = PJMEDIA_FRAME_TYPE_EXTENDED; - strm->rec_cb (strm->user_data, (pjmedia_frame*) frame); - frame->samples_cnt = 0; - frame->subframe_cnt = 0; - } - } - - break; - - case PJMEDIA_FORMAT_PCMU: - - case PJMEDIA_FORMAT_PCMA: { - unsigned samples_processed = 0; - - /* Make sure it is normal frame. */ - pj_assert (buffer[0] == 1 && buffer[1] == 0); - - /* Detect the recorder G.711 frame size, player frame size will - * follow this recorder frame size. - */ - - if (vas_g711_frame_len == 0) { - vas_g711_frame_len = buffer.Length() < 160? 80 : 160; - TRACE_ ( (THIS_FILE, "Detected VAS G.711 frame size = %u samples", - vas_g711_frame_len)); - } - - /* Convert VAS buffer format into pjmedia_frame_ext. Whenever - * samples count in the frame is equal to stream's samples per - * frame, call parent stream callback. - */ - while (samples_processed < vas_g711_frame_len) { - unsigned tmp; - const pj_uint8_t *pb = (const pj_uint8_t*) buffer.Ptr() + - 2 + samples_processed; - - tmp = PJ_MIN (strm->param.samples_per_frame - frame->samples_cnt, - vas_g711_frame_len - samples_processed); - - pjmedia_frame_ext_append_subframe (frame, pb, tmp << 3, tmp); - samples_processed += tmp; - - if (frame->samples_cnt == strm->param.samples_per_frame) { - frame->base.type = PJMEDIA_FRAME_TYPE_EXTENDED; - strm->rec_cb (strm->user_data, (pjmedia_frame*) frame); - frame->samples_cnt = 0; - frame->subframe_cnt = 0; - } - } - } - - break; - - default: - break; + buf->GetPayloadPtr(buffer); + + switch(strm->param.ext_fmt.id) { + case PJMEDIA_FORMAT_AMR: + { + const pj_uint8_t *p = (const pj_uint8_t*)buffer.Ptr() + 1; + unsigned len = buffer.Length() - 1; + + pjmedia_frame_ext_append_subframe(frame, p, len << 3, 160); + if (frame->samples_cnt == strm->param.samples_per_frame) { + frame->base.type = PJMEDIA_FRAME_TYPE_EXTENDED; + strm->rec_cb(strm->user_data, (pjmedia_frame*)frame); + frame->samples_cnt = 0; + frame->subframe_cnt = 0; + } + } + break; + + case PJMEDIA_FORMAT_G729: + { + /* Check if we got a normal or SID frame. */ + if (buffer[0] != 0) { + enum { NORMAL_LEN = 22, SID_LEN = 8 }; + TBitStream *bitstream = (TBitStream*)strm->strm_data; + unsigned src_len = buffer.Length()- 2; + + pj_assert(src_len == NORMAL_LEN || src_len == SID_LEN); + + const TDesC8& p = bitstream->CompressG729Frame( + buffer.Right(src_len), + src_len == SID_LEN); + + pjmedia_frame_ext_append_subframe(frame, p.Ptr(), + p.Length() << 3, 80); + } else { /* We got null frame. */ + pjmedia_frame_ext_append_subframe(frame, NULL, 0, 80); + } + + if (frame->samples_cnt == strm->param.samples_per_frame) { + frame->base.type = PJMEDIA_FRAME_TYPE_EXTENDED; + strm->rec_cb(strm->user_data, (pjmedia_frame*)frame); + frame->samples_cnt = 0; + frame->subframe_cnt = 0; + } + } + break; + + case PJMEDIA_FORMAT_ILBC: + { + unsigned samples_got; + + samples_got = strm->param.ext_fmt.bitrate == 15200? 160 : 240; + + /* Check if we got a normal or SID frame. */ + if (buffer[0] != 0) { + const pj_uint8_t *p = (const pj_uint8_t*)buffer.Ptr() + 2; + unsigned len = buffer.Length() - 2; + + pjmedia_frame_ext_append_subframe(frame, p, len << 3, + samples_got); + } else { /* We got null frame. */ + pjmedia_frame_ext_append_subframe(frame, NULL, 0, samples_got); + } + + if (frame->samples_cnt == strm->param.samples_per_frame) { + frame->base.type = PJMEDIA_FRAME_TYPE_EXTENDED; + strm->rec_cb(strm->user_data, (pjmedia_frame*)frame); + frame->samples_cnt = 0; + frame->subframe_cnt = 0; + } + } + break; + + case PJMEDIA_FORMAT_PCMU: + case PJMEDIA_FORMAT_PCMA: + { + unsigned samples_processed = 0; + + /* Make sure it is normal frame. */ + pj_assert(buffer[0] == 1 && buffer[1] == 0); + + /* Detect the recorder G.711 frame size, player frame size will + * follow this recorder frame size. + */ + if (vas_g711_frame_len == 0) { + vas_g711_frame_len = buffer.Length() < 160? 80 : 160; + TRACE_((THIS_FILE, "Detected VAS G.711 frame size = %u samples", + vas_g711_frame_len)); + } + + /* Convert VAS buffer format into pjmedia_frame_ext. Whenever + * samples count in the frame is equal to stream's samples per + * frame, call parent stream callback. + */ + while (samples_processed < vas_g711_frame_len) { + unsigned tmp; + const pj_uint8_t *pb = (const pj_uint8_t*)buffer.Ptr() + + 2 + samples_processed; + + tmp = PJ_MIN(strm->param.samples_per_frame - frame->samples_cnt, + vas_g711_frame_len - samples_processed); + + pjmedia_frame_ext_append_subframe(frame, pb, tmp << 3, tmp); + samples_processed += tmp; + + if (frame->samples_cnt == strm->param.samples_per_frame) { + frame->base.type = PJMEDIA_FRAME_TYPE_EXTENDED; + strm->rec_cb(strm->user_data, (pjmedia_frame*)frame); + frame->samples_cnt = 0; + frame->subframe_cnt = 0; + } + } + } + break; + + default: + break; } } -static void PlayCb (CVoIPDataBuffer *buf, void *user_data) +static void PlayCb(CVoIPDataBuffer *buf, void *user_data) { - struct vas_stream *strm = (struct vas_stream*) user_data; pjmedia_frame_ext *frame = (pjmedia_frame_ext*) strm->play_buf; - TPtr8 buffer (0, 0, 0); + TPtr8 buffer(0, 0, 0); /* Get the buffer */ - buf->GetPayloadPtr (buffer); + buf->GetPayloadPtr(buffer); /* Init buffer attributes and header. */ buffer.Zero(); - switch (strm->param.ext_fmt.id) { - - case PJMEDIA_FORMAT_AMR: { - if (frame->samples_cnt == 0) { - frame->base.type = PJMEDIA_FRAME_TYPE_EXTENDED; - strm->play_cb (strm->user_data, (pjmedia_frame*) frame); - pj_assert (frame->base.type==PJMEDIA_FRAME_TYPE_EXTENDED || - frame->base.type==PJMEDIA_FRAME_TYPE_NONE); - } - - if (frame->base.type == PJMEDIA_FRAME_TYPE_EXTENDED) { - pjmedia_frame_ext_subframe *sf; - unsigned samples_cnt; - - sf = pjmedia_frame_ext_get_subframe (frame, 0); - samples_cnt = frame->samples_cnt / frame->subframe_cnt; - - if (sf->data && sf->bitlen) { - /* AMR header for VAS is one byte, the format (may be!): - * 0xxxxy00, where xxxx:frame type, y:not sure. - */ - unsigned len = (sf->bitlen+7) >>3; - enum {SID_FT = 8 }; - pj_uint8_t amr_header = 4, ft = SID_FT; - - if (len >= pjmedia_codec_amrnb_framelen[0]) - ft = pjmedia_codec_amr_get_mode2 (PJ_TRUE, len); - - amr_header |= ft << 3; - - buffer.Append (amr_header); - - buffer.Append ( (TUint8*) sf->data, len); - } else { - buffer.Append (0); - } - - pjmedia_frame_ext_pop_subframes (frame, 1); - - } else { /* PJMEDIA_FRAME_TYPE_NONE */ - buffer.Append (0); - - frame->samples_cnt = 0; - frame->subframe_cnt = 0; - } - } - - break; - - case PJMEDIA_FORMAT_G729: { - if (frame->samples_cnt == 0) { - frame->base.type = PJMEDIA_FRAME_TYPE_EXTENDED; - strm->play_cb (strm->user_data, (pjmedia_frame*) frame); - pj_assert (frame->base.type==PJMEDIA_FRAME_TYPE_EXTENDED || - frame->base.type==PJMEDIA_FRAME_TYPE_NONE); - } - - if (frame->base.type == PJMEDIA_FRAME_TYPE_EXTENDED) { - pjmedia_frame_ext_subframe *sf; - unsigned samples_cnt; - - sf = pjmedia_frame_ext_get_subframe (frame, 0); - samples_cnt = frame->samples_cnt / frame->subframe_cnt; - - if (sf->data && sf->bitlen) { - enum { NORMAL_LEN = 10, SID_LEN = 2 }; - pj_bool_t sid_frame = ( (sf->bitlen >> 3) == SID_LEN); - TBitStream *bitstream = (TBitStream*) strm->strm_data; - const TPtrC8 src (sf->data, sf->bitlen>>3); - const TDesC8 &dst = bitstream->ExpandG729Frame (src, - sid_frame); - - if (sid_frame) { - buffer.Append (2); - buffer.Append (0); - } else { - buffer.Append (1); - buffer.Append (0); - } - - buffer.Append (dst); - } else { - buffer.Append (2); - buffer.Append (0); - - buffer.AppendFill (0, 22); - } - - pjmedia_frame_ext_pop_subframes (frame, 1); - - } else { /* PJMEDIA_FRAME_TYPE_NONE */ - buffer.Append (2); - buffer.Append (0); - - buffer.AppendFill (0, 22); - } - } - - break; - - case PJMEDIA_FORMAT_ILBC: { - if (frame->samples_cnt == 0) { - frame->base.type = PJMEDIA_FRAME_TYPE_EXTENDED; - strm->play_cb (strm->user_data, (pjmedia_frame*) frame); - pj_assert (frame->base.type==PJMEDIA_FRAME_TYPE_EXTENDED || - frame->base.type==PJMEDIA_FRAME_TYPE_NONE); - } - - if (frame->base.type == PJMEDIA_FRAME_TYPE_EXTENDED) { - pjmedia_frame_ext_subframe *sf; - unsigned samples_cnt; - - sf = pjmedia_frame_ext_get_subframe (frame, 0); - samples_cnt = frame->samples_cnt / frame->subframe_cnt; - - pj_assert ( (strm->param.ext_fmt.bitrate == 15200 && - samples_cnt == 160) || - (strm->param.ext_fmt.bitrate != 15200 && - samples_cnt == 240)); - - if (sf->data && sf->bitlen) { - buffer.Append (1); - buffer.Append (0); - buffer.Append ( (TUint8*) sf->data, sf->bitlen>>3); - } else { - unsigned frame_len; - - buffer.Append (1); - buffer.Append (0); - - /* VAS iLBC frame is 20ms or 30ms */ - frame_len = strm->param.ext_fmt.bitrate == 15200? 38 : 50; - buffer.AppendFill (0, frame_len); - } - - pjmedia_frame_ext_pop_subframes (frame, 1); - - } else { /* PJMEDIA_FRAME_TYPE_NONE */ - - unsigned frame_len; - - buffer.Append (1); - buffer.Append (0); - - /* VAS iLBC frame is 20ms or 30ms */ - frame_len = strm->param.ext_fmt.bitrate == 15200? 38 : 50; - buffer.AppendFill (0, frame_len); - - } - } - - break; - - case PJMEDIA_FORMAT_PCMU: - - case PJMEDIA_FORMAT_PCMA: { - unsigned samples_ready = 0; - unsigned samples_req = vas_g711_frame_len; - - /* Assume frame size is 10ms if frame size hasn't been known. */ - - if (samples_req == 0) - samples_req = 80; - - buffer.Append (1); - - buffer.Append (0); - - /* Call parent stream callback to get samples to play. */ - while (samples_ready < samples_req) { - if (frame->samples_cnt == 0) { - frame->base.type = PJMEDIA_FRAME_TYPE_EXTENDED; - strm->play_cb (strm->user_data, (pjmedia_frame*) frame); - pj_assert (frame->base.type==PJMEDIA_FRAME_TYPE_EXTENDED || - frame->base.type==PJMEDIA_FRAME_TYPE_NONE); - } - - if (frame->base.type == PJMEDIA_FRAME_TYPE_EXTENDED) { - pjmedia_frame_ext_subframe *sf; - unsigned samples_cnt; - - sf = pjmedia_frame_ext_get_subframe (frame, 0); - samples_cnt = frame->samples_cnt / frame->subframe_cnt; - - if (sf->data && sf->bitlen) { - buffer.Append ( (TUint8*) sf->data, sf->bitlen>>3); - } else { - pj_uint8_t silc; - silc = (strm->param.ext_fmt.id==PJMEDIA_FORMAT_PCMU) ? - pjmedia_linear2ulaw (0) : pjmedia_linear2alaw (0); - buffer.AppendFill (silc, samples_cnt); - } - - samples_ready += samples_cnt; - - pjmedia_frame_ext_pop_subframes (frame, 1); - - } else { /* PJMEDIA_FRAME_TYPE_NONE */ - pj_uint8_t silc; - - silc = (strm->param.ext_fmt.id==PJMEDIA_FORMAT_PCMU) ? - pjmedia_linear2ulaw (0) : pjmedia_linear2alaw (0); - buffer.AppendFill (silc, samples_req - samples_ready); - - samples_ready = samples_req; - frame->samples_cnt = 0; - frame->subframe_cnt = 0; - } - } - } - - break; - - default: - break; + switch(strm->param.ext_fmt.id) { + case PJMEDIA_FORMAT_AMR: + { + if (frame->samples_cnt == 0) { + frame->base.type = PJMEDIA_FRAME_TYPE_EXTENDED; + strm->play_cb(strm->user_data, (pjmedia_frame*)frame); + pj_assert(frame->base.type==PJMEDIA_FRAME_TYPE_EXTENDED || + frame->base.type==PJMEDIA_FRAME_TYPE_NONE); + } + + if (frame->base.type == PJMEDIA_FRAME_TYPE_EXTENDED) { + pjmedia_frame_ext_subframe *sf; + unsigned samples_cnt; + + sf = pjmedia_frame_ext_get_subframe(frame, 0); + samples_cnt = frame->samples_cnt / frame->subframe_cnt; + + if (sf->data && sf->bitlen) { + /* AMR header for VAS is one byte, the format (may be!): + * 0xxxxy00, where xxxx:frame type, y:not sure. + */ + unsigned len = (sf->bitlen+7)>>3; + enum {SID_FT = 8 }; + pj_uint8_t amr_header = 4, ft = SID_FT; + + if (len >= pjmedia_codec_amrnb_framelen[0]) + ft = pjmedia_codec_amr_get_mode2(PJ_TRUE, len); + + amr_header |= ft << 3; + buffer.Append(amr_header); + + buffer.Append((TUint8*)sf->data, len); + } else { + buffer.Append(0); + } + + pjmedia_frame_ext_pop_subframes(frame, 1); + + } else { /* PJMEDIA_FRAME_TYPE_NONE */ + buffer.Append(0); + + frame->samples_cnt = 0; + frame->subframe_cnt = 0; + } + } + break; + + case PJMEDIA_FORMAT_G729: + { + if (frame->samples_cnt == 0) { + frame->base.type = PJMEDIA_FRAME_TYPE_EXTENDED; + strm->play_cb(strm->user_data, (pjmedia_frame*)frame); + pj_assert(frame->base.type==PJMEDIA_FRAME_TYPE_EXTENDED || + frame->base.type==PJMEDIA_FRAME_TYPE_NONE); + } + + if (frame->base.type == PJMEDIA_FRAME_TYPE_EXTENDED) { + pjmedia_frame_ext_subframe *sf; + unsigned samples_cnt; + + sf = pjmedia_frame_ext_get_subframe(frame, 0); + samples_cnt = frame->samples_cnt / frame->subframe_cnt; + + if (sf->data && sf->bitlen) { + enum { NORMAL_LEN = 10, SID_LEN = 2 }; + pj_bool_t sid_frame = ((sf->bitlen >> 3) == SID_LEN); + TBitStream *bitstream = (TBitStream*)strm->strm_data; + const TPtrC8 src(sf->data, sf->bitlen>>3); + const TDesC8 &dst = bitstream->ExpandG729Frame(src, + sid_frame); + if (sid_frame) { + buffer.Append(2); + buffer.Append(0); + } else { + buffer.Append(1); + buffer.Append(0); + } + buffer.Append(dst); + } else { + buffer.Append(2); + buffer.Append(0); + + buffer.AppendFill(0, 22); + } + + pjmedia_frame_ext_pop_subframes(frame, 1); + + } else { /* PJMEDIA_FRAME_TYPE_NONE */ + buffer.Append(2); + buffer.Append(0); + + buffer.AppendFill(0, 22); + } + } + break; + + case PJMEDIA_FORMAT_ILBC: + { + if (frame->samples_cnt == 0) { + frame->base.type = PJMEDIA_FRAME_TYPE_EXTENDED; + strm->play_cb(strm->user_data, (pjmedia_frame*)frame); + pj_assert(frame->base.type==PJMEDIA_FRAME_TYPE_EXTENDED || + frame->base.type==PJMEDIA_FRAME_TYPE_NONE); + } + + if (frame->base.type == PJMEDIA_FRAME_TYPE_EXTENDED) { + pjmedia_frame_ext_subframe *sf; + unsigned samples_cnt; + + sf = pjmedia_frame_ext_get_subframe(frame, 0); + samples_cnt = frame->samples_cnt / frame->subframe_cnt; + + pj_assert((strm->param.ext_fmt.bitrate == 15200 && + samples_cnt == 160) || + (strm->param.ext_fmt.bitrate != 15200 && + samples_cnt == 240)); + + if (sf->data && sf->bitlen) { + buffer.Append(1); + buffer.Append(0); + buffer.Append((TUint8*)sf->data, sf->bitlen>>3); + } else { + unsigned frame_len; + + buffer.Append(1); + buffer.Append(0); + + /* VAS iLBC frame is 20ms or 30ms */ + frame_len = strm->param.ext_fmt.bitrate == 15200? 38 : 50; + buffer.AppendFill(0, frame_len); + } + + pjmedia_frame_ext_pop_subframes(frame, 1); + + } else { /* PJMEDIA_FRAME_TYPE_NONE */ + + unsigned frame_len; + + buffer.Append(1); + buffer.Append(0); + + /* VAS iLBC frame is 20ms or 30ms */ + frame_len = strm->param.ext_fmt.bitrate == 15200? 38 : 50; + buffer.AppendFill(0, frame_len); + + } + } + break; + + case PJMEDIA_FORMAT_PCMU: + case PJMEDIA_FORMAT_PCMA: + { + unsigned samples_ready = 0; + unsigned samples_req = vas_g711_frame_len; + + /* Assume frame size is 10ms if frame size hasn't been known. */ + if (samples_req == 0) + samples_req = 80; + + buffer.Append(1); + buffer.Append(0); + + /* Call parent stream callback to get samples to play. */ + while (samples_ready < samples_req) { + if (frame->samples_cnt == 0) { + frame->base.type = PJMEDIA_FRAME_TYPE_EXTENDED; + strm->play_cb(strm->user_data, (pjmedia_frame*)frame); + pj_assert(frame->base.type==PJMEDIA_FRAME_TYPE_EXTENDED || + frame->base.type==PJMEDIA_FRAME_TYPE_NONE); + } + + if (frame->base.type == PJMEDIA_FRAME_TYPE_EXTENDED) { + pjmedia_frame_ext_subframe *sf; + unsigned samples_cnt; + + sf = pjmedia_frame_ext_get_subframe(frame, 0); + samples_cnt = frame->samples_cnt / frame->subframe_cnt; + if (sf->data && sf->bitlen) { + buffer.Append((TUint8*)sf->data, sf->bitlen>>3); + } else { + pj_uint8_t silc; + silc = (strm->param.ext_fmt.id==PJMEDIA_FORMAT_PCMU)? + pjmedia_linear2ulaw(0) : pjmedia_linear2alaw(0); + buffer.AppendFill(silc, samples_cnt); + } + samples_ready += samples_cnt; + + pjmedia_frame_ext_pop_subframes(frame, 1); + + } else { /* PJMEDIA_FRAME_TYPE_NONE */ + pj_uint8_t silc; + + silc = (strm->param.ext_fmt.id==PJMEDIA_FORMAT_PCMU)? + pjmedia_linear2ulaw(0) : pjmedia_linear2alaw(0); + buffer.AppendFill(silc, samples_req - samples_ready); + + samples_ready = samples_req; + frame->samples_cnt = 0; + frame->subframe_cnt = 0; + } + } + } + break; + + default: + break; } /* Set the buffer */ - buf->SetPayloadPtr (buffer); + buf->SetPayloadPtr(buffer); } @@ -1388,20 +1296,19 @@ static void PlayCb (CVoIPDataBuffer *buf, void *user_data) * C compatible declaration of VAS factory. */ PJ_BEGIN_DECL -PJ_DECL (pjmedia_aud_dev_factory*) pjmedia_symb_vas_factory (pj_pool_factory *pf); +PJ_DECL(pjmedia_aud_dev_factory*)pjmedia_symb_vas_factory(pj_pool_factory *pf); PJ_END_DECL /* * Init VAS audio driver. */ -PJ_DEF (pjmedia_aud_dev_factory*) pjmedia_symb_vas_factory (pj_pool_factory *pf) +PJ_DEF(pjmedia_aud_dev_factory*) pjmedia_symb_vas_factory(pj_pool_factory *pf) { - struct vas_factory *f; pj_pool_t *pool; - pool = pj_pool_create (pf, "VAS", 1000, 1000, NULL); - f = PJ_POOL_ZALLOC_T (pool, struct vas_factory); + pool = pj_pool_create(pf, "VAS", 1000, 1000, NULL); + f = PJ_POOL_ZALLOC_T(pool, struct vas_factory); f->pf = pf; f->pool = pool; f->base.op = &factory_op; @@ -1410,185 +1317,171 @@ PJ_DEF (pjmedia_aud_dev_factory*) pjmedia_symb_vas_factory (pj_pool_factory *pf) } /* API: init factory */ -static pj_status_t factory_init (pjmedia_aud_dev_factory *f) +static pj_status_t factory_init(pjmedia_aud_dev_factory *f) { - - struct vas_factory *af = (struct vas_factory*) f; - CVoIPUtilityFactory *vas_factory; + struct vas_factory *af = (struct vas_factory*)f; + CVoIPUtilityFactory *vas_factory_; CVoIPAudioUplinkStream *vas_uplink; CVoIPAudioDownlinkStream *vas_dnlink; RArray<TVoIPCodecFormat> uplink_formats, dnlink_formats; unsigned ext_fmt_cnt = 0; - TVersion vas_version (1, 0, 0); /* Not really used at this time */ + TVersion vas_version(1, 0, 0); /* Not really used at this time */ TInt err; - pj_ansi_strcpy (af->dev_info.name, "S60 VAS"); + pj_ansi_strcpy(af->dev_info.name, "S60 VAS"); af->dev_info.default_samples_per_sec = 8000; af->dev_info.caps = PJMEDIA_AUD_DEV_CAP_EXT_FORMAT | - //PJMEDIA_AUD_DEV_CAP_INPUT_VOLUME_SETTING | - PJMEDIA_AUD_DEV_CAP_OUTPUT_VOLUME_SETTING | - PJMEDIA_AUD_DEV_CAP_OUTPUT_ROUTE | - PJMEDIA_AUD_DEV_CAP_VAD | - PJMEDIA_AUD_DEV_CAP_CNG; - af->dev_info.routes = PJMEDIA_AUD_DEV_ROUTE_EARPIECE | - PJMEDIA_AUD_DEV_ROUTE_LOUDSPEAKER; + //PJMEDIA_AUD_DEV_CAP_INPUT_VOLUME_SETTING | + PJMEDIA_AUD_DEV_CAP_OUTPUT_VOLUME_SETTING | + PJMEDIA_AUD_DEV_CAP_OUTPUT_ROUTE | + PJMEDIA_AUD_DEV_CAP_VAD | + PJMEDIA_AUD_DEV_CAP_CNG; + af->dev_info.routes = PJMEDIA_AUD_DEV_ROUTE_EARPIECE | + PJMEDIA_AUD_DEV_ROUTE_LOUDSPEAKER; af->dev_info.input_count = 1; af->dev_info.output_count = 1; af->dev_info.ext_fmt_cnt = 0; /* Enumerate supported formats */ - err = CVoIPUtilityFactory::CreateFactory (vas_factory); - + err = CVoIPUtilityFactory::CreateFactory(vas_factory_); if (err != KErrNone) - goto on_error; + goto on_error; - /* On VAS 2.0, uplink & downlink stream should be instantiated before + /* On VAS 2.0, uplink & downlink stream should be instantiated before * querying formats. */ - err = vas_factory->CreateUplinkStream (vas_version, - CVoIPUtilityFactory::EVoIPCall, - vas_uplink); - + err = vas_factory_->CreateUplinkStream(vas_version, + CVoIPUtilityFactory::EVoIPCall, + vas_uplink); if (err != KErrNone) - goto on_error; - - err = vas_factory->CreateDownlinkStream (vas_version, - CVoIPUtilityFactory::EVoIPCall, - vas_dnlink); - + goto on_error; + + err = vas_factory_->CreateDownlinkStream(vas_version, + CVoIPUtilityFactory::EVoIPCall, + vas_dnlink); if (err != KErrNone) - goto on_error; - + goto on_error; + uplink_formats.Reset(); - - err = vas_factory->GetSupportedUplinkFormats (uplink_formats); - + err = vas_factory_->GetSupportedUplinkFormats(uplink_formats); if (err != KErrNone) - goto on_error; + goto on_error; dnlink_formats.Reset(); - - err = vas_factory->GetSupportedDownlinkFormats (dnlink_formats); - + err = vas_factory_->GetSupportedDownlinkFormats(dnlink_formats); if (err != KErrNone) - goto on_error; + goto on_error; /* Free the streams, they are just used for querying formats */ delete vas_uplink; - vas_uplink = NULL; - delete vas_dnlink; - vas_dnlink = NULL; - + delete vas_factory_; + vas_factory_ = NULL; + for (TInt i = 0; i < dnlink_formats.Count(); i++) { - /* Format must be supported by both downlink & uplink. */ - if (uplink_formats.Find (dnlink_formats[i]) == KErrNotFound) - continue; - - switch (dnlink_formats[i]) { - - case EAMR_NB: - af->dev_info.ext_fmt[ext_fmt_cnt].id = PJMEDIA_FORMAT_AMR; - af->dev_info.ext_fmt[ext_fmt_cnt].bitrate = 7400; - af->dev_info.ext_fmt[ext_fmt_cnt].vad = PJ_TRUE; - break; - - case EG729: - af->dev_info.ext_fmt[ext_fmt_cnt].id = PJMEDIA_FORMAT_G729; - af->dev_info.ext_fmt[ext_fmt_cnt].bitrate = 8000; - af->dev_info.ext_fmt[ext_fmt_cnt].vad = PJ_FALSE; - break; - - case EILBC: - af->dev_info.ext_fmt[ext_fmt_cnt].id = PJMEDIA_FORMAT_ILBC; - af->dev_info.ext_fmt[ext_fmt_cnt].bitrate = 13333; - af->dev_info.ext_fmt[ext_fmt_cnt].vad = PJ_TRUE; - break; - - case EG711: + /* Format must be supported by both downlink & uplink. */ + if (uplink_formats.Find(dnlink_formats[i]) == KErrNotFound) + continue; + + switch (dnlink_formats[i]) { + case EAMR_NB: + af->dev_info.ext_fmt[ext_fmt_cnt].id = PJMEDIA_FORMAT_AMR; + af->dev_info.ext_fmt[ext_fmt_cnt].bitrate = 7400; + af->dev_info.ext_fmt[ext_fmt_cnt].vad = PJ_TRUE; + break; + + case EG729: + af->dev_info.ext_fmt[ext_fmt_cnt].id = PJMEDIA_FORMAT_G729; + af->dev_info.ext_fmt[ext_fmt_cnt].bitrate = 8000; + af->dev_info.ext_fmt[ext_fmt_cnt].vad = PJ_FALSE; + break; + + case EILBC: + af->dev_info.ext_fmt[ext_fmt_cnt].id = PJMEDIA_FORMAT_ILBC; + af->dev_info.ext_fmt[ext_fmt_cnt].bitrate = 13333; + af->dev_info.ext_fmt[ext_fmt_cnt].vad = PJ_TRUE; + break; + + case EG711: #if PJMEDIA_AUDIO_DEV_SYMB_VAS_VERSION==2 - - case EG711_10MS: + case EG711_10MS: #endif - af->dev_info.ext_fmt[ext_fmt_cnt].id = PJMEDIA_FORMAT_PCMU; - af->dev_info.ext_fmt[ext_fmt_cnt].bitrate = 64000; - af->dev_info.ext_fmt[ext_fmt_cnt].vad = PJ_FALSE; - ++ext_fmt_cnt; - af->dev_info.ext_fmt[ext_fmt_cnt].id = PJMEDIA_FORMAT_PCMA; - af->dev_info.ext_fmt[ext_fmt_cnt].bitrate = 64000; - af->dev_info.ext_fmt[ext_fmt_cnt].vad = PJ_FALSE; - break; - - default: - continue; - } - - ++ext_fmt_cnt; + af->dev_info.ext_fmt[ext_fmt_cnt].id = PJMEDIA_FORMAT_PCMU; + af->dev_info.ext_fmt[ext_fmt_cnt].bitrate = 64000; + af->dev_info.ext_fmt[ext_fmt_cnt].vad = PJ_FALSE; + ++ext_fmt_cnt; + af->dev_info.ext_fmt[ext_fmt_cnt].id = PJMEDIA_FORMAT_PCMA; + af->dev_info.ext_fmt[ext_fmt_cnt].bitrate = 64000; + af->dev_info.ext_fmt[ext_fmt_cnt].vad = PJ_FALSE; + break; + + default: + continue; + } + + ++ext_fmt_cnt; } - + af->dev_info.ext_fmt_cnt = ext_fmt_cnt; uplink_formats.Close(); dnlink_formats.Close(); - - PJ_LOG (3, (THIS_FILE, "VAS initialized")); + + PJ_LOG(3, (THIS_FILE, "VAS initialized")); return PJ_SUCCESS; - + on_error: - return PJ_RETURN_OS_ERROR (err); + return PJ_RETURN_OS_ERROR(err); } /* API: destroy factory */ -static pj_status_t factory_destroy (pjmedia_aud_dev_factory *f) +static pj_status_t factory_destroy(pjmedia_aud_dev_factory *f) { - - struct vas_factory *af = (struct vas_factory*) f; + struct vas_factory *af = (struct vas_factory*)f; pj_pool_t *pool = af->pool; af->pool = NULL; - pj_pool_release (pool); - - PJ_LOG (3, (THIS_FILE, "VAS destroyed")); + pj_pool_release(pool); + PJ_LOG(3, (THIS_FILE, "VAS destroyed")); + return PJ_SUCCESS; } /* API: get number of devices */ -static unsigned factory_get_dev_count (pjmedia_aud_dev_factory *f) +static unsigned factory_get_dev_count(pjmedia_aud_dev_factory *f) { - PJ_UNUSED_ARG (f); + PJ_UNUSED_ARG(f); return 1; } /* API: get device info */ -static pj_status_t factory_get_dev_info (pjmedia_aud_dev_factory *f, - unsigned index, - pjmedia_aud_dev_info *info) +static pj_status_t factory_get_dev_info(pjmedia_aud_dev_factory *f, + unsigned index, + pjmedia_aud_dev_info *info) { + struct vas_factory *af = (struct vas_factory*)f; - struct vas_factory *af = (struct vas_factory*) f; - - PJ_ASSERT_RETURN (index == 0, PJMEDIA_EAUD_INVDEV); + PJ_ASSERT_RETURN(index == 0, PJMEDIA_EAUD_INVDEV); - pj_memcpy (info, &af->dev_info, sizeof (*info)); + pj_memcpy(info, &af->dev_info, sizeof(*info)); return PJ_SUCCESS; } /* API: create default device parameter */ -static pj_status_t factory_default_param (pjmedia_aud_dev_factory *f, - unsigned index, - pjmedia_aud_param *param) +static pj_status_t factory_default_param(pjmedia_aud_dev_factory *f, + unsigned index, + pjmedia_aud_param *param) { + struct vas_factory *af = (struct vas_factory*)f; - struct vas_factory *af = (struct vas_factory*) f; + PJ_ASSERT_RETURN(index == 0, PJMEDIA_EAUD_INVDEV); - PJ_ASSERT_RETURN (index == 0, PJMEDIA_EAUD_INVDEV); - - pj_bzero (param, sizeof (*param)); + pj_bzero(param, sizeof(*param)); param->dir = PJMEDIA_DIR_CAPTURE_PLAYBACK; param->rec_id = index; param->play_id = index; @@ -1604,17 +1497,15 @@ static pj_status_t factory_default_param (pjmedia_aud_dev_factory *f, /* API: create stream */ -static pj_status_t factory_create_stream (pjmedia_aud_dev_factory *f, - const pjmedia_aud_param *param, - pjmedia_aud_rec_cb rec_cb, - pjmedia_aud_play_cb play_cb, - void *user_data, - pjmedia_aud_stream **p_aud_strm) +static pj_status_t factory_create_stream(pjmedia_aud_dev_factory *f, + const pjmedia_aud_param *param, + pjmedia_aud_rec_cb rec_cb, + pjmedia_aud_play_cb play_cb, + void *user_data, + pjmedia_aud_stream **p_aud_strm) { - - struct vas_factory *af = (struct vas_factory*) f; + struct vas_factory *af = (struct vas_factory*)f; pj_pool_t *pool; - struct vas_stream *strm; CPjAudioSetting vas_setting; @@ -1622,433 +1513,422 @@ static pj_status_t factory_create_stream (pjmedia_aud_dev_factory *f, PjAudioCallback vas_play_cb; /* Can only support 16bits per sample */ - PJ_ASSERT_RETURN (param->bits_per_sample == BITS_PER_SAMPLE, PJ_EINVAL); + PJ_ASSERT_RETURN(param->bits_per_sample == BITS_PER_SAMPLE, PJ_EINVAL); /* Supported clock rates: - * - for non-PCM format: 8kHz - * - for PCM format: 8kHz and 16kHz + * - for non-PCM format: 8kHz + * - for PCM format: 8kHz and 16kHz */ - PJ_ASSERT_RETURN (param->clock_rate == 8000 || - (param->clock_rate == 16000 && - param->ext_fmt.id == PJMEDIA_FORMAT_L16), - PJ_EINVAL); + PJ_ASSERT_RETURN(param->clock_rate == 8000 || + (param->clock_rate == 16000 && + param->ext_fmt.id == PJMEDIA_FORMAT_L16), + PJ_EINVAL); /* Supported channels number: * - for non-PCM format: mono - * - for PCM format: mono and stereo + * - for PCM format: mono and stereo */ - PJ_ASSERT_RETURN (param->channel_count == 1 || - (param->channel_count == 2 && - param->ext_fmt.id == PJMEDIA_FORMAT_L16), - PJ_EINVAL); + PJ_ASSERT_RETURN(param->channel_count == 1 || + (param->channel_count == 2 && + param->ext_fmt.id == PJMEDIA_FORMAT_L16), + PJ_EINVAL); /* Create and Initialize stream descriptor */ - pool = pj_pool_create (af->pf, "vas-dev", 1000, 1000, NULL); - PJ_ASSERT_RETURN (pool, PJ_ENOMEM); + pool = pj_pool_create(af->pf, "vas-dev", 1000, 1000, NULL); + PJ_ASSERT_RETURN(pool, PJ_ENOMEM); - strm = PJ_POOL_ZALLOC_T (pool, struct vas_stream); + strm = PJ_POOL_ZALLOC_T(pool, struct vas_stream); strm->pool = pool; strm->param = *param; if (strm->param.flags & PJMEDIA_AUD_DEV_CAP_EXT_FORMAT == 0) - strm->param.ext_fmt.id = PJMEDIA_FORMAT_L16; - + strm->param.ext_fmt.id = PJMEDIA_FORMAT_L16; + /* Set audio engine fourcc. */ - switch (strm->param.ext_fmt.id) { - - case PJMEDIA_FORMAT_L16: -#ifdef USE_NATIVE_PCM - vas_setting.format = EPCM16; + switch(strm->param.ext_fmt.id) { + case PJMEDIA_FORMAT_L16: +#ifdef USE_NATIVE_PCM + vas_setting.format = EPCM16; #else - vas_setting.format = EG711; + vas_setting.format = EG711; #endif - break; - - case PJMEDIA_FORMAT_PCMU: - - case PJMEDIA_FORMAT_PCMA: - vas_setting.format = EG711; - break; - - case PJMEDIA_FORMAT_AMR: - vas_setting.format = EAMR_NB; - break; - - case PJMEDIA_FORMAT_G729: - vas_setting.format = EG729; - break; - - case PJMEDIA_FORMAT_ILBC: - vas_setting.format = EILBC; - break; - - default: - vas_setting.format = ENULL; - break; + break; + case PJMEDIA_FORMAT_PCMU: + case PJMEDIA_FORMAT_PCMA: + vas_setting.format = EG711; + break; + case PJMEDIA_FORMAT_AMR: + vas_setting.format = EAMR_NB; + break; + case PJMEDIA_FORMAT_G729: + vas_setting.format = EG729; + break; + case PJMEDIA_FORMAT_ILBC: + vas_setting.format = EILBC; + break; + default: + vas_setting.format = ENULL; + break; } /* Set audio engine mode. */ - if (strm->param.ext_fmt.id == PJMEDIA_FORMAT_L16) { -#ifdef USE_NATIVE_PCM - vas_setting.mode = 0; + if (strm->param.ext_fmt.id == PJMEDIA_FORMAT_L16) + { +#ifdef USE_NATIVE_PCM + vas_setting.mode = 0; #else - vas_setting.mode = CVoIPFormatIntfc::EG711uLaw; + vas_setting.mode = CVoIPFormatIntfc::EG711uLaw; #endif - } else if (strm->param.ext_fmt.id == PJMEDIA_FORMAT_AMR) { - vas_setting.mode = strm->param.ext_fmt.bitrate; - } else if (strm->param.ext_fmt.id == PJMEDIA_FORMAT_PCMU) { - vas_setting.mode = CVoIPFormatIntfc::EG711uLaw; - } else if (strm->param.ext_fmt.id == PJMEDIA_FORMAT_PCMA) { - vas_setting.mode = CVoIPFormatIntfc::EG711ALaw; - } else if (strm->param.ext_fmt.id == PJMEDIA_FORMAT_ILBC) { - if (strm->param.ext_fmt.bitrate == 15200) - vas_setting.mode = CVoIPFormatIntfc::EiLBC20mSecFrame; - else - vas_setting.mode = CVoIPFormatIntfc::EiLBC30mSecFrame; + } + else if (strm->param.ext_fmt.id == PJMEDIA_FORMAT_AMR) + { + vas_setting.mode = strm->param.ext_fmt.bitrate; + } + else if (strm->param.ext_fmt.id == PJMEDIA_FORMAT_PCMU) + { + vas_setting.mode = CVoIPFormatIntfc::EG711uLaw; + } + else if (strm->param.ext_fmt.id == PJMEDIA_FORMAT_PCMA) + { + vas_setting.mode = CVoIPFormatIntfc::EG711ALaw; + } + else if (strm->param.ext_fmt.id == PJMEDIA_FORMAT_ILBC) + { + if (strm->param.ext_fmt.bitrate == 15200) + vas_setting.mode = CVoIPFormatIntfc::EiLBC20mSecFrame; + else + vas_setting.mode = CVoIPFormatIntfc::EiLBC30mSecFrame; } else { - vas_setting.mode = 0; + vas_setting.mode = 0; } - /* Disable VAD on L16, G711, iLBC, and also G729 (G729's SID + /* Disable VAD on L16, G711, iLBC, and also G729 (G729's SID * potentially cause noise?). */ if (strm->param.ext_fmt.id == PJMEDIA_FORMAT_PCMU || - strm->param.ext_fmt.id == PJMEDIA_FORMAT_PCMA || - strm->param.ext_fmt.id == PJMEDIA_FORMAT_L16 || - strm->param.ext_fmt.id == PJMEDIA_FORMAT_ILBC || - strm->param.ext_fmt.id == PJMEDIA_FORMAT_G729) { - vas_setting.vad = EFalse; + strm->param.ext_fmt.id == PJMEDIA_FORMAT_PCMA || + strm->param.ext_fmt.id == PJMEDIA_FORMAT_L16 || + strm->param.ext_fmt.id == PJMEDIA_FORMAT_ILBC || + strm->param.ext_fmt.id == PJMEDIA_FORMAT_G729) + { + vas_setting.vad = EFalse; } else { - vas_setting.vad = strm->param.ext_fmt.vad; + vas_setting.vad = strm->param.ext_fmt.vad; } - + /* Set other audio engine attributes. */ vas_setting.plc = strm->param.plc_enabled; - vas_setting.cng = vas_setting.vad; - - vas_setting.loudspk = - strm->param.output_route==PJMEDIA_AUD_DEV_ROUTE_LOUDSPEAKER; + vas_setting.loudspk = + strm->param.output_route==PJMEDIA_AUD_DEV_ROUTE_LOUDSPEAKER; /* Set audio engine callbacks. */ if (strm->param.ext_fmt.id == PJMEDIA_FORMAT_L16) { #ifdef USE_NATIVE_PCM - vas_play_cb = &PlayCbPcm2; - vas_rec_cb = &RecCbPcm2; + vas_play_cb = &PlayCbPcm2; + vas_rec_cb = &RecCbPcm2; #else - vas_play_cb = &PlayCbPcm; - vas_rec_cb = &RecCbPcm; + vas_play_cb = &PlayCbPcm; + vas_rec_cb = &RecCbPcm; #endif } else { - vas_play_cb = &PlayCb; - vas_rec_cb = &RecCb; + vas_play_cb = &PlayCb; + vas_rec_cb = &RecCb; } strm->rec_cb = rec_cb; - strm->play_cb = play_cb; strm->user_data = user_data; strm->resample_factor = strm->param.clock_rate / 8000; /* play_buf size is samples per frame scaled in to 8kHz mono. */ - strm->play_buf = (pj_int16_t*) pj_pool_zalloc ( - pool, - (strm->param.samples_per_frame / - strm->resample_factor / - strm->param.channel_count) << 1); + strm->play_buf = (pj_int16_t*)pj_pool_zalloc( + pool, + (strm->param.samples_per_frame / + strm->resample_factor / + strm->param.channel_count) << 1); strm->play_buf_len = 0; strm->play_buf_start = 0; /* rec_buf size is samples per frame scaled in to 8kHz mono. */ - strm->rec_buf = (pj_int16_t*) pj_pool_zalloc ( - pool, - (strm->param.samples_per_frame / - strm->resample_factor / - strm->param.channel_count) << 1); + strm->rec_buf = (pj_int16_t*)pj_pool_zalloc( + pool, + (strm->param.samples_per_frame / + strm->resample_factor / + strm->param.channel_count) << 1); strm->rec_buf_len = 0; if (strm->param.ext_fmt.id == PJMEDIA_FORMAT_G729) { - TBitStream *g729_bitstream = new TBitStream; - - PJ_ASSERT_RETURN (g729_bitstream, PJ_ENOMEM); - strm->strm_data = (void*) g729_bitstream; + TBitStream *g729_bitstream = new TBitStream; + + PJ_ASSERT_RETURN(g729_bitstream, PJ_ENOMEM); + strm->strm_data = (void*)g729_bitstream; } - + /* Init resampler when format is PCM and clock rate is not 8kHz */ - if (strm->param.clock_rate != 8000 && - strm->param.ext_fmt.id == PJMEDIA_FORMAT_L16) { - pj_status_t status; - - if (strm->param.dir & PJMEDIA_DIR_CAPTURE) { - /* Create resample for recorder */ - status = pjmedia_resample_create (pool, PJ_TRUE, PJ_FALSE, 1, - 8000, - strm->param.clock_rate, - 80, - &strm->rec_resample); - - if (status != PJ_SUCCESS) - return status; - } - - if (strm->param.dir & PJMEDIA_DIR_PLAYBACK) { - /* Create resample for player */ - status = pjmedia_resample_create (pool, PJ_TRUE, PJ_FALSE, 1, - strm->param.clock_rate, - 8000, - 80 * strm->resample_factor, - &strm->play_resample); - - if (status != PJ_SUCCESS) - return status; - } + if (strm->param.clock_rate != 8000 && + strm->param.ext_fmt.id == PJMEDIA_FORMAT_L16) + { + pj_status_t status; + + if (strm->param.dir & PJMEDIA_DIR_CAPTURE) { + /* Create resample for recorder */ + status = pjmedia_resample_create( pool, PJ_TRUE, PJ_FALSE, 1, + 8000, + strm->param.clock_rate, + 80, + &strm->rec_resample); + if (status != PJ_SUCCESS) + return status; + } + + if (strm->param.dir & PJMEDIA_DIR_PLAYBACK) { + /* Create resample for player */ + status = pjmedia_resample_create( pool, PJ_TRUE, PJ_FALSE, 1, + strm->param.clock_rate, + 8000, + 80 * strm->resample_factor, + &strm->play_resample); + if (status != PJ_SUCCESS) + return status; + } } /* Create PCM buffer, when the clock rate is not 8kHz or not mono */ if (strm->param.ext_fmt.id == PJMEDIA_FORMAT_L16 && - (strm->resample_factor > 1 || strm->param.channel_count != 1)) { - strm->pcm_buf = (pj_int16_t*) pj_pool_zalloc (pool, - strm->param.samples_per_frame << 1); + (strm->resample_factor > 1 || strm->param.channel_count != 1)) + { + strm->pcm_buf = (pj_int16_t*)pj_pool_zalloc(pool, + strm->param.samples_per_frame << 1); } - + /* Create the audio engine. */ - TRAPD (err, strm->engine = CPjAudioEngine::NewL (strm, - vas_rec_cb, vas_play_cb, - strm, vas_setting)); - + TRAPD(err, strm->engine = CPjAudioEngine::NewL(strm, + vas_rec_cb, vas_play_cb, + strm, vas_setting)); if (err != KErrNone) { - pj_pool_release (pool); - return PJ_RETURN_OS_ERROR (err); + pj_pool_release(pool); + return PJ_RETURN_OS_ERROR(err); } /* Apply output volume setting if specified */ if (param->flags & PJMEDIA_AUD_DEV_CAP_OUTPUT_VOLUME_SETTING) { - stream_set_cap (&strm->base, PJMEDIA_AUD_DEV_CAP_OUTPUT_VOLUME_SETTING, - ¶m->output_vol); + stream_set_cap(&strm->base, PJMEDIA_AUD_DEV_CAP_OUTPUT_VOLUME_SETTING, + ¶m->output_vol); } /* Done */ strm->base.op = &stream_op; - *p_aud_strm = &strm->base; return PJ_SUCCESS; } /* API: Get stream info. */ -static pj_status_t stream_get_param (pjmedia_aud_stream *s, - pjmedia_aud_param *pi) +static pj_status_t stream_get_param(pjmedia_aud_stream *s, + pjmedia_aud_param *pi) { + struct vas_stream *strm = (struct vas_stream*)s; - struct vas_stream *strm = (struct vas_stream*) s; + PJ_ASSERT_RETURN(strm && pi, PJ_EINVAL); - PJ_ASSERT_RETURN (strm && pi, PJ_EINVAL); - - pj_memcpy (pi, &strm->param, sizeof (*pi)); + pj_memcpy(pi, &strm->param, sizeof(*pi)); /* Update the output volume setting */ - - if (stream_get_cap (s, PJMEDIA_AUD_DEV_CAP_OUTPUT_VOLUME_SETTING, - &pi->output_vol) == PJ_SUCCESS) { - pi->flags |= PJMEDIA_AUD_DEV_CAP_OUTPUT_VOLUME_SETTING; + if (stream_get_cap(s, PJMEDIA_AUD_DEV_CAP_OUTPUT_VOLUME_SETTING, + &pi->output_vol) == PJ_SUCCESS) + { + pi->flags |= PJMEDIA_AUD_DEV_CAP_OUTPUT_VOLUME_SETTING; } - + return PJ_SUCCESS; } /* API: get capability */ -static pj_status_t stream_get_cap (pjmedia_aud_stream *s, - pjmedia_aud_dev_cap cap, - void *pval) +static pj_status_t stream_get_cap(pjmedia_aud_stream *s, + pjmedia_aud_dev_cap cap, + void *pval) { - - struct vas_stream *strm = (struct vas_stream*) s; + struct vas_stream *strm = (struct vas_stream*)s; pj_status_t status = PJ_ENOTSUP; - PJ_ASSERT_RETURN (s && pval, PJ_EINVAL); + PJ_ASSERT_RETURN(s && pval, PJ_EINVAL); switch (cap) { - - case PJMEDIA_AUD_DEV_CAP_OUTPUT_ROUTE: - - if (strm->param.dir & PJMEDIA_DIR_PLAYBACK) { - * (pjmedia_aud_dev_route*) pval = strm->param.output_route; - status = PJ_SUCCESS; - } - - break; - - /* There is a case that GetMaxGain() stucks, e.g: in N95. */ - /* - case PJMEDIA_AUD_DEV_CAP_INPUT_VOLUME_SETTING: - if (strm->param.dir & PJMEDIA_DIR_CAPTURE) { - PJ_ASSERT_RETURN(strm->engine, PJ_EINVAL); - - TInt max_gain = strm->engine->GetMaxGain(); - TInt gain = strm->engine->GetGain(); - - if (max_gain > 0 && gain >= 0) { - *(unsigned*)pval = gain * 100 / max_gain; - status = PJ_SUCCESS; - } else { - status = PJMEDIA_EAUD_NOTREADY; - } - } - break; - */ - - case PJMEDIA_AUD_DEV_CAP_OUTPUT_VOLUME_SETTING: - - if (strm->param.dir & PJMEDIA_DIR_PLAYBACK) { - PJ_ASSERT_RETURN (strm->engine, PJ_EINVAL); - - TInt max_vol = strm->engine->GetMaxVolume(); - TInt vol = strm->engine->GetVolume(); - - if (max_vol > 0 && vol >= 0) { - * (unsigned*) pval = vol * 100 / max_vol; - status = PJ_SUCCESS; - } else { - status = PJMEDIA_EAUD_NOTREADY; - } - } - - break; - - default: - break; + case PJMEDIA_AUD_DEV_CAP_OUTPUT_ROUTE: + if (strm->param.dir & PJMEDIA_DIR_PLAYBACK) { + *(pjmedia_aud_dev_route*)pval = strm->param.output_route; + status = PJ_SUCCESS; + } + break; + + /* There is a case that GetMaxGain() stucks, e.g: in N95. */ + /* + case PJMEDIA_AUD_DEV_CAP_INPUT_VOLUME_SETTING: + if (strm->param.dir & PJMEDIA_DIR_CAPTURE) { + PJ_ASSERT_RETURN(strm->engine, PJ_EINVAL); + + TInt max_gain = strm->engine->GetMaxGain(); + TInt gain = strm->engine->GetGain(); + + if (max_gain > 0 && gain >= 0) { + *(unsigned*)pval = gain * 100 / max_gain; + status = PJ_SUCCESS; + } else { + status = PJMEDIA_EAUD_NOTREADY; + } + } + break; + */ + + case PJMEDIA_AUD_DEV_CAP_OUTPUT_VOLUME_SETTING: + if (strm->param.dir & PJMEDIA_DIR_PLAYBACK) { + PJ_ASSERT_RETURN(strm->engine, PJ_EINVAL); + + TInt max_vol = strm->engine->GetMaxVolume(); + TInt vol = strm->engine->GetVolume(); + + if (max_vol > 0 && vol >= 0) { + *(unsigned*)pval = vol * 100 / max_vol; + status = PJ_SUCCESS; + } else { + status = PJMEDIA_EAUD_NOTREADY; + } + } + break; + default: + break; } - + return status; } /* API: set capability */ -static pj_status_t stream_set_cap (pjmedia_aud_stream *s, - pjmedia_aud_dev_cap cap, - const void *pval) +static pj_status_t stream_set_cap(pjmedia_aud_stream *s, + pjmedia_aud_dev_cap cap, + const void *pval) { - - struct vas_stream *strm = (struct vas_stream*) s; + struct vas_stream *strm = (struct vas_stream*)s; pj_status_t status = PJ_ENOTSUP; - PJ_ASSERT_RETURN (s && pval, PJ_EINVAL); + PJ_ASSERT_RETURN(s && pval, PJ_EINVAL); switch (cap) { - - case PJMEDIA_AUD_DEV_CAP_OUTPUT_ROUTE: - - if (strm->param.dir & PJMEDIA_DIR_PLAYBACK) { - pjmedia_aud_dev_route r = * (const pjmedia_aud_dev_route*) pval; - TInt err; - - PJ_ASSERT_RETURN (strm->engine, PJ_EINVAL); - - switch (r) { - - case PJMEDIA_AUD_DEV_ROUTE_DEFAULT: - - case PJMEDIA_AUD_DEV_ROUTE_EARPIECE: - err = strm->engine->ActivateSpeaker (EFalse); - status = (err==KErrNone) ? PJ_SUCCESS:PJ_RETURN_OS_ERROR (err); - break; - - case PJMEDIA_AUD_DEV_ROUTE_LOUDSPEAKER: - err = strm->engine->ActivateSpeaker (ETrue); - status = (err==KErrNone) ? PJ_SUCCESS:PJ_RETURN_OS_ERROR (err); - break; - - default: - status = PJ_EINVAL; - break; - } - - if (status == PJ_SUCCESS) - strm->param.output_route = r; - } - - break; - - /* There is a case that GetMaxGain() stucks, e.g: in N95. */ - /* - case PJMEDIA_AUD_DEV_CAP_INPUT_VOLUME_SETTING: - if (strm->param.dir & PJMEDIA_DIR_CAPTURE) { - PJ_ASSERT_RETURN(strm->engine, PJ_EINVAL); - - TInt max_gain = strm->engine->GetMaxGain(); - if (max_gain > 0) { - TInt gain, err; - - gain = *(unsigned*)pval * max_gain / 100; - err = strm->engine->SetGain(gain); - status = (err==KErrNone)? PJ_SUCCESS:PJ_RETURN_OS_ERROR(err); - } else { - status = PJMEDIA_EAUD_NOTREADY; - } - if (status == PJ_SUCCESS) - strm->param.input_vol = *(unsigned*)pval; - } - break; - */ - - case PJMEDIA_AUD_DEV_CAP_OUTPUT_VOLUME_SETTING: - - if (strm->param.dir & PJMEDIA_DIR_PLAYBACK) { - PJ_ASSERT_RETURN (strm->engine, PJ_EINVAL); - - TInt max_vol = strm->engine->GetMaxVolume(); - - if (max_vol > 0) { - TInt vol, err; - - vol = * (unsigned*) pval * max_vol / 100; - err = strm->engine->SetVolume (vol); - status = (err==KErrNone) ? PJ_SUCCESS:PJ_RETURN_OS_ERROR (err); - } else { - status = PJMEDIA_EAUD_NOTREADY; - } - - if (status == PJ_SUCCESS) - strm->param.output_vol = * (unsigned*) pval; - } - - break; - - default: - break; + case PJMEDIA_AUD_DEV_CAP_OUTPUT_ROUTE: + if (strm->param.dir & PJMEDIA_DIR_PLAYBACK) { + pjmedia_aud_dev_route r = *(const pjmedia_aud_dev_route*)pval; + TInt err; + + PJ_ASSERT_RETURN(strm->engine, PJ_EINVAL); + + switch (r) { + case PJMEDIA_AUD_DEV_ROUTE_DEFAULT: + case PJMEDIA_AUD_DEV_ROUTE_EARPIECE: + err = strm->engine->ActivateSpeaker(EFalse); + status = (err==KErrNone)? PJ_SUCCESS:PJ_RETURN_OS_ERROR(err); + break; + case PJMEDIA_AUD_DEV_ROUTE_LOUDSPEAKER: + err = strm->engine->ActivateSpeaker(ETrue); + status = (err==KErrNone)? PJ_SUCCESS:PJ_RETURN_OS_ERROR(err); + break; + default: + status = PJ_EINVAL; + break; + } + if (status == PJ_SUCCESS) + strm->param.output_route = r; + } + break; + + /* There is a case that GetMaxGain() stucks, e.g: in N95. */ + /* + case PJMEDIA_AUD_DEV_CAP_INPUT_VOLUME_SETTING: + if (strm->param.dir & PJMEDIA_DIR_CAPTURE) { + PJ_ASSERT_RETURN(strm->engine, PJ_EINVAL); + + TInt max_gain = strm->engine->GetMaxGain(); + if (max_gain > 0) { + TInt gain, err; + + gain = *(unsigned*)pval * max_gain / 100; + err = strm->engine->SetGain(gain); + status = (err==KErrNone)? PJ_SUCCESS:PJ_RETURN_OS_ERROR(err); + } else { + status = PJMEDIA_EAUD_NOTREADY; + } + if (status == PJ_SUCCESS) + strm->param.input_vol = *(unsigned*)pval; + } + break; + */ + + case PJMEDIA_AUD_DEV_CAP_OUTPUT_VOLUME_SETTING: + if (strm->param.dir & PJMEDIA_DIR_PLAYBACK) { + PJ_ASSERT_RETURN(strm->engine, PJ_EINVAL); + + TInt max_vol = strm->engine->GetMaxVolume(); + if (max_vol > 0) { + TInt vol, err; + + vol = *(unsigned*)pval * max_vol / 100; + err = strm->engine->SetVolume(vol); + status = (err==KErrNone)? PJ_SUCCESS:PJ_RETURN_OS_ERROR(err); + } else { + status = PJMEDIA_EAUD_NOTREADY; + } + if (status == PJ_SUCCESS) + strm->param.output_vol = *(unsigned*)pval; + } + break; + default: + break; } - + return status; } /* API: Start stream. */ -static pj_status_t stream_start (pjmedia_aud_stream *strm) +static pj_status_t stream_start(pjmedia_aud_stream *strm) { + struct vas_stream *stream = (struct vas_stream*)strm; - struct vas_stream *stream = (struct vas_stream*) strm; - - PJ_ASSERT_RETURN (stream, PJ_EINVAL); + PJ_ASSERT_RETURN(stream, PJ_EINVAL); if (stream->engine) { - TInt err = stream->engine->Start(); - - if (err != KErrNone) - return PJ_RETURN_OS_ERROR (err); - } - - return PJ_SUCCESS; + enum { VAS_WAIT_START = 2000 }; /* in msecs */ + TTime start, now; + TInt err = stream->engine->Start(); + + if (err != KErrNone) + return PJ_RETURN_OS_ERROR(err); + + /* Perform synchronous start, timeout after VAS_WAIT_START ms */ + start.UniversalTime(); + do { + pj_symbianos_poll(-1, 100); + now.UniversalTime(); + } while (!stream->engine->IsStarted() && + (now.MicroSecondsFrom(start) < VAS_WAIT_START * 1000)); + + if (stream->engine->IsStarted()) + return PJ_SUCCESS; + else + return PJ_ETIMEDOUT; + } + + return PJ_EINVALIDOP; } /* API: Stop stream. */ -static pj_status_t stream_stop (pjmedia_aud_stream *strm) +static pj_status_t stream_stop(pjmedia_aud_stream *strm) { + struct vas_stream *stream = (struct vas_stream*)strm; - struct vas_stream *stream = (struct vas_stream*) strm; - - PJ_ASSERT_RETURN (stream, PJ_EINVAL); + PJ_ASSERT_RETURN(stream, PJ_EINVAL); if (stream->engine) { - stream->engine->Stop(); + stream->engine->Stop(); } return PJ_SUCCESS; @@ -2056,31 +1936,28 @@ static pj_status_t stream_stop (pjmedia_aud_stream *strm) /* API: Destroy stream. */ -static pj_status_t stream_destroy (pjmedia_aud_stream *strm) +static pj_status_t stream_destroy(pjmedia_aud_stream *strm) { + struct vas_stream *stream = (struct vas_stream*)strm; - struct vas_stream *stream = (struct vas_stream*) strm; - - PJ_ASSERT_RETURN (stream, PJ_EINVAL); + PJ_ASSERT_RETURN(stream, PJ_EINVAL); - stream_stop (strm); + stream_stop(strm); delete stream->engine; stream->engine = NULL; if (stream->param.ext_fmt.id == PJMEDIA_FORMAT_G729) { - TBitStream *g729_bitstream = (TBitStream*) stream->strm_data; - stream->strm_data = NULL; - delete g729_bitstream; + TBitStream *g729_bitstream = (TBitStream*)stream->strm_data; + stream->strm_data = NULL; + delete g729_bitstream; } pj_pool_t *pool; - pool = stream->pool; - if (pool) { - stream->pool = NULL; - pj_pool_release (pool); + stream->pool = NULL; + pj_pool_release(pool); } return PJ_SUCCESS; diff --git a/sflphone-common/libs/pjproject/pjmedia/src/pjmedia-audiodev/wmme_dev.c b/sflphone-common/libs/pjproject/pjmedia/src/pjmedia-audiodev/wmme_dev.c index f7a3436b257e10eb4943868325455c75c582fce3..66924d8f235ec639ac9eb07c0f55c7bd61d63fe7 100644 --- a/sflphone-common/libs/pjproject/pjmedia/src/pjmedia-audiodev/wmme_dev.c +++ b/sflphone-common/libs/pjproject/pjmedia/src/pjmedia-audiodev/wmme_dev.c @@ -1,4 +1,4 @@ -/* $Id: wmme_dev.c 2841 2009-07-18 09:21:09Z bennylp $ */ +/* $Id: wmme_dev.c 2941 2009-10-13 11:19:57Z nanang $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> @@ -283,7 +283,15 @@ static pj_status_t factory_init(pjmedia_aud_dev_factory *f) if (devCount==0) { PJ_LOG(4,(THIS_FILE, "WMME found no sound devices")); + /* Enabling this will cause pjsua-lib initialization to fail when there + * is no sound device installed in the system, even when pjsua has been + * run with --null-audio. Moreover, it might be better to think that + * the WMME backend initialization is successfull, regardless there is + * no audio device installed, as later application can check it using + * get_dev_count(). return PJMEDIA_EAUD_NODEV; + */ + return PJ_SUCCESS; } wf->dev_info = (struct wmme_dev_info*) @@ -450,7 +458,7 @@ static pj_status_t init_waveformatex(LPWAVEFORMATEX wfx, const pjmedia_aud_param *prm) { - pj_bzero(wfx, sizeof(PCMWAVEFORMAT)); + pj_bzero(wfx, sizeof(WAVEFORMATEX)); if (prm->ext_fmt.id == PJMEDIA_FORMAT_L16) { enum { BYTES_PER_SAMPLE = 2 }; wfx->wFormatTag = WAVE_FORMAT_PCM; diff --git a/sflphone-common/libs/pjproject/pjmedia/src/pjmedia-codec/passthrough.c b/sflphone-common/libs/pjproject/pjmedia/src/pjmedia-codec/passthrough.c index 42042acca490d5dd6c70286da234ede4b6d37d60..884c3e954b38f82f0bec7f0f061aef4714b2b273 100644 --- a/sflphone-common/libs/pjproject/pjmedia/src/pjmedia-codec/passthrough.c +++ b/sflphone-common/libs/pjproject/pjmedia/src/pjmedia-codec/passthrough.c @@ -1,4 +1,4 @@ -/* $Id: passthrough.c 2834 2009-07-15 17:55:16Z nanang $ */ +/* $Id: passthrough.c 2997 2009-11-09 08:49:32Z bennylp $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> @@ -719,6 +719,8 @@ static pj_status_t codec_open( pjmedia_codec *codec, #endif #if PJMEDIA_HAS_PASSTHROUGH_CODEC_ILBC + /* Init iLBC settings */ + if (desc->pt == PJMEDIA_RTP_PT_ILBC) { enum { DEFAULT_MODE = 30 }; static pj_str_t STR_MODE = {"mode", 4}; @@ -915,7 +917,9 @@ static pj_status_t codec_decode( pjmedia_codec *codec, struct pjmedia_frame *output) { codec_private_t *codec_data = (codec_private_t*) codec->codec_data; +#if PJMEDIA_HAS_PASSTHROUGH_CODEC_AMR struct codec_desc *desc = &codec_desc[codec_data->codec_idx]; +#endif pjmedia_frame_ext *output_ = (pjmedia_frame_ext*) output; pj_assert(input); @@ -960,7 +964,6 @@ static pj_status_t codec_recover( pjmedia_codec *codec, struct pjmedia_frame *output) { codec_private_t *codec_data = (codec_private_t*) codec->codec_data; - struct codec_desc *desc = &codec_desc[codec_data->codec_idx]; pjmedia_frame_ext *output_ = (pjmedia_frame_ext*) output; PJ_UNUSED_ARG(output_buf_len); diff --git a/sflphone-common/libs/pjproject/pjmedia/src/pjmedia/jbuf.c b/sflphone-common/libs/pjproject/pjmedia/src/pjmedia/jbuf.c index fac084e9b973d98af727bf56d1e99922f58a30d9..3cdcc6acbdf5db874bec5c1950b2528af8e694bd 100644 --- a/sflphone-common/libs/pjproject/pjmedia/src/pjmedia/jbuf.c +++ b/sflphone-common/libs/pjproject/pjmedia/src/pjmedia/jbuf.c @@ -1,4 +1,4 @@ -/* $Id: jbuf.c 2844 2009-07-29 12:14:21Z bennylp $ */ +/* $Id: jbuf.c 3015 2009-11-11 04:26:00Z nanang $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> @@ -735,7 +735,7 @@ PJ_DEF(void) pjmedia_jbuf_get_frame2(pjmedia_jbuf *jb, } else { - pjmedia_jb_frame_type ftype; + pjmedia_jb_frame_type ftype = PJMEDIA_JB_MISSING_FRAME; pj_bool_t res; /* Retrieve a frame from frame list */ diff --git a/sflphone-common/libs/pjproject/pjmedia/src/pjmedia/rtp.c b/sflphone-common/libs/pjproject/pjmedia/src/pjmedia/rtp.c index e383e964ee9f4a5df33edbddac12939e512349d6..fbebb155f6732a3f079666948255355168619365 100644 --- a/sflphone-common/libs/pjproject/pjmedia/src/pjmedia/rtp.c +++ b/sflphone-common/libs/pjproject/pjmedia/src/pjmedia/rtp.c @@ -1,4 +1,4 @@ -/* $Id: rtp.c 2394 2008-12-23 17:27:53Z bennylp $ */ +/* $Id: rtp.c 2904 2009-08-20 13:06:17Z bennylp $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> @@ -170,7 +170,7 @@ PJ_DEF(pj_status_t) pjmedia_rtp_decode_rtp( pjmedia_rtp_session *ses, if ((*hdr)->x) { pjmedia_rtp_ext_hdr *ext = (pjmedia_rtp_ext_hdr*) (((pj_uint8_t*)pkt) + offset); - offset += (pj_ntohs(ext->length) * sizeof(pj_uint32_t)); + offset += ((pj_ntohs(ext->length)+1) * sizeof(pj_uint32_t)); } /* Check that offset is less than packet size */ diff --git a/sflphone-common/libs/pjproject/pjmedia/src/pjmedia/sdp.c b/sflphone-common/libs/pjproject/pjmedia/src/pjmedia/sdp.c index 77bf5da68b569d77a0d9a6a82bb1449eb2207ea7..2a44d2f62e7aa009b3f77b0c5e845f8f165f4785 100644 --- a/sflphone-common/libs/pjproject/pjmedia/src/pjmedia/sdp.c +++ b/sflphone-common/libs/pjproject/pjmedia/src/pjmedia/sdp.c @@ -1,4 +1,4 @@ -/* $Id: sdp.c 2847 2009-07-30 19:35:24Z bennylp $ */ +/* $Id: sdp.c 2995 2009-11-09 05:18:12Z bennylp $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> @@ -174,6 +174,7 @@ PJ_DEF(pjmedia_sdp_attr*) pjmedia_sdp_attr_find2(unsigned count, } + PJ_DEF(pj_status_t) pjmedia_sdp_attr_add(unsigned *count, pjmedia_sdp_attr *attr_array[], pjmedia_sdp_attr *attr) @@ -680,6 +681,12 @@ PJ_DEF(pj_status_t) pjmedia_sdp_media_add_attr( pjmedia_sdp_media *m, return pjmedia_sdp_attr_add(&m->attr_count, m->attr, attr); } +PJ_DEF(pj_status_t) pjmedia_sdp_session_add_attr(pjmedia_sdp_session *s, + pjmedia_sdp_attr *attr) +{ + return pjmedia_sdp_attr_add(&s->attr_count, s->attr, attr); +} + PJ_DEF(unsigned) pjmedia_sdp_media_remove_all_attr(pjmedia_sdp_media *m, const char *name) { @@ -978,13 +985,22 @@ static void parse_media(pj_scanner *scanner, pjmedia_sdp_media *med, /* format list */ med->desc.fmt_count = 0; while (*scanner->curptr == ' ') { + pj_str_t fmt; + pj_scan_get_char(scanner); /* Check again for the end of the line */ if ((*scanner->curptr == '\r') || (*scanner->curptr == '\n')) break; - pj_scan_get(scanner, &cs_token, &med->desc.fmt[med->desc.fmt_count++]); + pj_scan_get(scanner, &cs_token, &fmt); + if (med->desc.fmt_count < PJMEDIA_MAX_SDP_FMT) + med->desc.fmt[med->desc.fmt_count++] = fmt; + else + PJ_PERROR(2,(THIS_FILE, PJ_ETOOMANY, + "Error adding SDP media format %.*s, " + "format is ignored", + (int)fmt.slen, fmt.ptr)); } /* We've got what we're looking for, skip anything until newline */ @@ -1019,7 +1035,9 @@ static pjmedia_sdp_attr *parse_attr( pj_pool_t *pool, pj_scanner *scanner, /* get attr name. */ pj_scan_get(scanner, &cs_token, &attr->name); - if (*scanner->curptr != '\r' && *scanner->curptr != '\n') { + if (*scanner->curptr && *scanner->curptr != '\r' && + *scanner->curptr != '\n') + { /* skip ':' if present. */ if (*scanner->curptr == ':') pj_scan_get_char(scanner); @@ -1080,9 +1098,9 @@ PJ_DEF(pj_status_t) pjmedia_sdp_parse( pj_pool_t *pool, attr = parse_attr(pool, &scanner, &ctx); if (attr) { if (media) { - media->attr[media->attr_count++] = attr; + pjmedia_sdp_media_add_attr(media, attr); } else { - session->attr[session->attr_count++] = attr; + pjmedia_sdp_session_add_attr(session, attr); } } break; @@ -1107,7 +1125,11 @@ PJ_DEF(pj_status_t) pjmedia_sdp_parse( pj_pool_t *pool, case 'm': media = PJ_POOL_ZALLOC_T(pool, pjmedia_sdp_media); parse_media(&scanner, media, &ctx); - session->media[ session->media_count++ ] = media; + if (session->media_count < PJMEDIA_MAX_SDP_MEDIA) + session->media[ session->media_count++ ] = media; + else + PJ_PERROR(2,(THIS_FILE, PJ_ETOOMANY, + "Error adding media, media is ignored")); break; case 'v': parse_version(&scanner, &ctx); @@ -1350,11 +1372,14 @@ PJ_DEF(pj_status_t) pjmedia_sdp_media_deactivate(pj_pool_t *pool, pjmedia_sdp_attr *attr; static const pj_str_t ID_INACTIVE = { "inactive", 8 }; + if (m->attr_count >= PJMEDIA_MAX_SDP_ATTR) + return PJ_ETOOMANY; + attr = pjmedia_sdp_attr_create(pool, ID_INACTIVE.ptr, NULL); if (NULL == attr) return PJ_ENOMEM; - m->attr[m->attr_count++] = attr; + pjmedia_sdp_media_add_attr(m, attr); m->desc.port = 0; return PJ_SUCCESS; diff --git a/sflphone-common/libs/pjproject/pjmedia/src/pjmedia/sdp_neg.c b/sflphone-common/libs/pjproject/pjmedia/src/pjmedia/sdp_neg.c index 881b65342e4104161ea7aa5d5be7abaf1bac39a2..9e283027dd999409ad2d5b2bc065f9cfeb393178 100644 --- a/sflphone-common/libs/pjproject/pjmedia/src/pjmedia/sdp_neg.c +++ b/sflphone-common/libs/pjproject/pjmedia/src/pjmedia/sdp_neg.c @@ -1,4 +1,4 @@ -/* $Id: sdp_neg.c 2724 2009-05-29 13:04:03Z bennylp $ */ +/* $Id: sdp_neg.c 2926 2009-10-06 11:29:14Z nanang $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> @@ -1006,6 +1006,15 @@ static pj_status_t match_offer(pj_pool_t *pool, const pjmedia_sdp_media *master, *slave; pj_str_t pt_amr_need_adapt = {NULL, 0}; + /* If offer has zero port, just clone the offer and update direction */ + if (offer->desc.port == 0) { + answer = pjmedia_sdp_media_clone(pool, offer); + remove_all_media_directions(answer); + update_media_direction(pool, offer, answer); + *p_answer = answer; + return PJ_SUCCESS; + } + /* Set master/slave negotiator based on prefer_remote_codec_order. */ if (prefer_remote_codec_order) { master = offer; @@ -1218,10 +1227,6 @@ static pj_status_t match_offer(pj_pool_t *pool, } answer->desc.fmt_count = pt_answer_count; - /* If offer has zero port, set our answer with zero port too */ - if (offer->desc.port == 0) - answer->desc.port = 0; - /* Update media direction. */ update_media_direction(pool, offer, answer); diff --git a/sflphone-common/libs/pjproject/pjmedia/src/pjmedia/sdp_wrap.cpp b/sflphone-common/libs/pjproject/pjmedia/src/pjmedia/sdp_wrap.cpp index cfca6d28ccc016aa5bb9112daaf12b3c2e61f14e..dd5b8fd09cb13bf51740f6a9a199bcfa927ee63f 100644 --- a/sflphone-common/libs/pjproject/pjmedia/src/pjmedia/sdp_wrap.cpp +++ b/sflphone-common/libs/pjproject/pjmedia/src/pjmedia/sdp_wrap.cpp @@ -1,5 +1,5 @@ /* $Id: sdp_wrap.cpp 2873 2009-08-13 11:54:35Z nanang $ */ -/* +/* * Copyright (C) 2009 Teluu Inc. (http://www.teluu.com) * * This program is free software; you can redistribute it and/or modify @@ -14,7 +14,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* diff --git a/sflphone-common/libs/pjproject/pjmedia/src/pjmedia/transport_ice.c b/sflphone-common/libs/pjproject/pjmedia/src/pjmedia/transport_ice.c index b3f947bdcb7fdae34d0b3fcfa5a611c99f5caec9..2bf078273ad3204c19c537f5f55a7165c0a6b6c8 100644 --- a/sflphone-common/libs/pjproject/pjmedia/src/pjmedia/transport_ice.c +++ b/sflphone-common/libs/pjproject/pjmedia/src/pjmedia/transport_ice.c @@ -1,4 +1,4 @@ -/* $Id: transport_ice.c 2896 2009-08-17 18:55:13Z bennylp $ */ +/* $Id: transport_ice.c 2957 2009-10-20 14:44:00Z bennylp $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> @@ -1147,7 +1147,9 @@ static pj_status_t transport_encode_sdp(pjmedia_transport *tp, pj_status_t status; /* Validate media transport */ - /* For now, this transport only support RTP/AVP transport */ + /* This transport only support RTP/AVP transport, unless if + * transport checking is disabled + */ if ((tp_ice->media_option & PJMEDIA_TPMED_NO_TRANSPORT_CHECKING) == 0) { pjmedia_sdp_media *loc_m, *rem_m; @@ -1410,6 +1412,17 @@ static pj_status_t transport_media_start(pjmedia_transport *tp, } } + /* Ticket #977: Update role if turns out we're supposed to be the + * Controlling agent (e.g. when talking to ice-lite peer). + */ + if (tp_ice->rem_offer_state.local_role==PJ_ICE_SESS_ROLE_CONTROLLING && + pj_ice_strans_has_sess(tp_ice->ice_st)) + { + pj_ice_strans_change_role(tp_ice->ice_st, + PJ_ICE_SESS_ROLE_CONTROLLING); + } + + /* start ICE */ } @@ -1473,6 +1486,38 @@ static pj_status_t transport_get_info(pjmedia_transport *tp, info->src_rtcp_name = tp_ice->rtcp_src_addr; } + /* Fill up transport specific info */ + if (info->specific_info_cnt < PJ_ARRAY_SIZE(info->spc_info)) { + pjmedia_transport_specific_info *tsi; + pjmedia_ice_transport_info *ii; + unsigned i; + + pj_assert(sizeof(*ii) <= sizeof(tsi->buffer)); + tsi = &info->spc_info[info->specific_info_cnt++]; + tsi->type = PJMEDIA_TRANSPORT_TYPE_ICE; + tsi->cbsize = sizeof(*ii); + + ii = (pjmedia_ice_transport_info*) tsi->buffer; + pj_bzero(ii, sizeof(*ii)); + + if (pj_ice_strans_has_sess(tp_ice->ice_st)) + ii->role = pj_ice_strans_get_role(tp_ice->ice_st); + else + ii->role = PJ_ICE_SESS_ROLE_UNKNOWN; + ii->sess_state = pj_ice_strans_get_state(tp_ice->ice_st); + ii->comp_cnt = pj_ice_strans_get_running_comp_cnt(tp_ice->ice_st); + + for (i=1; i<=ii->comp_cnt && i<=PJ_ARRAY_SIZE(ii->comp); ++i) { + const pj_ice_sess_check *chk; + + chk = pj_ice_strans_get_valid_pair(tp_ice->ice_st, i); + if (chk) { + ii->comp[i-1].lcand_type = chk->lcand->type; + ii->comp[i-1].rcand_type = chk->rcand->type; + } + } + } + return PJ_SUCCESS; } diff --git a/sflphone-common/libs/pjproject/pjmedia/src/test/mips_test.c b/sflphone-common/libs/pjproject/pjmedia/src/test/mips_test.c index 4c734a20713cf2bcd19437a43246ca971be87e9e..d5cdcd3112bcb0d6a7e84882988cfa63987d0d06 100644 --- a/sflphone-common/libs/pjproject/pjmedia/src/test/mips_test.c +++ b/sflphone-common/libs/pjproject/pjmedia/src/test/mips_test.c @@ -1,4 +1,4 @@ -/* $Id: mips_test.c 2882 2009-08-15 10:05:36Z bennylp $ */ +/* $Id: mips_test.c 2978 2009-10-30 01:18:28Z bennylp $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> @@ -2407,7 +2407,7 @@ int mips_test(void) struct test_entry *e = &entries[i]; pj_timestamp times[RETRY], tzero; int usec; - float cpu_pct, mips; + float cpu_pct, mips_val; unsigned j, clock_rate = clock_rates[c]; if ((e->valid_clock_rate & k[c]) == 0) @@ -2438,10 +2438,10 @@ int mips_test(void) usec = usec / (DURATION / 1000); - mips = (float)(CPU_IPS * usec / 1000000.0 / 1000000); + mips_val = (float)(CPU_IPS * usec / 1000000.0 / 1000000); cpu_pct = (float)(100.0 * usec / 1000000); PJ_LOG(3,(THIS_FILE, "%2dKHz %-38s % 8d %8.3f %7.2f", - clock_rate/1000, e->title, usec, cpu_pct, mips)); + clock_rate/1000, e->title, usec, cpu_pct, mips_val)); } } diff --git a/sflphone-common/libs/pjproject/pjmedia/src/test/sdp_neg_test.c b/sflphone-common/libs/pjproject/pjmedia/src/test/sdp_neg_test.c index 25b9010adbb70f90af18fed6b004fda0bf9f1582..437bd41301b8387b0a743e21bee7e69a482cec1d 100644 --- a/sflphone-common/libs/pjproject/pjmedia/src/test/sdp_neg_test.c +++ b/sflphone-common/libs/pjproject/pjmedia/src/test/sdp_neg_test.c @@ -1,4 +1,4 @@ -/* $Id: sdp_neg_test.c 2675 2009-05-06 14:34:13Z bennylp $ */ +/* $Id: sdp_neg_test.c 3014 2009-11-11 04:18:58Z nanang $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> @@ -129,7 +129,7 @@ static struct test "m=audio 49170 RTP/AVP 0\r\n" "a=rtpmap:0 PCMU/8000\r\n" "m=video 0 RTP/AVP 31\r\n" - "a=rtpmap:31 H261/90000\r\n" /* <-- this is not necessary */ + //"a=rtpmap:31 H261/90000\r\n" /* <-- this is not necessary */ "m=video 53000 RTP/AVP 32\r\n" "a=rtpmap:32 MPV/90000\r\n" "m=audio 0 RTP/AVP 110\r\n" diff --git a/sflphone-common/libs/pjproject/pjnath/build/Makefile b/sflphone-common/libs/pjproject/pjnath/build/Makefile index 13bd9f65862776b882f21c960bf4e8d3f305124b..3012659f48b8c989c814c9a15c1265b9463f2e74 100644 --- a/sflphone-common/libs/pjproject/pjnath/build/Makefile +++ b/sflphone-common/libs/pjproject/pjnath/build/Makefile @@ -7,9 +7,9 @@ include $(PJDIR)/build/common.mak RULES_MAK := $(PJDIR)/build/rules.mak -PJLIB_LIB:=../../pjlib/lib/libpj-sfl-$(TARGET_NAME)$(LIBEXT) -PJLIB_UTIL_LIB:=../../pjlib-util/lib/libpjlib-util-sfl-$(TARGET_NAME)$(LIBEXT) -export PJNATH_LIB:=../lib/libpjnath-sfl-$(TARGET_NAME)$(LIBEXT) +PJLIB_LIB:=../../pjlib/lib/libpj-$(TARGET_NAME)$(LIBEXT) +PJLIB_UTIL_LIB:=../../pjlib-util/lib/libpjlib-util-$(TARGET_NAME)$(LIBEXT) +export PJNATH_LIB:=../lib/libpjnath-$(TARGET_NAME)$(LIBEXT) ############################################################################### # Gather all flags. diff --git a/sflphone-common/libs/pjproject/pjnath/include/pjnath/config.h b/sflphone-common/libs/pjproject/pjnath/include/pjnath/config.h index 91ab258825971a4528788888a14b62d63396ed4a..5a5ebac783aad94a58b2bb75e7dbef990cecefc9 100644 --- a/sflphone-common/libs/pjproject/pjnath/include/pjnath/config.h +++ b/sflphone-common/libs/pjproject/pjnath/include/pjnath/config.h @@ -1,5 +1,5 @@ -/* $Id: config.h 2724 2009-05-29 13:04:03Z bennylp $ */ -/* +/* $Id: config.h 2966 2009-10-25 09:02:07Z bennylp $ */ +/* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> * @@ -15,7 +15,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef __PJNATH_CONFIG_H__ #define __PJNATH_CONFIG_H__ @@ -66,9 +66,9 @@ /** * The default initial STUN round-trip time estimation (the RTO value - * in RFC 3489-bis), in miliseconds. - * This value is used to control the STUN request - * retransmit time. The initial value of retransmission interval + * in RFC 3489-bis), in miliseconds. + * This value is used to control the STUN request + * retransmit time. The initial value of retransmission interval * would be set to this value, and will be doubled after each * retransmission. */ @@ -79,7 +79,7 @@ /** * The STUN transaction timeout value, in miliseconds. - * After the last retransmission is sent and if no response is received + * After the last retransmission is sent and if no response is received * after this time, the STUN transaction will be considered to have failed. * * The default value is 16x RTO (as per RFC 3489-bis). @@ -202,8 +202,8 @@ /** - * Number of seconds to refresh the permission/channel binding before the - * permission/channel binding expires. This value should be greater than + * Number of seconds to refresh the permission/channel binding before the + * permission/channel binding expires. This value should be greater than * PJ_TURN_PERM_TIMEOUT setting. */ #ifndef PJ_TURN_REFRESH_SEC_BEFORE @@ -212,7 +212,7 @@ /** - * The TURN session timer heart beat interval. When this timer occurs, the + * The TURN session timer heart beat interval. When this timer occurs, the * TURN session will scan all the permissions/channel bindings to see which * need to be refreshed. */ @@ -250,14 +250,14 @@ * the maximum number of components (PJ_ICE_MAX_COMP) value. */ #ifndef PJ_ICE_COMP_BITS -# define PJ_ICE_COMP_BITS 3 +# define PJ_ICE_COMP_BITS 1 #endif /** * Maximum number of ICE components. */ -#define PJ_ICE_MAX_COMP (2<<PJ_ICE_COMP_BITS) +#define PJ_ICE_MAX_COMP (2<<PJ_ICE_COMP_BITS) /** * Use the priority value according to the ice-draft. @@ -282,10 +282,10 @@ /** * The number of bits to represent ICE candidate's local preference. The * local preference is used to specify preference among candidates with - * the same type, and ICE draft suggests 65535 as the default local - * preference, which means we need 16 bits to represent the value. But + * the same type, and ICE draft suggests 65535 as the default local + * preference, which means we need 16 bits to represent the value. But * since we don't have the facility to specify local preference, we'll - * just disable this feature and let the preference sorted by the + * just disable this feature and let the preference sorted by the * type only. * * Default: 0 @@ -316,15 +316,15 @@ /** - * According to ICE Section 8.2. Updating States, if an In-Progress pair in - * the check list is for the same component as a nominated pair, the agent + * According to ICE Section 8.2. Updating States, if an In-Progress pair in + * the check list is for the same component as a nominated pair, the agent * SHOULD cease retransmissions for its check if its pair priority is lower * than the lowest priority nominated pair for that component. * * If a higher priority check is In Progress, this rule would cause that * check to be performed even when it most likely will fail. * - * The macro here controls if ICE session should cancel all In Progress + * The macro here controls if ICE session should cancel all In Progress * checks for the same component regardless of its priority. * * Default: 1 (yes, cancel all) diff --git a/sflphone-common/libs/pjproject/pjnath/include/pjnath/ice_strans.h b/sflphone-common/libs/pjproject/pjnath/include/pjnath/ice_strans.h index 0182d63b10ab7b0fa1adbd9d8dac26d100424ed6..c576f4551e47c4acb4ac0618ac5897d00dd631ba 100644 --- a/sflphone-common/libs/pjproject/pjnath/include/pjnath/ice_strans.h +++ b/sflphone-common/libs/pjproject/pjnath/include/pjnath/ice_strans.h @@ -1,4 +1,4 @@ -/* $Id: ice_strans.h 2724 2009-05-29 13:04:03Z bennylp $ */ +/* $Id: ice_strans.h 3028 2009-12-08 13:11:25Z bennylp $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> @@ -270,6 +270,13 @@ typedef struct pj_ice_strans_cfg * TURN specific settings. */ struct { + /** + * Optional TURN socket settings. The default values will be + * initialized by #pj_turn_sock_cfg_default(). This contains + * settings such as QoS. + */ + pj_turn_sock_cfg cfg; + /** * Specify the TURN server domain or hostname or IP address. * If DNS SRV resolution is required, application must fill @@ -324,9 +331,82 @@ typedef struct pj_ice_strans_cfg } turn; + /** + * Component specific settings, which will override the settings in + * the STUN and TURN settings above. For example, setting the QoS + * parameters here allows the application to have different QoS + * traffic type for RTP and RTCP component. + */ + struct { + /** + * QoS traffic type to be set on this transport. When application + * wants to apply QoS tagging to the transport, it's preferable to + * set this field rather than \a qos_param fields since this is + * more portable. + * + * Default value is PJ_QOS_TYPE_BEST_EFFORT. + */ + pj_qos_type qos_type; + + /** + * Set the low level QoS parameters to the transport. This is a + * lower level operation than setting the \a qos_type field and + * may not be supported on all platforms. + * + * By default all settings in this structure are disabled. + */ + pj_qos_params qos_params; + + } comp[PJ_ICE_MAX_COMP]; + } pj_ice_strans_cfg; +/** + * ICE stream transport's state. + */ +typedef enum pj_ice_strans_state +{ + /** + * ICE stream transport is not created. + */ + PJ_ICE_STRANS_STATE_NULL, + + /** + * ICE candidate gathering process is in progress. + */ + PJ_ICE_STRANS_STATE_INIT, + + /** + * ICE stream transport initialization/candidate gathering process is + * complete, ICE session may be created on this stream transport. + */ + PJ_ICE_STRANS_STATE_READY, + + /** + * New session has been created and the session is ready. + */ + PJ_ICE_STRANS_STATE_SESS_READY, + + /** + * ICE negotiation is in progress. + */ + PJ_ICE_STRANS_STATE_NEGO, + + /** + * ICE negotiation has completed successfully and media is ready + * to be used. + */ + PJ_ICE_STRANS_STATE_RUNNING, + + /** + * ICE negotiation has completed with failure. + */ + PJ_ICE_STRANS_STATE_FAILED + +} pj_ice_strans_state; + + /** * Initialize ICE transport configuration with default values. * @@ -370,6 +450,26 @@ PJ_DECL(pj_status_t) pj_ice_strans_create(const char *name, const pj_ice_strans_cb *cb, pj_ice_strans **p_ice_st); +/** + * Get ICE session state. + * + * @param ice_st The ICE stream transport. + * + * @return ICE session state. + */ +PJ_DECL(pj_ice_strans_state) pj_ice_strans_get_state(pj_ice_strans *ice_st); + + +/** + * Get string representation of ICE state. + * + * @param state ICE stream transport state. + * + * @return String. + */ +PJ_DECL(const char*) pj_ice_strans_state_name(pj_ice_strans_state state); + + /** * Destroy the ICE stream transport. This will destroy the ICE session * inside the ICE stream transport, close all sockets and release all @@ -521,6 +621,17 @@ PJ_DECL(pj_status_t) pj_ice_strans_get_ufrag_pwd(pj_ice_strans *ice_st, pj_str_t *rem_pwd); +/** + * Get the number of local candidates for the specified component ID. + * + * @param ice_st The ICE stream transport. + * @param comp_id Component ID. + * + * @return The number of candidates. + */ +PJ_DECL(unsigned) pj_ice_strans_get_cands_count(pj_ice_strans *ice_st, + unsigned comp_id); + /** * Enumerate the local candidates for the specified component. * diff --git a/sflphone-common/libs/pjproject/pjnath/include/pjnath/stun_sock.h b/sflphone-common/libs/pjproject/pjnath/include/pjnath/stun_sock.h index 0e7a2bce0f837796d3fd4af2ee63173aa550e3e1..a4fd2676c2e13998b9a9767fca8853da98cc78dc 100644 --- a/sflphone-common/libs/pjproject/pjnath/include/pjnath/stun_sock.h +++ b/sflphone-common/libs/pjproject/pjnath/include/pjnath/stun_sock.h @@ -1,4 +1,4 @@ -/* $Id: stun_sock.h 2642 2009-04-22 17:20:24Z bennylp $ */ +/* $Id: stun_sock.h 2966 2009-10-25 09:02:07Z bennylp $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> @@ -28,6 +28,7 @@ #include <pjlib-util/resolver.h> #include <pj/ioqueue.h> #include <pj/sock.h> +#include <pj/sock_qos.h> PJ_BEGIN_DECL @@ -247,6 +248,32 @@ typedef struct pj_stun_sock_cfg */ int ka_interval; + /** + * QoS traffic type to be set on this transport. When application wants + * to apply QoS tagging to the transport, it's preferable to set this + * field rather than \a qos_param fields since this is more portable. + * + * Default value is PJ_QOS_TYPE_BEST_EFFORT. + */ + pj_qos_type qos_type; + + /** + * Set the low level QoS parameters to the transport. This is a lower + * level operation than setting the \a qos_type field and may not be + * supported on all platforms. + * + * By default all settings in this structure are disabled. + */ + pj_qos_params qos_params; + + /** + * Specify if STUN socket should ignore any errors when setting the QoS + * traffic type/parameters. + * + * Default: PJ_TRUE + */ + pj_bool_t qos_ignore_error; + } pj_stun_sock_cfg; diff --git a/sflphone-common/libs/pjproject/pjnath/include/pjnath/turn_session.h b/sflphone-common/libs/pjproject/pjnath/include/pjnath/turn_session.h index b083bf727775b6009efb00ea02b4c49422ec20d0..7ea6ed2ecceeb55b1054073d04bf7c28ab98d6a2 100644 --- a/sflphone-common/libs/pjproject/pjnath/include/pjnath/turn_session.h +++ b/sflphone-common/libs/pjproject/pjnath/include/pjnath/turn_session.h @@ -1,4 +1,4 @@ -/* $Id: turn_session.h 2642 2009-04-22 17:20:24Z bennylp $ */ +/* $Id: turn_session.h 3028 2009-12-08 13:11:25Z bennylp $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> @@ -455,11 +455,19 @@ PJ_DECL(pj_status_t) pj_turn_session_shutdown(pj_turn_session *sess); * be notified about the client destruction. * * @param sess The TURN client session. + * @param last_err Optional error code to be set to the session, + * which would be returned back in the \a info + * parameter of #pj_turn_session_get_info(). If + * this argument value is PJ_SUCCESS, the error + * code will not be set. If the session already + * has an error code set, this function will not + * overwrite that error code either. * * @return PJ_SUCCESS if the operation has been successful, * or the appropriate error code on failure. */ -PJ_DECL(pj_status_t) pj_turn_session_destroy(pj_turn_session *sess); +PJ_DECL(pj_status_t) pj_turn_session_destroy(pj_turn_session *sess, + pj_status_t last_err); /** diff --git a/sflphone-common/libs/pjproject/pjnath/include/pjnath/turn_sock.h b/sflphone-common/libs/pjproject/pjnath/include/pjnath/turn_sock.h index fdad56197badd248f331a9d18727fd2637160da4..3bbb26ce13a9f35faeddf33ff67e2b98cda61380 100644 --- a/sflphone-common/libs/pjproject/pjnath/include/pjnath/turn_sock.h +++ b/sflphone-common/libs/pjproject/pjnath/include/pjnath/turn_sock.h @@ -1,4 +1,4 @@ -/* $Id: turn_sock.h 2642 2009-04-22 17:20:24Z bennylp $ */ +/* $Id: turn_sock.h 2966 2009-10-25 09:02:07Z bennylp $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> @@ -25,6 +25,7 @@ * @brief TURN relay using UDP client as transport protocol */ #include <pjnath/turn_session.h> +#include <pj/sock_qos.h> PJ_BEGIN_DECL @@ -100,6 +101,48 @@ typedef struct pj_turn_sock_cb } pj_turn_sock_cb; +/** + * This structure describes options that can be specified when creating + * the TURN socket. Application should call #pj_turn_sock_cfg_default() + * to initialize this structure with its default values before using it. + */ +typedef struct pj_turn_sock_cfg +{ + /** + * QoS traffic type to be set on this transport. When application wants + * to apply QoS tagging to the transport, it's preferable to set this + * field rather than \a qos_param fields since this is more portable. + * + * Default value is PJ_QOS_TYPE_BEST_EFFORT. + */ + pj_qos_type qos_type; + + /** + * Set the low level QoS parameters to the transport. This is a lower + * level operation than setting the \a qos_type field and may not be + * supported on all platforms. + * + * By default all settings in this structure are not set. + */ + pj_qos_params qos_params; + + /** + * Specify if STUN socket should ignore any errors when setting the QoS + * traffic type/parameters. + * + * Default: PJ_TRUE + */ + pj_bool_t qos_ignore_error; + +} pj_turn_sock_cfg; + + +/** + * Initialize pj_turn_sock_cfg structure with default values. + */ +PJ_DECL(void) pj_turn_sock_cfg_default(pj_turn_sock_cfg *cfg); + + /** * Create a TURN transport instance with the specified address family and * connection type. Once TURN transport instance is created, application @@ -114,7 +157,9 @@ typedef struct pj_turn_sock_cb * @param conn_type Connection type to the TURN server. Both TCP and * UDP are supported. * @param cb Callback to receive events from the TURN transport. - * @param options Option flags, currently this value must be zero. + * @param setting Optional settings to be specified to the transport. + * If this parameter is NULL, default values will be + * used. * @param user_data Arbitrary application data to be associated with * this transport. * @param p_turn_sock Pointer to receive the created instance of the @@ -127,7 +172,7 @@ PJ_DECL(pj_status_t) pj_turn_sock_create(pj_stun_config *cfg, int af, pj_turn_tp_type conn_type, const pj_turn_sock_cb *cb, - unsigned options, + const pj_turn_sock_cfg *setting, void *user_data, pj_turn_sock **p_turn_sock); diff --git a/sflphone-common/libs/pjproject/pjnath/src/pjnath-test/stun.c b/sflphone-common/libs/pjproject/pjnath/src/pjnath-test/stun.c index 587c5a2e4628be262841b4b987c7cb557abb67ba..bfda94244edffe0c47701aa00b7331a56751b5c7 100644 --- a/sflphone-common/libs/pjproject/pjnath/src/pjnath-test/stun.c +++ b/sflphone-common/libs/pjproject/pjnath/src/pjnath-test/stun.c @@ -1,4 +1,4 @@ -/* $Id: stun.c 2775 2009-06-18 14:04:44Z nanang $ */ +/* $Id: stun.c 2938 2009-10-11 05:06:43Z bennylp $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> @@ -479,7 +479,9 @@ static struct test_vector "", "", &create_msgint1 - }, + } + /* disabled: see http://trac.pjsip.org/repos/ticket/960 + , { PJ_STUN_BINDING_RESPONSE, "\xb7\xe7\xa7\x01\xbc\x34\xd6\x86\xfa\x87\xdf\xae", @@ -503,6 +505,9 @@ static struct test_vector "", &create_msgint2 } + */ + + /* disabled: see http://trac.pjsip.org/repos/ticket/960 #if defined(PJ_HAS_IPV6) && PJ_HAS_IPV6!=0 , { @@ -542,6 +547,7 @@ static struct test_vector &create_msgint3 } #endif + */ }; @@ -591,6 +597,10 @@ static int fingerprint_test_vector() unsigned i; int rc = 0; + /* To avoid function not referenced warnings */ + (void)create_msgint2; + (void)create_msgint3; + PJ_LOG(3,(THIS_FILE, " draft-denis-behave-rfc3489bis-test-vectors-02")); pool = pj_pool_create(mem, "fingerprint", 1024, 1024, NULL); diff --git a/sflphone-common/libs/pjproject/pjnath/src/pjnath/ice_session.c b/sflphone-common/libs/pjproject/pjnath/src/pjnath/ice_session.c index 80c27358dcef530fef0c5cefb0828d17d7596862..3a7727d0c9f92f1d28ad44f070ac100f03930564 100644 --- a/sflphone-common/libs/pjproject/pjnath/src/pjnath/ice_session.c +++ b/sflphone-common/libs/pjproject/pjnath/src/pjnath/ice_session.c @@ -1,4 +1,4 @@ -/* $Id: ice_session.c 2827 2009-07-02 11:09:23Z nanang $ */ +/* $Id: ice_session.c 3022 2009-11-23 15:02:18Z bennylp $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> @@ -531,7 +531,9 @@ PJ_DEF(pj_status_t) pj_ice_sess_set_prefs(pj_ice_sess *ice, ice->prefs = (pj_uint8_t*) pj_pool_calloc(ice->pool, PJ_ARRAY_SIZE(prefs), sizeof(pj_uint8_t)); for (i=0; i<4; ++i) { +#if PJ_ICE_CAND_TYPE_PREF_BITS < 8 pj_assert(prefs[i] < (2 << PJ_ICE_CAND_TYPE_PREF_BITS)); +#endif ice->prefs[i] = prefs[i]; } return PJ_SUCCESS; @@ -947,12 +949,24 @@ static void clist_set_state(pj_ice_sess *ice, pj_ice_sess_checklist *clist, } /* Sort checklist based on priority */ -static void sort_checklist(pj_ice_sess_checklist *clist) +static void sort_checklist(pj_ice_sess *ice, pj_ice_sess_checklist *clist) { unsigned i; + pj_ice_sess_check **check_ptr[PJ_ICE_MAX_COMP*2]; + unsigned check_ptr_cnt = 0; + + for (i=0; i<ice->comp_cnt; ++i) { + if (ice->comp[i].valid_check) { + check_ptr[check_ptr_cnt++] = &ice->comp[i].valid_check; + } + if (ice->comp[i].nominated_check) { + check_ptr[check_ptr_cnt++] = &ice->comp[i].nominated_check; + } + } for (i=0; i<clist->count-1; ++i) { unsigned j, highest = i; + for (j=i+1; j<clist->count; ++j) { if (CMP_CHECK_PRIO(&clist->checks[j], &clist->checks[highest]) > 0) { highest = j; @@ -961,12 +975,23 @@ static void sort_checklist(pj_ice_sess_checklist *clist) if (highest != i) { pj_ice_sess_check tmp; + unsigned k; pj_memcpy(&tmp, &clist->checks[i], sizeof(pj_ice_sess_check)); pj_memcpy(&clist->checks[i], &clist->checks[highest], sizeof(pj_ice_sess_check)); pj_memcpy(&clist->checks[highest], &tmp, sizeof(pj_ice_sess_check)); + + /* Update valid and nominated check pointers, since we're moving + * around checks + */ + for (k=0; k<check_ptr_cnt; ++k) { + if (*check_ptr[k] == &clist->checks[highest]) + *check_ptr[k] = &clist->checks[i]; + else if (*check_ptr[k] == &clist->checks[i]) + *check_ptr[k] = &clist->checks[highest]; + } } } } @@ -1099,6 +1124,7 @@ static void on_timer(pj_timer_heap_t *th, pj_timer_entry *te) { pj_ice_sess *ice = (pj_ice_sess*) te->user_data; enum timer_type type = (enum timer_type)te->id; + pj_bool_t has_mutex = PJ_TRUE; PJ_UNUSED_ARG(th); @@ -1114,16 +1140,27 @@ static void on_timer(pj_timer_heap_t *th, pj_timer_entry *te) on_ice_complete(ice, PJNATH_EICENOMTIMEOUT); break; case TIMER_COMPLETION_CALLBACK: - /* Start keep-alive timer but don't send any packets yet. - * Need to do it here just in case app destroy the session - * in the callback. - */ - if (ice->ice_status == PJ_SUCCESS) - ice_keep_alive(ice, PJ_FALSE); + { + void (*on_ice_complete)(pj_ice_sess *ice, pj_status_t status); + pj_status_t ice_status; + + /* Start keep-alive timer but don't send any packets yet. + * Need to do it here just in case app destroy the session + * in the callback. + */ + if (ice->ice_status == PJ_SUCCESS) + ice_keep_alive(ice, PJ_FALSE); - /* Notify app about ICE completion*/ - if (ice->cb.on_ice_complete) - (*ice->cb.on_ice_complete)(ice, ice->ice_status); + /* Release mutex in case app destroy us in the callback */ + ice_status = ice->ice_status; + on_ice_complete = ice->cb.on_ice_complete; + has_mutex = PJ_FALSE; + pj_mutex_unlock(ice->mutex); + + /* Notify app about ICE completion*/ + if (on_ice_complete) + (*on_ice_complete)(ice, ice_status); + } break; case TIMER_START_NOMINATED_CHECK: start_nominated_check(ice); @@ -1136,7 +1173,8 @@ static void on_timer(pj_timer_heap_t *th, pj_timer_entry *te) break; } - pj_mutex_unlock(ice->mutex); + if (has_mutex) + pj_mutex_unlock(ice->mutex); } /* Send keep-alive */ @@ -1651,7 +1689,7 @@ PJ_DEF(pj_status_t) pj_ice_sess_create_check_list( } /* Sort checklist based on priority */ - sort_checklist(clist); + sort_checklist(ice, clist); /* Prune the checklist */ status = prune_checklist(ice, clist); @@ -1904,7 +1942,7 @@ static void start_nominated_check(pj_ice_sess *ice) } /* And (re)start the periodic check */ - if (!ice->clist.timer.id) { + if (ice->clist.timer.id) { pj_timer_heap_cancel(ice->stun_cfg.timer_heap, &ice->clist.timer); ice->clist.timer.id = PJ_FALSE; } @@ -2313,12 +2351,14 @@ static void on_stun_request_complete(pj_stun_session *stun_sess, ice->valid_list.checks[i].nominated = check->nominated; } - /* Sort valid_list */ - sort_checklist(&ice->valid_list); - /* Update valid check and nominated check for the component */ update_comp_check(ice, new_check->lcand->comp_id, new_check); + /* Sort valid_list (must do so after update_comp_check(), otherwise + * new_check will point to something else (#953) + */ + sort_checklist(ice, &ice->valid_list); + /* 7.1.2.2.2. Updating Pair States * * The agent sets the state of the pair that generated the check to diff --git a/sflphone-common/libs/pjproject/pjnath/src/pjnath/ice_strans.c b/sflphone-common/libs/pjproject/pjnath/src/pjnath/ice_strans.c index 17656565344779bf4d921594e22e18e6dd8f3c33..fa6c067b9a0a418d0f0cb3cc4496a063b46cf707 100644 --- a/sflphone-common/libs/pjproject/pjnath/src/pjnath/ice_strans.c +++ b/sflphone-common/libs/pjproject/pjnath/src/pjnath/ice_strans.c @@ -1,4 +1,4 @@ -/* $Id: ice_strans.c 2724 2009-05-29 13:04:03Z bennylp $ */ +/* $Id: ice_strans.c 3028 2009-12-08 13:11:25Z bennylp $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> @@ -173,6 +173,7 @@ struct pj_ice_strans pj_ice_strans_cb cb; /**< Application callback. */ pj_lock_t *init_lock; /**< Initialization mutex. */ + pj_ice_strans_state state; /**< Session state. */ pj_ice_sess *ice; /**< ICE session. */ pj_time_val start_time;/**< Time when ICE was started */ @@ -210,6 +211,7 @@ PJ_DEF(void) pj_ice_strans_cfg_default(pj_ice_strans_cfg *cfg) pj_stun_config_init(&cfg->stun_cfg, NULL, 0, NULL, NULL); pj_stun_sock_cfg_default(&cfg->stun.cfg); pj_turn_alloc_param_default(&cfg->turn.alloc_param); + pj_turn_sock_cfg_default(&cfg->turn.cfg); pj_ice_sess_options_default(&cfg->opt); @@ -272,6 +274,17 @@ static pj_status_t create_comp(pj_ice_strans *ice_st, unsigned comp_id) stun_sock_cb.on_status = &stun_on_status; stun_sock_cb.on_data_sent = &stun_on_data_sent; + /* Override component specific QoS settings, if any */ + if (ice_st->cfg.comp[comp_id-1].qos_type) { + ice_st->cfg.stun.cfg.qos_type = + ice_st->cfg.comp[comp_id-1].qos_type; + } + if (ice_st->cfg.comp[comp_id-1].qos_params.flags) { + pj_memcpy(&ice_st->cfg.stun.cfg.qos_params, + &ice_st->cfg.comp[comp_id-1].qos_params, + sizeof(ice_st->cfg.stun.cfg.qos_params)); + } + /* Create the STUN transport */ status = pj_stun_sock_create(&ice_st->cfg.stun_cfg, NULL, ice_st->cfg.af, &stun_sock_cb, @@ -390,10 +403,22 @@ static pj_status_t create_comp(pj_ice_strans *ice_st, unsigned comp_id) turn_sock_cb.on_rx_data = &turn_on_rx_data; turn_sock_cb.on_state = &turn_on_state; + /* Override with component specific QoS settings, if any */ + if (ice_st->cfg.comp[comp_id-1].qos_type) { + ice_st->cfg.turn.cfg.qos_type = + ice_st->cfg.comp[comp_id-1].qos_type; + } + if (ice_st->cfg.comp[comp_id-1].qos_params.flags) { + pj_memcpy(&ice_st->cfg.turn.cfg.qos_params, + &ice_st->cfg.comp[comp_id-1].qos_params, + sizeof(ice_st->cfg.turn.cfg.qos_params)); + } + + /* Create the TURN transport */ status = pj_turn_sock_create(&ice_st->cfg.stun_cfg, ice_st->cfg.af, ice_st->cfg.turn.conn_type, - &turn_sock_cb, 0, comp, - &comp->turn_sock); + &turn_sock_cb, &ice_st->cfg.turn.cfg, + comp, &comp->turn_sock); if (status != PJ_SUCCESS) { return status; } @@ -452,7 +477,8 @@ PJ_DEF(pj_status_t) pj_ice_strans_create( const char *name, if (status != PJ_SUCCESS) return status; - PJ_ASSERT_RETURN(comp_cnt && cb && p_ice_st, PJ_EINVAL); + PJ_ASSERT_RETURN(comp_cnt && cb && p_ice_st && + comp_cnt <= PJ_ICE_MAX_COMP , PJ_EINVAL); if (name == NULL) name = "ice%p"; @@ -488,6 +514,9 @@ PJ_DEF(pj_status_t) pj_ice_strans_create( const char *name, ice_st->comp = (pj_ice_strans_comp**) pj_pool_calloc(pool, comp_cnt, sizeof(pj_ice_strans_comp*)); + /* Move state to candidate gathering */ + ice_st->state = PJ_ICE_STRANS_STATE_INIT; + /* Acquire initialization mutex to prevent callback to be * called before we finish initialization. */ @@ -561,6 +590,29 @@ static void destroy_ice_st(pj_ice_strans *ice_st) pj_pool_release(ice_st->pool); } +/* Get ICE session state. */ +PJ_DEF(pj_ice_strans_state) pj_ice_strans_get_state(pj_ice_strans *ice_st) +{ + return ice_st->state; +} + +/* State string */ +PJ_DEF(const char*) pj_ice_strans_state_name(pj_ice_strans_state state) +{ + const char *names[] = { + "Null", + "Candidate Gathering", + "Candidate Gathering Complete", + "Session Initialized", + "Negotiation In Progress", + "Negotiation Success", + "Negotiation Failed" + }; + + PJ_ASSERT_RETURN(state <= PJ_ICE_STRANS_STATE_FAILED, "???"); + return names[state]; +} + /* Notification about failure */ static void sess_fail(pj_ice_strans *ice_st, pj_ice_strans_op op, const char *title, pj_status_t status) @@ -603,6 +655,7 @@ static void sess_init_update(pj_ice_strans *ice_st) /* All candidates have been gathered */ ice_st->cb_called = PJ_TRUE; + ice_st->state = PJ_ICE_STRANS_STATE_READY; if (ice_st->cb.on_ice_complete) (*ice_st->cb.on_ice_complete)(ice_st, PJ_ICE_STRANS_OP_INIT, PJ_SUCCESS); @@ -782,6 +835,9 @@ PJ_DEF(pj_status_t) pj_ice_strans_init_ice(pj_ice_strans *ice_st, } } + /* ICE session is ready for negotiation */ + ice_st->state = PJ_ICE_STRANS_STATE_SESS_READY; + return PJ_SUCCESS; on_error: @@ -855,6 +911,27 @@ PJ_DEF(pj_status_t) pj_ice_strans_get_ufrag_pwd( pj_ice_strans *ice_st, return PJ_SUCCESS; } +/* + * Get number of candidates + */ +PJ_DEF(unsigned) pj_ice_strans_get_cands_count(pj_ice_strans *ice_st, + unsigned comp_id) +{ + unsigned i, cnt; + + PJ_ASSERT_RETURN(ice_st && ice_st->ice && comp_id && + comp_id <= ice_st->comp_cnt, 0); + + cnt = 0; + for (i=0; i<ice_st->ice->lcand_cnt; ++i) { + if (ice_st->ice->lcand[i].comp_id != comp_id) + continue; + ++cnt; + } + + return cnt; +} + /* * Enum candidates */ @@ -982,6 +1059,7 @@ PJ_DEF(pj_status_t) pj_ice_strans_start_ice( pj_ice_strans *ice_st, return status; } + ice_st->state = PJ_ICE_STRANS_STATE_NEGO; return status; } @@ -1011,6 +1089,7 @@ PJ_DEF(pj_status_t) pj_ice_strans_stop_ice(pj_ice_strans *ice_st) ice_st->ice = NULL; } + ice_st->state = PJ_ICE_STRANS_STATE_INIT; return PJ_SUCCESS; } @@ -1169,6 +1248,9 @@ static void on_ice_complete(pj_ice_sess *ice, pj_status_t status) } } + ice_st->state = (status==PJ_SUCCESS) ? PJ_ICE_STRANS_STATE_RUNNING : + PJ_ICE_STRANS_STATE_FAILED; + (*ice_st->cb.on_ice_complete)(ice_st, PJ_ICE_STRANS_OP_NEGOTIATION, status); diff --git a/sflphone-common/libs/pjproject/pjnath/src/pjnath/stun_msg.c b/sflphone-common/libs/pjproject/pjnath/src/pjnath/stun_msg.c index 00f0cf148f04dbf87054a2afa34d228908dca09a..a90b0aeb9859ba848d35a0199ee86c7f7ee5301d 100644 --- a/sflphone-common/libs/pjproject/pjnath/src/pjnath/stun_msg.c +++ b/sflphone-common/libs/pjproject/pjnath/src/pjnath/stun_msg.c @@ -1,4 +1,4 @@ -/* $Id: stun_msg.c 2691 2009-05-12 10:01:21Z bennylp $ */ +/* $Id: stun_msg.c 2928 2009-10-07 08:38:02Z bennylp $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> @@ -1234,8 +1234,23 @@ static pj_status_t encode_string_attr(const void *a, pj_uint8_t *buf, } PUTVAL16H(buf, 0, ca->hdr.type); - PUTVAL16H(buf, 2, (pj_uint16_t)ca->value.slen); - + + /* Special treatment for SOFTWARE attribute: + * This attribute had caused interop problem when talking to + * legacy RFC 3489 STUN servers, due to different "length" + * rules with RFC 5389. + */ + if (msghdr->magic != PJ_STUN_MAGIC || + ca->hdr.type == PJ_STUN_ATTR_SOFTWARE) + { + /* Set the length to be 4-bytes aligned so that we can + * communicate with RFC 3489 endpoints + */ + PUTVAL16H(buf, 2, (pj_uint16_t)((ca->value.slen + 3) & (~3))); + } else { + /* Use RFC 5389 rule */ + PUTVAL16H(buf, 2, (pj_uint16_t)ca->value.slen); + } /* Copy the string */ pj_memcpy(buf+ATTR_HDR_LEN, ca->value.ptr, ca->value.slen); diff --git a/sflphone-common/libs/pjproject/pjnath/src/pjnath/stun_session.c b/sflphone-common/libs/pjproject/pjnath/src/pjnath/stun_session.c index 414d422889b081f9d2ac3ddae3af66abdbee3c1f..5b149d5834ca51ea912bcce183716bc1a4a708d7 100644 --- a/sflphone-common/libs/pjproject/pjnath/src/pjnath/stun_session.c +++ b/sflphone-common/libs/pjproject/pjnath/src/pjnath/stun_session.c @@ -1,4 +1,4 @@ -/* $Id: stun_session.c 2773 2009-06-17 19:14:20Z bennylp $ */ +/* $Id: stun_session.c 2938 2009-10-11 05:06:43Z bennylp $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> @@ -227,7 +227,7 @@ static pj_status_t apply_msg_options(pj_stun_session *sess, if (sess->srv_name.slen && pj_stun_msg_find_attr(msg, PJ_STUN_ATTR_SOFTWARE, 0)==NULL && (PJ_STUN_IS_RESPONSE(msg->hdr.type) || - PJ_STUN_IS_REQUEST(msg->hdr.type) && msg->hdr.magic==PJ_STUN_MAGIC)) + (PJ_STUN_IS_REQUEST(msg->hdr.type) && msg->hdr.magic==PJ_STUN_MAGIC))) { pj_stun_msg_add_string_attr(pool, msg, PJ_STUN_ATTR_SOFTWARE, &sess->srv_name); diff --git a/sflphone-common/libs/pjproject/pjnath/src/pjnath/stun_sock.c b/sflphone-common/libs/pjproject/pjnath/src/pjnath/stun_sock.c index 213b05cf2a7e860997daedeb4499c176bfe1aa6c..2ba37f82e0fbd7cbebda7e359a2f88f18d2a8405 100644 --- a/sflphone-common/libs/pjproject/pjnath/src/pjnath/stun_sock.c +++ b/sflphone-common/libs/pjproject/pjnath/src/pjnath/stun_sock.c @@ -1,4 +1,4 @@ -/* $Id: stun_sock.c 2667 2009-04-30 17:14:50Z bennylp $ */ +/* $Id: stun_sock.c 2993 2009-11-09 04:32:33Z bennylp $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> @@ -136,6 +136,8 @@ PJ_DEF(void) pj_stun_sock_cfg_default(pj_stun_sock_cfg *cfg) cfg->max_pkt_size = PJ_STUN_SOCK_PKT_LEN; cfg->async_cnt = 1; cfg->ka_interval = PJ_STUN_KEEP_ALIVE_SEC; + cfg->qos_type = PJ_QOS_TYPE_BEST_EFFORT; + cfg->qos_ignore_error = PJ_TRUE; } @@ -200,6 +202,14 @@ PJ_DEF(pj_status_t) pj_stun_sock_create( pj_stun_config *stun_cfg, if (status != PJ_SUCCESS) goto on_error; + /* Apply QoS, if specified */ + status = pj_sock_apply_qos2(stun_sock->sock_fd, cfg->qos_type, + &cfg->qos_params, 2, stun_sock->obj_name, + NULL); + if (status != PJ_SUCCESS && !cfg->qos_ignore_error) + goto on_error; + + /* Bind socket */ if (pj_sockaddr_has_addr(&cfg->bound_addr)) { status = pj_sock_bind(stun_sock->sock_fd, &cfg->bound_addr, pj_sockaddr_get_len(&cfg->bound_addr)); @@ -429,12 +439,11 @@ static pj_bool_t sess_fail(pj_stun_sock *stun_sock, pj_stun_sock_op op, pj_status_t status) { - char errmsg[PJ_ERR_MSG_SIZE]; pj_bool_t ret; - pj_strerror(status, errmsg, sizeof(errmsg)); - PJ_LOG(4,(stun_sock->obj_name, "Session failed because %s failed: %s", - pj_stun_sock_op_name(op), errmsg)); + PJ_PERROR(4,(stun_sock->obj_name, status, + "Session failed because %s failed", + pj_stun_sock_op_name(op))); ret = (*stun_sock->cb.on_status)(stun_sock, op, status); @@ -758,10 +767,7 @@ static pj_bool_t on_data_recvfrom(pj_activesock_t *asock, /* Log socket error */ if (status != PJ_SUCCESS) { - char errmsg[PJ_ERR_MSG_SIZE]; - - pj_strerror(status, errmsg, sizeof(errmsg)); - PJ_LOG(2,(stun_sock->obj_name, "recvfrom() error: %s", errmsg)); + PJ_PERROR(2,(stun_sock->obj_name, status, "recvfrom() error")); return PJ_TRUE; } diff --git a/sflphone-common/libs/pjproject/pjnath/src/pjnath/turn_session.c b/sflphone-common/libs/pjproject/pjnath/src/pjnath/turn_session.c index 1c264968acbd646dfd7ddfeac6ae238364f3da91..98a7371cd49c58e1684265a0622acbc1dbc17b9e 100644 --- a/sflphone-common/libs/pjproject/pjnath/src/pjnath/turn_session.c +++ b/sflphone-common/libs/pjproject/pjnath/src/pjnath/turn_session.c @@ -1,4 +1,4 @@ -/* $Id: turn_session.c 2774 2009-06-17 19:20:11Z bennylp $ */ +/* $Id: turn_session.c 3028 2009-12-08 13:11:25Z bennylp $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> @@ -461,10 +461,13 @@ PJ_DEF(pj_status_t) pj_turn_session_shutdown(pj_turn_session *sess) /** * Forcefully destroy the TURN session. */ -PJ_DEF(pj_status_t) pj_turn_session_destroy( pj_turn_session *sess) +PJ_DEF(pj_status_t) pj_turn_session_destroy( pj_turn_session *sess, + pj_status_t last_err) { PJ_ASSERT_RETURN(sess, PJ_EINVAL); + if (last_err != PJ_SUCCESS && sess->last_status == PJ_SUCCESS) + sess->last_status = last_err; set_state(sess, PJ_TURN_STATE_DEALLOCATED); sess_shutdown(sess, PJ_SUCCESS); return PJ_SUCCESS; @@ -959,12 +962,16 @@ PJ_DEF(pj_status_t) pj_turn_session_sendto( pj_turn_session *sess, ch = lookup_ch_by_addr(sess, addr, pj_sockaddr_get_len(addr), PJ_FALSE, PJ_FALSE); if (ch && ch->num != PJ_TURN_INVALID_CHANNEL && ch->bound) { + unsigned total_len; + /* Peer is assigned a channel number, we can use ChannelData */ pj_turn_channel_data *cd = (pj_turn_channel_data*)sess->tx_pkt; pj_assert(sizeof(*cd)==4); - if (pkt_len > sizeof(sess->tx_pkt)-sizeof(*cd)) { + /* Calculate total length, including paddings */ + total_len = (pkt_len + sizeof(*cd) + 3) & (~3); + if (total_len > sizeof(sess->tx_pkt)) { status = PJ_ETOOBIG; goto on_return; } @@ -975,7 +982,7 @@ PJ_DEF(pj_status_t) pj_turn_session_sendto( pj_turn_session *sess, pj_assert(sess->srv_addr != NULL); - status = sess->cb.on_send_pkt(sess, sess->tx_pkt, pkt_len+sizeof(*cd), + status = sess->cb.on_send_pkt(sess, sess->tx_pkt, total_len, sess->srv_addr, pj_sockaddr_get_len(sess->srv_addr)); @@ -1156,7 +1163,8 @@ PJ_DEF(pj_status_t) pj_turn_session_on_rx_pkt(pj_turn_session *sess, goto on_return; } else { if (parsed_len) { - *parsed_len = cd.length + sizeof(cd); + /* Apply padding too */ + *parsed_len = ((cd.length + 3) & (~3)) + sizeof(cd); } } diff --git a/sflphone-common/libs/pjproject/pjnath/src/pjnath/turn_sock.c b/sflphone-common/libs/pjproject/pjnath/src/pjnath/turn_sock.c index 53a4d2a840ac0a0f3dbfd9443b4e83374dd56b5a..70acf7481d775b095974ec2efec89bda68c38108 100644 --- a/sflphone-common/libs/pjproject/pjnath/src/pjnath/turn_sock.c +++ b/sflphone-common/libs/pjproject/pjnath/src/pjnath/turn_sock.c @@ -1,4 +1,4 @@ -/* $Id: turn_sock.c 2642 2009-04-22 17:20:24Z bennylp $ */ +/* $Id: turn_sock.c 3028 2009-12-08 13:11:25Z bennylp $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> @@ -46,6 +46,7 @@ struct pj_turn_sock pj_turn_alloc_param alloc_param; pj_stun_config cfg; + pj_turn_sock_cfg setting; pj_bool_t destroy_request; pj_timer_entry timer; @@ -92,6 +93,14 @@ static void destroy(pj_turn_sock *turn_sock); static void timer_cb(pj_timer_heap_t *th, pj_timer_entry *e); +/* Init config */ +PJ_DEF(void) pj_turn_sock_cfg_default(pj_turn_sock_cfg *cfg) +{ + pj_bzero(cfg, sizeof(*cfg)); + cfg->qos_type = PJ_QOS_TYPE_BEST_EFFORT; + cfg->qos_ignore_error = PJ_TRUE; +} + /* * Create. */ @@ -99,21 +108,26 @@ PJ_DEF(pj_status_t) pj_turn_sock_create(pj_stun_config *cfg, int af, pj_turn_tp_type conn_type, const pj_turn_sock_cb *cb, - unsigned options, + const pj_turn_sock_cfg *setting, void *user_data, pj_turn_sock **p_turn_sock) { pj_turn_sock *turn_sock; pj_turn_session_cb sess_cb; + pj_turn_sock_cfg default_setting; pj_pool_t *pool; const char *name_tmpl; pj_status_t status; PJ_ASSERT_RETURN(cfg && p_turn_sock, PJ_EINVAL); PJ_ASSERT_RETURN(af==pj_AF_INET() || af==pj_AF_INET6(), PJ_EINVAL); - PJ_ASSERT_RETURN(options==0, PJ_EINVAL); PJ_ASSERT_RETURN(conn_type!=PJ_TURN_TP_TCP || PJ_HAS_TCP, PJ_EINVAL); + if (!setting) { + pj_turn_sock_cfg_default(&default_setting); + setting = &default_setting; + } + switch (conn_type) { case PJ_TURN_TP_UDP: name_tmpl = "udprel%p"; @@ -139,6 +153,9 @@ PJ_DEF(pj_status_t) pj_turn_sock_create(pj_stun_config *cfg, /* Copy STUN config (this contains ioqueue, timer heap, etc.) */ pj_memcpy(&turn_sock->cfg, cfg, sizeof(*cfg)); + /* Copy setting (QoS parameters etc */ + pj_memcpy(&turn_sock->setting, setting, sizeof(*setting)); + /* Set callback */ if (cb) { pj_memcpy(&turn_sock->cb, cb, sizeof(*cb)); @@ -256,14 +273,7 @@ static void timer_cb(pj_timer_heap_t *th, pj_timer_entry *e) static void show_err(pj_turn_sock *turn_sock, const char *title, pj_status_t status) { - char errmsg[PJ_ERR_MSG_SIZE]; - - if (status != PJ_SUCCESS) { - pj_strerror(status, errmsg, sizeof(errmsg)); - PJ_LOG(4,(turn_sock->obj_name, "%s: %s", title, errmsg)); - } else { - PJ_LOG(4,(turn_sock->obj_name, "%s", title, errmsg)); - } + PJ_PERROR(4,(turn_sock->obj_name, status, title)); } /* On error, terminate session */ @@ -271,8 +281,9 @@ static void sess_fail(pj_turn_sock *turn_sock, const char *title, pj_status_t status) { show_err(turn_sock, title, status); - if (turn_sock->sess) - pj_turn_session_destroy(turn_sock->sess); + if (turn_sock->sess) { + pj_turn_session_destroy(turn_sock->sess, status); + } } /* @@ -477,6 +488,49 @@ static pj_bool_t on_connect_complete(pj_activesock_t *asock, return PJ_TRUE; } +static pj_uint16_t GETVAL16H(const pj_uint8_t *buf, unsigned pos) +{ + return (pj_uint16_t) ((buf[pos + 0] << 8) | \ + (buf[pos + 1] << 0)); +} + +/* Quick check to determine if there is enough packet to process in the + * incoming buffer. Return the packet length, or zero if there's no packet. + */ +static unsigned has_packet(pj_turn_sock *turn_sock, const void *buf, pj_size_t bufsize) +{ + pj_bool_t is_stun; + + if (turn_sock->conn_type == PJ_TURN_TP_UDP) + return bufsize; + + /* Quickly check if this is STUN message, by checking the first two bits and + * size field which must be multiple of 4 bytes + */ + is_stun = ((((pj_uint8_t*)buf)[0] & 0xC0) == 0) && + ((GETVAL16H((const pj_uint8_t*)buf, 2) & 0x03)==0); + + if (is_stun) { + pj_size_t msg_len = GETVAL16H((const pj_uint8_t*)buf, 2); + return (msg_len+20 <= bufsize) ? msg_len+20 : 0; + } else { + /* This must be ChannelData. */ + pj_turn_channel_data cd; + + if (bufsize < 4) + return 0; + + /* Decode ChannelData packet */ + pj_memcpy(&cd, buf, sizeof(pj_turn_channel_data)); + cd.length = pj_ntohs(cd.length); + + if (bufsize >= cd.length+sizeof(cd)) + return (cd.length+sizeof(cd)+3) & (~3); + else + return 0; + } +} + /* * Notification from ioqueue when incoming UDP packet is received. */ @@ -487,21 +541,51 @@ static pj_bool_t on_data_read(pj_activesock_t *asock, pj_size_t *remainder) { pj_turn_sock *turn_sock; - pj_size_t parsed_len; pj_bool_t ret = PJ_TRUE; turn_sock = (pj_turn_sock*) pj_activesock_get_user_data(asock); pj_lock_acquire(turn_sock->lock); if (status == PJ_SUCCESS && turn_sock->sess) { - /* Report incoming packet to TURN session */ - parsed_len = (unsigned)size; - pj_turn_session_on_rx_pkt(turn_sock->sess, data, size, &parsed_len); - if (parsed_len < (unsigned)size) { - *remainder = size - parsed_len; - pj_memmove(data, ((char*)data)+parsed_len, *remainder); - } else { - *remainder = 0; + /* Report incoming packet to TURN session, repeat while we have + * "packet" in the buffer (required for stream-oriented transports) + */ + unsigned pkt_len; + + //PJ_LOG(5,(turn_sock->pool->obj_name, + // "Incoming data, %lu bytes total buffer", size)); + + while ((pkt_len=has_packet(turn_sock, data, size)) != 0) { + pj_size_t parsed_len; + //const pj_uint8_t *pkt = (const pj_uint8_t*)data; + + //PJ_LOG(5,(turn_sock->pool->obj_name, + // "Packet start: %02X %02X %02X %02X", + // pkt[0], pkt[1], pkt[2], pkt[3])); + + //PJ_LOG(5,(turn_sock->pool->obj_name, + // "Processing %lu bytes packet of %lu bytes total buffer", + // pkt_len, size)); + + parsed_len = (unsigned)size; + pj_turn_session_on_rx_pkt(turn_sock->sess, data, size, &parsed_len); + + /* parsed_len may be zero if we have parsing error, so use our + * previous calculation to exhaust the bad packet. + */ + if (parsed_len == 0) + parsed_len = pkt_len; + + if (parsed_len < (unsigned)size) { + *remainder = size - parsed_len; + pj_memmove(data, ((char*)data)+parsed_len, *remainder); + } else { + *remainder = 0; + } + size = *remainder; + + //PJ_LOG(5,(turn_sock->pool->obj_name, + // "Buffer size now %lu bytes", size)); } } else if (status != PJ_SUCCESS && turn_sock->conn_type != PJ_TURN_TP_UDP) @@ -652,6 +736,16 @@ static void turn_on_state(pj_turn_session *sess, return; } + /* Apply QoS, if specified */ + status = pj_sock_apply_qos2(sock, turn_sock->setting.qos_type, + &turn_sock->setting.qos_params, + (turn_sock->setting.qos_ignore_error?2:1), + turn_sock->pool->obj_name, NULL); + if (status != PJ_SUCCESS && !turn_sock->setting.qos_ignore_error) { + pj_turn_sock_destroy(turn_sock); + return; + } + /* Create active socket */ pj_bzero(&asock_cb, sizeof(asock_cb)); asock_cb.on_data_read = &on_data_read; diff --git a/sflphone-common/libs/pjproject/pjsip-apps/build/Makefile b/sflphone-common/libs/pjproject/pjsip-apps/build/Makefile index 3752b731110424f1b044fb05091bdc8f55d9d1c1..08e2ca00cd2e6dda86ccf175eb57a0eb80f30ee4 100644 --- a/sflphone-common/libs/pjproject/pjsip-apps/build/Makefile +++ b/sflphone-common/libs/pjproject/pjsip-apps/build/Makefile @@ -4,16 +4,16 @@ include $(PJDIR)/build/common.mak RULES_MAK := $(PJDIR)/build/rules.mak -PJLIB_LIB:=../../pjlib/lib/libpj-sfl-$(TARGET_NAME)$(LIBEXT) -PJLIB_UTIL_LIB:=../../pjlib-util/lib/libpjlib-util-sfl-$(TARGET_NAME)$(LIBEXT) -PJNATH_LIB:=../../pjnath/lib/libpjnath-sfl-$(TARGET_NAME)$(LIBEXT) -PJMEDIA_LIB:=../../pjmedia/lib/libpjmedia-sfl-$(TARGET_NAME)$(LIBEXT) -PJMEDIA_AUDIODEV_LIB:=../../pjmedia/lib/libpjmedia-audiodev-sfl-$(TARGET_NAME)$(LIBEXT) -PJMEDIA_CODEC_LIB:=../../pjmedia/lib/libpjmedia-codec-sfl-$(TARGET_NAME)$(LIBEXT) -PJSIP_LIB:=../../pjsip/lib/libpjsip-sfl-$(TARGET_NAME)$(LIBEXT) -PJSIP_UA_LIB:=../../pjsip/lib/libpjsip-ua-sfl-$(TARGET_NAME)$(LIBEXT) -PJSIP_SIMPLE_LIB:=../../pjsip/lib/libpjsip-simple-sfl-$(TARGET_NAME)$(LIBEXT) -PJSUA_LIB_LIB=../../pjsip/lib/libpjsua-sfl-$(TARGET_NAME)$(LIBEXT) +PJLIB_LIB:=../../pjlib/lib/libpj-$(TARGET_NAME)$(LIBEXT) +PJLIB_UTIL_LIB:=../../pjlib-util/lib/libpjlib-util-$(TARGET_NAME)$(LIBEXT) +PJNATH_LIB:=../../pjnath/lib/libpjnath-$(TARGET_NAME)$(LIBEXT) +PJMEDIA_LIB:=../../pjmedia/lib/libpjmedia-$(TARGET_NAME)$(LIBEXT) +PJMEDIA_AUDIODEV_LIB:=../../pjmedia/lib/libpjmedia-audiodev-$(TARGET_NAME)$(LIBEXT) +PJMEDIA_CODEC_LIB:=../../pjmedia/lib/libpjmedia-codec-$(TARGET_NAME)$(LIBEXT) +PJSIP_LIB:=../../pjsip/lib/libpjsip-$(TARGET_NAME)$(LIBEXT) +PJSIP_UA_LIB:=../../pjsip/lib/libpjsip-ua-$(TARGET_NAME)$(LIBEXT) +PJSIP_SIMPLE_LIB:=../../pjsip/lib/libpjsip-simple-$(TARGET_NAME)$(LIBEXT) +PJSUA_LIB_LIB=../../pjsip/lib/libpjsua-$(TARGET_NAME)$(LIBEXT) ############################################################################### @@ -39,12 +39,23 @@ export PJSUA_LDFLAGS += $(APP_LDFLAGS) $(APP_LDLIBS) $(LDFLAGS) export PJSUA_EXE:=../bin/pjsua-$(TARGET_NAME)$(HOST_EXE) +############################################################################### +# Defines for building pjsystest +# +export PJSYSTEST_SRCDIR = ../src/pjsystest +export PJSYSTEST_OBJS += $(OS_OBJS) $(M_OBJS) $(CC_OBJS) $(HOST_OBJS) \ + systest.o main_console.o +export PJSYSTEST_CFLAGS += $(_CFLAGS) +export PJSYSTEST_LDFLAGS += $(APP_LDFLAGS) $(APP_LDLIBS) $(LDFLAGS) +export PJSYSTEST_EXE:=../bin/pjsystest-$(TARGET_NAME)$(HOST_EXE) + + export CC_OUT CC AR RANLIB HOST_MV HOST_RM HOST_RMDIR HOST_MKDIR OBJEXT LD LDOUT ############################################################################### # Main entry # # -TARGETS := pjsua samples +TARGETS := pjsua pjsystest samples .PHONY: $(TARGETS) @@ -60,6 +71,9 @@ distclean: realclean pjsua: $(MAKE) -f $(RULES_MAK) APP=PJSUA app=pjsua $(PJSUA_EXE) +pjsystest: + $(MAKE) -f $(RULES_MAK) APP=PJSYSTEST app=pjsystest $(PJSYSTEST_EXE) + samples: $(MAKE) -f Samples.mak @@ -69,9 +83,11 @@ samples: clean depend realclean: $(MAKE) -f $(RULES_MAK) APP=PJSUA app=pjsua $@ + $(MAKE) -f $(RULES_MAK) APP=PJSYSTEST app=pjsystest $@ $(MAKE) -f Samples.mak $@ @if test "$@" = "depend"; then \ echo '$(PJSUA_EXE): $(APP_LIB_FILES)' >> .pjsua-$(TARGET_NAME).depend; \ + echo '$(PJSYSTEST_EXE): $(APP_LIB_FILES)' >> .pjsystest-$(TARGET_NAME).depend; \ fi diff --git a/sflphone-common/libs/pjproject/pjsip-apps/src/confbot/confbot.py b/sflphone-common/libs/pjproject/pjsip-apps/src/confbot/confbot.py new file mode 100644 index 0000000000000000000000000000000000000000..572c50c117f38440cf176c3cbb31b44cbf12eb9b --- /dev/null +++ b/sflphone-common/libs/pjproject/pjsip-apps/src/confbot/confbot.py @@ -0,0 +1,575 @@ +# $Id: confbot.py 2912 2009-08-24 11:56:13Z bennylp $ +# +# SIP Conference Bot +# +# Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +import pjsua as pj +import string +import sys + +CFG_FILE = "config" + +INFO = 1 +TRACE = 2 + +# Call callback. This would just forward the event to the Member class +class CallCb(pj.CallCallback): + def __init__(self, member, call=None): + pj.CallCallback.__init__(self, call) + self.member = member + + def on_state(self): + self.member.on_call_state(self.call) + + def on_media_state(self): + self.member.on_call_media_state(self.call) + + def on_dtmf_digit(self, digits): + self.member.on_call_dtmf_digit(self.call, digits) + + def on_transfer_request(self, dst, code): + return self.member.on_call_transfer_request(self.call, dst, code) + + def on_transfer_status(self, code, reason, final, cont): + return self.member.on_call_transfer_status(self.call, code, reason, final, cont) + + def on_replace_request(self, code, reason): + return self.member.on_call_replace_request(self.call, code, reason) + + def on_replaced(self, new_call): + self.member.on_call_replaced(self.call, new_call) + + def on_typing(self, is_typing): + self.member.on_typing(is_typing, call=self.call) + + def on_pager(self, mime_type, body): + self.member.on_pager(mime_type, body, call=self.call) + + def on_pager_status(self, body, im_id, code, reason): + self.member.on_pager_status(body, im_id, code, reason, call=self.call) + +# Buddy callback. This would just forward the event to Member class +class BuddyCb(pj.BuddyCallback): + def __init__(self, member, buddy=None): + pj.BuddyCallback.__init__(self, buddy) + self.member = member + + def on_pager(self, mime_type, body): + self.member.on_pager(mime_type, body, buddy=self.buddy) + + def on_pager_status(self, body, im_id, code, reason): + self.member.on_pager_status(body, im_id, code, reason, buddy=self.buddy) + + def on_state(self): + self.member.on_pres_state(self.buddy) + + def on_typing(self, is_typing): + self.member.on_typing(is_typing, buddy=self.buddy) + + + + +############################################################################## +# +# +# This class represents individual room member (either/both chat and voice conf) +# +# +class Member: + def __init__(self, bot, uri): + self.uri = uri + self.bot = bot + self.call = None + self.buddy = None + self.bi = pj.BuddyInfo() + self.in_chat = False + self.in_voice = False + self.im_error = False + self.html = False + + def __str__(self): + str = string.ljust(self.uri, 30) + " -- " + if self.buddy: + bi = self.buddy.info() + str = str + bi.online_text + else: + str = str + "Offline" + str = str + " [" + if (self.in_voice): + str = str + " voice" + if (self.in_chat): + str = str + " chat" + if (self.html): + str = str + " html" + else: + str = str + " plain" + + if (self.im_error): + str = str + " im_error" + str = str + "]" + return str + + def join_call(self, call): + if self.call: + self.call.hangup(603, "You have been disconnected for making another call") + self.call = call + call.set_callback(CallCb(self, call)) + msg = "%(uri)s is attempting to join the voice conference" % \ + {'uri': self.uri} + self.bot.DEBUG(msg + "\n", INFO) + self.bot.broadcast_pager(None, msg) + + def join_chat(self): + if not self.buddy: + self.bot.DEBUG(self.uri + " joining chatroom...\n", INFO) + self.buddy = self.bot.acc.add_buddy(self.uri) + self.buddy.set_callback(BuddyCb(self, self.buddy)) + self.buddy.subscribe() + else: + self.bot.DEBUG(self.uri + " already in chatroom, resubscribing..\n", INFO) + self.buddy.subscribe() + + def send_pager(self, body, mime="text/plain"): + self.bot.DEBUG("send_pager() to " + self.uri) + if self.in_chat and not self.im_error and self.buddy: + if self.html: + #This will make us receive html! + #mime = "text/html" + body = body.replace("<", "<") + body = body.replace(">", ">") + body = body.replace('"', """) + body = body.replace("\n", "<BR>\n") + self.buddy.send_pager(body, content_type=mime) + self.bot.DEBUG("..sent\n") + else: + self.bot.DEBUG("..not sent!\n") + + def on_call_state(self, call): + ci = call.info() + if ci.state==pj.CallState.DISCONNECTED: + if self.in_voice: + msg = "%(uri)s has left the voice conference (%(1)d/%(2)s)" % \ + {'uri': self.uri, '1': ci.last_code, '2': ci.last_reason} + self.bot.DEBUG(msg + "\n", INFO) + self.bot.broadcast_pager(None, msg) + self.in_voice = False + self.call = None + self.bot.on_member_left(self) + elif ci.state==pj.CallState.CONFIRMED: + msg = "%(uri)s has joined the voice conference" % \ + {'uri': self.uri} + self.bot.DEBUG(msg + "\n", INFO) + self.bot.broadcast_pager(None, msg) + + def on_call_media_state(self, call): + self.bot.DEBUG("Member.on_call_media_state\n") + ci = call.info() + if ci.conf_slot!=-1: + if not self.in_voice: + msg = self.uri + " call media is active" + self.bot.broadcast_pager(None, msg) + self.in_voice = True + self.bot.add_to_voice_conf(self) + else: + if self.in_voice: + msg = self.uri + " call media is inactive" + self.bot.broadcast_pager(None, msg) + self.in_voice = False + + def on_call_dtmf_digit(self, call, digits): + msg = "%(uri)s sent DTMF digits %(dig)s" % \ + {'uri': self.uri, 'dig': digits} + self.bot.broadcast_pager(None, msg) + + def on_call_transfer_request(self, call, dst, code): + msg = "%(uri)s is transfering the call to %(dst)s" % \ + {'uri': self.uri, 'dst': dst} + self.bot.broadcast_pager(None, msg) + return 202 + + def on_call_transfer_status(self, call, code, reason, final, cont): + msg = "%(uri)s call transfer status is %(code)d/%(res)s" % \ + {'uri': self.uri, 'code': code, 'res': reason} + self.bot.broadcast_pager(None, msg) + return True + + def on_call_replace_request(self, call, code, reason): + msg = "%(uri)s is requesting call replace" % \ + {'uri': self.uri} + self.bot.broadcast_pager(None, msg) + return (code, reason) + + def on_call_replaced(self, call, new_call): + msg = "%(uri)s call is replaced" % \ + {'uri': self.uri} + self.bot.broadcast_pager(None, msg) + + def on_pres_state(self, buddy): + old_bi = self.bi + self.bi = buddy.info() + msg = "%(uri)s status is %(st)s" % \ + {'uri': self.uri, 'st': self.bi.online_text} + self.bot.DEBUG(msg + "\n", INFO) + self.bot.broadcast_pager(self, msg) + + if self.bi.sub_state==pj.SubscriptionState.ACTIVE: + if not self.in_chat: + self.in_chat = True + buddy.send_pager("Welcome to chatroom") + self.bot.broadcast_pager(self, self.uri + " has joined the chat room") + else: + self.in_chat = True + elif self.bi.sub_state==pj.SubscriptionState.NULL or \ + self.bi.sub_state==pj.SubscriptionState.TERMINATED or \ + self.bi.sub_state==pj.SubscriptionState.UNKNOWN: + self.buddy.delete() + self.buddy = None + if self.in_chat: + self.in_chat = False + self.bot.broadcast_pager(self, self.uri + " has left the chat room") + else: + self.in_chat = False + self.bot.on_member_left(self) + + def on_typing(self, is_typing, call=None, buddy=None): + if is_typing: + msg = self.uri + " is typing..." + else: + msg = self.uri + " has stopped typing" + self.bot.broadcast_pager(self, msg) + + def on_pager(self, mime_type, body, call=None, buddy=None): + if not self.bot.handle_cmd(self, None, body): + msg = self.uri + ": " + body + self.bot.broadcast_pager(self, msg, mime_type) + + def on_pager_status(self, body, im_id, code, reason, call=None, buddy=None): + self.im_error = (code/100 != 2) + + + +############################################################################## +# +# +# The Bot instance (singleton) +# +# +class Bot(pj.AccountCallback): + def __init__(self): + pj.AccountCallback.__init__(self, None) + self.lib = pj.Lib() + self.acc = None + self.calls = [] + self.members = {} + self.cfg = None + + def DEBUG(self, msg, level=TRACE): + print msg, + + def helpstring(self): + return """ +--h[elp] Display this help screen +--j[oin] Join the chat room +--html on|off Set to receive HTML or plain text + +Participant commands: +--s[how] Show confbot settings +--leave Leave the chatroom +--l[ist] List all members + +Admin commands: +--a[dmin] <CMD> Where <CMD> are: + list List the admins + add <URI> Add URI as admin + del <URI> Remove URI as admin + rr Reregister account to server + call <URI> Make call to the URI and add to voice conf + dc <URI> Disconnect call to URI + hold <URI> Hold call with that URI + update <URI> Send UPDATE to call with that URI + reinvite <URI> Send re-INVITE to call with that URI +""" + + def listmembers(self): + msg = "" + for uri, m in self.members.iteritems(): + msg = msg + str(m) + "\n" + return msg + + def showsettings(self): + ai = self.acc.info() + msg = """ +ConfBot status and settings: + URI: %(uri)s + Status: %(pres)s + Reg Status: %(reg_st)d + Reg Reason: %(reg_res)s +""" % {'uri': ai.uri, 'pres': ai.online_text, \ + 'reg_st': ai.reg_status, 'reg_res': ai.reg_reason} + return msg + + def main(self, cfg_file): + try: + cfg = self.cfg = __import__(cfg_file) + + self.lib.init(ua_cfg=cfg.ua_cfg, log_cfg=cfg.log_cfg, media_cfg=cfg.media_cfg) + self.lib.set_null_snd_dev() + + transport = None + if cfg.udp_cfg: + transport = self.lib.create_transport(pj.TransportType.UDP, cfg.udp_cfg) + if cfg.tcp_cfg: + t = self.lib.create_transport(pj.TransportType.TCP, cfg.tcp_cfg) + if not transport: + transport = t + + self.lib.start() + + if cfg.acc_cfg: + self.DEBUG("Creating account %(uri)s..\n" % {'uri': cfg.acc_cfg.id}, INFO) + self.acc = self.lib.create_account(cfg.acc_cfg, cb=self) + else: + self.DEBUG("Creating account for %(t)s..\n" % \ + {'t': transport.info().description}, INFO) + self.acc = self.lib.create_account_for_transport(transport, cb=self) + + self.acc.set_basic_status(True) + + # Wait for ENTER before quitting + print "Press q to quit or --help/--h for help" + while True: + input = sys.stdin.readline().strip(" \t\r\n") + if not self.handle_cmd(None, None, input): + if input=="q": + break + + self.lib.destroy() + self.lib = None + + except pj.Error, e: + print "Exception: " + str(e) + if self.lib: + self.lib.destroy() + self.lib = None + + def broadcast_pager(self, exclude_member, body, mime_type="text/plain"): + self.DEBUG("Broadcast: " + body + "\n") + for uri, m in self.members.iteritems(): + if m != exclude_member: + m.send_pager(body, mime_type) + + def add_to_voice_conf(self, member): + if not member.call: + return + src_ci = member.call.info() + self.DEBUG("bot.add_to_voice_conf\n") + for uri, m in self.members.iteritems(): + if m==member: + continue + if not m.call: + continue + dst_ci = m.call.info() + if dst_ci.media_state==pj.MediaState.ACTIVE and dst_ci.conf_slot!=-1: + self.lib.conf_connect(src_ci.conf_slot, dst_ci.conf_slot) + self.lib.conf_connect(dst_ci.conf_slot, src_ci.conf_slot) + + def on_member_left(self, member): + if not member.call and not member.buddy: + del self.members[member.uri] + del member + + def handle_admin_cmd(self, member, body): + if member and self.cfg.admins and not member.uri in self.cfg.admins: + member.send_pager("You are not admin") + return + args = body.split() + msg = "" + + if len(args)==1: + args.append(" ") + + if args[1]=="list": + if not self.cfg.admins: + msg = "Everyone is admin!" + else: + msg = str(self.cfg.admins) + elif args[1]=="add": + if len(args)!=3: + msg = "Usage: add <URI>" + else: + self.cfg.admins.append(args[2]) + msg = args[2] + " added as admin" + elif args[1]=="del": + if len(args)!=3: + msg = "Usage: del <URI>" + elif args[2] not in self.cfg.admins: + msg = args[2] + " is not admin" + else: + self.cfg.admins.remove(args[2]) + msg = args[2] + " has been removed from admins" + elif args[1]=="rr": + msg = "Reregistering.." + self.acc.set_registration(True) + elif args[1]=="call": + if len(args)!=3: + msg = "Usage: call <URI>" + else: + uri = args[2] + try: + call = self.acc.make_call(uri) + except pj.Error, e: + msg = "Error: " + str(e) + call = None + + if call: + if not uri in self.members: + m = Member(self, uri) + self.members[m.uri] = m + else: + m = self.members[uri] + msg = "Adding " + m.uri + " to voice conference.." + m.join_call(call) + elif args[1]=="dc" or args[1]=="hold" or args[1]=="update" or args[1]=="reinvite": + if len(args)!=3: + msg = "Usage: " + args[1] + " <URI>" + else: + uri = args[2] + if not uri in self.members: + msg = "Member not found/URI doesn't match (note: case matters!)" + else: + m = self.members[uri] + if m.call: + if args[1]=="dc": + msg = "Disconnecting.." + m.call.hangup(603, "You're disconnected by admin") + elif args[1]=="hold": + msg = "Holding the call" + m.call.hold() + elif args[1]=="update": + msg = "Sending UPDATE" + m.call.update() + elif args[1]=="reinvite": + msg = "Sending re-INVITE" + m.call.reinvite() + else: + msg = "He is not in call" + else: + msg = "Unknown admin command " + body + + #print "msg is '%(msg)s'" % {'msg': msg} + + if True: + if member: + member.send_pager(msg) + else: + print msg + + def handle_cmd(self, member, from_uri, body): + body = body.strip(" \t\r\n") + msg = "" + handled = True + if body=="--l" or body=="--list": + msg = self.listmembers() + if msg=="": + msg = "Nobody is here" + elif body[0:3]=="--s": + msg = self.showsettings() + elif body[0:6]=="--html" and member: + if body[8:11]=="off": + member.html = False + else: + member.html = True + elif body=="--h" or body=="--help": + msg = self.helpstring() + elif body=="--leave": + if not member or not member.buddy: + msg = "You are not in chatroom" + else: + member.buddy.unsubscribe() + elif body[0:3]=="--j": + if not from_uri in self.members: + m = Member(self, from_uri) + self.members[m.uri] = m + self.DEBUG("Adding " + m.uri + " to chatroom\n") + m.join_chat() + else: + m = self.members[from_uri] + self.DEBUG("Adding " + m.uri + " to chatroom\n") + m.join_chat() + elif body[0:3]=="--a": + self.handle_admin_cmd(member, body) + handled = True + else: + handled = False + + if msg: + if member: + member.send_pager(msg) + elif from_uri: + self.acc.send_pager(from_uri, msg); + else: + print msg + return handled + + def on_incoming_call(self, call): + self.DEBUG("on_incoming_call from %(uri)s\n" % {'uri': call.info().remote_uri}, INFO) + ci = call.info() + if not ci.remote_uri in self.members: + m = Member(self, ci.remote_uri) + self.members[m.uri] = m + m.join_call(call) + else: + m = self.members[ci.remote_uri] + m.join_call(call) + call.answer(200) + + def on_incoming_subscribe(self, buddy, from_uri, contact_uri, pres_obj): + self.DEBUG("on_incoming_subscribe from %(uri)s\n" % from_uri, INFO) + return (200, 'OK') + + def on_reg_state(self): + ai = self.acc.info() + self.DEBUG("Registration state: %(code)d/%(reason)s\n" % \ + {'code': ai.reg_status, 'reason': ai.reg_reason}, INFO) + if ai.reg_status/100==2 and ai.reg_expires > 0: + self.acc.set_basic_status(True) + + def on_pager(self, from_uri, contact, mime_type, body): + body = body.strip(" \t\r\n") + if not self.handle_cmd(None, from_uri, body): + self.acc.send_pager(from_uri, "You have not joined the chat room. Type '--join' to join or '--help' for the help") + + def on_pager_status(self, to_uri, body, im_id, code, reason): + pass + + def on_typing(self, from_uri, contact, is_typing): + pass + + + + +############################################################################## +# +# +# main() +# +# +if __name__ == "__main__": + bot = Bot() + bot.main(CFG_FILE) + diff --git a/sflphone-common/libs/pjproject/pjsip-apps/src/confbot/config.py b/sflphone-common/libs/pjproject/pjsip-apps/src/confbot/config.py new file mode 100644 index 0000000000000000000000000000000000000000..9dd31b4a18ac9d9f7e1bec4fdeb47b044003ca6c --- /dev/null +++ b/sflphone-common/libs/pjproject/pjsip-apps/src/confbot/config.py @@ -0,0 +1,41 @@ +# $Id: config.py 2912 2009-08-24 11:56:13Z bennylp $ +# +# Confbot settings +# +import pjsua as pj + +# Set of admins. If empty then everyone is admin! +admins = set([]) + +# acc_cfg holds the account config (set it to None to disable account) +acc_cfg = None +acc_cfg = pj.AccountConfig() +if acc_cfg: + acc_cfg.id = "sip:bot@pjsip.org" + acc_cfg.reg_uri = "sip:pjsip.org" + acc_cfg.proxy = [ "sip:pjsip.org;lr;transport=tcp" ] + acc_cfg.auth_cred = [ pj.AuthCred("*", "bot", "secretpass") ] + acc_cfg.publish_enabled = True + #acc_cfg.require_timer = True + +# Transport configs (set them to None to disable the transport) +udp_cfg = pj.TransportConfig(5080) +tcp_cfg = pj.TransportConfig(0) +#tcp_cfg = None + +# Logging Config (you can also set it to None to use default values) +def log_cb(level, str, len): + print str, + +log_cfg = pj.LogConfig() +#log_cfg.callback = log_cb + +# UA Config (you can also set it to None to use default values) +ua_cfg = pj.UAConfig() +ua_cfg.user_agent = "PJSIP ConfBot" +ua_cfg.stun_host = "stun.pjsip.org" + +# Media config (you can also set it to None to use default values) +media_cfg = pj.MediaConfig() +media_cfg.enable_ice = True +media_cfg.max_calls = 20 diff --git a/sflphone-common/libs/pjproject/pjsip-apps/src/pjsua/pjsua_app.c b/sflphone-common/libs/pjproject/pjsip-apps/src/pjsua/pjsua_app.c index 275387f9de14ba42fc52590fc3cb535e60c52449..5b43b055115f9f6d6433832bb95c40de86181f9b 100644 --- a/sflphone-common/libs/pjproject/pjsip-apps/src/pjsua/pjsua_app.c +++ b/sflphone-common/libs/pjproject/pjsip-apps/src/pjsua/pjsua_app.c @@ -1,4 +1,4 @@ -/* $Id: pjsua_app.c 2897 2009-08-17 20:28:47Z nanang $ */ +/* $Id: pjsua_app.c 3039 2009-12-30 06:35:20Z nanang $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> @@ -59,6 +59,7 @@ static struct app_config pjsua_media_config media_cfg; pj_bool_t no_refersub; pj_bool_t ipv6; + pj_bool_t enable_qos; pj_bool_t no_tcp; pj_bool_t no_udp; pj_bool_t use_tls; @@ -103,6 +104,8 @@ static struct app_config #ifdef STEREO_DEMO pjmedia_snd_port *snd; + pjmedia_port *sc, *sc_ch1; + pjsua_conf_port_id sc_ch1_slot; #endif float mic_level, @@ -190,6 +193,7 @@ static void usage(void) puts (" --username=string Set authentication username"); puts (" --password=string Set authentication password"); puts (" --publish Send presence PUBLISH for this account"); + puts (" --mwi Subscribe to message summary/waiting indication"); puts (" --use-100rel Require reliable provisional response (100rel)"); puts (" --use-timer Require SIP session timers"); puts (" --timer-se=N Session timers expiration period, in secs (def:1800)"); @@ -205,6 +209,7 @@ static void usage(void) #if defined(PJ_HAS_IPV6) && PJ_HAS_IPV6 puts (" --ipv6 Use IPv6 instead for SIP and media."); #endif + puts (" --set-qos Enable QoS tagging for SIP and media."); puts (" --local-port=port Set TCP/UDP port. This implicitly enables both "); puts (" TCP and UDP transports on the specified port, unless"); puts (" if TCP or UDP is disabled."); @@ -479,7 +484,7 @@ static pj_status_t parse_args(int argc, char *argv[], OPT_REGISTRAR, OPT_REG_TIMEOUT, OPT_PUBLISH, OPT_ID, OPT_CONTACT, OPT_BOUND_ADDR, OPT_CONTACT_PARAMS, OPT_CONTACT_URI_PARAMS, OPT_100REL, OPT_USE_IMS, OPT_REALM, OPT_USERNAME, OPT_PASSWORD, - OPT_NAMESERVER, OPT_STUN_SRV, + OPT_MWI, OPT_NAMESERVER, OPT_STUN_SRV, OPT_ADD_BUDDY, OPT_OFFER_X_MS_MSG, OPT_NO_PRESENCE, OPT_AUTO_ANSWER, OPT_AUTO_PLAY, OPT_AUTO_PLAY_HANGUP, OPT_AUTO_LOOP, OPT_AUTO_CONF, OPT_CLOCK_RATE, OPT_SND_CLOCK_RATE, OPT_STEREO, @@ -498,7 +503,7 @@ static pj_status_t parse_args(int argc, char *argv[], OPT_TLS_NEG_TIMEOUT, OPT_TLS_SRV_NAME, OPT_CAPTURE_DEV, OPT_PLAYBACK_DEV, OPT_CAPTURE_LAT, OPT_PLAYBACK_LAT, OPT_NO_TONES, OPT_JB_MAX_SIZE, - OPT_STDOUT_REFRESH, OPT_STDOUT_REFRESH_TEXT, OPT_IPV6, + OPT_STDOUT_REFRESH, OPT_STDOUT_REFRESH_TEXT, OPT_IPV6, OPT_QOS, #ifdef _IONBF OPT_STDOUT_NO_BUF, #endif @@ -531,6 +536,7 @@ static pj_status_t parse_args(int argc, char *argv[], { "registrar", 1, 0, OPT_REGISTRAR}, { "reg-timeout",1, 0, OPT_REG_TIMEOUT}, { "publish", 0, 0, OPT_PUBLISH}, + { "mwi", 0, 0, OPT_MWI}, { "use-100rel", 0, 0, OPT_100REL}, { "use-ims", 0, 0, OPT_USE_IMS}, { "id", 1, 0, OPT_ID}, @@ -614,6 +620,7 @@ static pj_status_t parse_args(int argc, char *argv[], #if defined(PJ_HAS_IPV6) && PJ_HAS_IPV6 { "ipv6", 0, 0, OPT_IPV6}, #endif + { "set-qos", 0, 0, OPT_QOS}, { "use-timer", 0, 0, OPT_TIMER}, { "timer-se", 1, 0, OPT_TIMER_SE}, { "timer-min-se", 1, 0, OPT_TIMER_MIN_SE}, @@ -828,6 +835,10 @@ static pj_status_t parse_args(int argc, char *argv[], cur_acc->publish_enabled = PJ_TRUE; break; + case OPT_MWI: /* mwi */ + cur_acc->mwi_enabled = PJ_TRUE; + break; + case OPT_100REL: /** 100rel */ cur_acc->require_100rel = PJ_TRUE; cfg->cfg.require_100rel = PJ_TRUE; @@ -1268,6 +1279,7 @@ static pj_status_t parse_args(int argc, char *argv[], case OPT_TLS_VERIFY_CLIENT: cfg->udp_cfg.tls_setting.verify_client = PJ_TRUE; + cfg->udp_cfg.tls_setting.require_client_cert = PJ_TRUE; break; case OPT_TLS_NEG_TIMEOUT: @@ -1325,7 +1337,17 @@ static pj_status_t parse_args(int argc, char *argv[], cfg->ipv6 = PJ_TRUE; break; #endif - + case OPT_QOS: + cfg->enable_qos = PJ_TRUE; + /* Set RTP traffic type to Voice */ + cfg->rtp_cfg.qos_type = PJ_QOS_TYPE_VOICE; + /* Directly apply DSCP value to SIP traffic. Say lets + * set it to CS3 (DSCP 011000). Note that this will not + * work on all platforms. + */ + cfg->udp_cfg.qos_params.flags = PJ_QOS_PARAM_HAS_DSCP; + cfg->udp_cfg.qos_params.dscp_val = 0x18; + break; default: PJ_LOG(1,(THIS_FILE, "Argument \"%s\" is not valid. Use --help to see help", @@ -1535,6 +1557,13 @@ static void write_account_settings(int acc_index, pj_str_t *result) pj_strcat2(result, line); } + /* Publish */ + if (acc_cfg->publish_enabled) + pj_strcat2(result, "--publish\n"); + + /* MWI */ + if (acc_cfg->mwi_enabled) + pj_strcat2(result, "--mwi\n"); } @@ -1605,6 +1634,9 @@ static int write_settings(const struct app_config *config, if (config->ipv6) { pj_strcat2(&cfg, "--ipv6\n"); } + if (config->enable_qos) { + pj_strcat2(&cfg, "--set-qos\n"); + } /* UDP Transport. */ pj_ansi_sprintf(line, "--local-port %d\n", config->udp_cfg.port); @@ -2617,12 +2649,16 @@ static void on_buddy_state(pjsua_buddy_id buddy_id) pjsua_buddy_info info; pjsua_buddy_get_info(buddy_id, &info); - PJ_LOG(3,(THIS_FILE, "%.*s status is %.*s (subscription state is %s)", + PJ_LOG(3,(THIS_FILE, "%.*s status is %.*s, subscription state is %s " + "(last termination reason code=%d %.*s)", (int)info.uri.slen, info.uri.ptr, (int)info.status_text.slen, info.status_text.ptr, - info.sub_state_name)); + info.sub_state_name, + info.sub_term_code, + (int)info.sub_term_reason.slen, + info.sub_term_reason.ptr)); } @@ -2720,6 +2756,37 @@ static void on_nat_detect(const pj_stun_nat_detect_result *res) } +/* + * MWI indication + */ +static void on_mwi_info(pjsua_acc_id acc_id, pjsua_mwi_info *mwi_info) +{ + pj_str_t body; + + PJ_LOG(3,(THIS_FILE, "Received MWI for acc %d:", acc_id)); + + if (mwi_info->rdata->msg_info.ctype) { + const pjsip_ctype_hdr *ctype = mwi_info->rdata->msg_info.ctype; + + PJ_LOG(3,(THIS_FILE, " Content-Type: %.*s/%.*s", + (int)ctype->media.type.slen, + ctype->media.type.ptr, + (int)ctype->media.subtype.slen, + ctype->media.subtype.ptr)); + } + + if (!mwi_info->rdata->msg_info.msg->body) { + PJ_LOG(3,(THIS_FILE, " no message body")); + return; + } + + body.ptr = mwi_info->rdata->msg_info.msg->body->data; + body.slen = mwi_info->rdata->msg_info.msg->body->len; + + PJ_LOG(3,(THIS_FILE, " Body:\n%.*s", (int)body.slen, body.ptr)); +} + + /* * Print buddy list. */ @@ -4315,6 +4382,7 @@ pj_status_t app_init(int argc, char *argv[]) app_config.cfg.cb.on_call_transfer_status = &on_call_transfer_status; app_config.cfg.cb.on_call_replaced = &on_call_replaced; app_config.cfg.cb.on_nat_detect = &on_nat_detect; + app_config.cfg.cb.on_mwi_info = &on_mwi_info; /* Set sound device latency */ if (app_config.capture_lat > 0) @@ -4533,6 +4601,11 @@ pj_status_t app_init(int argc, char *argv[]) pjsua_acc_id acc_id; + /* Copy the QoS settings */ + tcp_cfg.tls_setting.qos_type = tcp_cfg.qos_type; + pj_memcpy(&tcp_cfg.tls_setting.qos_params, &tcp_cfg.qos_params, + sizeof(tcp_cfg.qos_params)); + /* Set TLS port as TCP port+1 */ tcp_cfg.port++; status = pjsua_transport_create(PJSIP_TRANSPORT_TLS, @@ -4678,6 +4751,16 @@ pj_status_t app_destroy(void) pjmedia_snd_port_destroy(app_config.snd); app_config.snd = NULL; } + if (app_config.sc_ch1) { + pjsua_conf_remove_port(app_config.sc_ch1_slot); + app_config.sc_ch1_slot = PJSUA_INVALID_ID; + pjmedia_port_destroy(app_config.sc_ch1); + app_config.sc_ch1 = NULL; + } + if (app_config.sc) { + pjmedia_port_destroy(app_config.sc); + app_config.sc = NULL; + } #endif /* Close ringback port */ @@ -4717,9 +4800,25 @@ pj_status_t app_destroy(void) #ifdef STEREO_DEMO +/* + * In this stereo demo, we open the sound device in stereo mode and + * arrange the attachment to the PJSUA-LIB conference bridge as such + * so that channel0/left channel of the sound device corresponds to + * slot 0 in the bridge, and channel1/right channel of the sound + * device corresponds to slot 1 in the bridge. Then user can independently + * feed different media to/from the speakers/microphones channels, by + * connecting them to slot 0 or 1 respectively. + * + * Here's how the connection looks like: + * + +-----------+ stereo +-----------------+ 2x mono +-----------+ + | AUDIO DEV |<------>| SPLITCOMB left|<------->|#0 BRIDGE | + +-----------+ | right|<------->|#1 | + +-----------------+ +-----------+ + */ static void stereo_demo() { - pjmedia_port *conf, *splitter, *ch1; + pjmedia_port *conf; pj_status_t status; /* Disable existing sound device */ @@ -4732,27 +4831,28 @@ static void stereo_demo() 2 * conf->info.samples_per_frame, conf->info.bits_per_sample, 0 /* options */, - &splitter); + &app_config.sc); pj_assert(status == PJ_SUCCESS); /* Connect channel0 (left channel?) to conference port slot0 */ - status = pjmedia_splitcomb_set_channel(splitter, 0 /* ch0 */, + status = pjmedia_splitcomb_set_channel(app_config.sc, 0 /* ch0 */, 0 /*options*/, conf); pj_assert(status == PJ_SUCCESS); /* Create reverse channel for channel1 (right channel?)... */ status = pjmedia_splitcomb_create_rev_channel(app_config.pool, - splitter, + app_config.sc, 1 /* ch1 */, 0 /* options */, - &ch1); + &app_config.sc_ch1); pj_assert(status == PJ_SUCCESS); /* .. and register it to conference bridge (it would be slot1 * if there's no other devices connected to the bridge) */ - status = pjsua_conf_add_port(app_config.pool, ch1, NULL); + status = pjsua_conf_add_port(app_config.pool, app_config.sc_ch1, + &app_config.sc_ch1_slot); pj_assert(status == PJ_SUCCESS); /* Create sound device */ @@ -4766,7 +4866,7 @@ static void stereo_demo() /* Connect the splitter to the sound device */ - status = pjmedia_snd_port_connect(app_config.snd, splitter); + status = pjmedia_snd_port_connect(app_config.snd, app_config.sc); pj_assert(status == PJ_SUCCESS); } @@ -4899,3 +4999,4 @@ static pj_status_t create_ipv6_media_transports(void) return pjsua_media_transports_attach(tp, i, PJ_TRUE); } + diff --git a/sflphone-common/libs/pjproject/pjsip-apps/src/pjsua_wince/pjsua_wince.cpp b/sflphone-common/libs/pjproject/pjsip-apps/src/pjsua_wince/pjsua_wince.cpp index 8609fc5f0ed414089f4666ff9c1bebe9c0b85d7c..a10c67f887e3396f998e694ce5b4f3322de127f2 100644 --- a/sflphone-common/libs/pjproject/pjsip-apps/src/pjsua_wince/pjsua_wince.cpp +++ b/sflphone-common/libs/pjproject/pjsip-apps/src/pjsua_wince/pjsua_wince.cpp @@ -54,15 +54,15 @@ static HWND hwndActionButton, hwndExitButton; // // STUN server #if 0 -// Use this to have the STUN server resolved normally + // Use this to have the STUN server resolved normally # define STUN_DOMAIN NULL # define STUN_SERVER "stun.fwdnet.net" #elif 0 -// Use this to have the STUN server resolved with DNS SRV + // Use this to have the STUN server resolved with DNS SRV # define STUN_DOMAIN "iptel.org" # define STUN_SERVER NULL #else -// Use this to disable STUN + // Use this to disable STUN # define STUN_DOMAIN NULL # define STUN_SERVER NULL #endif @@ -82,14 +82,16 @@ static int g_current_acc; static int g_current_call = PJSUA_INVALID_ID; static int g_current_action; -enum { +enum +{ ID_GLOBAL_STATUS = 21, ID_URI, ID_CALL_STATUS, ID_POLL_TIMER, }; -enum { +enum +{ ID_MENU_NONE = 64, ID_MENU_CALL, ID_MENU_ANSWER, @@ -102,101 +104,85 @@ enum { static ATOM MyRegisterClass (HINSTANCE, LPTSTR); BOOL InitInstance (HINSTANCE, int); static void OnCreate (HWND hWnd); -static LRESULT CALLBACK WndProc (HWND, UINT, WPARAM, LPARAM); +static LRESULT CALLBACK WndProc (HWND, UINT, WPARAM, LPARAM); ///////////////////////////////////////////////////////////////////////////// -static void OnError (const wchar_t *title, pj_status_t status) +static void OnError(const wchar_t *title, pj_status_t status) { char errmsg[PJ_ERR_MSG_SIZE]; - PJ_DECL_UNICODE_TEMP_BUF (werrmsg, PJ_ERR_MSG_SIZE); - - pj_strerror (status, errmsg, sizeof (errmsg)); + PJ_DECL_UNICODE_TEMP_BUF(werrmsg, PJ_ERR_MSG_SIZE); - MessageBox (NULL, PJ_STRING_TO_NATIVE (errmsg, werrmsg, PJ_ERR_MSG_SIZE), - title, MB_OK); + pj_strerror(status, errmsg, sizeof(errmsg)); + + MessageBox(NULL, PJ_STRING_TO_NATIVE(errmsg, werrmsg, PJ_ERR_MSG_SIZE), + title, MB_OK); } -static void SetLocalURI (const char *uri, int len, bool enabled=true) +static void SetLocalURI(const char *uri, int len, bool enabled=true) { wchar_t tmp[128]; - - if (len==-1) len=pj_ansi_strlen (uri); - - pj_ansi_to_unicode (uri, len, tmp, PJ_ARRAY_SIZE (tmp)); - - SetDlgItemText (hMainWnd, ID_GLOBAL_STATUS, tmp); - - EnableWindow (hwndGlobalStatus, enabled?TRUE:FALSE); + if (len==-1) len=pj_ansi_strlen(uri); + pj_ansi_to_unicode(uri, len, tmp, PJ_ARRAY_SIZE(tmp)); + SetDlgItemText(hMainWnd, ID_GLOBAL_STATUS, tmp); + EnableWindow(hwndGlobalStatus, enabled?TRUE:FALSE); } -static void SetURI (const char *uri, int len, bool enabled=true) +static void SetURI(const char *uri, int len, bool enabled=true) { wchar_t tmp[128]; - - if (len==-1) len=pj_ansi_strlen (uri); - - pj_ansi_to_unicode (uri, len, tmp, PJ_ARRAY_SIZE (tmp)); - - SetDlgItemText (hMainWnd, ID_URI, tmp); - - EnableWindow (hwndURI, enabled?TRUE:FALSE); + if (len==-1) len=pj_ansi_strlen(uri); + pj_ansi_to_unicode(uri, len, tmp, PJ_ARRAY_SIZE(tmp)); + SetDlgItemText(hMainWnd, ID_URI, tmp); + EnableWindow(hwndURI, enabled?TRUE:FALSE); } -static void SetCallStatus (const char *state, int len) +static void SetCallStatus(const char *state, int len) { wchar_t tmp[128]; - - if (len==-1) len=pj_ansi_strlen (state); - - pj_ansi_to_unicode (state, len, tmp, PJ_ARRAY_SIZE (tmp)); - - SetDlgItemText (hMainWnd, ID_CALL_STATUS, tmp); + if (len==-1) len=pj_ansi_strlen(state); + pj_ansi_to_unicode(state, len, tmp, PJ_ARRAY_SIZE(tmp)); + SetDlgItemText(hMainWnd, ID_CALL_STATUS, tmp); } -static void SetAction (int action, bool enable=true) +static void SetAction(int action, bool enable=true) { HMENU hMenu; - hMenu = CommandBar_GetMenu (hwndCB, 0); + hMenu = CommandBar_GetMenu(hwndCB, 0); - RemoveMenu (hMenu, ID_MENU_NONE, MF_BYCOMMAND); - RemoveMenu (hMenu, ID_MENU_CALL, MF_BYCOMMAND); - RemoveMenu (hMenu, ID_MENU_ANSWER, MF_BYCOMMAND); - RemoveMenu (hMenu, ID_MENU_DISCONNECT, MF_BYCOMMAND); + RemoveMenu(hMenu, ID_MENU_NONE, MF_BYCOMMAND); + RemoveMenu(hMenu, ID_MENU_CALL, MF_BYCOMMAND); + RemoveMenu(hMenu, ID_MENU_ANSWER, MF_BYCOMMAND); + RemoveMenu(hMenu, ID_MENU_DISCONNECT, MF_BYCOMMAND); switch (action) { - - case ID_MENU_NONE: - InsertMenu (hMenu, ID_EXIT, MF_BYCOMMAND, action, TEXT ("None")); - SetWindowText (hwndActionButton, TEXT ("-")); - break; - - case ID_MENU_CALL: - InsertMenu (hMenu, ID_EXIT, MF_BYCOMMAND, action, TEXT ("Call")); - SetWindowText (hwndActionButton, TEXT ("&Call")); - break; - - case ID_MENU_ANSWER: - InsertMenu (hMenu, ID_EXIT, MF_BYCOMMAND, action, TEXT ("Answer")); - SetWindowText (hwndActionButton, TEXT ("&Answer")); - break; - - case ID_MENU_DISCONNECT: - InsertMenu (hMenu, ID_EXIT, MF_BYCOMMAND, action, TEXT ("Hangup")); - SetWindowText (hwndActionButton, TEXT ("&Hangup")); - break; + case ID_MENU_NONE: + InsertMenu(hMenu, ID_EXIT, MF_BYCOMMAND, action, TEXT("None")); + SetWindowText(hwndActionButton, TEXT("-")); + break; + case ID_MENU_CALL: + InsertMenu(hMenu, ID_EXIT, MF_BYCOMMAND, action, TEXT("Call")); + SetWindowText(hwndActionButton, TEXT("&Call")); + break; + case ID_MENU_ANSWER: + InsertMenu(hMenu, ID_EXIT, MF_BYCOMMAND, action, TEXT("Answer")); + SetWindowText(hwndActionButton, TEXT("&Answer")); + break; + case ID_MENU_DISCONNECT: + InsertMenu(hMenu, ID_EXIT, MF_BYCOMMAND, action, TEXT("Hangup")); + SetWindowText(hwndActionButton, TEXT("&Hangup")); + break; } - EnableMenuItem (hMenu, action, MF_BYCOMMAND | (enable?MF_ENABLED:MF_GRAYED)); - - DrawMenuBar (hMainWnd); + EnableMenuItem(hMenu, action, MF_BYCOMMAND | (enable?MF_ENABLED:MF_GRAYED)); + DrawMenuBar(hMainWnd); g_current_action = action; } @@ -205,35 +191,35 @@ static void SetAction (int action, bool enable=true) /* * Handler when invite state has changed. */ -static void on_call_state (pjsua_call_id call_id, pjsip_event *e) +static void on_call_state(pjsua_call_id call_id, pjsip_event *e) { pjsua_call_info call_info; - PJ_UNUSED_ARG (e); + PJ_UNUSED_ARG(e); - pjsua_call_get_info (call_id, &call_info); + pjsua_call_get_info(call_id, &call_info); if (call_info.state == PJSIP_INV_STATE_DISCONNECTED) { - g_current_call = PJSUA_INVALID_ID; - SetURI (SIP_DST_URI, -1); - SetAction (ID_MENU_CALL); - //SetCallStatus(call_info.state_text.ptr, call_info.state_text.slen); - SetCallStatus (call_info.last_status_text.ptr, call_info.last_status_text.slen); + g_current_call = PJSUA_INVALID_ID; + SetURI(SIP_DST_URI, -1); + SetAction(ID_MENU_CALL); + //SetCallStatus(call_info.state_text.ptr, call_info.state_text.slen); + SetCallStatus(call_info.last_status_text.ptr, call_info.last_status_text.slen); } else { - //if (g_current_call == PJSUA_INVALID_ID) - // g_current_call = call_id; + //if (g_current_call == PJSUA_INVALID_ID) + // g_current_call = call_id; - if (call_info.remote_contact.slen) - SetURI (call_info.remote_contact.ptr, call_info.remote_contact.slen, false); - else - SetURI (call_info.remote_info.ptr, call_info.remote_info.slen, false); + if (call_info.remote_contact.slen) + SetURI(call_info.remote_contact.ptr, call_info.remote_contact.slen, false); + else + SetURI(call_info.remote_info.ptr, call_info.remote_info.slen, false); - if (call_info.state == PJSIP_INV_STATE_CONFIRMED) - SetAction (ID_MENU_DISCONNECT); + if (call_info.state == PJSIP_INV_STATE_CONFIRMED) + SetAction(ID_MENU_DISCONNECT); - SetCallStatus (call_info.state_text.ptr, call_info.state_text.slen); + SetCallStatus(call_info.state_text.ptr, call_info.state_text.slen); } } @@ -243,15 +229,15 @@ static void on_call_state (pjsua_call_id call_id, pjsip_event *e) * The action may connect the call to sound device, to file, or * to loop the call. */ -static void on_call_media_state (pjsua_call_id call_id) +static void on_call_media_state(pjsua_call_id call_id) { pjsua_call_info call_info; - pjsua_call_get_info (call_id, &call_info); + pjsua_call_get_info(call_id, &call_info); if (call_info.media_status == PJSUA_CALL_MEDIA_ACTIVE) { - pjsua_conf_connect (call_info.conf_slot, 0); - pjsua_conf_connect (0, call_info.conf_slot); + pjsua_conf_connect(call_info.conf_slot, 0); + pjsua_conf_connect(0, call_info.conf_slot); } } @@ -259,37 +245,37 @@ static void on_call_media_state (pjsua_call_id call_id) /** * Handler when there is incoming call. */ -static void on_incoming_call (pjsua_acc_id acc_id, pjsua_call_id call_id, - pjsip_rx_data *rdata) +static void on_incoming_call(pjsua_acc_id acc_id, pjsua_call_id call_id, + pjsip_rx_data *rdata) { pjsua_call_info call_info; - PJ_UNUSED_ARG (acc_id); - PJ_UNUSED_ARG (rdata); + PJ_UNUSED_ARG(acc_id); + PJ_UNUSED_ARG(rdata); if (g_current_call != PJSUA_INVALID_ID) { - pj_str_t reason; - reason = pj_str ("Another call is in progress"); - pjsua_call_answer (call_id, PJSIP_SC_BUSY_HERE, &reason, NULL); - return; + pj_str_t reason; + reason = pj_str("Another call is in progress"); + pjsua_call_answer(call_id, PJSIP_SC_BUSY_HERE, &reason, NULL); + return; } g_current_call = call_id; - pjsua_call_get_info (call_id, &call_info); + pjsua_call_get_info(call_id, &call_info); - SetAction (ID_MENU_ANSWER); - SetURI (call_info.remote_info.ptr, call_info.remote_info.slen, false); - pjsua_call_answer (call_id, 200, NULL, NULL); + SetAction(ID_MENU_ANSWER); + SetURI(call_info.remote_info.ptr, call_info.remote_info.slen, false); + pjsua_call_answer(call_id, 200, NULL, NULL); } /* * Handler registration status has changed. */ -static void on_reg_state (pjsua_acc_id acc_id) +static void on_reg_state(pjsua_acc_id acc_id) { - PJ_UNUSED_ARG (acc_id); + PJ_UNUSED_ARG(acc_id); // Log already written. } @@ -298,65 +284,65 @@ static void on_reg_state (pjsua_acc_id acc_id) /* * Handler on buddy state changed. */ -static void on_buddy_state (pjsua_buddy_id buddy_id) +static void on_buddy_state(pjsua_buddy_id buddy_id) { /* Currently this is not processed */ - PJ_UNUSED_ARG (buddy_id); + PJ_UNUSED_ARG(buddy_id); } /** * Incoming IM message (i.e. MESSAGE request)! */ -static void on_pager (pjsua_call_id call_id, const pj_str_t *from, - const pj_str_t *to, const pj_str_t *contact, - const pj_str_t *mime_type, const pj_str_t *text) +static void on_pager(pjsua_call_id call_id, const pj_str_t *from, + const pj_str_t *to, const pj_str_t *contact, + const pj_str_t *mime_type, const pj_str_t *text) { /* Currently this is not processed */ - PJ_UNUSED_ARG (call_id); - PJ_UNUSED_ARG (from); - PJ_UNUSED_ARG (to); - PJ_UNUSED_ARG (contact); - PJ_UNUSED_ARG (mime_type); - PJ_UNUSED_ARG (text); + PJ_UNUSED_ARG(call_id); + PJ_UNUSED_ARG(from); + PJ_UNUSED_ARG(to); + PJ_UNUSED_ARG(contact); + PJ_UNUSED_ARG(mime_type); + PJ_UNUSED_ARG(text); } /** * Received typing indication */ -static void on_typing (pjsua_call_id call_id, const pj_str_t *from, - const pj_str_t *to, const pj_str_t *contact, - pj_bool_t is_typing) +static void on_typing(pjsua_call_id call_id, const pj_str_t *from, + const pj_str_t *to, const pj_str_t *contact, + pj_bool_t is_typing) { /* Currently this is not processed */ - PJ_UNUSED_ARG (call_id); - PJ_UNUSED_ARG (from); - PJ_UNUSED_ARG (to); - PJ_UNUSED_ARG (contact); - PJ_UNUSED_ARG (is_typing); + PJ_UNUSED_ARG(call_id); + PJ_UNUSED_ARG(from); + PJ_UNUSED_ARG(to); + PJ_UNUSED_ARG(contact); + PJ_UNUSED_ARG(is_typing); } -/** - * Callback upon NAT detection completion +/** + * Callback upon NAT detection completion */ -static void nat_detect_cb (const pj_stun_nat_detect_result *res) +static void nat_detect_cb(const pj_stun_nat_detect_result *res) { if (res->status != PJ_SUCCESS) { - char msg[250]; - pj_ansi_snprintf (msg, sizeof (msg), "NAT detection failed: %s", - res->status_text); - SetCallStatus (msg, pj_ansi_strlen (msg)); + char msg[250]; + pj_ansi_snprintf(msg, sizeof(msg), "NAT detection failed: %s", + res->status_text); + SetCallStatus(msg, pj_ansi_strlen(msg)); } else { - char msg[250]; - pj_ansi_snprintf (msg, sizeof (msg), "NAT type is %s", - res->nat_type_name); - SetCallStatus (msg, pj_ansi_strlen (msg)); + char msg[250]; + pj_ansi_snprintf(msg, sizeof(msg), "NAT type is %s", + res->nat_type_name); + SetCallStatus(msg, pj_ansi_strlen(msg)); } } -static BOOL OnInitStack (void) +static BOOL OnInitStack(void) { pjsua_config cfg; pjsua_logging_config log_cfg; @@ -370,172 +356,141 @@ static BOOL OnInitStack (void) /* Create pjsua */ status = pjsua_create(); - if (status != PJ_SUCCESS) { - OnError (TEXT ("Error creating pjsua"), status); - return FALSE; + OnError(TEXT("Error creating pjsua"), status); + return FALSE; } /* Create global pool for application */ - g_pool = pjsua_pool_create ("pjsua", 4000, 4000); + g_pool = pjsua_pool_create("pjsua", 4000, 4000); /* Init configs */ - pjsua_config_default (&cfg); - - pjsua_media_config_default (&media_cfg); - - pjsua_transport_config_default (&udp_cfg); - + pjsua_config_default(&cfg); + pjsua_media_config_default(&media_cfg); + pjsua_transport_config_default(&udp_cfg); udp_cfg.port = SIP_PORT; - pjsua_transport_config_default (&rtp_cfg); - + pjsua_transport_config_default(&rtp_cfg); rtp_cfg.port = 40000; - pjsua_logging_config_default (&log_cfg); - + pjsua_logging_config_default(&log_cfg); log_cfg.level = 5; - - log_cfg.log_filename = pj_str ("\\pjsua.txt"); - + log_cfg.log_filename = pj_str("\\pjsua.txt"); log_cfg.msg_logging = 1; - log_cfg.decor = pj_log_get_decor() | PJ_LOG_HAS_CR; /* Setup media */ media_cfg.clock_rate = 8000; - media_cfg.ec_options = PJMEDIA_ECHO_SIMPLE; - media_cfg.ec_tail_len = 256; - // use default quality setting //media_cfg.quality = 1; media_cfg.ptime = 20; - media_cfg.enable_ice = USE_ICE; /* Initialize application callbacks */ cfg.cb.on_call_state = &on_call_state; - cfg.cb.on_call_media_state = &on_call_media_state; - cfg.cb.on_incoming_call = &on_incoming_call; - cfg.cb.on_reg_state = &on_reg_state; - cfg.cb.on_buddy_state = &on_buddy_state; - cfg.cb.on_pager = &on_pager; - cfg.cb.on_typing = &on_typing; - cfg.cb.on_nat_detect = &nat_detect_cb; if (SIP_PROXY) { - cfg.outbound_proxy_cnt = 1; - cfg.outbound_proxy[0] = pj_str (SIP_PROXY); + cfg.outbound_proxy_cnt = 1; + cfg.outbound_proxy[0] = pj_str(SIP_PROXY); } - + if (NAMESERVER) { - cfg.nameserver_count = 1; - cfg.nameserver[0] = pj_str (NAMESERVER); + cfg.nameserver_count = 1; + cfg.nameserver[0] = pj_str(NAMESERVER); } - + if (NAMESERVER && STUN_DOMAIN) { - cfg.stun_domain = pj_str (STUN_DOMAIN); + cfg.stun_domain = pj_str(STUN_DOMAIN); } else if (STUN_SERVER) { - cfg.stun_host = pj_str (STUN_SERVER); + cfg.stun_host = pj_str(STUN_SERVER); } - - + + /* Initialize pjsua */ - status = pjsua_init (&cfg, &log_cfg, &media_cfg); - + status = pjsua_init(&cfg, &log_cfg, &media_cfg); if (status != PJ_SUCCESS) { - OnError (TEXT ("Initialization error"), status); - return FALSE; + OnError(TEXT("Initialization error"), status); + return FALSE; } /* Set codec priority */ - pjsua_codec_set_priority (pj_cstr (&tmp, "pcmu"), 240); - - pjsua_codec_set_priority (pj_cstr (&tmp, "pcma"), 230); - - pjsua_codec_set_priority (pj_cstr (&tmp, "speex/8000"), 190); - - pjsua_codec_set_priority (pj_cstr (&tmp, "ilbc"), 189); - - pjsua_codec_set_priority (pj_cstr (&tmp, "speex/16000"), 180); - - pjsua_codec_set_priority (pj_cstr (&tmp, "speex/32000"), 0); - - pjsua_codec_set_priority (pj_cstr (&tmp, "gsm"), 100); + pjsua_codec_set_priority(pj_cstr(&tmp, "pcmu"), 240); + pjsua_codec_set_priority(pj_cstr(&tmp, "pcma"), 230); + pjsua_codec_set_priority(pj_cstr(&tmp, "speex/8000"), 190); + pjsua_codec_set_priority(pj_cstr(&tmp, "ilbc"), 189); + pjsua_codec_set_priority(pj_cstr(&tmp, "speex/16000"), 180); + pjsua_codec_set_priority(pj_cstr(&tmp, "speex/32000"), 0); + pjsua_codec_set_priority(pj_cstr(&tmp, "gsm"), 100); /* Add UDP transport and the corresponding PJSUA account */ - status = pjsua_transport_create (PJSIP_TRANSPORT_UDP, - &udp_cfg, &transport_id); - + status = pjsua_transport_create(PJSIP_TRANSPORT_UDP, + &udp_cfg, &transport_id); if (status != PJ_SUCCESS) { - OnError (TEXT ("Error starting SIP transport"), status); - return FALSE; + OnError(TEXT("Error starting SIP transport"), status); + return FALSE; } - pjsua_transport_get_info (transport_id, &transport_info); + pjsua_transport_get_info(transport_id, &transport_info); - g_local_uri.ptr = (char*) pj_pool_alloc (g_pool, 128); - g_local_uri.slen = pj_ansi_sprintf (g_local_uri.ptr, - "<sip:%.*s:%d>", - (int) transport_info.local_name.host.slen, - transport_info.local_name.host.ptr, - transport_info.local_name.port); + g_local_uri.ptr = (char*)pj_pool_alloc(g_pool, 128); + g_local_uri.slen = pj_ansi_sprintf(g_local_uri.ptr, + "<sip:%.*s:%d>", + (int)transport_info.local_name.host.slen, + transport_info.local_name.host.ptr, + transport_info.local_name.port); /* Add local account */ - pjsua_acc_add_local (transport_id, PJ_TRUE, &g_current_acc); - pjsua_acc_set_online_status (g_current_acc, PJ_TRUE); + pjsua_acc_add_local(transport_id, PJ_TRUE, &g_current_acc); + pjsua_acc_set_online_status(g_current_acc, PJ_TRUE); /* Add account */ - if (HAS_SIP_ACCOUNT) { - pjsua_acc_config cfg; - - pjsua_acc_config_default (&cfg); - cfg.id = pj_str ("sip:" SIP_USER "@" SIP_DOMAIN); - cfg.reg_uri = pj_str ("sip:" SIP_DOMAIN); - cfg.cred_count = 1; - cfg.cred_info[0].realm = pj_str (SIP_REALM); - cfg.cred_info[0].scheme = pj_str ("digest"); - cfg.cred_info[0].username = pj_str (SIP_USER); - cfg.cred_info[0].data_type = PJSIP_CRED_DATA_PLAIN_PASSWD; - cfg.cred_info[0].data = pj_str (SIP_PASSWD); - - status = pjsua_acc_add (&cfg, PJ_TRUE, &g_current_acc); - - if (status != PJ_SUCCESS) { - pjsua_destroy(); - return PJ_FALSE; - } + pjsua_acc_config cfg; + + pjsua_acc_config_default(&cfg); + cfg.id = pj_str("sip:" SIP_USER "@" SIP_DOMAIN); + cfg.reg_uri = pj_str("sip:" SIP_DOMAIN); + cfg.cred_count = 1; + cfg.cred_info[0].realm = pj_str(SIP_REALM); + cfg.cred_info[0].scheme = pj_str("digest"); + cfg.cred_info[0].username = pj_str(SIP_USER); + cfg.cred_info[0].data_type = PJSIP_CRED_DATA_PLAIN_PASSWD; + cfg.cred_info[0].data = pj_str(SIP_PASSWD); + + status = pjsua_acc_add(&cfg, PJ_TRUE, &g_current_acc); + if (status != PJ_SUCCESS) { + pjsua_destroy(); + return PJ_FALSE; + } } /* Add buddy */ if (SIP_DST_URI) { - pjsua_buddy_config bcfg; - - pjsua_buddy_config_default (&bcfg); - bcfg.uri = pj_str (SIP_DST_URI); - bcfg.subscribe = PJ_FALSE; - - pjsua_buddy_add (&bcfg, NULL); + pjsua_buddy_config bcfg; + + pjsua_buddy_config_default(&bcfg); + bcfg.uri = pj_str(SIP_DST_URI); + bcfg.subscribe = PJ_FALSE; + + pjsua_buddy_add(&bcfg, NULL); } /* Start pjsua */ status = pjsua_start(); - if (status != PJ_SUCCESS) { - OnError (TEXT ("Error starting pjsua"), status); - return FALSE; + OnError(TEXT("Error starting pjsua"), status); + return FALSE; } return TRUE; @@ -544,39 +499,40 @@ static BOOL OnInitStack (void) ////////////////////////////////////////////////////////////////////////////// -int WINAPI WinMain (HINSTANCE hInstance, - HINSTANCE hPrevInstance, - LPTSTR lpCmdLine, - int nCmdShow) +int WINAPI WinMain(HINSTANCE hInstance, + HINSTANCE hPrevInstance, + LPTSTR lpCmdLine, + int nCmdShow) { MSG msg; HACCEL hAccelTable; - PJ_UNUSED_ARG (lpCmdLine); - PJ_UNUSED_ARG (hPrevInstance); + PJ_UNUSED_ARG(lpCmdLine); + PJ_UNUSED_ARG(hPrevInstance); // Perform application initialization: - - if (!InitInstance (hInstance, nCmdShow)) { - return FALSE; + if (!InitInstance (hInstance, nCmdShow)) + { + return FALSE; } - - hAccelTable = LoadAccelerators (hInstance, (LPCTSTR) IDC_PJSUA_WINCE); - - + + hAccelTable = LoadAccelerators(hInstance, (LPCTSTR)IDC_PJSUA_WINCE); + + // Main message loop: - - while (GetMessage (&msg, NULL, 0, 0)) { - if (!TranslateAccelerator (msg.hwnd, hAccelTable, &msg)) { - TranslateMessage (&msg); - DispatchMessage (&msg); - } + while (GetMessage(&msg, NULL, 0, 0)) + { + if (!TranslateAccelerator(msg.hwnd, hAccelTable, &msg)) + { + TranslateMessage(&msg); + DispatchMessage(&msg); + } } - + return msg.wParam; } -static ATOM MyRegisterClass (HINSTANCE hInstance, LPTSTR szWindowClass) +static ATOM MyRegisterClass(HINSTANCE hInstance, LPTSTR szWindowClass) { WNDCLASS wc; @@ -585,17 +541,17 @@ static ATOM MyRegisterClass (HINSTANCE hInstance, LPTSTR szWindowClass) wc.cbClsExtra = 0; wc.cbWndExtra = 0; wc.hInstance = hInstance; - wc.hIcon = LoadIcon (hInstance, MAKEINTRESOURCE (IDI_PJSUA_WINCE)); + wc.hIcon = LoadIcon(hInstance, MAKEINTRESOURCE(IDI_PJSUA_WINCE)); wc.hCursor = 0; - wc.hbrBackground = (HBRUSH) GetStockObject (WHITE_BRUSH); + wc.hbrBackground = (HBRUSH) GetStockObject(WHITE_BRUSH); wc.lpszMenuName = 0; wc.lpszClassName = szWindowClass; - return RegisterClass (&wc); + return RegisterClass(&wc); } -BOOL InitInstance (HINSTANCE hInstance, int nCmdShow) +BOOL InitInstance(HINSTANCE hInstance, int nCmdShow) { HWND hWnd; TCHAR szTitle[MAX_LOADSTRING]; @@ -604,244 +560,221 @@ BOOL InitInstance (HINSTANCE hInstance, int nCmdShow) hInst = hInstance; /* Init stack */ - if (OnInitStack() == FALSE) - return FALSE; - - LoadString (hInstance, IDC_PJSUA_WINCE, szWindowClass, MAX_LOADSTRING); + return FALSE; - MyRegisterClass (hInstance, szWindowClass); + LoadString(hInstance, IDC_PJSUA_WINCE, szWindowClass, MAX_LOADSTRING); + MyRegisterClass(hInstance, szWindowClass); - LoadString (hInstance, IDS_APP_TITLE, szTitle, MAX_LOADSTRING); + LoadString(hInstance, IDS_APP_TITLE, szTitle, MAX_LOADSTRING); + hWnd = CreateWindow(szWindowClass, szTitle, WS_VISIBLE, + CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, 200, + NULL, NULL, hInstance, NULL); - hWnd = CreateWindow (szWindowClass, szTitle, WS_VISIBLE, - CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, 200, - NULL, NULL, hInstance, NULL); - - if (!hWnd) { - return FALSE; + if (!hWnd) + { + return FALSE; } hMainWnd = hWnd; - - ShowWindow (hWnd, nCmdShow); - UpdateWindow (hWnd); - + ShowWindow(hWnd, nCmdShow); + UpdateWindow(hWnd); if (hwndCB) - CommandBar_Show (hwndCB, TRUE); + CommandBar_Show(hwndCB, TRUE); - SetTimer (hMainWnd, ID_POLL_TIMER, 50, NULL); + SetTimer(hMainWnd, ID_POLL_TIMER, 50, NULL); pjsua_detect_nat_type(); - return TRUE; } -static void OnCreate (HWND hWnd) +static void OnCreate(HWND hWnd) { - enum { - X = 10, - Y = 40, - W = 220, - H = 30, + enum + { + X = 10, + Y = 40, + W = 220, + H = 30, }; DWORD dwStyle; hMainWnd = hWnd; - hwndCB = CommandBar_Create (hInst, hWnd, 1); - CommandBar_InsertMenubar (hwndCB, hInst, IDM_MENU, 0); - CommandBar_AddAdornments (hwndCB, 0, 0); + hwndCB = CommandBar_Create(hInst, hWnd, 1); + CommandBar_InsertMenubar(hwndCB, hInst, IDM_MENU, 0); + CommandBar_AddAdornments(hwndCB, 0, 0); // Create global status text - dwStyle = WS_CHILD | WS_VISIBLE | WS_DISABLED | ES_LEFT; - hwndGlobalStatus = CreateWindow ( - TEXT ("EDIT"), // Class name - NULL, // Window text - dwStyle, // Window style - X, // x-coordinate of the upper-left corner - Y+0, // y-coordinate of the upper-left corner - W, // Width of the window for the edit - // control - H-5, // Height of the window for the edit - // control - hWnd, // Window handle to the parent window - (HMENU) ID_GLOBAL_STATUS, // Control identifier - hInst, // Instance handle - NULL); // Specify NULL for this parameter when - // you create a control - SetLocalURI (g_local_uri.ptr, g_local_uri.slen, false); + dwStyle = WS_CHILD | WS_VISIBLE | WS_DISABLED | ES_LEFT; + hwndGlobalStatus = CreateWindow( + TEXT("EDIT"), // Class name + NULL, // Window text + dwStyle, // Window style + X, // x-coordinate of the upper-left corner + Y+0, // y-coordinate of the upper-left corner + W, // Width of the window for the edit + // control + H-5, // Height of the window for the edit + // control + hWnd, // Window handle to the parent window + (HMENU) ID_GLOBAL_STATUS, // Control identifier + hInst, // Instance handle + NULL); // Specify NULL for this parameter when + // you create a control + SetLocalURI(g_local_uri.ptr, g_local_uri.slen, false); // Create URI edit - dwStyle = WS_CHILD | WS_VISIBLE | WS_TABSTOP | WS_BORDER; + dwStyle = WS_CHILD | WS_VISIBLE | WS_TABSTOP | WS_BORDER; hwndURI = CreateWindow ( - TEXT ("EDIT"), // Class name - NULL, // Window text - dwStyle, // Window style - X, // x-coordinate of the upper-left corner - Y+H, // y-coordinate of the upper-left corner - W, // Width of the window for the edit - // control - H-5, // Height of the window for the edit - // control - hWnd, // Window handle to the parent window - (HMENU) ID_URI, // Control identifier - hInst, // Instance handle - NULL); // Specify NULL for this parameter when - // you create a control + TEXT("EDIT"), // Class name + NULL, // Window text + dwStyle, // Window style + X, // x-coordinate of the upper-left corner + Y+H, // y-coordinate of the upper-left corner + W, // Width of the window for the edit + // control + H-5, // Height of the window for the edit + // control + hWnd, // Window handle to the parent window + (HMENU) ID_URI, // Control identifier + hInst, // Instance handle + NULL); // Specify NULL for this parameter when + // you create a control // Create action Button - hwndActionButton = CreateWindow (L"button", L"Action", - WS_CHILD | WS_VISIBLE | BS_PUSHBUTTON, - X, Y+2*H, - 60, H-5, hWnd, - (HMENU) ID_BTN_ACTION, - hInst, NULL); + hwndActionButton = CreateWindow( L"button", L"Action", + WS_CHILD | WS_VISIBLE | BS_PUSHBUTTON, + X, Y+2*H, + 60, H-5, hWnd, + (HMENU) ID_BTN_ACTION, + hInst, NULL ); // Create exit button - hwndExitButton = CreateWindow (L"button", L"E&xit", - WS_CHILD | WS_VISIBLE | BS_PUSHBUTTON, - X+70, Y+2*H, - 60, H-5, hWnd, - (HMENU) ID_EXIT, - hInst, NULL); + hwndExitButton = CreateWindow( L"button", L"E&xit", + WS_CHILD | WS_VISIBLE | BS_PUSHBUTTON, + X+70, Y+2*H, + 60, H-5, hWnd, + (HMENU) ID_EXIT, + hInst, NULL ); // Create call status edit - dwStyle = WS_CHILD | WS_VISIBLE | WS_DISABLED; + dwStyle = WS_CHILD | WS_VISIBLE | WS_DISABLED; hwndCallStatus = CreateWindow ( - TEXT ("EDIT"), // Class name - NULL, // Window text - dwStyle, // Window style - X, // x-coordinate of the upper-left corner - Y+3*H, // y-coordinate of the upper-left corner - W, // Width of the window for the edit - // control - H-5, // Height of the window for the edit - // control - hWnd, // Window handle to the parent window - (HMENU) ID_CALL_STATUS, // Control identifier - hInst, // Instance handle - NULL); // Specify NULL for this parameter when - // you create a control - SetCallStatus ("Ready", 5); - SetAction (ID_MENU_CALL); - SetURI (SIP_DST_URI, -1); - SetFocus (hWnd); + TEXT("EDIT"), // Class name + NULL, // Window text + dwStyle, // Window style + X, // x-coordinate of the upper-left corner + Y+3*H, // y-coordinate of the upper-left corner + W, // Width of the window for the edit + // control + H-5, // Height of the window for the edit + // control + hWnd, // Window handle to the parent window + (HMENU) ID_CALL_STATUS, // Control identifier + hInst, // Instance handle + NULL); // Specify NULL for this parameter when + // you create a control + SetCallStatus("Ready", 5); + SetAction(ID_MENU_CALL); + SetURI(SIP_DST_URI, -1); + SetFocus(hWnd); } -static void OnDestroy (void) +static void OnDestroy(void) { pjsua_destroy(); } -static LRESULT CALLBACK WndProc (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) +static LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) { int wmId, wmEvent; - + switch (message) { - - case WM_KEYUP: - - if (wParam==114) { - wParam = ID_MENU_CALL; - } else if (wParam==115) { - if (g_current_call == PJSUA_INVALID_ID) - wParam = ID_EXIT; - else - wParam = ID_MENU_DISCONNECT; - } else - break; - - case WM_COMMAND: - wmId = LOWORD (wParam); - - wmEvent = HIWORD (wParam); - - if (wmId == ID_BTN_ACTION) - wmId = g_current_action; - - switch (wmId) { - - case ID_MENU_CALL: - - if (g_current_call != PJSUA_INVALID_ID) { - MessageBox (NULL, TEXT ("Can not make call"), - TEXT ("You already have one call active"), MB_OK); - } - - pj_str_t dst_uri; - - wchar_t text[256]; - char tmp[256]; - pj_status_t status; - - GetWindowText (hwndURI, text, PJ_ARRAY_SIZE (text)); - pj_unicode_to_ansi (text, pj_unicode_strlen (text), - tmp, sizeof (tmp)); - dst_uri.ptr = tmp; - dst_uri.slen = pj_ansi_strlen (tmp); - status = pjsua_call_make_call (g_current_acc, - &dst_uri, 0, NULL, - NULL, &g_current_call); - - if (status != PJ_SUCCESS) - OnError (TEXT ("Unable to make call"), status); - - break; - - case ID_MENU_ANSWER: - if (g_current_call == PJSUA_INVALID_ID) - MessageBox (NULL, TEXT ("Can not answer"), - TEXT ("There is no call!"), MB_OK); - else - pjsua_call_answer (g_current_call, 200, NULL, NULL); - - break; - - case ID_MENU_DISCONNECT: - if (g_current_call == PJSUA_INVALID_ID) - MessageBox (NULL, TEXT ("Can not disconnect"), - TEXT ("There is no call!"), MB_OK); - else - pjsua_call_hangup (g_current_call, PJSIP_SC_DECLINE, NULL, NULL); - - break; - - case ID_EXIT: - DestroyWindow (hWnd); - - break; - - default: - return DefWindowProc (hWnd, message, wParam, lParam); - } - - break; - - case WM_CREATE: - OnCreate (hWnd); - break; - - case WM_DESTROY: - OnDestroy(); - CommandBar_Destroy (hwndCB); - PostQuitMessage (0); - break; - - case WM_TIMER: - pjsua_handle_events (1); - break; - - default: - return DefWindowProc (hWnd, message, wParam, lParam); + case WM_KEYUP: + if (wParam==114) { + wParam = ID_MENU_CALL; + } else if (wParam==115) { + if (g_current_call == PJSUA_INVALID_ID) + wParam = ID_EXIT; + else + wParam = ID_MENU_DISCONNECT; + } else + break; + + case WM_COMMAND: + wmId = LOWORD(wParam); + wmEvent = HIWORD(wParam); + if (wmId == ID_BTN_ACTION) + wmId = g_current_action; + switch (wmId) + { + case ID_MENU_CALL: + if (g_current_call != PJSUA_INVALID_ID) { + MessageBox(NULL, TEXT("Can not make call"), + TEXT("You already have one call active"), MB_OK); + } + pj_str_t dst_uri; + wchar_t text[256]; + char tmp[256]; + pj_status_t status; + + GetWindowText(hwndURI, text, PJ_ARRAY_SIZE(text)); + pj_unicode_to_ansi(text, pj_unicode_strlen(text), + tmp, sizeof(tmp)); + dst_uri.ptr = tmp; + dst_uri.slen = pj_ansi_strlen(tmp); + status = pjsua_call_make_call(g_current_acc, + &dst_uri, 0, NULL, + NULL, &g_current_call); + if (status != PJ_SUCCESS) + OnError(TEXT("Unable to make call"), status); + break; + case ID_MENU_ANSWER: + if (g_current_call == PJSUA_INVALID_ID) + MessageBox(NULL, TEXT("Can not answer"), + TEXT("There is no call!"), MB_OK); + else + pjsua_call_answer(g_current_call, 200, NULL, NULL); + break; + case ID_MENU_DISCONNECT: + if (g_current_call == PJSUA_INVALID_ID) + MessageBox(NULL, TEXT("Can not disconnect"), + TEXT("There is no call!"), MB_OK); + else + pjsua_call_hangup(g_current_call, PJSIP_SC_DECLINE, NULL, NULL); + break; + case ID_EXIT: + DestroyWindow(hWnd); + break; + default: + return DefWindowProc(hWnd, message, wParam, lParam); + } + break; + + case WM_CREATE: + OnCreate(hWnd); + break; + + case WM_DESTROY: + OnDestroy(); + CommandBar_Destroy(hwndCB); + PostQuitMessage(0); + break; + + case WM_TIMER: + pjsua_handle_events(1); + break; + + default: + return DefWindowProc(hWnd, message, wParam, lParam); } - - return 0; + return 0; } diff --git a/sflphone-common/libs/pjproject/pjsip-apps/src/pjsystest/systest.c b/sflphone-common/libs/pjproject/pjsip-apps/src/pjsystest/systest.c index 3b8474357feb809284912e2ac44f6850ced8cd03..0ac9c67d384c951f6fae50864be258969c820d75 100644 --- a/sflphone-common/libs/pjproject/pjsip-apps/src/pjsystest/systest.c +++ b/sflphone-common/libs/pjproject/pjsip-apps/src/pjsystest/systest.c @@ -1,4 +1,4 @@ -/* $Id: systest.c 2840 2009-07-18 09:18:26Z bennylp $ */ +/* $Id: systest.c 2991 2009-11-08 03:35:41Z bennylp $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * @@ -114,7 +114,7 @@ static void systest_perror(const char *title, pj_status_t status) errmsg[0] = '\0'; strcpy(themsg, title); - strncat(themsg, errmsg, sizeof(themsg)); + strncat(themsg, errmsg, sizeof(themsg)-1); themsg[sizeof(themsg)-1] = '\0'; gui_msgbox("Error", themsg, WITH_OK); @@ -245,16 +245,32 @@ on_return: return; } +/* Util: create file player, each time trying different paths until we get + * the file. + */ +static pj_status_t create_player(unsigned path_cnt, const char *paths[], + pjsua_player_id *p_id) +{ + pj_str_t name; + pj_status_t status = PJ_ENOTFOUND; + unsigned i; + + for (i=0; i<path_cnt; ++i) { + status = pjsua_player_create(pj_cstr(&name, paths[i]), 0, p_id); + if (status == PJ_SUCCESS) + return PJ_SUCCESS; + } + return status; +} /***************************************************************************** * test: play WAV file */ -static void systest_play_wav(const char *filename) +static void systest_play_wav(unsigned path_cnt, const char *paths[]) { pjsua_player_id play_id = PJSUA_INVALID_ID; enum gui_key key; test_item_t *ti; - pj_str_t name; const char *title = "WAV File Playback Test"; pj_status_t status; @@ -268,7 +284,7 @@ static void systest_play_wav(const char *filename) "impairments such as stutter. Let this test run " "for a while to make sure that everything is okay." " Press OK to start, CANCEL to skip", - filename); + paths[0]); key = gui_msgbox(title, textbuf, WITH_OKCANCEL); @@ -280,7 +296,7 @@ static void systest_play_wav(const char *filename) PJ_LOG(3,(THIS_FILE, "Running %s", title)); /* WAV port */ - status = pjsua_player_create(pj_cstr(&name, filename), 0, &play_id); + status = create_player(path_cnt, paths, &play_id); if (status != PJ_SUCCESS) goto on_return; @@ -313,12 +329,16 @@ on_return: static void systest_play_wav1(void) { - systest_play_wav(WAV_PLAYBACK_PATH); + const char *paths[] = { WAV_PLAYBACK_PATH, + ALT_PATH1 WAV_PLAYBACK_PATH }; + systest_play_wav(PJ_ARRAY_SIZE(paths), paths); } static void systest_play_wav2(void) { - systest_play_wav(WAV_TOCK8_PATH); + const char *paths[] = { WAV_TOCK8_PATH, + ALT_PATH1 WAV_TOCK8_PATH}; + systest_play_wav(PJ_ARRAY_SIZE(paths), paths); } @@ -712,7 +732,7 @@ static int calculate_latency(pj_pool_t *pool, pjmedia_port *wav, static void systest_latency_test(void) { - const pj_str_t ref_wav_file = pj_str(WAV_TOCK8_PATH); + const char *ref_wav_paths[] = { WAV_TOCK8_PATH, ALT_PATH1 WAV_TOCK8_PATH }; const pj_str_t rec_wav_file = pj_str(WAV_LATENCY_OUT_PATH); pjsua_player_id play_id = PJSUA_INVALID_ID; pjsua_conf_port_id play_slot = PJSUA_INVALID_ID; @@ -754,7 +774,8 @@ static void systest_latency_test(void) PJ_LOG(3,(THIS_FILE, "Running %s", title)); - status = pjsua_player_create(&ref_wav_file, 0, &play_id); + status = create_player(PJ_ARRAY_SIZE(ref_wav_paths), ref_wav_paths, + &play_id); if (status != PJ_SUCCESS) goto on_return; diff --git a/sflphone-common/libs/pjproject/pjsip-apps/src/pjsystest/systest.h b/sflphone-common/libs/pjproject/pjsip-apps/src/pjsystest/systest.h index 0f10bd83cdba4e4fe0033b4a3681108ccff13535..cb5475c35031a88807d17b35d864200115f1cd7e 100644 --- a/sflphone-common/libs/pjproject/pjsip-apps/src/pjsystest/systest.h +++ b/sflphone-common/libs/pjproject/pjsip-apps/src/pjsystest/systest.h @@ -1,4 +1,4 @@ -/* $Id: systest.h 2839 2009-07-17 11:37:42Z bennylp $ */ +/* $Id: systest.h 2991 2009-11-08 03:35:41Z bennylp $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * @@ -53,6 +53,7 @@ #define WAV_REC_OUT_PATH "\\PJSYSTEST_TESTREC.WAV" #define WAV_TOCK8_PATH "\\Program Files\\pjsystest\\tock8.WAV" #define WAV_LATENCY_OUT_PATH "\\PJSYSTEST_LATREC.WAV" + #define ALT_PATH1 "" #else #define LOG_OUT_PATH "PJSYSTEST.LOG" #define RESULT_OUT_PATH "PJSYSTEST_RESULT.TXT" @@ -60,6 +61,7 @@ #define WAV_REC_OUT_PATH "PJSYSTEST_TESTREC.WAV" #define WAV_TOCK8_PATH "tock8.wav" #define WAV_LATENCY_OUT_PATH "PJSYSTEST_LATREC.WAV" + #define ALT_PATH1 "../../tests/pjsua/wavs/" #endif #ifdef __cplusplus diff --git a/sflphone-common/libs/pjproject/pjsip-apps/src/pocketpj/PocketPJ.cpp b/sflphone-common/libs/pjproject/pjsip-apps/src/pocketpj/PocketPJ.cpp index cc75d884ba8ed66ab5e30a943b74a3ec7d4f896e..2d42d96e2ea3f8e259bbfb5dc4ab2966ea01d874 100644 --- a/sflphone-common/libs/pjproject/pjsip-apps/src/pocketpj/PocketPJ.cpp +++ b/sflphone-common/libs/pjproject/pjsip-apps/src/pocketpj/PocketPJ.cpp @@ -14,21 +14,21 @@ static char THIS_FILE[] = __FILE__; ///////////////////////////////////////////////////////////////////////////// // CPocketPJApp -BEGIN_MESSAGE_MAP (CPocketPJApp, CWinApp) - //{{AFX_MSG_MAP(CPocketPJApp) - // NOTE - the ClassWizard will add and remove mapping macros here. - // DO NOT EDIT what you see in these blocks of generated code! - //}}AFX_MSG_MAP +BEGIN_MESSAGE_MAP(CPocketPJApp, CWinApp) + //{{AFX_MSG_MAP(CPocketPJApp) + // NOTE - the ClassWizard will add and remove mapping macros here. + // DO NOT EDIT what you see in these blocks of generated code! + //}}AFX_MSG_MAP END_MESSAGE_MAP() ///////////////////////////////////////////////////////////////////////////// // CPocketPJApp construction CPocketPJApp::CPocketPJApp() - : CWinApp() + : CWinApp() { - // TODO: add construction code here, - // Place all significant initialization in InitInstance + // TODO: add construction code here, + // Place all significant initialization in InitInstance } ///////////////////////////////////////////////////////////////////////////// @@ -41,24 +41,26 @@ CPocketPJApp theApp; BOOL CPocketPJApp::InitInstance() { - // Standard initialization - // If you are not using these features and wish to reduce the size - // of your final executable, you should remove from the following - // the specific initialization routines you do not need. + // Standard initialization + // If you are not using these features and wish to reduce the size + // of your final executable, you should remove from the following + // the specific initialization routines you do not need. - CPocketPJDlg dlg; - m_pMainWnd = &dlg; - int nResponse = dlg.DoModal(); + CPocketPJDlg dlg; + m_pMainWnd = &dlg; + int nResponse = dlg.DoModal(); + if (nResponse == IDOK) + { + // TODO: Place code here to handle when the dialog is + // dismissed with OK + } + else if (nResponse == IDCANCEL) + { + // TODO: Place code here to handle when the dialog is + // dismissed with Cancel + } - if (nResponse == IDOK) { - // TODO: Place code here to handle when the dialog is - // dismissed with OK - } else if (nResponse == IDCANCEL) { - // TODO: Place code here to handle when the dialog is - // dismissed with Cancel - } - - // Since the dialog has been closed, return FALSE so that we exit the - // application, rather than start the application's message pump. - return FALSE; + // Since the dialog has been closed, return FALSE so that we exit the + // application, rather than start the application's message pump. + return FALSE; } diff --git a/sflphone-common/libs/pjproject/pjsip-apps/src/pocketpj/PocketPJDlg.cpp b/sflphone-common/libs/pjproject/pjsip-apps/src/pocketpj/PocketPJDlg.cpp index ecec2641ab1e47d227c98d472cb441bc3e739422..b8a6bf2f1e7b3b3853bd122c02513c3e7d2fc0c2 100644 --- a/sflphone-common/libs/pjproject/pjsip-apps/src/pocketpj/PocketPJDlg.cpp +++ b/sflphone-common/libs/pjproject/pjsip-apps/src/pocketpj/PocketPJDlg.cpp @@ -18,65 +18,64 @@ static CPocketPJDlg *theDlg; ///////////////////////////////////////////////////////////////////////////// // CPocketPJDlg dialog -CPocketPJDlg::CPocketPJDlg (CWnd* pParent /*=NULL*/) - : CDialog (CPocketPJDlg::IDD, pParent), m_PopUp (NULL) +CPocketPJDlg::CPocketPJDlg(CWnd* pParent /*=NULL*/) + : CDialog(CPocketPJDlg::IDD, pParent), m_PopUp(NULL) { - //{{AFX_DATA_INIT(CPocketPJDlg) - // NOTE: the ClassWizard will add member initialization here - //}}AFX_DATA_INIT - // Note that LoadIcon does not require a subsequent DestroyIcon in Win32 - m_hIcon = AfxGetApp()->LoadIcon (IDR_MAINFRAME); - - theDlg = this; - - m_PopUp = new CPopUpWnd (this); - m_PopUp->Hide(); - - unsigned i; - m_PopUpCount = 0; - - for (i=0; i<POPUP_MAX_TYPE; ++i) { - m_PopUpState[i] = FALSE; - } + //{{AFX_DATA_INIT(CPocketPJDlg) + // NOTE: the ClassWizard will add member initialization here + //}}AFX_DATA_INIT + // Note that LoadIcon does not require a subsequent DestroyIcon in Win32 + m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME); + + theDlg = this; + + m_PopUp = new CPopUpWnd(this); + m_PopUp->Hide(); + + unsigned i; + m_PopUpCount = 0; + for (i=0; i<POPUP_MAX_TYPE; ++i) { + m_PopUpState[i] = FALSE; + } } -void CPocketPJDlg::DoDataExchange (CDataExchange* pDX) +void CPocketPJDlg::DoDataExchange(CDataExchange* pDX) { - CDialog::DoDataExchange (pDX); - //{{AFX_DATA_MAP(CPocketPJDlg) - DDX_Control (pDX, IDC_URL, m_Url); - DDX_Control (pDX, IDC_BUDDY_LIST, m_BuddyList); - DDX_Control (pDX, IDC_BTN_ACTION, m_BtnUrlAction); - DDX_Control (pDX, IDC_BTN_ACC, m_BtnAcc); - DDX_Control (pDX, IDC_ACC_ID, m_AccId); - //}}AFX_DATA_MAP + CDialog::DoDataExchange(pDX); + //{{AFX_DATA_MAP(CPocketPJDlg) + DDX_Control(pDX, IDC_URL, m_Url); + DDX_Control(pDX, IDC_BUDDY_LIST, m_BuddyList); + DDX_Control(pDX, IDC_BTN_ACTION, m_BtnUrlAction); + DDX_Control(pDX, IDC_BTN_ACC, m_BtnAcc); + DDX_Control(pDX, IDC_ACC_ID, m_AccId); + //}}AFX_DATA_MAP } -BEGIN_MESSAGE_MAP (CPocketPJDlg, CDialog) - //{{AFX_MSG_MAP(CPocketPJDlg) - ON_BN_CLICKED (IDC_BTN_ACC, OnBtnAcc) - ON_BN_CLICKED (IDC_BTN_ACTION, OnBtnAction) - ON_COMMAND (IDC_ACC_SETTINGS, OnSettings) - ON_COMMAND (IDC_URI_CALL, OnUriCall) - ON_WM_TIMER() - ON_COMMAND (IDC_URI_ADD_BUDDY, OnUriAddBuddy) - ON_COMMAND (IDC_URI_DEL_BUDDY, OnUriDelBuddy) - ON_COMMAND (IDC_ACC_ONLINE, OnAccOnline) - ON_COMMAND (IDC_ACC_INVISIBLE, OnAccInvisible) - ON_NOTIFY (NM_CLICK, IDC_BUDDY_LIST, OnClickBuddyList) - //}}AFX_MSG_MAP +BEGIN_MESSAGE_MAP(CPocketPJDlg, CDialog) + //{{AFX_MSG_MAP(CPocketPJDlg) + ON_BN_CLICKED(IDC_BTN_ACC, OnBtnAcc) + ON_BN_CLICKED(IDC_BTN_ACTION, OnBtnAction) + ON_COMMAND(IDC_ACC_SETTINGS, OnSettings) + ON_COMMAND(IDC_URI_CALL, OnUriCall) + ON_WM_TIMER() + ON_COMMAND(IDC_URI_ADD_BUDDY, OnUriAddBuddy) + ON_COMMAND(IDC_URI_DEL_BUDDY, OnUriDelBuddy) + ON_COMMAND(IDC_ACC_ONLINE, OnAccOnline) + ON_COMMAND(IDC_ACC_INVISIBLE, OnAccInvisible) + ON_NOTIFY(NM_CLICK, IDC_BUDDY_LIST, OnClickBuddyList) + //}}AFX_MSG_MAP END_MESSAGE_MAP() -void CPocketPJDlg::Error (const CString &title, pj_status_t rc) +void CPocketPJDlg::Error(const CString &title, pj_status_t rc) { char errmsg[PJ_ERR_MSG_SIZE]; wchar_t werrmsg[PJ_ERR_MSG_SIZE]; - pj_strerror (rc, errmsg, sizeof (errmsg)); - pj_ansi_to_unicode (errmsg, strlen (errmsg), werrmsg, PJ_ARRAY_SIZE (werrmsg)); + pj_strerror(rc, errmsg, sizeof(errmsg)); + pj_ansi_to_unicode(errmsg, strlen(errmsg), werrmsg, PJ_ARRAY_SIZE(werrmsg)); - AfxMessageBox (title + _T (": ") + werrmsg); + AfxMessageBox(title + _T(": ") + werrmsg); } BOOL CPocketPJDlg::Restart() @@ -85,43 +84,41 @@ BOOL CPocketPJDlg::Restart() pj_status_t status; char ver[80]; - sprintf (ver, "PocketPJ/%s", pj_get_version()); + sprintf(ver, "PocketPJ/%s", pj_get_version()); - ShowWindow (SW_SHOW); - PopUp_Show (POPUP_REGISTRATION, ver, - "Starting up....", "", "", "", 0); + ShowWindow(SW_SHOW); + PopUp_Show(POPUP_REGISTRATION, ver, + "Starting up....", "", "", "", 0); - KillTimer (TIMER_ID); + KillTimer(TIMER_ID); // Destroy first. - PopUp_Modify (POPUP_REGISTRATION, POPUP_EL_TITLE3, "Cleaning up.."); + PopUp_Modify(POPUP_REGISTRATION, POPUP_EL_TITLE3, "Cleaning up.."); pjsua_destroy(); - m_BtnAcc.SetBitmap (::LoadBitmap (AfxGetInstanceHandle(), MAKEINTRESOURCE (IDB_OFFLINE))); + m_BtnAcc.SetBitmap(::LoadBitmap(AfxGetInstanceHandle(), MAKEINTRESOURCE(IDB_OFFLINE)) ); UpdateWindow(); // Create - PopUp_Show (POPUP_REGISTRATION, ver, - "Starting up....", "Creating stack..", "", "", 0); + PopUp_Show(POPUP_REGISTRATION, ver, + "Starting up....", "Creating stack..", "", "", 0); status = pjsua_create(); - if (status != PJ_SUCCESS) { - Error (_T ("Error in creating library"), status); - PopUp_Hide (POPUP_REGISTRATION); - return FALSE; + Error(_T("Error in creating library"), status); + PopUp_Hide(POPUP_REGISTRATION); + return FALSE; } pjsua_config cfg; - pjsua_logging_config log_cfg; pjsua_media_config media_cfg; - pjsua_config_default (&cfg); + pjsua_config_default(&cfg); cfg.max_calls = 1; cfg.thread_cnt = 0; - cfg.user_agent = pj_str (ver); + cfg.user_agent = pj_str(ver); cfg.cb.on_call_state = &on_call_state; cfg.cb.on_call_media_state = &on_call_media_state; @@ -133,50 +130,53 @@ BOOL CPocketPJDlg::Restart() /* Configure nameserver */ char nameserver[60]; { - FIXED_INFO fi; - ULONG len = sizeof (fi); - CString err; - - PopUp_Modify (POPUP_REGISTRATION, POPUP_EL_TITLE3, "Retrieving network parameters.."); - - if (GetNetworkParams (&fi, &len) != ERROR_SUCCESS) { - err = _T ("Info: Error querying network parameters. You must configure DNS server."); - } else if (fi.CurrentDnsServer == NULL) { - err = _T ("Info: DNS server not configured. You must configure DNS server."); - } - - if (err.GetLength()) { - if (m_Cfg.m_DNS.GetLength()) { - pj_unicode_to_ansi ( (LPCTSTR) m_Cfg.m_DNS, m_Cfg.m_DNS.GetLength(), - nameserver, sizeof (nameserver)); - cfg.nameserver_count = 1; - cfg.nameserver[0] = pj_str (nameserver); - } else { - AfxMessageBox (err); - pjsua_destroy(); - PopUp_Hide (POPUP_REGISTRATION); - return FALSE; - } - } else { - strcpy (nameserver, fi.CurrentDnsServer->IpAddress.String); - cfg.nameserver_count = 1; - cfg.nameserver[0] = pj_str (nameserver); - } + FIXED_INFO fi; + PIP_ADDR_STRING pDNS = NULL; + ULONG len = sizeof(fi); + CString err; + + PopUp_Modify(POPUP_REGISTRATION, POPUP_EL_TITLE3, "Retrieving network parameters.."); + if (GetNetworkParams(&fi, &len) != ERROR_SUCCESS) { + err = _T("Info: Error querying network parameters. You must configure DNS server."); + } else if (fi.CurrentDnsServer) { + pDNS = fi.CurrentDnsServer; + } else if (fi.DnsServerList.IpAddress.String[0] != 0) { + pDNS = &fi.DnsServerList; + } else { + err = _T("Info: DNS server not configured. You must configure DNS server."); + } + + if (err.GetLength()) { + if (m_Cfg.m_DNS.GetLength()) { + pj_unicode_to_ansi((LPCTSTR)m_Cfg.m_DNS, m_Cfg.m_DNS.GetLength(), + nameserver, sizeof(nameserver)); + cfg.nameserver_count = 1; + cfg.nameserver[0] = pj_str(nameserver); + } else { + AfxMessageBox(err); + pjsua_destroy(); + PopUp_Hide(POPUP_REGISTRATION); + return FALSE; + } + } else { + strcpy(nameserver, pDNS->IpAddress.String); + cfg.nameserver_count = 1; + cfg.nameserver[0] = pj_str(nameserver); + } } char tmp_stun[80]; - if (m_Cfg.m_UseStun) { - pj_unicode_to_ansi ( (LPCTSTR) m_Cfg.m_StunSrv, m_Cfg.m_StunSrv.GetLength(), - tmp_stun, sizeof (tmp_stun)); - cfg.stun_host = pj_str (tmp_stun); + pj_unicode_to_ansi((LPCTSTR)m_Cfg.m_StunSrv, m_Cfg.m_StunSrv.GetLength(), + tmp_stun, sizeof(tmp_stun)); + cfg.stun_host = pj_str(tmp_stun); } - pjsua_logging_config_default (&log_cfg); - - log_cfg.log_filename = pj_str ("\\PocketPJ.TXT"); + pjsua_logging_config_default(&log_cfg); + log_cfg.msg_logging = PJ_TRUE; + log_cfg.log_filename = pj_str("\\PocketPJ.TXT"); - pjsua_media_config_default (&media_cfg); + pjsua_media_config_default(&media_cfg); media_cfg.clock_rate = 8000; media_cfg.audio_frame_ptime = 40; media_cfg.ec_tail_len = 0; @@ -189,246 +189,208 @@ BOOL CPocketPJDlg::Restart() media_cfg.no_vad = !m_Cfg.m_VAD; if (m_Cfg.m_EchoSuppress) { - media_cfg.ec_options = PJMEDIA_ECHO_SIMPLE; - media_cfg.ec_tail_len = m_Cfg.m_EcTail; + media_cfg.ec_options = PJMEDIA_ECHO_SIMPLE; + media_cfg.ec_tail_len = m_Cfg.m_EcTail; } // Init - PopUp_Modify (POPUP_REGISTRATION, POPUP_EL_TITLE3, "Initializing.."); - - status = pjsua_init (&cfg, &log_cfg, &media_cfg); - + PopUp_Modify(POPUP_REGISTRATION, POPUP_EL_TITLE3, "Initializing.."); + status = pjsua_init(&cfg, &log_cfg, &media_cfg); if (status != PJ_SUCCESS) { - Error (_T ("Error initializing library"), status); - pjsua_destroy(); - PopUp_Hide (POPUP_REGISTRATION); - return FALSE; + Error(_T("Error initializing library"), status); + pjsua_destroy(); + PopUp_Hide(POPUP_REGISTRATION); + return FALSE; } // Create one UDP transport - PopUp_Modify (POPUP_REGISTRATION, POPUP_EL_TITLE3, "Adding UDP transport.."); - + PopUp_Modify(POPUP_REGISTRATION, POPUP_EL_TITLE3, "Adding UDP transport.."); pjsua_transport_id transport_id; - pjsua_transport_config udp_cfg; - pjsua_transport_config_default (&udp_cfg); - + pjsua_transport_config_default(&udp_cfg); udp_cfg.port = 0; - - status = pjsua_transport_create (PJSIP_TRANSPORT_UDP, - &udp_cfg, &transport_id); - + status = pjsua_transport_create(PJSIP_TRANSPORT_UDP, + &udp_cfg, &transport_id); if (status != PJ_SUCCESS) { - Error (_T ("Error creating UDP transport"), status); - pjsua_destroy(); - PopUp_Hide (POPUP_REGISTRATION); - return FALSE; + Error(_T("Error creating UDP transport"), status); + pjsua_destroy(); + PopUp_Hide(POPUP_REGISTRATION); + return FALSE; } - if (m_Cfg.m_TCP) { - // Create one TCP transport - PopUp_Modify (POPUP_REGISTRATION, POPUP_EL_TITLE3, "Adding TCP transport.."); - pjsua_transport_id transport_id; - pjsua_transport_config tcp_cfg; - - pjsua_transport_config_default (&tcp_cfg); - tcp_cfg.port = 0; - status = pjsua_transport_create (PJSIP_TRANSPORT_TCP, - &tcp_cfg, &transport_id); - - if (status != PJ_SUCCESS) { - Error (_T ("Error creating TCP transport"), status); - pjsua_destroy(); - PopUp_Hide (POPUP_REGISTRATION); - return FALSE; - } + // Always instantiate TCP to support auto-switching to TCP when + // packet is larger than 1300 bytes. If TCP is disabled when + // no auto-switching will occur + if (1) { + // Create one TCP transport + PopUp_Modify(POPUP_REGISTRATION, POPUP_EL_TITLE3, "Adding TCP transport.."); + pjsua_transport_id transport_id; + pjsua_transport_config tcp_cfg; + + pjsua_transport_config_default(&tcp_cfg); + tcp_cfg.port = 0; + status = pjsua_transport_create(PJSIP_TRANSPORT_TCP, + &tcp_cfg, &transport_id); + if (status != PJ_SUCCESS) { + Error(_T("Error creating TCP transport"), status); + pjsua_destroy(); + PopUp_Hide(POPUP_REGISTRATION); + return FALSE; + } } // Adjust codecs priority pj_str_t tmp; - - pjsua_codec_set_priority (pj_cstr (&tmp, "*"), 0); - - for (i=0; i< (unsigned) m_Cfg.m_Codecs.GetSize(); ++i) { - CString codec = m_Cfg.m_Codecs.GetAt (i); - char tmp_nam[80]; - - pj_unicode_to_ansi ( (LPCTSTR) codec, codec.GetLength(), - tmp_nam, sizeof (tmp_nam)); - pjsua_codec_set_priority (pj_cstr (&tmp, tmp_nam), (pj_uint8_t) (200-i)); + pjsua_codec_set_priority(pj_cstr(&tmp, "*"), 0); + for (i=0; i<(unsigned)m_Cfg.m_Codecs.GetSize(); ++i) { + CString codec = m_Cfg.m_Codecs.GetAt(i); + char tmp_nam[80]; + + pj_unicode_to_ansi((LPCTSTR)codec, codec.GetLength(), + tmp_nam, sizeof(tmp_nam)); + pjsua_codec_set_priority(pj_cstr(&tmp, tmp_nam), (pj_uint8_t)(200-i)); } // Start! - PopUp_Modify (POPUP_REGISTRATION, POPUP_EL_TITLE3, "Starting.."); - + PopUp_Modify(POPUP_REGISTRATION, POPUP_EL_TITLE3, "Starting.."); status = pjsua_start(); - if (status != PJ_SUCCESS) { - Error (_T ("Error starting library"), status); - pjsua_destroy(); - PopUp_Hide (POPUP_REGISTRATION); - return FALSE; + Error(_T("Error starting library"), status); + pjsua_destroy(); + PopUp_Hide(POPUP_REGISTRATION); + return FALSE; } // Add account - PopUp_Modify (POPUP_REGISTRATION, POPUP_EL_TITLE3, "Adding account.."); - + PopUp_Modify(POPUP_REGISTRATION, POPUP_EL_TITLE3, "Adding account.."); char domain[80], username[80], passwd[80]; - char id[80], reg_uri[80]; - pjsua_acc_config acc_cfg; - pj_unicode_to_ansi ( (LPCTSTR) m_Cfg.m_Domain, m_Cfg.m_Domain.GetLength(), - domain, sizeof (domain)); - - pj_unicode_to_ansi ( (LPCTSTR) m_Cfg.m_User, m_Cfg.m_User.GetLength(), - username, sizeof (username)); - - pj_unicode_to_ansi ( (LPCTSTR) m_Cfg.m_Password, m_Cfg.m_Password.GetLength(), - passwd, sizeof (passwd)); - - snprintf (id, sizeof (id), "<sip:%s@%s>", username, domain); - - snprintf (reg_uri, sizeof (reg_uri), "sip:%s", domain); - - pjsua_acc_config_default (&acc_cfg); - - acc_cfg.id = pj_str (id); + pj_unicode_to_ansi((LPCTSTR)m_Cfg.m_Domain, m_Cfg.m_Domain.GetLength(), + domain, sizeof(domain)); + pj_unicode_to_ansi((LPCTSTR)m_Cfg.m_User, m_Cfg.m_User.GetLength(), + username, sizeof(username)); + pj_unicode_to_ansi((LPCTSTR)m_Cfg.m_Password, m_Cfg.m_Password.GetLength(), + passwd, sizeof(passwd)); - acc_cfg.reg_uri = pj_str (reg_uri); + snprintf(id, sizeof(id), "<sip:%s@%s>", username, domain); + snprintf(reg_uri, sizeof(reg_uri), "sip:%s", domain); + pjsua_acc_config_default(&acc_cfg); + acc_cfg.id = pj_str(id); + acc_cfg.reg_uri = pj_str(reg_uri); acc_cfg.cred_count = 1; - - acc_cfg.cred_info[0].scheme = pj_str ("Digest"); - - acc_cfg.cred_info[0].realm = pj_str ("*"); - - acc_cfg.cred_info[0].username = pj_str (username); - + acc_cfg.cred_info[0].scheme = pj_str("Digest"); + acc_cfg.cred_info[0].realm = pj_str("*"); + acc_cfg.cred_info[0].username = pj_str(username); acc_cfg.cred_info[0].data_type = 0; - - acc_cfg.cred_info[0].data = pj_str (passwd); + acc_cfg.cred_info[0].data = pj_str(passwd); #if defined(PJMEDIA_HAS_SRTP) && (PJMEDIA_HAS_SRTP != 0) acc_cfg.use_srtp = (m_Cfg.m_UseSrtp ? PJMEDIA_SRTP_OPTIONAL : PJMEDIA_SRTP_DISABLED); - acc_cfg.srtp_secure_signaling = 0; - #endif acc_cfg.publish_enabled = m_Cfg.m_UsePublish; - + char route[80]; - if (m_Cfg.m_TCP) { - snprintf (route, sizeof (route), "<sip:%s;lr;transport=tcp>", domain); - acc_cfg.proxy[acc_cfg.proxy_cnt++] = pj_str (route); + snprintf(route, sizeof(route), "<sip:%s;lr;transport=tcp>", domain); + acc_cfg.proxy[acc_cfg.proxy_cnt++] = pj_str(route); } else { - snprintf (route, sizeof (route), "<sip:%s;lr>", domain); - acc_cfg.proxy[acc_cfg.proxy_cnt++] = pj_str (route); + snprintf(route, sizeof(route), "<sip:%s;lr>", domain); + acc_cfg.proxy[acc_cfg.proxy_cnt++] = pj_str(route); } - status = pjsua_acc_add (&acc_cfg, PJ_TRUE, &m_PjsuaAccId); - + status = pjsua_acc_add(&acc_cfg, PJ_TRUE, &m_PjsuaAccId); if (status != PJ_SUCCESS) { - Error (_T ("Invalid account settings"), status); - pjsua_destroy(); - PopUp_Hide (POPUP_REGISTRATION); - return FALSE; + Error(_T("Invalid account settings"), status); + pjsua_destroy(); + PopUp_Hide(POPUP_REGISTRATION); + return FALSE; } - CString acc_text = m_Cfg.m_User + _T ("@") + m_Cfg.m_Domain; - - m_AccId.SetWindowText (acc_text); + CString acc_text = m_Cfg.m_User + _T("@") + m_Cfg.m_Domain; + m_AccId.SetWindowText(acc_text); - PopUp_Modify (POPUP_REGISTRATION, POPUP_EL_TITLE1, acc_text); - PopUp_Modify (POPUP_REGISTRATION, POPUP_EL_TITLE2, "Registering.."); - PopUp_Modify (POPUP_REGISTRATION, POPUP_EL_TITLE3, ""); + PopUp_Modify(POPUP_REGISTRATION, POPUP_EL_TITLE1, acc_text); + PopUp_Modify(POPUP_REGISTRATION, POPUP_EL_TITLE2, "Registering.."); + PopUp_Modify(POPUP_REGISTRATION, POPUP_EL_TITLE3, ""); - SetTimer (TIMER_ID, 100, NULL); + SetTimer(TIMER_ID, 100, NULL); return TRUE; } -void CPocketPJDlg::PopUp_Show (PopUpType type, - const CString& title1, - const CString& title2, - const CString& title3, - const CString& btn1, - const CString& btn2, - unsigned userData) +void CPocketPJDlg::PopUp_Show( PopUpType type, + const CString& title1, + const CString& title2, + const CString& title3, + const CString& btn1, + const CString& btn2, + unsigned userData) { - PJ_UNUSED_ARG (userData); + PJ_UNUSED_ARG(userData); if (!m_PopUpState[type]) - ++m_PopUpCount; + ++m_PopUpCount; m_PopUpState[type] = TRUE; m_PopUpContent[type].m_Title1 = title1; - m_PopUpContent[type].m_Title2 = title2; - m_PopUpContent[type].m_Title3 = title3; - m_PopUpContent[type].m_Btn1 = btn1; - m_PopUpContent[type].m_Btn2 = btn2; - m_PopUp->SetContent (m_PopUpContent[type]); - + m_PopUp->SetContent(m_PopUpContent[type]); m_PopUp->Show(); } -void CPocketPJDlg::PopUp_Modify (PopUpType type, - PopUpElement el, - const CString& text) +void CPocketPJDlg::PopUp_Modify(PopUpType type, + PopUpElement el, + const CString& text) { switch (el) { - - case POPUP_EL_TITLE1: - m_PopUpContent[type].m_Title1 = text; - break; - - case POPUP_EL_TITLE2: - m_PopUpContent[type].m_Title2 = text; - break; - - case POPUP_EL_TITLE3: - m_PopUpContent[type].m_Title3 = text; - break; - - case POPUP_EL_BUTTON1: - m_PopUpContent[type].m_Btn1 = text; - break; - - case POPUP_EL_BUTTON2: - m_PopUpContent[type].m_Btn1 = text; - break; + case POPUP_EL_TITLE1: + m_PopUpContent[type].m_Title1 = text; + break; + case POPUP_EL_TITLE2: + m_PopUpContent[type].m_Title2 = text; + break; + case POPUP_EL_TITLE3: + m_PopUpContent[type].m_Title3 = text; + break; + case POPUP_EL_BUTTON1: + m_PopUpContent[type].m_Btn1 = text; + break; + case POPUP_EL_BUTTON2: + m_PopUpContent[type].m_Btn1 = text; + break; } - m_PopUp->SetContent (m_PopUpContent[type]); + m_PopUp->SetContent(m_PopUpContent[type]); } -void CPocketPJDlg::PopUp_Hide (PopUpType type) +void CPocketPJDlg::PopUp_Hide(PopUpType type) { if (m_PopUpState[type]) - --m_PopUpCount; + --m_PopUpCount; m_PopUpState[type] = FALSE; if (m_PopUpCount == 0) { - m_PopUp->Hide(); - UpdateWindow(); + m_PopUp->Hide(); + UpdateWindow(); } else { - for (int i=POPUP_MAX_TYPE-1; i>=0; --i) { - if (m_PopUpState[i]) { - m_PopUp->SetContent (m_PopUpContent[i]); - break; - } - } + for (int i=POPUP_MAX_TYPE-1; i>=0; --i) { + if (m_PopUpState[i]) { + m_PopUp->SetContent(m_PopUpContent[i]); + break; + } + } } } @@ -436,120 +398,109 @@ void CPocketPJDlg::OnCallState() { pjsua_call_info ci; - pjsua_call_get_info (0, &ci); - + pjsua_call_get_info(0, &ci); + switch (ci.state) { - - case PJSIP_INV_STATE_NULL: /**< Before INVITE is sent or received */ - break; - - case PJSIP_INV_STATE_CALLING: /**< After INVITE is sent */ - PopUp_Show (POPUP_CALL, "Calling..", ci.remote_info.ptr, "", - "", "Hangup", 0); - break; - - case PJSIP_INV_STATE_INCOMING: /**< After INVITE is received. */ - PopUp_Show (POPUP_CALL, "Incoming call..", ci.remote_info.ptr, "", - "Answer", "Hangup", 0); - pjsua_call_answer (0, 180, NULL, NULL); - - if (m_Cfg.m_AutoAnswer) - OnPopUpButton (1); - - break; - - case PJSIP_INV_STATE_EARLY: /**< After response with To tag. */ - - case PJSIP_INV_STATE_CONNECTING:/**< After 2xx is sent/received. */ - - case PJSIP_INV_STATE_CONFIRMED: { /**< After ACK is sent/received. */ - CString stateText = ci.state_text.ptr; - PopUp_Modify (POPUP_CALL, POPUP_EL_TITLE3, stateText); - } - - break; - - case PJSIP_INV_STATE_DISCONNECTED:/**< Session is terminated. */ - PopUp_Modify (POPUP_CALL, POPUP_EL_TITLE3, "Disconnected"); - PopUp_Hide (POPUP_CALL); - break; - } + case PJSIP_INV_STATE_NULL: /**< Before INVITE is sent or received */ + break; + case PJSIP_INV_STATE_CALLING: /**< After INVITE is sent */ + PopUp_Show(POPUP_CALL, "Calling..", ci.remote_info.ptr, "", + "", "Hangup", 0); + break; + case PJSIP_INV_STATE_INCOMING: /**< After INVITE is received. */ + PopUp_Show(POPUP_CALL, "Incoming call..", ci.remote_info.ptr, "", + "Answer", "Hangup", 0); + pjsua_call_answer(0, 180, NULL, NULL); + if (m_Cfg.m_AutoAnswer) + OnPopUpButton(1); + break; + case PJSIP_INV_STATE_EARLY: /**< After response with To tag. */ + case PJSIP_INV_STATE_CONNECTING:/**< After 2xx is sent/received. */ + case PJSIP_INV_STATE_CONFIRMED: /**< After ACK is sent/received. */ + { + CString stateText = ci.state_text.ptr; + PopUp_Modify(POPUP_CALL, POPUP_EL_TITLE3, stateText); + } + break; + case PJSIP_INV_STATE_DISCONNECTED:/**< Session is terminated. */ + PopUp_Modify(POPUP_CALL, POPUP_EL_TITLE3, "Disconnected"); + PopUp_Hide(POPUP_CALL); + break; + } } -void CPocketPJDlg::on_call_state (pjsua_call_id call_id, pjsip_event *e) +void CPocketPJDlg::on_call_state(pjsua_call_id call_id, pjsip_event *e) { - PJ_UNUSED_ARG (e); - PJ_UNUSED_ARG (call_id); + PJ_UNUSED_ARG(e); + PJ_UNUSED_ARG(call_id); theDlg->OnCallState(); } -void CPocketPJDlg::on_call_media_state (pjsua_call_id call_id) +void CPocketPJDlg::on_call_media_state(pjsua_call_id call_id) { pjsua_call_info call_info; - pjsua_call_get_info (call_id, &call_info); - + pjsua_call_get_info(call_id, &call_info); if (call_info.media_status == PJSUA_CALL_MEDIA_ACTIVE) { - pjsua_conf_connect (call_info.conf_slot, 0); - pjsua_conf_connect (0, call_info.conf_slot); + pjsua_conf_connect(call_info.conf_slot, 0); + pjsua_conf_connect(0, call_info.conf_slot); } } -void CPocketPJDlg::on_incoming_call (pjsua_acc_id acc_id, pjsua_call_id call_id, - pjsip_rx_data *rdata) +void CPocketPJDlg::on_incoming_call(pjsua_acc_id acc_id, pjsua_call_id call_id, + pjsip_rx_data *rdata) { - PJ_UNUSED_ARG (acc_id); - PJ_UNUSED_ARG (call_id); - PJ_UNUSED_ARG (rdata); + PJ_UNUSED_ARG(acc_id); + PJ_UNUSED_ARG(call_id); + PJ_UNUSED_ARG(rdata); } void CPocketPJDlg::OnRegState() { pjsua_acc_info ai; - pjsua_acc_get_info (m_PjsuaAccId, &ai); + pjsua_acc_get_info(m_PjsuaAccId, &ai); - CString acc_text = m_Cfg.m_User + _T ("@") + m_Cfg.m_Domain; + CString acc_text = m_Cfg.m_User + _T("@") + m_Cfg.m_Domain; if (ai.expires>0 && ai.status/100==2) { - /* Registration success */ - HBITMAP old = m_BtnAcc.SetBitmap (::LoadBitmap (AfxGetInstanceHandle(), MAKEINTRESOURCE (IDB_ONLINE))); - PJ_UNUSED_ARG (old); - acc_text += " (OK)"; - m_AccId.SetWindowText (acc_text); + /* Registration success */ + HBITMAP old = m_BtnAcc.SetBitmap(::LoadBitmap(AfxGetInstanceHandle(), MAKEINTRESOURCE(IDB_ONLINE)) ); + PJ_UNUSED_ARG(old); + acc_text += " (OK)"; + m_AccId.SetWindowText(acc_text); } else if (ai.status/100 != 2) { - acc_text += " (err)"; - Error (_T ("SIP registration error"), PJSIP_ERRNO_FROM_SIP_STATUS (ai.status)); - m_AccId.SetWindowText (acc_text); + acc_text += " (err)"; + Error(_T("SIP registration error"), PJSIP_ERRNO_FROM_SIP_STATUS(ai.status)); + m_AccId.SetWindowText(acc_text); } - - PopUp_Hide (POPUP_REGISTRATION); + PopUp_Hide(POPUP_REGISTRATION); } -void CPocketPJDlg::on_reg_state (pjsua_acc_id acc_id) +void CPocketPJDlg::on_reg_state(pjsua_acc_id acc_id) { - PJ_UNUSED_ARG (acc_id); + PJ_UNUSED_ARG(acc_id); theDlg->OnRegState(); } -void CPocketPJDlg::on_buddy_state (pjsua_buddy_id buddy_id) +void CPocketPJDlg::on_buddy_state(pjsua_buddy_id buddy_id) { - PJ_UNUSED_ARG (buddy_id); + PJ_UNUSED_ARG(buddy_id); theDlg->RedrawBuddyList(); } -void CPocketPJDlg::on_pager (pjsua_call_id call_id, const pj_str_t *from, - const pj_str_t *to, const pj_str_t *contact, - const pj_str_t *mime_type, const pj_str_t *text) +void CPocketPJDlg::on_pager(pjsua_call_id call_id, const pj_str_t *from, + const pj_str_t *to, const pj_str_t *contact, + const pj_str_t *mime_type, const pj_str_t *text) { - PJ_UNUSED_ARG (call_id); - PJ_UNUSED_ARG (from); - PJ_UNUSED_ARG (to); - PJ_UNUSED_ARG (contact); - PJ_UNUSED_ARG (mime_type); - PJ_UNUSED_ARG (text); + PJ_UNUSED_ARG(call_id); + PJ_UNUSED_ARG(from); + PJ_UNUSED_ARG(to); + PJ_UNUSED_ARG(contact); + PJ_UNUSED_ARG(mime_type); + PJ_UNUSED_ARG(text); } ///////////////////////////////////////////////////////////////////////////// @@ -557,150 +508,143 @@ void CPocketPJDlg::on_pager (pjsua_call_id call_id, const pj_str_t *from, BOOL CPocketPJDlg::OnInitDialog() { - CDialog::OnInitDialog(); - - // Set the icon for this dialog. The framework does this automatically - // when the application's main window is not a dialog - SetIcon (m_hIcon, TRUE); // Set big icon - SetIcon (m_hIcon, FALSE); // Set small icon - - CenterWindow (GetDesktopWindow()); // center to the hpc screen - - // TODO: Add extra initialization here - - m_Cfg.LoadRegistry(); - //ShowWindow(SW_SHOW); - m_AccId.SetWindowText (m_Cfg.m_User); - - CImageList *il = new CImageList; - VERIFY (il->Create (16, 16, ILC_COLOR|ILC_MASK, 2, 4)); - - CBitmap *bmp = new CBitmap; - bmp->LoadBitmap (MAKEINTRESOURCE (IDB_BLANK)); - il->Add (bmp, RGB (255,255,255)); - bmp = new CBitmap; - bmp->LoadBitmap (MAKEINTRESOURCE (IDB_ONLINE)); - il->Add (bmp, RGB (255,255,255)); - - m_BuddyList.SetImageList (il, LVSIL_SMALL); - - if (m_Cfg.m_Domain.GetLength() ==0 || Restart() == FALSE) { - for (;;) { - CSettingsDlg dlg (m_Cfg); - - if (dlg.DoModal() != IDOK) { - EndDialog (IDOK); - return TRUE; - } - - m_Cfg.SaveRegistry(); - - if (Restart()) - break; - } - } - - RedrawBuddyList(); - - return TRUE; // return TRUE unless you set the focus to a control + CDialog::OnInitDialog(); + + // Set the icon for this dialog. The framework does this automatically + // when the application's main window is not a dialog + SetIcon(m_hIcon, TRUE); // Set big icon + SetIcon(m_hIcon, FALSE); // Set small icon + + CenterWindow(GetDesktopWindow()); // center to the hpc screen + + // TODO: Add extra initialization here + + m_Cfg.LoadRegistry(); + //ShowWindow(SW_SHOW); + m_AccId.SetWindowText(m_Cfg.m_User); + + CImageList *il = new CImageList; + VERIFY(il->Create(16, 16, ILC_COLOR|ILC_MASK, 2, 4)); + + CBitmap *bmp = new CBitmap; + bmp->LoadBitmap(MAKEINTRESOURCE(IDB_BLANK)); + il->Add(bmp, RGB(255,255,255)); + bmp = new CBitmap; + bmp->LoadBitmap(MAKEINTRESOURCE(IDB_ONLINE)); + il->Add(bmp, RGB(255,255,255)); + + m_BuddyList.SetImageList(il, LVSIL_SMALL); + + if (m_Cfg.m_Domain.GetLength()==0 || Restart() == FALSE) { + for (;;) { + CSettingsDlg dlg(m_Cfg); + if (dlg.DoModal() != IDOK) { + EndDialog(IDOK); + return TRUE; + } + + m_Cfg.SaveRegistry(); + + if (Restart()) + break; + } + } + + RedrawBuddyList(); + return TRUE; // return TRUE unless you set the focus to a control } -void CPocketPJDlg::OnBtnAcc() +void CPocketPJDlg::OnBtnAcc() { CMenu menu; - VERIFY (menu.LoadMenu (IDR_ACC_MENU)); - CMenu* pPopup = menu.GetSubMenu (0); - ASSERT (pPopup != NULL); + VERIFY(menu.LoadMenu(IDR_ACC_MENU)); + CMenu* pPopup = menu.GetSubMenu(0); + ASSERT(pPopup != NULL); RECT r; - m_BtnAcc.GetWindowRect (&r); - pPopup->TrackPopupMenu (TPM_LEFTALIGN, r.left+4, r.top+4, this); + m_BtnAcc.GetWindowRect(&r); + pPopup->TrackPopupMenu(TPM_LEFTALIGN, r.left+4, r.top+4, this); } -void CPocketPJDlg::OnBtnAction() +void CPocketPJDlg::OnBtnAction() { CMenu menu; - VERIFY (menu.LoadMenu (IDR_URI_MENU)); - CMenu* pPopup = menu.GetSubMenu (0); - ASSERT (pPopup != NULL); + VERIFY(menu.LoadMenu(IDR_URI_MENU)); + CMenu* pPopup = menu.GetSubMenu(0); + ASSERT(pPopup != NULL); RECT r; - this->m_BtnUrlAction.GetWindowRect (&r); - pPopup->TrackPopupMenu (TPM_LEFTALIGN, r.left+4, r.top+4, this); + this->m_BtnUrlAction.GetWindowRect(&r); + pPopup->TrackPopupMenu(TPM_LEFTALIGN, r.left+4, r.top+4, this); } -void CPocketPJDlg::OnSettings() +void CPocketPJDlg::OnSettings() { for (;;) { - CSettingsDlg dlg (m_Cfg); - - if (dlg.DoModal() != IDOK) { - return; - } + CSettingsDlg dlg(m_Cfg); + if (dlg.DoModal() != IDOK) { + return; + } - m_Cfg.SaveRegistry(); + m_Cfg.SaveRegistry(); - if (Restart()) - break; + if (Restart()) + break; } } void CPocketPJDlg::OnOK() { - if (AfxMessageBox (_T ("Quit PocketPJ?"), MB_YESNO) ==IDYES) { - KillTimer (TIMER_ID); - PopUp_Show (POPUP_REGISTRATION, "", "Shutting down..", "", "", "", 0); - pjsua_destroy(); - CDialog::OnOK(); - PopUp_Hide (POPUP_REGISTRATION); - m_Cfg.SaveRegistry(); - return; + if (AfxMessageBox(_T("Quit PocketPJ?"), MB_YESNO)==IDYES) { + KillTimer(TIMER_ID); + PopUp_Show(POPUP_REGISTRATION, "", "Shutting down..", "", "", "", 0); + pjsua_destroy(); + CDialog::OnOK(); + PopUp_Hide(POPUP_REGISTRATION); + m_Cfg.SaveRegistry(); + return; } } -void CPocketPJDlg::OnTimer (UINT nIDEvent) +void CPocketPJDlg::OnTimer(UINT nIDEvent) { - pjsua_handle_events (10); - CDialog::OnTimer (nIDEvent); + pjsua_handle_events(10); + CDialog::OnTimer(nIDEvent); } -int CPocketPJDlg::FindBuddyInPjsua (const CString &Uri) +int CPocketPJDlg::FindBuddyInPjsua(const CString &Uri) { char uri[80]; pjsua_buddy_id id[128]; - unsigned i, count = PJ_ARRAY_SIZE (id); - - if (pjsua_enum_buddies (id, &count) != PJ_SUCCESS) - return PJSUA_INVALID_ID; + unsigned i, count = PJ_ARRAY_SIZE(id); + if (pjsua_enum_buddies(id, &count) != PJ_SUCCESS) + return PJSUA_INVALID_ID; if (count==0) - return PJSUA_INVALID_ID; + return PJSUA_INVALID_ID; - pj_unicode_to_ansi ( (LPCTSTR) Uri, Uri.GetLength(), uri, sizeof (uri)); + pj_unicode_to_ansi((LPCTSTR)Uri, Uri.GetLength(), uri, sizeof(uri)); for (i=0; i<count; ++i) { - pjsua_buddy_info bi; - pjsua_buddy_get_info (id[i], &bi); - - if (pj_strcmp2 (&bi.uri, uri) ==0) - return i; + pjsua_buddy_info bi; + pjsua_buddy_get_info(id[i], &bi); + if (pj_strcmp2(&bi.uri, uri)==0) + return i; } return PJSUA_INVALID_ID; } -int CPocketPJDlg::FindBuddyInCfg (const CString &uri) +int CPocketPJDlg::FindBuddyInCfg(const CString &uri) { int i; - for (i=0; i<m_Cfg.m_BuddyList.GetSize(); ++i) { - if (m_Cfg.m_BuddyList.GetAt (0) == uri) { - return i; - } + if (m_Cfg.m_BuddyList.GetAt(0) == uri) { + return i; + } } - return -1; } @@ -711,136 +655,127 @@ void CPocketPJDlg::RedrawBuddyList() m_BuddyList.DeleteAllItems(); for (i=0; i<m_Cfg.m_BuddyList.GetSize(); ++i) { - int isOnline; - int id; - - id = FindBuddyInPjsua (m_Cfg.m_BuddyList.GetAt (i)); - - if (id != PJSUA_INVALID_ID) { - pjsua_buddy_info bi; - pjsua_buddy_get_info (id, &bi); - isOnline = (bi.status == PJSUA_BUDDY_STATUS_ONLINE); - } else { - isOnline = 0; - } - - LVITEM lvi; - - memset (&lvi, 0, sizeof (lvi)); - lvi.mask = LVIF_TEXT | LVIF_IMAGE; - lvi.iItem = i; - lvi.iImage = isOnline; - lvi.pszText = (LPTSTR) (LPCTSTR) m_Cfg.m_BuddyList.GetAt (i); - - m_BuddyList.InsertItem (&lvi); + int isOnline; + int id; + + id = FindBuddyInPjsua(m_Cfg.m_BuddyList.GetAt(i)); + if (id != PJSUA_INVALID_ID) { + pjsua_buddy_info bi; + pjsua_buddy_get_info(id, &bi); + isOnline = (bi.status == PJSUA_BUDDY_STATUS_ONLINE); + } else { + isOnline = 0; + } + + LVITEM lvi; + memset(&lvi, 0, sizeof(lvi)); + lvi.mask = LVIF_TEXT | LVIF_IMAGE; + lvi.iItem = i; + lvi.iImage = isOnline; + lvi.pszText = (LPTSTR)(LPCTSTR)m_Cfg.m_BuddyList.GetAt(i); + + m_BuddyList.InsertItem(&lvi); } } -void CPocketPJDlg::OnUriCall() +void CPocketPJDlg::OnUriCall() { char tmp[120]; CString uri; pj_status_t status; - m_Url.GetWindowText (uri); - pj_unicode_to_ansi ( (LPCTSTR) uri, uri.GetLength(), tmp, sizeof (tmp)); - - if ( (status=pjsua_verify_sip_url (tmp)) != PJ_SUCCESS) { - Error ("The URL is not valid SIP URL", status); - return; + m_Url.GetWindowText(uri); + pj_unicode_to_ansi((LPCTSTR)uri, uri.GetLength(), tmp, sizeof(tmp)); + if ((status=pjsua_verify_sip_url(tmp)) != PJ_SUCCESS) { + Error("The URL is not valid SIP URL", status); + return; } - pj_str_t dest_uri = pj_str (tmp); - + pj_str_t dest_uri = pj_str(tmp); pjsua_call_id call_id; - status = pjsua_call_make_call (m_PjsuaAccId, &dest_uri, 0, NULL, NULL, &call_id); + status = pjsua_call_make_call(m_PjsuaAccId, &dest_uri, 0, NULL, NULL, &call_id); if (status != PJ_SUCCESS) - Error ("Unable to make call", status); + Error("Unable to make call", status); } -void CPocketPJDlg::OnUriAddBuddy() +void CPocketPJDlg::OnUriAddBuddy() { int i; char tmp[120]; CString uri; pj_status_t status; - m_Url.GetWindowText (uri); - pj_unicode_to_ansi ( (LPCTSTR) uri, uri.GetLength(), tmp, sizeof (tmp)); - - if ( (status=pjsua_verify_sip_url (tmp)) != PJ_SUCCESS) { - Error ("The URL is not valid SIP URL", status); - return; + m_Url.GetWindowText(uri); + pj_unicode_to_ansi((LPCTSTR)uri, uri.GetLength(), tmp, sizeof(tmp)); + if ((status=pjsua_verify_sip_url(tmp)) != PJ_SUCCESS) { + Error("The URL is not valid SIP URL", status); + return; } for (i=0; i<m_Cfg.m_BuddyList.GetSize(); ++i) { - if (m_Cfg.m_BuddyList.GetAt (0) == uri) { - AfxMessageBox (_T ("The URI is already in the buddy list")); - return; - } + if (m_Cfg.m_BuddyList.GetAt(0) == uri) { + AfxMessageBox(_T("The URI is already in the buddy list")); + return; + } } - m_Cfg.m_BuddyList.Add (uri); - + m_Cfg.m_BuddyList.Add(uri); RedrawBuddyList(); } -void CPocketPJDlg::OnUriDelBuddy() +void CPocketPJDlg::OnUriDelBuddy() { CString uri; - m_Url.GetWindowText (uri); - int i = FindBuddyInCfg (uri); - + m_Url.GetWindowText(uri); + int i = FindBuddyInCfg(uri); if (i<0) { - /* Buddy not found */ - return; + /* Buddy not found */ + return; } - m_Cfg.m_BuddyList.RemoveAt (i); - + m_Cfg.m_BuddyList.RemoveAt(i); RedrawBuddyList(); - AfxMessageBox (_T ("Buddy " + uri + " deleted")); + AfxMessageBox(_T("Buddy " + uri + " deleted")); } -void CPocketPJDlg::OnAccOnline() +void CPocketPJDlg::OnAccOnline() { - pjsua_acc_set_online_status (m_PjsuaAccId, PJ_TRUE); - m_BtnAcc.SetBitmap (::LoadBitmap (AfxGetInstanceHandle(), MAKEINTRESOURCE (IDB_ONLINE))); + pjsua_acc_set_online_status(m_PjsuaAccId, PJ_TRUE); + m_BtnAcc.SetBitmap(::LoadBitmap(AfxGetInstanceHandle(), MAKEINTRESOURCE(IDB_ONLINE)) ); } -void CPocketPJDlg::OnAccInvisible() +void CPocketPJDlg::OnAccInvisible() { - pjsua_acc_set_online_status (m_PjsuaAccId, PJ_FALSE); - m_BtnAcc.SetBitmap (::LoadBitmap (AfxGetInstanceHandle(), MAKEINTRESOURCE (IDB_INVISIBLE))); + pjsua_acc_set_online_status(m_PjsuaAccId, PJ_FALSE); + m_BtnAcc.SetBitmap(::LoadBitmap(AfxGetInstanceHandle(), MAKEINTRESOURCE(IDB_INVISIBLE)) ); } -void CPocketPJDlg::OnPopUpButton (int btnNo) +void CPocketPJDlg::OnPopUpButton(int btnNo) { if (btnNo == 1) { - pjsua_call_answer (0, 200, NULL, 0); - PopUp_Modify (POPUP_CALL, POPUP_EL_BUTTON1, ""); + pjsua_call_answer(0, 200, NULL, 0); + PopUp_Modify(POPUP_CALL, POPUP_EL_BUTTON1, ""); } else if (btnNo == 2) { - // Hangup button - PopUp_Modify (POPUP_CALL, POPUP_EL_TITLE2, "Hang up.."); - PopUp_Modify (POPUP_CALL, POPUP_EL_TITLE3, ""); - pjsua_call_hangup (0, PJSIP_SC_DECLINE, 0, 0); + // Hangup button + PopUp_Modify(POPUP_CALL, POPUP_EL_TITLE2, "Hang up.."); + PopUp_Modify(POPUP_CALL, POPUP_EL_TITLE3, ""); + pjsua_call_hangup(0, PJSIP_SC_DECLINE, 0, 0); } } -void CPocketPJDlg::OnClickBuddyList (NMHDR* pNMHDR, LRESULT* pResult) +void CPocketPJDlg::OnClickBuddyList(NMHDR* pNMHDR, LRESULT* pResult) { POSITION pos = m_BuddyList.GetFirstSelectedItemPosition(); - PJ_UNUSED_ARG (pNMHDR); + PJ_UNUSED_ARG(pNMHDR); if (pos != NULL) { - int iItem = m_BuddyList.GetNextSelectedItem (pos); - CString uri = m_BuddyList.GetItemText (iItem, 0); - m_Url.SetWindowText (uri); + int iItem = m_BuddyList.GetNextSelectedItem(pos); + CString uri = m_BuddyList.GetItemText(iItem, 0); + m_Url.SetWindowText(uri); } - *pResult = 0; } diff --git a/sflphone-common/libs/pjproject/pjsip-apps/src/pocketpj/PopUpWnd.cpp b/sflphone-common/libs/pjproject/pjsip-apps/src/pocketpj/PopUpWnd.cpp index a92d2454e21f48256aa624a55358b576c276ebc3..1f1654f0621eca2dd67e4686be3002f1a647eff5 100644 --- a/sflphone-common/libs/pjproject/pjsip-apps/src/pocketpj/PopUpWnd.cpp +++ b/sflphone-common/libs/pjproject/pjsip-apps/src/pocketpj/PopUpWnd.cpp @@ -16,9 +16,9 @@ static char THIS_FILE[] = __FILE__; ///////////////////////////////////////////////////////////////////////////// // CPopUpWnd -CPopUpWnd::CPopUpWnd (CPocketPJDlg* pParent) +CPopUpWnd::CPopUpWnd(CPocketPJDlg* pParent) { - Create (pParent); + Create(pParent); } CPopUpWnd::~CPopUpWnd() @@ -26,95 +26,81 @@ CPopUpWnd::~CPopUpWnd() DestroyWindow(); } -BOOL CPopUpWnd::Create (CPocketPJDlg* pParent) +BOOL CPopUpWnd::Create(CPocketPJDlg* pParent) { BOOL bSuccess; m_ParentWnd = pParent; // Register window class - CString csClassName = AfxRegisterWndClass (CS_HREDRAW|CS_VREDRAW, - 0, - CBrush (::GetSysColor (COLOR_BTNFACE))); + CString csClassName = AfxRegisterWndClass(CS_HREDRAW|CS_VREDRAW, + 0, + CBrush(::GetSysColor(COLOR_BTNFACE))); // Create popup window - bSuccess = CreateEx (WS_EX_DLGMODALFRAME|WS_EX_TOPMOST, // Extended style - csClassName, // Classname - _T ("PocketPJ"), // Title - WS_POPUP|WS_BORDER|WS_CAPTION, // style - 0,0, // position - updated soon. - 1,1, // Size - updated soon - pParent->GetSafeHwnd(), // handle to parent - 0, // No menu - NULL); - - if (!bSuccess) - return FALSE; - - ShowWindow (SW_HIDE); + bSuccess = CreateEx(WS_EX_DLGMODALFRAME|WS_EX_TOPMOST, // Extended style + csClassName, // Classname + _T("PocketPJ"), // Title + WS_POPUP|WS_BORDER|WS_CAPTION, // style + 0,0, // position - updated soon. + 1,1, // Size - updated soon + pParent->GetSafeHwnd(), // handle to parent + 0, // No menu + NULL); + if (!bSuccess) + return FALSE; + + ShowWindow(SW_HIDE); // Now create the controls - CRect TempRect (0,0,10,10); + CRect TempRect(0,0,10,10); /* |SS_LEFTNOWORDWRAP */ - bSuccess = m_Title1.Create (_T ("Title1"), WS_CHILD|WS_VISIBLE|SS_NOPREFIX, - TempRect, this, IDC_TITLE1); - + bSuccess = m_Title1.Create(_T("Title1"), WS_CHILD|WS_VISIBLE|SS_NOPREFIX, + TempRect, this, IDC_TITLE1); if (!bSuccess) - return FALSE; - - bSuccess = m_Title2.Create (_T ("Title2"), WS_CHILD|WS_VISIBLE|SS_NOPREFIX, - TempRect, this, IDC_TITLE2); + return FALSE; + bSuccess = m_Title2.Create(_T("Title2"), WS_CHILD|WS_VISIBLE|SS_NOPREFIX, + TempRect, this, IDC_TITLE2); if (!bSuccess) - return FALSE; - - bSuccess = m_Title3.Create (_T ("Title3"), WS_CHILD|WS_VISIBLE|SS_NOPREFIX, - TempRect, this, IDC_TITLE3); + return FALSE; + bSuccess = m_Title3.Create(_T("Title3"), WS_CHILD|WS_VISIBLE|SS_NOPREFIX, + TempRect, this, IDC_TITLE3); if (!bSuccess) - return FALSE; - - bSuccess = m_Btn1.Create (_T ("Button1"), - WS_CHILD|WS_VISIBLE|WS_TABSTOP| BS_PUSHBUTTON, - TempRect, this, IDC_BTN1); + return FALSE; + bSuccess = m_Btn1.Create(_T("Button1"), + WS_CHILD|WS_VISIBLE|WS_TABSTOP| BS_PUSHBUTTON, + TempRect, this, IDC_BTN1); if (!bSuccess) - return FALSE; - - bSuccess = m_Btn2.Create (_T ("Button2"), - WS_CHILD|WS_VISIBLE|WS_TABSTOP| BS_PUSHBUTTON, - TempRect, this, IDC_BTN2); + return FALSE; + bSuccess = m_Btn2.Create(_T("Button2"), + WS_CHILD|WS_VISIBLE|WS_TABSTOP| BS_PUSHBUTTON, + TempRect, this, IDC_BTN2); if (!bSuccess) - return FALSE; + return FALSE; - CFont *ft1 = new CFont, - *ft2 = new CFont, - *ft3 = new CFont; + CFont *ft1 = new CFont, + *ft2 = new CFont, + *ft3 = new CFont; LOGFONT lf; - - memset (&lf, 0, sizeof (LOGFONT)); - + memset(&lf, 0, sizeof(LOGFONT)); lf.lfHeight = 12; - - lstrcpy (lf.lfFaceName, _T ("Arial")); - - VERIFY (ft1->CreateFontIndirect (&lf)); - - VERIFY (ft3->CreateFontIndirect (&lf)); + lstrcpy(lf.lfFaceName, _T("Arial")); + VERIFY(ft1->CreateFontIndirect(&lf)); + VERIFY(ft3->CreateFontIndirect(&lf)); lf.lfHeight = 20; + VERIFY(ft2->CreateFontIndirect(&lf)); - VERIFY (ft2->CreateFontIndirect (&lf)); - - m_Title1.SetFont (ft1, TRUE); - - m_Title2.SetFont (ft2, TRUE); - - m_Title3.SetFont (ft3, TRUE); + m_Title1.SetFont(ft1, TRUE); + m_Title2.SetFont(ft2, TRUE); + m_Title3.SetFont(ft3, TRUE); SetWindowSize(); @@ -127,111 +113,109 @@ BOOL CPopUpWnd::Create (CPocketPJDlg* pParent) return TRUE; } -void CPopUpWnd::SetContent (const CPopUpContent &content) +void CPopUpWnd::SetContent(const CPopUpContent &content) { - m_Title1.SetWindowText (content.m_Title1); - m_Title2.SetWindowText (content.m_Title2); - m_Title3.SetWindowText (content.m_Title3); + m_Title1.SetWindowText(content.m_Title1); + m_Title2.SetWindowText(content.m_Title2); + m_Title3.SetWindowText(content.m_Title3); if (content.m_Btn1 != "") { - m_Btn1.SetWindowText (content.m_Btn1); - m_Btn1.ShowWindow (SW_SHOW); + m_Btn1.SetWindowText(content.m_Btn1); + m_Btn1.ShowWindow(SW_SHOW); } else { - m_Btn1.ShowWindow (SW_HIDE); + m_Btn1.ShowWindow(SW_HIDE); } if (content.m_Btn2 != "") { - m_Btn2.SetWindowText (content.m_Btn2); - m_Btn2.ShowWindow (SW_SHOW); + m_Btn2.SetWindowText(content.m_Btn2); + m_Btn2.ShowWindow(SW_SHOW); } else { - m_Btn2.ShowWindow (SW_HIDE); + m_Btn2.ShowWindow(SW_HIDE); } UpdateWindow(); - - ShowWindow (SW_SHOW); + ShowWindow(SW_SHOW); } -void CPopUpWnd::SetWindowSize (int width, int height) +void CPopUpWnd::SetWindowSize(int width, int height) { enum { H1 = 16, H2 = 40, H3 = 16, S = 5, G = 10, BW=60, BH=20, BG=40}; - CRect rootRect (0, 0, 320, 240); + CRect rootRect(0, 0, 320, 240); int Y; - MoveWindow ( (rootRect.Width() - width) /2, (rootRect.Height() - height) /2, - width, height); + MoveWindow((rootRect.Width() - width)/2, (rootRect.Height() - height)/2, + width, height); - m_Title1.MoveWindow (10, Y=S, width-20, H1); - m_Title2.MoveWindow (10, Y+=H1+G, width-20, H2); - m_Title3.MoveWindow (10, Y+=H2+G, width-20, H3); + m_Title1.MoveWindow(10, Y=S, width-20, H1); + m_Title2.MoveWindow(10, Y+=H1+G, width-20, H2); + m_Title3.MoveWindow(10, Y+=H2+G, width-20, H3); - m_Btn1.MoveWindow ( (width-2*BW-BG) /2, Y+=H3+G, BW, BH); - m_Btn2.MoveWindow ( (width-2*BW-BG) /2+BW+BG, Y, BW, BH); + m_Btn1.MoveWindow((width-2*BW-BG)/2, Y+=H3+G, BW, BH); + m_Btn2.MoveWindow((width-2*BW-BG)/2+BW+BG, Y, BW, BH); } -void CPopUpWnd::Hide() -{ - if (!::IsWindow (GetSafeHwnd())) +void CPopUpWnd::Hide() +{ + if (!::IsWindow(GetSafeHwnd())) return; - if (IsWindowVisible()) { - ShowWindow (SW_HIDE); - ModifyStyle (WS_VISIBLE, 0); + if (IsWindowVisible()) + { + ShowWindow(SW_HIDE); + ModifyStyle(WS_VISIBLE, 0); } } -void CPopUpWnd::Show() -{ - if (!::IsWindow (GetSafeHwnd())) +void CPopUpWnd::Show() +{ + if (!::IsWindow(GetSafeHwnd())) return; - ModifyStyle (0, WS_VISIBLE); - - ShowWindow (SW_SHOWNA); - - RedrawWindow (NULL,NULL,RDW_ERASE|RDW_INVALIDATE|RDW_UPDATENOW); + ModifyStyle(0, WS_VISIBLE); + ShowWindow(SW_SHOWNA); + RedrawWindow(NULL,NULL,RDW_ERASE|RDW_INVALIDATE|RDW_UPDATENOW); } -BEGIN_MESSAGE_MAP (CPopUpWnd, CWnd) +BEGIN_MESSAGE_MAP(CPopUpWnd, CWnd) //{{AFX_MSG_MAP(CPopUpWnd) ON_WM_ERASEBKGND() - //}}AFX_MSG_MAP - ON_BN_CLICKED (IDC_BTN1, OnCancel1) - ON_BN_CLICKED (IDC_BTN2, OnCancel2) + //}}AFX_MSG_MAP + ON_BN_CLICKED(IDC_BTN1, OnCancel1) + ON_BN_CLICKED(IDC_BTN2, OnCancel2) END_MESSAGE_MAP() ///////////////////////////////////////////////////////////////////////////// // CPopUpWnd message handlers -BOOL CPopUpWnd::OnEraseBkgnd (CDC* pDC) +BOOL CPopUpWnd::OnEraseBkgnd(CDC* pDC) { CBrush backBrush; - backBrush.CreateSolidBrush (RGB (255,255,255)); - CBrush* pOldBrush = pDC->SelectObject (&backBrush); + backBrush.CreateSolidBrush(RGB(255,255,255)); + CBrush* pOldBrush = pDC->SelectObject(&backBrush); CRect rect; - pDC->GetClipBox (&rect); // Erase the area needed - pDC->PatBlt (rect.left, rect.top, rect.Width(), rect.Height(), PATCOPY); - pDC->SelectObject (pOldBrush); + pDC->GetClipBox(&rect); // Erase the area needed + pDC->PatBlt(rect.left, rect.top, rect.Width(), rect.Height(), PATCOPY); + pDC->SelectObject(pOldBrush); return TRUE; } -void CPopUpWnd::OnCancel1() +void CPopUpWnd::OnCancel1() { - m_ParentWnd->OnPopUpButton (1); + m_ParentWnd->OnPopUpButton(1); } -void CPopUpWnd::OnCancel2() +void CPopUpWnd::OnCancel2() { - m_ParentWnd->OnPopUpButton (2); + m_ParentWnd->OnPopUpButton(2); } -BOOL CPopUpWnd::DestroyWindow() +BOOL CPopUpWnd::DestroyWindow() { return CWnd::DestroyWindow(); } @@ -239,12 +223,13 @@ BOOL CPopUpWnd::DestroyWindow() void CPopUpWnd::PeekAndPump() { MSG msg; - - while (::PeekMessage (&msg, NULL,0,0,PM_NOREMOVE)) { - if (!AfxGetApp()->PumpMessage()) { - ::PostQuitMessage (0); + while (::PeekMessage(&msg, NULL,0,0,PM_NOREMOVE)) + { + if (!AfxGetApp()->PumpMessage()) + { + ::PostQuitMessage(0); return; - } + } } } diff --git a/sflphone-common/libs/pjproject/pjsip-apps/src/pocketpj/SettingsDlg.cpp b/sflphone-common/libs/pjproject/pjsip-apps/src/pocketpj/SettingsDlg.cpp index 6d963f81fa3ec9b2ec11faf8c56bd006f3464868..1357044ae2c4675b973a6de003ba6a4a8476b784 100644 --- a/sflphone-common/libs/pjproject/pjsip-apps/src/pocketpj/SettingsDlg.cpp +++ b/sflphone-common/libs/pjproject/pjsip-apps/src/pocketpj/SettingsDlg.cpp @@ -37,20 +37,20 @@ static char THIS_FILE[] = __FILE__; ///////////////////////////////////////////////////////////////////////////// // Settings CPocketPJSettings::CPocketPJSettings() - : m_UseStun (FALSE), m_UseIce (FALSE), m_UseSrtp (FALSE), m_UsePublish (FALSE), - m_EchoSuppress (TRUE), m_EcTail (200), m_TCP (FALSE), m_VAD (FALSE), - m_AutoAnswer (FALSE) +: m_UseStun(FALSE), m_UseIce(FALSE), m_UseSrtp(FALSE), m_UsePublish(FALSE), + m_EchoSuppress(TRUE), m_EcTail(200), m_TCP(FALSE), m_VAD(FALSE), + m_AutoAnswer(FALSE) { /* Init codec list */ #if defined(PJMEDIA_HAS_GSM_CODEC) && PJMEDIA_HAS_GSM_CODEC - m_Codecs.Add (_T ("GSM")); + m_Codecs.Add(_T("GSM")); #endif #if defined(PJMEDIA_HAS_G711_CODEC) && PJMEDIA_HAS_G711_CODEC - m_Codecs.Add (_T ("PCMU")); - m_Codecs.Add (_T ("PCMA")); + m_Codecs.Add(_T("PCMU")); + m_Codecs.Add(_T("PCMA")); #endif #if defined(PJMEDIA_HAS_SPEEX_CODEC) && PJMEDIA_HAS_SPEEX_CODEC - m_Codecs.Add (_T ("Speex")); + m_Codecs.Add(_T("Speex")); #endif } @@ -63,131 +63,113 @@ void CPocketPJSettings::LoadRegistry() DWORD cbData; - if (key.Open (HKEY_CURRENT_USER, REG_PATH) != ERROR_SUCCESS) - return; + if (key.Open(HKEY_CURRENT_USER, REG_PATH) != ERROR_SUCCESS) + return; - cbData = sizeof (textVal); - - if (key.QueryValue (textVal, REG_DOMAIN, &cbData) == ERROR_SUCCESS) { - m_Domain = textVal; + cbData = sizeof(textVal); + if (key.QueryValue(textVal, REG_DOMAIN, &cbData) == ERROR_SUCCESS) { + m_Domain = textVal; } - cbData = sizeof (textVal); - - if (key.QueryValue (textVal, REG_USER, &cbData) == ERROR_SUCCESS) { - m_User = textVal; + cbData = sizeof(textVal); + if (key.QueryValue(textVal, REG_USER, &cbData) == ERROR_SUCCESS) { + m_User = textVal; } - cbData = sizeof (textVal); - - if (key.QueryValue (textVal, REG_PASSWD, &cbData) == ERROR_SUCCESS) { - m_Password = textVal; + cbData = sizeof(textVal); + if (key.QueryValue(textVal, REG_PASSWD, &cbData) == ERROR_SUCCESS) { + m_Password = textVal; } - cbData = sizeof (textVal); - - if (key.QueryValue (textVal, REG_STUN_SRV, &cbData) == ERROR_SUCCESS) { - m_StunSrv = textVal; + cbData = sizeof(textVal); + if (key.QueryValue(textVal, REG_STUN_SRV, &cbData) == ERROR_SUCCESS) { + m_StunSrv = textVal; } - cbData = sizeof (textVal); - - if (key.QueryValue (textVal, REG_DNS, &cbData) == ERROR_SUCCESS) { - m_DNS = textVal; + cbData = sizeof(textVal); + if (key.QueryValue(textVal, REG_DNS, &cbData) == ERROR_SUCCESS) { + m_DNS = textVal; } dwordVal = 0; - - if (key.QueryValue (dwordVal, REG_USE_STUN) == ERROR_SUCCESS) { - m_UseStun = dwordVal != 0; + if (key.QueryValue(dwordVal, REG_USE_STUN) == ERROR_SUCCESS) { + m_UseStun = dwordVal != 0; } - if (key.QueryValue (dwordVal, REG_USE_ICE) == ERROR_SUCCESS) { - m_UseIce = dwordVal != 0; + if (key.QueryValue(dwordVal, REG_USE_ICE) == ERROR_SUCCESS) { + m_UseIce = dwordVal != 0; } - if (key.QueryValue (dwordVal, REG_USE_SRTP) == ERROR_SUCCESS) { - m_UseSrtp = dwordVal != 0; + if (key.QueryValue(dwordVal, REG_USE_SRTP) == ERROR_SUCCESS) { + m_UseSrtp = dwordVal != 0; } - cbData = sizeof (dwordVal); - - if (key.QueryValue (dwordVal, REG_USE_PUBLISH) == ERROR_SUCCESS) { - m_UsePublish = dwordVal != 0; + cbData = sizeof(dwordVal); + if (key.QueryValue(dwordVal, REG_USE_PUBLISH) == ERROR_SUCCESS) { + m_UsePublish = dwordVal != 0; } - cbData = sizeof (dwordVal); - - if (key.QueryValue (dwordVal, REG_ENABLE_EC) == ERROR_SUCCESS) { - m_EchoSuppress = dwordVal != 0; + cbData = sizeof(dwordVal); + if (key.QueryValue(dwordVal, REG_ENABLE_EC) == ERROR_SUCCESS) { + m_EchoSuppress = dwordVal != 0; } - cbData = sizeof (dwordVal); - - if (key.QueryValue (dwordVal, REG_EC_TAIL) == ERROR_SUCCESS) { - m_EcTail = dwordVal; + cbData = sizeof(dwordVal); + if (key.QueryValue(dwordVal, REG_EC_TAIL) == ERROR_SUCCESS) { + m_EcTail = dwordVal; } - cbData = sizeof (dwordVal); - - if (key.QueryValue (dwordVal, REG_ENABLE_TCP) == ERROR_SUCCESS) { - m_TCP = dwordVal != 0; + cbData = sizeof(dwordVal); + if (key.QueryValue(dwordVal, REG_ENABLE_TCP) == ERROR_SUCCESS) { + m_TCP = dwordVal != 0; } - cbData = sizeof (dwordVal); - - if (key.QueryValue (dwordVal, REG_ENABLE_VAD) == ERROR_SUCCESS) { - m_VAD = dwordVal != 0; + cbData = sizeof(dwordVal); + if (key.QueryValue(dwordVal, REG_ENABLE_VAD) == ERROR_SUCCESS) { + m_VAD = dwordVal != 0; } - cbData = sizeof (dwordVal); - - if (key.QueryValue (dwordVal, REG_AUTO_ANSWER) == ERROR_SUCCESS) { - m_AutoAnswer = dwordVal != 0; + cbData = sizeof(dwordVal); + if (key.QueryValue(dwordVal, REG_AUTO_ANSWER) == ERROR_SUCCESS) { + m_AutoAnswer = dwordVal != 0; } m_BuddyList.RemoveAll(); DWORD buddyCount = 0; - cbData = sizeof (dwordVal); - - if (key.QueryValue (dwordVal, REG_BUDDY_CNT) == ERROR_SUCCESS) { - buddyCount = dwordVal; + cbData = sizeof(dwordVal); + if (key.QueryValue(dwordVal, REG_BUDDY_CNT) == ERROR_SUCCESS) { + buddyCount = dwordVal; } unsigned i; - for (i=0; i<buddyCount; ++i) { - CString entry; - entry.Format (REG_BUDDY_X, i); + CString entry; + entry.Format(REG_BUDDY_X, i); - cbData = sizeof (textVal); - - if (key.QueryValue (textVal, entry, &cbData) == ERROR_SUCCESS) { - m_BuddyList.Add (textVal); - } + cbData = sizeof(textVal); + if (key.QueryValue(textVal, entry, &cbData) == ERROR_SUCCESS) { + m_BuddyList.Add(textVal); + } } DWORD codecCount = 0; + cbData = sizeof(dwordVal); + if (key.QueryValue(codecCount, REG_CODEC_CNT) == ERROR_SUCCESS) { - cbData = sizeof (dwordVal); - - if (key.QueryValue (codecCount, REG_CODEC_CNT) == ERROR_SUCCESS) { + m_Codecs.RemoveAll(); - m_Codecs.RemoveAll(); + for (i=0; i<codecCount; ++i) { + CString entry; + entry.Format(REG_CODEC_X, i); - for (i=0; i<codecCount; ++i) { - CString entry; - entry.Format (REG_CODEC_X, i); - - cbData = sizeof (textVal); - - if (key.QueryValue (textVal, entry, &cbData) == ERROR_SUCCESS) { - m_Codecs.Add (textVal); - } - } + cbData = sizeof(textVal); + if (key.QueryValue(textVal, entry, &cbData) == ERROR_SUCCESS) { + m_Codecs.Add(textVal); + } + } } key.Close(); @@ -198,55 +180,42 @@ void CPocketPJSettings::SaveRegistry() { CRegKey key; - if (key.Create (HKEY_CURRENT_USER, REG_PATH) != ERROR_SUCCESS) - return; - - key.SetValue (m_Domain, REG_DOMAIN); - - key.SetValue (m_User, REG_USER); - - key.SetValue (m_Password, REG_PASSWD); + if (key.Create(HKEY_CURRENT_USER, REG_PATH) != ERROR_SUCCESS) + return; - key.SetValue (m_StunSrv, REG_STUN_SRV); + key.SetValue(m_Domain, REG_DOMAIN); + key.SetValue(m_User, REG_USER); + key.SetValue(m_Password, REG_PASSWD); + key.SetValue(m_StunSrv, REG_STUN_SRV); + key.SetValue(m_DNS, REG_DNS); + + key.SetValue(m_UseStun, REG_USE_STUN); + key.SetValue(m_UseIce, REG_USE_ICE); + key.SetValue(m_UseSrtp, REG_USE_SRTP); + key.SetValue(m_UsePublish, REG_USE_PUBLISH); - key.SetValue (m_DNS, REG_DNS); + key.SetValue(m_EchoSuppress, REG_ENABLE_EC); + key.SetValue(m_EcTail, REG_EC_TAIL); - key.SetValue (m_UseStun, REG_USE_STUN); + key.SetValue(m_TCP, REG_ENABLE_TCP); + key.SetValue(m_VAD, REG_ENABLE_VAD); + key.SetValue(m_AutoAnswer, REG_AUTO_ANSWER); - key.SetValue (m_UseIce, REG_USE_ICE); - - key.SetValue (m_UseSrtp, REG_USE_SRTP); - - key.SetValue (m_UsePublish, REG_USE_PUBLISH); - - key.SetValue (m_EchoSuppress, REG_ENABLE_EC); - - key.SetValue (m_EcTail, REG_EC_TAIL); - - key.SetValue (m_TCP, REG_ENABLE_TCP); - - key.SetValue (m_VAD, REG_ENABLE_VAD); - - key.SetValue (m_AutoAnswer, REG_AUTO_ANSWER); - - key.SetValue (m_BuddyList.GetSize(), REG_BUDDY_CNT); + key.SetValue(m_BuddyList.GetSize(), REG_BUDDY_CNT); int i; - for (i=0; i<m_BuddyList.GetSize(); ++i) { - CString entry; - entry.Format (REG_BUDDY_X, i); - key.SetValue (m_BuddyList.GetAt (i), entry); + CString entry; + entry.Format(REG_BUDDY_X, i); + key.SetValue(m_BuddyList.GetAt(i), entry); } DWORD N = m_Codecs.GetSize(); - - key.SetValue (N, REG_CODEC_CNT); - + key.SetValue(N, REG_CODEC_CNT); for (i=0; i<m_Codecs.GetSize(); ++i) { - CString entry; - entry.Format (REG_CODEC_X, i); - key.SetValue (m_Codecs.GetAt (i), entry); + CString entry; + entry.Format(REG_CODEC_X, i); + key.SetValue(m_Codecs.GetAt(i), entry); } key.Close(); @@ -257,137 +226,127 @@ void CPocketPJSettings::SaveRegistry() // CSettingsDlg dialog -CSettingsDlg::CSettingsDlg (CPocketPJSettings &cfg, CWnd* pParent) - : CDialog (CSettingsDlg::IDD, pParent), m_Cfg (cfg) +CSettingsDlg::CSettingsDlg(CPocketPJSettings &cfg, CWnd* pParent) + : CDialog(CSettingsDlg::IDD, pParent), m_Cfg(cfg) { - //{{AFX_DATA_INIT(CSettingsDlg) - m_Domain = _T (""); - m_ICE = FALSE; - m_Passwd = _T (""); - m_PUBLISH = FALSE; - m_SRTP = FALSE; - m_STUN = FALSE; - m_StunSrv = _T (""); - m_User = _T (""); - m_Dns = _T (""); - m_EchoSuppress = FALSE; - m_EcTail = _T (""); - m_TCP = FALSE; - m_VAD = FALSE; - m_AutoAnswer = FALSE; - //}}AFX_DATA_INIT - - m_Domain = m_Cfg.m_Domain; - m_ICE = m_Cfg.m_UseIce; - m_Passwd = m_Cfg.m_Password; - m_PUBLISH = m_Cfg.m_UsePublish; - m_SRTP = m_Cfg.m_UseSrtp; - m_STUN = m_Cfg.m_UseStun; - m_StunSrv = m_Cfg.m_StunSrv; - m_User = m_Cfg.m_User; - m_Dns = m_Cfg.m_DNS; - m_EchoSuppress = m_Cfg.m_EchoSuppress; - m_TCP = m_Cfg.m_TCP; - m_VAD = m_Cfg.m_VAD; - m_AutoAnswer= m_Cfg.m_AutoAnswer; - - CString s; - s.Format (_T ("%d"), m_Cfg.m_EcTail); - m_EcTail = s; + //{{AFX_DATA_INIT(CSettingsDlg) + m_Domain = _T(""); + m_ICE = FALSE; + m_Passwd = _T(""); + m_PUBLISH = FALSE; + m_SRTP = FALSE; + m_STUN = FALSE; + m_StunSrv = _T(""); + m_User = _T(""); + m_Dns = _T(""); + m_EchoSuppress = FALSE; + m_EcTail = _T(""); + m_TCP = FALSE; + m_VAD = FALSE; + m_AutoAnswer = FALSE; + //}}AFX_DATA_INIT + + m_Domain = m_Cfg.m_Domain; + m_ICE = m_Cfg.m_UseIce; + m_Passwd = m_Cfg.m_Password; + m_PUBLISH = m_Cfg.m_UsePublish; + m_SRTP = m_Cfg.m_UseSrtp; + m_STUN = m_Cfg.m_UseStun; + m_StunSrv = m_Cfg.m_StunSrv; + m_User = m_Cfg.m_User; + m_Dns = m_Cfg.m_DNS; + m_EchoSuppress = m_Cfg.m_EchoSuppress; + m_TCP = m_Cfg.m_TCP; + m_VAD = m_Cfg.m_VAD; + m_AutoAnswer= m_Cfg.m_AutoAnswer; + + CString s; + s.Format(_T("%d"), m_Cfg.m_EcTail); + m_EcTail = s; } -void CSettingsDlg::DoDataExchange (CDataExchange* pDX) +void CSettingsDlg::DoDataExchange(CDataExchange* pDX) { - CDialog::DoDataExchange (pDX); - //{{AFX_DATA_MAP(CSettingsDlg) - DDX_Control (pDX, IDC_CODECS, m_Codecs); - DDX_Text (pDX, IDC_DOMAIN, m_Domain); - DDX_Check (pDX, IDC_ICE, m_ICE); - DDX_Text (pDX, IDC_PASSWD, m_Passwd); - DDX_Check (pDX, IDC_PUBLISH, m_PUBLISH); - DDX_Check (pDX, IDC_SRTP, m_SRTP); - DDX_Check (pDX, IDC_STUN, m_STUN); - DDX_Text (pDX, IDC_STUN_SRV, m_StunSrv); - DDX_Text (pDX, IDC_USER, m_User); - DDX_Text (pDX, IDC_DNS, m_Dns); - DDX_Check (pDX, IDC_ECHO_SUPPRESS, m_EchoSuppress); - DDX_Text (pDX, IDC_EC_TAIL, m_EcTail); - DDX_Check (pDX, IDC_TCP, m_TCP); - DDX_Check (pDX, IDC_VAD, m_VAD); - DDX_Check (pDX, IDC_AA, m_AutoAnswer); - //}}AFX_DATA_MAP - - - if (m_Codecs.GetCount() == 0) { - int i; - - for (i=0; i<m_Cfg.m_Codecs.GetSize(); ++i) { - m_Codecs.AddString (m_Cfg.m_Codecs.GetAt (i)); - } - - m_Codecs.SetCurSel (0); - } + CDialog::DoDataExchange(pDX); + //{{AFX_DATA_MAP(CSettingsDlg) + DDX_Control(pDX, IDC_CODECS, m_Codecs); + DDX_Text(pDX, IDC_DOMAIN, m_Domain); + DDX_Check(pDX, IDC_ICE, m_ICE); + DDX_Text(pDX, IDC_PASSWD, m_Passwd); + DDX_Check(pDX, IDC_PUBLISH, m_PUBLISH); + DDX_Check(pDX, IDC_SRTP, m_SRTP); + DDX_Check(pDX, IDC_STUN, m_STUN); + DDX_Text(pDX, IDC_STUN_SRV, m_StunSrv); + DDX_Text(pDX, IDC_USER, m_User); + DDX_Text(pDX, IDC_DNS, m_Dns); + DDX_Check(pDX, IDC_ECHO_SUPPRESS, m_EchoSuppress); + DDX_Text(pDX, IDC_EC_TAIL, m_EcTail); + DDX_Check(pDX, IDC_TCP, m_TCP); + DDX_Check(pDX, IDC_VAD, m_VAD); + DDX_Check(pDX, IDC_AA, m_AutoAnswer); + //}}AFX_DATA_MAP + + + if (m_Codecs.GetCount() == 0) { + int i; + for (i=0; i<m_Cfg.m_Codecs.GetSize(); ++i) { + m_Codecs.AddString(m_Cfg.m_Codecs.GetAt(i)); + } + m_Codecs.SetCurSel(0); + } } -BEGIN_MESSAGE_MAP (CSettingsDlg, CDialog) - //{{AFX_MSG_MAP(CSettingsDlg) - ON_BN_CLICKED (IDC_STUN, OnStun) - ON_BN_CLICKED (IDC_ECHO_SUPPRESS, OnEchoSuppress) - ON_CBN_SELCHANGE (IDC_CODECS, OnSelchangeCodecs) - //}}AFX_MSG_MAP +BEGIN_MESSAGE_MAP(CSettingsDlg, CDialog) + //{{AFX_MSG_MAP(CSettingsDlg) + ON_BN_CLICKED(IDC_STUN, OnStun) + ON_BN_CLICKED(IDC_ECHO_SUPPRESS, OnEchoSuppress) + ON_CBN_SELCHANGE(IDC_CODECS, OnSelchangeCodecs) + //}}AFX_MSG_MAP END_MESSAGE_MAP() ///////////////////////////////////////////////////////////////////////////// // CSettingsDlg message handlers -int CSettingsDlg::DoModal() +int CSettingsDlg::DoModal() { - int rc = CDialog::DoModal(); + int rc = CDialog::DoModal(); return rc; } -void CSettingsDlg::OnStun() +void CSettingsDlg::OnStun() { } -void CSettingsDlg::OnEchoSuppress() +void CSettingsDlg::OnEchoSuppress() { } -void CSettingsDlg::OnSelchangeCodecs() +void CSettingsDlg::OnSelchangeCodecs() { int cur = m_Codecs.GetCurSel(); - if (cur < 1) - return; + return; CString codec; - DWORD N; - m_Codecs.GetLBText (cur, codec); - + m_Codecs.GetLBText(cur, codec); N = m_Codecs.GetCount(); - - m_Codecs.DeleteString (cur); - + m_Codecs.DeleteString(cur); N = m_Codecs.GetCount(); - - m_Codecs.InsertString (0, codec); - + m_Codecs.InsertString(0, codec); N = m_Codecs.GetCount(); - - m_Codecs.SetCurSel (0); + m_Codecs.SetCurSel(0); } -void CSettingsDlg::OnOK() +void CSettingsDlg::OnOK() { - UpdateData (TRUE); + UpdateData(TRUE); m_Cfg.m_Domain = m_Domain; m_Cfg.m_UseIce = m_ICE != 0; @@ -399,7 +358,7 @@ void CSettingsDlg::OnOK() m_Cfg.m_User = m_User; m_Cfg.m_DNS = m_Dns; m_Cfg.m_EchoSuppress= m_EchoSuppress != 0; - m_Cfg.m_EcTail = _ttoi (m_EcTail); + m_Cfg.m_EcTail = _ttoi(m_EcTail); m_Cfg.m_TCP = m_TCP != 0; m_Cfg.m_VAD = m_VAD != 0; m_Cfg.m_AutoAnswer = m_AutoAnswer != 0; @@ -407,11 +366,10 @@ void CSettingsDlg::OnOK() unsigned i; m_Cfg.m_Codecs.RemoveAll(); DWORD N = m_Codecs.GetCount(); - for (i=0; i<N; ++i) { - CString codec; - m_Codecs.GetLBText (i, codec); - m_Cfg.m_Codecs.Add (codec); + CString codec; + m_Codecs.GetLBText(i, codec); + m_Cfg.m_Codecs.Add(codec); } CDialog::OnOK(); diff --git a/sflphone-common/libs/pjproject/pjsip-apps/src/python/_pjsua.c b/sflphone-common/libs/pjproject/pjsip-apps/src/python/_pjsua.c index 0eb7e8009c7538afd587d4bd6e08e8ffc945ed71..3b5c580a2a971bfc486dec7120f790597b1cbd46 100644 --- a/sflphone-common/libs/pjproject/pjsip-apps/src/python/_pjsua.c +++ b/sflphone-common/libs/pjproject/pjsip-apps/src/python/_pjsua.c @@ -1,4 +1,4 @@ -/* $Id: _pjsua.c 2394 2008-12-23 17:27:53Z bennylp $ */ +/* $Id: _pjsua.c 3010 2009-11-10 10:57:29Z bennylp $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> @@ -630,6 +630,33 @@ static void cb_on_typing(pjsua_call_id call_id, const pj_str_t *from, } +/* + * on_mwi_info + */ +static void cb_on_mwi_info(pjsua_acc_id acc_id, pjsua_mwi_info *mwi_info) +{ + if (PyCallable_Check(g_obj_callback->on_mwi_info)) { + PyObject *param_acc_id, *param_body; + pj_str_t body; + + ENTER_PYTHON(); + + body.ptr = mwi_info->rdata->msg_info.msg->body->data; + body.slen = mwi_info->rdata->msg_info.msg->body->len; + + PyObject_CallFunctionObjArgs( + g_obj_callback->on_mwi_info, + param_acc_id = Py_BuildValue("i",acc_id), + param_body = PyString_FromPJ(&body), + NULL + ); + + Py_DECREF(param_acc_id); + Py_DECREF(param_body); + + LEAVE_PYTHON(); + } +} /* * translate_hdr @@ -901,6 +928,7 @@ static PyObject *py_pjsua_init(PyObject *pSelf, PyObject *pArgs) cfg_ua.cb.on_pager2 = &cb_on_pager; cfg_ua.cb.on_pager_status2 = &cb_on_pager_status; cfg_ua.cb.on_typing2 = &cb_on_typing; + cfg_ua.cb.on_mwi_info = &cb_on_mwi_info; p_cfg_ua = &cfg_ua; @@ -2033,6 +2061,10 @@ static PyObject *py_pjsua_buddy_set_user_data(PyObject *pSelf, PyObject *pArgs) return NULL; } + if (!pjsua_buddy_is_valid(buddy_id)) { + return Py_BuildValue("i", 0); + } + old_user_data = (PyObject*) pjsua_buddy_get_user_data(buddy_id); status = pjsua_buddy_set_user_data(buddy_id, (void*)user_data); @@ -3875,6 +3907,7 @@ static PyObject *py_pj_parse_simple_sip(PyObject *pSelf, PyObject *pArgs) item = PyString_FromPJ(&sip_uri->transport_param); PyTuple_SetItem(ret, 4, item); + pj_pool_release(pool); return ret; } diff --git a/sflphone-common/libs/pjproject/pjsip-apps/src/python/_pjsua.h b/sflphone-common/libs/pjproject/pjsip-apps/src/python/_pjsua.h index 06fc700ef98f73f5ff658644b99f6c623d65f63c..8f89464f4d61dcd2d85223eed08a49eca0d854b4 100644 --- a/sflphone-common/libs/pjproject/pjsip-apps/src/python/_pjsua.h +++ b/sflphone-common/libs/pjproject/pjsip-apps/src/python/_pjsua.h @@ -1,4 +1,4 @@ -/* $Id: _pjsua.h 2859 2009-08-11 16:26:20Z nanang $ */ +/* $Id: _pjsua.h 3007 2009-11-10 10:06:58Z bennylp $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> @@ -235,6 +235,7 @@ typedef struct PyObj_pjsua_callback PyObject * on_pager; PyObject * on_pager_status; PyObject * on_typing; + PyObject * on_mwi_info; } PyObj_pjsua_callback; @@ -258,6 +259,7 @@ static void PyObj_pjsua_callback_delete(PyObj_pjsua_callback* self) Py_XDECREF(self->on_pager); Py_XDECREF(self->on_pager_status); Py_XDECREF(self->on_typing); + Py_XDECREF(self->on_mwi_info); self->ob_type->tp_free((PyObject*)self); } @@ -291,6 +293,7 @@ static PyObject * PyObj_pjsua_callback_new(PyTypeObject *type, self->on_pager = Py_BuildValue(""); self->on_pager_status = Py_BuildValue(""); self->on_typing = Py_BuildValue(""); + self->on_mwi_info = Py_BuildValue(""); } return (PyObject *)self; @@ -394,6 +397,11 @@ static PyMemberDef PyObj_pjsua_callback_members[] = offsetof(PyObj_pjsua_callback, on_typing), 0, "Notify application about typing indication." }, + { + "on_mwi_info", T_OBJECT_EX, + offsetof(PyObj_pjsua_callback, on_mwi_info), 0, + "Notify application about MWI indication." + }, {NULL} /* Sentinel */ }; @@ -1337,6 +1345,7 @@ static void PyObj_pjsua_transport_config_delete(PyObj_pjsua_transport_config* se static void PyObj_pjsua_transport_config_export(pjsua_transport_config *cfg, PyObj_pjsua_transport_config *obj) { + pjsua_transport_config_default(cfg); cfg->public_addr = PyString_ToPJ(obj->public_addr); cfg->bound_addr = PyString_ToPJ(obj->bound_addr); cfg->port = obj->port; @@ -1645,6 +1654,7 @@ typedef struct PyObject *id; PyObject *reg_uri; int publish_enabled; + int mwi_enabled; PyObject *force_contact; PyListObject *proxy; unsigned reg_timeout; @@ -1698,6 +1708,7 @@ static void PyObj_pjsua_acc_config_import(PyObj_pjsua_acc_config *obj, Py_XDECREF(obj->reg_uri); obj->reg_uri = PyString_FromPJ(&cfg->reg_uri); obj->publish_enabled = cfg->publish_enabled; + obj->mwi_enabled = cfg->mwi_enabled; Py_XDECREF(obj->force_contact); obj->force_contact = PyString_FromPJ(&cfg->force_contact); Py_XDECREF(obj->proxy); @@ -1753,6 +1764,7 @@ static void PyObj_pjsua_acc_config_export(pjsua_acc_config *cfg, cfg->id = PyString_ToPJ(obj->id); cfg->reg_uri = PyString_ToPJ(obj->reg_uri); cfg->publish_enabled = obj->publish_enabled; + cfg->mwi_enabled = obj->mwi_enabled; cfg->force_contact = PyString_ToPJ(obj->force_contact); cfg->proxy_cnt = PyList_Size((PyObject*)obj->proxy); @@ -1857,6 +1869,11 @@ static PyMemberDef PyObj_pjsua_acc_config_members[] = offsetof(PyObj_pjsua_acc_config, publish_enabled), 0, "Publish presence? " }, + { + "mwi_enabled", T_INT, + offsetof(PyObj_pjsua_acc_config, mwi_enabled), 0, + "Enable MWI subscription " + }, { "force_contact", T_OBJECT_EX, offsetof(PyObj_pjsua_acc_config, force_contact), 0, diff --git a/sflphone-common/libs/pjproject/pjsip-apps/src/python/pjsua.py b/sflphone-common/libs/pjproject/pjsip-apps/src/python/pjsua.py index f653fc06e3112aa73913d39870a1705088ad1d7e..183ce0e70bfee11715dd34314de02f9195d91e42 100644 --- a/sflphone-common/libs/pjproject/pjsip-apps/src/python/pjsua.py +++ b/sflphone-common/libs/pjproject/pjsip-apps/src/python/pjsua.py @@ -1,4 +1,4 @@ -# $Id: pjsua.py 2375 2008-12-11 11:18:33Z bennylp $ +# $Id: pjsua.py 2976 2009-10-29 08:16:46Z bennylp $ # # Object oriented PJSUA wrapper. # @@ -993,6 +993,19 @@ class AccountCallback: """ pass + def on_mwi_info(self, body): + """ + Notification about change in Message Summary / Message Waiting + Indication (RFC 3842) status. MWI subscription must be enabled + in the account config to receive this notification. + + Keyword arguments: + body -- String containing message body as received in the + NOTIFY request. + + """ + pass + class Account: @@ -1222,6 +1235,28 @@ class Account: lck = self._lib().auto_lock() _pjsua.acc_pres_notify(self._id, pres_obj, state, reason, Lib._create_msg_data(hdr_list)) + + def send_pager(self, uri, text, im_id=0, content_type="text/plain", \ + hdr_list=None): + """Send instant message to arbitrary URI. + + Keyword arguments: + text -- Instant message to be sent + uri -- URI to send the Instant Message to. + im_id -- Optional instant message ID to identify this + instant message when delivery status callback + is called. + content_type -- MIME type identifying the instant message + hdr_list -- Optional list of headers to be sent with the + request. + + """ + lck = self._lib().auto_lock() + err = _pjsua.im_send(self._id, uri, \ + content_type, text, \ + Lib._create_msg_data(hdr_list), \ + im_id) + self._lib()._err_check("send_pager()", self, err) class CallCallback: """Class to receive event notification from Call objects. @@ -1658,7 +1693,7 @@ class Call: """ lck = self._lib().auto_lock() - if hdr_list and body: + if hdr_list or body: msg_data = _pjsua.Msg_Data() if hdr_list: msg_data.hdr_list = hdr_list @@ -2091,6 +2126,7 @@ class Lib: py_ua_cfg.cb.on_pager = _cb_on_pager py_ua_cfg.cb.on_pager_status = _cb_on_pager_status py_ua_cfg.cb.on_typing = _cb_on_typing + py_ua_cfg.cb.on_mwi_info = _cb_on_mwi_info; err = _pjsua.init(py_ua_cfg, log_cfg._cvt_to_pjsua(), media_cfg._cvt_to_pjsua()) @@ -2741,6 +2777,11 @@ class Lib: else: acc._cb.on_typing(from_uri, contact, is_typing) + def _cb_on_mwi_info(self, acc_id, body): + acc = self._lookup_account(acc_id) + if acc: + return acc._cb.on_mwi_info(body) + def _cb_on_buddy_state(self, buddy_id): buddy = self._lookup_buddy(buddy_id) if buddy: @@ -2794,6 +2835,8 @@ def _cb_on_pager_status(call_id, to, body, user_data, status, reason, acc_id): def _cb_on_typing(call_id, from_uri, to, contact, is_typing, acc_id): _lib._cb_on_typing(call_id, from_uri, to, contact, is_typing, acc_id) +def _cb_on_mwi_info(acc_id, body): + _lib._cb_on_mwi_info(acc_id, body) # Worker thread def _worker_thread_main(arg): diff --git a/sflphone-common/libs/pjproject/pjsip-apps/src/samples/debug.c b/sflphone-common/libs/pjproject/pjsip-apps/src/samples/debug.c index e9ae2fa0e2cc776b5707d897041757645fdce124..895991fcbc2f476b87bb2ed9380e369d241cf3ed 100644 --- a/sflphone-common/libs/pjproject/pjsip-apps/src/samples/debug.c +++ b/sflphone-common/libs/pjproject/pjsip-apps/src/samples/debug.c @@ -1,4 +1,4 @@ -/* $Id: debug.c 2846 2009-07-29 12:28:31Z bennylp $ */ +/* $Id: debug.c 3028 2009-12-08 13:11:25Z bennylp $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> @@ -28,5 +28,5 @@ * E.g.: * #include "playfile.c" */ -#include "jbsim.c" +#include "icedemo.c" diff --git a/sflphone-common/libs/pjproject/pjsip-apps/src/samples/icedemo.c b/sflphone-common/libs/pjproject/pjsip-apps/src/samples/icedemo.c index 44f0ed824fcd0517d654e7ea787ffbee9a9d0373..027a0536f76dd00f66e3e3c9291c81ce71f47d84 100644 --- a/sflphone-common/libs/pjproject/pjsip-apps/src/samples/icedemo.c +++ b/sflphone-common/libs/pjproject/pjsip-apps/src/samples/icedemo.c @@ -1,4 +1,4 @@ -/* $Id: icedemo.c 2724 2009-05-29 13:04:03Z bennylp $ */ +/* $Id: icedemo.c 3043 2010-01-04 14:20:22Z bennylp $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * @@ -47,6 +47,7 @@ static struct app_t pj_str_t turn_username; pj_str_t turn_password; pj_bool_t turn_fingerprint; + const char *log_file; } opt; /* Our global variables */ @@ -56,6 +57,7 @@ static struct app_t pj_bool_t thread_quit_flag; pj_ice_strans_cfg ice_cfg; pj_ice_strans *icest; + FILE *log_fhnd; /* Variables to store parsed remote ICE info */ struct rem_info @@ -109,6 +111,12 @@ static void err_exit(const char *title, pj_status_t status) pj_caching_pool_destroy(&icedemo.cp); pj_shutdown(); + + if (icedemo.log_fhnd) { + fclose(icedemo.log_fhnd); + icedemo.log_fhnd = NULL; + } + exit(status != PJ_SUCCESS); } @@ -216,11 +224,13 @@ static void cb_on_rx_data(pj_ice_strans *ice_st, PJ_UNUSED_ARG(src_addr_len); PJ_UNUSED_ARG(pkt); - ((char*)pkt)[size] = '\0'; + // Don't do this! It will ruin the packet buffer in case TCP is used! + //((char*)pkt)[size] = '\0'; - PJ_LOG(3,(THIS_FILE, "Component %d: received %d bytes data from %s: \"%s\"", + PJ_LOG(3,(THIS_FILE, "Component %d: received %d bytes data from %s: \"%.*s\"", comp_id, size, pj_sockaddr_print(src_addr, ipstr, sizeof(ipstr), 3), + (unsigned)size, (char*)pkt)); } @@ -236,8 +246,6 @@ static void cb_on_ice_complete(pj_ice_strans *ice_st, (op==PJ_ICE_STRANS_OP_INIT? "initialization" : (op==PJ_ICE_STRANS_OP_NEGOTIATION ? "negotiation" : "unknown_op")); - PJ_UNUSED_ARG(ice_st); - if (status == PJ_SUCCESS) { PJ_LOG(3,(THIS_FILE, "ICE %s successful", opname)); } else { @@ -245,9 +253,20 @@ static void cb_on_ice_complete(pj_ice_strans *ice_st, pj_strerror(status, errmsg, sizeof(errmsg)); PJ_LOG(1,(THIS_FILE, "ICE %s failed: %s", opname, errmsg)); + pj_ice_strans_destroy(ice_st); + icedemo.icest = NULL; } } +/* log callback to write to file */ +static void log_func(int level, const char *data, int len) +{ + pj_log_write(level, data, len); + if (icedemo.log_fhnd) { + if (fwrite(data, len, 1, icedemo.log_fhnd) != 1) + return; + } +} /* * This is the main application initialization function. It is called @@ -258,6 +277,11 @@ static pj_status_t icedemo_init(void) { pj_status_t status; + if (icedemo.opt.log_file) { + icedemo.log_fhnd = fopen(icedemo.opt.log_file, "a"); + pj_log_set_log_func(&log_func); + } + /* Initialize the libraries before anything else */ CHECK( pj_init() ); CHECK( pjlib_util_init() ); @@ -1147,6 +1171,7 @@ static void icedemo_usage() puts(" resolution"); puts(" --max-host, -H N Set max number of host candidates to N"); puts(" --regular, -R Use regular nomination (default aggressive)"); + puts(" --log-file, -L FILE Save output to log FILE"); puts(" --help, -h Display this screen."); puts(""); puts("STUN related options:"); @@ -1182,7 +1207,8 @@ int main(int argc, char *argv[]) { "turn-username", 1, 0, 'u'}, { "turn-password", 1, 0, 'p'}, { "turn-fingerprint", 0, 0, 'F'}, - { "regular", 0, 0, 'R'} + { "regular", 0, 0, 'R'}, + { "log-file", 1, 0, 'L'}, }; int c, opt_id; pj_status_t status; @@ -1190,7 +1216,7 @@ int main(int argc, char *argv[]) icedemo.opt.comp_cnt = 1; icedemo.opt.max_host = -1; - while((c=pj_getopt_long(argc,argv, "c:n:s:t:u:p:H:hTFR", long_options, &opt_id))!=-1) { + while((c=pj_getopt_long(argc,argv, "c:n:s:t:u:p:H:L:hTFR", long_options, &opt_id))!=-1) { switch (c) { case 'c': icedemo.opt.comp_cnt = atoi(pj_optarg); @@ -1229,6 +1255,9 @@ int main(int argc, char *argv[]) case 'R': icedemo.opt.regular = PJ_TRUE; break; + case 'L': + icedemo.opt.log_file = pj_optarg; + break; default: printf("Argument \"%s\" is not valid. Use -h to see help", argv[pj_optind]); diff --git a/sflphone-common/libs/pjproject/pjsip-apps/src/samples/jbsim.c b/sflphone-common/libs/pjproject/pjsip-apps/src/samples/jbsim.c index 5ff871aa61dfe280cbe19b9061d414d30df0aa79..6815730d3436e6743e506d0a7fb69bf65f6f6513 100644 --- a/sflphone-common/libs/pjproject/pjsip-apps/src/samples/jbsim.c +++ b/sflphone-common/libs/pjproject/pjsip-apps/src/samples/jbsim.c @@ -1,4 +1,4 @@ -/* $Id: jbsim.c 2854 2009-08-05 17:10:35Z bennylp $ */ +/* $Id: jbsim.c 2938 2009-10-11 05:06:43Z bennylp $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * @@ -310,7 +310,7 @@ static pj_status_t stream_init(const struct stream_cfg *cfg, struct stream **p_s struct stream *stream = NULL; pjmedia_codec_mgr *cm; unsigned count; - pjmedia_codec_info *ci; + const pjmedia_codec_info *ci; pjmedia_stream_info si; pj_status_t status; diff --git a/sflphone-common/libs/pjproject/pjsip-apps/src/symbian_ua/main_symbian.cpp b/sflphone-common/libs/pjproject/pjsip-apps/src/symbian_ua/main_symbian.cpp index 75b85cab1c8c21cd04811f88fc44932da5c344f5..b1b884286cac3137827bd10a5cd42839b9d89007 100644 --- a/sflphone-common/libs/pjproject/pjsip-apps/src/symbian_ua/main_symbian.cpp +++ b/sflphone-common/libs/pjproject/pjsip-apps/src/symbian_ua/main_symbian.cpp @@ -1,5 +1,5 @@ /* $Id: main_symbian.cpp 2673 2009-05-05 10:46:51Z nanang $ */ -/* +/* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> * @@ -15,7 +15,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include "ua.h" @@ -30,7 +30,7 @@ CConsoleBase* console; // Needed by APS //TPtrC APP_UID = _L("200235D3"); -TPtrC APP_UID = _L ("A000000D"); +TPtrC APP_UID = _L("A000000D"); //////////////////////////////////////////////////////////////////////////// @@ -38,13 +38,13 @@ TPtrC APP_UID = _L ("A000000D"); LOCAL_C void DoStartL() { CActiveScheduler *scheduler = new (ELeave) CActiveScheduler; - CleanupStack::PushL (scheduler); - CActiveScheduler::Install (scheduler); + CleanupStack::PushL(scheduler); + CActiveScheduler::Install(scheduler); ua_main(); - - CActiveScheduler::Install (NULL); - CleanupStack::Pop (scheduler); + + CActiveScheduler::Install(NULL); + CleanupStack::Pop(scheduler); delete scheduler; } @@ -61,26 +61,22 @@ GLDEF_C TInt E32Main() CTrapCleanup* cleanup = CTrapCleanup::New(); // Create output console - TRAPD (createError, console = Console::NewL (_L ("Console"), TSize (KConsFullScreen,KConsFullScreen))); - + TRAPD(createError, console = Console::NewL(_L("Console"), TSize(KConsFullScreen,KConsFullScreen))); if (createError) return createError; - TRAPD (startError, DoStartL()); - - console->Printf (_L ("[press any key to close]\n")); + TRAPD(startError, DoStartL()); + console->Printf(_L("[press any key to close]\n")); console->Getch(); - + delete console; - delete cleanup; - CloseSTDLIB(); + CloseSTDLIB(); // Mark end of heap usage, detect memory leaks __UHEAP_MARKEND; - return KErrNone; } diff --git a/sflphone-common/libs/pjproject/pjsip-apps/src/symbian_ua/ua.cpp b/sflphone-common/libs/pjproject/pjsip-apps/src/symbian_ua/ua.cpp index 3b2182bc11d686be8d2b9a7525ce1de0adef5a34..7b5de03db3e38722f38500a92fd2a322304a5c7e 100644 --- a/sflphone-common/libs/pjproject/pjsip-apps/src/symbian_ua/ua.cpp +++ b/sflphone-common/libs/pjproject/pjsip-apps/src/symbian_ua/ua.cpp @@ -1,5 +1,5 @@ -/* $Id: ua.cpp 2781 2009-06-22 14:06:40Z nanang $ */ -/* +/* $Id: ua.cpp 2999 2009-11-09 09:52:23Z bennylp $ */ +/* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> * @@ -15,7 +15,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include <pjsua-lib/pjsua.h> #include <pjsua-lib/pjsua_internal.h> @@ -35,7 +35,7 @@ // // Destination URI (to make call, or to subscribe presence) // -#define SIP_DST_URI "sip:100@pjsip.lab" +#define SIP_DST_URI "<sip:100@pjsip.lab>" // // Account @@ -52,9 +52,14 @@ //#define SIP_PROXY "<sip:192.168.0.8;lr>" // -// Set to 1 if TCP is desired (experimental) +// SIP transports // -#define ENABLE_SIP_TCP 0 +#define ENABLE_SIP_UDP 1 +#define ENABLE_SIP_TCP 0 // experimental +#define ENABLE_SIP_TLS 0 // experimental + +#define TLS_SRV_NAME "pjsip.org" // TLS servername (required for + // TLS transport) // // Configure nameserver if DNS SRV is to be used with both SIP @@ -66,15 +71,15 @@ // // STUN server #if 0 -// Use this to have the STUN server resolved normally + // Use this to have the STUN server resolved normally # define STUN_DOMAIN NULL # define STUN_SERVER "stun.pjsip.org" #elif 0 -// Use this to have the STUN server resolved with DNS SRV + // Use this to have the STUN server resolved with DNS SRV # define STUN_DOMAIN "pjsip.org" # define STUN_SERVER NULL #else -// Use this to disable STUN + // Use this to disable STUN # define STUN_DOMAIN NULL # define STUN_SERVER NULL #endif @@ -89,6 +94,16 @@ // #define USE_SRTP PJSUA_DEFAULT_USE_SRTP +// +// Set QoS on transports? Yes! +// As an example, we set SIP transports DSCP value to CS3 (DSCP +// value 24 or 0x18), for no reason, and tag RTP/RTCP packets +// with VOICE type. +// +#define SIP_QOS_DSCP 0x18 +#define RTP_QOS_TYPE PJ_QOS_TYPE_VOICE + + // // Globals // @@ -98,180 +113,179 @@ static pjsua_buddy_id g_buddy_id = PJSUA_INVALID_ID; /* Callback called by the library upon receiving incoming call */ -static void on_incoming_call (pjsua_acc_id acc_id, pjsua_call_id call_id, - pjsip_rx_data *rdata) +static void on_incoming_call(pjsua_acc_id acc_id, pjsua_call_id call_id, + pjsip_rx_data *rdata) { pjsua_call_info ci; - PJ_UNUSED_ARG (acc_id); - PJ_UNUSED_ARG (rdata); + PJ_UNUSED_ARG(acc_id); + PJ_UNUSED_ARG(rdata); if (g_call_id != PJSUA_INVALID_ID) { - pjsua_call_answer (call_id, PJSIP_SC_BUSY_HERE, NULL, NULL); - return; + pjsua_call_answer(call_id, PJSIP_SC_BUSY_HERE, NULL, NULL); + return; } + + pjsua_call_get_info(call_id, &ci); - pjsua_call_get_info (call_id, &ci); - - PJ_LOG (3, (THIS_FILE, "Incoming call from %.*s!!", - (int) ci.remote_info.slen, - ci.remote_info.ptr)); + PJ_LOG(3,(THIS_FILE, "Incoming call from %.*s!!", + (int)ci.remote_info.slen, + ci.remote_info.ptr)); g_call_id = call_id; - + /* Automatically answer incoming calls with 180/Ringing */ - pjsua_call_answer (call_id, 180, NULL, NULL); + pjsua_call_answer(call_id, 180, NULL, NULL); } /* Callback called by the library when call's state has changed */ -static void on_call_state (pjsua_call_id call_id, pjsip_event *e) +static void on_call_state(pjsua_call_id call_id, pjsip_event *e) { pjsua_call_info ci; - PJ_UNUSED_ARG (e); - - pjsua_call_get_info (call_id, &ci); + PJ_UNUSED_ARG(e); + pjsua_call_get_info(call_id, &ci); + if (ci.state == PJSIP_INV_STATE_DISCONNECTED) { - if (call_id == g_call_id) - g_call_id = PJSUA_INVALID_ID; + if (call_id == g_call_id) + g_call_id = PJSUA_INVALID_ID; } else if (ci.state != PJSIP_INV_STATE_INCOMING) { - if (g_call_id == PJSUA_INVALID_ID) - g_call_id = call_id; + if (g_call_id == PJSUA_INVALID_ID) + g_call_id = call_id; } - - PJ_LOG (3, (THIS_FILE, "Call %d state=%.*s", call_id, - - (int) ci.state_text.slen, - ci.state_text.ptr)); + + PJ_LOG(3,(THIS_FILE, "Call %d state=%.*s", call_id, + (int)ci.state_text.slen, + ci.state_text.ptr)); } /* Callback called by the library when call's media state has changed */ -static void on_call_media_state (pjsua_call_id call_id) +static void on_call_media_state(pjsua_call_id call_id) { pjsua_call_info ci; - pjsua_call_get_info (call_id, &ci); + pjsua_call_get_info(call_id, &ci); if (ci.media_status == PJSUA_CALL_MEDIA_ACTIVE) { - // When media is active, connect call to sound device. - pjsua_conf_connect (ci.conf_slot, 0); - pjsua_conf_connect (0, ci.conf_slot); + // When media is active, connect call to sound device. + pjsua_conf_connect(ci.conf_slot, 0); + pjsua_conf_connect(0, ci.conf_slot); } } /* Handler on buddy state changed. */ -static void on_buddy_state (pjsua_buddy_id buddy_id) +static void on_buddy_state(pjsua_buddy_id buddy_id) { pjsua_buddy_info info; - pjsua_buddy_get_info (buddy_id, &info); + pjsua_buddy_get_info(buddy_id, &info); - PJ_LOG (3, (THIS_FILE, "%.*s status is %.*s", - (int) info.uri.slen, - info.uri.ptr, - (int) info.status_text.slen, - info.status_text.ptr)); + PJ_LOG(3,(THIS_FILE, "%.*s status is %.*s", + (int)info.uri.slen, + info.uri.ptr, + (int)info.status_text.slen, + info.status_text.ptr)); } /* Incoming IM message (i.e. MESSAGE request)! */ -static void on_pager (pjsua_call_id call_id, const pj_str_t *from, - const pj_str_t *to, const pj_str_t *contact, - const pj_str_t *mime_type, const pj_str_t *text) +static void on_pager(pjsua_call_id call_id, const pj_str_t *from, + const pj_str_t *to, const pj_str_t *contact, + const pj_str_t *mime_type, const pj_str_t *text) { /* Note: call index may be -1 */ - PJ_UNUSED_ARG (call_id); - PJ_UNUSED_ARG (to); - PJ_UNUSED_ARG (contact); - PJ_UNUSED_ARG (mime_type); - - PJ_LOG (3, (THIS_FILE,"MESSAGE from %.*s: %.*s", - (int) from->slen, from->ptr, - (int) text->slen, text->ptr)); + PJ_UNUSED_ARG(call_id); + PJ_UNUSED_ARG(to); + PJ_UNUSED_ARG(contact); + PJ_UNUSED_ARG(mime_type); + + PJ_LOG(3,(THIS_FILE,"MESSAGE from %.*s: %.*s", + (int)from->slen, from->ptr, + (int)text->slen, text->ptr)); } /* Received typing indication */ -static void on_typing (pjsua_call_id call_id, const pj_str_t *from, - const pj_str_t *to, const pj_str_t *contact, - pj_bool_t is_typing) +static void on_typing(pjsua_call_id call_id, const pj_str_t *from, + const pj_str_t *to, const pj_str_t *contact, + pj_bool_t is_typing) { - PJ_UNUSED_ARG (call_id); - PJ_UNUSED_ARG (to); - PJ_UNUSED_ARG (contact); + PJ_UNUSED_ARG(call_id); + PJ_UNUSED_ARG(to); + PJ_UNUSED_ARG(contact); - PJ_LOG (3, (THIS_FILE, "IM indication: %.*s %s", - (int) from->slen, from->ptr, - (is_typing?"is typing..":"has stopped typing"))); + PJ_LOG(3,(THIS_FILE, "IM indication: %.*s %s", + (int)from->slen, from->ptr, + (is_typing?"is typing..":"has stopped typing"))); } /* Call transfer request status. */ -static void on_call_transfer_status (pjsua_call_id call_id, - int status_code, - const pj_str_t *status_text, - pj_bool_t final, - pj_bool_t *p_cont) +static void on_call_transfer_status(pjsua_call_id call_id, + int status_code, + const pj_str_t *status_text, + pj_bool_t final, + pj_bool_t *p_cont) { - PJ_LOG (3, (THIS_FILE, "Call %d: transfer status=%d (%.*s) %s", - call_id, status_code, - (int) status_text->slen, status_text->ptr, - (final ? "[final]" : ""))); + PJ_LOG(3,(THIS_FILE, "Call %d: transfer status=%d (%.*s) %s", + call_id, status_code, + (int)status_text->slen, status_text->ptr, + (final ? "[final]" : ""))); if (status_code/100 == 2) { - PJ_LOG (3, (THIS_FILE, - "Call %d: call transfered successfully, disconnecting call", - call_id)); - pjsua_call_hangup (call_id, PJSIP_SC_GONE, NULL, NULL); - *p_cont = PJ_FALSE; + PJ_LOG(3,(THIS_FILE, + "Call %d: call transfered successfully, disconnecting call", + call_id)); + pjsua_call_hangup(call_id, PJSIP_SC_GONE, NULL, NULL); + *p_cont = PJ_FALSE; } } /* NAT detection result */ -static void on_nat_detect (const pj_stun_nat_detect_result *res) +static void on_nat_detect(const pj_stun_nat_detect_result *res) { if (res->status != PJ_SUCCESS) { - pjsua_perror (THIS_FILE, "NAT detection failed", res->status); + pjsua_perror(THIS_FILE, "NAT detection failed", res->status); } else { - PJ_LOG (3, (THIS_FILE, "NAT detected as %s", res->nat_type_name)); - } + PJ_LOG(3, (THIS_FILE, "NAT detected as %s", res->nat_type_name)); + } } /* Notification that call is being replaced. */ -static void on_call_replaced (pjsua_call_id old_call_id, - pjsua_call_id new_call_id) +static void on_call_replaced(pjsua_call_id old_call_id, + pjsua_call_id new_call_id) { pjsua_call_info old_ci, new_ci; - pjsua_call_get_info (old_call_id, &old_ci); - pjsua_call_get_info (new_call_id, &new_ci); + pjsua_call_get_info(old_call_id, &old_ci); + pjsua_call_get_info(new_call_id, &new_ci); - PJ_LOG (3, (THIS_FILE, "Call %d with %.*s is being replaced by " - "call %d with %.*s", - old_call_id, - (int) old_ci.remote_info.slen, old_ci.remote_info.ptr, - new_call_id, - (int) new_ci.remote_info.slen, new_ci.remote_info.ptr)); + PJ_LOG(3,(THIS_FILE, "Call %d with %.*s is being replaced by " + "call %d with %.*s", + old_call_id, + (int)old_ci.remote_info.slen, old_ci.remote_info.ptr, + new_call_id, + (int)new_ci.remote_info.slen, new_ci.remote_info.ptr)); } //#include<e32debug.h> /* Logging callback */ -static void log_writer (int level, const char *buf, int len) +static void log_writer(int level, const char *buf, int len) { static wchar_t buf16[PJ_LOG_MAX_SIZE]; - PJ_UNUSED_ARG (level); + PJ_UNUSED_ARG(level); + + pj_ansi_to_unicode(buf, len, buf16, PJ_ARRAY_SIZE(buf16)); - pj_ansi_to_unicode (buf, len, buf16, PJ_ARRAY_SIZE (buf16)); - - TPtrC16 aBuf ( (const TUint16*) buf16, (TInt) len); + TPtrC16 aBuf((const TUint16*)buf16, (TInt)len); //RDebug::Print(aBuf); - console->Write (aBuf); - + console->Write(aBuf); + } /* @@ -284,79 +298,63 @@ static pj_status_t app_startup() pj_status_t status; /* Redirect log before pjsua_init() */ - pj_log_set_log_func (&log_writer); - + pj_log_set_log_func(&log_writer); + /* Set log level */ - pj_log_set_level (CON_LOG_LEVEL); + pj_log_set_level(CON_LOG_LEVEL); /* Create pjsua first! */ status = pjsua_create(); - if (status != PJ_SUCCESS) { - pjsua_perror (THIS_FILE, "pjsua_create() error", status); - return status; + pjsua_perror(THIS_FILE, "pjsua_create() error", status); + return status; } /* Init pjsua */ pjsua_config cfg; - pjsua_logging_config log_cfg; - pjsua_media_config med_cfg; - pjsua_config_default (&cfg); - + pjsua_config_default(&cfg); cfg.max_calls = 2; - cfg.thread_cnt = 0; // Disable threading on Symbian - cfg.use_srtp = USE_SRTP; - cfg.srtp_secure_signaling = 0; - + cfg.cb.on_incoming_call = &on_incoming_call; - cfg.cb.on_call_media_state = &on_call_media_state; - cfg.cb.on_call_state = &on_call_state; - cfg.cb.on_buddy_state = &on_buddy_state; - cfg.cb.on_pager = &on_pager; - cfg.cb.on_typing = &on_typing; - cfg.cb.on_call_transfer_status = &on_call_transfer_status; - cfg.cb.on_call_replaced = &on_call_replaced; - cfg.cb.on_nat_detect = &on_nat_detect; - + if (SIP_PROXY) { - cfg.outbound_proxy_cnt = 1; - cfg.outbound_proxy[0] = pj_str (SIP_PROXY); + cfg.outbound_proxy_cnt = 1; + cfg.outbound_proxy[0] = pj_str(SIP_PROXY); } - + if (NAMESERVER) { - cfg.nameserver_count = 1; - cfg.nameserver[0] = pj_str (NAMESERVER); + cfg.nameserver_count = 1; + cfg.nameserver[0] = pj_str(NAMESERVER); } - + if (NAMESERVER && STUN_DOMAIN) { - cfg.stun_domain = pj_str (STUN_DOMAIN); + cfg.stun_domain = pj_str(STUN_DOMAIN); } else if (STUN_SERVER) { - cfg.stun_host = pj_str (STUN_SERVER); + cfg.stun_host = pj_str(STUN_SERVER); } - - - pjsua_logging_config_default (&log_cfg); - + + + pjsua_logging_config_default(&log_cfg); log_cfg.level = FILE_LOG_LEVEL; log_cfg.console_level = CON_LOG_LEVEL; log_cfg.cb = &log_writer; - log_cfg.log_filename = pj_str ("C:\\data\\symbian_ua.log"); + log_cfg.log_filename = pj_str("C:\\data\\symbian_ua.log"); - pjsua_media_config_default (&med_cfg); + pjsua_media_config_default(&med_cfg); med_cfg.thread_cnt = 0; // Disable threading on Symbian med_cfg.has_ioqueue = PJ_FALSE; med_cfg.clock_rate = 8000; @@ -365,112 +363,140 @@ static pj_status_t app_startup() med_cfg.enable_ice = USE_ICE; med_cfg.snd_auto_close_time = 0; // wait for 0 seconds idle before sound dev get auto-closed //med_cfg.no_vad = PJ_TRUE; - - status = pjsua_init (&cfg, &log_cfg, &med_cfg); - + + status = pjsua_init(&cfg, &log_cfg, &med_cfg); if (status != PJ_SUCCESS) { - pjsua_perror (THIS_FILE, "pjsua_init() error", status); - pjsua_destroy(); - return status; + pjsua_perror(THIS_FILE, "pjsua_init() error", status); + pjsua_destroy(); + return status; } - + /* Adjust Speex priority and enable only the narrowband */ { - pj_str_t codec_id = pj_str ("speex/8000"); - pjmedia_codec_mgr_set_codec_priority ( - pjmedia_endpt_get_codec_mgr (pjsua_var.med_endpt), - &codec_id, PJMEDIA_CODEC_PRIO_NORMAL+1); - - codec_id = pj_str ("speex/16000"); - pjmedia_codec_mgr_set_codec_priority ( - pjmedia_endpt_get_codec_mgr (pjsua_var.med_endpt), - &codec_id, PJMEDIA_CODEC_PRIO_DISABLED); - - codec_id = pj_str ("speex/32000"); - pjmedia_codec_mgr_set_codec_priority ( - pjmedia_endpt_get_codec_mgr (pjsua_var.med_endpt), - &codec_id, PJMEDIA_CODEC_PRIO_DISABLED); + pj_str_t codec_id = pj_str("speex/8000"); + pjmedia_codec_mgr_set_codec_priority( + pjmedia_endpt_get_codec_mgr(pjsua_var.med_endpt), + &codec_id, PJMEDIA_CODEC_PRIO_NORMAL+1); + + codec_id = pj_str("speex/16000"); + pjmedia_codec_mgr_set_codec_priority( + pjmedia_endpt_get_codec_mgr(pjsua_var.med_endpt), + &codec_id, PJMEDIA_CODEC_PRIO_DISABLED); + + codec_id = pj_str("speex/32000"); + pjmedia_codec_mgr_set_codec_priority( + pjmedia_endpt_get_codec_mgr(pjsua_var.med_endpt), + &codec_id, PJMEDIA_CODEC_PRIO_DISABLED); } - /* Add UDP transport. */ + pjsua_transport_config tcfg; - pjsua_transport_id tid; - pjsua_transport_config_default (&tcfg); - +#if ENABLE_SIP_UDP + /* Add UDP transport. */ + pjsua_transport_config_default(&tcfg); tcfg.port = SIP_PORT; - - status = pjsua_transport_create (PJSIP_TRANSPORT_UDP, &tcfg, &tid); - + if (SIP_QOS_DSCP) { + tcfg.qos_params.flags |= PJ_QOS_PARAM_HAS_DSCP; + tcfg.qos_params.dscp_val = SIP_QOS_DSCP; + } + status = pjsua_transport_create(PJSIP_TRANSPORT_UDP, &tcfg, &tid); if (status != PJ_SUCCESS) { - pjsua_perror (THIS_FILE, "Error creating UDP transport", status); - pjsua_destroy(); - return status; + pjsua_perror(THIS_FILE, "Error creating UDP transport", status); + pjsua_destroy(); + return status; } - - /* Add TCP transport */ +#endif + #if ENABLE_SIP_TCP - pjsua_transport_config_default (&tcfg); - + /* Add TCP transport */ + pjsua_transport_config_default(&tcfg); tcfg.port = SIP_PORT; - - status = pjsua_transport_create (PJSIP_TRANSPORT_TCP, &tcfg, &tid); - + if (SIP_QOS_DSCP) { + tcfg.qos_params.flags |= PJ_QOS_PARAM_HAS_DSCP; + tcfg.qos_params.dscp_val = SIP_QOS_DSCP; + } + status = pjsua_transport_create(PJSIP_TRANSPORT_TCP, &tcfg, &tid); if (status != PJ_SUCCESS) { - pjsua_perror (THIS_FILE, "Error creating TCP transport", status); - pjsua_destroy(); - return status; + pjsua_perror(THIS_FILE, "Error creating TCP transport", status); + pjsua_destroy(); + return status; } - #endif - + +#if ENABLE_SIP_TLS + /* Add TLS transport */ + pjsua_transport_config_default(&tcfg); + tcfg.port = SIP_PORT + 1; + if (SIP_QOS_DSCP) { + tcfg.qos_params.flags |= PJ_QOS_PARAM_HAS_DSCP; + tcfg.qos_params.dscp_val = SIP_QOS_DSCP; + tcfg.tls_setting.qos_params = tcfg.qos_params; + } + tcfg.tls_setting.server_name = pj_str(TLS_SRV_NAME); + status = pjsua_transport_create(PJSIP_TRANSPORT_TLS, &tcfg, &tid); + if (status != PJ_SUCCESS) { + pjsua_perror(THIS_FILE, "Error creating TLS transport", status); + pjsua_destroy(); + return status; + } +#endif + /* Add account for the transport */ - pjsua_acc_add_local (tid, PJ_TRUE, &g_acc_id); - - + pjsua_acc_add_local(tid, PJ_TRUE, &g_acc_id); + + /* Create media transports */ + pjsua_transport_config mtcfg; + pjsua_transport_config_default(&mtcfg); + mtcfg.port = 4000; + mtcfg.qos_type = RTP_QOS_TYPE; + status = pjsua_media_transports_create(&mtcfg); + if (status != PJ_SUCCESS) { + pjsua_perror(THIS_FILE, "Error creating media transports", status); + pjsua_destroy(); + return status; + } + /* Initialization is done, now start pjsua */ status = pjsua_start(); - if (status != PJ_SUCCESS) { - pjsua_perror (THIS_FILE, "Error starting pjsua", status); - pjsua_destroy(); - return status; + pjsua_perror(THIS_FILE, "Error starting pjsua", status); + pjsua_destroy(); + return status; } /* Register to SIP server by creating SIP account. */ if (HAS_SIP_ACCOUNT) { - pjsua_acc_config cfg; - - pjsua_acc_config_default (&cfg); - cfg.id = pj_str ("sip:" SIP_USER "@" SIP_DOMAIN); - cfg.reg_uri = pj_str ("sip:" SIP_DOMAIN); - cfg.cred_count = 1; - cfg.cred_info[0].realm = pj_str ("*"); - cfg.cred_info[0].scheme = pj_str ("digest"); - cfg.cred_info[0].username = pj_str (SIP_USER); - cfg.cred_info[0].data_type = PJSIP_CRED_DATA_PLAIN_PASSWD; - cfg.cred_info[0].data = pj_str (SIP_PASSWD); - - status = pjsua_acc_add (&cfg, PJ_TRUE, &g_acc_id); - - if (status != PJ_SUCCESS) { - pjsua_perror (THIS_FILE, "Error adding account", status); - pjsua_destroy(); - return status; - } + pjsua_acc_config cfg; + + pjsua_acc_config_default(&cfg); + cfg.id = pj_str("sip:" SIP_USER "@" SIP_DOMAIN); + cfg.reg_uri = pj_str("sip:" SIP_DOMAIN); + cfg.cred_count = 1; + cfg.cred_info[0].realm = pj_str("*"); + cfg.cred_info[0].scheme = pj_str("digest"); + cfg.cred_info[0].username = pj_str(SIP_USER); + cfg.cred_info[0].data_type = PJSIP_CRED_DATA_PLAIN_PASSWD; + cfg.cred_info[0].data = pj_str(SIP_PASSWD); + + status = pjsua_acc_add(&cfg, PJ_TRUE, &g_acc_id); + if (status != PJ_SUCCESS) { + pjsua_perror(THIS_FILE, "Error adding account", status); + pjsua_destroy(); + return status; + } } if (SIP_DST_URI) { - pjsua_buddy_config bcfg; - - pjsua_buddy_config_default (&bcfg); - bcfg.uri = pj_str (SIP_DST_URI); - bcfg.subscribe = PJ_FALSE; - - pjsua_buddy_add (&bcfg, &g_buddy_id); + pjsua_buddy_config bcfg; + + pjsua_buddy_config_default(&bcfg); + bcfg.uri = pj_str(SIP_DST_URI); + bcfg.subscribe = PJ_FALSE; + + pjsua_buddy_add(&bcfg, &g_buddy_id); } - return PJ_SUCCESS; } @@ -481,486 +507,445 @@ static pj_status_t app_startup() */ #include <e32base.h> -class ConsoleUI : public CActive +class ConsoleUI : public CActive { - - public: - ConsoleUI (CConsoleBase *con); - ~ConsoleUI(); - - // Run console UI - void Run(); - - // Stop - void Stop(); - - protected: - // Cancel asynchronous read. - void DoCancel(); - - // Implementation: called when read has completed. - void RunL(); - - private: - CConsoleBase *con_; +public: + ConsoleUI(CConsoleBase *con); + ~ConsoleUI(); + + // Run console UI + void Run(); + + // Stop + void Stop(); + +protected: + // Cancel asynchronous read. + void DoCancel(); + + // Implementation: called when read has completed. + void RunL(); + +private: + CConsoleBase *con_; }; -ConsoleUI::ConsoleUI (CConsoleBase *con) - : CActive (EPriorityStandard), con_ (con) +ConsoleUI::ConsoleUI(CConsoleBase *con) +: CActive(EPriorityStandard), con_(con) { - CActiveScheduler::Add (this); + CActiveScheduler::Add(this); } -ConsoleUI::~ConsoleUI() +ConsoleUI::~ConsoleUI() { Stop(); } // Run console UI -void ConsoleUI::Run() +void ConsoleUI::Run() { - con_->Read (iStatus); + con_->Read(iStatus); SetActive(); } // Stop console UI -void ConsoleUI::Stop() +void ConsoleUI::Stop() { Cancel(); } // Cancel asynchronous read. -void ConsoleUI::DoCancel() +void ConsoleUI::DoCancel() { con_->ReadCancel(); } -static void PrintMainMenu() +static void PrintMainMenu() { const char *menu = - "\n\n" - "Main Menu:\n" - " d Enable/disable codecs\n" - " m Call " SIP_DST_URI "\n" - " a Answer call\n" - " g Hangup all calls\n" - " t Toggle audio route\n" + "\n\n" + "Main Menu:\n" + " d Enable/disable codecs\n" + " m Call " SIP_DST_URI "\n" + " a Answer call\n" + " g Hangup all calls\n" + " t Toggle audio route\n" #if !defined(PJMEDIA_CONF_USE_SWITCH_BOARD) || PJMEDIA_CONF_USE_SWITCH_BOARD==0 - " j Toggle loopback audio\n" + " j Toggle loopback audio\n" #endif - "up/dn Increase/decrease output volume\n" - " s Subscribe " SIP_DST_URI "\n" - " S Unsubscribe presence\n" - " o Set account online\n" - " O Set account offline\n" - " w Quit\n"; - - PJ_LOG (3, (THIS_FILE, menu)); + "up/dn Increase/decrease output volume\n" + " s Subscribe " SIP_DST_URI "\n" + " S Unsubscribe presence\n" + " o Set account online\n" + " O Set account offline\n" + " w Quit\n"; + + PJ_LOG(3, (THIS_FILE, menu)); } -static void PrintCodecMenu() +static void PrintCodecMenu() { - const char *menu = - "\n\n" - "Codec Menu:\n" - " a Enable all codecs\n" + const char *menu = + "\n\n" + "Codec Menu:\n" + " a Enable all codecs\n" #if PJMEDIA_HAS_PASSTHROUGH_CODEC_AMR - " d Enable only AMR\n" + " d Enable only AMR\n" #endif #if PJMEDIA_HAS_PASSTHROUGH_CODEC_G729 - " g Enable only G.729\n" + " g Enable only G.729\n" #endif #if PJMEDIA_HAS_PASSTHROUGH_CODEC_ILBC - " j Enable only iLBC\n" + " j Enable only iLBC\n" #endif - " m Enable only Speex\n" - " p Enable only GSM\n" - " t Enable only PCMU\n" - " w Enable only PCMA\n"; - - PJ_LOG (3, (THIS_FILE, menu)); + " m Enable only Speex\n" + " p Enable only GSM\n" + " t Enable only PCMU\n" + " w Enable only PCMA\n"; + + PJ_LOG(3, (THIS_FILE, menu)); } -static void HandleMainMenu (TKeyCode kc) -{ +static void HandleMainMenu(TKeyCode kc) { switch (kc) { - - case EKeyUpArrow: - - case EKeyDownArrow: { - unsigned vol; - pj_status_t status; - - status = pjsua_snd_get_setting ( - PJMEDIA_AUD_DEV_CAP_OUTPUT_VOLUME_SETTING, &vol); - - if (status == PJ_SUCCESS) { - if (kc == EKeyUpArrow) - vol = PJ_MIN (100, vol+10); - else - vol = (vol>=10 ? vol-10 : 0); - - status = pjsua_snd_set_setting ( - PJMEDIA_AUD_DEV_CAP_OUTPUT_VOLUME_SETTING, - &vol, PJ_TRUE); - } - - if (status == PJ_SUCCESS) { - PJ_LOG (3, (THIS_FILE, "Output volume set to %d", vol)); - } else { - pjsua_perror (THIS_FILE, "Error setting volume", status); - } - } - - break; - - case 't': { - pjmedia_aud_dev_route route; - pj_status_t status; - - status = pjsua_snd_get_setting (PJMEDIA_AUD_DEV_CAP_OUTPUT_ROUTE, - &route); - - if (status == PJ_SUCCESS) { - if (route == PJMEDIA_AUD_DEV_ROUTE_LOUDSPEAKER) - route = PJMEDIA_AUD_DEV_ROUTE_EARPIECE; - else - route = PJMEDIA_AUD_DEV_ROUTE_LOUDSPEAKER; - - status = pjsua_snd_set_setting ( - PJMEDIA_AUD_DEV_CAP_OUTPUT_ROUTE, - &route, PJ_TRUE); - } - - if (status != PJ_SUCCESS) - pjsua_perror (THIS_FILE, "Error switch audio route", status); - } - - break; - - case 'j': { - static pj_bool_t loopback_active = PJ_FALSE; - - if (!loopback_active) - pjsua_conf_connect (0, 0); - else - pjsua_conf_disconnect (0, 0); - - loopback_active = !loopback_active; - } - - break; - - case 'm': - - if (g_call_id != PJSUA_INVALID_ID) { - PJ_LOG (3, (THIS_FILE, "Another call is active")); - break; - } - - if (pjsua_verify_sip_url (SIP_DST_URI) == PJ_SUCCESS) { - pj_str_t dst = pj_str (SIP_DST_URI); - pjsua_call_make_call (g_acc_id, &dst, 0, NULL, - NULL, &g_call_id); - } else { - PJ_LOG (3, (THIS_FILE, "Invalid SIP URI")); - } - - break; - - case 'a': - - if (g_call_id != PJSUA_INVALID_ID) - pjsua_call_answer (g_call_id, 200, NULL, NULL); - - break; - - case 'g': - pjsua_call_hangup_all(); - - break; - - case 's': - - case 'S': - if (g_buddy_id != PJSUA_INVALID_ID) - pjsua_buddy_subscribe_pres (g_buddy_id, kc=='s'); - - break; - - case 'o': - - case 'O': - pjsua_acc_set_online_status (g_acc_id, kc=='o'); - - break; - - default: - PJ_LOG (3, (THIS_FILE, "Keycode '%c' (%d) is pressed", kc, kc)); - - break; + + case EKeyUpArrow: + case EKeyDownArrow: + { + unsigned vol; + pj_status_t status; + + status = pjsua_snd_get_setting( + PJMEDIA_AUD_DEV_CAP_OUTPUT_VOLUME_SETTING, &vol); + if (status == PJ_SUCCESS) { + if (kc == EKeyUpArrow) + vol = PJ_MIN(100, vol+10); + else + vol = (vol>=10 ? vol-10 : 0); + status = pjsua_snd_set_setting( + PJMEDIA_AUD_DEV_CAP_OUTPUT_VOLUME_SETTING, + &vol, PJ_TRUE); + } + + if (status == PJ_SUCCESS) { + PJ_LOG(3,(THIS_FILE, "Output volume set to %d", vol)); + } else { + pjsua_perror(THIS_FILE, "Error setting volume", status); + } + } + break; + + case 't': + { + pjmedia_aud_dev_route route; + pj_status_t status; + + status = pjsua_snd_get_setting(PJMEDIA_AUD_DEV_CAP_OUTPUT_ROUTE, + &route); + + if (status == PJ_SUCCESS) { + if (route == PJMEDIA_AUD_DEV_ROUTE_LOUDSPEAKER) + route = PJMEDIA_AUD_DEV_ROUTE_EARPIECE; + else + route = PJMEDIA_AUD_DEV_ROUTE_LOUDSPEAKER; + + status = pjsua_snd_set_setting( + PJMEDIA_AUD_DEV_CAP_OUTPUT_ROUTE, + &route, PJ_TRUE); + } + + if (status != PJ_SUCCESS) + pjsua_perror(THIS_FILE, "Error switch audio route", status); + } + break; + + case 'j': + { + static pj_bool_t loopback_active = PJ_FALSE; + if (!loopback_active) + pjsua_conf_connect(0, 0); + else + pjsua_conf_disconnect(0, 0); + loopback_active = !loopback_active; + } + break; + + case 'm': + if (g_call_id != PJSUA_INVALID_ID) { + PJ_LOG(3,(THIS_FILE, "Another call is active")); + break; + } + + if (pjsua_verify_sip_url(SIP_DST_URI) == PJ_SUCCESS) { + pj_str_t dst = pj_str(SIP_DST_URI); + pjsua_call_make_call(g_acc_id, &dst, 0, NULL, + NULL, &g_call_id); + } else { + PJ_LOG(3,(THIS_FILE, "Invalid SIP URI")); + } + break; + case 'a': + if (g_call_id != PJSUA_INVALID_ID) + pjsua_call_answer(g_call_id, 200, NULL, NULL); + break; + case 'g': + pjsua_call_hangup_all(); + break; + case 's': + case 'S': + if (g_buddy_id != PJSUA_INVALID_ID) + pjsua_buddy_subscribe_pres(g_buddy_id, kc=='s'); + break; + case 'o': + case 'O': + pjsua_acc_set_online_status(g_acc_id, kc=='o'); + break; + + default: + PJ_LOG(3,(THIS_FILE, "Keycode '%c' (%d) is pressed", kc, kc)); + break; } PrintMainMenu(); } -static void HandleCodecMenu (TKeyCode kc) -{ +static void HandleCodecMenu(TKeyCode kc) { const pj_str_t ID_ALL = {"*", 1}; pj_str_t codec = {NULL, 0}; - + if (kc == 'a') { - pjsua_codec_set_priority (&ID_ALL, PJMEDIA_CODEC_PRIO_NORMAL); - PJ_LOG (3, (THIS_FILE, "All codecs activated")); + pjsua_codec_set_priority(&ID_ALL, PJMEDIA_CODEC_PRIO_NORMAL); + PJ_LOG(3,(THIS_FILE, "All codecs activated")); } else { - switch (kc) { - - case 'd': - codec = pj_str ("AMR"); - break; - - case 'g': - codec = pj_str ("G729"); - break; - - case 'j': - codec = pj_str ("ILBC"); - break; - - case 'm': - codec = pj_str ("SPEEX/8000"); - break; - - case 'p': - codec = pj_str ("GSM"); - break; - - case 't': - codec = pj_str ("PCMU"); - break; - - case 'w': - codec = pj_str ("PCMA"); - break; - - default: - PJ_LOG (3, (THIS_FILE, "Keycode '%c' (%d) is pressed", kc, kc)); - break; - } - - if (codec.slen) { - pj_status_t status; - - pjsua_codec_set_priority (&ID_ALL, PJMEDIA_CODEC_PRIO_DISABLED); - - status = pjsua_codec_set_priority (&codec, - PJMEDIA_CODEC_PRIO_NORMAL); - - if (status == PJ_SUCCESS) - PJ_LOG (3, (THIS_FILE, "%s activated", codec.ptr)); - else - PJ_LOG (3, (THIS_FILE, "Failed activating %s, err=%d", - codec.ptr, status)); - } + switch (kc) { + case 'd': + codec = pj_str("AMR"); + break; + case 'g': + codec = pj_str("G729"); + break; + case 'j': + codec = pj_str("ILBC"); + break; + case 'm': + codec = pj_str("SPEEX/8000"); + break; + case 'p': + codec = pj_str("GSM"); + break; + case 't': + codec = pj_str("PCMU"); + break; + case 'w': + codec = pj_str("PCMA"); + break; + default: + PJ_LOG(3,(THIS_FILE, "Keycode '%c' (%d) is pressed", kc, kc)); + break; + } + + if (codec.slen) { + pj_status_t status; + + pjsua_codec_set_priority(&ID_ALL, PJMEDIA_CODEC_PRIO_DISABLED); + + status = pjsua_codec_set_priority(&codec, + PJMEDIA_CODEC_PRIO_NORMAL); + if (status == PJ_SUCCESS) + PJ_LOG(3,(THIS_FILE, "%s activated", codec.ptr)); + else + PJ_LOG(3,(THIS_FILE, "Failed activating %s, err=%d", + codec.ptr, status)); + } } } // Implementation: called when read has completed. -void ConsoleUI::RunL() +void ConsoleUI::RunL() { enum { - MENU_TYPE_MAIN = 0, - MENU_TYPE_CODEC = 1 + MENU_TYPE_MAIN = 0, + MENU_TYPE_CODEC = 1 }; static int menu_type = MENU_TYPE_MAIN; TKeyCode kc = con_->KeyCode(); pj_bool_t reschedule = PJ_TRUE; - + if (menu_type == MENU_TYPE_MAIN) { - if (kc == 'w') { - CActiveScheduler::Stop(); - reschedule = PJ_FALSE; - } else if (kc == 'd') { - menu_type = MENU_TYPE_CODEC; - PrintCodecMenu(); - } else { - HandleMainMenu (kc); - } + if (kc == 'w') { + CActiveScheduler::Stop(); + reschedule = PJ_FALSE; + } else if (kc == 'd') { + menu_type = MENU_TYPE_CODEC; + PrintCodecMenu(); + } else { + HandleMainMenu(kc); + } } else { - HandleCodecMenu (kc); - - menu_type = MENU_TYPE_MAIN; - PrintMainMenu(); + HandleCodecMenu(kc); + + menu_type = MENU_TYPE_MAIN; + PrintMainMenu(); } - + if (reschedule) - Run(); + Run(); } #if 0 // IP networking related testing -static pj_status_t test_addr (void) +static pj_status_t test_addr(void) { - int af; - unsigned i, count; - pj_addrinfo ai[8]; - pj_sockaddr ifs[8]; - const pj_str_t *hostname; - pj_hostent he; - pj_status_t status; - - pj_log_set_log_func (&log_writer); - - status = pj_init(); - - if (status != PJ_SUCCESS) { - pjsua_perror (THIS_FILE, "pj_init() error", status); - return status; - } - - af = pj_AF_INET(); - + int af; + unsigned i, count; + pj_addrinfo ai[8]; + pj_sockaddr ifs[8]; + const pj_str_t *hostname; + pj_hostent he; + pj_status_t status; + + pj_log_set_log_func(&log_writer); + + status = pj_init(); + if (status != PJ_SUCCESS) { + pjsua_perror(THIS_FILE, "pj_init() error", status); + return status; + } + + af = pj_AF_INET(); + #if 0 - pj_in_addr in_addr; - pj_str_t aa = pj_str ("1.1.1.1"); - in_addr = pj_inet_addr (&aa); - char *the_addr = pj_inet_ntoa (in_addr); - PJ_LOG (3, (THIS_FILE, "IP addr=%s", the_addr)); - - aa = pj_str ("192.168.0.15"); - in_addr = pj_inet_addr (&aa); - the_addr = pj_inet_ntoa (in_addr); - PJ_LOG (3, (THIS_FILE, "IP addr=%s", the_addr)); - - aa = pj_str ("2.2.2.2"); - in_addr = pj_inet_addr (&aa); - the_addr = pj_inet_ntoa (in_addr); - PJ_LOG (3, (THIS_FILE, "IP addr=%s", the_addr)); - - return -1; + pj_in_addr in_addr; + pj_str_t aa = pj_str("1.1.1.1"); + in_addr = pj_inet_addr(&aa); + char *the_addr = pj_inet_ntoa(in_addr); + PJ_LOG(3,(THIS_FILE, "IP addr=%s", the_addr)); + + aa = pj_str("192.168.0.15"); + in_addr = pj_inet_addr(&aa); + the_addr = pj_inet_ntoa(in_addr); + PJ_LOG(3,(THIS_FILE, "IP addr=%s", the_addr)); + + aa = pj_str("2.2.2.2"); + in_addr = pj_inet_addr(&aa); + the_addr = pj_inet_ntoa(in_addr); + PJ_LOG(3,(THIS_FILE, "IP addr=%s", the_addr)); + + return -1; #endif - - // Hostname - hostname = pj_gethostname(); - - if (hostname == NULL) { - status = PJ_ERESOLVE; - pjsua_perror (THIS_FILE, "pj_gethostname() error", status); - goto on_return; - } - - PJ_LOG (3, (THIS_FILE, "Hostname: %.*s", hostname->slen, hostname->ptr)); - - // Gethostbyname - status = pj_gethostbyname (hostname, &he); - - if (status != PJ_SUCCESS) { - pjsua_perror (THIS_FILE, "pj_gethostbyname() error", status); - } else { - PJ_LOG (3, (THIS_FILE, "gethostbyname: %s", - pj_inet_ntoa (* (pj_in_addr*) he.h_addr))); - } - - // Getaddrinfo - count = PJ_ARRAY_SIZE (ai); - - status = pj_getaddrinfo (af, hostname, &count, ai); - - if (status != PJ_SUCCESS) { - pjsua_perror (THIS_FILE, "pj_getaddrinfo() error", status); - } else { - for (i=0; i<count; ++i) { - char ipaddr[PJ_INET6_ADDRSTRLEN+2]; - PJ_LOG (3, (THIS_FILE, "Addrinfo: %s", - pj_sockaddr_print (&ai[i].ai_addr, ipaddr, sizeof (ipaddr), 2))); - } - } - - // Enum interface - count = PJ_ARRAY_SIZE (ifs); - - status = pj_enum_ip_interface (af, &count, ifs); - - if (status != PJ_SUCCESS) { - pjsua_perror (THIS_FILE, "pj_enum_ip_interface() error", status); - } else { - for (i=0; i<count; ++i) { - char ipaddr[PJ_INET6_ADDRSTRLEN+2]; - PJ_LOG (3, (THIS_FILE, "Interface: %s", - pj_sockaddr_print (&ifs[i], ipaddr, sizeof (ipaddr), 2))); - } - } - - // Get default iinterface - status = pj_getdefaultipinterface (af, &ifs[0]); - - if (status != PJ_SUCCESS) { - pjsua_perror (THIS_FILE, "pj_getdefaultipinterface() error", status); - } else { - char ipaddr[PJ_INET6_ADDRSTRLEN+2]; - PJ_LOG (3, (THIS_FILE, "Default IP: %s", - pj_sockaddr_print (&ifs[0], ipaddr, sizeof (ipaddr), 2))); - } - - // Get default IP address - status = pj_gethostip (af, &ifs[0]); - - if (status != PJ_SUCCESS) { - pjsua_perror (THIS_FILE, "pj_gethostip() error", status); - } else { - char ipaddr[PJ_INET6_ADDRSTRLEN+2]; - PJ_LOG (3, (THIS_FILE, "Host IP: %s", - pj_sockaddr_print (&ifs[0], ipaddr, sizeof (ipaddr), 2))); - } - - status = -1; - + + // Hostname + hostname = pj_gethostname(); + if (hostname == NULL) { + status = PJ_ERESOLVE; + pjsua_perror(THIS_FILE, "pj_gethostname() error", status); + goto on_return; + } + + PJ_LOG(3,(THIS_FILE, "Hostname: %.*s", hostname->slen, hostname->ptr)); + + // Gethostbyname + status = pj_gethostbyname(hostname, &he); + if (status != PJ_SUCCESS) { + pjsua_perror(THIS_FILE, "pj_gethostbyname() error", status); + } else { + PJ_LOG(3,(THIS_FILE, "gethostbyname: %s", + pj_inet_ntoa(*(pj_in_addr*)he.h_addr))); + } + + // Getaddrinfo + count = PJ_ARRAY_SIZE(ai); + status = pj_getaddrinfo(af, hostname, &count, ai); + if (status != PJ_SUCCESS) { + pjsua_perror(THIS_FILE, "pj_getaddrinfo() error", status); + } else { + for (i=0; i<count; ++i) { + char ipaddr[PJ_INET6_ADDRSTRLEN+2]; + PJ_LOG(3,(THIS_FILE, "Addrinfo: %s", + pj_sockaddr_print(&ai[i].ai_addr, ipaddr, sizeof(ipaddr), 2))); + } + } + + // Enum interface + count = PJ_ARRAY_SIZE(ifs); + status = pj_enum_ip_interface(af, &count, ifs); + if (status != PJ_SUCCESS) { + pjsua_perror(THIS_FILE, "pj_enum_ip_interface() error", status); + } else { + for (i=0; i<count; ++i) { + char ipaddr[PJ_INET6_ADDRSTRLEN+2]; + PJ_LOG(3,(THIS_FILE, "Interface: %s", + pj_sockaddr_print(&ifs[i], ipaddr, sizeof(ipaddr), 2))); + } + } + + // Get default iinterface + status = pj_getdefaultipinterface(af, &ifs[0]); + if (status != PJ_SUCCESS) { + pjsua_perror(THIS_FILE, "pj_getdefaultipinterface() error", status); + } else { + char ipaddr[PJ_INET6_ADDRSTRLEN+2]; + PJ_LOG(3,(THIS_FILE, "Default IP: %s", + pj_sockaddr_print(&ifs[0], ipaddr, sizeof(ipaddr), 2))); + } + + // Get default IP address + status = pj_gethostip(af, &ifs[0]); + if (status != PJ_SUCCESS) { + pjsua_perror(THIS_FILE, "pj_gethostip() error", status); + } else { + char ipaddr[PJ_INET6_ADDRSTRLEN+2]; + PJ_LOG(3,(THIS_FILE, "Host IP: %s", + pj_sockaddr_print(&ifs[0], ipaddr, sizeof(ipaddr), 2))); + } + + status = -1; + on_return: - pj_shutdown(); - return status; + pj_shutdown(); + return status; } - #endif #include <es_sock.h> #if 0 -// Force network connection to use the first IAP, -// this is useful for debugging on emulator without GUI. +// Force network connection to use the first IAP, +// this is useful for debugging on emulator without GUI. // Include commdb.lib & apengine.lib in symbian_ua.mmp file // if this is enabled. #include <apdatahandler.h> -inline void ForceUseFirstIAP() +inline void ForceUseFirstIAP() { TUint32 rank = 1; TUint32 bearers; TUint32 prompt; TUint32 iap; - CCommsDatabase* commDb = CCommsDatabase::NewL (EDatabaseTypeIAP); - CleanupStack::PushL (commDb); - - CApDataHandler* apDataHandler = CApDataHandler::NewLC (*commDb); + CCommsDatabase* commDb = CCommsDatabase::NewL(EDatabaseTypeIAP); + CleanupStack::PushL(commDb); + CApDataHandler* apDataHandler = CApDataHandler::NewLC(*commDb); + TCommDbConnectionDirection direction = ECommDbConnectionDirectionOutgoing; - apDataHandler->GetPreferredIfDbIapTypeL (rank, direction, bearers, prompt, iap); + apDataHandler->GetPreferredIfDbIapTypeL(rank, direction, bearers, prompt, iap); prompt = ECommDbDialogPrefDoNotPrompt; - apDataHandler->SetPreferredIfDbIapTypeL (rank, direction, bearers, (TCommDbDialogPref) prompt, iap, ETrue); - CleanupStack::PopAndDestroy (2); // apDataHandler, commDb + apDataHandler->SetPreferredIfDbIapTypeL(rank, direction, bearers, (TCommDbDialogPref)prompt, iap, ETrue); + CleanupStack::PopAndDestroy(2); // apDataHandler, commDb } -static void SelectIAP() +static void SelectIAP() { ForceUseFirstIAP(); } #else -static void SelectIAP() +static void SelectIAP() { } @@ -969,108 +954,96 @@ static void SelectIAP() // Class CConnMon to monitor network connection (RConnection). Whenever // the connection is down, it will notify PJLIB and restart PJSUA-LIB. +class CConnMon : public CActive { +public: + static CConnMon* NewL(RConnection &conn, RSocketServ &sserver) { + CConnMon *self = new (ELeave) CConnMon(conn, sserver); + CleanupStack::PushL(self); + self->ConstructL(); + CleanupStack::Pop(self); + return self; + } + + void Start() { + conn_.ProgressNotification(nif_progress_, iStatus); + SetActive(); + } + + void Stop() { + Cancel(); + } + + ~CConnMon() { Stop(); } + +private: + CConnMon(RConnection &conn, RSocketServ &sserver) : + CActive(EPriorityHigh), + conn_(conn), + sserver_(sserver) + { + CActiveScheduler::Add(this); + } + + void ConstructL() {} -class CConnMon : public CActive -{ - - public: - static CConnMon* NewL (RConnection &conn, RSocketServ &sserver) { - CConnMon *self = new (ELeave) CConnMon (conn, sserver); - CleanupStack::PushL (self); - self->ConstructL(); - CleanupStack::Pop (self); - return self; - } - - void Start() { - conn_.ProgressNotification (nif_progress_, iStatus); - SetActive(); - } - - void Stop() { - Cancel(); - } - - ~CConnMon() { - Stop(); - } - - private: - CConnMon (RConnection &conn, RSocketServ &sserver) : - CActive (EPriorityHigh), - conn_ (conn), - sserver_ (sserver) { - CActiveScheduler::Add (this); - } - - void ConstructL() {} - - void DoCancel() { - conn_.CancelProgressNotification(); - } - - void RunL() { - int stage = nif_progress_().iStage; - - if (stage == KLinkLayerClosed) { - pj_status_t status; - TInt err; - - // Tell pjlib that connection is down. - pj_symbianos_set_connection_status (PJ_FALSE); - - PJ_LOG (3, (THIS_FILE, "RConnection closed, restarting PJSUA..")); - - // Destroy pjsua - pjsua_destroy(); - PJ_LOG (3, (THIS_FILE, "PJSUA destroyed.")); - - // Reopen the connection - err = conn_.Open (sserver_); - - if (err == KErrNone) - err = conn_.Start(); - - if (err != KErrNone) { - CActiveScheduler::Stop(); - return; - } - - // Reinit Symbian OS param before pj_init() - pj_symbianos_params sym_params; - - pj_bzero (&sym_params, sizeof (sym_params)); - - sym_params.rsocketserv = &sserver_; - - sym_params.rconnection = &conn_; - - pj_symbianos_set_params (&sym_params); - - // Reinit pjsua - status = app_startup(); - - if (status != PJ_SUCCESS) { - pjsua_perror (THIS_FILE, "app_startup() error", status); - CActiveScheduler::Stop(); - return; - } - - PJ_LOG (3, (THIS_FILE, "PJSUA restarted.")); - - PrintMainMenu(); - } - - Start(); - } + void DoCancel() { + conn_.CancelProgressNotification(); + } - RConnection& conn_; - RSocketServ& sserver_; - TNifProgressBuf nif_progress_; + void RunL() { + int stage = nif_progress_().iStage; + + if (stage == KLinkLayerClosed) { + pj_status_t status; + TInt err; + + // Tell pjlib that connection is down. + pj_symbianos_set_connection_status(PJ_FALSE); + + PJ_LOG(3, (THIS_FILE, "RConnection closed, restarting PJSUA..")); + + // Destroy pjsua + pjsua_destroy(); + PJ_LOG(3, (THIS_FILE, "PJSUA destroyed.")); + + // Reopen the connection + err = conn_.Open(sserver_); + if (err == KErrNone) + err = conn_.Start(); + if (err != KErrNone) { + CActiveScheduler::Stop(); + return; + } + + // Reinit Symbian OS param before pj_init() + pj_symbianos_params sym_params; + pj_bzero(&sym_params, sizeof(sym_params)); + sym_params.rsocketserv = &sserver_; + sym_params.rconnection = &conn_; + pj_symbianos_set_params(&sym_params); + + // Reinit pjsua + status = app_startup(); + if (status != PJ_SUCCESS) { + pjsua_perror(THIS_FILE, "app_startup() error", status); + CActiveScheduler::Stop(); + return; + } + + PJ_LOG(3, (THIS_FILE, "PJSUA restarted.")); + PrintMainMenu(); + } + + Start(); + } + + RConnection& conn_; + RSocketServ& sserver_; + TNifProgressBuf nif_progress_; }; //////////////////////////////////////////////////////////////////////////// -int ua_main() +int ua_main() { RSocketServ aSocketServer; RConnection aConn; @@ -1079,94 +1052,81 @@ int ua_main() pj_status_t status; SelectIAP(); - + // Initialize RSocketServ - - if ( (err=aSocketServer.Connect()) != KErrNone) - return PJ_STATUS_FROM_OS (err); - + if ((err=aSocketServer.Connect()) != KErrNone) + return PJ_STATUS_FROM_OS(err); + // Open up a connection - if ( (err=aConn.Open (aSocketServer)) != KErrNone) { - aSocketServer.Close(); - return PJ_STATUS_FROM_OS (err); + if ((err=aConn.Open(aSocketServer)) != KErrNone) { + aSocketServer.Close(); + return PJ_STATUS_FROM_OS(err); } - - if ( (err=aConn.Start()) != KErrNone) { - aSocketServer.Close(); - return PJ_STATUS_FROM_OS (err); + + if ((err=aConn.Start()) != KErrNone) { + aSocketServer.Close(); + return PJ_STATUS_FROM_OS(err); } - + // Set Symbian OS parameters in pjlib. // This must be done before pj_init() is called. - pj_bzero (&sym_params, sizeof (sym_params)); - + pj_bzero(&sym_params, sizeof(sym_params)); sym_params.rsocketserv = &aSocketServer; - sym_params.rconnection = &aConn; - - pj_symbianos_set_params (&sym_params); - + pj_symbianos_set_params(&sym_params); + // Initialize pjsua status = app_startup(); - //status = test_addr(); if (status != PJ_SUCCESS) { - aConn.Close(); - aSocketServer.Close(); - return status; + aConn.Close(); + aSocketServer.Close(); + return status; } - + // Run the UI - ConsoleUI *con = new ConsoleUI (console); - + ConsoleUI *con = new ConsoleUI(console); + con->Run(); - PrintMainMenu(); // Init & start connection monitor - CConnMon *connmon = CConnMon::NewL (aConn, aSocketServer); - + CConnMon *connmon = CConnMon::NewL(aConn, aSocketServer); connmon->Start(); CActiveScheduler::Start(); - + delete connmon; - delete con; // Dump memory statistics - PJ_LOG (3, (THIS_FILE, "Max heap usage: %u.%03uMB", - pjsua_var.cp.peak_used_size / 1000000, - (pjsua_var.cp.peak_used_size % 1000000) /1000)); - + PJ_LOG(3,(THIS_FILE, "Max heap usage: %u.%03uMB", + pjsua_var.cp.peak_used_size / 1000000, + (pjsua_var.cp.peak_used_size % 1000000)/1000)); + // check max stack usage #if defined(PJ_OS_HAS_CHECK_STACK) && PJ_OS_HAS_CHECK_STACK!=0 - pj_thread_t* this_thread = pj_thread_this(); - - if (!this_thread) - return status; - - const char* max_stack_file; - - int max_stack_line; - - status = pj_thread_get_stack_info (this_thread, &max_stack_file, &max_stack_line); - - PJ_LOG (3, (THIS_FILE, "Max stack usage: %u at %s:%d", - pj_thread_get_stack_max_usage (this_thread), - max_stack_file, max_stack_line)); - + pj_thread_t* this_thread = pj_thread_this(); + if (!this_thread) + return status; + + const char* max_stack_file; + int max_stack_line; + status = pj_thread_get_stack_info(this_thread, &max_stack_file, &max_stack_line); + + PJ_LOG(3,(THIS_FILE, "Max stack usage: %u at %s:%d", + pj_thread_get_stack_max_usage(this_thread), + max_stack_file, max_stack_line)); #endif - + // Shutdown pjsua pjsua_destroy(); - + // Close connection and socket server aConn.Close(); - aSocketServer.Close(); - + return status; } diff --git a/sflphone-common/libs/pjproject/pjsip-apps/src/symbian_ua_gui/src/Symbian_ua_guiSettingItemListSets.cpp b/sflphone-common/libs/pjproject/pjsip-apps/src/symbian_ua_gui/src/Symbian_ua_guiSettingItemListSets.cpp index 69d842c37df7062f36df385435f9c5b97caf0431..6d7522938b924bc781abb0d7ae49544c8af38811 100644 --- a/sflphone-common/libs/pjproject/pjsip-apps/src/symbian_ua_gui/src/Symbian_ua_guiSettingItemListSets.cpp +++ b/sflphone-common/libs/pjproject/pjsip-apps/src/symbian_ua_gui/src/Symbian_ua_guiSettingItemListSets.cpp @@ -3,16 +3,16 @@ Name : Symbian_ua_guiSettingItemListSettings.cpp Author : nanang Copyright : (c) 2008-2009 Teluu Inc. - Description : + Description : ======================================================================== */ /** - * Generated helper class which manages the settings contained + * Generated helper class which manages the settings contained * in 'symbian_ua_guiSettingItemList'. Each CAknSettingItem maintains * a reference to data in this class so that changes in the setting * item list can be synchronized with this storage. */ - + // [[[ begin generated region: do not modify [Generated Includes] #include <e32base.h> #include <stringloader.h> @@ -25,123 +25,120 @@ * C/C++ constructor for settings data, cannot throw */ TSymbian_ua_guiSettingItemListSettings::TSymbian_ua_guiSettingItemListSettings() -{ -} + { + } /** * Two-phase constructor for settings data */ TSymbian_ua_guiSettingItemListSettings* TSymbian_ua_guiSettingItemListSettings::NewL() -{ - TSymbian_ua_guiSettingItemListSettings* data = new (ELeave) TSymbian_ua_guiSettingItemListSettings; - CleanupStack::PushL (data); - data->ConstructL(); - CleanupStack::Pop (data); - return data; -} - + { + TSymbian_ua_guiSettingItemListSettings* data = new( ELeave ) TSymbian_ua_guiSettingItemListSettings; + CleanupStack::PushL( data ); + data->ConstructL(); + CleanupStack::Pop( data ); + return data; + } + /** * Second phase for initializing settings data */ void TSymbian_ua_guiSettingItemListSettings::ConstructL() -{ - // [[[ begin generated region: do not modify [Generated Initializers] - { - HBufC* text = StringLoader::LoadLC (R_SYMBIAN_UA_GUI_SETTING_ITEM_LIST_ED_REGISTRAR); - SetEd_registrar (text->Des()); - CleanupStack::PopAndDestroy (text); - } - - { - HBufC* text = StringLoader::LoadLC (R_SYMBIAN_UA_GUI_SETTING_ITEM_LIST_ED_USER); - SetEd_user (text->Des()); - CleanupStack::PopAndDestroy (text); - } - - SetB_srtp (0); - SetB_ice (0); - { - HBufC* text = StringLoader::LoadLC (R_SYMBIAN_UA_GUI_SETTING_ITEM_LIST_ED_STUN_SERVER); - SetEd_stun_server (text->Des()); - CleanupStack::PopAndDestroy (text); - } - - // ]]] end generated region [Generated Initializers] - -} - + { + // [[[ begin generated region: do not modify [Generated Initializers] + { + HBufC* text = StringLoader::LoadLC( R_SYMBIAN_UA_GUI_SETTING_ITEM_LIST_ED_REGISTRAR ); + SetEd_registrar( text->Des() ); + CleanupStack::PopAndDestroy( text ); + } + { + HBufC* text = StringLoader::LoadLC( R_SYMBIAN_UA_GUI_SETTING_ITEM_LIST_ED_USER ); + SetEd_user( text->Des() ); + CleanupStack::PopAndDestroy( text ); + } + SetB_srtp( 0 ); + SetB_ice( 0 ); + { + HBufC* text = StringLoader::LoadLC( R_SYMBIAN_UA_GUI_SETTING_ITEM_LIST_ED_STUN_SERVER ); + SetEd_stun_server( text->Des() ); + CleanupStack::PopAndDestroy( text ); + } + // ]]] end generated region [Generated Initializers] + + } + // [[[ begin generated region: do not modify [Generated Contents] TDes& TSymbian_ua_guiSettingItemListSettings::Ed_registrar() -{ - return iEd_registrar; -} - -void TSymbian_ua_guiSettingItemListSettings::SetEd_registrar (const TDesC& aValue) -{ - if (aValue.Length() < KEd_registrarMaxLength) - iEd_registrar.Copy (aValue); - else - iEd_registrar.Copy (aValue.Ptr(), KEd_registrarMaxLength); -} + { + return iEd_registrar; + } + +void TSymbian_ua_guiSettingItemListSettings::SetEd_registrar(const TDesC& aValue) + { + if ( aValue.Length() < KEd_registrarMaxLength) + iEd_registrar.Copy( aValue ); + else + iEd_registrar.Copy( aValue.Ptr(), KEd_registrarMaxLength); + } TDes& TSymbian_ua_guiSettingItemListSettings::Ed_user() -{ - return iEd_user; -} - -void TSymbian_ua_guiSettingItemListSettings::SetEd_user (const TDesC& aValue) -{ - if (aValue.Length() < KEd_userMaxLength) - iEd_user.Copy (aValue); - else - iEd_user.Copy (aValue.Ptr(), KEd_userMaxLength); -} + { + return iEd_user; + } + +void TSymbian_ua_guiSettingItemListSettings::SetEd_user(const TDesC& aValue) + { + if ( aValue.Length() < KEd_userMaxLength) + iEd_user.Copy( aValue ); + else + iEd_user.Copy( aValue.Ptr(), KEd_userMaxLength); + } TDes& TSymbian_ua_guiSettingItemListSettings::Ed_password() -{ - return iEd_password; -} - -void TSymbian_ua_guiSettingItemListSettings::SetEd_password (const TDesC& aValue) -{ - if (aValue.Length() < KEd_passwordMaxLength) - iEd_password.Copy (aValue); - else - iEd_password.Copy (aValue.Ptr(), KEd_passwordMaxLength); -} + { + return iEd_password; + } + +void TSymbian_ua_guiSettingItemListSettings::SetEd_password(const TDesC& aValue) + { + if ( aValue.Length() < KEd_passwordMaxLength) + iEd_password.Copy( aValue ); + else + iEd_password.Copy( aValue.Ptr(), KEd_passwordMaxLength); + } TBool& TSymbian_ua_guiSettingItemListSettings::B_srtp() -{ - return iB_srtp; -} + { + return iB_srtp; + } -void TSymbian_ua_guiSettingItemListSettings::SetB_srtp (const TBool& aValue) -{ - iB_srtp = aValue; -} +void TSymbian_ua_guiSettingItemListSettings::SetB_srtp(const TBool& aValue) + { + iB_srtp = aValue; + } TBool& TSymbian_ua_guiSettingItemListSettings::B_ice() -{ - return iB_ice; -} + { + return iB_ice; + } -void TSymbian_ua_guiSettingItemListSettings::SetB_ice (const TBool& aValue) -{ - iB_ice = aValue; -} +void TSymbian_ua_guiSettingItemListSettings::SetB_ice(const TBool& aValue) + { + iB_ice = aValue; + } TDes& TSymbian_ua_guiSettingItemListSettings::Ed_stun_server() -{ - return iEd_stun_server; -} - -void TSymbian_ua_guiSettingItemListSettings::SetEd_stun_server (const TDesC& aValue) -{ - if (aValue.Length() < KEd_stun_serverMaxLength) - iEd_stun_server.Copy (aValue); - else - iEd_stun_server.Copy (aValue.Ptr(), KEd_stun_serverMaxLength); -} + { + return iEd_stun_server; + } + +void TSymbian_ua_guiSettingItemListSettings::SetEd_stun_server(const TDesC& aValue) + { + if ( aValue.Length() < KEd_stun_serverMaxLength) + iEd_stun_server.Copy( aValue ); + else + iEd_stun_server.Copy( aValue.Ptr(), KEd_stun_serverMaxLength); + } // ]]] end generated region [Generated Contents] diff --git a/sflphone-common/libs/pjproject/pjsip-apps/src/symbian_ua_gui/src/symbian_ua.cpp b/sflphone-common/libs/pjproject/pjsip-apps/src/symbian_ua_gui/src/symbian_ua.cpp index 1e56a4f9fe5f534dd8c26789f89c068b324c340b..f722336a1b900a640f9aecab638b82c5b60f10cc 100644 --- a/sflphone-common/libs/pjproject/pjsip-apps/src/symbian_ua_gui/src/symbian_ua.cpp +++ b/sflphone-common/libs/pjproject/pjsip-apps/src/symbian_ua_gui/src/symbian_ua.cpp @@ -1,5 +1,5 @@ /* $Id: ua.cpp 1793 2008-02-14 13:39:24Z bennylp $ */ -/* +/* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> * @@ -15,7 +15,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include <pjsua-lib/pjsua.h> #include <pjsua-lib/pjsua_internal.h> @@ -38,230 +38,222 @@ static pjsua_buddy_id g_buddy_id = PJSUA_INVALID_ID; static symbian_ua_info_cb_t g_cb = {NULL, NULL, NULL, NULL, NULL}; -static void log_writer (int level, const char *buf, int len) +static void log_writer(int level, const char *buf, int len) { static wchar_t buf16[PJ_LOG_MAX_SIZE]; - PJ_UNUSED_ARG (level); - + PJ_UNUSED_ARG(level); + if (!g_cb.on_info) - return; - - pj_ansi_to_unicode (buf, len, buf16, PJ_ARRAY_SIZE (buf16)); + return; - g_cb.on_info (buf16); + pj_ansi_to_unicode(buf, len, buf16, PJ_ARRAY_SIZE(buf16)); + g_cb.on_info(buf16); } -static void on_reg_state (pjsua_acc_id acc_id) +static void on_reg_state(pjsua_acc_id acc_id) { pjsua_acc_info acc_info; pj_status_t status; - status = pjsua_acc_get_info (acc_id, &acc_info); - + status = pjsua_acc_get_info(acc_id, &acc_info); if (status != PJ_SUCCESS) - return; + return; if (acc_info.status == 200) { - if (acc_info.expires) { - PJ_LOG (3, (THIS_FILE, "Registration success!")); - - if (g_cb.on_reg_state) g_cb.on_reg_state (true); - } else { - PJ_LOG (3, (THIS_FILE, "Unregistration success!")); - - if (g_cb.on_unreg_state) g_cb.on_unreg_state (true); - } + if (acc_info.expires) { + PJ_LOG(3,(THIS_FILE, "Registration success!")); + if (g_cb.on_reg_state) g_cb.on_reg_state(true); + } else { + PJ_LOG(3,(THIS_FILE, "Unregistration success!")); + if (g_cb.on_unreg_state) g_cb.on_unreg_state(true); + } } else { - if (acc_info.expires) { - PJ_LOG (3, (THIS_FILE, "Registration failed!")); - - if (g_cb.on_reg_state) g_cb.on_reg_state (false); - } else { - PJ_LOG (3, (THIS_FILE, "Unregistration failed!")); - - if (g_cb.on_unreg_state) g_cb.on_unreg_state (false); - } + if (acc_info.expires) { + PJ_LOG(3,(THIS_FILE, "Registration failed!")); + if (g_cb.on_reg_state) g_cb.on_reg_state(false); + } else { + PJ_LOG(3,(THIS_FILE, "Unregistration failed!")); + if (g_cb.on_unreg_state) g_cb.on_unreg_state(false); + } } } /* Callback called by the library upon receiving incoming call */ -static void on_incoming_call (pjsua_acc_id acc_id, pjsua_call_id call_id, - pjsip_rx_data *rdata) +static void on_incoming_call(pjsua_acc_id acc_id, pjsua_call_id call_id, + pjsip_rx_data *rdata) { pjsua_call_info ci; - PJ_UNUSED_ARG (acc_id); - PJ_UNUSED_ARG (rdata); + PJ_UNUSED_ARG(acc_id); + PJ_UNUSED_ARG(rdata); if (g_call_id != PJSUA_INVALID_ID) { - pjsua_call_answer (call_id, PJSIP_SC_BUSY_HERE, NULL, NULL); - return; + pjsua_call_answer(call_id, PJSIP_SC_BUSY_HERE, NULL, NULL); + return; } + + pjsua_call_get_info(call_id, &ci); - pjsua_call_get_info (call_id, &ci); - - PJ_LOG (3, (THIS_FILE, "Incoming call from %.*s!!", - (int) ci.remote_info.slen, - ci.remote_info.ptr)); + PJ_LOG(3,(THIS_FILE, "Incoming call from %.*s!!", + (int)ci.remote_info.slen, + ci.remote_info.ptr)); g_call_id = call_id; - + /* Automatically answer incoming calls with 180/Ringing */ - pjsua_call_answer (call_id, 180, NULL, NULL); + pjsua_call_answer(call_id, 180, NULL, NULL); if (g_cb.on_incoming_call) { - static wchar_t disp[256]; - static wchar_t uri[PJSIP_MAX_URL_SIZE]; + static wchar_t disp[256]; + static wchar_t uri[PJSIP_MAX_URL_SIZE]; - pj_ansi_to_unicode (ci.remote_info.ptr, ci.remote_info.slen, - disp, PJ_ARRAY_SIZE (disp)); - pj_ansi_to_unicode (ci.remote_contact.ptr, ci.remote_contact.slen, - uri, PJ_ARRAY_SIZE (uri)); + pj_ansi_to_unicode(ci.remote_info.ptr, ci.remote_info.slen, + disp, PJ_ARRAY_SIZE(disp)); + pj_ansi_to_unicode(ci.remote_contact.ptr, ci.remote_contact.slen, + uri, PJ_ARRAY_SIZE(uri)); - g_cb.on_incoming_call (disp, uri); + g_cb.on_incoming_call(disp, uri); } } /* Callback called by the library when call's state has changed */ -static void on_call_state (pjsua_call_id call_id, pjsip_event *e) +static void on_call_state(pjsua_call_id call_id, pjsip_event *e) { pjsua_call_info ci; - PJ_UNUSED_ARG (e); - - pjsua_call_get_info (call_id, &ci); + PJ_UNUSED_ARG(e); + pjsua_call_get_info(call_id, &ci); + if (ci.state == PJSIP_INV_STATE_DISCONNECTED) { - if (call_id == g_call_id) - g_call_id = PJSUA_INVALID_ID; - - if (g_cb.on_call_end) { - static wchar_t reason[256]; - pj_ansi_to_unicode (ci.last_status_text.ptr, ci.last_status_text.slen, - reason, PJ_ARRAY_SIZE (reason)); - g_cb.on_call_end (reason); - } + if (call_id == g_call_id) + g_call_id = PJSUA_INVALID_ID; + if (g_cb.on_call_end) { + static wchar_t reason[256]; + pj_ansi_to_unicode(ci.last_status_text.ptr, ci.last_status_text.slen, + reason, PJ_ARRAY_SIZE(reason)); + g_cb.on_call_end(reason); + } } else if (ci.state != PJSIP_INV_STATE_INCOMING) { - if (g_call_id == PJSUA_INVALID_ID) - g_call_id = call_id; + if (g_call_id == PJSUA_INVALID_ID) + g_call_id = call_id; } - - PJ_LOG (3, (THIS_FILE, "Call %d state=%.*s", call_id, - - (int) ci.state_text.slen, - ci.state_text.ptr)); + + PJ_LOG(3,(THIS_FILE, "Call %d state=%.*s", call_id, + (int)ci.state_text.slen, + ci.state_text.ptr)); } /* Callback called by the library when call's media state has changed */ -static void on_call_media_state (pjsua_call_id call_id) +static void on_call_media_state(pjsua_call_id call_id) { pjsua_call_info ci; - pjsua_call_get_info (call_id, &ci); + pjsua_call_get_info(call_id, &ci); if (ci.media_status == PJSUA_CALL_MEDIA_ACTIVE) { - // When media is active, connect call to sound device. - pjsua_conf_connect (ci.conf_slot, 0); - pjsua_conf_connect (0, ci.conf_slot); + // When media is active, connect call to sound device. + pjsua_conf_connect(ci.conf_slot, 0); + pjsua_conf_connect(0, ci.conf_slot); } } /* Handler on buddy state changed. */ -static void on_buddy_state (pjsua_buddy_id buddy_id) +static void on_buddy_state(pjsua_buddy_id buddy_id) { pjsua_buddy_info info; - pjsua_buddy_get_info (buddy_id, &info); + pjsua_buddy_get_info(buddy_id, &info); - PJ_LOG (3, (THIS_FILE, "%.*s status is %.*s", - (int) info.uri.slen, - info.uri.ptr, - (int) info.status_text.slen, - info.status_text.ptr)); + PJ_LOG(3,(THIS_FILE, "%.*s status is %.*s", + (int)info.uri.slen, + info.uri.ptr, + (int)info.status_text.slen, + info.status_text.ptr)); } /* Incoming IM message (i.e. MESSAGE request)! */ -static void on_pager (pjsua_call_id call_id, const pj_str_t *from, - const pj_str_t *to, const pj_str_t *contact, - const pj_str_t *mime_type, const pj_str_t *text) +static void on_pager(pjsua_call_id call_id, const pj_str_t *from, + const pj_str_t *to, const pj_str_t *contact, + const pj_str_t *mime_type, const pj_str_t *text) { /* Note: call index may be -1 */ - PJ_UNUSED_ARG (call_id); - PJ_UNUSED_ARG (to); - PJ_UNUSED_ARG (contact); - PJ_UNUSED_ARG (mime_type); - - PJ_LOG (3, (THIS_FILE,"MESSAGE from %.*s: %.*s", - (int) from->slen, from->ptr, - (int) text->slen, text->ptr)); + PJ_UNUSED_ARG(call_id); + PJ_UNUSED_ARG(to); + PJ_UNUSED_ARG(contact); + PJ_UNUSED_ARG(mime_type); + + PJ_LOG(3,(THIS_FILE,"MESSAGE from %.*s: %.*s", + (int)from->slen, from->ptr, + (int)text->slen, text->ptr)); } /* Received typing indication */ -static void on_typing (pjsua_call_id call_id, const pj_str_t *from, - const pj_str_t *to, const pj_str_t *contact, - pj_bool_t is_typing) +static void on_typing(pjsua_call_id call_id, const pj_str_t *from, + const pj_str_t *to, const pj_str_t *contact, + pj_bool_t is_typing) { - PJ_UNUSED_ARG (call_id); - PJ_UNUSED_ARG (to); - PJ_UNUSED_ARG (contact); + PJ_UNUSED_ARG(call_id); + PJ_UNUSED_ARG(to); + PJ_UNUSED_ARG(contact); - PJ_LOG (3, (THIS_FILE, "IM indication: %.*s %s", - (int) from->slen, from->ptr, - (is_typing?"is typing..":"has stopped typing"))); + PJ_LOG(3,(THIS_FILE, "IM indication: %.*s %s", + (int)from->slen, from->ptr, + (is_typing?"is typing..":"has stopped typing"))); } /* Call transfer request status. */ -static void on_call_transfer_status (pjsua_call_id call_id, - int status_code, - const pj_str_t *status_text, - pj_bool_t final, - pj_bool_t *p_cont) +static void on_call_transfer_status(pjsua_call_id call_id, + int status_code, + const pj_str_t *status_text, + pj_bool_t final, + pj_bool_t *p_cont) { - PJ_LOG (3, (THIS_FILE, "Call %d: transfer status=%d (%.*s) %s", - call_id, status_code, - (int) status_text->slen, status_text->ptr, - (final ? "[final]" : ""))); + PJ_LOG(3,(THIS_FILE, "Call %d: transfer status=%d (%.*s) %s", + call_id, status_code, + (int)status_text->slen, status_text->ptr, + (final ? "[final]" : ""))); if (status_code/100 == 2) { - PJ_LOG (3, (THIS_FILE, - "Call %d: call transfered successfully, disconnecting call", - call_id)); - pjsua_call_hangup (call_id, PJSIP_SC_GONE, NULL, NULL); - *p_cont = PJ_FALSE; + PJ_LOG(3,(THIS_FILE, + "Call %d: call transfered successfully, disconnecting call", + call_id)); + pjsua_call_hangup(call_id, PJSIP_SC_GONE, NULL, NULL); + *p_cont = PJ_FALSE; } } /* NAT detection result */ -static void on_nat_detect (const pj_stun_nat_detect_result *res) +static void on_nat_detect(const pj_stun_nat_detect_result *res) { if (res->status != PJ_SUCCESS) { - pjsua_perror (THIS_FILE, "NAT detection failed", res->status); + pjsua_perror(THIS_FILE, "NAT detection failed", res->status); } else { - PJ_LOG (3, (THIS_FILE, "NAT detected as %s", res->nat_type_name)); - } + PJ_LOG(3, (THIS_FILE, "NAT detected as %s", res->nat_type_name)); + } } /* Notification that call is being replaced. */ -static void on_call_replaced (pjsua_call_id old_call_id, - pjsua_call_id new_call_id) +static void on_call_replaced(pjsua_call_id old_call_id, + pjsua_call_id new_call_id) { pjsua_call_info old_ci, new_ci; - pjsua_call_get_info (old_call_id, &old_ci); - pjsua_call_get_info (new_call_id, &new_ci); + pjsua_call_get_info(old_call_id, &old_ci); + pjsua_call_get_info(new_call_id, &new_ci); - PJ_LOG (3, (THIS_FILE, "Call %d with %.*s is being replaced by " - "call %d with %.*s", - old_call_id, - (int) old_ci.remote_info.slen, old_ci.remote_info.ptr, - new_call_id, - (int) new_ci.remote_info.slen, new_ci.remote_info.ptr)); + PJ_LOG(3,(THIS_FILE, "Call %d with %.*s is being replaced by " + "call %d with %.*s", + old_call_id, + (int)old_ci.remote_info.slen, old_ci.remote_info.ptr, + new_call_id, + (int)new_ci.remote_info.slen, new_ci.remote_info.ptr)); } int symbian_ua_init() @@ -269,167 +261,132 @@ int symbian_ua_init() TInt err; pj_symbianos_params sym_params; pj_status_t status; - + // Initialize RSocketServ - - if ( (err=aSocketServer.Connect()) != KErrNone) - return PJ_STATUS_FROM_OS (err); - + if ((err=aSocketServer.Connect()) != KErrNone) + return PJ_STATUS_FROM_OS(err); + // Open up a connection - if ( (err=aConn.Open (aSocketServer)) != KErrNone) { - aSocketServer.Close(); - return PJ_STATUS_FROM_OS (err); + if ((err=aConn.Open(aSocketServer)) != KErrNone) { + aSocketServer.Close(); + return PJ_STATUS_FROM_OS(err); } - - if ( (err=aConn.Start()) != KErrNone) { - aConn.Close(); - aSocketServer.Close(); - return PJ_STATUS_FROM_OS (err); + + if ((err=aConn.Start()) != KErrNone) { + aConn.Close(); + aSocketServer.Close(); + return PJ_STATUS_FROM_OS(err); } - + // Set Symbian OS parameters in pjlib. // This must be done before pj_init() is called. - pj_bzero (&sym_params, sizeof (sym_params)); - + pj_bzero(&sym_params, sizeof(sym_params)); sym_params.rsocketserv = &aSocketServer; - sym_params.rconnection = &aConn; - - pj_symbianos_set_params (&sym_params); + pj_symbianos_set_params(&sym_params); /* Redirect log before pjsua_init() */ - pj_log_set_log_func (&log_writer); - + pj_log_set_log_func(&log_writer); + /* Set log level */ - pj_log_set_level (LOG_LEVEL); + pj_log_set_level(LOG_LEVEL); /* Create pjsua first! */ status = pjsua_create(); - if (status != PJ_SUCCESS) { - pjsua_perror (THIS_FILE, "pjsua_create() error", status); - return status; + pjsua_perror(THIS_FILE, "pjsua_create() error", status); + return status; } /* Init pjsua */ pjsua_config cfg; - pjsua_config_default (&cfg); - + pjsua_config_default(&cfg); cfg.max_calls = 2; - cfg.thread_cnt = 0; // Disable threading on Symbian - cfg.use_srtp = USE_SRTP; - cfg.srtp_secure_signaling = 0; cfg.cb.on_incoming_call = &on_incoming_call; - cfg.cb.on_call_media_state = &on_call_media_state; - cfg.cb.on_call_state = &on_call_state; - cfg.cb.on_buddy_state = &on_buddy_state; - cfg.cb.on_pager = &on_pager; - cfg.cb.on_typing = &on_typing; - cfg.cb.on_call_transfer_status = &on_call_transfer_status; - cfg.cb.on_call_replaced = &on_call_replaced; - cfg.cb.on_nat_detect = &on_nat_detect; - cfg.cb.on_reg_state = &on_reg_state; pjsua_media_config med_cfg; - pjsua_media_config_default (&med_cfg); - + pjsua_media_config_default(&med_cfg); med_cfg.thread_cnt = 0; // Disable threading on Symbian - med_cfg.has_ioqueue = PJ_FALSE; - med_cfg.clock_rate = 8000; - #if defined(PJMEDIA_SYM_SND_USE_APS) && (PJMEDIA_SYM_SND_USE_APS==1) med_cfg.audio_frame_ptime = 20; - #else med_cfg.audio_frame_ptime = 40; - #endif med_cfg.ec_tail_len = 0; - med_cfg.enable_ice = USE_ICE; - med_cfg.snd_auto_close_time = 5; // wait for 5 seconds idle before sound dev get auto-closed pjsua_logging_config log_cfg; - pjsua_logging_config_default (&log_cfg); - + pjsua_logging_config_default(&log_cfg); log_cfg.console_level = LOG_LEVEL; - log_cfg.cb = &log_writer; - log_cfg.decor = 0; - status = pjsua_init (&cfg, &log_cfg, &med_cfg); - + status = pjsua_init(&cfg, &log_cfg, &med_cfg); if (status != PJ_SUCCESS) { - pjsua_perror (THIS_FILE, "pjsua_init() error", status); - pjsua_destroy(); - return status; + pjsua_perror(THIS_FILE, "pjsua_init() error", status); + pjsua_destroy(); + return status; } /* Add UDP transport. */ pjsua_transport_config tcfg; - pjsua_transport_id tid; - pjsua_transport_config_default (&tcfg); - + pjsua_transport_config_default(&tcfg); tcfg.port = SIP_PORT; - - status = pjsua_transport_create (PJSIP_TRANSPORT_UDP, &tcfg, &tid); - + status = pjsua_transport_create(PJSIP_TRANSPORT_UDP, &tcfg, &tid); if (status != PJ_SUCCESS) { - pjsua_perror (THIS_FILE, "Error creating transport", status); - pjsua_destroy(); - return status; + pjsua_perror(THIS_FILE, "Error creating transport", status); + pjsua_destroy(); + return status; } /* Add account for the transport */ - pjsua_acc_add_local (tid, PJ_TRUE, &g_acc_id); + pjsua_acc_add_local(tid, PJ_TRUE, &g_acc_id); /* Initialization is done, now start pjsua */ status = pjsua_start(); - if (status != PJ_SUCCESS) { - pjsua_perror (THIS_FILE, "Error starting pjsua", status); - pjsua_destroy(); - return status; + pjsua_perror(THIS_FILE, "Error starting pjsua", status); + pjsua_destroy(); + return status; } /* Adjust Speex priority and enable only the narrowband */ { - pj_str_t codec_id = pj_str ("speex/8000"); - pjmedia_codec_mgr_set_codec_priority ( - pjmedia_endpt_get_codec_mgr (pjsua_var.med_endpt), - &codec_id, PJMEDIA_CODEC_PRIO_NORMAL+1); - - codec_id = pj_str ("speex/16000"); - pjmedia_codec_mgr_set_codec_priority ( - pjmedia_endpt_get_codec_mgr (pjsua_var.med_endpt), - &codec_id, PJMEDIA_CODEC_PRIO_DISABLED); - - codec_id = pj_str ("speex/32000"); - pjmedia_codec_mgr_set_codec_priority ( - pjmedia_endpt_get_codec_mgr (pjsua_var.med_endpt), - &codec_id, PJMEDIA_CODEC_PRIO_DISABLED); + pj_str_t codec_id = pj_str("speex/8000"); + pjmedia_codec_mgr_set_codec_priority( + pjmedia_endpt_get_codec_mgr(pjsua_var.med_endpt), + &codec_id, PJMEDIA_CODEC_PRIO_NORMAL+1); + + codec_id = pj_str("speex/16000"); + pjmedia_codec_mgr_set_codec_priority( + pjmedia_endpt_get_codec_mgr(pjsua_var.med_endpt), + &codec_id, PJMEDIA_CODEC_PRIO_DISABLED); + + codec_id = pj_str("speex/32000"); + pjmedia_codec_mgr_set_codec_priority( + pjmedia_endpt_get_codec_mgr(pjsua_var.med_endpt), + &codec_id, PJMEDIA_CODEC_PRIO_DISABLED); } return PJ_SUCCESS; @@ -440,104 +397,97 @@ int symbian_ua_destroy() { // Shutdown pjsua pjsua_destroy(); - + // Close connection and socket server aConn.Close(); aSocketServer.Close(); - + CloseSTDLIB(); return PJ_SUCCESS; } -void symbian_ua_set_info_callback (const symbian_ua_info_cb_t *cb) +void symbian_ua_set_info_callback(const symbian_ua_info_cb_t *cb) { if (cb) - g_cb = *cb; + g_cb = *cb; else - pj_bzero (&g_cb, sizeof (g_cb)); + pj_bzero(&g_cb, sizeof(g_cb)); } -int symbian_ua_set_account (const char *domain, const char *username, - const char *password, - bool use_srtp, bool use_ice) +int symbian_ua_set_account(const char *domain, const char *username, + const char *password, + bool use_srtp, bool use_ice) { pj_status_t status; - PJ_ASSERT_RETURN (username && password && domain, PJ_EINVAL); - PJ_UNUSED_ARG (use_srtp); - PJ_UNUSED_ARG (use_ice); + PJ_ASSERT_RETURN(username && password && domain, PJ_EINVAL); + PJ_UNUSED_ARG(use_srtp); + PJ_UNUSED_ARG(use_ice); if (domain[0] == 0) { - pjsua_acc_info acc_info; - pj_status_t status; - - status = pjsua_acc_get_info (g_acc_id, &acc_info); - - if (status != PJ_SUCCESS) - return status; - - if (acc_info.status == 200) { - PJ_LOG (3, (THIS_FILE, "Unregistering..")); - pjsua_acc_set_registration (g_acc_id, PJ_FALSE); - g_acc_id = 0; - } - - return PJ_SUCCESS; + pjsua_acc_info acc_info; + pj_status_t status; + + status = pjsua_acc_get_info(g_acc_id, &acc_info); + if (status != PJ_SUCCESS) + return status; + + if (acc_info.status == 200) { + PJ_LOG(3,(THIS_FILE, "Unregistering..")); + pjsua_acc_set_registration(g_acc_id, PJ_FALSE); + g_acc_id = 0; + } + return PJ_SUCCESS; } if (pjsua_acc_get_count() > 1) { - status = pjsua_acc_del (g_acc_id); - - if (status != PJ_SUCCESS) { - pjsua_perror (THIS_FILE, "Error removing account", status); - return status; - } - - g_acc_id = 0; + status = pjsua_acc_del(g_acc_id); + if (status != PJ_SUCCESS) { + pjsua_perror(THIS_FILE, "Error removing account", status); + return status; + } + g_acc_id = 0; } pjsua_acc_config cfg; - char tmp_id[PJSIP_MAX_URL_SIZE]; char tmp_reg_uri[PJSIP_MAX_URL_SIZE]; - if (!pj_ansi_strnicmp (domain, "sip:", 4)) { - domain += 4; + if (!pj_ansi_strnicmp(domain, "sip:", 4)) { + domain += 4; } - pjsua_acc_config_default (&cfg); - - pj_ansi_sprintf (tmp_id, "sip:%s@%s", username, domain); - cfg.id = pj_str (tmp_id); - pj_ansi_sprintf (tmp_reg_uri, "sip:%s", domain); - cfg.reg_uri = pj_str (tmp_reg_uri); + pjsua_acc_config_default(&cfg); + pj_ansi_sprintf(tmp_id, "sip:%s@%s", username, domain); + cfg.id = pj_str(tmp_id); + pj_ansi_sprintf(tmp_reg_uri, "sip:%s", domain); + cfg.reg_uri = pj_str(tmp_reg_uri); cfg.cred_count = 1; - cfg.cred_info[0].realm = pj_str ("*"); - cfg.cred_info[0].scheme = pj_str ("digest"); - cfg.cred_info[0].username = pj_str ( (char*) username); + cfg.cred_info[0].realm = pj_str("*"); + cfg.cred_info[0].scheme = pj_str("digest"); + cfg.cred_info[0].username = pj_str((char*)username); cfg.cred_info[0].data_type = PJSIP_CRED_DATA_PLAIN_PASSWD; - cfg.cred_info[0].data = pj_str ( (char*) password); - - status = pjsua_acc_add (&cfg, PJ_TRUE, &g_acc_id); + cfg.cred_info[0].data = pj_str((char*)password); + status = pjsua_acc_add(&cfg, PJ_TRUE, &g_acc_id); if (status != PJ_SUCCESS) { - pjsua_perror (THIS_FILE, "Error setting account", status); - pjsua_destroy(); - return status; + pjsua_perror(THIS_FILE, "Error setting account", status); + pjsua_destroy(); + return status; } return PJ_SUCCESS; } -int symbian_ua_makecall (const char* dest_url) +int symbian_ua_makecall(const char* dest_url) { - if (pjsua_verify_sip_url (dest_url) == PJ_SUCCESS) { - pj_str_t dst = pj_str ( (char*) dest_url); - pjsua_call_make_call (g_acc_id, &dst, 0, NULL, - NULL, &g_call_id); + if (pjsua_verify_sip_url(dest_url) == PJ_SUCCESS) { + pj_str_t dst = pj_str((char*)dest_url); + pjsua_call_make_call(g_acc_id, &dst, 0, NULL, + NULL, &g_call_id); - return PJ_SUCCESS; + return PJ_SUCCESS; } return PJ_EINVAL; @@ -552,13 +502,13 @@ int symbian_ua_endcall() bool symbian_ua_anycall() { - return (pjsua_call_get_count() >0); + return (pjsua_call_get_count()>0); } int symbian_ua_answercall() { PJ_ASSERT_RETURN (g_call_id != PJSUA_INVALID_ID, PJ_EINVAL); - return pjsua_call_answer (g_call_id, 200, NULL, NULL); + return pjsua_call_answer(g_call_id, 200, NULL, NULL); } diff --git a/sflphone-common/libs/pjproject/pjsip-apps/src/symbian_ua_gui/src/symbian_ua_guiAppUi.cpp b/sflphone-common/libs/pjproject/pjsip-apps/src/symbian_ua_gui/src/symbian_ua_guiAppUi.cpp index ab66bb27805fcce63c3a2a661ffca137f37d260c..ac399510b2bb98b03fe0b34dbf21a021b4be41ec 100644 --- a/sflphone-common/libs/pjproject/pjsip-apps/src/symbian_ua_gui/src/symbian_ua_guiAppUi.cpp +++ b/sflphone-common/libs/pjproject/pjsip-apps/src/symbian_ua_gui/src/symbian_ua_guiAppUi.cpp @@ -3,7 +3,7 @@ Name : symbian_ua_guiAppUi.cpp Author : nanang Copyright : (c) 2008-2009 Teluu Inc. - Description : + Description : ======================================================================== */ // [[[ begin generated region: do not modify [Generated System Includes] @@ -29,168 +29,167 @@ /** * Construct the Csymbian_ua_guiAppUi instance - */ -Csymbian_ua_guiAppUi::Csymbian_ua_guiAppUi() : CTimer (0) -{ - // [[[ begin generated region: do not modify [Generated Contents] - // ]]] end generated region [Generated Contents] + */ +Csymbian_ua_guiAppUi::Csymbian_ua_guiAppUi() : CTimer(0) + { + // [[[ begin generated region: do not modify [Generated Contents] + // ]]] end generated region [Generated Contents] -} + } -/** +/** * The appui's destructor removes the container from the control * stack and destroys it. */ Csymbian_ua_guiAppUi::~Csymbian_ua_guiAppUi() -{ - // [[[ begin generated region: do not modify [Generated Contents] - TRAPD (err_Dlg_wait_init, RemoveDlg_wait_initL()); - // ]]] end generated region [Generated Contents] -} + { + // [[[ begin generated region: do not modify [Generated Contents] + TRAPD( err_Dlg_wait_init, RemoveDlg_wait_initL() ); + // ]]] end generated region [Generated Contents] + } // [[[ begin generated function: do not modify void Csymbian_ua_guiAppUi::InitializeContainersL() -{ - iSymbian_ua_guiContainerView = Csymbian_ua_guiContainerView::NewL(); - AddViewL (iSymbian_ua_guiContainerView); - iSymbian_ua_guiSettingItemListView = Csymbian_ua_guiSettingItemListView::NewL(); - AddViewL (iSymbian_ua_guiSettingItemListView); - SetDefaultViewL (*iSymbian_ua_guiSettingItemListView); -} - + { + iSymbian_ua_guiContainerView = Csymbian_ua_guiContainerView::NewL(); + AddViewL( iSymbian_ua_guiContainerView ); + iSymbian_ua_guiSettingItemListView = Csymbian_ua_guiSettingItemListView::NewL(); + AddViewL( iSymbian_ua_guiSettingItemListView ); + SetDefaultViewL( *iSymbian_ua_guiSettingItemListView ); + } // ]]] end generated function /** * Handle a command for this appui (override) * @param aCommand command id to be handled */ -void Csymbian_ua_guiAppUi::HandleCommandL (TInt aCommand) -{ - // [[[ begin generated region: do not modify [Generated Code] - TBool commandHandled = EFalse; - - switch (aCommand) { // code to dispatch to the AppUi's menu and CBA commands is generated here - - default: - break; - } - - - if (!commandHandled) { - if (aCommand == EAknSoftkeyExit || aCommand == EEikCmdExit) { - symbian_ua_destroy(); - Exit(); - } - } - - // ]]] end generated region [Generated Code] - -} - -/** +void Csymbian_ua_guiAppUi::HandleCommandL( TInt aCommand ) + { + // [[[ begin generated region: do not modify [Generated Code] + TBool commandHandled = EFalse; + switch ( aCommand ) + { // code to dispatch to the AppUi's menu and CBA commands is generated here + default: + break; + } + + + if ( !commandHandled ) + { + if ( aCommand == EAknSoftkeyExit || aCommand == EEikCmdExit ) + { + symbian_ua_destroy(); + Exit(); + } + } + // ]]] end generated region [Generated Code] + + } + +/** * Override of the HandleResourceChangeL virtual function */ -void Csymbian_ua_guiAppUi::HandleResourceChangeL (TInt aType) -{ - CAknViewAppUi::HandleResourceChangeL (aType); - // [[[ begin generated region: do not modify [Generated Code] - // ]]] end generated region [Generated Code] - -} - -/** +void Csymbian_ua_guiAppUi::HandleResourceChangeL( TInt aType ) + { + CAknViewAppUi::HandleResourceChangeL( aType ); + // [[[ begin generated region: do not modify [Generated Code] + // ]]] end generated region [Generated Code] + + } + +/** * Override of the HandleKeyEventL virtual function * @return EKeyWasConsumed if event was handled, EKeyWasNotConsumed if not - * @param aKeyEvent - * @param aType + * @param aKeyEvent + * @param aType */ -TKeyResponse Csymbian_ua_guiAppUi::HandleKeyEventL ( - const TKeyEvent& aKeyEvent, - TEventCode aType) -{ - // The inherited HandleKeyEventL is private and cannot be called - // [[[ begin generated region: do not modify [Generated Contents] - // ]]] end generated region [Generated Contents] - - return EKeyWasNotConsumed; -} - -/** +TKeyResponse Csymbian_ua_guiAppUi::HandleKeyEventL( + const TKeyEvent& aKeyEvent, + TEventCode aType ) + { + // The inherited HandleKeyEventL is private and cannot be called + // [[[ begin generated region: do not modify [Generated Contents] + // ]]] end generated region [Generated Contents] + + return EKeyWasNotConsumed; + } + +/** * Override of the HandleViewDeactivation virtual function * - * @param aViewIdToBeDeactivated - * @param aNewlyActivatedViewId + * @param aViewIdToBeDeactivated + * @param aNewlyActivatedViewId */ -void Csymbian_ua_guiAppUi::HandleViewDeactivation ( - const TVwsViewId& aViewIdToBeDeactivated, - const TVwsViewId& aNewlyActivatedViewId) -{ - CAknViewAppUi::HandleViewDeactivation ( - aViewIdToBeDeactivated, - aNewlyActivatedViewId); - // [[[ begin generated region: do not modify [Generated Contents] - // ]]] end generated region [Generated Contents] - -} +void Csymbian_ua_guiAppUi::HandleViewDeactivation( + const TVwsViewId& aViewIdToBeDeactivated, + const TVwsViewId& aNewlyActivatedViewId ) + { + CAknViewAppUi::HandleViewDeactivation( + aViewIdToBeDeactivated, + aNewlyActivatedViewId ); + // [[[ begin generated region: do not modify [Generated Contents] + // ]]] end generated region [Generated Contents] + + } /** - * @brief Completes the second phase of Symbian object construction. - * Put initialization code that could leave here. - */ + * @brief Completes the second phase of Symbian object construction. + * Put initialization code that could leave here. + */ void Csymbian_ua_guiAppUi::ConstructL() -{ - // [[[ begin generated region: do not modify [Generated Contents] - BaseConstructL (EAknEnableSkin); - InitializeContainersL(); - // ]]] end generated region [Generated Contents] - - // Create private folder - RProcess process; - TFileName path; - - path.Copy (process.FileName().Left (2)); - - if (path.Compare (_L ("c")) || path.Compare (_L ("C"))) - CEikonEnv::Static()->FsSession().CreatePrivatePath (EDriveC); - else if (path.Compare (_L ("e")) || path.Compare (_L ("E"))) - CEikonEnv::Static()->FsSession().CreatePrivatePath (EDriveE); - - // Init PJSUA - if (symbian_ua_init() != 0) { - symbian_ua_destroy(); - Exit(); - } - - ExecuteDlg_wait_initLD(); - - CTimer::ConstructL(); - CActiveScheduler::Add (this); - After (4000000); -} - -/** + { + // [[[ begin generated region: do not modify [Generated Contents] + BaseConstructL( EAknEnableSkin ); + InitializeContainersL(); + // ]]] end generated region [Generated Contents] + + // Create private folder + RProcess process; + TFileName path; + + path.Copy( process.FileName().Left(2) ); + + if(path.Compare(_L("c")) || path.Compare(_L("C"))) + CEikonEnv::Static()->FsSession().CreatePrivatePath(EDriveC); + else if(path.Compare(_L("e")) || path.Compare(_L("E"))) + CEikonEnv::Static()->FsSession().CreatePrivatePath(EDriveE); + + // Init PJSUA + if (symbian_ua_init() != 0) { + symbian_ua_destroy(); + Exit(); + } + + ExecuteDlg_wait_initLD(); + + CTimer::ConstructL(); + CActiveScheduler::Add( this ); + After(4000000); + } + +/** * Override of the HandleApplicationSpecificEventL virtual function */ -void Csymbian_ua_guiAppUi::HandleApplicationSpecificEventL ( - TInt aType, - const TWsEvent& anEvent) -{ - CAknViewAppUi::HandleApplicationSpecificEventL (aType, anEvent); - // [[[ begin generated region: do not modify [Generated Code] - // ]]] end generated region [Generated Code] - -} - -/** +void Csymbian_ua_guiAppUi::HandleApplicationSpecificEventL( + TInt aType, + const TWsEvent& anEvent ) + { + CAknViewAppUi::HandleApplicationSpecificEventL( aType, anEvent ); + // [[[ begin generated region: do not modify [Generated Code] + // ]]] end generated region [Generated Code] + + } + +/** * Handle the applicationSpecificEvent event. */ -void Csymbian_ua_guiAppUi::HandleSymbian_ua_guiAppUiApplicationSpecificEventL ( - TInt /* aType */, - const TWsEvent& /* anEvent */) -{ - // TODO: implement applicationSpecificEvent event handler -} - +void Csymbian_ua_guiAppUi::HandleSymbian_ua_guiAppUiApplicationSpecificEventL( + TInt /* aType */, + const TWsEvent& /* anEvent */ ) + { + // TODO: implement applicationSpecificEvent event handler + } + // [[[ begin generated function: do not modify /** * Execute the wait dialog for dlg_wait_init. This routine returns @@ -199,22 +198,19 @@ void Csymbian_ua_guiAppUi::HandleSymbian_ua_guiAppUiApplicationSpecificEventL ( * @param aOverrideText optional override text. When null the text configured * in the UI Designer is used. */ -void Csymbian_ua_guiAppUi::ExecuteDlg_wait_initLD (const TDesC* aOverrideText) -{ - iDlg_wait_init = new (ELeave) CAknWaitDialog ( - reinterpret_cast< CEikDialog** > (&iDlg_wait_init), EFalse); - - if (aOverrideText != NULL) { - iDlg_wait_init->SetTextL (*aOverrideText); - } - - iDlg_wait_init->ExecuteLD (R_APPLICATION_DLG_WAIT_INIT); - - iDlg_wait_initCallback = new (ELeave) CProgressDialogCallback ( - this, iDlg_wait_init, &Csymbian_ua_guiAppUi::HandleDlg_wait_initCanceledL); - iDlg_wait_init->SetCallback (iDlg_wait_initCallback); -} - +void Csymbian_ua_guiAppUi::ExecuteDlg_wait_initLD( const TDesC* aOverrideText ) + { + iDlg_wait_init = new ( ELeave ) CAknWaitDialog( + reinterpret_cast< CEikDialog** >( &iDlg_wait_init ), EFalse ); + if ( aOverrideText != NULL ) + { + iDlg_wait_init->SetTextL( *aOverrideText ); + } + iDlg_wait_init->ExecuteLD( R_APPLICATION_DLG_WAIT_INIT ); + iDlg_wait_initCallback = new ( ELeave ) CProgressDialogCallback( + this, iDlg_wait_init, &Csymbian_ua_guiAppUi::HandleDlg_wait_initCanceledL ); + iDlg_wait_init->SetCallback( iDlg_wait_initCallback ); + } // ]]] end generated function // [[[ begin generated function: do not modify @@ -222,32 +218,30 @@ void Csymbian_ua_guiAppUi::ExecuteDlg_wait_initLD (const TDesC* aOverrideText) * Close and dispose of the wait dialog for dlg_wait_init */ void Csymbian_ua_guiAppUi::RemoveDlg_wait_initL() -{ - if (iDlg_wait_init != NULL) { - iDlg_wait_init->SetCallback (NULL); - iDlg_wait_init->ProcessFinishedL(); // deletes the dialog - iDlg_wait_init = NULL; - } - - delete iDlg_wait_initCallback; - - iDlg_wait_initCallback = NULL; - -} - + { + if ( iDlg_wait_init != NULL ) + { + iDlg_wait_init->SetCallback( NULL ); + iDlg_wait_init->ProcessFinishedL(); // deletes the dialog + iDlg_wait_init = NULL; + } + delete iDlg_wait_initCallback; + iDlg_wait_initCallback = NULL; + + } // ]]] end generated function -/** +/** * Handle the canceled event. */ -void Csymbian_ua_guiAppUi::HandleDlg_wait_initCanceledL (CAknProgressDialog* /* aDialog */) -{ - // TODO: implement canceled event handler - -} - +void Csymbian_ua_guiAppUi::HandleDlg_wait_initCanceledL( CAknProgressDialog* /* aDialog */ ) + { + // TODO: implement canceled event handler + + } + void Csymbian_ua_guiAppUi::RunL() -{ - RemoveDlg_wait_initL(); - iSymbian_ua_guiSettingItemListView->HandleCommandL (EAknSoftkeySave); -} + { + RemoveDlg_wait_initL(); + iSymbian_ua_guiSettingItemListView->HandleCommandL(EAknSoftkeySave); + } diff --git a/sflphone-common/libs/pjproject/pjsip-apps/src/symbian_ua_gui/src/symbian_ua_guiApplication.cpp b/sflphone-common/libs/pjproject/pjsip-apps/src/symbian_ua_gui/src/symbian_ua_guiApplication.cpp index d32c672d6c7e08becc4bab7c0a2fe005a0d5948a..dc60fecd64d1cab99afdbb61aa15b9f49921935b 100644 --- a/sflphone-common/libs/pjproject/pjsip-apps/src/symbian_ua_gui/src/symbian_ua_guiApplication.cpp +++ b/sflphone-common/libs/pjproject/pjsip-apps/src/symbian_ua_gui/src/symbian_ua_guiApplication.cpp @@ -3,7 +3,7 @@ Name : symbian_ua_guiApplication.cpp Author : nanang Copyright : (c) 2008-2009 Teluu Inc. - Description : + Description : ======================================================================== */ // [[[ begin generated region: do not modify [Generated System Includes] @@ -19,50 +19,50 @@ // Needed by APS -TPtrC APP_UID = _L ("EBD12EE4"); +TPtrC APP_UID = _L("EBD12EE4"); /** * @brief Returns the application's UID (override from CApaApplication::AppDllUid()) * @return UID for this application (KUidsymbian_ua_guiApplication) */ TUid Csymbian_ua_guiApplication::AppDllUid() const -{ - return KUidsymbian_ua_guiApplication; -} + { + return KUidsymbian_ua_guiApplication; + } /** * @brief Creates the application's document (override from CApaApplication::CreateDocumentL()) * @return Pointer to the created document object (Csymbian_ua_guiDocument) */ CApaDocument* Csymbian_ua_guiApplication::CreateDocumentL() -{ - return Csymbian_ua_guiDocument::NewL (*this); -} + { + return Csymbian_ua_guiDocument::NewL( *this ); + } #ifdef EKA2 /** * @brief Called by the application framework to construct the application object * @return The application (Csymbian_ua_guiApplication) - */ + */ LOCAL_C CApaApplication* NewApplication() -{ - return new Csymbian_ua_guiApplication; -} + { + return new Csymbian_ua_guiApplication; + } /** * @brief This standard export is the entry point for all Series 60 applications * @return error code - */ + */ GLDEF_C TInt E32Main() -{ - TInt err; - - err = EikStart::RunApplication (NewApplication); - - return err; -} + { + TInt err; + + err = EikStart::RunApplication( NewApplication ); + return err; + } + #else // Series 60 2.x main DLL program code /** @@ -70,17 +70,17 @@ GLDEF_C TInt E32Main() * @return The application (Csymbian_ua_guiApplication) */ EXPORT_C CApaApplication* NewApplication() -{ - return new Csymbian_ua_guiApplication; -} + { + return new Csymbian_ua_guiApplication; + } /** * @brief This standard export is the entry point for all Series 60 applications * @return error code */ -GLDEF_C TInt E32Dll (TDllReason /*reason*/) -{ - return KErrNone; -} +GLDEF_C TInt E32Dll(TDllReason /*reason*/) + { + return KErrNone; + } #endif // EKA2 diff --git a/sflphone-common/libs/pjproject/pjsip-apps/src/symbian_ua_gui/src/symbian_ua_guiContainer.cpp b/sflphone-common/libs/pjproject/pjsip-apps/src/symbian_ua_gui/src/symbian_ua_guiContainer.cpp index 1ff6ff8bd9484cc2ed32a7d5af13a3deb486a0dd..777217c7de802bbeee708c77d062236f1961d719 100644 --- a/sflphone-common/libs/pjproject/pjsip-apps/src/symbian_ua_gui/src/symbian_ua_guiContainer.cpp +++ b/sflphone-common/libs/pjproject/pjsip-apps/src/symbian_ua_gui/src/symbian_ua_guiContainer.cpp @@ -3,7 +3,7 @@ Name : symbian_ua_guiContainer.cpp Author : nanang Copyright : (c) 2008-2009 Teluu Inc. - Description : + Description : ======================================================================== */ // [[[ begin generated region: do not modify [Generated System Includes] @@ -30,35 +30,34 @@ // ]]] end generated region [Generated Constants] /** - * First phase of Symbian two-phase construction. Should not + * First phase of Symbian two-phase construction. Should not * contain any code that could leave. */ CSymbian_ua_guiContainer::CSymbian_ua_guiContainer() -{ - // [[[ begin generated region: do not modify [Generated Contents] - iLabel1 = NULL; - iEd_url = NULL; - iEd_info = NULL; - // ]]] end generated region [Generated Contents] - -} - -/** + { + // [[[ begin generated region: do not modify [Generated Contents] + iLabel1 = NULL; + iEd_url = NULL; + iEd_info = NULL; + // ]]] end generated region [Generated Contents] + + } +/** * Destroy child controls. */ CSymbian_ua_guiContainer::~CSymbian_ua_guiContainer() -{ - // [[[ begin generated region: do not modify [Generated Contents] - delete iLabel1; - iLabel1 = NULL; - delete iEd_url; - iEd_url = NULL; - delete iEd_info; - iEd_info = NULL; - // ]]] end generated region [Generated Contents] - -} - + { + // [[[ begin generated region: do not modify [Generated Contents] + delete iLabel1; + iLabel1 = NULL; + delete iEd_url; + iEd_url = NULL; + delete iEd_info; + iEd_info = NULL; + // ]]] end generated region [Generated Contents] + + } + /** * Construct the control (first phase). * Creates an instance and initializes it. @@ -68,18 +67,18 @@ CSymbian_ua_guiContainer::~CSymbian_ua_guiContainer() * @param aCommandObserver command observer * @return initialized instance of CSymbian_ua_guiContainer */ -CSymbian_ua_guiContainer* CSymbian_ua_guiContainer::NewL ( - const TRect& aRect, - const CCoeControl* aParent, - MEikCommandObserver* aCommandObserver) -{ - CSymbian_ua_guiContainer* self = CSymbian_ua_guiContainer::NewLC ( - aRect, - aParent, - aCommandObserver); - CleanupStack::Pop (self); - return self; -} +CSymbian_ua_guiContainer* CSymbian_ua_guiContainer::NewL( + const TRect& aRect, + const CCoeControl* aParent, + MEikCommandObserver* aCommandObserver ) + { + CSymbian_ua_guiContainer* self = CSymbian_ua_guiContainer::NewLC( + aRect, + aParent, + aCommandObserver ); + CleanupStack::Pop( self ); + return self; + } /** * Construct the control (first phase). @@ -90,205 +89,197 @@ CSymbian_ua_guiContainer* CSymbian_ua_guiContainer::NewL ( * @param aCommandObserver command observer * @return new instance of CSymbian_ua_guiContainer */ -CSymbian_ua_guiContainer* CSymbian_ua_guiContainer::NewLC ( - const TRect& aRect, - const CCoeControl* aParent, - MEikCommandObserver* aCommandObserver) -{ - CSymbian_ua_guiContainer* self = new (ELeave) CSymbian_ua_guiContainer(); - CleanupStack::PushL (self); - self->ConstructL (aRect, aParent, aCommandObserver); - return self; -} - +CSymbian_ua_guiContainer* CSymbian_ua_guiContainer::NewLC( + const TRect& aRect, + const CCoeControl* aParent, + MEikCommandObserver* aCommandObserver ) + { + CSymbian_ua_guiContainer* self = new ( ELeave ) CSymbian_ua_guiContainer(); + CleanupStack::PushL( self ); + self->ConstructL( aRect, aParent, aCommandObserver ); + return self; + } + /** * Construct the control (second phase). * Creates a window to contain the controls and activates it. * @param aRect bounding rectangle * @param aCommandObserver command observer * @param aParent owning parent, or NULL - */ -void CSymbian_ua_guiContainer::ConstructL ( - const TRect& aRect, - const CCoeControl* aParent, - MEikCommandObserver* aCommandObserver) -{ - if (aParent == NULL) { - CreateWindowL(); - } else { - SetContainerWindowL (*aParent); - } - - iFocusControl = NULL; - - iCommandObserver = aCommandObserver; - InitializeControlsL(); - SetRect (aRect); - ActivateL(); - // [[[ begin generated region: do not modify [Post-ActivateL initializations] - // ]]] end generated region [Post-ActivateL initializations] - -} - + */ +void CSymbian_ua_guiContainer::ConstructL( + const TRect& aRect, + const CCoeControl* aParent, + MEikCommandObserver* aCommandObserver ) + { + if ( aParent == NULL ) + { + CreateWindowL(); + } + else + { + SetContainerWindowL( *aParent ); + } + iFocusControl = NULL; + iCommandObserver = aCommandObserver; + InitializeControlsL(); + SetRect( aRect ); + ActivateL(); + // [[[ begin generated region: do not modify [Post-ActivateL initializations] + // ]]] end generated region [Post-ActivateL initializations] + + } + /** * Return the number of controls in the container (override) * @return count */ TInt CSymbian_ua_guiContainer::CountComponentControls() const -{ - return (int) ELastControl; -} - + { + return ( int ) ELastControl; + } + /** * Get the control with the given index (override) * @param aIndex Control index [0...n) (limited by #CountComponentControls) * @return Pointer to control */ -CCoeControl* CSymbian_ua_guiContainer::ComponentControl (TInt aIndex) const -{ - // [[[ begin generated region: do not modify [Generated Contents] - switch (aIndex) { - - case ELabel1: - return iLabel1; - - case EEd_url: - return iEd_url; - - case EEd_info: - return iEd_info; - } - - // ]]] end generated region [Generated Contents] - - // handle any user controls here... - - return NULL; -} - +CCoeControl* CSymbian_ua_guiContainer::ComponentControl( TInt aIndex ) const + { + // [[[ begin generated region: do not modify [Generated Contents] + switch ( aIndex ) + { + case ELabel1: + return iLabel1; + case EEd_url: + return iEd_url; + case EEd_info: + return iEd_info; + } + // ]]] end generated region [Generated Contents] + + // handle any user controls here... + + return NULL; + } + /** * Handle resizing of the container. This implementation will lay out * full-sized controls like list boxes for any screen size, and will layout * labels, editors, etc. to the size they were given in the UI designer. * This code will need to be modified to adjust arbitrary controls to * any screen size. - */ + */ void CSymbian_ua_guiContainer::SizeChanged() -{ - CCoeControl::SizeChanged(); - LayoutControls(); - // [[[ begin generated region: do not modify [Generated Contents] - - // ]]] end generated region [Generated Contents] - -} - + { + CCoeControl::SizeChanged(); + LayoutControls(); + // [[[ begin generated region: do not modify [Generated Contents] + + // ]]] end generated region [Generated Contents] + + } + // [[[ begin generated function: do not modify /** * Layout components as specified in the UI Designer */ void CSymbian_ua_guiContainer::LayoutControls() -{ - iLabel1->SetExtent (TPoint (2, 23), TSize (32, 28)); - iEd_url->SetExtent (TPoint (49, 25), TSize (197, 28)); - iEd_info->SetExtent (TPoint (3, 78), TSize (235, 143)); -} - + { + iLabel1->SetExtent( TPoint( 2, 23 ), TSize( 32, 28 ) ); + iEd_url->SetExtent( TPoint( 49, 25 ), TSize( 197, 28 ) ); + iEd_info->SetExtent( TPoint( 3, 78 ), TSize( 235, 143 ) ); + } // ]]] end generated function /** * Handle key events. - */ -TKeyResponse CSymbian_ua_guiContainer::OfferKeyEventL ( - const TKeyEvent& aKeyEvent, - TEventCode aType) -{ - // [[[ begin generated region: do not modify [Generated Contents] - - // ]]] end generated region [Generated Contents] - - if (iFocusControl != NULL - && iFocusControl->OfferKeyEventL (aKeyEvent, aType) == EKeyWasConsumed) { - return EKeyWasConsumed; - } - - return CCoeControl::OfferKeyEventL (aKeyEvent, aType); -} - + */ +TKeyResponse CSymbian_ua_guiContainer::OfferKeyEventL( + const TKeyEvent& aKeyEvent, + TEventCode aType ) + { + // [[[ begin generated region: do not modify [Generated Contents] + + // ]]] end generated region [Generated Contents] + + if ( iFocusControl != NULL + && iFocusControl->OfferKeyEventL( aKeyEvent, aType ) == EKeyWasConsumed ) + { + return EKeyWasConsumed; + } + return CCoeControl::OfferKeyEventL( aKeyEvent, aType ); + } + // [[[ begin generated function: do not modify /** * Initialize each control upon creation. - */ + */ void CSymbian_ua_guiContainer::InitializeControlsL() -{ - iLabel1 = new (ELeave) CEikLabel; - iLabel1->SetContainerWindowL (*this); - { - TResourceReader reader; - iEikonEnv->CreateResourceReaderLC (reader, R_SYMBIAN_UA_GUI_CONTAINER_LABEL1); - iLabel1->ConstructFromResourceL (reader); - CleanupStack::PopAndDestroy(); // reader internal state - } - - iEd_url = new (ELeave) CEikEdwin; - iEd_url->SetContainerWindowL (*this); - { - TResourceReader reader; - iEikonEnv->CreateResourceReaderLC (reader, R_SYMBIAN_UA_GUI_CONTAINER_ED_URL); - iEd_url->ConstructFromResourceL (reader); - CleanupStack::PopAndDestroy(); // reader internal state - } - - { - HBufC* text = StringLoader::LoadLC (R_SYMBIAN_UA_GUI_CONTAINER_ED_URL_2); - iEd_url->SetTextL (text); - CleanupStack::PopAndDestroy (text); - } - - iEd_info = new (ELeave) CEikEdwin; - iEd_info->SetContainerWindowL (*this); - { - TResourceReader reader; - iEikonEnv->CreateResourceReaderLC (reader, R_SYMBIAN_UA_GUI_CONTAINER_ED_INFO); - iEd_info->ConstructFromResourceL (reader); - CleanupStack::PopAndDestroy(); // reader internal state - } - - { - HBufC* text = StringLoader::LoadLC (R_SYMBIAN_UA_GUI_CONTAINER_ED_INFO_2); - iEd_info->SetTextL (text); - CleanupStack::PopAndDestroy (text); - } - - iEd_url->SetFocus (ETrue); - iFocusControl = iEd_url; - -} - + { + iLabel1 = new ( ELeave ) CEikLabel; + iLabel1->SetContainerWindowL( *this ); + { + TResourceReader reader; + iEikonEnv->CreateResourceReaderLC( reader, R_SYMBIAN_UA_GUI_CONTAINER_LABEL1 ); + iLabel1->ConstructFromResourceL( reader ); + CleanupStack::PopAndDestroy(); // reader internal state + } + iEd_url = new ( ELeave ) CEikEdwin; + iEd_url->SetContainerWindowL( *this ); + { + TResourceReader reader; + iEikonEnv->CreateResourceReaderLC( reader, R_SYMBIAN_UA_GUI_CONTAINER_ED_URL ); + iEd_url->ConstructFromResourceL( reader ); + CleanupStack::PopAndDestroy(); // reader internal state + } + { + HBufC* text = StringLoader::LoadLC( R_SYMBIAN_UA_GUI_CONTAINER_ED_URL_2 ); + iEd_url->SetTextL( text ); + CleanupStack::PopAndDestroy( text ); + } + iEd_info = new ( ELeave ) CEikEdwin; + iEd_info->SetContainerWindowL( *this ); + { + TResourceReader reader; + iEikonEnv->CreateResourceReaderLC( reader, R_SYMBIAN_UA_GUI_CONTAINER_ED_INFO ); + iEd_info->ConstructFromResourceL( reader ); + CleanupStack::PopAndDestroy(); // reader internal state + } + { + HBufC* text = StringLoader::LoadLC( R_SYMBIAN_UA_GUI_CONTAINER_ED_INFO_2 ); + iEd_info->SetTextL( text ); + CleanupStack::PopAndDestroy( text ); + } + + iEd_url->SetFocus( ETrue ); + iFocusControl = iEd_url; + + } // ]]] end generated function -/** +/** * Handle global resource changes, such as scalable UI or skin events (override) */ -void CSymbian_ua_guiContainer::HandleResourceChange (TInt aType) -{ - CCoeControl::HandleResourceChange (aType); - SetRect (iAvkonViewAppUi->View (TUid::Uid (ESymbian_ua_guiContainerViewId))->ClientRect()); - // [[[ begin generated region: do not modify [Generated Contents] - // ]]] end generated region [Generated Contents] - -} - +void CSymbian_ua_guiContainer::HandleResourceChange( TInt aType ) + { + CCoeControl::HandleResourceChange( aType ); + SetRect( iAvkonViewAppUi->View( TUid::Uid( ESymbian_ua_guiContainerViewId ) )->ClientRect() ); + // [[[ begin generated region: do not modify [Generated Contents] + // ]]] end generated region [Generated Contents] + + } + /** * Draw container contents. - */ -void CSymbian_ua_guiContainer::Draw (const TRect& aRect) const -{ - // [[[ begin generated region: do not modify [Generated Contents] - CWindowGc& gc = SystemGc(); - gc.Clear (aRect); - - // ]]] end generated region [Generated Contents] - -} - + */ +void CSymbian_ua_guiContainer::Draw( const TRect& aRect ) const + { + // [[[ begin generated region: do not modify [Generated Contents] + CWindowGc& gc = SystemGc(); + gc.Clear( aRect ); + + // ]]] end generated region [Generated Contents] + + } + diff --git a/sflphone-common/libs/pjproject/pjsip-apps/src/symbian_ua_gui/src/symbian_ua_guiContainerView.cpp b/sflphone-common/libs/pjproject/pjsip-apps/src/symbian_ua_gui/src/symbian_ua_guiContainerView.cpp index a01d8f353c10d8e10622026ad2c9fcb7c0ee9973..661c210eac8ada40713cc3b7bbe0defd198b57e5 100644 --- a/sflphone-common/libs/pjproject/pjsip-apps/src/symbian_ua_gui/src/symbian_ua_guiContainerView.cpp +++ b/sflphone-common/libs/pjproject/pjsip-apps/src/symbian_ua_gui/src/symbian_ua_guiContainerView.cpp @@ -3,7 +3,7 @@ Name : symbian_ua_guiContainerView.cpp Author : nanang Copyright : (c) 2008-2009 Teluu Inc. - Description : + Description : ======================================================================== */ // [[[ begin generated region: do not modify [Generated System Includes] @@ -39,111 +39,106 @@ // ]]] end generated region [Generated Constants] Csymbian_ua_guiContainerView *myinstance = NULL; -_LIT (KStCall, "Call"); -_LIT (KStHangUp, "Hang Up"); +_LIT(KStCall, "Call"); +_LIT(KStHangUp, "Hang Up"); -void on_info (const wchar_t* buf) +void on_info(const wchar_t* buf) { - TPtrC aBuf ( (const TUint16*) buf); - - if (myinstance) - myinstance->PutMessage (aBuf); + TPtrC aBuf((const TUint16*)buf); + + if (myinstance) + myinstance->PutMessage(aBuf); } -void on_incoming_call (const wchar_t* caller_disp, const wchar_t* caller_uri) +void on_incoming_call(const wchar_t* caller_disp, const wchar_t* caller_uri) { - TBuf<512> buf; - TPtrC aDisp ( (const TUint16*) caller_disp); - TPtrC aUri ( (const TUint16*) caller_uri); - _LIT (KFormat, "Incoming call from %S, accept?"); - - buf.Format (KFormat, &aDisp); - - if (Csymbian_ua_guiContainerView::RunQry_accept_callL (&buf) == EAknSoftkeyYes) { - CEikButtonGroupContainer* cba = CEikButtonGroupContainer::Current(); - - if (cba != NULL) { - TRAPD (result, cba->SetCommandL (ESymbian_ua_guiContainerViewControlPaneRightId, KStHangUp)); - cba->DrawDeferred(); - } - - symbian_ua_answercall(); - } else { - symbian_ua_endcall(); - } + TBuf<512> buf; + TPtrC aDisp((const TUint16*)caller_disp); + TPtrC aUri((const TUint16*)caller_uri); + _LIT(KFormat, "Incoming call from %S, accept?"); + + buf.Format(KFormat, &aDisp); + if (Csymbian_ua_guiContainerView::RunQry_accept_callL(&buf) == EAknSoftkeyYes) + { + CEikButtonGroupContainer* cba = CEikButtonGroupContainer::Current(); + if (cba != NULL) { + TRAPD(result, cba->SetCommandL(ESymbian_ua_guiContainerViewControlPaneRightId, KStHangUp)); + cba->DrawDeferred(); + } + symbian_ua_answercall(); + } else { + symbian_ua_endcall(); + } } -void on_call_end (const wchar_t* reason) +void on_call_end(const wchar_t* reason) { - TPtrC aReason ( (const TUint16*) reason); - - CEikButtonGroupContainer* cba = CEikButtonGroupContainer::Current(); - - if (cba != NULL) { - TRAPD (result, cba->SetCommandL (ESymbian_ua_guiContainerViewControlPaneRightId, KStCall)); - cba->DrawDeferred(); - } - - Csymbian_ua_guiContainerView::RunNote_infoL (&aReason); + TPtrC aReason((const TUint16*)reason); + + CEikButtonGroupContainer* cba = CEikButtonGroupContainer::Current(); + if (cba != NULL) { + TRAPD(result, cba->SetCommandL(ESymbian_ua_guiContainerViewControlPaneRightId, KStCall)); + cba->DrawDeferred(); + } + + Csymbian_ua_guiContainerView::RunNote_infoL(&aReason); } -void on_reg_state (bool success) +void on_reg_state(bool success) { - if (success) - Csymbian_ua_guiContainerView::RunNote_infoL(); - else - Csymbian_ua_guiContainerView::RunNote_warningL(); + if (success) + Csymbian_ua_guiContainerView::RunNote_infoL(); + else + Csymbian_ua_guiContainerView::RunNote_warningL(); } -void on_unreg_state (bool success) +void on_unreg_state(bool success) { - TPtrC st_success (_L ("Unregistration Success!")); - TPtrC st_failed (_L ("Unregistration Failed!")); - - if (success) - Csymbian_ua_guiContainerView::RunNote_infoL (&st_success); - else - Csymbian_ua_guiContainerView::RunNote_warningL (&st_failed); + TPtrC st_success(_L("Unregistration Success!")); + TPtrC st_failed(_L("Unregistration Failed!")); + + if (success) + Csymbian_ua_guiContainerView::RunNote_infoL(&st_success); + else + Csymbian_ua_guiContainerView::RunNote_warningL(&st_failed); } -void Csymbian_ua_guiContainerView::PutMessage (const TDesC &msg) -{ - if (!iSymbian_ua_guiContainer) - return; - - CEikEdwin *obj_info = (CEikEdwin*) iSymbian_ua_guiContainer->ComponentControl (iSymbian_ua_guiContainer->EEd_info); +void Csymbian_ua_guiContainerView::PutMessage(const TDesC &msg) + { + if (!iSymbian_ua_guiContainer) + return; + + CEikEdwin *obj_info = (CEikEdwin*) iSymbian_ua_guiContainer->ComponentControl(iSymbian_ua_guiContainer->EEd_info); - obj_info->SetTextL (&msg); - - obj_info->DrawDeferred(); -} + obj_info->SetTextL(&msg); + obj_info->DrawDeferred(); + } /** * First phase of Symbian two-phase construction. Should not contain any * code that could leave. */ Csymbian_ua_guiContainerView::Csymbian_ua_guiContainerView() -{ - // [[[ begin generated region: do not modify [Generated Contents] - iSymbian_ua_guiContainer = NULL; - // ]]] end generated region [Generated Contents] - -} - -/** + { + // [[[ begin generated region: do not modify [Generated Contents] + iSymbian_ua_guiContainer = NULL; + // ]]] end generated region [Generated Contents] + + } +/** * The view's destructor removes the container from the control * stack and destroys it. */ Csymbian_ua_guiContainerView::~Csymbian_ua_guiContainerView() -{ - // [[[ begin generated region: do not modify [Generated Contents] - delete iSymbian_ua_guiContainer; - iSymbian_ua_guiContainer = NULL; - // ]]] end generated region [Generated Contents] - - symbian_ua_set_info_callback (NULL); - myinstance = NULL; -} + { + // [[[ begin generated region: do not modify [Generated Contents] + delete iSymbian_ua_guiContainer; + iSymbian_ua_guiContainer = NULL; + // ]]] end generated region [Generated Contents] + + symbian_ua_set_info_callback(NULL); + myinstance = NULL; + } /** * Symbian two-phase constructor. @@ -152,11 +147,11 @@ Csymbian_ua_guiContainerView::~Csymbian_ua_guiContainerView() * @return new instance of Csymbian_ua_guiContainerView */ Csymbian_ua_guiContainerView* Csymbian_ua_guiContainerView::NewL() -{ - Csymbian_ua_guiContainerView* self = Csymbian_ua_guiContainerView::NewLC(); - CleanupStack::Pop (self); - return self; -} + { + Csymbian_ua_guiContainerView* self = Csymbian_ua_guiContainerView::NewLC(); + CleanupStack::Pop( self ); + return self; + } /** * Symbian two-phase constructor. @@ -165,266 +160,259 @@ Csymbian_ua_guiContainerView* Csymbian_ua_guiContainerView::NewL() * @return new instance of Csymbian_ua_guiContainerView */ Csymbian_ua_guiContainerView* Csymbian_ua_guiContainerView::NewLC() -{ - Csymbian_ua_guiContainerView* self = new (ELeave) Csymbian_ua_guiContainerView(); - CleanupStack::PushL (self); - self->ConstructL(); - return self; -} + { + Csymbian_ua_guiContainerView* self = new ( ELeave ) Csymbian_ua_guiContainerView(); + CleanupStack::PushL( self ); + self->ConstructL(); + return self; + } /** - * Second-phase constructor for view. + * Second-phase constructor for view. * Initialize contents from resource. - */ + */ void Csymbian_ua_guiContainerView::ConstructL() -{ - // [[[ begin generated region: do not modify [Generated Code] - BaseConstructL (R_SYMBIAN_UA_GUI_CONTAINER_SYMBIAN_UA_GUI_CONTAINER_VIEW); - // ]]] end generated region [Generated Code] - - // add your own initialization code here - symbian_ua_info_cb_t cb; - Mem::FillZ (&cb, sizeof (cb)); - - cb.on_info = &on_info; - cb.on_incoming_call = &on_incoming_call; - cb.on_reg_state = &on_reg_state; - cb.on_unreg_state = &on_unreg_state; - cb.on_call_end = &on_call_end; - - symbian_ua_set_info_callback (&cb); - myinstance = this; -} - + { + // [[[ begin generated region: do not modify [Generated Code] + BaseConstructL( R_SYMBIAN_UA_GUI_CONTAINER_SYMBIAN_UA_GUI_CONTAINER_VIEW ); + // ]]] end generated region [Generated Code] + + // add your own initialization code here + symbian_ua_info_cb_t cb; + Mem::FillZ(&cb, sizeof(cb)); + + cb.on_info = &on_info; + cb.on_incoming_call = &on_incoming_call; + cb.on_reg_state = &on_reg_state; + cb.on_unreg_state = &on_unreg_state; + cb.on_call_end = &on_call_end; + + symbian_ua_set_info_callback(&cb); + myinstance = this; + } + /** * @return The UID for this view */ TUid Csymbian_ua_guiContainerView::Id() const -{ - return TUid::Uid (ESymbian_ua_guiContainerViewId); -} + { + return TUid::Uid( ESymbian_ua_guiContainerViewId ); + } /** * Handle a command for this view (override) * @param aCommand command id to be handled */ -void Csymbian_ua_guiContainerView::HandleCommandL (TInt aCommand) -{ - // [[[ begin generated region: do not modify [Generated Code] - TBool commandHandled = EFalse; - - switch (aCommand) { // code to dispatch to the AknView's menu and CBA commands is generated here - - case ESymbian_ua_guiContainerViewControlPaneRightId: - commandHandled = CallSoftKeyPressedL (aCommand); - break; - - case ESymbian_ua_guiContainerViewSettingMenuItemCommand: - commandHandled = HandleSettingMenuItemSelectedL (aCommand); - break; - - default: - break; - } - - - if (!commandHandled) { - - if (aCommand == ESymbian_ua_guiContainerViewControlPaneRightId) { - AppUi()->HandleCommandL (EEikCmdExit); - } - - } - - // ]]] end generated region [Generated Code] - -} +void Csymbian_ua_guiContainerView::HandleCommandL( TInt aCommand ) + { + // [[[ begin generated region: do not modify [Generated Code] + TBool commandHandled = EFalse; + switch ( aCommand ) + { // code to dispatch to the AknView's menu and CBA commands is generated here + + case ESymbian_ua_guiContainerViewControlPaneRightId: + commandHandled = CallSoftKeyPressedL( aCommand ); + break; + case ESymbian_ua_guiContainerViewSettingMenuItemCommand: + commandHandled = HandleSettingMenuItemSelectedL( aCommand ); + break; + default: + break; + } + + + if ( !commandHandled ) + { + + if ( aCommand == ESymbian_ua_guiContainerViewControlPaneRightId ) + { + AppUi()->HandleCommandL( EEikCmdExit ); + } + + } + // ]]] end generated region [Generated Code] + + } /** - * Handles user actions during activation of the view, + * Handles user actions during activation of the view, * such as initializing the content. */ -void Csymbian_ua_guiContainerView::DoActivateL ( - const TVwsViewId& /*aPrevViewId*/, - TUid /*aCustomMessageId*/, - const TDesC8& /*aCustomMessage*/) -{ - // [[[ begin generated region: do not modify [Generated Contents] - SetupStatusPaneL(); - - CEikButtonGroupContainer* cba = AppUi()->Cba(); - - if (cba != NULL) { - cba->MakeVisible (EFalse); - } - - if (iSymbian_ua_guiContainer == NULL) { - iSymbian_ua_guiContainer = CSymbian_ua_guiContainer::NewL (ClientRect(), NULL, this); - iSymbian_ua_guiContainer->SetMopParent (this); - AppUi()->AddToStackL (*this, iSymbian_ua_guiContainer); - } - - // ]]] end generated region [Generated Contents] - - cba = CEikButtonGroupContainer::Current(); - - if (cba != NULL) { - if (symbian_ua_anycall()) - cba->SetCommandL (ESymbian_ua_guiContainerViewControlPaneRightId, KStHangUp); - else - cba->SetCommandL (ESymbian_ua_guiContainerViewControlPaneRightId, KStCall); - } - -} +void Csymbian_ua_guiContainerView::DoActivateL( + const TVwsViewId& /*aPrevViewId*/, + TUid /*aCustomMessageId*/, + const TDesC8& /*aCustomMessage*/ ) + { + // [[[ begin generated region: do not modify [Generated Contents] + SetupStatusPaneL(); + + CEikButtonGroupContainer* cba = AppUi()->Cba(); + if ( cba != NULL ) + { + cba->MakeVisible( EFalse ); + } + + if ( iSymbian_ua_guiContainer == NULL ) + { + iSymbian_ua_guiContainer = CSymbian_ua_guiContainer::NewL( ClientRect(), NULL, this ); + iSymbian_ua_guiContainer->SetMopParent( this ); + AppUi()->AddToStackL( *this, iSymbian_ua_guiContainer ); + } + // ]]] end generated region [Generated Contents] + + cba = CEikButtonGroupContainer::Current(); + if (cba != NULL) { + if (symbian_ua_anycall()) + cba->SetCommandL(ESymbian_ua_guiContainerViewControlPaneRightId, KStHangUp); + else + cba->SetCommandL(ESymbian_ua_guiContainerViewControlPaneRightId, KStCall); + } + + } /** */ void Csymbian_ua_guiContainerView::DoDeactivate() -{ - // [[[ begin generated region: do not modify [Generated Contents] - CleanupStatusPane(); - - CEikButtonGroupContainer* cba = AppUi()->Cba(); - - if (cba != NULL) { - cba->MakeVisible (ETrue); - cba->DrawDeferred(); - } - - if (iSymbian_ua_guiContainer != NULL) { - AppUi()->RemoveFromViewStack (*this, iSymbian_ua_guiContainer); - delete iSymbian_ua_guiContainer; - iSymbian_ua_guiContainer = NULL; - } - - // ]]] end generated region [Generated Contents] - -} + { + // [[[ begin generated region: do not modify [Generated Contents] + CleanupStatusPane(); + + CEikButtonGroupContainer* cba = AppUi()->Cba(); + if ( cba != NULL ) + { + cba->MakeVisible( ETrue ); + cba->DrawDeferred(); + } + + if ( iSymbian_ua_guiContainer != NULL ) + { + AppUi()->RemoveFromViewStack( *this, iSymbian_ua_guiContainer ); + delete iSymbian_ua_guiContainer; + iSymbian_ua_guiContainer = NULL; + } + // ]]] end generated region [Generated Contents] + + } // [[[ begin generated function: do not modify void Csymbian_ua_guiContainerView::SetupStatusPaneL() -{ - // reset the context pane - TUid contextPaneUid = TUid::Uid (EEikStatusPaneUidContext); - CEikStatusPaneBase::TPaneCapabilities subPaneContext = - StatusPane()->PaneCapabilities (contextPaneUid); - - if (subPaneContext.IsPresent() && subPaneContext.IsAppOwned()) { - CAknContextPane* context = static_cast< CAknContextPane* > ( - StatusPane()->ControlL (contextPaneUid)); - context->SetPictureToDefaultL(); - } - - // setup the title pane - TUid titlePaneUid = TUid::Uid (EEikStatusPaneUidTitle); - - CEikStatusPaneBase::TPaneCapabilities subPaneTitle = - StatusPane()->PaneCapabilities (titlePaneUid); - - if (subPaneTitle.IsPresent() && subPaneTitle.IsAppOwned()) { - CAknTitlePane* title = static_cast< CAknTitlePane* > ( - StatusPane()->ControlL (titlePaneUid)); - TResourceReader reader; - iEikonEnv->CreateResourceReaderLC (reader, R_SYMBIAN_UA_GUI_CONTAINER_TITLE_RESOURCE); - title->SetFromResourceL (reader); - CleanupStack::PopAndDestroy(); // reader internal state - } - -} - + { + // reset the context pane + TUid contextPaneUid = TUid::Uid( EEikStatusPaneUidContext ); + CEikStatusPaneBase::TPaneCapabilities subPaneContext = + StatusPane()->PaneCapabilities( contextPaneUid ); + if ( subPaneContext.IsPresent() && subPaneContext.IsAppOwned() ) + { + CAknContextPane* context = static_cast< CAknContextPane* > ( + StatusPane()->ControlL( contextPaneUid ) ); + context->SetPictureToDefaultL(); + } + + // setup the title pane + TUid titlePaneUid = TUid::Uid( EEikStatusPaneUidTitle ); + CEikStatusPaneBase::TPaneCapabilities subPaneTitle = + StatusPane()->PaneCapabilities( titlePaneUid ); + if ( subPaneTitle.IsPresent() && subPaneTitle.IsAppOwned() ) + { + CAknTitlePane* title = static_cast< CAknTitlePane* >( + StatusPane()->ControlL( titlePaneUid ) ); + TResourceReader reader; + iEikonEnv->CreateResourceReaderLC( reader, R_SYMBIAN_UA_GUI_CONTAINER_TITLE_RESOURCE ); + title->SetFromResourceL( reader ); + CleanupStack::PopAndDestroy(); // reader internal state + } + + } // ]]] end generated function // [[[ begin generated function: do not modify void Csymbian_ua_guiContainerView::CleanupStatusPane() -{ -} - + { + } // ]]] end generated function -/** +/** * Handle status pane size change for this view (override) */ void Csymbian_ua_guiContainerView::HandleStatusPaneSizeChange() -{ - CAknView::HandleStatusPaneSizeChange(); - - // this may fail, but we're not able to propagate exceptions here - TInt result; - TRAP (result, SetupStatusPaneL()); -} - -/** + { + CAknView::HandleStatusPaneSizeChange(); + + // this may fail, but we're not able to propagate exceptions here + TInt result; + TRAP( result, SetupStatusPaneL() ); + } + +/** * Handle the rightSoftKeyPressed event. * @return ETrue if the command was handled, EFalse if not */ -TBool Csymbian_ua_guiContainerView::CallSoftKeyPressedL (TInt aCommand) -{ - CEikEdwin *obj_url = (CEikEdwin*) iSymbian_ua_guiContainer->ComponentControl (iSymbian_ua_guiContainer->EEd_url); - CEikButtonGroupContainer* cba = CEikButtonGroupContainer::Current(); - - if (symbian_ua_anycall()) { - symbian_ua_endcall(); - return ETrue; - } - - PutMessage (_L ("Making call...")); - - if (cba != NULL) { - cba->SetCommandL (aCommand, KStHangUp); - cba->DrawDeferred(); - } - - - TUint8 url[256]; - - TPtr8 aUrl (url, 256); - - HBufC *buf = obj_url->GetTextInHBufL(); - CnvUtfConverter::ConvertFromUnicodeToUtf8 (aUrl, *buf); - delete buf; - - if (symbian_ua_makecall ( (char *) aUrl.PtrZ()) != 0) { - PutMessage (_L ("Making call failed!")); - - if (cba != NULL) { - cba->SetCommandL (aCommand, KStCall); - cba->DrawDeferred(); - } - } - - return ETrue; -} - -/** +TBool Csymbian_ua_guiContainerView::CallSoftKeyPressedL( TInt aCommand ) + { + CEikEdwin *obj_url = (CEikEdwin*) iSymbian_ua_guiContainer->ComponentControl(iSymbian_ua_guiContainer->EEd_url); + CEikButtonGroupContainer* cba = CEikButtonGroupContainer::Current(); + + if (symbian_ua_anycall()) { + symbian_ua_endcall(); + return ETrue; + } + + PutMessage(_L("Making call...")); + if ( cba != NULL ) { + cba->SetCommandL(aCommand, KStHangUp); + cba->DrawDeferred(); + } + + + TUint8 url[256]; + TPtr8 aUrl(url, 256); + + HBufC *buf = obj_url->GetTextInHBufL(); + CnvUtfConverter::ConvertFromUnicodeToUtf8(aUrl, *buf); + delete buf; + + if (symbian_ua_makecall((char *)aUrl.PtrZ()) != 0) { + PutMessage(_L("Making call failed!")); + if ( cba != NULL ) { + cba->SetCommandL(aCommand, KStCall); + cba->DrawDeferred(); + } + } + + return ETrue; + } + +/** * Handle the selected event. * @param aCommand the command id invoked * @return ETrue if the command was handled, EFalse if not */ -TBool Csymbian_ua_guiContainerView::HandleSettingMenuItemSelectedL (TInt aCommand) -{ - AppUi()->ActivateLocalViewL (TUid::Uid (ESymbian_ua_guiSettingItemListViewId)); - return ETrue; -} - +TBool Csymbian_ua_guiContainerView::HandleSettingMenuItemSelectedL( TInt aCommand ) + { + AppUi()->ActivateLocalViewL(TUid::Uid(ESymbian_ua_guiSettingItemListViewId)); + return ETrue; + } + // [[[ begin generated function: do not modify /** * Show the popup note for note_error * @param aOverrideText optional override text */ -void Csymbian_ua_guiContainerView::RunNote_errorL (const TDesC* aOverrideText) -{ - CAknErrorNote* note = new (ELeave) CAknErrorNote(); - - if (aOverrideText == NULL) { - HBufC* noteText = StringLoader::LoadLC (R_SYMBIAN_UA_GUI_CONTAINER_NOTE_ERROR); - note->ExecuteLD (*noteText); - CleanupStack::PopAndDestroy (noteText); - } else { - note->ExecuteLD (*aOverrideText); - } -} - +void Csymbian_ua_guiContainerView::RunNote_errorL( const TDesC* aOverrideText ) + { + CAknErrorNote* note = new ( ELeave ) CAknErrorNote(); + if ( aOverrideText == NULL ) + { + HBufC* noteText = StringLoader::LoadLC( R_SYMBIAN_UA_GUI_CONTAINER_NOTE_ERROR ); + note->ExecuteLD( *noteText ); + CleanupStack::PopAndDestroy( noteText ); + } + else + { + note->ExecuteLD( *aOverrideText ); + } + } // ]]] end generated function // [[[ begin generated function: do not modify @@ -432,19 +420,20 @@ void Csymbian_ua_guiContainerView::RunNote_errorL (const TDesC* aOverrideText) * Show the popup note for note_info * @param aOverrideText optional override text */ -void Csymbian_ua_guiContainerView::RunNote_infoL (const TDesC* aOverrideText) -{ - CAknInformationNote* note = new (ELeave) CAknInformationNote(); - - if (aOverrideText == NULL) { - HBufC* noteText = StringLoader::LoadLC (R_SYMBIAN_UA_GUI_CONTAINER_NOTE_INFO); - note->ExecuteLD (*noteText); - CleanupStack::PopAndDestroy (noteText); - } else { - note->ExecuteLD (*aOverrideText); - } -} - +void Csymbian_ua_guiContainerView::RunNote_infoL( const TDesC* aOverrideText ) + { + CAknInformationNote* note = new ( ELeave ) CAknInformationNote(); + if ( aOverrideText == NULL ) + { + HBufC* noteText = StringLoader::LoadLC( R_SYMBIAN_UA_GUI_CONTAINER_NOTE_INFO ); + note->ExecuteLD( *noteText ); + CleanupStack::PopAndDestroy( noteText ); + } + else + { + note->ExecuteLD( *aOverrideText ); + } + } // ]]] end generated function // [[[ begin generated function: do not modify @@ -452,19 +441,20 @@ void Csymbian_ua_guiContainerView::RunNote_infoL (const TDesC* aOverrideText) * Show the popup note for note_warning * @param aOverrideText optional override text */ -void Csymbian_ua_guiContainerView::RunNote_warningL (const TDesC* aOverrideText) -{ - CAknWarningNote* note = new (ELeave) CAknWarningNote(); - - if (aOverrideText == NULL) { - HBufC* noteText = StringLoader::LoadLC (R_SYMBIAN_UA_GUI_CONTAINER_NOTE_WARNING); - note->ExecuteLD (*noteText); - CleanupStack::PopAndDestroy (noteText); - } else { - note->ExecuteLD (*aOverrideText); - } -} - +void Csymbian_ua_guiContainerView::RunNote_warningL( const TDesC* aOverrideText ) + { + CAknWarningNote* note = new ( ELeave ) CAknWarningNote(); + if ( aOverrideText == NULL ) + { + HBufC* noteText = StringLoader::LoadLC( R_SYMBIAN_UA_GUI_CONTAINER_NOTE_WARNING ); + note->ExecuteLD( *noteText ); + CleanupStack::PopAndDestroy( noteText ); + } + else + { + note->ExecuteLD( *aOverrideText ); + } + } // ]]] end generated function // [[[ begin generated function: do not modify @@ -473,17 +463,16 @@ void Csymbian_ua_guiContainerView::RunNote_warningL (const TDesC* aOverrideText) * @param aOverrideText optional override text * @return EAknSoftkeyYes (left soft key id) or 0 */ -TInt Csymbian_ua_guiContainerView::RunQry_accept_callL (const TDesC* aOverrideText) -{ - - CAknQueryDialog* queryDialog = CAknQueryDialog::NewL(); - - if (aOverrideText != NULL) { - queryDialog->SetPromptL (*aOverrideText); - } - - return queryDialog->ExecuteLD (R_SYMBIAN_UA_GUI_CONTAINER_QRY_ACCEPT_CALL); -} - +TInt Csymbian_ua_guiContainerView::RunQry_accept_callL( const TDesC* aOverrideText ) + { + + CAknQueryDialog* queryDialog = CAknQueryDialog::NewL(); + + if ( aOverrideText != NULL ) + { + queryDialog->SetPromptL( *aOverrideText ); + } + return queryDialog->ExecuteLD( R_SYMBIAN_UA_GUI_CONTAINER_QRY_ACCEPT_CALL ); + } // ]]] end generated function diff --git a/sflphone-common/libs/pjproject/pjsip-apps/src/symbian_ua_gui/src/symbian_ua_guiDocument.cpp b/sflphone-common/libs/pjproject/pjsip-apps/src/symbian_ua_gui/src/symbian_ua_guiDocument.cpp index 209c9ebcec9f9a653241e1340be8fb8b382c2949..8eb54f8d74fed49b685ad511827c23256e1d61f4 100644 --- a/sflphone-common/libs/pjproject/pjsip-apps/src/symbian_ua_gui/src/symbian_ua_guiDocument.cpp +++ b/sflphone-common/libs/pjproject/pjsip-apps/src/symbian_ua_gui/src/symbian_ua_guiDocument.cpp @@ -3,7 +3,7 @@ Name : symbian_ua_guiDocument.cpp Author : nanang Copyright : (c) 2008-2009 Teluu Inc. - Description : + Description : ======================================================================== */ // [[[ begin generated region: do not modify [Generated User Includes] @@ -15,19 +15,19 @@ * @brief Constructs the document class for the application. * @param anApplication the application instance */ -Csymbian_ua_guiDocument::Csymbian_ua_guiDocument (CEikApplication& anApplication) - : CAknDocument (anApplication) -{ -} +Csymbian_ua_guiDocument::Csymbian_ua_guiDocument( CEikApplication& anApplication ) + : CAknDocument( anApplication ) + { + } /** - * @brief Completes the second phase of Symbian object construction. - * Put initialization code that could leave here. - */ + * @brief Completes the second phase of Symbian object construction. + * Put initialization code that could leave here. + */ void Csymbian_ua_guiDocument::ConstructL() -{ -} - + { + } + /** * Symbian OS two-phase constructor. * @@ -37,21 +37,21 @@ void Csymbian_ua_guiDocument::ConstructL() * @param aApp the application instance * @return the new Csymbian_ua_guiDocument */ -Csymbian_ua_guiDocument* Csymbian_ua_guiDocument::NewL (CEikApplication& aApp) -{ - Csymbian_ua_guiDocument* self = new (ELeave) Csymbian_ua_guiDocument (aApp); - CleanupStack::PushL (self); - self->ConstructL(); - CleanupStack::Pop (self); - return self; -} +Csymbian_ua_guiDocument* Csymbian_ua_guiDocument::NewL( CEikApplication& aApp ) + { + Csymbian_ua_guiDocument* self = new ( ELeave ) Csymbian_ua_guiDocument( aApp ); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } /** * @brief Creates the application UI object for this document. * @return the new instance - */ + */ CEikAppUi* Csymbian_ua_guiDocument::CreateAppUiL() -{ - return new (ELeave) Csymbian_ua_guiAppUi; -} - + { + return new ( ELeave ) Csymbian_ua_guiAppUi; + } + diff --git a/sflphone-common/libs/pjproject/pjsip-apps/src/symbian_ua_gui/src/symbian_ua_guiSettingItemList.cpp b/sflphone-common/libs/pjproject/pjsip-apps/src/symbian_ua_gui/src/symbian_ua_guiSettingItemList.cpp index 15fba37ca33e2d2bcddce2b6c92a7d8e0621c144..27f3d6e5ce3c2793c376ae827d531342cea8e787 100644 --- a/sflphone-common/libs/pjproject/pjsip-apps/src/symbian_ua_gui/src/symbian_ua_guiSettingItemList.cpp +++ b/sflphone-common/libs/pjproject/pjsip-apps/src/symbian_ua_gui/src/symbian_ua_guiSettingItemList.cpp @@ -3,7 +3,7 @@ Name : symbian_ua_guiSettingItemList.cpp Author : nanang Copyright : (c) 2008-2009 Teluu Inc. - Description : + Description : ======================================================================== */ @@ -22,7 +22,7 @@ #include <aknpopupfieldtext.h> #include <eikappui.h> #include <aknviewappui.h> -#include <akntextsettingpage.h> +#include <akntextsettingpage.h> #include <symbian_ua_gui.rsg> // ]]] end generated region [Generated System Includes] @@ -43,8 +43,8 @@ // ]]] end generated region [Generated Constants] -_LIT (KtxDicFileName ,"settings.ini"); - +_LIT(KtxDicFileName ,"settings.ini" ); + const TInt KRegistrar = 2; const TInt KUsername = 3; const TInt KPassword = 4; @@ -55,36 +55,36 @@ const TInt KIce = 7; /** * Construct the CSymbian_ua_guiSettingItemList instance * @param aCommandObserver command observer - */ -CSymbian_ua_guiSettingItemList::CSymbian_ua_guiSettingItemList ( - TSymbian_ua_guiSettingItemListSettings& aSettings, - MEikCommandObserver* aCommandObserver) - : iSettings (aSettings), iCommandObserver (aCommandObserver) -{ - // [[[ begin generated region: do not modify [Generated Contents] - // ]]] end generated region [Generated Contents] - -} - -/** + */ +CSymbian_ua_guiSettingItemList::CSymbian_ua_guiSettingItemList( + TSymbian_ua_guiSettingItemListSettings& aSettings, + MEikCommandObserver* aCommandObserver ) + : iSettings( aSettings ), iCommandObserver( aCommandObserver ) + { + // [[[ begin generated region: do not modify [Generated Contents] + // ]]] end generated region [Generated Contents] + + } +/** * Destroy any instance variables */ CSymbian_ua_guiSettingItemList::~CSymbian_ua_guiSettingItemList() -{ - // [[[ begin generated region: do not modify [Generated Contents] - // ]]] end generated region [Generated Contents] - -} + { + // [[[ begin generated region: do not modify [Generated Contents] + // ]]] end generated region [Generated Contents] + + } /** * Handle system notification that the container's size has changed. */ void CSymbian_ua_guiSettingItemList::SizeChanged() -{ - if (ListBox()) { - ListBox()->SetRect (Rect()); - } -} + { + if ( ListBox() ) + { + ListBox()->SetRect( Rect() ); + } + } /** * Create one setting item at a time, identified by id. @@ -93,73 +93,73 @@ void CSymbian_ua_guiSettingItemList::SizeChanged() * a reference to the underlying data, which EditItemL() uses * to edit and store the value. */ -CAknSettingItem* CSymbian_ua_guiSettingItemList::CreateSettingItemL (TInt aId) -{ - switch (aId) { - // [[[ begin generated region: do not modify [Initializers] - - case ESymbian_ua_guiSettingItemListViewEd_registrar: { - CAknTextSettingItem* item = new (ELeave) - CAknTextSettingItem ( - aId, - iSettings.Ed_registrar()); - item->SetSettingPageFlags (CAknTextSettingPage::EZeroLengthAllowed); - return item; - } - - case ESymbian_ua_guiSettingItemListViewEd_user: { - CAknTextSettingItem* item = new (ELeave) - CAknTextSettingItem ( - aId, - iSettings.Ed_user()); - item->SetSettingPageFlags (CAknTextSettingPage::EZeroLengthAllowed); - return item; - } - - case ESymbian_ua_guiSettingItemListViewEd_password: { - CAknPasswordSettingItem* item = new (ELeave) - CAknPasswordSettingItem ( - aId, - CAknPasswordSettingItem::EAlpha, - iSettings.Ed_password()); - item->SetSettingPageFlags (CAknTextSettingPage::EZeroLengthAllowed); - return item; - } - - case ESymbian_ua_guiSettingItemListViewB_srtp: { - CAknBinaryPopupSettingItem* item = new (ELeave) - CAknBinaryPopupSettingItem ( - aId, - iSettings.B_srtp()); - item->SetHidden (ETrue); - return item; - } - - case ESymbian_ua_guiSettingItemListViewB_ice: { - CAknBinaryPopupSettingItem* item = new (ELeave) - CAknBinaryPopupSettingItem ( - aId, - iSettings.B_ice()); - item->SetHidden (ETrue); - return item; - } - - case ESymbian_ua_guiSettingItemListViewEd_stun_server: { - CAknTextSettingItem* item = new (ELeave) - CAknTextSettingItem ( - aId, - iSettings.Ed_stun_server()); - item->SetHidden (ETrue); - return item; - } - - // ]]] end generated region [Initializers] - - } - - return NULL; -} - +CAknSettingItem* CSymbian_ua_guiSettingItemList::CreateSettingItemL( TInt aId ) + { + switch ( aId ) + { + // [[[ begin generated region: do not modify [Initializers] + case ESymbian_ua_guiSettingItemListViewEd_registrar: + { + CAknTextSettingItem* item = new ( ELeave ) + CAknTextSettingItem( + aId, + iSettings.Ed_registrar() ); + item->SetSettingPageFlags(CAknTextSettingPage::EZeroLengthAllowed); + return item; + } + case ESymbian_ua_guiSettingItemListViewEd_user: + { + CAknTextSettingItem* item = new ( ELeave ) + CAknTextSettingItem( + aId, + iSettings.Ed_user() ); + item->SetSettingPageFlags(CAknTextSettingPage::EZeroLengthAllowed); + return item; + } + case ESymbian_ua_guiSettingItemListViewEd_password: + { + CAknPasswordSettingItem* item = new ( ELeave ) + CAknPasswordSettingItem( + aId, + CAknPasswordSettingItem::EAlpha, + iSettings.Ed_password() ); + item->SetSettingPageFlags(CAknTextSettingPage::EZeroLengthAllowed); + return item; + } + case ESymbian_ua_guiSettingItemListViewB_srtp: + { + CAknBinaryPopupSettingItem* item = new ( ELeave ) + CAknBinaryPopupSettingItem( + aId, + iSettings.B_srtp() ); + item->SetHidden( ETrue ); + return item; + } + case ESymbian_ua_guiSettingItemListViewB_ice: + { + CAknBinaryPopupSettingItem* item = new ( ELeave ) + CAknBinaryPopupSettingItem( + aId, + iSettings.B_ice() ); + item->SetHidden( ETrue ); + return item; + } + case ESymbian_ua_guiSettingItemListViewEd_stun_server: + { + CAknTextSettingItem* item = new ( ELeave ) + CAknTextSettingItem( + aId, + iSettings.Ed_stun_server() ); + item->SetHidden( ETrue ); + return item; + } + // ]]] end generated region [Initializers] + + } + + return NULL; + } + /** * Edit the setting item identified by the given id and store * the changes into the store. @@ -168,256 +168,256 @@ CAknSettingItem* CSymbian_ua_guiSettingItemList::CreateSettingItemL (TInt aId) * always show the edit page and interactively edit the item; * false: change the item in place if possible, else show the edit page */ -void CSymbian_ua_guiSettingItemList::EditItemL (TInt aIndex, TBool aCalledFromMenu) -{ - CAknSettingItem* item = (*SettingItemArray()) [aIndex]; - - switch (item->Identifier()) { - // [[[ begin generated region: do not modify [Editing Started Invoker] - // ]]] end generated region [Editing Started Invoker] - - } - - CAknSettingItemList::EditItemL (aIndex, aCalledFromMenu); - - TBool storeValue = ETrue; - - switch (item->Identifier()) { - // [[[ begin generated region: do not modify [Editing Stopped Invoker] - // ]]] end generated region [Editing Stopped Invoker] - - } - - if (storeValue) { - item->StoreL(); - SaveSettingValuesL(); - } -} - +void CSymbian_ua_guiSettingItemList::EditItemL ( TInt aIndex, TBool aCalledFromMenu ) + { + CAknSettingItem* item = ( *SettingItemArray() )[aIndex]; + switch ( item->Identifier() ) + { + // [[[ begin generated region: do not modify [Editing Started Invoker] + // ]]] end generated region [Editing Started Invoker] + + } + + CAknSettingItemList::EditItemL( aIndex, aCalledFromMenu ); + + TBool storeValue = ETrue; + switch ( item->Identifier() ) + { + // [[[ begin generated region: do not modify [Editing Stopped Invoker] + // ]]] end generated region [Editing Stopped Invoker] + + } + + if ( storeValue ) + { + item->StoreL(); + SaveSettingValuesL(); + } + } /** * Handle the "Change" option on the Options menu. This is an * alternative to the Selection key that forces the settings page * to come up rather than changing the value in place (if possible). */ void CSymbian_ua_guiSettingItemList::ChangeSelectedItemL() -{ - if (ListBox()->CurrentItemIndex() >= 0) { - EditItemL (ListBox()->CurrentItemIndex(), ETrue); - } -} + { + if ( ListBox()->CurrentItemIndex() >= 0 ) + { + EditItemL( ListBox()->CurrentItemIndex(), ETrue ); + } + } /** * Load the initial contents of the setting items. By default, * the setting items are populated with the default values from * the design. You can override those values here. * <p> - * Note: this call alone does not update the UI. + * Note: this call alone does not update the UI. * LoadSettingsL() must be called afterwards. */ void CSymbian_ua_guiSettingItemList::LoadSettingValuesL() -{ - // load values into iSettings + { + // load values into iSettings - TFileName path; - TFileName pathWithoutDrive; - CEikonEnv::Static()->FsSession().PrivatePath (pathWithoutDrive); + TFileName path; + TFileName pathWithoutDrive; + CEikonEnv::Static()->FsSession().PrivatePath( pathWithoutDrive ); - // Extract drive letter into appDrive: + // Extract drive letter into appDrive: #ifdef __WINS__ - path.Copy (_L ("c:")); + path.Copy( _L("c:") ); #else - RProcess process; - path.Copy (process.FileName().Left (2)); + RProcess process; + path.Copy( process.FileName().Left(2) ); #endif - path.Append (pathWithoutDrive); - path.Append (KtxDicFileName); - - TFindFile AufFolder (CCoeEnv::Static()->FsSession()); - - if (KErrNone == AufFolder.FindByDir (path, KNullDesC)) { - CDictionaryFileStore* MyDStore = CDictionaryFileStore::OpenLC (CCoeEnv::Static()->FsSession(),AufFolder.File(), TUid::Uid (1)); - TUid FileUid; - - FileUid.iUid = KRegistrar; - - if (MyDStore->IsPresentL (FileUid)) { - RDictionaryReadStream in; - in.OpenLC (*MyDStore,FileUid); - in >> iSettings.Ed_registrar(); - CleanupStack::PopAndDestroy (1);// in - } - - FileUid.iUid = KUsername; - - if (MyDStore->IsPresentL (FileUid)) { - RDictionaryReadStream in; - in.OpenLC (*MyDStore,FileUid); - in >> iSettings.Ed_user(); - CleanupStack::PopAndDestroy (1);// in - } - - FileUid.iUid = KPassword; - - if (MyDStore->IsPresentL (FileUid)) { - RDictionaryReadStream in; - in.OpenLC (*MyDStore,FileUid); - in >> iSettings.Ed_password(); - CleanupStack::PopAndDestroy (1);// in - } - - FileUid.iUid = KStunServer; - - if (MyDStore->IsPresentL (FileUid)) { - RDictionaryReadStream in; - in.OpenLC (*MyDStore,FileUid); - in >> iSettings.Ed_stun_server(); - CleanupStack::PopAndDestroy (1);// in - } - - FileUid.iUid = KSrtp; - - if (MyDStore->IsPresentL (FileUid)) { - RDictionaryReadStream in; - in.OpenLC (*MyDStore,FileUid); - iSettings.SetB_srtp ( (TBool) in.ReadInt32L()); - CleanupStack::PopAndDestroy (1);// in - } - - FileUid.iUid = KIce; - - if (MyDStore->IsPresentL (FileUid)) { - RDictionaryReadStream in; - in.OpenLC (*MyDStore,FileUid); - iSettings.SetB_ice ( (TBool) in.ReadInt32L()); - CleanupStack::PopAndDestroy (1);// in - } - - CleanupStack::PopAndDestroy (1);// Store - } - -} - + path.Append( pathWithoutDrive ); + path.Append( KtxDicFileName ); + + TFindFile AufFolder(CCoeEnv::Static()->FsSession()); + if(KErrNone == AufFolder.FindByDir(path, KNullDesC)) + { + CDictionaryFileStore* MyDStore = CDictionaryFileStore::OpenLC(CCoeEnv::Static()->FsSession(),AufFolder.File(), TUid::Uid(1)); + TUid FileUid; + + FileUid.iUid = KRegistrar; + if(MyDStore->IsPresentL(FileUid)) + { + RDictionaryReadStream in; + in.OpenLC(*MyDStore,FileUid); + in >> iSettings.Ed_registrar(); + CleanupStack::PopAndDestroy(1);// in + } + + FileUid.iUid = KUsername; + if(MyDStore->IsPresentL(FileUid)) + { + RDictionaryReadStream in; + in.OpenLC(*MyDStore,FileUid); + in >> iSettings.Ed_user(); + CleanupStack::PopAndDestroy(1);// in + } + + FileUid.iUid = KPassword; + if(MyDStore->IsPresentL(FileUid)) + { + RDictionaryReadStream in; + in.OpenLC(*MyDStore,FileUid); + in >> iSettings.Ed_password(); + CleanupStack::PopAndDestroy(1);// in + } + + FileUid.iUid = KStunServer; + if(MyDStore->IsPresentL(FileUid)) + { + RDictionaryReadStream in; + in.OpenLC(*MyDStore,FileUid); + in >> iSettings.Ed_stun_server(); + CleanupStack::PopAndDestroy(1);// in + } + + FileUid.iUid = KSrtp; + if(MyDStore->IsPresentL(FileUid)) + { + RDictionaryReadStream in; + in.OpenLC(*MyDStore,FileUid); + iSettings.SetB_srtp((TBool)in.ReadInt32L()); + CleanupStack::PopAndDestroy(1);// in + } + + FileUid.iUid = KIce; + if(MyDStore->IsPresentL(FileUid)) + { + RDictionaryReadStream in; + in.OpenLC(*MyDStore,FileUid); + iSettings.SetB_ice((TBool)in.ReadInt32L()); + CleanupStack::PopAndDestroy(1);// in + } + + CleanupStack::PopAndDestroy(1);// Store + } + + } + /** * Save the contents of the setting items. Note, this is called * whenever an item is changed and stored to the model, so it * may be called multiple times or not at all. */ void CSymbian_ua_guiSettingItemList::SaveSettingValuesL() -{ - // store values from iSettings + { + // store values from iSettings - TFileName path; - TFileName pathWithoutDrive; - CEikonEnv::Static()->FsSession().PrivatePath (pathWithoutDrive); + TFileName path; + TFileName pathWithoutDrive; + CEikonEnv::Static()->FsSession().PrivatePath( pathWithoutDrive ); - // Extract drive letter into appDrive: + // Extract drive letter into appDrive: #ifdef __WINS__ - path.Copy (_L ("c:")); + path.Copy( _L("c:") ); #else - RProcess process; - path.Copy (process.FileName().Left (2)); - - if (path.Compare (_L ("c")) || path.Compare (_L ("C"))) - CEikonEnv::Static()->FsSession().CreatePrivatePath (EDriveC); - else if (path.Compare (_L ("e")) || path.Compare (_L ("E"))) - CEikonEnv::Static()->FsSession().CreatePrivatePath (EDriveE); - + RProcess process; + path.Copy( process.FileName().Left(2) ); + + if(path.Compare(_L("c")) || path.Compare(_L("C"))) + CEikonEnv::Static()->FsSession().CreatePrivatePath(EDriveC); + else if(path.Compare(_L("e")) || path.Compare(_L("E"))) + CEikonEnv::Static()->FsSession().CreatePrivatePath(EDriveE); #endif - path.Append (pathWithoutDrive); - - path.Append (KtxDicFileName); - - TFindFile AufFolder (CCoeEnv::Static()->FsSession()); - - if (KErrNone == AufFolder.FindByDir (path, KNullDesC)) { - User::LeaveIfError (CCoeEnv::Static()->FsSession().Delete (AufFolder.File())); - } - - CDictionaryFileStore* MyDStore = CDictionaryFileStore::OpenLC (CCoeEnv::Static()->FsSession(),path, TUid::Uid (1)); - - TUid FileUid = {0x0}; - - FileUid.iUid = KRegistrar; - RDictionaryWriteStream out1; - out1.AssignLC (*MyDStore,FileUid); - out1 << iSettings.Ed_registrar(); - out1.CommitL(); - CleanupStack::PopAndDestroy (1);// out2 - - FileUid.iUid = KUsername; - RDictionaryWriteStream out2; - out2.AssignLC (*MyDStore,FileUid); - out2 << iSettings.Ed_user(); - out2.CommitL(); - CleanupStack::PopAndDestroy (1);// out2 - - FileUid.iUid = KPassword; - RDictionaryWriteStream out3; - out3.AssignLC (*MyDStore,FileUid); - out3 << iSettings.Ed_password(); - out3.CommitL(); - CleanupStack::PopAndDestroy (1);// out2 - - FileUid.iUid = KStunServer; - RDictionaryWriteStream out4; - out4.AssignLC (*MyDStore,FileUid); - out4 << iSettings.Ed_stun_server(); - out4.CommitL(); - CleanupStack::PopAndDestroy (1);// out2 - - FileUid.iUid = KSrtp; - RDictionaryWriteStream out5; - out5.AssignLC (*MyDStore,FileUid); - out5.WriteInt32L (iSettings.B_srtp()); - out5.CommitL(); - CleanupStack::PopAndDestroy (1);// out1 - - FileUid.iUid = KIce; - RDictionaryWriteStream out6; - out6.AssignLC (*MyDStore,FileUid); - out6.WriteInt32L (iSettings.B_ice()); - out6.CommitL(); - CleanupStack::PopAndDestroy (1);// out1 - - MyDStore->CommitL(); - CleanupStack::PopAndDestroy (1);// Store - -} - - -/** + path.Append( pathWithoutDrive ); + path.Append( KtxDicFileName ); + + TFindFile AufFolder(CCoeEnv::Static()->FsSession()); + if(KErrNone == AufFolder.FindByDir(path, KNullDesC)) + { + User::LeaveIfError(CCoeEnv::Static()->FsSession().Delete(AufFolder.File())); + } + + CDictionaryFileStore* MyDStore = CDictionaryFileStore::OpenLC(CCoeEnv::Static()->FsSession(),path, TUid::Uid(1)); + + TUid FileUid = {0x0}; + + FileUid.iUid = KRegistrar; + RDictionaryWriteStream out1; + out1.AssignLC(*MyDStore,FileUid); + out1 << iSettings.Ed_registrar(); + out1.CommitL(); + CleanupStack::PopAndDestroy(1);// out2 + + FileUid.iUid = KUsername; + RDictionaryWriteStream out2; + out2.AssignLC(*MyDStore,FileUid); + out2 << iSettings.Ed_user(); + out2.CommitL(); + CleanupStack::PopAndDestroy(1);// out2 + + FileUid.iUid = KPassword; + RDictionaryWriteStream out3; + out3.AssignLC(*MyDStore,FileUid); + out3 << iSettings.Ed_password(); + out3.CommitL(); + CleanupStack::PopAndDestroy(1);// out2 + + FileUid.iUid = KStunServer; + RDictionaryWriteStream out4; + out4.AssignLC(*MyDStore,FileUid); + out4 << iSettings.Ed_stun_server(); + out4.CommitL(); + CleanupStack::PopAndDestroy(1);// out2 + + FileUid.iUid = KSrtp; + RDictionaryWriteStream out5; + out5.AssignLC(*MyDStore,FileUid); + out5.WriteInt32L(iSettings.B_srtp()); + out5.CommitL(); + CleanupStack::PopAndDestroy(1);// out1 + + FileUid.iUid = KIce; + RDictionaryWriteStream out6; + out6.AssignLC(*MyDStore,FileUid); + out6.WriteInt32L(iSettings.B_ice()); + out6.CommitL(); + CleanupStack::PopAndDestroy(1);// out1 + + MyDStore->CommitL(); + CleanupStack::PopAndDestroy(1);// Store + + } + + +/** * Handle global resource changes, such as scalable UI or skin events (override) */ -void CSymbian_ua_guiSettingItemList::HandleResourceChange (TInt aType) -{ - CAknSettingItemList::HandleResourceChange (aType); - SetRect (iAvkonViewAppUi->View (TUid::Uid (ESymbian_ua_guiSettingItemListViewId))->ClientRect()); - // [[[ begin generated region: do not modify [Generated Contents] - // ]]] end generated region [Generated Contents] - -} - -/** +void CSymbian_ua_guiSettingItemList::HandleResourceChange( TInt aType ) + { + CAknSettingItemList::HandleResourceChange( aType ); + SetRect( iAvkonViewAppUi->View( TUid::Uid( ESymbian_ua_guiSettingItemListViewId ) )->ClientRect() ); + // [[[ begin generated region: do not modify [Generated Contents] + // ]]] end generated region [Generated Contents] + + } + +/** * Handle key event (override) * @param aKeyEvent key event * @param aType event code * @return EKeyWasConsumed if the event was handled, else EKeyWasNotConsumed */ -TKeyResponse CSymbian_ua_guiSettingItemList::OfferKeyEventL ( - const TKeyEvent& aKeyEvent, - TEventCode aType) -{ - // [[[ begin generated region: do not modify [Generated Contents] - // ]]] end generated region [Generated Contents] - - if (aKeyEvent.iCode == EKeyLeftArrow - || aKeyEvent.iCode == EKeyRightArrow) { - // allow the tab control to get the arrow keys - return EKeyWasNotConsumed; - } - - return CAknSettingItemList::OfferKeyEventL (aKeyEvent, aType); -} - +TKeyResponse CSymbian_ua_guiSettingItemList::OfferKeyEventL( + const TKeyEvent& aKeyEvent, + TEventCode aType ) + { + // [[[ begin generated region: do not modify [Generated Contents] + // ]]] end generated region [Generated Contents] + + if ( aKeyEvent.iCode == EKeyLeftArrow + || aKeyEvent.iCode == EKeyRightArrow ) + { + // allow the tab control to get the arrow keys + return EKeyWasNotConsumed; + } + + return CAknSettingItemList::OfferKeyEventL( aKeyEvent, aType ); + } + diff --git a/sflphone-common/libs/pjproject/pjsip-apps/src/symbian_ua_gui/src/symbian_ua_guiSettingItemListView.cpp b/sflphone-common/libs/pjproject/pjsip-apps/src/symbian_ua_gui/src/symbian_ua_guiSettingItemListView.cpp index 2a158b4bb501e994f02206f14f4330c86a027094..243ff994c57092b657a7f86bcee643b8393be22e 100644 --- a/sflphone-common/libs/pjproject/pjsip-apps/src/symbian_ua_gui/src/symbian_ua_guiSettingItemListView.cpp +++ b/sflphone-common/libs/pjproject/pjsip-apps/src/symbian_ua_gui/src/symbian_ua_guiSettingItemListView.cpp @@ -3,7 +3,7 @@ Name : symbian_ua_guiSettingItemListView.cpp Author : nanang Copyright : (c) 2008-2009 Teluu Inc. - Description : + Description : ======================================================================== */ // [[[ begin generated region: do not modify [Generated System Includes] @@ -36,22 +36,21 @@ * code that could leave. */ Csymbian_ua_guiSettingItemListView::Csymbian_ua_guiSettingItemListView() -{ - // [[[ begin generated region: do not modify [Generated Contents] - // ]]] end generated region [Generated Contents] - -} - -/** + { + // [[[ begin generated region: do not modify [Generated Contents] + // ]]] end generated region [Generated Contents] + + } +/** * The view's destructor removes the container from the control * stack and destroys it. */ Csymbian_ua_guiSettingItemListView::~Csymbian_ua_guiSettingItemListView() -{ - // [[[ begin generated region: do not modify [Generated Contents] - // ]]] end generated region [Generated Contents] - -} + { + // [[[ begin generated region: do not modify [Generated Contents] + // ]]] end generated region [Generated Contents] + + } /** * Symbian two-phase constructor. @@ -60,11 +59,11 @@ Csymbian_ua_guiSettingItemListView::~Csymbian_ua_guiSettingItemListView() * @return new instance of Csymbian_ua_guiSettingItemListView */ Csymbian_ua_guiSettingItemListView* Csymbian_ua_guiSettingItemListView::NewL() -{ - Csymbian_ua_guiSettingItemListView* self = Csymbian_ua_guiSettingItemListView::NewLC(); - CleanupStack::Pop (self); - return self; -} + { + Csymbian_ua_guiSettingItemListView* self = Csymbian_ua_guiSettingItemListView::NewLC(); + CleanupStack::Pop( self ); + return self; + } /** * Symbian two-phase constructor. @@ -73,219 +72,214 @@ Csymbian_ua_guiSettingItemListView* Csymbian_ua_guiSettingItemListView::NewL() * @return new instance of Csymbian_ua_guiSettingItemListView */ Csymbian_ua_guiSettingItemListView* Csymbian_ua_guiSettingItemListView::NewLC() -{ - Csymbian_ua_guiSettingItemListView* self = new (ELeave) Csymbian_ua_guiSettingItemListView(); - CleanupStack::PushL (self); - self->ConstructL(); - return self; -} + { + Csymbian_ua_guiSettingItemListView* self = new ( ELeave ) Csymbian_ua_guiSettingItemListView(); + CleanupStack::PushL( self ); + self->ConstructL(); + return self; + } /** - * Second-phase constructor for view. + * Second-phase constructor for view. * Initialize contents from resource. - */ + */ void Csymbian_ua_guiSettingItemListView::ConstructL() -{ - // [[[ begin generated region: do not modify [Generated Code] - BaseConstructL (R_SYMBIAN_UA_GUI_SETTING_ITEM_LIST_SYMBIAN_UA_GUI_SETTING_ITEM_LIST_VIEW); - // ]]] end generated region [Generated Code] - - // add your own initialization code here -} - + { + // [[[ begin generated region: do not modify [Generated Code] + BaseConstructL( R_SYMBIAN_UA_GUI_SETTING_ITEM_LIST_SYMBIAN_UA_GUI_SETTING_ITEM_LIST_VIEW ); + // ]]] end generated region [Generated Code] + + // add your own initialization code here + } + /** * @return The UID for this view */ TUid Csymbian_ua_guiSettingItemListView::Id() const -{ - return TUid::Uid (ESymbian_ua_guiSettingItemListViewId); -} + { + return TUid::Uid( ESymbian_ua_guiSettingItemListViewId ); + } /** * Handle a command for this view (override) * @param aCommand command id to be handled */ -void Csymbian_ua_guiSettingItemListView::HandleCommandL (TInt aCommand) -{ - // [[[ begin generated region: do not modify [Generated Code] - TBool commandHandled = EFalse; - - switch (aCommand) { // code to dispatch to the AknView's menu and CBA commands is generated here - - case EAknSoftkeySave: - commandHandled = HandleControlPaneRightSoftKeyPressedL (aCommand); - break; - - case ESymbian_ua_guiSettingItemListViewMenuItem1Command: - commandHandled = HandleChangeSelectedSettingItemL (aCommand); - break; - - default: - break; - } - - - if (!commandHandled) { - - } - - // ]]] end generated region [Generated Code] - -} +void Csymbian_ua_guiSettingItemListView::HandleCommandL( TInt aCommand ) + { + // [[[ begin generated region: do not modify [Generated Code] + TBool commandHandled = EFalse; + switch ( aCommand ) + { // code to dispatch to the AknView's menu and CBA commands is generated here + + case EAknSoftkeySave: + commandHandled = HandleControlPaneRightSoftKeyPressedL( aCommand ); + break; + case ESymbian_ua_guiSettingItemListViewMenuItem1Command: + commandHandled = HandleChangeSelectedSettingItemL( aCommand ); + break; + default: + break; + } + + + if ( !commandHandled ) + { + + } + // ]]] end generated region [Generated Code] + + } /** - * Handles user actions during activation of the view, + * Handles user actions during activation of the view, * such as initializing the content. */ -void Csymbian_ua_guiSettingItemListView::DoActivateL ( - const TVwsViewId& /*aPrevViewId*/, - TUid /*aCustomMessageId*/, - const TDesC8& /*aCustomMessage*/) -{ - // [[[ begin generated region: do not modify [Generated Contents] - SetupStatusPaneL(); - - CEikButtonGroupContainer* cba = AppUi()->Cba(); - - if (cba != NULL) { - cba->MakeVisible (EFalse); - } - - if (iSymbian_ua_guiSettingItemList == NULL) { - iSettings = TSymbian_ua_guiSettingItemListSettings::NewL(); - iSymbian_ua_guiSettingItemList = new (ELeave) CSymbian_ua_guiSettingItemList (*iSettings, this); - iSymbian_ua_guiSettingItemList->SetMopParent (this); - iSymbian_ua_guiSettingItemList->ConstructFromResourceL (R_SYMBIAN_UA_GUI_SETTING_ITEM_LIST_SYMBIAN_UA_GUI_SETTING_ITEM_LIST); - iSymbian_ua_guiSettingItemList->ActivateL(); - iSymbian_ua_guiSettingItemList->LoadSettingValuesL(); - iSymbian_ua_guiSettingItemList->LoadSettingsL(); - AppUi()->AddToStackL (*this, iSymbian_ua_guiSettingItemList); - } - - // ]]] end generated region [Generated Contents] - -} +void Csymbian_ua_guiSettingItemListView::DoActivateL( + const TVwsViewId& /*aPrevViewId*/, + TUid /*aCustomMessageId*/, + const TDesC8& /*aCustomMessage*/ ) + { + // [[[ begin generated region: do not modify [Generated Contents] + SetupStatusPaneL(); + + CEikButtonGroupContainer* cba = AppUi()->Cba(); + if ( cba != NULL ) + { + cba->MakeVisible( EFalse ); + } + + if ( iSymbian_ua_guiSettingItemList == NULL ) + { + iSettings = TSymbian_ua_guiSettingItemListSettings::NewL(); + iSymbian_ua_guiSettingItemList = new ( ELeave ) CSymbian_ua_guiSettingItemList( *iSettings, this ); + iSymbian_ua_guiSettingItemList->SetMopParent( this ); + iSymbian_ua_guiSettingItemList->ConstructFromResourceL( R_SYMBIAN_UA_GUI_SETTING_ITEM_LIST_SYMBIAN_UA_GUI_SETTING_ITEM_LIST ); + iSymbian_ua_guiSettingItemList->ActivateL(); + iSymbian_ua_guiSettingItemList->LoadSettingValuesL(); + iSymbian_ua_guiSettingItemList->LoadSettingsL(); + AppUi()->AddToStackL( *this, iSymbian_ua_guiSettingItemList ); + } + // ]]] end generated region [Generated Contents] + + } /** */ void Csymbian_ua_guiSettingItemListView::DoDeactivate() -{ - // [[[ begin generated region: do not modify [Generated Contents] - CleanupStatusPane(); - - CEikButtonGroupContainer* cba = AppUi()->Cba(); - - if (cba != NULL) { - cba->MakeVisible (ETrue); - cba->DrawDeferred(); - } - - if (iSymbian_ua_guiSettingItemList != NULL) { - AppUi()->RemoveFromStack (iSymbian_ua_guiSettingItemList); - delete iSymbian_ua_guiSettingItemList; - iSymbian_ua_guiSettingItemList = NULL; - delete iSettings; - iSettings = NULL; - } - - // ]]] end generated region [Generated Contents] - -} + { + // [[[ begin generated region: do not modify [Generated Contents] + CleanupStatusPane(); + + CEikButtonGroupContainer* cba = AppUi()->Cba(); + if ( cba != NULL ) + { + cba->MakeVisible( ETrue ); + cba->DrawDeferred(); + } + + if ( iSymbian_ua_guiSettingItemList != NULL ) + { + AppUi()->RemoveFromStack( iSymbian_ua_guiSettingItemList ); + delete iSymbian_ua_guiSettingItemList; + iSymbian_ua_guiSettingItemList = NULL; + delete iSettings; + iSettings = NULL; + } + // ]]] end generated region [Generated Contents] + + } // [[[ begin generated function: do not modify void Csymbian_ua_guiSettingItemListView::SetupStatusPaneL() -{ - // reset the context pane - TUid contextPaneUid = TUid::Uid (EEikStatusPaneUidContext); - CEikStatusPaneBase::TPaneCapabilities subPaneContext = - StatusPane()->PaneCapabilities (contextPaneUid); - - if (subPaneContext.IsPresent() && subPaneContext.IsAppOwned()) { - CAknContextPane* context = static_cast< CAknContextPane* > ( - StatusPane()->ControlL (contextPaneUid)); - context->SetPictureToDefaultL(); - } - - // setup the title pane - TUid titlePaneUid = TUid::Uid (EEikStatusPaneUidTitle); - - CEikStatusPaneBase::TPaneCapabilities subPaneTitle = - StatusPane()->PaneCapabilities (titlePaneUid); - - if (subPaneTitle.IsPresent() && subPaneTitle.IsAppOwned()) { - CAknTitlePane* title = static_cast< CAknTitlePane* > ( - StatusPane()->ControlL (titlePaneUid)); - TResourceReader reader; - iEikonEnv->CreateResourceReaderLC (reader, R_SYMBIAN_UA_GUI_SETTING_ITEM_LIST_TITLE_RESOURCE); - title->SetFromResourceL (reader); - CleanupStack::PopAndDestroy(); // reader internal state - } - -} - + { + // reset the context pane + TUid contextPaneUid = TUid::Uid( EEikStatusPaneUidContext ); + CEikStatusPaneBase::TPaneCapabilities subPaneContext = + StatusPane()->PaneCapabilities( contextPaneUid ); + if ( subPaneContext.IsPresent() && subPaneContext.IsAppOwned() ) + { + CAknContextPane* context = static_cast< CAknContextPane* > ( + StatusPane()->ControlL( contextPaneUid ) ); + context->SetPictureToDefaultL(); + } + + // setup the title pane + TUid titlePaneUid = TUid::Uid( EEikStatusPaneUidTitle ); + CEikStatusPaneBase::TPaneCapabilities subPaneTitle = + StatusPane()->PaneCapabilities( titlePaneUid ); + if ( subPaneTitle.IsPresent() && subPaneTitle.IsAppOwned() ) + { + CAknTitlePane* title = static_cast< CAknTitlePane* >( + StatusPane()->ControlL( titlePaneUid ) ); + TResourceReader reader; + iEikonEnv->CreateResourceReaderLC( reader, R_SYMBIAN_UA_GUI_SETTING_ITEM_LIST_TITLE_RESOURCE ); + title->SetFromResourceL( reader ); + CleanupStack::PopAndDestroy(); // reader internal state + } + + } // ]]] end generated function // [[[ begin generated function: do not modify void Csymbian_ua_guiSettingItemListView::CleanupStatusPane() -{ -} - + { + } // ]]] end generated function -/** +/** * Handle status pane size change for this view (override) */ void Csymbian_ua_guiSettingItemListView::HandleStatusPaneSizeChange() -{ - CAknView::HandleStatusPaneSizeChange(); - - // this may fail, but we're not able to propagate exceptions here - TInt result; - TRAP (result, SetupStatusPaneL()); -} - -/** + { + CAknView::HandleStatusPaneSizeChange(); + + // this may fail, but we're not able to propagate exceptions here + TInt result; + TRAP( result, SetupStatusPaneL() ); + } + +/** * Handle the selected event. * @param aCommand the command id invoked * @return ETrue if the command was handled, EFalse if not */ -TBool Csymbian_ua_guiSettingItemListView::HandleChangeSelectedSettingItemL (TInt aCommand) -{ - iSymbian_ua_guiSettingItemList->ChangeSelectedItemL(); - return ETrue; -} - -/** +TBool Csymbian_ua_guiSettingItemListView::HandleChangeSelectedSettingItemL( TInt aCommand ) + { + iSymbian_ua_guiSettingItemList->ChangeSelectedItemL(); + return ETrue; + } + +/** * Handle the rightSoftKeyPressed event. * @return ETrue if the command was handled, EFalse if not */ -TBool Csymbian_ua_guiSettingItemListView::HandleControlPaneRightSoftKeyPressedL (TInt aCommand) -{ - TUint8 domain[256] = {0}; - TPtr8 cDomain (domain, sizeof (domain)); - TUint8 user[64] = {0}; - TPtr8 cUser (user, sizeof (user)); - TUint8 pass[64] = {0}; - TPtr8 cPass (pass, sizeof (pass)); - - cDomain.Copy (iSettings->Ed_registrar()); - cUser.Copy (iSettings->Ed_user()); - cPass.Copy (iSettings->Ed_password()); - symbian_ua_set_account ( (char*) domain, (char*) user, (char*) pass, false, false); - - AppUi()->ActivateLocalViewL (TUid::Uid (ESymbian_ua_guiContainerViewId)); - return ETrue; -} - -/** +TBool Csymbian_ua_guiSettingItemListView::HandleControlPaneRightSoftKeyPressedL( TInt aCommand ) + { + TUint8 domain[256] = {0}; + TPtr8 cDomain(domain, sizeof(domain)); + TUint8 user[64] = {0}; + TPtr8 cUser(user, sizeof(user)); + TUint8 pass[64] = {0}; + TPtr8 cPass(pass, sizeof(pass)); + + cDomain.Copy(iSettings->Ed_registrar()); + cUser.Copy(iSettings->Ed_user()); + cPass.Copy(iSettings->Ed_password()); + symbian_ua_set_account((char*)domain, (char*)user, (char*)pass, false, false); + + AppUi()->ActivateLocalViewL(TUid::Uid(ESymbian_ua_guiContainerViewId)); + return ETrue; + } + +/** * Handle the selected event. * @param aCommand the command id invoked * @return ETrue if the command was handled, EFalse if not */ -TBool Csymbian_ua_guiSettingItemListView::HandleCancelMenuItemSelectedL (TInt aCommand) -{ - AppUi()->ActivateLocalViewL (TUid::Uid (ESymbian_ua_guiContainerViewId)); - return ETrue; -} - +TBool Csymbian_ua_guiSettingItemListView::HandleCancelMenuItemSelectedL( TInt aCommand ) + { + AppUi()->ActivateLocalViewL(TUid::Uid(ESymbian_ua_guiContainerViewId)); + return ETrue; + } + diff --git a/sflphone-common/libs/pjproject/pjsip-apps/src/symsndtest/app_main.cpp b/sflphone-common/libs/pjproject/pjsip-apps/src/symsndtest/app_main.cpp index b4c95f7b078771a784a8736d538bfe58a9093931..b270fa71b2efca391ffd58cc25f9875f6252fd26 100644 --- a/sflphone-common/libs/pjproject/pjsip-apps/src/symsndtest/app_main.cpp +++ b/sflphone-common/libs/pjproject/pjsip-apps/src/symsndtest/app_main.cpp @@ -1,5 +1,5 @@ /* $Id: app_main.cpp 2821 2009-06-30 13:37:26Z nanang $ */ -/* +/* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> * @@ -15,7 +15,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include <pjmedia-audiodev/audiodev.h> #include <pjmedia/delaybuf.h> @@ -45,24 +45,24 @@ pj_pool_t *pool; pjmedia_delay_buf *delaybuf; /* Logging callback */ -static void log_writer (int level, const char *buf, unsigned len) +static void log_writer(int level, const char *buf, unsigned len) { static wchar_t buf16[PJ_LOG_MAX_SIZE]; - PJ_UNUSED_ARG (level); + PJ_UNUSED_ARG(level); - pj_ansi_to_unicode (buf, len, buf16, PJ_ARRAY_SIZE (buf16)); + pj_ansi_to_unicode(buf, len, buf16, PJ_ARRAY_SIZE(buf16)); - TPtrC16 aBuf ( (const TUint16*) buf16, (TInt) len); - console->Write (aBuf); + TPtrC16 aBuf((const TUint16*)buf16, (TInt)len); + console->Write(aBuf); } /* perror util */ -static void app_perror (const char *title, pj_status_t status) +static void app_perror(const char *title, pj_status_t status) { char errmsg[PJ_ERR_MSG_SIZE]; - pj_strerror (status, errmsg, sizeof (errmsg)); - PJ_LOG (1, (THIS_FILE, "Error: %s: %s", title, errmsg)); + pj_strerror(status, errmsg, sizeof(errmsg)); + PJ_LOG(1,(THIS_FILE, "Error: %s: %s", title, errmsg)); } /* Application init */ @@ -72,65 +72,59 @@ static pj_status_t app_init() pj_status_t status; /* Redirect log */ - pj_log_set_log_func ( (void (*) (int,const char*,int)) &log_writer); - pj_log_set_decor (PJ_LOG_HAS_NEWLINE); - pj_log_set_level (3); + pj_log_set_log_func((void (*)(int,const char*,int)) &log_writer); + pj_log_set_decor(PJ_LOG_HAS_NEWLINE); + pj_log_set_level(3); /* Init pjlib */ status = pj_init(); - if (status != PJ_SUCCESS) { - app_perror ("pj_init()", status); - return status; + app_perror("pj_init()", status); + return status; } - pj_caching_pool_init (&cp, NULL, 0); + pj_caching_pool_init(&cp, NULL, 0); /* Init sound subsystem */ - status = pjmedia_aud_subsys_init (&cp.factory); - + status = pjmedia_aud_subsys_init(&cp.factory); if (status != PJ_SUCCESS) { - app_perror ("pjmedia_snd_init()", status); - pj_caching_pool_destroy (&cp); - pj_shutdown(); - return status; + app_perror("pjmedia_snd_init()", status); + pj_caching_pool_destroy(&cp); + pj_shutdown(); + return status; } count = pjmedia_aud_dev_count(); - - PJ_LOG (3, (THIS_FILE, "Device count: %d", count)); - + PJ_LOG(3,(THIS_FILE, "Device count: %d", count)); for (i=0; i<count; ++i) { - pjmedia_aud_dev_info info; - pj_status_t status; - - status = pjmedia_aud_dev_get_info (i, &info); - pj_assert (status == PJ_SUCCESS); - PJ_LOG (3, (THIS_FILE, "%d: %s %d/%d %dHz", - i, info.name, info.input_count, info.output_count, - info.default_samples_per_sec)); + pjmedia_aud_dev_info info; + pj_status_t status; + + status = pjmedia_aud_dev_get_info(i, &info); + pj_assert(status == PJ_SUCCESS); + PJ_LOG(3, (THIS_FILE, "%d: %s %d/%d %dHz", + i, info.name, info.input_count, info.output_count, + info.default_samples_per_sec)); } /* Create pool */ - pool = pj_pool_create (&cp.factory, THIS_FILE, 512, 512, NULL); - + pool = pj_pool_create(&cp.factory, THIS_FILE, 512, 512, NULL); if (pool == NULL) { - app_perror ("pj_pool_create()", status); - pj_caching_pool_destroy (&cp); - pj_shutdown(); - return status; + app_perror("pj_pool_create()", status); + pj_caching_pool_destroy(&cp); + pj_shutdown(); + return status; } /* Init delay buffer */ - status = pjmedia_delay_buf_create (pool, THIS_FILE, CLOCK_RATE, - SAMPLES_PER_FRAME, CHANNEL_COUNT, - 0, 0, &delaybuf); - + status = pjmedia_delay_buf_create(pool, THIS_FILE, CLOCK_RATE, + SAMPLES_PER_FRAME, CHANNEL_COUNT, + 0, 0, &delaybuf); if (status != PJ_SUCCESS) { - app_perror ("pjmedia_delay_buf_create()", status); + app_perror("pjmedia_delay_buf_create()", status); //pj_caching_pool_destroy(&cp); - //pj_shutdown(); - //return status; + //pj_shutdown(); + //return status; } return PJ_SUCCESS; @@ -138,30 +132,29 @@ static pj_status_t app_init() /* Sound capture callback */ -static pj_status_t rec_cb (void *user_data, - pjmedia_frame *frame) +static pj_status_t rec_cb(void *user_data, + pjmedia_frame *frame) { - PJ_UNUSED_ARG (user_data); + PJ_UNUSED_ARG(user_data); - pjmedia_delay_buf_put (delaybuf, (pj_int16_t*) frame->buf); + pjmedia_delay_buf_put(delaybuf, (pj_int16_t*)frame->buf); if (frame->size != SAMPLES_PER_FRAME*2) { - PJ_LOG (3, (THIS_FILE, "Size captured = %u", - frame->size)); + PJ_LOG(3, (THIS_FILE, "Size captured = %u", + frame->size)); } ++rec_cnt; - return PJ_SUCCESS; } /* Play cb */ -static pj_status_t play_cb (void *user_data, - pjmedia_frame *frame) +static pj_status_t play_cb(void *user_data, + pjmedia_frame *frame) { - PJ_UNUSED_ARG (user_data); + PJ_UNUSED_ARG(user_data); - pjmedia_delay_buf_get (delaybuf, (pj_int16_t*) frame->buf); + pjmedia_delay_buf_get(delaybuf, (pj_int16_t*)frame->buf); frame->size = SAMPLES_PER_FRAME*2; frame->type = PJMEDIA_FRAME_TYPE_AUDIO; @@ -170,43 +163,39 @@ static pj_status_t play_cb (void *user_data, } /* Start sound */ -static pj_status_t snd_start (unsigned flag) +static pj_status_t snd_start(unsigned flag) { pjmedia_aud_param param; pj_status_t status; if (strm != NULL) { - app_perror ("snd already open", PJ_EINVALIDOP); - return PJ_EINVALIDOP; + app_perror("snd already open", PJ_EINVALIDOP); + return PJ_EINVALIDOP; } - pjmedia_aud_dev_default_param (0, ¶m); - + pjmedia_aud_dev_default_param(0, ¶m); param.channel_count = CHANNEL_COUNT; param.clock_rate = CLOCK_RATE; param.samples_per_frame = SAMPLES_PER_FRAME; param.dir = (pjmedia_dir) flag; - status = pjmedia_aud_stream_create (¶m, &rec_cb, &play_cb, NULL, &strm); - + status = pjmedia_aud_stream_create(¶m, &rec_cb, &play_cb, NULL, &strm); if (status != PJ_SUCCESS) { - app_perror ("snd open", status); - return status; + app_perror("snd open", status); + return status; } rec_cnt = play_cnt = 0; + pj_gettimeofday(&t_start); - pj_gettimeofday (&t_start); - - pjmedia_delay_buf_reset (delaybuf); - - status = pjmedia_aud_stream_start (strm); + pjmedia_delay_buf_reset(delaybuf); + status = pjmedia_aud_stream_start(strm); if (status != PJ_SUCCESS) { - app_perror ("snd start", status); - pjmedia_aud_stream_destroy (strm); - strm = NULL; - return status; + app_perror("snd start", status); + pjmedia_aud_stream_destroy(strm); + strm = NULL; + return status; } return PJ_SUCCESS; @@ -219,26 +208,23 @@ static pj_status_t snd_stop() pj_status_t status; if (strm == NULL) { - app_perror ("snd not open", PJ_EINVALIDOP); - return PJ_EINVALIDOP; + app_perror("snd not open", PJ_EINVALIDOP); + return PJ_EINVALIDOP; } - status = pjmedia_aud_stream_stop (strm); - + status = pjmedia_aud_stream_stop(strm); if (status != PJ_SUCCESS) { - app_perror ("snd failed to stop", status); + app_perror("snd failed to stop", status); } - - status = pjmedia_aud_stream_destroy (strm); - + status = pjmedia_aud_stream_destroy(strm); strm = NULL; - pj_gettimeofday (&now); - PJ_TIME_VAL_SUB (now, t_start); + pj_gettimeofday(&now); + PJ_TIME_VAL_SUB(now, t_start); - PJ_LOG (3, (THIS_FILE, "Duration: %d.%03d", now.sec, now.msec)); - PJ_LOG (3, (THIS_FILE, "Captured: %d", rec_cnt)); - PJ_LOG (3, (THIS_FILE, "Played: %d", play_cnt)); + PJ_LOG(3,(THIS_FILE, "Duration: %d.%03d", now.sec, now.msec)); + PJ_LOG(3,(THIS_FILE, "Captured: %d", rec_cnt)); + PJ_LOG(3,(THIS_FILE, "Played: %d", play_cnt)); return status; } @@ -247,16 +233,12 @@ static pj_status_t snd_stop() static void app_fini() { if (strm) - snd_stop(); + snd_stop(); pjmedia_aud_subsys_shutdown(); - - pjmedia_delay_buf_destroy (delaybuf); - - pj_pool_release (pool); - - pj_caching_pool_destroy (&cp); - + pjmedia_delay_buf_destroy(delaybuf); + pj_pool_release(pool); + pj_caching_pool_destroy(&cp); pj_shutdown(); } @@ -269,38 +251,37 @@ static void app_fini() class ConsoleUI : public CActive { +public: + ConsoleUI(CConsoleBase *con); - public: - ConsoleUI (CConsoleBase *con); - - // Run console UI - void Run(); + // Run console UI + void Run(); - // Stop - void Stop(); + // Stop + void Stop(); - protected: - // Cancel asynchronous read. - void DoCancel(); +protected: + // Cancel asynchronous read. + void DoCancel(); - // Implementation: called when read has completed. - void RunL(); + // Implementation: called when read has completed. + void RunL(); - private: - CConsoleBase *con_; +private: + CConsoleBase *con_; }; -ConsoleUI::ConsoleUI (CConsoleBase *con) - : CActive (EPriorityUserInput), con_ (con) +ConsoleUI::ConsoleUI(CConsoleBase *con) +: CActive(EPriorityUserInput), con_(con) { - CActiveScheduler::Add (this); + CActiveScheduler::Add(this); } // Run console UI void ConsoleUI::Run() { - con_->Read (iStatus); + con_->Read(iStatus); SetActive(); } @@ -318,13 +299,13 @@ void ConsoleUI::DoCancel() static void PrintMenu() { - PJ_LOG (3, (THIS_FILE, "\n\n" - "Menu:\n" - " a Start bidir sound\n" - " t Start recorder\n" - " p Start player\n" - " d Stop & close sound\n" - " w Quit\n")); + PJ_LOG(3, (THIS_FILE, "\n\n" + "Menu:\n" + " a Start bidir sound\n" + " t Start recorder\n" + " p Start player\n" + " d Stop & close sound\n" + " w Quit\n")); } // Implementation: called when read has completed. @@ -334,39 +315,33 @@ void ConsoleUI::RunL() pj_bool_t reschedule = PJ_TRUE; switch (kc) { - - case 'w': - snd_stop(); - CActiveScheduler::Stop(); - reschedule = PJ_FALSE; - break; - - case 'a': - snd_start (PJMEDIA_DIR_CAPTURE_PLAYBACK); - break; - - case 't': - snd_start (PJMEDIA_DIR_CAPTURE); - break; - - case 'p': - snd_start (PJMEDIA_DIR_PLAYBACK); - break; - - case 'd': - snd_stop(); - break; - - default: - PJ_LOG (3, (THIS_FILE, "Keycode '%c' (%d) is pressed", - kc, kc)); - break; + case 'w': + snd_stop(); + CActiveScheduler::Stop(); + reschedule = PJ_FALSE; + break; + case 'a': + snd_start(PJMEDIA_DIR_CAPTURE_PLAYBACK); + break; + case 't': + snd_start(PJMEDIA_DIR_CAPTURE); + break; + case 'p': + snd_start(PJMEDIA_DIR_PLAYBACK); + break; + case 'd': + snd_stop(); + break; + default: + PJ_LOG(3,(THIS_FILE, "Keycode '%c' (%d) is pressed", + kc, kc)); + break; } PrintMenu(); if (reschedule) - Run(); + Run(); } @@ -377,18 +352,16 @@ int app_main() return -1; // Run the UI - ConsoleUI *con = new ConsoleUI (console); + ConsoleUI *con = new ConsoleUI(console); con->Run(); PrintMenu(); - CActiveScheduler::Start(); delete con; app_fini(); - return 0; } diff --git a/sflphone-common/libs/pjproject/pjsip-apps/src/symsndtest/main_symbian.cpp b/sflphone-common/libs/pjproject/pjsip-apps/src/symsndtest/main_symbian.cpp index 6b1a92f6b3f19f6f3cfa135ebfcadf8331c2f61d..5ed4eb83ee1f7cd6a95611455129221fb5f881a9 100644 --- a/sflphone-common/libs/pjproject/pjsip-apps/src/symsndtest/main_symbian.cpp +++ b/sflphone-common/libs/pjproject/pjsip-apps/src/symsndtest/main_symbian.cpp @@ -1,5 +1,5 @@ /* $Id: main_symbian.cpp 2506 2009-03-12 18:11:37Z bennylp $ */ -/* +/* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> * @@ -15,7 +15,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include <e32std.h> @@ -29,7 +29,7 @@ CConsoleBase* console; // Needed by APS -TPtrC APP_UID = _L ("A000000E"); +TPtrC APP_UID = _L("A000000E"); int app_main(); @@ -39,13 +39,13 @@ int app_main(); LOCAL_C void DoStartL() { CActiveScheduler *scheduler = new (ELeave) CActiveScheduler; - CleanupStack::PushL (scheduler); - CActiveScheduler::Install (scheduler); + CleanupStack::PushL(scheduler); + CActiveScheduler::Install(scheduler); app_main(); - CActiveScheduler::Install (NULL); - CleanupStack::Pop (scheduler); + CActiveScheduler::Install(NULL); + CleanupStack::Pop(scheduler); delete scheduler; } @@ -62,25 +62,22 @@ GLDEF_C TInt E32Main() CTrapCleanup* cleanup = CTrapCleanup::New(); // Create output console - TRAPD (createError, console = Console::NewL (_L ("Console"), TSize (KConsFullScreen,KConsFullScreen))); - + TRAPD(createError, console = Console::NewL(_L("Console"), TSize(KConsFullScreen,KConsFullScreen))); if (createError) return createError; - TRAPD (startError, DoStartL()); + TRAPD(startError, DoStartL()); //console->Printf(_L("[press any key to close]\n")); //console->Getch(); delete console; - delete cleanup; CloseSTDLIB(); // Mark end of heap usage, detect memory leaks __UHEAP_MARKEND; - return KErrNone; } diff --git a/sflphone-common/libs/pjproject/pjsip/build/Makefile b/sflphone-common/libs/pjproject/pjsip/build/Makefile index fe5937d0a3f9374681f50d22e40c06e368138bf5..d825db83bbce5cdadf8b6556d3aa077440ec4ab2 100644 --- a/sflphone-common/libs/pjproject/pjsip/build/Makefile +++ b/sflphone-common/libs/pjproject/pjsip/build/Makefile @@ -8,15 +8,15 @@ include $(PJDIR)/build/common.mak RULES_MAK := $(PJDIR)/build/rules.mak -PJLIB_LIB:=../../pjlib/lib/libpj-sfl-$(TARGET_NAME)$(LIBEXT) -PJLIB_UTIL_LIB:=../../pjlib-util/lib/libpjlib-util-sfl-$(TARGET_NAME)$(LIBEXT) -PJMEDIA_LIB:=../../pjmedia/lib/libpjmedia-sfl-$(TARGET_NAME)$(LIBEXT) -PJMEDIA_CODEC_LIB:=../../pjmedia/lib/libpjmedia-codec-sfl-$(TARGET_NAME)$(LIBEXT) +PJLIB_LIB:=../../pjlib/lib/libpj-$(TARGET_NAME)$(LIBEXT) +PJLIB_UTIL_LIB:=../../pjlib-util/lib/libpjlib-util-$(TARGET_NAME)$(LIBEXT) +PJMEDIA_LIB:=../../pjmedia/lib/libpjmedia-$(TARGET_NAME)$(LIBEXT) +PJMEDIA_CODEC_LIB:=../../pjmedia/lib/libpjmedia-codec-$(TARGET_NAME)$(LIBEXT) -export PJSIP_LIB:=../lib/libpjsip-sfl-$(TARGET_NAME)$(LIBEXT) -export PJSIP_UA_LIB:=../lib/libpjsip-ua-sfl-$(TARGET_NAME)$(LIBEXT) -export PJSIP_SIMPLE_LIB:=../lib/libpjsip-simple-sfl-$(TARGET_NAME)$(LIBEXT) -export PJSUA_LIB_LIB=../lib/libpjsua-sfl-$(TARGET_NAME)$(LIBEXT) +export PJSIP_LIB:=../lib/libpjsip-$(TARGET_NAME)$(LIBEXT) +export PJSIP_UA_LIB:=../lib/libpjsip-ua-$(TARGET_NAME)$(LIBEXT) +export PJSIP_SIMPLE_LIB:=../lib/libpjsip-simple-$(TARGET_NAME)$(LIBEXT) +export PJSUA_LIB_LIB=../lib/libpjsua-$(TARGET_NAME)$(LIBEXT) ############################################################################### @@ -41,7 +41,7 @@ export PJSIP_OBJS += $(OS_OBJS) $(M_OBJS) $(CC_OBJS) $(HOST_OBJS) \ sip_endpoint.o sip_util.o sip_util_proxy.o \ sip_resolve.o sip_transport.o sip_transport_loop.o \ sip_transport_udp.o sip_transport_tcp.o \ - sip_transport_tls_ossl.o sip_auth_aka.o sip_auth_client.o \ + sip_transport_tls.o sip_auth_aka.o sip_auth_client.o \ sip_auth_msg.o sip_auth_parser.o \ sip_auth_server.o \ sip_transaction.o sip_util_statefull.o \ @@ -64,7 +64,7 @@ export PJSIP_UA_CFLAGS += $(_CFLAGS) export PJSIP_SIMPLE_SRCDIR = ../src/pjsip-simple export PJSIP_SIMPLE_OBJS += $(OS_OBJS) $(M_OBJS) $(CC_OBJS) $(HOST_OBJS) \ errno.o evsub.o evsub_msg.o iscomposing.o \ - pidf.o presence.o presence_body.o publishc.o \ + mwi.o pidf.o presence.o presence_body.o publishc.o \ rpid.o xpidf.o export PJSIP_SIMPLE_CFLAGS += $(_CFLAGS) diff --git a/sflphone-common/libs/pjproject/pjsip/build/os-auto.mak b/sflphone-common/libs/pjproject/pjsip/build/os-auto.mak deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/sflphone-common/libs/pjproject/pjsip/build/pjsip_core.dsp b/sflphone-common/libs/pjproject/pjsip/build/pjsip_core.dsp index 4a5389b510f6db03391a2a52adad97e0b197eeb0..b29e69ec0990cf8b35baf5bd96b159cf85adeeb1 100644 --- a/sflphone-common/libs/pjproject/pjsip/build/pjsip_core.dsp +++ b/sflphone-common/libs/pjproject/pjsip/build/pjsip_core.dsp @@ -156,7 +156,12 @@ SOURCE=..\src\pjsip\sip_transport_tcp.c # End Source File # Begin Source File +SOURCE=..\src\pjsip\sip_transport_tls.c +# End Source File +# Begin Source File + SOURCE=..\src\pjsip\sip_transport_tls_ossl.c +# PROP Exclude_From_Build 1 # End Source File # Begin Source File diff --git a/sflphone-common/libs/pjproject/pjsip/build/pjsip_core.vcproj b/sflphone-common/libs/pjproject/pjsip/build/pjsip_core.vcproj index 2aef6d4c2ec649aa6046eade53444587bd3836bb..8d0228a52b3817235cb74c52620704bd4f4e3040 100644 --- a/sflphone-common/libs/pjproject/pjsip/build/pjsip_core.vcproj +++ b/sflphone-common/libs/pjproject/pjsip/build/pjsip_core.vcproj @@ -34,11 +34,11 @@ <Configurations> <Configuration Name="Release|Win32" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-win32-release-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="2" ConfigurationType="4" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-win32-release-defaults.vsprops" UseOfMFC="0" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="2" > <Tool Name="VCPreBuildEventTool" @@ -57,8 +57,8 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" AdditionalIncludeDirectories="../include,../../pjlib/include,../../pjlib-util/include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -72,7 +72,7 @@ /> <Tool Name="VCLibrarianTool" - OutputFile="..\lib\pjsip-core-$(TargetCPU)-$(PlatformName)-vc$(VSVer)-$(ConfigurationName).lib" + OutputFile="..\lib\pjsip-core-$(TargetCPU)-$(PlatformName)-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -92,10 +92,10 @@ </Configuration> <Configuration Name="Release|Windows Mobile 6 Standard SDK (ARMV4I)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm6-release-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" ConfigurationType="4" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm6-release-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -114,9 +114,9 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" ExecutionBucket="7" AdditionalIncludeDirectories="../include,../../pjlib/include,../../pjlib-util/include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -130,7 +130,7 @@ /> <Tool Name="VCLibrarianTool" - OutputFile="..\lib\pjsip-core-$(TargetCPU)-wm6std-vc$(VSVer)-$(ConfigurationName).lib" + OutputFile="..\lib\pjsip-core-$(TargetCPU)-wm6std-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -158,10 +158,10 @@ </Configuration> <Configuration Name="Release|Windows Mobile 6 Professional SDK (ARMV4I)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm6-release-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" ConfigurationType="4" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm6-release-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -180,9 +180,9 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" ExecutionBucket="7" AdditionalIncludeDirectories="../include,../../pjlib/include,../../pjlib-util/include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -196,7 +196,7 @@ /> <Tool Name="VCLibrarianTool" - OutputFile="..\lib\pjsip-core-$(TargetCPU)-wm6pro-vc$(VSVer)-$(ConfigurationName).lib" + OutputFile="..\lib\pjsip-core-$(TargetCPU)-wm6pro-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -223,12 +223,11 @@ /> </Configuration> <Configuration - Name="Debug|Win32" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-win32-common-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="2" + Name="Release|Pocket PC 2003 (ARMV4)" ConfigurationType="4" - UseOfMFC="0" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm2003-release-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -247,8 +246,9 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" + ExecutionBucket="7" AdditionalIncludeDirectories="../include,../../pjlib/include,../../pjlib-util/include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -262,7 +262,7 @@ /> <Tool Name="VCLibrarianTool" - OutputFile="..\lib\pjsip-core-$(TargetCPU)-$(PlatformName)-vc$(VSVer)-$(ConfigurationName).lib" + OutputFile="..\lib\pjsip-core-$(TargetCPU)-wm2003ppc-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -274,18 +274,26 @@ Name="VCBscMakeTool" /> <Tool - Name="VCFxCopTool" + Name="VCCodeSignTool" /> <Tool Name="VCPostBuildEventTool" /> + <DeploymentTool + ForceDirty="-1" + RemoteDirectory="" + RegisterOutput="0" + AdditionalFiles="" + /> + <DebuggerTool + /> </Configuration> <Configuration - Name="Debug|Windows Mobile 6 Standard SDK (ARMV4I)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm6-common-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Release|Smartphone 2003 (ARMV4)" ConfigurationType="4" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm2003-release-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -304,9 +312,9 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" ExecutionBucket="7" AdditionalIncludeDirectories="../include,../../pjlib/include,../../pjlib-util/include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -320,7 +328,7 @@ /> <Tool Name="VCLibrarianTool" - OutputFile="..\lib\pjsip-core-$(TargetCPU)-wm6std-vc$(VSVer)-$(ConfigurationName).lib" + OutputFile="..\lib\pjsip-core-$(TargetCPU)-wm2003sp-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -347,11 +355,11 @@ /> </Configuration> <Configuration - Name="Debug|Windows Mobile 6 Professional SDK (ARMV4I)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm6-common-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ConfigurationType="4" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm5-release-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -370,9 +378,9 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" ExecutionBucket="7" AdditionalIncludeDirectories="../include,../../pjlib/include,../../pjlib-util/include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -386,7 +394,7 @@ /> <Tool Name="VCLibrarianTool" - OutputFile="..\lib\pjsip-core-$(TargetCPU)-wm6pro-vc$(VSVer)-$(ConfigurationName).lib" + OutputFile="..\lib\pjsip-core-$(TargetCPU)-wm5ppc-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -413,12 +421,11 @@ /> </Configuration> <Configuration - Name="Debug-Static|Win32" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-win32-common-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="2" + Name="Release|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ConfigurationType="4" - UseOfMFC="0" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm5-release-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -437,8 +444,9 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" + ExecutionBucket="7" AdditionalIncludeDirectories="../include,../../pjlib/include,../../pjlib-util/include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -452,7 +460,7 @@ /> <Tool Name="VCLibrarianTool" - OutputFile="..\lib\pjsip-core-$(TargetCPU)-$(PlatformName)-vc$(VSVer)-$(ConfigurationName).lib" + OutputFile="..\lib\pjsip-core-$(TargetCPU)-wm5sp-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -464,18 +472,27 @@ Name="VCBscMakeTool" /> <Tool - Name="VCFxCopTool" + Name="VCCodeSignTool" /> <Tool Name="VCPostBuildEventTool" /> + <DeploymentTool + ForceDirty="-1" + RemoteDirectory="" + RegisterOutput="0" + AdditionalFiles="" + /> + <DebuggerTool + /> </Configuration> <Configuration - Name="Debug-Static|Windows Mobile 6 Standard SDK (ARMV4I)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm6-common-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Debug|Win32" ConfigurationType="4" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-win32-common-defaults.vsprops" + UseOfMFC="0" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="2" > <Tool Name="VCPreBuildEventTool" @@ -494,9 +511,8 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" - ExecutionBucket="7" AdditionalIncludeDirectories="../include,../../pjlib/include,../../pjlib-util/include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -510,7 +526,7 @@ /> <Tool Name="VCLibrarianTool" - OutputFile="..\lib\pjsip-core-$(TargetCPU)-wm6std-vc$(VSVer)-$(ConfigurationName).lib" + OutputFile="..\lib\pjsip-core-$(TargetCPU)-$(PlatformName)-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -522,26 +538,18 @@ Name="VCBscMakeTool" /> <Tool - Name="VCCodeSignTool" + Name="VCFxCopTool" /> <Tool Name="VCPostBuildEventTool" /> - <DeploymentTool - ForceDirty="-1" - RemoteDirectory="" - RegisterOutput="0" - AdditionalFiles="" - /> - <DebuggerTool - /> </Configuration> <Configuration - Name="Debug-Static|Windows Mobile 6 Professional SDK (ARMV4I)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm6-common-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Debug|Windows Mobile 6 Standard SDK (ARMV4I)" ConfigurationType="4" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm6-common-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -560,9 +568,9 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" ExecutionBucket="7" AdditionalIncludeDirectories="../include,../../pjlib/include,../../pjlib-util/include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -576,7 +584,7 @@ /> <Tool Name="VCLibrarianTool" - OutputFile="..\lib\pjsip-core-$(TargetCPU)-wm6pro-vc$(VSVer)-$(ConfigurationName).lib" + OutputFile="..\lib\pjsip-core-$(TargetCPU)-wm6std-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -603,12 +611,11 @@ /> </Configuration> <Configuration - Name="Release-Dynamic|Win32" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-win32-release-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="2" + Name="Debug|Windows Mobile 6 Professional SDK (ARMV4I)" ConfigurationType="4" - UseOfMFC="0" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm6-common-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -627,8 +634,9 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" + ExecutionBucket="7" AdditionalIncludeDirectories="../include,../../pjlib/include,../../pjlib-util/include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -642,7 +650,7 @@ /> <Tool Name="VCLibrarianTool" - OutputFile="..\lib\pjsip-core-$(TargetCPU)-$(PlatformName)-vc$(VSVer)-$(ConfigurationName).lib" + OutputFile="..\lib\pjsip-core-$(TargetCPU)-wm6pro-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -654,18 +662,26 @@ Name="VCBscMakeTool" /> <Tool - Name="VCFxCopTool" + Name="VCCodeSignTool" /> <Tool Name="VCPostBuildEventTool" /> + <DeploymentTool + ForceDirty="-1" + RemoteDirectory="" + RegisterOutput="0" + AdditionalFiles="" + /> + <DebuggerTool + /> </Configuration> <Configuration - Name="Release-Dynamic|Windows Mobile 6 Standard SDK (ARMV4I)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm6-release-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Debug|Pocket PC 2003 (ARMV4)" ConfigurationType="4" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm2003-common-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -684,9 +700,9 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" ExecutionBucket="7" AdditionalIncludeDirectories="../include,../../pjlib/include,../../pjlib-util/include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -700,7 +716,7 @@ /> <Tool Name="VCLibrarianTool" - OutputFile="..\lib\pjsip-core-$(TargetCPU)-wm6std-vc$(VSVer)-$(ConfigurationName).lib" + OutputFile="..\lib\pjsip-core-$(TargetCPU)-wm2003ppc-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -727,11 +743,11 @@ /> </Configuration> <Configuration - Name="Release-Dynamic|Windows Mobile 6 Professional SDK (ARMV4I)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm6-release-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Debug|Smartphone 2003 (ARMV4)" ConfigurationType="4" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm2003-common-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -750,9 +766,9 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" ExecutionBucket="7" AdditionalIncludeDirectories="../include,../../pjlib/include,../../pjlib-util/include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -766,7 +782,7 @@ /> <Tool Name="VCLibrarianTool" - OutputFile="..\lib\pjsip-core-$(TargetCPU)-wm6pro-vc$(VSVer)-$(ConfigurationName).lib" + OutputFile="..\lib\pjsip-core-$(TargetCPU)-wm2003sp-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -793,12 +809,11 @@ /> </Configuration> <Configuration - Name="Debug-Dynamic|Win32" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-win32-common-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="2" + Name="Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ConfigurationType="4" - UseOfMFC="0" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm5-common-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -817,8 +832,9 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" + ExecutionBucket="7" AdditionalIncludeDirectories="../include,../../pjlib/include,../../pjlib-util/include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -832,7 +848,7 @@ /> <Tool Name="VCLibrarianTool" - OutputFile="..\lib\pjsip-core-$(TargetCPU)-$(PlatformName)-vc$(VSVer)-$(ConfigurationName).lib" + OutputFile="..\lib\pjsip-core-$(TargetCPU)-wm5ppc-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -844,18 +860,26 @@ Name="VCBscMakeTool" /> <Tool - Name="VCFxCopTool" + Name="VCCodeSignTool" /> <Tool Name="VCPostBuildEventTool" /> + <DeploymentTool + ForceDirty="-1" + RemoteDirectory="" + RegisterOutput="0" + AdditionalFiles="" + /> + <DebuggerTool + /> </Configuration> <Configuration - Name="Debug-Dynamic|Windows Mobile 6 Standard SDK (ARMV4I)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm6-common-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Debug|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ConfigurationType="4" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm5-common-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -874,9 +898,9 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" ExecutionBucket="7" AdditionalIncludeDirectories="../include,../../pjlib/include,../../pjlib-util/include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -890,7 +914,7 @@ /> <Tool Name="VCLibrarianTool" - OutputFile="..\lib\pjsip-core-$(TargetCPU)-wm6std-vc$(VSVer)-$(ConfigurationName).lib" + OutputFile="..\lib\pjsip-core-$(TargetCPU)-wm5sp-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -917,11 +941,12 @@ /> </Configuration> <Configuration - Name="Debug-Dynamic|Windows Mobile 6 Professional SDK (ARMV4I)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm6-common-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Debug-Static|Win32" ConfigurationType="4" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-win32-common-defaults.vsprops" + UseOfMFC="0" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="2" > <Tool Name="VCPreBuildEventTool" @@ -940,9 +965,8 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" - ExecutionBucket="7" AdditionalIncludeDirectories="../include,../../pjlib/include,../../pjlib-util/include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -956,7 +980,7 @@ /> <Tool Name="VCLibrarianTool" - OutputFile="..\lib\pjsip-core-$(TargetCPU)-wm6pro-vc$(VSVer)-$(ConfigurationName).lib" + OutputFile="..\lib\pjsip-core-$(TargetCPU)-$(PlatformName)-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -968,27 +992,18 @@ Name="VCBscMakeTool" /> <Tool - Name="VCCodeSignTool" + Name="VCFxCopTool" /> <Tool Name="VCPostBuildEventTool" /> - <DeploymentTool - ForceDirty="-1" - RemoteDirectory="" - RegisterOutput="0" - AdditionalFiles="" - /> - <DebuggerTool - /> </Configuration> <Configuration - Name="Release-Static|Win32" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-win32-release-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="2" + Name="Debug-Static|Windows Mobile 6 Standard SDK (ARMV4I)" ConfigurationType="4" - UseOfMFC="0" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm6-common-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -1007,8 +1022,9 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" + ExecutionBucket="7" AdditionalIncludeDirectories="../include,../../pjlib/include,../../pjlib-util/include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -1022,7 +1038,7 @@ /> <Tool Name="VCLibrarianTool" - OutputFile="..\lib\pjsip-core-$(TargetCPU)-$(PlatformName)-vc$(VSVer)-$(ConfigurationName).lib" + OutputFile="..\lib\pjsip-core-$(TargetCPU)-wm6std-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -1034,18 +1050,26 @@ Name="VCBscMakeTool" /> <Tool - Name="VCFxCopTool" + Name="VCCodeSignTool" /> <Tool Name="VCPostBuildEventTool" /> + <DeploymentTool + ForceDirty="-1" + RemoteDirectory="" + RegisterOutput="0" + AdditionalFiles="" + /> + <DebuggerTool + /> </Configuration> <Configuration - Name="Release-Static|Windows Mobile 6 Standard SDK (ARMV4I)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm6-release-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Debug-Static|Windows Mobile 6 Professional SDK (ARMV4I)" ConfigurationType="4" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm6-common-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -1064,9 +1088,9 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" ExecutionBucket="7" AdditionalIncludeDirectories="../include,../../pjlib/include,../../pjlib-util/include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -1080,7 +1104,7 @@ /> <Tool Name="VCLibrarianTool" - OutputFile="..\lib\pjsip-core-$(TargetCPU)-wm6std-vc$(VSVer)-$(ConfigurationName).lib" + OutputFile="..\lib\pjsip-core-$(TargetCPU)-wm6pro-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -1107,11 +1131,11 @@ /> </Configuration> <Configuration - Name="Release-Static|Windows Mobile 6 Professional SDK (ARMV4I)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm6-release-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Debug-Static|Pocket PC 2003 (ARMV4)" ConfigurationType="4" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm2003-common-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -1130,9 +1154,9 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" ExecutionBucket="7" AdditionalIncludeDirectories="../include,../../pjlib/include,../../pjlib-util/include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -1146,7 +1170,7 @@ /> <Tool Name="VCLibrarianTool" - OutputFile="..\lib\pjsip-core-$(TargetCPU)-wm6pro-vc$(VSVer)-$(ConfigurationName).lib" + OutputFile="..\lib\pjsip-core-$(TargetCPU)-wm2003ppc-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -1173,11 +1197,11 @@ /> </Configuration> <Configuration - Name="Release|Pocket PC 2003 (ARMV4)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm2003-release-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Debug-Static|Smartphone 2003 (ARMV4)" ConfigurationType="4" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm2003-common-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -1196,9 +1220,9 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" ExecutionBucket="7" AdditionalIncludeDirectories="../include,../../pjlib/include,../../pjlib-util/include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -1212,7 +1236,7 @@ /> <Tool Name="VCLibrarianTool" - OutputFile="..\lib\pjsip-core-$(TargetCPU)-wm2003ppc-vc$(VSVer)-$(ConfigurationName).lib" + OutputFile="..\lib\pjsip-core-$(TargetCPU)-wm2003sp-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -1239,11 +1263,11 @@ /> </Configuration> <Configuration - Name="Debug|Pocket PC 2003 (ARMV4)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm2003-common-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Debug-Static|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ConfigurationType="4" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm5-common-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -1262,9 +1286,9 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" ExecutionBucket="7" AdditionalIncludeDirectories="../include,../../pjlib/include,../../pjlib-util/include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -1278,7 +1302,7 @@ /> <Tool Name="VCLibrarianTool" - OutputFile="..\lib\pjsip-core-$(TargetCPU)-wm2003ppc-vc$(VSVer)-$(ConfigurationName).lib" + OutputFile="..\lib\pjsip-core-$(TargetCPU)-wm5ppc-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -1305,11 +1329,11 @@ /> </Configuration> <Configuration - Name="Debug-Static|Pocket PC 2003 (ARMV4)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm2003-common-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Debug-Static|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ConfigurationType="4" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm5-common-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -1328,9 +1352,9 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" ExecutionBucket="7" AdditionalIncludeDirectories="../include,../../pjlib/include,../../pjlib-util/include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -1344,7 +1368,7 @@ /> <Tool Name="VCLibrarianTool" - OutputFile="..\lib\pjsip-core-$(TargetCPU)-wm2003ppc-vc$(VSVer)-$(ConfigurationName).lib" + OutputFile="..\lib\pjsip-core-$(TargetCPU)-wm5sp-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -1371,11 +1395,12 @@ /> </Configuration> <Configuration - Name="Release-Dynamic|Pocket PC 2003 (ARMV4)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm2003-release-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Release-Dynamic|Win32" ConfigurationType="4" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-win32-release-defaults.vsprops" + UseOfMFC="0" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="2" > <Tool Name="VCPreBuildEventTool" @@ -1394,9 +1419,8 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" - ExecutionBucket="7" AdditionalIncludeDirectories="../include,../../pjlib/include,../../pjlib-util/include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -1410,7 +1434,7 @@ /> <Tool Name="VCLibrarianTool" - OutputFile="..\lib\pjsip-core-$(TargetCPU)-wm2003ppc-vc$(VSVer)-$(ConfigurationName).lib" + OutputFile="..\lib\pjsip-core-$(TargetCPU)-$(PlatformName)-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -1422,26 +1446,18 @@ Name="VCBscMakeTool" /> <Tool - Name="VCCodeSignTool" + Name="VCFxCopTool" /> <Tool Name="VCPostBuildEventTool" /> - <DeploymentTool - ForceDirty="-1" - RemoteDirectory="" - RegisterOutput="0" - AdditionalFiles="" - /> - <DebuggerTool - /> </Configuration> <Configuration - Name="Debug-Dynamic|Pocket PC 2003 (ARMV4)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm2003-common-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Release-Dynamic|Windows Mobile 6 Standard SDK (ARMV4I)" ConfigurationType="4" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm6-release-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -1460,9 +1476,9 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" ExecutionBucket="7" AdditionalIncludeDirectories="../include,../../pjlib/include,../../pjlib-util/include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -1476,7 +1492,7 @@ /> <Tool Name="VCLibrarianTool" - OutputFile="..\lib\pjsip-core-$(TargetCPU)-wm2003ppc-vc$(VSVer)-$(ConfigurationName).lib" + OutputFile="..\lib\pjsip-core-$(TargetCPU)-wm6std-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -1503,11 +1519,11 @@ /> </Configuration> <Configuration - Name="Release-Static|Pocket PC 2003 (ARMV4)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm2003-release-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Release-Dynamic|Windows Mobile 6 Professional SDK (ARMV4I)" ConfigurationType="4" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm6-release-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -1526,9 +1542,9 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" ExecutionBucket="7" AdditionalIncludeDirectories="../include,../../pjlib/include,../../pjlib-util/include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -1542,7 +1558,7 @@ /> <Tool Name="VCLibrarianTool" - OutputFile="..\lib\pjsip-core-$(TargetCPU)-wm2003ppc-vc$(VSVer)-$(ConfigurationName).lib" + OutputFile="..\lib\pjsip-core-$(TargetCPU)-wm6pro-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -1569,11 +1585,11 @@ /> </Configuration> <Configuration - Name="Release|Smartphone 2003 (ARMV4)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm2003-release-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Release-Dynamic|Pocket PC 2003 (ARMV4)" ConfigurationType="4" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm2003-release-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -1592,9 +1608,9 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" ExecutionBucket="7" AdditionalIncludeDirectories="../include,../../pjlib/include,../../pjlib-util/include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -1608,7 +1624,7 @@ /> <Tool Name="VCLibrarianTool" - OutputFile="..\lib\pjsip-core-$(TargetCPU)-wm2003sp-vc$(VSVer)-$(ConfigurationName).lib" + OutputFile="..\lib\pjsip-core-$(TargetCPU)-wm2003ppc-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -1635,11 +1651,11 @@ /> </Configuration> <Configuration - Name="Debug|Smartphone 2003 (ARMV4)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm2003-common-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Release-Dynamic|Smartphone 2003 (ARMV4)" ConfigurationType="4" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm2003-release-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -1658,9 +1674,9 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" ExecutionBucket="7" AdditionalIncludeDirectories="../include,../../pjlib/include,../../pjlib-util/include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -1674,7 +1690,7 @@ /> <Tool Name="VCLibrarianTool" - OutputFile="..\lib\pjsip-core-$(TargetCPU)-wm2003sp-vc$(VSVer)-$(ConfigurationName).lib" + OutputFile="..\lib\pjsip-core-$(TargetCPU)-wm2003sp-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -1701,11 +1717,11 @@ /> </Configuration> <Configuration - Name="Debug-Static|Smartphone 2003 (ARMV4)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm2003-common-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Release-Dynamic|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ConfigurationType="4" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm5-release-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -1724,9 +1740,9 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" ExecutionBucket="7" AdditionalIncludeDirectories="../include,../../pjlib/include,../../pjlib-util/include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -1740,7 +1756,7 @@ /> <Tool Name="VCLibrarianTool" - OutputFile="..\lib\pjsip-core-$(TargetCPU)-wm2003sp-vc$(VSVer)-$(ConfigurationName).lib" + OutputFile="..\lib\pjsip-core-$(TargetCPU)-wm5ppc-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -1767,11 +1783,11 @@ /> </Configuration> <Configuration - Name="Release-Dynamic|Smartphone 2003 (ARMV4)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm2003-release-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Release-Dynamic|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ConfigurationType="4" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm5-release-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -1790,9 +1806,9 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" ExecutionBucket="7" AdditionalIncludeDirectories="../include,../../pjlib/include,../../pjlib-util/include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -1806,7 +1822,7 @@ /> <Tool Name="VCLibrarianTool" - OutputFile="..\lib\pjsip-core-$(TargetCPU)-wm2003sp-vc$(VSVer)-$(ConfigurationName).lib" + OutputFile="..\lib\pjsip-core-$(TargetCPU)-wm5sp-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -1833,11 +1849,12 @@ /> </Configuration> <Configuration - Name="Debug-Dynamic|Smartphone 2003 (ARMV4)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm2003-common-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Debug-Dynamic|Win32" ConfigurationType="4" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-win32-common-defaults.vsprops" + UseOfMFC="0" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="2" > <Tool Name="VCPreBuildEventTool" @@ -1856,9 +1873,8 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" - ExecutionBucket="7" AdditionalIncludeDirectories="../include,../../pjlib/include,../../pjlib-util/include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -1872,7 +1888,7 @@ /> <Tool Name="VCLibrarianTool" - OutputFile="..\lib\pjsip-core-$(TargetCPU)-wm2003sp-vc$(VSVer)-$(ConfigurationName).lib" + OutputFile="..\lib\pjsip-core-$(TargetCPU)-$(PlatformName)-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -1884,26 +1900,18 @@ Name="VCBscMakeTool" /> <Tool - Name="VCCodeSignTool" + Name="VCFxCopTool" /> <Tool Name="VCPostBuildEventTool" /> - <DeploymentTool - ForceDirty="-1" - RemoteDirectory="" - RegisterOutput="0" - AdditionalFiles="" - /> - <DebuggerTool - /> </Configuration> <Configuration - Name="Release-Static|Smartphone 2003 (ARMV4)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm2003-release-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Debug-Dynamic|Windows Mobile 6 Standard SDK (ARMV4I)" ConfigurationType="4" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm6-common-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -1922,9 +1930,9 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" ExecutionBucket="7" AdditionalIncludeDirectories="../include,../../pjlib/include,../../pjlib-util/include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -1938,7 +1946,7 @@ /> <Tool Name="VCLibrarianTool" - OutputFile="..\lib\pjsip-core-$(TargetCPU)-wm2003sp-vc$(VSVer)-$(ConfigurationName).lib" + OutputFile="..\lib\pjsip-core-$(TargetCPU)-wm6std-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -1965,11 +1973,11 @@ /> </Configuration> <Configuration - Name="Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm5-release-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Debug-Dynamic|Windows Mobile 6 Professional SDK (ARMV4I)" ConfigurationType="4" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm6-common-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -1988,9 +1996,9 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" ExecutionBucket="7" AdditionalIncludeDirectories="../include,../../pjlib/include,../../pjlib-util/include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -2004,7 +2012,7 @@ /> <Tool Name="VCLibrarianTool" - OutputFile="..\lib\pjsip-core-$(TargetCPU)-wm5ppc-vc$(VSVer)-$(ConfigurationName).lib" + OutputFile="..\lib\pjsip-core-$(TargetCPU)-wm6pro-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -2031,11 +2039,11 @@ /> </Configuration> <Configuration - Name="Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm5-common-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Debug-Dynamic|Pocket PC 2003 (ARMV4)" ConfigurationType="4" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm2003-common-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -2054,9 +2062,9 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" ExecutionBucket="7" AdditionalIncludeDirectories="../include,../../pjlib/include,../../pjlib-util/include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -2070,7 +2078,7 @@ /> <Tool Name="VCLibrarianTool" - OutputFile="..\lib\pjsip-core-$(TargetCPU)-wm5ppc-vc$(VSVer)-$(ConfigurationName).lib" + OutputFile="..\lib\pjsip-core-$(TargetCPU)-wm2003ppc-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -2097,11 +2105,11 @@ /> </Configuration> <Configuration - Name="Debug-Static|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm5-common-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Debug-Dynamic|Smartphone 2003 (ARMV4)" ConfigurationType="4" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm2003-common-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -2120,9 +2128,9 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" ExecutionBucket="7" AdditionalIncludeDirectories="../include,../../pjlib/include,../../pjlib-util/include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -2136,7 +2144,7 @@ /> <Tool Name="VCLibrarianTool" - OutputFile="..\lib\pjsip-core-$(TargetCPU)-wm5ppc-vc$(VSVer)-$(ConfigurationName).lib" + OutputFile="..\lib\pjsip-core-$(TargetCPU)-wm2003sp-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -2163,11 +2171,11 @@ /> </Configuration> <Configuration - Name="Release-Dynamic|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm5-release-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Debug-Dynamic|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ConfigurationType="4" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm5-common-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -2186,9 +2194,9 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" ExecutionBucket="7" AdditionalIncludeDirectories="../include,../../pjlib/include,../../pjlib-util/include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -2202,7 +2210,7 @@ /> <Tool Name="VCLibrarianTool" - OutputFile="..\lib\pjsip-core-$(TargetCPU)-wm5ppc-vc$(VSVer)-$(ConfigurationName).lib" + OutputFile="..\lib\pjsip-core-$(TargetCPU)-wm5ppc-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -2229,11 +2237,11 @@ /> </Configuration> <Configuration - Name="Debug-Dynamic|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm5-common-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Debug-Dynamic|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ConfigurationType="4" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm5-common-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -2252,9 +2260,9 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" ExecutionBucket="7" AdditionalIncludeDirectories="../include,../../pjlib/include,../../pjlib-util/include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -2268,7 +2276,7 @@ /> <Tool Name="VCLibrarianTool" - OutputFile="..\lib\pjsip-core-$(TargetCPU)-wm5ppc-vc$(VSVer)-$(ConfigurationName).lib" + OutputFile="..\lib\pjsip-core-$(TargetCPU)-wm5sp-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -2295,11 +2303,12 @@ /> </Configuration> <Configuration - Name="Release-Static|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm5-release-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Release-Static|Win32" ConfigurationType="4" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-win32-release-defaults.vsprops" + UseOfMFC="0" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="2" > <Tool Name="VCPreBuildEventTool" @@ -2318,9 +2327,8 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" - ExecutionBucket="7" AdditionalIncludeDirectories="../include,../../pjlib/include,../../pjlib-util/include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -2334,7 +2342,7 @@ /> <Tool Name="VCLibrarianTool" - OutputFile="..\lib\pjsip-core-$(TargetCPU)-wm5ppc-vc$(VSVer)-$(ConfigurationName).lib" + OutputFile="..\lib\pjsip-core-$(TargetCPU)-$(PlatformName)-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -2346,26 +2354,18 @@ Name="VCBscMakeTool" /> <Tool - Name="VCCodeSignTool" + Name="VCFxCopTool" /> <Tool Name="VCPostBuildEventTool" /> - <DeploymentTool - ForceDirty="-1" - RemoteDirectory="" - RegisterOutput="0" - AdditionalFiles="" - /> - <DebuggerTool - /> </Configuration> <Configuration - Name="Release|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm5-release-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Release-Static|Windows Mobile 6 Standard SDK (ARMV4I)" ConfigurationType="4" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm6-release-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -2384,9 +2384,9 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" ExecutionBucket="7" AdditionalIncludeDirectories="../include,../../pjlib/include,../../pjlib-util/include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -2400,7 +2400,7 @@ /> <Tool Name="VCLibrarianTool" - OutputFile="..\lib\pjsip-core-$(TargetCPU)-wm5sp-vc$(VSVer)-$(ConfigurationName).lib" + OutputFile="..\lib\pjsip-core-$(TargetCPU)-wm6std-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -2427,11 +2427,11 @@ /> </Configuration> <Configuration - Name="Debug|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm5-common-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Release-Static|Windows Mobile 6 Professional SDK (ARMV4I)" ConfigurationType="4" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm6-release-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -2450,9 +2450,9 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" ExecutionBucket="7" AdditionalIncludeDirectories="../include,../../pjlib/include,../../pjlib-util/include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -2466,7 +2466,7 @@ /> <Tool Name="VCLibrarianTool" - OutputFile="..\lib\pjsip-core-$(TargetCPU)-wm5sp-vc$(VSVer)-$(ConfigurationName).lib" + OutputFile="..\lib\pjsip-core-$(TargetCPU)-wm6pro-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -2493,11 +2493,11 @@ /> </Configuration> <Configuration - Name="Debug-Static|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm5-common-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Release-Static|Pocket PC 2003 (ARMV4)" ConfigurationType="4" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm2003-release-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -2516,9 +2516,9 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" ExecutionBucket="7" AdditionalIncludeDirectories="../include,../../pjlib/include,../../pjlib-util/include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -2532,7 +2532,7 @@ /> <Tool Name="VCLibrarianTool" - OutputFile="..\lib\pjsip-core-$(TargetCPU)-wm5sp-vc$(VSVer)-$(ConfigurationName).lib" + OutputFile="..\lib\pjsip-core-$(TargetCPU)-wm2003ppc-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -2559,11 +2559,11 @@ /> </Configuration> <Configuration - Name="Release-Dynamic|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm5-release-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Release-Static|Smartphone 2003 (ARMV4)" ConfigurationType="4" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm2003-release-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -2582,9 +2582,9 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" ExecutionBucket="7" AdditionalIncludeDirectories="../include,../../pjlib/include,../../pjlib-util/include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -2598,7 +2598,7 @@ /> <Tool Name="VCLibrarianTool" - OutputFile="..\lib\pjsip-core-$(TargetCPU)-wm5sp-vc$(VSVer)-$(ConfigurationName).lib" + OutputFile="..\lib\pjsip-core-$(TargetCPU)-wm2003sp-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -2625,11 +2625,11 @@ /> </Configuration> <Configuration - Name="Debug-Dynamic|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm5-common-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Release-Static|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ConfigurationType="4" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm5-release-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -2648,9 +2648,9 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" ExecutionBucket="7" AdditionalIncludeDirectories="../include,../../pjlib/include,../../pjlib-util/include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -2664,7 +2664,7 @@ /> <Tool Name="VCLibrarianTool" - OutputFile="..\lib\pjsip-core-$(TargetCPU)-wm5sp-vc$(VSVer)-$(ConfigurationName).lib" + OutputFile="..\lib\pjsip-core-$(TargetCPU)-wm5ppc-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -2692,10 +2692,10 @@ </Configuration> <Configuration Name="Release-Static|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm5-release-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" ConfigurationType="4" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm5-release-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -2714,9 +2714,9 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" ExecutionBucket="7" AdditionalIncludeDirectories="../include,../../pjlib/include,../../pjlib-util/include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -2730,7 +2730,7 @@ /> <Tool Name="VCLibrarianTool" - OutputFile="..\lib\pjsip-core-$(TargetCPU)-wm5sp-vc$(VSVer)-$(ConfigurationName).lib" + OutputFile="..\lib\pjsip-core-$(TargetCPU)-wm5sp-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -3479,11 +3479,16 @@ /> </FileConfiguration> </File> + <File + RelativePath="..\src\pjsip\sip_transport_tls.c" + > + </File> <File RelativePath="..\src\pjsip\sip_transport_tls_ossl.c" > <FileConfiguration Name="Release|Win32" + ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" @@ -3493,6 +3498,7 @@ </FileConfiguration> <FileConfiguration Name="Debug|Win32" + ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" @@ -3500,8 +3506,17 @@ PreprocessorDefinitions="" /> </FileConfiguration> + <FileConfiguration + Name="Debug|Windows Mobile 6 Standard SDK (ARMV4I)" + ExcludedFromBuild="true" + > + <Tool + Name="VCCLCompilerTool" + /> + </FileConfiguration> <FileConfiguration Name="Debug-Static|Win32" + ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" @@ -3511,6 +3526,7 @@ </FileConfiguration> <FileConfiguration Name="Release-Dynamic|Win32" + ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" @@ -3520,6 +3536,7 @@ </FileConfiguration> <FileConfiguration Name="Debug-Dynamic|Win32" + ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" @@ -3529,6 +3546,7 @@ </FileConfiguration> <FileConfiguration Name="Release-Static|Win32" + ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" diff --git a/sflphone-common/libs/pjproject/pjsip/build/pjsip_simple.dsp b/sflphone-common/libs/pjproject/pjsip/build/pjsip_simple.dsp index 82554d7de56923ff39e0eb777e9fda24eed72f2a..8b584a97bb04d191be99818e077ef1fc76a4ee32 100644 --- a/sflphone-common/libs/pjproject/pjsip/build/pjsip_simple.dsp +++ b/sflphone-common/libs/pjproject/pjsip/build/pjsip_simple.dsp @@ -103,6 +103,10 @@ SOURCE="..\src\pjsip-simple\iscomposing.c" # End Source File # Begin Source File +SOURCE="..\src\pjsip-simple\mwi.c" +# End Source File +# Begin Source File + SOURCE="..\src\pjsip-simple\pidf.c" # End Source File # Begin Source File @@ -147,6 +151,10 @@ SOURCE="..\include\pjsip-simple\iscomposing.h" # End Source File # Begin Source File +SOURCE="..\include\pjsip-simple\mwi.h" +# End Source File +# Begin Source File + SOURCE="..\include\pjsip-simple\pidf.h" # End Source File # Begin Source File diff --git a/sflphone-common/libs/pjproject/pjsip/build/pjsip_simple.vcproj b/sflphone-common/libs/pjproject/pjsip/build/pjsip_simple.vcproj index 76d1d07b2bd0617cd8f5022066592972561ee675..f2504c824ebd52babeaad0d9f5df21f6785d1cd6 100644 --- a/sflphone-common/libs/pjproject/pjsip/build/pjsip_simple.vcproj +++ b/sflphone-common/libs/pjproject/pjsip/build/pjsip_simple.vcproj @@ -34,11 +34,11 @@ <Configurations> <Configuration Name="Debug|Win32" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-win32-common-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="2" ConfigurationType="4" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-win32-common-defaults.vsprops" UseOfMFC="0" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="2" > <Tool Name="VCPreBuildEventTool" @@ -57,8 +57,8 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" AdditionalIncludeDirectories="../include,../../pjlib-util/include,../../pjlib/include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -72,7 +72,7 @@ /> <Tool Name="VCLibrarianTool" - OutputFile="..\lib\pjsip-simple-$(TargetCPU)-$(PlatformName)-vc$(VSVer)-$(ConfigurationName).lib" + OutputFile="..\lib\pjsip-simple-$(TargetCPU)-$(PlatformName)-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -92,10 +92,10 @@ </Configuration> <Configuration Name="Debug|Windows Mobile 6 Standard SDK (ARMV4I)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm6-common-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" ConfigurationType="4" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm6-common-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -114,9 +114,9 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" ExecutionBucket="7" AdditionalIncludeDirectories="../include,../../pjlib-util/include,../../pjlib/include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -130,7 +130,7 @@ /> <Tool Name="VCLibrarianTool" - OutputFile="..\lib\pjsip-simple-$(TargetCPU)-wm6std-vc$(VSVer)-$(ConfigurationName).lib" + OutputFile="..\lib\pjsip-simple-$(TargetCPU)-wm6std-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -158,10 +158,10 @@ </Configuration> <Configuration Name="Debug|Windows Mobile 6 Professional SDK (ARMV4I)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm6-common-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" ConfigurationType="4" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm6-common-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -180,9 +180,9 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" ExecutionBucket="7" AdditionalIncludeDirectories="../include,../../pjlib-util/include,../../pjlib/include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -196,7 +196,7 @@ /> <Tool Name="VCLibrarianTool" - OutputFile="..\lib\pjsip-simple-$(TargetCPU)-wm6pro-vc$(VSVer)-$(ConfigurationName).lib" + OutputFile="..\lib\pjsip-simple-$(TargetCPU)-wm6pro-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -223,12 +223,11 @@ /> </Configuration> <Configuration - Name="Release|Win32" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-win32-release-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="2" + Name="Debug|Pocket PC 2003 (ARMV4)" ConfigurationType="4" - UseOfMFC="0" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm2003-common-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -247,8 +246,9 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" + ExecutionBucket="7" AdditionalIncludeDirectories="../include,../../pjlib-util/include,../../pjlib/include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -262,7 +262,7 @@ /> <Tool Name="VCLibrarianTool" - OutputFile="..\lib\pjsip-simple-$(TargetCPU)-$(PlatformName)-vc$(VSVer)-$(ConfigurationName).lib" + OutputFile="..\lib\pjsip-simple-$(TargetCPU)-wm2003ppc-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -274,18 +274,26 @@ Name="VCBscMakeTool" /> <Tool - Name="VCFxCopTool" + Name="VCCodeSignTool" /> <Tool Name="VCPostBuildEventTool" /> + <DeploymentTool + ForceDirty="-1" + RemoteDirectory="" + RegisterOutput="0" + AdditionalFiles="" + /> + <DebuggerTool + /> </Configuration> <Configuration - Name="Release|Windows Mobile 6 Standard SDK (ARMV4I)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm6-release-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Debug|Smartphone 2003 (ARMV4)" ConfigurationType="4" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm2003-common-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -304,9 +312,9 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" ExecutionBucket="7" AdditionalIncludeDirectories="../include,../../pjlib-util/include,../../pjlib/include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -320,7 +328,7 @@ /> <Tool Name="VCLibrarianTool" - OutputFile="..\lib\pjsip-simple-$(TargetCPU)-wm6std-vc$(VSVer)-$(ConfigurationName).lib" + OutputFile="..\lib\pjsip-simple-$(TargetCPU)-wm2003sp-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -347,11 +355,11 @@ /> </Configuration> <Configuration - Name="Release|Windows Mobile 6 Professional SDK (ARMV4I)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm6-release-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ConfigurationType="4" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm5-common-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -370,9 +378,9 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" ExecutionBucket="7" AdditionalIncludeDirectories="../include,../../pjlib-util/include,../../pjlib/include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -386,7 +394,7 @@ /> <Tool Name="VCLibrarianTool" - OutputFile="..\lib\pjsip-simple-$(TargetCPU)-wm6pro-vc$(VSVer)-$(ConfigurationName).lib" + OutputFile="..\lib\pjsip-simple-$(TargetCPU)-wm5ppc-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -413,12 +421,11 @@ /> </Configuration> <Configuration - Name="Debug-Static|Win32" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-win32-common-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="2" + Name="Debug|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ConfigurationType="4" - UseOfMFC="0" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm5-common-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -437,8 +444,9 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" + ExecutionBucket="7" AdditionalIncludeDirectories="../include,../../pjlib-util/include,../../pjlib/include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -452,7 +460,7 @@ /> <Tool Name="VCLibrarianTool" - OutputFile="..\lib\pjsip-simple-$(TargetCPU)-$(PlatformName)-vc$(VSVer)-$(ConfigurationName).lib" + OutputFile="..\lib\pjsip-simple-$(TargetCPU)-wm5sp-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -464,18 +472,27 @@ Name="VCBscMakeTool" /> <Tool - Name="VCFxCopTool" + Name="VCCodeSignTool" /> <Tool Name="VCPostBuildEventTool" /> + <DeploymentTool + ForceDirty="-1" + RemoteDirectory="" + RegisterOutput="0" + AdditionalFiles="" + /> + <DebuggerTool + /> </Configuration> <Configuration - Name="Debug-Static|Windows Mobile 6 Standard SDK (ARMV4I)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm6-common-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Release|Win32" ConfigurationType="4" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-win32-release-defaults.vsprops" + UseOfMFC="0" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="2" > <Tool Name="VCPreBuildEventTool" @@ -494,9 +511,8 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" - ExecutionBucket="7" AdditionalIncludeDirectories="../include,../../pjlib-util/include,../../pjlib/include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -510,7 +526,7 @@ /> <Tool Name="VCLibrarianTool" - OutputFile="..\lib\pjsip-simple-$(TargetCPU)-wm6std-vc$(VSVer)-$(ConfigurationName).lib" + OutputFile="..\lib\pjsip-simple-$(TargetCPU)-$(PlatformName)-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -522,26 +538,18 @@ Name="VCBscMakeTool" /> <Tool - Name="VCCodeSignTool" + Name="VCFxCopTool" /> <Tool Name="VCPostBuildEventTool" /> - <DeploymentTool - ForceDirty="-1" - RemoteDirectory="" - RegisterOutput="0" - AdditionalFiles="" - /> - <DebuggerTool - /> </Configuration> <Configuration - Name="Debug-Static|Windows Mobile 6 Professional SDK (ARMV4I)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm6-common-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Release|Windows Mobile 6 Standard SDK (ARMV4I)" ConfigurationType="4" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm6-release-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -560,9 +568,9 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" ExecutionBucket="7" AdditionalIncludeDirectories="../include,../../pjlib-util/include,../../pjlib/include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -576,7 +584,7 @@ /> <Tool Name="VCLibrarianTool" - OutputFile="..\lib\pjsip-simple-$(TargetCPU)-wm6pro-vc$(VSVer)-$(ConfigurationName).lib" + OutputFile="..\lib\pjsip-simple-$(TargetCPU)-wm6std-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -603,12 +611,11 @@ /> </Configuration> <Configuration - Name="Release-Dynamic|Win32" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-win32-release-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="2" + Name="Release|Windows Mobile 6 Professional SDK (ARMV4I)" ConfigurationType="4" - UseOfMFC="0" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm6-release-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -627,8 +634,9 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" + ExecutionBucket="7" AdditionalIncludeDirectories="../include,../../pjlib-util/include,../../pjlib/include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -642,7 +650,7 @@ /> <Tool Name="VCLibrarianTool" - OutputFile="..\lib\pjsip-simple-$(TargetCPU)-$(PlatformName)-vc$(VSVer)-$(ConfigurationName).lib" + OutputFile="..\lib\pjsip-simple-$(TargetCPU)-wm6pro-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -654,18 +662,26 @@ Name="VCBscMakeTool" /> <Tool - Name="VCFxCopTool" + Name="VCCodeSignTool" /> <Tool Name="VCPostBuildEventTool" /> + <DeploymentTool + ForceDirty="-1" + RemoteDirectory="" + RegisterOutput="0" + AdditionalFiles="" + /> + <DebuggerTool + /> </Configuration> <Configuration - Name="Release-Dynamic|Windows Mobile 6 Standard SDK (ARMV4I)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm6-release-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Release|Pocket PC 2003 (ARMV4)" ConfigurationType="4" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm2003-release-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -684,9 +700,9 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" ExecutionBucket="7" AdditionalIncludeDirectories="../include,../../pjlib-util/include,../../pjlib/include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -700,7 +716,7 @@ /> <Tool Name="VCLibrarianTool" - OutputFile="..\lib\pjsip-simple-$(TargetCPU)-wm6std-vc$(VSVer)-$(ConfigurationName).lib" + OutputFile="..\lib\pjsip-simple-$(TargetCPU)-wm2003ppc-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -727,11 +743,11 @@ /> </Configuration> <Configuration - Name="Release-Dynamic|Windows Mobile 6 Professional SDK (ARMV4I)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm6-release-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Release|Smartphone 2003 (ARMV4)" ConfigurationType="4" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm2003-release-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -750,9 +766,9 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" ExecutionBucket="7" AdditionalIncludeDirectories="../include,../../pjlib-util/include,../../pjlib/include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -766,7 +782,7 @@ /> <Tool Name="VCLibrarianTool" - OutputFile="..\lib\pjsip-simple-$(TargetCPU)-wm6pro-vc$(VSVer)-$(ConfigurationName).lib" + OutputFile="..\lib\pjsip-simple-$(TargetCPU)-wm2003sp-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -793,12 +809,11 @@ /> </Configuration> <Configuration - Name="Debug-Dynamic|Win32" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-win32-common-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="2" + Name="Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ConfigurationType="4" - UseOfMFC="0" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm5-release-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -817,8 +832,9 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" + ExecutionBucket="7" AdditionalIncludeDirectories="../include,../../pjlib-util/include,../../pjlib/include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -832,7 +848,7 @@ /> <Tool Name="VCLibrarianTool" - OutputFile="..\lib\pjsip-simple-$(TargetCPU)-$(PlatformName)-vc$(VSVer)-$(ConfigurationName).lib" + OutputFile="..\lib\pjsip-simple-$(TargetCPU)-wm5ppc-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -844,18 +860,26 @@ Name="VCBscMakeTool" /> <Tool - Name="VCFxCopTool" + Name="VCCodeSignTool" /> <Tool Name="VCPostBuildEventTool" /> + <DeploymentTool + ForceDirty="-1" + RemoteDirectory="" + RegisterOutput="0" + AdditionalFiles="" + /> + <DebuggerTool + /> </Configuration> <Configuration - Name="Debug-Dynamic|Windows Mobile 6 Standard SDK (ARMV4I)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm6-common-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Release|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ConfigurationType="4" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm5-release-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -874,9 +898,9 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" ExecutionBucket="7" AdditionalIncludeDirectories="../include,../../pjlib-util/include,../../pjlib/include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -890,7 +914,7 @@ /> <Tool Name="VCLibrarianTool" - OutputFile="..\lib\pjsip-simple-$(TargetCPU)-wm6std-vc$(VSVer)-$(ConfigurationName).lib" + OutputFile="..\lib\pjsip-simple-$(TargetCPU)-wm5sp-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -917,11 +941,12 @@ /> </Configuration> <Configuration - Name="Debug-Dynamic|Windows Mobile 6 Professional SDK (ARMV4I)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm6-common-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Debug-Static|Win32" ConfigurationType="4" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-win32-common-defaults.vsprops" + UseOfMFC="0" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="2" > <Tool Name="VCPreBuildEventTool" @@ -940,9 +965,8 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" - ExecutionBucket="7" AdditionalIncludeDirectories="../include,../../pjlib-util/include,../../pjlib/include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -956,7 +980,7 @@ /> <Tool Name="VCLibrarianTool" - OutputFile="..\lib\pjsip-simple-$(TargetCPU)-wm6pro-vc$(VSVer)-$(ConfigurationName).lib" + OutputFile="..\lib\pjsip-simple-$(TargetCPU)-$(PlatformName)-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -968,27 +992,18 @@ Name="VCBscMakeTool" /> <Tool - Name="VCCodeSignTool" + Name="VCFxCopTool" /> <Tool Name="VCPostBuildEventTool" /> - <DeploymentTool - ForceDirty="-1" - RemoteDirectory="" - RegisterOutput="0" - AdditionalFiles="" - /> - <DebuggerTool - /> </Configuration> <Configuration - Name="Release-Static|Win32" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-win32-release-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="2" + Name="Debug-Static|Windows Mobile 6 Standard SDK (ARMV4I)" ConfigurationType="4" - UseOfMFC="0" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm6-common-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -1007,8 +1022,9 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" + ExecutionBucket="7" AdditionalIncludeDirectories="../include,../../pjlib-util/include,../../pjlib/include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -1022,7 +1038,7 @@ /> <Tool Name="VCLibrarianTool" - OutputFile="..\lib\pjsip-simple-$(TargetCPU)-$(PlatformName)-vc$(VSVer)-$(ConfigurationName).lib" + OutputFile="..\lib\pjsip-simple-$(TargetCPU)-wm6std-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -1034,18 +1050,26 @@ Name="VCBscMakeTool" /> <Tool - Name="VCFxCopTool" + Name="VCCodeSignTool" /> <Tool Name="VCPostBuildEventTool" /> + <DeploymentTool + ForceDirty="-1" + RemoteDirectory="" + RegisterOutput="0" + AdditionalFiles="" + /> + <DebuggerTool + /> </Configuration> <Configuration - Name="Release-Static|Windows Mobile 6 Standard SDK (ARMV4I)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm6-release-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Debug-Static|Windows Mobile 6 Professional SDK (ARMV4I)" ConfigurationType="4" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm6-common-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -1064,9 +1088,9 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" ExecutionBucket="7" AdditionalIncludeDirectories="../include,../../pjlib-util/include,../../pjlib/include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -1080,7 +1104,7 @@ /> <Tool Name="VCLibrarianTool" - OutputFile="..\lib\pjsip-simple-$(TargetCPU)-wm6std-vc$(VSVer)-$(ConfigurationName).lib" + OutputFile="..\lib\pjsip-simple-$(TargetCPU)-wm6pro-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -1107,11 +1131,11 @@ /> </Configuration> <Configuration - Name="Release-Static|Windows Mobile 6 Professional SDK (ARMV4I)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm6-release-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Debug-Static|Pocket PC 2003 (ARMV4)" ConfigurationType="4" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm2003-common-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -1130,9 +1154,9 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" ExecutionBucket="7" AdditionalIncludeDirectories="../include,../../pjlib-util/include,../../pjlib/include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -1146,7 +1170,7 @@ /> <Tool Name="VCLibrarianTool" - OutputFile="..\lib\pjsip-simple-$(TargetCPU)-wm6pro-vc$(VSVer)-$(ConfigurationName).lib" + OutputFile="..\lib\pjsip-simple-$(TargetCPU)-wm2003ppc-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -1173,11 +1197,11 @@ /> </Configuration> <Configuration - Name="Debug|Pocket PC 2003 (ARMV4)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm2003-common-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Debug-Static|Smartphone 2003 (ARMV4)" ConfigurationType="4" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm2003-common-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -1196,9 +1220,9 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" ExecutionBucket="7" AdditionalIncludeDirectories="../include,../../pjlib-util/include,../../pjlib/include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -1212,7 +1236,7 @@ /> <Tool Name="VCLibrarianTool" - OutputFile="..\lib\pjsip-simple-$(TargetCPU)-wm2003ppc-vc$(VSVer)-$(ConfigurationName).lib" + OutputFile="..\lib\pjsip-simple-$(TargetCPU)-wm2003sp-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -1239,11 +1263,11 @@ /> </Configuration> <Configuration - Name="Release|Pocket PC 2003 (ARMV4)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm2003-release-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Debug-Static|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ConfigurationType="4" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm5-common-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -1262,9 +1286,9 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" ExecutionBucket="7" AdditionalIncludeDirectories="../include,../../pjlib-util/include,../../pjlib/include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -1278,7 +1302,7 @@ /> <Tool Name="VCLibrarianTool" - OutputFile="..\lib\pjsip-simple-$(TargetCPU)-wm2003ppc-vc$(VSVer)-$(ConfigurationName).lib" + OutputFile="..\lib\pjsip-simple-$(TargetCPU)-wm5ppc-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -1305,11 +1329,11 @@ /> </Configuration> <Configuration - Name="Debug-Static|Pocket PC 2003 (ARMV4)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm2003-common-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Debug-Static|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ConfigurationType="4" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm5-common-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -1328,9 +1352,9 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" ExecutionBucket="7" AdditionalIncludeDirectories="../include,../../pjlib-util/include,../../pjlib/include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -1344,7 +1368,7 @@ /> <Tool Name="VCLibrarianTool" - OutputFile="..\lib\pjsip-simple-$(TargetCPU)-wm2003ppc-vc$(VSVer)-$(ConfigurationName).lib" + OutputFile="..\lib\pjsip-simple-$(TargetCPU)-wm5sp-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -1371,11 +1395,12 @@ /> </Configuration> <Configuration - Name="Release-Dynamic|Pocket PC 2003 (ARMV4)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm2003-release-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Release-Dynamic|Win32" ConfigurationType="4" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-win32-release-defaults.vsprops" + UseOfMFC="0" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="2" > <Tool Name="VCPreBuildEventTool" @@ -1394,9 +1419,8 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" - ExecutionBucket="7" AdditionalIncludeDirectories="../include,../../pjlib-util/include,../../pjlib/include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -1410,7 +1434,7 @@ /> <Tool Name="VCLibrarianTool" - OutputFile="..\lib\pjsip-simple-$(TargetCPU)-wm2003ppc-vc$(VSVer)-$(ConfigurationName).lib" + OutputFile="..\lib\pjsip-simple-$(TargetCPU)-$(PlatformName)-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -1422,26 +1446,18 @@ Name="VCBscMakeTool" /> <Tool - Name="VCCodeSignTool" + Name="VCFxCopTool" /> <Tool Name="VCPostBuildEventTool" /> - <DeploymentTool - ForceDirty="-1" - RemoteDirectory="" - RegisterOutput="0" - AdditionalFiles="" - /> - <DebuggerTool - /> </Configuration> <Configuration - Name="Debug-Dynamic|Pocket PC 2003 (ARMV4)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm2003-common-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Release-Dynamic|Windows Mobile 6 Standard SDK (ARMV4I)" ConfigurationType="4" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm6-release-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -1460,9 +1476,9 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" ExecutionBucket="7" AdditionalIncludeDirectories="../include,../../pjlib-util/include,../../pjlib/include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -1476,7 +1492,7 @@ /> <Tool Name="VCLibrarianTool" - OutputFile="..\lib\pjsip-simple-$(TargetCPU)-wm2003ppc-vc$(VSVer)-$(ConfigurationName).lib" + OutputFile="..\lib\pjsip-simple-$(TargetCPU)-wm6std-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -1503,11 +1519,11 @@ /> </Configuration> <Configuration - Name="Release-Static|Pocket PC 2003 (ARMV4)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm2003-release-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Release-Dynamic|Windows Mobile 6 Professional SDK (ARMV4I)" ConfigurationType="4" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm6-release-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -1526,9 +1542,9 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" ExecutionBucket="7" AdditionalIncludeDirectories="../include,../../pjlib-util/include,../../pjlib/include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -1542,7 +1558,7 @@ /> <Tool Name="VCLibrarianTool" - OutputFile="..\lib\pjsip-simple-$(TargetCPU)-wm2003ppc-vc$(VSVer)-$(ConfigurationName).lib" + OutputFile="..\lib\pjsip-simple-$(TargetCPU)-wm6pro-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -1569,11 +1585,11 @@ /> </Configuration> <Configuration - Name="Debug|Smartphone 2003 (ARMV4)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm2003-common-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Release-Dynamic|Pocket PC 2003 (ARMV4)" ConfigurationType="4" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm2003-release-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -1592,9 +1608,9 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" ExecutionBucket="7" AdditionalIncludeDirectories="../include,../../pjlib-util/include,../../pjlib/include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -1608,7 +1624,7 @@ /> <Tool Name="VCLibrarianTool" - OutputFile="..\lib\pjsip-simple-$(TargetCPU)-wm2003sp-vc$(VSVer)-$(ConfigurationName).lib" + OutputFile="..\lib\pjsip-simple-$(TargetCPU)-wm2003ppc-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -1635,11 +1651,11 @@ /> </Configuration> <Configuration - Name="Release|Smartphone 2003 (ARMV4)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm2003-release-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Release-Dynamic|Smartphone 2003 (ARMV4)" ConfigurationType="4" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm2003-release-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -1658,9 +1674,9 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" ExecutionBucket="7" AdditionalIncludeDirectories="../include,../../pjlib-util/include,../../pjlib/include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -1674,7 +1690,7 @@ /> <Tool Name="VCLibrarianTool" - OutputFile="..\lib\pjsip-simple-$(TargetCPU)-wm2003sp-vc$(VSVer)-$(ConfigurationName).lib" + OutputFile="..\lib\pjsip-simple-$(TargetCPU)-wm2003sp-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -1701,11 +1717,11 @@ /> </Configuration> <Configuration - Name="Debug-Static|Smartphone 2003 (ARMV4)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm2003-common-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Release-Dynamic|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ConfigurationType="4" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm5-release-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -1724,9 +1740,9 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" ExecutionBucket="7" AdditionalIncludeDirectories="../include,../../pjlib-util/include,../../pjlib/include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -1740,7 +1756,7 @@ /> <Tool Name="VCLibrarianTool" - OutputFile="..\lib\pjsip-simple-$(TargetCPU)-wm2003sp-vc$(VSVer)-$(ConfigurationName).lib" + OutputFile="..\lib\pjsip-simple-$(TargetCPU)-wm5ppc-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -1767,11 +1783,11 @@ /> </Configuration> <Configuration - Name="Release-Dynamic|Smartphone 2003 (ARMV4)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm2003-release-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Release-Dynamic|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ConfigurationType="4" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm5-release-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -1790,9 +1806,9 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" ExecutionBucket="7" AdditionalIncludeDirectories="../include,../../pjlib-util/include,../../pjlib/include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -1806,7 +1822,7 @@ /> <Tool Name="VCLibrarianTool" - OutputFile="..\lib\pjsip-simple-$(TargetCPU)-wm2003sp-vc$(VSVer)-$(ConfigurationName).lib" + OutputFile="..\lib\pjsip-simple-$(TargetCPU)-wm5sp-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -1833,11 +1849,12 @@ /> </Configuration> <Configuration - Name="Debug-Dynamic|Smartphone 2003 (ARMV4)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm2003-common-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Debug-Dynamic|Win32" ConfigurationType="4" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-win32-common-defaults.vsprops" + UseOfMFC="0" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="2" > <Tool Name="VCPreBuildEventTool" @@ -1856,9 +1873,8 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" - ExecutionBucket="7" AdditionalIncludeDirectories="../include,../../pjlib-util/include,../../pjlib/include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -1872,7 +1888,7 @@ /> <Tool Name="VCLibrarianTool" - OutputFile="..\lib\pjsip-simple-$(TargetCPU)-wm2003sp-vc$(VSVer)-$(ConfigurationName).lib" + OutputFile="..\lib\pjsip-simple-$(TargetCPU)-$(PlatformName)-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -1884,26 +1900,18 @@ Name="VCBscMakeTool" /> <Tool - Name="VCCodeSignTool" + Name="VCFxCopTool" /> <Tool Name="VCPostBuildEventTool" /> - <DeploymentTool - ForceDirty="-1" - RemoteDirectory="" - RegisterOutput="0" - AdditionalFiles="" - /> - <DebuggerTool - /> </Configuration> <Configuration - Name="Release-Static|Smartphone 2003 (ARMV4)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm2003-release-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Debug-Dynamic|Windows Mobile 6 Standard SDK (ARMV4I)" ConfigurationType="4" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm6-common-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -1922,9 +1930,9 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" ExecutionBucket="7" AdditionalIncludeDirectories="../include,../../pjlib-util/include,../../pjlib/include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -1938,7 +1946,7 @@ /> <Tool Name="VCLibrarianTool" - OutputFile="..\lib\pjsip-simple-$(TargetCPU)-wm2003sp-vc$(VSVer)-$(ConfigurationName).lib" + OutputFile="..\lib\pjsip-simple-$(TargetCPU)-wm6std-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -1965,11 +1973,11 @@ /> </Configuration> <Configuration - Name="Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm5-common-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Debug-Dynamic|Windows Mobile 6 Professional SDK (ARMV4I)" ConfigurationType="4" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm6-common-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -1988,9 +1996,9 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" ExecutionBucket="7" AdditionalIncludeDirectories="../include,../../pjlib-util/include,../../pjlib/include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -2004,7 +2012,7 @@ /> <Tool Name="VCLibrarianTool" - OutputFile="..\lib\pjsip-simple-$(TargetCPU)-wm5ppc-vc$(VSVer)-$(ConfigurationName).lib" + OutputFile="..\lib\pjsip-simple-$(TargetCPU)-wm6pro-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -2031,11 +2039,11 @@ /> </Configuration> <Configuration - Name="Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm5-release-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Debug-Dynamic|Pocket PC 2003 (ARMV4)" ConfigurationType="4" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm2003-common-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -2054,9 +2062,9 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" ExecutionBucket="7" AdditionalIncludeDirectories="../include,../../pjlib-util/include,../../pjlib/include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -2070,7 +2078,7 @@ /> <Tool Name="VCLibrarianTool" - OutputFile="..\lib\pjsip-simple-$(TargetCPU)-wm5ppc-vc$(VSVer)-$(ConfigurationName).lib" + OutputFile="..\lib\pjsip-simple-$(TargetCPU)-wm2003ppc-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -2097,11 +2105,11 @@ /> </Configuration> <Configuration - Name="Debug-Static|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm5-common-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Debug-Dynamic|Smartphone 2003 (ARMV4)" ConfigurationType="4" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm2003-common-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -2120,9 +2128,9 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" ExecutionBucket="7" AdditionalIncludeDirectories="../include,../../pjlib-util/include,../../pjlib/include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -2136,7 +2144,7 @@ /> <Tool Name="VCLibrarianTool" - OutputFile="..\lib\pjsip-simple-$(TargetCPU)-wm5ppc-vc$(VSVer)-$(ConfigurationName).lib" + OutputFile="..\lib\pjsip-simple-$(TargetCPU)-wm2003sp-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -2163,11 +2171,11 @@ /> </Configuration> <Configuration - Name="Release-Dynamic|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm5-release-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Debug-Dynamic|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ConfigurationType="4" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm5-common-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -2186,9 +2194,9 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" ExecutionBucket="7" AdditionalIncludeDirectories="../include,../../pjlib-util/include,../../pjlib/include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -2202,7 +2210,7 @@ /> <Tool Name="VCLibrarianTool" - OutputFile="..\lib\pjsip-simple-$(TargetCPU)-wm5ppc-vc$(VSVer)-$(ConfigurationName).lib" + OutputFile="..\lib\pjsip-simple-$(TargetCPU)-wm5ppc-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -2229,11 +2237,11 @@ /> </Configuration> <Configuration - Name="Debug-Dynamic|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm5-common-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Debug-Dynamic|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ConfigurationType="4" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm5-common-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -2252,9 +2260,9 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" ExecutionBucket="7" AdditionalIncludeDirectories="../include,../../pjlib-util/include,../../pjlib/include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -2268,7 +2276,7 @@ /> <Tool Name="VCLibrarianTool" - OutputFile="..\lib\pjsip-simple-$(TargetCPU)-wm5ppc-vc$(VSVer)-$(ConfigurationName).lib" + OutputFile="..\lib\pjsip-simple-$(TargetCPU)-wm5sp-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -2295,11 +2303,12 @@ /> </Configuration> <Configuration - Name="Release-Static|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm5-release-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Release-Static|Win32" ConfigurationType="4" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-win32-release-defaults.vsprops" + UseOfMFC="0" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="2" > <Tool Name="VCPreBuildEventTool" @@ -2318,9 +2327,8 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" - ExecutionBucket="7" AdditionalIncludeDirectories="../include,../../pjlib-util/include,../../pjlib/include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -2334,7 +2342,7 @@ /> <Tool Name="VCLibrarianTool" - OutputFile="..\lib\pjsip-simple-$(TargetCPU)-wm5ppc-vc$(VSVer)-$(ConfigurationName).lib" + OutputFile="..\lib\pjsip-simple-$(TargetCPU)-$(PlatformName)-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -2346,26 +2354,18 @@ Name="VCBscMakeTool" /> <Tool - Name="VCCodeSignTool" + Name="VCFxCopTool" /> <Tool Name="VCPostBuildEventTool" /> - <DeploymentTool - ForceDirty="-1" - RemoteDirectory="" - RegisterOutput="0" - AdditionalFiles="" - /> - <DebuggerTool - /> </Configuration> <Configuration - Name="Debug|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm5-common-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Release-Static|Windows Mobile 6 Standard SDK (ARMV4I)" ConfigurationType="4" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm6-release-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -2384,9 +2384,9 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" ExecutionBucket="7" AdditionalIncludeDirectories="../include,../../pjlib-util/include,../../pjlib/include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -2400,7 +2400,7 @@ /> <Tool Name="VCLibrarianTool" - OutputFile="..\lib\pjsip-simple-$(TargetCPU)-wm5sp-vc$(VSVer)-$(ConfigurationName).lib" + OutputFile="..\lib\pjsip-simple-$(TargetCPU)-wm6std-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -2427,11 +2427,11 @@ /> </Configuration> <Configuration - Name="Release|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm5-release-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Release-Static|Windows Mobile 6 Professional SDK (ARMV4I)" ConfigurationType="4" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm6-release-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -2450,9 +2450,9 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" ExecutionBucket="7" AdditionalIncludeDirectories="../include,../../pjlib-util/include,../../pjlib/include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -2466,7 +2466,7 @@ /> <Tool Name="VCLibrarianTool" - OutputFile="..\lib\pjsip-simple-$(TargetCPU)-wm5sp-vc$(VSVer)-$(ConfigurationName).lib" + OutputFile="..\lib\pjsip-simple-$(TargetCPU)-wm6pro-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -2493,11 +2493,11 @@ /> </Configuration> <Configuration - Name="Debug-Static|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm5-common-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Release-Static|Pocket PC 2003 (ARMV4)" ConfigurationType="4" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm2003-release-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -2516,9 +2516,9 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" ExecutionBucket="7" AdditionalIncludeDirectories="../include,../../pjlib-util/include,../../pjlib/include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -2532,7 +2532,7 @@ /> <Tool Name="VCLibrarianTool" - OutputFile="..\lib\pjsip-simple-$(TargetCPU)-wm5sp-vc$(VSVer)-$(ConfigurationName).lib" + OutputFile="..\lib\pjsip-simple-$(TargetCPU)-wm2003ppc-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -2559,11 +2559,11 @@ /> </Configuration> <Configuration - Name="Release-Dynamic|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm5-release-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Release-Static|Smartphone 2003 (ARMV4)" ConfigurationType="4" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm2003-release-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -2582,9 +2582,9 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" ExecutionBucket="7" AdditionalIncludeDirectories="../include,../../pjlib-util/include,../../pjlib/include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -2598,7 +2598,7 @@ /> <Tool Name="VCLibrarianTool" - OutputFile="..\lib\pjsip-simple-$(TargetCPU)-wm5sp-vc$(VSVer)-$(ConfigurationName).lib" + OutputFile="..\lib\pjsip-simple-$(TargetCPU)-wm2003sp-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -2625,11 +2625,11 @@ /> </Configuration> <Configuration - Name="Debug-Dynamic|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm5-common-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Release-Static|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ConfigurationType="4" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm5-release-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -2648,9 +2648,9 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" ExecutionBucket="7" AdditionalIncludeDirectories="../include,../../pjlib-util/include,../../pjlib/include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -2664,7 +2664,7 @@ /> <Tool Name="VCLibrarianTool" - OutputFile="..\lib\pjsip-simple-$(TargetCPU)-wm5sp-vc$(VSVer)-$(ConfigurationName).lib" + OutputFile="..\lib\pjsip-simple-$(TargetCPU)-wm5ppc-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -2692,10 +2692,10 @@ </Configuration> <Configuration Name="Release-Static|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm5-release-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" ConfigurationType="4" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm5-release-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -2714,9 +2714,9 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" ExecutionBucket="7" AdditionalIncludeDirectories="../include,../../pjlib-util/include,../../pjlib/include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -2730,7 +2730,7 @@ /> <Tool Name="VCLibrarianTool" - OutputFile="..\lib\pjsip-simple-$(TargetCPU)-wm5sp-vc$(VSVer)-$(ConfigurationName).lib" + OutputFile="..\lib\pjsip-simple-$(TargetCPU)-wm5sp-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -2996,6 +2996,10 @@ /> </FileConfiguration> </File> + <File + RelativePath="..\src\pjsip-simple\mwi.c" + > + </File> <File RelativePath="..\src\pjsip-simple\pidf.c" > @@ -3311,6 +3315,10 @@ RelativePath="..\include\pjsip-simple\iscomposing.h" > </File> + <File + RelativePath="..\include\pjsip-simple\mwi.h" + > + </File> <File RelativePath="..\include\pjsip-simple\pidf.h" > diff --git a/sflphone-common/libs/pjproject/pjsip/include/pjsip-simple/mwi.h b/sflphone-common/libs/pjproject/pjsip/include/pjsip-simple/mwi.h new file mode 100644 index 0000000000000000000000000000000000000000..351bbbea4fed96cb272f7c376ed72c4adaaacd02 --- /dev/null +++ b/sflphone-common/libs/pjproject/pjsip/include/pjsip-simple/mwi.h @@ -0,0 +1,208 @@ +/* $Id: mwi.h 2968 2009-10-26 11:21:37Z bennylp $ */ +/* + * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ +#ifndef __PJSIP_SIMPLE_MWI_H__ +#define __PJSIP_SIMPLE_MWI_H__ + +/** + * @file mwi.h + * @brief SIP Extension for MWI (RFC 3842) + */ +#include <pjsip-simple/evsub.h> +#include <pjsip/sip_msg.h> + + +PJ_BEGIN_DECL + + +/** + * @defgroup mwi SIP Message Summary and Message Waiting Indication (RFC 3842) + * @ingroup PJSIP_SIMPLE + * @brief Support for SIP MWI Extension (RFC 3842) + * @{ + * + * This module implements RFC 3842: A Message Summary and Message Waiting + * Indication Event Package for the Session Initiation Protocol (SIP). + * It uses the SIP Event Notification framework (evsub.h) and extends the + * framework by implementing "message-summary" event package. + */ + + +/** + * Initialize the MWI module and register it as endpoint module and + * package to the event subscription module. + * + * @param endpt The endpoint instance. + * @param mod_evsub The event subscription module instance. + * + * @return PJ_SUCCESS if the module is successfully + * initialized and registered to both endpoint + * and the event subscription module. + */ +PJ_DECL(pj_status_t) pjsip_mwi_init_module(pjsip_endpoint *endpt, + pjsip_module *mod_evsub); + +/** + * Get the MWI module instance. + * + * @return The MWI module instance. + */ +PJ_DECL(pjsip_module*) pjsip_mwi_instance(void); + +/** + * Create MWI client subscription session. + * + * @param dlg The underlying dialog to use. + * @param user_cb Pointer to callbacks to receive MWI subscription + * events. + * @param options Option flags. Currently only PJSIP_EVSUB_NO_EVENT_ID + * is recognized. + * @param p_evsub Pointer to receive the MWI subscription + * session. + * + * @return PJ_SUCCESS on success. + */ +PJ_DECL(pj_status_t) pjsip_mwi_create_uac( pjsip_dialog *dlg, + const pjsip_evsub_user *user_cb, + unsigned options, + pjsip_evsub **p_evsub ); + +/** + * Create MWI server subscription session. + * + * @param dlg The underlying dialog to use. + * @param user_cb Pointer to callbacks to receive MWI subscription + * events. + * @param rdata The incoming SUBSCRIBE request that creates the event + * subscription. + * @param p_evsub Pointer to receive the MWI subscription + * session. + * + * @return PJ_SUCCESS on success. + */ +PJ_DECL(pj_status_t) pjsip_mwi_create_uas( pjsip_dialog *dlg, + const pjsip_evsub_user *user_cb, + pjsip_rx_data *rdata, + pjsip_evsub **p_evsub ); + +/** + * Forcefully destroy the MWI subscription. This function should only + * be called on special condition, such as when the subscription + * initialization has failed. For other conditions, application MUST terminate + * the subscription by sending the appropriate un(SUBSCRIBE) or NOTIFY. + * + * @param sub The MWI subscription. + * @param notify Specify whether the state notification callback + * should be called. + * + * @return PJ_SUCCESS if subscription session has been destroyed. + */ +PJ_DECL(pj_status_t) pjsip_mwi_terminate( pjsip_evsub *sub, + pj_bool_t notify ); + +/** + * Call this function to create request to initiate MWI subscription, to + * refresh subcription, or to request subscription termination. + * + * @param sub Client subscription instance. + * @param expires Subscription expiration. If the value is set to zero, + * this will request unsubscription. + * @param p_tdata Pointer to receive the request. + * + * @return PJ_SUCCESS on success. + */ +PJ_DECL(pj_status_t) pjsip_mwi_initiate( pjsip_evsub *sub, + pj_int32_t expires, + pjsip_tx_data **p_tdata); + +/** + * Accept the incoming subscription request by sending 2xx response to + * incoming SUBSCRIBE request. + * + * @param sub Server subscription instance. + * @param rdata The incoming subscription request message. + * @param st_code Status code, which MUST be final response. + * @param hdr_list Optional list of headers to be added in the response. + * + * @return PJ_SUCCESS on success. + */ +PJ_DECL(pj_status_t) pjsip_mwi_accept( pjsip_evsub *sub, + pjsip_rx_data *rdata, + int st_code, + const pjsip_hdr *hdr_list ); + +/** + * For notifier, create NOTIFY request to subscriber, and set the state + * of the subscription. + * + * @param sub The server subscription (notifier) instance. + * @param state New state to set. + * @param state_str The state string name, if state contains value other + * than active, pending, or terminated. Otherwise this + * argument is ignored. + * @param reason Specify reason if new state is terminated, otherwise + * put NULL. + * @param mime_type MIME type/content type of the message body. + * @param body Message body to be included in the NOTIFY request. + * @param p_tdata Pointer to receive the request. + * + * @return PJ_SUCCESS on success. + */ +PJ_DECL(pj_status_t) pjsip_mwi_notify( pjsip_evsub *sub, + pjsip_evsub_state state, + const pj_str_t *state_str, + const pj_str_t *reason, + const pjsip_media_type *mime_type, + const pj_str_t *body, + pjsip_tx_data **p_tdata); + +/** + * Create NOTIFY request containing message body from the last NOITFY + * message created. + * + * @param sub Server subscription object. + * @param p_tdata Pointer to receive request. + * + * @return PJ_SUCCESS on success. + */ +PJ_DECL(pj_status_t) pjsip_mwi_current_notify( pjsip_evsub *sub, + pjsip_tx_data **p_tdata ); + + +/** + * Send request message that was previously created with initiate(), notify(), + * or current_notify(). Application may also send request created with other + * functions, e.g. authentication. But the request MUST be either request + * that creates/refresh subscription or NOTIFY request. + * + * @param sub The subscription object. + * @param tdata Request message to be sent. + * + * @return PJ_SUCCESS on success. + */ +PJ_DECL(pj_status_t) pjsip_mwi_send_request( pjsip_evsub *sub, + pjsip_tx_data *tdata ); + +/** + * @} + */ + +PJ_END_DECL + + +#endif /* __PJSIP_SIMPLE_MWI_H__ */ diff --git a/sflphone-common/libs/pjproject/pjsip/include/pjsip-simple/publish.h b/sflphone-common/libs/pjproject/pjsip/include/pjsip-simple/publish.h index 23ab5e04828032f7e7d64f396dad49c98a0be2a1..36147c4b0f9f8a145d9972cf24625e769e320d46 100644 --- a/sflphone-common/libs/pjproject/pjsip/include/pjsip-simple/publish.h +++ b/sflphone-common/libs/pjproject/pjsip/include/pjsip-simple/publish.h @@ -1,4 +1,4 @@ -/* $Id: publish.h 2661 2009-04-28 22:19:49Z bennylp $ */ +/* $Id: publish.h 2940 2009-10-12 07:44:14Z bennylp $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> @@ -65,6 +65,25 @@ extern const pjsip_method pjsip_publish_method; typedef struct pjsip_publishc pjsip_publishc; +/** + * Client publication options. Application should initialize this structure + * with its default values by calling #pjsip_publishc_opt_default() + */ +typedef struct pjsip_publishc_opt +{ + /** + * Specify whether the client publication session should queue the + * PUBLISH request should there be another PUBLISH transaction still + * pending. If this is set to false, the client will return error + * on the PUBLISH request if there is another PUBLISH transaction still + * in progress. + * + * Default: PJSIP_PUBLISHC_QUEUE_REQUEST + */ + pj_bool_t queue_request; + +} pjsip_publishc_opt; + /** Structure to hold parameters when calling application's callback. * The application's callback is called when the client publication process @@ -88,6 +107,14 @@ struct pjsip_publishc_cbparam typedef void pjsip_publishc_cb(struct pjsip_publishc_cbparam *param); +/** + * Initialize client publication session option with default values. + * + * @param opt The option. + */ +PJ_DECL(void) pjsip_publishc_opt_default(pjsip_publishc_opt *opt); + + /** * Initialize client publication module. * @@ -98,12 +125,11 @@ typedef void pjsip_publishc_cb(struct pjsip_publishc_cbparam *param); PJ_DECL(pj_status_t) pjsip_publishc_init_module(pjsip_endpoint *endpt); - /** * Create client publication structure. * * @param endpt Endpoint, used to allocate pool from. - * @param options Option flags. + * @param opt Options, or NULL to specify default options. * @param token Opaque data to be associated with the client publication. * @param cb Pointer to callback function to receive publication status. * @param p_pubc Pointer to receive client publication structure. @@ -111,7 +137,7 @@ PJ_DECL(pj_status_t) pjsip_publishc_init_module(pjsip_endpoint *endpt); * @return PJ_SUCCESS on success. */ PJ_DECL(pj_status_t) pjsip_publishc_create( pjsip_endpoint *endpt, - unsigned options, + const pjsip_publishc_opt *opt, void *token, pjsip_publishc_cb *cb, pjsip_publishc **p_pubc); @@ -269,10 +295,23 @@ PJ_DECL(pj_status_t) pjsip_publishc_update_expires(pjsip_publishc *pubc, * and application will be notified via the callback when the process * completes. * + * If the session has another PUBLISH request outstanding, the behavior + * depends on whether request queueing is enabled in the session (this was + * set by setting \a queue_request field of #pjsip_publishc_opt to true + * when calling #pjsip_publishc_create(). Default is true). If request + * queueing is enabled, the request will be queued and the function will + * return PJ_EPENDING. One the outstanding request is complete, the queued + * request will be sent automatically. If request queueing is disabled, the + * function will reject the request and return PJ_EBUSY. + * * @param pubc The client publication structure. * @param tdata Transmit data. * - * @return PJ_SUCCESS on success. + * @return - PJ_SUCCESS on success, or + * - PJ_EPENDING if request is queued, or + * - PJ_EBUSY if request is rejected because another PUBLISH + * request is in progress, or + * - other status code to indicate the error. */ PJ_DECL(pj_status_t) pjsip_publishc_send(pjsip_publishc *pubc, pjsip_tx_data *tdata); diff --git a/sflphone-common/libs/pjproject/pjsip/include/pjsip/sip_autoconf.h b/sflphone-common/libs/pjproject/pjsip/include/pjsip/sip_autoconf.h deleted file mode 100644 index cf154f5ec0e6b07e4202816984acf53b5c69c5be..0000000000000000000000000000000000000000 --- a/sflphone-common/libs/pjproject/pjsip/include/pjsip/sip_autoconf.h +++ /dev/null @@ -1,40 +0,0 @@ -/* pjsip/include/pjsip/sip_autoconf.h. Generated from sip_autoconf.h.in by configure. */ -/* $Id: sip_autoconf.h.in 2394 2008-12-23 17:27:53Z bennylp $ */ -/* - * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) - * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ -#ifndef __PJSIP_SIP_AUTOCONF_H__ -#define __PJSIP_SIP_AUTOCONF_H__ - -/** - * @file sip_autoconf.h - * @brief Describes operating system specifics (automatically detected by - * autoconf) - */ - -/** - * Enable/disable TLS transport, as configured by autoconf. - * But only do this if user doesn't explicitly configure in pj/config_site.h. - */ -#ifndef PJSIP_HAS_TLS_TRANSPORT -#define PJSIP_HAS_TLS_TRANSPORT 1 -#endif - - -#endif /* __PJSIP_SIP_AUTOCONF_H__ */ - diff --git a/sflphone-common/libs/pjproject/pjsip/include/pjsip/sip_autoconf.h.in b/sflphone-common/libs/pjproject/pjsip/include/pjsip/sip_autoconf.h.in index cb753905e54ae072b4a0558ba531f35d9ef6ee43..2b9a6d0ca9055ac972c07c8adfce1d4072c7cef9 100644 --- a/sflphone-common/libs/pjproject/pjsip/include/pjsip/sip_autoconf.h.in +++ b/sflphone-common/libs/pjproject/pjsip/include/pjsip/sip_autoconf.h.in @@ -1,4 +1,4 @@ -/* $Id: sip_autoconf.h.in 2394 2008-12-23 17:27:53Z bennylp $ */ +/* $Id: sip_autoconf.h.in 2973 2009-10-28 06:09:15Z nanang $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> @@ -26,14 +26,14 @@ * autoconf) */ -/** +/* * Enable/disable TLS transport, as configured by autoconf. * But only do this if user doesn't explicitly configure in pj/config_site.h. */ -#ifndef PJSIP_HAS_TLS_TRANSPORT -#undef PJSIP_HAS_TLS_TRANSPORT -#endif - +/* Since 1.5, the default setting will follow PJ_HAS_SSL_SOCK setting. */ +//#ifndef PJSIP_HAS_TLS_TRANSPORT +//#undef PJSIP_HAS_TLS_TRANSPORT +//#endif #endif /* __PJSIP_SIP_AUTOCONF_H__ */ diff --git a/sflphone-common/libs/pjproject/pjsip/include/pjsip/sip_config.h b/sflphone-common/libs/pjproject/pjsip/include/pjsip/sip_config.h index 0fa12a8be7705b196a1c1b1c612f512910f40504..0250fb8e96556a96a658e2596950444102aa70f0 100644 --- a/sflphone-common/libs/pjproject/pjsip/include/pjsip/sip_config.h +++ b/sflphone-common/libs/pjproject/pjsip/include/pjsip/sip_config.h @@ -1,4 +1,4 @@ -/* $Id: sip_config.h 2859 2009-08-11 16:26:20Z nanang $ */ +/* $Id: sip_config.h 3019 2009-11-20 04:18:27Z bennylp $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> @@ -213,7 +213,7 @@ PJ_INLINE(pjsip_cfg_t*) pjsip_cfg(void) * This mainly affects the size of mod_data array in various components. */ #ifndef PJSIP_MAX_MODULE -# define PJSIP_MAX_MODULE 16 +# define PJSIP_MAX_MODULE 32 #endif @@ -513,10 +513,10 @@ PJ_INLINE(pjsip_cfg_t*) pjsip_cfg(void) * Enable TLS SIP transport support. For most systems this means that * OpenSSL must be installed. * - * Default: 0 (for now) + * Default: follow PJ_HAS_SSL_SOCK setting, which is 0 (disabled) by default. */ #ifndef PJSIP_HAS_TLS_TRANSPORT -# define PJSIP_HAS_TLS_TRANSPORT 0 +# define PJSIP_HAS_TLS_TRANSPORT PJ_HAS_SSL_SOCK #endif @@ -896,6 +896,20 @@ PJ_INLINE(pjsip_cfg_t*) pjsip_cfg(void) #endif +/** + * Specify whether the client publication session should queue the + * PUBLISH request should there be another PUBLISH transaction still + * pending. If this is set to false, the client will return error + * on the PUBLISH request if there is another PUBLISH transaction still + * in progress. + * + * Default: 1 (yes) + */ +#ifndef PJSIP_PUBLISHC_QUEUE_REQUEST +# define PJSIP_PUBLISHC_QUEUE_REQUEST 1 +#endif + + PJ_END_DECL /** diff --git a/sflphone-common/libs/pjproject/pjsip/include/pjsip/sip_msg.h b/sflphone-common/libs/pjproject/pjsip/include/pjsip/sip_msg.h index b1dc2c04c5345d1072d05ef6637393254b0fc565..51e970c0dac4d51c3d0ff460f5793c957a162f11 100644 --- a/sflphone-common/libs/pjproject/pjsip/include/pjsip/sip_msg.h +++ b/sflphone-common/libs/pjproject/pjsip/include/pjsip/sip_msg.h @@ -1,4 +1,4 @@ -/* $Id: sip_msg.h 2394 2008-12-23 17:27:53Z bennylp $ */ +/* $Id: sip_msg.h 2968 2009-10-26 11:21:37Z bennylp $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> @@ -511,6 +511,18 @@ typedef struct pjsip_media_type pj_str_t param; /**< Media type parameters (concatenated). */ } pjsip_media_type; + +/** + * Copy SIP media type to another. + * + * @param pool Pool to duplicate strings. + * @param dst Destination structure. + * @param src Source structure. + */ +PJ_DECL(void) pjsip_media_type_cp(pj_pool_t *pool, + pjsip_media_type *dst, + const pjsip_media_type *src); + /** * @} */ diff --git a/sflphone-common/libs/pjproject/pjsip/include/pjsip/sip_transport.h b/sflphone-common/libs/pjproject/pjsip/include/pjsip/sip_transport.h index 25d142fdbce829ff050be43cd368a4207c13881c..ed52cf670d65e13ec45a737354e2d86a227556ea 100644 --- a/sflphone-common/libs/pjproject/pjsip/include/pjsip/sip_transport.h +++ b/sflphone-common/libs/pjproject/pjsip/include/pjsip/sip_transport.h @@ -1,4 +1,4 @@ -/* $Id: sip_transport.h 2724 2009-05-29 13:04:03Z bennylp $ */ +/* $Id: sip_transport.h 2985 2009-11-04 13:17:31Z bennylp $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> @@ -27,6 +27,7 @@ #include <pjsip/sip_msg.h> #include <pjsip/sip_parser.h> +#include <pjsip/sip_resolve.h> #include <pj/sock.h> #include <pj/list.h> #include <pj/ioqueue.h> @@ -384,9 +385,16 @@ struct pjsip_rx_data /** Content-length header. */ pjsip_clen_hdr *clen; - /** The first Require header. */ + /** "Require" header containing aggregates of all Require + * headers found in the message, or NULL. + */ pjsip_require_hdr *require; + /** "Supported" header containing aggregates of all Supported + * headers found in the message, or NULL. + */ + pjsip_supported_hdr *supported; + /** The list of error generated by the parser when parsing this message. */ @@ -522,6 +530,26 @@ struct pjsip_tx_data /** Callback to be called when this tx_data has been transmitted. */ void (*cb)(void*, pjsip_tx_data*, pj_ssize_t); + /** Destination information, to be used to determine the network address + * of the message. For a request, this information is initialized when + * the request is sent with #pjsip_endpt_send_request_stateless() and + * network address is resolved. For CANCEL request, this information + * will be copied from the original INVITE to make sure that the CANCEL + * request goes to the same physical network address as the INVITE + * request. + */ + struct + { + /** Server addresses resolved. + */ + pjsip_server_addresses addr; + + /** Current server address being tried. + */ + unsigned cur_addr; + + } dest_info; + /** Transport information, only valid during on_tx_request() and * on_tx_response() callback. */ diff --git a/sflphone-common/libs/pjproject/pjsip/include/pjsip/sip_transport_tcp.h b/sflphone-common/libs/pjproject/pjsip/include/pjsip/sip_transport_tcp.h index 5fe5a52e100dd4354d1c05675a34714b6fe37b10..d2fc6536262cdc1696bd9fd3619a32becf1988fb 100644 --- a/sflphone-common/libs/pjproject/pjsip/include/pjsip/sip_transport_tcp.h +++ b/sflphone-common/libs/pjproject/pjsip/include/pjsip/sip_transport_tcp.h @@ -1,4 +1,4 @@ -/* $Id: sip_transport_tcp.h 2394 2008-12-23 17:27:53Z bennylp $ */ +/* $Id: sip_transport_tcp.h 2966 2009-10-25 09:02:07Z bennylp $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> @@ -26,6 +26,7 @@ */ #include <pjsip/sip_transport.h> +#include <pj/sock_qos.h> /* Only declare the API if PJ_HAS_TCP is true */ @@ -43,6 +44,74 @@ PJ_BEGIN_DECL * the transport to the framework. */ +/** + * Settings to be specified when creating the TCP transport. Application + * should initialize this structure with its default values by calling + * pjsip_tcp_transport_cfg_default(). + */ +typedef struct pjsip_tcp_transport_cfg +{ + /** + * Address family to use. Valid values are pj_AF_INET() and + * pj_AF_INET6(). Default is pj_AF_INET(). + */ + int af; + + /** + * Optional address to bind the socket to. Default is to bind to + * PJ_INADDR_ANY and to any available port. + */ + pj_sockaddr bind_addr; + + /** + * Optional published address, which is the address to be + * advertised as the address of this SIP transport. + * By default the bound address will be used as the published address. + */ + pjsip_host_port addr_name; + + /** + * Number of simultaneous asynchronous accept() operations to be + * supported. It is recommended that the number here corresponds to + * the number of processors in the system (or the number of SIP + * worker threads). + * + * Default: 1 + */ + unsigned async_cnt; + + /** + * QoS traffic type to be set on this transport. When application wants + * to apply QoS tagging to the transport, it's preferable to set this + * field rather than \a qos_param fields since this is more portable. + * + * Default is QoS not set. + */ + pj_qos_type qos_type; + + /** + * Set the low level QoS parameters to the transport. This is a lower + * level operation than setting the \a qos_type field and may not be + * supported on all platforms. + * + * Default is QoS not set. + */ + pj_qos_params qos_params; + +} pjsip_tcp_transport_cfg; + + +/** + * Initialize pjsip_tcp_transport_cfg structure with default values for + * the specifed address family. + * + * @param cfg The structure to initialize. + * @param af Address family to be used. + */ +PJ_DECL(void) pjsip_tcp_transport_cfg_default(pjsip_tcp_transport_cfg *cfg, + int af); + + /** * Register support for SIP TCP transport by creating TCP listener on * the specified address and port. This function will create an @@ -110,6 +179,24 @@ PJ_DECL(pj_status_t) pjsip_tcp_transport_start2(pjsip_endpoint *endpt, unsigned async_cnt, pjsip_tpfactory **p_factory); +/** + * Another variant of #pjsip_tcp_transport_start(). + * + * @param endpt The SIP endpoint. + * @param cfg TCP transport settings. Application should initialize + * this setting with #pjsip_tcp_transport_cfg_default(). + * @param p_factory Optional pointer to receive the instance of the + * SIP TCP transport factory just created. + * + * @return PJ_SUCCESS when the transport has been successfully + * started and registered to transport manager, or + * the appropriate error code. + */ +PJ_DECL(pj_status_t) pjsip_tcp_transport_start3( + pjsip_endpoint *endpt, + const pjsip_tcp_transport_cfg *cfg, + pjsip_tpfactory **p_factory + ); PJ_END_DECL diff --git a/sflphone-common/libs/pjproject/pjsip/include/pjsip/sip_transport_tls.h b/sflphone-common/libs/pjproject/pjsip/include/pjsip/sip_transport_tls.h index 4c5d1b6a67c97235d093ed14f10a267fbed25826..e093fd6b08b40bca0f62db053abaa590c34870b0 100644 --- a/sflphone-common/libs/pjproject/pjsip/include/pjsip/sip_transport_tls.h +++ b/sflphone-common/libs/pjproject/pjsip/include/pjsip/sip_transport_tls.h @@ -1,4 +1,4 @@ -/* $Id: sip_transport_tls.h 2394 2008-12-23 17:27:53Z bennylp $ */ +/* $Id: sip_transport_tls.h 2998 2009-11-09 08:51:34Z bennylp $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> @@ -27,6 +27,7 @@ #include <pjsip/sip_transport.h> #include <pj/string.h> +#include <pj/sock_qos.h> PJ_BEGIN_DECL @@ -160,6 +161,32 @@ typedef struct pjsip_tls_setting */ pj_time_val timeout; + /** + * QoS traffic type to be set on this transport. When application wants + * to apply QoS tagging to the transport, it's preferable to set this + * field rather than \a qos_param fields since this is more portable. + * + * Default value is PJ_QOS_TYPE_BEST_EFFORT. + */ + pj_qos_type qos_type; + + /** + * Set the low level QoS parameters to the transport. This is a lower + * level operation than setting the \a qos_type field and may not be + * supported on all platforms. + * + * By default all settings in this structure are disabled. + */ + pj_qos_params qos_params; + + /** + * Specify if the transport should ignore any errors when setting the QoS + * traffic type/parameters. + * + * Default: PJ_TRUE + */ + pj_bool_t qos_ignore_error; + } pjsip_tls_setting; @@ -171,6 +198,8 @@ typedef struct pjsip_tls_setting PJ_INLINE(void) pjsip_tls_setting_default(pjsip_tls_setting *tls_opt) { pj_memset(tls_opt, 0, sizeof(*tls_opt)); + tls_opt->qos_type = PJ_QOS_TYPE_BEST_EFFORT; + tls_opt->qos_ignore_error = PJ_TRUE; } diff --git a/sflphone-common/libs/pjproject/pjsip/include/pjsip/sip_util.h b/sflphone-common/libs/pjproject/pjsip/include/pjsip/sip_util.h index da8efa55c7fbc152b1ba7e2b9cad884bdc760b73..43a9cab21394d7d97e8671e16bced6350066ccb5 100644 --- a/sflphone-common/libs/pjproject/pjsip/include/pjsip/sip_util.h +++ b/sflphone-common/libs/pjproject/pjsip/include/pjsip/sip_util.h @@ -1,4 +1,4 @@ -/* $Id: sip_util.h 2855 2009-08-05 18:41:23Z nanang $ */ +/* $Id: sip_util.h 2932 2009-10-09 12:11:07Z bennylp $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> @@ -451,14 +451,6 @@ typedef struct pjsip_send_state */ pjsip_tx_data *tdata; - /** Server addresses resolved. - */ - pjsip_server_addresses addr; - - /** Current server address being tried. - */ - unsigned cur_addr; - /** Current transport being used. */ pjsip_transport *cur_transport; diff --git a/sflphone-common/libs/pjproject/pjsip/include/pjsip_simple.h b/sflphone-common/libs/pjproject/pjsip/include/pjsip_simple.h index f1f925f322f08a465ed43a034be06675d3af6604..f9fb8643b9c6cc646d5a56d05213a25cdd6e7887 100644 --- a/sflphone-common/libs/pjproject/pjsip/include/pjsip_simple.h +++ b/sflphone-common/libs/pjproject/pjsip/include/pjsip_simple.h @@ -1,4 +1,4 @@ -/* $Id: pjsip_simple.h 2394 2008-12-23 17:27:53Z bennylp $ */ +/* $Id: pjsip_simple.h 2968 2009-10-26 11:21:37Z bennylp $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> @@ -35,7 +35,9 @@ #define __PJSIP_SIMPLE_H__ #include <pjsip-simple/evsub.h> +#include <pjsip-simple/evsub_msg.h> #include <pjsip-simple/iscomposing.h> +#include <pjsip-simple/mwi.h> #include <pjsip-simple/presence.h> #include <pjsip-simple/pidf.h> #include <pjsip-simple/publish.h> diff --git a/sflphone-common/libs/pjproject/pjsip/include/pjsua-lib/pjsua.h b/sflphone-common/libs/pjproject/pjsip/include/pjsua-lib/pjsua.h index cb8125bf0a62a6ab054d52d9a37748639b262e7f..6821f60aa8a54f579a73ace990aca27753f53500 100644 --- a/sflphone-common/libs/pjproject/pjsip/include/pjsua-lib/pjsua.h +++ b/sflphone-common/libs/pjproject/pjsip/include/pjsua-lib/pjsua.h @@ -1,4 +1,4 @@ -/* $Id: pjsua.h 2864 2009-08-12 11:03:23Z bennylp $ */ +/* $Id: pjsua.h 3021 2009-11-20 23:33:07Z bennylp $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> @@ -378,6 +378,17 @@ PJ_DECL(void) pjsua_logging_config_dup(pj_pool_t *pool, const pjsua_logging_config *src); +/** + * Structure to be passed on MWI callback. + */ +typedef struct pjsua_mwi_info +{ + pjsip_evsub *evsub; /**< Event subscription session, for + reference. */ + pjsip_rx_data *rdata; /**< The received NOTIFY request. */ +} pjsua_mwi_info; + + /** * This structure describes application callback to receive various event * notification from PJSUA-API. All of these callbacks are OPTIONAL, @@ -821,6 +832,17 @@ typedef struct pjsua_callback const pjsip_uri *target, const pjsip_event *e); + /** + * This callback is called when a NOTIFY request for message summary / + * message waiting indication is received. + * + * @param acc_id The account ID. + * @param mwi_info Structure containing details of the event, + * including the received NOTIFY request in the + * \a rdata field. + */ + void (*on_mwi_info)(pjsua_acc_id acc_id, pjsua_mwi_info *mwi_info); + } pjsua_callback; @@ -979,6 +1001,21 @@ typedef struct pjsua_config */ pj_bool_t require_timer; + /** + * Handle unsolicited NOTIFY requests containing message waiting + * indication (MWI) info. Unsolicited MWI is incoming NOTIFY requests + * which are not requested by client with SUBSCRIBE request. + * + * If this is enabled, the library will respond 200/OK to the NOTIFY + * request and forward the request to \a on_mwi_info() callback. + * + * See also \a mwi_enabled field #on pjsua_acc_config. + * + * Default: PJ_TRUE + * + */ + pj_bool_t enable_unsolicited_mwi; + /** * Specify Session Timer settings, see #pjsip_timer_setting. * Note that this setting can be further customized in account @@ -1396,6 +1433,32 @@ PJ_DECL(pj_status_t) pjsua_cancel_stun_resolution(void *token, PJ_DECL(pj_status_t) pjsua_verify_sip_url(const char *url); +/** + * Schedule a timer entry. Note that the timer callback may be executed + * by different thread, depending on whether worker thread is enabled or + * not. + * + * @param entry Timer heap entry. + * @param delay The interval to expire. + * + * @return PJ_SUCCESS on success, or the appropriate error code. + * + * @see pjsip_endpt_schedule_timer() + */ +PJ_DECL(pj_status_t) pjsua_schedule_timer(pj_timer_entry *entry, + const pj_time_val *delay); + + +/** + * Cancel the previously scheduled timer. + * + * @param entry Timer heap entry. + * + * @see pjsip_endpt_cancel_timer() + */ +PJ_DECL(void) pjsua_cancel_timer(pj_timer_entry *entry); + + /** * This is a utility function to display error message for the specified * error code. The error message will be sent to the log. @@ -1491,6 +1554,24 @@ typedef struct pjsua_transport_config */ pjsip_tls_setting tls_setting; + /** + * QoS traffic type to be set on this transport. When application wants + * to apply QoS tagging to the transport, it's preferable to set this + * field rather than \a qos_param fields since this is more portable. + * + * Default is QoS not set. + */ + pj_qos_type qos_type; + + /** + * Set the low level QoS parameters to the transport. This is a lower + * level operation than setting the \a qos_type field and may not be + * supported on all platforms. + * + * Default is QoS not set. + */ + pj_qos_params qos_params; + } pjsua_transport_config; @@ -1724,6 +1805,17 @@ PJ_DECL(pj_status_t) pjsua_transport_close( pjsua_transport_id id, #endif +/** + * Default maximum time to wait for account unregistration transactions to + * complete during library shutdown sequence. + * + * Default: 4000 (4 seconds) + */ +#ifndef PJSUA_UNREG_TIMEOUT +# define PJSUA_UNREG_TIMEOUT 4000 +#endif + + /** * Default PUBLISH expiration */ @@ -1750,6 +1842,22 @@ PJ_DECL(pj_status_t) pjsua_transport_close( pjsua_transport_id id, #endif +/** + * Maximum time to wait for unpublication transaction(s) to complete + * during shutdown process, before sending unregistration. The library + * tries to wait for the unpublication (un-PUBLISH) to complete before + * sending REGISTER request to unregister the account, during library + * shutdown process. If the value is set too short, it is possible that + * the unregistration is sent before unpublication completes, causing + * unpublication request to fail. + * + * Default: 2000 (2 seconds) + */ +#ifndef PJSUA_UNPUBLISH_MAX_WAIT_TIME_MSEC +# define PJSUA_UNPUBLISH_MAX_WAIT_TIME_MSEC 2000 +#endif + + /** * This structure describes account configuration to be specified when * adding a new account with #pjsua_acc_add(). Application MUST initialize @@ -1788,6 +1896,15 @@ typedef struct pjsua_acc_config */ pj_str_t reg_uri; + /** + * Subscribe to message waiting indication events (RFC 3842). + * + * See also \a enable_unsolicited_mwi field on #pjsua_config. + * + * Default: no + */ + pj_bool_t mwi_enabled; + /** * If this flag is set, the presence information of this account will * be PUBLISH-ed to the server where the account belongs. @@ -1796,6 +1913,24 @@ typedef struct pjsua_acc_config */ pj_bool_t publish_enabled; + /** + * Event publication options. + */ + pjsip_publishc_opt publish_opt; + + /** + * Maximum time to wait for unpublication transaction(s) to complete + * during shutdown process, before sending unregistration. The library + * tries to wait for the unpublication (un-PUBLISH) to complete before + * sending REGISTER request to unregister the account, during library + * shutdown process. If the value is set too short, it is possible that + * the unregistration is sent before unpublication completes, causing + * unpublication request to fail. + * + * Default: PJSUA_UNPUBLISH_MAX_WAIT_TIME_MSEC + */ + unsigned unpublish_max_wait_time_msec; + /** * Authentication preference. */ @@ -1885,6 +2020,14 @@ typedef struct pjsua_acc_config */ unsigned reg_timeout; + /** + * Specify the maximum time to wait for unregistration requests to + * complete during library shutdown sequence. + * + * Default: PJSUA_UNREG_TIMEOUT + */ + unsigned unreg_timeout; + /** * Number of credentials in the credential array. */ @@ -2958,9 +3101,12 @@ PJ_DECL(pj_status_t) pjsua_call_dump(pjsua_call_id call_id, /** - * This specifies how long the library should retry resending SUBSCRIBE - * if the previous SUBSCRIBE failed. This also controls the duration - * before failed PUBLISH request will be retried. + * This specifies how long the library should wait before retrying failed + * SUBSCRIBE request, and there is no rule to automatically resubscribe + * (for example, no "retry-after" parameter in Subscription-State header). + * + * This also controls the duration before failed PUBLISH request will be + * retried. * * Default: 300 seconds */ @@ -3075,7 +3221,16 @@ typedef struct pjsua_buddy_info const char *sub_state_name; /** - * Specifies the last presence subscription terminatino reason. If + * Specifies the last presence subscription termination code. This would + * return the last status of the SUBSCRIBE request. If the subscription + * is terminated with NOTIFY by the server, this value will be set to + * 200, and subscription termination reason will be given in the + * \a sub_term_reason field. + */ + unsigned sub_term_code; + + /** + * Specifies the last presence subscription termination reason. If * presence subscription is currently active, the value will be empty. */ pj_str_t sub_term_reason; diff --git a/sflphone-common/libs/pjproject/pjsip/include/pjsua-lib/pjsua_internal.h b/sflphone-common/libs/pjproject/pjsip/include/pjsua-lib/pjsua_internal.h index e5c82e3e3faa496b6b6202dde1638cc8f4370d1e..86e8815cba4d5dc5ab2951377f51c5e7694bcfd8 100644 --- a/sflphone-common/libs/pjproject/pjsip/include/pjsua-lib/pjsua_internal.h +++ b/sflphone-common/libs/pjproject/pjsip/include/pjsua-lib/pjsua_internal.h @@ -1,4 +1,4 @@ -/* $Id: pjsua_internal.h 2874 2009-08-13 15:55:47Z bennylp $ */ +/* $Id: pjsua_internal.h 2968 2009-10-26 11:21:37Z bennylp $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> @@ -82,6 +82,9 @@ typedef struct pjsua_call pjmedia_transport *med_orig; /**< Original media transport */ pj_bool_t med_tp_auto_del; /**< May delete media transport */ pjsua_med_tp_st med_tp_st; /**< Media transport state */ + pj_sockaddr med_rtp_addr; /**< Current RTP source address + (used to update ICE default + address) */ pj_stun_nat_type rem_nat_type; /**< NAT type of remote endpoint. */ pjmedia_srtp_use rem_srtp_use; /**< Remote's SRTP usage policy. */ @@ -141,6 +144,8 @@ typedef struct pjsua_acc pjsip_publishc *publish_sess; /**< Client publication session. */ pj_bool_t publish_state; /**< Last published online status */ + pjsip_evsub *mwi_sub; /**< MWI client subscription */ + pjsip_dialog *mwi_dlg; /**< Dialog for MWI sub. */ } pjsua_acc; @@ -182,9 +187,10 @@ typedef struct pjsua_buddy pj_bool_t monitor; /**< Should we monitor? */ pjsip_dialog *dlg; /**< The underlying dialog. */ pjsip_evsub *sub; /**< Buddy presence subscription */ + unsigned term_code; /**< Subscription termination code */ pj_str_t term_reason;/**< Subscription termination reason */ pjsip_pres_status status; /**< Buddy presence status. */ - + pj_timer_entry timer; /**< Resubscription timer */ } pjsua_buddy; @@ -447,6 +453,11 @@ void pjsua_pres_delete_acc(int acc_id); */ pj_status_t pjsua_im_init(void); +/** + * Start MWI subscription + */ +void pjsua_start_mwi(pjsua_acc *acc); + /** * Init call subsystem. */ diff --git a/sflphone-common/libs/pjproject/pjsip/src/pjsip-simple/mwi.c b/sflphone-common/libs/pjproject/pjsip/src/pjsip-simple/mwi.c new file mode 100644 index 0000000000000000000000000000000000000000..c8ae4645fcf96d228aee1d67d075428b4d41f5d5 --- /dev/null +++ b/sflphone-common/libs/pjproject/pjsip/src/pjsip-simple/mwi.c @@ -0,0 +1,599 @@ +/* $Id: mwi.c 2968 2009-10-26 11:21:37Z bennylp $ */ +/* + * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) + * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ +#include <pjsip-simple/mwi.h> +#include <pjsip-simple/errno.h> +#include <pjsip-simple/evsub_msg.h> +#include <pjsip/sip_module.h> +#include <pjsip/sip_endpoint.h> +#include <pjsip/sip_dialog.h> +#include <pj/assert.h> +#include <pj/guid.h> +#include <pj/log.h> +#include <pj/os.h> +#include <pj/pool.h> +#include <pj/string.h> + + +#define THIS_FILE "mwi.c" +#define MWI_DEFAULT_EXPIRES 3600 + + /* + * MWI module (mod-mdi) + */ +static struct pjsip_module mod_mwi = +{ + NULL, NULL, /* prev, next. */ + { "mod-mwi", 7 }, /* Name. */ + -1, /* Id */ + PJSIP_MOD_PRIORITY_DIALOG_USAGE,/* Priority */ + NULL, /* load() */ + NULL, /* start() */ + NULL, /* stop() */ + NULL, /* unload() */ + NULL, /* on_rx_request() */ + NULL, /* on_rx_response() */ + NULL, /* on_tx_request. */ + NULL, /* on_tx_response() */ + NULL, /* on_tsx_state() */ +}; + + +/* + * This structure describe an mwi agent (both client and server) + */ +typedef struct pjsip_mwi +{ + pjsip_evsub *sub; /**< Event subscribtion record. */ + pjsip_dialog *dlg; /**< The dialog. */ + pjsip_evsub_user user_cb; /**< The user callback. */ + + /* These are for server subscriptions */ + pj_pool_t *body_pool; /**< Pool to save message body */ + pjsip_media_type mime_type; /**< MIME type of last msg body */ + pj_str_t body; /**< Last sent message body */ +} pjsip_mwi; + + +/* + * Forward decl for evsub callbacks. + */ +static void mwi_on_evsub_state( pjsip_evsub *sub, pjsip_event *event); +static void mwi_on_evsub_tsx_state( pjsip_evsub *sub, pjsip_transaction *tsx, + pjsip_event *event); +static void mwi_on_evsub_rx_refresh( pjsip_evsub *sub, + pjsip_rx_data *rdata, + int *p_st_code, + pj_str_t **p_st_text, + pjsip_hdr *res_hdr, + pjsip_msg_body **p_body); +static void mwi_on_evsub_rx_notify( pjsip_evsub *sub, + pjsip_rx_data *rdata, + int *p_st_code, + pj_str_t **p_st_text, + pjsip_hdr *res_hdr, + pjsip_msg_body **p_body); +static void mwi_on_evsub_client_refresh(pjsip_evsub *sub); +static void mwi_on_evsub_server_timeout(pjsip_evsub *sub); + + +/* + * Event subscription callback for mwi. + */ +static pjsip_evsub_user mwi_user = +{ + &mwi_on_evsub_state, + &mwi_on_evsub_tsx_state, + &mwi_on_evsub_rx_refresh, + &mwi_on_evsub_rx_notify, + &mwi_on_evsub_client_refresh, + &mwi_on_evsub_server_timeout, +}; + + +/* + * Some static constants. + */ +static const pj_str_t STR_EVENT = { "Event", 5 }; +static const pj_str_t STR_MWI = { "message-summary", 15 }; +static const pj_str_t STR_APP_SIMPLE_SMS = { "application/simple-message-summary", 34}; + +/* + * Init mwi module. + */ +PJ_DEF(pj_status_t) pjsip_mwi_init_module( pjsip_endpoint *endpt, + pjsip_module *mod_evsub) +{ + pj_status_t status; + pj_str_t accept[1]; + + /* Check arguments. */ + PJ_ASSERT_RETURN(endpt && mod_evsub, PJ_EINVAL); + + /* Must have not been registered */ + PJ_ASSERT_RETURN(mod_mwi.id == -1, PJ_EINVALIDOP); + + /* Register to endpoint */ + status = pjsip_endpt_register_module(endpt, &mod_mwi); + if (status != PJ_SUCCESS) + return status; + + accept[0] = STR_APP_SIMPLE_SMS; + + /* Register event package to event module. */ + status = pjsip_evsub_register_pkg( &mod_mwi, &STR_MWI, + MWI_DEFAULT_EXPIRES, + PJ_ARRAY_SIZE(accept), accept); + if (status != PJ_SUCCESS) { + pjsip_endpt_unregister_module(endpt, &mod_mwi); + return status; + } + + return PJ_SUCCESS; +} + + +/* + * Get mwi module instance. + */ +PJ_DEF(pjsip_module*) pjsip_mwi_instance(void) +{ + return &mod_mwi; +} + + +/* + * Create client subscription. + */ +PJ_DEF(pj_status_t) pjsip_mwi_create_uac( pjsip_dialog *dlg, + const pjsip_evsub_user *user_cb, + unsigned options, + pjsip_evsub **p_evsub ) +{ + pj_status_t status; + pjsip_mwi *mwi; + pjsip_evsub *sub; + + PJ_ASSERT_RETURN(dlg && p_evsub, PJ_EINVAL); + + PJ_UNUSED_ARG(options); + + pjsip_dlg_inc_lock(dlg); + + /* Create event subscription */ + status = pjsip_evsub_create_uac( dlg, &mwi_user, &STR_MWI, + options, &sub); + if (status != PJ_SUCCESS) + goto on_return; + + /* Create mwi */ + mwi = PJ_POOL_ZALLOC_T(dlg->pool, pjsip_mwi); + mwi->dlg = dlg; + mwi->sub = sub; + if (user_cb) + pj_memcpy(&mwi->user_cb, user_cb, sizeof(pjsip_evsub_user)); + + /* Attach to evsub */ + pjsip_evsub_set_mod_data(sub, mod_mwi.id, mwi); + + *p_evsub = sub; + +on_return: + pjsip_dlg_dec_lock(dlg); + return status; +} + + +/* + * Create server subscription. + */ +PJ_DEF(pj_status_t) pjsip_mwi_create_uas( pjsip_dialog *dlg, + const pjsip_evsub_user *user_cb, + pjsip_rx_data *rdata, + pjsip_evsub **p_evsub ) +{ + pjsip_accept_hdr *accept; + pjsip_event_hdr *event; + pjsip_evsub *sub; + pjsip_mwi *mwi; + char obj_name[PJ_MAX_OBJ_NAME]; + pj_status_t status; + + /* Check arguments */ + PJ_ASSERT_RETURN(dlg && rdata && p_evsub, PJ_EINVAL); + + /* Must be request message */ + PJ_ASSERT_RETURN(rdata->msg_info.msg->type == PJSIP_REQUEST_MSG, + PJSIP_ENOTREQUESTMSG); + + /* Check that request is SUBSCRIBE */ + PJ_ASSERT_RETURN(pjsip_method_cmp(&rdata->msg_info.msg->line.req.method, + &pjsip_subscribe_method)==0, + PJSIP_SIMPLE_ENOTSUBSCRIBE); + + /* Check that Event header contains "mwi" */ + event = (pjsip_event_hdr*) + pjsip_msg_find_hdr_by_name(rdata->msg_info.msg, &STR_EVENT, NULL); + if (!event) { + return PJSIP_ERRNO_FROM_SIP_STATUS(PJSIP_SC_BAD_REQUEST); + } + if (pj_stricmp(&event->event_type, &STR_MWI) != 0) { + return PJSIP_ERRNO_FROM_SIP_STATUS(PJSIP_SC_BAD_EVENT); + } + + /* Check that request contains compatible Accept header. */ + accept = (pjsip_accept_hdr*) + pjsip_msg_find_hdr(rdata->msg_info.msg, PJSIP_H_ACCEPT, NULL); + if (accept) { + unsigned i; + for (i=0; i<accept->count; ++i) { + if (pj_stricmp(&accept->values[i], &STR_APP_SIMPLE_SMS)==0) { + break; + } + } + + if (i==accept->count) { + /* Nothing is acceptable */ + return PJSIP_ERRNO_FROM_SIP_STATUS(PJSIP_SC_NOT_ACCEPTABLE); + } + + } else { + /* No Accept header. + * Assume client supports "application/simple-message-summary" + */ + } + + /* Lock dialog */ + pjsip_dlg_inc_lock(dlg); + + + /* Create server subscription */ + status = pjsip_evsub_create_uas( dlg, &mwi_user, rdata, 0, &sub); + if (status != PJ_SUCCESS) + goto on_return; + + /* Create server mwi subscription */ + mwi = PJ_POOL_ZALLOC_T(dlg->pool, pjsip_mwi); + mwi->dlg = dlg; + mwi->sub = sub; + if (user_cb) + pj_memcpy(&mwi->user_cb, user_cb, sizeof(pjsip_evsub_user)); + + pj_ansi_snprintf(obj_name, PJ_MAX_OBJ_NAME, "mwibd%p", dlg->pool); + mwi->body_pool = pj_pool_create(dlg->pool->factory, obj_name, + 512, 512, NULL); + + /* Attach to evsub */ + pjsip_evsub_set_mod_data(sub, mod_mwi.id, mwi); + + /* Done: */ + *p_evsub = sub; + +on_return: + pjsip_dlg_dec_lock(dlg); + return status; +} + + +/* + * Forcefully terminate mwi. + */ +PJ_DEF(pj_status_t) pjsip_mwi_terminate( pjsip_evsub *sub, + pj_bool_t notify ) +{ + return pjsip_evsub_terminate(sub, notify); +} + +/* + * Create SUBSCRIBE + */ +PJ_DEF(pj_status_t) pjsip_mwi_initiate( pjsip_evsub *sub, + pj_int32_t expires, + pjsip_tx_data **p_tdata) +{ + return pjsip_evsub_initiate(sub, &pjsip_subscribe_method, expires, + p_tdata); +} + + +/* + * Accept incoming subscription. + */ +PJ_DEF(pj_status_t) pjsip_mwi_accept( pjsip_evsub *sub, + pjsip_rx_data *rdata, + int st_code, + const pjsip_hdr *hdr_list ) +{ + return pjsip_evsub_accept( sub, rdata, st_code, hdr_list ); +} + +/* + * Create message body and attach it to the (NOTIFY) request. + */ +static pj_status_t mwi_create_msg_body( pjsip_mwi *mwi, + pjsip_tx_data *tdata) +{ + pjsip_msg_body *body; + pj_str_t dup_text; + + PJ_ASSERT_RETURN(mwi->mime_type.type.slen && mwi->body.slen, PJ_EINVALIDOP); + + /* Clone the message body and mime type */ + pj_strdup(tdata->pool, &dup_text, &mwi->body); + + /* Create the message body */ + body = PJ_POOL_ZALLOC_T(tdata->pool, pjsip_msg_body); + pjsip_media_type_cp(tdata->pool, &body->content_type, &mwi->mime_type); + body->data = dup_text.ptr; + body->len = (unsigned)dup_text.slen; + body->print_body = &pjsip_print_text_body; + body->clone_data = &pjsip_clone_text_data; + + /* Attach to tdata */ + tdata->msg->body = body; + + return PJ_SUCCESS; +} + + +/* + * Create NOTIFY + */ +PJ_DEF(pj_status_t) pjsip_mwi_notify( pjsip_evsub *sub, + pjsip_evsub_state state, + const pj_str_t *state_str, + const pj_str_t *reason, + const pjsip_media_type *mime_type, + const pj_str_t *body, + pjsip_tx_data **p_tdata) +{ + pjsip_mwi *mwi; + pjsip_tx_data *tdata; + pj_status_t status; + + /* Check arguments. */ + PJ_ASSERT_RETURN(sub && mime_type && body && p_tdata, PJ_EINVAL); + + /* Get the mwi object. */ + mwi = (pjsip_mwi*) pjsip_evsub_get_mod_data(sub, mod_mwi.id); + PJ_ASSERT_RETURN(mwi != NULL, PJ_EINVALIDOP); + + /* Lock object. */ + pjsip_dlg_inc_lock(mwi->dlg); + + /* Create the NOTIFY request. */ + status = pjsip_evsub_notify( sub, state, state_str, reason, &tdata); + if (status != PJ_SUCCESS) + goto on_return; + + /* Update the cached message body */ + if (mime_type || body) + pj_pool_reset(mwi->body_pool); + if (mime_type) + pjsip_media_type_cp(mwi->body_pool, &mwi->mime_type, mime_type); + if (body) + pj_strdup(mwi->body_pool, &mwi->body, body); + + /* Create message body */ + status = mwi_create_msg_body( mwi, tdata ); + if (status != PJ_SUCCESS) + goto on_return; + + /* Done. */ + *p_tdata = tdata; + +on_return: + pjsip_dlg_dec_lock(mwi->dlg); + return status; +} + + +/* + * Create NOTIFY that reflect current state. + */ +PJ_DEF(pj_status_t) pjsip_mwi_current_notify( pjsip_evsub *sub, + pjsip_tx_data **p_tdata ) +{ + pjsip_mwi *mwi; + pjsip_tx_data *tdata; + pj_status_t status; + + /* Check arguments. */ + PJ_ASSERT_RETURN(sub && p_tdata, PJ_EINVAL); + + /* Get the mwi object. */ + mwi = (pjsip_mwi*) pjsip_evsub_get_mod_data(sub, mod_mwi.id); + PJ_ASSERT_RETURN(mwi != NULL, PJ_EINVALIDOP); + + /* Lock object. */ + pjsip_dlg_inc_lock(mwi->dlg); + + /* Create the NOTIFY request. */ + status = pjsip_evsub_current_notify( sub, &tdata); + if (status != PJ_SUCCESS) + goto on_return; + + + /* Create message body to reflect the mwi status. */ + status = mwi_create_msg_body( mwi, tdata ); + if (status != PJ_SUCCESS) + goto on_return; + + /* Done. */ + *p_tdata = tdata; + +on_return: + pjsip_dlg_dec_lock(mwi->dlg); + return status; +} + + +/* + * Send request. + */ +PJ_DEF(pj_status_t) pjsip_mwi_send_request( pjsip_evsub *sub, + pjsip_tx_data *tdata ) +{ + return pjsip_evsub_send_request(sub, tdata); +} + +/* + * This callback is called by event subscription when subscription + * state has changed. + */ +static void mwi_on_evsub_state( pjsip_evsub *sub, pjsip_event *event) +{ + pjsip_mwi *mwi; + + mwi = (pjsip_mwi*) pjsip_evsub_get_mod_data(sub, mod_mwi.id); + PJ_ASSERT_ON_FAIL(mwi!=NULL, {return;}); + + if (mwi->user_cb.on_evsub_state) + (*mwi->user_cb.on_evsub_state)(sub, event); + + if (pjsip_evsub_get_state(sub) == PJSIP_EVSUB_STATE_TERMINATED) { + if (mwi->body_pool) { + pj_pool_release(mwi->body_pool); + mwi->body_pool = NULL; + } + } +} + +/* + * Called when transaction state has changed. + */ +static void mwi_on_evsub_tsx_state( pjsip_evsub *sub, pjsip_transaction *tsx, + pjsip_event *event) +{ + pjsip_mwi *mwi; + + mwi = (pjsip_mwi*) pjsip_evsub_get_mod_data(sub, mod_mwi.id); + PJ_ASSERT_ON_FAIL(mwi!=NULL, {return;}); + + if (mwi->user_cb.on_tsx_state) + (*mwi->user_cb.on_tsx_state)(sub, tsx, event); +} + + +/* + * Called when SUBSCRIBE is received. + */ +static void mwi_on_evsub_rx_refresh( pjsip_evsub *sub, + pjsip_rx_data *rdata, + int *p_st_code, + pj_str_t **p_st_text, + pjsip_hdr *res_hdr, + pjsip_msg_body **p_body) +{ + pjsip_mwi *mwi; + + mwi = (pjsip_mwi*) pjsip_evsub_get_mod_data(sub, mod_mwi.id); + PJ_ASSERT_ON_FAIL(mwi!=NULL, {return;}); + + if (mwi->user_cb.on_rx_refresh) { + (*mwi->user_cb.on_rx_refresh)(sub, rdata, p_st_code, p_st_text, + res_hdr, p_body); + + } else { + /* Implementors MUST send NOTIFY if it implements on_rx_refresh */ + pjsip_tx_data *tdata; + pj_str_t timeout = { "timeout", 7}; + pj_status_t status; + + if (pjsip_evsub_get_state(sub)==PJSIP_EVSUB_STATE_TERMINATED) { + status = pjsip_mwi_notify( sub, PJSIP_EVSUB_STATE_TERMINATED, + NULL, &timeout, NULL, NULL, &tdata); + } else { + status = pjsip_mwi_current_notify(sub, &tdata); + } + + if (status == PJ_SUCCESS) + pjsip_mwi_send_request(sub, tdata); + } +} + + +/* + * Called when NOTIFY is received. + */ +static void mwi_on_evsub_rx_notify( pjsip_evsub *sub, + pjsip_rx_data *rdata, + int *p_st_code, + pj_str_t **p_st_text, + pjsip_hdr *res_hdr, + pjsip_msg_body **p_body) +{ + pjsip_mwi *mwi; + + mwi = (pjsip_mwi*) pjsip_evsub_get_mod_data(sub, mod_mwi.id); + PJ_ASSERT_ON_FAIL(mwi!=NULL, {return;}); + + /* Just notify application. */ + if (mwi->user_cb.on_rx_notify) { + (*mwi->user_cb.on_rx_notify)(sub, rdata, p_st_code, p_st_text, + res_hdr, p_body); + } +} + +/* + * Called when it's time to send SUBSCRIBE. + */ +static void mwi_on_evsub_client_refresh(pjsip_evsub *sub) +{ + pjsip_mwi *mwi; + + mwi = (pjsip_mwi*) pjsip_evsub_get_mod_data(sub, mod_mwi.id); + PJ_ASSERT_ON_FAIL(mwi!=NULL, {return;}); + + if (mwi->user_cb.on_client_refresh) { + (*mwi->user_cb.on_client_refresh)(sub); + } else { + pj_status_t status; + pjsip_tx_data *tdata; + + status = pjsip_mwi_initiate(sub, -1, &tdata); + if (status == PJ_SUCCESS) + pjsip_mwi_send_request(sub, tdata); + } +} + +/* + * Called when no refresh is received after the interval. + */ +static void mwi_on_evsub_server_timeout(pjsip_evsub *sub) +{ + pjsip_mwi *mwi; + + mwi = (pjsip_mwi*) pjsip_evsub_get_mod_data(sub, mod_mwi.id); + PJ_ASSERT_ON_FAIL(mwi!=NULL, {return;}); + + if (mwi->user_cb.on_server_timeout) { + (*mwi->user_cb.on_server_timeout)(sub); + } else { + pj_status_t status; + pjsip_tx_data *tdata; + pj_str_t reason = { "timeout", 7 }; + + status = pjsip_mwi_notify(sub, PJSIP_EVSUB_STATE_TERMINATED, + NULL, &reason, NULL, NULL, &tdata); + if (status == PJ_SUCCESS) + pjsip_mwi_send_request(sub, tdata); + } +} + diff --git a/sflphone-common/libs/pjproject/pjsip/src/pjsip-simple/presence_body.c b/sflphone-common/libs/pjproject/pjsip/src/pjsip-simple/presence_body.c index fe245bd4ead525a3ef63d55f8c101230289414e2..a6069594b468d07aca398cc68ec38d4354a8b9d7 100644 --- a/sflphone-common/libs/pjproject/pjsip/src/pjsip-simple/presence_body.c +++ b/sflphone-common/libs/pjproject/pjsip/src/pjsip-simple/presence_body.c @@ -1,4 +1,4 @@ -/* $Id: presence_body.c 2877 2009-08-13 16:17:51Z bennylp $ */ +/* $Id: presence_body.c 3045 2010-01-05 15:23:43Z bennylp $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> @@ -124,7 +124,7 @@ PJ_DEF(pj_status_t) pjsip_pres_create_pidf( pj_pool_t *pool, tslen = pj_ansi_snprintf(buf, sizeof(buf), "%04d-%02d-%02dT%02d:%02d:%02d.%03dZ", - pt.year, pt.mon, pt.day, + pt.year, pt.mon+1, pt.day, pt.hour, pt.min, pt.sec, pt.msec); if (tslen > 0 && tslen < sizeof(buf)) { pj_str_t time = pj_str(buf); diff --git a/sflphone-common/libs/pjproject/pjsip/src/pjsip-simple/publishc.c b/sflphone-common/libs/pjproject/pjsip/src/pjsip-simple/publishc.c index 4dcb0f5027c858d9c62d935dca85a6cd3b0db2cf..d4a7f8271e4e9c3fe60761a439b3c56c768d639a 100644 --- a/sflphone-common/libs/pjproject/pjsip/src/pjsip-simple/publishc.c +++ b/sflphone-common/libs/pjproject/pjsip/src/pjsip-simple/publishc.c @@ -1,4 +1,4 @@ -/* $Id: publishc.c 2754 2009-06-05 16:10:36Z bennylp $ */ +/* $Id: publishc.c 2940 2009-10-12 07:44:14Z bennylp $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> @@ -56,6 +56,15 @@ const pjsip_method pjsip_publish_method = }; +/** + * Pending request list. + */ +typedef struct pending_publish +{ + PJ_DECL_LIST_MEMBER(pjsip_tx_data); +} pending_publish; + + /** * SIP client publication structure. */ @@ -65,7 +74,9 @@ struct pjsip_publishc pjsip_endpoint *endpt; pj_bool_t _delete_flag; int pending_tsx; + pj_mutex_t *mutex; + pjsip_publishc_opt opt; void *token; pjsip_publishc_cb *cb; @@ -91,9 +102,18 @@ struct pjsip_publishc pj_time_val last_refresh; pj_time_val next_refresh; pj_timer_entry timer; + + /* Pending PUBLISH request */ + pending_publish pending_reqs; }; +PJ_DEF(void) pjsip_publishc_opt_default(pjsip_publishc_opt *opt) +{ + pj_bzero(opt, sizeof(*opt)); + opt->queue_request = PJSIP_PUBLISHC_QUEUE_REQUEST; +} + /* * Initialize client publication module. @@ -127,20 +147,18 @@ PJ_DEF(pj_status_t) pjsip_publishc_init_module(pjsip_endpoint *endpt) PJ_DEF(pj_status_t) pjsip_publishc_create( pjsip_endpoint *endpt, - unsigned options, + const pjsip_publishc_opt *opt, void *token, pjsip_publishc_cb *cb, pjsip_publishc **p_pubc) { pj_pool_t *pool; pjsip_publishc *pubc; + pjsip_publishc_opt default_opt; pj_status_t status; /* Verify arguments. */ PJ_ASSERT_RETURN(endpt && cb && p_pubc, PJ_EINVAL); - PJ_ASSERT_RETURN(options == 0, PJ_EINVAL); - - PJ_UNUSED_ARG(options); pool = pjsip_endpt_create_pool(endpt, "pubc%p", 1024, 1024); PJ_ASSERT_RETURN(pool != NULL, PJ_ENOMEM); @@ -153,9 +171,25 @@ PJ_DEF(pj_status_t) pjsip_publishc_create( pjsip_endpoint *endpt, pubc->cb = cb; pubc->expires = PJSIP_PUBC_EXPIRATION_NOT_SPECIFIED; + if (!opt) { + pjsip_publishc_opt_default(&default_opt); + opt = &default_opt; + } + pj_memcpy(&pubc->opt, opt, sizeof(*opt)); + pj_list_init(&pubc->pending_reqs); + + status = pj_mutex_create_recursive(pubc->pool, "pubc%p", &pubc->mutex); + if (status != PJ_SUCCESS) { + pj_pool_release(pool); + return status; + } + status = pjsip_auth_clt_init(&pubc->auth_sess, endpt, pubc->pool, 0); - if (status != PJ_SUCCESS) + if (status != PJ_SUCCESS) { + pj_mutex_destroy(pubc->mutex); + pj_pool_release(pool); return status; + } pj_list_init(&pubc->route_set); pj_list_init(&pubc->usr_hdr); @@ -174,6 +208,14 @@ PJ_DEF(pj_status_t) pjsip_publishc_destroy(pjsip_publishc *pubc) pubc->_delete_flag = 1; pubc->cb = NULL; } else { + /* Cancel existing timer, if any */ + if (pubc->timer.id != 0) { + pjsip_endpt_cancel_timer(pubc->endpt, &pubc->timer); + pubc->timer.id = 0; + } + + if (pubc->mutex) + pj_mutex_destroy(pubc->mutex); pjsip_endpt_release_pool(pubc->endpt, pubc->pool); } @@ -570,6 +612,12 @@ static void tsx_callback(void *token, pjsip_event *event) if (pubc->auto_refresh && expiration!=0 && expiration!=0xFFFF) { pj_time_val delay = { 0, 0}; + /* Cancel existing timer, if any */ + if (pubc->timer.id != 0) { + pjsip_endpt_cancel_timer(pubc->endpt, &pubc->timer); + pubc->timer.id = 0; + } + delay.sec = expiration - DELAY_BEFORE_REFRESH; if (pubc->expires != PJSIP_PUBC_EXPIRATION_NOT_SPECIFIED && delay.sec > (pj_int32_t)pubc->expires) @@ -607,6 +655,22 @@ static void tsx_callback(void *token, pjsip_event *event) rdata, expiration); --pubc->pending_tsx; + + /* If we have pending request(s), send them now */ + pj_mutex_lock(pubc->mutex); + while (!pj_list_empty(&pubc->pending_reqs)) { + pjsip_tx_data *tdata = pubc->pending_reqs.next; + pj_list_erase(tdata); + status = pjsip_publishc_send(pubc, tdata); + if (status == PJ_EPENDING) { + pj_assert(!"Not expected"); + pj_list_erase(tdata); + pjsip_tx_data_dec_ref(tdata); + } else if (status == PJ_SUCCESS) { + break; + } + } + pj_mutex_unlock(pubc->mutex); } /* Delete the record if user destroy pubc during the callback. */ @@ -623,13 +687,26 @@ PJ_DEF(pj_status_t) pjsip_publishc_send(pjsip_publishc *pubc, pjsip_cseq_hdr *cseq_hdr; pj_uint32_t cseq; + PJ_ASSERT_RETURN(pubc && tdata, PJ_EINVAL); + /* Make sure we don't have pending transaction. */ + pj_mutex_lock(pubc->mutex); if (pubc->pending_tsx) { - PJ_LOG(4,(THIS_FILE, "Unable to send request, pubc has another " - "transaction pending")); - pjsip_tx_data_dec_ref( tdata ); - return PJSIP_EBUSY; + if (pubc->opt.queue_request) { + pj_list_push_back(&pubc->pending_reqs, tdata); + pj_mutex_unlock(pubc->mutex); + PJ_LOG(4,(THIS_FILE, "Request is queued, pubc has another " + "transaction pending")); + return PJ_EPENDING; + } else { + pjsip_tx_data_dec_ref(tdata); + pj_mutex_unlock(pubc->mutex); + PJ_LOG(4,(THIS_FILE, "Unable to send request, pubc has another " + "transaction pending")); + return PJ_EBUSY; + } } + pj_mutex_unlock(pubc->mutex); /* Invalidate message buffer. */ pjsip_tx_data_invalidate_msg(tdata); diff --git a/sflphone-common/libs/pjproject/pjsip/src/pjsip-simple/rpid.c b/sflphone-common/libs/pjproject/pjsip/src/pjsip-simple/rpid.c index 615d3915a3b3b3cd35211224208c24d00c03df1e..0ec9d260b5f542ea301274327c2c2076ceeae3b6 100644 --- a/sflphone-common/libs/pjproject/pjsip/src/pjsip-simple/rpid.c +++ b/sflphone-common/libs/pjproject/pjsip/src/pjsip-simple/rpid.c @@ -1,4 +1,4 @@ -/* $Id: rpid.c 2394 2008-12-23 17:27:53Z bennylp $ */ +/* $Id: rpid.c 2935 2009-10-09 13:17:56Z bennylp $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> @@ -21,6 +21,7 @@ #include <pjsip-simple/errno.h> #include <pj/assert.h> #include <pj/guid.h> +#include <pj/pool.h> #include <pj/string.h> @@ -146,7 +147,16 @@ PJ_DEF(pj_status_t) pjrpid_add_element(pjpidf_pres *pres, attr = pj_xml_attr_new(pool, &ID, &elem->id); } else { pj_str_t person_id; - pj_create_unique_string(pool, &person_id); + /* xs:ID must start with letter */ + //pj_create_unique_string(pool, &person_id); + person_id.ptr = (char*)pj_pool_alloc(pool, PJ_GUID_STRING_LENGTH+2); + person_id.ptr += 2; + pj_generate_unique_string(&person_id); + person_id.ptr -= 2; + person_id.ptr[0] = 'p'; + person_id.ptr[1] = 'j'; + person_id.slen += 2; + attr = pj_xml_attr_new(pool, &ID, &person_id); } pj_xml_add_attr(nd_person, attr); diff --git a/sflphone-common/libs/pjproject/pjsip/src/pjsip-ua/sip_inv.c b/sflphone-common/libs/pjproject/pjsip/src/pjsip-ua/sip_inv.c index 3adfe72daeb0d8007caaa2d73f192cb8115cb2a8..9aba3bbcd1e918a4069752842e0493ae02c42ac4 100644 --- a/sflphone-common/libs/pjproject/pjsip/src/pjsip-ua/sip_inv.c +++ b/sflphone-common/libs/pjproject/pjsip/src/pjsip-ua/sip_inv.c @@ -1,4 +1,4 @@ -/* $Id: sip_inv.c 2879 2009-08-14 13:23:22Z nanang $ */ +/* $Id: sip_inv.c 2951 2009-10-16 06:28:56Z nanang $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> @@ -108,6 +108,10 @@ static pj_status_t process_answer( pjsip_inv_session *inv, pjsip_tx_data *tdata, const pjmedia_sdp_session *local_sdp); +static pj_status_t handle_timer_response(pjsip_inv_session *inv, + const pjsip_rx_data *rdata, + pj_bool_t end_sess_on_failure); + static void (*inv_state_handler[])( pjsip_inv_session *inv, pjsip_event *e) = { &inv_on_state_null, @@ -477,6 +481,29 @@ static pj_bool_t mod_inv_on_rx_request(pjsip_rx_data *rdata) return PJ_FALSE; } +/* This function will process Session Timer headers in received + * 2xx or 422 response of INVITE/UPDATE request. + */ +static pj_status_t handle_timer_response(pjsip_inv_session *inv, + const pjsip_rx_data *rdata, + pj_bool_t end_sess_on_failure) +{ + pjsip_status_code st_code; + pj_status_t status; + + status = pjsip_timer_process_resp(inv, rdata, &st_code); + if (status != PJ_SUCCESS && end_sess_on_failure) { + pjsip_tx_data *tdata; + pj_status_t status2; + + status2 = pjsip_inv_end_session(inv, st_code, NULL, &tdata); + if (tdata && status2 == PJ_SUCCESS) + pjsip_inv_send_msg(inv, tdata); + } + + return status; +} + /* * Module on_rx_response(). * @@ -490,8 +517,6 @@ static pj_bool_t mod_inv_on_rx_response(pjsip_rx_data *rdata) pjsip_dialog *dlg; pjsip_inv_session *inv; pjsip_msg *msg = rdata->msg_info.msg; - pj_status_t status; - pjsip_status_code st_code; dlg = pjsip_rdata_get_dlg(rdata); @@ -519,22 +544,6 @@ static pj_bool_t mod_inv_on_rx_response(pjsip_rx_data *rdata) } - /* Pass response to timer session module */ - status = pjsip_timer_process_resp(inv, rdata, &st_code); - if (status != PJ_SUCCESS) { - pjsip_event e; - pjsip_tx_data *tdata; - - PJSIP_EVENT_INIT_RX_MSG(e, rdata); - inv_send_ack(inv, &e); - - status = pjsip_inv_end_session(inv, st_code, NULL, &tdata); - if (tdata && status == PJ_SUCCESS) - pjsip_inv_send_msg(inv, tdata); - - return PJ_TRUE; - } - /* No other processing needs to be done here. */ return PJ_FALSE; } @@ -2774,8 +2783,8 @@ static void inv_handle_update_response( pjsip_inv_session *inv, /* Handle 401/407 challenge. */ if (tsx->state == PJSIP_TSX_STATE_COMPLETED && - (tsx->status_code == 401 || tsx->status_code == 407)) { - + (tsx->status_code == 401 || tsx->status_code == 407)) + { pjsip_tx_data *tdata; status = pjsip_auth_clt_reinit_req( &inv->dlg->auth_sess, @@ -2798,17 +2807,30 @@ static void inv_handle_update_response( pjsip_inv_session *inv, /* Re-send request. */ status = pjsip_inv_send_msg(inv, tdata); } + } + + /* Process 422 response */ + else if (tsx->state == PJSIP_TSX_STATE_COMPLETED && + tsx->status_code == 422) + { + status = handle_timer_response(inv, e->body.tsx_state.src.rdata, + PJ_FALSE); + } /* Process 2xx response */ - } else if (tsx->state == PJSIP_TSX_STATE_COMPLETED && + else if (tsx->state == PJSIP_TSX_STATE_COMPLETED && tsx->status_code/100 == 2 && e->body.tsx_state.src.rdata->msg_info.msg->body) { + status = handle_timer_response(inv, e->body.tsx_state.src.rdata, + PJ_FALSE); status = inv_check_sdp_in_incoming_msg(inv, tsx, - e->body.tsx_state.src.rdata); - - } else { - /* Get/attach invite session's transaction data */ + e->body.tsx_state.src.rdata); + } + + /* Get/attach invite session's transaction data */ + else + { tsx_inv_data = (struct tsx_inv_data*)tsx->mod_data[mod_inv.mod.id]; if (tsx_inv_data == NULL) { tsx_inv_data=PJ_POOL_ZALLOC_T(tsx->pool, struct tsx_inv_data); @@ -2974,6 +2996,7 @@ static void inv_on_state_null( pjsip_inv_session *inv, pjsip_event *e) * Generic UAC transaction handler: * - resend request on 401 or 407 response. * - terminate dialog on 408 and 481 response. + * - resend request on 422 response. */ static pj_bool_t handle_uac_tsx_response(pjsip_inv_session *inv, pjsip_event *e) @@ -3054,6 +3077,16 @@ static pj_bool_t handle_uac_tsx_response(pjsip_inv_session *inv, } return PJ_TRUE; /* Handled */ + } + + /* Handle session timer 422 response. */ + else if (tsx->state == PJSIP_TSX_STATE_COMPLETED && + tsx->status_code == PJSIP_SC_SESSION_TIMER_TOO_SMALL) + { + handle_timer_response(inv, e->body.tsx_state.src.rdata, + PJ_FALSE); + + return PJ_TRUE; /* Handled */ } else { return PJ_FALSE; /* Unhandled */ @@ -3141,6 +3174,15 @@ static void handle_uac_call_rejection(pjsip_inv_session *inv, pjsip_event *e) status = pjsip_inv_send_msg(inv, tdata); } + } else if (tsx->state == PJSIP_TSX_STATE_COMPLETED && + tsx->status_code == PJSIP_SC_SESSION_TIMER_TOO_SMALL) + { + /* Handle session timer 422 response: + * Resend the request with requested session timer setting. + */ + status = handle_timer_response(inv, e->body.tsx_state.src.rdata, + PJ_TRUE); + } else if (PJSIP_IS_STATUS_IN_CLASS(tsx->status_code, 600)) { /* Global error */ goto terminate_session; @@ -3212,11 +3254,19 @@ static void inv_on_state_calling( pjsip_inv_session *inv, pjsip_event *e) case PJSIP_TSX_STATE_COMPLETED: if (tsx->status_code/100 == 2) { - + /* This should not happen. * When transaction receives 2xx, it should be terminated */ pj_assert(0); + + /* Process session timer response. */ + status = handle_timer_response(inv, + e->body.tsx_state.src.rdata, + PJ_TRUE); + if (status != PJ_SUCCESS) + break; + inv_set_state(inv, PJSIP_INV_STATE_CONNECTING, e); inv_check_sdp_in_incoming_msg(inv, tsx, @@ -3235,6 +3285,13 @@ static void inv_on_state_calling( pjsip_inv_session *inv, pjsip_event *e) if (tsx->status_code/100 == 2) { /* This must be receipt of 2xx response */ + /* Process session timer response. */ + status = handle_timer_response(inv, + e->body.tsx_state.src.rdata, + PJ_TRUE); + if (status != PJ_SUCCESS) + break; + /* Set state to CONNECTING */ inv_set_state(inv, PJSIP_INV_STATE_CONNECTING, e); @@ -3386,6 +3443,15 @@ static void inv_on_state_early( pjsip_inv_session *inv, pjsip_event *e) if (tsx->status_code/100 == 2) { inv_set_state(inv, PJSIP_INV_STATE_CONNECTING, e); if (e->body.tsx_state.type == PJSIP_EVENT_RX_MSG) { + pj_status_t status; + + /* Process session timer response. */ + status = handle_timer_response(inv, + e->body.tsx_state.src.rdata, + PJ_TRUE); + if (status != PJ_SUCCESS) + break; + inv_check_sdp_in_incoming_msg(inv, tsx, e->body.tsx_state.src.rdata); } @@ -3417,6 +3483,15 @@ static void inv_on_state_early( pjsip_inv_session *inv, pjsip_event *e) inv_set_state(inv, PJSIP_INV_STATE_CONNECTING, e); if (e->body.tsx_state.type == PJSIP_EVENT_RX_MSG) { + pj_status_t status; + + /* Process session timer response. */ + status = handle_timer_response(inv, + e->body.tsx_state.src.rdata, + PJ_TRUE); + if (status != PJ_SUCCESS) + break; + inv_check_sdp_in_incoming_msg(inv, tsx, e->body.tsx_state.src.rdata); } @@ -3885,9 +3960,17 @@ static void inv_on_state_confirmed( pjsip_inv_session *inv, pjsip_event *e) } else if (tsx->state == PJSIP_TSX_STATE_TERMINATED && tsx->status_code/100 == 2) { + pj_status_t status; /* Re-INVITE was accepted. */ + /* Process session timer response. */ + status = handle_timer_response(inv, + e->body.tsx_state.src.rdata, + PJ_TRUE); + if (status != PJ_SUCCESS) + return; + /* Process SDP */ inv_check_sdp_in_incoming_msg(inv, tsx, e->body.tsx_state.src.rdata); @@ -3945,7 +4028,7 @@ static void inv_on_state_confirmed( pjsip_inv_session *inv, pjsip_event *e) } else if (tsx->role == PJSIP_ROLE_UAC) { /* - * Handle 401/407/408/481 response + * Handle 401/407/408/481/422 response */ handle_uac_tsx_response(inv, e); } @@ -3992,7 +4075,7 @@ static void inv_on_state_disconnected( pjsip_inv_session *inv, pjsip_event *e) } else if (tsx->role == PJSIP_ROLE_UAC) { /* - * Handle 401/407/408/481 response + * Handle 401/407/408/481/422 response */ handle_uac_tsx_response(inv, e); } diff --git a/sflphone-common/libs/pjproject/pjsip/src/pjsip-ua/sip_timer.c b/sflphone-common/libs/pjproject/pjsip/src/pjsip-ua/sip_timer.c index a677c24ad9eb01c741a091c7173ce31c355215dc..715585a39faafe780cb0ff5432558b183c5a0dc6 100644 --- a/sflphone-common/libs/pjproject/pjsip/src/pjsip-ua/sip_timer.c +++ b/sflphone-common/libs/pjproject/pjsip/src/pjsip-ua/sip_timer.c @@ -1,4 +1,4 @@ -/* $Id: sip_timer.c 2893 2009-08-17 15:56:18Z nanang $ */ +/* $Id: sip_timer.c 2934 2009-10-09 12:31:59Z nanang $ */ /* * Copyright (C) 2009 Teluu Inc. (http://www.teluu.com) * @@ -791,11 +791,26 @@ PJ_DEF(pj_status_t) pjsip_timer_process_resp(pjsip_inv_session *inv, if (se_hdr && se_hdr->sess_expires < inv->timer->setting.min_se) { - if (st_code) - *st_code = PJSIP_SC_SESSION_TIMER_TOO_SMALL; - pjsip_timer_end_session(inv); - return PJSIP_ERRNO_FROM_SIP_STATUS( - PJSIP_SC_SESSION_TIMER_TOO_SMALL); + /* See ticket #954, instead of returning non-PJ_SUCCESS (which + * may cause disconnecting call/dialog), let's just accept the + * SE and update our local SE, as long as it isn't less than 90s. + */ + if (se_hdr->sess_expires >= ABS_MIN_SE) { + PJ_LOG(3, (inv->pool->obj_name, + "Peer responds with bad Session-Expires, %ds, " + "which is less than Min-SE specified in request, " + "%ds. Well, let's just accept and use it.", + se_hdr->sess_expires, inv->timer->setting.min_se)); + + inv->timer->setting.sess_expires = se_hdr->sess_expires; + inv->timer->setting.min_se = se_hdr->sess_expires; + } + + //if (st_code) + // *st_code = PJSIP_SC_SESSION_TIMER_TOO_SMALL; + //pjsip_timer_end_session(inv); + //return PJSIP_ERRNO_FROM_SIP_STATUS( + // PJSIP_SC_SESSION_TIMER_TOO_SMALL); } /* Update SE. Session-Expires in response cannot be lower than Min-SE. diff --git a/sflphone-common/libs/pjproject/pjsip/src/pjsip/sip_auth_client.c b/sflphone-common/libs/pjproject/pjsip/src/pjsip/sip_auth_client.c index ea0b8e471ef90d3a5299a6b9aadb0213e0770330..fc734f7a153efbdeaf6b87754937a737cdc44498 100644 --- a/sflphone-common/libs/pjproject/pjsip/src/pjsip/sip_auth_client.c +++ b/sflphone-common/libs/pjproject/pjsip/src/pjsip/sip_auth_client.c @@ -1,4 +1,4 @@ -/* $Id: sip_auth_client.c 2394 2008-12-23 17:27:53Z bennylp $ */ +/* $Id: sip_auth_client.c 2988 2009-11-06 04:16:36Z bennylp $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> @@ -322,8 +322,33 @@ static void update_digest_session( pj_pool_t *ses_pool, pjsip_cached_auth *cached_auth, const pjsip_www_authenticate_hdr *hdr ) { - if (hdr->challenge.digest.qop.slen == 0) + if (hdr->challenge.digest.qop.slen == 0) { +#if PJSIP_AUTH_AUTO_SEND_NEXT!=0 + if (!cached_auth->last_chal || pj_stricmp2(&hdr->scheme, "digest")) { + cached_auth->last_chal = (pjsip_www_authenticate_hdr*) + pjsip_hdr_clone(ses_pool, hdr); + } else { + /* Only update if the new challenge is "significantly different" + * than the one in the cache, to reduce memory usage. + */ + const pjsip_digest_challenge *d1 = + &cached_auth->last_chal->challenge.digest; + const pjsip_digest_challenge *d2 = &hdr->challenge.digest; + + if (pj_strcmp(&d1->domain, &d2->domain) || + pj_strcmp(&d1->realm, &d2->realm) || + pj_strcmp(&d1->nonce, &d2->nonce) || + pj_strcmp(&d1->opaque, &d2->opaque) || + pj_strcmp(&d1->algorithm, &d2->algorithm) || + pj_strcmp(&d1->qop, &d2->qop)) + { + cached_auth->last_chal = (pjsip_www_authenticate_hdr*) + pjsip_hdr_clone(ses_pool, hdr); + } + } +#endif return; + } /* Initialize cnonce and qop if not present. */ if (cached_auth->cnonce.slen == 0) { diff --git a/sflphone-common/libs/pjproject/pjsip/src/pjsip/sip_auth_parser_wrap.cpp b/sflphone-common/libs/pjproject/pjsip/src/pjsip/sip_auth_parser_wrap.cpp index c308a758b482c6e3032087ae2971a704fe227fa9..0f58a977e0261ad97c7dd6a369e9d6bf0f20803a 100644 --- a/sflphone-common/libs/pjproject/pjsip/src/pjsip/sip_auth_parser_wrap.cpp +++ b/sflphone-common/libs/pjproject/pjsip/src/pjsip/sip_auth_parser_wrap.cpp @@ -1,5 +1,5 @@ /* $Id: sip_auth_parser_wrap.cpp 2873 2009-08-13 11:54:35Z nanang $ */ -/* +/* * Copyright (C) 2009 Teluu Inc. (http://www.teluu.com) * * This program is free software; you can redistribute it and/or modify @@ -14,7 +14,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* diff --git a/sflphone-common/libs/pjproject/pjsip/src/pjsip/sip_dialog.c b/sflphone-common/libs/pjproject/pjsip/src/pjsip/sip_dialog.c index 4584d75d5fff5bcb7680a60fa88216ea0e9565ee..1d2de50fdb51275c78e98b67e91f1dfb998ba4da 100644 --- a/sflphone-common/libs/pjproject/pjsip/src/pjsip/sip_dialog.c +++ b/sflphone-common/libs/pjproject/pjsip/src/pjsip/sip_dialog.c @@ -1,4 +1,4 @@ -/* $Id: sip_dialog.c 2860 2009-08-11 18:10:15Z nanang $ */ +/* $Id: sip_dialog.c 3031 2009-12-10 05:16:23Z bennylp $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> @@ -854,6 +854,8 @@ PJ_DEF(pj_status_t) pjsip_dlg_try_inc_lock(pjsip_dialog *dlg) */ PJ_DEF(void) pjsip_dlg_dec_lock(pjsip_dialog *dlg) { + PJ_ASSERT_ON_FAIL(dlg!=NULL, return); + PJ_LOG(6,(dlg->obj_name, "Entering pjsip_dlg_dec_lock(), sess_count=%d", dlg->sess_count)); @@ -1532,7 +1534,18 @@ void pjsip_dlg_on_rx_request( pjsip_dialog *dlg, pjsip_rx_data *rdata ) rdata->msg_info.msg->line.req.method.id != PJSIP_ACK_METHOD) { status = pjsip_tsx_create_uas(dlg->ua, rdata, &tsx); - PJ_ASSERT_ON_FAIL(status==PJ_SUCCESS,{goto on_return;}); + if (status != PJ_SUCCESS) { + /* Once case for this is when re-INVITE contains same + * Via branch value as previous INVITE (ticket #965). + */ + char errmsg[PJ_ERR_MSG_SIZE]; + pj_str_t reason; + + reason = pj_strerror(status, errmsg, sizeof(errmsg)); + pjsip_endpt_respond_stateless(dlg->endpt, rdata, 500, &reason, + NULL, NULL); + goto on_return; + } /* Put this dialog in the transaction data. */ tsx->mod_data[dlg->ua->id] = dlg; diff --git a/sflphone-common/libs/pjproject/pjsip/src/pjsip/sip_dialog_wrap.cpp b/sflphone-common/libs/pjproject/pjsip/src/pjsip/sip_dialog_wrap.cpp index 9f2080f5ba268a07dbea12913cf15489ebcd3557..1dee2f2cc88dc343cefd477751ec884e764b8a7e 100644 --- a/sflphone-common/libs/pjproject/pjsip/src/pjsip/sip_dialog_wrap.cpp +++ b/sflphone-common/libs/pjproject/pjsip/src/pjsip/sip_dialog_wrap.cpp @@ -1,5 +1,5 @@ /* $Id: sip_dialog_wrap.cpp 2873 2009-08-13 11:54:35Z nanang $ */ -/* +/* * Copyright (C) 2009 Teluu Inc. (http://www.teluu.com) * * This program is free software; you can redistribute it and/or modify @@ -14,7 +14,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* diff --git a/sflphone-common/libs/pjproject/pjsip/src/pjsip/sip_endpoint_wrap.cpp b/sflphone-common/libs/pjproject/pjsip/src/pjsip/sip_endpoint_wrap.cpp index 1689f7961b6918c42bd91553930fe239b714c0a7..55b157aee113a918c838e31cc782c38f3b84572f 100644 --- a/sflphone-common/libs/pjproject/pjsip/src/pjsip/sip_endpoint_wrap.cpp +++ b/sflphone-common/libs/pjproject/pjsip/src/pjsip/sip_endpoint_wrap.cpp @@ -1,5 +1,5 @@ /* $Id: sip_endpoint_wrap.cpp 2873 2009-08-13 11:54:35Z nanang $ */ -/* +/* * Copyright (C) 2009 Teluu Inc. (http://www.teluu.com) * * This program is free software; you can redistribute it and/or modify @@ -14,7 +14,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* diff --git a/sflphone-common/libs/pjproject/pjsip/src/pjsip/sip_msg.c b/sflphone-common/libs/pjproject/pjsip/src/pjsip/sip_msg.c index 249b9940d65118398265c8d5cfd45a2f099637b9..97dc6c34eca40cc34f51597c0dc93f6312eac20c 100644 --- a/sflphone-common/libs/pjproject/pjsip/src/pjsip/sip_msg.c +++ b/sflphone-common/libs/pjproject/pjsip/src/pjsip/sip_msg.c @@ -1,4 +1,4 @@ -/* $Id: sip_msg.c 2724 2009-05-29 13:04:03Z bennylp $ */ +/* $Id: sip_msg.c 2968 2009-10-26 11:21:37Z bennylp $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> @@ -21,6 +21,7 @@ #include <pjsip/sip_parser.h> #include <pjsip/print_util.h> #include <pjsip/sip_errno.h> +#include <pj/ctype.h> #include <pj/string.h> #include <pj/pool.h> #include <pj/assert.h> @@ -597,6 +598,20 @@ PJ_DEF(const pj_str_t*) pjsip_get_status_text(int code) &status_phrase[code] : &status_phrase[0]; } +/////////////////////////////////////////////////////////////////////////////// +/* + * Media type + */ +PJ_DEF(void) pjsip_media_type_cp( pj_pool_t *pool, + pjsip_media_type *dst, + const pjsip_media_type *src) +{ + PJ_ASSERT_ON_FAIL(pool && dst && src, return); + pj_strdup(pool, &dst->type, &src->type); + pj_strdup(pool, &dst->subtype, &src->subtype); + pj_strdup(pool, &dst->param, &src->param); +} + /////////////////////////////////////////////////////////////////////////////// /* * Generic pjsip_hdr_names/hvalue header. @@ -1718,6 +1733,7 @@ PJ_DEF(pjsip_retry_after_hdr*) pjsip_retry_after_hdr_init( pj_pool_t *pool, init_hdr(hdr, PJSIP_H_RETRY_AFTER, &retry_after_hdr_vptr); hdr->ivalue = value; + hdr->comment.slen = 0; pj_list_init(&hdr->param); return hdr; } @@ -1903,7 +1919,14 @@ static int pjsip_via_hdr_print( pjsip_via_hdr *hdr, /* SIP/2.0/transport host:port */ pj_memcpy(buf, sip_ver.ptr, sip_ver.slen); buf += sip_ver.slen; - pj_memcpy(buf, hdr->transport.ptr, hdr->transport.slen); + //pj_memcpy(buf, hdr->transport.ptr, hdr->transport.slen); + /* Convert transport type to UPPERCASE (some endpoints want that) */ + { + int i; + for (i=0; i<hdr->transport.slen; ++i) { + buf[i] = (char)pj_toupper(hdr->transport.ptr[i]); + } + } buf += hdr->transport.slen; *buf++ = ' '; diff --git a/sflphone-common/libs/pjproject/pjsip/src/pjsip/sip_parser.c b/sflphone-common/libs/pjproject/pjsip/src/pjsip/sip_parser.c index 15fda1d43021aa413bbbdf4432ea15b59f0374a3..1212c0abba0d4b859aba5cc26bbac5ece5342cd5 100644 --- a/sflphone-common/libs/pjproject/pjsip/src/pjsip/sip_parser.c +++ b/sflphone-common/libs/pjproject/pjsip/src/pjsip/sip_parser.c @@ -1,4 +1,4 @@ -/* $Id: sip_parser.c 2695 2009-05-12 15:55:09Z bennylp $ */ +/* $Id: sip_parser.c 3003 2009-11-10 05:09:44Z bennylp $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> @@ -1007,11 +1007,17 @@ parse_headers: if (handler) { hdr = (*handler)(ctx); + /* Note: + * hdr MAY BE NULL, if parsing does not yield a new header + * instance, e.g. the values have been added to existing + * header. See http://trac.pjsip.org/repos/ticket/940 + */ + /* Check if we've just parsed a Content-Type header. * We will check for a message body if we've got Content-Type * header. */ - if (hdr->type == PJSIP_H_CONTENT_TYPE) { + if (hdr && hdr->type == PJSIP_H_CONTENT_TYPE) { ctype_hdr = (pjsip_ctype_hdr*)hdr; } @@ -1027,7 +1033,8 @@ parse_headers: * different Contact headers. * So here we must insert list instead of just insert one header. */ - pj_list_insert_nodes_before(&msg->hdr, hdr); + if (hdr) + pj_list_insert_nodes_before(&msg->hdr, hdr); /* Parse until EOF or an empty line is found. */ } while (!pj_scan_is_eof(scanner) && !IS_NEWLINE(*scanner->curptr)); @@ -1639,7 +1646,14 @@ static void parse_generic_array_hdr( pjsip_generic_array_hdr *hdr, goto end; } - pj_scan_get( scanner, &pconst.pjsip_NOT_COMMA_OR_NEWLINE, &hdr->values[0]); + if (hdr->count >= PJ_ARRAY_SIZE(hdr->values)) { + /* Too many elements */ + on_syntax_error(scanner); + return; + } + + pj_scan_get( scanner, &pconst.pjsip_NOT_COMMA_OR_NEWLINE, + &hdr->values[hdr->count]); hdr->count++; while (*scanner->curptr == ',') { @@ -1917,13 +1931,21 @@ static pjsip_hdr* parse_hdr_from( pjsip_parse_ctx *ctx ) /* Parse Require: header. */ static pjsip_hdr* parse_hdr_require( pjsip_parse_ctx *ctx ) { - pjsip_require_hdr *hdr = pjsip_require_hdr_create(ctx->pool); - parse_generic_array_hdr(hdr, ctx->scanner); + pjsip_require_hdr *hdr; + pj_bool_t new_hdr = (ctx->rdata==NULL || + ctx->rdata->msg_info.require == NULL); + + if (ctx->rdata && ctx->rdata->msg_info.require) { + hdr = ctx->rdata->msg_info.require; + } else { + hdr = pjsip_require_hdr_create(ctx->pool); + if (ctx->rdata) + ctx->rdata->msg_info.require = hdr; + } - if (ctx->rdata && ctx->rdata->msg_info.require == NULL) - ctx->rdata->msg_info.require = hdr; + parse_generic_array_hdr(hdr, ctx->scanner); - return (pjsip_hdr*)hdr; + return new_hdr ? (pjsip_hdr*)hdr : NULL; } /* Parse Retry-After: header. */ @@ -1960,12 +1982,22 @@ static pjsip_hdr* parse_hdr_retry_after(pjsip_parse_ctx *ctx) /* Parse Supported: header. */ static pjsip_hdr* parse_hdr_supported(pjsip_parse_ctx *ctx) { - pjsip_supported_hdr *hdr = pjsip_supported_hdr_create(ctx->pool); + pjsip_supported_hdr *hdr; + pj_bool_t new_hdr = (ctx->rdata==NULL || + ctx->rdata->msg_info.supported == NULL); + + if (ctx->rdata && ctx->rdata->msg_info.supported) { + hdr = ctx->rdata->msg_info.supported; + } else { + hdr = pjsip_supported_hdr_create(ctx->pool); + if (ctx->rdata) + ctx->rdata->msg_info.supported = hdr; + } + parse_generic_array_hdr(hdr, ctx->scanner); - return (pjsip_hdr*)hdr; + return new_hdr ? (pjsip_hdr*)hdr : NULL; } - /* Parse To: header. */ static pjsip_hdr* parse_hdr_to( pjsip_parse_ctx *ctx ) { diff --git a/sflphone-common/libs/pjproject/pjsip/src/pjsip/sip_parser_wrap.cpp b/sflphone-common/libs/pjproject/pjsip/src/pjsip/sip_parser_wrap.cpp index 95f2ca7a4fe860427acfa2ef36be84e13d369bd6..e27cd0429802382394649228f3da524bfb0d0c98 100644 --- a/sflphone-common/libs/pjproject/pjsip/src/pjsip/sip_parser_wrap.cpp +++ b/sflphone-common/libs/pjproject/pjsip/src/pjsip/sip_parser_wrap.cpp @@ -1,5 +1,5 @@ /* $Id: sip_parser_wrap.cpp 2873 2009-08-13 11:54:35Z nanang $ */ -/* +/* * Copyright (C) 2009 Teluu Inc. (http://www.teluu.com) * * This program is free software; you can redistribute it and/or modify @@ -14,7 +14,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* diff --git a/sflphone-common/libs/pjproject/pjsip/src/pjsip/sip_resolve.c b/sflphone-common/libs/pjproject/pjsip/src/pjsip/sip_resolve.c index a7293f688f66104db2b7bc92fce8e2dbcfe497f9..746506d606c993d7f3f055cd8101747f9cfcf174 100644 --- a/sflphone-common/libs/pjproject/pjsip/src/pjsip/sip_resolve.c +++ b/sflphone-common/libs/pjproject/pjsip/src/pjsip/sip_resolve.c @@ -1,4 +1,4 @@ -/* $Id: sip_resolve.c 2394 2008-12-23 17:27:53Z bennylp $ */ +/* $Id: sip_resolve.c 3053 2010-01-08 17:12:05Z bennylp $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> @@ -198,7 +198,7 @@ PJ_DEF(void) pjsip_resolve( pjsip_resolver_t *resolver, } else { /* No type or explicit port is specified, and the address is * not IP address. - * In this case, full resolution must be performed. + * In this case, full NAPTR resolution must be performed. * But we don't support it (yet). */ #if PJ_HAS_TCP @@ -225,63 +225,71 @@ PJ_DEF(void) pjsip_resolve( pjsip_resolver_t *resolver, * we can just finish the resolution now using pj_gethostbyname() */ if (ip_addr_ver || resolver->res == NULL) { - - char ip_addr[PJ_INET6_ADDRSTRLEN]; - int af; - pj_addrinfo ai; - unsigned count; + char addr_str[PJ_INET6_ADDRSTRLEN+10]; pj_uint16_t srv_port; - if (!ip_addr_ver) { - PJ_LOG(5,(THIS_FILE, + if (ip_addr_ver != 0) { + /* Target is an IP address, no need to resolve */ + if (ip_addr_ver == 4) { + pj_sockaddr_init(pj_AF_INET(), &svr_addr.entry[0].addr, + NULL, 0); + pj_inet_aton(&target->addr.host, + &svr_addr.entry[0].addr.ipv4.sin_addr); + } else { + pj_sockaddr_init(pj_AF_INET6(), &svr_addr.entry[0].addr, + NULL, 0); + pj_inet_pton(pj_AF_INET6(), &target->addr.host, + &svr_addr.entry[0].addr.ipv6.sin6_addr); + } + } else { + pj_addrinfo ai; + unsigned count; + int af; + + PJ_LOG(5,(THIS_FILE, "DNS resolver not available, target '%.*s:%d' type=%s " - "will be resolved with gethostbyname()", + "will be resolved with getaddrinfo()", target->addr.host.slen, target->addr.host.ptr, target->addr.port, pjsip_transport_get_type_name(target->type))); + + if (type & PJSIP_TRANSPORT_IPV6) { + af = pj_AF_INET6(); + } else { + af = pj_AF_INET(); + } + + /* Resolve */ + count = 1; + status = pj_getaddrinfo(af, &target->addr.host, &count, &ai); + if (status != PJ_SUCCESS) + goto on_error; + + svr_addr.entry[0].addr.addr.sa_family = (pj_uint16_t)af; + pj_memcpy(&svr_addr.entry[0].addr, &ai.ai_addr, + sizeof(pj_sockaddr)); } - /* Set the port number if not specified. */ + /* Set the port number */ if (target->addr.port == 0) { srv_port = (pj_uint16_t) pjsip_transport_get_default_port_for_type(type); } else { srv_port = (pj_uint16_t)target->addr.port; } - - if (type & PJSIP_TRANSPORT_IPV6) { - af = pj_AF_INET6(); - } else { - af = pj_AF_INET(); - } - - /* Resolve */ - count = 1; - status = pj_getaddrinfo(af, &target->addr.host, &count, &ai); - if (status != PJ_SUCCESS) - goto on_error; - - svr_addr.entry[0].addr.addr.sa_family = (pj_uint16_t)af; - pj_memcpy(&svr_addr.entry[0].addr, &ai.ai_addr, sizeof(pj_sockaddr)); - - if (af == pj_AF_INET6()) { - svr_addr.entry[0].addr.ipv6.sin6_port = pj_htons(srv_port); - } else { - svr_addr.entry[0].addr.ipv4.sin_port = pj_htons(srv_port); - } + pj_sockaddr_set_port(&svr_addr.entry[0].addr, srv_port); /* Call the callback. */ PJ_LOG(5,(THIS_FILE, "Target '%.*s:%d' type=%s resolved to " - "'%s:%d' type=%s (%s)", + "'%s' type=%s (%s)", (int)target->addr.host.slen, target->addr.host.ptr, target->addr.port, pjsip_transport_get_type_name(target->type), - pj_inet_ntop2(af, pj_sockaddr_get_addr(&svr_addr.entry[0].addr), - ip_addr, sizeof(ip_addr)), - srv_port, + pj_sockaddr_print(&svr_addr.entry[0].addr, addr_str, + sizeof(addr_str), 3), pjsip_transport_get_type_name(type), pjsip_transport_get_type_desc(type))); svr_addr.count = 1; @@ -361,21 +369,14 @@ PJ_DEF(void) pjsip_resolve( pjsip_resolver_t *resolver, if (query->query_type == PJ_DNS_TYPE_SRV) { - unsigned option = PJ_TRUE; - if (type & PJSIP_TRANSPORT_IPV6) { - option |= PJ_DNS_SRV_FALLBACK_GETADDRINFO_IPV6; - } else { - option |= PJ_DNS_SRV_FALLBACK_GETADDRINFO_IPV4; - } - - status = pj_dns_srv_resolve(&query->naptr[0].name, - &query->naptr[0].res_type, - query->req.def_port, pool, resolver->res, - option, query, &srv_resolver_cb, NULL); + status = pj_dns_srv_resolve(&query->naptr[0].name, + &query->naptr[0].res_type, + query->req.def_port, pool, resolver->res, + PJ_TRUE, query, &srv_resolver_cb, NULL); } else if (query->query_type == PJ_DNS_TYPE_A) { - status = pj_dns_resolver_start_query(resolver->res, + status = pj_dns_resolver_start_query(resolver->res, &query->naptr[0].name, PJ_DNS_TYPE_A, 0, &dns_a_callback, diff --git a/sflphone-common/libs/pjproject/pjsip/src/pjsip/sip_tel_uri_wrap.cpp b/sflphone-common/libs/pjproject/pjsip/src/pjsip/sip_tel_uri_wrap.cpp index fc1f818e8b33be3cc592295667691061378b722c..f82281a3231d07b532bb308357b8e6bc7b69a325 100644 --- a/sflphone-common/libs/pjproject/pjsip/src/pjsip/sip_tel_uri_wrap.cpp +++ b/sflphone-common/libs/pjproject/pjsip/src/pjsip/sip_tel_uri_wrap.cpp @@ -1,5 +1,5 @@ /* $Id: sip_tel_uri_wrap.cpp 2873 2009-08-13 11:54:35Z nanang $ */ -/* +/* * Copyright (C) 2009 Teluu Inc. (http://www.teluu.com) * * This program is free software; you can redistribute it and/or modify @@ -14,7 +14,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* diff --git a/sflphone-common/libs/pjproject/pjsip/src/pjsip/sip_transaction.c b/sflphone-common/libs/pjproject/pjsip/src/pjsip/sip_transaction.c index a21fe753f590a83e12433ec3079abfa8463bbf20..79b0866bafe9f12e084e9343b1fc0aff97411f15 100644 --- a/sflphone-common/libs/pjproject/pjsip/src/pjsip/sip_transaction.c +++ b/sflphone-common/libs/pjproject/pjsip/src/pjsip/sip_transaction.c @@ -1,4 +1,4 @@ -/* $Id: sip_transaction.c 2857 2009-08-11 12:36:49Z nanang $ */ +/* $Id: sip_transaction.c 2936 2009-10-10 13:36:43Z bennylp $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> @@ -545,10 +545,15 @@ static pj_status_t mod_tsx_layer_register_tsx( pjsip_transaction *tsx) * Do not use PJ_ASSERT_RETURN since it evaluates the expression * twice! */ - pj_assert(pj_hash_get( mod_tsx_layer.htable, - tsx->transaction_key.ptr, - tsx->transaction_key.slen, - NULL) == NULL); + if(pj_hash_get(mod_tsx_layer.htable, + tsx->transaction_key.ptr, + tsx->transaction_key.slen, + NULL)) + { + pj_mutex_unlock(mod_tsx_layer.mutex); + PJ_LOG(2,(THIS_FILE, "Unable to register transaction (key exists)")); + return PJ_EEXISTS; + } TSX_TRACE_((THIS_FILE, "Transaction %p registered with hkey=0x%p and key=%.*s", @@ -1344,6 +1349,7 @@ PJ_DEF(pj_status_t) pjsip_tsx_create_uas( pjsip_module *tsx_user, status = pjsip_tsx_create_key(tsx->pool, &tsx->transaction_key, PJSIP_ROLE_UAS, &tsx->method, rdata); if (status != PJ_SUCCESS) { + unlock_tsx(tsx, &lck); tsx_destroy(tsx); return status; } @@ -1371,6 +1377,7 @@ PJ_DEF(pj_status_t) pjsip_tsx_create_uas( pjsip_module *tsx_user, /* Get response address. */ status = pjsip_get_response_addr( tsx->pool, rdata, &tsx->res_addr ); if (status != PJ_SUCCESS) { + unlock_tsx(tsx, &lck); tsx_destroy(tsx); return status; } @@ -1393,6 +1400,7 @@ PJ_DEF(pj_status_t) pjsip_tsx_create_uas( pjsip_module *tsx_user, /* Register the transaction. */ status = mod_tsx_layer_register_tsx(tsx); if (status != PJ_SUCCESS) { + unlock_tsx(tsx, &lck); tsx_destroy(tsx); return status; } @@ -1626,6 +1634,7 @@ static void send_msg_callback( pjsip_send_state *send_state, pj_ssize_t sent, pj_bool_t *cont ) { pjsip_transaction *tsx = (pjsip_transaction*) send_state->token; + pjsip_tx_data *tdata = send_state->tdata; struct tsx_lock_data lck; lock_tsx(tsx, &lck); @@ -1644,9 +1653,9 @@ static void send_msg_callback( pjsip_send_state *send_state, pjsip_transport_add_ref(tsx->transport); /* Update remote address. */ - tsx->addr_len = send_state->addr.entry[send_state->cur_addr].addr_len; + tsx->addr_len = tdata->dest_info.addr.entry[tdata->dest_info.cur_addr].addr_len; pj_memcpy(&tsx->addr, - &send_state->addr.entry[send_state->cur_addr].addr, + &tdata->dest_info.addr.entry[tdata->dest_info.cur_addr].addr, tsx->addr_len); /* Update is_reliable flag. */ @@ -2840,6 +2849,15 @@ static pj_status_t tsx_on_state_completed_uas( pjsip_transaction *tsx, /* Process incoming ACK request. */ + /* Verify that this is an INVITE transaction */ + if (tsx->method.id != PJSIP_INVITE_METHOD) { + PJ_LOG(2, (tsx->obj_name, + "Received illegal ACK for %.*s transaction", + (int)tsx->method.name.slen, + tsx->method.name.ptr)); + return PJSIP_EINVALIDMETHOD; + } + /* Cease retransmission. */ if (tsx->retransmit_timer.id != 0) { pjsip_endpt_cancel_timer(tsx->endpt, &tsx->retransmit_timer); diff --git a/sflphone-common/libs/pjproject/pjsip/src/pjsip/sip_transport.c b/sflphone-common/libs/pjproject/pjsip/src/pjsip/sip_transport.c index df1f896e2f6d5f3a3ab11e71d38366e8d5d12c40..a26d3c3f532f666b689cf140b621422d9ef38180 100644 --- a/sflphone-common/libs/pjproject/pjsip/src/pjsip/sip_transport.c +++ b/sflphone-common/libs/pjproject/pjsip/src/pjsip/sip_transport.c @@ -1,4 +1,4 @@ -/* $Id: sip_transport.c 2724 2009-05-29 13:04:03Z bennylp $ */ +/* $Id: sip_transport.c 2915 2009-09-22 17:56:44Z bennylp $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> @@ -1439,6 +1439,14 @@ PJ_DEF(pj_ssize_t) pjsip_tpmgr_receive_packet( pjsip_tpmgr *mgr, if (rdata->msg_info.via->rport_param == 0) { rdata->msg_info.via->rport_param = rdata->pkt_info.src_port; } + } else { + /* Drop malformed responses */ + if (rdata->msg_info.msg->line.status.code < 100 || + rdata->msg_info.msg->line.status.code >= 700) + { + mgr->on_rx_msg(mgr->endpt, PJSIP_EINVALIDSTATUS, rdata); + goto finish_process_fragment; + } } /* Drop response message if it has more than one Via. diff --git a/sflphone-common/libs/pjproject/pjsip/src/pjsip/sip_transport_tcp.c b/sflphone-common/libs/pjproject/pjsip/src/pjsip/sip_transport_tcp.c index bb5ade9652456e86e7836ee5687f7b5121c76e47..030cc8a427f08e217cad8ab91dfc93cd4d0812fc 100644 --- a/sflphone-common/libs/pjproject/pjsip/src/pjsip/sip_transport_tcp.c +++ b/sflphone-common/libs/pjproject/pjsip/src/pjsip/sip_transport_tcp.c @@ -1,4 +1,4 @@ -/* $Id: sip_transport_tcp.c 2781 2009-06-22 14:06:40Z nanang $ */ +/* $Id: sip_transport_tcp.c 3035 2009-12-22 13:00:22Z bennylp $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> @@ -57,6 +57,8 @@ struct tcp_listener pjsip_endpoint *endpt; pjsip_tpmgr *tpmgr; pj_activesock_t *asock; + pj_qos_type qos_type; + pj_qos_params qos_params; }; @@ -164,6 +166,17 @@ static void sockaddr_to_host_port( pj_pool_t *pool, host_port->port = pj_sockaddr_get_port(addr); } +/* + * Initialize pjsip_tcp_transport_cfg structure with default values. + */ +PJ_DEF(void) pjsip_tcp_transport_cfg_default(pjsip_tcp_transport_cfg *cfg, + int af) +{ + pj_bzero(cfg, sizeof(*cfg)); + cfg->af = af; + pj_sockaddr_init(cfg->af, &cfg->bind_addr, NULL, 0); + cfg->async_cnt = 1; +} /**************************************************************************** @@ -174,32 +187,33 @@ static void sockaddr_to_host_port( pj_pool_t *pool, * This is the public API to create, initialize, register, and start the * TCP listener. */ -PJ_DEF(pj_status_t) pjsip_tcp_transport_start2(pjsip_endpoint *endpt, - const pj_sockaddr_in *local, - const pjsip_host_port *a_name, - unsigned async_cnt, - pjsip_tpfactory **p_factory) +PJ_DEF(pj_status_t) pjsip_tcp_transport_start3( + pjsip_endpoint *endpt, + const pjsip_tcp_transport_cfg *cfg, + pjsip_tpfactory **p_factory + ) { pj_pool_t *pool; pj_sock_t sock = PJ_INVALID_SOCKET; struct tcp_listener *listener; pj_activesock_cfg asock_cfg; pj_activesock_cb listener_cb; - pj_sockaddr_in *listener_addr; + pj_sockaddr *listener_addr; int addr_len; pj_status_t status; /* Sanity check */ - PJ_ASSERT_RETURN(endpt && async_cnt, PJ_EINVAL); + PJ_ASSERT_RETURN(endpt && cfg->async_cnt, PJ_EINVAL); /* Verify that address given in a_name (if any) is valid */ - if (a_name && a_name->host.slen) { - pj_sockaddr_in tmp; - - status = pj_sockaddr_in_init(&tmp, &a_name->host, - (pj_uint16_t)a_name->port); - if (status != PJ_SUCCESS || tmp.sin_addr.s_addr == PJ_INADDR_ANY || - tmp.sin_addr.s_addr == PJ_INADDR_NONE) + if (cfg->addr_name.host.slen) { + pj_sockaddr tmp; + + status = pj_sockaddr_init(cfg->af, &tmp, &cfg->addr_name.host, + (pj_uint16_t)cfg->addr_name.port); + if (status != PJ_SUCCESS || !pj_sockaddr_has_addr(&tmp) || + (cfg->af==pj_AF_INET() && + tmp.ipv4.sin_addr.s_addr==PJ_INADDR_NONE)) { /* Invalid address */ return PJ_EINVAL; @@ -217,6 +231,9 @@ PJ_DEF(pj_status_t) pjsip_tcp_transport_start2(pjsip_endpoint *endpt, listener->factory.type_name = "tcp"; listener->factory.flag = pjsip_transport_get_flag_from_type(PJSIP_TRANSPORT_TCP); + listener->qos_type = cfg->qos_type; + pj_memcpy(&listener->qos_params, &cfg->qos_params, + sizeof(cfg->qos_params)); pj_ansi_strcpy(listener->factory.obj_name, "tcplis"); @@ -226,24 +243,27 @@ PJ_DEF(pj_status_t) pjsip_tcp_transport_start2(pjsip_endpoint *endpt, goto on_error; - /* Create and bind socket */ - status = pj_sock_socket(pj_AF_INET(), pj_SOCK_STREAM(), 0, &sock); + /* Create socket */ + status = pj_sock_socket(cfg->af, pj_SOCK_STREAM(), 0, &sock); if (status != PJ_SUCCESS) goto on_error; - listener_addr = (pj_sockaddr_in*)&listener->factory.local_addr; - if (local) { - pj_memcpy(listener_addr, local, sizeof(pj_sockaddr_in)); - } else { - pj_sockaddr_in_init(listener_addr, NULL, 0); - } + /* Apply QoS, if specified */ + status = pj_sock_apply_qos2(sock, cfg->qos_type, &cfg->qos_params, + 2, listener->factory.obj_name, + "SIP TCP listener socket"); - status = pj_sock_bind(sock, listener_addr, sizeof(pj_sockaddr_in)); + /* Bind socket */ + listener_addr = &listener->factory.local_addr; + pj_sockaddr_cp(listener_addr, &cfg->bind_addr); + + status = pj_sock_bind(sock, listener_addr, + pj_sockaddr_get_len(listener_addr)); if (status != PJ_SUCCESS) goto on_error; /* Retrieve the bound address */ - addr_len = sizeof(pj_sockaddr_in); + addr_len = pj_sockaddr_get_len(listener_addr); status = pj_sock_getsockname(sock, listener_addr, &addr_len); if (status != PJ_SUCCESS) goto on_error; @@ -251,12 +271,12 @@ PJ_DEF(pj_status_t) pjsip_tcp_transport_start2(pjsip_endpoint *endpt, /* If published host/IP is specified, then use that address as the * listener advertised address. */ - if (a_name && a_name->host.slen) { + if (cfg->addr_name.host.slen) { /* Copy the address */ - listener->factory.addr_name = *a_name; + listener->factory.addr_name = cfg->addr_name; pj_strdup(listener->factory.pool, &listener->factory.addr_name.host, - &a_name->host); - listener->factory.addr_name.port = a_name->port; + &cfg->addr_name.host); + listener->factory.addr_name.port = cfg->addr_name.port; } else { /* No published address is given, use the bound address */ @@ -264,24 +284,27 @@ PJ_DEF(pj_status_t) pjsip_tcp_transport_start2(pjsip_endpoint *endpt, /* If the address returns 0.0.0.0, use the default * interface address as the transport's address. */ - if (listener_addr->sin_addr.s_addr == 0) { + if (!pj_sockaddr_has_addr(listener_addr)) { pj_sockaddr hostip; status = pj_gethostip(pj_AF_INET(), &hostip); if (status != PJ_SUCCESS) goto on_error; - listener_addr->sin_addr.s_addr = hostip.ipv4.sin_addr.s_addr; + pj_memcpy(pj_sockaddr_get_addr(listener_addr), + pj_sockaddr_get_addr(&hostip), + pj_sockaddr_get_addr_len(&hostip)); } /* Save the address name */ sockaddr_to_host_port(listener->factory.pool, - &listener->factory.addr_name, listener_addr); + &listener->factory.addr_name, + (pj_sockaddr_in*)listener_addr); } /* If port is zero, get the bound port */ if (listener->factory.addr_name.port == 0) { - listener->factory.addr_name.port = pj_ntohs(listener_addr->sin_port); + listener->factory.addr_name.port = pj_sockaddr_get_port(listener_addr); } pj_ansi_snprintf(listener->factory.obj_name, @@ -296,9 +319,11 @@ PJ_DEF(pj_status_t) pjsip_tcp_transport_start2(pjsip_endpoint *endpt, /* Create active socket */ - if (async_cnt > MAX_ASYNC_CNT) async_cnt = MAX_ASYNC_CNT; pj_activesock_cfg_default(&asock_cfg); - asock_cfg.async_cnt = async_cnt; + if (cfg->async_cnt > MAX_ASYNC_CNT) + asock_cfg.async_cnt = MAX_ASYNC_CNT; + else + asock_cfg.async_cnt = cfg->async_cnt; pj_bzero(&listener_cb, sizeof(listener_cb)); listener_cb.on_accept_complete = &on_accept_complete; @@ -344,6 +369,35 @@ on_error: } +/* + * This is the public API to create, initialize, register, and start the + * TCP listener. + */ +PJ_DEF(pj_status_t) pjsip_tcp_transport_start2(pjsip_endpoint *endpt, + const pj_sockaddr_in *local, + const pjsip_host_port *a_name, + unsigned async_cnt, + pjsip_tpfactory **p_factory) +{ + pjsip_tcp_transport_cfg cfg; + + pjsip_tcp_transport_cfg_default(&cfg, pj_AF_INET()); + + if (local) + pj_sockaddr_cp(&cfg.bind_addr, local); + else + pj_sockaddr_init(cfg.af, &cfg.bind_addr, NULL, 0); + + if (a_name) + pj_memcpy(&cfg.addr_name, a_name, sizeof(*a_name)); + + if (async_cnt) + cfg.async_cnt = async_cnt; + + return pjsip_tcp_transport_start3(endpt, &cfg, p_factory); +} + + /* * This is the public API to create, initialize, register, and start the * TCP listener. @@ -774,6 +828,12 @@ static pj_status_t lis_create_transport(pjsip_tpfactory *factory, if (status != PJ_SUCCESS) return status; + /* Apply QoS, if specified */ + status = pj_sock_apply_qos2(sock, listener->qos_type, + &listener->qos_params, + 2, listener->factory.obj_name, + "outgoing SIP TCP socket"); + /* Bind to any port */ status = pj_sock_bind_in(sock, 0, 0); if (status != PJ_SUCCESS) { @@ -878,6 +938,12 @@ static pj_bool_t on_accept_complete(pj_activesock_t *asock, pj_sockaddr_print(src_addr, addr, sizeof(addr), 3), sock)); + /* Apply QoS, if specified */ + status = pj_sock_apply_qos2(sock, listener->qos_type, + &listener->qos_params, + 2, listener->factory.obj_name, + "incoming SIP TCP socket"); + /* * Incoming connection! * Create TCP transport for the new socket. @@ -1214,7 +1280,9 @@ static pj_bool_t on_connect_complete(pj_activesock_t *asock, if (pj_sock_getsockname(tcp->sock, &addr, &addrlen)==PJ_SUCCESS) { pj_sockaddr_in *tp_addr = (pj_sockaddr_in*)&tcp->base.local_addr; - if (tp_addr->sin_addr.s_addr != addr.sin_addr.s_addr) { + if (pj_sockaddr_has_addr(&addr) && + tp_addr->sin_addr.s_addr != addr.sin_addr.s_addr) + { tp_addr->sin_addr.s_addr = addr.sin_addr.s_addr; tp_addr->sin_port = addr.sin_port; sockaddr_to_host_port(tcp->base.pool, &tcp->base.local_name, diff --git a/sflphone-common/libs/pjproject/pjsip/src/pjsip/sip_transport_tls.c b/sflphone-common/libs/pjproject/pjsip/src/pjsip/sip_transport_tls.c new file mode 100644 index 0000000000000000000000000000000000000000..db65fa0200d7ba39fceedf388c3db9fe9270dd76 --- /dev/null +++ b/sflphone-common/libs/pjproject/pjsip/src/pjsip/sip_transport_tls.c @@ -0,0 +1,1381 @@ +/* $Id: sip_transport_tls.c 3039 2009-12-30 06:35:20Z nanang $ */ +/* + * Copyright (C) 2009 Teluu Inc. (http://www.teluu.com) + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#include <pjsip/sip_transport_tls.h> +#include <pjsip/sip_endpoint.h> +#include <pjsip/sip_errno.h> +#include <pj/compat/socket.h> +#include <pj/addr_resolv.h> +#include <pj/ssl_sock.h> +#include <pj/assert.h> +#include <pj/lock.h> +#include <pj/log.h> +#include <pj/os.h> +#include <pj/pool.h> +#include <pj/string.h> + +#if defined(PJSIP_HAS_TLS_TRANSPORT) && PJSIP_HAS_TLS_TRANSPORT!=0 + +#define THIS_FILE "sip_transport_tls.c" + +#define MAX_ASYNC_CNT 16 +#define POOL_LIS_INIT 512 +#define POOL_LIS_INC 512 +#define POOL_TP_INIT 512 +#define POOL_TP_INC 512 + +struct tls_listener; +struct tls_transport; + +/* + * Definition of TLS/SSL transport listener, and it's descendant of + * pjsip_tpfactory. + */ +struct tls_listener +{ + pjsip_tpfactory factory; + pj_bool_t is_registered; + pjsip_endpoint *endpt; + pjsip_tpmgr *tpmgr; + pj_ssl_sock_t *ssock; + pj_ssl_cert_t *cert; + pjsip_tls_setting tls_setting; +}; + + +/* + * This structure is used to keep delayed transmit operation in a list. + * A delayed transmission occurs when application sends tx_data when + * the TLS connect/establishment is still in progress. These delayed + * transmission will be "flushed" once the socket is connected (either + * successfully or with errors). + */ +struct delayed_tdata +{ + PJ_DECL_LIST_MEMBER(struct delayed_tdata); + pjsip_tx_data_op_key *tdata_op_key; +}; + + +/* + * TLS/SSL transport, and it's descendant of pjsip_transport. + */ +struct tls_transport +{ + pjsip_transport base; + pj_bool_t is_server; + + pj_bool_t is_registered; + pj_bool_t is_closing; + pj_status_t close_reason; + pj_ssl_sock_t *ssock; + pj_bool_t has_pending_connect; + + /* Keep-alive timer. */ + pj_timer_entry ka_timer; + pj_time_val last_activity; + pjsip_tx_data_op_key ka_op_key; + pj_str_t ka_pkt; + + /* TLS transport can only have one rdata! + * Otherwise chunks of incoming PDU may be received on different + * buffer. + */ + pjsip_rx_data rdata; + + /* Pending transmission list. */ + struct delayed_tdata delayed_list; +}; + + +/**************************************************************************** + * PROTOTYPES + */ + +/* This callback is called when pending accept() operation completes. */ +static pj_bool_t on_accept_complete(pj_ssl_sock_t *ssock, + pj_ssl_sock_t *new_ssock, + const pj_sockaddr_t *src_addr, + int src_addr_len); + +/* Callback on incoming data */ +static pj_bool_t on_data_read(pj_ssl_sock_t *ssock, + void *data, + pj_size_t size, + pj_status_t status, + pj_size_t *remainder); + +/* Callback when packet is sent */ +static pj_bool_t on_data_sent(pj_ssl_sock_t *ssock, + pj_ioqueue_op_key_t *send_key, + pj_ssize_t sent); + +/* This callback is called by transport manager to destroy listener */ +static pj_status_t lis_destroy(pjsip_tpfactory *factory); + +/* This callback is called by transport manager to create transport */ +static pj_status_t lis_create_transport(pjsip_tpfactory *factory, + pjsip_tpmgr *mgr, + pjsip_endpoint *endpt, + const pj_sockaddr *rem_addr, + int addr_len, + pjsip_transport **transport); + +/* Common function to create and initialize transport */ +static pj_status_t tls_create(struct tls_listener *listener, + pj_pool_t *pool, + pj_ssl_sock_t *ssock, + pj_bool_t is_server, + const pj_sockaddr_in *local, + const pj_sockaddr_in *remote, + struct tls_transport **p_tls); + + +static void tls_perror(const char *sender, const char *title, + pj_status_t status) +{ + char errmsg[PJ_ERR_MSG_SIZE]; + + pj_strerror(status, errmsg, sizeof(errmsg)); + + PJ_LOG(1,(sender, "%s: %s [code=%d]", title, errmsg, status)); +} + + +static void sockaddr_to_host_port( pj_pool_t *pool, + pjsip_host_port *host_port, + const pj_sockaddr_in *addr ) +{ + host_port->host.ptr = (char*) pj_pool_alloc(pool, PJ_INET6_ADDRSTRLEN+4); + pj_sockaddr_print(addr, host_port->host.ptr, PJ_INET6_ADDRSTRLEN+4, 2); + host_port->host.slen = pj_ansi_strlen(host_port->host.ptr); + host_port->port = pj_sockaddr_get_port(addr); +} + + + +/**************************************************************************** + * The TLS listener/transport factory. + */ + +/* + * This is the public API to create, initialize, register, and start the + * TLS listener. + */ +PJ_DEF(pj_status_t) pjsip_tls_transport_start (pjsip_endpoint *endpt, + const pjsip_tls_setting *opt, + const pj_sockaddr_in *local, + const pjsip_host_port *a_name, + unsigned async_cnt, + pjsip_tpfactory **p_factory) +{ + pj_pool_t *pool; + struct tls_listener *listener; + pj_ssl_sock_param ssock_param; + pj_sockaddr_in *listener_addr; + pj_bool_t has_listener; + pj_status_t status; + + /* Sanity check */ + PJ_ASSERT_RETURN(endpt && async_cnt, PJ_EINVAL); + + /* Verify that address given in a_name (if any) is valid */ + if (a_name && a_name->host.slen) { + pj_sockaddr_in tmp; + + status = pj_sockaddr_in_init(&tmp, &a_name->host, + (pj_uint16_t)a_name->port); + if (status != PJ_SUCCESS || tmp.sin_addr.s_addr == PJ_INADDR_ANY || + tmp.sin_addr.s_addr == PJ_INADDR_NONE) + { + /* Invalid address */ + return PJ_EINVAL; + } + } + + pool = pjsip_endpt_create_pool(endpt, "tlslis", POOL_LIS_INIT, + POOL_LIS_INC); + PJ_ASSERT_RETURN(pool, PJ_ENOMEM); + + listener = PJ_POOL_ZALLOC_T(pool, struct tls_listener); + listener->factory.pool = pool; + listener->factory.type = PJSIP_TRANSPORT_TLS; + listener->factory.type_name = "tls"; + listener->factory.flag = + pjsip_transport_get_flag_from_type(PJSIP_TRANSPORT_TLS); + + pj_ansi_strcpy(listener->factory.obj_name, "tlslis"); + + if (opt) + pjsip_tls_setting_copy(pool, &listener->tls_setting, opt); + else + pjsip_tls_setting_default(&listener->tls_setting); + + status = pj_lock_create_recursive_mutex(pool, "tlslis", + &listener->factory.lock); + if (status != PJ_SUCCESS) + goto on_error; + + if (async_cnt > MAX_ASYNC_CNT) + async_cnt = MAX_ASYNC_CNT; + + /* Build SSL socket param */ + pj_ssl_sock_param_default(&ssock_param); + ssock_param.cb.on_accept_complete = &on_accept_complete; + ssock_param.cb.on_data_read = &on_data_read; + ssock_param.cb.on_data_sent = &on_data_sent; + ssock_param.async_cnt = async_cnt; + ssock_param.ioqueue = pjsip_endpt_get_ioqueue(endpt); + ssock_param.require_client_cert = listener->tls_setting.require_client_cert; + ssock_param.server_name = listener->tls_setting.server_name; + ssock_param.timeout = listener->tls_setting.timeout; + ssock_param.user_data = listener; + ssock_param.verify_peer = listener->tls_setting.verify_client; + if (ssock_param.send_buffer_size < PJSIP_MAX_PKT_LEN) + ssock_param.send_buffer_size = PJSIP_MAX_PKT_LEN; + if (ssock_param.read_buffer_size < PJSIP_MAX_PKT_LEN) + ssock_param.read_buffer_size = PJSIP_MAX_PKT_LEN; + ssock_param.qos_type = listener->tls_setting.qos_type; + ssock_param.qos_ignore_error = listener->tls_setting.qos_ignore_error; + pj_memcpy(&ssock_param.qos_params, &listener->tls_setting.qos_params, + sizeof(ssock_param.qos_params)); + + has_listener = PJ_FALSE; + + switch(listener->tls_setting.method) { + case PJSIP_TLSV1_METHOD: + ssock_param.proto = PJ_SSL_SOCK_PROTO_TLS1; + break; + case PJSIP_SSLV2_METHOD: + ssock_param.proto = PJ_SSL_SOCK_PROTO_SSL2; + break; + case PJSIP_SSLV3_METHOD: + ssock_param.proto = PJ_SSL_SOCK_PROTO_SSL3; + break; + case PJSIP_SSLV23_METHOD: + ssock_param.proto = PJ_SSL_SOCK_PROTO_SSL23; + break; + default: + ssock_param.proto = PJ_SSL_SOCK_PROTO_DEFAULT; + break; + } + + /* Create SSL socket */ + status = pj_ssl_sock_create(pool, &ssock_param, &listener->ssock); + if (status != PJ_SUCCESS) + goto on_error; + + listener_addr = (pj_sockaddr_in*)&listener->factory.local_addr; + if (local) { + pj_sockaddr_cp((pj_sockaddr_t*)listener_addr, + (const pj_sockaddr_t*)local); + } else { + pj_sockaddr_in_init(listener_addr, NULL, 0); + } + + /* Check if certificate/CA list for SSL socket is set */ + if (listener->tls_setting.cert_file.slen || + listener->tls_setting.ca_list_file.slen) + { + status = pj_ssl_cert_load_from_files(pool, + &listener->tls_setting.ca_list_file, + &listener->tls_setting.cert_file, + &listener->tls_setting.privkey_file, + &listener->tls_setting.password, + &listener->cert); + if (status != PJ_SUCCESS) + goto on_error; + + status = pj_ssl_sock_set_certificate(listener->ssock, pool, + listener->cert); + if (status != PJ_SUCCESS) + goto on_error; + } + + /* Start accepting incoming connections. Note that some TLS/SSL backends + * may not support for SSL socket server. + */ + has_listener = PJ_FALSE; + + status = pj_ssl_sock_start_accept(listener->ssock, pool, + (pj_sockaddr_t*)listener_addr, + pj_sockaddr_get_len((pj_sockaddr_t*)listener_addr)); + if (status == PJ_SUCCESS || status == PJ_EPENDING) { + pj_ssl_sock_info info; + has_listener = PJ_TRUE; + + /* Retrieve the bound address */ + status = pj_ssl_sock_get_info(listener->ssock, &info); + if (status == PJ_SUCCESS) + pj_sockaddr_cp(listener_addr, (pj_sockaddr_t*)&info.local_addr); + } else if (status != PJ_ENOTSUP) { + goto on_error; + } + + /* If published host/IP is specified, then use that address as the + * listener advertised address. + */ + if (a_name && a_name->host.slen) { + /* Copy the address */ + listener->factory.addr_name = *a_name; + pj_strdup(listener->factory.pool, &listener->factory.addr_name.host, + &a_name->host); + listener->factory.addr_name.port = a_name->port; + + } else { + /* No published address is given, use the bound address */ + + /* If the address returns 0.0.0.0, use the default + * interface address as the transport's address. + */ + if (listener_addr->sin_addr.s_addr == 0) { + pj_sockaddr hostip; + + status = pj_gethostip(pj_AF_INET(), &hostip); + if (status != PJ_SUCCESS) + goto on_error; + + listener_addr->sin_addr.s_addr = hostip.ipv4.sin_addr.s_addr; + } + + /* Save the address name */ + sockaddr_to_host_port(listener->factory.pool, + &listener->factory.addr_name, listener_addr); + } + + /* If port is zero, get the bound port */ + if (listener->factory.addr_name.port == 0) { + listener->factory.addr_name.port = pj_ntohs(listener_addr->sin_port); + } + + pj_ansi_snprintf(listener->factory.obj_name, + sizeof(listener->factory.obj_name), + "tlslis:%d", listener->factory.addr_name.port); + + /* Register to transport manager */ + listener->endpt = endpt; + listener->tpmgr = pjsip_endpt_get_tpmgr(endpt); + listener->factory.create_transport = lis_create_transport; + listener->factory.destroy = lis_destroy; + listener->is_registered = PJ_TRUE; + status = pjsip_tpmgr_register_tpfactory(listener->tpmgr, + &listener->factory); + if (status != PJ_SUCCESS) { + listener->is_registered = PJ_FALSE; + goto on_error; + } + + if (has_listener) { + PJ_LOG(4,(listener->factory.obj_name, + "SIP TLS listener is ready for incoming connections " + "at %.*s:%d", + (int)listener->factory.addr_name.host.slen, + listener->factory.addr_name.host.ptr, + listener->factory.addr_name.port)); + } else { + PJ_LOG(4,(listener->factory.obj_name, "SIP TLS is ready " + "(client only)")); + } + + /* Return the pointer to user */ + if (p_factory) *p_factory = &listener->factory; + + return PJ_SUCCESS; + +on_error: + lis_destroy(&listener->factory); + return status; +} + + +/* This callback is called by transport manager to destroy listener */ +static pj_status_t lis_destroy(pjsip_tpfactory *factory) +{ + struct tls_listener *listener = (struct tls_listener *)factory; + + if (listener->is_registered) { + pjsip_tpmgr_unregister_tpfactory(listener->tpmgr, &listener->factory); + listener->is_registered = PJ_FALSE; + } + + if (listener->ssock) { + pj_ssl_sock_close(listener->ssock); + listener->ssock = NULL; + } + + if (listener->factory.lock) { + pj_lock_destroy(listener->factory.lock); + listener->factory.lock = NULL; + } + + if (listener->factory.pool) { + pj_pool_t *pool = listener->factory.pool; + + PJ_LOG(4,(listener->factory.obj_name, "SIP TLS listener destroyed")); + + listener->factory.pool = NULL; + pj_pool_release(pool); + } + + return PJ_SUCCESS; +} + + +/***************************************************************************/ +/* + * TLS Transport + */ + +/* + * Prototypes. + */ +/* Called by transport manager to send message */ +static pj_status_t tls_send_msg(pjsip_transport *transport, + pjsip_tx_data *tdata, + const pj_sockaddr_t *rem_addr, + int addr_len, + void *token, + pjsip_transport_callback callback); + +/* Called by transport manager to shutdown */ +static pj_status_t tls_shutdown(pjsip_transport *transport); + +/* Called by transport manager to destroy transport */ +static pj_status_t tls_destroy_transport(pjsip_transport *transport); + +/* Utility to destroy transport */ +static pj_status_t tls_destroy(pjsip_transport *transport, + pj_status_t reason); + +/* Callback when connect completes */ +static pj_bool_t on_connect_complete(pj_ssl_sock_t *ssock, + pj_status_t status); + +/* TLS keep-alive timer callback */ +static void tls_keep_alive_timer(pj_timer_heap_t *th, pj_timer_entry *e); + +/* + * Common function to create TLS transport, called when pending accept() and + * pending connect() complete. + */ +static pj_status_t tls_create( struct tls_listener *listener, + pj_pool_t *pool, + pj_ssl_sock_t *ssock, + pj_bool_t is_server, + const pj_sockaddr_in *local, + const pj_sockaddr_in *remote, + struct tls_transport **p_tls) +{ + struct tls_transport *tls; + const pj_str_t ka_pkt = PJSIP_TCP_KEEP_ALIVE_DATA; + pj_status_t status; + + + PJ_ASSERT_RETURN(listener && ssock && local && remote && p_tls, PJ_EINVAL); + + + if (pool == NULL) { + pool = pjsip_endpt_create_pool(listener->endpt, "tls", + POOL_TP_INIT, POOL_TP_INC); + PJ_ASSERT_RETURN(pool != NULL, PJ_ENOMEM); + } + + /* + * Create and initialize basic transport structure. + */ + tls = PJ_POOL_ZALLOC_T(pool, struct tls_transport); + tls->is_server = is_server; + pj_list_init(&tls->delayed_list); + tls->base.pool = pool; + + pj_ansi_snprintf(tls->base.obj_name, PJ_MAX_OBJ_NAME, + (is_server ? "tlss%p" :"tlsc%p"), tls); + + status = pj_atomic_create(pool, 0, &tls->base.ref_cnt); + if (status != PJ_SUCCESS) { + goto on_error; + } + + status = pj_lock_create_recursive_mutex(pool, "tls", &tls->base.lock); + if (status != PJ_SUCCESS) { + goto on_error; + } + + tls->base.key.type = PJSIP_TRANSPORT_TLS; + pj_memcpy(&tls->base.key.rem_addr, remote, sizeof(pj_sockaddr_in)); + tls->base.type_name = "tls"; + tls->base.flag = pjsip_transport_get_flag_from_type(PJSIP_TRANSPORT_TLS); + + tls->base.info = (char*) pj_pool_alloc(pool, 64); + pj_ansi_snprintf(tls->base.info, 64, "TLS to %s:%d", + pj_inet_ntoa(remote->sin_addr), + (int)pj_ntohs(remote->sin_port)); + + tls->base.addr_len = sizeof(pj_sockaddr_in); + + /* Set initial local address */ + if (!pj_sockaddr_has_addr(local)) { + pj_sockaddr_cp(&tls->base.local_addr, + &listener->factory.local_addr); + } else { + pj_sockaddr_cp(&tls->base.local_addr, local); + } + + sockaddr_to_host_port(pool, &tls->base.local_name, + (pj_sockaddr_in*)&tls->base.local_addr); + sockaddr_to_host_port(pool, &tls->base.remote_name, remote); + + tls->base.endpt = listener->endpt; + tls->base.tpmgr = listener->tpmgr; + tls->base.send_msg = &tls_send_msg; + tls->base.do_shutdown = &tls_shutdown; + tls->base.destroy = &tls_destroy_transport; + + tls->ssock = ssock; + + /* Register transport to transport manager */ + status = pjsip_transport_register(listener->tpmgr, &tls->base); + if (status != PJ_SUCCESS) { + goto on_error; + } + + tls->is_registered = PJ_TRUE; + + /* Initialize keep-alive timer */ + tls->ka_timer.user_data = (void*)tls; + tls->ka_timer.cb = &tls_keep_alive_timer; + pj_ioqueue_op_key_init(&tls->ka_op_key.key, sizeof(pj_ioqueue_op_key_t)); + pj_strdup(tls->base.pool, &tls->ka_pkt, &ka_pkt); + + /* Done setting up basic transport. */ + *p_tls = tls; + + PJ_LOG(4,(tls->base.obj_name, "TLS %s transport created", + (tls->is_server ? "server" : "client"))); + + return PJ_SUCCESS; + +on_error: + tls_destroy(&tls->base, status); + return status; +} + + +/* Flush all delayed transmision once the socket is connected. */ +static void tls_flush_pending_tx(struct tls_transport *tls) +{ + pj_lock_acquire(tls->base.lock); + while (!pj_list_empty(&tls->delayed_list)) { + struct delayed_tdata *pending_tx; + pjsip_tx_data *tdata; + pj_ioqueue_op_key_t *op_key; + pj_ssize_t size; + pj_status_t status; + + pending_tx = tls->delayed_list.next; + pj_list_erase(pending_tx); + + tdata = pending_tx->tdata_op_key->tdata; + op_key = (pj_ioqueue_op_key_t*)pending_tx->tdata_op_key; + + /* send! */ + size = tdata->buf.cur - tdata->buf.start; + status = pj_ssl_sock_send(tls->ssock, op_key, tdata->buf.start, + &size, 0); + + if (status != PJ_EPENDING) { + on_data_sent(tls->ssock, op_key, size); + } + } + pj_lock_release(tls->base.lock); +} + + +/* Called by transport manager to destroy transport */ +static pj_status_t tls_destroy_transport(pjsip_transport *transport) +{ + struct tls_transport *tls = (struct tls_transport*)transport; + + /* Transport would have been unregistered by now since this callback + * is called by transport manager. + */ + tls->is_registered = PJ_FALSE; + + return tls_destroy(transport, tls->close_reason); +} + + +/* Destroy TLS transport */ +static pj_status_t tls_destroy(pjsip_transport *transport, + pj_status_t reason) +{ + struct tls_transport *tls = (struct tls_transport*)transport; + + if (tls->close_reason == 0) + tls->close_reason = reason; + + if (tls->is_registered) { + tls->is_registered = PJ_FALSE; + pjsip_transport_destroy(transport); + + /* pjsip_transport_destroy will recursively call this function + * again. + */ + return PJ_SUCCESS; + } + + /* Mark transport as closing */ + tls->is_closing = PJ_TRUE; + + /* Stop keep-alive timer. */ + if (tls->ka_timer.id) { + pjsip_endpt_cancel_timer(tls->base.endpt, &tls->ka_timer); + tls->ka_timer.id = PJ_FALSE; + } + + /* Cancel all delayed transmits */ + while (!pj_list_empty(&tls->delayed_list)) { + struct delayed_tdata *pending_tx; + pj_ioqueue_op_key_t *op_key; + + pending_tx = tls->delayed_list.next; + pj_list_erase(pending_tx); + + op_key = (pj_ioqueue_op_key_t*)pending_tx->tdata_op_key; + + on_data_sent(tls->ssock, op_key, -reason); + } + + if (tls->rdata.tp_info.pool) { + pj_pool_release(tls->rdata.tp_info.pool); + tls->rdata.tp_info.pool = NULL; + } + + if (tls->ssock) { + pj_ssl_sock_close(tls->ssock); + tls->ssock = NULL; + } + if (tls->base.lock) { + pj_lock_destroy(tls->base.lock); + tls->base.lock = NULL; + } + + if (tls->base.ref_cnt) { + pj_atomic_destroy(tls->base.ref_cnt); + tls->base.ref_cnt = NULL; + } + + if (tls->base.pool) { + pj_pool_t *pool; + + if (reason != PJ_SUCCESS) { + char errmsg[PJ_ERR_MSG_SIZE]; + + pj_strerror(reason, errmsg, sizeof(errmsg)); + PJ_LOG(4,(tls->base.obj_name, + "TLS transport destroyed with reason %d: %s", + reason, errmsg)); + + } else { + + PJ_LOG(4,(tls->base.obj_name, + "TLS transport destroyed normally")); + + } + + pool = tls->base.pool; + tls->base.pool = NULL; + pj_pool_release(pool); + } + + return PJ_SUCCESS; +} + + +/* + * This utility function creates receive data buffers and start + * asynchronous recv() operations from the socket. It is called after + * accept() or connect() operation complete. + */ +static pj_status_t tls_start_read(struct tls_transport *tls) +{ + pj_pool_t *pool; + pj_ssize_t size; + pj_sockaddr_in *rem_addr; + void *readbuf[1]; + pj_status_t status; + + /* Init rdata */ + pool = pjsip_endpt_create_pool(tls->base.endpt, + "rtd%p", + PJSIP_POOL_RDATA_LEN, + PJSIP_POOL_RDATA_INC); + if (!pool) { + tls_perror(tls->base.obj_name, "Unable to create pool", PJ_ENOMEM); + return PJ_ENOMEM; + } + + tls->rdata.tp_info.pool = pool; + + tls->rdata.tp_info.transport = &tls->base; + tls->rdata.tp_info.tp_data = tls; + tls->rdata.tp_info.op_key.rdata = &tls->rdata; + pj_ioqueue_op_key_init(&tls->rdata.tp_info.op_key.op_key, + sizeof(pj_ioqueue_op_key_t)); + + tls->rdata.pkt_info.src_addr = tls->base.key.rem_addr; + tls->rdata.pkt_info.src_addr_len = sizeof(pj_sockaddr_in); + rem_addr = (pj_sockaddr_in*) &tls->base.key.rem_addr; + pj_ansi_strcpy(tls->rdata.pkt_info.src_name, + pj_inet_ntoa(rem_addr->sin_addr)); + tls->rdata.pkt_info.src_port = pj_ntohs(rem_addr->sin_port); + + size = sizeof(tls->rdata.pkt_info.packet); + readbuf[0] = tls->rdata.pkt_info.packet; + status = pj_ssl_sock_start_read2(tls->ssock, tls->base.pool, size, + readbuf, 0); + if (status != PJ_SUCCESS && status != PJ_EPENDING) { + PJ_LOG(4, (tls->base.obj_name, + "pj_ssl_sock_start_read() error, status=%d", + status)); + return status; + } + + return PJ_SUCCESS; +} + + +/* This callback is called by transport manager for the TLS factory + * to create outgoing transport to the specified destination. + */ +static pj_status_t lis_create_transport(pjsip_tpfactory *factory, + pjsip_tpmgr *mgr, + pjsip_endpoint *endpt, + const pj_sockaddr *rem_addr, + int addr_len, + pjsip_transport **p_transport) +{ + struct tls_listener *listener; + struct tls_transport *tls; + pj_pool_t *pool; + pj_ssl_sock_t *ssock; + pj_ssl_sock_param ssock_param; + pj_sockaddr_in local_addr; + pj_status_t status; + + /* Sanity checks */ + PJ_ASSERT_RETURN(factory && mgr && endpt && rem_addr && + addr_len && p_transport, PJ_EINVAL); + + /* Check that address is a sockaddr_in */ + PJ_ASSERT_RETURN(rem_addr->addr.sa_family == pj_AF_INET() && + addr_len == sizeof(pj_sockaddr_in), PJ_EINVAL); + + + listener = (struct tls_listener*)factory; + + pool = pjsip_endpt_create_pool(listener->endpt, "tls", + POOL_TP_INIT, POOL_TP_INC); + PJ_ASSERT_RETURN(pool != NULL, PJ_ENOMEM); + + /* Build SSL socket param */ + pj_ssl_sock_param_default(&ssock_param); + ssock_param.cb.on_connect_complete = &on_connect_complete; + ssock_param.cb.on_data_read = &on_data_read; + ssock_param.cb.on_data_sent = &on_data_sent; + ssock_param.async_cnt = 1; + ssock_param.ioqueue = pjsip_endpt_get_ioqueue(listener->endpt); + PJ_TODO(set_proper_servername_based_on_target); + PJ_TODO(synchronize_tls_cipher_type_with_ssl_sock_cipher_type); + ssock_param.server_name = listener->tls_setting.server_name; + ssock_param.timeout = listener->tls_setting.timeout; + ssock_param.user_data = NULL; /* pending, must be set later */ + ssock_param.verify_peer = listener->tls_setting.verify_server; + if (ssock_param.send_buffer_size < PJSIP_MAX_PKT_LEN) + ssock_param.send_buffer_size = PJSIP_MAX_PKT_LEN; + if (ssock_param.read_buffer_size < PJSIP_MAX_PKT_LEN) + ssock_param.read_buffer_size = PJSIP_MAX_PKT_LEN; + ssock_param.qos_type = listener->tls_setting.qos_type; + ssock_param.qos_ignore_error = listener->tls_setting.qos_ignore_error; + pj_memcpy(&ssock_param.qos_params, &listener->tls_setting.qos_params, + sizeof(ssock_param.qos_params)); + + switch(listener->tls_setting.method) { + case PJSIP_TLSV1_METHOD: + ssock_param.proto = PJ_SSL_SOCK_PROTO_TLS1; + break; + case PJSIP_SSLV2_METHOD: + ssock_param.proto = PJ_SSL_SOCK_PROTO_SSL2; + break; + case PJSIP_SSLV3_METHOD: + ssock_param.proto = PJ_SSL_SOCK_PROTO_SSL3; + break; + case PJSIP_SSLV23_METHOD: + ssock_param.proto = PJ_SSL_SOCK_PROTO_SSL23; + break; + default: + ssock_param.proto = PJ_SSL_SOCK_PROTO_DEFAULT; + break; + } + + status = pj_ssl_sock_create(pool, &ssock_param, &ssock); + if (status != PJ_SUCCESS) + return status; + + /* Apply SSL certificate */ + if (listener->cert) { + status = pj_ssl_sock_set_certificate(ssock, pool, listener->cert); + if (status != PJ_SUCCESS) + return status; + } + + /* Initially set bind address to PJ_INADDR_ANY port 0 */ + pj_sockaddr_in_init(&local_addr, NULL, 0); + + /* Create the transport descriptor */ + status = tls_create(listener, pool, ssock, PJ_FALSE, &local_addr, + (pj_sockaddr_in*)rem_addr, &tls); + if (status != PJ_SUCCESS) + return status; + + /* Set the "pending" SSL socket user data */ + pj_ssl_sock_set_user_data(tls->ssock, tls); + + /* Start asynchronous connect() operation */ + tls->has_pending_connect = PJ_TRUE; + status = pj_ssl_sock_start_connect(tls->ssock, tls->base.pool, + (pj_sockaddr_t*)&local_addr, + (pj_sockaddr_t*)rem_addr, + addr_len); + if (status == PJ_SUCCESS) { + on_connect_complete(tls->ssock, PJ_SUCCESS); + } else if (status != PJ_EPENDING) { + tls_destroy(&tls->base, status); + return status; + } + + if (tls->has_pending_connect) { + pj_ssl_sock_info info; + + /* Update local address, just in case local address currently set is + * different now that asynchronous connect() is started. + */ + + /* Retrieve the bound address */ + status = pj_ssl_sock_get_info(tls->ssock, &info); + if (status == PJ_SUCCESS) { + pj_uint16_t new_port; + + new_port = pj_sockaddr_get_port((pj_sockaddr_t*)&info.local_addr); + + if (pj_sockaddr_has_addr((pj_sockaddr_t*)&info.local_addr)) { + /* Update sockaddr */ + pj_sockaddr_cp((pj_sockaddr_t*)&tls->base.local_addr, + (pj_sockaddr_t*)&info.local_addr); + } else if (new_port && new_port != pj_sockaddr_get_port( + (pj_sockaddr_t*)&tls->base.local_addr)) + { + /* Update port only */ + pj_sockaddr_set_port(&tls->base.local_addr, + new_port); + } + + sockaddr_to_host_port(tls->base.pool, &tls->base.local_name, + (pj_sockaddr_in*)&tls->base.local_addr); + } + + PJ_LOG(4,(tls->base.obj_name, + "TLS transport %.*s:%d is connecting to %.*s:%d...", + (int)tls->base.local_name.host.slen, + tls->base.local_name.host.ptr, + tls->base.local_name.port, + (int)tls->base.remote_name.host.slen, + tls->base.remote_name.host.ptr, + tls->base.remote_name.port)); + } + + /* Done */ + *p_transport = &tls->base; + + return PJ_SUCCESS; +} + + +/* + * This callback is called by SSL socket when pending accept() operation + * has completed. + */ +static pj_bool_t on_accept_complete(pj_ssl_sock_t *ssock, + pj_ssl_sock_t *new_ssock, + const pj_sockaddr_t *src_addr, + int src_addr_len) +{ + struct tls_listener *listener; + struct tls_transport *tls; + char addr[PJ_INET6_ADDRSTRLEN+10]; + pj_status_t status; + + PJ_UNUSED_ARG(src_addr_len); + + listener = (struct tls_listener*) pj_ssl_sock_get_user_data(ssock); + + PJ_ASSERT_RETURN(new_ssock, PJ_TRUE); + + PJ_LOG(4,(listener->factory.obj_name, + "TLS listener %.*s:%d: got incoming TLS connection " + "from %s, sock=%d", + (int)listener->factory.addr_name.host.slen, + listener->factory.addr_name.host.ptr, + listener->factory.addr_name.port, + pj_sockaddr_print(src_addr, addr, sizeof(addr), 3), + new_ssock)); + + /* + * Incoming connection! + * Create TLS transport for the new socket. + */ + status = tls_create( listener, NULL, new_ssock, PJ_TRUE, + (const pj_sockaddr_in*)&listener->factory.local_addr, + (const pj_sockaddr_in*)src_addr, &tls); + + if (status == PJ_SUCCESS) { + /* Set the "pending" SSL socket user data */ + pj_ssl_sock_set_user_data(new_ssock, tls); + + status = tls_start_read(tls); + if (status != PJ_SUCCESS) { + PJ_LOG(3,(tls->base.obj_name, "New transport cancelled")); + tls_destroy(&tls->base, status); + } else { + /* Start keep-alive timer */ + if (PJSIP_TCP_KEEP_ALIVE_INTERVAL) { + pj_time_val delay = {PJSIP_TCP_KEEP_ALIVE_INTERVAL, 0}; + pjsip_endpt_schedule_timer(listener->endpt, + &tls->ka_timer, + &delay); + tls->ka_timer.id = PJ_TRUE; + pj_gettimeofday(&tls->last_activity); + } + } + } + + return PJ_TRUE; +} + + +/* + * Callback from ioqueue when packet is sent. + */ +static pj_bool_t on_data_sent(pj_ssl_sock_t *ssock, + pj_ioqueue_op_key_t *op_key, + pj_ssize_t bytes_sent) +{ + struct tls_transport *tls = (struct tls_transport*) + pj_ssl_sock_get_user_data(ssock); + pjsip_tx_data_op_key *tdata_op_key = (pjsip_tx_data_op_key*)op_key; + + /* Note that op_key may be the op_key from keep-alive, thus + * it will not have tdata etc. + */ + + tdata_op_key->tdata = NULL; + + if (tdata_op_key->callback) { + /* + * Notify sip_transport.c that packet has been sent. + */ + if (bytes_sent == 0) + bytes_sent = -PJ_RETURN_OS_ERROR(OSERR_ENOTCONN); + + tdata_op_key->callback(&tls->base, tdata_op_key->token, bytes_sent); + + /* Mark last activity time */ + pj_gettimeofday(&tls->last_activity); + + } + + /* Check for error/closure */ + if (bytes_sent <= 0) { + pj_status_t status; + + PJ_LOG(5,(tls->base.obj_name, "TLS send() error, sent=%d", + bytes_sent)); + + status = (bytes_sent == 0) ? PJ_RETURN_OS_ERROR(OSERR_ENOTCONN) : + -bytes_sent; + if (tls->close_reason==PJ_SUCCESS) tls->close_reason = status; + pjsip_transport_shutdown(&tls->base); + + return PJ_FALSE; + } + + return PJ_TRUE; +} + + +/* + * This callback is called by transport manager to send SIP message + */ +static pj_status_t tls_send_msg(pjsip_transport *transport, + pjsip_tx_data *tdata, + const pj_sockaddr_t *rem_addr, + int addr_len, + void *token, + pjsip_transport_callback callback) +{ + struct tls_transport *tls = (struct tls_transport*)transport; + pj_ssize_t size; + pj_bool_t delayed = PJ_FALSE; + pj_status_t status = PJ_SUCCESS; + + /* Sanity check */ + PJ_ASSERT_RETURN(transport && tdata, PJ_EINVAL); + + /* Check that there's no pending operation associated with the tdata */ + PJ_ASSERT_RETURN(tdata->op_key.tdata == NULL, PJSIP_EPENDINGTX); + + /* Check the address is supported */ + PJ_ASSERT_RETURN(rem_addr && addr_len==sizeof(pj_sockaddr_in), PJ_EINVAL); + + + + /* Init op key. */ + tdata->op_key.tdata = tdata; + tdata->op_key.token = token; + tdata->op_key.callback = callback; + + /* If asynchronous connect() has not completed yet, just put the + * transmit data in the pending transmission list since we can not + * use the socket yet. + */ + if (tls->has_pending_connect) { + + /* + * Looks like connect() is still in progress. Check again (this time + * with holding the lock) to be sure. + */ + pj_lock_acquire(tls->base.lock); + + if (tls->has_pending_connect) { + struct delayed_tdata *delayed_tdata; + + /* + * connect() is still in progress. Put the transmit data to + * the delayed list. + */ + delayed_tdata = PJ_POOL_ALLOC_T(tdata->pool, + struct delayed_tdata); + delayed_tdata->tdata_op_key = &tdata->op_key; + + pj_list_push_back(&tls->delayed_list, delayed_tdata); + status = PJ_EPENDING; + + /* Prevent pj_ioqueue_send() to be called below */ + delayed = PJ_TRUE; + } + + pj_lock_release(tls->base.lock); + } + + if (!delayed) { + /* + * Transport is ready to go. Send the packet to ioqueue to be + * sent asynchronously. + */ + size = tdata->buf.cur - tdata->buf.start; + status = pj_ssl_sock_send(tls->ssock, + (pj_ioqueue_op_key_t*)&tdata->op_key, + tdata->buf.start, &size, 0); + + if (status != PJ_EPENDING) { + /* Not pending (could be immediate success or error) */ + tdata->op_key.tdata = NULL; + + /* Shutdown transport on closure/errors */ + if (size <= 0) { + + PJ_LOG(5,(tls->base.obj_name, "TLS send() error, sent=%d", + size)); + + if (status == PJ_SUCCESS) + status = PJ_RETURN_OS_ERROR(OSERR_ENOTCONN); + if (tls->close_reason==PJ_SUCCESS) tls->close_reason = status; + pjsip_transport_shutdown(&tls->base); + } + } + } + + return status; +} + + +/* + * This callback is called by transport manager to shutdown transport. + */ +static pj_status_t tls_shutdown(pjsip_transport *transport) +{ + struct tls_transport *tls = (struct tls_transport*)transport; + + /* Stop keep-alive timer. */ + if (tls->ka_timer.id) { + pjsip_endpt_cancel_timer(tls->base.endpt, &tls->ka_timer); + tls->ka_timer.id = PJ_FALSE; + } + + return PJ_SUCCESS; +} + + +/* + * Callback from ioqueue that an incoming data is received from the socket. + */ +static pj_bool_t on_data_read(pj_ssl_sock_t *ssock, + void *data, + pj_size_t size, + pj_status_t status, + pj_size_t *remainder) +{ + enum { MAX_IMMEDIATE_PACKET = 10 }; + struct tls_transport *tls; + pjsip_rx_data *rdata; + + PJ_UNUSED_ARG(data); + + tls = (struct tls_transport*) pj_ssl_sock_get_user_data(ssock); + rdata = &tls->rdata; + + /* Don't do anything if transport is closing. */ + if (tls->is_closing) { + tls->is_closing++; + return PJ_FALSE; + } + + /* Houston, we have packet! Report the packet to transport manager + * to be parsed. + */ + if (status == PJ_SUCCESS) { + pj_size_t size_eaten; + + /* Mark this as an activity */ + pj_gettimeofday(&tls->last_activity); + + pj_assert((void*)rdata->pkt_info.packet == data); + + /* Init pkt_info part. */ + rdata->pkt_info.len = size; + rdata->pkt_info.zero = 0; + pj_gettimeofday(&rdata->pkt_info.timestamp); + + /* Report to transport manager. + * The transport manager will tell us how many bytes of the packet + * have been processed (as valid SIP message). + */ + size_eaten = + pjsip_tpmgr_receive_packet(rdata->tp_info.transport->tpmgr, + rdata); + + pj_assert(size_eaten <= (pj_size_t)rdata->pkt_info.len); + + /* Move unprocessed data to the front of the buffer */ + *remainder = size - size_eaten; + if (*remainder > 0 && *remainder != size) { + pj_memmove(rdata->pkt_info.packet, + rdata->pkt_info.packet + size_eaten, + *remainder); + } + + } else { + + /* Transport is closed */ + PJ_LOG(4,(tls->base.obj_name, "TLS connection closed")); + + /* We can not destroy the transport since high level objects may + * still keep reference to this transport. So we can only + * instruct transport manager to gracefully start the shutdown + * procedure for this transport. + */ + if (tls->close_reason==PJ_SUCCESS) + tls->close_reason = status; + pjsip_transport_shutdown(&tls->base); + + return PJ_FALSE; + + } + + /* Reset pool. */ + pj_pool_reset(rdata->tp_info.pool); + + return PJ_TRUE; +} + + +/* + * Callback from ioqueue when asynchronous connect() operation completes. + */ +static pj_bool_t on_connect_complete(pj_ssl_sock_t *ssock, + pj_status_t status) +{ + struct tls_transport *tls; + pj_ssl_sock_info info; + + tls = (struct tls_transport*) pj_ssl_sock_get_user_data(ssock); + + /* Check connect() status */ + if (status != PJ_SUCCESS) { + + tls_perror(tls->base.obj_name, "TLS connect() error", status); + + /* Cancel all delayed transmits */ + while (!pj_list_empty(&tls->delayed_list)) { + struct delayed_tdata *pending_tx; + pj_ioqueue_op_key_t *op_key; + + pending_tx = tls->delayed_list.next; + pj_list_erase(pending_tx); + + op_key = (pj_ioqueue_op_key_t*)pending_tx->tdata_op_key; + + on_data_sent(tls->ssock, op_key, -status); + } + + /* We can not destroy the transport since high level objects may + * still keep reference to this transport. So we can only + * instruct transport manager to gracefully start the shutdown + * procedure for this transport. + */ + if (tls->close_reason==PJ_SUCCESS) tls->close_reason = status; + pjsip_transport_shutdown(&tls->base); + return PJ_FALSE; + } + + /* Update (again) local address, just in case local address currently + * set is different now that the socket is connected (could happen + * on some systems, like old Win32 probably?). + */ + + /* Retrieve the bound address */ + status = pj_ssl_sock_get_info(tls->ssock, &info); + if (status == PJ_SUCCESS) { + pj_sockaddr_in addr; + pj_sockaddr_in *tp_addr = (pj_sockaddr_in*)&tls->base.local_addr; + + pj_sockaddr_cp((pj_sockaddr_t*)&addr, (pj_sockaddr_t*)&info.local_addr); + if (tp_addr->sin_addr.s_addr != addr.sin_addr.s_addr) { + tp_addr->sin_addr.s_addr = addr.sin_addr.s_addr; + tp_addr->sin_port = addr.sin_port; + sockaddr_to_host_port(tls->base.pool, &tls->base.local_name, + tp_addr); + } + } + + PJ_LOG(4,(tls->base.obj_name, + "TLS transport %.*s:%d is connected to %.*s:%d", + (int)tls->base.local_name.host.slen, + tls->base.local_name.host.ptr, + tls->base.local_name.port, + (int)tls->base.remote_name.host.slen, + tls->base.remote_name.host.ptr, + tls->base.remote_name.port)); + + /* Mark that pending connect() operation has completed. */ + tls->has_pending_connect = PJ_FALSE; + + /* Start pending read */ + status = tls_start_read(tls); + if (status != PJ_SUCCESS) { + /* We can not destroy the transport since high level objects may + * still keep reference to this transport. So we can only + * instruct transport manager to gracefully start the shutdown + * procedure for this transport. + */ + if (tls->close_reason==PJ_SUCCESS) tls->close_reason = status; + pjsip_transport_shutdown(&tls->base); + return PJ_FALSE; + } + + /* Flush all pending send operations */ + tls_flush_pending_tx(tls); + + /* Start keep-alive timer */ + if (PJSIP_TCP_KEEP_ALIVE_INTERVAL) { + pj_time_val delay = { PJSIP_TCP_KEEP_ALIVE_INTERVAL, 0 }; + pjsip_endpt_schedule_timer(tls->base.endpt, &tls->ka_timer, + &delay); + tls->ka_timer.id = PJ_TRUE; + pj_gettimeofday(&tls->last_activity); + } + + return PJ_TRUE; +} + + +/* Transport keep-alive timer callback */ +static void tls_keep_alive_timer(pj_timer_heap_t *th, pj_timer_entry *e) +{ + struct tls_transport *tls = (struct tls_transport*) e->user_data; + pj_time_val delay; + pj_time_val now; + pj_ssize_t size; + pj_status_t status; + + PJ_UNUSED_ARG(th); + + tls->ka_timer.id = PJ_TRUE; + + pj_gettimeofday(&now); + PJ_TIME_VAL_SUB(now, tls->last_activity); + + if (now.sec > 0 && now.sec < PJSIP_TCP_KEEP_ALIVE_INTERVAL) { + /* There has been activity, so don't send keep-alive */ + delay.sec = PJSIP_TCP_KEEP_ALIVE_INTERVAL - now.sec; + delay.msec = 0; + + pjsip_endpt_schedule_timer(tls->base.endpt, &tls->ka_timer, + &delay); + tls->ka_timer.id = PJ_TRUE; + return; + } + + PJ_LOG(5,(tls->base.obj_name, "Sending %d byte(s) keep-alive to %.*s:%d", + (int)tls->ka_pkt.slen, (int)tls->base.remote_name.host.slen, + tls->base.remote_name.host.ptr, + tls->base.remote_name.port)); + + /* Send the data */ + size = tls->ka_pkt.slen; + status = pj_ssl_sock_send(tls->ssock, &tls->ka_op_key.key, + tls->ka_pkt.ptr, &size, 0); + + if (status != PJ_SUCCESS && status != PJ_EPENDING) { + tls_perror(tls->base.obj_name, + "Error sending keep-alive packet", status); + pjsip_transport_shutdown(&tls->base); + return; + } + + /* Register next keep-alive */ + delay.sec = PJSIP_TCP_KEEP_ALIVE_INTERVAL; + delay.msec = 0; + + pjsip_endpt_schedule_timer(tls->base.endpt, &tls->ka_timer, + &delay); + tls->ka_timer.id = PJ_TRUE; +} + +#endif /* PJSIP_HAS_TLS_TRANSPORT */ diff --git a/sflphone-common/libs/pjproject/pjsip/src/pjsip/sip_transport_tls_ossl.c b/sflphone-common/libs/pjproject/pjsip/src/pjsip/sip_transport_tls_ossl.c index d9ea1994119352bb9c95fdbbe64b693e4d36dd81..4d04b130eed76ce128eeabbd36b48193b758ce90 100644 --- a/sflphone-common/libs/pjproject/pjsip/src/pjsip/sip_transport_tls_ossl.c +++ b/sflphone-common/libs/pjproject/pjsip/src/pjsip/sip_transport_tls_ossl.c @@ -959,7 +959,7 @@ PJ_DEF(pj_status_t) pjsip_tls_transport_start( pjsip_endpoint *endpt, listener = PJ_POOL_ZALLOC_T(pool, struct tls_listener); listener->factory.pool = pool; listener->factory.type = PJSIP_TRANSPORT_TLS; - listener->factory.type_name = "TLS"; + listener->factory.type_name = "tls"; listener->factory.flag = pjsip_transport_get_flag_from_type(PJSIP_TRANSPORT_TLS); listener->sock = PJ_INVALID_SOCKET; @@ -1270,7 +1270,7 @@ static pj_status_t tls_create( struct tls_listener *listener, tls->base.key.type = PJSIP_TRANSPORT_TLS; pj_memcpy(&tls->base.key.rem_addr, remote, sizeof(pj_sockaddr_in)); - tls->base.type_name = "TLS"; + tls->base.type_name = "tls"; tls->base.flag = pjsip_transport_get_flag_from_type(PJSIP_TRANSPORT_TLS); tls->base.info = (char*) pj_pool_alloc(pool, 64); diff --git a/sflphone-common/libs/pjproject/pjsip/src/pjsip/sip_transport_wrap.cpp b/sflphone-common/libs/pjproject/pjsip/src/pjsip/sip_transport_wrap.cpp index d8501b89ed21f8a397da67215b2a363614110a92..7fc80e2b170b2f3e136fc11d5c2c9f13b2a78fdc 100644 --- a/sflphone-common/libs/pjproject/pjsip/src/pjsip/sip_transport_wrap.cpp +++ b/sflphone-common/libs/pjproject/pjsip/src/pjsip/sip_transport_wrap.cpp @@ -1,5 +1,5 @@ /* $Id: sip_transport_wrap.cpp 2873 2009-08-13 11:54:35Z nanang $ */ -/* +/* * Copyright (C) 2009 Teluu Inc. (http://www.teluu.com) * * This program is free software; you can redistribute it and/or modify @@ -14,7 +14,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* diff --git a/sflphone-common/libs/pjproject/pjsip/src/pjsip/sip_util.c b/sflphone-common/libs/pjproject/pjsip/src/pjsip/sip_util.c index 7577a8f446100cd91ef26fbb68dcf5ba10ce3332..421a3771c2cc45186262ff5b645cdf40e95596f8 100644 --- a/sflphone-common/libs/pjproject/pjsip/src/pjsip/sip_util.c +++ b/sflphone-common/libs/pjproject/pjsip/src/pjsip/sip_util.c @@ -1,4 +1,4 @@ -/* $Id: sip_util.c 2855 2009-08-05 18:41:23Z nanang $ */ +/* $Id: sip_util.c 2932 2009-10-09 12:11:07Z bennylp $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> @@ -754,6 +754,18 @@ PJ_DEF(pj_status_t) pjsip_endpt_create_cancel( pjsip_endpoint *endpt, break; } + /* Must also copy the saved strict route header, otherwise CANCEL will be + * sent with swapped Route and request URI! + */ + if (req_tdata->saved_strict_route) { + cancel_tdata->saved_strict_route = (pjsip_route_hdr*) + pjsip_hdr_clone(cancel_tdata->pool, req_tdata->saved_strict_route); + } + + /* Finally copy the destination info from the original request */ + pj_memcpy(&cancel_tdata->dest_info, &req_tdata->dest_info, + sizeof(req_tdata->dest_info)); + /* Done. * Return the transmit buffer containing the CANCEL request. */ @@ -1057,7 +1069,7 @@ static void stateless_send_transport_cb( void *token, * (2) Failure (i.e. sent <= 0) */ cont = (sent > 0) ? PJ_FALSE : - (stateless_data->cur_addr<stateless_data->addr.count-1); + (tdata->dest_info.cur_addr<tdata->dest_info.addr.count-1); if (stateless_data->app_cb) { (*stateless_data->app_cb)(stateless_data, sent, &cont); } else { @@ -1084,11 +1096,11 @@ static void stateless_send_transport_cb( void *token, * first invocation. */ if (sent != -PJ_EPENDING) { - stateless_data->cur_addr++; + tdata->dest_info.cur_addr++; } /* Have next address? */ - if (stateless_data->cur_addr >= stateless_data->addr.count) { + if (tdata->dest_info.cur_addr >= tdata->dest_info.addr.count) { /* This only happens when a rather buggy application has * sent 'cont' to PJ_TRUE when the initial value was PJ_FALSE. * In this case just stop the processing; we don't need to @@ -1100,9 +1112,9 @@ static void stateless_send_transport_cb( void *token, } /* Keep current server address information handy. */ - cur_addr = &stateless_data->addr.entry[stateless_data->cur_addr].addr; - cur_addr_type = stateless_data->addr.entry[stateless_data->cur_addr].type; - cur_addr_len = stateless_data->addr.entry[stateless_data->cur_addr].addr_len; + cur_addr = &tdata->dest_info.addr.entry[tdata->dest_info.cur_addr].addr; + cur_addr_type = tdata->dest_info.addr.entry[tdata->dest_info.cur_addr].type; + cur_addr_len = tdata->dest_info.addr.entry[tdata->dest_info.cur_addr].addr_len; /* Acquire transport. */ status = pjsip_endpt_acquire_transport( stateless_data->endpt, @@ -1178,6 +1190,7 @@ stateless_send_resolver_callback( pj_status_t status, const struct pjsip_server_addresses *addr) { pjsip_send_state *stateless_data = (pjsip_send_state*) token; + pjsip_tx_data *tdata = stateless_data->tdata; /* Fail on server resolution. */ if (status != PJ_SUCCESS) { @@ -1185,12 +1198,16 @@ stateless_send_resolver_callback( pj_status_t status, pj_bool_t cont = PJ_FALSE; (*stateless_data->app_cb)(stateless_data, -status, &cont); } - pjsip_tx_data_dec_ref(stateless_data->tdata); + pjsip_tx_data_dec_ref(tdata); return; } /* Copy server addresses */ - pj_memcpy( &stateless_data->addr, addr, sizeof(pjsip_server_addresses)); + if (addr && addr != &tdata->dest_info.addr) { + pj_memcpy( &tdata->dest_info.addr, addr, + sizeof(pjsip_server_addresses)); + } + pj_assert(tdata->dest_info.addr.count != 0); #if !defined(PJSIP_DONT_SWITCH_TO_TCP) || PJSIP_DONT_SWITCH_TO_TCP==0 /* RFC 3261 section 18.1.1: @@ -1199,29 +1216,33 @@ stateless_send_resolver_callback( pj_status_t status, * using an RFC 2914 [43] congestion controlled transport protocol, such * as TCP. */ - if (stateless_data->tdata->msg->type == PJSIP_REQUEST_MSG && - addr->count > 0 && - addr->entry[0].type == PJSIP_TRANSPORT_UDP) + if (tdata->msg->type == PJSIP_REQUEST_MSG && + tdata->dest_info.addr.count > 0 && + tdata->dest_info.addr.entry[0].type == PJSIP_TRANSPORT_UDP) { int len; /* Encode the request */ - status = pjsip_tx_data_encode(stateless_data->tdata); + status = pjsip_tx_data_encode(tdata); if (status != PJ_SUCCESS) { if (stateless_data->app_cb) { pj_bool_t cont = PJ_FALSE; (*stateless_data->app_cb)(stateless_data, -status, &cont); } - pjsip_tx_data_dec_ref(stateless_data->tdata); + pjsip_tx_data_dec_ref(tdata); return; } /* Check if request message is larger than 1300 bytes. */ - len = stateless_data->tdata->buf.cur - - stateless_data->tdata->buf.start; + len = tdata->buf.cur - tdata->buf.start; if (len >= PJSIP_UDP_SIZE_THRESHOLD) { int i; - int count = stateless_data->addr.count; + int count = tdata->dest_info.addr.count; + + PJ_LOG(5,(THIS_FILE, "%s exceeds UDP size threshold (%u), " + "sending with TCP", + pjsip_tx_data_get_info(tdata), + PJSIP_UDP_SIZE_THRESHOLD)); /* Insert "TCP version" of resolved UDP addresses at the * beginning. @@ -1229,19 +1250,18 @@ stateless_send_resolver_callback( pj_status_t status, if (count * 2 > PJSIP_MAX_RESOLVED_ADDRESSES) count = PJSIP_MAX_RESOLVED_ADDRESSES / 2; for (i = 0; i < count; ++i) { - pj_memcpy(&stateless_data->addr.entry[i+count], - &stateless_data->addr.entry[i], - sizeof(stateless_data->addr.entry[0])); - stateless_data->addr.entry[i].type = PJSIP_TRANSPORT_TCP; + pj_memcpy(&tdata->dest_info.addr.entry[i+count], + &tdata->dest_info.addr.entry[i], + sizeof(tdata->dest_info.addr.entry[0])); + tdata->dest_info.addr.entry[i].type = PJSIP_TRANSPORT_TCP; } - stateless_data->addr.count = count * 2; + tdata->dest_info.addr.count = count * 2; } } #endif /* !PJSIP_DONT_SWITCH_TO_TCP */ /* Process the addresses. */ - stateless_send_transport_cb( stateless_data, stateless_data->tdata, - -PJ_EPENDING); + stateless_send_transport_cb( stateless_data, tdata, -PJ_EPENDING); } /* @@ -1275,11 +1295,22 @@ PJ_DEF(pj_status_t) pjsip_endpt_send_request_stateless(pjsip_endpoint *endpt, stateless_data->tdata = tdata; stateless_data->app_cb = cb; - /* Resolve destination host. - * The processing then resumed when the resolving callback is called. + /* If destination info has not been initialized (this applies for most + * all requests except CANCEL), resolve destination host. The processing + * then resumed when the resolving callback is called. For CANCEL, the + * destination info must have been copied from the original INVITE so + * proceed to sending the request directly. */ - pjsip_endpt_resolve( endpt, tdata->pool, &dest_info, stateless_data, - &stateless_send_resolver_callback); + if (tdata->dest_info.addr.count == 0) { + pjsip_endpt_resolve( endpt, tdata->pool, &dest_info, stateless_data, + &stateless_send_resolver_callback); + } else { + PJ_LOG(5,(THIS_FILE, "%s: skipping target resolution because " + "address is already set", + pjsip_tx_data_get_info(tdata))); + stateless_send_resolver_callback(PJ_SUCCESS, stateless_data, + &tdata->dest_info.addr); + } return PJ_SUCCESS; } @@ -1590,7 +1621,7 @@ static void send_response_resolver_cb( pj_status_t status, void *token, } /* Update address in send_state. */ - send_state->addr = *addr; + pj_memcpy(&send_state->tdata->dest_info.addr, addr, sizeof(*addr)); /* Send response using the transoprt. */ status = pjsip_transport_send( send_state->cur_transport, diff --git a/sflphone-common/libs/pjproject/pjsip/src/pjsip/sip_util_proxy_wrap.cpp b/sflphone-common/libs/pjproject/pjsip/src/pjsip/sip_util_proxy_wrap.cpp index caa9f9f73fceb8e9166919fccb709a4edf516222..0e394ee4f6f80a717f879ddba901477970e572b4 100644 --- a/sflphone-common/libs/pjproject/pjsip/src/pjsip/sip_util_proxy_wrap.cpp +++ b/sflphone-common/libs/pjproject/pjsip/src/pjsip/sip_util_proxy_wrap.cpp @@ -1,5 +1,5 @@ /* $Id: sip_util_proxy_wrap.cpp 2873 2009-08-13 11:54:35Z nanang $ */ -/* +/* * Copyright (C) 2009 Teluu Inc. (http://www.teluu.com) * * This program is free software; you can redistribute it and/or modify @@ -14,7 +14,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* diff --git a/sflphone-common/libs/pjproject/pjsip/src/pjsip/sip_util_wrap.cpp b/sflphone-common/libs/pjproject/pjsip/src/pjsip/sip_util_wrap.cpp index b27a511a2c0e88c077f880c0da7117f9038ab99f..06a93441903cd22f55b1a4d6110ccd41e45c0728 100644 --- a/sflphone-common/libs/pjproject/pjsip/src/pjsip/sip_util_wrap.cpp +++ b/sflphone-common/libs/pjproject/pjsip/src/pjsip/sip_util_wrap.cpp @@ -1,5 +1,5 @@ /* $Id: sip_util_wrap.cpp 2873 2009-08-13 11:54:35Z nanang $ */ -/* +/* * Copyright (C) 2009 Teluu Inc. (http://www.teluu.com) * * This program is free software; you can redistribute it and/or modify @@ -14,7 +14,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* diff --git a/sflphone-common/libs/pjproject/pjsip/src/pjsua-lib/pjsua_acc.c b/sflphone-common/libs/pjproject/pjsip/src/pjsua-lib/pjsua_acc.c index 4c9d6088dd7f302ba86ccab66ef5820a63bb5de5..26db69e35ab35feb5652eac79e31adf66e3793cb 100644 --- a/sflphone-common/libs/pjproject/pjsip/src/pjsua-lib/pjsua_acc.c +++ b/sflphone-common/libs/pjproject/pjsip/src/pjsua-lib/pjsua_acc.c @@ -1,4 +1,4 @@ -/* $Id: pjsua_acc.c 2855 2009-08-05 18:41:23Z nanang $ */ +/* $Id: pjsua_acc.c 3032 2009-12-14 11:13:45Z bennylp $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> @@ -328,7 +328,11 @@ PJ_DEF(pj_status_t) pjsua_acc_add( const pjsua_acc_config *cfg, /* If accounts has registration enabled, start registration */ if (pjsua_var.acc[id].cfg.reg_uri.slen) pjsua_acc_set_registration(id, PJ_TRUE); - + else { + /* Otherwise subscribe to MWI, if it's enabled */ + if (pjsua_var.acc[id].cfg.mwi_enabled) + pjsua_start_mwi(&pjsua_var.acc[id]); + } return PJ_SUCCESS; } @@ -683,6 +687,19 @@ static pj_bool_t acc_check_nat_addr(pjsua_acc *acc, return PJ_FALSE; } + /* Also don't switch if only the port number part is different, and + * the Via received address is private. + * See http://trac.pjsip.org/repos/ticket/864 + */ + if (acc->cfg.allow_contact_rewrite != 2 && + pj_sockaddr_cmp(&contact_addr, &recv_addr)==0 && + is_private_ip(via_addr)) + { + /* Don't switch */ + pj_pool_release(pool); + return PJ_FALSE; + } + PJ_LOG(3,(THIS_FILE, "IP address change detected for account %d " "(%.*s:%d --> %.*s:%d). Updating registration..", acc->index, @@ -739,16 +756,9 @@ static pj_bool_t acc_check_nat_addr(pjsua_acc *acc, pj_strdup2_with_null(acc->pool, &acc->contact, tmp); } - /* For UDP transport, if STUN is enabled then update the transport's - * published name as well. - */ - if (tp->key.type==PJSIP_TRANSPORT_UDP && - (pjsua_var.ua_cfg.stun_domain.slen != 0 || - pjsua_var.ua_cfg.stun_host.slen != 0)) - { - pj_strdup_with_null(tp->pool, &tp->local_name.host, via_addr); - tp->local_name.port = rport; - } + /* Always update, by http://trac.pjsip.org/repos/ticket/864. */ + pj_strdup_with_null(tp->pool, &tp->local_name.host, via_addr); + tp->local_name.port = rport; /* Perform new registration */ pjsua_acc_set_registration(acc->index, PJ_TRUE); @@ -1056,6 +1066,10 @@ static void regc_cb(struct pjsip_regc_cbparam *param) /* Send initial PUBLISH if it is enabled */ if (acc->cfg.publish_enabled && acc->publish_sess==NULL) pjsua_pres_init_publish_acc(acc->index); + + /* Subscribe to MWI, if it's enabled */ + if (acc->cfg.mwi_enabled) + pjsua_start_mwi(acc); } } else { @@ -1597,7 +1611,17 @@ PJ_DEF(pj_status_t) pjsua_acc_create_request(pjsua_acc_id acc_id, (pjsip_hdr*)pjsip_hdr_clone(tdata->pool, r)); r = r->next; } - + + /* If account is locked to specific transport, then set that transport to + * the transmit data. + */ + if (pjsua_var.acc[acc_id].cfg.transport_id != PJSUA_INVALID_ID) { + pjsip_tpselector tp_sel; + + pjsua_init_tpselector(acc->cfg.transport_id, &tp_sel); + pjsip_tx_data_set_transport(tdata, &tp_sel); + } + /* Done */ *p_tdata = tdata; return PJ_SUCCESS; diff --git a/sflphone-common/libs/pjproject/pjsip/src/pjsua-lib/pjsua_call.c b/sflphone-common/libs/pjproject/pjsip/src/pjsua-lib/pjsua_call.c index 9729899cedb96ab29ff3321499ba64911578fe51..4f882c531c3586c3cd7b3c541405a73305c324cd 100644 --- a/sflphone-common/libs/pjproject/pjsip/src/pjsua-lib/pjsua_call.c +++ b/sflphone-common/libs/pjproject/pjsip/src/pjsua-lib/pjsua_call.c @@ -1,4 +1,4 @@ -/* $Id: pjsua_call.c 2869 2009-08-12 17:53:47Z bennylp $ */ +/* $Id: pjsua_call.c 3013 2009-11-11 00:33:00Z bennylp $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> @@ -133,6 +133,11 @@ pj_status_t pjsua_call_subsys_init(const pjsua_config *cfg) /* Copy config */ pjsua_config_dup(pjsua_var.pool, &pjsua_var.ua_cfg, cfg); + /* Verify settings */ + if (pjsua_var.ua_cfg.max_calls >= PJSUA_MAX_CALLS) { + pjsua_var.ua_cfg.max_calls = PJSUA_MAX_CALLS; + } + /* Check the route URI's and force loose route if required */ for (i=0; i<pjsua_var.ua_cfg.outbound_proxy_cnt; ++i) { status = normalize_route_uri(pjsua_var.pool, @@ -384,13 +389,16 @@ PJ_DEF(pj_status_t) pjsua_call_make_call( pjsua_acc_id acc_id, call_id = alloc_call_id(); if (call_id == PJSUA_INVALID_ID) { - pjsua_perror(THIS_FILE, "Error making file", PJ_ETOOMANY); + pjsua_perror(THIS_FILE, "Error making call", PJ_ETOOMANY); PJSUA_UNLOCK(); return PJ_ETOOMANY; } call = &pjsua_var.calls[call_id]; + /* Associate session with account */ + call->acc_id = acc_id; + /* Create temporary pool */ tmp_pool = pjsua_pool_create("tmpcall10", 512, 256); @@ -499,7 +507,6 @@ PJ_DEF(pj_status_t) pjsua_call_make_call( pjsua_acc_id acc_id, } /* Create and associate our data in the session. */ - call->acc_id = acc_id; call->inv = inv; dlg->mod_data[pjsua_var.mod.id] = call; @@ -645,6 +652,14 @@ pj_bool_t pjsua_call_on_incoming(pjsip_rx_data *rdata) if (dlg || tsx) return PJ_FALSE; + /* Don't want to accept the call if shutdown is in progress */ + if (pjsua_var.thread_quit_flag) { + pjsip_endpt_respond_stateless(pjsua_var.endpt, rdata, + PJSIP_SC_TEMPORARILY_UNAVAILABLE, NULL, + NULL, NULL); + return PJ_TRUE; + } + PJSUA_LOCK(); /* Find free call slot. */ @@ -2821,11 +2836,11 @@ PJ_DEF(pj_status_t) pjsua_call_dump( pjsua_call_id call_id, *p = '\0'; } - /* Get SRTP status */ + /* Get and ICE SRTP status */ pjmedia_transport_info_init(&tp_info); pjmedia_transport_get_info(call->med_tp, &tp_info); if (tp_info.specific_info_cnt > 0) { - int i; + unsigned i; for (i = 0; i < tp_info.specific_info_cnt; ++i) { if (tp_info.spc_info[i].type == PJMEDIA_TRANSPORT_TYPE_SRTP) { @@ -2842,7 +2857,23 @@ PJ_DEF(pj_status_t) pjsua_call_dump( pjsua_call_id call_id, *p++ = '\n'; *p = '\0'; } - break; + } else if (tp_info.spc_info[i].type==PJMEDIA_TRANSPORT_TYPE_ICE) { + const pjmedia_ice_transport_info *ii; + + ii = (const pjmedia_ice_transport_info*) + tp_info.spc_info[i].buffer; + + len = pj_ansi_snprintf(p, end-p, + "%s ICE role: %s, state: %s, comp_cnt: %u", + indent, + pj_ice_sess_role_name(ii->role), + pj_ice_strans_state_name(ii->sess_state), + ii->comp_cnt); + if (len > 0 && len < end-p) { + p += len; + *p++ = '\n'; + *p = '\0'; + } } } } @@ -2942,18 +2973,18 @@ static void pjsua_call_on_state_changed(pjsip_inv_session *inv, ev_state = PJSIP_EVSUB_STATE_ACTIVE; break; + case PJSIP_INV_STATE_CONFIRMED: #if 0 /* We don't need this, as we've terminated the subscription in * CONNECTING state. */ - case PJSIP_INV_STATE_CONFIRMED: /* When state is confirmed, send the final 200/OK and terminate * subscription. */ st_code = e->body.tsx_state.tsx->status_code; ev_state = PJSIP_EVSUB_STATE_TERMINATED; - break; #endif + break; case PJSIP_INV_STATE_DISCONNECTED: st_code = e->body.tsx_state.tsx->status_code; diff --git a/sflphone-common/libs/pjproject/pjsip/src/pjsua-lib/pjsua_core.c b/sflphone-common/libs/pjproject/pjsip/src/pjsua-lib/pjsua_core.c index e8d2fd9767924921ad65ba0e6ce1b62d73a048a1..7974c536c3ccda7bfc49c5906e4356634d1b2f7d 100644 --- a/sflphone-common/libs/pjproject/pjsip/src/pjsua-lib/pjsua_core.c +++ b/sflphone-common/libs/pjproject/pjsip/src/pjsua-lib/pjsua_core.c @@ -1,4 +1,4 @@ -/* $Id: pjsua_core.c 2895 2009-08-17 16:30:04Z nanang $ */ +/* $Id: pjsua_core.c 3021 2009-11-20 23:33:07Z bennylp $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> @@ -101,6 +101,7 @@ PJ_DEF(void) pjsua_config_default(pjsua_config *cfg) cfg->nat_type_in_sdp = 1; cfg->stun_ignore_failure = PJ_TRUE; cfg->force_lr = PJ_TRUE; + cfg->enable_unsolicited_mwi = PJ_TRUE; #if defined(PJMEDIA_HAS_SRTP) && (PJMEDIA_HAS_SRTP != 0) cfg->use_srtp = PJSUA_DEFAULT_USE_SRTP; cfg->srtp_secure_signaling = PJSUA_DEFAULT_SRTP_SECURE_SIGNALING; @@ -161,6 +162,9 @@ PJ_DEF(void) pjsua_acc_config_default(pjsua_acc_config *cfg) pj_bzero(cfg, sizeof(*cfg)); cfg->reg_timeout = PJSUA_REG_INTERVAL; + cfg->unreg_timeout = PJSUA_UNREG_TIMEOUT; + pjsip_publishc_opt_default(&cfg->publish_opt); + cfg->unpublish_max_wait_time_msec = PJSUA_UNPUBLISH_MAX_WAIT_TIME_MSEC; cfg->transport_id = PJSUA_INVALID_ID; cfg->allow_contact_rewrite = PJ_TRUE; cfg->require_100rel = pjsua_var.ua_cfg.require_100rel; @@ -303,6 +307,14 @@ static pj_bool_t options_on_rx_request(pjsip_rx_data *rdata) return PJ_FALSE; } + /* Don't want to handle if shutdown is in progress */ + if (pjsua_var.thread_quit_flag) { + pjsip_endpt_respond_stateless(pjsua_var.endpt, rdata, + PJSIP_SC_TEMPORARILY_UNAVAILABLE, NULL, + NULL, NULL); + return PJ_TRUE; + } + /* Create basic response. */ status = pjsip_endpt_create_response(pjsua_var.endpt, rdata, 200, NULL, &tdata); @@ -809,6 +821,9 @@ PJ_DEF(pj_status_t) pjsua_init( const pjsua_config *ua_cfg, status = pjsip_pres_init_module( pjsua_var.endpt, pjsip_evsub_instance()); PJ_ASSERT_RETURN(status == PJ_SUCCESS, status); + /* Initialize MWI support */ + status = pjsip_mwi_init_module(pjsua_var.endpt, pjsip_evsub_instance()); + /* Init PUBLISH module */ pjsip_publishc_init_module(pjsua_var.endpt); @@ -1227,6 +1242,10 @@ PJ_DEF(pj_status_t) pjsua_destroy(void) } if (pjsua_var.endpt) { + unsigned max_wait; + + PJ_LOG(4,(THIS_FILE, "Shutting down...")); + /* Terminate all calls. */ pjsua_call_hangup_all(); @@ -1241,6 +1260,45 @@ PJ_DEF(pj_status_t) pjsua_destroy(void) /* Terminate all presence subscriptions. */ pjsua_pres_shutdown(); + /* Destroy media (to shutdown media transports etc) */ + pjsua_media_subsys_destroy(); + + /* Wait for sometime until all publish client sessions are done + * (ticket #364) + */ + /* First stage, get the maximum wait time */ + max_wait = 100; + for (i=0; i<PJ_ARRAY_SIZE(pjsua_var.acc); ++i) { + if (!pjsua_var.acc[i].valid) + continue; + if (pjsua_var.acc[i].cfg.unpublish_max_wait_time_msec > max_wait) + max_wait = pjsua_var.acc[i].cfg.unpublish_max_wait_time_msec; + } + + /* Second stage, wait for unpublications to complete */ + for (i=0; i<(int)(max_wait/50); ++i) { + unsigned j; + for (j=0; j<PJ_ARRAY_SIZE(pjsua_var.acc); ++j) { + if (!pjsua_var.acc[j].valid) + continue; + + if (pjsua_var.acc[j].publish_sess) + break; + } + if (j != PJ_ARRAY_SIZE(pjsua_var.acc)) + busy_sleep(50); + else + break; + } + + /* Third stage, forcefully destroy unfinished unpublications */ + for (i=0; i<PJ_ARRAY_SIZE(pjsua_var.acc); ++i) { + if (pjsua_var.acc[i].publish_sess) { + pjsip_publishc_destroy(pjsua_var.acc[i].publish_sess); + pjsua_var.acc[i].publish_sess = NULL; + } + } + /* Unregister all accounts */ for (i=0; i<(int)PJ_ARRAY_SIZE(pjsua_var.acc); ++i) { if (!pjsua_var.acc[i].valid) @@ -1250,10 +1308,6 @@ PJ_DEF(pj_status_t) pjsua_destroy(void) pjsua_acc_set_registration(i, PJ_FALSE); } } - } - - /* Destroy endpoint. */ - if (pjsua_var.endpt) { /* Terminate any pending STUN resolution */ if (!pj_list_empty(&pjsua_var.stun_res)) { @@ -1265,23 +1319,40 @@ PJ_DEF(pj_status_t) pjsua_destroy(void) } } + /* Wait until all unregistrations are done (ticket #364) */ + /* First stage, get the maximum wait time */ + max_wait = 100; + for (i=0; i<PJ_ARRAY_SIZE(pjsua_var.acc); ++i) { + if (!pjsua_var.acc[i].valid) + continue; + if (pjsua_var.acc[i].cfg.unreg_timeout > max_wait) + max_wait = pjsua_var.acc[i].cfg.unreg_timeout; + } + + /* Second stage, wait for unregistrations to complete */ + for (i=0; i<(int)(max_wait/50); ++i) { + unsigned j; + for (j=0; j<PJ_ARRAY_SIZE(pjsua_var.acc); ++j) { + if (!pjsua_var.acc[j].valid) + continue; + + if (pjsua_var.acc[j].regc) + break; + } + if (j != PJ_ARRAY_SIZE(pjsua_var.acc)) + busy_sleep(50); + else + break; + } + /* Note variable 'i' is used below */ + /* Wait for some time to allow unregistration and ICE/TURN * transports shutdown to complete: - */ - PJ_LOG(4,(THIS_FILE, "Shutting down...")); - busy_sleep(1000); - - PJ_LOG(4,(THIS_FILE, "Destroying...")); - - /* Terminate all calls again, just in case there's new call - * picked up during busy_sleep() */ - pjsua_call_hangup_all(); + if (i < 20) + busy_sleep(1000 - i*50); - /* Destroy media after all polling is done, as there may be - * incoming request that needs handling (e.g. OPTIONS) - */ - pjsua_media_subsys_destroy(); + PJ_LOG(4,(THIS_FILE, "Destroying...")); /* Must destroy endpoint first before destroying pools in * buddies or accounts, since shutting down transaction layer @@ -1306,9 +1377,6 @@ PJ_DEF(pj_status_t) pjsua_destroy(void) pjsua_var.acc[i].pool = NULL; } } - } else { - /* Destroy media */ - pjsua_media_subsys_destroy(); } /* Destroy mutex */ @@ -1462,12 +1530,12 @@ static const char *addr_string(const pj_sockaddr_t *addr) * address via STUN, depending on config). */ static pj_status_t create_sip_udp_sock(int af, - const pj_str_t *bind_param, - int port, + const pjsua_transport_config *cfg, pj_sock_t *p_sock, pj_sockaddr *p_pub_addr) { char stun_ip_addr[PJ_INET6_ADDRSTRLEN]; + unsigned port = cfg->port; pj_str_t stun_srv; pj_sock_t sock; pj_sockaddr bind_addr; @@ -1481,8 +1549,8 @@ static pj_status_t create_sip_udp_sock(int af, } /* Initialize bound address */ - if (bind_param->slen) { - status = pj_sockaddr_init(af, &bind_addr, bind_param, + if (cfg->bound_addr.slen) { + status = pj_sockaddr_init(af, &bind_addr, &cfg->bound_addr, (pj_uint16_t)port); if (status != PJ_SUCCESS) { pjsua_perror(THIS_FILE, @@ -1494,12 +1562,19 @@ static pj_status_t create_sip_udp_sock(int af, pj_sockaddr_init(af, &bind_addr, NULL, (pj_uint16_t)port); } + /* Create socket */ status = pj_sock_socket(af, pj_SOCK_DGRAM(), 0, &sock); if (status != PJ_SUCCESS) { pjsua_perror(THIS_FILE, "socket() error", status); return status; } + /* Apply QoS, if specified */ + status = pj_sock_apply_qos2(sock, cfg->qos_type, + &cfg->qos_params, + 2, THIS_FILE, "SIP UDP socket"); + + /* Bind socket */ status = pj_sock_bind(sock, &bind_addr, pj_sockaddr_get_len(&bind_addr)); if (status != PJ_SUCCESS) { pjsua_perror(THIS_FILE, "bind() error", status); @@ -1647,8 +1722,7 @@ PJ_DEF(pj_status_t) pjsua_transport_create( pjsip_transport_type_e type, * (only when public address is not specified). */ status = create_sip_udp_sock(pjsip_transport_type_get_af(type), - &cfg->bound_addr, cfg->port, - &sock, &pub_addr); + cfg, &sock, &pub_addr); if (status != PJ_SUCCESS) goto on_return; @@ -1679,9 +1753,10 @@ PJ_DEF(pj_status_t) pjsua_transport_create( pjsip_transport_type_e type, * Create TCP transport. */ pjsua_transport_config config; - pjsip_host_port a_name; pjsip_tpfactory *tcp; - pj_sockaddr_in local_addr; + pjsip_tcp_transport_cfg tcp_cfg; + + pjsip_tcp_transport_cfg_default(&tcp_cfg, pj_AF_INET()); /* Supply default config if it's not specified */ if (cfg == NULL) { @@ -1689,14 +1764,14 @@ PJ_DEF(pj_status_t) pjsua_transport_create( pjsip_transport_type_e type, cfg = &config; } - /* Init local address */ - pj_sockaddr_in_init(&local_addr, 0, 0); - + /* Configure bind address */ if (cfg->port) - local_addr.sin_port = pj_htons((pj_uint16_t)cfg->port); + pj_sockaddr_set_port(&tcp_cfg.bind_addr, (pj_uint16_t)cfg->port); if (cfg->bound_addr.slen) { - status = pj_sockaddr_in_set_str_addr(&local_addr,&cfg->bound_addr); + status = pj_sockaddr_set_str_addr(tcp_cfg.af, + &tcp_cfg.bind_addr, + &cfg->bound_addr); if (status != PJ_SUCCESS) { pjsua_perror(THIS_FILE, "Unable to resolve transport bound address", @@ -1705,14 +1780,17 @@ PJ_DEF(pj_status_t) pjsua_transport_create( pjsip_transport_type_e type, } } - /* Init published name */ - pj_bzero(&a_name, sizeof(pjsip_host_port)); + /* Set published name */ if (cfg->public_addr.slen) - a_name.host = cfg->public_addr; + tcp_cfg.addr_name.host = cfg->public_addr; + + /* Copy the QoS settings */ + tcp_cfg.qos_type = cfg->qos_type; + pj_memcpy(&tcp_cfg.qos_params, &cfg->qos_params, + sizeof(cfg->qos_params)); /* Create the TCP transport */ - status = pjsip_tcp_transport_start2(pjsua_var.endpt, &local_addr, - &a_name, 1, &tcp); + status = pjsip_tcp_transport_start3(pjsua_var.endpt, &tcp_cfg, &tcp); if (status != PJ_SUCCESS) { pjsua_perror(THIS_FILE, "Error creating SIP TCP listener", @@ -2254,6 +2332,23 @@ PJ_DEF(pj_status_t) pjsua_verify_sip_url(const char *c_url) return p ? 0 : -1; } +/* + * Schedule a timer entry. + */ +PJ_DEF(pj_status_t) pjsua_schedule_timer( pj_timer_entry *entry, + const pj_time_val *delay) +{ + return pjsip_endpt_schedule_timer(pjsua_var.endpt, entry, delay); +} + +/* + * Cancel the previously scheduled timer. + * + */ +PJ_DEF(void) pjsua_cancel_timer(pj_timer_entry *entry) +{ + pjsip_endpt_cancel_timer(pjsua_var.endpt, entry); +} /** * Normalize route URI (check for ";lr" and append one if it doesn't @@ -2314,6 +2409,7 @@ pj_status_t normalize_route_uri(pj_pool_t *pool, pj_str_t *uri) /* Clone the URI */ pj_strdup_with_null(pool, uri, &tmp_uri); + pj_pool_release(tmp_pool); return PJ_SUCCESS; } diff --git a/sflphone-common/libs/pjproject/pjsip/src/pjsua-lib/pjsua_im.c b/sflphone-common/libs/pjproject/pjsip/src/pjsua-lib/pjsua_im.c index 76d57618425f6acb21af0550399cf23bffd709da..9ccf0b02f9cccf54ac219c6d1b3c89e2a1cb8f7b 100644 --- a/sflphone-common/libs/pjproject/pjsip/src/pjsua-lib/pjsua_im.c +++ b/sflphone-common/libs/pjproject/pjsip/src/pjsua-lib/pjsua_im.c @@ -1,4 +1,4 @@ -/* $Id: pjsua_im.c 2855 2009-08-05 18:41:23Z nanang $ */ +/* $Id: pjsua_im.c 2923 2009-10-01 14:17:49Z bennylp $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> @@ -380,6 +380,9 @@ static void im_callback(void *token, pjsip_event *e) /* Must duplicate im_data */ im_data2 = pjsua_im_data_dup(tdata->pool, im_data); + /* Increment CSeq */ + PJSIP_MSG_CSEQ_HDR(tdata->msg)->cseq++; + /* Re-send request */ status = pjsip_endpt_send_request( pjsua_var.endpt, tdata, -1, im_data2, &im_callback); @@ -479,6 +482,9 @@ static void typing_callback(void *token, pjsip_event *e) /* Must duplicate im_data */ im_data2 = pjsua_im_data_dup(tdata->pool, im_data); + /* Increment CSeq */ + PJSIP_MSG_CSEQ_HDR(tdata->msg)->cseq++; + /* Re-send request */ status = pjsip_endpt_send_request( pjsua_var.endpt, tdata, -1, im_data2, &typing_callback); diff --git a/sflphone-common/libs/pjproject/pjsip/src/pjsua-lib/pjsua_media.c b/sflphone-common/libs/pjproject/pjsip/src/pjsua-lib/pjsua_media.c index e3f57bc3b2eac529ed527301f5c89eb18d12a62a..c07cc9a1b0c09b84d96dde48a879405f30ea2ac3 100644 --- a/sflphone-common/libs/pjproject/pjsip/src/pjsua-lib/pjsua_media.c +++ b/sflphone-common/libs/pjproject/pjsip/src/pjsua-lib/pjsua_media.c @@ -1,4 +1,4 @@ -/* $Id: pjsua_media.c 2869 2009-08-12 17:53:47Z bennylp $ */ +/* $Id: pjsua_media.c 3041 2010-01-04 13:08:31Z bennylp $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> @@ -334,9 +334,6 @@ pj_status_t pjsua_media_subsys_init(const pjsua_media_config *cfg) } #endif - /* Perform NAT detection */ - pjsua_detect_nat_type(); - return PJ_SUCCESS; } @@ -384,13 +381,19 @@ static pj_status_t create_rtp_rtcp_sock(const pjsua_transport_config *cfg, /* Loop retry to bind RTP and RTCP sockets. */ for (i=0; i<RTP_RETRY; ++i, next_rtp_port += 2) { - /* Create and bind RTP socket. */ + /* Create RTP socket. */ status = pj_sock_socket(pj_AF_INET(), pj_SOCK_DGRAM(), 0, &sock[0]); if (status != PJ_SUCCESS) { pjsua_perror(THIS_FILE, "socket() error", status); return status; } + /* Apply QoS to RTP socket, if specified */ + status = pj_sock_apply_qos2(sock[0], cfg->qos_type, + &cfg->qos_params, + 2, THIS_FILE, "RTP socket"); + + /* Bind RTP socket */ status=pj_sock_bind_in(sock[0], pj_ntohl(bound_addr.sin_addr.s_addr), next_rtp_port); if (status != PJ_SUCCESS) { @@ -399,7 +402,7 @@ static pj_status_t create_rtp_rtcp_sock(const pjsua_transport_config *cfg, continue; } - /* Create and bind RTCP socket. */ + /* Create RTCP socket. */ status = pj_sock_socket(pj_AF_INET(), pj_SOCK_DGRAM(), 0, &sock[1]); if (status != PJ_SUCCESS) { pjsua_perror(THIS_FILE, "socket() error", status); @@ -407,6 +410,12 @@ static pj_status_t create_rtp_rtcp_sock(const pjsua_transport_config *cfg, return status; } + /* Apply QoS to RTCP socket, if specified */ + status = pj_sock_apply_qos2(sock[1], cfg->qos_type, + &cfg->qos_params, + 2, THIS_FILE, "RTCP socket"); + + /* Bind RTCP socket */ status=pj_sock_bind_in(sock[1], pj_ntohl(bound_addr.sin_addr.s_addr), (pj_uint16_t)(next_rtp_port+1)); if (status != PJ_SUCCESS) { @@ -629,6 +638,9 @@ pj_status_t pjsua_media_subsys_start(void) pj_timer_entry_init(&pjsua_var.snd_idle_timer, PJ_FALSE, NULL, &close_snd_timer_cb); + /* Perform NAT detection */ + pjsua_detect_nat_type(); + return PJ_SUCCESS; } @@ -640,6 +652,8 @@ pj_status_t pjsua_media_subsys_destroy(void) { unsigned i; + PJ_LOG(4,(THIS_FILE, "Shutting down media..")); + close_snd_dev(); if (pjsua_var.mconf) { @@ -819,6 +833,33 @@ static void on_ice_complete(pjmedia_transport *tp, if (pjsua_var.ua_cfg.cb.on_call_media_state) { pjsua_var.ua_cfg.cb.on_call_media_state(id); } + } else { + /* Send UPDATE if default transport address is different than + * what was advertised (ticket #881) + */ + pjmedia_transport_info tpinfo; + pjmedia_ice_transport_info *ii = NULL; + unsigned i; + + pjmedia_transport_info_init(&tpinfo); + pjmedia_transport_get_info(tp, &tpinfo); + for (i=0; i<tpinfo.specific_info_cnt; ++i) { + if (tpinfo.spc_info[i].type==PJMEDIA_TRANSPORT_TYPE_ICE) { + ii = (pjmedia_ice_transport_info*) + tpinfo.spc_info[i].buffer; + break; + } + } + + if (ii && ii->role==PJ_ICE_SESS_ROLE_CONTROLLING && + pj_sockaddr_cmp(&tpinfo.sock_info.rtp_addr_name, + &pjsua_var.calls[id].med_rtp_addr)) + { + PJ_LOG(4,(THIS_FILE, + "ICE default transport address has changed for " + "call %d, sending UPDATE", id)); + pjsua_call_update(id, 0, NULL); + } } break; } @@ -852,7 +893,7 @@ static pj_status_t parse_host_port(const pj_str_t *host_port, } /* Create ICE media transports (when ice is enabled) */ -static pj_status_t create_ice_media_transports(void) +static pj_status_t create_ice_media_transports(pjsua_transport_config *cfg) { char stunip[PJ_INET6_ADDRSTRLEN]; pj_ice_strans_cfg ice_cfg; @@ -886,6 +927,11 @@ static pj_status_t create_ice_media_transports(void) if (pjsua_var.media_cfg.ice_max_host_cands >= 0) ice_cfg.stun.max_host_cands = pjsua_var.media_cfg.ice_max_host_cands; + /* Copy QoS setting to STUN setting */ + ice_cfg.stun.cfg.qos_type = cfg->qos_type; + pj_memcpy(&ice_cfg.stun.cfg.qos_params, &cfg->qos_params, + sizeof(cfg->qos_params)); + /* Configure TURN settings */ if (pjsua_var.media_cfg.enable_turn) { status = parse_host_port(&pjsua_var.media_cfg.turn_server, @@ -901,6 +947,11 @@ static pj_status_t create_ice_media_transports(void) pj_memcpy(&ice_cfg.turn.auth_cred, &pjsua_var.media_cfg.turn_auth_cred, sizeof(ice_cfg.turn.auth_cred)); + + /* Copy QoS setting to TURN setting */ + ice_cfg.turn.cfg.qos_type = cfg->qos_type; + pj_memcpy(&ice_cfg.turn.cfg.qos_params, &cfg->qos_params, + sizeof(cfg->qos_params)); } /* Create each media transport */ @@ -996,7 +1047,7 @@ PJ_DEF(pj_status_t) pjsua_media_transports_create( /* Create the transports */ if (pjsua_var.media_cfg.enable_ice) { - status = create_ice_media_transports(); + status = create_ice_media_transports(&cfg); } else { status = create_udp_media_transports(&cfg); } @@ -1318,6 +1369,10 @@ pj_status_t pjsua_media_channel_create_sdp(pjsua_call_id call_id, return status; } + /* Update currently advertised RTP source address */ + pj_memcpy(&call->med_rtp_addr, &tpinfo.sock_info.rtp_addr_name, + sizeof(pj_sockaddr)); + *p_sdp = sdp; return PJ_SUCCESS; } @@ -1337,8 +1392,9 @@ static void stop_media_session(pjsua_call_id call_id) if (call->session) { pjmedia_rtcp_stat stat; - if (pjmedia_session_get_stream_stat(call->session, 0, &stat) - == PJ_SUCCESS) + if ((call->media_dir & PJMEDIA_DIR_ENCODING) && + (pjmedia_session_get_stream_stat(call->session, 0, &stat) + == PJ_SUCCESS)) { /* Save RTP timestamp & sequence, so when media session is * restarted, those values will be restored as the initial @@ -1480,7 +1536,7 @@ pj_status_t pjsua_media_channel_update(pjsua_call_id call_id, pjmedia_transport_info_init(&tp_info); pjmedia_transport_get_info(call->med_tp, &tp_info); if (tp_info.specific_info_cnt > 0) { - int i; + unsigned i; for (i = 0; i < tp_info.specific_info_cnt; ++i) { if (tp_info.spc_info[i].type == PJMEDIA_TRANSPORT_TYPE_SRTP) { diff --git a/sflphone-common/libs/pjproject/pjsip/src/pjsua-lib/pjsua_pres.c b/sflphone-common/libs/pjproject/pjsip/src/pjsua-lib/pjsua_pres.c index a743cbc53db66d04788c5c85d694acadeb45be2b..0f661da5cdc035f5578ba547b5d97131d72ec49e 100644 --- a/sflphone-common/libs/pjproject/pjsip/src/pjsua-lib/pjsua_pres.c +++ b/sflphone-common/libs/pjproject/pjsip/src/pjsua-lib/pjsua_pres.c @@ -1,4 +1,4 @@ -/* $Id: pjsua_pres.c 2824 2009-06-30 13:53:47Z bennylp $ */ +/* $Id: pjsua_pres.c 3031 2009-12-10 05:16:23Z bennylp $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> @@ -24,13 +24,14 @@ #define THIS_FILE "pjsua_pres.c" -static void subscribe_buddy_presence(unsigned index); +static void subscribe_buddy_presence(pjsua_buddy_id buddy_id); +static void unsubscribe_buddy_presence(pjsua_buddy_id buddy_id); /* * Find buddy. */ -static pjsua_buddy_id pjsua_find_buddy(const pjsip_uri *uri) +static pjsua_buddy_id find_buddy(const pjsip_uri *uri) { const pjsip_sip_uri *sip_uri; unsigned i; @@ -60,6 +61,87 @@ static pjsua_buddy_id pjsua_find_buddy(const pjsip_uri *uri) return PJSUA_INVALID_ID; } +#define LOCK_DIALOG 1 +#define LOCK_PJSUA 2 +#define LOCK_ALL (LOCK_DIALOG | LOCK_PJSUA) + +/* Buddy lock object */ +struct buddy_lock +{ + pjsua_buddy *buddy; + pjsip_dialog *dlg; + pj_uint8_t flag; +}; + +/* Acquire lock to the specified buddy_id */ +pj_status_t lock_buddy(const char *title, + pjsua_buddy_id buddy_id, + struct buddy_lock *lck, + unsigned _unused_) +{ + enum { MAX_RETRY=50 }; + pj_bool_t has_pjsua_lock = PJ_FALSE; + unsigned retry; + + PJ_UNUSED_ARG(_unused_); + + pj_bzero(lck, sizeof(*lck)); + + for (retry=0; retry<MAX_RETRY; ++retry) { + + if (PJSUA_TRY_LOCK() != PJ_SUCCESS) { + pj_thread_sleep(retry/10); + continue; + } + + has_pjsua_lock = PJ_TRUE; + lck->flag = LOCK_PJSUA; + lck->buddy = &pjsua_var.buddy[buddy_id]; + + if (lck->buddy->dlg == NULL) + return PJ_SUCCESS; + + if (pjsip_dlg_try_inc_lock(lck->buddy->dlg) != PJ_SUCCESS) { + lck->flag = 0; + lck->buddy = NULL; + has_pjsua_lock = PJ_FALSE; + PJSUA_UNLOCK(); + pj_thread_sleep(retry/10); + continue; + } + + lck->dlg = lck->buddy->dlg; + lck->flag = LOCK_DIALOG; + PJSUA_UNLOCK(); + + break; + } + + if (lck->flag == 0) { + if (has_pjsua_lock == PJ_FALSE) + PJ_LOG(1,(THIS_FILE, "Timed-out trying to acquire PJSUA mutex " + "(possibly system has deadlocked) in %s", + title)); + else + PJ_LOG(1,(THIS_FILE, "Timed-out trying to acquire dialog mutex " + "(possibly system has deadlocked) in %s", + title)); + return PJ_ETIMEDOUT; + } + + return PJ_SUCCESS; +} + +/* Release buddy lock */ +static void unlock_buddy(struct buddy_lock *lck) +{ + if (lck->flag & LOCK_DIALOG) + pjsip_dlg_dec_lock(lck->dlg); + + if (lck->flag & LOCK_PJSUA) + PJSUA_UNLOCK(); +} + /* * Get total number of buddies. @@ -86,8 +168,11 @@ PJ_DEF(pjsua_buddy_id) pjsua_buddy_find(const pj_str_t *uri_str) uri = pjsip_parse_uri(pool, input.ptr, input.slen, 0); if (!uri) buddy_id = PJSUA_INVALID_ID; - else - buddy_id = pjsua_find_buddy(uri); + else { + PJSUA_LOCK(); + buddy_id = find_buddy(uri); + PJSUA_UNLOCK(); + } pj_pool_release(pool); @@ -139,20 +224,22 @@ PJ_DEF(pj_status_t) pjsua_buddy_get_info( pjsua_buddy_id buddy_id, pjsua_buddy_info *info) { unsigned total=0; + struct buddy_lock lck; pjsua_buddy *buddy; + pj_status_t status; - PJ_ASSERT_RETURN(buddy_id>=0 && - buddy_id<(int)PJ_ARRAY_SIZE(pjsua_var.buddy), - PJ_EINVAL); - - PJSUA_LOCK(); + PJ_ASSERT_RETURN(pjsua_buddy_is_valid(buddy_id), PJ_EINVAL); pj_bzero(info, sizeof(pjsua_buddy_info)); - buddy = &pjsua_var.buddy[buddy_id]; + status = lock_buddy("pjsua_buddy_get_info()", buddy_id, &lck, 0); + if (status != PJ_SUCCESS) + return status; + + buddy = lck.buddy; info->id = buddy->index; if (pjsua_var.buddy[buddy_id].uri.slen == 0) { - PJSUA_UNLOCK(); + unlock_buddy(&lck); return PJ_SUCCESS; } @@ -186,13 +273,19 @@ PJ_DEF(pj_status_t) pjsua_buddy_get_info( pjsua_buddy_id buddy_id, } else { info->status = PJSUA_BUDDY_STATUS_OFFLINE; - info->status_text = pj_str("Offline"); + info->rpid = buddy->status.info[0].rpid; + + if (info->rpid.note.slen) + info->status_text = info->rpid.note; + else + info->status_text = pj_str("Offline"); } /* monitor pres */ info->monitor_pres = buddy->monitor; /* subscription state and termination reason */ + info->sub_term_code = buddy->term_code; if (buddy->sub) { info->sub_state = pjsip_evsub_get_state(buddy->sub); info->sub_state_name = pjsip_evsub_get_state_name(buddy->sub); @@ -218,7 +311,7 @@ PJ_DEF(pj_status_t) pjsua_buddy_get_info( pjsua_buddy_id buddy_id, info->sub_term_reason = pj_str(""); } - PJSUA_UNLOCK(); + unlock_buddy(&lck); return PJ_SUCCESS; } @@ -228,15 +321,18 @@ PJ_DEF(pj_status_t) pjsua_buddy_get_info( pjsua_buddy_id buddy_id, PJ_DEF(pj_status_t) pjsua_buddy_set_user_data( pjsua_buddy_id buddy_id, void *user_data) { - PJ_ASSERT_RETURN(buddy_id>=0 && - buddy_id<(int)PJ_ARRAY_SIZE(pjsua_var.buddy), - PJ_EINVAL); + struct buddy_lock lck; + pj_status_t status; - PJSUA_LOCK(); + PJ_ASSERT_RETURN(pjsua_buddy_is_valid(buddy_id), PJ_EINVAL); + + status = lock_buddy("pjsua_buddy_set_user_data()", buddy_id, &lck, 0); + if (status != PJ_SUCCESS) + return status; pjsua_var.buddy[buddy_id].user_data = user_data; - PJSUA_UNLOCK(); + unlock_buddy(&lck); return PJ_SUCCESS; } @@ -247,17 +343,19 @@ PJ_DEF(pj_status_t) pjsua_buddy_set_user_data( pjsua_buddy_id buddy_id, */ PJ_DEF(void*) pjsua_buddy_get_user_data(pjsua_buddy_id buddy_id) { + struct buddy_lock lck; + pj_status_t status; void *user_data; - PJ_ASSERT_RETURN(buddy_id>=0 && - buddy_id<(int)PJ_ARRAY_SIZE(pjsua_var.buddy), - NULL); + PJ_ASSERT_RETURN(pjsua_buddy_is_valid(buddy_id), NULL); - PJSUA_LOCK(); + status = lock_buddy("pjsua_buddy_get_user_data()", buddy_id, &lck, 0); + if (status != PJ_SUCCESS) + return NULL; user_data = pjsua_var.buddy[buddy_id].user_data; - PJSUA_UNLOCK(); + unlock_buddy(&lck); return user_data; } @@ -382,6 +480,9 @@ PJ_DEF(pj_status_t) pjsua_buddy_add( const pjsua_buddy_config *cfg, */ PJ_DEF(pj_status_t) pjsua_buddy_del(pjsua_buddy_id buddy_id) { + struct buddy_lock lck; + pj_status_t status; + PJ_ASSERT_RETURN(buddy_id>=0 && buddy_id<(int)PJ_ARRAY_SIZE(pjsua_var.buddy), PJ_EINVAL); @@ -390,11 +491,13 @@ PJ_DEF(pj_status_t) pjsua_buddy_del(pjsua_buddy_id buddy_id) return PJ_SUCCESS; } + status = lock_buddy("pjsua_buddy_del()", buddy_id, &lck, 0); + if (status != PJ_SUCCESS) + return status; + /* Unsubscribe presence */ pjsua_buddy_subscribe_pres(buddy_id, PJ_FALSE); - PJSUA_LOCK(); - /* Not interested with further events for this buddy */ if (pjsua_var.buddy[buddy_id].sub) { pjsip_evsub_set_mod_data(pjsua_var.buddy[buddy_id].sub, @@ -405,10 +508,16 @@ PJ_DEF(pj_status_t) pjsua_buddy_del(pjsua_buddy_id buddy_id) pjsua_var.buddy[buddy_id].uri.slen = 0; pjsua_var.buddy_cnt--; + /* Clear timer */ + if (pjsua_var.buddy[buddy_id].timer.id) { + pjsua_cancel_timer(&pjsua_var.buddy[buddy_id].timer); + pjsua_var.buddy[buddy_id].timer.id = PJ_FALSE; + } + /* Reset buddy struct */ reset_buddy(buddy_id); - PJSUA_UNLOCK(); + unlock_buddy(&lck); return PJ_SUCCESS; } @@ -419,21 +528,20 @@ PJ_DEF(pj_status_t) pjsua_buddy_del(pjsua_buddy_id buddy_id) PJ_DEF(pj_status_t) pjsua_buddy_subscribe_pres( pjsua_buddy_id buddy_id, pj_bool_t subscribe) { - pjsua_buddy *buddy; - - PJ_ASSERT_RETURN(buddy_id>=0 && - buddy_id<(int)PJ_ARRAY_SIZE(pjsua_var.buddy), - PJ_EINVAL); + struct buddy_lock lck; + pj_status_t status; - PJSUA_LOCK(); + PJ_ASSERT_RETURN(pjsua_buddy_is_valid(buddy_id), PJ_EINVAL); - buddy = &pjsua_var.buddy[buddy_id]; - buddy->monitor = subscribe; + status = lock_buddy("pjsua_buddy_subscribe_pres()", buddy_id, &lck, 0); + if (status != PJ_SUCCESS) + return status; - PJSUA_UNLOCK(); + lck.buddy->monitor = subscribe; - pjsua_pres_refresh(); + pjsua_buddy_update_pres(buddy_id); + unlock_buddy(&lck); return PJ_SUCCESS; } @@ -443,32 +551,32 @@ PJ_DEF(pj_status_t) pjsua_buddy_subscribe_pres( pjsua_buddy_id buddy_id, */ PJ_DEF(pj_status_t) pjsua_buddy_update_pres(pjsua_buddy_id buddy_id) { - pjsua_buddy *buddy; - - PJ_ASSERT_RETURN(buddy_id>=0 && - buddy_id<(int)PJ_ARRAY_SIZE(pjsua_var.buddy), - PJ_EINVAL); + struct buddy_lock lck; + pj_status_t status; - PJSUA_LOCK(); + PJ_ASSERT_RETURN(pjsua_buddy_is_valid(buddy_id), PJ_EINVAL); - buddy = &pjsua_var.buddy[buddy_id]; + status = lock_buddy("pjsua_buddy_update_pres()", buddy_id, &lck, 0); + if (status != PJ_SUCCESS) + return status; - /* Return error if buddy's presence monitoring is not enabled */ - if (!buddy->monitor) { - PJSUA_UNLOCK(); - return PJ_EINVALIDOP; + /* Is this an unsubscribe request? */ + if (!lck.buddy->monitor) { + unsubscribe_buddy_presence(buddy_id); + unlock_buddy(&lck); + return PJ_SUCCESS; } /* Ignore if presence is already active for the buddy */ - if (buddy->sub) { - PJSUA_UNLOCK(); + if (lck.buddy->sub) { + unlock_buddy(&lck); return PJ_SUCCESS; } /* Initiate presence subscription */ subscribe_buddy_presence(buddy_id); - PJSUA_UNLOCK(); + unlock_buddy(&lck); return PJ_SUCCESS; } @@ -682,6 +790,14 @@ static pj_bool_t pres_on_rx_request(pjsip_rx_data *rdata) /* Incoming SUBSCRIBE: */ + /* Don't want to accept the request if shutdown is in progress */ + if (pjsua_var.thread_quit_flag) { + pjsip_endpt_respond_stateless(pjsua_var.endpt, rdata, + PJSIP_SC_TEMPORARILY_UNAVAILABLE, NULL, + NULL, NULL); + return PJ_TRUE; + } + PJSUA_LOCK(); /* Find which account for the incoming request. */ @@ -797,7 +913,7 @@ static pj_bool_t pres_on_rx_request(pjsip_rx_data *rdata) if (pjsua_var.ua_cfg.cb.on_incoming_subscribe) { pjsua_buddy_id buddy_id; - buddy_id = pjsua_find_buddy(rdata->msg_info.from->uri); + buddy_id = find_buddy(rdata->msg_info.from->uri); (*pjsua_var.ua_cfg.cb.on_incoming_subscribe)(acc_id, uapres, buddy_id, &dlg->remote.info_str, @@ -943,7 +1059,7 @@ PJ_DEF(pj_status_t) pjsua_pres_notify( pjsua_acc_id acc_id, /* Subscribe to buddy's presence if we're not subscribed */ - buddy_id = pjsua_find_buddy(srv_pres->dlg->remote.info->uri); + buddy_id = find_buddy(srv_pres->dlg->remote.info->uri); if (buddy_id != PJSUA_INVALID_ID) { pjsua_buddy *b = &pjsua_var.buddy[buddy_id]; if (b->monitor && b->sub == NULL) { @@ -992,7 +1108,7 @@ static void publish_cb(struct pjsip_publishc_cbparam *param) } } else { - if (param->expiration == -1) { + if (param->expiration < 1) { /* Could happen if server "forgot" to include Expires header * in the response. We will not renew, so destroy the pubc. */ @@ -1073,7 +1189,10 @@ static pj_status_t send_publish(int acc_id, pj_bool_t active) /* Send the PUBLISH request */ status = pjsip_publishc_send(acc->publish_sess, tdata); - if (status != PJ_SUCCESS) { + if (status == PJ_EPENDING) { + PJ_LOG(3,(THIS_FILE, "Previous request is in progress, " + "PUBLISH request is queued")); + } else if (status != PJ_SUCCESS) { pjsua_perror(THIS_FILE, "Error sending PUBLISH request", status); goto on_error; } @@ -1102,7 +1221,8 @@ pj_status_t pjsua_pres_init_publish_acc(int acc_id) if (acc_cfg->publish_enabled) { /* Create client publication */ - status = pjsip_publishc_create(pjsua_var.endpt, 0, acc, &publish_cb, + status = pjsip_publishc_create(pjsua_var.endpt, &acc_cfg->publish_opt, + acc, &publish_cb, &acc->publish_sess); if (status != PJ_SUCCESS) { acc->publish_sess = NULL; @@ -1197,10 +1317,13 @@ void pjsua_pres_delete_acc(int acc_id) if (acc->publish_sess) { acc->online_status = PJ_FALSE; send_publish(acc_id, PJ_FALSE); + /* By ticket #364, don't destroy the session yet (let the callback + destroy it) if (acc->publish_sess) { pjsip_publishc_destroy(acc->publish_sess); acc->publish_sess = NULL; } + */ acc_cfg->publish_enabled = PJ_FALSE; } } @@ -1265,6 +1388,46 @@ void pjsua_pres_update_acc(int acc_id, pj_bool_t force) * Client subscription. */ +static void buddy_timer_cb(pj_timer_heap_t *th, pj_timer_entry *entry) +{ + pjsua_buddy *buddy = (pjsua_buddy*)entry->user_data; + + PJ_UNUSED_ARG(th); + + entry->id = PJ_FALSE; + pjsua_buddy_update_pres(buddy->index); +} + +/* Reschedule subscription refresh timer or terminate the subscription + * refresh timer for the specified buddy. + */ +static void buddy_resubscribe(pjsua_buddy *buddy, pj_bool_t resched, + unsigned msec_interval) +{ + if (buddy->timer.id) { + pjsua_cancel_timer(&buddy->timer); + buddy->timer.id = PJ_FALSE; + } + + if (resched) { + pj_time_val delay; + + PJ_LOG(4,(THIS_FILE, + "Resubscribing buddy id %u in %u ms (reason: %.*s)", + buddy->index, msec_interval, + (int)buddy->term_reason.slen, + buddy->term_reason.ptr)); + + pj_timer_entry_init(&buddy->timer, 0, buddy, &buddy_timer_cb); + delay.sec = 0; + delay.msec = msec_interval; + pj_time_val_normalize(&delay); + + if (pjsua_schedule_timer(&buddy->timer, &delay)==PJ_SUCCESS) + buddy->timer.id = PJ_TRUE; + } +} + /* Callback called when *client* subscription state has changed. */ static void pjsua_evsub_on_state( pjsip_evsub *sub, pjsip_event *event) { @@ -1272,8 +1435,10 @@ static void pjsua_evsub_on_state( pjsip_evsub *sub, pjsip_event *event) PJ_UNUSED_ARG(event); - PJSUA_LOCK(); - + /* Note: #937: no need to acuire PJSUA_LOCK here. Since the buddy has + * a dialog attached to it, lock_buddy() will use the dialog + * lock, which we are currently holding! + */ buddy = (pjsua_buddy*) pjsip_evsub_get_mod_data(sub, pjsua_var.mod.id); if (buddy) { PJ_LOG(4,(THIS_FILE, @@ -1283,6 +1448,8 @@ static void pjsua_evsub_on_state( pjsip_evsub *sub, pjsip_event *event) pjsip_evsub_get_state_name(sub))); if (pjsip_evsub_get_state(sub) == PJSIP_EVSUB_STATE_TERMINATED) { + int resub_delay = -1; + if (buddy->term_reason.ptr == NULL) { buddy->term_reason.ptr = (char*) pj_pool_alloc(buddy->pool, @@ -1291,7 +1458,95 @@ static void pjsua_evsub_on_state( pjsip_evsub *sub, pjsip_event *event) pj_strncpy(&buddy->term_reason, pjsip_evsub_get_termination_reason(sub), PJSUA_BUDDY_SUB_TERM_REASON_LEN); + + buddy->term_code = 200; + + /* Determine whether to resubscribe automatically */ + if (event && event->type==PJSIP_EVENT_TSX_STATE) { + const pjsip_transaction *tsx = event->body.tsx_state.tsx; + if (pjsip_method_cmp(&tsx->method, + &pjsip_subscribe_method)==0) + { + buddy->term_code = tsx->status_code; + switch (tsx->status_code) { + case PJSIP_SC_CALL_TSX_DOES_NOT_EXIST: + /* 481: we refreshed too late? resubscribe + * immediately. + */ + /* But this must only happen when the 481 is received + * on subscription refresh request. We MUST NOT try to + * resubscribe automatically if the 481 is received + * on the initial SUBSCRIBE (if server returns this + * response for some reason). + */ + if (buddy->dlg->remote.contact) + resub_delay = 500; + break; + } + } else if (pjsip_method_cmp(&tsx->method, + &pjsip_notify_method)==0) + { + if (pj_stricmp2(&buddy->term_reason, "deactivated")==0 || + pj_stricmp2(&buddy->term_reason, "timeout")==0) { + /* deactivated: The subscription has been terminated, + * but the subscriber SHOULD retry immediately with + * a new subscription. + */ + /* timeout: The subscription has been terminated + * because it was not refreshed before it expired. + * Clients MAY re-subscribe immediately. The + * "retry-after" parameter has no semantics for + * "timeout". + */ + resub_delay = 500; + } + else if (pj_stricmp2(&buddy->term_reason, "probation")==0|| + pj_stricmp2(&buddy->term_reason, "giveup")==0) { + /* probation: The subscription has been terminated, + * but the client SHOULD retry at some later time. + * If a "retry-after" parameter is also present, the + * client SHOULD wait at least the number of seconds + * specified by that parameter before attempting to re- + * subscribe. + */ + /* giveup: The subscription has been terminated because + * the notifier could not obtain authorization in a + * timely fashion. If a "retry-after" parameter is + * also present, the client SHOULD wait at least the + * number of seconds specified by that parameter before + * attempting to re-subscribe; otherwise, the client + * MAY retry immediately, but will likely get put back + * into pending state. + */ + const pjsip_sub_state_hdr *sub_hdr; + pj_str_t sub_state = { "Subscription-State", 18 }; + const pjsip_msg *msg; + + msg = event->body.tsx_state.src.rdata->msg_info.msg; + sub_hdr = (const pjsip_sub_state_hdr*) + pjsip_msg_find_hdr_by_name(msg, &sub_state, + NULL); + if (sub_hdr && sub_hdr->retry_after > 0) + resub_delay = sub_hdr->retry_after * 1000; + } + + } + } + + /* For other cases of subscription termination, if resubscribe + * timer is not set, schedule with default expiration (plus minus + * some random value, to avoid sending SUBSCRIBEs all at once) + */ + if (resub_delay == -1) { + pj_assert(PJSUA_PRES_TIMER >= 3); + resub_delay = PJSUA_PRES_TIMER*1000 - 2500 + (pj_rand()%5000); + } + + buddy_resubscribe(buddy, PJ_TRUE, resub_delay); + } else { + /* This will clear the last termination code/reason */ + buddy->term_code = 0; buddy->term_reason.slen = 0; } @@ -1303,11 +1558,10 @@ static void pjsua_evsub_on_state( pjsip_evsub *sub, pjsip_event *event) if (pjsip_evsub_get_state(sub) == PJSIP_EVSUB_STATE_TERMINATED) { buddy->sub = NULL; buddy->status.info_cnt = 0; + buddy->dlg = NULL; pjsip_evsub_set_mod_data(sub, pjsua_var.mod.id, NULL); } } - - PJSUA_UNLOCK(); } @@ -1319,11 +1573,12 @@ static void pjsua_evsub_on_tsx_state(pjsip_evsub *sub, pjsua_buddy *buddy; pjsip_contact_hdr *contact_hdr; - PJSUA_LOCK(); - + /* Note: #937: no need to acuire PJSUA_LOCK here. Since the buddy has + * a dialog attached to it, lock_buddy() will use the dialog + * lock, which we are currently holding! + */ buddy = (pjsua_buddy*) pjsip_evsub_get_mod_data(sub, pjsua_var.mod.id); if (!buddy) { - PJSUA_UNLOCK(); return; } @@ -1332,7 +1587,6 @@ static void pjsua_evsub_on_tsx_state(pjsip_evsub *sub, */ if (buddy->contact.slen != 0) { /* Contact already set */ - PJSUA_UNLOCK(); return; } @@ -1342,7 +1596,6 @@ static void pjsua_evsub_on_tsx_state(pjsip_evsub *sub, event->type != PJSIP_EVENT_RX_MSG || pjsip_method_cmp(&tsx->method, pjsip_get_subscribe_method())!=0) { - PJSUA_UNLOCK(); return; } @@ -1351,7 +1604,6 @@ static void pjsua_evsub_on_tsx_state(pjsip_evsub *sub, pjsip_msg_find_hdr(event->body.rx_msg.rdata->msg_info.msg, PJSIP_H_CONTACT, NULL); if (!contact_hdr) { - PJSUA_UNLOCK(); return; } @@ -1363,8 +1615,6 @@ static void pjsua_evsub_on_tsx_state(pjsip_evsub *sub, PJSIP_MAX_URL_SIZE); if (buddy->contact.slen < 0) buddy->contact.slen = 0; - - PJSUA_UNLOCK(); } @@ -1378,8 +1628,10 @@ static void pjsua_evsub_on_rx_notify(pjsip_evsub *sub, { pjsua_buddy *buddy; - PJSUA_LOCK(); - + /* Note: #937: no need to acuire PJSUA_LOCK here. Since the buddy has + * a dialog attached to it, lock_buddy() will use the dialog + * lock, which we are currently holding! + */ buddy = (pjsua_buddy*) pjsip_evsub_get_mod_data(sub, pjsua_var.mod.id); if (buddy) { /* Update our info. */ @@ -1394,8 +1646,6 @@ static void pjsua_evsub_on_rx_notify(pjsip_evsub *sub, PJ_UNUSED_ARG(p_st_text); PJ_UNUSED_ARG(res_hdr); PJ_UNUSED_ARG(p_body); - - PJSUA_UNLOCK(); } @@ -1421,7 +1671,7 @@ static pjsip_evsub_user pres_callback = /* It does what it says.. */ -static void subscribe_buddy_presence(unsigned index) +static void subscribe_buddy_presence(pjsua_buddy_id buddy_id) { pj_pool_t *tmp_pool = NULL; pjsua_buddy *buddy; @@ -1431,13 +1681,13 @@ static void subscribe_buddy_presence(unsigned index) pjsip_tx_data *tdata; pj_status_t status; - buddy = &pjsua_var.buddy[index]; + buddy = &pjsua_var.buddy[buddy_id]; acc_id = pjsua_acc_find_for_outgoing(&buddy->uri); acc = &pjsua_var.acc[acc_id]; PJ_LOG(4,(THIS_FILE, "Using account %d for buddy %d subscription", - acc_id, index)); + acc_id, buddy_id)); /* Generate suitable Contact header unless one is already set in * the account @@ -1478,13 +1728,13 @@ static void subscribe_buddy_presence(unsigned index) status = pjsip_pres_create_uac( buddy->dlg, &pres_callback, PJSIP_EVSUB_NO_EVENT_ID, &buddy->sub); if (status != PJ_SUCCESS) { - pjsua_var.buddy[index].sub = NULL; + buddy->sub = NULL; pjsua_perror(THIS_FILE, "Unable to create presence client", status); /* This should destroy the dialog since there's no session * referencing it */ - pjsip_dlg_dec_lock(buddy->dlg); + if (buddy->dlg) pjsip_dlg_dec_lock(buddy->dlg); if (tmp_pool) pj_pool_release(tmp_pool); return; } @@ -1517,7 +1767,7 @@ static void subscribe_buddy_presence(unsigned index) status = pjsip_pres_initiate(buddy->sub, -1, &tdata); if (status != PJ_SUCCESS) { - pjsip_dlg_dec_lock(buddy->dlg); + if (buddy->dlg) pjsip_dlg_dec_lock(buddy->dlg); if (buddy->sub) { pjsip_pres_terminate(buddy->sub, PJ_FALSE); } @@ -1532,7 +1782,7 @@ static void subscribe_buddy_presence(unsigned index) status = pjsip_pres_send_request(buddy->sub, tdata); if (status != PJ_SUCCESS) { - pjsip_dlg_dec_lock(buddy->dlg); + if (buddy->dlg) pjsip_dlg_dec_lock(buddy->dlg); if (buddy->sub) { pjsip_pres_terminate(buddy->sub, PJ_FALSE); } @@ -1549,19 +1799,19 @@ static void subscribe_buddy_presence(unsigned index) /* It does what it says... */ -static void unsubscribe_buddy_presence(unsigned index) +static void unsubscribe_buddy_presence(pjsua_buddy_id buddy_id) { pjsua_buddy *buddy; pjsip_tx_data *tdata; pj_status_t status; - buddy = &pjsua_var.buddy[index]; + buddy = &pjsua_var.buddy[buddy_id]; if (buddy->sub == NULL) return; if (pjsip_evsub_get_state(buddy->sub) == PJSIP_EVSUB_STATE_TERMINATED) { - pjsua_var.buddy[index].sub = NULL; + buddy->sub = NULL; return; } @@ -1579,39 +1829,22 @@ static void unsubscribe_buddy_presence(unsigned index) } } - -/* Lock all buddies */ -#define LOCK_BUDDIES unsigned cnt_ = 0; \ - pjsip_dialog *dlg_list_[PJSUA_MAX_BUDDIES]; \ - unsigned i_; \ - for (i_=0; i_<PJ_ARRAY_SIZE(pjsua_var.buddy);++i_) { \ - if (pjsua_var.buddy[i_].sub) { \ - dlg_list_[cnt_++] = pjsua_var.buddy[i_].dlg; \ - pjsip_dlg_inc_lock(pjsua_var.buddy[i_].dlg); \ - } \ - } \ - PJSUA_LOCK(); - -/* Unlock all buddies */ -#define UNLOCK_BUDDIES PJSUA_UNLOCK(); \ - for (i_=0; i_<cnt_; ++i_) { \ - pjsip_dlg_dec_lock(dlg_list_[i_]); \ - } - - - /* It does what it says.. */ -static void refresh_client_subscriptions(void) +static pj_status_t refresh_client_subscriptions(void) { unsigned i; - - LOCK_BUDDIES; + pj_status_t status; for (i=0; i<PJ_ARRAY_SIZE(pjsua_var.buddy); ++i) { + struct buddy_lock lck; - if (!pjsua_var.buddy[i].uri.slen) + if (!pjsua_buddy_is_valid(i)) continue; + status = lock_buddy("refresh_client_subscriptions()", i, &lck, 0); + if (status != PJ_SUCCESS) + return status; + if (pjsua_var.buddy[i].monitor && !pjsua_var.buddy[i].sub) { subscribe_buddy_presence(i); @@ -1619,11 +1852,318 @@ static void refresh_client_subscriptions(void) unsubscribe_buddy_presence(i); } + + unlock_buddy(&lck); + } + + return PJ_SUCCESS; +} + +/*************************************************************************** + * MWI + */ +/* Callback called when *client* subscription state has changed. */ +static void mwi_evsub_on_state( pjsip_evsub *sub, pjsip_event *event) +{ + pjsua_acc *acc; + + PJ_UNUSED_ARG(event); + + /* Note: #937: no need to acuire PJSUA_LOCK here. Since the buddy has + * a dialog attached to it, lock_buddy() will use the dialog + * lock, which we are currently holding! + */ + acc = (pjsua_acc*) pjsip_evsub_get_mod_data(sub, pjsua_var.mod.id); + if (!acc) + return; + + PJ_LOG(4,(THIS_FILE, + "MWI subscription for %.*s is %s", + (int)acc->cfg.id.slen, acc->cfg.id.ptr, + pjsip_evsub_get_state_name(sub))); + + if (pjsip_evsub_get_state(sub) == PJSIP_EVSUB_STATE_TERMINATED) { + /* Clear subscription */ + acc->mwi_dlg = NULL; + acc->mwi_sub = NULL; + pjsip_evsub_set_mod_data(sub, pjsua_var.mod.id, NULL); + + } +} + +/* Callback called when we receive NOTIFY */ +static void mwi_evsub_on_rx_notify(pjsip_evsub *sub, + pjsip_rx_data *rdata, + int *p_st_code, + pj_str_t **p_st_text, + pjsip_hdr *res_hdr, + pjsip_msg_body **p_body) +{ + pjsua_mwi_info mwi_info; + pjsua_acc *acc; + + PJ_UNUSED_ARG(p_st_code); + PJ_UNUSED_ARG(p_st_text); + PJ_UNUSED_ARG(res_hdr); + PJ_UNUSED_ARG(p_body); + + acc = (pjsua_acc*) pjsip_evsub_get_mod_data(sub, pjsua_var.mod.id); + if (!acc) + return; + + /* Construct mwi_info */ + pj_bzero(&mwi_info, sizeof(mwi_info)); + mwi_info.evsub = sub; + mwi_info.rdata = rdata; + + /* Call callback */ + if (pjsua_var.ua_cfg.cb.on_mwi_info) { + (*pjsua_var.ua_cfg.cb.on_mwi_info)(acc->index, &mwi_info); + } +} + + +/* Event subscription callback. */ +static pjsip_evsub_user mwi_cb = +{ + &mwi_evsub_on_state, + NULL, /* on_tsx_state: not interested */ + NULL, /* on_rx_refresh: don't care about SUBSCRIBE refresh, unless + * we want to authenticate + */ + + &mwi_evsub_on_rx_notify, + + NULL, /* on_client_refresh: Use default behaviour, which is to + * refresh client subscription. */ + + NULL, /* on_server_timeout: Use default behaviour, which is to send + * NOTIFY to terminate. + */ +}; + +void pjsua_start_mwi(pjsua_acc *acc) +{ + pj_pool_t *tmp_pool = NULL; + pj_str_t contact; + pjsip_tx_data *tdata; + pj_status_t status; + + if (!acc->cfg.mwi_enabled) { + if (acc->mwi_sub) { + /* Terminate MWI subscription */ + pjsip_tx_data *tdata; + pjsip_evsub *sub = acc->mwi_sub; + + /* Detach sub from this account */ + acc->mwi_sub = NULL; + acc->mwi_dlg = NULL; + pjsip_evsub_set_mod_data(sub, pjsua_var.mod.id, NULL); + + /* Unsubscribe */ + status = pjsip_mwi_initiate(acc->mwi_sub, 0, &tdata); + if (status == PJ_SUCCESS) { + status = pjsip_mwi_send_request(acc->mwi_sub, tdata); + } + } + return; + } + + if (acc->mwi_sub) { + /* Subscription is already active */ + return; + } - UNLOCK_BUDDIES; + /* Generate suitable Contact header unless one is already set in + * the account + */ + if (acc->contact.slen) { + contact = acc->contact; + } else { + tmp_pool = pjsua_pool_create("tmpmwi", 512, 256); + status = pjsua_acc_create_uac_contact(tmp_pool, &contact, + acc->index, &acc->cfg.id); + if (status != PJ_SUCCESS) { + pjsua_perror(THIS_FILE, "Unable to generate Contact header", + status); + pj_pool_release(tmp_pool); + return; + } + } + + /* Create UAC dialog */ + status = pjsip_dlg_create_uac( pjsip_ua_instance(), + &acc->cfg.id, + &contact, + &acc->cfg.id, + NULL, &acc->mwi_dlg); + if (status != PJ_SUCCESS) { + pjsua_perror(THIS_FILE, "Unable to create dialog", status); + if (tmp_pool) pj_pool_release(tmp_pool); + return; + } + + /* Increment the dialog's lock otherwise when presence session creation + * fails the dialog will be destroyed prematurely. + */ + pjsip_dlg_inc_lock(acc->mwi_dlg); + + /* Create UAC subscription */ + status = pjsip_mwi_create_uac(acc->mwi_dlg, &mwi_cb, + PJSIP_EVSUB_NO_EVENT_ID, &acc->mwi_sub); + if (status != PJ_SUCCESS) { + pjsua_perror(THIS_FILE, "Error creating MWI subscription", status); + if (tmp_pool) pj_pool_release(tmp_pool); + if (acc->mwi_dlg) pjsip_dlg_dec_lock(acc->mwi_dlg); + return; + } + + /* If account is locked to specific transport, then lock dialog + * to this transport too. + */ + if (acc->cfg.transport_id != PJSUA_INVALID_ID) { + pjsip_tpselector tp_sel; + + pjsua_init_tpselector(acc->cfg.transport_id, &tp_sel); + pjsip_dlg_set_transport(acc->mwi_dlg, &tp_sel); + } + + /* Set route-set */ + if (!pj_list_empty(&acc->route_set)) { + pjsip_dlg_set_route_set(acc->mwi_dlg, &acc->route_set); + } + + /* Set credentials */ + if (acc->cred_cnt) { + pjsip_auth_clt_set_credentials( &acc->mwi_dlg->auth_sess, + acc->cred_cnt, acc->cred); + } + + /* Set authentication preference */ + pjsip_auth_clt_set_prefs(&acc->mwi_dlg->auth_sess, &acc->cfg.auth_pref); + + pjsip_evsub_set_mod_data(acc->mwi_sub, pjsua_var.mod.id, acc); + + status = pjsip_mwi_initiate(acc->mwi_sub, -1, &tdata); + if (status != PJ_SUCCESS) { + if (acc->mwi_dlg) pjsip_dlg_dec_lock(acc->mwi_dlg); + if (acc->mwi_sub) { + pjsip_pres_terminate(acc->mwi_sub, PJ_FALSE); + } + acc->mwi_sub = NULL; + acc->mwi_dlg = NULL; + pjsua_perror(THIS_FILE, "Unable to create initial MWI SUBSCRIBE", + status); + if (tmp_pool) pj_pool_release(tmp_pool); + return; + } + + pjsua_process_msg_data(tdata, NULL); + + status = pjsip_pres_send_request(acc->mwi_sub, tdata); + if (status != PJ_SUCCESS) { + if (acc->mwi_dlg) pjsip_dlg_dec_lock(acc->mwi_dlg); + if (acc->mwi_sub) { + pjsip_pres_terminate(acc->mwi_sub, PJ_FALSE); + } + acc->mwi_sub = NULL; + acc->mwi_dlg = NULL; + pjsua_perror(THIS_FILE, "Unable to send initial MWI SUBSCRIBE", + status); + if (tmp_pool) pj_pool_release(tmp_pool); + return; + } + + pjsip_dlg_dec_lock(acc->mwi_dlg); + if (tmp_pool) pj_pool_release(tmp_pool); + +} + + +/*************************************************************************** + * Unsolicited MWI + */ +static pj_bool_t unsolicited_mwi_on_rx_request(pjsip_rx_data *rdata) +{ + pjsip_msg *msg = rdata->msg_info.msg; + pj_str_t EVENT_HDR = { "Event", 5 }; + pj_str_t MWI = { "message-summary", 15 }; + pjsip_event_hdr *eh; + + if (pjsip_method_cmp(&msg->line.req.method, &pjsip_notify_method)!=0) { + /* Only interested with NOTIFY request */ + return PJ_FALSE; + } + + eh = (pjsip_event_hdr*) pjsip_msg_find_hdr_by_name(msg, &EVENT_HDR, NULL); + if (!eh) { + /* Something wrong with the request, it has no Event hdr */ + return PJ_FALSE; + } + + if (pj_stricmp(&eh->event_type, &MWI) != 0) { + /* Not MWI event */ + return PJ_FALSE; + } + + /* Got unsolicited MWI request, respond with 200/OK first */ + pjsip_endpt_respond(pjsua_get_pjsip_endpt(), NULL, rdata, 200, NULL, + NULL, NULL, NULL); + + + /* Call callback */ + if (pjsua_var.ua_cfg.cb.on_mwi_info) { + pjsua_acc_id acc_id; + pjsua_mwi_info mwi_info; + + acc_id = pjsua_acc_find_for_incoming(rdata); + + pj_bzero(&mwi_info, sizeof(mwi_info)); + mwi_info.rdata = rdata; + + (*pjsua_var.ua_cfg.cb.on_mwi_info)(acc_id, &mwi_info); + } + + + return PJ_TRUE; +} + +/* The module instance. */ +static pjsip_module pjsua_unsolicited_mwi_mod = +{ + NULL, NULL, /* prev, next. */ + { "mod-unsolicited-mwi", 19 }, /* Name. */ + -1, /* Id */ + PJSIP_MOD_PRIORITY_APPLICATION, /* Priority */ + NULL, /* load() */ + NULL, /* start() */ + NULL, /* stop() */ + NULL, /* unload() */ + &unsolicited_mwi_on_rx_request, /* on_rx_request() */ + NULL, /* on_rx_response() */ + NULL, /* on_tx_request. */ + NULL, /* on_tx_response() */ + NULL, /* on_tsx_state() */ +}; + +static pj_status_t enable_unsolicited_mwi(void) +{ + pj_status_t status; + + status = pjsip_endpt_register_module(pjsua_get_pjsip_endpt(), + &pjsua_unsolicited_mwi_mod); + if (status != PJ_SUCCESS) + pjsua_perror(THIS_FILE, "Error registering unsolicited MWI module", + status); + + return status; } + + +/***************************************************************************/ + /* Timer callback to re-create client subscription */ static void pres_timer_cb(pj_timer_heap_t *th, pj_timer_entry *entry) @@ -1631,15 +2171,25 @@ static void pres_timer_cb(pj_timer_heap_t *th, unsigned i; pj_time_val delay = { PJSUA_PRES_TIMER, 0 }; - /* Retry failed PUBLISH requests */ + entry->id = PJ_FALSE; + + /* Retry failed PUBLISH and MWI SUBSCRIBE requests */ for (i=0; i<PJ_ARRAY_SIZE(pjsua_var.acc); ++i) { pjsua_acc *acc = &pjsua_var.acc[i]; + + /* Retry PUBLISH */ if (acc->cfg.publish_enabled && acc->publish_sess==NULL) pjsua_pres_init_publish_acc(acc->index); + + /* Re-subscribe MWI subscription if it's terminated prematurely */ + if (acc->cfg.mwi_enabled && !acc->mwi_sub) + pjsua_start_mwi(acc); } - entry->id = PJ_FALSE; - refresh_client_subscriptions(); + /* #937: No need to do bulk client refresh, as buddies have their + * own individual timer now. + */ + //refresh_client_subscriptions(); pjsip_endpt_schedule_timer(pjsua_var.endpt, entry, &delay); entry->id = PJ_TRUE; @@ -1687,23 +2237,13 @@ pj_status_t pjsua_pres_start(void) pjsua_var.pres_timer.id = PJ_TRUE; } - return PJ_SUCCESS; -} - - -/* - * Refresh presence subscriptions - */ -void pjsua_pres_refresh() -{ - unsigned i; - - refresh_client_subscriptions(); - - for (i=0; i<PJ_ARRAY_SIZE(pjsua_var.acc); ++i) { - if (pjsua_var.acc[i].valid) - pjsua_pres_update_acc(i, PJ_FALSE); + if (pjsua_var.ua_cfg.enable_unsolicited_mwi) { + pj_status_t status = enable_unsolicited_mwi(); + if (status != PJ_SUCCESS) + return status; } + + return PJ_SUCCESS; } @@ -1714,6 +2254,8 @@ void pjsua_pres_shutdown(void) { unsigned i; + PJ_LOG(4,(THIS_FILE, "Shutting down presence..")); + if (pjsua_var.pres_timer.id != 0) { pjsip_endpt_cancel_timer(pjsua_var.endpt, &pjsua_var.pres_timer); pjsua_var.pres_timer.id = PJ_FALSE; @@ -1729,5 +2271,10 @@ void pjsua_pres_shutdown(void) pjsua_var.buddy[i].monitor = 0; } - pjsua_pres_refresh(); + refresh_client_subscriptions(); + + for (i=0; i<PJ_ARRAY_SIZE(pjsua_var.acc); ++i) { + if (pjsua_var.acc[i].valid) + pjsua_pres_update_acc(i, PJ_FALSE); + } } diff --git a/sflphone-common/libs/pjproject/tests/pjsua/scripts-sendto/126_sdp_with_port_0_and_no_rtpmap_for_dynamic_pt.py b/sflphone-common/libs/pjproject/tests/pjsua/scripts-sendto/126_sdp_with_port_0_and_no_rtpmap_for_dynamic_pt.py new file mode 100644 index 0000000000000000000000000000000000000000..22e2b0f1a9a95658f2ffeb260a3c70dc7b3f04a6 --- /dev/null +++ b/sflphone-common/libs/pjproject/tests/pjsua/scripts-sendto/126_sdp_with_port_0_and_no_rtpmap_for_dynamic_pt.py @@ -0,0 +1,26 @@ +# $Id: 126_sdp_with_port_0_and_no_rtpmap_for_dynamic_pt.py 3011 2009-11-10 10:58:20Z nanang $ +import inc_sip as sip +import inc_sdp as sdp + +sdp = \ +""" +v=0 +o=- 0 0 IN IP4 127.0.0.1 +s=- +c=IN IP4 127.0.0.1 +t=0 0 +m=video 0 RTP/AVP 100 +m=audio 5000 RTP/AVP 0 +""" + +pjsua_args = "--null-audio --auto-answer 200" +extra_headers = "" +include = ["Content-Type: application/sdp", # response must include SDP + "m=video 0 RTP/AVP[\\s\\S]+m=audio [1-9]+[0-9]* RTP/AVP" + ] +exclude = [] + +sendto_cfg = sip.SendtoCfg("SDP media with port 0 and no rtpmap for dynamic PT", pjsua_args, sdp, 200, + extra_headers=extra_headers, + resp_inc=include, resp_exc=exclude) + diff --git a/sflphone-common/libs/pjproject/tests/pjsua/scripts-sipp/uac-bad-ack.xml b/sflphone-common/libs/pjproject/tests/pjsua/scripts-sipp/uac-bad-ack.xml new file mode 100644 index 0000000000000000000000000000000000000000..d93e30c51d6e33f7f583febab54c2045f62deac3 --- /dev/null +++ b/sflphone-common/libs/pjproject/tests/pjsua/scripts-sipp/uac-bad-ack.xml @@ -0,0 +1,132 @@ +<?xml version="1.0" encoding="ISO-8859-1" ?> +<!DOCTYPE scenario SYSTEM "sipp.dtd"> + +<!-- This program is free software; you can redistribute it and/or --> +<!-- modify it under the terms of the GNU General Public License as --> +<!-- published by the Free Software Foundation; either version 2 of the --> +<!-- License, or (at your option) any later version. --> +<!-- --> +<!-- This program is distributed in the hope that it will be useful, --> +<!-- but WITHOUT ANY WARRANTY; without even the implied warranty of --> +<!-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --> +<!-- GNU General Public License for more details. --> +<!-- --> +<!-- You should have received a copy of the GNU General Public License --> +<!-- along with this program; if not, write to the --> +<!-- Free Software Foundation, Inc., --> +<!-- 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA --> +<!-- --> +<!-- --> + +<scenario name="UAC with bad ACK"> + <!-- UAC with bad ACK causes assertion with pjsip 1.4 --> + <send retrans="500"> + <![CDATA[ + + INVITE sip:[service]@[remote_ip]:[remote_port] SIP/2.0 + Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch] + From: sipp <sip:sipp@[local_ip]:[local_port]>;tag=[call_number] + To: sut <sip:[service]@[remote_ip]:[remote_port]> + Call-ID: [call_id] + CSeq: 1 INVITE + Contact: sip:sipp@[local_ip]:[local_port] + Max-Forwards: 70 + Subject: Performance Test + Content-Type: application/sdp + Content-Length: [len] + + v=0 + o=user1 53655765 2353687637 IN IP[local_ip_type] [local_ip] + s=- + c=IN IP[media_ip_type] [media_ip] + t=0 0 + m=audio [media_port] RTP/AVP 0 + a=rtpmap:0 PCMU/8000 + + ]]> + </send> + + <recv response="100" + optional="true"> + </recv> + + <recv response="180" optional="true"> + </recv> + + <!-- By adding rrs="true" (Record Route Sets), the route sets --> + <!-- are saved and used for following messages sent. Useful to test --> + <!-- against stateful SIP proxies/B2BUAs. --> + <recv response="200" rtd="true"> + </recv> + + <!-- Packet lost can be simulated in any send/recv message by --> + <!-- by adding the 'lost = "10"'. Value can be [1-100] percent. --> + <send> + <![CDATA[ + + ACK sip:[service]@[remote_ip]:[remote_port] SIP/2.0 + Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch] + From: sipp <sip:sipp@[local_ip]:[local_port]>;tag=[call_number] + To: sut <sip:[service]@[remote_ip]:[remote_port]>[peer_tag_param] + Call-ID: [call_id] + CSeq: 1 ACK + Contact: sip:sipp@[local_ip]:[local_port] + Max-Forwards: 70 + Subject: Performance Test + Content-Length: 0 + + ]]> + </send> + + <!-- This delay can be customized by the -d command-line option --> + <!-- or by adding a 'milliseconds = "value"' option here. --> + <pause/> + + <!-- The 'crlf' option inserts a blank line in the statistics report. --> + <send retrans="500"> + <![CDATA[ + + BYE sip:[service]@[remote_ip]:[remote_port] SIP/2.0 + Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=z9hG4bK-1 + From: sipp <sip:sipp@[local_ip]:[local_port]>;tag=[call_number] + To: sut <sip:[service]@[remote_ip]:[remote_port]>[peer_tag_param] + Call-ID: [call_id] + CSeq: 2 BYE + Contact: sip:sipp@[local_ip]:[local_port] + Max-Forwards: 70 + Subject: Performance Test + Content-Length: 0 + + ]]> + </send> + + <recv response="200" crlf="true"> + </recv> + + <pause milliseconds="2000"/> + + <send> + <![CDATA[ + + ACK sip:[service]@[remote_ip]:[remote_port] SIP/2.0 + Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=z9hG4bK-1 + From: sipp <sip:sipp@[local_ip]:[local_port]>;tag=[call_number] + To: sut <sip:[service]@[remote_ip]:[remote_port]>[peer_tag_param] + Call-ID: [call_id] + CSeq: 2 BYE + Contact: sip:sipp@[local_ip]:[local_port] + Max-Forwards: 70 + Subject: Performance Test + Content-Length: 0 + + ]]> + </send> + + <!-- definition of the response time repartition table (unit is ms) --> + <ResponseTimeRepartition value="10, 20, 30, 40, 50, 100, 150, 200"/> + + <!-- definition of the call length repartition table (unit is ms) --> + <CallLengthRepartition value="10, 50, 100, 500, 1000, 5000, 10000"/> + +</scenario> + diff --git a/sflphone-common/libs/pjproject/tests/pjsua/scripts-sipp/uac-inv-multiple-require.xml b/sflphone-common/libs/pjproject/tests/pjsua/scripts-sipp/uac-inv-multiple-require.xml new file mode 100644 index 0000000000000000000000000000000000000000..b0790f6ef7dc912b6dcb1a8551ad8ad62d125ef0 --- /dev/null +++ b/sflphone-common/libs/pjproject/tests/pjsua/scripts-sipp/uac-inv-multiple-require.xml @@ -0,0 +1,91 @@ +<?xml version="1.0" encoding="ISO-8859-1" ?> +<!DOCTYPE scenario SYSTEM "sipp.dtd"> + + +<scenario name="Multiple Require header fields"> + <!-- UAC with bad ACK causes assertion with pjsip 1.4 --> + <send retrans="500"> + <![CDATA[ + + INVITE sip:[service]@[remote_ip]:[remote_port] SIP/2.0 + Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch] + From: sipp <sip:sipp@[local_ip]:[local_port]>;tag=[call_number] + To: sut <sip:[service]@[remote_ip]:[remote_port]> + Call-ID: [call_id] + CSeq: 1 INVITE + Contact: sip:sipp@[local_ip]:[local_port] + Max-Forwards: 70 + Require: timer + Require: toto + Subject: Performance Test + Content-Type: application/sdp + Content-Length: [len] + + v=0 + o=user1 53655765 2353687637 IN IP[local_ip_type] [local_ip] + s=- + c=IN IP[media_ip_type] [media_ip] + t=0 0 + m=audio [media_port] RTP/AVP 0 + a=rtpmap:0 PCMU/8000 + + ]]> + </send> + + <recv response="100" + optional="true"> + </recv> + + <recv response="180" optional="true"> + </recv> + + <recv response="200" rtd="true"> + </recv> + + <send> + <![CDATA[ + + ACK sip:[service]@[remote_ip]:[remote_port] SIP/2.0 + Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch] + From: sipp <sip:sipp@[local_ip]:[local_port]>;tag=[call_number] + To: sut <sip:[service]@[remote_ip]:[remote_port]>[peer_tag_param] + Call-ID: [call_id] + CSeq: 1 ACK + Contact: sip:sipp@[local_ip]:[local_port] + Max-Forwards: 70 + Subject: Performance Test + Content-Length: 0 + + ]]> + </send> + + <pause/> + + <send retrans="500"> + <![CDATA[ + + BYE sip:[service]@[remote_ip]:[remote_port] SIP/2.0 + Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=z9hG4bK-1 + From: sipp <sip:sipp@[local_ip]:[local_port]>;tag=[call_number] + To: sut <sip:[service]@[remote_ip]:[remote_port]>[peer_tag_param] + Call-ID: [call_id] + CSeq: 2 BYE + Contact: sip:sipp@[local_ip]:[local_port] + Max-Forwards: 70 + Subject: Performance Test + Content-Length: 0 + + ]]> + </send> + + <recv response="200" crlf="true"> + </recv> + + <!-- definition of the response time repartition table (unit is ms) --> + <ResponseTimeRepartition value="10, 20, 30, 40, 50, 100, 150, 200"/> + + <!-- definition of the call length repartition table (unit is ms) --> + <CallLengthRepartition value="10, 50, 100, 500, 1000, 5000, 10000"/> + +</scenario> + diff --git a/sflphone-common/libs/pjproject/tests/pjsua/scripts-sipp/uac-options.xml b/sflphone-common/libs/pjproject/tests/pjsua/scripts-sipp/uac-options.xml new file mode 100644 index 0000000000000000000000000000000000000000..7b14884509b95fa28e7d6bfa3429c5659a495c61 --- /dev/null +++ b/sflphone-common/libs/pjproject/tests/pjsua/scripts-sipp/uac-options.xml @@ -0,0 +1,54 @@ +<?xml version="1.0" encoding="ISO-8859-1" ?> +<!DOCTYPE scenario SYSTEM "sipp.dtd"> + +<!-- This program is free software; you can redistribute it and/or --> +<!-- modify it under the terms of the GNU General Public License as --> +<!-- published by the Free Software Foundation; either version 2 of the --> +<!-- License, or (at your option) any later version. --> +<!-- --> +<!-- This program is distributed in the hope that it will be useful, --> +<!-- but WITHOUT ANY WARRANTY; without even the implied warranty of --> +<!-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --> +<!-- GNU General Public License for more details. --> +<!-- --> +<!-- You should have received a copy of the GNU General Public License --> +<!-- along with this program; if not, write to the --> +<!-- Free Software Foundation, Inc., --> +<!-- 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA --> +<!-- --> +<!-- --> + +<scenario name="UAC OPTIONS"> + <!-- UAC with bad ACK causes assertion with pjsip 1.4 --> + <send retrans="500"> + <![CDATA[ + + OPTIONS sip:[service]@[remote_ip]:[remote_port] SIP/2.0 + Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch] + From: sipp <sip:sipp@[local_ip]:[local_port]>;tag=[call_number] + To: sut <sip:[service]@[remote_ip]:[remote_port]> + Call-ID: [call_id] + CSeq: 1 OPTIONS + Contact: sip:sipp@[local_ip]:[local_port] + Max-Forwards: 70 + Subject: Performance Test + Content-Length: [len] + + ]]> + </send> + + <!-- By adding rrs="true" (Record Route Sets), the route sets --> + <!-- are saved and used for following messages sent. Useful to test --> + <!-- against stateful SIP proxies/B2BUAs. --> + <recv response="200" rtd="true"> + </recv> + + + <!-- definition of the response time repartition table (unit is ms) --> + <ResponseTimeRepartition value="10, 20, 30, 40, 50, 100, 150, 200"/> + + <!-- definition of the call length repartition table (unit is ms) --> + <CallLengthRepartition value="10, 50, 100, 500, 1000, 5000, 10000"/> + +</scenario> + diff --git a/sflphone-common/libs/pjproject/tests/pjsua/scripts-sipp/uac-reinvite-bad-via-branch.xml b/sflphone-common/libs/pjproject/tests/pjsua/scripts-sipp/uac-reinvite-bad-via-branch.xml new file mode 100644 index 0000000000000000000000000000000000000000..ed825c9faf493a6ac870aabe3c159114460e7f10 --- /dev/null +++ b/sflphone-common/libs/pjproject/tests/pjsua/scripts-sipp/uac-reinvite-bad-via-branch.xml @@ -0,0 +1,173 @@ +<?xml version="1.0" encoding="ISO-8859-1" ?> +<!DOCTYPE scenario SYSTEM "sipp.dtd"> + +<!-- This program is free software; you can redistribute it and/or --> +<!-- modify it under the terms of the GNU General Public License as --> +<!-- published by the Free Software Foundation; either version 2 of the --> +<!-- License, or (at your option) any later version. --> +<!-- --> +<!-- This program is distributed in the hope that it will be useful, --> +<!-- but WITHOUT ANY WARRANTY; without even the implied warranty of --> +<!-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --> +<!-- GNU General Public License for more details. --> +<!-- --> +<!-- You should have received a copy of the GNU General Public License --> +<!-- along with this program; if not, write to the --> +<!-- Free Software Foundation, Inc., --> +<!-- 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA --> +<!-- --> +<!-- --> + +<!-- Re-INVITE with bad Via branch (it has the same branch as the + previous INVITE (ticket #965) will cause assertion +--> + + +<scenario name="UAC re-INVITE with bad Via branch"> + <send retrans="500"> + <![CDATA[ + + INVITE sip:[service]@[remote_ip]:[remote_port] SIP/2.0 + Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=z9hG4bKPj-1 + From: sipp <sip:sipp@[local_ip]:[local_port]>;tag=[call_number] + To: sut <sip:[service]@[remote_ip]:[remote_port]> + Call-ID: [call_id] + CSeq: 1 INVITE + Contact: sip:sipp@[local_ip]:[local_port] + Max-Forwards: 70 + Subject: Performance Test + Content-Type: application/sdp + Content-Length: [len] + + v=0 + o=Tester 234 123 IN IP4 127.0.0.1 + s=Tester + c=IN IP4 127.0.0.1 + t=0 0 + m=audio 17424 RTP/AVP 0 101 + a=rtpmap:101 telephone-event/8000 + a=sendrecv + + ]]> + </send> + + <recv response="100" + optional="true"> + </recv> + + <recv response="180" optional="true"> + </recv> + + <!-- By adding rrs="true" (Record Route Sets), the route sets --> + <!-- are saved and used for following messages sent. Useful to test --> + <!-- against stateful SIP proxies/B2BUAs. --> + <recv response="200" rtd="true"> + </recv> + + <!-- Packet lost can be simulated in any send/recv message by --> + <!-- by adding the 'lost = "10"'. Value can be [1-100] percent. --> + <send> + <![CDATA[ + + ACK sip:[service]@[remote_ip]:[remote_port] SIP/2.0 + Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=z9hG4bKPj-2 + From: sipp <sip:sipp@[local_ip]:[local_port]>;tag=[call_number] + To: sut <sip:[service]@[remote_ip]:[remote_port]>[peer_tag_param] + Call-ID: [call_id] + CSeq: 1 ACK + Contact: sip:sipp@[local_ip]:[local_port] + Max-Forwards: 70 + Subject: Performance Test + Content-Length: 0 + + ]]> + </send> + + + <!-- Re-INVITE with Via branch value the same as previous INVITE --> + <send retrans="500"> + <![CDATA[ + + INVITE sip:[service]@[remote_ip]:[remote_port] SIP/2.0 + Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=z9hG4bKPj-1 + From: sipp <sip:sipp@[local_ip]:[local_port]>;tag=[call_number] + To: sut <sip:[service]@[remote_ip]:[remote_port]>[peer_tag_param] + Call-ID: [call_id] + CSeq: 2 INVITE + Contact: sip:sipp@[local_ip]:[local_port] + Max-Forwards: 70 + Subject: Performance Test + Content-Type: application/sdp + Content-Length: [len] + + v=0 + o=Tester 234 124 IN IP4 127.0.0.1 + s=Tester + c=IN IP4 127.0.0.1 + t=0 0 + m=audio 17424 RTP/AVP 0 101 + a=rtpmap:101 telephone-event/8000 + + + ]]> + </send> + + <!-- By adding rrs="true" (Record Route Sets), the route sets --> + <!-- are saved and used for following messages sent. Useful to test --> + <!-- against stateful SIP proxies/B2BUAs. --> + <recv response="500" rtd="true"> + </recv> + + <!-- Packet lost can be simulated in any send/recv message by --> + <!-- by adding the 'lost = "10"'. Value can be [1-100] percent. --> + <send> + <![CDATA[ + + ACK sip:[service]@[remote_ip]:[remote_port] SIP/2.0 + Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=z9hG4bKPj-1 + From: sipp <sip:sipp@[local_ip]:[local_port]>;tag=[call_number] + To: sut <sip:[service]@[remote_ip]:[remote_port]>[peer_tag_param] + Call-ID: [call_id] + CSeq: 2 ACK + Contact: sip:sipp@[local_ip]:[local_port] + Max-Forwards: 70 + Subject: Performance Test + Content-Length: 0 + + ]]> + </send> + + + <pause milliseconds="2000"/> + + + <!-- The 'crlf' option inserts a blank line in the statistics report. --> + <send retrans="500"> + <![CDATA[ + + BYE sip:[service]@[remote_ip]:[remote_port] SIP/2.0 + Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch] + From: sipp <sip:sipp@[local_ip]:[local_port]>;tag=[call_number] + To: sut <sip:[service]@[remote_ip]:[remote_port]>[peer_tag_param] + Call-ID: [call_id] + CSeq: 3 BYE + Contact: sip:sipp@[local_ip]:[local_port] + Max-Forwards: 70 + Subject: Performance Test + Content-Length: 0 + + ]]> + </send> + + <recv response="200" crlf="true"> + </recv> + + + <!-- definition of the response time repartition table (unit is ms) --> + <ResponseTimeRepartition value="10, 20, 30, 40, 50, 100, 150, 200"/> + + <!-- definition of the call length repartition table (unit is ms) --> + <CallLengthRepartition value="10, 50, 100, 500, 1000, 5000, 10000"/> + +</scenario> + diff --git a/sflphone-common/libs/pjproject/tests/pjsua/scripts-sipp/uac-reinvite-port-0-bad-sdp.xml b/sflphone-common/libs/pjproject/tests/pjsua/scripts-sipp/uac-reinvite-port-0-bad-sdp.xml new file mode 100644 index 0000000000000000000000000000000000000000..d1cc04f3c19c3a6607e9098c8db8394602ab53f9 --- /dev/null +++ b/sflphone-common/libs/pjproject/tests/pjsua/scripts-sipp/uac-reinvite-port-0-bad-sdp.xml @@ -0,0 +1,207 @@ +<?xml version="1.0" encoding="ISO-8859-1" ?> +<!DOCTYPE scenario SYSTEM "sipp.dtd"> + +<!-- This program is free software; you can redistribute it and/or --> +<!-- modify it under the terms of the GNU General Public License as --> +<!-- published by the Free Software Foundation; either version 2 of the --> +<!-- License, or (at your option) any later version. --> +<!-- --> +<!-- This program is distributed in the hope that it will be useful, --> +<!-- but WITHOUT ANY WARRANTY; without even the implied warranty of --> +<!-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --> +<!-- GNU General Public License for more details. --> +<!-- --> +<!-- You should have received a copy of the GNU General Public License --> +<!-- along with this program; if not, write to the --> +<!-- Free Software Foundation, Inc., --> +<!-- 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA --> +<!-- --> +<!-- --> + +<!-- Note: + For this test to work, PJSUA-LIB needs to add video line, with + this patch: + + pjsua_media.c:1253, after call to pjmedia_endpt_create_sdp(): + + if (1) { + pjmedia_sdp_media *m = PJ_POOL_ZALLOC_T(pool, pjmedia_sdp_media); + m->desc.media = pj_str("video"); + m->desc.port = 3000; + m->desc.transport = pj_str("RTP/AVP"); + m->desc.fmt_count = 1; + m->desc.fmt[0] = pj_str("0"); + sdp->media[sdp->media_count++] = m; + } + +--> + + +<scenario name="UAC with bad ACK"> + <!-- UAC with bad ACK causes assertion with pjsip 1.4 --> + <send retrans="500"> + <![CDATA[ + + INVITE sip:[service]@[remote_ip]:[remote_port] SIP/2.0 + Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch] + From: sipp <sip:sipp@[local_ip]:[local_port]>;tag=[call_number] + To: sut <sip:[service]@[remote_ip]:[remote_port]> + Call-ID: [call_id] + CSeq: 1 INVITE + Contact: sip:sipp@[local_ip]:[local_port] + Max-Forwards: 70 + Subject: Performance Test + Content-Type: application/sdp + Content-Length: [len] + + v=0 + o=Tester 234 123 IN IP4 89.208.145.194 + s=Tester + c=IN IP4 89.208.145.194 + t=0 0 + m=audio 17424 RTP/AVP 111 0 18 101 + a=rtpmap:111 SPEEX/16000 + a=rtpmap:0 PCMU/8000 + a=rtpmap:18 G729/8000 + a=rtpmap:101 telephone-event/8000 + a=sendrecv + a=rtcp:17425 + m=video 11128 RTP/AVP 34 103 104 + a=rtpmap:34 H263/90000 + a=rtpmap:103 H263-1998/90000 + a=rtpmap:104 H264/90000 + a=sendrecv + a=rtcp:11129 + + ]]> + </send> + + <recv response="100" + optional="true"> + </recv> + + <recv response="180" optional="true"> + </recv> + + <!-- By adding rrs="true" (Record Route Sets), the route sets --> + <!-- are saved and used for following messages sent. Useful to test --> + <!-- against stateful SIP proxies/B2BUAs. --> + <recv response="200" rtd="true"> + </recv> + + <!-- Packet lost can be simulated in any send/recv message by --> + <!-- by adding the 'lost = "10"'. Value can be [1-100] percent. --> + <send> + <![CDATA[ + + ACK sip:[service]@[remote_ip]:[remote_port] SIP/2.0 + Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch] + From: sipp <sip:sipp@[local_ip]:[local_port]>;tag=[call_number] + To: sut <sip:[service]@[remote_ip]:[remote_port]>[peer_tag_param] + Call-ID: [call_id] + CSeq: 1 ACK + Contact: sip:sipp@[local_ip]:[local_port] + Max-Forwards: 70 + Subject: Performance Test + Content-Length: 0 + + ]]> + </send> + + <!-- This delay can be customized by the -d command-line option --> + <!-- or by adding a 'milliseconds = "value"' option here. --> + <pause milliseconds="2000"/> + + <send retrans="500"> + <![CDATA[ + + INVITE sip:[service]@[remote_ip]:[remote_port] SIP/2.0 + Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch] + From: sipp <sip:sipp@[local_ip]:[local_port]>;tag=[call_number] + To: sut <sip:[service]@[remote_ip]:[remote_port]>[peer_tag_param] + Call-ID: [call_id] + CSeq: 2 INVITE + Contact: sip:sipp@[local_ip]:[local_port] + Max-Forwards: 70 + Subject: Performance Test + Content-Type: application/sdp + Content-Length: [len] + + v=0 + o=Tester 234 124 IN IP4 89.208.145.194 + s=Tester + c=IN IP4 89.208.145.194 + t=0 0 + m=audio 17424 RTP/AVP 111 0 18 101 + a=rtpmap:111 SPEEX/16000 + a=rtpmap:0 PCMU/8000 + a=rtpmap:18 G729/8000 + a=rtpmap:101 telephone-event/8000 + a=sendrecv + a=rtcp:17425 + m=video 0 RTP/AVP 34 103 104 + a=sendrecv + + + ]]> + </send> + + <!-- By adding rrs="true" (Record Route Sets), the route sets --> + <!-- are saved and used for following messages sent. Useful to test --> + <!-- against stateful SIP proxies/B2BUAs. --> + <recv response="200" rtd="true"> + </recv> + + <!-- Packet lost can be simulated in any send/recv message by --> + <!-- by adding the 'lost = "10"'. Value can be [1-100] percent. --> + <send> + <![CDATA[ + + ACK sip:[service]@[remote_ip]:[remote_port] SIP/2.0 + Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch] + From: sipp <sip:sipp@[local_ip]:[local_port]>;tag=[call_number] + To: sut <sip:[service]@[remote_ip]:[remote_port]>[peer_tag_param] + Call-ID: [call_id] + CSeq: 2 ACK + Contact: sip:sipp@[local_ip]:[local_port] + Max-Forwards: 70 + Subject: Performance Test + Content-Length: 0 + + ]]> + </send> + + + <pause milliseconds="2000"/> + + + <!-- The 'crlf' option inserts a blank line in the statistics report. --> + <send retrans="500"> + <![CDATA[ + + BYE sip:[service]@[remote_ip]:[remote_port] SIP/2.0 + Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch] + From: sipp <sip:sipp@[local_ip]:[local_port]>;tag=[call_number] + To: sut <sip:[service]@[remote_ip]:[remote_port]>[peer_tag_param] + Call-ID: [call_id] + CSeq: 3 BYE + Contact: sip:sipp@[local_ip]:[local_port] + Max-Forwards: 70 + Subject: Performance Test + Content-Length: 0 + + ]]> + </send> + + <recv response="200" crlf="true"> + </recv> + + + <!-- definition of the response time repartition table (unit is ms) --> + <ResponseTimeRepartition value="10, 20, 30, 40, 50, 100, 150, 200"/> + + <!-- definition of the call length repartition table (unit is ms) --> + <CallLengthRepartition value="10, 50, 100, 500, 1000, 5000, 10000"/> + +</scenario> + diff --git a/sflphone-common/libs/pjproject/tests/pjsua/scripts-sipp/uac-subscribe.xml b/sflphone-common/libs/pjproject/tests/pjsua/scripts-sipp/uac-subscribe.xml new file mode 100644 index 0000000000000000000000000000000000000000..c42e95143bd89f7312115a7d59d4c2b5365cc435 --- /dev/null +++ b/sflphone-common/libs/pjproject/tests/pjsua/scripts-sipp/uac-subscribe.xml @@ -0,0 +1,113 @@ +<?xml version="1.0" encoding="ISO-8859-1" ?> +<!DOCTYPE scenario SYSTEM "sipp.dtd"> + +<!-- This program is free software; you can redistribute it and/or --> +<!-- modify it under the terms of the GNU General Public License as --> +<!-- published by the Free Software Foundation; either version 2 of the --> +<!-- License, or (at your option) any later version. --> +<!-- --> +<!-- This program is distributed in the hope that it will be useful, --> +<!-- but WITHOUT ANY WARRANTY; without even the implied warranty of --> +<!-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --> +<!-- GNU General Public License for more details. --> +<!-- --> +<!-- You should have received a copy of the GNU General Public License --> +<!-- along with this program; if not, write to the --> +<!-- Free Software Foundation, Inc., --> +<!-- 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA --> +<!-- --> +<!-- --> + +<scenario name="UAC presence"> + <!-- UAC Presence --> + <send retrans="500"> + <![CDATA[ + + SUBSCRIBE sip:[service]@[remote_ip]:[remote_port] SIP/2.0 + Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch] + From: sipp <sip:sipp@[local_ip]:[local_port]>;tag=[call_number] + To: sut <sip:[service]@[remote_ip]:[remote_port]> + Call-ID: [call_id] + CSeq: 1 SUBSCRIBE + Contact: sip:sipp@[local_ip]:[local_port] + Max-Forwards: 70 + Subject: Performance Test + Event: presence + Expires: 600 + Accept: application/pidf+xml, application/xpidf+xml + Allow-Events: presence, refer + Content-Length: 0 + + ]]> + </send> + + <recv response="200" rtd="true"> + </recv> + + <recv request="NOTIFY" crlf="true"> + </recv> + + <send> + <![CDATA[ + + SIP/2.0 200 OK + [last_Via:] + [last_From:] + [last_To:] + [last_Call-ID:] + [last_CSeq:] + Content-Length: 0 + + ]]> + </send> + + <send retrans="500"> + <![CDATA[ + + SUBSCRIBE sip:[service]@[remote_ip]:[remote_port] SIP/2.0 + Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch] + From: sipp <sip:sipp@[local_ip]:[local_port]>;tag=[call_number] + To: sut <sip:[service]@[remote_ip]:[remote_port]> + Call-ID: [call_id] + CSeq: 2 SUBSCRIBE + Contact: sip:sipp@[local_ip]:[local_port] + Max-Forwards: 70 + Subject: Performance Test + Event: presence + Expires: 0 + Accept: application/pidf+xml, application/xpidf+xml + Allow-Events: presence, refer + Content-Length: 0 + + ]]> + </send> + + <recv response="200" rtd="true"> + </recv> + + <recv request="NOTIFY" crlf="true"> + </recv> + + <send> + <![CDATA[ + + SIP/2.0 200 OK + [last_Via:] + [last_From:] + [last_To:] + [last_Call-ID:] + [last_CSeq:] + Content-Length: 0 + + ]]> + </send> + + + <!-- definition of the response time repartition table (unit is ms) --> + <ResponseTimeRepartition value="10, 20, 30, 40, 50, 100, 150, 200"/> + + <!-- definition of the call length repartition table (unit is ms) --> + <CallLengthRepartition value="10, 50, 100, 500, 1000, 5000, 10000"/> + +</scenario> + diff --git a/sflphone-common/libs/pjproject/tests/pjsua/scripts-sipp/uas-422-then-200-bad-se.xml b/sflphone-common/libs/pjproject/tests/pjsua/scripts-sipp/uas-422-then-200-bad-se.xml new file mode 100644 index 0000000000000000000000000000000000000000..537f242bf5d221e4df78a2cdc6fc2bb0f6e002bb --- /dev/null +++ b/sflphone-common/libs/pjproject/tests/pjsua/scripts-sipp/uas-422-then-200-bad-se.xml @@ -0,0 +1,119 @@ +<?xml version="1.0" encoding="ISO-8859-1" ?> +<!DOCTYPE scenario SYSTEM "sipp.dtd"> + +<!-- This program is free software; you can redistribute it and/or --> +<!-- modify it under the terms of the GNU General Public License as --> +<!-- published by the Free Software Foundation; either version 2 of the --> +<!-- License, or (at your option) any later version. --> +<!-- --> +<!-- This program is distributed in the hope that it will be useful, --> +<!-- but WITHOUT ANY WARRANTY; without even the implied warranty of --> +<!-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --> +<!-- GNU General Public License for more details. --> +<!-- --> +<!-- You should have received a copy of the GNU General Public License --> +<!-- along with this program; if not, write to the --> +<!-- Free Software Foundation, Inc., --> +<!-- 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA --> +<!-- --> +<!-- Sipp default 'uas' scenario. --> +<!-- --> + +<scenario name="Basic UAS responder"> + <!-- By adding rrs="true" (Record Route Sets), the route sets --> + <!-- are saved and used for following messages sent. Useful to test --> + <!-- against stateful SIP proxies/B2BUAs. --> + <recv request="INVITE" crlf="true"> + </recv> + + <!-- The '[last_*]' keyword is replaced automatically by the --> + <!-- specified header if it was present in the last message received --> + <!-- (except if it was a retransmission). If the header was not --> + <!-- present or if no message has been received, the '[last_*]' --> + <!-- keyword is discarded, and all bytes until the end of the line --> + <!-- are also discarded. --> + <!-- --> + <!-- If the specified header was present several times in the --> + <!-- message, all occurences are concatenated (CRLF seperated) --> + <!-- to be used in place of the '[last_*]' keyword. --> + + <send retrans="500"> + <![CDATA[ + + SIP/2.0 422 Session Timer too small + [last_Via:] + [last_From:] + [last_To:];tag=[call_number] + [last_Call-ID:] + [last_CSeq:] + Contact: <sip:[local_ip]:[local_port];transport=[transport]> + Min-SE: 5400 + Content-Length: 0 + + ]]> + </send> + + <recv request="ACK" + optional="true" + rtd="true" + crlf="true"> + </recv> + + + <recv request="INVITE" crlf="true"> + </recv> + + <send retrans="500"> + <![CDATA[ + + SIP/2.0 200 OK + [last_Via:] + [last_From:] + [last_To:];tag=[call_number] + [last_Call-ID:] + [last_CSeq:] + Allow: INVITE, OPTIONS, BYE, CANCEL, ACK, PRACK, UPDATE, REFER, SUBSCRIBE, NOTIFY, INFO, REGISTER + Allow-Events: telephone-event + Contact: <sip:[local_ip]:[local_port];transport=[transport]> + Supported: replaces + Session-Expires: 3600;refresher=uas + Require: timer + Content-Type: application/sdp + Content-Disposition: session;handling=required + Content-Length: [len] + + v=0 + o=Some-UserAgent 68 210 IN IP4 [local_ip] + s=SIP Call + c=IN IP4 [local_ip] + t=0 0 + m=audio 17294 RTP/AVP 18 101 + c=IN IP4 [local_ip] + a=rtpmap:18 G729/8000 + a=fmtp:18 annexb=no + a=rtpmap:101 telephone-event/8000 + a=fmtp:101 0-16 + a=ptime:20 + + ]]> + </send> + + <recv request="ACK" + rtd="true" + crlf="true"> + </recv> + + + <!-- Keep the call open for a while in case the 200 is lost to be --> + <!-- able to retransmit it if we receive the BYE again. --> + <pause milliseconds="4000"/> + + + <!-- definition of the response time repartition table (unit is ms) --> + <ResponseTimeRepartition value="10, 20, 30, 40, 50, 100, 150, 200"/> + + <!-- definition of the call length repartition table (unit is ms) --> + <CallLengthRepartition value="10, 50, 100, 500, 1000, 5000, 10000"/> + +</scenario> + diff --git a/sflphone-common/libs/pjproject/tests/pjsua/scripts-sipp/uas-auth.xml b/sflphone-common/libs/pjproject/tests/pjsua/scripts-sipp/uas-auth.xml new file mode 100644 index 0000000000000000000000000000000000000000..71da30f282ba4b6d6ec24c33abd593984ae189fb --- /dev/null +++ b/sflphone-common/libs/pjproject/tests/pjsua/scripts-sipp/uas-auth.xml @@ -0,0 +1,67 @@ +<?xml version="1.0" encoding="ISO-8859-1" ?> +<!DOCTYPE scenario SYSTEM "sipp.dtd"> + +<!-- This program is free software; you can redistribute it and/or --> +<!-- modify it under the terms of the GNU General Public License as --> +<!-- published by the Free Software Foundation; either version 2 of the --> +<!-- License, or (at your option) any later version. --> +<!-- --> +<!-- This program is distributed in the hope that it will be useful, --> +<!-- but WITHOUT ANY WARRANTY; without even the implied warranty of --> +<!-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --> +<!-- GNU General Public License for more details. --> +<!-- --> +<!-- You should have received a copy of the GNU General Public License --> +<!-- along with this program; if not, write to the --> +<!-- Free Software Foundation, Inc., --> +<!-- 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA --> +<!-- --> +<!-- Sipp default 'uas' scenario. --> +<!-- --> + +<scenario name="UAS authorization server"> + <recv request="REGISTER" crlf="true"> + </recv> + + <send> + <![CDATA[ + + SIP/2.0 401 Unauthorized + [last_Via:] + [last_From:] + [last_To:];tag=[call_number] + [last_Call-ID:] + [last_CSeq:] + WWW-Authenticate: digest realm="test",stale=true + ]]> + </send> + + + <recv request="REGISTER" crlf="true"> + </recv> + + <send> + <![CDATA[ + + SIP/2.0 200 OK + [last_Via:] + [last_From:] + [last_To:];tag=[call_number] + [last_Call-ID:] + [last_CSeq:] + Expires: 30 + ]]> + </send> + + + <pause milliseconds="1000"/> + + + <!-- definition of the response time repartition table (unit is ms) --> + <ResponseTimeRepartition value="10, 20, 30, 40, 50, 100, 150, 200"/> + + <!-- definition of the call length repartition table (unit is ms) --> + <CallLengthRepartition value="10, 50, 100, 500, 1000, 5000, 10000"/> + +</scenario> + diff --git a/sflphone-common/libs/pjproject/tests/pjsua/scripts-sipp/uas-mwi-0.xml b/sflphone-common/libs/pjproject/tests/pjsua/scripts-sipp/uas-mwi-0.xml new file mode 100644 index 0000000000000000000000000000000000000000..58f2bd480e39f6fa003d6e53c57e087a6a4eaac8 --- /dev/null +++ b/sflphone-common/libs/pjproject/tests/pjsua/scripts-sipp/uas-mwi-0.xml @@ -0,0 +1,86 @@ +<?xml version="1.0" encoding="ISO-8859-1" ?> +<!DOCTYPE scenario SYSTEM "sipp.dtd"> + +<!-- This program is free software; you can redistribute it and/or --> +<!-- modify it under the terms of the GNU General Public License as --> +<!-- published by the Free Software Foundation; either version 2 of the --> +<!-- License, or (at your option) any later version. --> +<!-- --> +<!-- This program is distributed in the hope that it will be useful, --> +<!-- but WITHOUT ANY WARRANTY; without even the implied warranty of --> +<!-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --> +<!-- GNU General Public License for more details. --> +<!-- --> +<!-- You should have received a copy of the GNU General Public License --> +<!-- along with this program; if not, write to the --> +<!-- Free Software Foundation, Inc., --> +<!-- 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA --> +<!-- --> +<!-- Late NOTIFY scenario: --> +<!-- - UAC sends SUBSCRIBE, we reply with 200 --> +<!-- - we send NOTIFY, expect 200 --> +<!-- - UAC sends SUBSCRIBE, we ignore --> +<!-- - we send NOTIFY --> +<!-- See http://trac.pjsip.org/repos/ticket/911 --> +<!-- --> + +<scenario name="MWI server with immediate final notify"> + <recv request="SUBSCRIBE" crlf="true"> + <action> + <ereg regexp=".*" search_in="hdr" header="From" assign_to="3"/> + <ereg regexp="sip:(.*)>" search_in="hdr" header="Contact" assign_to="4,5"/> + <assign assign_to="4" variable="5" /> + </action> + </recv> + + + <send> + <![CDATA[ + + SIP/2.0 200 OK + [last_Via:] + [last_From:] + [last_To:];tag=[call_number] + [last_Call-ID:] + [last_CSeq:] + Contact: <sip:sipp@[local_ip]:[local_port]> + Content-Length: 0 + Expires: 600 + ]]> + </send> + + <!-- initial notify is final notify --> + <send retrans="500"> + <![CDATA[ + NOTIFY sip:[$5] SIP/2.0 + Via: SIP/2.0/[transport] [local_ip]:[local_port];rport;branch=[branch] + From: sipp <sip:sipp@[local_ip]>;tag=[call_number] + To[$3] + Call-ID: [call_id] + Cseq: 1 NOTIFY + Contact: sip:sipp@[local_ip]:[local_port] + Max-Forwards: 70 + Event: message-summary + Subscription-State: terminated;reason=goinghome + Content-Type: application/simple-message-summary + Content-Length: [len] + + Messages-Waiting: yes + Voice-Message: 4/8 (1/2) + + ]]> + </send> + + <recv response="200"> + </recv> + + <pause milliseconds="5000"/> + + <!-- definition of the response time repartition table (unit is ms) --> + <ResponseTimeRepartition value="10, 20, 30, 40, 50, 100, 150, 200"/> + + <!-- definition of the call length repartition table (unit is ms) --> + <CallLengthRepartition value="10, 50, 100, 500, 1000, 5000, 10000"/> + +</scenario> + diff --git a/sflphone-common/libs/pjproject/tests/pjsua/scripts-sipp/uas-mwi.xml b/sflphone-common/libs/pjproject/tests/pjsua/scripts-sipp/uas-mwi.xml new file mode 100644 index 0000000000000000000000000000000000000000..00e703718b5b07d8a6111334e7b9e8637468797a --- /dev/null +++ b/sflphone-common/libs/pjproject/tests/pjsua/scripts-sipp/uas-mwi.xml @@ -0,0 +1,112 @@ +<?xml version="1.0" encoding="ISO-8859-1" ?> +<!DOCTYPE scenario SYSTEM "sipp.dtd"> + +<!-- This program is free software; you can redistribute it and/or --> +<!-- modify it under the terms of the GNU General Public License as --> +<!-- published by the Free Software Foundation; either version 2 of the --> +<!-- License, or (at your option) any later version. --> +<!-- --> +<!-- This program is distributed in the hope that it will be useful, --> +<!-- but WITHOUT ANY WARRANTY; without even the implied warranty of --> +<!-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --> +<!-- GNU General Public License for more details. --> +<!-- --> +<!-- You should have received a copy of the GNU General Public License --> +<!-- along with this program; if not, write to the --> +<!-- Free Software Foundation, Inc., --> +<!-- 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA --> +<!-- --> +<!-- Late NOTIFY scenario: --> +<!-- - UAC sends SUBSCRIBE, we reply with 200 --> +<!-- - we send NOTIFY, expect 200 --> +<!-- - UAC sends SUBSCRIBE, we ignore --> +<!-- - we send NOTIFY --> +<!-- See http://trac.pjsip.org/repos/ticket/911 --> +<!-- --> + +<scenario name="MWI server"> + <recv request="SUBSCRIBE" crlf="true"> + <action> + <ereg regexp=".*" search_in="hdr" header="From" assign_to="3"/> + <ereg regexp="sip:(.*)>" search_in="hdr" header="Contact" assign_to="4,5"/> + <assign assign_to="4" variable="5" /> + </action> + </recv> + + + <send> + <![CDATA[ + + SIP/2.0 200 OK + [last_Via:] + [last_From:] + [last_To:];tag=[call_number] + [last_Call-ID:] + [last_CSeq:] + Contact: <sip:sipp@[local_ip]:[local_port]> + Content-Length: 0 + Expires: 600 + ]]> + </send> + + <!-- initial notify --> + <send retrans="500"> + <![CDATA[ + NOTIFY sip:[$5] SIP/2.0 + Via: SIP/2.0/[transport] [local_ip]:[local_port];rport;branch=[branch] + From: sipp <sip:sipp@[local_ip]>;tag=[call_number] + To[$3] + Call-ID: [call_id] + Cseq: 1 NOTIFY + Contact: sip:sipp@[local_ip]:[local_port] + Max-Forwards: 70 + Event: message-summary + Subscription-State: active;expires=50 + Content-Type: application/simple-message-summary + Content-Length: [len] + + Messages-Waiting: yes + Voice-Message: 4/8 (1/2) + + ]]> + </send> + + <recv response="200"> + </recv> + + <pause milliseconds="10000"/> + + + <!-- terminate subscription --> + <send retrans="500"> + <![CDATA[ + NOTIFY sip:[$5] SIP/2.0 + Via: SIP/2.0/[transport] [local_ip]:[local_port];rport;branch=[branch] + From: sipp <sip:sipp@[local_ip]>;tag=[call_number] + To[$3] + Call-ID: [call_id] + Cseq: 2 NOTIFY + Contact: sip:sipp@[local_ip]:[local_port] + Max-Forwards: 70 + Event: message-summary + Subscription-State: terminated;reason=noresource + Content-Type: application/simple-message-summary + Content-Length: [len] + + Messages-Waiting: yes + Voice-Message: 4/8 (1/2) + + ]]> + </send> + + <recv response="200"> + </recv> + + <!-- definition of the response time repartition table (unit is ms) --> + <ResponseTimeRepartition value="10, 20, 30, 40, 50, 100, 150, 200"/> + + <!-- definition of the call length repartition table (unit is ms) --> + <CallLengthRepartition value="10, 50, 100, 500, 1000, 5000, 10000"/> + +</scenario> + diff --git a/sflphone-common/libs/pjproject/tests/pjsua/scripts-sipp/uas-subscribe-refresh-481.xml b/sflphone-common/libs/pjproject/tests/pjsua/scripts-sipp/uas-subscribe-refresh-481.xml new file mode 100644 index 0000000000000000000000000000000000000000..5f1165013c701e4a45de426bc3139419f773bcc3 --- /dev/null +++ b/sflphone-common/libs/pjproject/tests/pjsua/scripts-sipp/uas-subscribe-refresh-481.xml @@ -0,0 +1,116 @@ +<?xml version="1.0" encoding="ISO-8859-1" ?> +<!DOCTYPE scenario SYSTEM "sipp.dtd"> + +<!-- This program is free software; you can redistribute it and/or --> +<!-- modify it under the terms of the GNU General Public License as --> +<!-- published by the Free Software Foundation; either version 2 of the --> +<!-- License, or (at your option) any later version. --> +<!-- --> +<!-- This program is distributed in the hope that it will be useful, --> +<!-- but WITHOUT ANY WARRANTY; without even the implied warranty of --> +<!-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --> +<!-- GNU General Public License for more details. --> +<!-- --> +<!-- You should have received a copy of the GNU General Public License --> +<!-- along with this program; if not, write to the --> +<!-- Free Software Foundation, Inc., --> +<!-- 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA --> +<!-- --> +<!-- Late NOTIFY scenario: --> +<!-- - UAC sends SUBSCRIBE, we reply with 200 --> +<!-- - we send NOTIFY, expect 200 --> +<!-- - UAC sends SUBSCRIBE, we ignore --> +<!-- - we send NOTIFY --> +<!-- See http://trac.pjsip.org/repos/ticket/911 --> +<!-- --> + +<scenario name="SUBSCRIBE tests"> + <!-- Establish subscription --> + <recv request="SUBSCRIBE" crlf="true"> + <action> + <ereg regexp=".*" search_in="hdr" header="From" assign_to="3"/> + <ereg regexp="sip:(.*)>" search_in="hdr" header="Contact" assign_to="4,5"/> + <assign assign_to="4" variable="5" /> + </action> + </recv> + + <send> + <![CDATA[ + + SIP/2.0 200 OK + [last_Via:] + [last_From:] + [last_To:];tag=[call_number] + [last_Call-ID:] + [last_CSeq:] + Contact: <sip:sipp@[local_ip]:[local_port]> + Content-Length: 0 + Expires: 60 + ]]> + </send> + + <send retrans="500"> + <![CDATA[ + NOTIFY sip:[$5] SIP/2.0 + Via: SIP/2.0/[transport] [local_ip]:[local_port];rport;branch=z9hG4bKPj01 + From: sipp <sip:sipp@[local_ip]>;tag=[call_number] + To[$3] + Call-ID: [call_id] + Cseq: 1 NOTIFY + Contact: sip:sipp@[local_ip]:[local_port] + Max-Forwards: 70 + Event: presence + Subscription-State: active;expires=50 + Content-Type: application/pidf+xml + + <?xml version="1.0" encoding="UTF-8"?> + <presence xmlns="urn:ietf:params:xml:ns:pidf" xmlns:op="urn:oma:xml:prs:pidf:oma-pres" entity="sip:moto_red@ptt.intra.genaker.net"> + <tuple id="17415d5738f332a64a2f1d8cfb4ab0a5"> + <status> + <basic>open</basic> + </status> + </tuple> + </presence> + ]]> + </send> + + <recv response="200"> + </recv> + + <!-- Subscription has been established at this point --> + + + <!-- ******* + + Wait for subscription refresh, reply with 481 + + --> + + <recv request="SUBSCRIBE" crlf="true"> + </recv> + + <send> + <![CDATA[ + + SIP/2.0 481 You should resubscribe mow + [last_Via:] + [last_From:] + [last_To:];tag=[call_number] + [last_Call-ID:] + [last_CSeq:] + Contact: <sip:sipp@[local_ip]:[local_port]> + Content-Length: 0 + ]]> + </send> + + + + + <!-- definition of the response time repartition table (unit is ms) --> + <ResponseTimeRepartition value="10, 20, 30, 40, 50, 100, 150, 200"/> + + <!-- definition of the call length repartition table (unit is ms) --> + <CallLengthRepartition value="10, 50, 100, 500, 1000, 5000, 10000"/> + +</scenario> + diff --git a/sflphone-common/libs/pjproject/tests/pjsua/scripts-sipp/uas-subscribe-terminated-retry.xml b/sflphone-common/libs/pjproject/tests/pjsua/scripts-sipp/uas-subscribe-terminated-retry.xml new file mode 100644 index 0000000000000000000000000000000000000000..4843cc37653b6fb48cf54885c86548a690ca526a --- /dev/null +++ b/sflphone-common/libs/pjproject/tests/pjsua/scripts-sipp/uas-subscribe-terminated-retry.xml @@ -0,0 +1,120 @@ +<?xml version="1.0" encoding="ISO-8859-1" ?> +<!DOCTYPE scenario SYSTEM "sipp.dtd"> + +<!-- This program is free software; you can redistribute it and/or --> +<!-- modify it under the terms of the GNU General Public License as --> +<!-- published by the Free Software Foundation; either version 2 of the --> +<!-- License, or (at your option) any later version. --> +<!-- --> +<!-- This program is distributed in the hope that it will be useful, --> +<!-- but WITHOUT ANY WARRANTY; without even the implied warranty of --> +<!-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --> +<!-- GNU General Public License for more details. --> +<!-- --> +<!-- You should have received a copy of the GNU General Public License --> +<!-- along with this program; if not, write to the --> +<!-- Free Software Foundation, Inc., --> +<!-- 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA --> +<!-- --> +<!-- Late NOTIFY scenario: --> +<!-- - UAC sends SUBSCRIBE, we reply with 200 --> +<!-- - we send NOTIFY, expect 200 --> +<!-- - UAC sends SUBSCRIBE, we ignore --> +<!-- - we send NOTIFY --> +<!-- See http://trac.pjsip.org/repos/ticket/911 --> +<!-- --> + +<scenario name="NOTIFY with terminated status with some reason code should cause UAC to retry"> + <!-- Establish subscription --> + <recv request="SUBSCRIBE" crlf="true"> + <action> + <ereg regexp=".*" search_in="hdr" header="From" assign_to="3"/> + <ereg regexp="sip:(.*)>" search_in="hdr" header="Contact" assign_to="4,5"/> + <assign assign_to="4" variable="5" /> + </action> + </recv> + + <send> + <![CDATA[ + + SIP/2.0 200 OK + [last_Via:] + [last_From:] + [last_To:];tag=[call_number] + [last_Call-ID:] + [last_CSeq:] + Contact: <sip:sipp@[local_ip]:[local_port]> + Content-Length: 0 + Expires: 60 + ]]> + </send> + + <send retrans="500"> + <![CDATA[ + NOTIFY sip:[$5] SIP/2.0 + Via: SIP/2.0/[transport] [local_ip]:[local_port];rport;branch=[branch] + From: sipp <sip:sipp@[local_ip]>;tag=[call_number] + To[$3] + Call-ID: [call_id] + Cseq: 1 NOTIFY + Contact: sip:sipp@[local_ip]:[local_port] + Max-Forwards: 70 + Event: presence + Subscription-State: active;expires=50 + Content-Type: application/pidf+xml + + <?xml version="1.0" encoding="UTF-8"?> + <presence xmlns="urn:ietf:params:xml:ns:pidf" xmlns:op="urn:oma:xml:prs:pidf:oma-pres" entity="sip:moto_red@ptt.intra.genaker.net"> + <tuple id="17415d5738f332a64a2f1d8cfb4ab0a5"> + <status> + <basic>open</basic> + </status> + </tuple> + </presence> + ]]> + </send> + + <recv response="200"> + </recv> + + <!-- Subscription has been established at this point --> + + + <pause milliseconds="4000"/> + + <!-- ******* + + Send NOTIFY termination + + --> + <send retrans="500"> + <![CDATA[ + NOTIFY sip:[$5] SIP/2.0 + Via: SIP/2.0/[transport] [local_ip]:[local_port];rport;branch=[branch] + From: sipp <sip:sipp@[local_ip]>;tag=[call_number] + To[$3] + Call-ID: [call_id] + Cseq: 3 NOTIFY + Contact: sip:sipp@[local_ip]:[local_port] + Max-Forwards: 70 + Event: presence + Subscription-State: terminated;reason=probation;retry-after=5 + Content-Length: 0 + ]]> + </send> + + <recv response="200"> + </recv> + + + + + + <!-- definition of the response time repartition table (unit is ms) --> + <ResponseTimeRepartition value="10, 20, 30, 40, 50, 100, 150, 200"/> + + <!-- definition of the call length repartition table (unit is ms) --> + <CallLengthRepartition value="10, 50, 100, 500, 1000, 5000, 10000"/> + +</scenario> + diff --git a/sflphone-common/libs/pjproject/third_party/build/Makefile b/sflphone-common/libs/pjproject/third_party/build/Makefile index 6d84db662cdb58d574db54b9cfc287e6941192b2..36d80612076f25e3761cfe4f45c6f3aae3489499 100644 --- a/sflphone-common/libs/pjproject/third_party/build/Makefile +++ b/sflphone-common/libs/pjproject/third_party/build/Makefile @@ -1,4 +1,4 @@ -DIRS = resample srtp +DIRS = resample milenage srtp include ../../build.mak include $(PJDIR)/build/common.mak diff --git a/sflphone-common/libs/pjproject/third_party/build/milenage/Makefile b/sflphone-common/libs/pjproject/third_party/build/milenage/Makefile new file mode 100644 index 0000000000000000000000000000000000000000..094ddeaa7e42e8763816d5e3ae84f8fa21c18cef --- /dev/null +++ b/sflphone-common/libs/pjproject/third_party/build/milenage/Makefile @@ -0,0 +1,58 @@ +include ../../../build.mak +include ../../../build/common.mak + +export LIBDIR := ../../lib + +RULES_MAK := $(PJDIR)/build/rules.mak + +export MILENAGE_LIB := ../../lib/libmilenage-$(TARGET_NAME)$(LIBEXT) + +############################################################################### +# Gather all flags. +# +export _CFLAGS := $(CC_CFLAGS) $(OS_CFLAGS) $(HOST_CFLAGS) $(M_CFLAGS) \ + $(CFLAGS) $(CC_INC). $(CC_INC)../../milenage/include \ + $(CC_INC)../../../pjlib/include +export _CXXFLAGS:= $(_CFLAGS) $(CC_CXXFLAGS) $(OS_CXXFLAGS) $(M_CXXFLAGS) \ + $(HOST_CXXFLAGS) $(CXXFLAGS) +export _LDFLAGS := $(CC_LDFLAGS) $(OS_LDFLAGS) $(M_LDFLAGS) $(HOST_LDFLAGS) \ + $(LDFLAGS) + +export MILENAGE_SRCDIR = ../../milenage +export MILENAGE_OBJS = milenage.o rijndael.o +export MILENAGE_CFLAGS = $(_CFLAGS) + + +export CC_OUT CC AR RANLIB HOST_MV HOST_RM HOST_RMDIR HOST_MKDIR OBJEXT LD LDOUT +############################################################################### +# Main entry +# +# $(TARGET) is defined in os-$(OS_NAME).mak file in current directory. +# +TARGETS := libmilenage + +all: $(TARGETS) + +doc: + cd .. && doxygen docs/doxygen.cfg + +dep: depend +distclean: realclean + +.PHONY: dep depend libmilenage clean realclean distclean + +libmilenage: + $(MAKE) -f $(RULES_MAK) APP=MILENAGE app=libmilenage $(MILENAGE_LIB) + +clean print_lib: + $(MAKE) -f $(RULES_MAK) APP=MILENAGE app=libmilenage $@ + +realclean: + $(subst @@,$(subst /,$(HOST_PSEP),.ilbc-$(TARGET_NAME).depend),$(HOST_RMR)) + + $(MAKE) -f $(RULES_MAK) APP=MILENAGE app=libmilenage $@ + +depend: + $(MAKE) -f $(RULES_MAK) APP=MILENAGE app=libmilenage $@ + + diff --git a/sflphone-common/libs/pjproject/third_party/build/milenage/libmilenage.dsp b/sflphone-common/libs/pjproject/third_party/build/milenage/libmilenage.dsp new file mode 100644 index 0000000000000000000000000000000000000000..cf89612e9c3f6c83c0a7c3f0ebfe95d35de406c2 --- /dev/null +++ b/sflphone-common/libs/pjproject/third_party/build/milenage/libmilenage.dsp @@ -0,0 +1,110 @@ +# Microsoft Developer Studio Project File - Name="libmilenage" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Static Library" 0x0104 + +CFG=libmilenage - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "libmilenage.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "libmilenage.mak" CFG="libmilenage - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "libmilenage - Win32 Release" (based on "Win32 (x86) Static Library") +!MESSAGE "libmilenage - Win32 Debug" (based on "Win32 (x86) Static Library") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +RSC=rc.exe + +!IF "$(CFG)" == "libmilenage - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "../../lib" +# PROP BASE Intermediate_Dir "output/libmilenage-i386-win32-vc6-release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "../../lib" +# PROP Intermediate_Dir "output/libmilenage-i386-win32-vc6-release" +# PROP Target_Dir "" +F90=df.exe +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c +# ADD CPP /nologo /MD /W3 /GX /O2 /I "../../../pjlib/include" /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LIB32=link.exe -lib +# ADD BASE LIB32 /nologo +# ADD LIB32 /nologo /out:"../../lib/libmilenage-i386-win32-vc6-release.lib" + +!ELSEIF "$(CFG)" == "libmilenage - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "output/libmilenage-i386-win32-vc6-debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "../../lib" +# PROP Intermediate_Dir "output/libmilenage-i386-win32-vc6-debug" +# PROP Target_Dir "" +F90=df.exe +# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c +# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "../../../pjlib/include" /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LIB32=link.exe -lib +# ADD BASE LIB32 /nologo +# ADD LIB32 /nologo /out:"../../lib/libmilenage-i386-win32-vc6-debug.lib" + +!ENDIF + +# Begin Target + +# Name "libmilenage - Win32 Release" +# Name "libmilenage - Win32 Debug" +# Begin Group "Source Files" + +# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" +# Begin Source File + +SOURCE=..\..\milenage\milenage.c +# End Source File +# Begin Source File + +SOURCE=..\..\milenage\rijndael.c +# End Source File +# End Group +# Begin Group "Header Files" + +# PROP Default_Filter "h;hpp;hxx;hm;inl" +# Begin Source File + +SOURCE=..\..\milenage\milenage.h +# End Source File +# Begin Source File + +SOURCE=..\..\milenage\rijndael.h +# End Source File +# End Group +# End Target +# End Project diff --git a/sflphone-common/libs/pjproject/third_party/build/milenage/libmilenage.vcp b/sflphone-common/libs/pjproject/third_party/build/milenage/libmilenage.vcp new file mode 100644 index 0000000000000000000000000000000000000000..34f4d037397414d746c23ed2f9497ae1dd608e1c --- /dev/null +++ b/sflphone-common/libs/pjproject/third_party/build/milenage/libmilenage.vcp @@ -0,0 +1,1562 @@ +# Microsoft eMbedded Visual Tools Project File - Name="libmilenage" - Package Owner=<4> +# Microsoft eMbedded Visual Tools Generated Build File, Format Version 6.02 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (WCE x86) Static Library" 0x8304 +# TARGTYPE "Win32 (WCE MIPS16) Static Library" 0x8904 +# TARGTYPE "Win32 (WCE SH4) Static Library" 0x8604 +# TARGTYPE "Win32 (WCE MIPSII) Static Library" 0xa104 +# TARGTYPE "Win32 (WCE MIPSIV_FP) Static Library" 0x9204 +# TARGTYPE "Win32 (WCE SH3) Static Library" 0x8104 +# TARGTYPE "Win32 (WCE ARMV4) Static Library" 0xa304 +# TARGTYPE "Win32 (WCE ARMV4I) Static Library" 0xa504 +# TARGTYPE "Win32 (WCE emulator) Static Library" 0xa604 +# TARGTYPE "Win32 (WCE MIPSII_FP) Static Library" 0xa204 +# TARGTYPE "Win32 (WCE ARMV4T) Static Library" 0xa404 +# TARGTYPE "Win32 (WCE MIPSIV) Static Library" 0x9604 + +CFG=libmilenage - Win32 (WCE MIPSII_FP) Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "libmilenage.vcn". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "libmilenage.vcn" CFG="libmilenage - Win32 (WCE MIPSII_FP) Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "libmilenage - Win32 (WCE MIPSII_FP) Release" (based on "Win32 (WCE MIPSII_FP) Static Library") +!MESSAGE "libmilenage - Win32 (WCE MIPSII_FP) Debug" (based on "Win32 (WCE MIPSII_FP) Static Library") +!MESSAGE "libmilenage - Win32 (WCE MIPSII) Release" (based on "Win32 (WCE MIPSII) Static Library") +!MESSAGE "libmilenage - Win32 (WCE MIPSII) Debug" (based on "Win32 (WCE MIPSII) Static Library") +!MESSAGE "libmilenage - Win32 (WCE SH4) Release" (based on "Win32 (WCE SH4) Static Library") +!MESSAGE "libmilenage - Win32 (WCE SH4) Debug" (based on "Win32 (WCE SH4) Static Library") +!MESSAGE "libmilenage - Win32 (WCE SH3) Release" (based on "Win32 (WCE SH3) Static Library") +!MESSAGE "libmilenage - Win32 (WCE SH3) Debug" (based on "Win32 (WCE SH3) Static Library") +!MESSAGE "libmilenage - Win32 (WCE MIPSIV) Release" (based on "Win32 (WCE MIPSIV) Static Library") +!MESSAGE "libmilenage - Win32 (WCE MIPSIV) Debug" (based on "Win32 (WCE MIPSIV) Static Library") +!MESSAGE "libmilenage - Win32 (WCE emulator) Release" (based on "Win32 (WCE emulator) Static Library") +!MESSAGE "libmilenage - Win32 (WCE emulator) Debug" (based on "Win32 (WCE emulator) Static Library") +!MESSAGE "libmilenage - Win32 (WCE ARMV4I) Release" (based on "Win32 (WCE ARMV4I) Static Library") +!MESSAGE "libmilenage - Win32 (WCE ARMV4I) Debug" (based on "Win32 (WCE ARMV4I) Static Library") +!MESSAGE "libmilenage - Win32 (WCE MIPSIV_FP) Release" (based on "Win32 (WCE MIPSIV_FP) Static Library") +!MESSAGE "libmilenage - Win32 (WCE MIPSIV_FP) Debug" (based on "Win32 (WCE MIPSIV_FP) Static Library") +!MESSAGE "libmilenage - Win32 (WCE ARMV4) Release" (based on "Win32 (WCE ARMV4) Static Library") +!MESSAGE "libmilenage - Win32 (WCE ARMV4) Debug" (based on "Win32 (WCE ARMV4) Static Library") +!MESSAGE "libmilenage - Win32 (WCE MIPS16) Release" (based on "Win32 (WCE MIPS16) Static Library") +!MESSAGE "libmilenage - Win32 (WCE MIPS16) Debug" (based on "Win32 (WCE MIPS16) Static Library") +!MESSAGE "libmilenage - Win32 (WCE ARMV4T) Release" (based on "Win32 (WCE ARMV4T) Static Library") +!MESSAGE "libmilenage - Win32 (WCE ARMV4T) Debug" (based on "Win32 (WCE ARMV4T) Static Library") +!MESSAGE "libmilenage - Win32 (WCE x86) Release" (based on "Win32 (WCE x86) Static Library") +!MESSAGE "libmilenage - Win32 (WCE x86) Debug" (based on "Win32 (WCE x86) Static Library") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +# PROP ATL_Project 2 + +!IF "$(CFG)" == "libmilenage - Win32 (WCE MIPSII_FP) Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "output\MIPSII_FPRel" +# PROP BASE Intermediate_Dir "output\MIPSII_FPRel" +# PROP BASE CPU_ID "{D8AC856C-B213-4895-9E83-9EC51A55201E}" +# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" +# PROP BASE Target_Dir "output\" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "output\MIPSII_FPRel" +# PROP Intermediate_Dir "output\MIPSII_FPRel" +# PROP CPU_ID "{D8AC856C-B213-4895-9E83-9EC51A55201E}" +# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" +# PROP Target_Dir "output\" +CPP=clmips.exe +# ADD BASE CPP /nologo /W3 /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "MIPS" /D "_MIPS_" /D "R4000" /D "MIPSII" /D "MIPSII_FP" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "NDEBUG" /D "_LIB" /YX /QMmips2 /QMFPE- /O2 /M$(CECrtMT) /c +# ADD CPP /nologo /W3 /I "../../../pjlib/include" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "MIPS" /D "_MIPS_" /D "R4000" /D "MIPSII" /D "MIPSII_FP" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "NDEBUG" /D "_LIB" /YX /QMmips2 /QMFPE- /O2 /M$(CECrtMT) /c +LIB32=link.exe -lib +# ADD BASE LIB32 /nologo +# ADD LIB32 /nologo +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo + +!ELSEIF "$(CFG)" == "libmilenage - Win32 (WCE MIPSII_FP) Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "output\MIPSII_FPDbg" +# PROP BASE Intermediate_Dir "output\MIPSII_FPDbg" +# PROP BASE CPU_ID "{D8AC856C-B213-4895-9E83-9EC51A55201E}" +# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" +# PROP BASE Target_Dir "output\" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "output\MIPSII_FPDbg" +# PROP Intermediate_Dir "output\MIPSII_FPDbg" +# PROP CPU_ID "{D8AC856C-B213-4895-9E83-9EC51A55201E}" +# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" +# PROP Target_Dir "output\" +CPP=clmips.exe +# ADD BASE CPP /nologo /W3 /Zi /Od /D "DEBUG" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "MIPS" /D "_MIPS_" /D "R4000" /D "MIPSII" /D "MIPSII_FP" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "_LIB" /YX /QMmips2 /QMFPE- /M$(CECrtMTDebug) /c +# ADD CPP /nologo /W3 /Zi /Od /I "../../../pjlib/include" /D "DEBUG" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "MIPS" /D "_MIPS_" /D "R4000" /D "MIPSII" /D "MIPSII_FP" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "_LIB" /YX /QMmips2 /QMFPE- /M$(CECrtMTDebug) /c +LIB32=link.exe -lib +# ADD BASE LIB32 /nologo +# ADD LIB32 /nologo +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo + +!ELSEIF "$(CFG)" == "libmilenage - Win32 (WCE MIPSII) Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "output\MIPSIIRel" +# PROP BASE Intermediate_Dir "output\MIPSIIRel" +# PROP BASE CPU_ID "{689DDC64-9D9D-11D5-96F8-00207802C01C}" +# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" +# PROP BASE Target_Dir "output\" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "output\MIPSIIRel" +# PROP Intermediate_Dir "output\MIPSIIRel" +# PROP CPU_ID "{689DDC64-9D9D-11D5-96F8-00207802C01C}" +# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" +# PROP Target_Dir "output\" +CPP=clmips.exe +# ADD BASE CPP /nologo /W3 /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "MIPS" /D "_MIPS_" /D "R4000" /D "MIPSII" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "NDEBUG" /D "_LIB" /YX /QMmips2 /QMFPE /O2 /M$(CECrtMT) /c +# ADD CPP /nologo /W3 /I "../../../pjlib/include" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "MIPS" /D "_MIPS_" /D "R4000" /D "MIPSII" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "NDEBUG" /D "_LIB" /YX /QMmips2 /QMFPE /O2 /M$(CECrtMT) /c +LIB32=link.exe -lib +# ADD BASE LIB32 /nologo +# ADD LIB32 /nologo +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo + +!ELSEIF "$(CFG)" == "libmilenage - Win32 (WCE MIPSII) Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "output\MIPSIIDbg" +# PROP BASE Intermediate_Dir "output\MIPSIIDbg" +# PROP BASE CPU_ID "{689DDC64-9D9D-11D5-96F8-00207802C01C}" +# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" +# PROP BASE Target_Dir "output\" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "output\MIPSIIDbg" +# PROP Intermediate_Dir "output\MIPSIIDbg" +# PROP CPU_ID "{689DDC64-9D9D-11D5-96F8-00207802C01C}" +# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" +# PROP Target_Dir "output\" +CPP=clmips.exe +# ADD BASE CPP /nologo /W3 /Zi /Od /D "DEBUG" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "MIPS" /D "_MIPS_" /D "R4000" /D "MIPSII" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "_LIB" /YX /QMmips2 /QMFPE /M$(CECrtMTDebug) /c +# ADD CPP /nologo /W3 /Zi /Od /I "../../../pjlib/include" /D "DEBUG" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "MIPS" /D "_MIPS_" /D "R4000" /D "MIPSII" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "_LIB" /YX /QMmips2 /QMFPE /M$(CECrtMTDebug) /c +LIB32=link.exe -lib +# ADD BASE LIB32 /nologo +# ADD LIB32 /nologo +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo + +!ELSEIF "$(CFG)" == "libmilenage - Win32 (WCE SH4) Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "output\SH4Rel" +# PROP BASE Intermediate_Dir "output\SH4Rel" +# PROP BASE CPU_ID "{D6519021-710F-11D3-99F2-00105A0DF099}" +# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" +# PROP BASE Target_Dir "output\" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "output\SH4Rel" +# PROP Intermediate_Dir "output\SH4Rel" +# PROP CPU_ID "{D6519021-710F-11D3-99F2-00105A0DF099}" +# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" +# PROP Target_Dir "output\" +CPP=shcl.exe +# ADD BASE CPP /nologo /W3 /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "SHx" /D "SH4" /D "_SH4_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "NDEBUG" /D "_LIB" /YX /Qsh4 /O2 /M$(CECrtMT) /c +# ADD CPP /nologo /W3 /I "../../../pjlib/include" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "SHx" /D "SH4" /D "_SH4_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "NDEBUG" /D "_LIB" /YX /Qsh4 /O2 /M$(CECrtMT) /c +LIB32=link.exe -lib +# ADD BASE LIB32 /nologo +# ADD LIB32 /nologo +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo + +!ELSEIF "$(CFG)" == "libmilenage - Win32 (WCE SH4) Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "output\SH4Dbg" +# PROP BASE Intermediate_Dir "output\SH4Dbg" +# PROP BASE CPU_ID "{D6519021-710F-11D3-99F2-00105A0DF099}" +# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" +# PROP BASE Target_Dir "output\" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "output\SH4Dbg" +# PROP Intermediate_Dir "output\SH4Dbg" +# PROP CPU_ID "{D6519021-710F-11D3-99F2-00105A0DF099}" +# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" +# PROP Target_Dir "output\" +CPP=shcl.exe +# ADD BASE CPP /nologo /W3 /Zi /Od /D "DEBUG" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "SHx" /D "SH4" /D "_SH4_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "_LIB" /YX /Qsh4 /M$(CECrtMTDebug) /c +# ADD CPP /nologo /W3 /Zi /Od /I "../../../pjlib/include" /D "DEBUG" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "SHx" /D "SH4" /D "_SH4_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "_LIB" /YX /Qsh4 /M$(CECrtMTDebug) /c +LIB32=link.exe -lib +# ADD BASE LIB32 /nologo +# ADD LIB32 /nologo +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo + +!ELSEIF "$(CFG)" == "libmilenage - Win32 (WCE SH3) Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "output\SH3Rel" +# PROP BASE Intermediate_Dir "output\SH3Rel" +# PROP BASE CPU_ID "{D6519020-710F-11D3-99F2-00105A0DF099}" +# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" +# PROP BASE Target_Dir "output\" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "output\SH3Rel" +# PROP Intermediate_Dir "output\SH3Rel" +# PROP CPU_ID "{D6519020-710F-11D3-99F2-00105A0DF099}" +# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" +# PROP Target_Dir "output\" +CPP=shcl.exe +# ADD BASE CPP /nologo /W3 /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "SHx" /D "SH3" /D "_SH3_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "NDEBUG" /D "_LIB" /YX /O2 /M$(CECrtMT) /c +# ADD CPP /nologo /W3 /I "../../../pjlib/include" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "SHx" /D "SH3" /D "_SH3_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "NDEBUG" /D "_LIB" /YX /O2 /M$(CECrtMT) /c +LIB32=link.exe -lib +# ADD BASE LIB32 /nologo +# ADD LIB32 /nologo +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo + +!ELSEIF "$(CFG)" == "libmilenage - Win32 (WCE SH3) Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "output\SH3Dbg" +# PROP BASE Intermediate_Dir "output\SH3Dbg" +# PROP BASE CPU_ID "{D6519020-710F-11D3-99F2-00105A0DF099}" +# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" +# PROP BASE Target_Dir "output\" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "output\SH3Dbg" +# PROP Intermediate_Dir "output\SH3Dbg" +# PROP CPU_ID "{D6519020-710F-11D3-99F2-00105A0DF099}" +# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" +# PROP Target_Dir "output\" +CPP=shcl.exe +# ADD BASE CPP /nologo /W3 /Zi /Od /D "DEBUG" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "SHx" /D "SH3" /D "_SH3_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "_LIB" /YX /M$(CECrtMTDebug) /c +# ADD CPP /nologo /W3 /Zi /Od /I "../../../pjlib/include" /D "DEBUG" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "SHx" /D "SH3" /D "_SH3_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "_LIB" /YX /M$(CECrtMTDebug) /c +LIB32=link.exe -lib +# ADD BASE LIB32 /nologo +# ADD LIB32 /nologo +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo + +!ELSEIF "$(CFG)" == "libmilenage - Win32 (WCE MIPSIV) Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "output\MIPSIVRel" +# PROP BASE Intermediate_Dir "output\MIPSIVRel" +# PROP BASE CPU_ID "{0B2FE524-26C5-4194-8CEF-B1582DEB5A98}" +# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" +# PROP BASE Target_Dir "output\" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "output\MIPSIVRel" +# PROP Intermediate_Dir "output\MIPSIVRel" +# PROP CPU_ID "{0B2FE524-26C5-4194-8CEF-B1582DEB5A98}" +# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" +# PROP Target_Dir "output\" +CPP=clmips.exe +# ADD BASE CPP /nologo /W3 /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "MIPS" /D "_MIPS_" /D "_MIPS64" /D "R4000" /D "MIPSIV" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "NDEBUG" /D "_LIB" /YX /QMmips4 /QMn32 /QMFPE /O2 /M$(CECrtMT) /c +# ADD CPP /nologo /W3 /I "../../../pjlib/include" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "MIPS" /D "_MIPS_" /D "_MIPS64" /D "R4000" /D "MIPSIV" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "NDEBUG" /D "_LIB" /YX /QMmips4 /QMn32 /QMFPE /O2 /M$(CECrtMT) /c +LIB32=link.exe -lib +# ADD BASE LIB32 /nologo +# ADD LIB32 /nologo +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo + +!ELSEIF "$(CFG)" == "libmilenage - Win32 (WCE MIPSIV) Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "output\MIPSIVDbg" +# PROP BASE Intermediate_Dir "output\MIPSIVDbg" +# PROP BASE CPU_ID "{0B2FE524-26C5-4194-8CEF-B1582DEB5A98}" +# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" +# PROP BASE Target_Dir "output\" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "output\MIPSIVDbg" +# PROP Intermediate_Dir "output\MIPSIVDbg" +# PROP CPU_ID "{0B2FE524-26C5-4194-8CEF-B1582DEB5A98}" +# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" +# PROP Target_Dir "output\" +CPP=clmips.exe +# ADD BASE CPP /nologo /W3 /Zi /Od /D "DEBUG" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "MIPS" /D "_MIPS_" /D "_MIPS64" /D "R4000" /D "MIPSIV" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "_LIB" /YX /QMmips4 /QMn32 /QMFPE /M$(CECrtMTDebug) /c +# ADD CPP /nologo /W3 /Zi /Od /I "../../../pjlib/include" /D "DEBUG" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "MIPS" /D "_MIPS_" /D "_MIPS64" /D "R4000" /D "MIPSIV" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "_LIB" /YX /QMmips4 /QMn32 /QMFPE /M$(CECrtMTDebug) /c +LIB32=link.exe -lib +# ADD BASE LIB32 /nologo +# ADD LIB32 /nologo +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo + +!ELSEIF "$(CFG)" == "libmilenage - Win32 (WCE emulator) Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "output\emulatorRel" +# PROP BASE Intermediate_Dir "output\emulatorRel" +# PROP BASE CPU_ID "{32E52003-403E-442D-BE48-DE10F8C6131D}" +# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" +# PROP BASE Target_Dir "output\" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "output\emulatorRel" +# PROP Intermediate_Dir "output\emulatorRel" +# PROP CPU_ID "{32E52003-403E-442D-BE48-DE10F8C6131D}" +# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" +# PROP Target_Dir "output\" +CPP=cl.exe +# ADD BASE CPP /nologo /W3 /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "_i386_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "_X86_" /D "x86" /D "NDEBUG" /D "_LIB" /YX /Gs8192 /GF /O2 /c +# ADD CPP /nologo /W3 /I "../../../pjlib/include" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "_i386_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "_X86_" /D "x86" /D "NDEBUG" /D "_LIB" /YX /Gs8192 /GF /O2 /c +LIB32=link.exe -lib +# ADD BASE LIB32 /nologo +# ADD LIB32 /nologo +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo + +!ELSEIF "$(CFG)" == "libmilenage - Win32 (WCE emulator) Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "output\emulatorDbg" +# PROP BASE Intermediate_Dir "output\emulatorDbg" +# PROP BASE CPU_ID "{32E52003-403E-442D-BE48-DE10F8C6131D}" +# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" +# PROP BASE Target_Dir "output\" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "output\emulatorDbg" +# PROP Intermediate_Dir "output\emulatorDbg" +# PROP CPU_ID "{32E52003-403E-442D-BE48-DE10F8C6131D}" +# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" +# PROP Target_Dir "output\" +CPP=cl.exe +# ADD BASE CPP /nologo /W3 /Zi /Od /D "DEBUG" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "_i386_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "_X86_" /D "x86" /D "_LIB" /YX /Gs8192 /GF /c +# ADD CPP /nologo /W3 /Zi /Od /I "../../../pjlib/include" /D "DEBUG" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "_i386_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "_X86_" /D "x86" /D "_LIB" /YX /Gs8192 /GF /c +LIB32=link.exe -lib +# ADD BASE LIB32 /nologo +# ADD LIB32 /nologo +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo + +!ELSEIF "$(CFG)" == "libmilenage - Win32 (WCE ARMV4I) Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "output\ARMV4IRel" +# PROP BASE Intermediate_Dir "output\ARMV4IRel" +# PROP BASE CPU_ID "{DC70F430-E78B-494F-A9D5-62ADC56443B8}" +# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" +# PROP BASE Target_Dir "output\" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "output\ARMV4IRel" +# PROP Intermediate_Dir "output\ARMV4IRel" +# PROP CPU_ID "{DC70F430-E78B-494F-A9D5-62ADC56443B8}" +# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" +# PROP Target_Dir "output\" +CPP=clarm.exe +# ADD BASE CPP /nologo /W3 /D _WIN32_WCE=$(CEVersion) /D "ARM" /D "_ARM_" /D "$(CePlatform)" /D "ARMV4I" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "NDEBUG" /D "_LIB" /YX /QRarch4T /QRinterwork-return /O2 /M$(CECrtMT) /c +# ADD CPP /nologo /W3 /I "../../../pjlib/include" /D _WIN32_WCE=$(CEVersion) /D "ARM" /D "_ARM_" /D "$(CePlatform)" /D "ARMV4I" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "NDEBUG" /D "_LIB" /YX /QRarch4T /QRinterwork-return /O2 /M$(CECrtMT) /c +LIB32=link.exe -lib +# ADD BASE LIB32 /nologo +# ADD LIB32 /nologo +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo + +!ELSEIF "$(CFG)" == "libmilenage - Win32 (WCE ARMV4I) Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "output\ARMV4IDbg" +# PROP BASE Intermediate_Dir "output\ARMV4IDbg" +# PROP BASE CPU_ID "{DC70F430-E78B-494F-A9D5-62ADC56443B8}" +# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" +# PROP BASE Target_Dir "output\" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "output\ARMV4IDbg" +# PROP Intermediate_Dir "output\ARMV4IDbg" +# PROP CPU_ID "{DC70F430-E78B-494F-A9D5-62ADC56443B8}" +# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" +# PROP Target_Dir "output\" +CPP=clarm.exe +# ADD BASE CPP /nologo /W3 /Zi /Od /D "DEBUG" /D _WIN32_WCE=$(CEVersion) /D "ARM" /D "_ARM_" /D "$(CePlatform)" /D "ARMV4I" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "_LIB" /YX /QRarch4T /QRinterwork-return /M$(CECrtMTDebug) /c +# ADD CPP /nologo /W3 /Zi /Od /I "../../../pjlib/include" /D "DEBUG" /D _WIN32_WCE=$(CEVersion) /D "ARM" /D "_ARM_" /D "$(CePlatform)" /D "ARMV4I" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "_LIB" /YX /QRarch4T /QRinterwork-return /M$(CECrtMTDebug) /c +LIB32=link.exe -lib +# ADD BASE LIB32 /nologo +# ADD LIB32 /nologo +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo + +!ELSEIF "$(CFG)" == "libmilenage - Win32 (WCE MIPSIV_FP) Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "output\MIPSIV_FPRel" +# PROP BASE Intermediate_Dir "output\MIPSIV_FPRel" +# PROP BASE CPU_ID "{046A430D-7770-48AB-89B5-24C2D300B03F}" +# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" +# PROP BASE Target_Dir "output\" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "output\MIPSIV_FPRel" +# PROP Intermediate_Dir "output\MIPSIV_FPRel" +# PROP CPU_ID "{046A430D-7770-48AB-89B5-24C2D300B03F}" +# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" +# PROP Target_Dir "output\" +CPP=clmips.exe +# ADD BASE CPP /nologo /W3 /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "MIPS" /D "_MIPS_" /D "_MIPS64" /D "R4000" /D "MIPSIV" /D "MIPSIV_FP" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "NDEBUG" /D "_LIB" /YX /QMmips4 /QMn32 /QMFPE- /O2 /M$(CECrtMT) /c +# ADD CPP /nologo /W3 /I "../../../pjlib/include" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "MIPS" /D "_MIPS_" /D "_MIPS64" /D "R4000" /D "MIPSIV" /D "MIPSIV_FP" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "NDEBUG" /D "_LIB" /YX /QMmips4 /QMn32 /QMFPE- /O2 /M$(CECrtMT) /c +LIB32=link.exe -lib +# ADD BASE LIB32 /nologo +# ADD LIB32 /nologo +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo + +!ELSEIF "$(CFG)" == "libmilenage - Win32 (WCE MIPSIV_FP) Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "output\MIPSIV_FPDbg" +# PROP BASE Intermediate_Dir "output\MIPSIV_FPDbg" +# PROP BASE CPU_ID "{046A430D-7770-48AB-89B5-24C2D300B03F}" +# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" +# PROP BASE Target_Dir "output\" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "output\MIPSIV_FPDbg" +# PROP Intermediate_Dir "output\MIPSIV_FPDbg" +# PROP CPU_ID "{046A430D-7770-48AB-89B5-24C2D300B03F}" +# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" +# PROP Target_Dir "output\" +CPP=clmips.exe +# ADD BASE CPP /nologo /W3 /Zi /Od /D "DEBUG" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "MIPS" /D "_MIPS_" /D "_MIPS64" /D "R4000" /D "MIPSIV" /D "MIPSIV_FP" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "_LIB" /YX /QMmips4 /QMn32 /QMFPE- /M$(CECrtMTDebug) /c +# ADD CPP /nologo /W3 /Zi /Od /I "../../../pjlib/include" /D "DEBUG" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "MIPS" /D "_MIPS_" /D "_MIPS64" /D "R4000" /D "MIPSIV" /D "MIPSIV_FP" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "_LIB" /YX /QMmips4 /QMn32 /QMFPE- /M$(CECrtMTDebug) /c +LIB32=link.exe -lib +# ADD BASE LIB32 /nologo +# ADD LIB32 /nologo +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo + +!ELSEIF "$(CFG)" == "libmilenage - Win32 (WCE ARMV4) Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "output\ARMV4Rel" +# PROP BASE Intermediate_Dir "output\ARMV4Rel" +# PROP BASE CPU_ID "{ECBEA43D-CD7B-4852-AD55-D4227B5D624B}" +# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" +# PROP BASE Target_Dir "output\" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "output\ARMV4Rel" +# PROP Intermediate_Dir "output\ARMV4Rel" +# PROP CPU_ID "{ECBEA43D-CD7B-4852-AD55-D4227B5D624B}" +# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" +# PROP Target_Dir "output\" +CPP=clarm.exe +# ADD BASE CPP /nologo /W3 /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "NDEBUG" /D "ARM" /D "_ARM_" /D "ARMV4" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "_LIB" /YX /O2 /M$(CECrtMT) /c +# ADD CPP /nologo /W3 /I "../../../pjlib/include" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "NDEBUG" /D "ARM" /D "_ARM_" /D "ARMV4" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "_LIB" /YX /O2 /M$(CECrtMT) /c +LIB32=link.exe -lib +# ADD BASE LIB32 /nologo +# ADD LIB32 /nologo +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo + +!ELSEIF "$(CFG)" == "libmilenage - Win32 (WCE ARMV4) Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "output\ARMV4Dbg" +# PROP BASE Intermediate_Dir "output\ARMV4Dbg" +# PROP BASE CPU_ID "{ECBEA43D-CD7B-4852-AD55-D4227B5D624B}" +# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" +# PROP BASE Target_Dir "output\" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "output\ARMV4Dbg" +# PROP Intermediate_Dir "output\ARMV4Dbg" +# PROP CPU_ID "{ECBEA43D-CD7B-4852-AD55-D4227B5D624B}" +# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" +# PROP Target_Dir "output\" +CPP=clarm.exe +# ADD BASE CPP /nologo /W3 /Zi /Od /D "DEBUG" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "ARM" /D "_ARM_" /D "ARMV4" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "_LIB" /YX /M$(CECrtMTDebug) /c +# ADD CPP /nologo /W3 /Zi /Od /I "../../../pjlib/include" /D "DEBUG" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "ARM" /D "_ARM_" /D "ARMV4" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "_LIB" /YX /M$(CECrtMTDebug) /c +LIB32=link.exe -lib +# ADD BASE LIB32 /nologo +# ADD LIB32 /nologo +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo + +!ELSEIF "$(CFG)" == "libmilenage - Win32 (WCE MIPS16) Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "output\MIPS16Rel" +# PROP BASE Intermediate_Dir "output\MIPS16Rel" +# PROP BASE CPU_ID "{D6519013-710F-11D3-99F2-00105A0DF099}" +# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" +# PROP BASE Target_Dir "output\" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "output\MIPS16Rel" +# PROP Intermediate_Dir "output\MIPS16Rel" +# PROP CPU_ID "{D6519013-710F-11D3-99F2-00105A0DF099}" +# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" +# PROP Target_Dir "output\" +CPP=clmips.exe +# ADD BASE CPP /nologo /W3 /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "MIPS" /D "_MIPS_" /D "R4000" /D "MIPSII" /D "MIPS16" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "NDEBUG" /D "_MIPS16_" /D "MIPS16SUPPORT" /D "_LIB" /YX /QMmips16 /O2 /M$(CECrtMT) /c +# ADD CPP /nologo /W3 /I "../../../pjlib/include" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "MIPS" /D "_MIPS_" /D "R4000" /D "MIPSII" /D "MIPS16" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "NDEBUG" /D "_MIPS16_" /D "MIPS16SUPPORT" /D "_LIB" /YX /QMmips16 /O2 /M$(CECrtMT) /c +LIB32=link.exe -lib +# ADD BASE LIB32 /nologo +# ADD LIB32 /nologo +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo + +!ELSEIF "$(CFG)" == "libmilenage - Win32 (WCE MIPS16) Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "output\MIPS16Dbg" +# PROP BASE Intermediate_Dir "output\MIPS16Dbg" +# PROP BASE CPU_ID "{D6519013-710F-11D3-99F2-00105A0DF099}" +# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" +# PROP BASE Target_Dir "output\" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "output\MIPS16Dbg" +# PROP Intermediate_Dir "output\MIPS16Dbg" +# PROP CPU_ID "{D6519013-710F-11D3-99F2-00105A0DF099}" +# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" +# PROP Target_Dir "output\" +CPP=clmips.exe +# ADD BASE CPP /nologo /W3 /Zi /Od /D "DEBUG" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "MIPS" /D "_MIPS_" /D "R4000" /D "MIPSII" /D "MIPS16" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "_MIPS16_" /D "MIPS16SUPPORT" /D "_LIB" /YX /QMmips16 /M$(CECrtMTDebug) /c +# ADD CPP /nologo /W3 /Zi /Od /I "../../../pjlib/include" /D "DEBUG" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "MIPS" /D "_MIPS_" /D "R4000" /D "MIPSII" /D "MIPS16" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "_MIPS16_" /D "MIPS16SUPPORT" /D "_LIB" /YX /QMmips16 /M$(CECrtMTDebug) /c +LIB32=link.exe -lib +# ADD BASE LIB32 /nologo +# ADD LIB32 /nologo +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo + +!ELSEIF "$(CFG)" == "libmilenage - Win32 (WCE ARMV4T) Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "output\ARMV4TRel" +# PROP BASE Intermediate_Dir "output\ARMV4TRel" +# PROP BASE CPU_ID "{F52316A9-3B7C-4FE7-A67F-68350B41240D}" +# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" +# PROP BASE Target_Dir "output\" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "output\ARMV4TRel" +# PROP Intermediate_Dir "output\ARMV4TRel" +# PROP CPU_ID "{F52316A9-3B7C-4FE7-A67F-68350B41240D}" +# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" +# PROP Target_Dir "output\" +CPP=clthumb.exe +# ADD BASE CPP /nologo /W3 /D _WIN32_WCE=$(CEVersion) /D "ARM" /D "_ARM_" /D "$(CePlatform)" /D "THUMB" /D "_THUMB_" /D "ARMV4T" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "NDEBUG" /D "_LIB" /YX /QRarch4T /QRinterwork-return /O2 /M$(CECrtMT) /c +# ADD CPP /nologo /W3 /I "../../../pjlib/include" /D _WIN32_WCE=$(CEVersion) /D "ARM" /D "_ARM_" /D "$(CePlatform)" /D "THUMB" /D "_THUMB_" /D "ARMV4T" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "NDEBUG" /D "_LIB" /YX /QRarch4T /QRinterwork-return /O2 /M$(CECrtMT) /c +LIB32=link.exe -lib +# ADD BASE LIB32 /nologo +# ADD LIB32 /nologo +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo + +!ELSEIF "$(CFG)" == "libmilenage - Win32 (WCE ARMV4T) Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "output\ARMV4TDbg" +# PROP BASE Intermediate_Dir "output\ARMV4TDbg" +# PROP BASE CPU_ID "{F52316A9-3B7C-4FE7-A67F-68350B41240D}" +# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" +# PROP BASE Target_Dir "output\" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "output\ARMV4TDbg" +# PROP Intermediate_Dir "output\ARMV4TDbg" +# PROP CPU_ID "{F52316A9-3B7C-4FE7-A67F-68350B41240D}" +# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" +# PROP Target_Dir "output\" +CPP=clthumb.exe +# ADD BASE CPP /nologo /W3 /Zi /Od /D "DEBUG" /D _WIN32_WCE=$(CEVersion) /D "ARM" /D "_ARM_" /D "$(CePlatform)" /D "THUMB" /D "_THUMB_" /D "ARMV4T" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "_LIB" /YX /QRarch4T /QRinterwork-return /M$(CECrtMTDebug) /c +# ADD CPP /nologo /W3 /Zi /Od /I "../../../pjlib/include" /D "DEBUG" /D _WIN32_WCE=$(CEVersion) /D "ARM" /D "_ARM_" /D "$(CePlatform)" /D "THUMB" /D "_THUMB_" /D "ARMV4T" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "_LIB" /YX /QRarch4T /QRinterwork-return /M$(CECrtMTDebug) /c +LIB32=link.exe -lib +# ADD BASE LIB32 /nologo +# ADD LIB32 /nologo +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo + +!ELSEIF "$(CFG)" == "libmilenage - Win32 (WCE x86) Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "output\X86Rel" +# PROP BASE Intermediate_Dir "output\X86Rel" +# PROP BASE CPU_ID "{D6518FF3-710F-11D3-99F2-00105A0DF099}" +# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" +# PROP BASE Target_Dir "output\" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "output\X86Rel" +# PROP Intermediate_Dir "output\X86Rel" +# PROP CPU_ID "{D6518FF3-710F-11D3-99F2-00105A0DF099}" +# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" +# PROP Target_Dir "output\" +CPP=cl.exe +# ADD BASE CPP /nologo /W3 /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "_i386_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "_X86_" /D "x86" /D "NDEBUG" /D "_LIB" /YX /Gs8192 /GF /O2 /c +# ADD CPP /nologo /W3 /I "../../../pjlib/include" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "_i386_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "_X86_" /D "x86" /D "NDEBUG" /D "_LIB" /YX /Gs8192 /GF /O2 /c +LIB32=link.exe -lib +# ADD BASE LIB32 /nologo +# ADD LIB32 /nologo +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo + +!ELSEIF "$(CFG)" == "libmilenage - Win32 (WCE x86) Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "output\X86Dbg" +# PROP BASE Intermediate_Dir "output\X86Dbg" +# PROP BASE CPU_ID "{D6518FF3-710F-11D3-99F2-00105A0DF099}" +# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" +# PROP BASE Target_Dir "output\" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "output\X86Dbg" +# PROP Intermediate_Dir "output\X86Dbg" +# PROP CPU_ID "{D6518FF3-710F-11D3-99F2-00105A0DF099}" +# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" +# PROP Target_Dir "output\" +CPP=cl.exe +# ADD BASE CPP /nologo /W3 /Zi /Od /D "DEBUG" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "_i386_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "_X86_" /D "x86" /D "_LIB" /YX /Gs8192 /GF /c +# ADD CPP /nologo /W3 /Zi /Od /I "../../../pjlib/include" /D "DEBUG" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "_i386_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "_X86_" /D "x86" /D "_LIB" /YX /Gs8192 /GF /c +LIB32=link.exe -lib +# ADD BASE LIB32 /nologo +# ADD LIB32 /nologo +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo + +!ENDIF + +# Begin Target + +# Name "libmilenage - Win32 (WCE MIPSII_FP) Release" +# Name "libmilenage - Win32 (WCE MIPSII_FP) Debug" +# Name "libmilenage - Win32 (WCE MIPSII) Release" +# Name "libmilenage - Win32 (WCE MIPSII) Debug" +# Name "libmilenage - Win32 (WCE SH4) Release" +# Name "libmilenage - Win32 (WCE SH4) Debug" +# Name "libmilenage - Win32 (WCE SH3) Release" +# Name "libmilenage - Win32 (WCE SH3) Debug" +# Name "libmilenage - Win32 (WCE MIPSIV) Release" +# Name "libmilenage - Win32 (WCE MIPSIV) Debug" +# Name "libmilenage - Win32 (WCE emulator) Release" +# Name "libmilenage - Win32 (WCE emulator) Debug" +# Name "libmilenage - Win32 (WCE ARMV4I) Release" +# Name "libmilenage - Win32 (WCE ARMV4I) Debug" +# Name "libmilenage - Win32 (WCE MIPSIV_FP) Release" +# Name "libmilenage - Win32 (WCE MIPSIV_FP) Debug" +# Name "libmilenage - Win32 (WCE ARMV4) Release" +# Name "libmilenage - Win32 (WCE ARMV4) Debug" +# Name "libmilenage - Win32 (WCE MIPS16) Release" +# Name "libmilenage - Win32 (WCE MIPS16) Debug" +# Name "libmilenage - Win32 (WCE ARMV4T) Release" +# Name "libmilenage - Win32 (WCE ARMV4T) Debug" +# Name "libmilenage - Win32 (WCE x86) Release" +# Name "libmilenage - Win32 (WCE x86) Debug" +# Begin Group "Source Files" + +# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" +# Begin Source File + +SOURCE=..\..\milenage\milenage.c + +!IF "$(CFG)" == "libmilenage - Win32 (WCE MIPSII_FP) Release" + +DEP_CPP_MILEN=\ + "..\..\milenage\milenage.h"\ + "..\..\milenage\rijndael.h"\ + + +!ELSEIF "$(CFG)" == "libmilenage - Win32 (WCE MIPSII_FP) Debug" + +DEP_CPP_MILEN=\ + "..\..\milenage\milenage.h"\ + "..\..\milenage\rijndael.h"\ + + +!ELSEIF "$(CFG)" == "libmilenage - Win32 (WCE MIPSII) Release" + +DEP_CPP_MILEN=\ + "..\..\milenage\milenage.h"\ + "..\..\milenage\rijndael.h"\ + + +!ELSEIF "$(CFG)" == "libmilenage - Win32 (WCE MIPSII) Debug" + +DEP_CPP_MILEN=\ + "..\..\milenage\milenage.h"\ + "..\..\milenage\rijndael.h"\ + + +!ELSEIF "$(CFG)" == "libmilenage - Win32 (WCE SH4) Release" + +DEP_CPP_MILEN=\ + "..\..\milenage\milenage.h"\ + "..\..\milenage\rijndael.h"\ + + +!ELSEIF "$(CFG)" == "libmilenage - Win32 (WCE SH4) Debug" + +DEP_CPP_MILEN=\ + "..\..\milenage\milenage.h"\ + "..\..\milenage\rijndael.h"\ + + +!ELSEIF "$(CFG)" == "libmilenage - Win32 (WCE SH3) Release" + +DEP_CPP_MILEN=\ + "..\..\milenage\milenage.h"\ + "..\..\milenage\rijndael.h"\ + + +!ELSEIF "$(CFG)" == "libmilenage - Win32 (WCE SH3) Debug" + +DEP_CPP_MILEN=\ + "..\..\milenage\milenage.h"\ + "..\..\milenage\rijndael.h"\ + + +!ELSEIF "$(CFG)" == "libmilenage - Win32 (WCE MIPSIV) Release" + +DEP_CPP_MILEN=\ + "..\..\milenage\milenage.h"\ + "..\..\milenage\rijndael.h"\ + + +!ELSEIF "$(CFG)" == "libmilenage - Win32 (WCE MIPSIV) Debug" + +DEP_CPP_MILEN=\ + "..\..\milenage\milenage.h"\ + "..\..\milenage\rijndael.h"\ + + +!ELSEIF "$(CFG)" == "libmilenage - Win32 (WCE emulator) Release" + +DEP_CPP_MILEN=\ + "..\..\milenage\milenage.h"\ + "..\..\milenage\rijndael.h"\ + + +!ELSEIF "$(CFG)" == "libmilenage - Win32 (WCE emulator) Debug" + +DEP_CPP_MILEN=\ + "..\..\milenage\milenage.h"\ + "..\..\milenage\rijndael.h"\ + + +!ELSEIF "$(CFG)" == "libmilenage - Win32 (WCE ARMV4I) Release" + +DEP_CPP_MILEN=\ + "..\..\milenage\milenage.h"\ + "..\..\milenage\rijndael.h"\ + + +!ELSEIF "$(CFG)" == "libmilenage - Win32 (WCE ARMV4I) Debug" + +DEP_CPP_MILEN=\ + "..\..\milenage\milenage.h"\ + "..\..\milenage\rijndael.h"\ + + +!ELSEIF "$(CFG)" == "libmilenage - Win32 (WCE MIPSIV_FP) Release" + +DEP_CPP_MILEN=\ + "..\..\milenage\milenage.h"\ + "..\..\milenage\rijndael.h"\ + + +!ELSEIF "$(CFG)" == "libmilenage - Win32 (WCE MIPSIV_FP) Debug" + +DEP_CPP_MILEN=\ + "..\..\milenage\milenage.h"\ + "..\..\milenage\rijndael.h"\ + + +!ELSEIF "$(CFG)" == "libmilenage - Win32 (WCE ARMV4) Release" + +DEP_CPP_MILEN=\ + "..\..\milenage\milenage.h"\ + "..\..\milenage\rijndael.h"\ + + +!ELSEIF "$(CFG)" == "libmilenage - Win32 (WCE ARMV4) Debug" + +DEP_CPP_MILEN=\ + "..\..\milenage\milenage.h"\ + "..\..\milenage\rijndael.h"\ + + +!ELSEIF "$(CFG)" == "libmilenage - Win32 (WCE MIPS16) Release" + +DEP_CPP_MILEN=\ + "..\..\milenage\milenage.h"\ + "..\..\milenage\rijndael.h"\ + + +!ELSEIF "$(CFG)" == "libmilenage - Win32 (WCE MIPS16) Debug" + +DEP_CPP_MILEN=\ + "..\..\milenage\milenage.h"\ + "..\..\milenage\rijndael.h"\ + + +!ELSEIF "$(CFG)" == "libmilenage - Win32 (WCE ARMV4T) Release" + +DEP_CPP_MILEN=\ + "..\..\milenage\milenage.h"\ + "..\..\milenage\rijndael.h"\ + + +!ELSEIF "$(CFG)" == "libmilenage - Win32 (WCE ARMV4T) Debug" + +DEP_CPP_MILEN=\ + "..\..\milenage\milenage.h"\ + "..\..\milenage\rijndael.h"\ + + +!ELSEIF "$(CFG)" == "libmilenage - Win32 (WCE x86) Release" + +DEP_CPP_MILEN=\ + "..\..\milenage\milenage.h"\ + "..\..\milenage\rijndael.h"\ + + +!ELSEIF "$(CFG)" == "libmilenage - Win32 (WCE x86) Debug" + +DEP_CPP_MILEN=\ + "..\..\milenage\milenage.h"\ + "..\..\milenage\rijndael.h"\ + + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=..\..\milenage\rijndael.c + +!IF "$(CFG)" == "libmilenage - Win32 (WCE MIPSII_FP) Release" + +DEP_CPP_RIJND=\ + "..\..\..\pjlib\include\pj\compat\cc_armcc.h"\ + "..\..\..\pjlib\include\pj\compat\cc_codew.h"\ + "..\..\..\pjlib\include\pj\compat\cc_gcc.h"\ + "..\..\..\pjlib\include\pj\compat\cc_gcce.h"\ + "..\..\..\pjlib\include\pj\compat\cc_msvc.h"\ + "..\..\..\pjlib\include\pj\compat\cc_mwcc.h"\ + "..\..\..\pjlib\include\pj\compat\m_auto.h"\ + "..\..\..\pjlib\include\pj\compat\os_auto.h"\ + "..\..\..\pjlib\include\pj\compat\os_darwinos.h"\ + "..\..\..\pjlib\include\pj\compat\os_linux.h"\ + "..\..\..\pjlib\include\pj\compat\os_linux_kernel.h"\ + "..\..\..\pjlib\include\pj\compat\os_palmos.h"\ + "..\..\..\pjlib\include\pj\compat\os_rtems.h"\ + "..\..\..\pjlib\include\pj\compat\os_sunos.h"\ + "..\..\..\pjlib\include\pj\compat\os_symbian.h"\ + "..\..\..\pjlib\include\pj\compat\os_win32.h"\ + "..\..\..\pjlib\include\pj\compat\os_win32_wince.h"\ + "..\..\..\pjlib\include\pj\compat\size_t.h"\ + "..\..\..\pjlib\include\pj\config.h"\ + "..\..\..\pjlib\include\pj\config_site.h"\ + "..\..\..\pjlib\include\pj\config_site_sample.h"\ + "..\..\..\pjlib\include\pj\types.h"\ + + +!ELSEIF "$(CFG)" == "libmilenage - Win32 (WCE MIPSII_FP) Debug" + +DEP_CPP_RIJND=\ + "..\..\..\pjlib\include\pj\compat\cc_armcc.h"\ + "..\..\..\pjlib\include\pj\compat\cc_codew.h"\ + "..\..\..\pjlib\include\pj\compat\cc_gcc.h"\ + "..\..\..\pjlib\include\pj\compat\cc_gcce.h"\ + "..\..\..\pjlib\include\pj\compat\cc_msvc.h"\ + "..\..\..\pjlib\include\pj\compat\cc_mwcc.h"\ + "..\..\..\pjlib\include\pj\compat\m_auto.h"\ + "..\..\..\pjlib\include\pj\compat\os_auto.h"\ + "..\..\..\pjlib\include\pj\compat\os_darwinos.h"\ + "..\..\..\pjlib\include\pj\compat\os_linux.h"\ + "..\..\..\pjlib\include\pj\compat\os_linux_kernel.h"\ + "..\..\..\pjlib\include\pj\compat\os_palmos.h"\ + "..\..\..\pjlib\include\pj\compat\os_rtems.h"\ + "..\..\..\pjlib\include\pj\compat\os_sunos.h"\ + "..\..\..\pjlib\include\pj\compat\os_symbian.h"\ + "..\..\..\pjlib\include\pj\compat\os_win32.h"\ + "..\..\..\pjlib\include\pj\compat\os_win32_wince.h"\ + "..\..\..\pjlib\include\pj\compat\size_t.h"\ + "..\..\..\pjlib\include\pj\config.h"\ + "..\..\..\pjlib\include\pj\config_site.h"\ + "..\..\..\pjlib\include\pj\config_site_sample.h"\ + "..\..\..\pjlib\include\pj\types.h"\ + + +!ELSEIF "$(CFG)" == "libmilenage - Win32 (WCE MIPSII) Release" + +DEP_CPP_RIJND=\ + "..\..\..\pjlib\include\pj\compat\cc_armcc.h"\ + "..\..\..\pjlib\include\pj\compat\cc_codew.h"\ + "..\..\..\pjlib\include\pj\compat\cc_gcc.h"\ + "..\..\..\pjlib\include\pj\compat\cc_gcce.h"\ + "..\..\..\pjlib\include\pj\compat\cc_msvc.h"\ + "..\..\..\pjlib\include\pj\compat\cc_mwcc.h"\ + "..\..\..\pjlib\include\pj\compat\m_auto.h"\ + "..\..\..\pjlib\include\pj\compat\os_auto.h"\ + "..\..\..\pjlib\include\pj\compat\os_darwinos.h"\ + "..\..\..\pjlib\include\pj\compat\os_linux.h"\ + "..\..\..\pjlib\include\pj\compat\os_linux_kernel.h"\ + "..\..\..\pjlib\include\pj\compat\os_palmos.h"\ + "..\..\..\pjlib\include\pj\compat\os_rtems.h"\ + "..\..\..\pjlib\include\pj\compat\os_sunos.h"\ + "..\..\..\pjlib\include\pj\compat\os_symbian.h"\ + "..\..\..\pjlib\include\pj\compat\os_win32.h"\ + "..\..\..\pjlib\include\pj\compat\os_win32_wince.h"\ + "..\..\..\pjlib\include\pj\compat\size_t.h"\ + "..\..\..\pjlib\include\pj\config.h"\ + "..\..\..\pjlib\include\pj\config_site.h"\ + "..\..\..\pjlib\include\pj\config_site_sample.h"\ + "..\..\..\pjlib\include\pj\types.h"\ + + +!ELSEIF "$(CFG)" == "libmilenage - Win32 (WCE MIPSII) Debug" + +DEP_CPP_RIJND=\ + "..\..\..\pjlib\include\pj\compat\cc_armcc.h"\ + "..\..\..\pjlib\include\pj\compat\cc_codew.h"\ + "..\..\..\pjlib\include\pj\compat\cc_gcc.h"\ + "..\..\..\pjlib\include\pj\compat\cc_gcce.h"\ + "..\..\..\pjlib\include\pj\compat\cc_msvc.h"\ + "..\..\..\pjlib\include\pj\compat\cc_mwcc.h"\ + "..\..\..\pjlib\include\pj\compat\m_auto.h"\ + "..\..\..\pjlib\include\pj\compat\os_auto.h"\ + "..\..\..\pjlib\include\pj\compat\os_darwinos.h"\ + "..\..\..\pjlib\include\pj\compat\os_linux.h"\ + "..\..\..\pjlib\include\pj\compat\os_linux_kernel.h"\ + "..\..\..\pjlib\include\pj\compat\os_palmos.h"\ + "..\..\..\pjlib\include\pj\compat\os_rtems.h"\ + "..\..\..\pjlib\include\pj\compat\os_sunos.h"\ + "..\..\..\pjlib\include\pj\compat\os_symbian.h"\ + "..\..\..\pjlib\include\pj\compat\os_win32.h"\ + "..\..\..\pjlib\include\pj\compat\os_win32_wince.h"\ + "..\..\..\pjlib\include\pj\compat\size_t.h"\ + "..\..\..\pjlib\include\pj\config.h"\ + "..\..\..\pjlib\include\pj\config_site.h"\ + "..\..\..\pjlib\include\pj\config_site_sample.h"\ + "..\..\..\pjlib\include\pj\types.h"\ + + +!ELSEIF "$(CFG)" == "libmilenage - Win32 (WCE SH4) Release" + +DEP_CPP_RIJND=\ + "..\..\..\pjlib\include\pj\compat\cc_armcc.h"\ + "..\..\..\pjlib\include\pj\compat\cc_codew.h"\ + "..\..\..\pjlib\include\pj\compat\cc_gcc.h"\ + "..\..\..\pjlib\include\pj\compat\cc_gcce.h"\ + "..\..\..\pjlib\include\pj\compat\cc_msvc.h"\ + "..\..\..\pjlib\include\pj\compat\cc_mwcc.h"\ + "..\..\..\pjlib\include\pj\compat\m_auto.h"\ + "..\..\..\pjlib\include\pj\compat\os_auto.h"\ + "..\..\..\pjlib\include\pj\compat\os_darwinos.h"\ + "..\..\..\pjlib\include\pj\compat\os_linux.h"\ + "..\..\..\pjlib\include\pj\compat\os_linux_kernel.h"\ + "..\..\..\pjlib\include\pj\compat\os_palmos.h"\ + "..\..\..\pjlib\include\pj\compat\os_rtems.h"\ + "..\..\..\pjlib\include\pj\compat\os_sunos.h"\ + "..\..\..\pjlib\include\pj\compat\os_symbian.h"\ + "..\..\..\pjlib\include\pj\compat\os_win32.h"\ + "..\..\..\pjlib\include\pj\compat\os_win32_wince.h"\ + "..\..\..\pjlib\include\pj\compat\size_t.h"\ + "..\..\..\pjlib\include\pj\config.h"\ + "..\..\..\pjlib\include\pj\config_site.h"\ + "..\..\..\pjlib\include\pj\config_site_sample.h"\ + "..\..\..\pjlib\include\pj\types.h"\ + + +!ELSEIF "$(CFG)" == "libmilenage - Win32 (WCE SH4) Debug" + +DEP_CPP_RIJND=\ + "..\..\..\pjlib\include\pj\compat\cc_armcc.h"\ + "..\..\..\pjlib\include\pj\compat\cc_codew.h"\ + "..\..\..\pjlib\include\pj\compat\cc_gcc.h"\ + "..\..\..\pjlib\include\pj\compat\cc_gcce.h"\ + "..\..\..\pjlib\include\pj\compat\cc_msvc.h"\ + "..\..\..\pjlib\include\pj\compat\cc_mwcc.h"\ + "..\..\..\pjlib\include\pj\compat\m_auto.h"\ + "..\..\..\pjlib\include\pj\compat\os_auto.h"\ + "..\..\..\pjlib\include\pj\compat\os_darwinos.h"\ + "..\..\..\pjlib\include\pj\compat\os_linux.h"\ + "..\..\..\pjlib\include\pj\compat\os_linux_kernel.h"\ + "..\..\..\pjlib\include\pj\compat\os_palmos.h"\ + "..\..\..\pjlib\include\pj\compat\os_rtems.h"\ + "..\..\..\pjlib\include\pj\compat\os_sunos.h"\ + "..\..\..\pjlib\include\pj\compat\os_symbian.h"\ + "..\..\..\pjlib\include\pj\compat\os_win32.h"\ + "..\..\..\pjlib\include\pj\compat\os_win32_wince.h"\ + "..\..\..\pjlib\include\pj\compat\size_t.h"\ + "..\..\..\pjlib\include\pj\config.h"\ + "..\..\..\pjlib\include\pj\config_site.h"\ + "..\..\..\pjlib\include\pj\config_site_sample.h"\ + "..\..\..\pjlib\include\pj\types.h"\ + + +!ELSEIF "$(CFG)" == "libmilenage - Win32 (WCE SH3) Release" + +DEP_CPP_RIJND=\ + "..\..\..\pjlib\include\pj\compat\cc_armcc.h"\ + "..\..\..\pjlib\include\pj\compat\cc_codew.h"\ + "..\..\..\pjlib\include\pj\compat\cc_gcc.h"\ + "..\..\..\pjlib\include\pj\compat\cc_gcce.h"\ + "..\..\..\pjlib\include\pj\compat\cc_msvc.h"\ + "..\..\..\pjlib\include\pj\compat\cc_mwcc.h"\ + "..\..\..\pjlib\include\pj\compat\m_auto.h"\ + "..\..\..\pjlib\include\pj\compat\os_auto.h"\ + "..\..\..\pjlib\include\pj\compat\os_darwinos.h"\ + "..\..\..\pjlib\include\pj\compat\os_linux.h"\ + "..\..\..\pjlib\include\pj\compat\os_linux_kernel.h"\ + "..\..\..\pjlib\include\pj\compat\os_palmos.h"\ + "..\..\..\pjlib\include\pj\compat\os_rtems.h"\ + "..\..\..\pjlib\include\pj\compat\os_sunos.h"\ + "..\..\..\pjlib\include\pj\compat\os_symbian.h"\ + "..\..\..\pjlib\include\pj\compat\os_win32.h"\ + "..\..\..\pjlib\include\pj\compat\os_win32_wince.h"\ + "..\..\..\pjlib\include\pj\compat\size_t.h"\ + "..\..\..\pjlib\include\pj\config.h"\ + "..\..\..\pjlib\include\pj\config_site.h"\ + "..\..\..\pjlib\include\pj\config_site_sample.h"\ + "..\..\..\pjlib\include\pj\types.h"\ + + +!ELSEIF "$(CFG)" == "libmilenage - Win32 (WCE SH3) Debug" + +DEP_CPP_RIJND=\ + "..\..\..\pjlib\include\pj\compat\cc_armcc.h"\ + "..\..\..\pjlib\include\pj\compat\cc_codew.h"\ + "..\..\..\pjlib\include\pj\compat\cc_gcc.h"\ + "..\..\..\pjlib\include\pj\compat\cc_gcce.h"\ + "..\..\..\pjlib\include\pj\compat\cc_msvc.h"\ + "..\..\..\pjlib\include\pj\compat\cc_mwcc.h"\ + "..\..\..\pjlib\include\pj\compat\m_auto.h"\ + "..\..\..\pjlib\include\pj\compat\os_auto.h"\ + "..\..\..\pjlib\include\pj\compat\os_darwinos.h"\ + "..\..\..\pjlib\include\pj\compat\os_linux.h"\ + "..\..\..\pjlib\include\pj\compat\os_linux_kernel.h"\ + "..\..\..\pjlib\include\pj\compat\os_palmos.h"\ + "..\..\..\pjlib\include\pj\compat\os_rtems.h"\ + "..\..\..\pjlib\include\pj\compat\os_sunos.h"\ + "..\..\..\pjlib\include\pj\compat\os_symbian.h"\ + "..\..\..\pjlib\include\pj\compat\os_win32.h"\ + "..\..\..\pjlib\include\pj\compat\os_win32_wince.h"\ + "..\..\..\pjlib\include\pj\compat\size_t.h"\ + "..\..\..\pjlib\include\pj\config.h"\ + "..\..\..\pjlib\include\pj\config_site.h"\ + "..\..\..\pjlib\include\pj\config_site_sample.h"\ + "..\..\..\pjlib\include\pj\types.h"\ + + +!ELSEIF "$(CFG)" == "libmilenage - Win32 (WCE MIPSIV) Release" + +DEP_CPP_RIJND=\ + "..\..\..\pjlib\include\pj\compat\cc_armcc.h"\ + "..\..\..\pjlib\include\pj\compat\cc_codew.h"\ + "..\..\..\pjlib\include\pj\compat\cc_gcc.h"\ + "..\..\..\pjlib\include\pj\compat\cc_gcce.h"\ + "..\..\..\pjlib\include\pj\compat\cc_msvc.h"\ + "..\..\..\pjlib\include\pj\compat\cc_mwcc.h"\ + "..\..\..\pjlib\include\pj\compat\m_auto.h"\ + "..\..\..\pjlib\include\pj\compat\os_auto.h"\ + "..\..\..\pjlib\include\pj\compat\os_darwinos.h"\ + "..\..\..\pjlib\include\pj\compat\os_linux.h"\ + "..\..\..\pjlib\include\pj\compat\os_linux_kernel.h"\ + "..\..\..\pjlib\include\pj\compat\os_palmos.h"\ + "..\..\..\pjlib\include\pj\compat\os_rtems.h"\ + "..\..\..\pjlib\include\pj\compat\os_sunos.h"\ + "..\..\..\pjlib\include\pj\compat\os_symbian.h"\ + "..\..\..\pjlib\include\pj\compat\os_win32.h"\ + "..\..\..\pjlib\include\pj\compat\os_win32_wince.h"\ + "..\..\..\pjlib\include\pj\compat\size_t.h"\ + "..\..\..\pjlib\include\pj\config.h"\ + "..\..\..\pjlib\include\pj\config_site.h"\ + "..\..\..\pjlib\include\pj\config_site_sample.h"\ + "..\..\..\pjlib\include\pj\types.h"\ + + +!ELSEIF "$(CFG)" == "libmilenage - Win32 (WCE MIPSIV) Debug" + +DEP_CPP_RIJND=\ + "..\..\..\pjlib\include\pj\compat\cc_armcc.h"\ + "..\..\..\pjlib\include\pj\compat\cc_codew.h"\ + "..\..\..\pjlib\include\pj\compat\cc_gcc.h"\ + "..\..\..\pjlib\include\pj\compat\cc_gcce.h"\ + "..\..\..\pjlib\include\pj\compat\cc_msvc.h"\ + "..\..\..\pjlib\include\pj\compat\cc_mwcc.h"\ + "..\..\..\pjlib\include\pj\compat\m_auto.h"\ + "..\..\..\pjlib\include\pj\compat\os_auto.h"\ + "..\..\..\pjlib\include\pj\compat\os_darwinos.h"\ + "..\..\..\pjlib\include\pj\compat\os_linux.h"\ + "..\..\..\pjlib\include\pj\compat\os_linux_kernel.h"\ + "..\..\..\pjlib\include\pj\compat\os_palmos.h"\ + "..\..\..\pjlib\include\pj\compat\os_rtems.h"\ + "..\..\..\pjlib\include\pj\compat\os_sunos.h"\ + "..\..\..\pjlib\include\pj\compat\os_symbian.h"\ + "..\..\..\pjlib\include\pj\compat\os_win32.h"\ + "..\..\..\pjlib\include\pj\compat\os_win32_wince.h"\ + "..\..\..\pjlib\include\pj\compat\size_t.h"\ + "..\..\..\pjlib\include\pj\config.h"\ + "..\..\..\pjlib\include\pj\config_site.h"\ + "..\..\..\pjlib\include\pj\config_site_sample.h"\ + "..\..\..\pjlib\include\pj\types.h"\ + + +!ELSEIF "$(CFG)" == "libmilenage - Win32 (WCE emulator) Release" + +DEP_CPP_RIJND=\ + "..\..\..\pjlib\include\pj\compat\cc_armcc.h"\ + "..\..\..\pjlib\include\pj\compat\cc_codew.h"\ + "..\..\..\pjlib\include\pj\compat\cc_gcc.h"\ + "..\..\..\pjlib\include\pj\compat\cc_gcce.h"\ + "..\..\..\pjlib\include\pj\compat\cc_msvc.h"\ + "..\..\..\pjlib\include\pj\compat\cc_mwcc.h"\ + "..\..\..\pjlib\include\pj\compat\m_auto.h"\ + "..\..\..\pjlib\include\pj\compat\os_auto.h"\ + "..\..\..\pjlib\include\pj\compat\os_darwinos.h"\ + "..\..\..\pjlib\include\pj\compat\os_linux.h"\ + "..\..\..\pjlib\include\pj\compat\os_linux_kernel.h"\ + "..\..\..\pjlib\include\pj\compat\os_palmos.h"\ + "..\..\..\pjlib\include\pj\compat\os_rtems.h"\ + "..\..\..\pjlib\include\pj\compat\os_sunos.h"\ + "..\..\..\pjlib\include\pj\compat\os_symbian.h"\ + "..\..\..\pjlib\include\pj\compat\os_win32.h"\ + "..\..\..\pjlib\include\pj\compat\os_win32_wince.h"\ + "..\..\..\pjlib\include\pj\compat\size_t.h"\ + "..\..\..\pjlib\include\pj\config.h"\ + "..\..\..\pjlib\include\pj\config_site.h"\ + "..\..\..\pjlib\include\pj\config_site_sample.h"\ + "..\..\..\pjlib\include\pj\types.h"\ + + +!ELSEIF "$(CFG)" == "libmilenage - Win32 (WCE emulator) Debug" + +DEP_CPP_RIJND=\ + "..\..\..\pjlib\include\pj\compat\cc_armcc.h"\ + "..\..\..\pjlib\include\pj\compat\cc_codew.h"\ + "..\..\..\pjlib\include\pj\compat\cc_gcc.h"\ + "..\..\..\pjlib\include\pj\compat\cc_gcce.h"\ + "..\..\..\pjlib\include\pj\compat\cc_msvc.h"\ + "..\..\..\pjlib\include\pj\compat\cc_mwcc.h"\ + "..\..\..\pjlib\include\pj\compat\m_auto.h"\ + "..\..\..\pjlib\include\pj\compat\os_auto.h"\ + "..\..\..\pjlib\include\pj\compat\os_darwinos.h"\ + "..\..\..\pjlib\include\pj\compat\os_linux.h"\ + "..\..\..\pjlib\include\pj\compat\os_linux_kernel.h"\ + "..\..\..\pjlib\include\pj\compat\os_palmos.h"\ + "..\..\..\pjlib\include\pj\compat\os_rtems.h"\ + "..\..\..\pjlib\include\pj\compat\os_sunos.h"\ + "..\..\..\pjlib\include\pj\compat\os_symbian.h"\ + "..\..\..\pjlib\include\pj\compat\os_win32.h"\ + "..\..\..\pjlib\include\pj\compat\os_win32_wince.h"\ + "..\..\..\pjlib\include\pj\compat\size_t.h"\ + "..\..\..\pjlib\include\pj\config.h"\ + "..\..\..\pjlib\include\pj\config_site.h"\ + "..\..\..\pjlib\include\pj\config_site_sample.h"\ + "..\..\..\pjlib\include\pj\types.h"\ + + +!ELSEIF "$(CFG)" == "libmilenage - Win32 (WCE ARMV4I) Release" + +DEP_CPP_RIJND=\ + "..\..\..\pjlib\include\pj\compat\cc_armcc.h"\ + "..\..\..\pjlib\include\pj\compat\cc_codew.h"\ + "..\..\..\pjlib\include\pj\compat\cc_gcc.h"\ + "..\..\..\pjlib\include\pj\compat\cc_gcce.h"\ + "..\..\..\pjlib\include\pj\compat\cc_msvc.h"\ + "..\..\..\pjlib\include\pj\compat\cc_mwcc.h"\ + "..\..\..\pjlib\include\pj\compat\m_auto.h"\ + "..\..\..\pjlib\include\pj\compat\os_auto.h"\ + "..\..\..\pjlib\include\pj\compat\os_darwinos.h"\ + "..\..\..\pjlib\include\pj\compat\os_linux.h"\ + "..\..\..\pjlib\include\pj\compat\os_linux_kernel.h"\ + "..\..\..\pjlib\include\pj\compat\os_palmos.h"\ + "..\..\..\pjlib\include\pj\compat\os_rtems.h"\ + "..\..\..\pjlib\include\pj\compat\os_sunos.h"\ + "..\..\..\pjlib\include\pj\compat\os_symbian.h"\ + "..\..\..\pjlib\include\pj\compat\os_win32.h"\ + "..\..\..\pjlib\include\pj\compat\os_win32_wince.h"\ + "..\..\..\pjlib\include\pj\compat\size_t.h"\ + "..\..\..\pjlib\include\pj\config.h"\ + "..\..\..\pjlib\include\pj\config_site.h"\ + "..\..\..\pjlib\include\pj\config_site_sample.h"\ + "..\..\..\pjlib\include\pj\types.h"\ + + +!ELSEIF "$(CFG)" == "libmilenage - Win32 (WCE ARMV4I) Debug" + +DEP_CPP_RIJND=\ + "..\..\..\pjlib\include\pj\compat\cc_armcc.h"\ + "..\..\..\pjlib\include\pj\compat\cc_codew.h"\ + "..\..\..\pjlib\include\pj\compat\cc_gcc.h"\ + "..\..\..\pjlib\include\pj\compat\cc_gcce.h"\ + "..\..\..\pjlib\include\pj\compat\cc_msvc.h"\ + "..\..\..\pjlib\include\pj\compat\cc_mwcc.h"\ + "..\..\..\pjlib\include\pj\compat\m_auto.h"\ + "..\..\..\pjlib\include\pj\compat\os_auto.h"\ + "..\..\..\pjlib\include\pj\compat\os_darwinos.h"\ + "..\..\..\pjlib\include\pj\compat\os_linux.h"\ + "..\..\..\pjlib\include\pj\compat\os_linux_kernel.h"\ + "..\..\..\pjlib\include\pj\compat\os_palmos.h"\ + "..\..\..\pjlib\include\pj\compat\os_rtems.h"\ + "..\..\..\pjlib\include\pj\compat\os_sunos.h"\ + "..\..\..\pjlib\include\pj\compat\os_symbian.h"\ + "..\..\..\pjlib\include\pj\compat\os_win32.h"\ + "..\..\..\pjlib\include\pj\compat\os_win32_wince.h"\ + "..\..\..\pjlib\include\pj\compat\size_t.h"\ + "..\..\..\pjlib\include\pj\config.h"\ + "..\..\..\pjlib\include\pj\config_site.h"\ + "..\..\..\pjlib\include\pj\config_site_sample.h"\ + "..\..\..\pjlib\include\pj\types.h"\ + + +!ELSEIF "$(CFG)" == "libmilenage - Win32 (WCE MIPSIV_FP) Release" + +DEP_CPP_RIJND=\ + "..\..\..\pjlib\include\pj\compat\cc_armcc.h"\ + "..\..\..\pjlib\include\pj\compat\cc_codew.h"\ + "..\..\..\pjlib\include\pj\compat\cc_gcc.h"\ + "..\..\..\pjlib\include\pj\compat\cc_gcce.h"\ + "..\..\..\pjlib\include\pj\compat\cc_msvc.h"\ + "..\..\..\pjlib\include\pj\compat\cc_mwcc.h"\ + "..\..\..\pjlib\include\pj\compat\m_auto.h"\ + "..\..\..\pjlib\include\pj\compat\os_auto.h"\ + "..\..\..\pjlib\include\pj\compat\os_darwinos.h"\ + "..\..\..\pjlib\include\pj\compat\os_linux.h"\ + "..\..\..\pjlib\include\pj\compat\os_linux_kernel.h"\ + "..\..\..\pjlib\include\pj\compat\os_palmos.h"\ + "..\..\..\pjlib\include\pj\compat\os_rtems.h"\ + "..\..\..\pjlib\include\pj\compat\os_sunos.h"\ + "..\..\..\pjlib\include\pj\compat\os_symbian.h"\ + "..\..\..\pjlib\include\pj\compat\os_win32.h"\ + "..\..\..\pjlib\include\pj\compat\os_win32_wince.h"\ + "..\..\..\pjlib\include\pj\compat\size_t.h"\ + "..\..\..\pjlib\include\pj\config.h"\ + "..\..\..\pjlib\include\pj\config_site.h"\ + "..\..\..\pjlib\include\pj\config_site_sample.h"\ + "..\..\..\pjlib\include\pj\types.h"\ + + +!ELSEIF "$(CFG)" == "libmilenage - Win32 (WCE MIPSIV_FP) Debug" + +DEP_CPP_RIJND=\ + "..\..\..\pjlib\include\pj\compat\cc_armcc.h"\ + "..\..\..\pjlib\include\pj\compat\cc_codew.h"\ + "..\..\..\pjlib\include\pj\compat\cc_gcc.h"\ + "..\..\..\pjlib\include\pj\compat\cc_gcce.h"\ + "..\..\..\pjlib\include\pj\compat\cc_msvc.h"\ + "..\..\..\pjlib\include\pj\compat\cc_mwcc.h"\ + "..\..\..\pjlib\include\pj\compat\m_auto.h"\ + "..\..\..\pjlib\include\pj\compat\os_auto.h"\ + "..\..\..\pjlib\include\pj\compat\os_darwinos.h"\ + "..\..\..\pjlib\include\pj\compat\os_linux.h"\ + "..\..\..\pjlib\include\pj\compat\os_linux_kernel.h"\ + "..\..\..\pjlib\include\pj\compat\os_palmos.h"\ + "..\..\..\pjlib\include\pj\compat\os_rtems.h"\ + "..\..\..\pjlib\include\pj\compat\os_sunos.h"\ + "..\..\..\pjlib\include\pj\compat\os_symbian.h"\ + "..\..\..\pjlib\include\pj\compat\os_win32.h"\ + "..\..\..\pjlib\include\pj\compat\os_win32_wince.h"\ + "..\..\..\pjlib\include\pj\compat\size_t.h"\ + "..\..\..\pjlib\include\pj\config.h"\ + "..\..\..\pjlib\include\pj\config_site.h"\ + "..\..\..\pjlib\include\pj\config_site_sample.h"\ + "..\..\..\pjlib\include\pj\types.h"\ + + +!ELSEIF "$(CFG)" == "libmilenage - Win32 (WCE ARMV4) Release" + +DEP_CPP_RIJND=\ + "..\..\..\pjlib\include\pj\compat\cc_armcc.h"\ + "..\..\..\pjlib\include\pj\compat\cc_codew.h"\ + "..\..\..\pjlib\include\pj\compat\cc_gcc.h"\ + "..\..\..\pjlib\include\pj\compat\cc_gcce.h"\ + "..\..\..\pjlib\include\pj\compat\cc_msvc.h"\ + "..\..\..\pjlib\include\pj\compat\cc_mwcc.h"\ + "..\..\..\pjlib\include\pj\compat\m_auto.h"\ + "..\..\..\pjlib\include\pj\compat\os_auto.h"\ + "..\..\..\pjlib\include\pj\compat\os_darwinos.h"\ + "..\..\..\pjlib\include\pj\compat\os_linux.h"\ + "..\..\..\pjlib\include\pj\compat\os_linux_kernel.h"\ + "..\..\..\pjlib\include\pj\compat\os_palmos.h"\ + "..\..\..\pjlib\include\pj\compat\os_rtems.h"\ + "..\..\..\pjlib\include\pj\compat\os_sunos.h"\ + "..\..\..\pjlib\include\pj\compat\os_symbian.h"\ + "..\..\..\pjlib\include\pj\compat\os_win32.h"\ + "..\..\..\pjlib\include\pj\compat\os_win32_wince.h"\ + "..\..\..\pjlib\include\pj\compat\size_t.h"\ + "..\..\..\pjlib\include\pj\config.h"\ + "..\..\..\pjlib\include\pj\config_site.h"\ + "..\..\..\pjlib\include\pj\config_site_sample.h"\ + "..\..\..\pjlib\include\pj\types.h"\ + + +!ELSEIF "$(CFG)" == "libmilenage - Win32 (WCE ARMV4) Debug" + +DEP_CPP_RIJND=\ + "..\..\..\pjlib\include\pj\compat\cc_armcc.h"\ + "..\..\..\pjlib\include\pj\compat\cc_codew.h"\ + "..\..\..\pjlib\include\pj\compat\cc_gcc.h"\ + "..\..\..\pjlib\include\pj\compat\cc_gcce.h"\ + "..\..\..\pjlib\include\pj\compat\cc_msvc.h"\ + "..\..\..\pjlib\include\pj\compat\cc_mwcc.h"\ + "..\..\..\pjlib\include\pj\compat\m_auto.h"\ + "..\..\..\pjlib\include\pj\compat\os_auto.h"\ + "..\..\..\pjlib\include\pj\compat\os_darwinos.h"\ + "..\..\..\pjlib\include\pj\compat\os_linux.h"\ + "..\..\..\pjlib\include\pj\compat\os_linux_kernel.h"\ + "..\..\..\pjlib\include\pj\compat\os_palmos.h"\ + "..\..\..\pjlib\include\pj\compat\os_rtems.h"\ + "..\..\..\pjlib\include\pj\compat\os_sunos.h"\ + "..\..\..\pjlib\include\pj\compat\os_symbian.h"\ + "..\..\..\pjlib\include\pj\compat\os_win32.h"\ + "..\..\..\pjlib\include\pj\compat\os_win32_wince.h"\ + "..\..\..\pjlib\include\pj\compat\size_t.h"\ + "..\..\..\pjlib\include\pj\config.h"\ + "..\..\..\pjlib\include\pj\config_site.h"\ + "..\..\..\pjlib\include\pj\config_site_sample.h"\ + "..\..\..\pjlib\include\pj\types.h"\ + + +!ELSEIF "$(CFG)" == "libmilenage - Win32 (WCE MIPS16) Release" + +DEP_CPP_RIJND=\ + "..\..\..\pjlib\include\pj\compat\cc_armcc.h"\ + "..\..\..\pjlib\include\pj\compat\cc_codew.h"\ + "..\..\..\pjlib\include\pj\compat\cc_gcc.h"\ + "..\..\..\pjlib\include\pj\compat\cc_gcce.h"\ + "..\..\..\pjlib\include\pj\compat\cc_msvc.h"\ + "..\..\..\pjlib\include\pj\compat\cc_mwcc.h"\ + "..\..\..\pjlib\include\pj\compat\m_auto.h"\ + "..\..\..\pjlib\include\pj\compat\os_auto.h"\ + "..\..\..\pjlib\include\pj\compat\os_darwinos.h"\ + "..\..\..\pjlib\include\pj\compat\os_linux.h"\ + "..\..\..\pjlib\include\pj\compat\os_linux_kernel.h"\ + "..\..\..\pjlib\include\pj\compat\os_palmos.h"\ + "..\..\..\pjlib\include\pj\compat\os_rtems.h"\ + "..\..\..\pjlib\include\pj\compat\os_sunos.h"\ + "..\..\..\pjlib\include\pj\compat\os_symbian.h"\ + "..\..\..\pjlib\include\pj\compat\os_win32.h"\ + "..\..\..\pjlib\include\pj\compat\os_win32_wince.h"\ + "..\..\..\pjlib\include\pj\compat\size_t.h"\ + "..\..\..\pjlib\include\pj\config.h"\ + "..\..\..\pjlib\include\pj\config_site.h"\ + "..\..\..\pjlib\include\pj\config_site_sample.h"\ + "..\..\..\pjlib\include\pj\types.h"\ + + +!ELSEIF "$(CFG)" == "libmilenage - Win32 (WCE MIPS16) Debug" + +DEP_CPP_RIJND=\ + "..\..\..\pjlib\include\pj\compat\cc_armcc.h"\ + "..\..\..\pjlib\include\pj\compat\cc_codew.h"\ + "..\..\..\pjlib\include\pj\compat\cc_gcc.h"\ + "..\..\..\pjlib\include\pj\compat\cc_gcce.h"\ + "..\..\..\pjlib\include\pj\compat\cc_msvc.h"\ + "..\..\..\pjlib\include\pj\compat\cc_mwcc.h"\ + "..\..\..\pjlib\include\pj\compat\m_auto.h"\ + "..\..\..\pjlib\include\pj\compat\os_auto.h"\ + "..\..\..\pjlib\include\pj\compat\os_darwinos.h"\ + "..\..\..\pjlib\include\pj\compat\os_linux.h"\ + "..\..\..\pjlib\include\pj\compat\os_linux_kernel.h"\ + "..\..\..\pjlib\include\pj\compat\os_palmos.h"\ + "..\..\..\pjlib\include\pj\compat\os_rtems.h"\ + "..\..\..\pjlib\include\pj\compat\os_sunos.h"\ + "..\..\..\pjlib\include\pj\compat\os_symbian.h"\ + "..\..\..\pjlib\include\pj\compat\os_win32.h"\ + "..\..\..\pjlib\include\pj\compat\os_win32_wince.h"\ + "..\..\..\pjlib\include\pj\compat\size_t.h"\ + "..\..\..\pjlib\include\pj\config.h"\ + "..\..\..\pjlib\include\pj\config_site.h"\ + "..\..\..\pjlib\include\pj\config_site_sample.h"\ + "..\..\..\pjlib\include\pj\types.h"\ + + +!ELSEIF "$(CFG)" == "libmilenage - Win32 (WCE ARMV4T) Release" + +DEP_CPP_RIJND=\ + "..\..\..\pjlib\include\pj\compat\cc_armcc.h"\ + "..\..\..\pjlib\include\pj\compat\cc_codew.h"\ + "..\..\..\pjlib\include\pj\compat\cc_gcc.h"\ + "..\..\..\pjlib\include\pj\compat\cc_gcce.h"\ + "..\..\..\pjlib\include\pj\compat\cc_msvc.h"\ + "..\..\..\pjlib\include\pj\compat\cc_mwcc.h"\ + "..\..\..\pjlib\include\pj\compat\m_auto.h"\ + "..\..\..\pjlib\include\pj\compat\os_auto.h"\ + "..\..\..\pjlib\include\pj\compat\os_darwinos.h"\ + "..\..\..\pjlib\include\pj\compat\os_linux.h"\ + "..\..\..\pjlib\include\pj\compat\os_linux_kernel.h"\ + "..\..\..\pjlib\include\pj\compat\os_palmos.h"\ + "..\..\..\pjlib\include\pj\compat\os_rtems.h"\ + "..\..\..\pjlib\include\pj\compat\os_sunos.h"\ + "..\..\..\pjlib\include\pj\compat\os_symbian.h"\ + "..\..\..\pjlib\include\pj\compat\os_win32.h"\ + "..\..\..\pjlib\include\pj\compat\os_win32_wince.h"\ + "..\..\..\pjlib\include\pj\compat\size_t.h"\ + "..\..\..\pjlib\include\pj\config.h"\ + "..\..\..\pjlib\include\pj\config_site.h"\ + "..\..\..\pjlib\include\pj\config_site_sample.h"\ + "..\..\..\pjlib\include\pj\types.h"\ + + +!ELSEIF "$(CFG)" == "libmilenage - Win32 (WCE ARMV4T) Debug" + +DEP_CPP_RIJND=\ + "..\..\..\pjlib\include\pj\compat\cc_armcc.h"\ + "..\..\..\pjlib\include\pj\compat\cc_codew.h"\ + "..\..\..\pjlib\include\pj\compat\cc_gcc.h"\ + "..\..\..\pjlib\include\pj\compat\cc_gcce.h"\ + "..\..\..\pjlib\include\pj\compat\cc_msvc.h"\ + "..\..\..\pjlib\include\pj\compat\cc_mwcc.h"\ + "..\..\..\pjlib\include\pj\compat\m_auto.h"\ + "..\..\..\pjlib\include\pj\compat\os_auto.h"\ + "..\..\..\pjlib\include\pj\compat\os_darwinos.h"\ + "..\..\..\pjlib\include\pj\compat\os_linux.h"\ + "..\..\..\pjlib\include\pj\compat\os_linux_kernel.h"\ + "..\..\..\pjlib\include\pj\compat\os_palmos.h"\ + "..\..\..\pjlib\include\pj\compat\os_rtems.h"\ + "..\..\..\pjlib\include\pj\compat\os_sunos.h"\ + "..\..\..\pjlib\include\pj\compat\os_symbian.h"\ + "..\..\..\pjlib\include\pj\compat\os_win32.h"\ + "..\..\..\pjlib\include\pj\compat\os_win32_wince.h"\ + "..\..\..\pjlib\include\pj\compat\size_t.h"\ + "..\..\..\pjlib\include\pj\config.h"\ + "..\..\..\pjlib\include\pj\config_site.h"\ + "..\..\..\pjlib\include\pj\config_site_sample.h"\ + "..\..\..\pjlib\include\pj\types.h"\ + + +!ELSEIF "$(CFG)" == "libmilenage - Win32 (WCE x86) Release" + +DEP_CPP_RIJND=\ + "..\..\..\pjlib\include\pj\compat\cc_armcc.h"\ + "..\..\..\pjlib\include\pj\compat\cc_codew.h"\ + "..\..\..\pjlib\include\pj\compat\cc_gcc.h"\ + "..\..\..\pjlib\include\pj\compat\cc_gcce.h"\ + "..\..\..\pjlib\include\pj\compat\cc_msvc.h"\ + "..\..\..\pjlib\include\pj\compat\cc_mwcc.h"\ + "..\..\..\pjlib\include\pj\compat\m_auto.h"\ + "..\..\..\pjlib\include\pj\compat\os_auto.h"\ + "..\..\..\pjlib\include\pj\compat\os_darwinos.h"\ + "..\..\..\pjlib\include\pj\compat\os_linux.h"\ + "..\..\..\pjlib\include\pj\compat\os_linux_kernel.h"\ + "..\..\..\pjlib\include\pj\compat\os_palmos.h"\ + "..\..\..\pjlib\include\pj\compat\os_rtems.h"\ + "..\..\..\pjlib\include\pj\compat\os_sunos.h"\ + "..\..\..\pjlib\include\pj\compat\os_symbian.h"\ + "..\..\..\pjlib\include\pj\compat\os_win32.h"\ + "..\..\..\pjlib\include\pj\compat\os_win32_wince.h"\ + "..\..\..\pjlib\include\pj\compat\size_t.h"\ + "..\..\..\pjlib\include\pj\config.h"\ + "..\..\..\pjlib\include\pj\config_site.h"\ + "..\..\..\pjlib\include\pj\config_site_sample.h"\ + "..\..\..\pjlib\include\pj\types.h"\ + + +!ELSEIF "$(CFG)" == "libmilenage - Win32 (WCE x86) Debug" + +DEP_CPP_RIJND=\ + "..\..\..\pjlib\include\pj\compat\cc_armcc.h"\ + "..\..\..\pjlib\include\pj\compat\cc_codew.h"\ + "..\..\..\pjlib\include\pj\compat\cc_gcc.h"\ + "..\..\..\pjlib\include\pj\compat\cc_gcce.h"\ + "..\..\..\pjlib\include\pj\compat\cc_msvc.h"\ + "..\..\..\pjlib\include\pj\compat\cc_mwcc.h"\ + "..\..\..\pjlib\include\pj\compat\m_auto.h"\ + "..\..\..\pjlib\include\pj\compat\os_auto.h"\ + "..\..\..\pjlib\include\pj\compat\os_darwinos.h"\ + "..\..\..\pjlib\include\pj\compat\os_linux.h"\ + "..\..\..\pjlib\include\pj\compat\os_linux_kernel.h"\ + "..\..\..\pjlib\include\pj\compat\os_palmos.h"\ + "..\..\..\pjlib\include\pj\compat\os_rtems.h"\ + "..\..\..\pjlib\include\pj\compat\os_sunos.h"\ + "..\..\..\pjlib\include\pj\compat\os_symbian.h"\ + "..\..\..\pjlib\include\pj\compat\os_win32.h"\ + "..\..\..\pjlib\include\pj\compat\os_win32_wince.h"\ + "..\..\..\pjlib\include\pj\compat\size_t.h"\ + "..\..\..\pjlib\include\pj\config.h"\ + "..\..\..\pjlib\include\pj\config_site.h"\ + "..\..\..\pjlib\include\pj\config_site_sample.h"\ + "..\..\..\pjlib\include\pj\types.h"\ + + +!ENDIF + +# End Source File +# End Group +# Begin Group "Header Files" + +# PROP Default_Filter "h;hpp;hxx;hm;inl" +# Begin Source File + +SOURCE=..\..\milenage\milenage.h +# End Source File +# Begin Source File + +SOURCE=..\..\milenage\rijndael.h +# End Source File +# End Group +# End Target +# End Project diff --git a/sflphone-common/libs/pjproject/third_party/build/milenage/libmilenage.vcproj b/sflphone-common/libs/pjproject/third_party/build/milenage/libmilenage.vcproj new file mode 100644 index 0000000000000000000000000000000000000000..c0f63e5a7eb003bfde97fbfae012478c9818d51f --- /dev/null +++ b/sflphone-common/libs/pjproject/third_party/build/milenage/libmilenage.vcproj @@ -0,0 +1,2888 @@ +<?xml version="1.0" encoding="Windows-1252"?> +<VisualStudioProject + ProjectType="Visual C++" + Version="8.00" + Name="libmilenage" + ProjectGUID="{4BF51C21-5A30-423B-82FE-1ED410E5769D}" + RootNamespace="libmilenage" + > + <Platforms> + <Platform + Name="Win32" + /> + <Platform + Name="Windows Mobile 6 Standard SDK (ARMV4I)" + /> + <Platform + Name="Windows Mobile 6 Professional SDK (ARMV4I)" + /> + <Platform + Name="Pocket PC 2003 (ARMV4)" + /> + <Platform + Name="Smartphone 2003 (ARMV4)" + /> + <Platform + Name="Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + /> + <Platform + Name="Windows Mobile 5.0 Smartphone SDK (ARMV4I)" + /> + </Platforms> + <ToolFiles> + </ToolFiles> + <Configurations> + <Configuration + Name="Debug|Win32" + InheritedPropertySheets="..\..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\..\build\vs\pjproject-vs8-win32-common-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="2" + ConfigurationType="4" + UseOfMFC="0" + > + <Tool + Name="VCPreBuildEventTool" + /> + <Tool + Name="VCCustomBuildTool" + /> + <Tool + Name="VCXMLDataGeneratorTool" + /> + <Tool + Name="VCWebServiceProxyGeneratorTool" + /> + <Tool + Name="VCMIDLTool" + /> + <Tool + Name="VCCLCompilerTool" + PreprocessorDefinitions="_LIB;" + AdditionalIncludeDirectories="../../../pjlib/include" + PrecompiledHeaderFile="" + /> + <Tool + Name="VCManagedResourceCompilerTool" + /> + <Tool + Name="VCResourceCompilerTool" + /> + <Tool + Name="VCPreLinkEventTool" + /> + <Tool + Name="VCLibrarianTool" + OutputFile="..\..\lib\$(ProjectName)-$(TargetCPU)-$(PlatformName)-vc$(VSVer)-$(ConfigurationName).lib" + /> + <Tool + Name="VCALinkTool" + /> + <Tool + Name="VCXDCMakeTool" + /> + <Tool + Name="VCBscMakeTool" + /> + <Tool + Name="VCFxCopTool" + /> + <Tool + Name="VCPostBuildEventTool" + /> + </Configuration> + <Configuration + Name="Debug|Windows Mobile 6 Standard SDK (ARMV4I)" + InheritedPropertySheets="..\..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\..\build\vs\pjproject-vs8-wm6-common-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" + ConfigurationType="4" + > + <Tool + Name="VCPreBuildEventTool" + /> + <Tool + Name="VCCustomBuildTool" + /> + <Tool + Name="VCXMLDataGeneratorTool" + /> + <Tool + Name="VCWebServiceProxyGeneratorTool" + /> + <Tool + Name="VCMIDLTool" + /> + <Tool + Name="VCCLCompilerTool" + PreprocessorDefinitions="_LIB;" + ExecutionBucket="7" + AdditionalIncludeDirectories="../../../pjlib/include" + PrecompiledHeaderFile="" + /> + <Tool + Name="VCManagedResourceCompilerTool" + /> + <Tool + Name="VCResourceCompilerTool" + /> + <Tool + Name="VCPreLinkEventTool" + /> + <Tool + Name="VCLibrarianTool" + OutputFile="..\..\lib\$(ProjectName)-$(TargetCPU)-wm6std-vc$(VSVer)-$(ConfigurationName).lib" + /> + <Tool + Name="VCALinkTool" + /> + <Tool + Name="VCXDCMakeTool" + /> + <Tool + Name="VCBscMakeTool" + /> + <Tool + Name="VCCodeSignTool" + /> + <Tool + Name="VCPostBuildEventTool" + /> + <DeploymentTool + ForceDirty="-1" + RemoteDirectory="" + RegisterOutput="0" + AdditionalFiles="" + /> + <DebuggerTool + /> + </Configuration> + <Configuration + Name="Debug|Windows Mobile 6 Professional SDK (ARMV4I)" + InheritedPropertySheets="..\..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\..\build\vs\pjproject-vs8-wm6-common-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" + ConfigurationType="4" + > + <Tool + Name="VCPreBuildEventTool" + /> + <Tool + Name="VCCustomBuildTool" + /> + <Tool + Name="VCXMLDataGeneratorTool" + /> + <Tool + Name="VCWebServiceProxyGeneratorTool" + /> + <Tool + Name="VCMIDLTool" + /> + <Tool + Name="VCCLCompilerTool" + PreprocessorDefinitions="_LIB;" + ExecutionBucket="7" + AdditionalIncludeDirectories="../../../pjlib/include" + PrecompiledHeaderFile="" + /> + <Tool + Name="VCManagedResourceCompilerTool" + /> + <Tool + Name="VCResourceCompilerTool" + /> + <Tool + Name="VCPreLinkEventTool" + /> + <Tool + Name="VCLibrarianTool" + OutputFile="..\..\lib\$(ProjectName)-$(TargetCPU)-wm6pro-vc$(VSVer)-$(ConfigurationName).lib" + /> + <Tool + Name="VCALinkTool" + /> + <Tool + Name="VCXDCMakeTool" + /> + <Tool + Name="VCBscMakeTool" + /> + <Tool + Name="VCCodeSignTool" + /> + <Tool + Name="VCPostBuildEventTool" + /> + <DeploymentTool + ForceDirty="-1" + RemoteDirectory="" + RegisterOutput="0" + AdditionalFiles="" + /> + <DebuggerTool + /> + </Configuration> + <Configuration + Name="Release|Win32" + InheritedPropertySheets="..\..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\..\build\vs\pjproject-vs8-win32-release-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="2" + ConfigurationType="4" + UseOfMFC="0" + > + <Tool + Name="VCPreBuildEventTool" + /> + <Tool + Name="VCCustomBuildTool" + /> + <Tool + Name="VCXMLDataGeneratorTool" + /> + <Tool + Name="VCWebServiceProxyGeneratorTool" + /> + <Tool + Name="VCMIDLTool" + /> + <Tool + Name="VCCLCompilerTool" + PreprocessorDefinitions="_LIB;" + AdditionalIncludeDirectories="../../../pjlib/include" + PrecompiledHeaderFile="" + /> + <Tool + Name="VCManagedResourceCompilerTool" + /> + <Tool + Name="VCResourceCompilerTool" + /> + <Tool + Name="VCPreLinkEventTool" + /> + <Tool + Name="VCLibrarianTool" + OutputFile="..\..\lib\$(ProjectName)-$(TargetCPU)-$(PlatformName)-vc$(VSVer)-$(ConfigurationName).lib" + /> + <Tool + Name="VCALinkTool" + /> + <Tool + Name="VCXDCMakeTool" + /> + <Tool + Name="VCBscMakeTool" + /> + <Tool + Name="VCFxCopTool" + /> + <Tool + Name="VCPostBuildEventTool" + /> + </Configuration> + <Configuration + Name="Release|Windows Mobile 6 Standard SDK (ARMV4I)" + InheritedPropertySheets="..\..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\..\build\vs\pjproject-vs8-wm6-release-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" + ConfigurationType="4" + > + <Tool + Name="VCPreBuildEventTool" + /> + <Tool + Name="VCCustomBuildTool" + /> + <Tool + Name="VCXMLDataGeneratorTool" + /> + <Tool + Name="VCWebServiceProxyGeneratorTool" + /> + <Tool + Name="VCMIDLTool" + /> + <Tool + Name="VCCLCompilerTool" + PreprocessorDefinitions="_LIB;" + ExecutionBucket="7" + AdditionalIncludeDirectories="../../../pjlib/include" + PrecompiledHeaderFile="" + /> + <Tool + Name="VCManagedResourceCompilerTool" + /> + <Tool + Name="VCResourceCompilerTool" + /> + <Tool + Name="VCPreLinkEventTool" + /> + <Tool + Name="VCLibrarianTool" + OutputFile="..\..\lib\$(ProjectName)-$(TargetCPU)-wm6std-vc$(VSVer)-$(ConfigurationName).lib" + /> + <Tool + Name="VCALinkTool" + /> + <Tool + Name="VCXDCMakeTool" + /> + <Tool + Name="VCBscMakeTool" + /> + <Tool + Name="VCCodeSignTool" + /> + <Tool + Name="VCPostBuildEventTool" + /> + <DeploymentTool + ForceDirty="-1" + RemoteDirectory="" + RegisterOutput="0" + AdditionalFiles="" + /> + <DebuggerTool + /> + </Configuration> + <Configuration + Name="Release|Windows Mobile 6 Professional SDK (ARMV4I)" + InheritedPropertySheets="..\..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\..\build\vs\pjproject-vs8-wm6-release-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" + ConfigurationType="4" + > + <Tool + Name="VCPreBuildEventTool" + /> + <Tool + Name="VCCustomBuildTool" + /> + <Tool + Name="VCXMLDataGeneratorTool" + /> + <Tool + Name="VCWebServiceProxyGeneratorTool" + /> + <Tool + Name="VCMIDLTool" + /> + <Tool + Name="VCCLCompilerTool" + PreprocessorDefinitions="_LIB;" + ExecutionBucket="7" + AdditionalIncludeDirectories="../../../pjlib/include" + PrecompiledHeaderFile="" + /> + <Tool + Name="VCManagedResourceCompilerTool" + /> + <Tool + Name="VCResourceCompilerTool" + /> + <Tool + Name="VCPreLinkEventTool" + /> + <Tool + Name="VCLibrarianTool" + OutputFile="..\..\lib\$(ProjectName)-$(TargetCPU)-wm6pro-vc$(VSVer)-$(ConfigurationName).lib" + /> + <Tool + Name="VCALinkTool" + /> + <Tool + Name="VCXDCMakeTool" + /> + <Tool + Name="VCBscMakeTool" + /> + <Tool + Name="VCCodeSignTool" + /> + <Tool + Name="VCPostBuildEventTool" + /> + <DeploymentTool + ForceDirty="-1" + RemoteDirectory="" + RegisterOutput="0" + AdditionalFiles="" + /> + <DebuggerTool + /> + </Configuration> + <Configuration + Name="Debug-Static|Win32" + InheritedPropertySheets="..\..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\..\build\vs\pjproject-vs8-win32-common-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="2" + ConfigurationType="4" + UseOfMFC="0" + > + <Tool + Name="VCPreBuildEventTool" + /> + <Tool + Name="VCCustomBuildTool" + /> + <Tool + Name="VCXMLDataGeneratorTool" + /> + <Tool + Name="VCWebServiceProxyGeneratorTool" + /> + <Tool + Name="VCMIDLTool" + /> + <Tool + Name="VCCLCompilerTool" + PreprocessorDefinitions="_LIB;" + AdditionalIncludeDirectories="../../../pjlib/include" + PrecompiledHeaderFile="" + /> + <Tool + Name="VCManagedResourceCompilerTool" + /> + <Tool + Name="VCResourceCompilerTool" + /> + <Tool + Name="VCPreLinkEventTool" + /> + <Tool + Name="VCLibrarianTool" + OutputFile="..\..\lib\$(ProjectName)-$(TargetCPU)-$(PlatformName)-vc$(VSVer)-$(ConfigurationName).lib" + /> + <Tool + Name="VCALinkTool" + /> + <Tool + Name="VCXDCMakeTool" + /> + <Tool + Name="VCBscMakeTool" + /> + <Tool + Name="VCFxCopTool" + /> + <Tool + Name="VCPostBuildEventTool" + /> + </Configuration> + <Configuration + Name="Debug-Static|Windows Mobile 6 Standard SDK (ARMV4I)" + InheritedPropertySheets="..\..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\..\build\vs\pjproject-vs8-wm6-common-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" + ConfigurationType="4" + > + <Tool + Name="VCPreBuildEventTool" + /> + <Tool + Name="VCCustomBuildTool" + /> + <Tool + Name="VCXMLDataGeneratorTool" + /> + <Tool + Name="VCWebServiceProxyGeneratorTool" + /> + <Tool + Name="VCMIDLTool" + /> + <Tool + Name="VCCLCompilerTool" + PreprocessorDefinitions="_LIB;" + ExecutionBucket="7" + AdditionalIncludeDirectories="../../../pjlib/include" + PrecompiledHeaderFile="" + /> + <Tool + Name="VCManagedResourceCompilerTool" + /> + <Tool + Name="VCResourceCompilerTool" + /> + <Tool + Name="VCPreLinkEventTool" + /> + <Tool + Name="VCLibrarianTool" + OutputFile="..\..\lib\$(ProjectName)-$(TargetCPU)-wm6std-vc$(VSVer)-$(ConfigurationName).lib" + /> + <Tool + Name="VCALinkTool" + /> + <Tool + Name="VCXDCMakeTool" + /> + <Tool + Name="VCBscMakeTool" + /> + <Tool + Name="VCCodeSignTool" + /> + <Tool + Name="VCPostBuildEventTool" + /> + <DeploymentTool + ForceDirty="-1" + RemoteDirectory="" + RegisterOutput="0" + AdditionalFiles="" + /> + <DebuggerTool + /> + </Configuration> + <Configuration + Name="Debug-Static|Windows Mobile 6 Professional SDK (ARMV4I)" + InheritedPropertySheets="..\..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\..\build\vs\pjproject-vs8-wm6-common-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" + ConfigurationType="4" + > + <Tool + Name="VCPreBuildEventTool" + /> + <Tool + Name="VCCustomBuildTool" + /> + <Tool + Name="VCXMLDataGeneratorTool" + /> + <Tool + Name="VCWebServiceProxyGeneratorTool" + /> + <Tool + Name="VCMIDLTool" + /> + <Tool + Name="VCCLCompilerTool" + PreprocessorDefinitions="_LIB;" + ExecutionBucket="7" + AdditionalIncludeDirectories="../../../pjlib/include" + PrecompiledHeaderFile="" + /> + <Tool + Name="VCManagedResourceCompilerTool" + /> + <Tool + Name="VCResourceCompilerTool" + /> + <Tool + Name="VCPreLinkEventTool" + /> + <Tool + Name="VCLibrarianTool" + OutputFile="..\..\lib\$(ProjectName)-$(TargetCPU)-wm6pro-vc$(VSVer)-$(ConfigurationName).lib" + /> + <Tool + Name="VCALinkTool" + /> + <Tool + Name="VCXDCMakeTool" + /> + <Tool + Name="VCBscMakeTool" + /> + <Tool + Name="VCCodeSignTool" + /> + <Tool + Name="VCPostBuildEventTool" + /> + <DeploymentTool + ForceDirty="-1" + RemoteDirectory="" + RegisterOutput="0" + AdditionalFiles="" + /> + <DebuggerTool + /> + </Configuration> + <Configuration + Name="Release-Dynamic|Win32" + InheritedPropertySheets="..\..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\..\build\vs\pjproject-vs8-win32-release-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="2" + ConfigurationType="4" + UseOfMFC="0" + > + <Tool + Name="VCPreBuildEventTool" + /> + <Tool + Name="VCCustomBuildTool" + /> + <Tool + Name="VCXMLDataGeneratorTool" + /> + <Tool + Name="VCWebServiceProxyGeneratorTool" + /> + <Tool + Name="VCMIDLTool" + /> + <Tool + Name="VCCLCompilerTool" + PreprocessorDefinitions="_LIB;" + AdditionalIncludeDirectories="../../../pjlib/include" + PrecompiledHeaderFile="" + /> + <Tool + Name="VCManagedResourceCompilerTool" + /> + <Tool + Name="VCResourceCompilerTool" + /> + <Tool + Name="VCPreLinkEventTool" + /> + <Tool + Name="VCLibrarianTool" + OutputFile="..\..\lib\$(ProjectName)-$(TargetCPU)-$(PlatformName)-vc$(VSVer)-$(ConfigurationName).lib" + /> + <Tool + Name="VCALinkTool" + /> + <Tool + Name="VCXDCMakeTool" + /> + <Tool + Name="VCBscMakeTool" + /> + <Tool + Name="VCFxCopTool" + /> + <Tool + Name="VCPostBuildEventTool" + /> + </Configuration> + <Configuration + Name="Release-Dynamic|Windows Mobile 6 Standard SDK (ARMV4I)" + InheritedPropertySheets="..\..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\..\build\vs\pjproject-vs8-wm6-release-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" + ConfigurationType="4" + > + <Tool + Name="VCPreBuildEventTool" + /> + <Tool + Name="VCCustomBuildTool" + /> + <Tool + Name="VCXMLDataGeneratorTool" + /> + <Tool + Name="VCWebServiceProxyGeneratorTool" + /> + <Tool + Name="VCMIDLTool" + /> + <Tool + Name="VCCLCompilerTool" + PreprocessorDefinitions="_LIB;" + ExecutionBucket="7" + AdditionalIncludeDirectories="../../../pjlib/include" + PrecompiledHeaderFile="" + /> + <Tool + Name="VCManagedResourceCompilerTool" + /> + <Tool + Name="VCResourceCompilerTool" + /> + <Tool + Name="VCPreLinkEventTool" + /> + <Tool + Name="VCLibrarianTool" + OutputFile="..\..\lib\$(ProjectName)-$(TargetCPU)-wm6std-vc$(VSVer)-$(ConfigurationName).lib" + /> + <Tool + Name="VCALinkTool" + /> + <Tool + Name="VCXDCMakeTool" + /> + <Tool + Name="VCBscMakeTool" + /> + <Tool + Name="VCCodeSignTool" + /> + <Tool + Name="VCPostBuildEventTool" + /> + <DeploymentTool + ForceDirty="-1" + RemoteDirectory="" + RegisterOutput="0" + AdditionalFiles="" + /> + <DebuggerTool + /> + </Configuration> + <Configuration + Name="Release-Dynamic|Windows Mobile 6 Professional SDK (ARMV4I)" + InheritedPropertySheets="..\..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\..\build\vs\pjproject-vs8-wm6-release-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" + ConfigurationType="4" + > + <Tool + Name="VCPreBuildEventTool" + /> + <Tool + Name="VCCustomBuildTool" + /> + <Tool + Name="VCXMLDataGeneratorTool" + /> + <Tool + Name="VCWebServiceProxyGeneratorTool" + /> + <Tool + Name="VCMIDLTool" + /> + <Tool + Name="VCCLCompilerTool" + PreprocessorDefinitions="_LIB;" + ExecutionBucket="7" + AdditionalIncludeDirectories="../../../pjlib/include" + PrecompiledHeaderFile="" + /> + <Tool + Name="VCManagedResourceCompilerTool" + /> + <Tool + Name="VCResourceCompilerTool" + /> + <Tool + Name="VCPreLinkEventTool" + /> + <Tool + Name="VCLibrarianTool" + OutputFile="..\..\lib\$(ProjectName)-$(TargetCPU)-wm6pro-vc$(VSVer)-$(ConfigurationName).lib" + /> + <Tool + Name="VCALinkTool" + /> + <Tool + Name="VCXDCMakeTool" + /> + <Tool + Name="VCBscMakeTool" + /> + <Tool + Name="VCCodeSignTool" + /> + <Tool + Name="VCPostBuildEventTool" + /> + <DeploymentTool + ForceDirty="-1" + RemoteDirectory="" + RegisterOutput="0" + AdditionalFiles="" + /> + <DebuggerTool + /> + </Configuration> + <Configuration + Name="Debug-Dynamic|Win32" + InheritedPropertySheets="..\..\..\build\vs\pjproject-vs8-debug-dynamic-defaults.vsprops;..\..\..\build\vs\pjproject-vs8-win32-common-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="2" + ConfigurationType="4" + UseOfMFC="0" + > + <Tool + Name="VCPreBuildEventTool" + /> + <Tool + Name="VCCustomBuildTool" + /> + <Tool + Name="VCXMLDataGeneratorTool" + /> + <Tool + Name="VCWebServiceProxyGeneratorTool" + /> + <Tool + Name="VCMIDLTool" + /> + <Tool + Name="VCCLCompilerTool" + PreprocessorDefinitions="_LIB;" + AdditionalIncludeDirectories="../../../pjlib/include" + PrecompiledHeaderFile="" + /> + <Tool + Name="VCManagedResourceCompilerTool" + /> + <Tool + Name="VCResourceCompilerTool" + /> + <Tool + Name="VCPreLinkEventTool" + /> + <Tool + Name="VCLibrarianTool" + OutputFile="..\..\lib\$(ProjectName)-$(TargetCPU)-$(PlatformName)-vc$(VSVer)-$(ConfigurationName).lib" + /> + <Tool + Name="VCALinkTool" + /> + <Tool + Name="VCXDCMakeTool" + /> + <Tool + Name="VCBscMakeTool" + /> + <Tool + Name="VCFxCopTool" + /> + <Tool + Name="VCPostBuildEventTool" + /> + </Configuration> + <Configuration + Name="Debug-Dynamic|Windows Mobile 6 Standard SDK (ARMV4I)" + InheritedPropertySheets="..\..\..\build\vs\pjproject-vs8-debug-dynamic-defaults.vsprops;..\..\..\build\vs\pjproject-vs8-wm6-common-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" + ConfigurationType="4" + > + <Tool + Name="VCPreBuildEventTool" + /> + <Tool + Name="VCCustomBuildTool" + /> + <Tool + Name="VCXMLDataGeneratorTool" + /> + <Tool + Name="VCWebServiceProxyGeneratorTool" + /> + <Tool + Name="VCMIDLTool" + /> + <Tool + Name="VCCLCompilerTool" + PreprocessorDefinitions="_LIB;" + ExecutionBucket="7" + AdditionalIncludeDirectories="../../../pjlib/include" + PrecompiledHeaderFile="" + /> + <Tool + Name="VCManagedResourceCompilerTool" + /> + <Tool + Name="VCResourceCompilerTool" + /> + <Tool + Name="VCPreLinkEventTool" + /> + <Tool + Name="VCLibrarianTool" + OutputFile="..\..\lib\$(ProjectName)-$(TargetCPU)-wm6std-vc$(VSVer)-$(ConfigurationName).lib" + /> + <Tool + Name="VCALinkTool" + /> + <Tool + Name="VCXDCMakeTool" + /> + <Tool + Name="VCBscMakeTool" + /> + <Tool + Name="VCCodeSignTool" + /> + <Tool + Name="VCPostBuildEventTool" + /> + <DeploymentTool + ForceDirty="-1" + RemoteDirectory="" + RegisterOutput="0" + AdditionalFiles="" + /> + <DebuggerTool + /> + </Configuration> + <Configuration + Name="Debug-Dynamic|Windows Mobile 6 Professional SDK (ARMV4I)" + InheritedPropertySheets="..\..\..\build\vs\pjproject-vs8-debug-dynamic-defaults.vsprops;..\..\..\build\vs\pjproject-vs8-wm6-common-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" + ConfigurationType="4" + > + <Tool + Name="VCPreBuildEventTool" + /> + <Tool + Name="VCCustomBuildTool" + /> + <Tool + Name="VCXMLDataGeneratorTool" + /> + <Tool + Name="VCWebServiceProxyGeneratorTool" + /> + <Tool + Name="VCMIDLTool" + /> + <Tool + Name="VCCLCompilerTool" + PreprocessorDefinitions="_LIB;" + ExecutionBucket="7" + AdditionalIncludeDirectories="../../../pjlib/include" + PrecompiledHeaderFile="" + /> + <Tool + Name="VCManagedResourceCompilerTool" + /> + <Tool + Name="VCResourceCompilerTool" + /> + <Tool + Name="VCPreLinkEventTool" + /> + <Tool + Name="VCLibrarianTool" + OutputFile="..\..\lib\$(ProjectName)-$(TargetCPU)-wm6pro-vc$(VSVer)-$(ConfigurationName).lib" + /> + <Tool + Name="VCALinkTool" + /> + <Tool + Name="VCXDCMakeTool" + /> + <Tool + Name="VCBscMakeTool" + /> + <Tool + Name="VCCodeSignTool" + /> + <Tool + Name="VCPostBuildEventTool" + /> + <DeploymentTool + ForceDirty="-1" + RemoteDirectory="" + RegisterOutput="0" + AdditionalFiles="" + /> + <DebuggerTool + /> + </Configuration> + <Configuration + Name="Release-Static|Win32" + InheritedPropertySheets="..\..\..\build\vs\pjproject-vs8-release-static-defaults.vsprops;..\..\..\build\vs\pjproject-vs8-win32-release-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="2" + ConfigurationType="4" + UseOfMFC="0" + > + <Tool + Name="VCPreBuildEventTool" + /> + <Tool + Name="VCCustomBuildTool" + /> + <Tool + Name="VCXMLDataGeneratorTool" + /> + <Tool + Name="VCWebServiceProxyGeneratorTool" + /> + <Tool + Name="VCMIDLTool" + /> + <Tool + Name="VCCLCompilerTool" + PreprocessorDefinitions="_LIB;" + AdditionalIncludeDirectories="../../../pjlib/include" + PrecompiledHeaderFile="" + /> + <Tool + Name="VCManagedResourceCompilerTool" + /> + <Tool + Name="VCResourceCompilerTool" + /> + <Tool + Name="VCPreLinkEventTool" + /> + <Tool + Name="VCLibrarianTool" + OutputFile="..\..\lib\$(ProjectName)-$(TargetCPU)-$(PlatformName)-vc$(VSVer)-$(ConfigurationName).lib" + /> + <Tool + Name="VCALinkTool" + /> + <Tool + Name="VCXDCMakeTool" + /> + <Tool + Name="VCBscMakeTool" + /> + <Tool + Name="VCFxCopTool" + /> + <Tool + Name="VCPostBuildEventTool" + /> + </Configuration> + <Configuration + Name="Release-Static|Windows Mobile 6 Standard SDK (ARMV4I)" + InheritedPropertySheets="..\..\..\build\vs\pjproject-vs8-release-static-defaults.vsprops;..\..\..\build\vs\pjproject-vs8-wm6-release-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" + ConfigurationType="4" + > + <Tool + Name="VCPreBuildEventTool" + /> + <Tool + Name="VCCustomBuildTool" + /> + <Tool + Name="VCXMLDataGeneratorTool" + /> + <Tool + Name="VCWebServiceProxyGeneratorTool" + /> + <Tool + Name="VCMIDLTool" + /> + <Tool + Name="VCCLCompilerTool" + PreprocessorDefinitions="_LIB;" + ExecutionBucket="7" + AdditionalIncludeDirectories="../../../pjlib/include" + PrecompiledHeaderFile="" + /> + <Tool + Name="VCManagedResourceCompilerTool" + /> + <Tool + Name="VCResourceCompilerTool" + /> + <Tool + Name="VCPreLinkEventTool" + /> + <Tool + Name="VCLibrarianTool" + OutputFile="..\..\lib\$(ProjectName)-$(TargetCPU)-wm6std-vc$(VSVer)-$(ConfigurationName).lib" + /> + <Tool + Name="VCALinkTool" + /> + <Tool + Name="VCXDCMakeTool" + /> + <Tool + Name="VCBscMakeTool" + /> + <Tool + Name="VCCodeSignTool" + /> + <Tool + Name="VCPostBuildEventTool" + /> + <DeploymentTool + ForceDirty="-1" + RemoteDirectory="" + RegisterOutput="0" + AdditionalFiles="" + /> + <DebuggerTool + /> + </Configuration> + <Configuration + Name="Release-Static|Windows Mobile 6 Professional SDK (ARMV4I)" + InheritedPropertySheets="..\..\..\build\vs\pjproject-vs8-release-static-defaults.vsprops;..\..\..\build\vs\pjproject-vs8-wm6-release-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" + ConfigurationType="4" + > + <Tool + Name="VCPreBuildEventTool" + /> + <Tool + Name="VCCustomBuildTool" + /> + <Tool + Name="VCXMLDataGeneratorTool" + /> + <Tool + Name="VCWebServiceProxyGeneratorTool" + /> + <Tool + Name="VCMIDLTool" + /> + <Tool + Name="VCCLCompilerTool" + PreprocessorDefinitions="_LIB;" + ExecutionBucket="7" + AdditionalIncludeDirectories="../../../pjlib/include" + PrecompiledHeaderFile="" + /> + <Tool + Name="VCManagedResourceCompilerTool" + /> + <Tool + Name="VCResourceCompilerTool" + /> + <Tool + Name="VCPreLinkEventTool" + /> + <Tool + Name="VCLibrarianTool" + OutputFile="..\..\lib\$(ProjectName)-$(TargetCPU)-wm6pro-vc$(VSVer)-$(ConfigurationName).lib" + /> + <Tool + Name="VCALinkTool" + /> + <Tool + Name="VCXDCMakeTool" + /> + <Tool + Name="VCBscMakeTool" + /> + <Tool + Name="VCCodeSignTool" + /> + <Tool + Name="VCPostBuildEventTool" + /> + <DeploymentTool + ForceDirty="-1" + RemoteDirectory="" + RegisterOutput="0" + AdditionalFiles="" + /> + <DebuggerTool + /> + </Configuration> + <Configuration + Name="Debug|Pocket PC 2003 (ARMV4)" + InheritedPropertySheets="..\..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\..\build\vs\pjproject-vs8-wm2003-common-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" + ConfigurationType="4" + > + <Tool + Name="VCPreBuildEventTool" + /> + <Tool + Name="VCCustomBuildTool" + /> + <Tool + Name="VCXMLDataGeneratorTool" + /> + <Tool + Name="VCWebServiceProxyGeneratorTool" + /> + <Tool + Name="VCMIDLTool" + /> + <Tool + Name="VCCLCompilerTool" + PreprocessorDefinitions="_LIB;" + ExecutionBucket="7" + AdditionalIncludeDirectories="../../../pjlib/include" + PrecompiledHeaderFile="" + /> + <Tool + Name="VCManagedResourceCompilerTool" + /> + <Tool + Name="VCResourceCompilerTool" + /> + <Tool + Name="VCPreLinkEventTool" + /> + <Tool + Name="VCLibrarianTool" + OutputFile="..\..\lib\$(ProjectName)-$(TargetCPU)-wm2003ppc-vc$(VSVer)-$(ConfigurationName).lib" + /> + <Tool + Name="VCALinkTool" + /> + <Tool + Name="VCXDCMakeTool" + /> + <Tool + Name="VCBscMakeTool" + /> + <Tool + Name="VCCodeSignTool" + /> + <Tool + Name="VCPostBuildEventTool" + /> + <DeploymentTool + ForceDirty="-1" + RemoteDirectory="" + RegisterOutput="0" + AdditionalFiles="" + /> + <DebuggerTool + /> + </Configuration> + <Configuration + Name="Release|Pocket PC 2003 (ARMV4)" + InheritedPropertySheets="..\..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\..\build\vs\pjproject-vs8-wm2003-release-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" + ConfigurationType="4" + > + <Tool + Name="VCPreBuildEventTool" + /> + <Tool + Name="VCCustomBuildTool" + /> + <Tool + Name="VCXMLDataGeneratorTool" + /> + <Tool + Name="VCWebServiceProxyGeneratorTool" + /> + <Tool + Name="VCMIDLTool" + /> + <Tool + Name="VCCLCompilerTool" + PreprocessorDefinitions="_LIB;" + ExecutionBucket="7" + AdditionalIncludeDirectories="../../../pjlib/include" + PrecompiledHeaderFile="" + /> + <Tool + Name="VCManagedResourceCompilerTool" + /> + <Tool + Name="VCResourceCompilerTool" + /> + <Tool + Name="VCPreLinkEventTool" + /> + <Tool + Name="VCLibrarianTool" + OutputFile="..\..\lib\$(ProjectName)-$(TargetCPU)-wm2003ppc-vc$(VSVer)-$(ConfigurationName).lib" + /> + <Tool + Name="VCALinkTool" + /> + <Tool + Name="VCXDCMakeTool" + /> + <Tool + Name="VCBscMakeTool" + /> + <Tool + Name="VCCodeSignTool" + /> + <Tool + Name="VCPostBuildEventTool" + /> + <DeploymentTool + ForceDirty="-1" + RemoteDirectory="" + RegisterOutput="0" + AdditionalFiles="" + /> + <DebuggerTool + /> + </Configuration> + <Configuration + Name="Debug-Static|Pocket PC 2003 (ARMV4)" + InheritedPropertySheets="..\..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\..\build\vs\pjproject-vs8-wm2003-common-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" + ConfigurationType="4" + > + <Tool + Name="VCPreBuildEventTool" + /> + <Tool + Name="VCCustomBuildTool" + /> + <Tool + Name="VCXMLDataGeneratorTool" + /> + <Tool + Name="VCWebServiceProxyGeneratorTool" + /> + <Tool + Name="VCMIDLTool" + /> + <Tool + Name="VCCLCompilerTool" + PreprocessorDefinitions="_LIB;" + ExecutionBucket="7" + AdditionalIncludeDirectories="../../../pjlib/include" + PrecompiledHeaderFile="" + /> + <Tool + Name="VCManagedResourceCompilerTool" + /> + <Tool + Name="VCResourceCompilerTool" + /> + <Tool + Name="VCPreLinkEventTool" + /> + <Tool + Name="VCLibrarianTool" + OutputFile="..\..\lib\$(ProjectName)-$(TargetCPU)-wm2003ppc-vc$(VSVer)-$(ConfigurationName).lib" + /> + <Tool + Name="VCALinkTool" + /> + <Tool + Name="VCXDCMakeTool" + /> + <Tool + Name="VCBscMakeTool" + /> + <Tool + Name="VCCodeSignTool" + /> + <Tool + Name="VCPostBuildEventTool" + /> + <DeploymentTool + ForceDirty="-1" + RemoteDirectory="" + RegisterOutput="0" + AdditionalFiles="" + /> + <DebuggerTool + /> + </Configuration> + <Configuration + Name="Release-Dynamic|Pocket PC 2003 (ARMV4)" + InheritedPropertySheets="..\..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\..\build\vs\pjproject-vs8-wm2003-release-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" + ConfigurationType="4" + > + <Tool + Name="VCPreBuildEventTool" + /> + <Tool + Name="VCCustomBuildTool" + /> + <Tool + Name="VCXMLDataGeneratorTool" + /> + <Tool + Name="VCWebServiceProxyGeneratorTool" + /> + <Tool + Name="VCMIDLTool" + /> + <Tool + Name="VCCLCompilerTool" + PreprocessorDefinitions="_LIB;" + ExecutionBucket="7" + AdditionalIncludeDirectories="../../../pjlib/include" + PrecompiledHeaderFile="" + /> + <Tool + Name="VCManagedResourceCompilerTool" + /> + <Tool + Name="VCResourceCompilerTool" + /> + <Tool + Name="VCPreLinkEventTool" + /> + <Tool + Name="VCLibrarianTool" + OutputFile="..\..\lib\$(ProjectName)-$(TargetCPU)-wm2003ppc-vc$(VSVer)-$(ConfigurationName).lib" + /> + <Tool + Name="VCALinkTool" + /> + <Tool + Name="VCXDCMakeTool" + /> + <Tool + Name="VCBscMakeTool" + /> + <Tool + Name="VCCodeSignTool" + /> + <Tool + Name="VCPostBuildEventTool" + /> + <DeploymentTool + ForceDirty="-1" + RemoteDirectory="" + RegisterOutput="0" + AdditionalFiles="" + /> + <DebuggerTool + /> + </Configuration> + <Configuration + Name="Debug-Dynamic|Pocket PC 2003 (ARMV4)" + InheritedPropertySheets="..\..\..\build\vs\pjproject-vs8-debug-dynamic-defaults.vsprops;..\..\..\build\vs\pjproject-vs8-wm2003-common-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" + ConfigurationType="4" + > + <Tool + Name="VCPreBuildEventTool" + /> + <Tool + Name="VCCustomBuildTool" + /> + <Tool + Name="VCXMLDataGeneratorTool" + /> + <Tool + Name="VCWebServiceProxyGeneratorTool" + /> + <Tool + Name="VCMIDLTool" + /> + <Tool + Name="VCCLCompilerTool" + PreprocessorDefinitions="_LIB;" + ExecutionBucket="7" + AdditionalIncludeDirectories="../../../pjlib/include" + PrecompiledHeaderFile="" + /> + <Tool + Name="VCManagedResourceCompilerTool" + /> + <Tool + Name="VCResourceCompilerTool" + /> + <Tool + Name="VCPreLinkEventTool" + /> + <Tool + Name="VCLibrarianTool" + OutputFile="..\..\lib\$(ProjectName)-$(TargetCPU)-wm2003ppc-vc$(VSVer)-$(ConfigurationName).lib" + /> + <Tool + Name="VCALinkTool" + /> + <Tool + Name="VCXDCMakeTool" + /> + <Tool + Name="VCBscMakeTool" + /> + <Tool + Name="VCCodeSignTool" + /> + <Tool + Name="VCPostBuildEventTool" + /> + <DeploymentTool + ForceDirty="-1" + RemoteDirectory="" + RegisterOutput="0" + AdditionalFiles="" + /> + <DebuggerTool + /> + </Configuration> + <Configuration + Name="Release-Static|Pocket PC 2003 (ARMV4)" + InheritedPropertySheets="..\..\..\build\vs\pjproject-vs8-release-static-defaults.vsprops;..\..\..\build\vs\pjproject-vs8-wm2003-release-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" + ConfigurationType="4" + > + <Tool + Name="VCPreBuildEventTool" + /> + <Tool + Name="VCCustomBuildTool" + /> + <Tool + Name="VCXMLDataGeneratorTool" + /> + <Tool + Name="VCWebServiceProxyGeneratorTool" + /> + <Tool + Name="VCMIDLTool" + /> + <Tool + Name="VCCLCompilerTool" + PreprocessorDefinitions="_LIB;" + ExecutionBucket="7" + AdditionalIncludeDirectories="../../../pjlib/include" + PrecompiledHeaderFile="" + /> + <Tool + Name="VCManagedResourceCompilerTool" + /> + <Tool + Name="VCResourceCompilerTool" + /> + <Tool + Name="VCPreLinkEventTool" + /> + <Tool + Name="VCLibrarianTool" + OutputFile="..\..\lib\$(ProjectName)-$(TargetCPU)-wm2003ppc-vc$(VSVer)-$(ConfigurationName).lib" + /> + <Tool + Name="VCALinkTool" + /> + <Tool + Name="VCXDCMakeTool" + /> + <Tool + Name="VCBscMakeTool" + /> + <Tool + Name="VCCodeSignTool" + /> + <Tool + Name="VCPostBuildEventTool" + /> + <DeploymentTool + ForceDirty="-1" + RemoteDirectory="" + RegisterOutput="0" + AdditionalFiles="" + /> + <DebuggerTool + /> + </Configuration> + <Configuration + Name="Debug|Smartphone 2003 (ARMV4)" + InheritedPropertySheets="..\..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\..\build\vs\pjproject-vs8-wm2003-common-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" + ConfigurationType="4" + > + <Tool + Name="VCPreBuildEventTool" + /> + <Tool + Name="VCCustomBuildTool" + /> + <Tool + Name="VCXMLDataGeneratorTool" + /> + <Tool + Name="VCWebServiceProxyGeneratorTool" + /> + <Tool + Name="VCMIDLTool" + /> + <Tool + Name="VCCLCompilerTool" + PreprocessorDefinitions="_LIB;" + ExecutionBucket="7" + AdditionalIncludeDirectories="../../../pjlib/include" + PrecompiledHeaderFile="" + /> + <Tool + Name="VCManagedResourceCompilerTool" + /> + <Tool + Name="VCResourceCompilerTool" + /> + <Tool + Name="VCPreLinkEventTool" + /> + <Tool + Name="VCLibrarianTool" + OutputFile="..\..\lib\$(ProjectName)-$(TargetCPU)-wm2003sp-vc$(VSVer)-$(ConfigurationName).lib" + /> + <Tool + Name="VCALinkTool" + /> + <Tool + Name="VCXDCMakeTool" + /> + <Tool + Name="VCBscMakeTool" + /> + <Tool + Name="VCCodeSignTool" + /> + <Tool + Name="VCPostBuildEventTool" + /> + <DeploymentTool + ForceDirty="-1" + RemoteDirectory="" + RegisterOutput="0" + AdditionalFiles="" + /> + <DebuggerTool + /> + </Configuration> + <Configuration + Name="Release|Smartphone 2003 (ARMV4)" + InheritedPropertySheets="..\..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\..\build\vs\pjproject-vs8-wm2003-release-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" + ConfigurationType="4" + > + <Tool + Name="VCPreBuildEventTool" + /> + <Tool + Name="VCCustomBuildTool" + /> + <Tool + Name="VCXMLDataGeneratorTool" + /> + <Tool + Name="VCWebServiceProxyGeneratorTool" + /> + <Tool + Name="VCMIDLTool" + /> + <Tool + Name="VCCLCompilerTool" + PreprocessorDefinitions="_LIB;" + ExecutionBucket="7" + AdditionalIncludeDirectories="../../../pjlib/include" + PrecompiledHeaderFile="" + /> + <Tool + Name="VCManagedResourceCompilerTool" + /> + <Tool + Name="VCResourceCompilerTool" + /> + <Tool + Name="VCPreLinkEventTool" + /> + <Tool + Name="VCLibrarianTool" + OutputFile="..\..\lib\$(ProjectName)-$(TargetCPU)-wm2003sp-vc$(VSVer)-$(ConfigurationName).lib" + /> + <Tool + Name="VCALinkTool" + /> + <Tool + Name="VCXDCMakeTool" + /> + <Tool + Name="VCBscMakeTool" + /> + <Tool + Name="VCCodeSignTool" + /> + <Tool + Name="VCPostBuildEventTool" + /> + <DeploymentTool + ForceDirty="-1" + RemoteDirectory="" + RegisterOutput="0" + AdditionalFiles="" + /> + <DebuggerTool + /> + </Configuration> + <Configuration + Name="Debug-Static|Smartphone 2003 (ARMV4)" + InheritedPropertySheets="..\..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\..\build\vs\pjproject-vs8-wm2003-common-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" + ConfigurationType="4" + > + <Tool + Name="VCPreBuildEventTool" + /> + <Tool + Name="VCCustomBuildTool" + /> + <Tool + Name="VCXMLDataGeneratorTool" + /> + <Tool + Name="VCWebServiceProxyGeneratorTool" + /> + <Tool + Name="VCMIDLTool" + /> + <Tool + Name="VCCLCompilerTool" + PreprocessorDefinitions="_LIB;" + ExecutionBucket="7" + AdditionalIncludeDirectories="../../../pjlib/include" + PrecompiledHeaderFile="" + /> + <Tool + Name="VCManagedResourceCompilerTool" + /> + <Tool + Name="VCResourceCompilerTool" + /> + <Tool + Name="VCPreLinkEventTool" + /> + <Tool + Name="VCLibrarianTool" + OutputFile="..\..\lib\$(ProjectName)-$(TargetCPU)-wm2003sp-vc$(VSVer)-$(ConfigurationName).lib" + /> + <Tool + Name="VCALinkTool" + /> + <Tool + Name="VCXDCMakeTool" + /> + <Tool + Name="VCBscMakeTool" + /> + <Tool + Name="VCCodeSignTool" + /> + <Tool + Name="VCPostBuildEventTool" + /> + <DeploymentTool + ForceDirty="-1" + RemoteDirectory="" + RegisterOutput="0" + AdditionalFiles="" + /> + <DebuggerTool + /> + </Configuration> + <Configuration + Name="Release-Dynamic|Smartphone 2003 (ARMV4)" + InheritedPropertySheets="..\..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\..\build\vs\pjproject-vs8-wm2003-release-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" + ConfigurationType="4" + > + <Tool + Name="VCPreBuildEventTool" + /> + <Tool + Name="VCCustomBuildTool" + /> + <Tool + Name="VCXMLDataGeneratorTool" + /> + <Tool + Name="VCWebServiceProxyGeneratorTool" + /> + <Tool + Name="VCMIDLTool" + /> + <Tool + Name="VCCLCompilerTool" + PreprocessorDefinitions="_LIB;" + ExecutionBucket="7" + AdditionalIncludeDirectories="../../../pjlib/include" + PrecompiledHeaderFile="" + /> + <Tool + Name="VCManagedResourceCompilerTool" + /> + <Tool + Name="VCResourceCompilerTool" + /> + <Tool + Name="VCPreLinkEventTool" + /> + <Tool + Name="VCLibrarianTool" + OutputFile="..\..\lib\$(ProjectName)-$(TargetCPU)-wm2003sp-vc$(VSVer)-$(ConfigurationName).lib" + /> + <Tool + Name="VCALinkTool" + /> + <Tool + Name="VCXDCMakeTool" + /> + <Tool + Name="VCBscMakeTool" + /> + <Tool + Name="VCCodeSignTool" + /> + <Tool + Name="VCPostBuildEventTool" + /> + <DeploymentTool + ForceDirty="-1" + RemoteDirectory="" + RegisterOutput="0" + AdditionalFiles="" + /> + <DebuggerTool + /> + </Configuration> + <Configuration + Name="Debug-Dynamic|Smartphone 2003 (ARMV4)" + InheritedPropertySheets="..\..\..\build\vs\pjproject-vs8-debug-dynamic-defaults.vsprops;..\..\..\build\vs\pjproject-vs8-wm2003-common-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" + ConfigurationType="4" + > + <Tool + Name="VCPreBuildEventTool" + /> + <Tool + Name="VCCustomBuildTool" + /> + <Tool + Name="VCXMLDataGeneratorTool" + /> + <Tool + Name="VCWebServiceProxyGeneratorTool" + /> + <Tool + Name="VCMIDLTool" + /> + <Tool + Name="VCCLCompilerTool" + PreprocessorDefinitions="_LIB;" + ExecutionBucket="7" + AdditionalIncludeDirectories="../../../pjlib/include" + PrecompiledHeaderFile="" + /> + <Tool + Name="VCManagedResourceCompilerTool" + /> + <Tool + Name="VCResourceCompilerTool" + /> + <Tool + Name="VCPreLinkEventTool" + /> + <Tool + Name="VCLibrarianTool" + OutputFile="..\..\lib\$(ProjectName)-$(TargetCPU)-wm2003sp-vc$(VSVer)-$(ConfigurationName).lib" + /> + <Tool + Name="VCALinkTool" + /> + <Tool + Name="VCXDCMakeTool" + /> + <Tool + Name="VCBscMakeTool" + /> + <Tool + Name="VCCodeSignTool" + /> + <Tool + Name="VCPostBuildEventTool" + /> + <DeploymentTool + ForceDirty="-1" + RemoteDirectory="" + RegisterOutput="0" + AdditionalFiles="" + /> + <DebuggerTool + /> + </Configuration> + <Configuration + Name="Release-Static|Smartphone 2003 (ARMV4)" + InheritedPropertySheets="..\..\..\build\vs\pjproject-vs8-release-static-defaults.vsprops;..\..\..\build\vs\pjproject-vs8-wm2003-release-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" + ConfigurationType="4" + > + <Tool + Name="VCPreBuildEventTool" + /> + <Tool + Name="VCCustomBuildTool" + /> + <Tool + Name="VCXMLDataGeneratorTool" + /> + <Tool + Name="VCWebServiceProxyGeneratorTool" + /> + <Tool + Name="VCMIDLTool" + /> + <Tool + Name="VCCLCompilerTool" + PreprocessorDefinitions="_LIB;" + ExecutionBucket="7" + AdditionalIncludeDirectories="../../../pjlib/include" + PrecompiledHeaderFile="" + /> + <Tool + Name="VCManagedResourceCompilerTool" + /> + <Tool + Name="VCResourceCompilerTool" + /> + <Tool + Name="VCPreLinkEventTool" + /> + <Tool + Name="VCLibrarianTool" + OutputFile="..\..\lib\$(ProjectName)-$(TargetCPU)-wm2003sp-vc$(VSVer)-$(ConfigurationName).lib" + /> + <Tool + Name="VCALinkTool" + /> + <Tool + Name="VCXDCMakeTool" + /> + <Tool + Name="VCBscMakeTool" + /> + <Tool + Name="VCCodeSignTool" + /> + <Tool + Name="VCPostBuildEventTool" + /> + <DeploymentTool + ForceDirty="-1" + RemoteDirectory="" + RegisterOutput="0" + AdditionalFiles="" + /> + <DebuggerTool + /> + </Configuration> + <Configuration + Name="Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + InheritedPropertySheets="..\..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\..\build\vs\pjproject-vs8-wm5-common-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" + ConfigurationType="4" + > + <Tool + Name="VCPreBuildEventTool" + /> + <Tool + Name="VCCustomBuildTool" + /> + <Tool + Name="VCXMLDataGeneratorTool" + /> + <Tool + Name="VCWebServiceProxyGeneratorTool" + /> + <Tool + Name="VCMIDLTool" + /> + <Tool + Name="VCCLCompilerTool" + PreprocessorDefinitions="_LIB;" + ExecutionBucket="7" + AdditionalIncludeDirectories="../../../pjlib/include" + PrecompiledHeaderFile="" + /> + <Tool + Name="VCManagedResourceCompilerTool" + /> + <Tool + Name="VCResourceCompilerTool" + /> + <Tool + Name="VCPreLinkEventTool" + /> + <Tool + Name="VCLibrarianTool" + OutputFile="..\..\lib\$(ProjectName)-$(TargetCPU)-wm5ppc-vc$(VSVer)-$(ConfigurationName).lib" + /> + <Tool + Name="VCALinkTool" + /> + <Tool + Name="VCXDCMakeTool" + /> + <Tool + Name="VCBscMakeTool" + /> + <Tool + Name="VCCodeSignTool" + /> + <Tool + Name="VCPostBuildEventTool" + /> + <DeploymentTool + ForceDirty="-1" + RemoteDirectory="" + RegisterOutput="0" + AdditionalFiles="" + /> + <DebuggerTool + /> + </Configuration> + <Configuration + Name="Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + InheritedPropertySheets="..\..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\..\build\vs\pjproject-vs8-wm5-release-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" + ConfigurationType="4" + > + <Tool + Name="VCPreBuildEventTool" + /> + <Tool + Name="VCCustomBuildTool" + /> + <Tool + Name="VCXMLDataGeneratorTool" + /> + <Tool + Name="VCWebServiceProxyGeneratorTool" + /> + <Tool + Name="VCMIDLTool" + /> + <Tool + Name="VCCLCompilerTool" + PreprocessorDefinitions="_LIB;" + ExecutionBucket="7" + AdditionalIncludeDirectories="../../../pjlib/include" + PrecompiledHeaderFile="" + /> + <Tool + Name="VCManagedResourceCompilerTool" + /> + <Tool + Name="VCResourceCompilerTool" + /> + <Tool + Name="VCPreLinkEventTool" + /> + <Tool + Name="VCLibrarianTool" + OutputFile="..\..\lib\$(ProjectName)-$(TargetCPU)-wm5ppc-vc$(VSVer)-$(ConfigurationName).lib" + /> + <Tool + Name="VCALinkTool" + /> + <Tool + Name="VCXDCMakeTool" + /> + <Tool + Name="VCBscMakeTool" + /> + <Tool + Name="VCCodeSignTool" + /> + <Tool + Name="VCPostBuildEventTool" + /> + <DeploymentTool + ForceDirty="-1" + RemoteDirectory="" + RegisterOutput="0" + AdditionalFiles="" + /> + <DebuggerTool + /> + </Configuration> + <Configuration + Name="Debug-Static|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + InheritedPropertySheets="..\..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\..\build\vs\pjproject-vs8-wm5-common-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" + ConfigurationType="4" + > + <Tool + Name="VCPreBuildEventTool" + /> + <Tool + Name="VCCustomBuildTool" + /> + <Tool + Name="VCXMLDataGeneratorTool" + /> + <Tool + Name="VCWebServiceProxyGeneratorTool" + /> + <Tool + Name="VCMIDLTool" + /> + <Tool + Name="VCCLCompilerTool" + PreprocessorDefinitions="_LIB;" + ExecutionBucket="7" + AdditionalIncludeDirectories="../../../pjlib/include" + PrecompiledHeaderFile="" + /> + <Tool + Name="VCManagedResourceCompilerTool" + /> + <Tool + Name="VCResourceCompilerTool" + /> + <Tool + Name="VCPreLinkEventTool" + /> + <Tool + Name="VCLibrarianTool" + OutputFile="..\..\lib\$(ProjectName)-$(TargetCPU)-wm5ppc-vc$(VSVer)-$(ConfigurationName).lib" + /> + <Tool + Name="VCALinkTool" + /> + <Tool + Name="VCXDCMakeTool" + /> + <Tool + Name="VCBscMakeTool" + /> + <Tool + Name="VCCodeSignTool" + /> + <Tool + Name="VCPostBuildEventTool" + /> + <DeploymentTool + ForceDirty="-1" + RemoteDirectory="" + RegisterOutput="0" + AdditionalFiles="" + /> + <DebuggerTool + /> + </Configuration> + <Configuration + Name="Release-Dynamic|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + InheritedPropertySheets="..\..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\..\build\vs\pjproject-vs8-wm5-release-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" + ConfigurationType="4" + > + <Tool + Name="VCPreBuildEventTool" + /> + <Tool + Name="VCCustomBuildTool" + /> + <Tool + Name="VCXMLDataGeneratorTool" + /> + <Tool + Name="VCWebServiceProxyGeneratorTool" + /> + <Tool + Name="VCMIDLTool" + /> + <Tool + Name="VCCLCompilerTool" + PreprocessorDefinitions="_LIB;" + ExecutionBucket="7" + AdditionalIncludeDirectories="../../../pjlib/include" + PrecompiledHeaderFile="" + /> + <Tool + Name="VCManagedResourceCompilerTool" + /> + <Tool + Name="VCResourceCompilerTool" + /> + <Tool + Name="VCPreLinkEventTool" + /> + <Tool + Name="VCLibrarianTool" + OutputFile="..\..\lib\$(ProjectName)-$(TargetCPU)-wm5ppc-vc$(VSVer)-$(ConfigurationName).lib" + /> + <Tool + Name="VCALinkTool" + /> + <Tool + Name="VCXDCMakeTool" + /> + <Tool + Name="VCBscMakeTool" + /> + <Tool + Name="VCCodeSignTool" + /> + <Tool + Name="VCPostBuildEventTool" + /> + <DeploymentTool + ForceDirty="-1" + RemoteDirectory="" + RegisterOutput="0" + AdditionalFiles="" + /> + <DebuggerTool + /> + </Configuration> + <Configuration + Name="Debug-Dynamic|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + InheritedPropertySheets="..\..\..\build\vs\pjproject-vs8-debug-dynamic-defaults.vsprops;..\..\..\build\vs\pjproject-vs8-wm5-common-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" + ConfigurationType="4" + > + <Tool + Name="VCPreBuildEventTool" + /> + <Tool + Name="VCCustomBuildTool" + /> + <Tool + Name="VCXMLDataGeneratorTool" + /> + <Tool + Name="VCWebServiceProxyGeneratorTool" + /> + <Tool + Name="VCMIDLTool" + /> + <Tool + Name="VCCLCompilerTool" + PreprocessorDefinitions="_LIB;" + ExecutionBucket="7" + AdditionalIncludeDirectories="../../../pjlib/include" + PrecompiledHeaderFile="" + /> + <Tool + Name="VCManagedResourceCompilerTool" + /> + <Tool + Name="VCResourceCompilerTool" + /> + <Tool + Name="VCPreLinkEventTool" + /> + <Tool + Name="VCLibrarianTool" + OutputFile="..\..\lib\$(ProjectName)-$(TargetCPU)-wm5ppc-vc$(VSVer)-$(ConfigurationName).lib" + /> + <Tool + Name="VCALinkTool" + /> + <Tool + Name="VCXDCMakeTool" + /> + <Tool + Name="VCBscMakeTool" + /> + <Tool + Name="VCCodeSignTool" + /> + <Tool + Name="VCPostBuildEventTool" + /> + <DeploymentTool + ForceDirty="-1" + RemoteDirectory="" + RegisterOutput="0" + AdditionalFiles="" + /> + <DebuggerTool + /> + </Configuration> + <Configuration + Name="Release-Static|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + InheritedPropertySheets="..\..\..\build\vs\pjproject-vs8-release-static-defaults.vsprops;..\..\..\build\vs\pjproject-vs8-wm5-release-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" + ConfigurationType="4" + > + <Tool + Name="VCPreBuildEventTool" + /> + <Tool + Name="VCCustomBuildTool" + /> + <Tool + Name="VCXMLDataGeneratorTool" + /> + <Tool + Name="VCWebServiceProxyGeneratorTool" + /> + <Tool + Name="VCMIDLTool" + /> + <Tool + Name="VCCLCompilerTool" + PreprocessorDefinitions="_LIB;" + ExecutionBucket="7" + AdditionalIncludeDirectories="../../../pjlib/include" + PrecompiledHeaderFile="" + /> + <Tool + Name="VCManagedResourceCompilerTool" + /> + <Tool + Name="VCResourceCompilerTool" + /> + <Tool + Name="VCPreLinkEventTool" + /> + <Tool + Name="VCLibrarianTool" + OutputFile="..\..\lib\$(ProjectName)-$(TargetCPU)-wm5ppc-vc$(VSVer)-$(ConfigurationName).lib" + /> + <Tool + Name="VCALinkTool" + /> + <Tool + Name="VCXDCMakeTool" + /> + <Tool + Name="VCBscMakeTool" + /> + <Tool + Name="VCCodeSignTool" + /> + <Tool + Name="VCPostBuildEventTool" + /> + <DeploymentTool + ForceDirty="-1" + RemoteDirectory="" + RegisterOutput="0" + AdditionalFiles="" + /> + <DebuggerTool + /> + </Configuration> + <Configuration + Name="Debug|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" + InheritedPropertySheets="..\..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\..\build\vs\pjproject-vs8-wm5-common-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" + ConfigurationType="4" + > + <Tool + Name="VCPreBuildEventTool" + /> + <Tool + Name="VCCustomBuildTool" + /> + <Tool + Name="VCXMLDataGeneratorTool" + /> + <Tool + Name="VCWebServiceProxyGeneratorTool" + /> + <Tool + Name="VCMIDLTool" + /> + <Tool + Name="VCCLCompilerTool" + PreprocessorDefinitions="_LIB;" + ExecutionBucket="7" + AdditionalIncludeDirectories="../../../pjlib/include" + PrecompiledHeaderFile="" + /> + <Tool + Name="VCManagedResourceCompilerTool" + /> + <Tool + Name="VCResourceCompilerTool" + /> + <Tool + Name="VCPreLinkEventTool" + /> + <Tool + Name="VCLibrarianTool" + OutputFile="..\..\lib\$(ProjectName)-$(TargetCPU)-wm5sp-vc$(VSVer)-$(ConfigurationName).lib" + /> + <Tool + Name="VCALinkTool" + /> + <Tool + Name="VCXDCMakeTool" + /> + <Tool + Name="VCBscMakeTool" + /> + <Tool + Name="VCCodeSignTool" + /> + <Tool + Name="VCPostBuildEventTool" + /> + <DeploymentTool + ForceDirty="-1" + RemoteDirectory="" + RegisterOutput="0" + AdditionalFiles="" + /> + <DebuggerTool + /> + </Configuration> + <Configuration + Name="Release|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" + InheritedPropertySheets="..\..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\..\build\vs\pjproject-vs8-wm5-release-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" + ConfigurationType="4" + > + <Tool + Name="VCPreBuildEventTool" + /> + <Tool + Name="VCCustomBuildTool" + /> + <Tool + Name="VCXMLDataGeneratorTool" + /> + <Tool + Name="VCWebServiceProxyGeneratorTool" + /> + <Tool + Name="VCMIDLTool" + /> + <Tool + Name="VCCLCompilerTool" + PreprocessorDefinitions="_LIB;" + ExecutionBucket="7" + AdditionalIncludeDirectories="../../../pjlib/include" + PrecompiledHeaderFile="" + /> + <Tool + Name="VCManagedResourceCompilerTool" + /> + <Tool + Name="VCResourceCompilerTool" + /> + <Tool + Name="VCPreLinkEventTool" + /> + <Tool + Name="VCLibrarianTool" + OutputFile="..\..\lib\$(ProjectName)-$(TargetCPU)-wm5sp-vc$(VSVer)-$(ConfigurationName).lib" + /> + <Tool + Name="VCALinkTool" + /> + <Tool + Name="VCXDCMakeTool" + /> + <Tool + Name="VCBscMakeTool" + /> + <Tool + Name="VCCodeSignTool" + /> + <Tool + Name="VCPostBuildEventTool" + /> + <DeploymentTool + ForceDirty="-1" + RemoteDirectory="" + RegisterOutput="0" + AdditionalFiles="" + /> + <DebuggerTool + /> + </Configuration> + <Configuration + Name="Debug-Static|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" + InheritedPropertySheets="..\..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\..\build\vs\pjproject-vs8-wm5-common-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" + ConfigurationType="4" + > + <Tool + Name="VCPreBuildEventTool" + /> + <Tool + Name="VCCustomBuildTool" + /> + <Tool + Name="VCXMLDataGeneratorTool" + /> + <Tool + Name="VCWebServiceProxyGeneratorTool" + /> + <Tool + Name="VCMIDLTool" + /> + <Tool + Name="VCCLCompilerTool" + PreprocessorDefinitions="_LIB;" + ExecutionBucket="7" + AdditionalIncludeDirectories="../../../pjlib/include" + PrecompiledHeaderFile="" + /> + <Tool + Name="VCManagedResourceCompilerTool" + /> + <Tool + Name="VCResourceCompilerTool" + /> + <Tool + Name="VCPreLinkEventTool" + /> + <Tool + Name="VCLibrarianTool" + OutputFile="..\..\lib\$(ProjectName)-$(TargetCPU)-wm5sp-vc$(VSVer)-$(ConfigurationName).lib" + /> + <Tool + Name="VCALinkTool" + /> + <Tool + Name="VCXDCMakeTool" + /> + <Tool + Name="VCBscMakeTool" + /> + <Tool + Name="VCCodeSignTool" + /> + <Tool + Name="VCPostBuildEventTool" + /> + <DeploymentTool + ForceDirty="-1" + RemoteDirectory="" + RegisterOutput="0" + AdditionalFiles="" + /> + <DebuggerTool + /> + </Configuration> + <Configuration + Name="Release-Dynamic|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" + InheritedPropertySheets="..\..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\..\build\vs\pjproject-vs8-wm5-release-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" + ConfigurationType="4" + > + <Tool + Name="VCPreBuildEventTool" + /> + <Tool + Name="VCCustomBuildTool" + /> + <Tool + Name="VCXMLDataGeneratorTool" + /> + <Tool + Name="VCWebServiceProxyGeneratorTool" + /> + <Tool + Name="VCMIDLTool" + /> + <Tool + Name="VCCLCompilerTool" + PreprocessorDefinitions="_LIB;" + ExecutionBucket="7" + AdditionalIncludeDirectories="../../../pjlib/include" + PrecompiledHeaderFile="" + /> + <Tool + Name="VCManagedResourceCompilerTool" + /> + <Tool + Name="VCResourceCompilerTool" + /> + <Tool + Name="VCPreLinkEventTool" + /> + <Tool + Name="VCLibrarianTool" + OutputFile="..\..\lib\$(ProjectName)-$(TargetCPU)-wm5sp-vc$(VSVer)-$(ConfigurationName).lib" + /> + <Tool + Name="VCALinkTool" + /> + <Tool + Name="VCXDCMakeTool" + /> + <Tool + Name="VCBscMakeTool" + /> + <Tool + Name="VCCodeSignTool" + /> + <Tool + Name="VCPostBuildEventTool" + /> + <DeploymentTool + ForceDirty="-1" + RemoteDirectory="" + RegisterOutput="0" + AdditionalFiles="" + /> + <DebuggerTool + /> + </Configuration> + <Configuration + Name="Debug-Dynamic|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" + InheritedPropertySheets="..\..\..\build\vs\pjproject-vs8-debug-dynamic-defaults.vsprops;..\..\..\build\vs\pjproject-vs8-wm5-common-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" + ConfigurationType="4" + > + <Tool + Name="VCPreBuildEventTool" + /> + <Tool + Name="VCCustomBuildTool" + /> + <Tool + Name="VCXMLDataGeneratorTool" + /> + <Tool + Name="VCWebServiceProxyGeneratorTool" + /> + <Tool + Name="VCMIDLTool" + /> + <Tool + Name="VCCLCompilerTool" + PreprocessorDefinitions="_LIB;" + ExecutionBucket="7" + AdditionalIncludeDirectories="../../../pjlib/include" + PrecompiledHeaderFile="" + /> + <Tool + Name="VCManagedResourceCompilerTool" + /> + <Tool + Name="VCResourceCompilerTool" + /> + <Tool + Name="VCPreLinkEventTool" + /> + <Tool + Name="VCLibrarianTool" + OutputFile="..\..\lib\$(ProjectName)-$(TargetCPU)-wm5sp-vc$(VSVer)-$(ConfigurationName).lib" + /> + <Tool + Name="VCALinkTool" + /> + <Tool + Name="VCXDCMakeTool" + /> + <Tool + Name="VCBscMakeTool" + /> + <Tool + Name="VCCodeSignTool" + /> + <Tool + Name="VCPostBuildEventTool" + /> + <DeploymentTool + ForceDirty="-1" + RemoteDirectory="" + RegisterOutput="0" + AdditionalFiles="" + /> + <DebuggerTool + /> + </Configuration> + <Configuration + Name="Release-Static|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" + InheritedPropertySheets="..\..\..\build\vs\pjproject-vs8-release-static-defaults.vsprops;..\..\..\build\vs\pjproject-vs8-wm5-release-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" + ConfigurationType="4" + > + <Tool + Name="VCPreBuildEventTool" + /> + <Tool + Name="VCCustomBuildTool" + /> + <Tool + Name="VCXMLDataGeneratorTool" + /> + <Tool + Name="VCWebServiceProxyGeneratorTool" + /> + <Tool + Name="VCMIDLTool" + /> + <Tool + Name="VCCLCompilerTool" + PreprocessorDefinitions="_LIB;" + ExecutionBucket="7" + AdditionalIncludeDirectories="../../../pjlib/include" + PrecompiledHeaderFile="" + /> + <Tool + Name="VCManagedResourceCompilerTool" + /> + <Tool + Name="VCResourceCompilerTool" + /> + <Tool + Name="VCPreLinkEventTool" + /> + <Tool + Name="VCLibrarianTool" + OutputFile="..\..\lib\$(ProjectName)-$(TargetCPU)-wm5sp-vc$(VSVer)-$(ConfigurationName).lib" + /> + <Tool + Name="VCALinkTool" + /> + <Tool + Name="VCXDCMakeTool" + /> + <Tool + Name="VCBscMakeTool" + /> + <Tool + Name="VCCodeSignTool" + /> + <Tool + Name="VCPostBuildEventTool" + /> + <DeploymentTool + ForceDirty="-1" + RemoteDirectory="" + RegisterOutput="0" + AdditionalFiles="" + /> + <DebuggerTool + /> + </Configuration> + </Configurations> + <References> + </References> + <Files> + <Filter + Name="Source Files" + Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" + > + <File + RelativePath="..\..\milenage\milenage.c" + > + <FileConfiguration + Name="Debug|Win32" + > + <Tool + Name="VCCLCompilerTool" + PreprocessorDefinitions="" + /> + </FileConfiguration> + <FileConfiguration + Name="Release|Win32" + > + <Tool + Name="VCCLCompilerTool" + PreprocessorDefinitions="" + /> + </FileConfiguration> + <FileConfiguration + Name="Debug-Static|Win32" + > + <Tool + Name="VCCLCompilerTool" + PreprocessorDefinitions="" + /> + </FileConfiguration> + <FileConfiguration + Name="Release-Dynamic|Win32" + > + <Tool + Name="VCCLCompilerTool" + PreprocessorDefinitions="" + /> + </FileConfiguration> + <FileConfiguration + Name="Debug-Dynamic|Win32" + > + <Tool + Name="VCCLCompilerTool" + PreprocessorDefinitions="" + /> + </FileConfiguration> + <FileConfiguration + Name="Release-Static|Win32" + > + <Tool + Name="VCCLCompilerTool" + PreprocessorDefinitions="" + /> + </FileConfiguration> + </File> + <File + RelativePath="..\..\milenage\rijndael.c" + > + <FileConfiguration + Name="Debug|Win32" + > + <Tool + Name="VCCLCompilerTool" + PreprocessorDefinitions="" + /> + </FileConfiguration> + <FileConfiguration + Name="Release|Win32" + > + <Tool + Name="VCCLCompilerTool" + PreprocessorDefinitions="" + /> + </FileConfiguration> + <FileConfiguration + Name="Debug-Static|Win32" + > + <Tool + Name="VCCLCompilerTool" + PreprocessorDefinitions="" + /> + </FileConfiguration> + <FileConfiguration + Name="Release-Dynamic|Win32" + > + <Tool + Name="VCCLCompilerTool" + PreprocessorDefinitions="" + /> + </FileConfiguration> + <FileConfiguration + Name="Debug-Dynamic|Win32" + > + <Tool + Name="VCCLCompilerTool" + PreprocessorDefinitions="" + /> + </FileConfiguration> + <FileConfiguration + Name="Release-Static|Win32" + > + <Tool + Name="VCCLCompilerTool" + PreprocessorDefinitions="" + /> + </FileConfiguration> + </File> + </Filter> + <Filter + Name="Header Files" + Filter="h;hpp;hxx;hm;inl" + > + <File + RelativePath="..\..\milenage\milenage.h" + > + </File> + <File + RelativePath="..\..\milenage\rijndael.h" + > + </File> + </Filter> + </Files> + <Globals> + </Globals> +</VisualStudioProject> diff --git a/sflphone-common/libs/pjproject/third_party/build/portaudio/os-auto.mak b/sflphone-common/libs/pjproject/third_party/build/portaudio/os-auto.mak deleted file mode 100644 index 79022f6df192d1ccb21fc34000725dd8e694aa22..0000000000000000000000000000000000000000 --- a/sflphone-common/libs/pjproject/third_party/build/portaudio/os-auto.mak +++ /dev/null @@ -1,79 +0,0 @@ -# third_party/build/portaudio/os-auto.mak. Generated from os-auto.mak.in by configure. - -# Define the desired sound device backend -# Valid values are: -# - pa_unix: PortAudio on Unix (OSS or ALSA) -# - pa_darwinos: PortAudio on MacOSX (CoreAudio) -# - pa_old_darwinos: PortAudio on MacOSX (old CoreAudio, for OSX 10.2) -# - pa_win32: PortAudio on Win32 (WMME) -# -# There are other values below, but these are handled by PJMEDIA's Makefile -# - ds: Win32 DirectSound (dsound.c) -# - null: Null sound device (nullsound.c) -AC_PJMEDIA_SND=pa_unix - -# For Unix, specify if ALSA should be supported -AC_PA_USE_ALSA=1 - -# For Unix, specify if OSS should be supported -AC_PA_USE_OSS=1 - -# Additional PortAudio CFLAGS are in -DHAVE_SYS_SOUNDCARD_H -DHAVE_LINUX_SOUNDCARD_H -DPA_LITTLE_ENDIAN - - -# -# PortAudio on Unix -# -ifeq ($(AC_PJMEDIA_SND),pa_unix) -# Host APIs and utils -export PORTAUDIO_OBJS += pa_unix_hostapis.o pa_unix_util.o - -# Include ALSA? -ifeq ($(AC_PA_USE_ALSA),1) -export CFLAGS += -DPA_USE_ALSA=1 -export PORTAUDIO_OBJS += pa_linux_alsa.o -endif - -export CFLAGS += -DHAVE_SYS_SOUNDCARD_H -DHAVE_LINUX_SOUNDCARD_H -DPA_LITTLE_ENDIAN -endif - -# Include OSS? -ifeq ($(AC_PA_USE_OSS),1) -export CFLAGS += -DPA_USE_OSS=1 -export PORTAUDIO_OBJS += pa_unix_oss.o -endif - -# -# PortAudio on MacOS X (using current PortAudio) -# -ifeq ($(AC_PJMEDIA_SND),pa_darwinos) -export PORTAUDIO_OBJS +=pa_mac_hostapis.o \ - pa_unix_util.o \ - pa_mac_core.o \ - pa_mac_core_blocking.o \ - pa_mac_core_utilities.o \ - pa_ringbuffer.o -export CFLAGS += -DPA_USE_COREAUDIO=1 -export CFLAGS += -DHAVE_SYS_SOUNDCARD_H -DHAVE_LINUX_SOUNDCARD_H -DPA_LITTLE_ENDIAN -endif - -# -# PortAudio on MacOS X (using old PortAudio, for MacOS X 10.2.x) -# -ifeq ($(AC_PJMEDIA_SND),pa_old_darwinos) -export PORTAUDIO_OBJS +=pa_mac_hostapis.o \ - pa_unix_util.o \ - pa_mac_core_old.o -export CFLAGS += -DPA_USE_COREAUDIO=1 -export CFLAGS += -DHAVE_SYS_SOUNDCARD_H -DHAVE_LINUX_SOUNDCARD_H -DPA_LITTLE_ENDIAN -endif - -# -# -# PortAudio on Win32 (WMME) -# -ifeq ($(AC_PJMEDIA_SND),pa_win32) -export PORTAUDIO_OBJS += pa_win_hostapis.o pa_win_util.o \ - pa_win_wmme.o pa_win_waveformat.o -export CFLAGS += -DPA_NO_ASIO -DPA_NO_DS -endif diff --git a/sflphone-common/libs/pjproject/third_party/build/speex/config.h b/sflphone-common/libs/pjproject/third_party/build/speex/config.h index e04c40be4f7383fdda6c17ec53d4369e70989492..ba7be7a6e21d233da490e2274094580c6d416459 100644 --- a/sflphone-common/libs/pjproject/third_party/build/speex/config.h +++ b/sflphone-common/libs/pjproject/third_party/build/speex/config.h @@ -4,7 +4,7 @@ #if !defined(PJ_HAS_FLOATING_POINT) || PJ_HAS_FLOATING_POINT==0 # define FIXED_POINT # define USE_KISS_FFT -#else +#else # define FLOATING_POINT # define USE_SMALLFT #endif @@ -12,7 +12,7 @@ #define EXPORT #if (defined(PJ_WIN32) && PJ_WIN32!=0) || \ - (defined(PJ_WIN32_WINCE) && PJ_WIN32_WINCE != 0) + (defined(PJ_WIN32_WINCE) && PJ_WIN32_WINCE != 0) # include "../../speex/win32/config.h" #else #define inline __inline diff --git a/sflphone-common/libs/pjproject/third_party/g7221/common/basic_op.c b/sflphone-common/libs/pjproject/third_party/g7221/common/basic_op.c index 8c6e71dcbfbcc31334a07cbc07546f62ac40be52..028d06fe96ccc6de55fdc05ca9780a1121f4139e 100644 --- a/sflphone-common/libs/pjproject/third_party/g7221/common/basic_op.c +++ b/sflphone-common/libs/pjproject/third_party/g7221/common/basic_op.c @@ -1135,7 +1135,7 @@ LIBG7221_DEF(Word16) norm_s (Word16 var1) } else { - if (var1 == (UWord16)0xffff) + if ((UWord16)var1 == (UWord16)0xffff) { var_out = 15; } diff --git a/sflphone-common/libs/pjproject/third_party/g7221/common/basic_op_i.h b/sflphone-common/libs/pjproject/third_party/g7221/common/basic_op_i.h index 8eba815ec643900b6ca186081aea3ae1900c7bd9..d6906237b100b75aef8dce6b5286979a94f4b645 100644 --- a/sflphone-common/libs/pjproject/third_party/g7221/common/basic_op_i.h +++ b/sflphone-common/libs/pjproject/third_party/g7221/common/basic_op_i.h @@ -99,7 +99,7 @@ PJ_INLINE(Word16) saturate (Word32 L_var1) if (val16 == L_var1) return val16; - if (val16 > MAX_16) + if (L_var1 > MAX_16) return MAX_16; return MIN_16; } diff --git a/sflphone-common/libs/pjproject/third_party/g7221/common/config.h b/sflphone-common/libs/pjproject/third_party/g7221/common/config.h index 925a1dae5310185863c639be6722384f1bfa8fed..4faec787d79753bddee3567150bd1663ec6df8a5 100644 --- a/sflphone-common/libs/pjproject/third_party/g7221/common/config.h +++ b/sflphone-common/libs/pjproject/third_party/g7221/common/config.h @@ -4,12 +4,15 @@ #include <pj/config.h> /** - * Expand basic operation functions as inline. + * Expand all basic operation functions as inline. Even if this is set to + * zero, some critical functions would still be expanded as inline. Note + * also that enabling this may generate some warning messages about functions + * not being referenced (with gcc). * - * Default: 1 (yes) + * Default: 0 (no) */ #ifndef PJMEDIA_LIBG7221_FUNCS_INLINED -# define PJMEDIA_LIBG7221_FUNCS_INLINED 1 +# define PJMEDIA_LIBG7221_FUNCS_INLINED 0 #endif /* Declare/define a function that may be expanded as inline. */ diff --git a/sflphone-common/libs/pjproject/third_party/ilbc/FrameClassify.c b/sflphone-common/libs/pjproject/third_party/ilbc/FrameClassify.c new file mode 100644 index 0000000000000000000000000000000000000000..80d72d917d51b3bc30e22e54eb4f544d7ada33e5 --- /dev/null +++ b/sflphone-common/libs/pjproject/third_party/ilbc/FrameClassify.c @@ -0,0 +1,114 @@ + + /****************************************************************** + + iLBC Speech Coder ANSI-C Source Code + + FrameClassify.c + + Copyright (C) The Internet Society (2004). + All Rights Reserved. + + ******************************************************************/ + + #include "iLBC_define.h" + + /*---------------------------------------------------------------* + * Classification of subframes to localize start state + *--------------------------------------------------------------*/ + + int FrameClassify( /* index to the max-energy sub-frame */ + iLBC_Enc_Inst_t *iLBCenc_inst, + /* (i/o) the encoder state structure */ + float *residual /* (i) lpc residual signal */ + ) { + float max_ssqEn, fssqEn[NSUB_MAX], bssqEn[NSUB_MAX], *pp; + int n, l, max_ssqEn_n; + const float ssqEn_win[NSUB_MAX-1]={(float)0.8,(float)0.9, + (float)1.0,(float)0.9,(float)0.8}; + const float sampEn_win[5]={(float)1.0/(float)6.0, + (float)2.0/(float)6.0, (float)3.0/(float)6.0, + (float)4.0/(float)6.0, (float)5.0/(float)6.0}; + + /* init the front and back energies to zero */ + + memset(fssqEn, 0, NSUB_MAX*sizeof(float)); + memset(bssqEn, 0, NSUB_MAX*sizeof(float)); + + /* Calculate front of first seqence */ + + n=0; + pp=residual; + for (l=0; l<5; l++) { + fssqEn[n] += sampEn_win[l] * (*pp) * (*pp); + pp++; + } + for (l=5; l<SUBL; l++) { + + + + + + fssqEn[n] += (*pp) * (*pp); + pp++; + } + + /* Calculate front and back of all middle sequences */ + + for (n=1; n<iLBCenc_inst->nsub-1; n++) { + pp=residual+n*SUBL; + for (l=0; l<5; l++) { + fssqEn[n] += sampEn_win[l] * (*pp) * (*pp); + bssqEn[n] += (*pp) * (*pp); + pp++; + } + for (l=5; l<SUBL-5; l++) { + fssqEn[n] += (*pp) * (*pp); + bssqEn[n] += (*pp) * (*pp); + pp++; + } + for (l=SUBL-5; l<SUBL; l++) { + fssqEn[n] += (*pp) * (*pp); + bssqEn[n] += sampEn_win[SUBL-l-1] * (*pp) * (*pp); + pp++; + } + } + + /* Calculate back of last seqence */ + + n=iLBCenc_inst->nsub-1; + pp=residual+n*SUBL; + for (l=0; l<SUBL-5; l++) { + bssqEn[n] += (*pp) * (*pp); + pp++; + } + for (l=SUBL-5; l<SUBL; l++) { + bssqEn[n] += sampEn_win[SUBL-l-1] * (*pp) * (*pp); + pp++; + } + + /* find the index to the weighted 80 sample with + most energy */ + + if (iLBCenc_inst->mode==20) l=1; + else l=0; + + max_ssqEn=(fssqEn[0]+bssqEn[1])*ssqEn_win[l]; + max_ssqEn_n=1; + for (n=2; n<iLBCenc_inst->nsub; n++) { + + + + + + + l++; + if ((fssqEn[n-1]+bssqEn[n])*ssqEn_win[l] > max_ssqEn) { + max_ssqEn=(fssqEn[n-1]+bssqEn[n]) * + ssqEn_win[l]; + max_ssqEn_n=n; + } + } + + return max_ssqEn_n; + } + diff --git a/sflphone-common/libs/pjproject/third_party/ilbc/FrameClassify.h b/sflphone-common/libs/pjproject/third_party/ilbc/FrameClassify.h new file mode 100644 index 0000000000000000000000000000000000000000..018ddbe5daec5c2a7b9670e2cc1de2140b0e5cbe --- /dev/null +++ b/sflphone-common/libs/pjproject/third_party/ilbc/FrameClassify.h @@ -0,0 +1,27 @@ + + /****************************************************************** + + iLBC Speech Coder ANSI-C Source Code + + FrameClassify.h + + Copyright (C) The Internet Society (2004). + All Rights Reserved. + + ******************************************************************/ + + #ifndef __iLBC_FRAMECLASSIFY_H + #define __iLBC_FRAMECLASSIFY_H + + int FrameClassify( /* index to the max-energy sub-frame */ + iLBC_Enc_Inst_t *iLBCenc_inst, + /* (i/o) the encoder state structure */ + float *residual /* (i) lpc residual signal */ + ); + + + + + + #endif + diff --git a/sflphone-common/libs/pjproject/third_party/ilbc/LPCdecode.c b/sflphone-common/libs/pjproject/third_party/ilbc/LPCdecode.c new file mode 100644 index 0000000000000000000000000000000000000000..81bab90485c7f201aeb34df64ed26703a907b195 --- /dev/null +++ b/sflphone-common/libs/pjproject/third_party/ilbc/LPCdecode.c @@ -0,0 +1,158 @@ + + /****************************************************************** + + iLBC Speech Coder ANSI-C Source Code + + LPC_decode.c + + Copyright (C) The Internet Society (2004). + All Rights Reserved. + + ******************************************************************/ + + #include <math.h> + #include <string.h> + + #include "helpfun.h" + #include "lsf.h" + #include "iLBC_define.h" + #include "constants.h" + + /*---------------------------------------------------------------* + * interpolation of lsf coefficients for the decoder + *--------------------------------------------------------------*/ + + void LSFinterpolate2a_dec( + float *a, /* (o) lpc coefficients for a sub-frame */ + float *lsf1, /* (i) first lsf coefficient vector */ + float *lsf2, /* (i) second lsf coefficient vector */ + float coef, /* (i) interpolation weight */ + int length /* (i) length of lsf vectors */ + ){ + float lsftmp[LPC_FILTERORDER]; + + interpolate(lsftmp, lsf1, lsf2, coef, length); + lsf2a(a, lsftmp); + } + + /*---------------------------------------------------------------* + * obtain dequantized lsf coefficients from quantization index + *--------------------------------------------------------------*/ + + void SimplelsfDEQ( + float *lsfdeq, /* (o) dequantized lsf coefficients */ + int *index, /* (i) quantization index */ + int lpc_n /* (i) number of LPCs */ + ){ + int i, j, pos, cb_pos; + + + + + + /* decode first LSF */ + + pos = 0; + cb_pos = 0; + for (i = 0; i < LSF_NSPLIT; i++) { + for (j = 0; j < dim_lsfCbTbl[i]; j++) { + lsfdeq[pos + j] = lsfCbTbl[cb_pos + + (long)(index[i])*dim_lsfCbTbl[i] + j]; + } + pos += dim_lsfCbTbl[i]; + cb_pos += size_lsfCbTbl[i]*dim_lsfCbTbl[i]; + } + + if (lpc_n>1) { + + /* decode last LSF */ + + pos = 0; + cb_pos = 0; + for (i = 0; i < LSF_NSPLIT; i++) { + for (j = 0; j < dim_lsfCbTbl[i]; j++) { + lsfdeq[LPC_FILTERORDER + pos + j] = + lsfCbTbl[cb_pos + + (long)(index[LSF_NSPLIT + i])* + dim_lsfCbTbl[i] + j]; + } + pos += dim_lsfCbTbl[i]; + cb_pos += size_lsfCbTbl[i]*dim_lsfCbTbl[i]; + } + } + } + + /*----------------------------------------------------------------* + * obtain synthesis and weighting filters form lsf coefficients + *---------------------------------------------------------------*/ + + void DecoderInterpolateLSF( + float *syntdenum, /* (o) synthesis filter coefficients */ + float *weightdenum, /* (o) weighting denumerator + coefficients */ + float *lsfdeq, /* (i) dequantized lsf coefficients */ + int length, /* (i) length of lsf coefficient vector */ + iLBC_Dec_Inst_t *iLBCdec_inst + /* (i) the decoder state structure */ + ){ + int i, pos, lp_length; + float lp[LPC_FILTERORDER + 1], *lsfdeq2; + + + + + + + lsfdeq2 = lsfdeq + length; + lp_length = length + 1; + + if (iLBCdec_inst->mode==30) { + /* sub-frame 1: Interpolation between old and first */ + + LSFinterpolate2a_dec(lp, iLBCdec_inst->lsfdeqold, lsfdeq, + lsf_weightTbl_30ms[0], length); + memcpy(syntdenum,lp,lp_length*sizeof(float)); + bwexpand(weightdenum, lp, LPC_CHIRP_WEIGHTDENUM, + lp_length); + + /* sub-frames 2 to 6: interpolation between first + and last LSF */ + + pos = lp_length; + for (i = 1; i < 6; i++) { + LSFinterpolate2a_dec(lp, lsfdeq, lsfdeq2, + lsf_weightTbl_30ms[i], length); + memcpy(syntdenum + pos,lp,lp_length*sizeof(float)); + bwexpand(weightdenum + pos, lp, + LPC_CHIRP_WEIGHTDENUM, lp_length); + pos += lp_length; + } + } + else { + pos = 0; + for (i = 0; i < iLBCdec_inst->nsub; i++) { + LSFinterpolate2a_dec(lp, iLBCdec_inst->lsfdeqold, + lsfdeq, lsf_weightTbl_20ms[i], length); + memcpy(syntdenum+pos,lp,lp_length*sizeof(float)); + bwexpand(weightdenum+pos, lp, LPC_CHIRP_WEIGHTDENUM, + lp_length); + pos += lp_length; + } + } + + /* update memory */ + + if (iLBCdec_inst->mode==30) + memcpy(iLBCdec_inst->lsfdeqold, lsfdeq2, + length*sizeof(float)); + else + memcpy(iLBCdec_inst->lsfdeqold, lsfdeq, + length*sizeof(float)); + + } + + + + + + diff --git a/sflphone-common/libs/pjproject/third_party/ilbc/LPCdecode.h b/sflphone-common/libs/pjproject/third_party/ilbc/LPCdecode.h new file mode 100644 index 0000000000000000000000000000000000000000..abe1d7b3b1db0521daf95abbd4e9bbec2b06fe52 --- /dev/null +++ b/sflphone-common/libs/pjproject/third_party/ilbc/LPCdecode.h @@ -0,0 +1,52 @@ + + /****************************************************************** + + iLBC Speech Coder ANSI-C Source Code + + LPC_decode.h + + Copyright (C) The Internet Society (2004). + All Rights Reserved. + + ******************************************************************/ + + #ifndef __iLBC_LPC_DECODE_H + #define __iLBC_LPC_DECODE_H + + void LSFinterpolate2a_dec( + float *a, /* (o) lpc coefficients for a sub-frame */ + float *lsf1, /* (i) first lsf coefficient vector */ + float *lsf2, /* (i) second lsf coefficient vector */ + float coef, /* (i) interpolation weight */ + int length /* (i) length of lsf vectors */ + ); + + void SimplelsfDEQ( + float *lsfdeq, /* (o) dequantized lsf coefficients */ + int *index, /* (i) quantization index */ + int lpc_n /* (i) number of LPCs */ + ); + + void DecoderInterpolateLSF( + float *syntdenum, /* (o) synthesis filter coefficients */ + float *weightdenum, /* (o) weighting denumerator + coefficients */ + float *lsfdeq, /* (i) dequantized lsf coefficients */ + int length, /* (i) length of lsf coefficient vector */ + iLBC_Dec_Inst_t *iLBCdec_inst + /* (i) the decoder state structure */ + ); + + #endif + + + + + + + + + + + + diff --git a/sflphone-common/libs/pjproject/third_party/ilbc/LPCencode.c b/sflphone-common/libs/pjproject/third_party/ilbc/LPCencode.c new file mode 100644 index 0000000000000000000000000000000000000000..19695c0fa552eece2761a4d9edd8b37abe10bd9f --- /dev/null +++ b/sflphone-common/libs/pjproject/third_party/ilbc/LPCencode.c @@ -0,0 +1,241 @@ + + /****************************************************************** + + iLBC Speech Coder ANSI-C Source Code + + LPCencode.c + + Copyright (C) The Internet Society (2004). + All Rights Reserved. + + ******************************************************************/ + + #include <string.h> + + #include "iLBC_define.h" + #include "helpfun.h" + #include "lsf.h" + #include "constants.h" + + + + + + /*----------------------------------------------------------------* + * lpc analysis (subrutine to LPCencode) + *---------------------------------------------------------------*/ + + void SimpleAnalysis( + float *lsf, /* (o) lsf coefficients */ + float *data, /* (i) new data vector */ + iLBC_Enc_Inst_t *iLBCenc_inst + /* (i/o) the encoder state structure */ + ){ + int k, is; + float temp[BLOCKL_MAX], lp[LPC_FILTERORDER + 1]; + float lp2[LPC_FILTERORDER + 1]; + float r[LPC_FILTERORDER + 1]; + + is=LPC_LOOKBACK+BLOCKL_MAX-iLBCenc_inst->blockl; + memcpy(iLBCenc_inst->lpc_buffer+is,data, + iLBCenc_inst->blockl*sizeof(float)); + + /* No lookahead, last window is asymmetric */ + + for (k = 0; k < iLBCenc_inst->lpc_n; k++) { + + is = LPC_LOOKBACK; + + if (k < (iLBCenc_inst->lpc_n - 1)) { + window(temp, lpc_winTbl, + iLBCenc_inst->lpc_buffer, BLOCKL_MAX); + } else { + window(temp, lpc_asymwinTbl, + iLBCenc_inst->lpc_buffer + is, BLOCKL_MAX); + } + + autocorr(r, temp, BLOCKL_MAX, LPC_FILTERORDER); + window(r, r, lpc_lagwinTbl, LPC_FILTERORDER + 1); + + levdurb(lp, temp, r, LPC_FILTERORDER); + bwexpand(lp2, lp, LPC_CHIRP_SYNTDENUM, LPC_FILTERORDER+1); + + a2lsf(lsf + k*LPC_FILTERORDER, lp2); + } + is=LPC_LOOKBACK+BLOCKL_MAX-iLBCenc_inst->blockl; + memmove(iLBCenc_inst->lpc_buffer, + iLBCenc_inst->lpc_buffer+LPC_LOOKBACK+BLOCKL_MAX-is, + is*sizeof(float)); + } + + /*----------------------------------------------------------------* + + + + + + * lsf interpolator and conversion from lsf to a coefficients + * (subrutine to SimpleInterpolateLSF) + *---------------------------------------------------------------*/ + + void LSFinterpolate2a_enc( + float *a, /* (o) lpc coefficients */ + float *lsf1,/* (i) first set of lsf coefficients */ + float *lsf2,/* (i) second set of lsf coefficients */ + float coef, /* (i) weighting coefficient to use between + lsf1 and lsf2 */ + long length /* (i) length of coefficient vectors */ + ){ + float lsftmp[LPC_FILTERORDER]; + + interpolate(lsftmp, lsf1, lsf2, coef, length); + lsf2a(a, lsftmp); + } + + /*----------------------------------------------------------------* + * lsf interpolator (subrutine to LPCencode) + *---------------------------------------------------------------*/ + + void SimpleInterpolateLSF( + float *syntdenum, /* (o) the synthesis filter denominator + resulting from the quantized + interpolated lsf */ + float *weightdenum, /* (o) the weighting filter denominator + resulting from the unquantized + interpolated lsf */ + float *lsf, /* (i) the unquantized lsf coefficients */ + float *lsfdeq, /* (i) the dequantized lsf coefficients */ + float *lsfold, /* (i) the unquantized lsf coefficients of + the previous signal frame */ + float *lsfdeqold, /* (i) the dequantized lsf coefficients of + the previous signal frame */ + int length, /* (i) should equate LPC_FILTERORDER */ + iLBC_Enc_Inst_t *iLBCenc_inst + /* (i/o) the encoder state structure */ + ){ + int i, pos, lp_length; + float lp[LPC_FILTERORDER + 1], *lsf2, *lsfdeq2; + + lsf2 = lsf + length; + lsfdeq2 = lsfdeq + length; + lp_length = length + 1; + + if (iLBCenc_inst->mode==30) { + /* sub-frame 1: Interpolation between old and first + + + + + + set of lsf coefficients */ + + LSFinterpolate2a_enc(lp, lsfdeqold, lsfdeq, + lsf_weightTbl_30ms[0], length); + memcpy(syntdenum,lp,lp_length*sizeof(float)); + LSFinterpolate2a_enc(lp, lsfold, lsf, + lsf_weightTbl_30ms[0], length); + bwexpand(weightdenum, lp, LPC_CHIRP_WEIGHTDENUM, lp_length); + + /* sub-frame 2 to 6: Interpolation between first + and second set of lsf coefficients */ + + pos = lp_length; + for (i = 1; i < iLBCenc_inst->nsub; i++) { + LSFinterpolate2a_enc(lp, lsfdeq, lsfdeq2, + lsf_weightTbl_30ms[i], length); + memcpy(syntdenum + pos,lp,lp_length*sizeof(float)); + + LSFinterpolate2a_enc(lp, lsf, lsf2, + lsf_weightTbl_30ms[i], length); + bwexpand(weightdenum + pos, lp, + LPC_CHIRP_WEIGHTDENUM, lp_length); + pos += lp_length; + } + } + else { + pos = 0; + for (i = 0; i < iLBCenc_inst->nsub; i++) { + LSFinterpolate2a_enc(lp, lsfdeqold, lsfdeq, + lsf_weightTbl_20ms[i], length); + memcpy(syntdenum+pos,lp,lp_length*sizeof(float)); + LSFinterpolate2a_enc(lp, lsfold, lsf, + lsf_weightTbl_20ms[i], length); + bwexpand(weightdenum+pos, lp, + LPC_CHIRP_WEIGHTDENUM, lp_length); + pos += lp_length; + } + } + + /* update memory */ + + if (iLBCenc_inst->mode==30) { + memcpy(lsfold, lsf2, length*sizeof(float)); + memcpy(lsfdeqold, lsfdeq2, length*sizeof(float)); + } + else { + memcpy(lsfold, lsf, length*sizeof(float)); + memcpy(lsfdeqold, lsfdeq, length*sizeof(float)); + + + + + + } + } + + /*----------------------------------------------------------------* + * lsf quantizer (subrutine to LPCencode) + *---------------------------------------------------------------*/ + + void SimplelsfQ( + float *lsfdeq, /* (o) dequantized lsf coefficients + (dimension FILTERORDER) */ + int *index, /* (o) quantization index */ + float *lsf, /* (i) the lsf coefficient vector to be + quantized (dimension FILTERORDER ) */ + int lpc_n /* (i) number of lsf sets to quantize */ + ){ + /* Quantize first LSF with memoryless split VQ */ + SplitVQ(lsfdeq, index, lsf, lsfCbTbl, LSF_NSPLIT, + dim_lsfCbTbl, size_lsfCbTbl); + + if (lpc_n==2) { + /* Quantize second LSF with memoryless split VQ */ + SplitVQ(lsfdeq + LPC_FILTERORDER, index + LSF_NSPLIT, + lsf + LPC_FILTERORDER, lsfCbTbl, LSF_NSPLIT, + dim_lsfCbTbl, size_lsfCbTbl); + } + } + + /*----------------------------------------------------------------* + * lpc encoder + *---------------------------------------------------------------*/ + + void LPCencode( + float *syntdenum, /* (i/o) synthesis filter coefficients + before/after encoding */ + float *weightdenum, /* (i/o) weighting denumerator + coefficients before/after + encoding */ + int *lsf_index, /* (o) lsf quantization index */ + float *data, /* (i) lsf coefficients to quantize */ + iLBC_Enc_Inst_t *iLBCenc_inst + /* (i/o) the encoder state structure */ + ){ + float lsf[LPC_FILTERORDER * LPC_N_MAX]; + float lsfdeq[LPC_FILTERORDER * LPC_N_MAX]; + int change=0; + + SimpleAnalysis(lsf, data, iLBCenc_inst); + SimplelsfQ(lsfdeq, lsf_index, lsf, iLBCenc_inst->lpc_n); + + + + + + change=LSF_check(lsfdeq, LPC_FILTERORDER, iLBCenc_inst->lpc_n); + SimpleInterpolateLSF(syntdenum, weightdenum, + lsf, lsfdeq, iLBCenc_inst->lsfold, + iLBCenc_inst->lsfdeqold, LPC_FILTERORDER, iLBCenc_inst); + } + diff --git a/sflphone-common/libs/pjproject/third_party/ilbc/LPCencode.h b/sflphone-common/libs/pjproject/third_party/ilbc/LPCencode.h new file mode 100644 index 0000000000000000000000000000000000000000..39a9b04037f6e9a3195d1ebc41a7f5bb1bbb16a9 --- /dev/null +++ b/sflphone-common/libs/pjproject/third_party/ilbc/LPCencode.h @@ -0,0 +1,28 @@ + + /****************************************************************** + + iLBC Speech Coder ANSI-C Source Code + + LPCencode.h + + Copyright (C) The Internet Society (2004). + All Rights Reserved. + + ******************************************************************/ + + #ifndef __iLBC_LPCENCOD_H + #define __iLBC_LPCENCOD_H + + void LPCencode( + float *syntdenum, /* (i/o) synthesis filter coefficients + before/after encoding */ + float *weightdenum, /* (i/o) weighting denumerator coefficients + before/after encoding */ + int *lsf_index, /* (o) lsf quantization index */ + float *data, /* (i) lsf coefficients to quantize */ + iLBC_Enc_Inst_t *iLBCenc_inst + /* (i/o) the encoder state structure */ + ); + + #endif + diff --git a/sflphone-common/libs/pjproject/third_party/ilbc/StateConstructW.c b/sflphone-common/libs/pjproject/third_party/ilbc/StateConstructW.c new file mode 100644 index 0000000000000000000000000000000000000000..1d3e65fa634e6562cf9d75800fafa24383874858 --- /dev/null +++ b/sflphone-common/libs/pjproject/third_party/ilbc/StateConstructW.c @@ -0,0 +1,86 @@ + + /****************************************************************** + + iLBC Speech Coder ANSI-C Source Code + + StateConstructW.c + + Copyright (C) The Internet Society (2004). + All Rights Reserved. + + ******************************************************************/ + + #include <math.h> + #include <string.h> + + #include "iLBC_define.h" + #include "constants.h" + #include "filter.h" + + /*----------------------------------------------------------------* + * decoding of the start state + *---------------------------------------------------------------*/ + + void StateConstructW( + int idxForMax, /* (i) 6-bit index for the quantization of + max amplitude */ + int *idxVec, /* (i) vector of quantization indexes */ + float *syntDenum, /* (i) synthesis filter denumerator */ + + + + + + float *out, /* (o) the decoded state vector */ + int len /* (i) length of a state vector */ + ){ + float maxVal, tmpbuf[LPC_FILTERORDER+2*STATE_LEN], *tmp, + numerator[LPC_FILTERORDER+1]; + float foutbuf[LPC_FILTERORDER+2*STATE_LEN], *fout; + int k,tmpi; + + /* decoding of the maximum value */ + + maxVal = state_frgqTbl[idxForMax]; + maxVal = (float)pow(10,maxVal)/(float)4.5; + + /* initialization of buffers and coefficients */ + + memset(tmpbuf, 0, LPC_FILTERORDER*sizeof(float)); + memset(foutbuf, 0, LPC_FILTERORDER*sizeof(float)); + for (k=0; k<LPC_FILTERORDER; k++) { + numerator[k]=syntDenum[LPC_FILTERORDER-k]; + } + numerator[LPC_FILTERORDER]=syntDenum[0]; + tmp = &tmpbuf[LPC_FILTERORDER]; + fout = &foutbuf[LPC_FILTERORDER]; + + /* decoding of the sample values */ + + for (k=0; k<len; k++) { + tmpi = len-1-k; + /* maxVal = 1/scal */ + tmp[k] = maxVal*state_sq3Tbl[idxVec[tmpi]]; + } + + /* circular convolution with all-pass filter */ + + memset(tmp+len, 0, len*sizeof(float)); + ZeroPoleFilter(tmp, numerator, syntDenum, 2*len, + LPC_FILTERORDER, fout); + for (k=0;k<len;k++) { + out[k] = fout[len-1-k]+fout[2*len-1-k]; + } + } + + + + + + + + + + + + diff --git a/sflphone-common/libs/pjproject/third_party/ilbc/StateConstructW.h b/sflphone-common/libs/pjproject/third_party/ilbc/StateConstructW.h new file mode 100644 index 0000000000000000000000000000000000000000..08f93d2815bebc9d54654f238c3c569d957f4b90 --- /dev/null +++ b/sflphone-common/libs/pjproject/third_party/ilbc/StateConstructW.h @@ -0,0 +1,31 @@ + + /****************************************************************** + + iLBC Speech Coder ANSI-C Source Code + + StateConstructW.h + + + + + + + Copyright (C) The Internet Society (2004). + All Rights Reserved. + + ******************************************************************/ + + #ifndef __iLBC_STATECONSTRUCTW_H + #define __iLBC_STATECONSTRUCTW_H + + void StateConstructW( + int idxForMax, /* (i) 6-bit index for the quantization of + max amplitude */ + int *idxVec, /* (i) vector of quantization indexes */ + float *syntDenum, /* (i) synthesis filter denumerator */ + float *out, /* (o) the decoded state vector */ + int len /* (i) length of a state vector */ + ); + + #endif + diff --git a/sflphone-common/libs/pjproject/third_party/ilbc/StateSearchW.c b/sflphone-common/libs/pjproject/third_party/ilbc/StateSearchW.c new file mode 100644 index 0000000000000000000000000000000000000000..1eeee936c1321ec7605c04e369ed1485a801e5d1 --- /dev/null +++ b/sflphone-common/libs/pjproject/third_party/ilbc/StateSearchW.c @@ -0,0 +1,211 @@ + + /****************************************************************** + + iLBC Speech Coder ANSI-C Source Code + + StateSearchW.c + + Copyright (C) The Internet Society (2004). + All Rights Reserved. + + ******************************************************************/ + + #include <math.h> + #include <string.h> + + #include "iLBC_define.h" + #include "constants.h" + #include "filter.h" + #include "helpfun.h" + + /*----------------------------------------------------------------* + * predictive noise shaping encoding of scaled start state + * (subrutine for StateSearchW) + *---------------------------------------------------------------*/ + + void AbsQuantW( + iLBC_Enc_Inst_t *iLBCenc_inst, + /* (i) Encoder instance */ + float *in, /* (i) vector to encode */ + float *syntDenum, /* (i) denominator of synthesis filter */ + float *weightDenum, /* (i) denominator of weighting filter */ + int *out, /* (o) vector of quantizer indexes */ + int len, /* (i) length of vector to encode and + vector of quantizer indexes */ + int state_first /* (i) position of start state in the + 80 vec */ + ){ + float *syntOut; + float syntOutBuf[LPC_FILTERORDER+STATE_SHORT_LEN_30MS]; + float toQ, xq; + int n; + int index; + + /* initialization of buffer for filtering */ + + memset(syntOutBuf, 0, LPC_FILTERORDER*sizeof(float)); + + + + + + + /* initialization of pointer for filtering */ + + syntOut = &syntOutBuf[LPC_FILTERORDER]; + + /* synthesis and weighting filters on input */ + + if (state_first) { + AllPoleFilter (in, weightDenum, SUBL, LPC_FILTERORDER); + } else { + AllPoleFilter (in, weightDenum, + iLBCenc_inst->state_short_len-SUBL, + LPC_FILTERORDER); + } + + /* encoding loop */ + + for (n=0; n<len; n++) { + + /* time update of filter coefficients */ + + if ((state_first)&&(n==SUBL)){ + syntDenum += (LPC_FILTERORDER+1); + weightDenum += (LPC_FILTERORDER+1); + + /* synthesis and weighting filters on input */ + AllPoleFilter (&in[n], weightDenum, len-n, + LPC_FILTERORDER); + + } else if ((state_first==0)&& + (n==(iLBCenc_inst->state_short_len-SUBL))) { + syntDenum += (LPC_FILTERORDER+1); + weightDenum += (LPC_FILTERORDER+1); + + /* synthesis and weighting filters on input */ + AllPoleFilter (&in[n], weightDenum, len-n, + LPC_FILTERORDER); + + } + + /* prediction of synthesized and weighted input */ + + syntOut[n] = 0.0; + AllPoleFilter (&syntOut[n], weightDenum, 1, + LPC_FILTERORDER); + + /* quantization */ + + toQ = in[n]-syntOut[n]; + + + + + + sort_sq(&xq, &index, toQ, state_sq3Tbl, 8); + out[n]=index; + syntOut[n] = state_sq3Tbl[out[n]]; + + /* update of the prediction filter */ + + AllPoleFilter(&syntOut[n], weightDenum, 1, + LPC_FILTERORDER); + } + } + + /*----------------------------------------------------------------* + * encoding of start state + *---------------------------------------------------------------*/ + + void StateSearchW( + iLBC_Enc_Inst_t *iLBCenc_inst, + /* (i) Encoder instance */ + float *residual,/* (i) target residual vector */ + float *syntDenum, /* (i) lpc synthesis filter */ + float *weightDenum, /* (i) weighting filter denuminator */ + int *idxForMax, /* (o) quantizer index for maximum + amplitude */ + int *idxVec, /* (o) vector of quantization indexes */ + int len, /* (i) length of all vectors */ + int state_first /* (i) position of start state in the + 80 vec */ + ){ + float dtmp, maxVal; + float tmpbuf[LPC_FILTERORDER+2*STATE_SHORT_LEN_30MS]; + float *tmp, numerator[1+LPC_FILTERORDER]; + float foutbuf[LPC_FILTERORDER+2*STATE_SHORT_LEN_30MS], *fout; + int k; + float qmax, scal; + + /* initialization of buffers and filter coefficients */ + + memset(tmpbuf, 0, LPC_FILTERORDER*sizeof(float)); + memset(foutbuf, 0, LPC_FILTERORDER*sizeof(float)); + for (k=0; k<LPC_FILTERORDER; k++) { + numerator[k]=syntDenum[LPC_FILTERORDER-k]; + } + numerator[LPC_FILTERORDER]=syntDenum[0]; + tmp = &tmpbuf[LPC_FILTERORDER]; + fout = &foutbuf[LPC_FILTERORDER]; + + /* circular convolution with the all-pass filter */ + + + + + + + memcpy(tmp, residual, len*sizeof(float)); + memset(tmp+len, 0, len*sizeof(float)); + ZeroPoleFilter(tmp, numerator, syntDenum, 2*len, + LPC_FILTERORDER, fout); + for (k=0; k<len; k++) { + fout[k] += fout[k+len]; + } + + /* identification of the maximum amplitude value */ + + maxVal = fout[0]; + for (k=1; k<len; k++) { + + if (fout[k]*fout[k] > maxVal*maxVal){ + maxVal = fout[k]; + } + } + maxVal=(float)fabs(maxVal); + + /* encoding of the maximum amplitude value */ + + if (maxVal < 10.0) { + maxVal = 10.0; + } + maxVal = (float)log10(maxVal); + sort_sq(&dtmp, idxForMax, maxVal, state_frgqTbl, 64); + + /* decoding of the maximum amplitude representation value, + and corresponding scaling of start state */ + + maxVal=state_frgqTbl[*idxForMax]; + qmax = (float)pow(10,maxVal); + scal = (float)(4.5)/qmax; + for (k=0; k<len; k++){ + fout[k] *= scal; + } + + /* predictive noise shaping encoding of scaled start state */ + + AbsQuantW(iLBCenc_inst, fout,syntDenum, + weightDenum,idxVec, len, state_first); + } + + + + + + + + + + + diff --git a/sflphone-common/libs/pjproject/third_party/ilbc/StateSearchW.h b/sflphone-common/libs/pjproject/third_party/ilbc/StateSearchW.h new file mode 100644 index 0000000000000000000000000000000000000000..9036daa892e80c0b1fddccd6b085dabf2e0f674b --- /dev/null +++ b/sflphone-common/libs/pjproject/third_party/ilbc/StateSearchW.h @@ -0,0 +1,52 @@ + + /****************************************************************** + + iLBC Speech Coder ANSI-C Source Code + + StateSearchW.h + + Copyright (C) The Internet Society (2004). + All Rights Reserved. + + ******************************************************************/ + + #ifndef __iLBC_STATESEARCHW_H + #define __iLBC_STATESEARCHW_H + + void AbsQuantW( + iLBC_Enc_Inst_t *iLBCenc_inst, + /* (i) Encoder instance */ + float *in, /* (i) vector to encode */ + float *syntDenum, /* (i) denominator of synthesis filter */ + float *weightDenum, /* (i) denominator of weighting filter */ + int *out, /* (o) vector of quantizer indexes */ + int len, /* (i) length of vector to encode and + vector of quantizer indexes */ + int state_first /* (i) position of start state in the + 80 vec */ + ); + + void StateSearchW( + iLBC_Enc_Inst_t *iLBCenc_inst, + /* (i) Encoder instance */ + float *residual,/* (i) target residual vector */ + float *syntDenum, /* (i) lpc synthesis filter */ + float *weightDenum, /* (i) weighting filter denuminator */ + int *idxForMax, /* (o) quantizer index for maximum + amplitude */ + int *idxVec, /* (o) vector of quantization indexes */ + int len, /* (i) length of all vectors */ + int state_first /* (i) position of start state in the + 80 vec */ + ); + + + #endif + + + + + + + + diff --git a/sflphone-common/libs/pjproject/third_party/ilbc/anaFilter.c b/sflphone-common/libs/pjproject/third_party/ilbc/anaFilter.c new file mode 100644 index 0000000000000000000000000000000000000000..c161f98a5bf78702c9d7b64a784a6f06c2df7ade --- /dev/null +++ b/sflphone-common/libs/pjproject/third_party/ilbc/anaFilter.c @@ -0,0 +1,72 @@ + + /****************************************************************** + + iLBC Speech Coder ANSI-C Source Code + + anaFilter.c + + Copyright (C) The Internet Society (2004). + All Rights Reserved. + + ******************************************************************/ + + #include <string.h> + #include "iLBC_define.h" + + /*----------------------------------------------------------------* + * LP analysis filter. + *---------------------------------------------------------------*/ + + void anaFilter( + float *In, /* (i) Signal to be filtered */ + float *a, /* (i) LP parameters */ + int len,/* (i) Length of signal */ + float *Out, /* (o) Filtered signal */ + float *mem /* (i/o) Filter state */ + ){ + int i, j; + float *po, *pi, *pm, *pa; + + po = Out; + + /* Filter first part using memory from past */ + + for (i=0; i<LPC_FILTERORDER; i++) { + pi = &In[i]; + pm = &mem[LPC_FILTERORDER-1]; + pa = a; + *po=0.0; + + + + + + for (j=0; j<=i; j++) { + *po+=(*pa++)*(*pi--); + } + for (j=i+1; j<LPC_FILTERORDER+1; j++) { + + *po+=(*pa++)*(*pm--); + } + po++; + } + + /* Filter last part where the state is entirely + in the input vector */ + + for (i=LPC_FILTERORDER; i<len; i++) { + pi = &In[i]; + pa = a; + *po=0.0; + for (j=0; j<LPC_FILTERORDER+1; j++) { + *po+=(*pa++)*(*pi--); + } + po++; + } + + /* Update state vector */ + + memcpy(mem, &In[len-LPC_FILTERORDER], + LPC_FILTERORDER*sizeof(float)); + } + diff --git a/sflphone-common/libs/pjproject/third_party/ilbc/anaFilter.h b/sflphone-common/libs/pjproject/third_party/ilbc/anaFilter.h new file mode 100644 index 0000000000000000000000000000000000000000..91367f95e04513d38e37e8e9b87e89340d342081 --- /dev/null +++ b/sflphone-common/libs/pjproject/third_party/ilbc/anaFilter.h @@ -0,0 +1,30 @@ + + /****************************************************************** + + iLBC Speech Coder ANSI-C Source Code + + anaFilter.h + + Copyright (C) The Internet Society (2004). + All Rights Reserved. + + ******************************************************************/ + + #ifndef __iLBC_ANAFILTER_H + #define __iLBC_ANAFILTER_H + + void anaFilter( + + + + + + float *In, /* (i) Signal to be filtered */ + float *a, /* (i) LP parameters */ + int len,/* (i) Length of signal */ + float *Out, /* (o) Filtered signal */ + float *mem /* (i/o) Filter state */ + ); + + #endif + diff --git a/sflphone-common/libs/pjproject/third_party/ilbc/constants.c b/sflphone-common/libs/pjproject/third_party/ilbc/constants.c new file mode 100644 index 0000000000000000000000000000000000000000..d43dac4d4e5a825d223c761307a74f758467d61b --- /dev/null +++ b/sflphone-common/libs/pjproject/third_party/ilbc/constants.c @@ -0,0 +1,770 @@ + + /****************************************************************** + + iLBC Speech Coder ANSI-C Source Code + + constants.c + + Copyright (C) The Internet Society (2004). + All Rights Reserved. + + ******************************************************************/ + + #include "iLBC_define.h" + + /* ULP bit allocation */ + + /* 20 ms frame */ + + const iLBC_ULP_Inst_t ULP_20msTbl = { + /* LSF */ + { {6,0,0,0,0}, {7,0,0,0,0}, {7,0,0,0,0}, + {0,0,0,0,0}, {0,0,0,0,0}, {0,0,0,0,0}}, + /* Start state location, gain and samples */ + {2,0,0,0,0}, + {1,0,0,0,0}, + {6,0,0,0,0}, + {0,1,2,0,0}, + /* extra CB index and extra CB gain */ + {{6,0,1,0,0}, {0,0,7,0,0}, {0,0,7,0,0}}, + {{2,0,3,0,0}, {1,1,2,0,0}, {0,0,3,0,0}}, + /* CB index and CB gain */ + { {{7,0,1,0,0}, {0,0,7,0,0}, {0,0,7,0,0}}, + {{0,0,8,0,0}, {0,0,8,0,0}, {0,0,8,0,0}}, + {{0,0,0,0,0}, {0,0,0,0,0}, {0,0,0,0,0}}, + {{0,0,0,0,0}, {0,0,0,0,0}, {0,0,0,0,0}}}, + { {{1,2,2,0,0}, {1,1,2,0,0}, {0,0,3,0,0}}, + {{1,1,3,0,0}, {0,2,2,0,0}, {0,0,3,0,0}}, + {{0,0,0,0,0}, {0,0,0,0,0}, {0,0,0,0,0}}, + {{0,0,0,0,0}, {0,0,0,0,0}, {0,0,0,0,0}}} + }; + + /* 30 ms frame */ + + const iLBC_ULP_Inst_t ULP_30msTbl = { + /* LSF */ + + + + + + { {6,0,0,0,0}, {7,0,0,0,0}, {7,0,0,0,0}, + {6,0,0,0,0}, {7,0,0,0,0}, {7,0,0,0,0}}, + /* Start state location, gain and samples */ + {3,0,0,0,0}, + {1,0,0,0,0}, + {6,0,0,0,0}, + {0,1,2,0,0}, + /* extra CB index and extra CB gain */ + {{4,2,1,0,0}, {0,0,7,0,0}, {0,0,7,0,0}}, + {{1,1,3,0,0}, {1,1,2,0,0}, {0,0,3,0,0}}, + /* CB index and CB gain */ + { {{6,1,1,0,0}, {0,0,7,0,0}, {0,0,7,0,0}}, + {{0,7,1,0,0}, {0,0,8,0,0}, {0,0,8,0,0}}, + {{0,7,1,0,0}, {0,0,8,0,0}, {0,0,8,0,0}}, + {{0,7,1,0,0}, {0,0,8,0,0}, {0,0,8,0,0}}}, + { {{1,2,2,0,0}, {1,2,1,0,0}, {0,0,3,0,0}}, + {{0,2,3,0,0}, {0,2,2,0,0}, {0,0,3,0,0}}, + {{0,1,4,0,0}, {0,1,3,0,0}, {0,0,3,0,0}}, + {{0,1,4,0,0}, {0,1,3,0,0}, {0,0,3,0,0}}} + }; + + /* HP Filters */ + + float hpi_zero_coefsTbl[3] = { + (float)0.92727436, (float)-1.8544941, (float)0.92727436 + }; + float hpi_pole_coefsTbl[3] = { + (float)1.0, (float)-1.9059465, (float)0.9114024 + }; + float hpo_zero_coefsTbl[3] = { + (float)0.93980581, (float)-1.8795834, (float)0.93980581 + }; + float hpo_pole_coefsTbl[3] = { + (float)1.0, (float)-1.9330735, (float)0.93589199 + }; + + /* LP Filter */ + + float lpFilt_coefsTbl[FILTERORDER_DS]={ + (float)-0.066650, (float)0.125000, (float)0.316650, + (float)0.414063, (float)0.316650, + (float)0.125000, (float)-0.066650 + }; + + /* State quantization tables */ + + float state_sq3Tbl[8] = { + (float)-3.719849, (float)-2.177490, (float)-1.130005, + + + + + + (float)-0.309692, (float)0.444214, (float)1.329712, + (float)2.436279, (float)3.983887 + }; + + float state_frgqTbl[64] = { + (float)1.000085, (float)1.071695, (float)1.140395, + (float)1.206868, (float)1.277188, (float)1.351503, + (float)1.429380, (float)1.500727, (float)1.569049, + (float)1.639599, (float)1.707071, (float)1.781531, + (float)1.840799, (float)1.901550, (float)1.956695, + (float)2.006750, (float)2.055474, (float)2.102787, + (float)2.142819, (float)2.183592, (float)2.217962, + (float)2.257177, (float)2.295739, (float)2.332967, + (float)2.369248, (float)2.402792, (float)2.435080, + (float)2.468598, (float)2.503394, (float)2.539284, + (float)2.572944, (float)2.605036, (float)2.636331, + (float)2.668939, (float)2.698780, (float)2.729101, + (float)2.759786, (float)2.789834, (float)2.818679, + (float)2.848074, (float)2.877470, (float)2.906899, + (float)2.936655, (float)2.967804, (float)3.000115, + (float)3.033367, (float)3.066355, (float)3.104231, + (float)3.141499, (float)3.183012, (float)3.222952, + (float)3.265433, (float)3.308441, (float)3.350823, + (float)3.395275, (float)3.442793, (float)3.490801, + (float)3.542514, (float)3.604064, (float)3.666050, + (float)3.740994, (float)3.830749, (float)3.938770, + (float)4.101764 + }; + + /* CB tables */ + + int search_rangeTbl[5][CB_NSTAGES]={{58,58,58}, {108,44,44}, + {108,108,108}, {108,108,108}, {108,108,108}}; + int stMemLTbl=85; + int memLfTbl[NASUB_MAX]={147,147,147,147}; + + /* expansion filter(s) */ + + float cbfiltersTbl[CB_FILTERLEN]={ + (float)-0.034180, (float)0.108887, (float)-0.184326, + (float)0.806152, (float)0.713379, (float)-0.144043, + (float)0.083740, (float)-0.033691 + }; + + /* Gain Quantization */ + + float gain_sq3Tbl[8]={ + (float)-1.000000, (float)-0.659973, (float)-0.330017, + + + + + + (float)0.000000, (float)0.250000, (float)0.500000, + (float)0.750000, (float)1.00000}; + + float gain_sq4Tbl[16]={ + (float)-1.049988, (float)-0.900024, (float)-0.750000, + (float)-0.599976, (float)-0.450012, (float)-0.299988, + (float)-0.150024, (float)0.000000, (float)0.150024, + (float)0.299988, (float)0.450012, (float)0.599976, + (float)0.750000, (float)0.900024, (float)1.049988, + (float)1.200012}; + + float gain_sq5Tbl[32]={ + (float)0.037476, (float)0.075012, (float)0.112488, + (float)0.150024, (float)0.187500, (float)0.224976, + (float)0.262512, (float)0.299988, (float)0.337524, + (float)0.375000, (float)0.412476, (float)0.450012, + (float)0.487488, (float)0.525024, (float)0.562500, + (float)0.599976, (float)0.637512, (float)0.674988, + (float)0.712524, (float)0.750000, (float)0.787476, + (float)0.825012, (float)0.862488, (float)0.900024, + (float)0.937500, (float)0.974976, (float)1.012512, + (float)1.049988, (float)1.087524, (float)1.125000, + (float)1.162476, (float)1.200012}; + + /* Enhancer - Upsamling a factor 4 (ENH_UPS0 = 4) */ + float polyphaserTbl[ENH_UPS0*(2*ENH_FL0+1)]={ + (float)0.000000, (float)0.000000, (float)0.000000, + (float)1.000000, + (float)0.000000, (float)0.000000, (float)0.000000, + (float)0.015625, (float)-0.076904, (float)0.288330, + (float)0.862061, + (float)-0.106445, (float)0.018799, (float)-0.015625, + (float)0.023682, (float)-0.124268, (float)0.601563, + (float)0.601563, + (float)-0.124268, (float)0.023682, (float)-0.023682, + (float)0.018799, (float)-0.106445, (float)0.862061, + (float)0.288330, + (float)-0.076904, (float)0.015625, (float)-0.018799}; + + float enh_plocsTbl[ENH_NBLOCKS_TOT] = {(float)40.0, (float)120.0, + (float)200.0, (float)280.0, (float)360.0, + (float)440.0, (float)520.0, (float)600.0}; + + /* LPC analysis and quantization */ + + int dim_lsfCbTbl[LSF_NSPLIT] = {3, 3, 4}; + int size_lsfCbTbl[LSF_NSPLIT] = {64,128,128}; + + + + + + + float lsfmeanTbl[LPC_FILTERORDER] = { + (float)0.281738, (float)0.445801, (float)0.663330, + (float)0.962524, (float)1.251831, (float)1.533081, + (float)1.850586, (float)2.137817, (float)2.481445, + (float)2.777344}; + + float lsf_weightTbl_30ms[6] = {(float)(1.0/2.0), (float)1.0, + (float)(2.0/3.0), + (float)(1.0/3.0), (float)0.0, (float)0.0}; + + float lsf_weightTbl_20ms[4] = {(float)(3.0/4.0), (float)(2.0/4.0), + (float)(1.0/4.0), (float)(0.0)}; + + /* Hanning LPC window */ + float lpc_winTbl[BLOCKL_MAX]={ + (float)0.000183, (float)0.000671, (float)0.001526, + (float)0.002716, (float)0.004242, (float)0.006104, + (float)0.008301, (float)0.010834, (float)0.013702, + (float)0.016907, (float)0.020416, (float)0.024261, + (float)0.028442, (float)0.032928, (float)0.037750, + (float)0.042877, (float)0.048309, (float)0.054047, + (float)0.060089, (float)0.066437, (float)0.073090, + (float)0.080017, (float)0.087219, (float)0.094727, + (float)0.102509, (float)0.110535, (float)0.118835, + (float)0.127411, (float)0.136230, (float)0.145294, + (float)0.154602, (float)0.164154, (float)0.173920, + (float)0.183899, (float)0.194122, (float)0.204529, + (float)0.215149, (float)0.225952, (float)0.236938, + (float)0.248108, (float)0.259460, (float)0.270966, + (float)0.282654, (float)0.294464, (float)0.306396, + (float)0.318481, (float)0.330688, (float)0.343018, + (float)0.355438, (float)0.367981, (float)0.380585, + (float)0.393280, (float)0.406067, (float)0.418884, + (float)0.431763, (float)0.444702, (float)0.457672, + (float)0.470673, (float)0.483704, (float)0.496735, + (float)0.509766, (float)0.522797, (float)0.535828, + (float)0.548798, (float)0.561768, (float)0.574677, + (float)0.587524, (float)0.600342, (float)0.613068, + (float)0.625732, (float)0.638306, (float)0.650787, + (float)0.663147, (float)0.675415, (float)0.687561, + (float)0.699585, (float)0.711487, (float)0.723206, + (float)0.734802, (float)0.746216, (float)0.757477, + (float)0.768585, (float)0.779480, (float)0.790192, + (float)0.800720, (float)0.811005, (float)0.821106, + (float)0.830994, (float)0.840668, (float)0.850067, + (float)0.859253, (float)0.868225, (float)0.876892, + (float)0.885345, (float)0.893524, (float)0.901428, + (float)0.909058, (float)0.916412, (float)0.923492, + + + + + + (float)0.930267, (float)0.936768, (float)0.942963, + (float)0.948853, (float)0.954437, (float)0.959717, + (float)0.964691, (float)0.969360, (float)0.973694, + (float)0.977692, (float)0.981384, (float)0.984741, + (float)0.987762, (float)0.990479, (float)0.992828, + (float)0.994873, (float)0.996552, (float)0.997925, + (float)0.998932, (float)0.999603, (float)0.999969, + (float)0.999969, (float)0.999603, (float)0.998932, + (float)0.997925, (float)0.996552, (float)0.994873, + (float)0.992828, (float)0.990479, (float)0.987762, + (float)0.984741, (float)0.981384, (float)0.977692, + (float)0.973694, (float)0.969360, (float)0.964691, + (float)0.959717, (float)0.954437, (float)0.948853, + (float)0.942963, (float)0.936768, (float)0.930267, + (float)0.923492, (float)0.916412, (float)0.909058, + (float)0.901428, (float)0.893524, (float)0.885345, + (float)0.876892, (float)0.868225, (float)0.859253, + (float)0.850067, (float)0.840668, (float)0.830994, + (float)0.821106, (float)0.811005, (float)0.800720, + (float)0.790192, (float)0.779480, (float)0.768585, + (float)0.757477, (float)0.746216, (float)0.734802, + (float)0.723206, (float)0.711487, (float)0.699585, + (float)0.687561, (float)0.675415, (float)0.663147, + (float)0.650787, (float)0.638306, (float)0.625732, + (float)0.613068, (float)0.600342, (float)0.587524, + (float)0.574677, (float)0.561768, (float)0.548798, + (float)0.535828, (float)0.522797, (float)0.509766, + (float)0.496735, (float)0.483704, (float)0.470673, + (float)0.457672, (float)0.444702, (float)0.431763, + (float)0.418884, (float)0.406067, (float)0.393280, + (float)0.380585, (float)0.367981, (float)0.355438, + (float)0.343018, (float)0.330688, (float)0.318481, + (float)0.306396, (float)0.294464, (float)0.282654, + (float)0.270966, (float)0.259460, (float)0.248108, + (float)0.236938, (float)0.225952, (float)0.215149, + (float)0.204529, (float)0.194122, (float)0.183899, + (float)0.173920, (float)0.164154, (float)0.154602, + (float)0.145294, (float)0.136230, (float)0.127411, + (float)0.118835, (float)0.110535, (float)0.102509, + (float)0.094727, (float)0.087219, (float)0.080017, + (float)0.073090, (float)0.066437, (float)0.060089, + (float)0.054047, (float)0.048309, (float)0.042877, + (float)0.037750, (float)0.032928, (float)0.028442, + (float)0.024261, (float)0.020416, (float)0.016907, + (float)0.013702, (float)0.010834, (float)0.008301, + (float)0.006104, (float)0.004242, (float)0.002716, + (float)0.001526, (float)0.000671, (float)0.000183 + }; + + + + + + /* Asymmetric LPC window */ + float lpc_asymwinTbl[BLOCKL_MAX]={ + (float)0.000061, (float)0.000214, (float)0.000458, + (float)0.000824, (float)0.001282, (float)0.001831, + (float)0.002472, (float)0.003235, (float)0.004120, + (float)0.005066, (float)0.006134, (float)0.007294, + (float)0.008545, (float)0.009918, (float)0.011383, + (float)0.012939, (float)0.014587, (float)0.016357, + (float)0.018219, (float)0.020172, (float)0.022217, + (float)0.024353, (float)0.026611, (float)0.028961, + (float)0.031372, (float)0.033905, (float)0.036530, + (float)0.039276, (float)0.042084, (float)0.044983, + (float)0.047974, (float)0.051086, (float)0.054260, + (float)0.057526, (float)0.060883, (float)0.064331, + (float)0.067871, (float)0.071503, (float)0.075226, + (float)0.079010, (float)0.082916, (float)0.086884, + (float)0.090942, (float)0.095062, (float)0.099304, + (float)0.103607, (float)0.107971, (float)0.112427, + (float)0.116974, (float)0.121582, (float)0.126282, + (float)0.131073, (float)0.135895, (float)0.140839, + (float)0.145813, (float)0.150879, (float)0.156006, + (float)0.161224, (float)0.166504, (float)0.171844, + (float)0.177246, (float)0.182709, (float)0.188263, + (float)0.193848, (float)0.199524, (float)0.205231, + (float)0.211029, (float)0.216858, (float)0.222778, + (float)0.228729, (float)0.234741, (float)0.240814, + (float)0.246918, (float)0.253082, (float)0.259308, + (float)0.265564, (float)0.271881, (float)0.278259, + (float)0.284668, (float)0.291107, (float)0.297607, + (float)0.304138, (float)0.310730, (float)0.317322, + (float)0.323975, (float)0.330658, (float)0.337372, + (float)0.344147, (float)0.350922, (float)0.357727, + (float)0.364594, (float)0.371460, (float)0.378357, + (float)0.385284, (float)0.392212, (float)0.399170, + (float)0.406158, (float)0.413177, (float)0.420197, + (float)0.427246, (float)0.434296, (float)0.441376, + (float)0.448456, (float)0.455536, (float)0.462646, + (float)0.469757, (float)0.476868, (float)0.483978, + (float)0.491089, (float)0.498230, (float)0.505341, + (float)0.512451, (float)0.519592, (float)0.526703, + (float)0.533813, (float)0.540924, (float)0.548004, + (float)0.555084, (float)0.562164, (float)0.569244, + (float)0.576294, (float)0.583313, (float)0.590332, + (float)0.597321, (float)0.604309, (float)0.611267, + (float)0.618195, (float)0.625092, (float)0.631989, + (float)0.638855, (float)0.645660, (float)0.652466, + (float)0.659241, (float)0.665985, (float)0.672668, + (float)0.679352, (float)0.685974, (float)0.692566, + + + + + + (float)0.699127, (float)0.705658, (float)0.712128, + (float)0.718536, (float)0.724945, (float)0.731262, + (float)0.737549, (float)0.743805, (float)0.750000, + (float)0.756134, (float)0.762238, (float)0.768280, + (float)0.774261, (float)0.780182, (float)0.786072, + (float)0.791870, (float)0.797638, (float)0.803314, + (float)0.808960, (float)0.814514, (float)0.820038, + (float)0.825470, (float)0.830841, (float)0.836151, + (float)0.841400, (float)0.846558, (float)0.851654, + (float)0.856689, (float)0.861633, (float)0.866516, + (float)0.871338, (float)0.876068, (float)0.880737, + (float)0.885315, (float)0.889801, (float)0.894226, + (float)0.898560, (float)0.902832, (float)0.907013, + (float)0.911102, (float)0.915100, (float)0.919037, + (float)0.922882, (float)0.926636, (float)0.930328, + (float)0.933899, (float)0.937408, (float)0.940796, + (float)0.944122, (float)0.947357, (float)0.950470, + (float)0.953522, (float)0.956482, (float)0.959351, + (float)0.962097, (float)0.964783, (float)0.967377, + (float)0.969849, (float)0.972229, (float)0.974518, + (float)0.976715, (float)0.978821, (float)0.980835, + (float)0.982727, (float)0.984528, (float)0.986237, + (float)0.987854, (float)0.989380, (float)0.990784, + (float)0.992096, (float)0.993317, (float)0.994415, + (float)0.995422, (float)0.996338, (float)0.997162, + (float)0.997864, (float)0.998474, (float)0.998962, + (float)0.999390, (float)0.999695, (float)0.999878, + (float)0.999969, (float)0.999969, (float)0.996918, + (float)0.987701, (float)0.972382, (float)0.951050, + (float)0.923889, (float)0.891022, (float)0.852631, + (float)0.809021, (float)0.760406, (float)0.707092, + (float)0.649445, (float)0.587799, (float)0.522491, + (float)0.453979, (float)0.382690, (float)0.309021, + (float)0.233459, (float)0.156433, (float)0.078461 + }; + + /* Lag window for LPC */ + float lpc_lagwinTbl[LPC_FILTERORDER + 1]={ + (float)1.000100, (float)0.998890, (float)0.995569, + (float)0.990057, (float)0.982392, + (float)0.972623, (float)0.960816, (float)0.947047, + (float)0.931405, (float)0.913989, (float)0.894909}; + + /* LSF quantization*/ + float lsfCbTbl[64 * 3 + 128 * 3 + 128 * 4] = { + (float)0.155396, (float)0.273193, (float)0.451172, + (float)0.390503, (float)0.648071, (float)1.002075, + (float)0.440186, (float)0.692261, (float)0.955688, + + + + + + (float)0.343628, (float)0.642334, (float)1.071533, + (float)0.318359, (float)0.491577, (float)0.670532, + (float)0.193115, (float)0.375488, (float)0.725708, + (float)0.364136, (float)0.510376, (float)0.658691, + (float)0.297485, (float)0.527588, (float)0.842529, + (float)0.227173, (float)0.365967, (float)0.563110, + (float)0.244995, (float)0.396729, (float)0.636475, + (float)0.169434, (float)0.300171, (float)0.520264, + (float)0.312866, (float)0.464478, (float)0.643188, + (float)0.248535, (float)0.429932, (float)0.626099, + (float)0.236206, (float)0.491333, (float)0.817139, + (float)0.334961, (float)0.625122, (float)0.895752, + (float)0.343018, (float)0.518555, (float)0.698608, + (float)0.372803, (float)0.659790, (float)0.945435, + (float)0.176880, (float)0.316528, (float)0.581421, + (float)0.416382, (float)0.625977, (float)0.805176, + (float)0.303223, (float)0.568726, (float)0.915039, + (float)0.203613, (float)0.351440, (float)0.588135, + (float)0.221191, (float)0.375000, (float)0.614746, + (float)0.199951, (float)0.323364, (float)0.476074, + (float)0.300781, (float)0.433350, (float)0.566895, + (float)0.226196, (float)0.354004, (float)0.507568, + (float)0.300049, (float)0.508179, (float)0.711670, + (float)0.312012, (float)0.492676, (float)0.763428, + (float)0.329956, (float)0.541016, (float)0.795776, + (float)0.373779, (float)0.604614, (float)0.928833, + (float)0.210571, (float)0.452026, (float)0.755249, + (float)0.271118, (float)0.473267, (float)0.662476, + (float)0.285522, (float)0.436890, (float)0.634399, + (float)0.246704, (float)0.565552, (float)0.859009, + (float)0.270508, (float)0.406250, (float)0.553589, + (float)0.361450, (float)0.578491, (float)0.813843, + (float)0.342651, (float)0.482788, (float)0.622437, + (float)0.340332, (float)0.549438, (float)0.743164, + (float)0.200439, (float)0.336304, (float)0.540894, + (float)0.407837, (float)0.644775, (float)0.895142, + (float)0.294678, (float)0.454834, (float)0.699097, + (float)0.193115, (float)0.344482, (float)0.643188, + (float)0.275757, (float)0.420776, (float)0.598755, + (float)0.380493, (float)0.608643, (float)0.861084, + (float)0.222778, (float)0.426147, (float)0.676514, + (float)0.407471, (float)0.700195, (float)1.053101, + (float)0.218384, (float)0.377197, (float)0.669922, + (float)0.313232, (float)0.454102, (float)0.600952, + (float)0.347412, (float)0.571533, (float)0.874146, + (float)0.238037, (float)0.405396, (float)0.729492, + (float)0.223877, (float)0.412964, (float)0.822021, + (float)0.395264, (float)0.582153, (float)0.743896, + + + + + + (float)0.247925, (float)0.485596, (float)0.720581, + (float)0.229126, (float)0.496582, (float)0.907715, + (float)0.260132, (float)0.566895, (float)1.012695, + (float)0.337402, (float)0.611572, (float)0.978149, + (float)0.267822, (float)0.447632, (float)0.769287, + (float)0.250610, (float)0.381714, (float)0.530029, + (float)0.430054, (float)0.805054, (float)1.221924, + (float)0.382568, (float)0.544067, (float)0.701660, + (float)0.383545, (float)0.710327, (float)1.149170, + (float)0.271362, (float)0.529053, (float)0.775513, + (float)0.246826, (float)0.393555, (float)0.588623, + (float)0.266846, (float)0.422119, (float)0.676758, + (float)0.311523, (float)0.580688, (float)0.838623, + (float)1.331177, (float)1.576782, (float)1.779541, + (float)1.160034, (float)1.401978, (float)1.768188, + (float)1.161865, (float)1.525146, (float)1.715332, + (float)0.759521, (float)0.913940, (float)1.119873, + (float)0.947144, (float)1.121338, (float)1.282471, + (float)1.015015, (float)1.557007, (float)1.804932, + (float)1.172974, (float)1.402100, (float)1.692627, + (float)1.087524, (float)1.474243, (float)1.665405, + (float)0.899536, (float)1.105225, (float)1.406250, + (float)1.148438, (float)1.484741, (float)1.796265, + (float)0.785645, (float)1.209839, (float)1.567749, + (float)0.867798, (float)1.166504, (float)1.450684, + (float)0.922485, (float)1.229858, (float)1.420898, + (float)0.791260, (float)1.123291, (float)1.409546, + (float)0.788940, (float)0.966064, (float)1.340332, + (float)1.051147, (float)1.272827, (float)1.556641, + (float)0.866821, (float)1.181152, (float)1.538818, + (float)0.906738, (float)1.373535, (float)1.607910, + (float)1.244751, (float)1.581421, (float)1.933838, + (float)0.913940, (float)1.337280, (float)1.539673, + (float)0.680542, (float)0.959229, (float)1.662720, + (float)0.887207, (float)1.430542, (float)1.800781, + (float)0.912598, (float)1.433594, (float)1.683960, + (float)0.860474, (float)1.060303, (float)1.455322, + (float)1.005127, (float)1.381104, (float)1.706909, + (float)0.800781, (float)1.363892, (float)1.829102, + (float)0.781860, (float)1.124390, (float)1.505981, + (float)1.003662, (float)1.471436, (float)1.684692, + (float)0.981323, (float)1.309570, (float)1.618042, + (float)1.228760, (float)1.554321, (float)1.756470, + (float)0.734375, (float)0.895752, (float)1.225586, + (float)0.841797, (float)1.055664, (float)1.249268, + (float)0.920166, (float)1.119385, (float)1.486206, + (float)0.894409, (float)1.539063, (float)1.828979, + (float)1.283691, (float)1.543335, (float)1.858276, + + + + + + (float)0.676025, (float)0.933105, (float)1.490845, + (float)0.821289, (float)1.491821, (float)1.739868, + (float)0.923218, (float)1.144653, (float)1.580566, + (float)1.057251, (float)1.345581, (float)1.635864, + (float)0.888672, (float)1.074951, (float)1.353149, + (float)0.942749, (float)1.195435, (float)1.505493, + (float)1.492310, (float)1.788086, (float)2.039673, + (float)1.070313, (float)1.634399, (float)1.860962, + (float)1.253296, (float)1.488892, (float)1.686035, + (float)0.647095, (float)0.864014, (float)1.401855, + (float)0.866699, (float)1.254883, (float)1.453369, + (float)1.063965, (float)1.532593, (float)1.731323, + (float)1.167847, (float)1.521484, (float)1.884033, + (float)0.956055, (float)1.502075, (float)1.745605, + (float)0.928711, (float)1.288574, (float)1.479614, + (float)1.088013, (float)1.380737, (float)1.570801, + (float)0.905029, (float)1.186768, (float)1.371948, + (float)1.057861, (float)1.421021, (float)1.617432, + (float)1.108276, (float)1.312500, (float)1.501465, + (float)0.979492, (float)1.416992, (float)1.624268, + (float)1.276001, (float)1.661011, (float)2.007935, + (float)0.993042, (float)1.168579, (float)1.331665, + (float)0.778198, (float)0.944946, (float)1.235962, + (float)1.223755, (float)1.491333, (float)1.815674, + (float)0.852661, (float)1.350464, (float)1.722290, + (float)1.134766, (float)1.593140, (float)1.787354, + (float)1.051392, (float)1.339722, (float)1.531006, + (float)0.803589, (float)1.271240, (float)1.652100, + (float)0.755737, (float)1.143555, (float)1.639404, + (float)0.700928, (float)0.837280, (float)1.130371, + (float)0.942749, (float)1.197876, (float)1.669800, + (float)0.993286, (float)1.378296, (float)1.566528, + (float)0.801025, (float)1.095337, (float)1.298950, + (float)0.739990, (float)1.032959, (float)1.383667, + (float)0.845703, (float)1.072266, (float)1.543823, + (float)0.915649, (float)1.072266, (float)1.224487, + (float)1.021973, (float)1.226196, (float)1.481323, + (float)0.999878, (float)1.204102, (float)1.555908, + (float)0.722290, (float)0.913940, (float)1.340210, + (float)0.673340, (float)0.835938, (float)1.259521, + (float)0.832397, (float)1.208374, (float)1.394165, + (float)0.962158, (float)1.576172, (float)1.912842, + (float)1.166748, (float)1.370850, (float)1.556763, + (float)0.946289, (float)1.138550, (float)1.400391, + (float)1.035034, (float)1.218262, (float)1.386475, + (float)1.393799, (float)1.717773, (float)2.000244, + (float)0.972656, (float)1.260986, (float)1.760620, + (float)1.028198, (float)1.288452, (float)1.484619, + + + + + + (float)0.773560, (float)1.258057, (float)1.756714, + (float)1.080322, (float)1.328003, (float)1.742676, + (float)0.823975, (float)1.450806, (float)1.917725, + (float)0.859009, (float)1.016602, (float)1.191895, + (float)0.843994, (float)1.131104, (float)1.645020, + (float)1.189697, (float)1.702759, (float)1.894409, + (float)1.346680, (float)1.763184, (float)2.066040, + (float)0.980469, (float)1.253784, (float)1.441650, + (float)1.338135, (float)1.641968, (float)1.932739, + (float)1.223267, (float)1.424194, (float)1.626465, + (float)0.765747, (float)1.004150, (float)1.579102, + (float)1.042847, (float)1.269165, (float)1.647461, + (float)0.968750, (float)1.257568, (float)1.555786, + (float)0.826294, (float)0.993408, (float)1.275146, + (float)0.742310, (float)0.950439, (float)1.430542, + (float)1.054321, (float)1.439819, (float)1.828003, + (float)1.072998, (float)1.261719, (float)1.441895, + (float)0.859375, (float)1.036377, (float)1.314819, + (float)0.895752, (float)1.267212, (float)1.605591, + (float)0.805420, (float)0.962891, (float)1.142334, + (float)0.795654, (float)1.005493, (float)1.468506, + (float)1.105347, (float)1.313843, (float)1.584839, + (float)0.792236, (float)1.221802, (float)1.465698, + (float)1.170532, (float)1.467651, (float)1.664063, + (float)0.838257, (float)1.153198, (float)1.342163, + (float)0.968018, (float)1.198242, (float)1.391235, + (float)1.250122, (float)1.623535, (float)1.823608, + (float)0.711670, (float)1.058350, (float)1.512085, + (float)1.204834, (float)1.454468, (float)1.739136, + (float)1.137451, (float)1.421753, (float)1.620117, + (float)0.820435, (float)1.322754, (float)1.578247, + (float)0.798706, (float)1.005005, (float)1.213867, + (float)0.980713, (float)1.324951, (float)1.512939, + (float)1.112305, (float)1.438843, (float)1.735596, + (float)1.135498, (float)1.356689, (float)1.635742, + (float)1.101318, (float)1.387451, (float)1.686523, + (float)0.849854, (float)1.276978, (float)1.523438, + (float)1.377930, (float)1.627563, (float)1.858154, + (float)0.884888, (float)1.095459, (float)1.287476, + (float)1.289795, (float)1.505859, (float)1.756592, + (float)0.817505, (float)1.384155, (float)1.650513, + (float)1.446655, (float)1.702148, (float)1.931885, + (float)0.835815, (float)1.023071, (float)1.385376, + (float)0.916626, (float)1.139038, (float)1.335327, + (float)0.980103, (float)1.174072, (float)1.453735, + (float)1.705688, (float)2.153809, (float)2.398315, (float)2.743408, + (float)1.797119, (float)2.016846, (float)2.445679, (float)2.701904, + (float)1.990356, (float)2.219116, (float)2.576416, (float)2.813477, + + + + + + (float)1.849365, (float)2.190918, (float)2.611572, (float)2.835083, + (float)1.657959, (float)1.854370, (float)2.159058, (float)2.726196, + (float)1.437744, (float)1.897705, (float)2.253174, (float)2.655396, + (float)2.028687, (float)2.247314, (float)2.542358, (float)2.875854, + (float)1.736938, (float)1.922119, (float)2.185913, (float)2.743408, + (float)1.521606, (float)1.870972, (float)2.526855, (float)2.786987, + (float)1.841431, (float)2.050659, (float)2.463623, (float)2.857666, + (float)1.590088, (float)2.067261, (float)2.427979, (float)2.794434, + (float)1.746826, (float)2.057373, (float)2.320190, (float)2.800781, + (float)1.734619, (float)1.940552, (float)2.306030, (float)2.826416, + (float)1.786255, (float)2.204468, (float)2.457520, (float)2.795288, + (float)1.861084, (float)2.170532, (float)2.414551, (float)2.763672, + (float)2.001465, (float)2.307617, (float)2.552734, (float)2.811890, + (float)1.784424, (float)2.124146, (float)2.381592, (float)2.645508, + (float)1.888794, (float)2.135864, (float)2.418579, (float)2.861206, + (float)2.301147, (float)2.531250, (float)2.724976, (float)2.913086, + (float)1.837769, (float)2.051270, (float)2.261963, (float)2.553223, + (float)2.012939, (float)2.221191, (float)2.440186, (float)2.678101, + (float)1.429565, (float)1.858276, (float)2.582275, (float)2.845703, + (float)1.622803, (float)1.897705, (float)2.367310, (float)2.621094, + (float)1.581543, (float)1.960449, (float)2.515869, (float)2.736450, + (float)1.419434, (float)1.933960, (float)2.394653, (float)2.746704, + (float)1.721924, (float)2.059570, (float)2.421753, (float)2.769653, + (float)1.911011, (float)2.220703, (float)2.461060, (float)2.740723, + (float)1.581177, (float)1.860840, (float)2.516968, (float)2.874634, + (float)1.870361, (float)2.098755, (float)2.432373, (float)2.656494, + (float)2.059692, (float)2.279785, (float)2.495605, (float)2.729370, + (float)1.815674, (float)2.181519, (float)2.451538, (float)2.680542, + (float)1.407959, (float)1.768311, (float)2.343018, (float)2.668091, + (float)2.168701, (float)2.394653, (float)2.604736, (float)2.829346, + (float)1.636230, (float)1.865723, (float)2.329102, (float)2.824219, + (float)1.878906, (float)2.139526, (float)2.376709, (float)2.679810, + (float)1.765381, (float)1.971802, (float)2.195435, (float)2.586914, + (float)2.164795, (float)2.410889, (float)2.673706, (float)2.903198, + (float)2.071899, (float)2.331055, (float)2.645874, (float)2.907104, + (float)2.026001, (float)2.311523, (float)2.594849, (float)2.863892, + (float)1.948975, (float)2.180786, (float)2.514893, (float)2.797852, + (float)1.881836, (float)2.130859, (float)2.478149, (float)2.804199, + (float)2.238159, (float)2.452759, (float)2.652832, (float)2.868286, + (float)1.897949, (float)2.101685, (float)2.524292, (float)2.880127, + (float)1.856445, (float)2.074585, (float)2.541016, (float)2.791748, + (float)1.695557, (float)2.199097, (float)2.506226, (float)2.742676, + (float)1.612671, (float)1.877075, (float)2.435425, (float)2.732910, + (float)1.568848, (float)1.786499, (float)2.194580, (float)2.768555, + (float)1.953369, (float)2.164551, (float)2.486938, (float)2.874023, + (float)1.388306, (float)1.725342, (float)2.384521, (float)2.771851, + (float)2.115356, (float)2.337769, (float)2.592896, (float)2.864014, + (float)1.905762, (float)2.111328, (float)2.363525, (float)2.789307, + + + + + + (float)1.882568, (float)2.332031, (float)2.598267, (float)2.827637, + (float)1.683594, (float)2.088745, (float)2.361938, (float)2.608643, + (float)1.874023, (float)2.182129, (float)2.536133, (float)2.766968, + (float)1.861938, (float)2.070435, (float)2.309692, (float)2.700562, + (float)1.722168, (float)2.107422, (float)2.477295, (float)2.837646, + (float)1.926880, (float)2.184692, (float)2.442627, (float)2.663818, + (float)2.123901, (float)2.337280, (float)2.553101, (float)2.777466, + (float)1.588135, (float)1.911499, (float)2.212769, (float)2.543945, + (float)2.053955, (float)2.370850, (float)2.712158, (float)2.939941, + (float)2.210449, (float)2.519653, (float)2.770386, (float)2.958618, + (float)2.199463, (float)2.474731, (float)2.718262, (float)2.919922, + (float)1.960083, (float)2.175415, (float)2.608032, (float)2.888794, + (float)1.953735, (float)2.185181, (float)2.428223, (float)2.809570, + (float)1.615234, (float)2.036499, (float)2.576538, (float)2.834595, + (float)1.621094, (float)2.028198, (float)2.431030, (float)2.664673, + (float)1.824951, (float)2.267456, (float)2.514526, (float)2.747925, + (float)1.994263, (float)2.229126, (float)2.475220, (float)2.833984, + (float)1.746338, (float)2.011353, (float)2.588257, (float)2.826904, + (float)1.562866, (float)2.135986, (float)2.471680, (float)2.687256, + (float)1.748901, (float)2.083496, (float)2.460938, (float)2.686279, + (float)1.758057, (float)2.131470, (float)2.636597, (float)2.891602, + (float)2.071289, (float)2.299072, (float)2.550781, (float)2.814331, + (float)1.839600, (float)2.094360, (float)2.496460, (float)2.723999, + (float)1.882202, (float)2.088257, (float)2.636841, (float)2.923096, + (float)1.957886, (float)2.153198, (float)2.384399, (float)2.615234, + (float)1.992920, (float)2.351196, (float)2.654419, (float)2.889771, + (float)2.012817, (float)2.262451, (float)2.643799, (float)2.903076, + (float)2.025635, (float)2.254761, (float)2.508423, (float)2.784058, + (float)2.316040, (float)2.589355, (float)2.794189, (float)2.963623, + (float)1.741211, (float)2.279541, (float)2.578491, (float)2.816284, + (float)1.845337, (float)2.055786, (float)2.348511, (float)2.822021, + (float)1.679932, (float)1.926514, (float)2.499756, (float)2.835693, + (float)1.722534, (float)1.946899, (float)2.448486, (float)2.728760, + (float)1.829834, (float)2.043213, (float)2.580444, (float)2.867676, + (float)1.676636, (float)2.071655, (float)2.322510, (float)2.704834, + (float)1.791504, (float)2.113525, (float)2.469727, (float)2.784058, + (float)1.977051, (float)2.215088, (float)2.497437, (float)2.726929, + (float)1.800171, (float)2.106689, (float)2.357788, (float)2.738892, + (float)1.827759, (float)2.170166, (float)2.525879, (float)2.852417, + (float)1.918335, (float)2.132813, (float)2.488403, (float)2.728149, + (float)1.916748, (float)2.225098, (float)2.542603, (float)2.857666, + (float)1.761230, (float)1.976074, (float)2.507446, (float)2.884521, + (float)2.053711, (float)2.367432, (float)2.608032, (float)2.837646, + (float)1.595337, (float)2.000977, (float)2.307129, (float)2.578247, + (float)1.470581, (float)2.031250, (float)2.375854, (float)2.647583, + (float)1.801392, (float)2.128052, (float)2.399780, (float)2.822876, + (float)1.853638, (float)2.066650, (float)2.429199, (float)2.751465, + (float)1.956299, (float)2.163696, (float)2.394775, (float)2.734253, + + + + + + (float)1.963623, (float)2.275757, (float)2.585327, (float)2.865234, + (float)1.887451, (float)2.105469, (float)2.331787, (float)2.587402, + (float)2.120117, (float)2.443359, (float)2.733887, (float)2.941406, + (float)1.506348, (float)1.766968, (float)2.400513, (float)2.851807, + (float)1.664551, (float)1.981079, (float)2.375732, (float)2.774414, + (float)1.720703, (float)1.978882, (float)2.391479, (float)2.640991, + (float)1.483398, (float)1.814819, (float)2.434448, (float)2.722290, + (float)1.769043, (float)2.136597, (float)2.563721, (float)2.774414, + (float)1.810791, (float)2.049316, (float)2.373901, (float)2.613647, + (float)1.788330, (float)2.005981, (float)2.359131, (float)2.723145, + (float)1.785156, (float)1.993164, (float)2.399780, (float)2.832520, + (float)1.695313, (float)2.022949, (float)2.522583, (float)2.745117, + (float)1.584106, (float)1.965576, (float)2.299927, (float)2.715576, + (float)1.894897, (float)2.249878, (float)2.655884, (float)2.897705, + (float)1.720581, (float)1.995728, (float)2.299438, (float)2.557007, + (float)1.619385, (float)2.173950, (float)2.574219, (float)2.787964, + (float)1.883179, (float)2.220459, (float)2.474365, (float)2.825073, + (float)1.447632, (float)2.045044, (float)2.555542, (float)2.744873, + (float)1.502686, (float)2.156616, (float)2.653320, (float)2.846558, + (float)1.711548, (float)1.944092, (float)2.282959, (float)2.685791, + (float)1.499756, (float)1.867554, (float)2.341064, (float)2.578857, + (float)1.916870, (float)2.135132, (float)2.568237, (float)2.826050, + (float)1.498047, (float)1.711182, (float)2.223267, (float)2.755127, + (float)1.808716, (float)1.997559, (float)2.256470, (float)2.758545, + (float)2.088501, (float)2.402710, (float)2.667358, (float)2.890259, + (float)1.545044, (float)1.819214, (float)2.324097, (float)2.692993, + (float)1.796021, (float)2.012573, (float)2.505737, (float)2.784912, + (float)1.786499, (float)2.041748, (float)2.290405, (float)2.650757, + (float)1.938232, (float)2.264404, (float)2.529053, (float)2.796143 + }; + diff --git a/sflphone-common/libs/pjproject/third_party/ilbc/constants.h b/sflphone-common/libs/pjproject/third_party/ilbc/constants.h new file mode 100644 index 0000000000000000000000000000000000000000..3487d529dbecc8fd7799e47870e3908550b55fdf --- /dev/null +++ b/sflphone-common/libs/pjproject/third_party/ilbc/constants.h @@ -0,0 +1,80 @@ + + /****************************************************************** + + iLBC Speech Coder ANSI-C Source Code + + constants.h + + Copyright (C) The Internet Society (2004). + All Rights Reserved. + + ******************************************************************/ + + #ifndef __iLBC_CONSTANTS_H + #define __iLBC_CONSTANTS_H + + #include "iLBC_define.h" + + + /* ULP bit allocation */ + + + + + + + extern const iLBC_ULP_Inst_t ULP_20msTbl; + extern const iLBC_ULP_Inst_t ULP_30msTbl; + + /* high pass filters */ + + extern float hpi_zero_coefsTbl[]; + extern float hpi_pole_coefsTbl[]; + extern float hpo_zero_coefsTbl[]; + extern float hpo_pole_coefsTbl[]; + + /* low pass filters */ + extern float lpFilt_coefsTbl[]; + + /* LPC analysis and quantization */ + + extern float lpc_winTbl[]; + extern float lpc_asymwinTbl[]; + extern float lpc_lagwinTbl[]; + extern float lsfCbTbl[]; + extern float lsfmeanTbl[]; + extern int dim_lsfCbTbl[]; + extern int size_lsfCbTbl[]; + extern float lsf_weightTbl_30ms[]; + extern float lsf_weightTbl_20ms[]; + + /* state quantization tables */ + + extern float state_sq3Tbl[]; + extern float state_frgqTbl[]; + + /* gain quantization tables */ + + extern float gain_sq3Tbl[]; + extern float gain_sq4Tbl[]; + extern float gain_sq5Tbl[]; + + /* adaptive codebook definitions */ + + extern int search_rangeTbl[5][CB_NSTAGES]; + extern int memLfTbl[]; + extern int stMemLTbl; + extern float cbfiltersTbl[CB_FILTERLEN]; + + /* enhancer definitions */ + + extern float polyphaserTbl[]; + extern float enh_plocsTbl[]; + + + + + + + #endif + diff --git a/sflphone-common/libs/pjproject/third_party/ilbc/createCB.c b/sflphone-common/libs/pjproject/third_party/ilbc/createCB.c new file mode 100644 index 0000000000000000000000000000000000000000..aefacf200aa83c88e8f55bb9e0a44b053e2047b3 --- /dev/null +++ b/sflphone-common/libs/pjproject/third_party/ilbc/createCB.c @@ -0,0 +1,231 @@ + + + /****************************************************************** + + iLBC Speech Coder ANSI-C Source Code + + createCB.c + + Copyright (C) The Internet Society (2004). + All Rights Reserved. + + ******************************************************************/ + + + + + + #include "iLBC_define.h" + #include "constants.h" + #include <string.h> + #include <math.h> + + /*----------------------------------------------------------------* + * Construct an additional codebook vector by filtering the + * initial codebook buffer. This vector is then used to expand + * the codebook with an additional section. + *---------------------------------------------------------------*/ + + void filteredCBvecs( + float *cbvectors, /* (o) Codebook vectors for the + higher section */ + float *mem, /* (i) Buffer to create codebook + vector from */ + int lMem /* (i) Length of buffer */ + ){ + int j, k; + float *pp, *pp1; + float tempbuff2[CB_MEML+CB_FILTERLEN]; + float *pos; + + memset(tempbuff2, 0, (CB_HALFFILTERLEN-1)*sizeof(float)); + memcpy(&tempbuff2[CB_HALFFILTERLEN-1], mem, lMem*sizeof(float)); + memset(&tempbuff2[lMem+CB_HALFFILTERLEN-1], 0, + (CB_HALFFILTERLEN+1)*sizeof(float)); + + /* Create codebook vector for higher section by filtering */ + + /* do filtering */ + pos=cbvectors; + memset(pos, 0, lMem*sizeof(float)); + for (k=0; k<lMem; k++) { + pp=&tempbuff2[k]; + pp1=&cbfiltersTbl[CB_FILTERLEN-1]; + for (j=0;j<CB_FILTERLEN;j++) { + (*pos)+=(*pp++)*(*pp1--); + } + pos++; + } + } + + /*----------------------------------------------------------------* + * Search the augmented part of the codebook to find the best + * measure. + *----------------------------------------------------------------*/ + + + + + + + void searchAugmentedCB( + int low, /* (i) Start index for the search */ + int high, /* (i) End index for the search */ + int stage, /* (i) Current stage */ + int startIndex, /* (i) Codebook index for the first + aug vector */ + float *target, /* (i) Target vector for encoding */ + float *buffer, /* (i) Pointer to the end of the buffer for + augmented codebook construction */ + float *max_measure, /* (i/o) Currently maximum measure */ + int *best_index,/* (o) Currently the best index */ + float *gain, /* (o) Currently the best gain */ + float *energy, /* (o) Energy of augmented codebook + vectors */ + float *invenergy/* (o) Inv energy of augmented codebook + vectors */ + ) { + int icount, ilow, j, tmpIndex; + float *pp, *ppo, *ppi, *ppe, crossDot, alfa; + float weighted, measure, nrjRecursive; + float ftmp; + + /* Compute the energy for the first (low-5) + noninterpolated samples */ + nrjRecursive = (float) 0.0; + pp = buffer - low + 1; + for (j=0; j<(low-5); j++) { + nrjRecursive += ( (*pp)*(*pp) ); + pp++; + } + ppe = buffer - low; + + + for (icount=low; icount<=high; icount++) { + + /* Index of the codebook vector used for retrieving + energy values */ + tmpIndex = startIndex+icount-20; + + ilow = icount-4; + + /* Update the energy recursively to save complexity */ + nrjRecursive = nrjRecursive + (*ppe)*(*ppe); + ppe--; + energy[tmpIndex] = nrjRecursive; + + /* Compute cross dot product for the first (low-5) + samples */ + + + + + + crossDot = (float) 0.0; + pp = buffer-icount; + for (j=0; j<ilow; j++) { + crossDot += target[j]*(*pp++); + } + + /* interpolation */ + alfa = (float) 0.2; + ppo = buffer-4; + ppi = buffer-icount-4; + for (j=ilow; j<icount; j++) { + weighted = ((float)1.0-alfa)*(*ppo)+alfa*(*ppi); + ppo++; + ppi++; + energy[tmpIndex] += weighted*weighted; + crossDot += target[j]*weighted; + alfa += (float)0.2; + } + + /* Compute energy and cross dot product for the + remaining samples */ + pp = buffer - icount; + for (j=icount; j<SUBL; j++) { + energy[tmpIndex] += (*pp)*(*pp); + crossDot += target[j]*(*pp++); + } + + if (energy[tmpIndex]>0.0) { + invenergy[tmpIndex]=(float)1.0/(energy[tmpIndex]+EPS); + } else { + invenergy[tmpIndex] = (float) 0.0; + } + + if (stage==0) { + measure = (float)-10000000.0; + + if (crossDot > 0.0) { + measure = crossDot*crossDot*invenergy[tmpIndex]; + } + } + else { + measure = crossDot*crossDot*invenergy[tmpIndex]; + } + + /* check if measure is better */ + ftmp = crossDot*invenergy[tmpIndex]; + + if ((measure>*max_measure) && (fabs(ftmp)<CB_MAXGAIN)) { + + + + + + *best_index = tmpIndex; + *max_measure = measure; + *gain = ftmp; + } + } + } + + + /*----------------------------------------------------------------* + * Recreate a specific codebook vector from the augmented part. + * + *----------------------------------------------------------------*/ + + void createAugmentedVec( + int index, /* (i) Index for the augmented vector + to be created */ + float *buffer, /* (i) Pointer to the end of the buffer for + augmented codebook construction */ + float *cbVec/* (o) The construced codebook vector */ + ) { + int ilow, j; + float *pp, *ppo, *ppi, alfa, alfa1, weighted; + + ilow = index-5; + + /* copy the first noninterpolated part */ + + pp = buffer-index; + memcpy(cbVec,pp,sizeof(float)*index); + + /* interpolation */ + + alfa1 = (float)0.2; + alfa = 0.0; + ppo = buffer-5; + ppi = buffer-index-5; + for (j=ilow; j<index; j++) { + weighted = ((float)1.0-alfa)*(*ppo)+alfa*(*ppi); + ppo++; + ppi++; + cbVec[j] = weighted; + alfa += alfa1; + } + + /* copy the second noninterpolated part */ + + pp = buffer - index; + memcpy(cbVec+index,pp,sizeof(float)*(SUBL-index)); + + + + + + } + diff --git a/sflphone-common/libs/pjproject/third_party/ilbc/createCB.h b/sflphone-common/libs/pjproject/third_party/ilbc/createCB.h new file mode 100644 index 0000000000000000000000000000000000000000..eda547c6692451e297ad38421e4040d716d2acb1 --- /dev/null +++ b/sflphone-common/libs/pjproject/third_party/ilbc/createCB.h @@ -0,0 +1,58 @@ + + /****************************************************************** + + iLBC Speech Coder ANSI-C Source Code + + createCB.h + + Copyright (C) The Internet Society (2004). + All Rights Reserved. + + ******************************************************************/ + + #ifndef __iLBC_CREATECB_H + #define __iLBC_CREATECB_H + + void filteredCBvecs( + float *cbvectors, /* (o) Codebook vector for the + higher section */ + + + + + + float *mem, /* (i) Buffer to create codebook + vectors from */ + int lMem /* (i) Length of buffer */ + ); + + void searchAugmentedCB( + int low, /* (i) Start index for the search */ + int high, /* (i) End index for the search */ + int stage, /* (i) Current stage */ + int startIndex, /* (i) CB index for the first + augmented vector */ + float *target, /* (i) Target vector for encoding */ + float *buffer, /* (i) Pointer to the end of the + buffer for augmented codebook + construction */ + float *max_measure, /* (i/o) Currently maximum measure */ + int *best_index,/* (o) Currently the best index */ + float *gain, /* (o) Currently the best gain */ + float *energy, /* (o) Energy of augmented + codebook vectors */ + float *invenergy/* (o) Inv energy of aug codebook + vectors */ + ); + + void createAugmentedVec( + int index, /* (i) Index for the aug vector + to be created */ + float *buffer, /* (i) Pointer to the end of the + buffer for augmented codebook + construction */ + float *cbVec /* (o) The construced codebook vector */ + ); + + #endif + diff --git a/sflphone-common/libs/pjproject/third_party/ilbc/doCPLC.c b/sflphone-common/libs/pjproject/third_party/ilbc/doCPLC.c new file mode 100644 index 0000000000000000000000000000000000000000..9fa4584fe8dee53efca3d398a936c573a9d10070 --- /dev/null +++ b/sflphone-common/libs/pjproject/third_party/ilbc/doCPLC.c @@ -0,0 +1,270 @@ + + /****************************************************************** + + iLBC Speech Coder ANSI-C Source Code + + doCPLC.c + + Copyright (C) The Internet Society (2004). + All Rights Reserved. + + ******************************************************************/ + + #include <math.h> + #include <string.h> + #include <stdio.h> + + + + + + #include "iLBC_define.h" + + /*----------------------------------------------------------------* + * Compute cross correlation and pitch gain for pitch prediction + * of last subframe at given lag. + *---------------------------------------------------------------*/ + + void compCorr( + float *cc, /* (o) cross correlation coefficient */ + float *gc, /* (o) gain */ + float *pm, + float *buffer, /* (i) signal buffer */ + int lag, /* (i) pitch lag */ + int bLen, /* (i) length of buffer */ + int sRange /* (i) correlation search length */ + ){ + int i; + float ftmp1, ftmp2, ftmp3; + + /* Guard against getting outside buffer */ + if ((bLen-sRange-lag)<0) { + sRange=bLen-lag; + } + + ftmp1 = 0.0; + ftmp2 = 0.0; + ftmp3 = 0.0; + for (i=0; i<sRange; i++) { + ftmp1 += buffer[bLen-sRange+i] * + buffer[bLen-sRange+i-lag]; + ftmp2 += buffer[bLen-sRange+i-lag] * + buffer[bLen-sRange+i-lag]; + ftmp3 += buffer[bLen-sRange+i] * + buffer[bLen-sRange+i]; + } + + if (ftmp2 > 0.0) { + *cc = ftmp1*ftmp1/ftmp2; + *gc = (float)fabs(ftmp1/ftmp2); + *pm=(float)fabs(ftmp1)/ + ((float)sqrt(ftmp2)*(float)sqrt(ftmp3)); + } + else { + *cc = 0.0; + *gc = 0.0; + *pm=0.0; + } + } + + + + + + /*----------------------------------------------------------------* + * Packet loss concealment routine. Conceals a residual signal + * and LP parameters. If no packet loss, update state. + *---------------------------------------------------------------*/ + + void doThePLC( + float *PLCresidual, /* (o) concealed residual */ + float *PLClpc, /* (o) concealed LP parameters */ + int PLI, /* (i) packet loss indicator + 0 - no PL, 1 = PL */ + float *decresidual, /* (i) decoded residual */ + float *lpc, /* (i) decoded LPC (only used for no PL) */ + int inlag, /* (i) pitch lag */ + iLBC_Dec_Inst_t *iLBCdec_inst + /* (i/o) decoder instance */ + ){ + int lag=20, randlag; + float gain, maxcc; + float use_gain; + float gain_comp, maxcc_comp, per, max_per=0; + int i, pick, use_lag; + float ftmp, randvec[BLOCKL_MAX], pitchfact, energy; + + /* Packet Loss */ + + if (PLI == 1) { + + iLBCdec_inst->consPLICount += 1; + + /* if previous frame not lost, + determine pitch pred. gain */ + + if (iLBCdec_inst->prevPLI != 1) { + + /* Search around the previous lag to find the + best pitch period */ + + lag=inlag-3; + compCorr(&maxcc, &gain, &max_per, + iLBCdec_inst->prevResidual, + lag, iLBCdec_inst->blockl, 60); + for (i=inlag-2;i<=inlag+3;i++) { + compCorr(&maxcc_comp, &gain_comp, &per, + iLBCdec_inst->prevResidual, + i, iLBCdec_inst->blockl, 60); + + if (maxcc_comp>maxcc) { + maxcc=maxcc_comp; + + + + + + gain=gain_comp; + lag=i; + max_per=per; + } + } + + } + + /* previous frame lost, use recorded lag and periodicity */ + + else { + lag=iLBCdec_inst->prevLag; + max_per=iLBCdec_inst->per; + } + + /* downscaling */ + + use_gain=1.0; + if (iLBCdec_inst->consPLICount*iLBCdec_inst->blockl>320) + use_gain=(float)0.9; + else if (iLBCdec_inst->consPLICount* + iLBCdec_inst->blockl>2*320) + use_gain=(float)0.7; + else if (iLBCdec_inst->consPLICount* + iLBCdec_inst->blockl>3*320) + use_gain=(float)0.5; + else if (iLBCdec_inst->consPLICount* + iLBCdec_inst->blockl>4*320) + use_gain=(float)0.0; + + /* mix noise and pitch repeatition */ + ftmp=(float)sqrt(max_per); + if (ftmp>(float)0.7) + pitchfact=(float)1.0; + else if (ftmp>(float)0.4) + pitchfact=(ftmp-(float)0.4)/((float)0.7-(float)0.4); + else + pitchfact=0.0; + + + /* avoid repetition of same pitch cycle */ + use_lag=lag; + if (lag<80) { + use_lag=2*lag; + } + + /* compute concealed residual */ + + + + + + + energy = 0.0; + for (i=0; i<iLBCdec_inst->blockl; i++) { + + /* noise component */ + + iLBCdec_inst->seed=(iLBCdec_inst->seed*69069L+1) & + (0x80000000L-1); + randlag = 50 + ((signed long) iLBCdec_inst->seed)%70; + pick = i - randlag; + + if (pick < 0) { + randvec[i] = + iLBCdec_inst->prevResidual[ + iLBCdec_inst->blockl+pick]; + } else { + randvec[i] = randvec[pick]; + } + + /* pitch repeatition component */ + pick = i - use_lag; + + if (pick < 0) { + PLCresidual[i] = + iLBCdec_inst->prevResidual[ + iLBCdec_inst->blockl+pick]; + } else { + PLCresidual[i] = PLCresidual[pick]; + } + + /* mix random and periodicity component */ + + if (i<80) + PLCresidual[i] = use_gain*(pitchfact * + PLCresidual[i] + + ((float)1.0 - pitchfact) * randvec[i]); + else if (i<160) + PLCresidual[i] = (float)0.95*use_gain*(pitchfact * + PLCresidual[i] + + ((float)1.0 - pitchfact) * randvec[i]); + else + PLCresidual[i] = (float)0.9*use_gain*(pitchfact * + PLCresidual[i] + + ((float)1.0 - pitchfact) * randvec[i]); + + energy += PLCresidual[i] * PLCresidual[i]; + } + + /* less than 30 dB, use only noise */ + + + + + + + if (sqrt(energy/(float)iLBCdec_inst->blockl) < 30.0) { + gain=0.0; + for (i=0; i<iLBCdec_inst->blockl; i++) { + PLCresidual[i] = randvec[i]; + } + } + + /* use old LPC */ + + memcpy(PLClpc,iLBCdec_inst->prevLpc, + (LPC_FILTERORDER+1)*sizeof(float)); + + } + + /* no packet loss, copy input */ + + else { + memcpy(PLCresidual, decresidual, + iLBCdec_inst->blockl*sizeof(float)); + memcpy(PLClpc, lpc, (LPC_FILTERORDER+1)*sizeof(float)); + iLBCdec_inst->consPLICount = 0; + } + + /* update state */ + + if (PLI) { + iLBCdec_inst->prevLag = lag; + iLBCdec_inst->per=max_per; + } + + iLBCdec_inst->prevPLI = PLI; + memcpy(iLBCdec_inst->prevLpc, PLClpc, + (LPC_FILTERORDER+1)*sizeof(float)); + memcpy(iLBCdec_inst->prevResidual, PLCresidual, + iLBCdec_inst->blockl*sizeof(float)); + } + diff --git a/sflphone-common/libs/pjproject/third_party/ilbc/doCPLC.h b/sflphone-common/libs/pjproject/third_party/ilbc/doCPLC.h new file mode 100644 index 0000000000000000000000000000000000000000..2bda7a144108248dd1de2e37fb59bf94ef55817d --- /dev/null +++ b/sflphone-common/libs/pjproject/third_party/ilbc/doCPLC.h @@ -0,0 +1,29 @@ + + /****************************************************************** + + iLBC Speech Coder ANSI-C Source Code + + doCPLC.h + + Copyright (C) The Internet Society (2004). + All Rights Reserved. + + ******************************************************************/ + + #ifndef __iLBC_DOLPC_H + #define __iLBC_DOLPC_H + + void doThePLC( + float *PLCresidual, /* (o) concealed residual */ + float *PLClpc, /* (o) concealed LP parameters */ + int PLI, /* (i) packet loss indicator + 0 - no PL, 1 = PL */ + float *decresidual, /* (i) decoded residual */ + float *lpc, /* (i) decoded LPC (only used for no PL) */ + int inlag, /* (i) pitch lag */ + iLBC_Dec_Inst_t *iLBCdec_inst + /* (i/o) decoder instance */ + ); + + #endif + diff --git a/sflphone-common/libs/pjproject/third_party/ilbc/enhancer.c b/sflphone-common/libs/pjproject/third_party/ilbc/enhancer.c new file mode 100644 index 0000000000000000000000000000000000000000..dee13b03d5b1007292d8cfa9275d3617301f4718 --- /dev/null +++ b/sflphone-common/libs/pjproject/third_party/ilbc/enhancer.c @@ -0,0 +1,701 @@ + + /****************************************************************** + + iLBC Speech Coder ANSI-C Source Code + + enhancer.c + + Copyright (C) The Internet Society (2004). + All Rights Reserved. + + ******************************************************************/ + + #include <math.h> + #include <string.h> + #include "iLBC_define.h" + #include "constants.h" + #include "filter.h" + + /*----------------------------------------------------------------* + * Find index in array such that the array element with said + * index is the element of said array closest to "value" + * according to the squared-error criterion + *---------------------------------------------------------------*/ + + void NearestNeighbor( + + + + + + int *index, /* (o) index of array element closest + to value */ + float *array, /* (i) data array */ + float value,/* (i) value */ + int arlength/* (i) dimension of data array */ + ){ + int i; + float bestcrit,crit; + + crit=array[0]-value; + bestcrit=crit*crit; + *index=0; + for (i=1; i<arlength; i++) { + crit=array[i]-value; + crit=crit*crit; + + if (crit<bestcrit) { + bestcrit=crit; + *index=i; + } + } + } + + /*----------------------------------------------------------------* + * compute cross correlation between sequences + *---------------------------------------------------------------*/ + + void mycorr1( + float* corr, /* (o) correlation of seq1 and seq2 */ + float* seq1, /* (i) first sequence */ + int dim1, /* (i) dimension first seq1 */ + const float *seq2, /* (i) second sequence */ + int dim2 /* (i) dimension seq2 */ + ){ + int i,j; + + for (i=0; i<=dim1-dim2; i++) { + corr[i]=0.0; + for (j=0; j<dim2; j++) { + corr[i] += seq1[i+j] * seq2[j]; + } + } + } + + /*----------------------------------------------------------------* + * upsample finite array assuming zeros outside bounds + *---------------------------------------------------------------*/ + + + + + + + void enh_upsample( + float* useq1, /* (o) upsampled output sequence */ + float* seq1,/* (i) unupsampled sequence */ + int dim1, /* (i) dimension seq1 */ + int hfl /* (i) polyphase filter length=2*hfl+1 */ + ){ + float *pu,*ps; + int i,j,k,q,filterlength,hfl2; + const float *polyp[ENH_UPS0]; /* pointers to + polyphase columns */ + const float *pp; + + /* define pointers for filter */ + + filterlength=2*hfl+1; + + if ( filterlength > dim1 ) { + hfl2=(int) (dim1/2); + for (j=0; j<ENH_UPS0; j++) { + polyp[j]=polyphaserTbl+j*filterlength+hfl-hfl2; + } + hfl=hfl2; + filterlength=2*hfl+1; + } + else { + for (j=0; j<ENH_UPS0; j++) { + polyp[j]=polyphaserTbl+j*filterlength; + } + } + + /* filtering: filter overhangs left side of sequence */ + + pu=useq1; + for (i=hfl; i<filterlength; i++) { + for (j=0; j<ENH_UPS0; j++) { + *pu=0.0; + pp = polyp[j]; + ps = seq1+i; + for (k=0; k<=i; k++) { + *pu += *ps-- * *pp++; + } + pu++; + } + } + + /* filtering: simple convolution=inner products */ + + for (i=filterlength; i<dim1; i++) { + + + + + + for (j=0;j<ENH_UPS0; j++){ + *pu=0.0; + pp = polyp[j]; + ps = seq1+i; + for (k=0; k<filterlength; k++) { + *pu += *ps-- * *pp++; + } + pu++; + } + } + + /* filtering: filter overhangs right side of sequence */ + + for (q=1; q<=hfl; q++) { + for (j=0; j<ENH_UPS0; j++) { + *pu=0.0; + pp = polyp[j]+q; + ps = seq1+dim1-1; + for (k=0; k<filterlength-q; k++) { + *pu += *ps-- * *pp++; + } + pu++; + } + } + } + + + /*----------------------------------------------------------------* + * find segment starting near idata+estSegPos that has highest + * correlation with idata+centerStartPos through + * idata+centerStartPos+ENH_BLOCKL-1 segment is found at a + * resolution of ENH_UPSO times the original of the original + * sampling rate + *---------------------------------------------------------------*/ + + void refiner( + float *seg, /* (o) segment array */ + float *updStartPos, /* (o) updated start point */ + float* idata, /* (i) original data buffer */ + int idatal, /* (i) dimension of idata */ + int centerStartPos, /* (i) beginning center segment */ + float estSegPos,/* (i) estimated beginning other segment */ + float period /* (i) estimated pitch period */ + ){ + int estSegPosRounded,searchSegStartPos,searchSegEndPos,corrdim; + int tloc,tloc2,i,st,en,fraction; + float vect[ENH_VECTL],corrVec[ENH_CORRDIM],maxv; + float corrVecUps[ENH_CORRDIM*ENH_UPS0]; + + (void)period; + + + + /* defining array bounds */ + + estSegPosRounded=(int)(estSegPos - 0.5); + + searchSegStartPos=estSegPosRounded-ENH_SLOP; + + if (searchSegStartPos<0) { + searchSegStartPos=0; + } + searchSegEndPos=estSegPosRounded+ENH_SLOP; + + if (searchSegEndPos+ENH_BLOCKL >= idatal) { + searchSegEndPos=idatal-ENH_BLOCKL-1; + } + corrdim=searchSegEndPos-searchSegStartPos+1; + + /* compute upsampled correlation (corr33) and find + location of max */ + + mycorr1(corrVec,idata+searchSegStartPos, + corrdim+ENH_BLOCKL-1,idata+centerStartPos,ENH_BLOCKL); + enh_upsample(corrVecUps,corrVec,corrdim,ENH_FL0); + tloc=0; maxv=corrVecUps[0]; + for (i=1; i<ENH_UPS0*corrdim; i++) { + + if (corrVecUps[i]>maxv) { + tloc=i; + maxv=corrVecUps[i]; + } + } + + /* make vector can be upsampled without ever running outside + bounds */ + + *updStartPos= (float)searchSegStartPos + + (float)tloc/(float)ENH_UPS0+(float)1.0; + tloc2=(int)(tloc/ENH_UPS0); + + if (tloc>tloc2*ENH_UPS0) { + tloc2++; + } + st=searchSegStartPos+tloc2-ENH_FL0; + + if (st<0) { + memset(vect,0,-st*sizeof(float)); + memcpy(&vect[-st],idata, (ENH_VECTL+st)*sizeof(float)); + } + else { + + + + + + en=st+ENH_VECTL; + + if (en>idatal) { + memcpy(vect, &idata[st], + (ENH_VECTL-(en-idatal))*sizeof(float)); + memset(&vect[ENH_VECTL-(en-idatal)], 0, + (en-idatal)*sizeof(float)); + } + else { + memcpy(vect, &idata[st], ENH_VECTL*sizeof(float)); + } + } + fraction=tloc2*ENH_UPS0-tloc; + + /* compute the segment (this is actually a convolution) */ + + mycorr1(seg,vect,ENH_VECTL,polyphaserTbl+(2*ENH_FL0+1)*fraction, + 2*ENH_FL0+1); + } + + /*----------------------------------------------------------------* + * find the smoothed output data + *---------------------------------------------------------------*/ + + void smath( + float *odata, /* (o) smoothed output */ + float *sseq,/* (i) said second sequence of waveforms */ + int hl, /* (i) 2*hl+1 is sseq dimension */ + float alpha0/* (i) max smoothing energy fraction */ + ){ + int i,k; + float w00,w10,w11,A,B,C,*psseq,err,errs; + float surround[BLOCKL_MAX]; /* shape contributed by other than + current */ + float wt[2*ENH_HL+1]; /* waveform weighting to get + surround shape */ + float denom; + + /* create shape of contribution from all waveforms except the + current one */ + + for (i=1; i<=2*hl+1; i++) { + wt[i-1] = (float)0.5*(1 - (float)cos(2*PI*i/(2*hl+2))); + } + wt[hl]=0.0; /* for clarity, not used */ + for (i=0; i<ENH_BLOCKL; i++) { + surround[i]=sseq[i]*wt[0]; + } + + + + + + for (k=1; k<hl; k++) { + psseq=sseq+k*ENH_BLOCKL; + for(i=0;i<ENH_BLOCKL; i++) { + surround[i]+=psseq[i]*wt[k]; + } + } + for (k=hl+1; k<=2*hl; k++) { + psseq=sseq+k*ENH_BLOCKL; + for(i=0;i<ENH_BLOCKL; i++) { + surround[i]+=psseq[i]*wt[k]; + } + } + + /* compute some inner products */ + + w00 = w10 = w11 = 0.0; + psseq=sseq+hl*ENH_BLOCKL; /* current block */ + for (i=0; i<ENH_BLOCKL;i++) { + w00+=psseq[i]*psseq[i]; + w11+=surround[i]*surround[i]; + w10+=surround[i]*psseq[i]; + } + + if (fabs(w11) < 1.0) { + w11=1.0; + } + C = (float)sqrt( w00/w11); + + /* first try enhancement without power-constraint */ + + errs=0.0; + psseq=sseq+hl*ENH_BLOCKL; + for (i=0; i<ENH_BLOCKL; i++) { + odata[i]=C*surround[i]; + err=psseq[i]-odata[i]; + errs+=err*err; + } + + /* if constraint violated by first try, add constraint */ + + if (errs > alpha0 * w00) { + if ( w00 < 1) { + w00=1; + } + denom = (w11*w00-w10*w10)/(w00*w00); + + if (denom > 0.0001) { /* eliminates numerical problems + for if smooth */ + + + + + + A = (float)sqrt( (alpha0- alpha0*alpha0/4)/denom); + B = -alpha0/2 - A * w10/w00; + B = B+1; + } + else { /* essentially no difference between cycles; + smoothing not needed */ + A= 0.0; + B= 1.0; + } + + /* create smoothed sequence */ + + psseq=sseq+hl*ENH_BLOCKL; + for (i=0; i<ENH_BLOCKL; i++) { + odata[i]=A*surround[i]+B*psseq[i]; + } + } + } + + /*----------------------------------------------------------------* + * get the pitch-synchronous sample sequence + *---------------------------------------------------------------*/ + + void getsseq( + float *sseq, /* (o) the pitch-synchronous sequence */ + float *idata, /* (i) original data */ + int idatal, /* (i) dimension of data */ + int centerStartPos, /* (i) where current block starts */ + float *period, /* (i) rough-pitch-period array */ + float *plocs, /* (i) where periods of period array + are taken */ + int periodl, /* (i) dimension period array */ + int hl /* (i) 2*hl+1 is the number of sequences */ + ){ + int i,centerEndPos,q; + float blockStartPos[2*ENH_HL+1]; + int lagBlock[2*ENH_HL+1]; + float plocs2[ENH_PLOCSL]; + float *psseq; + + centerEndPos=centerStartPos+ENH_BLOCKL-1; + + /* present */ + + NearestNeighbor(lagBlock+hl,plocs, + (float)0.5*(centerStartPos+centerEndPos),periodl); + + blockStartPos[hl]=(float)centerStartPos; + + + + + + psseq=sseq+ENH_BLOCKL*hl; + memcpy(psseq, idata+centerStartPos, ENH_BLOCKL*sizeof(float)); + + /* past */ + + for (q=hl-1; q>=0; q--) { + blockStartPos[q]=blockStartPos[q+1]-period[lagBlock[q+1]]; + NearestNeighbor(lagBlock+q,plocs, + blockStartPos[q]+ + ENH_BLOCKL_HALF-period[lagBlock[q+1]], periodl); + + + if (blockStartPos[q]-ENH_OVERHANG>=0) { + refiner(sseq+q*ENH_BLOCKL, blockStartPos+q, idata, + idatal, centerStartPos, blockStartPos[q], + period[lagBlock[q+1]]); + } else { + psseq=sseq+q*ENH_BLOCKL; + memset(psseq, 0, ENH_BLOCKL*sizeof(float)); + } + } + + /* future */ + + for (i=0; i<periodl; i++) { + plocs2[i]=plocs[i]-period[i]; + } + for (q=hl+1; q<=2*hl; q++) { + NearestNeighbor(lagBlock+q,plocs2, + blockStartPos[q-1]+ENH_BLOCKL_HALF,periodl); + + blockStartPos[q]=blockStartPos[q-1]+period[lagBlock[q]]; + if (blockStartPos[q]+ENH_BLOCKL+ENH_OVERHANG<idatal) { + refiner(sseq+ENH_BLOCKL*q, blockStartPos+q, idata, + idatal, centerStartPos, blockStartPos[q], + period[lagBlock[q]]); + } + else { + psseq=sseq+q*ENH_BLOCKL; + memset(psseq, 0, ENH_BLOCKL*sizeof(float)); + } + } + } + + /*----------------------------------------------------------------* + * perform enhancement on idata+centerStartPos through + * idata+centerStartPos+ENH_BLOCKL-1 + *---------------------------------------------------------------*/ + + + + + + void enhancer( + float *odata, /* (o) smoothed block, dimension blockl */ + float *idata, /* (i) data buffer used for enhancing */ + int idatal, /* (i) dimension idata */ + int centerStartPos, /* (i) first sample current block + within idata */ + float alpha0, /* (i) max correction-energy-fraction + (in [0,1]) */ + float *period, /* (i) pitch period array */ + float *plocs, /* (i) locations where period array + values valid */ + int periodl /* (i) dimension of period and plocs */ + ){ + float sseq[(2*ENH_HL+1)*ENH_BLOCKL]; + + /* get said second sequence of segments */ + + getsseq(sseq,idata,idatal,centerStartPos,period, + plocs,periodl,ENH_HL); + + /* compute the smoothed output from said second sequence */ + + smath(odata,sseq,ENH_HL,alpha0); + + } + + /*----------------------------------------------------------------* + * cross correlation + *---------------------------------------------------------------*/ + + float xCorrCoef( + float *target, /* (i) first array */ + float *regressor, /* (i) second array */ + int subl /* (i) dimension arrays */ + ){ + int i; + float ftmp1, ftmp2; + + ftmp1 = 0.0; + ftmp2 = 0.0; + for (i=0; i<subl; i++) { + ftmp1 += target[i]*regressor[i]; + ftmp2 += regressor[i]*regressor[i]; + } + + if (ftmp1 > 0.0) { + return (float)(ftmp1*ftmp1/ftmp2); + } + + + + + + else { + return (float)0.0; + } + } + + /*----------------------------------------------------------------* + * interface for enhancer + *---------------------------------------------------------------*/ + + int enhancerInterface( + float *out, /* (o) enhanced signal */ + float *in, /* (i) unenhanced signal */ + iLBC_Dec_Inst_t *iLBCdec_inst /* (i) buffers etc */ + ){ + float *enh_buf, *enh_period; + int iblock, isample; + int lag=0, ilag, i, ioffset; + float cc, maxcc; + float ftmp1, ftmp2; + float *inPtr, *enh_bufPtr1, *enh_bufPtr2; + float plc_pred[ENH_BLOCKL]; + + float lpState[6], downsampled[(ENH_NBLOCKS*ENH_BLOCKL+120)/2]; + int inLen=ENH_NBLOCKS*ENH_BLOCKL+120; + int start, plc_blockl, inlag; + + enh_buf=iLBCdec_inst->enh_buf; + enh_period=iLBCdec_inst->enh_period; + + memmove(enh_buf, &enh_buf[iLBCdec_inst->blockl], + (ENH_BUFL-iLBCdec_inst->blockl)*sizeof(float)); + + memcpy(&enh_buf[ENH_BUFL-iLBCdec_inst->blockl], in, + iLBCdec_inst->blockl*sizeof(float)); + + if (iLBCdec_inst->mode==30) + plc_blockl=ENH_BLOCKL; + else + plc_blockl=40; + + /* when 20 ms frame, move processing one block */ + ioffset=0; + if (iLBCdec_inst->mode==20) ioffset=1; + + i=3-ioffset; + memmove(enh_period, &enh_period[i], + (ENH_NBLOCKS_TOT-i)*sizeof(float)); + + + + + + + /* Set state information to the 6 samples right before + the samples to be downsampled. */ + + memcpy(lpState, + enh_buf+(ENH_NBLOCKS_EXTRA+ioffset)*ENH_BLOCKL-126, + 6*sizeof(float)); + + /* Down sample a factor 2 to save computations */ + + DownSample(enh_buf+(ENH_NBLOCKS_EXTRA+ioffset)*ENH_BLOCKL-120, + lpFilt_coefsTbl, inLen-ioffset*ENH_BLOCKL, + lpState, downsampled); + + /* Estimate the pitch in the down sampled domain. */ + for (iblock = 0; iblock<ENH_NBLOCKS-ioffset; iblock++) { + + lag = 10; + maxcc = xCorrCoef(downsampled+60+iblock* + ENH_BLOCKL_HALF, downsampled+60+iblock* + ENH_BLOCKL_HALF-lag, ENH_BLOCKL_HALF); + for (ilag=11; ilag<60; ilag++) { + cc = xCorrCoef(downsampled+60+iblock* + ENH_BLOCKL_HALF, downsampled+60+iblock* + ENH_BLOCKL_HALF-ilag, ENH_BLOCKL_HALF); + + if (cc > maxcc) { + maxcc = cc; + lag = ilag; + } + } + + /* Store the estimated lag in the non-downsampled domain */ + enh_period[iblock+ENH_NBLOCKS_EXTRA+ioffset] = (float)lag*2; + + + } + + + /* PLC was performed on the previous packet */ + if (iLBCdec_inst->prev_enh_pl==1) { + + inlag=(int)enh_period[ENH_NBLOCKS_EXTRA+ioffset]; + + lag = inlag-1; + maxcc = xCorrCoef(in, in+lag, plc_blockl); + for (ilag=inlag; ilag<=inlag+1; ilag++) { + cc = xCorrCoef(in, in+ilag, plc_blockl); + + + + + + + if (cc > maxcc) { + maxcc = cc; + lag = ilag; + } + } + + enh_period[ENH_NBLOCKS_EXTRA+ioffset-1]=(float)lag; + + /* compute new concealed residual for the old lookahead, + mix the forward PLC with a backward PLC from + the new frame */ + + inPtr=&in[lag-1]; + + enh_bufPtr1=&plc_pred[plc_blockl-1]; + + if (lag>plc_blockl) { + start=plc_blockl; + } else { + start=lag; + } + + for (isample = start; isample>0; isample--) { + *enh_bufPtr1-- = *inPtr--; + } + + enh_bufPtr2=&enh_buf[ENH_BUFL-1-iLBCdec_inst->blockl]; + for (isample = (plc_blockl-1-lag); isample>=0; isample--) { + *enh_bufPtr1-- = *enh_bufPtr2--; + } + + /* limit energy change */ + ftmp2=0.0; + ftmp1=0.0; + for (i=0;i<plc_blockl;i++) { + ftmp2+=enh_buf[ENH_BUFL-1-iLBCdec_inst->blockl-i]* + enh_buf[ENH_BUFL-1-iLBCdec_inst->blockl-i]; + ftmp1+=plc_pred[i]*plc_pred[i]; + } + ftmp1=(float)sqrt(ftmp1/(float)plc_blockl); + ftmp2=(float)sqrt(ftmp2/(float)plc_blockl); + if (ftmp1>(float)2.0*ftmp2 && ftmp1>0.0) { + for (i=0;i<plc_blockl-10;i++) { + plc_pred[i]*=(float)2.0*ftmp2/ftmp1; + } + for (i=plc_blockl-10;i<plc_blockl;i++) { + plc_pred[i]*=(float)(i-plc_blockl+10)* + ((float)1.0-(float)2.0*ftmp2/ftmp1)/(float)(10)+ + + + + + + (float)2.0*ftmp2/ftmp1; + } + } + + enh_bufPtr1=&enh_buf[ENH_BUFL-1-iLBCdec_inst->blockl]; + for (i=0; i<plc_blockl; i++) { + ftmp1 = (float) (i+1) / (float) (plc_blockl+1); + *enh_bufPtr1 *= ftmp1; + *enh_bufPtr1 += ((float)1.0-ftmp1)* + plc_pred[plc_blockl-1-i]; + enh_bufPtr1--; + } + } + + if (iLBCdec_inst->mode==20) { + /* Enhancer with 40 samples delay */ + for (iblock = 0; iblock<2; iblock++) { + enhancer(out+iblock*ENH_BLOCKL, enh_buf, + ENH_BUFL, (5+iblock)*ENH_BLOCKL+40, + ENH_ALPHA0, enh_period, enh_plocsTbl, + ENH_NBLOCKS_TOT); + } + } else if (iLBCdec_inst->mode==30) { + /* Enhancer with 80 samples delay */ + for (iblock = 0; iblock<3; iblock++) { + enhancer(out+iblock*ENH_BLOCKL, enh_buf, + ENH_BUFL, (4+iblock)*ENH_BLOCKL, + ENH_ALPHA0, enh_period, enh_plocsTbl, + ENH_NBLOCKS_TOT); + } + } + + return (lag*2); + } + diff --git a/sflphone-common/libs/pjproject/third_party/ilbc/enhancer.h b/sflphone-common/libs/pjproject/third_party/ilbc/enhancer.h new file mode 100644 index 0000000000000000000000000000000000000000..8a081fb1bc21934a883a34398a531a7a37cc3caa --- /dev/null +++ b/sflphone-common/libs/pjproject/third_party/ilbc/enhancer.h @@ -0,0 +1,36 @@ + + /****************************************************************** + + iLBC Speech Coder ANSI-C Source Code + + enhancer.h + + Copyright (C) The Internet Society (2004). + All Rights Reserved. + + + + + + ******************************************************************/ + + #ifndef __ENHANCER_H + #define __ENHANCER_H + + #include "iLBC_define.h" + + float xCorrCoef( + float *target, /* (i) first array */ + float *regressor, /* (i) second array */ + int subl /* (i) dimension arrays */ + ); + + int enhancerInterface( + float *out, /* (o) the enhanced recidual signal */ + float *in, /* (i) the recidual signal to enhance */ + iLBC_Dec_Inst_t *iLBCdec_inst + /* (i/o) the decoder state structure */ + ); + + #endif + diff --git a/sflphone-common/libs/pjproject/third_party/ilbc/filter.c b/sflphone-common/libs/pjproject/third_party/ilbc/filter.c new file mode 100644 index 0000000000000000000000000000000000000000..6565c2beee0ccfac27f6cdf92a81272982b9dffb --- /dev/null +++ b/sflphone-common/libs/pjproject/third_party/ilbc/filter.c @@ -0,0 +1,175 @@ + + /****************************************************************** + + iLBC Speech Coder ANSI-C Source Code + + filter.c + + Copyright (C) The Internet Society (2004). + All Rights Reserved. + + ******************************************************************/ + + #include "iLBC_define.h" + + /*----------------------------------------------------------------* + * all-pole filter + *---------------------------------------------------------------*/ + + void AllPoleFilter( + float *InOut, /* (i/o) on entrance InOut[-orderCoef] to + InOut[-1] contain the state of the + filter (delayed samples). InOut[0] to + InOut[lengthInOut-1] contain the filter + input, on en exit InOut[-orderCoef] to + InOut[-1] is unchanged and InOut[0] to + InOut[lengthInOut-1] contain filtered + samples */ + float *Coef,/* (i) filter coefficients, Coef[0] is assumed + to be 1.0 */ + int lengthInOut,/* (i) number of input/output samples */ + int orderCoef /* (i) number of filter coefficients */ + ){ + int n,k; + + for(n=0;n<lengthInOut;n++){ + for(k=1;k<=orderCoef;k++){ + *InOut -= Coef[k]*InOut[-k]; + + + + + + } + InOut++; + } + } + + /*----------------------------------------------------------------* + * all-zero filter + *---------------------------------------------------------------*/ + + void AllZeroFilter( + float *In, /* (i) In[0] to In[lengthInOut-1] contain + filter input samples */ + float *Coef,/* (i) filter coefficients (Coef[0] is assumed + to be 1.0) */ + int lengthInOut,/* (i) number of input/output samples */ + int orderCoef, /* (i) number of filter coefficients */ + float *Out /* (i/o) on entrance Out[-orderCoef] to Out[-1] + contain the filter state, on exit Out[0] + to Out[lengthInOut-1] contain filtered + samples */ + ){ + int n,k; + + for(n=0;n<lengthInOut;n++){ + *Out = Coef[0]*In[0]; + for(k=1;k<=orderCoef;k++){ + *Out += Coef[k]*In[-k]; + } + Out++; + In++; + } + } + + /*----------------------------------------------------------------* + * pole-zero filter + *---------------------------------------------------------------*/ + + void ZeroPoleFilter( + float *In, /* (i) In[0] to In[lengthInOut-1] contain + filter input samples In[-orderCoef] to + In[-1] contain state of all-zero + section */ + float *ZeroCoef,/* (i) filter coefficients for all-zero + section (ZeroCoef[0] is assumed to + be 1.0) */ + float *PoleCoef,/* (i) filter coefficients for all-pole section + (ZeroCoef[0] is assumed to be 1.0) */ + int lengthInOut,/* (i) number of input/output samples */ + + + + + + int orderCoef, /* (i) number of filter coefficients */ + float *Out /* (i/o) on entrance Out[-orderCoef] to Out[-1] + contain state of all-pole section. On + exit Out[0] to Out[lengthInOut-1] + contain filtered samples */ + ){ + AllZeroFilter(In,ZeroCoef,lengthInOut,orderCoef,Out); + AllPoleFilter(Out,PoleCoef,lengthInOut,orderCoef); + } + + /*----------------------------------------------------------------* + * downsample (LP filter and decimation) + *---------------------------------------------------------------*/ + + void DownSample ( + float *In, /* (i) input samples */ + float *Coef, /* (i) filter coefficients */ + int lengthIn, /* (i) number of input samples */ + float *state, /* (i) filter state */ + float *Out /* (o) downsampled output */ + ){ + float o; + float *Out_ptr = Out; + float *Coef_ptr, *In_ptr; + float *state_ptr; + int i, j, stop; + + /* LP filter and decimate at the same time */ + + for (i = DELAY_DS; i < lengthIn; i+=FACTOR_DS) + { + Coef_ptr = &Coef[0]; + In_ptr = &In[i]; + state_ptr = &state[FILTERORDER_DS-2]; + + o = (float)0.0; + + stop = (i < FILTERORDER_DS) ? i + 1 : FILTERORDER_DS; + + for (j = 0; j < stop; j++) + { + o += *Coef_ptr++ * (*In_ptr--); + } + for (j = i + 1; j < FILTERORDER_DS; j++) + { + o += *Coef_ptr++ * (*state_ptr--); + } + + + + + + + *Out_ptr++ = o; + } + + /* Get the last part (use zeros as input for the future) */ + + for (i=(lengthIn+FACTOR_DS); i<(lengthIn+DELAY_DS); + i+=FACTOR_DS) { + + o=(float)0.0; + + if (i<lengthIn) { + Coef_ptr = &Coef[0]; + In_ptr = &In[i]; + for (j=0; j<FILTERORDER_DS; j++) { + o += *Coef_ptr++ * (*Out_ptr--); + } + } else { + Coef_ptr = &Coef[i-lengthIn]; + In_ptr = &In[lengthIn-1]; + for (j=0; j<FILTERORDER_DS-(i-lengthIn); j++) { + o += *Coef_ptr++ * (*In_ptr--); + } + } + *Out_ptr++ = o; + } + } + diff --git a/sflphone-common/libs/pjproject/third_party/ilbc/filter.h b/sflphone-common/libs/pjproject/third_party/ilbc/filter.h new file mode 100644 index 0000000000000000000000000000000000000000..4c512cd9376beb643234893f840467927d53c1ae --- /dev/null +++ b/sflphone-common/libs/pjproject/third_party/ilbc/filter.h @@ -0,0 +1,80 @@ + + /****************************************************************** + + iLBC Speech Coder ANSI-C Source Code + + filter.h + + Copyright (C) The Internet Society (2004). + All Rights Reserved. + + ******************************************************************/ + + + + + + + #ifndef __iLBC_FILTER_H + #define __iLBC_FILTER_H + + void AllPoleFilter( + float *InOut, /* (i/o) on entrance InOut[-orderCoef] to + InOut[-1] contain the state of the + filter (delayed samples). InOut[0] to + InOut[lengthInOut-1] contain the filter + input, on en exit InOut[-orderCoef] to + InOut[-1] is unchanged and InOut[0] to + InOut[lengthInOut-1] contain filtered + samples */ + float *Coef,/* (i) filter coefficients, Coef[0] is assumed + to be 1.0 */ + int lengthInOut,/* (i) number of input/output samples */ + int orderCoef /* (i) number of filter coefficients */ + ); + + void AllZeroFilter( + float *In, /* (i) In[0] to In[lengthInOut-1] contain + filter input samples */ + float *Coef,/* (i) filter coefficients (Coef[0] is assumed + to be 1.0) */ + int lengthInOut,/* (i) number of input/output samples */ + int orderCoef, /* (i) number of filter coefficients */ + float *Out /* (i/o) on entrance Out[-orderCoef] to Out[-1] + contain the filter state, on exit Out[0] + to Out[lengthInOut-1] contain filtered + samples */ + ); + + void ZeroPoleFilter( + float *In, /* (i) In[0] to In[lengthInOut-1] contain filter + input samples In[-orderCoef] to In[-1] + contain state of all-zero section */ + float *ZeroCoef,/* (i) filter coefficients for all-zero + section (ZeroCoef[0] is assumed to + be 1.0) */ + float *PoleCoef,/* (i) filter coefficients for all-pole section + (ZeroCoef[0] is assumed to be 1.0) */ + int lengthInOut,/* (i) number of input/output samples */ + int orderCoef, /* (i) number of filter coefficients */ + float *Out /* (i/o) on entrance Out[-orderCoef] to Out[-1] + contain state of all-pole section. On + exit Out[0] to Out[lengthInOut-1] + contain filtered samples */ + ); + + + + + + + void DownSample ( + float *In, /* (i) input samples */ + float *Coef, /* (i) filter coefficients */ + int lengthIn, /* (i) number of input samples */ + float *state, /* (i) filter state */ + float *Out /* (o) downsampled output */ + ); + + #endif + diff --git a/sflphone-common/libs/pjproject/third_party/ilbc/gainquant.c b/sflphone-common/libs/pjproject/third_party/ilbc/gainquant.c new file mode 100644 index 0000000000000000000000000000000000000000..0e74ff827050bc56fd50755ce31944c92e319ad2 --- /dev/null +++ b/sflphone-common/libs/pjproject/third_party/ilbc/gainquant.c @@ -0,0 +1,116 @@ + + /****************************************************************** + + iLBC Speech Coder ANSI-C Source Code + + + + + + + gainquant.c + + Copyright (C) The Internet Society (2004). + All Rights Reserved. + + ******************************************************************/ + + #include <string.h> + #include <math.h> + #include "constants.h" + #include "filter.h" + + /*----------------------------------------------------------------* + * quantizer for the gain in the gain-shape coding of residual + *---------------------------------------------------------------*/ + + float gainquant(/* (o) quantized gain value */ + float in, /* (i) gain value */ + float maxIn,/* (i) maximum of gain value */ + int cblen, /* (i) number of quantization indices */ + int *index /* (o) quantization index */ + ){ + int i, tindex; + float minmeasure,measure, *cb, scale; + + /* ensure a lower bound on the scaling factor */ + + scale=maxIn; + + if (scale<0.1) { + scale=(float)0.1; + } + + /* select the quantization table */ + + if (cblen == 8) { + cb = gain_sq3Tbl; + } else if (cblen == 16) { + cb = gain_sq4Tbl; + } else { + cb = gain_sq5Tbl; + } + + /* select the best index in the quantization table */ + + minmeasure=10000000.0; + tindex=0; + for (i=0; i<cblen; i++) { + + + + + + measure=(in-scale*cb[i])*(in-scale*cb[i]); + + if (measure<minmeasure) { + tindex=i; + minmeasure=measure; + } + } + *index=tindex; + + /* return the quantized value */ + + return scale*cb[tindex]; + } + + /*----------------------------------------------------------------* + * decoder for quantized gains in the gain-shape coding of + * residual + *---------------------------------------------------------------*/ + + float gaindequant( /* (o) quantized gain value */ + int index, /* (i) quantization index */ + float maxIn,/* (i) maximum of unquantized gain */ + int cblen /* (i) number of quantization indices */ + ){ + float scale; + + /* obtain correct scale factor */ + + scale=(float)fabs(maxIn); + + if (scale<0.1) { + scale=(float)0.1; + } + + /* select the quantization table and return the decoded value */ + + if (cblen==8) { + return scale*gain_sq3Tbl[index]; + } else if (cblen==16) { + return scale*gain_sq4Tbl[index]; + } + else if (cblen==32) { + return scale*gain_sq5Tbl[index]; + } + + return 0.0; + } + + + + + + diff --git a/sflphone-common/libs/pjproject/third_party/ilbc/gainquant.h b/sflphone-common/libs/pjproject/third_party/ilbc/gainquant.h new file mode 100644 index 0000000000000000000000000000000000000000..0d024246d7d38bc3e5d495a9b19720bce27aa073 --- /dev/null +++ b/sflphone-common/libs/pjproject/third_party/ilbc/gainquant.h @@ -0,0 +1,30 @@ + + /****************************************************************** + + iLBC Speech Coder ANSI-C Source Code + + gainquant.h + + Copyright (C) The Internet Society (2004). + All Rights Reserved. + + ******************************************************************/ + + #ifndef __iLBC_GAINQUANT_H + #define __iLBC_GAINQUANT_H + + float gainquant(/* (o) quantized gain value */ + float in, /* (i) gain value */ + float maxIn,/* (i) maximum of gain value */ + int cblen, /* (i) number of quantization indices */ + int *index /* (o) quantization index */ + ); + + float gaindequant( /* (o) quantized gain value */ + int index, /* (i) quantization index */ + float maxIn,/* (i) maximum of unquantized gain */ + int cblen /* (i) number of quantization indices */ + ); + + #endif + diff --git a/sflphone-common/libs/pjproject/third_party/ilbc/getCBvec.c b/sflphone-common/libs/pjproject/third_party/ilbc/getCBvec.c new file mode 100644 index 0000000000000000000000000000000000000000..4f2d291417505de51e3d1db92b384a045f9b9bb7 --- /dev/null +++ b/sflphone-common/libs/pjproject/third_party/ilbc/getCBvec.c @@ -0,0 +1,193 @@ + + /****************************************************************** + + iLBC Speech Coder ANSI-C Source Code + + getCBvec.c + + Copyright (C) The Internet Society (2004). + All Rights Reserved. + + ******************************************************************/ + + #include "iLBC_define.h" + #include "constants.h" + #include <string.h> + + /*----------------------------------------------------------------* + * Construct codebook vector for given index. + *---------------------------------------------------------------*/ + + void getCBvec( + + + + + + float *cbvec, /* (o) Constructed codebook vector */ + float *mem, /* (i) Codebook buffer */ + int index, /* (i) Codebook index */ + int lMem, /* (i) Length of codebook buffer */ + int cbveclen/* (i) Codebook vector length */ + ){ + int j, k, n, memInd, sFilt; + float tmpbuf[CB_MEML]; + int base_size; + int ilow, ihigh; + float alfa, alfa1; + + /* Determine size of codebook sections */ + + base_size=lMem-cbveclen+1; + + if (cbveclen==SUBL) { + base_size+=cbveclen/2; + } + + /* No filter -> First codebook section */ + + if (index<lMem-cbveclen+1) { + + /* first non-interpolated vectors */ + + k=index+cbveclen; + /* get vector */ + memcpy(cbvec, mem+lMem-k, cbveclen*sizeof(float)); + + } else if (index < base_size) { + + k=2*(index-(lMem-cbveclen+1))+cbveclen; + + ihigh=k/2; + ilow=ihigh-5; + + /* Copy first noninterpolated part */ + + memcpy(cbvec, mem+lMem-k/2, ilow*sizeof(float)); + + /* interpolation */ + + alfa1=(float)0.2; + alfa=0.0; + for (j=ilow; j<ihigh; j++) { + cbvec[j]=((float)1.0-alfa)*mem[lMem-k/2+j]+ + alfa*mem[lMem-k+j]; + + + + + + alfa+=alfa1; + } + + /* Copy second noninterpolated part */ + + memcpy(cbvec+ihigh, mem+lMem-k+ihigh, + (cbveclen-ihigh)*sizeof(float)); + + } + + /* Higher codebook section based on filtering */ + + else { + + /* first non-interpolated vectors */ + + if (index-base_size<lMem-cbveclen+1) { + float tempbuff2[CB_MEML+CB_FILTERLEN+1]; + float *pos; + float *pp, *pp1; + + memset(tempbuff2, 0, + CB_HALFFILTERLEN*sizeof(float)); + memcpy(&tempbuff2[CB_HALFFILTERLEN], mem, + lMem*sizeof(float)); + memset(&tempbuff2[lMem+CB_HALFFILTERLEN], 0, + (CB_HALFFILTERLEN+1)*sizeof(float)); + + k=index-base_size+cbveclen; + sFilt=lMem-k; + memInd=sFilt+1-CB_HALFFILTERLEN; + + /* do filtering */ + pos=cbvec; + memset(pos, 0, cbveclen*sizeof(float)); + for (n=0; n<cbveclen; n++) { + pp=&tempbuff2[memInd+n+CB_HALFFILTERLEN]; + pp1=&cbfiltersTbl[CB_FILTERLEN-1]; + for (j=0; j<CB_FILTERLEN; j++) { + (*pos)+=(*pp++)*(*pp1--); + } + pos++; + } + } + + /* interpolated vectors */ + + else { + + + + + + float tempbuff2[CB_MEML+CB_FILTERLEN+1]; + + float *pos; + float *pp, *pp1; + int i; + + memset(tempbuff2, 0, + CB_HALFFILTERLEN*sizeof(float)); + memcpy(&tempbuff2[CB_HALFFILTERLEN], mem, + lMem*sizeof(float)); + memset(&tempbuff2[lMem+CB_HALFFILTERLEN], 0, + (CB_HALFFILTERLEN+1)*sizeof(float)); + + k=2*(index-base_size- + (lMem-cbveclen+1))+cbveclen; + sFilt=lMem-k; + memInd=sFilt+1-CB_HALFFILTERLEN; + + /* do filtering */ + pos=&tmpbuf[sFilt]; + memset(pos, 0, k*sizeof(float)); + for (i=0; i<k; i++) { + pp=&tempbuff2[memInd+i+CB_HALFFILTERLEN]; + pp1=&cbfiltersTbl[CB_FILTERLEN-1]; + for (j=0; j<CB_FILTERLEN; j++) { + (*pos)+=(*pp++)*(*pp1--); + } + pos++; + } + + ihigh=k/2; + ilow=ihigh-5; + + /* Copy first noninterpolated part */ + + memcpy(cbvec, tmpbuf+lMem-k/2, + ilow*sizeof(float)); + + /* interpolation */ + + alfa1=(float)0.2; + alfa=0.0; + for (j=ilow; j<ihigh; j++) { + cbvec[j]=((float)1.0-alfa)* + tmpbuf[lMem-k/2+j]+alfa*tmpbuf[lMem-k+j]; + alfa+=alfa1; + } + + + + + + + /* Copy second noninterpolated part */ + + memcpy(cbvec+ihigh, tmpbuf+lMem-k+ihigh, + (cbveclen-ihigh)*sizeof(float)); + } + } + } + diff --git a/sflphone-common/libs/pjproject/third_party/ilbc/getCBvec.h b/sflphone-common/libs/pjproject/third_party/ilbc/getCBvec.h new file mode 100644 index 0000000000000000000000000000000000000000..0080907c02ec39f6bb21578fdb884499ce217d3e --- /dev/null +++ b/sflphone-common/libs/pjproject/third_party/ilbc/getCBvec.h @@ -0,0 +1,25 @@ + + /****************************************************************** + + iLBC Speech Coder ANSI-C Source Code + + getCBvec.h + + Copyright (C) The Internet Society (2004). + All Rights Reserved. + + ******************************************************************/ + + #ifndef __iLBC_GETCBVEC_H + #define __iLBC_GETCBVEC_H + + void getCBvec( + float *cbvec, /* (o) Constructed codebook vector */ + float *mem, /* (i) Codebook buffer */ + int index, /* (i) Codebook index */ + int lMem, /* (i) Length of codebook buffer */ + int cbveclen/* (i) Codebook vector length */ + ); + + #endif + diff --git a/sflphone-common/libs/pjproject/third_party/ilbc/helpfun.c b/sflphone-common/libs/pjproject/third_party/ilbc/helpfun.c new file mode 100644 index 0000000000000000000000000000000000000000..1aba65788f0deb2d3a22d231ba44d792151a6c95 --- /dev/null +++ b/sflphone-common/libs/pjproject/third_party/ilbc/helpfun.c @@ -0,0 +1,326 @@ + + /****************************************************************** + + iLBC Speech Coder ANSI-C Source Code + + helpfun.c + + Copyright (C) The Internet Society (2004). + All Rights Reserved. + + ******************************************************************/ + + #include <math.h> + + #include "iLBC_define.h" + #include "constants.h" + + /*----------------------------------------------------------------* + * calculation of auto correlation + *---------------------------------------------------------------*/ + + void autocorr( + float *r, /* (o) autocorrelation vector */ + const float *x, /* (i) data vector */ + int N, /* (i) length of data vector */ + int order /* largest lag for calculated + autocorrelations */ + ){ + int lag, n; + float sum; + + for (lag = 0; lag <= order; lag++) { + sum = 0; + for (n = 0; n < N - lag; n++) { + sum += x[n] * x[n+lag]; + } + r[lag] = sum; + } + + + + + + } + + /*----------------------------------------------------------------* + * window multiplication + *---------------------------------------------------------------*/ + + void window( + float *z, /* (o) the windowed data */ + const float *x, /* (i) the original data vector */ + const float *y, /* (i) the window */ + int N /* (i) length of all vectors */ + ){ + int i; + + for (i = 0; i < N; i++) { + z[i] = x[i] * y[i]; + } + } + + /*----------------------------------------------------------------* + * levinson-durbin solution for lpc coefficients + *---------------------------------------------------------------*/ + + void levdurb( + float *a, /* (o) lpc coefficient vector starting + with 1.0 */ + float *k, /* (o) reflection coefficients */ + float *r, /* (i) autocorrelation vector */ + int order /* (i) order of lpc filter */ + ){ + float sum, alpha; + int m, m_h, i; + + a[0] = 1.0; + + if (r[0] < EPS) { /* if r[0] <= 0, set LPC coeff. to zero */ + for (i = 0; i < order; i++) { + k[i] = 0; + a[i+1] = 0; + } + } else { + a[1] = k[0] = -r[1]/r[0]; + alpha = r[0] + r[1] * k[0]; + for (m = 1; m < order; m++){ + sum = r[m + 1]; + for (i = 0; i < m; i++){ + sum += a[i+1] * r[m - i]; + } + + + + + + k[m] = -sum / alpha; + alpha += k[m] * sum; + m_h = (m + 1) >> 1; + for (i = 0; i < m_h; i++){ + sum = a[i+1] + k[m] * a[m - i]; + a[m - i] += k[m] * a[i+1]; + a[i+1] = sum; + } + a[m+1] = k[m]; + } + } + } + + /*----------------------------------------------------------------* + * interpolation between vectors + *---------------------------------------------------------------*/ + + void interpolate( + float *out, /* (o) the interpolated vector */ + float *in1, /* (i) the first vector for the + interpolation */ + float *in2, /* (i) the second vector for the + interpolation */ + float coef, /* (i) interpolation weights */ + int length /* (i) length of all vectors */ + ){ + int i; + float invcoef; + + invcoef = (float)1.0 - coef; + for (i = 0; i < length; i++) { + out[i] = coef * in1[i] + invcoef * in2[i]; + } + } + + /*----------------------------------------------------------------* + * lpc bandwidth expansion + *---------------------------------------------------------------*/ + + void bwexpand( + float *out, /* (o) the bandwidth expanded lpc + coefficients */ + float *in, /* (i) the lpc coefficients before bandwidth + expansion */ + float coef, /* (i) the bandwidth expansion factor */ + int length /* (i) the length of lpc coefficient vectors */ + ){ + int i; + + + + + + float chirp; + + chirp = coef; + + out[0] = in[0]; + for (i = 1; i < length; i++) { + out[i] = chirp * in[i]; + chirp *= coef; + } + } + + /*----------------------------------------------------------------* + * vector quantization + *---------------------------------------------------------------*/ + + void vq( + float *Xq, /* (o) the quantized vector */ + int *index, /* (o) the quantization index */ + const float *CB,/* (i) the vector quantization codebook */ + float *X, /* (i) the vector to quantize */ + int n_cb, /* (i) the number of vectors in the codebook */ + int dim /* (i) the dimension of all vectors */ + ){ + int i, j; + int pos, minindex; + float dist, tmp, mindist; + + pos = 0; + mindist = FLOAT_MAX; + minindex = 0; + for (j = 0; j < n_cb; j++) { + dist = X[0] - CB[pos]; + dist *= dist; + for (i = 1; i < dim; i++) { + tmp = X[i] - CB[pos + i]; + dist += tmp*tmp; + } + + if (dist < mindist) { + mindist = dist; + minindex = j; + } + pos += dim; + } + for (i = 0; i < dim; i++) { + Xq[i] = CB[minindex*dim + i]; + } + *index = minindex; + + + + + + } + + /*----------------------------------------------------------------* + * split vector quantization + *---------------------------------------------------------------*/ + + void SplitVQ( + float *qX, /* (o) the quantized vector */ + int *index, /* (o) a vector of indexes for all vector + codebooks in the split */ + float *X, /* (i) the vector to quantize */ + const float *CB,/* (i) the quantizer codebook */ + int nsplit, /* the number of vector splits */ + const int *dim, /* the dimension of X and qX */ + const int *cbsize /* the number of vectors in the codebook */ + ){ + int cb_pos, X_pos, i; + + cb_pos = 0; + X_pos= 0; + for (i = 0; i < nsplit; i++) { + vq(qX + X_pos, index + i, CB + cb_pos, X + X_pos, + cbsize[i], dim[i]); + X_pos += dim[i]; + cb_pos += dim[i] * cbsize[i]; + } + } + + /*----------------------------------------------------------------* + * scalar quantization + *---------------------------------------------------------------*/ + + void sort_sq( + float *xq, /* (o) the quantized value */ + int *index, /* (o) the quantization index */ + float x, /* (i) the value to quantize */ + const float *cb,/* (i) the quantization codebook */ + int cb_size /* (i) the size of the quantization codebook */ + ){ + int i; + + if (x <= cb[0]) { + *index = 0; + *xq = cb[0]; + } else { + i = 0; + while ((x > cb[i]) && i < cb_size - 1) { + i++; + + + + + + } + + if (x > ((cb[i] + cb[i - 1])/2)) { + *index = i; + *xq = cb[i]; + } else { + *index = i - 1; + *xq = cb[i - 1]; + } + } + } + + /*----------------------------------------------------------------* + * check for stability of lsf coefficients + *---------------------------------------------------------------*/ + + int LSF_check( /* (o) 1 for stable lsf vectors and 0 for + nonstable ones */ + float *lsf, /* (i) a table of lsf vectors */ + int dim, /* (i) the dimension of each lsf vector */ + int NoAn /* (i) the number of lsf vectors in the + table */ + ){ + int k,n,m, Nit=2, change=0,pos; + float tmp; + static float eps=(float)0.039; /* 50 Hz */ + static float eps2=(float)0.0195; + static float maxlsf=(float)3.14; /* 4000 Hz */ + static float minlsf=(float)0.01; /* 0 Hz */ + + /* LSF separation check*/ + + for (n=0; n<Nit; n++) { /* Run through a couple of times */ + for (m=0; m<NoAn; m++) { /* Number of analyses per frame */ + for (k=0; k<(dim-1); k++) { + pos=m*dim+k; + + if ((lsf[pos+1]-lsf[pos])<eps) { + + if (lsf[pos+1]<lsf[pos]) { + tmp=lsf[pos+1]; + lsf[pos+1]= lsf[pos]+eps2; + lsf[pos]= lsf[pos+1]-eps2; + } else { + lsf[pos]-=eps2; + lsf[pos+1]+=eps2; + } + change=1; + + + + + + } + + if (lsf[pos]<minlsf) { + lsf[pos]=minlsf; + change=1; + } + + if (lsf[pos]>maxlsf) { + lsf[pos]=maxlsf; + change=1; + } + } + } + } + + return change; + } + diff --git a/sflphone-common/libs/pjproject/third_party/ilbc/helpfun.h b/sflphone-common/libs/pjproject/third_party/ilbc/helpfun.h new file mode 100644 index 0000000000000000000000000000000000000000..931ca68a64da2705c6669c1f985ca5183287e0dd --- /dev/null +++ b/sflphone-common/libs/pjproject/third_party/ilbc/helpfun.h @@ -0,0 +1,106 @@ + + /****************************************************************** + + iLBC Speech Coder ANSI-C Source Code + + helpfun.h + + Copyright (C) The Internet Society (2004). + All Rights Reserved. + + ******************************************************************/ + + #ifndef __iLBC_HELPFUN_H + #define __iLBC_HELPFUN_H + + void autocorr( + float *r, /* (o) autocorrelation vector */ + const float *x, /* (i) data vector */ + int N, /* (i) length of data vector */ + int order /* largest lag for calculated + autocorrelations */ + ); + + void window( + float *z, /* (o) the windowed data */ + const float *x, /* (i) the original data vector */ + const float *y, /* (i) the window */ + int N /* (i) length of all vectors */ + ); + + void levdurb( + float *a, /* (o) lpc coefficient vector starting + with 1.0 */ + float *k, /* (o) reflection coefficients */ + float *r, /* (i) autocorrelation vector */ + int order /* (i) order of lpc filter */ + ); + + void interpolate( + + + + + + float *out, /* (o) the interpolated vector */ + float *in1, /* (i) the first vector for the + interpolation */ + float *in2, /* (i) the second vector for the + interpolation */ + float coef, /* (i) interpolation weights */ + int length /* (i) length of all vectors */ + ); + + void bwexpand( + float *out, /* (o) the bandwidth expanded lpc + coefficients */ + float *in, /* (i) the lpc coefficients before bandwidth + expansion */ + float coef, /* (i) the bandwidth expansion factor */ + int length /* (i) the length of lpc coefficient vectors */ + ); + + void vq( + float *Xq, /* (o) the quantized vector */ + int *index, /* (o) the quantization index */ + const float *CB,/* (i) the vector quantization codebook */ + float *X, /* (i) the vector to quantize */ + int n_cb, /* (i) the number of vectors in the codebook */ + int dim /* (i) the dimension of all vectors */ + ); + + void SplitVQ( + float *qX, /* (o) the quantized vector */ + int *index, /* (o) a vector of indexes for all vector + codebooks in the split */ + float *X, /* (i) the vector to quantize */ + const float *CB,/* (i) the quantizer codebook */ + int nsplit, /* the number of vector splits */ + const int *dim, /* the dimension of X and qX */ + const int *cbsize /* the number of vectors in the codebook */ + ); + + + void sort_sq( + float *xq, /* (o) the quantized value */ + int *index, /* (o) the quantization index */ + float x, /* (i) the value to quantize */ + const float *cb,/* (i) the quantization codebook */ + int cb_size /* (i) the size of the quantization codebook */ + ); + + int LSF_check( /* (o) 1 for stable lsf vectors and 0 for + + + + + + nonstable ones */ + float *lsf, /* (i) a table of lsf vectors */ + int dim, /* (i) the dimension of each lsf vector */ + int NoAn /* (i) the number of lsf vectors in the + table */ + ); + + #endif + diff --git a/sflphone-common/libs/pjproject/third_party/ilbc/hpInput.c b/sflphone-common/libs/pjproject/third_party/ilbc/hpInput.c new file mode 100644 index 0000000000000000000000000000000000000000..7ceee09643715f91229629f87fb65ca8717e8bf4 --- /dev/null +++ b/sflphone-common/libs/pjproject/third_party/ilbc/hpInput.c @@ -0,0 +1,65 @@ + + /****************************************************************** + + iLBC Speech Coder ANSI-C Source Code + + + + + + hpInput.c + + Copyright (C) The Internet Society (2004). + All Rights Reserved. + + ******************************************************************/ + + #include "constants.h" + + /*----------------------------------------------------------------* + * Input high-pass filter + *---------------------------------------------------------------*/ + + void hpInput( + float *In, /* (i) vector to filter */ + int len, /* (i) length of vector to filter */ + float *Out, /* (o) the resulting filtered vector */ + float *mem /* (i/o) the filter state */ + ){ + int i; + float *pi, *po; + + /* all-zero section*/ + + pi = &In[0]; + po = &Out[0]; + for (i=0; i<len; i++) { + *po = hpi_zero_coefsTbl[0] * (*pi); + *po += hpi_zero_coefsTbl[1] * mem[0]; + *po += hpi_zero_coefsTbl[2] * mem[1]; + + mem[1] = mem[0]; + mem[0] = *pi; + po++; + pi++; + + } + + /* all-pole section*/ + + po = &Out[0]; + for (i=0; i<len; i++) { + *po -= hpi_pole_coefsTbl[1] * mem[2]; + *po -= hpi_pole_coefsTbl[2] * mem[3]; + + mem[3] = mem[2]; + mem[2] = *po; + po++; + + + + + + } + } + diff --git a/sflphone-common/libs/pjproject/third_party/ilbc/hpInput.h b/sflphone-common/libs/pjproject/third_party/ilbc/hpInput.h new file mode 100644 index 0000000000000000000000000000000000000000..3b020d11df050e976cf2044fc1ce3a1beddcefa9 --- /dev/null +++ b/sflphone-common/libs/pjproject/third_party/ilbc/hpInput.h @@ -0,0 +1,24 @@ + + /****************************************************************** + + iLBC Speech Coder ANSI-C Source Code + + hpInput.h + + Copyright (C) The Internet Society (2004). + All Rights Reserved. + + ******************************************************************/ + + #ifndef __iLBC_HPINPUT_H + #define __iLBC_HPINPUT_H + + void hpInput( + float *In, /* (i) vector to filter */ + int len, /* (i) length of vector to filter */ + float *Out, /* (o) the resulting filtered vector */ + float *mem /* (i/o) the filter state */ + ); + + #endif + diff --git a/sflphone-common/libs/pjproject/third_party/ilbc/hpOutput.c b/sflphone-common/libs/pjproject/third_party/ilbc/hpOutput.c new file mode 100644 index 0000000000000000000000000000000000000000..756160a657f9c0fa36ae28279db67a8263b4275f --- /dev/null +++ b/sflphone-common/libs/pjproject/third_party/ilbc/hpOutput.c @@ -0,0 +1,61 @@ + + /****************************************************************** + + iLBC Speech Coder ANSI-C Source Code + + hpOutput.c + + Copyright (C) The Internet Society (2004). + All Rights Reserved. + + ******************************************************************/ + + #include "constants.h" + + /*----------------------------------------------------------------* + * Output high-pass filter + *---------------------------------------------------------------*/ + + void hpOutput( + + + + + + float *In, /* (i) vector to filter */ + int len,/* (i) length of vector to filter */ + float *Out, /* (o) the resulting filtered vector */ + float *mem /* (i/o) the filter state */ + ){ + int i; + float *pi, *po; + + /* all-zero section*/ + + pi = &In[0]; + po = &Out[0]; + for (i=0; i<len; i++) { + *po = hpo_zero_coefsTbl[0] * (*pi); + *po += hpo_zero_coefsTbl[1] * mem[0]; + *po += hpo_zero_coefsTbl[2] * mem[1]; + + mem[1] = mem[0]; + mem[0] = *pi; + po++; + pi++; + + } + + /* all-pole section*/ + + po = &Out[0]; + for (i=0; i<len; i++) { + *po -= hpo_pole_coefsTbl[1] * mem[2]; + *po -= hpo_pole_coefsTbl[2] * mem[3]; + + mem[3] = mem[2]; + mem[2] = *po; + po++; + } + } + diff --git a/sflphone-common/libs/pjproject/third_party/ilbc/hpOutput.h b/sflphone-common/libs/pjproject/third_party/ilbc/hpOutput.h new file mode 100644 index 0000000000000000000000000000000000000000..b213a19348ef39bfe6d718971dc0f9f61e65ca01 --- /dev/null +++ b/sflphone-common/libs/pjproject/third_party/ilbc/hpOutput.h @@ -0,0 +1,24 @@ + + /****************************************************************** + + iLBC Speech Coder ANSI-C Source Code + + hpOutput.h + + Copyright (C) The Internet Society (2004). + All Rights Reserved. + + ******************************************************************/ + + #ifndef __iLBC_HPOUTPUT_H + #define __iLBC_HPOUTPUT_H + + void hpOutput( + float *In, /* (i) vector to filter */ + int len,/* (i) length of vector to filter */ + float *Out, /* (o) the resulting filtered vector */ + float *mem /* (i/o) the filter state */ + ); + + #endif + diff --git a/sflphone-common/libs/pjproject/third_party/ilbc/iCBConstruct.c b/sflphone-common/libs/pjproject/third_party/ilbc/iCBConstruct.c new file mode 100644 index 0000000000000000000000000000000000000000..ee9a73ca5896b687562181176fc16b4cd45c4eb5 --- /dev/null +++ b/sflphone-common/libs/pjproject/third_party/ilbc/iCBConstruct.c @@ -0,0 +1,112 @@ + + /****************************************************************** + + iLBC Speech Coder ANSI-C Source Code + + iCBConstruct.c + + Copyright (C) The Internet Society (2004). + All Rights Reserved. + + ******************************************************************/ + + #include <math.h> + + #include "iLBC_define.h" + #include "gainquant.h" + #include "getCBvec.h" + + /*----------------------------------------------------------------* + * Convert the codebook indexes to make the search easier + *---------------------------------------------------------------*/ + + + + + + + void index_conv_enc( + int *index /* (i/o) Codebook indexes */ + ){ + int k; + + for (k=1; k<CB_NSTAGES; k++) { + + if ((index[k]>=108)&&(index[k]<172)) { + index[k]-=64; + } else if (index[k]>=236) { + index[k]-=128; + } else { + /* ERROR */ + } + } + } + + void index_conv_dec( + int *index /* (i/o) Codebook indexes */ + ){ + int k; + + for (k=1; k<CB_NSTAGES; k++) { + + if ((index[k]>=44)&&(index[k]<108)) { + index[k]+=64; + } else if ((index[k]>=108)&&(index[k]<128)) { + index[k]+=128; + } else { + /* ERROR */ + } + } + } + + /*----------------------------------------------------------------* + * Construct decoded vector from codebook and gains. + *---------------------------------------------------------------*/ + + void iCBConstruct( + float *decvector, /* (o) Decoded vector */ + int *index, /* (i) Codebook indices */ + int *gain_index,/* (i) Gain quantization indices */ + float *mem, /* (i) Buffer for codevector construction */ + int lMem, /* (i) Length of buffer */ + int veclen, /* (i) Length of vector */ + int nStages /* (i) Number of codebook stages */ + ){ + int j,k; + + + + + + float gain[CB_NSTAGES]; + float cbvec[SUBL]; + + /* gain de-quantization */ + + gain[0] = gaindequant(gain_index[0], 1.0, 32); + if (nStages > 1) { + gain[1] = gaindequant(gain_index[1], + (float)fabs(gain[0]), 16); + } + if (nStages > 2) { + gain[2] = gaindequant(gain_index[2], + (float)fabs(gain[1]), 8); + } + + /* codebook vector construction and construction of + total vector */ + + getCBvec(cbvec, mem, index[0], lMem, veclen); + for (j=0;j<veclen;j++){ + decvector[j] = gain[0]*cbvec[j]; + } + if (nStages > 1) { + for (k=1; k<nStages; k++) { + getCBvec(cbvec, mem, index[k], lMem, veclen); + for (j=0;j<veclen;j++) { + decvector[j] += gain[k]*cbvec[j]; + } + } + } + } + diff --git a/sflphone-common/libs/pjproject/third_party/ilbc/iCBConstruct.h b/sflphone-common/libs/pjproject/third_party/ilbc/iCBConstruct.h new file mode 100644 index 0000000000000000000000000000000000000000..143501ed64787106eb384f34a841b97b7ab7b9c4 --- /dev/null +++ b/sflphone-common/libs/pjproject/third_party/ilbc/iCBConstruct.h @@ -0,0 +1,40 @@ + + /****************************************************************** + + iLBC Speech Coder ANSI-C Source Code + + iCBConstruct.h + + Copyright (C) The Internet Society (2004). + All Rights Reserved. + + + + + + + ******************************************************************/ + + #ifndef __iLBC_ICBCONSTRUCT_H + #define __iLBC_ICBCONSTRUCT_H + + void index_conv_enc( + int *index /* (i/o) Codebook indexes */ + ); + + void index_conv_dec( + int *index /* (i/o) Codebook indexes */ + ); + + void iCBConstruct( + float *decvector, /* (o) Decoded vector */ + int *index, /* (i) Codebook indices */ + int *gain_index,/* (i) Gain quantization indices */ + float *mem, /* (i) Buffer for codevector construction */ + int lMem, /* (i) Length of buffer */ + int veclen, /* (i) Length of vector */ + int nStages /* (i) Number of codebook stages */ + ); + + #endif + diff --git a/sflphone-common/libs/pjproject/third_party/ilbc/iCBSearch.c b/sflphone-common/libs/pjproject/third_party/ilbc/iCBSearch.c new file mode 100644 index 0000000000000000000000000000000000000000..e0442bf0544f56820aa18927f49328abd05b3d9d --- /dev/null +++ b/sflphone-common/libs/pjproject/third_party/ilbc/iCBSearch.c @@ -0,0 +1,515 @@ + + /****************************************************************** + + iLBC Speech Coder ANSI-C Source Code + + iCBSearch.c + + Copyright (C) The Internet Society (2004). + All Rights Reserved. + + ******************************************************************/ + + #include <math.h> + #include <string.h> + + #include "iLBC_define.h" + #include "gainquant.h" + #include "createCB.h" + #include "filter.h" + #include "constants.h" + + /*----------------------------------------------------------------* + * Search routine for codebook encoding and gain quantization. + *---------------------------------------------------------------*/ + + void iCBSearch( + iLBC_Enc_Inst_t *iLBCenc_inst, + /* (i) the encoder state structure */ + int *index, /* (o) Codebook indices */ + int *gain_index,/* (o) Gain quantization indices */ + + + + + + float *intarget,/* (i) Target vector for encoding */ + float *mem, /* (i) Buffer for codebook construction */ + int lMem, /* (i) Length of buffer */ + int lTarget, /* (i) Length of vector */ + int nStages, /* (i) Number of codebook stages */ + float *weightDenum, /* (i) weighting filter coefficients */ + float *weightState, /* (i) weighting filter state */ + int block /* (i) the sub-block number */ + ){ + int i, j, icount, stage, best_index, range, counter; + float max_measure, gain, measure, crossDot, ftmp; + float gains[CB_NSTAGES]; + float target[SUBL]; + int base_index, sInd, eInd, base_size; + int sIndAug=0, eIndAug=0; + float buf[CB_MEML+SUBL+2*LPC_FILTERORDER]; + float invenergy[CB_EXPAND*128], energy[CB_EXPAND*128]; + float *pp, *ppi=0, *ppo=0, *ppe=0; + float cbvectors[CB_MEML]; + float tene, cene, cvec[SUBL]; + float aug_vec[SUBL]; + + memset(cvec,0,SUBL*sizeof(float)); + + /* Determine size of codebook sections */ + + base_size=lMem-lTarget+1; + + if (lTarget==SUBL) { + base_size=lMem-lTarget+1+lTarget/2; + } + + /* setup buffer for weighting */ + + memcpy(buf,weightState,sizeof(float)*LPC_FILTERORDER); + memcpy(buf+LPC_FILTERORDER,mem,lMem*sizeof(float)); + memcpy(buf+LPC_FILTERORDER+lMem,intarget,lTarget*sizeof(float)); + + /* weighting */ + + AllPoleFilter(buf+LPC_FILTERORDER, weightDenum, + lMem+lTarget, LPC_FILTERORDER); + + /* Construct the codebook and target needed */ + + memcpy(target, buf+LPC_FILTERORDER+lMem, lTarget*sizeof(float)); + + tene=0.0; + + + + + + for (i=0; i<lTarget; i++) { + tene+=target[i]*target[i]; + } + + /* Prepare search over one more codebook section. This section + is created by filtering the original buffer with a filter. */ + + filteredCBvecs(cbvectors, buf+LPC_FILTERORDER, lMem); + + /* The Main Loop over stages */ + + for (stage=0; stage<nStages; stage++) { + + range = search_rangeTbl[block][stage]; + + /* initialize search measure */ + + max_measure = (float)-10000000.0; + gain = (float)0.0; + best_index = 0; + + /* Compute cross dot product between the target + and the CB memory */ + + crossDot=0.0; + pp=buf+LPC_FILTERORDER+lMem-lTarget; + for (j=0; j<lTarget; j++) { + crossDot += target[j]*(*pp++); + } + + if (stage==0) { + + /* Calculate energy in the first block of + 'lTarget' samples. */ + ppe = energy; + ppi = buf+LPC_FILTERORDER+lMem-lTarget-1; + ppo = buf+LPC_FILTERORDER+lMem-1; + + *ppe=0.0; + pp=buf+LPC_FILTERORDER+lMem-lTarget; + for (j=0; j<lTarget; j++) { + *ppe+=(*pp)*(*pp); + ++pp; + } + + if (*ppe>0.0) { + invenergy[0] = (float) 1.0 / (*ppe + EPS); + } else { + invenergy[0] = (float) 0.0; + + + + + + } + ppe++; + + measure=(float)-10000000.0; + + if (crossDot > 0.0) { + measure = crossDot*crossDot*invenergy[0]; + } + } + else { + measure = crossDot*crossDot*invenergy[0]; + } + + /* check if measure is better */ + ftmp = crossDot*invenergy[0]; + + if ((measure>max_measure) && (fabs(ftmp)<CB_MAXGAIN)) { + best_index = 0; + max_measure = measure; + gain = ftmp; + } + + /* loop over the main first codebook section, + full search */ + + for (icount=1; icount<range; icount++) { + + /* calculate measure */ + + crossDot=0.0; + pp = buf+LPC_FILTERORDER+lMem-lTarget-icount; + + for (j=0; j<lTarget; j++) { + crossDot += target[j]*(*pp++); + } + + if (stage==0) { + *ppe++ = energy[icount-1] + (*ppi)*(*ppi) - + (*ppo)*(*ppo); + ppo--; + ppi--; + + if (energy[icount]>0.0) { + invenergy[icount] = + (float)1.0/(energy[icount]+EPS); + } else { + invenergy[icount] = (float) 0.0; + } + + + + + + measure=(float)-10000000.0; + + if (crossDot > 0.0) { + measure = crossDot*crossDot*invenergy[icount]; + } + } + else { + measure = crossDot*crossDot*invenergy[icount]; + } + + /* check if measure is better */ + ftmp = crossDot*invenergy[icount]; + + if ((measure>max_measure) && (fabs(ftmp)<CB_MAXGAIN)) { + best_index = icount; + max_measure = measure; + gain = ftmp; + } + } + + /* Loop over augmented part in the first codebook + * section, full search. + * The vectors are interpolated. + */ + + if (lTarget==SUBL) { + + /* Search for best possible cb vector and + compute the CB-vectors' energy. */ + searchAugmentedCB(20, 39, stage, base_size-lTarget/2, + target, buf+LPC_FILTERORDER+lMem, + &max_measure, &best_index, &gain, energy, + invenergy); + } + + /* set search range for following codebook sections */ + + base_index=best_index; + + /* unrestricted search */ + +# if CB_RESRANGE == -1 + //if (CB_RESRANGE == -1) { + sInd=0; + eInd=range-1; + sIndAug=20; + eIndAug=39; + //} + +# else + + /* restricted search around best index from first + codebook section */ + + //else { + /* Initialize search indices */ + sIndAug=0; + eIndAug=0; + sInd=base_index-CB_RESRANGE/2; + eInd=sInd+CB_RESRANGE; + + if (lTarget==SUBL) { + + if (sInd<0) { + + sIndAug = 40 + sInd; + eIndAug = 39; + sInd=0; + + } else if ( base_index < (base_size-20) ) { + + if (eInd > range) { + sInd -= (eInd-range); + eInd = range; + } + } else { /* base_index >= (base_size-20) */ + + if (sInd < (base_size-20)) { + sIndAug = 20; + sInd = 0; + eInd = 0; + eIndAug = 19 + CB_RESRANGE; + + if(eIndAug > 39) { + eInd = eIndAug-39; + eIndAug = 39; + } + } else { + sIndAug = 20 + sInd - (base_size-20); + eIndAug = 39; + sInd = 0; + eInd = CB_RESRANGE - (eIndAug-sIndAug+1); + } + } + + } else { /* lTarget = 22 or 23 */ + + if (sInd < 0) { + eInd -= sInd; + + + + + + sInd = 0; + } + + if(eInd > range) { + sInd -= (eInd - range); + eInd = range; + } + } + + //} +# endif /* CB_RESRANGE == -1 */ + + + /* search of higher codebook section */ + + /* index search range */ + counter = sInd; + sInd += base_size; + eInd += base_size; + + + if (stage==0) { + ppe = energy+base_size; + *ppe=0.0; + + pp=cbvectors+lMem-lTarget; + for (j=0; j<lTarget; j++) { + *ppe+=(*pp)*(*pp); + ++pp; + } + + ppi = cbvectors + lMem - 1 - lTarget; + ppo = cbvectors + lMem - 1; + + for (j=0; j<(range-1); j++) { + *(ppe+1) = *ppe + (*ppi)*(*ppi) - (*ppo)*(*ppo); + ppo--; + ppi--; + ppe++; + } + } + + /* loop over search range */ + + for (icount=sInd; icount<eInd; icount++) { + + /* calculate measure */ + + crossDot=0.0; + pp=cbvectors + lMem - (counter++) - lTarget; + + for (j=0;j<lTarget;j++) { + + + + + + crossDot += target[j]*(*pp++); + } + + if (energy[icount]>0.0) { + invenergy[icount] =(float)1.0/(energy[icount]+EPS); + } else { + invenergy[icount] =(float)0.0; + } + + if (stage==0) { + + measure=(float)-10000000.0; + + if (crossDot > 0.0) { + measure = crossDot*crossDot* + invenergy[icount]; + } + } + else { + measure = crossDot*crossDot*invenergy[icount]; + } + + /* check if measure is better */ + ftmp = crossDot*invenergy[icount]; + + if ((measure>max_measure) && (fabs(ftmp)<CB_MAXGAIN)) { + best_index = icount; + max_measure = measure; + gain = ftmp; + } + } + + /* Search the augmented CB inside the limited range. */ + + if ((lTarget==SUBL)&&(sIndAug!=0)) { + searchAugmentedCB(sIndAug, eIndAug, stage, + 2*base_size-20, target, cbvectors+lMem, + &max_measure, &best_index, &gain, energy, + invenergy); + } + + /* record best index */ + + index[stage] = best_index; + + /* gain quantization */ + + if (stage==0){ + + + + + + + if (gain<0.0){ + gain = 0.0; + } + + if (gain>CB_MAXGAIN) { + gain = (float)CB_MAXGAIN; + } + gain = gainquant(gain, 1.0, 32, &gain_index[stage]); + } + else { + if (stage==1) { + gain = gainquant(gain, (float)fabs(gains[stage-1]), + 16, &gain_index[stage]); + } else { + gain = gainquant(gain, (float)fabs(gains[stage-1]), + 8, &gain_index[stage]); + } + } + + /* Extract the best (according to measure) + codebook vector */ + + if (lTarget==(STATE_LEN-iLBCenc_inst->state_short_len)) { + + if (index[stage]<base_size) { + pp=buf+LPC_FILTERORDER+lMem-lTarget-index[stage]; + } else { + pp=cbvectors+lMem-lTarget- + index[stage]+base_size; + } + } else { + + if (index[stage]<base_size) { + if (index[stage]<(base_size-20)) { + pp=buf+LPC_FILTERORDER+lMem- + lTarget-index[stage]; + } else { + createAugmentedVec(index[stage]-base_size+40, + buf+LPC_FILTERORDER+lMem,aug_vec); + pp=aug_vec; + } + } else { + int filterno, position; + + filterno=index[stage]/base_size; + position=index[stage]-filterno*base_size; + + + + + + + + if (position<(base_size-20)) { + pp=cbvectors+filterno*lMem-lTarget- + index[stage]+filterno*base_size; + } else { + createAugmentedVec( + index[stage]-(filterno+1)*base_size+40, + cbvectors+filterno*lMem,aug_vec); + pp=aug_vec; + } + } + } + + /* Subtract the best codebook vector, according + to measure, from the target vector */ + + for (j=0;j<lTarget;j++) { + cvec[j] += gain*(*pp); + target[j] -= gain*(*pp++); + } + + /* record quantized gain */ + + gains[stage]=gain; + + }/* end of Main Loop. for (stage=0;... */ + + /* Gain adjustment for energy matching */ + cene=0.0; + for (i=0; i<lTarget; i++) { + cene+=cvec[i]*cvec[i]; + } + j=gain_index[0]; + + for (i=gain_index[0]; i<32; i++) { + ftmp=cene*gain_sq5Tbl[i]*gain_sq5Tbl[i]; + + if ((ftmp<(tene*gains[0]*gains[0])) && + (gain_sq5Tbl[j]<(2.0*gains[0]))) { + j=i; + } + } + gain_index[0]=j; + } + + + + + + + + + diff --git a/sflphone-common/libs/pjproject/third_party/ilbc/iCBSearch.h b/sflphone-common/libs/pjproject/third_party/ilbc/iCBSearch.h new file mode 100644 index 0000000000000000000000000000000000000000..a61db15403215beedc47ef0957d0b3f110432d19 --- /dev/null +++ b/sflphone-common/libs/pjproject/third_party/ilbc/iCBSearch.h @@ -0,0 +1,37 @@ + + /****************************************************************** + + iLBC Speech Coder ANSI-C Source Code + + iCBSearch.h + + Copyright (C) The Internet Society (2004). + All Rights Reserved. + + ******************************************************************/ + + #ifndef __iLBC_ICBSEARCH_H + #define __iLBC_ICBSEARCH_H + + + + + + + void iCBSearch( + iLBC_Enc_Inst_t *iLBCenc_inst, + /* (i) the encoder state structure */ + int *index, /* (o) Codebook indices */ + int *gain_index,/* (o) Gain quantization indices */ + float *intarget,/* (i) Target vector for encoding */ + float *mem, /* (i) Buffer for codebook construction */ + int lMem, /* (i) Length of buffer */ + int lTarget, /* (i) Length of vector */ + int nStages, /* (i) Number of codebook stages */ + float *weightDenum, /* (i) weighting filter coefficients */ + float *weightState, /* (i) weighting filter state */ + int block /* (i) the sub-block number */ + ); + + #endif + diff --git a/sflphone-common/libs/pjproject/third_party/ilbc/iLBC_decode.c b/sflphone-common/libs/pjproject/third_party/ilbc/iLBC_decode.c new file mode 100644 index 0000000000000000000000000000000000000000..33d3f740f45774227c2523760ddb2a28cdc1232d --- /dev/null +++ b/sflphone-common/libs/pjproject/third_party/ilbc/iLBC_decode.c @@ -0,0 +1,652 @@ + + /****************************************************************** + + iLBC Speech Coder ANSI-C Source Code + + iLBC_decode.c + + Copyright (C) The Internet Society (2004). + All Rights Reserved. + + ******************************************************************/ + + #include <math.h> + #include <stdlib.h> + + #include "iLBC_define.h" + #include "StateConstructW.h" + #include "LPCdecode.h" + #include "iCBConstruct.h" + #include "doCPLC.h" + #include "helpfun.h" + #include "constants.h" + #include "packing.h" + #include "string.h" + #include "enhancer.h" + #include "hpOutput.h" + #include "syntFilter.h" + + /*----------------------------------------------------------------* + * Initiation of decoder instance. + *---------------------------------------------------------------*/ + + short initDecode( /* (o) Number of decoded + samples */ + iLBC_Dec_Inst_t *iLBCdec_inst, /* (i/o) Decoder instance */ + int mode, /* (i) frame size mode */ + int use_enhancer /* (i) 1 to use enhancer + 0 to run without + enhancer */ + ){ + int i; + + iLBCdec_inst->mode = mode; + + + + + + if (mode==30) { + iLBCdec_inst->blockl = BLOCKL_30MS; + iLBCdec_inst->nsub = NSUB_30MS; + iLBCdec_inst->nasub = NASUB_30MS; + iLBCdec_inst->lpc_n = LPC_N_30MS; + iLBCdec_inst->no_of_bytes = NO_OF_BYTES_30MS; + iLBCdec_inst->no_of_words = NO_OF_WORDS_30MS; + iLBCdec_inst->state_short_len=STATE_SHORT_LEN_30MS; + /* ULP init */ + iLBCdec_inst->ULP_inst=&ULP_30msTbl; + } + else if (mode==20) { + iLBCdec_inst->blockl = BLOCKL_20MS; + iLBCdec_inst->nsub = NSUB_20MS; + iLBCdec_inst->nasub = NASUB_20MS; + iLBCdec_inst->lpc_n = LPC_N_20MS; + iLBCdec_inst->no_of_bytes = NO_OF_BYTES_20MS; + iLBCdec_inst->no_of_words = NO_OF_WORDS_20MS; + iLBCdec_inst->state_short_len=STATE_SHORT_LEN_20MS; + /* ULP init */ + iLBCdec_inst->ULP_inst=&ULP_20msTbl; + } + else { + exit(2); + } + + memset(iLBCdec_inst->syntMem, 0, + LPC_FILTERORDER*sizeof(float)); + memcpy((*iLBCdec_inst).lsfdeqold, lsfmeanTbl, + LPC_FILTERORDER*sizeof(float)); + + memset(iLBCdec_inst->old_syntdenum, 0, + ((LPC_FILTERORDER + 1)*NSUB_MAX)*sizeof(float)); + for (i=0; i<NSUB_MAX; i++) + iLBCdec_inst->old_syntdenum[i*(LPC_FILTERORDER+1)]=1.0; + + iLBCdec_inst->last_lag = 20; + + iLBCdec_inst->prevLag = 120; + iLBCdec_inst->per = 0.0; + iLBCdec_inst->consPLICount = 0; + iLBCdec_inst->prevPLI = 0; + iLBCdec_inst->prevLpc[0] = 1.0; + memset(iLBCdec_inst->prevLpc+1,0, + LPC_FILTERORDER*sizeof(float)); + memset(iLBCdec_inst->prevResidual, 0, BLOCKL_MAX*sizeof(float)); + iLBCdec_inst->seed=777; + + + + + + + memset(iLBCdec_inst->hpomem, 0, 4*sizeof(float)); + + iLBCdec_inst->use_enhancer = use_enhancer; + memset(iLBCdec_inst->enh_buf, 0, ENH_BUFL*sizeof(float)); + for (i=0;i<ENH_NBLOCKS_TOT;i++) + iLBCdec_inst->enh_period[i]=(float)40.0; + + iLBCdec_inst->prev_enh_pl = 0; + + return (short)(iLBCdec_inst->blockl); + } + + /*----------------------------------------------------------------* + * frame residual decoder function (subrutine to iLBC_decode) + *---------------------------------------------------------------*/ + + void Decode( + iLBC_Dec_Inst_t *iLBCdec_inst, /* (i/o) the decoder state + structure */ + float *decresidual, /* (o) decoded residual frame */ + int start, /* (i) location of start + state */ + int idxForMax, /* (i) codebook index for the + maximum value */ + int *idxVec, /* (i) codebook indexes for the + samples in the start + state */ + float *syntdenum, /* (i) the decoded synthesis + filter coefficients */ + int *cb_index, /* (i) the indexes for the + adaptive codebook */ + int *gain_index, /* (i) the indexes for the + corresponding gains */ + int *extra_cb_index, /* (i) the indexes for the + adaptive codebook part + of start state */ + int *extra_gain_index, /* (i) the indexes for the + corresponding gains */ + int state_first /* (i) 1 if non adaptive part + of start state comes + first 0 if that part + comes last */ + ){ + float reverseDecresidual[BLOCKL_MAX], mem[CB_MEML]; + int k, meml_gotten, Nfor, Nback, i; + int diff, start_pos; + int subcount, subframe; + + + + + + + diff = STATE_LEN - iLBCdec_inst->state_short_len; + + if (state_first == 1) { + start_pos = (start-1)*SUBL; + } else { + start_pos = (start-1)*SUBL + diff; + } + + /* decode scalar part of start state */ + + StateConstructW(idxForMax, idxVec, + &syntdenum[(start-1)*(LPC_FILTERORDER+1)], + &decresidual[start_pos], iLBCdec_inst->state_short_len); + + + if (state_first) { /* put adaptive part in the end */ + + /* setup memory */ + + memset(mem, 0, + (CB_MEML-iLBCdec_inst->state_short_len)*sizeof(float)); + memcpy(mem+CB_MEML-iLBCdec_inst->state_short_len, + decresidual+start_pos, + iLBCdec_inst->state_short_len*sizeof(float)); + + /* construct decoded vector */ + + iCBConstruct( + &decresidual[start_pos+iLBCdec_inst->state_short_len], + extra_cb_index, extra_gain_index, mem+CB_MEML-stMemLTbl, + stMemLTbl, diff, CB_NSTAGES); + + } + else {/* put adaptive part in the beginning */ + + /* create reversed vectors for prediction */ + + for (k=0; k<diff; k++) { + reverseDecresidual[k] = + decresidual[(start+1)*SUBL-1- + (k+iLBCdec_inst->state_short_len)]; + } + + /* setup memory */ + + meml_gotten = iLBCdec_inst->state_short_len; + for (k=0; k<meml_gotten; k++){ + mem[CB_MEML-1-k] = decresidual[start_pos + k]; + + + + + + } + memset(mem, 0, (CB_MEML-k)*sizeof(float)); + + /* construct decoded vector */ + + iCBConstruct(reverseDecresidual, extra_cb_index, + extra_gain_index, mem+CB_MEML-stMemLTbl, stMemLTbl, + diff, CB_NSTAGES); + + /* get decoded residual from reversed vector */ + + for (k=0; k<diff; k++) { + decresidual[start_pos-1-k] = reverseDecresidual[k]; + } + } + + /* counter for predicted sub-frames */ + + subcount=0; + + /* forward prediction of sub-frames */ + + Nfor = iLBCdec_inst->nsub-start-1; + + if ( Nfor > 0 ){ + + /* setup memory */ + + memset(mem, 0, (CB_MEML-STATE_LEN)*sizeof(float)); + memcpy(mem+CB_MEML-STATE_LEN, decresidual+(start-1)*SUBL, + STATE_LEN*sizeof(float)); + + /* loop over sub-frames to encode */ + + for (subframe=0; subframe<Nfor; subframe++) { + + /* construct decoded vector */ + + iCBConstruct(&decresidual[(start+1+subframe)*SUBL], + cb_index+subcount*CB_NSTAGES, + gain_index+subcount*CB_NSTAGES, + mem+CB_MEML-memLfTbl[subcount], + memLfTbl[subcount], SUBL, CB_NSTAGES); + + /* update memory */ + + memcpy(mem, mem+SUBL, (CB_MEML-SUBL)*sizeof(float)); + memcpy(mem+CB_MEML-SUBL, + + + + + + &decresidual[(start+1+subframe)*SUBL], + SUBL*sizeof(float)); + + subcount++; + + } + + } + + /* backward prediction of sub-frames */ + + Nback = start-1; + + if ( Nback > 0 ) { + + /* setup memory */ + + meml_gotten = SUBL*(iLBCdec_inst->nsub+1-start); + + if ( meml_gotten > CB_MEML ) { + meml_gotten=CB_MEML; + } + for (k=0; k<meml_gotten; k++) { + mem[CB_MEML-1-k] = decresidual[(start-1)*SUBL + k]; + } + memset(mem, 0, (CB_MEML-k)*sizeof(float)); + + /* loop over subframes to decode */ + + for (subframe=0; subframe<Nback; subframe++) { + + /* construct decoded vector */ + + iCBConstruct(&reverseDecresidual[subframe*SUBL], + cb_index+subcount*CB_NSTAGES, + gain_index+subcount*CB_NSTAGES, + mem+CB_MEML-memLfTbl[subcount], memLfTbl[subcount], + SUBL, CB_NSTAGES); + + /* update memory */ + + memcpy(mem, mem+SUBL, (CB_MEML-SUBL)*sizeof(float)); + memcpy(mem+CB_MEML-SUBL, + &reverseDecresidual[subframe*SUBL], + SUBL*sizeof(float)); + + subcount++; + } + + + + + + /* get decoded residual from reversed vector */ + + for (i=0; i<SUBL*Nback; i++) + decresidual[SUBL*Nback - i - 1] = + reverseDecresidual[i]; + } + } + + /*----------------------------------------------------------------* + * main decoder function + *---------------------------------------------------------------*/ + + void iLBC_decode( + float *decblock, /* (o) decoded signal block */ + unsigned char *bytes, /* (i) encoded signal bits */ + iLBC_Dec_Inst_t *iLBCdec_inst, /* (i/o) the decoder state + structure */ + int mode /* (i) 0: bad packet, PLC, + 1: normal */ + ){ + float data[BLOCKL_MAX]; + float lsfdeq[LPC_FILTERORDER*LPC_N_MAX]; + float PLCresidual[BLOCKL_MAX], PLClpc[LPC_FILTERORDER + 1]; + float zeros[BLOCKL_MAX], one[LPC_FILTERORDER + 1]; + int k, i, start, idxForMax, pos, lastpart, ulp; + int lag, ilag; + float cc, maxcc; + int idxVec[STATE_LEN]; + int check; + int gain_index[NASUB_MAX*CB_NSTAGES], + extra_gain_index[CB_NSTAGES]; + int cb_index[CB_NSTAGES*NASUB_MAX], extra_cb_index[CB_NSTAGES]; + int lsf_i[LSF_NSPLIT*LPC_N_MAX]; + int state_first; + int last_bit; + unsigned char *pbytes; + float weightdenum[(LPC_FILTERORDER + 1)*NSUB_MAX]; + int order_plus_one; + float syntdenum[NSUB_MAX*(LPC_FILTERORDER+1)]; + float decresidual[BLOCKL_MAX]; + + if (mode>0) { /* the data are good */ + + /* decode data */ + + pbytes=bytes; + pos=0; + + + + + + + /* Set everything to zero before decoding */ + + for (k=0; k<LSF_NSPLIT*LPC_N_MAX; k++) { + lsf_i[k]=0; + } + start=0; + state_first=0; + idxForMax=0; + for (k=0; k<iLBCdec_inst->state_short_len; k++) { + idxVec[k]=0; + } + for (k=0; k<CB_NSTAGES; k++) { + extra_cb_index[k]=0; + } + for (k=0; k<CB_NSTAGES; k++) { + extra_gain_index[k]=0; + } + for (i=0; i<iLBCdec_inst->nasub; i++) { + for (k=0; k<CB_NSTAGES; k++) { + cb_index[i*CB_NSTAGES+k]=0; + } + } + for (i=0; i<iLBCdec_inst->nasub; i++) { + for (k=0; k<CB_NSTAGES; k++) { + gain_index[i*CB_NSTAGES+k]=0; + } + } + + /* loop over ULP classes */ + + for (ulp=0; ulp<3; ulp++) { + + /* LSF */ + for (k=0; k<LSF_NSPLIT*iLBCdec_inst->lpc_n; k++){ + unpack( &pbytes, &lastpart, + iLBCdec_inst->ULP_inst->lsf_bits[k][ulp], &pos); + packcombine(&lsf_i[k], lastpart, + iLBCdec_inst->ULP_inst->lsf_bits[k][ulp]); + } + + /* Start block info */ + + unpack( &pbytes, &lastpart, + iLBCdec_inst->ULP_inst->start_bits[ulp], &pos); + packcombine(&start, lastpart, + iLBCdec_inst->ULP_inst->start_bits[ulp]); + + unpack( &pbytes, &lastpart, + + + + + + iLBCdec_inst->ULP_inst->startfirst_bits[ulp], &pos); + packcombine(&state_first, lastpart, + iLBCdec_inst->ULP_inst->startfirst_bits[ulp]); + + unpack( &pbytes, &lastpart, + iLBCdec_inst->ULP_inst->scale_bits[ulp], &pos); + packcombine(&idxForMax, lastpart, + iLBCdec_inst->ULP_inst->scale_bits[ulp]); + + for (k=0; k<iLBCdec_inst->state_short_len; k++) { + unpack( &pbytes, &lastpart, + iLBCdec_inst->ULP_inst->state_bits[ulp], &pos); + packcombine(idxVec+k, lastpart, + iLBCdec_inst->ULP_inst->state_bits[ulp]); + } + + /* 23/22 (20ms/30ms) sample block */ + + for (k=0; k<CB_NSTAGES; k++) { + unpack( &pbytes, &lastpart, + iLBCdec_inst->ULP_inst->extra_cb_index[k][ulp], + &pos); + packcombine(extra_cb_index+k, lastpart, + iLBCdec_inst->ULP_inst->extra_cb_index[k][ulp]); + } + for (k=0; k<CB_NSTAGES; k++) { + unpack( &pbytes, &lastpart, + iLBCdec_inst->ULP_inst->extra_cb_gain[k][ulp], + &pos); + packcombine(extra_gain_index+k, lastpart, + iLBCdec_inst->ULP_inst->extra_cb_gain[k][ulp]); + } + + /* The two/four (20ms/30ms) 40 sample sub-blocks */ + + for (i=0; i<iLBCdec_inst->nasub; i++) { + for (k=0; k<CB_NSTAGES; k++) { + unpack( &pbytes, &lastpart, + iLBCdec_inst->ULP_inst->cb_index[i][k][ulp], + &pos); + packcombine(cb_index+i*CB_NSTAGES+k, lastpart, + iLBCdec_inst->ULP_inst->cb_index[i][k][ulp]); + } + } + + for (i=0; i<iLBCdec_inst->nasub; i++) { + for (k=0; k<CB_NSTAGES; k++) { + unpack( &pbytes, &lastpart, + + + + + + iLBCdec_inst->ULP_inst->cb_gain[i][k][ulp], + &pos); + packcombine(gain_index+i*CB_NSTAGES+k, lastpart, + iLBCdec_inst->ULP_inst->cb_gain[i][k][ulp]); + } + } + } + /* Extract last bit. If it is 1 this indicates an + empty/lost frame */ + unpack( &pbytes, &last_bit, 1, &pos); + + /* Check for bit errors or empty/lost frames */ + if (start<1) + mode = 0; + if (iLBCdec_inst->mode==20 && start>3) + mode = 0; + if (iLBCdec_inst->mode==30 && start>5) + mode = 0; + if (last_bit==1) + mode = 0; + + if (mode==1) { /* No bit errors was detected, + continue decoding */ + + /* adjust index */ + index_conv_dec(cb_index); + + /* decode the lsf */ + + SimplelsfDEQ(lsfdeq, lsf_i, iLBCdec_inst->lpc_n); + check=LSF_check(lsfdeq, LPC_FILTERORDER, + iLBCdec_inst->lpc_n); + DecoderInterpolateLSF(syntdenum, weightdenum, + lsfdeq, LPC_FILTERORDER, iLBCdec_inst); + + Decode(iLBCdec_inst, decresidual, start, idxForMax, + idxVec, syntdenum, cb_index, gain_index, + extra_cb_index, extra_gain_index, + state_first); + + /* preparing the plc for a future loss! */ + + doThePLC(PLCresidual, PLClpc, 0, decresidual, + syntdenum + + (LPC_FILTERORDER + 1)*(iLBCdec_inst->nsub - 1), + (*iLBCdec_inst).last_lag, iLBCdec_inst); + + + + + + + + memcpy(decresidual, PLCresidual, + iLBCdec_inst->blockl*sizeof(float)); + } + + } + + if (mode == 0) { + /* the data is bad (either a PLC call + * was made or a severe bit error was detected) + */ + + /* packet loss conceal */ + + memset(zeros, 0, BLOCKL_MAX*sizeof(float)); + + one[0] = 1; + memset(one+1, 0, LPC_FILTERORDER*sizeof(float)); + + start=0; + + doThePLC(PLCresidual, PLClpc, 1, zeros, one, + (*iLBCdec_inst).last_lag, iLBCdec_inst); + memcpy(decresidual, PLCresidual, + iLBCdec_inst->blockl*sizeof(float)); + + order_plus_one = LPC_FILTERORDER + 1; + for (i = 0; i < iLBCdec_inst->nsub; i++) { + memcpy(syntdenum+(i*order_plus_one), PLClpc, + order_plus_one*sizeof(float)); + } + } + + if (iLBCdec_inst->use_enhancer == 1) { + + /* post filtering */ + + iLBCdec_inst->last_lag = + enhancerInterface(data, decresidual, iLBCdec_inst); + + /* synthesis filtering */ + + if (iLBCdec_inst->mode==20) { + /* Enhancer has 40 samples delay */ + i=0; + syntFilter(data + i*SUBL, + iLBCdec_inst->old_syntdenum + + (i+iLBCdec_inst->nsub-1)*(LPC_FILTERORDER+1), + SUBL, iLBCdec_inst->syntMem); + + + + + + for (i=1; i < iLBCdec_inst->nsub; i++) { + syntFilter(data + i*SUBL, + syntdenum + (i-1)*(LPC_FILTERORDER+1), + SUBL, iLBCdec_inst->syntMem); + } + } else if (iLBCdec_inst->mode==30) { + /* Enhancer has 80 samples delay */ + for (i=0; i < 2; i++) { + syntFilter(data + i*SUBL, + iLBCdec_inst->old_syntdenum + + (i+iLBCdec_inst->nsub-2)*(LPC_FILTERORDER+1), + SUBL, iLBCdec_inst->syntMem); + } + for (i=2; i < iLBCdec_inst->nsub; i++) { + syntFilter(data + i*SUBL, + syntdenum + (i-2)*(LPC_FILTERORDER+1), SUBL, + iLBCdec_inst->syntMem); + } + } + + } else { + + /* Find last lag */ + lag = 20; + maxcc = xCorrCoef(&decresidual[BLOCKL_MAX-ENH_BLOCKL], + &decresidual[BLOCKL_MAX-ENH_BLOCKL-lag], ENH_BLOCKL); + + for (ilag=21; ilag<120; ilag++) { + cc = xCorrCoef(&decresidual[BLOCKL_MAX-ENH_BLOCKL], + &decresidual[BLOCKL_MAX-ENH_BLOCKL-ilag], + ENH_BLOCKL); + + if (cc > maxcc) { + maxcc = cc; + lag = ilag; + } + } + iLBCdec_inst->last_lag = lag; + + /* copy data and run synthesis filter */ + + memcpy(data, decresidual, + iLBCdec_inst->blockl*sizeof(float)); + for (i=0; i < iLBCdec_inst->nsub; i++) { + syntFilter(data + i*SUBL, + syntdenum + i*(LPC_FILTERORDER+1), SUBL, + iLBCdec_inst->syntMem); + } + + + + + + } + + /* high pass filtering on output if desired, otherwise + copy to out */ + + hpOutput(data, iLBCdec_inst->blockl, + decblock,iLBCdec_inst->hpomem); + + /* memcpy(decblock,data,iLBCdec_inst->blockl*sizeof(float));*/ + + memcpy(iLBCdec_inst->old_syntdenum, syntdenum, + + iLBCdec_inst->nsub*(LPC_FILTERORDER+1)*sizeof(float)); + + iLBCdec_inst->prev_enh_pl=0; + + if (mode==0) { /* PLC was used */ + iLBCdec_inst->prev_enh_pl=1; + } + } + diff --git a/sflphone-common/libs/pjproject/third_party/ilbc/iLBC_decode.h b/sflphone-common/libs/pjproject/third_party/ilbc/iLBC_decode.h new file mode 100644 index 0000000000000000000000000000000000000000..5f4384dcde8fc9400ccab82ae7df7cd010a0191a --- /dev/null +++ b/sflphone-common/libs/pjproject/third_party/ilbc/iLBC_decode.h @@ -0,0 +1,42 @@ + + /****************************************************************** + + iLBC Speech Coder ANSI-C Source Code + + iLBC_decode.h + + Copyright (C) The Internet Society (2004). + All Rights Reserved. + + ******************************************************************/ + + #ifndef __iLBC_ILBCDECODE_H + #define __iLBC_ILBCDECODE_H + + #include "iLBC_define.h" + + short initDecode( /* (o) Number of decoded + samples */ + iLBC_Dec_Inst_t *iLBCdec_inst, /* (i/o) Decoder instance */ + int mode, /* (i) frame size mode */ + int use_enhancer /* (i) 1 to use enhancer + 0 to run without + enhancer */ + ); + + void iLBC_decode( + float *decblock, /* (o) decoded signal block */ + unsigned char *bytes, /* (i) encoded signal bits */ + iLBC_Dec_Inst_t *iLBCdec_inst, /* (i/o) the decoder state + structure */ + int mode /* (i) 0: bad packet, PLC, + 1: normal */ + + + + + + ); + + #endif + diff --git a/sflphone-common/libs/pjproject/third_party/ilbc/iLBC_define.h b/sflphone-common/libs/pjproject/third_party/ilbc/iLBC_define.h new file mode 100644 index 0000000000000000000000000000000000000000..480c834b97c36d9fe0685bf57e337b532d7700a3 --- /dev/null +++ b/sflphone-common/libs/pjproject/third_party/ilbc/iLBC_define.h @@ -0,0 +1,217 @@ + + /****************************************************************** + + iLBC Speech Coder ANSI-C Source Code + + iLBC_define.h + + Copyright (C) The Internet Society (2004). + All Rights Reserved. + + ******************************************************************/ + #include <string.h> + + #ifndef __iLBC_ILBCDEFINE_H + #define __iLBC_ILBCDEFINE_H + + /* general codec settings */ + + #define FS (float)8000.0 + #define BLOCKL_20MS 160 + #define BLOCKL_30MS 240 + #define BLOCKL_MAX 240 + #define NSUB_20MS 4 + #define NSUB_30MS 6 + #define NSUB_MAX 6 + #define NASUB_20MS 2 + + + + + + #define NASUB_30MS 4 + #define NASUB_MAX 4 + #define SUBL 40 + #define STATE_LEN 80 + #define STATE_SHORT_LEN_30MS 58 + #define STATE_SHORT_LEN_20MS 57 + + /* LPC settings */ + + #define LPC_FILTERORDER 10 + #define LPC_CHIRP_SYNTDENUM (float)0.9025 + #define LPC_CHIRP_WEIGHTDENUM (float)0.4222 + #define LPC_LOOKBACK 60 + #define LPC_N_20MS 1 + #define LPC_N_30MS 2 + #define LPC_N_MAX 2 + #define LPC_ASYMDIFF 20 + #define LPC_BW (float)60.0 + #define LPC_WN (float)1.0001 + #define LSF_NSPLIT 3 + #define LSF_NUMBER_OF_STEPS 4 + #define LPC_HALFORDER (LPC_FILTERORDER/2) + + /* cb settings */ + + #define CB_NSTAGES 3 + #define CB_EXPAND 2 + #define CB_MEML 147 + #define CB_FILTERLEN 2*4 + #define CB_HALFFILTERLEN 4 + #define CB_RESRANGE 34 + #define CB_MAXGAIN (float)1.3 + + /* enhancer */ + + #define ENH_BLOCKL 80 /* block length */ + #define ENH_BLOCKL_HALF (ENH_BLOCKL/2) + #define ENH_HL 3 /* 2*ENH_HL+1 is number blocks + in said second sequence */ + #define ENH_SLOP 2 /* max difference estimated and + correct pitch period */ + #define ENH_PLOCSL 20 /* pitch-estimates and pitch- + locations buffer length */ + #define ENH_OVERHANG 2 + #define ENH_UPS0 4 /* upsampling rate */ + #define ENH_FL0 3 /* 2*FLO+1 is the length of + each filter */ + #define ENH_VECTL (ENH_BLOCKL+2*ENH_FL0) + + + + + + #define ENH_CORRDIM (2*ENH_SLOP+1) + #define ENH_NBLOCKS (BLOCKL_MAX/ENH_BLOCKL) + #define ENH_NBLOCKS_EXTRA 5 + #define ENH_NBLOCKS_TOT 8 /* ENH_NBLOCKS + + ENH_NBLOCKS_EXTRA */ + #define ENH_BUFL (ENH_NBLOCKS_TOT)*ENH_BLOCKL + #define ENH_ALPHA0 (float)0.05 + + /* Down sampling */ + + #define FILTERORDER_DS 7 + #define DELAY_DS 3 + #define FACTOR_DS 2 + + /* bit stream defs */ + + #define NO_OF_BYTES_20MS 38 + #define NO_OF_BYTES_30MS 50 + #define NO_OF_WORDS_20MS 19 + #define NO_OF_WORDS_30MS 25 + #define STATE_BITS 3 + #define BYTE_LEN 8 + #define ULP_CLASSES 3 + + /* help parameters */ + + #define FLOAT_MAX (float)1.0e37 + #define EPS (float)2.220446049250313e-016 + #define PI (float)3.14159265358979323846 + #define MIN_SAMPLE -32768 + #define MAX_SAMPLE 32767 + #define TWO_PI (float)6.283185307 + #define PI2 (float)0.159154943 + + /* type definition encoder instance */ + typedef struct iLBC_ULP_Inst_t_ { + int lsf_bits[6][ULP_CLASSES+2]; + int start_bits[ULP_CLASSES+2]; + int startfirst_bits[ULP_CLASSES+2]; + int scale_bits[ULP_CLASSES+2]; + int state_bits[ULP_CLASSES+2]; + int extra_cb_index[CB_NSTAGES][ULP_CLASSES+2]; + int extra_cb_gain[CB_NSTAGES][ULP_CLASSES+2]; + int cb_index[NSUB_MAX][CB_NSTAGES][ULP_CLASSES+2]; + int cb_gain[NSUB_MAX][CB_NSTAGES][ULP_CLASSES+2]; + } iLBC_ULP_Inst_t; + + /* type definition encoder instance */ + + + + + + typedef struct iLBC_Enc_Inst_t_ { + + /* flag for frame size mode */ + int mode; + + /* basic parameters for different frame sizes */ + int blockl; + int nsub; + int nasub; + int no_of_bytes, no_of_words; + int lpc_n; + int state_short_len; + const iLBC_ULP_Inst_t *ULP_inst; + + /* analysis filter state */ + float anaMem[LPC_FILTERORDER]; + + /* old lsf parameters for interpolation */ + float lsfold[LPC_FILTERORDER]; + float lsfdeqold[LPC_FILTERORDER]; + + /* signal buffer for LP analysis */ + float lpc_buffer[LPC_LOOKBACK + BLOCKL_MAX]; + + /* state of input HP filter */ + float hpimem[4]; + + } iLBC_Enc_Inst_t; + + /* type definition decoder instance */ + typedef struct iLBC_Dec_Inst_t_ { + + /* flag for frame size mode */ + int mode; + + /* basic parameters for different frame sizes */ + int blockl; + int nsub; + int nasub; + int no_of_bytes, no_of_words; + int lpc_n; + int state_short_len; + const iLBC_ULP_Inst_t *ULP_inst; + + /* synthesis filter state */ + float syntMem[LPC_FILTERORDER]; + + /* old LSF for interpolation */ + + + + + + float lsfdeqold[LPC_FILTERORDER]; + + /* pitch lag estimated in enhancer and used in PLC */ + int last_lag; + + /* PLC state information */ + int prevLag, consPLICount, prevPLI, prev_enh_pl; + float prevLpc[LPC_FILTERORDER+1]; + float prevResidual[NSUB_MAX*SUBL]; + float per; + unsigned long seed; + + /* previous synthesis filter parameters */ + float old_syntdenum[(LPC_FILTERORDER + 1)*NSUB_MAX]; + + /* state of output HP filter */ + float hpomem[4]; + + /* enhancer state information */ + int use_enhancer; + float enh_buf[ENH_BUFL]; + float enh_period[ENH_NBLOCKS_TOT]; + + } iLBC_Dec_Inst_t; + + #endif + diff --git a/sflphone-common/libs/pjproject/third_party/ilbc/iLBC_encode.c b/sflphone-common/libs/pjproject/third_party/ilbc/iLBC_encode.c new file mode 100644 index 0000000000000000000000000000000000000000..438545883df2e0540e5558686005f502c518a4d9 --- /dev/null +++ b/sflphone-common/libs/pjproject/third_party/ilbc/iLBC_encode.c @@ -0,0 +1,543 @@ + + /****************************************************************** + + iLBC Speech Coder ANSI-C Source Code + + iLBC_encode.c + + Copyright (C) The Internet Society (2004). + All Rights Reserved. + + ******************************************************************/ + + #include <math.h> + #include <stdlib.h> + #include <string.h> + + #include "iLBC_define.h" + #include "LPCencode.h" + #include "FrameClassify.h" + #include "StateSearchW.h" + #include "StateConstructW.h" + #include "helpfun.h" + #include "constants.h" + #include "packing.h" + #include "iCBSearch.h" + #include "iCBConstruct.h" + #include "hpInput.h" + #include "anaFilter.h" + #include "syntFilter.h" + + /*----------------------------------------------------------------* + * Initiation of encoder instance. + *---------------------------------------------------------------*/ + + short initEncode( /* (o) Number of bytes + encoded */ + iLBC_Enc_Inst_t *iLBCenc_inst, /* (i/o) Encoder instance */ + int mode /* (i) frame size mode */ + ){ + iLBCenc_inst->mode = mode; + if (mode==30) { + iLBCenc_inst->blockl = BLOCKL_30MS; + iLBCenc_inst->nsub = NSUB_30MS; + iLBCenc_inst->nasub = NASUB_30MS; + iLBCenc_inst->lpc_n = LPC_N_30MS; + iLBCenc_inst->no_of_bytes = NO_OF_BYTES_30MS; + iLBCenc_inst->no_of_words = NO_OF_WORDS_30MS; + + + + + + iLBCenc_inst->state_short_len=STATE_SHORT_LEN_30MS; + /* ULP init */ + iLBCenc_inst->ULP_inst=&ULP_30msTbl; + } + else if (mode==20) { + iLBCenc_inst->blockl = BLOCKL_20MS; + iLBCenc_inst->nsub = NSUB_20MS; + iLBCenc_inst->nasub = NASUB_20MS; + iLBCenc_inst->lpc_n = LPC_N_20MS; + iLBCenc_inst->no_of_bytes = NO_OF_BYTES_20MS; + iLBCenc_inst->no_of_words = NO_OF_WORDS_20MS; + iLBCenc_inst->state_short_len=STATE_SHORT_LEN_20MS; + /* ULP init */ + iLBCenc_inst->ULP_inst=&ULP_20msTbl; + } + else { + exit(2); + } + + memset((*iLBCenc_inst).anaMem, 0, + LPC_FILTERORDER*sizeof(float)); + memcpy((*iLBCenc_inst).lsfold, lsfmeanTbl, + LPC_FILTERORDER*sizeof(float)); + memcpy((*iLBCenc_inst).lsfdeqold, lsfmeanTbl, + LPC_FILTERORDER*sizeof(float)); + memset((*iLBCenc_inst).lpc_buffer, 0, + (LPC_LOOKBACK+BLOCKL_MAX)*sizeof(float)); + memset((*iLBCenc_inst).hpimem, 0, 4*sizeof(float)); + + return (short)(iLBCenc_inst->no_of_bytes); + } + + /*----------------------------------------------------------------* + * main encoder function + *---------------------------------------------------------------*/ + + void iLBC_encode( + unsigned char *bytes, /* (o) encoded data bits iLBC */ + float *block, /* (o) speech vector to + encode */ + iLBC_Enc_Inst_t *iLBCenc_inst /* (i/o) the general encoder + state */ + ){ + + float data[BLOCKL_MAX]; + float residual[BLOCKL_MAX], reverseResidual[BLOCKL_MAX]; + + int start, idxForMax, idxVec[STATE_LEN]; + + + + + + float reverseDecresidual[BLOCKL_MAX], mem[CB_MEML]; + int n, k, meml_gotten, Nfor, Nback, i, pos; + int gain_index[CB_NSTAGES*NASUB_MAX], + extra_gain_index[CB_NSTAGES]; + int cb_index[CB_NSTAGES*NASUB_MAX],extra_cb_index[CB_NSTAGES]; + int lsf_i[LSF_NSPLIT*LPC_N_MAX]; + unsigned char *pbytes; + int diff, start_pos, state_first; + float en1, en2; + int index, ulp, firstpart; + int subcount, subframe; + float weightState[LPC_FILTERORDER]; + float syntdenum[NSUB_MAX*(LPC_FILTERORDER+1)]; + float weightdenum[NSUB_MAX*(LPC_FILTERORDER+1)]; + float decresidual[BLOCKL_MAX]; + + /* high pass filtering of input signal if such is not done + prior to calling this function */ + + hpInput(block, iLBCenc_inst->blockl, + data, (*iLBCenc_inst).hpimem); + + /* otherwise simply copy */ + + /*memcpy(data,block,iLBCenc_inst->blockl*sizeof(float));*/ + + /* LPC of hp filtered input data */ + + LPCencode(syntdenum, weightdenum, lsf_i, data, iLBCenc_inst); + + + /* inverse filter to get residual */ + + for (n=0; n<iLBCenc_inst->nsub; n++) { + anaFilter(&data[n*SUBL], &syntdenum[n*(LPC_FILTERORDER+1)], + SUBL, &residual[n*SUBL], iLBCenc_inst->anaMem); + } + + /* find state location */ + + start = FrameClassify(iLBCenc_inst, residual); + + /* check if state should be in first or last part of the + two subframes */ + + diff = STATE_LEN - iLBCenc_inst->state_short_len; + en1 = 0; + index = (start-1)*SUBL; + + + + + + for (i = 0; i < iLBCenc_inst->state_short_len; i++) { + en1 += residual[index+i]*residual[index+i]; + } + en2 = 0; + index = (start-1)*SUBL+diff; + for (i = 0; i < iLBCenc_inst->state_short_len; i++) { + en2 += residual[index+i]*residual[index+i]; + } + + + if (en1 > en2) { + state_first = 1; + start_pos = (start-1)*SUBL; + } else { + state_first = 0; + start_pos = (start-1)*SUBL + diff; + } + + /* scalar quantization of state */ + + StateSearchW(iLBCenc_inst, &residual[start_pos], + &syntdenum[(start-1)*(LPC_FILTERORDER+1)], + &weightdenum[(start-1)*(LPC_FILTERORDER+1)], &idxForMax, + idxVec, iLBCenc_inst->state_short_len, state_first); + + StateConstructW(idxForMax, idxVec, + &syntdenum[(start-1)*(LPC_FILTERORDER+1)], + &decresidual[start_pos], iLBCenc_inst->state_short_len); + + /* predictive quantization in state */ + + if (state_first) { /* put adaptive part in the end */ + + /* setup memory */ + + memset(mem, 0, + (CB_MEML-iLBCenc_inst->state_short_len)*sizeof(float)); + memcpy(mem+CB_MEML-iLBCenc_inst->state_short_len, + decresidual+start_pos, + iLBCenc_inst->state_short_len*sizeof(float)); + memset(weightState, 0, LPC_FILTERORDER*sizeof(float)); + + /* encode sub-frames */ + + iCBSearch(iLBCenc_inst, extra_cb_index, extra_gain_index, + &residual[start_pos+iLBCenc_inst->state_short_len], + mem+CB_MEML-stMemLTbl, + stMemLTbl, diff, CB_NSTAGES, + + + + + + &weightdenum[start*(LPC_FILTERORDER+1)], + weightState, 0); + + /* construct decoded vector */ + + iCBConstruct( + &decresidual[start_pos+iLBCenc_inst->state_short_len], + extra_cb_index, extra_gain_index, + mem+CB_MEML-stMemLTbl, + stMemLTbl, diff, CB_NSTAGES); + + } + else { /* put adaptive part in the beginning */ + + /* create reversed vectors for prediction */ + + for (k=0; k<diff; k++) { + reverseResidual[k] = residual[(start+1)*SUBL-1 + -(k+iLBCenc_inst->state_short_len)]; + } + + /* setup memory */ + + meml_gotten = iLBCenc_inst->state_short_len; + for (k=0; k<meml_gotten; k++) { + mem[CB_MEML-1-k] = decresidual[start_pos + k]; + } + memset(mem, 0, (CB_MEML-k)*sizeof(float)); + memset(weightState, 0, LPC_FILTERORDER*sizeof(float)); + + /* encode sub-frames */ + + iCBSearch(iLBCenc_inst, extra_cb_index, extra_gain_index, + reverseResidual, mem+CB_MEML-stMemLTbl, stMemLTbl, + diff, CB_NSTAGES, + &weightdenum[(start-1)*(LPC_FILTERORDER+1)], + weightState, 0); + + /* construct decoded vector */ + + iCBConstruct(reverseDecresidual, extra_cb_index, + extra_gain_index, mem+CB_MEML-stMemLTbl, stMemLTbl, + diff, CB_NSTAGES); + + /* get decoded residual from reversed vector */ + + for (k=0; k<diff; k++) { + decresidual[start_pos-1-k] = reverseDecresidual[k]; + + + + + + } + } + + /* counter for predicted sub-frames */ + + subcount=0; + + /* forward prediction of sub-frames */ + + Nfor = iLBCenc_inst->nsub-start-1; + + + if ( Nfor > 0 ) { + + /* setup memory */ + + memset(mem, 0, (CB_MEML-STATE_LEN)*sizeof(float)); + memcpy(mem+CB_MEML-STATE_LEN, decresidual+(start-1)*SUBL, + STATE_LEN*sizeof(float)); + memset(weightState, 0, LPC_FILTERORDER*sizeof(float)); + + /* loop over sub-frames to encode */ + + for (subframe=0; subframe<Nfor; subframe++) { + + /* encode sub-frame */ + + iCBSearch(iLBCenc_inst, cb_index+subcount*CB_NSTAGES, + gain_index+subcount*CB_NSTAGES, + &residual[(start+1+subframe)*SUBL], + mem+CB_MEML-memLfTbl[subcount], + memLfTbl[subcount], SUBL, CB_NSTAGES, + &weightdenum[(start+1+subframe)* + (LPC_FILTERORDER+1)], + weightState, subcount+1); + + /* construct decoded vector */ + + iCBConstruct(&decresidual[(start+1+subframe)*SUBL], + cb_index+subcount*CB_NSTAGES, + gain_index+subcount*CB_NSTAGES, + mem+CB_MEML-memLfTbl[subcount], + memLfTbl[subcount], SUBL, CB_NSTAGES); + + /* update memory */ + + memcpy(mem, mem+SUBL, (CB_MEML-SUBL)*sizeof(float)); + memcpy(mem+CB_MEML-SUBL, + + + + + + &decresidual[(start+1+subframe)*SUBL], + SUBL*sizeof(float)); + memset(weightState, 0, LPC_FILTERORDER*sizeof(float)); + + subcount++; + } + } + + + /* backward prediction of sub-frames */ + + Nback = start-1; + + + if ( Nback > 0 ) { + + /* create reverse order vectors */ + + for (n=0; n<Nback; n++) { + for (k=0; k<SUBL; k++) { + reverseResidual[n*SUBL+k] = + residual[(start-1)*SUBL-1-n*SUBL-k]; + reverseDecresidual[n*SUBL+k] = + decresidual[(start-1)*SUBL-1-n*SUBL-k]; + } + } + + /* setup memory */ + + meml_gotten = SUBL*(iLBCenc_inst->nsub+1-start); + + + if ( meml_gotten > CB_MEML ) { + meml_gotten=CB_MEML; + } + for (k=0; k<meml_gotten; k++) { + mem[CB_MEML-1-k] = decresidual[(start-1)*SUBL + k]; + } + memset(mem, 0, (CB_MEML-k)*sizeof(float)); + memset(weightState, 0, LPC_FILTERORDER*sizeof(float)); + + /* loop over sub-frames to encode */ + + for (subframe=0; subframe<Nback; subframe++) { + + /* encode sub-frame */ + + iCBSearch(iLBCenc_inst, cb_index+subcount*CB_NSTAGES, + + + + + + gain_index+subcount*CB_NSTAGES, + &reverseResidual[subframe*SUBL], + mem+CB_MEML-memLfTbl[subcount], + memLfTbl[subcount], SUBL, CB_NSTAGES, + &weightdenum[(start-2-subframe)* + (LPC_FILTERORDER+1)], + weightState, subcount+1); + + /* construct decoded vector */ + + iCBConstruct(&reverseDecresidual[subframe*SUBL], + cb_index+subcount*CB_NSTAGES, + gain_index+subcount*CB_NSTAGES, + mem+CB_MEML-memLfTbl[subcount], + memLfTbl[subcount], SUBL, CB_NSTAGES); + + /* update memory */ + + memcpy(mem, mem+SUBL, (CB_MEML-SUBL)*sizeof(float)); + memcpy(mem+CB_MEML-SUBL, + &reverseDecresidual[subframe*SUBL], + SUBL*sizeof(float)); + memset(weightState, 0, LPC_FILTERORDER*sizeof(float)); + + subcount++; + + } + + /* get decoded residual from reversed vector */ + + for (i=0; i<SUBL*Nback; i++) { + decresidual[SUBL*Nback - i - 1] = + reverseDecresidual[i]; + } + } + /* end encoding part */ + + /* adjust index */ + index_conv_enc(cb_index); + + /* pack bytes */ + + pbytes=bytes; + pos=0; + + /* loop over the 3 ULP classes */ + + for (ulp=0; ulp<3; ulp++) { + + + + + + + /* LSF */ + for (k=0; k<LSF_NSPLIT*iLBCenc_inst->lpc_n; k++) { + packsplit(&lsf_i[k], &firstpart, &lsf_i[k], + iLBCenc_inst->ULP_inst->lsf_bits[k][ulp], + iLBCenc_inst->ULP_inst->lsf_bits[k][ulp]+ + iLBCenc_inst->ULP_inst->lsf_bits[k][ulp+1]+ + iLBCenc_inst->ULP_inst->lsf_bits[k][ulp+2]); + dopack( &pbytes, firstpart, + iLBCenc_inst->ULP_inst->lsf_bits[k][ulp], &pos); + } + + /* Start block info */ + + packsplit(&start, &firstpart, &start, + iLBCenc_inst->ULP_inst->start_bits[ulp], + iLBCenc_inst->ULP_inst->start_bits[ulp]+ + iLBCenc_inst->ULP_inst->start_bits[ulp+1]+ + iLBCenc_inst->ULP_inst->start_bits[ulp+2]); + dopack( &pbytes, firstpart, + iLBCenc_inst->ULP_inst->start_bits[ulp], &pos); + + packsplit(&state_first, &firstpart, &state_first, + iLBCenc_inst->ULP_inst->startfirst_bits[ulp], + iLBCenc_inst->ULP_inst->startfirst_bits[ulp]+ + iLBCenc_inst->ULP_inst->startfirst_bits[ulp+1]+ + iLBCenc_inst->ULP_inst->startfirst_bits[ulp+2]); + dopack( &pbytes, firstpart, + iLBCenc_inst->ULP_inst->startfirst_bits[ulp], &pos); + + packsplit(&idxForMax, &firstpart, &idxForMax, + iLBCenc_inst->ULP_inst->scale_bits[ulp], + iLBCenc_inst->ULP_inst->scale_bits[ulp]+ + iLBCenc_inst->ULP_inst->scale_bits[ulp+1]+ + iLBCenc_inst->ULP_inst->scale_bits[ulp+2]); + dopack( &pbytes, firstpart, + iLBCenc_inst->ULP_inst->scale_bits[ulp], &pos); + + for (k=0; k<iLBCenc_inst->state_short_len; k++) { + packsplit(idxVec+k, &firstpart, idxVec+k, + iLBCenc_inst->ULP_inst->state_bits[ulp], + iLBCenc_inst->ULP_inst->state_bits[ulp]+ + iLBCenc_inst->ULP_inst->state_bits[ulp+1]+ + iLBCenc_inst->ULP_inst->state_bits[ulp+2]); + dopack( &pbytes, firstpart, + iLBCenc_inst->ULP_inst->state_bits[ulp], &pos); + } + + + + + + + /* 23/22 (20ms/30ms) sample block */ + + for (k=0;k<CB_NSTAGES;k++) { + packsplit(extra_cb_index+k, &firstpart, + extra_cb_index+k, + iLBCenc_inst->ULP_inst->extra_cb_index[k][ulp], + iLBCenc_inst->ULP_inst->extra_cb_index[k][ulp]+ + iLBCenc_inst->ULP_inst->extra_cb_index[k][ulp+1]+ + iLBCenc_inst->ULP_inst->extra_cb_index[k][ulp+2]); + dopack( &pbytes, firstpart, + iLBCenc_inst->ULP_inst->extra_cb_index[k][ulp], + &pos); + } + + for (k=0;k<CB_NSTAGES;k++) { + packsplit(extra_gain_index+k, &firstpart, + extra_gain_index+k, + iLBCenc_inst->ULP_inst->extra_cb_gain[k][ulp], + iLBCenc_inst->ULP_inst->extra_cb_gain[k][ulp]+ + iLBCenc_inst->ULP_inst->extra_cb_gain[k][ulp+1]+ + iLBCenc_inst->ULP_inst->extra_cb_gain[k][ulp+2]); + dopack( &pbytes, firstpart, + iLBCenc_inst->ULP_inst->extra_cb_gain[k][ulp], + &pos); + } + + /* The two/four (20ms/30ms) 40 sample sub-blocks */ + + for (i=0; i<iLBCenc_inst->nasub; i++) { + for (k=0; k<CB_NSTAGES; k++) { + packsplit(cb_index+i*CB_NSTAGES+k, &firstpart, + cb_index+i*CB_NSTAGES+k, + iLBCenc_inst->ULP_inst->cb_index[i][k][ulp], + iLBCenc_inst->ULP_inst->cb_index[i][k][ulp]+ + iLBCenc_inst->ULP_inst->cb_index[i][k][ulp+1]+ + iLBCenc_inst->ULP_inst->cb_index[i][k][ulp+2]); + dopack( &pbytes, firstpart, + iLBCenc_inst->ULP_inst->cb_index[i][k][ulp], + &pos); + } + } + + for (i=0; i<iLBCenc_inst->nasub; i++) { + for (k=0; k<CB_NSTAGES; k++) { + packsplit(gain_index+i*CB_NSTAGES+k, &firstpart, + gain_index+i*CB_NSTAGES+k, + iLBCenc_inst->ULP_inst->cb_gain[i][k][ulp], + iLBCenc_inst->ULP_inst->cb_gain[i][k][ulp]+ + + + + + + iLBCenc_inst->ULP_inst->cb_gain[i][k][ulp+1]+ + iLBCenc_inst->ULP_inst->cb_gain[i][k][ulp+2]); + dopack( &pbytes, firstpart, + iLBCenc_inst->ULP_inst->cb_gain[i][k][ulp], + &pos); + } + } + } + + /* set the last bit to zero (otherwise the decoder + will treat it as a lost frame) */ + dopack( &pbytes, 0, 1, &pos); + } + diff --git a/sflphone-common/libs/pjproject/third_party/ilbc/iLBC_encode.h b/sflphone-common/libs/pjproject/third_party/ilbc/iLBC_encode.h new file mode 100644 index 0000000000000000000000000000000000000000..a3ab55f9dcea93d6a5379933adbd4d092c7d2687 --- /dev/null +++ b/sflphone-common/libs/pjproject/third_party/ilbc/iLBC_encode.h @@ -0,0 +1,39 @@ + + /****************************************************************** + + iLBC Speech Coder ANSI-C Source Code + + iLBC_encode.h + + Copyright (C) The Internet Society (2004). + All Rights Reserved. + + ******************************************************************/ + + #ifndef __iLBC_ILBCENCODE_H + #define __iLBC_ILBCENCODE_H + + #include "iLBC_define.h" + + short initEncode( /* (o) Number of bytes + encoded */ + iLBC_Enc_Inst_t *iLBCenc_inst, /* (i/o) Encoder instance */ + int mode /* (i) frame size mode */ + ); + + void iLBC_encode( + + unsigned char *bytes, /* (o) encoded data bits iLBC */ + float *block, /* (o) speech vector to + encode */ + iLBC_Enc_Inst_t *iLBCenc_inst /* (i/o) the general encoder + state */ + ); + + #endif + + + + + + diff --git a/sflphone-common/libs/pjproject/third_party/ilbc/iLBC_test.c b/sflphone-common/libs/pjproject/third_party/ilbc/iLBC_test.c new file mode 100644 index 0000000000000000000000000000000000000000..81985c09a518bc6a4a390672b082f13231e3fecb --- /dev/null +++ b/sflphone-common/libs/pjproject/third_party/ilbc/iLBC_test.c @@ -0,0 +1,310 @@ + + /****************************************************************** + + iLBC Speech Coder ANSI-C Source Code + + iLBC_test.c + + Copyright (C) The Internet Society (2004). + All Rights Reserved. + + ******************************************************************/ + + #include <math.h> + #include <stdlib.h> + #include <stdio.h> + #include <string.h> + #include "iLBC_define.h" + #include "iLBC_encode.h" + #include "iLBC_decode.h" + + /* Runtime statistics */ + #include <time.h> + + #define ILBCNOOFWORDS_MAX (NO_OF_BYTES_30MS/2) + + /*----------------------------------------------------------------* + * Encoder interface function + + + + + + *---------------------------------------------------------------*/ + + short encode( /* (o) Number of bytes encoded */ + iLBC_Enc_Inst_t *iLBCenc_inst, + /* (i/o) Encoder instance */ + short *encoded_data, /* (o) The encoded bytes */ + short *data /* (i) The signal block to encode*/ + ){ + float block[BLOCKL_MAX]; + int k; + + /* convert signal to float */ + + for (k=0; k<iLBCenc_inst->blockl; k++) + block[k] = (float)data[k]; + + /* do the actual encoding */ + + iLBC_encode((unsigned char *)encoded_data, block, iLBCenc_inst); + + + return (iLBCenc_inst->no_of_bytes); + } + + /*----------------------------------------------------------------* + * Decoder interface function + *---------------------------------------------------------------*/ + + short decode( /* (o) Number of decoded samples */ + iLBC_Dec_Inst_t *iLBCdec_inst, /* (i/o) Decoder instance */ + short *decoded_data, /* (o) Decoded signal block*/ + short *encoded_data, /* (i) Encoded bytes */ + short mode /* (i) 0=PL, 1=Normal */ + ){ + int k; + float decblock[BLOCKL_MAX], dtmp; + + /* check if mode is valid */ + + if (mode<0 || mode>1) { + printf("\nERROR - Wrong mode - 0, 1 allowed\n"); exit(3);} + + /* do actual decoding of block */ + + iLBC_decode(decblock, (unsigned char *)encoded_data, + iLBCdec_inst, mode); + + /* convert to short */ + + + + + + for (k=0; k<iLBCdec_inst->blockl; k++){ + dtmp=decblock[k]; + + if (dtmp<MIN_SAMPLE) + dtmp=MIN_SAMPLE; + else if (dtmp>MAX_SAMPLE) + dtmp=MAX_SAMPLE; + decoded_data[k] = (short) dtmp; + } + + return (iLBCdec_inst->blockl); + } + + /*---------------------------------------------------------------* + * Main program to test iLBC encoding and decoding + * + * Usage: + * exefile_name.exe <infile> <bytefile> <outfile> <channel> + * + * <infile> : Input file, speech for encoder (16-bit pcm file) + * <bytefile> : Bit stream output from the encoder + * <outfile> : Output file, decoded speech (16-bit pcm file) + * <channel> : Bit error file, optional (16-bit) + * 1 - Packet received correctly + * 0 - Packet Lost + * + *--------------------------------------------------------------*/ + + int main(int argc, char* argv[]) + { + + /* Runtime statistics */ + + float starttime; + float runtime; + float outtime; + + FILE *ifileid,*efileid,*ofileid, *cfileid; + short data[BLOCKL_MAX]; + short encoded_data[ILBCNOOFWORDS_MAX], decoded_data[BLOCKL_MAX]; + int len; + short pli, mode; + int blockcount = 0; + int packetlosscount = 0; + + /* Create structs */ + iLBC_Enc_Inst_t Enc_Inst; + iLBC_Dec_Inst_t Dec_Inst; + + + + + + /* get arguments and open files */ + + if ((argc!=5) && (argc!=6)) { + fprintf(stderr, + "\n*-----------------------------------------------*\n"); + fprintf(stderr, + " %s <20,30> input encoded decoded (channel)\n\n", + argv[0]); + fprintf(stderr, + " mode : Frame size for the encoding/decoding\n"); + fprintf(stderr, + " 20 - 20 ms\n"); + fprintf(stderr, + " 30 - 30 ms\n"); + fprintf(stderr, + " input : Speech for encoder (16-bit pcm file)\n"); + fprintf(stderr, + " encoded : Encoded bit stream\n"); + fprintf(stderr, + " decoded : Decoded speech (16-bit pcm file)\n"); + fprintf(stderr, + " channel : Packet loss pattern, optional (16-bit)\n"); + fprintf(stderr, + " 1 - Packet received correctly\n"); + fprintf(stderr, + " 0 - Packet Lost\n"); + fprintf(stderr, + "*-----------------------------------------------*\n\n"); + exit(1); + } + mode=atoi(argv[1]); + if (mode != 20 && mode != 30) { + fprintf(stderr,"Wrong mode %s, must be 20, or 30\n", + argv[1]); + exit(2); + } + if ( (ifileid=fopen(argv[2],"rb")) == NULL) { + fprintf(stderr,"Cannot open input file %s\n", argv[2]); + exit(2);} + if ( (efileid=fopen(argv[3],"wb")) == NULL) { + fprintf(stderr, "Cannot open encoded file %s\n", + argv[3]); exit(1);} + if ( (ofileid=fopen(argv[4],"wb")) == NULL) { + fprintf(stderr, "Cannot open decoded file %s\n", + argv[4]); exit(1);} + if (argc==6) { + if( (cfileid=fopen(argv[5],"rb")) == NULL) { + fprintf(stderr, "Cannot open channel file %s\n", + + + + + + argv[5]); + exit(1); + } + } else { + cfileid=NULL; + } + + /* print info */ + + fprintf(stderr, "\n"); + fprintf(stderr, + "*---------------------------------------------------*\n"); + fprintf(stderr, + "* *\n"); + fprintf(stderr, + "* iLBC test program *\n"); + fprintf(stderr, + "* *\n"); + fprintf(stderr, + "* *\n"); + fprintf(stderr, + "*---------------------------------------------------*\n"); + fprintf(stderr,"\nMode : %2d ms\n", mode); + fprintf(stderr,"Input file : %s\n", argv[2]); + fprintf(stderr,"Encoded file : %s\n", argv[3]); + fprintf(stderr,"Output file : %s\n", argv[4]); + if (argc==6) { + fprintf(stderr,"Channel file : %s\n", argv[5]); + } + fprintf(stderr,"\n"); + + /* Initialization */ + + initEncode(&Enc_Inst, mode); + initDecode(&Dec_Inst, mode, 1); + + /* Runtime statistics */ + + starttime=clock()/(float)CLOCKS_PER_SEC; + + /* loop over input blocks */ + + while (fread(data,sizeof(short),Enc_Inst.blockl,ifileid)== + (size_t)Enc_Inst.blockl) { + + blockcount++; + + /* encoding */ + + + + + + fprintf(stderr, "--- Encoding block %i --- ",blockcount); + len=encode(&Enc_Inst, encoded_data, data); + fprintf(stderr, "\r"); + + /* write byte file */ + + fwrite(encoded_data, sizeof(unsigned char), len, efileid); + + /* get channel data if provided */ + if (argc==6) { + if (fread(&pli, sizeof(short), 1, cfileid)) { + if ((pli!=0)&&(pli!=1)) { + fprintf(stderr, "Error in channel file\n"); + exit(0); + } + if (pli==0) { + /* Packet loss -> remove info from frame */ + memset(encoded_data, 0, + sizeof(short)*ILBCNOOFWORDS_MAX); + packetlosscount++; + } + } else { + fprintf(stderr, "Error. Channel file too short\n"); + exit(0); + } + } else { + pli=1; + } + + /* decoding */ + + fprintf(stderr, "--- Decoding block %i --- ",blockcount); + + len=decode(&Dec_Inst, decoded_data, encoded_data, pli); + fprintf(stderr, "\r"); + + /* write output file */ + + fwrite(decoded_data,sizeof(short),len,ofileid); + } + + /* Runtime statistics */ + + runtime = (float)(clock()/(float)CLOCKS_PER_SEC-starttime); + outtime = (float)((float)blockcount*(float)mode/1000.0); + printf("\n\nLength of speech file: %.1f s\n", outtime); + printf("Packet loss : %.1f%%\n", + 100.0*(float)packetlosscount/(float)blockcount); + + + + + + printf("Time to run iLBC :"); + printf(" %.1f s (%.1f %% of realtime)\n\n", runtime, + (100*runtime/outtime)); + + /* close files */ + + fclose(ifileid); fclose(efileid); fclose(ofileid); + if (argc==6) { + fclose(cfileid); + } + return(0); + } + diff --git a/sflphone-common/libs/pjproject/third_party/ilbc/lsf.c b/sflphone-common/libs/pjproject/third_party/ilbc/lsf.c new file mode 100644 index 0000000000000000000000000000000000000000..b4fe0eda3de10394e21f49209f7342d049a3f386 --- /dev/null +++ b/sflphone-common/libs/pjproject/third_party/ilbc/lsf.c @@ -0,0 +1,283 @@ + + /****************************************************************** + + iLBC Speech Coder ANSI-C Source Code + + lsf.c + + Copyright (C) The Internet Society (2004). + All Rights Reserved. + + ******************************************************************/ + + #include <string.h> + + + + + + #include <math.h> + + #include "iLBC_define.h" + + /*----------------------------------------------------------------* + * conversion from lpc coefficients to lsf coefficients + *---------------------------------------------------------------*/ + + void a2lsf( + float *freq,/* (o) lsf coefficients */ + float *a /* (i) lpc coefficients */ + ){ + float steps[LSF_NUMBER_OF_STEPS] = + {(float)0.00635, (float)0.003175, (float)0.0015875, + (float)0.00079375}; + float step; + int step_idx; + int lsp_index; + float p[LPC_HALFORDER]; + float q[LPC_HALFORDER]; + float p_pre[LPC_HALFORDER]; + float q_pre[LPC_HALFORDER]; + float old_p, old_q, *old; + float *pq_coef; + float omega, old_omega; + int i; + float hlp, hlp1, hlp2, hlp3, hlp4, hlp5; + + for (i=0; i<LPC_HALFORDER; i++) { + p[i] = (float)-1.0 * (a[i + 1] + a[LPC_FILTERORDER - i]); + q[i] = a[LPC_FILTERORDER - i] - a[i + 1]; + } + + p_pre[0] = (float)-1.0 - p[0]; + p_pre[1] = - p_pre[0] - p[1]; + p_pre[2] = - p_pre[1] - p[2]; + p_pre[3] = - p_pre[2] - p[3]; + p_pre[4] = - p_pre[3] - p[4]; + p_pre[4] = p_pre[4] / 2; + + q_pre[0] = (float)1.0 - q[0]; + q_pre[1] = q_pre[0] - q[1]; + q_pre[2] = q_pre[1] - q[2]; + q_pre[3] = q_pre[2] - q[3]; + q_pre[4] = q_pre[3] - q[4]; + q_pre[4] = q_pre[4] / 2; + + omega = 0.0; + + + + + + old_omega = 0.0; + + old_p = FLOAT_MAX; + old_q = FLOAT_MAX; + + /* Here we loop through lsp_index to find all the + LPC_FILTERORDER roots for omega. */ + + for (lsp_index = 0; lsp_index<LPC_FILTERORDER; lsp_index++) { + + /* Depending on lsp_index being even or odd, we + alternatively solve the roots for the two LSP equations. */ + + + if ((lsp_index & 0x1) == 0) { + pq_coef = p_pre; + old = &old_p; + } else { + pq_coef = q_pre; + old = &old_q; + } + + /* Start with low resolution grid */ + + for (step_idx = 0, step = steps[step_idx]; + step_idx < LSF_NUMBER_OF_STEPS;){ + + /* cos(10piw) + pq(0)cos(8piw) + pq(1)cos(6piw) + + pq(2)cos(4piw) + pq(3)cod(2piw) + pq(4) */ + + hlp = (float)cos(omega * TWO_PI); + hlp1 = (float)2.0 * hlp + pq_coef[0]; + hlp2 = (float)2.0 * hlp * hlp1 - (float)1.0 + + pq_coef[1]; + hlp3 = (float)2.0 * hlp * hlp2 - hlp1 + pq_coef[2]; + hlp4 = (float)2.0 * hlp * hlp3 - hlp2 + pq_coef[3]; + hlp5 = hlp * hlp4 - hlp3 + pq_coef[4]; + + + if (((hlp5 * (*old)) <= 0.0) || (omega >= 0.5)){ + + if (step_idx == (LSF_NUMBER_OF_STEPS - 1)){ + + if (fabs(hlp5) >= fabs(*old)) { + freq[lsp_index] = omega - step; + } else { + freq[lsp_index] = omega; + } + + + + + + + + if ((*old) >= 0.0){ + *old = (float)-1.0 * FLOAT_MAX; + } else { + *old = FLOAT_MAX; + } + + omega = old_omega; + step_idx = 0; + + step_idx = LSF_NUMBER_OF_STEPS; + } else { + + if (step_idx == 0) { + old_omega = omega; + } + + step_idx++; + omega -= steps[step_idx]; + + /* Go back one grid step */ + + step = steps[step_idx]; + } + } else { + + /* increment omega until they are of different sign, + and we know there is at least one root between omega + and old_omega */ + *old = hlp5; + omega += step; + } + } + } + + for (i = 0; i<LPC_FILTERORDER; i++) { + freq[i] = freq[i] * TWO_PI; + } + } + + /*----------------------------------------------------------------* + * conversion from lsf coefficients to lpc coefficients + *---------------------------------------------------------------*/ + + void lsf2a( + float *a_coef, /* (o) lpc coefficients */ + float *freq /* (i) lsf coefficients */ + + + + + + ){ + int i, j; + float hlp; + float p[LPC_HALFORDER], q[LPC_HALFORDER]; + float a[LPC_HALFORDER + 1], a1[LPC_HALFORDER], + a2[LPC_HALFORDER]; + float b[LPC_HALFORDER + 1], b1[LPC_HALFORDER], + b2[LPC_HALFORDER]; + + for (i=0; i<LPC_FILTERORDER; i++) { + freq[i] = freq[i] * PI2; + } + + /* Check input for ill-conditioned cases. This part is not + found in the TIA standard. It involves the following 2 IF + blocks. If "freq" is judged ill-conditioned, then we first + modify freq[0] and freq[LPC_HALFORDER-1] (normally + LPC_HALFORDER = 10 for LPC applications), then we adjust + the other "freq" values slightly */ + + + if ((freq[0] <= 0.0) || (freq[LPC_FILTERORDER - 1] >= 0.5)){ + + + if (freq[0] <= 0.0) { + freq[0] = (float)0.022; + } + + + if (freq[LPC_FILTERORDER - 1] >= 0.5) { + freq[LPC_FILTERORDER - 1] = (float)0.499; + } + + hlp = (freq[LPC_FILTERORDER - 1] - freq[0]) / + (float) (LPC_FILTERORDER - 1); + + for (i=1; i<LPC_FILTERORDER; i++) { + freq[i] = freq[i - 1] + hlp; + } + } + + memset(a1, 0, LPC_HALFORDER*sizeof(float)); + memset(a2, 0, LPC_HALFORDER*sizeof(float)); + memset(b1, 0, LPC_HALFORDER*sizeof(float)); + memset(b2, 0, LPC_HALFORDER*sizeof(float)); + memset(a, 0, (LPC_HALFORDER+1)*sizeof(float)); + memset(b, 0, (LPC_HALFORDER+1)*sizeof(float)); + + + + + + + /* p[i] and q[i] compute cos(2*pi*omega_{2j}) and + cos(2*pi*omega_{2j-1} in eqs. 4.2.2.2-1 and 4.2.2.2-2. + Note that for this code p[i] specifies the coefficients + used in .Q_A(z) while q[i] specifies the coefficients used + in .P_A(z) */ + + for (i=0; i<LPC_HALFORDER; i++) { + p[i] = (float)cos(TWO_PI * freq[2 * i]); + q[i] = (float)cos(TWO_PI * freq[2 * i + 1]); + } + + a[0] = 0.25; + b[0] = 0.25; + + for (i= 0; i<LPC_HALFORDER; i++) { + a[i + 1] = a[i] - 2 * p[i] * a1[i] + a2[i]; + b[i + 1] = b[i] - 2 * q[i] * b1[i] + b2[i]; + a2[i] = a1[i]; + a1[i] = a[i]; + b2[i] = b1[i]; + b1[i] = b[i]; + } + + for (j=0; j<LPC_FILTERORDER; j++) { + + if (j == 0) { + a[0] = 0.25; + b[0] = -0.25; + } else { + a[0] = b[0] = 0.0; + } + + for (i=0; i<LPC_HALFORDER; i++) { + a[i + 1] = a[i] - 2 * p[i] * a1[i] + a2[i]; + b[i + 1] = b[i] - 2 * q[i] * b1[i] + b2[i]; + a2[i] = a1[i]; + a1[i] = a[i]; + b2[i] = b1[i]; + b1[i] = b[i]; + } + + a_coef[j + 1] = 2 * (a[LPC_HALFORDER] + b[LPC_HALFORDER]); + } + + a_coef[0] = 1.0; + } + + + + + + + diff --git a/sflphone-common/libs/pjproject/third_party/ilbc/lsf.h b/sflphone-common/libs/pjproject/third_party/ilbc/lsf.h new file mode 100644 index 0000000000000000000000000000000000000000..caff77ec0d6fd3428297f5fd07efa98b23788088 --- /dev/null +++ b/sflphone-common/libs/pjproject/third_party/ilbc/lsf.h @@ -0,0 +1,27 @@ + + /****************************************************************** + + iLBC Speech Coder ANSI-C Source Code + + lsf.h + + Copyright (C) The Internet Society (2004). + All Rights Reserved. + + ******************************************************************/ + + #ifndef __iLBC_LSF_H + #define __iLBC_LSF_H + + void a2lsf( + float *freq,/* (o) lsf coefficients */ + float *a /* (i) lpc coefficients */ + ); + + void lsf2a( + float *a_coef, /* (o) lpc coefficients */ + float *freq /* (i) lsf coefficients */ + ); + + #endif + diff --git a/sflphone-common/libs/pjproject/third_party/ilbc/packing.c b/sflphone-common/libs/pjproject/third_party/ilbc/packing.c new file mode 100644 index 0000000000000000000000000000000000000000..b7496a48eaa72f3034e53936a7d022be12fc79e7 --- /dev/null +++ b/sflphone-common/libs/pjproject/third_party/ilbc/packing.c @@ -0,0 +1,182 @@ + + /****************************************************************** + + iLBC Speech Coder ANSI-C Source Code + + packing.c + + Copyright (C) The Internet Society (2004). + All Rights Reserved. + + ******************************************************************/ + + #include <math.h> + #include <stdlib.h> + + #include "iLBC_define.h" + #include "constants.h" + #include "helpfun.h" + #include "string.h" + + /*----------------------------------------------------------------* + * splitting an integer into first most significant bits and + * remaining least significant bits + *---------------------------------------------------------------*/ + + void packsplit( + int *index, /* (i) the value to split */ + int *firstpart, /* (o) the value specified by most + significant bits */ + int *rest, /* (o) the value specified by least + significant bits */ + + + + + + int bitno_firstpart, /* (i) number of bits in most + significant part */ + int bitno_total /* (i) number of bits in full range + of value */ + ){ + int bitno_rest = bitno_total-bitno_firstpart; + + *firstpart = *index>>(bitno_rest); + *rest = *index-(*firstpart<<(bitno_rest)); + } + + /*----------------------------------------------------------------* + * combining a value corresponding to msb's with a value + * corresponding to lsb's + *---------------------------------------------------------------*/ + + void packcombine( + int *index, /* (i/o) the msb value in the + combined value out */ + int rest, /* (i) the lsb value */ + int bitno_rest /* (i) the number of bits in the + lsb part */ + ){ + *index = *index<<bitno_rest; + *index += rest; + } + + /*----------------------------------------------------------------* + * packing of bits into bitstream, i.e., vector of bytes + *---------------------------------------------------------------*/ + + void dopack( + unsigned char **bitstream, /* (i/o) on entrance pointer to + place in bitstream to pack + new data, on exit pointer + to place in bitstream to + pack future data */ + int index, /* (i) the value to pack */ + int bitno, /* (i) the number of bits that the + value will fit within */ + int *pos /* (i/o) write position in the + current byte */ + ){ + int posLeft; + + /* Clear the bits before starting in a new byte */ + + if ((*pos)==0) { + + + + + + **bitstream=0; + } + + while (bitno>0) { + + /* Jump to the next byte if end of this byte is reached*/ + + if (*pos==8) { + *pos=0; + (*bitstream)++; + **bitstream=0; + } + + posLeft=8-(*pos); + + /* Insert index into the bitstream */ + + if (bitno <= posLeft) { + **bitstream |= (unsigned char)(index<<(posLeft-bitno)); + *pos+=bitno; + bitno=0; + } else { + **bitstream |= (unsigned char)(index>>(bitno-posLeft)); + + *pos=8; + index-=((index>>(bitno-posLeft))<<(bitno-posLeft)); + + bitno-=posLeft; + } + } + } + + /*----------------------------------------------------------------* + * unpacking of bits from bitstream, i.e., vector of bytes + *---------------------------------------------------------------*/ + + void unpack( + unsigned char **bitstream, /* (i/o) on entrance pointer to + place in bitstream to + unpack new data from, on + exit pointer to place in + bitstream to unpack future + data from */ + int *index, /* (o) resulting value */ + int bitno, /* (i) number of bits used to + represent the value */ + int *pos /* (i/o) read position in the + current byte */ + + + + + + ){ + int BitsLeft; + + *index=0; + + while (bitno>0) { + + /* move forward in bitstream when the end of the + byte is reached */ + + if (*pos==8) { + *pos=0; + (*bitstream)++; + } + + BitsLeft=8-(*pos); + + /* Extract bits to index */ + + if (BitsLeft>=bitno) { + *index+=((((**bitstream)<<(*pos)) & 0xFF)>>(8-bitno)); + + *pos+=bitno; + bitno=0; + } else { + + if ((8-bitno)>0) { + *index+=((((**bitstream)<<(*pos)) & 0xFF)>> + (8-bitno)); + *pos=8; + } else { + *index+=(((int)(((**bitstream)<<(*pos)) & 0xFF))<< + (bitno-8)); + *pos=8; + } + bitno-=BitsLeft; + } + } + } + diff --git a/sflphone-common/libs/pjproject/third_party/ilbc/packing.h b/sflphone-common/libs/pjproject/third_party/ilbc/packing.h new file mode 100644 index 0000000000000000000000000000000000000000..cbb9f82dfd24411a2edc41c843b2f4f9ad046e23 --- /dev/null +++ b/sflphone-common/libs/pjproject/third_party/ilbc/packing.h @@ -0,0 +1,68 @@ + + /****************************************************************** + + iLBC Speech Coder ANSI-C Source Code + + packing.h + + Copyright (C) The Internet Society (2004). + All Rights Reserved. + + ******************************************************************/ + + #ifndef __PACKING_H + #define __PACKING_H + + void packsplit( + int *index, /* (i) the value to split */ + int *firstpart, /* (o) the value specified by most + significant bits */ + int *rest, /* (o) the value specified by least + significant bits */ + int bitno_firstpart, /* (i) number of bits in most + significant part */ + int bitno_total /* (i) number of bits in full range + of value */ + ); + + void packcombine( + int *index, /* (i/o) the msb value in the + combined value out */ + int rest, /* (i) the lsb value */ + int bitno_rest /* (i) the number of bits in the + lsb part */ + ); + + void dopack( + unsigned char **bitstream, /* (i/o) on entrance pointer to + place in bitstream to pack + new data, on exit pointer + to place in bitstream to + pack future data */ + int index, /* (i) the value to pack */ + int bitno, /* (i) the number of bits that the + value will fit within */ + int *pos /* (i/o) write position in the + current byte */ + ); + + + + + + void unpack( + unsigned char **bitstream, /* (i/o) on entrance pointer to + place in bitstream to + unpack new data from, on + exit pointer to place in + bitstream to unpack future + data from */ + int *index, /* (o) resulting value */ + int bitno, /* (i) number of bits used to + represent the value */ + int *pos /* (i/o) read position in the + current byte */ + ); + + #endif + diff --git a/sflphone-common/libs/pjproject/third_party/ilbc/syntFilter.c b/sflphone-common/libs/pjproject/third_party/ilbc/syntFilter.c new file mode 100644 index 0000000000000000000000000000000000000000..190eb009db7029d1cc5bfe8740d5fe153c0d5da0 --- /dev/null +++ b/sflphone-common/libs/pjproject/third_party/ilbc/syntFilter.c @@ -0,0 +1,80 @@ + + /****************************************************************** + + iLBC Speech Coder ANSI-C Source Code + + syntFilter.c + + Copyright (C) The Internet Society (2004). + All Rights Reserved. + + ******************************************************************/ + + #include "iLBC_define.h" + + /*----------------------------------------------------------------* + * LP synthesis filter. + *---------------------------------------------------------------*/ + + void syntFilter( + float *Out, /* (i/o) Signal to be filtered */ + float *a, /* (i) LP parameters */ + int len, /* (i) Length of signal */ + + + + + + float *mem /* (i/o) Filter state */ + ){ + int i, j; + float *po, *pi, *pa, *pm; + + po=Out; + + /* Filter first part using memory from past */ + + for (i=0; i<LPC_FILTERORDER; i++) { + pi=&Out[i-1]; + pa=&a[1]; + pm=&mem[LPC_FILTERORDER-1]; + for (j=1; j<=i; j++) { + *po-=(*pa++)*(*pi--); + } + for (j=i+1; j<LPC_FILTERORDER+1; j++) { + *po-=(*pa++)*(*pm--); + } + po++; + } + + /* Filter last part where the state is entirely in + the output vector */ + + for (i=LPC_FILTERORDER; i<len; i++) { + pi=&Out[i-1]; + pa=&a[1]; + for (j=1; j<LPC_FILTERORDER+1; j++) { + *po-=(*pa++)*(*pi--); + } + po++; + } + + /* Update state vector */ + + memcpy(mem, &Out[len-LPC_FILTERORDER], + LPC_FILTERORDER*sizeof(float)); + } + + + + + + + + + + + + + + diff --git a/sflphone-common/libs/pjproject/third_party/ilbc/syntFilter.h b/sflphone-common/libs/pjproject/third_party/ilbc/syntFilter.h new file mode 100644 index 0000000000000000000000000000000000000000..8865b8917fa97c43326ab1d908ea3a13c68fbddb --- /dev/null +++ b/sflphone-common/libs/pjproject/third_party/ilbc/syntFilter.h @@ -0,0 +1,24 @@ + + /****************************************************************** + + iLBC Speech Coder ANSI-C Source Code + + syntFilter.h + + Copyright (C) The Internet Society (2004). + All Rights Reserved. + + ******************************************************************/ + + #ifndef __iLBC_SYNTFILTER_H + #define __iLBC_SYNTFILTER_H + + void syntFilter( + float *Out, /* (i/o) Signal to be filtered */ + float *a, /* (i) LP parameters */ + int len, /* (i) Length of signal */ + float *mem /* (i/o) Filter state */ + ); + + #endif + diff --git a/sflphone-common/libs/pjproject/third_party/milenage/milenage.c b/sflphone-common/libs/pjproject/third_party/milenage/milenage.c new file mode 100644 index 0000000000000000000000000000000000000000..66dae9bb10947bc3b5352a6f499c1c0954eab83d --- /dev/null +++ b/sflphone-common/libs/pjproject/third_party/milenage/milenage.c @@ -0,0 +1,284 @@ +/*------------------------------------------------------------------- + * Example algorithms f1, f1*, f2, f3, f4, f5, f5* + *------------------------------------------------------------------- + * + * A sample implementation of the example 3GPP authentication and + * key agreement functions f1, f1*, f2, f3, f4, f5 and f5*. This is + * a byte-oriented implementation of the functions, and of the block + * cipher kernel function Rijndael. + * + * This has been coded for clarity, not necessarily for efficiency. + * + * The functions f2, f3, f4 and f5 share the same inputs and have + * been coded together as a single function. f1, f1* and f5* are + * all coded separately. + * + *-----------------------------------------------------------------*/ + +#include "milenage.h" +#include "rijndael.h" + +/*--------------------------- prototypes --------------------------*/ + + + +/*------------------------------------------------------------------- + * Algorithm f1 + *------------------------------------------------------------------- + * + * Computes network authentication code MAC-A from key K, random + * challenge RAND, sequence number SQN and authentication management + * field AMF. + * + *-----------------------------------------------------------------*/ + +void f1 ( u8 k[16], u8 rand[16], u8 sqn[6], u8 amf[2], + u8 mac_a[8], u8 op[16] ) +{ + u8 op_c[16]; + u8 temp[16]; + u8 in1[16]; + u8 out1[16]; + u8 rijndaelInput[16]; + u8 i; + + RijndaelKeySchedule( k ); + + ComputeOPc( op_c, op ); + + for (i=0; i<16; i++) + rijndaelInput[i] = rand[i] ^ op_c[i]; + RijndaelEncrypt( rijndaelInput, temp ); + + for (i=0; i<6; i++) + { + in1[i] = sqn[i]; + in1[i+8] = sqn[i]; + } + for (i=0; i<2; i++) + { + in1[i+6] = amf[i]; + in1[i+14] = amf[i]; + } + + /* XOR op_c and in1, rotate by r1=64, and XOR * + * on the constant c1 (which is all zeroes) */ + + for (i=0; i<16; i++) + rijndaelInput[(i+8) % 16] = in1[i] ^ op_c[i]; + + /* XOR on the value temp computed before */ + + for (i=0; i<16; i++) + rijndaelInput[i] ^= temp[i]; + + RijndaelEncrypt( rijndaelInput, out1 ); + for (i=0; i<16; i++) + out1[i] ^= op_c[i]; + + for (i=0; i<8; i++) + mac_a[i] = out1[i]; + + return; +} /* end of function f1 */ + + + +/*------------------------------------------------------------------- + * Algorithms f2-f5 + *------------------------------------------------------------------- + * + * Takes key K and random challenge RAND, and returns response RES, + * confidentiality key CK, integrity key IK and anonymity key AK. + * + *-----------------------------------------------------------------*/ + +void f2345 ( u8 k[16], u8 rand[16], + u8 res[8], u8 ck[16], u8 ik[16], u8 ak[6], u8 op[16] ) +{ + u8 op_c[16]; + u8 temp[16]; + u8 out[16]; + u8 rijndaelInput[16]; + u8 i; + + RijndaelKeySchedule( k ); + + ComputeOPc( op_c, op ); + + for (i=0; i<16; i++) + rijndaelInput[i] = rand[i] ^ op_c[i]; + RijndaelEncrypt( rijndaelInput, temp ); + + /* To obtain output block OUT2: XOR OPc and TEMP, * + * rotate by r2=0, and XOR on the constant c2 (which * + * is all zeroes except that the last bit is 1). */ + + for (i=0; i<16; i++) + rijndaelInput[i] = temp[i] ^ op_c[i]; + rijndaelInput[15] ^= 1; + + RijndaelEncrypt( rijndaelInput, out ); + for (i=0; i<16; i++) + out[i] ^= op_c[i]; + + for (i=0; i<8; i++) + res[i] = out[i+8]; + for (i=0; i<6; i++) + ak[i] = out[i]; + + /* To obtain output block OUT3: XOR OPc and TEMP, * + * rotate by r3=32, and XOR on the constant c3 (which * + * is all zeroes except that the next to last bit is 1). */ + + for (i=0; i<16; i++) + rijndaelInput[(i+12) % 16] = temp[i] ^ op_c[i]; + rijndaelInput[15] ^= 2; + + RijndaelEncrypt( rijndaelInput, out ); + for (i=0; i<16; i++) + out[i] ^= op_c[i]; + + for (i=0; i<16; i++) + ck[i] = out[i]; + + /* To obtain output block OUT4: XOR OPc and TEMP, * + * rotate by r4=64, and XOR on the constant c4 (which * + * is all zeroes except that the 2nd from last bit is 1). */ + + for (i=0; i<16; i++) + rijndaelInput[(i+8) % 16] = temp[i] ^ op_c[i]; + rijndaelInput[15] ^= 4; + + RijndaelEncrypt( rijndaelInput, out ); + for (i=0; i<16; i++) + out[i] ^= op_c[i]; + + for (i=0; i<16; i++) + ik[i] = out[i]; + + return; +} /* end of function f2345 */ + + +/*------------------------------------------------------------------- + * Algorithm f1* + *------------------------------------------------------------------- + * + * Computes resynch authentication code MAC-S from key K, random + * challenge RAND, sequence number SQN and authentication management + * field AMF. + * + *-----------------------------------------------------------------*/ + +void f1star( u8 k[16], u8 rand[16], u8 sqn[6], u8 amf[2], + u8 mac_s[8], u8 op[16] ) +{ + u8 op_c[16]; + u8 temp[16]; + u8 in1[16]; + u8 out1[16]; + u8 rijndaelInput[16]; + u8 i; + + RijndaelKeySchedule( k ); + + ComputeOPc( op_c, op ); + + for (i=0; i<16; i++) + rijndaelInput[i] = rand[i] ^ op_c[i]; + RijndaelEncrypt( rijndaelInput, temp ); + + for (i=0; i<6; i++) + { + in1[i] = sqn[i]; + in1[i+8] = sqn[i]; + } + for (i=0; i<2; i++) + { + in1[i+6] = amf[i]; + in1[i+14] = amf[i]; + } + + /* XOR op_c and in1, rotate by r1=64, and XOR * + * on the constant c1 (which is all zeroes) */ + + for (i=0; i<16; i++) + rijndaelInput[(i+8) % 16] = in1[i] ^ op_c[i]; + + /* XOR on the value temp computed before */ + + for (i=0; i<16; i++) + rijndaelInput[i] ^= temp[i]; + + RijndaelEncrypt( rijndaelInput, out1 ); + for (i=0; i<16; i++) + out1[i] ^= op_c[i]; + + for (i=0; i<8; i++) + mac_s[i] = out1[i+8]; + + return; +} /* end of function f1star */ + + +/*------------------------------------------------------------------- + * Algorithm f5* + *------------------------------------------------------------------- + * + * Takes key K and random challenge RAND, and returns resynch + * anonymity key AK. + * + *-----------------------------------------------------------------*/ + +void f5star( u8 k[16], u8 rand[16], + u8 ak[6], u8 op[16] ) +{ + u8 op_c[16]; + u8 temp[16]; + u8 out[16]; + u8 rijndaelInput[16]; + u8 i; + + RijndaelKeySchedule( k ); + + ComputeOPc( op_c, op ); + + for (i=0; i<16; i++) + rijndaelInput[i] = rand[i] ^ op_c[i]; + RijndaelEncrypt( rijndaelInput, temp ); + + /* To obtain output block OUT5: XOR OPc and TEMP, * + * rotate by r5=96, and XOR on the constant c5 (which * + * is all zeroes except that the 3rd from last bit is 1). */ + + for (i=0; i<16; i++) + rijndaelInput[(i+4) % 16] = temp[i] ^ op_c[i]; + rijndaelInput[15] ^= 8; + + RijndaelEncrypt( rijndaelInput, out ); + for (i=0; i<16; i++) + out[i] ^= op_c[i]; + + for (i=0; i<6; i++) + ak[i] = out[i]; + + return; +} /* end of function f5star */ + + +/*------------------------------------------------------------------- + * Function to compute OPc from OP and K. Assumes key schedule has + already been performed. + *-----------------------------------------------------------------*/ + +void ComputeOPc( u8 op_c[16], u8 op[16] ) +{ + u8 i; + + RijndaelEncrypt( op, op_c ); + for (i=0; i<16; i++) + op_c[i] ^= op[i]; + + return; +} /* end of function ComputeOPc */ diff --git a/sflphone-common/libs/pjproject/third_party/milenage/milenage.h b/sflphone-common/libs/pjproject/third_party/milenage/milenage.h new file mode 100644 index 0000000000000000000000000000000000000000..a5f407f3787266cb0d90c08bc2b8c15e31704950 --- /dev/null +++ b/sflphone-common/libs/pjproject/third_party/milenage/milenage.h @@ -0,0 +1,35 @@ +/*------------------------------------------------------------------- + * Example algorithms f1, f1*, f2, f3, f4, f5, f5* + *------------------------------------------------------------------- + * + * A sample implementation of the example 3GPP authentication and + * key agreement functions f1, f1*, f2, f3, f4, f5 and f5*. This is + * a byte-oriented implementation of the functions, and of the block + * cipher kernel function Rijndael. + * + * This has been coded for clarity, not necessarily for efficiency. + * + * The functions f2, f3, f4 and f5 share the same inputs and have + * been coded together as a single function. f1, f1* and f5* are + * all coded separately. + * + *-----------------------------------------------------------------*/ + +#ifndef MILENAGE_H +#define MILENAGE_H + +typedef unsigned char u8; + + +void f1 ( u8 k[16], u8 rand[16], u8 sqn[6], u8 amf[2], + u8 mac_a[8], u8 op[16] ); +void f2345 ( u8 k[16], u8 rand[16], + u8 res[8], u8 ck[16], u8 ik[16], u8 ak[6], u8 op[16] ); +void f1star( u8 k[16], u8 rand[16], u8 sqn[6], u8 amf[2], + u8 mac_s[8], u8 op[16] ); +void f5star( u8 k[16], u8 rand[16], + u8 ak[6], u8 op[16] ); +void ComputeOPc( u8 op_c[16], u8 op[16] ); + + +#endif diff --git a/sflphone-common/libs/pjproject/third_party/milenage/rijndael.c b/sflphone-common/libs/pjproject/third_party/milenage/rijndael.c new file mode 100644 index 0000000000000000000000000000000000000000..86557b92e4e57f1f706f82a4943a8183b6e40f70 --- /dev/null +++ b/sflphone-common/libs/pjproject/third_party/milenage/rijndael.c @@ -0,0 +1,444 @@ +/*------------------------------------------------------------------- + * Rijndael Implementation + *------------------------------------------------------------------- + * + * A sample 32-bit orientated implementation of Rijndael, the + * suggested kernel for the example 3GPP authentication and key + * agreement functions. + * + * This implementation draws on the description in section 5.2 of + * the AES proposal and also on the implementation by + * Dr B. R. Gladman <brg@gladman.uk.net> 9th October 2000. + * It uses a number of large (4k) lookup tables to implement the + * algorithm in an efficient manner. + * + * Note: in this implementation the State is stored in four 32-bit + * words, one per column of the State, with the top byte of the + * column being the _least_ significant byte of the word. + * +*-----------------------------------------------------------------*/ + +#include <pj/types.h> + +#if defined(PJ_IS_LITTLE_ENDIAN) && PJ_IS_LITTLE_ENDIAN != 0 +# define LITTLE_ENDIAN /* For INTEL architecture */ +#endif + +typedef unsigned char u8; +typedef unsigned int u32; + +/* Circular byte rotates of 32 bit values */ + +#define rot1(x) ((x << 8) | (x >> 24)) +#define rot2(x) ((x << 16) | (x >> 16)) +#define rot3(x) ((x << 24) | (x >> 8)) + +/* Extract a byte from a 32-bit u32 */ + +#define byte0(x) ((u8)(x)) +#define byte1(x) ((u8)(x >> 8)) +#define byte2(x) ((u8)(x >> 16)) +#define byte3(x) ((u8)(x >> 24)) + + +/* Put or get a 32 bit u32 (v) in machine order from a byte * + * address in (x) */ + +#ifdef LITTLE_ENDIAN + +#define u32_in(x) (*(u32*)(x)) +#define u32_out(x,y) (*(u32*)(x) = y) + +#else + +/* Invert byte order in a 32 bit variable */ + +__inline u32 byte_swap(const u32 x) +{ + return rot1(x) & 0x00ff00ff | rot3(x) & 0xff00ff00; +} +__inline u32 u32_in(const u8 x[]) +{ + return byte_swap(*(u32*)x); +}; +__inline void u32_out(u8 x[], const u32 v) +{ + *(u32*)x = byte_swap(v); +}; + +#endif + +/*--------------- The lookup tables ----------------------------*/ + +static u32 rnd_con[10] = +{ + 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1B, 0x36 +}; + +static u32 ft_tab[4][256] = +{ + { + 0xA56363C6,0x847C7CF8,0x997777EE,0x8D7B7BF6,0x0DF2F2FF,0xBD6B6BD6,0xB16F6FDE,0x54C5C591, + 0x50303060,0x03010102,0xA96767CE,0x7D2B2B56,0x19FEFEE7,0x62D7D7B5,0xE6ABAB4D,0x9A7676EC, + 0x45CACA8F,0x9D82821F,0x40C9C989,0x877D7DFA,0x15FAFAEF,0xEB5959B2,0xC947478E,0x0BF0F0FB, + 0xECADAD41,0x67D4D4B3,0xFDA2A25F,0xEAAFAF45,0xBF9C9C23,0xF7A4A453,0x967272E4,0x5BC0C09B, + 0xC2B7B775,0x1CFDFDE1,0xAE93933D,0x6A26264C,0x5A36366C,0x413F3F7E,0x02F7F7F5,0x4FCCCC83, + 0x5C343468,0xF4A5A551,0x34E5E5D1,0x08F1F1F9,0x937171E2,0x73D8D8AB,0x53313162,0x3F15152A, + 0x0C040408,0x52C7C795,0x65232346,0x5EC3C39D,0x28181830,0xA1969637,0x0F05050A,0xB59A9A2F, + 0x0907070E,0x36121224,0x9B80801B,0x3DE2E2DF,0x26EBEBCD,0x6927274E,0xCDB2B27F,0x9F7575EA, + 0x1B090912,0x9E83831D,0x742C2C58,0x2E1A1A34,0x2D1B1B36,0xB26E6EDC,0xEE5A5AB4,0xFBA0A05B, + 0xF65252A4,0x4D3B3B76,0x61D6D6B7,0xCEB3B37D,0x7B292952,0x3EE3E3DD,0x712F2F5E,0x97848413, + 0xF55353A6,0x68D1D1B9,0000000000,0x2CEDEDC1,0x60202040,0x1FFCFCE3,0xC8B1B179,0xED5B5BB6, + 0xBE6A6AD4,0x46CBCB8D,0xD9BEBE67,0x4B393972,0xDE4A4A94,0xD44C4C98,0xE85858B0,0x4ACFCF85, + 0x6BD0D0BB,0x2AEFEFC5,0xE5AAAA4F,0x16FBFBED,0xC5434386,0xD74D4D9A,0x55333366,0x94858511, + 0xCF45458A,0x10F9F9E9,0x06020204,0x817F7FFE,0xF05050A0,0x443C3C78,0xBA9F9F25,0xE3A8A84B, + 0xF35151A2,0xFEA3A35D,0xC0404080,0x8A8F8F05,0xAD92923F,0xBC9D9D21,0x48383870,0x04F5F5F1, + 0xDFBCBC63,0xC1B6B677,0x75DADAAF,0x63212142,0x30101020,0x1AFFFFE5,0x0EF3F3FD,0x6DD2D2BF, + 0x4CCDCD81,0x140C0C18,0x35131326,0x2FECECC3,0xE15F5FBE,0xA2979735,0xCC444488,0x3917172E, + 0x57C4C493,0xF2A7A755,0x827E7EFC,0x473D3D7A,0xAC6464C8,0xE75D5DBA,0x2B191932,0x957373E6, + 0xA06060C0,0x98818119,0xD14F4F9E,0x7FDCDCA3,0x66222244,0x7E2A2A54,0xAB90903B,0x8388880B, + 0xCA46468C,0x29EEEEC7,0xD3B8B86B,0x3C141428,0x79DEDEA7,0xE25E5EBC,0x1D0B0B16,0x76DBDBAD, + 0x3BE0E0DB,0x56323264,0x4E3A3A74,0x1E0A0A14,0xDB494992,0x0A06060C,0x6C242448,0xE45C5CB8, + 0x5DC2C29F,0x6ED3D3BD,0xEFACAC43,0xA66262C4,0xA8919139,0xA4959531,0x37E4E4D3,0x8B7979F2, + 0x32E7E7D5,0x43C8C88B,0x5937376E,0xB76D6DDA,0x8C8D8D01,0x64D5D5B1,0xD24E4E9C,0xE0A9A949, + 0xB46C6CD8,0xFA5656AC,0x07F4F4F3,0x25EAEACF,0xAF6565CA,0x8E7A7AF4,0xE9AEAE47,0x18080810, + 0xD5BABA6F,0x887878F0,0x6F25254A,0x722E2E5C,0x241C1C38,0xF1A6A657,0xC7B4B473,0x51C6C697, + 0x23E8E8CB,0x7CDDDDA1,0x9C7474E8,0x211F1F3E,0xDD4B4B96,0xDCBDBD61,0x868B8B0D,0x858A8A0F, + 0x907070E0,0x423E3E7C,0xC4B5B571,0xAA6666CC,0xD8484890,0x05030306,0x01F6F6F7,0x120E0E1C, + 0xA36161C2,0x5F35356A,0xF95757AE,0xD0B9B969,0x91868617,0x58C1C199,0x271D1D3A,0xB99E9E27, + 0x38E1E1D9,0x13F8F8EB,0xB398982B,0x33111122,0xBB6969D2,0x70D9D9A9,0x898E8E07,0xA7949433, + 0xB69B9B2D,0x221E1E3C,0x92878715,0x20E9E9C9,0x49CECE87,0xFF5555AA,0x78282850,0x7ADFDFA5, + 0x8F8C8C03,0xF8A1A159,0x80898909,0x170D0D1A,0xDABFBF65,0x31E6E6D7,0xC6424284,0xB86868D0, + 0xC3414182,0xB0999929,0x772D2D5A,0x110F0F1E,0xCBB0B07B,0xFC5454A8,0xD6BBBB6D,0x3A16162C + }, + { + 0x6363C6A5,0x7C7CF884,0x7777EE99,0x7B7BF68D,0xF2F2FF0D,0x6B6BD6BD,0x6F6FDEB1,0xC5C59154, + 0x30306050,0x01010203,0x6767CEA9,0x2B2B567D,0xFEFEE719,0xD7D7B562,0xABAB4DE6,0x7676EC9A, + 0xCACA8F45,0x82821F9D,0xC9C98940,0x7D7DFA87,0xFAFAEF15,0x5959B2EB,0x47478EC9,0xF0F0FB0B, + 0xADAD41EC,0xD4D4B367,0xA2A25FFD,0xAFAF45EA,0x9C9C23BF,0xA4A453F7,0x7272E496,0xC0C09B5B, + 0xB7B775C2,0xFDFDE11C,0x93933DAE,0x26264C6A,0x36366C5A,0x3F3F7E41,0xF7F7F502,0xCCCC834F, + 0x3434685C,0xA5A551F4,0xE5E5D134,0xF1F1F908,0x7171E293,0xD8D8AB73,0x31316253,0x15152A3F, + 0x0404080C,0xC7C79552,0x23234665,0xC3C39D5E,0x18183028,0x969637A1,0x05050A0F,0x9A9A2FB5, + 0x07070E09,0x12122436,0x80801B9B,0xE2E2DF3D,0xEBEBCD26,0x27274E69,0xB2B27FCD,0x7575EA9F, + 0x0909121B,0x83831D9E,0x2C2C5874,0x1A1A342E,0x1B1B362D,0x6E6EDCB2,0x5A5AB4EE,0xA0A05BFB, + 0x5252A4F6,0x3B3B764D,0xD6D6B761,0xB3B37DCE,0x2929527B,0xE3E3DD3E,0x2F2F5E71,0x84841397, + 0x5353A6F5,0xD1D1B968,0000000000,0xEDEDC12C,0x20204060,0xFCFCE31F,0xB1B179C8,0x5B5BB6ED, + 0x6A6AD4BE,0xCBCB8D46,0xBEBE67D9,0x3939724B,0x4A4A94DE,0x4C4C98D4,0x5858B0E8,0xCFCF854A, + 0xD0D0BB6B,0xEFEFC52A,0xAAAA4FE5,0xFBFBED16,0x434386C5,0x4D4D9AD7,0x33336655,0x85851194, + 0x45458ACF,0xF9F9E910,0x02020406,0x7F7FFE81,0x5050A0F0,0x3C3C7844,0x9F9F25BA,0xA8A84BE3, + 0x5151A2F3,0xA3A35DFE,0x404080C0,0x8F8F058A,0x92923FAD,0x9D9D21BC,0x38387048,0xF5F5F104, + 0xBCBC63DF,0xB6B677C1,0xDADAAF75,0x21214263,0x10102030,0xFFFFE51A,0xF3F3FD0E,0xD2D2BF6D, + 0xCDCD814C,0x0C0C1814,0x13132635,0xECECC32F,0x5F5FBEE1,0x979735A2,0x444488CC,0x17172E39, + 0xC4C49357,0xA7A755F2,0x7E7EFC82,0x3D3D7A47,0x6464C8AC,0x5D5DBAE7,0x1919322B,0x7373E695, + 0x6060C0A0,0x81811998,0x4F4F9ED1,0xDCDCA37F,0x22224466,0x2A2A547E,0x90903BAB,0x88880B83, + 0x46468CCA,0xEEEEC729,0xB8B86BD3,0x1414283C,0xDEDEA779,0x5E5EBCE2,0x0B0B161D,0xDBDBAD76, + 0xE0E0DB3B,0x32326456,0x3A3A744E,0x0A0A141E,0x494992DB,0x06060C0A,0x2424486C,0x5C5CB8E4, + 0xC2C29F5D,0xD3D3BD6E,0xACAC43EF,0x6262C4A6,0x919139A8,0x959531A4,0xE4E4D337,0x7979F28B, + 0xE7E7D532,0xC8C88B43,0x37376E59,0x6D6DDAB7,0x8D8D018C,0xD5D5B164,0x4E4E9CD2,0xA9A949E0, + 0x6C6CD8B4,0x5656ACFA,0xF4F4F307,0xEAEACF25,0x6565CAAF,0x7A7AF48E,0xAEAE47E9,0x08081018, + 0xBABA6FD5,0x7878F088,0x25254A6F,0x2E2E5C72,0x1C1C3824,0xA6A657F1,0xB4B473C7,0xC6C69751, + 0xE8E8CB23,0xDDDDA17C,0x7474E89C,0x1F1F3E21,0x4B4B96DD,0xBDBD61DC,0x8B8B0D86,0x8A8A0F85, + 0x7070E090,0x3E3E7C42,0xB5B571C4,0x6666CCAA,0x484890D8,0x03030605,0xF6F6F701,0x0E0E1C12, + 0x6161C2A3,0x35356A5F,0x5757AEF9,0xB9B969D0,0x86861791,0xC1C19958,0x1D1D3A27,0x9E9E27B9, + 0xE1E1D938,0xF8F8EB13,0x98982BB3,0x11112233,0x6969D2BB,0xD9D9A970,0x8E8E0789,0x949433A7, + 0x9B9B2DB6,0x1E1E3C22,0x87871592,0xE9E9C920,0xCECE8749,0x5555AAFF,0x28285078,0xDFDFA57A, + 0x8C8C038F,0xA1A159F8,0x89890980,0x0D0D1A17,0xBFBF65DA,0xE6E6D731,0x424284C6,0x6868D0B8, + 0x414182C3,0x999929B0,0x2D2D5A77,0x0F0F1E11,0xB0B07BCB,0x5454A8FC,0xBBBB6DD6,0x16162C3A + }, + { + 0x63C6A563,0x7CF8847C,0x77EE9977,0x7BF68D7B,0xF2FF0DF2,0x6BD6BD6B,0x6FDEB16F,0xC59154C5, + 0x30605030,0x01020301,0x67CEA967,0x2B567D2B,0xFEE719FE,0xD7B562D7,0xAB4DE6AB,0x76EC9A76, + 0xCA8F45CA,0x821F9D82,0xC98940C9,0x7DFA877D,0xFAEF15FA,0x59B2EB59,0x478EC947,0xF0FB0BF0, + 0xAD41ECAD,0xD4B367D4,0xA25FFDA2,0xAF45EAAF,0x9C23BF9C,0xA453F7A4,0x72E49672,0xC09B5BC0, + 0xB775C2B7,0xFDE11CFD,0x933DAE93,0x264C6A26,0x366C5A36,0x3F7E413F,0xF7F502F7,0xCC834FCC, + 0x34685C34,0xA551F4A5,0xE5D134E5,0xF1F908F1,0x71E29371,0xD8AB73D8,0x31625331,0x152A3F15, + 0x04080C04,0xC79552C7,0x23466523,0xC39D5EC3,0x18302818,0x9637A196,0x050A0F05,0x9A2FB59A, + 0x070E0907,0x12243612,0x801B9B80,0xE2DF3DE2,0xEBCD26EB,0x274E6927,0xB27FCDB2,0x75EA9F75, + 0x09121B09,0x831D9E83,0x2C58742C,0x1A342E1A,0x1B362D1B,0x6EDCB26E,0x5AB4EE5A,0xA05BFBA0, + 0x52A4F652,0x3B764D3B,0xD6B761D6,0xB37DCEB3,0x29527B29,0xE3DD3EE3,0x2F5E712F,0x84139784, + 0x53A6F553,0xD1B968D1,0000000000,0xEDC12CED,0x20406020,0xFCE31FFC,0xB179C8B1,0x5BB6ED5B, + 0x6AD4BE6A,0xCB8D46CB,0xBE67D9BE,0x39724B39,0x4A94DE4A,0x4C98D44C,0x58B0E858,0xCF854ACF, + 0xD0BB6BD0,0xEFC52AEF,0xAA4FE5AA,0xFBED16FB,0x4386C543,0x4D9AD74D,0x33665533,0x85119485, + 0x458ACF45,0xF9E910F9,0x02040602,0x7FFE817F,0x50A0F050,0x3C78443C,0x9F25BA9F,0xA84BE3A8, + 0x51A2F351,0xA35DFEA3,0x4080C040,0x8F058A8F,0x923FAD92,0x9D21BC9D,0x38704838,0xF5F104F5, + 0xBC63DFBC,0xB677C1B6,0xDAAF75DA,0x21426321,0x10203010,0xFFE51AFF,0xF3FD0EF3,0xD2BF6DD2, + 0xCD814CCD,0x0C18140C,0x13263513,0xECC32FEC,0x5FBEE15F,0x9735A297,0x4488CC44,0x172E3917, + 0xC49357C4,0xA755F2A7,0x7EFC827E,0x3D7A473D,0x64C8AC64,0x5DBAE75D,0x19322B19,0x73E69573, + 0x60C0A060,0x81199881,0x4F9ED14F,0xDCA37FDC,0x22446622,0x2A547E2A,0x903BAB90,0x880B8388, + 0x468CCA46,0xEEC729EE,0xB86BD3B8,0x14283C14,0xDEA779DE,0x5EBCE25E,0x0B161D0B,0xDBAD76DB, + 0xE0DB3BE0,0x32645632,0x3A744E3A,0x0A141E0A,0x4992DB49,0x060C0A06,0x24486C24,0x5CB8E45C, + 0xC29F5DC2,0xD3BD6ED3,0xAC43EFAC,0x62C4A662,0x9139A891,0x9531A495,0xE4D337E4,0x79F28B79, + 0xE7D532E7,0xC88B43C8,0x376E5937,0x6DDAB76D,0x8D018C8D,0xD5B164D5,0x4E9CD24E,0xA949E0A9, + 0x6CD8B46C,0x56ACFA56,0xF4F307F4,0xEACF25EA,0x65CAAF65,0x7AF48E7A,0xAE47E9AE,0x08101808, + 0xBA6FD5BA,0x78F08878,0x254A6F25,0x2E5C722E,0x1C38241C,0xA657F1A6,0xB473C7B4,0xC69751C6, + 0xE8CB23E8,0xDDA17CDD,0x74E89C74,0x1F3E211F,0x4B96DD4B,0xBD61DCBD,0x8B0D868B,0x8A0F858A, + 0x70E09070,0x3E7C423E,0xB571C4B5,0x66CCAA66,0x4890D848,0x03060503,0xF6F701F6,0x0E1C120E, + 0x61C2A361,0x356A5F35,0x57AEF957,0xB969D0B9,0x86179186,0xC19958C1,0x1D3A271D,0x9E27B99E, + 0xE1D938E1,0xF8EB13F8,0x982BB398,0x11223311,0x69D2BB69,0xD9A970D9,0x8E07898E,0x9433A794, + 0x9B2DB69B,0x1E3C221E,0x87159287,0xE9C920E9,0xCE8749CE,0x55AAFF55,0x28507828,0xDFA57ADF, + 0x8C038F8C,0xA159F8A1,0x89098089,0x0D1A170D,0xBF65DABF,0xE6D731E6,0x4284C642,0x68D0B868, + 0x4182C341,0x9929B099,0x2D5A772D,0x0F1E110F,0xB07BCBB0,0x54A8FC54,0xBB6DD6BB,0x162C3A16 + }, + { + 0xC6A56363,0xF8847C7C,0xEE997777,0xF68D7B7B,0xFF0DF2F2,0xD6BD6B6B,0xDEB16F6F,0x9154C5C5, + 0x60503030,0x02030101,0xCEA96767,0x567D2B2B,0xE719FEFE,0xB562D7D7,0x4DE6ABAB,0xEC9A7676, + 0x8F45CACA,0x1F9D8282,0x8940C9C9,0xFA877D7D,0xEF15FAFA,0xB2EB5959,0x8EC94747,0xFB0BF0F0, + 0x41ECADAD,0xB367D4D4,0x5FFDA2A2,0x45EAAFAF,0x23BF9C9C,0x53F7A4A4,0xE4967272,0x9B5BC0C0, + 0x75C2B7B7,0xE11CFDFD,0x3DAE9393,0x4C6A2626,0x6C5A3636,0x7E413F3F,0xF502F7F7,0x834FCCCC, + 0x685C3434,0x51F4A5A5,0xD134E5E5,0xF908F1F1,0xE2937171,0xAB73D8D8,0x62533131,0x2A3F1515, + 0x080C0404,0x9552C7C7,0x46652323,0x9D5EC3C3,0x30281818,0x37A19696,0x0A0F0505,0x2FB59A9A, + 0x0E090707,0x24361212,0x1B9B8080,0xDF3DE2E2,0xCD26EBEB,0x4E692727,0x7FCDB2B2,0xEA9F7575, + 0x121B0909,0x1D9E8383,0x58742C2C,0x342E1A1A,0x362D1B1B,0xDCB26E6E,0xB4EE5A5A,0x5BFBA0A0, + 0xA4F65252,0x764D3B3B,0xB761D6D6,0x7DCEB3B3,0x527B2929,0xDD3EE3E3,0x5E712F2F,0x13978484, + 0xA6F55353,0xB968D1D1,0000000000,0xC12CEDED,0x40602020,0xE31FFCFC,0x79C8B1B1,0xB6ED5B5B, + 0xD4BE6A6A,0x8D46CBCB,0x67D9BEBE,0x724B3939,0x94DE4A4A,0x98D44C4C,0xB0E85858,0x854ACFCF, + 0xBB6BD0D0,0xC52AEFEF,0x4FE5AAAA,0xED16FBFB,0x86C54343,0x9AD74D4D,0x66553333,0x11948585, + 0x8ACF4545,0xE910F9F9,0x04060202,0xFE817F7F,0xA0F05050,0x78443C3C,0x25BA9F9F,0x4BE3A8A8, + 0xA2F35151,0x5DFEA3A3,0x80C04040,0x058A8F8F,0x3FAD9292,0x21BC9D9D,0x70483838,0xF104F5F5, + 0x63DFBCBC,0x77C1B6B6,0xAF75DADA,0x42632121,0x20301010,0xE51AFFFF,0xFD0EF3F3,0xBF6DD2D2, + 0x814CCDCD,0x18140C0C,0x26351313,0xC32FECEC,0xBEE15F5F,0x35A29797,0x88CC4444,0x2E391717, + 0x9357C4C4,0x55F2A7A7,0xFC827E7E,0x7A473D3D,0xC8AC6464,0xBAE75D5D,0x322B1919,0xE6957373, + 0xC0A06060,0x19988181,0x9ED14F4F,0xA37FDCDC,0x44662222,0x547E2A2A,0x3BAB9090,0x0B838888, + 0x8CCA4646,0xC729EEEE,0x6BD3B8B8,0x283C1414,0xA779DEDE,0xBCE25E5E,0x161D0B0B,0xAD76DBDB, + 0xDB3BE0E0,0x64563232,0x744E3A3A,0x141E0A0A,0x92DB4949,0x0C0A0606,0x486C2424,0xB8E45C5C, + 0x9F5DC2C2,0xBD6ED3D3,0x43EFACAC,0xC4A66262,0x39A89191,0x31A49595,0xD337E4E4,0xF28B7979, + 0xD532E7E7,0x8B43C8C8,0x6E593737,0xDAB76D6D,0x018C8D8D,0xB164D5D5,0x9CD24E4E,0x49E0A9A9, + 0xD8B46C6C,0xACFA5656,0xF307F4F4,0xCF25EAEA,0xCAAF6565,0xF48E7A7A,0x47E9AEAE,0x10180808, + 0x6FD5BABA,0xF0887878,0x4A6F2525,0x5C722E2E,0x38241C1C,0x57F1A6A6,0x73C7B4B4,0x9751C6C6, + 0xCB23E8E8,0xA17CDDDD,0xE89C7474,0x3E211F1F,0x96DD4B4B,0x61DCBDBD,0x0D868B8B,0x0F858A8A, + 0xE0907070,0x7C423E3E,0x71C4B5B5,0xCCAA6666,0x90D84848,0x06050303,0xF701F6F6,0x1C120E0E, + 0xC2A36161,0x6A5F3535,0xAEF95757,0x69D0B9B9,0x17918686,0x9958C1C1,0x3A271D1D,0x27B99E9E, + 0xD938E1E1,0xEB13F8F8,0x2BB39898,0x22331111,0xD2BB6969,0xA970D9D9,0x07898E8E,0x33A79494, + 0x2DB69B9B,0x3C221E1E,0x15928787,0xC920E9E9,0x8749CECE,0xAAFF5555,0x50782828,0xA57ADFDF, + 0x038F8C8C,0x59F8A1A1,0x09808989,0x1A170D0D,0x65DABFBF,0xD731E6E6,0x84C64242,0xD0B86868, + 0x82C34141,0x29B09999,0x5A772D2D,0x1E110F0F,0x7BCBB0B0,0xA8FC5454,0x6DD6BBBB,0x2C3A1616 + } +}; + +static u32 fl_tab[4][256] = +{ + { + 0x00000063,0x0000007C,0x00000077,0x0000007B,0x000000F2,0x0000006B,0x0000006F,0x000000C5, + 0x00000030,0x00000001,0x00000067,0x0000002B,0x000000FE,0x000000D7,0x000000AB,0x00000076, + 0x000000CA,0x00000082,0x000000C9,0x0000007D,0x000000FA,0x00000059,0x00000047,0x000000F0, + 0x000000AD,0x000000D4,0x000000A2,0x000000AF,0x0000009C,0x000000A4,0x00000072,0x000000C0, + 0x000000B7,0x000000FD,0x00000093,0x00000026,0x00000036,0x0000003F,0x000000F7,0x000000CC, + 0x00000034,0x000000A5,0x000000E5,0x000000F1,0x00000071,0x000000D8,0x00000031,0x00000015, + 0x00000004,0x000000C7,0x00000023,0x000000C3,0x00000018,0x00000096,0x00000005,0x0000009A, + 0x00000007,0x00000012,0x00000080,0x000000E2,0x000000EB,0x00000027,0x000000B2,0x00000075, + 0x00000009,0x00000083,0x0000002C,0x0000001A,0x0000001B,0x0000006E,0x0000005A,0x000000A0, + 0x00000052,0x0000003B,0x000000D6,0x000000B3,0x00000029,0x000000E3,0x0000002F,0x00000084, + 0x00000053,0x000000D1,0x00000000,0x000000ED,0x00000020,0x000000FC,0x000000B1,0x0000005B, + 0x0000006A,0x000000CB,0x000000BE,0x00000039,0x0000004A,0x0000004C,0x00000058,0x000000CF, + 0x000000D0,0x000000EF,0x000000AA,0x000000FB,0x00000043,0x0000004D,0x00000033,0x00000085, + 0x00000045,0x000000F9,0x00000002,0x0000007F,0x00000050,0x0000003C,0x0000009F,0x000000A8, + 0x00000051,0x000000A3,0x00000040,0x0000008F,0x00000092,0x0000009D,0x00000038,0x000000F5, + 0x000000BC,0x000000B6,0x000000DA,0x00000021,0x00000010,0x000000FF,0x000000F3,0x000000D2, + 0x000000CD,0x0000000C,0x00000013,0x000000EC,0x0000005F,0x00000097,0x00000044,0x00000017, + 0x000000C4,0x000000A7,0x0000007E,0x0000003D,0x00000064,0x0000005D,0x00000019,0x00000073, + 0x00000060,0x00000081,0x0000004F,0x000000DC,0x00000022,0x0000002A,0x00000090,0x00000088, + 0x00000046,0x000000EE,0x000000B8,0x00000014,0x000000DE,0x0000005E,0x0000000B,0x000000DB, + 0x000000E0,0x00000032,0x0000003A,0x0000000A,0x00000049,0x00000006,0x00000024,0x0000005C, + 0x000000C2,0x000000D3,0x000000AC,0x00000062,0x00000091,0x00000095,0x000000E4,0x00000079, + 0x000000E7,0x000000C8,0x00000037,0x0000006D,0x0000008D,0x000000D5,0x0000004E,0x000000A9, + 0x0000006C,0x00000056,0x000000F4,0x000000EA,0x00000065,0x0000007A,0x000000AE,0x00000008, + 0x000000BA,0x00000078,0x00000025,0x0000002E,0x0000001C,0x000000A6,0x000000B4,0x000000C6, + 0x000000E8,0x000000DD,0x00000074,0x0000001F,0x0000004B,0x000000BD,0x0000008B,0x0000008A, + 0x00000070,0x0000003E,0x000000B5,0x00000066,0x00000048,0x00000003,0x000000F6,0x0000000E, + 0x00000061,0x00000035,0x00000057,0x000000B9,0x00000086,0x000000C1,0x0000001D,0x0000009E, + 0x000000E1,0x000000F8,0x00000098,0x00000011,0x00000069,0x000000D9,0x0000008E,0x00000094, + 0x0000009B,0x0000001E,0x00000087,0x000000E9,0x000000CE,0x00000055,0x00000028,0x000000DF, + 0x0000008C,0x000000A1,0x00000089,0x0000000D,0x000000BF,0x000000E6,0x00000042,0x00000068, + 0x00000041,0x00000099,0x0000002D,0x0000000F,0x000000B0,0x00000054,0x000000BB,0x00000016 + }, + { + 0x00006300,0x00007C00,0x00007700,0x00007B00,0x0000F200,0x00006B00,0x00006F00,0x0000C500, + 0x00003000,0x00000100,0x00006700,0x00002B00,0x0000FE00,0x0000D700,0x0000AB00,0x00007600, + 0x0000CA00,0x00008200,0x0000C900,0x00007D00,0x0000FA00,0x00005900,0x00004700,0x0000F000, + 0x0000AD00,0x0000D400,0x0000A200,0x0000AF00,0x00009C00,0x0000A400,0x00007200,0x0000C000, + 0x0000B700,0x0000FD00,0x00009300,0x00002600,0x00003600,0x00003F00,0x0000F700,0x0000CC00, + 0x00003400,0x0000A500,0x0000E500,0x0000F100,0x00007100,0x0000D800,0x00003100,0x00001500, + 0x00000400,0x0000C700,0x00002300,0x0000C300,0x00001800,0x00009600,0x00000500,0x00009A00, + 0x00000700,0x00001200,0x00008000,0x0000E200,0x0000EB00,0x00002700,0x0000B200,0x00007500, + 0x00000900,0x00008300,0x00002C00,0x00001A00,0x00001B00,0x00006E00,0x00005A00,0x0000A000, + 0x00005200,0x00003B00,0x0000D600,0x0000B300,0x00002900,0x0000E300,0x00002F00,0x00008400, + 0x00005300,0x0000D100,0000000000,0x0000ED00,0x00002000,0x0000FC00,0x0000B100,0x00005B00, + 0x00006A00,0x0000CB00,0x0000BE00,0x00003900,0x00004A00,0x00004C00,0x00005800,0x0000CF00, + 0x0000D000,0x0000EF00,0x0000AA00,0x0000FB00,0x00004300,0x00004D00,0x00003300,0x00008500, + 0x00004500,0x0000F900,0x00000200,0x00007F00,0x00005000,0x00003C00,0x00009F00,0x0000A800, + 0x00005100,0x0000A300,0x00004000,0x00008F00,0x00009200,0x00009D00,0x00003800,0x0000F500, + 0x0000BC00,0x0000B600,0x0000DA00,0x00002100,0x00001000,0x0000FF00,0x0000F300,0x0000D200, + 0x0000CD00,0x00000C00,0x00001300,0x0000EC00,0x00005F00,0x00009700,0x00004400,0x00001700, + 0x0000C400,0x0000A700,0x00007E00,0x00003D00,0x00006400,0x00005D00,0x00001900,0x00007300, + 0x00006000,0x00008100,0x00004F00,0x0000DC00,0x00002200,0x00002A00,0x00009000,0x00008800, + 0x00004600,0x0000EE00,0x0000B800,0x00001400,0x0000DE00,0x00005E00,0x00000B00,0x0000DB00, + 0x0000E000,0x00003200,0x00003A00,0x00000A00,0x00004900,0x00000600,0x00002400,0x00005C00, + 0x0000C200,0x0000D300,0x0000AC00,0x00006200,0x00009100,0x00009500,0x0000E400,0x00007900, + 0x0000E700,0x0000C800,0x00003700,0x00006D00,0x00008D00,0x0000D500,0x00004E00,0x0000A900, + 0x00006C00,0x00005600,0x0000F400,0x0000EA00,0x00006500,0x00007A00,0x0000AE00,0x00000800, + 0x0000BA00,0x00007800,0x00002500,0x00002E00,0x00001C00,0x0000A600,0x0000B400,0x0000C600, + 0x0000E800,0x0000DD00,0x00007400,0x00001F00,0x00004B00,0x0000BD00,0x00008B00,0x00008A00, + 0x00007000,0x00003E00,0x0000B500,0x00006600,0x00004800,0x00000300,0x0000F600,0x00000E00, + 0x00006100,0x00003500,0x00005700,0x0000B900,0x00008600,0x0000C100,0x00001D00,0x00009E00, + 0x0000E100,0x0000F800,0x00009800,0x00001100,0x00006900,0x0000D900,0x00008E00,0x00009400, + 0x00009B00,0x00001E00,0x00008700,0x0000E900,0x0000CE00,0x00005500,0x00002800,0x0000DF00, + 0x00008C00,0x0000A100,0x00008900,0x00000D00,0x0000BF00,0x0000E600,0x00004200,0x00006800, + 0x00004100,0x00009900,0x00002D00,0x00000F00,0x0000B000,0x00005400,0x0000BB00,0x00001600 + }, + { + 0x00630000,0x007C0000,0x00770000,0x007B0000,0x00F20000,0x006B0000,0x006F0000,0x00C50000, + 0x00300000,0x00010000,0x00670000,0x002B0000,0x00FE0000,0x00D70000,0x00AB0000,0x00760000, + 0x00CA0000,0x00820000,0x00C90000,0x007D0000,0x00FA0000,0x00590000,0x00470000,0x00F00000, + 0x00AD0000,0x00D40000,0x00A20000,0x00AF0000,0x009C0000,0x00A40000,0x00720000,0x00C00000, + 0x00B70000,0x00FD0000,0x00930000,0x00260000,0x00360000,0x003F0000,0x00F70000,0x00CC0000, + 0x00340000,0x00A50000,0x00E50000,0x00F10000,0x00710000,0x00D80000,0x00310000,0x00150000, + 0x00040000,0x00C70000,0x00230000,0x00C30000,0x00180000,0x00960000,0x00050000,0x009A0000, + 0x00070000,0x00120000,0x00800000,0x00E20000,0x00EB0000,0x00270000,0x00B20000,0x00750000, + 0x00090000,0x00830000,0x002C0000,0x001A0000,0x001B0000,0x006E0000,0x005A0000,0x00A00000, + 0x00520000,0x003B0000,0x00D60000,0x00B30000,0x00290000,0x00E30000,0x002F0000,0x00840000, + 0x00530000,0x00D10000,0000000000,0x00ED0000,0x00200000,0x00FC0000,0x00B10000,0x005B0000, + 0x006A0000,0x00CB0000,0x00BE0000,0x00390000,0x004A0000,0x004C0000,0x00580000,0x00CF0000, + 0x00D00000,0x00EF0000,0x00AA0000,0x00FB0000,0x00430000,0x004D0000,0x00330000,0x00850000, + 0x00450000,0x00F90000,0x00020000,0x007F0000,0x00500000,0x003C0000,0x009F0000,0x00A80000, + 0x00510000,0x00A30000,0x00400000,0x008F0000,0x00920000,0x009D0000,0x00380000,0x00F50000, + 0x00BC0000,0x00B60000,0x00DA0000,0x00210000,0x00100000,0x00FF0000,0x00F30000,0x00D20000, + 0x00CD0000,0x000C0000,0x00130000,0x00EC0000,0x005F0000,0x00970000,0x00440000,0x00170000, + 0x00C40000,0x00A70000,0x007E0000,0x003D0000,0x00640000,0x005D0000,0x00190000,0x00730000, + 0x00600000,0x00810000,0x004F0000,0x00DC0000,0x00220000,0x002A0000,0x00900000,0x00880000, + 0x00460000,0x00EE0000,0x00B80000,0x00140000,0x00DE0000,0x005E0000,0x000B0000,0x00DB0000, + 0x00E00000,0x00320000,0x003A0000,0x000A0000,0x00490000,0x00060000,0x00240000,0x005C0000, + 0x00C20000,0x00D30000,0x00AC0000,0x00620000,0x00910000,0x00950000,0x00E40000,0x00790000, + 0x00E70000,0x00C80000,0x00370000,0x006D0000,0x008D0000,0x00D50000,0x004E0000,0x00A90000, + 0x006C0000,0x00560000,0x00F40000,0x00EA0000,0x00650000,0x007A0000,0x00AE0000,0x00080000, + 0x00BA0000,0x00780000,0x00250000,0x002E0000,0x001C0000,0x00A60000,0x00B40000,0x00C60000, + 0x00E80000,0x00DD0000,0x00740000,0x001F0000,0x004B0000,0x00BD0000,0x008B0000,0x008A0000, + 0x00700000,0x003E0000,0x00B50000,0x00660000,0x00480000,0x00030000,0x00F60000,0x000E0000, + 0x00610000,0x00350000,0x00570000,0x00B90000,0x00860000,0x00C10000,0x001D0000,0x009E0000, + 0x00E10000,0x00F80000,0x00980000,0x00110000,0x00690000,0x00D90000,0x008E0000,0x00940000, + 0x009B0000,0x001E0000,0x00870000,0x00E90000,0x00CE0000,0x00550000,0x00280000,0x00DF0000, + 0x008C0000,0x00A10000,0x00890000,0x000D0000,0x00BF0000,0x00E60000,0x00420000,0x00680000, + 0x00410000,0x00990000,0x002D0000,0x000F0000,0x00B00000,0x00540000,0x00BB0000,0x00160000 + }, + { + 0x63000000,0x7C000000,0x77000000,0x7B000000,0xF2000000,0x6B000000,0x6F000000,0xC5000000, + 0x30000000,0x01000000,0x67000000,0x2B000000,0xFE000000,0xD7000000,0xAB000000,0x76000000, + 0xCA000000,0x82000000,0xC9000000,0x7D000000,0xFA000000,0x59000000,0x47000000,0xF0000000, + 0xAD000000,0xD4000000,0xA2000000,0xAF000000,0x9C000000,0xA4000000,0x72000000,0xC0000000, + 0xB7000000,0xFD000000,0x93000000,0x26000000,0x36000000,0x3F000000,0xF7000000,0xCC000000, + 0x34000000,0xA5000000,0xE5000000,0xF1000000,0x71000000,0xD8000000,0x31000000,0x15000000, + 0x04000000,0xC7000000,0x23000000,0xC3000000,0x18000000,0x96000000,0x05000000,0x9A000000, + 0x07000000,0x12000000,0x80000000,0xE2000000,0xEB000000,0x27000000,0xB2000000,0x75000000, + 0x09000000,0x83000000,0x2C000000,0x1A000000,0x1B000000,0x6E000000,0x5A000000,0xA0000000, + 0x52000000,0x3B000000,0xD6000000,0xB3000000,0x29000000,0xE3000000,0x2F000000,0x84000000, + 0x53000000,0xD1000000,0000000000,0xED000000,0x20000000,0xFC000000,0xB1000000,0x5B000000, + 0x6A000000,0xCB000000,0xBE000000,0x39000000,0x4A000000,0x4C000000,0x58000000,0xCF000000, + 0xD0000000,0xEF000000,0xAA000000,0xFB000000,0x43000000,0x4D000000,0x33000000,0x85000000, + 0x45000000,0xF9000000,0x02000000,0x7F000000,0x50000000,0x3C000000,0x9F000000,0xA8000000, + 0x51000000,0xA3000000,0x40000000,0x8F000000,0x92000000,0x9D000000,0x38000000,0xF5000000, + 0xBC000000,0xB6000000,0xDA000000,0x21000000,0x10000000,0xFF000000,0xF3000000,0xD2000000, + 0xCD000000,0x0C000000,0x13000000,0xEC000000,0x5F000000,0x97000000,0x44000000,0x17000000, + 0xC4000000,0xA7000000,0x7E000000,0x3D000000,0x64000000,0x5D000000,0x19000000,0x73000000, + 0x60000000,0x81000000,0x4F000000,0xDC000000,0x22000000,0x2A000000,0x90000000,0x88000000, + 0x46000000,0xEE000000,0xB8000000,0x14000000,0xDE000000,0x5E000000,0x0B000000,0xDB000000, + 0xE0000000,0x32000000,0x3A000000,0x0A000000,0x49000000,0x06000000,0x24000000,0x5C000000, + 0xC2000000,0xD3000000,0xAC000000,0x62000000,0x91000000,0x95000000,0xE4000000,0x79000000, + 0xE7000000,0xC8000000,0x37000000,0x6D000000,0x8D000000,0xD5000000,0x4E000000,0xA9000000, + 0x6C000000,0x56000000,0xF4000000,0xEA000000,0x65000000,0x7A000000,0xAE000000,0x08000000, + 0xBA000000,0x78000000,0x25000000,0x2E000000,0x1C000000,0xA6000000,0xB4000000,0xC6000000, + 0xE8000000,0xDD000000,0x74000000,0x1F000000,0x4B000000,0xBD000000,0x8B000000,0x8A000000, + 0x70000000,0x3E000000,0xB5000000,0x66000000,0x48000000,0x03000000,0xF6000000,0x0E000000, + 0x61000000,0x35000000,0x57000000,0xB9000000,0x86000000,0xC1000000,0x1D000000,0x9E000000, + 0xE1000000,0xF8000000,0x98000000,0x11000000,0x69000000,0xD9000000,0x8E000000,0x94000000, + 0x9B000000,0x1E000000,0x87000000,0xE9000000,0xCE000000,0x55000000,0x28000000,0xDF000000, + 0x8C000000,0xA1000000,0x89000000,0x0D000000,0xBF000000,0xE6000000,0x42000000,0x68000000, + 0x41000000,0x99000000,0x2D000000,0x0F000000,0xB0000000,0x54000000,0xBB000000,0x16000000 + } +}; + +/*----------------- The workspace ------------------------------*/ + +static u32 Ekey[44]; /* The expanded key */ + +/*------ The round Function. 4 table lookups and 4 Exors ------*/ +#define f_rnd(x, n) \ + ( ft_tab[0][byte0(x[n])] \ + ^ ft_tab[1][byte1(x[(n + 1) & 3])] \ + ^ ft_tab[2][byte2(x[(n + 2) & 3])] \ + ^ ft_tab[3][byte3(x[(n + 3) & 3])] ) + +#define f_round(bo, bi, k) \ + bo[0] = f_rnd(bi, 0) ^ k[0]; \ + bo[1] = f_rnd(bi, 1) ^ k[1]; \ + bo[2] = f_rnd(bi, 2) ^ k[2]; \ + bo[3] = f_rnd(bi, 3) ^ k[3]; \ + k += 4 + +/*--- The S Box lookup used in constructing the Key schedule ---*/ +#define ls_box(x) \ + ( fl_tab[0][byte0(x)] \ + ^ fl_tab[1][byte1(x)] \ + ^ fl_tab[2][byte2(x)] \ + ^ fl_tab[3][byte3(x)] ) + +/*------------ The last round function (no MixColumn) ----------*/ +#define lf_rnd(x, n) \ + ( fl_tab[0][byte0(x[n])] \ + ^ fl_tab[1][byte1(x[(n + 1) & 3])] \ + ^ fl_tab[2][byte2(x[(n + 2) & 3])] \ + ^ fl_tab[3][byte3(x[(n + 3) & 3])] ) + + +/*----------------------------------------------------------- + * RijndaelKeySchedule + * Initialise the key schedule from a supplied key + */ +void RijndaelKeySchedule(u8 key[16]) +{ + u32 t; + u32 *ek=Ekey, /* pointer to the expanded key */ + *rc=rnd_con; /* pointer to the round constant */ + + Ekey[0] = u32_in(key ); + Ekey[1] = u32_in(key + 4); + Ekey[2] = u32_in(key + 8); + Ekey[3] = u32_in(key + 12); + + while(ek < Ekey + 40) + { + t = rot3(ek[3]); + ek[4] = ek[0] ^ ls_box(t) ^ *rc++; + ek[5] = ek[1] ^ ek[4]; + ek[6] = ek[2] ^ ek[5]; + ek[7] = ek[3] ^ ek[6]; + ek += 4; + } +} + +/*----------------------------------------------------------- + * RijndaelEncrypt + * Encrypt an input block + */ +void RijndaelEncrypt(u8 in[16], u8 out[16]) +{ + u32 b0[4], b1[4], *kp = Ekey; + + b0[0] = u32_in(in ) ^ *kp++; + b0[1] = u32_in(in + 4) ^ *kp++; + b0[2] = u32_in(in + 8) ^ *kp++; + b0[3] = u32_in(in + 12) ^ *kp++; + + f_round(b1, b0, kp); + f_round(b0, b1, kp); + f_round(b1, b0, kp); + f_round(b0, b1, kp); + f_round(b1, b0, kp); + f_round(b0, b1, kp); + f_round(b1, b0, kp); + f_round(b0, b1, kp); + f_round(b1, b0, kp); + + u32_out(out, lf_rnd(b1, 0) ^ kp[0]); + u32_out(out + 4, lf_rnd(b1, 1) ^ kp[1]); + u32_out(out + 8, lf_rnd(b1, 2) ^ kp[2]); + u32_out(out + 12, lf_rnd(b1, 3) ^ kp[3]); +} diff --git a/sflphone-common/libs/pjproject/third_party/milenage/rijndael.h b/sflphone-common/libs/pjproject/third_party/milenage/rijndael.h new file mode 100644 index 0000000000000000000000000000000000000000..4e728a5b3e7c77d4e492e2c90e551ffbccd15dd2 --- /dev/null +++ b/sflphone-common/libs/pjproject/third_party/milenage/rijndael.h @@ -0,0 +1,26 @@ +/*------------------------------------------------------------------- + * Example algorithms f1, f1*, f2, f3, f4, f5, f5* + *------------------------------------------------------------------- + * + * A sample implementation of the example 3GPP authentication and + * key agreement functions f1, f1*, f2, f3, f4, f5 and f5*. This is + * a byte-oriented implementation of the functions, and of the block + * cipher kernel function Rijndael. + * + * This has been coded for clarity, not necessarily for efficiency. + * + * The functions f2, f3, f4 and f5 share the same inputs and have + * been coded together as a single function. f1, f1* and f5* are + * all coded separately. + * + *-----------------------------------------------------------------*/ + +#ifndef RIJNDAEL_H +#define RIJNDAEL_H + + +void RijndaelKeySchedule( u8 key[16] ); +void RijndaelEncrypt( u8 input[16], u8 output[16] ); + + +#endif diff --git a/sflphone-common/libs/pjproject/third_party/portaudio/build/msvc/readme.txt b/sflphone-common/libs/pjproject/third_party/portaudio/build/msvc/readme.txt index 5364797db1e6485a8909b2e0614c4a9a63b0904f..b7d2f0beddb61e4f37e4b7efe1f7d62a7c5d1b2c 100644 --- a/sflphone-common/libs/pjproject/third_party/portaudio/build/msvc/readme.txt +++ b/sflphone-common/libs/pjproject/third_party/portaudio/build/msvc/readme.txt @@ -14,6 +14,8 @@ This DLL contains all 3 current win32 PA APIS (MM/DS/ASIO) portaudio19svn\src\hostapi\asio\ASIOSDK\host\mac (not needed) You dont need "driver" + + To build without ASIO (or another Host API) see the "Building without ASIO support" section below. 2) *If you have Visual Studio 6.0*, please make sure you have it updated with the latest (and final) @@ -76,5 +78,32 @@ PaAsio_GetInputChannelName @53 PaAsio_GetOutputChannelName @54 PaUtil_SetLogPrintFunction @55 + +*** Building without ASIO support *** + +To build PortAudio without ASIO support you need to: + A. Make sure your project doesn't try to build any ASIO SDK files. + If you're using one of the shipped projects, remove the ASIO related files + from the project. + + B. Make sure your project doesn't try to build the PortAudio ASIO + implementation files: + src/hostapi/pa_asio.cpp src/hostapi/iasiothiscallresolver.cpp + If you're using one of the shipped projects remove them from the project. + + C. Define the PA_NO_ASIO preprocessor symbol in the project properties. + In VS2005 this can be added under + Project Properties > Configuration Properties > C/C++ > Preprocessor > Preprocessor Definitions + + Defining PA_NO_ASIO stops src/os/win/pa_win_hostapis.c + from trying to initialize the PA ASIO implementation. + + D. Remove PaAsio_* entry points from portaudio.def + +A similar procedure can be used to omit any of the other host APIs from the +build. The relevant preprocessor symbols used by pa_win_hostapis.c are: +PA_NO_WMME, PA_NO_DS, PA_NO_ASIO, PA_NO_WASAPI and PA_NO_WDMKS + + ----- David Viens, davidv@plogue.com \ No newline at end of file diff --git a/sflphone-common/libs/pjproject/third_party/portaudio/configure.in b/sflphone-common/libs/pjproject/third_party/portaudio/configure.in index 749e3a47b1ee0e344b91b76a6ab5246a06c9e86c..087ff712bad8c5d9622b88e9505ab900cc4f302a 100644 --- a/sflphone-common/libs/pjproject/third_party/portaudio/configure.in +++ b/sflphone-common/libs/pjproject/third_party/portaudio/configure.in @@ -1,7 +1,7 @@ dnl dnl portaudio V19 configure.in script dnl -dnl Dominic Mazzoni, Arve Knudsen +dnl Dominic Mazzoni, Arve Knudsen, Stelios Bounanos dnl dnl Require autoconf >= 2.13 @@ -11,63 +11,87 @@ dnl Init autoconf and make sure configure is being called dnl from the right directory AC_INIT([include/portaudio.h]) +dnl Define build, build_cpu, build_vendor, build_os +AC_CANONICAL_BUILD +dnl Define host, host_cpu, host_vendor, host_os +AC_CANONICAL_HOST +dnl Define target, target_cpu, target_vendor, target_os +AC_CANONICAL_TARGET + dnl Specify options -AC_ARG_WITH(alsa, - [ --with-alsa (default=yes)], - with_alsa=$withval, with_alsa="yes") +AC_ARG_WITH(alsa, + AS_HELP_STRING([--with-alsa], [Enable support for ALSA @<:@autodetect@:>@]), + [with_alsa=$withval]) -AC_ARG_WITH(jack, - [ --with-jack (default=yes)], - with_jack=$withval, with_jack="yes") +AC_ARG_WITH(jack, + AS_HELP_STRING([--with-jack], [Enable support for JACK @<:@autodetect@:>@]), + [with_jack=$withval]) -AC_ARG_WITH(oss, - [ --with-oss (default=yes)], - with_oss=$withval, with_oss="yes") +AC_ARG_WITH(oss, + AS_HELP_STRING([--with-oss], [Enable support for OSS @<:@autodetect@:>@]), + [with_oss=$withval]) AC_ARG_WITH(asihpi, - [ --with-asihpi (default=auto)], - with_asihpi=$withval, with_asihpi="yes") - -AC_ARG_WITH(host_os, - [ --with-host_os (no default)], - host_os=$withval) + AS_HELP_STRING([--with-asihpi], [Enable support for ASIHPI @<:@autodetect@:>@]), + [with_asihpi=$withval]) AC_ARG_WITH(winapi, - [ --with-winapi ((wmme/directx/asio) default=wmme)], - with_winapi=$withval, with_winapi="wmme") - -dnl Mac API added for ASIO, can have other api's listed -AC_ARG_WITH(macapi, - [ --with-macapi ((asio/core/sm) default=core)], - with_macapi=$withval, with_macapi="core") + AS_HELP_STRING([--with-winapi], + [Select Windows API support (@<:@wmme|directx|asio|wdmks@:>@@<:@,...@:>@) @<:@wmme@:>@]), + [with_winapi=$withval], [with_winapi="wmme"]) +case "$target_os" in *mingw* | *cygwin*) + with_wmme=no + with_directx=no + with_asio=no + with_wdmks=no + for api in $(echo $with_winapi | sed 's/,/ /g'); do + case "$api" in + wmme|directx|asio|wdmks) + eval with_$api=yes + ;; + *) + AC_MSG_ERROR([unknown Windows API \"$api\" (do you need --help?)]) + ;; + esac + done + ;; +esac AC_ARG_WITH(asiodir, - [ --with-asiodir (default=/usr/local/asiosdk2)], + AS_HELP_STRING([--with-asiodir], [ASIO directory @<:@/usr/local/asiosdk2@:>@]), with_asiodir=$withval, with_asiodir="/usr/local/asiosdk2") AC_ARG_WITH(dxdir, - [ --with-dxdir (default=/usr/local/dx7sdk)], + AS_HELP_STRING([--with-dxdir], [DirectX directory @<:@/usr/local/dx7sdk@:>@]), with_dxdir=$withval, with_dxdir="/usr/local/dx7sdk") +debug_output=no AC_ARG_ENABLE(debug-output, - [ --enable-debug-output], - [if test x$enableval != xno ; then - AC_DEFINE(PA_ENABLE_DEBUG_OUTPUT,,[Enable debugging messages]) - fi - ]) + AS_HELP_STRING([--enable-debug-output], [Enable debug output @<:@no@:>@]), + [if test "x$enableval" != "xno" ; then + AC_DEFINE(PA_ENABLE_DEBUG_OUTPUT,,[Enable debugging messages]) + debug_output=yes + fi + ]) AC_ARG_ENABLE(cxx, - [ --enable-cxx (default=no)], - enable_cxx=$enableval, enable_cxx="no") + AS_HELP_STRING([--enable-cxx], [Enable C++ bindings @<:@no@:>@]), + enable_cxx=$enableval, enable_cxx="no") AC_ARG_ENABLE(mac-debug, - [ --enable-mac-debug (default=no)], - enable_mac_debug=$enableval, enable_mac_debug="no") + AS_HELP_STRING([--enable-mac-debug], [Enable Mac debug @<:@no@:>@]), + enable_mac_debug=$enableval, enable_mac_debug="no") AC_ARG_ENABLE(mac-universal, - [ --enable-mac-universal (default=yes)], - enable_mac_universal=$enableval, enable_mac_universal="yes") + AS_HELP_STRING([--enable-mac-universal], [Build Mac universal binaries @<:@yes@:>@]), + enable_mac_universal=$enableval, enable_mac_universal="yes") + +dnl Continue to accept --host_os for compatibility but do not document +dnl it (the correct way to change host_os is with --host=...). Moved +dnl here because the empty help string generates a blank line which we +dnl can use to separate PA options from libtool options. +AC_ARG_WITH(host_os, [], host_os=$withval) dnl Checks for programs. @@ -87,20 +111,27 @@ AC_C_BIGENDIAN dnl checks for various host APIs and arguments to configure that dnl turn them on or off -AC_CHECK_LIB(asound, snd_pcm_open, have_alsa=yes, have_alsa=no) -AC_CHECK_LIB(hpi, HPI_SubSysCreate, have_asihpi=yes, have_asihpi=no, -lm) -AC_CHECK_LIB(ossaudio, _oss_ioctl, have_libossaudio=yes, have_libossaudio=no) - -dnl Determine the host description for the subsequent test. -dnl PKG_CHECK_MODULES seems to check and set the host variable also, but -dnl that then requires pkg-config availability which is not standard on -dnl MinGW systems and can be a pain to install. -dnl AC_CANONICAL_HOST - -PKG_CHECK_MODULES(JACK, jack, have_jack=yes, have_jack=no) +have_alsa=no +if test "x$with_alsa" != "xno"; then + AC_CHECK_LIB(asound, snd_pcm_open, have_alsa=yes, have_alsa=no) +fi +have_asihpi=no +if test "x$with_asihpi" != "xno"; then + AC_CHECK_LIB(hpi, HPI_SubSysCreate, have_asihpi=yes, have_asihpi=no, -lm) +fi +have_libossaudio=no +have_oss=no +if test "x$with_oss" != "xno"; then + AC_CHECK_HEADERS([sys/soundcard.h linux/soundcard.h machine/soundcard.h], [have_oss=yes]) + if test "x$have_oss" = "xyes"; then + AC_CHECK_LIB(ossaudio, _oss_ioctl, have_libossaudio=yes, have_libossaudio=no) + fi +fi +have_jack=no +if test "x$with_jack" != "xno"; then + PKG_CHECK_MODULES(JACK, jack, have_jack=yes, have_jack=no) +fi -dnl checks for header files -AC_CHECK_HEADERS([sys/soundcard.h linux/soundcard.h machine/soundcard.h]) dnl sizeof checks: we will need a 16-bit and a 32-bit type @@ -149,6 +180,13 @@ else CFLAGS="$CFLAGS -DPA_LITTLE_ENDIAN" fi +add_objects() +{ + for o in $@; do + test "${OTHER_OBJS#*${o}*}" = "${OTHER_OBJS}" && OTHER_OBJS="$OTHER_OBJS $o" + done +} + case "${host_os}" in darwin* ) dnl Mac OS X configuration @@ -176,81 +214,50 @@ case "${host_os}" in CFLAGS="-std=c99 $CFLAGS $mac_arches $mac_sysroot $mac_version_min" OTHER_OBJS="src/os/unix/pa_unix_hostapis.o src/os/unix/pa_unix_util.o src/hostapi/coreaudio/pa_mac_core.o src/hostapi/coreaudio/pa_mac_core_utilities.o src/hostapi/coreaudio/pa_mac_core_blocking.o src/common/pa_ringbuffer.o" PADLL="libportaudio.dylib" - if [[ $with_macapi = "asio" ]] ; then - if [[ $with_asiodir ]] ; then - ASIODIR="$with_asiodir" - else - ASIODIR="/usr/local/asiosdk2" - fi - echo "ASIODIR: $ASIODIR" - - OTHER_OBJS="src/hostapi/asio/iasiothiscallresolver.o $ASIODIR/host/asiodrivers.o $ASIODIR/common/asio.o $ASIODIR/host/mac/asioshlib.o" - CFLAGS="$CFLAGS -I\$(top_srcdir)/src/hostapi/asio -I$ASIODIR/host/mac -I$ASIODIR/common" - CXXFLAGS="$CFLAGS" - fi ;; mingw* ) dnl MingW configuration - echo "WINAPI: $with_winapi" - if [[ $with_winapi = "directx" ]] ; then - if [[ $with_dxdir ]] ; then - DXDIR="$with_dxdir" - else - DXDIR="/usr/local/dx7sdk" - fi - echo "DXDIR: $DXDIR" - OTHER_OBJS="src/hostapi/dsound/pa_win_ds.o src/hostapi/dsound/pa_win_ds_dynlink.o src/os/win/pa_win_hostapis.o src/os/win/pa_win_util.o src/os/win/pa_win_waveformat.o" + PADLL="portaudio.dll" + THREAD_CFLAGS="-mthreads" + SHARED_FLAGS="-shared" + CFLAGS="$CFLAGS -I\$(top_srcdir)/include -DPA_NO_WMME -DPA_NO_ASIO -DPA_NO_WDMKS -DPA_NO_DS" + + if [[ "x$with_directx" = "xyes" ]]; then + DXDIR="$with_dxdir" + add_objects src/hostapi/dsound/pa_win_ds.o src/hostapi/dsound/pa_win_ds_dynlink.o src/os/win/pa_win_hostapis.o src/os/win/pa_win_util.o src/os/win/pa_win_waveformat.o LIBS="-lwinmm -lm -ldsound -lole32" - PADLL="portaudio.dll" - THREAD_CFLAGS="-mthreads" - SHARED_FLAGS="-shared" - DLL_LIBS="${DLL_LIBS} -lwinmm -lm -L./dx7sdk/lib -ldsound -lole32" + DLL_LIBS="${DLL_LIBS} -lwinmm -lm -L$DXDIR/lib -ldsound -lole32" #VC98="\"/c/Program Files/Microsoft Visual Studio/VC98/Include\"" #CFLAGS="$CFLAGS -I$VC98 -DPA_NO_WMME -DPA_NO_ASIO" - CFLAGS="$CFLAGS -I\$(top_srcdir)/include -I$DXDIR/include -DPA_NO_WMME -DPA_NO_ASIO" -DPA_NO_WDMKS - elif [[ $with_winapi = "asio" ]] ; then - if [[ $with_asiodir ]] ; then - ASIODIR="$with_asiodir" - else - ASIODIR="/usr/local/asiosdk2" - fi - echo "ASIODIR: $ASIODIR" - - - OTHER_OBJS="src/hostapi/asio/pa_asio.o src/common/pa_ringbuffer.o src/os/win/pa_win_hostapis.o src/os/win/pa_win_util.o src/hostapi/asio/iasiothiscallresolver.o $ASIODIR/common/asio.o $ASIODIR/host/asiodrivers.o $ASIODIR/host/pc/asiolist.o" - LIBS="-lwinmm -lm -lstdc++ -lole32 -luuid" - PADLL="portaudio.dll" - THREAD_CFLAGS="-mthreads" - SHARED_FLAGS="-shared" - DLL_LIBS="${DLL_LIBS} -lwinmm -lm -lstdc++ -lole32 -luuid" - CFLAGS="$CFLAGS -ffast-math -fomit-frame-pointer -I\$(top_srcdir)/src/common -I\$(top_srcdir)/src/hostapi/asio -I$ASIODIR/host/pc -I$ASIODIR/common -I$ASIODIR/host -DPA_NO_WMME -DPA_NO_DS -DPA_NO_WDMKS -DWINDOWS" + CFLAGS="$CFLAGS -I\$(top_srcdir)/src/os/win -I$DXDIR/include -UPA_NO_DS" + fi + + if [[ "x$with_asio" = "xyes" ]]; then + ASIODIR="$with_asiodir" + add_objects src/hostapi/asio/pa_asio.o src/common/pa_ringbuffer.o src/os/win/pa_win_hostapis.o src/os/win/pa_win_util.o src/hostapi/asio/iasiothiscallresolver.o $ASIODIR/common/asio.o $ASIODIR/host/asiodrivers.o $ASIODIR/host/pc/asiolist.o + LIBS="-lwinmm -lm -lole32 -luuid" + DLL_LIBS="${DLL_LIBS} -lwinmm -lm -lole32 -luuid" + CFLAGS="$CFLAGS -ffast-math -fomit-frame-pointer -I\$(top_srcdir)/src/common -I\$(top_srcdir)/src/hostapi/asio -I$ASIODIR/host/pc -I$ASIODIR/common -I$ASIODIR/host -UPA_NO_ASIO -DWINDOWS" CXXFLAGS="$CFLAGS" - elif [[ $with_winapi = "wdmks" ]] ; then - if [[ $with_dxdir ]] ; then - DXDIR="$with_dxdir" - else - DXDIR="/usr/local/dx7sdk" - fi - echo "DXDIR: $DXDIR" - OTHER_OBJS="src/hostapi/wdmks/pa_win_wdmks.o src/os/win/pa_win_hostapis.o src/os/win/pa_win_util.o" + fi + + if [[ "x$with_wdmks" = "xyes" ]]; then + DXDIR="$with_dxdir" + add_objects src/hostapi/wdmks/pa_win_wdmks.o src/os/win/pa_win_hostapis.o src/os/win/pa_win_util.o LIBS="-lwinmm -lm -luuid -lsetupapi -lole32" - PADLL="portaudio.dll" - THREAD_CFLAGS="-mthreads" - SHARED_FLAGS="-shared" - DLL_LIBS="${DLL_LIBS} -lwinmm -lm -L./dx7sdk/lib -luuid -lsetupapi -lole32" + DLL_LIBS="${DLL_LIBS} -lwinmm -lm -L$DXDIR/lib -luuid -lsetupapi -lole32" #VC98="\"/c/Program Files/Microsoft Visual Studio/VC98/Include\"" #CFLAGS="$CFLAGS -I$VC98 -DPA_NO_WMME -DPA_NO_ASIO" - CFLAGS="$CFLAGS -I\$(top_srcdir)/src/common -I$DXDIR/include -DPA_NO_WMME -DPA_NO_DS -DPA_NO_ASIO" - else # WMME default - OTHER_OBJS="src/hostapi/wmme/pa_win_wmme.o src/os/win/pa_win_hostapis.o src/os/win/pa_win_util.o src/os/win/pa_win_waveformat.o" - LIBS="-lwinmm -lm -lstdc++ -lole32 -luuid" - PADLL="portaudio.dll" - THREAD_CFLAGS="-mthreads" - SHARED_FLAGS="-shared" + CFLAGS="$CFLAGS -I\$(top_srcdir)/src/common -I$DXDIR/include -UPA_NO_WDMKS" + fi + + if [[ "x$with_wmme" = "xyes" ]]; then + add_objects src/hostapi/wmme/pa_win_wmme.o src/os/win/pa_win_hostapis.o src/os/win/pa_win_util.o src/os/win/pa_win_waveformat.o + LIBS="-lwinmm -lm -lole32 -luuid" DLL_LIBS="${DLL_LIBS} -lwinmm" - CFLAGS="$CFLAGS -I\$(top_srcdir)/src/common -DPA_NO_DS -DPA_NO_ASIO -DPA_NO_WDMKS" + CFLAGS="$CFLAGS -I\$(top_srcdir)/src/common -UPA_NO_WMME" fi ;; @@ -298,30 +305,30 @@ case "${host_os}" in AC_CHECK_LIB(pthread, pthread_create,[have_pthread="yes"], AC_MSG_ERROR([libpthread not found!])) - if [[ $have_alsa = "yes" ] && [ $with_alsa != "no" ]] ; then + if [[ "$have_alsa" = "yes" ] && [ "$with_alsa" != "no" ]] ; then DLL_LIBS="$DLL_LIBS -lasound" LIBS="$LIBS -lasound" OTHER_OBJS="$OTHER_OBJS src/hostapi/alsa/pa_linux_alsa.o" AC_DEFINE(PA_USE_ALSA) fi - if [[ $have_jack = "yes" ] && [ $with_jack != "no" ]] ; then + if [[ "$have_jack" = "yes" ] && [ "$with_jack" != "no" ]] ; then DLL_LIBS="$DLL_LIBS $JACK_LIBS" CFLAGS="$CFLAGS $JACK_CFLAGS" OTHER_OBJS="$OTHER_OBJS src/hostapi/jack/pa_jack.o src/common/pa_ringbuffer.o" AC_DEFINE(PA_USE_JACK) fi - if [[ $with_oss != "no" ]] ; then + if [[ "$with_oss" != "no" ]] ; then OTHER_OBJS="$OTHER_OBJS src/hostapi/oss/pa_unix_oss.o" - if [[ $have_libossaudio = "yes" ]] ; then + if [[ "$have_libossaudio" = "yes" ]] ; then DLL_LIBS="$DLL_LIBS -lossaudio" LIBS="$LIBS -lossaudio" fi AC_DEFINE(PA_USE_OSS) fi - if [[ $have_asihpi = "yes" ] && [ $with_asihpi != "no" ]] ; then + if [[ "$have_asihpi" = "yes" ] && [ "$with_asihpi" != "no" ]] ; then LIBS="$LIBS -lhpi" DLL_LIBS="$DLL_LIBS -lhpi" OTHER_OBJS="$OTHER_OBJS src/hostapi/asihpi/pa_linux_asihpi.o" @@ -359,4 +366,52 @@ fi AC_SUBST(ENABLE_CXX_TRUE) AC_SUBST(ENABLE_CXX_FALSE) +if test "x$with_asio" = "xyes"; then + WITH_ASIO_TRUE="" + WITH_ASIO_FALSE="@ #" +else + WITH_ASIO_TRUE="@ #" + WITH_ASIO_FALSE="" +fi +AC_SUBST(WITH_ASIO_TRUE) +AC_SUBST(WITH_ASIO_FALSE) + AC_OUTPUT([Makefile portaudio-2.0.pc]) + +AC_MSG_RESULT([ +Configuration summary: + + Target ...................... $target + C++ bindings ................ $enable_cxx + Debug output ................ $debug_output]) + +case "$target_os" in *linux*) + AC_MSG_RESULT([ + ALSA ........................ $have_alsa + ASIHPI ...................... $have_asihpi]) + ;; +esac +case "$target_os" in + *mingw* | *cygwin*) + test "x$with_directx" = "xyes" && with_directx="$with_directx (${with_dxdir})" + test "x$with_wdmks" = "xyes" && with_wdmks="$with_wdmks (${with_dxdir})" + test "x$with_asio" = "xyes" && with_asio="$with_asio (${with_asiodir})" + AC_MSG_RESULT([ + WMME ........................ $with_wmme + DSound ...................... $with_directx + WDMKS ....................... $with_wdmks + ASIO ........................ $with_asio +]) + ;; + *darwin*) + AC_MSG_RESULT([ + Mac debug flags ............. $enable_mac_debug +]) + ;; + *) + AC_MSG_RESULT([ + OSS ......................... $have_oss + JACK ........................ $have_jack +]) + ;; +esac diff --git a/sflphone-common/libs/pjproject/third_party/portaudio/include/pa_asio.h b/sflphone-common/libs/pjproject/third_party/portaudio/include/pa_asio.h index 363444ea509f8319602f543838da238110887da1..64d1bd4e7c3a5a20f9cf06d623269c9bf75e3376 100644 --- a/sflphone-common/libs/pjproject/third_party/portaudio/include/pa_asio.h +++ b/sflphone-common/libs/pjproject/third_party/portaudio/include/pa_asio.h @@ -1,7 +1,7 @@ #ifndef PA_ASIO_H #define PA_ASIO_H /* - * $Id: pa_asio.h 1337 2008-02-15 07:32:09Z rossb $ + * $Id: pa_asio.h 1400 2009-01-21 10:20:42Z rossb $ * PortAudio Portable Real-Time Audio Library * ASIO specific extensions * @@ -100,6 +100,19 @@ PaError PaAsio_GetOutputChannelName( PaDeviceIndex device, int channelIndex, const char** channelName ); +/** Set the sample rate of an open paASIO stream. + + @param stream The stream to operate on. + @param sampleRate The new sample rate. + + Note that this function may fail if the stream is alredy running and the + ASIO driver does not support switching the sample rate of a running stream. + + Returns paIncompatibleStreamHostApi if stream is not a paASIO stream. +*/ +PaError PaAsio_SetStreamSampleRate( PaStream* stream, double sampleRate ); + + #define paAsioUseChannelSelectors (0x01) typedef struct PaAsioStreamInfo{ diff --git a/sflphone-common/libs/pjproject/third_party/portaudio/include/pa_linux_alsa.h b/sflphone-common/libs/pjproject/third_party/portaudio/include/pa_linux_alsa.h index 9d41e4882e61db2d1e74b4762543574d880853a4..de89ae9bff5c68ac99fcbe1b4cb1d3db88c4a6f5 100644 --- a/sflphone-common/libs/pjproject/third_party/portaudio/include/pa_linux_alsa.h +++ b/sflphone-common/libs/pjproject/third_party/portaudio/include/pa_linux_alsa.h @@ -2,7 +2,7 @@ #define PA_LINUX_ALSA_H /* - * $Id: pa_linux_alsa.h 1337 2008-02-15 07:32:09Z rossb $ + * $Id: pa_linux_alsa.h 1414 2009-05-24 17:02:10Z aknudsen $ * PortAudio Portable Real-Time Audio Library * ALSA-specific extensions * @@ -87,6 +87,11 @@ PaError PaAlsa_GetStreamOutputCard( PaStream *s, int *card ); */ PaError PaAlsa_SetNumPeriods( int numPeriods ); +/** Set the maximum number of times to retry opening busy device (sleeping for a + * short interval inbetween). + */ +PaError PaAlsa_SetRetriesBusy( int retries ); + #ifdef __cplusplus } #endif diff --git a/sflphone-common/libs/pjproject/third_party/portaudio/include/pa_win_waveformat.h b/sflphone-common/libs/pjproject/third_party/portaudio/include/pa_win_waveformat.h index 63bf1c9587dafdd6d64358dd4e8eb33ac24d6bb5..dce18c0d9302eb65f964ada0be4a7a5a9069fa01 100644 --- a/sflphone-common/libs/pjproject/third_party/portaudio/include/pa_win_waveformat.h +++ b/sflphone-common/libs/pjproject/third_party/portaudio/include/pa_win_waveformat.h @@ -157,16 +157,34 @@ typedef struct{ #define PAWIN_INDEXOF_DWCHANNELMASK (PAWIN_SIZEOF_WAVEFORMATEX+2) #define PAWIN_INDEXOF_SUBFORMAT (PAWIN_SIZEOF_WAVEFORMATEX+6) + +/* + Valid values to pass for the waveFormatTag PaWin_InitializeWaveFormatEx and + PaWin_InitializeWaveFormatExtensible functions below. These must match + the standard Windows WAVE_FORMAT_* values. +*/ +#define PAWIN_WAVE_FORMAT_PCM (1) +#define PAWIN_WAVE_FORMAT_IEEE_FLOAT (3) +#define PAWIN_WAVE_FORMAT_DOLBY_AC3_SPDIF (0x0092) +#define PAWIN_WAVE_FORMAT_WMA_SPDIF (0x0164) + + +/* + returns PAWIN_WAVE_FORMAT_PCM or PAWIN_WAVE_FORMAT_IEEE_FLOAT + depending on the sampleFormat parameter. +*/ +int PaWin_SampleFormatToLinearWaveFormatTag( PaSampleFormat sampleFormat ); + /* Use the following two functions to initialize the waveformat structure. */ void PaWin_InitializeWaveFormatEx( PaWinWaveFormat *waveFormat, - int numChannels, PaSampleFormat sampleFormat, double sampleRate ); + int numChannels, PaSampleFormat sampleFormat, int waveFormatTag, double sampleRate ); void PaWin_InitializeWaveFormatExtensible( PaWinWaveFormat *waveFormat, - int numChannels, PaSampleFormat sampleFormat, double sampleRate, + int numChannels, PaSampleFormat sampleFormat, int waveFormatTag, double sampleRate, PaWinWaveFormatChannelMask channelMask ); diff --git a/sflphone-common/libs/pjproject/third_party/portaudio/include/pa_win_wmme.h b/sflphone-common/libs/pjproject/third_party/portaudio/include/pa_win_wmme.h index 58b74e3da71c76fa23a379c5c9d12b0fa4585bf4..deffd1006fa953c679e88a43029d967afbd9946d 100644 --- a/sflphone-common/libs/pjproject/third_party/portaudio/include/pa_win_wmme.h +++ b/sflphone-common/libs/pjproject/third_party/portaudio/include/pa_win_wmme.h @@ -1,7 +1,7 @@ #ifndef PA_WIN_WMME_H #define PA_WIN_WMME_H /* - * $Id: pa_win_wmme.h 1337 2008-02-15 07:32:09Z rossb $ + * $Id: pa_win_wmme.h 1405 2009-03-08 08:10:55Z rossb $ * PortAudio Portable Real-Time Audio Library * MME specific extensions * @@ -53,6 +53,10 @@ extern "C" #endif /* __cplusplus */ +/* The following are flags which can be set in + PaWinMmeStreamInfo's flags field. +*/ + #define paWinMmeUseLowLevelLatencyParameters (0x01) #define paWinMmeUseMultipleDevices (0x02) /* use mme specific multiple device feature */ #define paWinMmeUseChannelMask (0x04) @@ -64,6 +68,11 @@ extern "C" */ #define paWinMmeDontThrottleOverloadedProcessingThread (0x08) +/* Flags for non-PCM spdif passthrough. +*/ +#define paWinMmeWaveFormatDolbyAc3Spdif (0x10) +#define paWinMmeWaveFormatWmaSpdif (0x20) + typedef struct PaWinMmeDeviceAndChannelCount{ PaDeviceIndex device; diff --git a/sflphone-common/libs/pjproject/third_party/portaudio/src/common/pa_dither.c b/sflphone-common/libs/pjproject/third_party/portaudio/src/common/pa_dither.c index 6f6c9a1a61431387e5fb4684ebb1504520cdd29b..7a1b13125b8912139c7a35e365a018a9bfed58d3 100644 --- a/sflphone-common/libs/pjproject/third_party/portaudio/src/common/pa_dither.c +++ b/sflphone-common/libs/pjproject/third_party/portaudio/src/common/pa_dither.c @@ -1,5 +1,5 @@ /* - * $Id: pa_dither.c 1097 2006-08-26 08:27:53Z rossb $ + * $Id: pa_dither.c 1418 2009-10-12 21:00:53Z philburk $ * Portable Audio I/O Library triangular dither generator * * Based on the Open Source API proposed by Ross Bencina @@ -42,9 +42,14 @@ @brief Functions for generating dither noise */ - -#include "pa_dither.h" #include "pa_types.h" +#include "pa_dither.h" + + +/* Note that the linear congruential algorithm requires 32 bit integers + * because it uses arithmetic overflow. So use PaUint32 instead of + * unsigned long so it will work on 64 bit systems. + */ #define PA_DITHER_BITS_ (15) @@ -57,9 +62,9 @@ void PaUtil_InitializeTriangularDitherState( PaUtilTriangularDitherGenerator *st } -signed long PaUtil_Generate16BitTriangularDither( PaUtilTriangularDitherGenerator *state ) +PaInt32 PaUtil_Generate16BitTriangularDither( PaUtilTriangularDitherGenerator *state ) { - signed long current, highPass; + PaInt32 current, highPass; /* Generate two random numbers. */ state->randSeed1 = (state->randSeed1 * 196314165) + 907633515; @@ -69,9 +74,10 @@ signed long PaUtil_Generate16BitTriangularDither( PaUtilTriangularDitherGenerato * Shift before adding to prevent overflow which would skew the distribution. * Also shift an extra bit for the high pass filter. */ -#define DITHER_SHIFT_ ((SIZEOF_LONG*8 - PA_DITHER_BITS_) + 1) - current = (((signed long)state->randSeed1)>>DITHER_SHIFT_) + - (((signed long)state->randSeed2)>>DITHER_SHIFT_); +#define DITHER_SHIFT_ ((sizeof(PaInt32)*8 - PA_DITHER_BITS_) + 1) + + current = (((PaInt32)state->randSeed1)>>DITHER_SHIFT_) + + (((PaInt32)state->randSeed2)>>DITHER_SHIFT_); /* High pass filter to reduce audibility. */ highPass = current - state->previous; @@ -86,7 +92,7 @@ static const float const_float_dither_scale_ = PA_FLOAT_DITHER_SCALE_; float PaUtil_GenerateFloatTriangularDither( PaUtilTriangularDitherGenerator *state ) { - signed long current, highPass; + PaInt32 current, highPass; /* Generate two random numbers. */ state->randSeed1 = (state->randSeed1 * 196314165) + 907633515; @@ -96,9 +102,8 @@ float PaUtil_GenerateFloatTriangularDither( PaUtilTriangularDitherGenerator *sta * Shift before adding to prevent overflow which would skew the distribution. * Also shift an extra bit for the high pass filter. */ -#define DITHER_SHIFT_ ((SIZEOF_LONG*8 - PA_DITHER_BITS_) + 1) - current = (((signed long)state->randSeed1)>>DITHER_SHIFT_) + - (((signed long)state->randSeed2)>>DITHER_SHIFT_); + current = (((PaInt32)state->randSeed1)>>DITHER_SHIFT_) + + (((PaInt32)state->randSeed2)>>DITHER_SHIFT_); /* High pass filter to reduce audibility. */ highPass = current - state->previous; diff --git a/sflphone-common/libs/pjproject/third_party/portaudio/src/common/pa_dither.h b/sflphone-common/libs/pjproject/third_party/portaudio/src/common/pa_dither.h index e77ce470d2a3131684b68998e1678c48b8df61e6..a5131b27fa36cadcdaac26fd6365d299ec92292e 100644 --- a/sflphone-common/libs/pjproject/third_party/portaudio/src/common/pa_dither.h +++ b/sflphone-common/libs/pjproject/third_party/portaudio/src/common/pa_dither.h @@ -1,7 +1,7 @@ #ifndef PA_DITHER_H #define PA_DITHER_H /* - * $Id: pa_dither.h 1097 2006-08-26 08:27:53Z rossb $ + * $Id: pa_dither.h 1418 2009-10-12 21:00:53Z philburk $ * Portable Audio I/O Library triangular dither generator * * Based on the Open Source API proposed by Ross Bencina @@ -44,18 +44,24 @@ @brief Functions for generating dither noise */ +#include "pa_types.h" + #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ +/* Note that the linear congruential algorithm requires 32 bit integers + * because it uses arithmetic overflow. So use PaUint32 instead of + * unsigned long so it will work on 64 bit systems. + */ /** @brief State needed to generate a dither signal */ typedef struct PaUtilTriangularDitherGenerator{ - unsigned long previous; - unsigned long randSeed1; - unsigned long randSeed2; + PaUint32 previous; + PaUint32 randSeed1; + PaUint32 randSeed2; } PaUtilTriangularDitherGenerator; @@ -73,9 +79,9 @@ void PaUtil_InitializeTriangularDitherState( PaUtilTriangularDitherGenerator *di signed short out = (signed short)(((in>>1) + dither) >> 15); </pre> @return - A signed long with a range of +32767 to -32768 + A signed 32-bit integer with a range of +32767 to -32768 */ -signed long PaUtil_Generate16BitTriangularDither( PaUtilTriangularDitherGenerator *ditherState ); +PaInt32 PaUtil_Generate16BitTriangularDither( PaUtilTriangularDitherGenerator *ditherState ); /** diff --git a/sflphone-common/libs/pjproject/third_party/portaudio/src/common/pa_front.c b/sflphone-common/libs/pjproject/third_party/portaudio/src/common/pa_front.c index 3e9056093931cd1c42f2ee679b5ffde886c6b5cb..28f0c60e8d60fbfc56102d116c7efebea96d9419 100644 --- a/sflphone-common/libs/pjproject/third_party/portaudio/src/common/pa_front.c +++ b/sflphone-common/libs/pjproject/third_party/portaudio/src/common/pa_front.c @@ -1,5 +1,5 @@ /* - * $Id: pa_front.c 1387 2008-06-28 18:28:07Z philburk $ + * $Id: pa_front.c 1396 2008-11-03 19:31:30Z philburk $ * Portable Audio I/O Library Multi-Host API front end * Validate function parameters and manage multiple host APIs. * @@ -1506,7 +1506,7 @@ const PaStreamInfo* Pa_GetStreamInfo( PaStream *stream ) result = 0; PA_LOGAPI(("Pa_GetStreamInfo returned:\n" )); - PA_LOGAPI(("\tconst PaStreamInfo*: 0 [PaError error:%d ( %s )]\n", result, error, Pa_GetErrorText( error ) )); + PA_LOGAPI(("\tconst PaStreamInfo*: 0 [PaError error:%d ( %s )]\n", error, Pa_GetErrorText( error ) )); } else diff --git a/sflphone-common/libs/pjproject/third_party/portaudio/src/common/pa_memorybarrier.h b/sflphone-common/libs/pjproject/third_party/portaudio/src/common/pa_memorybarrier.h index 5efeed2487ad5f42efbc56c5973341db10ddf859..f6896222010f6d6d48ce32e0660e828d173da668 100644 --- a/sflphone-common/libs/pjproject/third_party/portaudio/src/common/pa_memorybarrier.h +++ b/sflphone-common/libs/pjproject/third_party/portaudio/src/common/pa_memorybarrier.h @@ -98,7 +98,7 @@ # error Memory barriers are not defined on this system. You can still compile by defining ALLOW_SMP_DANGERS, but SMP safety will not be guaranteed. # endif # endif -#elif (_MSC_VER >= 1400) +#elif (_MSC_VER >= 1400) && !defined(_WIN32_WCE) # include <intrin.h> # pragma intrinsic(_ReadWriteBarrier) # pragma intrinsic(_ReadBarrier) @@ -106,6 +106,10 @@ # define PaUtil_FullMemoryBarrier() _ReadWriteBarrier() # define PaUtil_ReadMemoryBarrier() _ReadBarrier() # define PaUtil_WriteMemoryBarrier() _WriteBarrier() +#elif defined(_WIN32_WCE) +# define PaUtil_FullMemoryBarrier() +# define PaUtil_ReadMemoryBarrier() +# define PaUtil_WriteMemoryBarrier() #elif defined(_MSC_VER) || defined(__BORLANDC__) # define PaUtil_FullMemoryBarrier() _asm { lock add [esp], 0 } # define PaUtil_ReadMemoryBarrier() _asm { lock add [esp], 0 } diff --git a/sflphone-common/libs/pjproject/third_party/portaudio/src/common/pa_process.c b/sflphone-common/libs/pjproject/third_party/portaudio/src/common/pa_process.c index 93f863caa64fd320cb1e40243a85cc8d799ebd8b..4770610b863460fb33df88b6da191e2878d7d686 100644 --- a/sflphone-common/libs/pjproject/third_party/portaudio/src/common/pa_process.c +++ b/sflphone-common/libs/pjproject/third_party/portaudio/src/common/pa_process.c @@ -1,5 +1,5 @@ /* - * $Id: pa_process.c 1341 2008-02-15 11:43:43Z rossb $ + * $Id: pa_process.c 1408 2009-03-13 16:41:39Z rossb $ * Portable Audio I/O Library * streamCallback <-> host buffer processing adapter * @@ -997,7 +997,7 @@ static unsigned long AdaptingInputOnlyProcess( PaUtilBufferProcessor *bp, bp->framesPerUserBuffer, bp->timeInfo, bp->callbackStatusFlags, bp->userData ); - bp->timeInfo->inputBufferAdcTime += frameCount * bp->samplePeriod; + bp->timeInfo->inputBufferAdcTime += bp->framesPerUserBuffer * bp->samplePeriod; } bp->framesInTempInputBuffer = 0; diff --git a/sflphone-common/libs/pjproject/third_party/portaudio/src/common/pa_ringbuffer.c b/sflphone-common/libs/pjproject/third_party/portaudio/src/common/pa_ringbuffer.c index ad9e2ae56713006d6bf29bdc2c36f70d438f8e74..310d719f2c582f21849084fcc3630488b59c245a 100644 --- a/sflphone-common/libs/pjproject/third_party/portaudio/src/common/pa_ringbuffer.c +++ b/sflphone-common/libs/pjproject/third_party/portaudio/src/common/pa_ringbuffer.c @@ -1,5 +1,5 @@ /* - * $Id: pa_ringbuffer.c 1346 2008-02-20 10:09:20Z rossb $ + * $Id: pa_ringbuffer.c 1421 2009-11-18 16:09:05Z bjornroche $ * Portable Audio I/O Library * Ring Buffer utility. * @@ -63,7 +63,7 @@ * Initialize FIFO. * elementCount must be power of 2, returns -1 if not. */ -long PaUtil_InitializeRingBuffer( PaUtilRingBuffer *rbuf, long elementSizeBytes, long elementCount, void *dataPtr ) +ring_buffer_size_t PaUtil_InitializeRingBuffer( PaUtilRingBuffer *rbuf, ring_buffer_size_t elementSizeBytes, ring_buffer_size_t elementCount, void *dataPtr ) { if( ((elementCount-1) & elementCount) != 0) return -1; /* Not Power of two. */ rbuf->bufferSize = elementCount; @@ -77,14 +77,14 @@ long PaUtil_InitializeRingBuffer( PaUtilRingBuffer *rbuf, long elementSizeBytes, /*************************************************************************** ** Return number of elements available for reading. */ -long PaUtil_GetRingBufferReadAvailable( PaUtilRingBuffer *rbuf ) +ring_buffer_size_t PaUtil_GetRingBufferReadAvailable( PaUtilRingBuffer *rbuf ) { PaUtil_ReadMemoryBarrier(); return ( (rbuf->writeIndex - rbuf->readIndex) & rbuf->bigMask ); } /*************************************************************************** ** Return number of elements available for writing. */ -long PaUtil_GetRingBufferWriteAvailable( PaUtilRingBuffer *rbuf ) +ring_buffer_size_t PaUtil_GetRingBufferWriteAvailable( PaUtilRingBuffer *rbuf ) { /* Since we are calling PaUtil_GetRingBufferReadAvailable, we don't need an aditional MB */ return ( rbuf->bufferSize - PaUtil_GetRingBufferReadAvailable(rbuf)); @@ -103,19 +103,19 @@ void PaUtil_FlushRingBuffer( PaUtilRingBuffer *rbuf ) ** If non-contiguous, size2 will be the size of second region. ** Returns room available to be written or elementCount, whichever is smaller. */ -long PaUtil_GetRingBufferWriteRegions( PaUtilRingBuffer *rbuf, long elementCount, - void **dataPtr1, long *sizePtr1, - void **dataPtr2, long *sizePtr2 ) +ring_buffer_size_t PaUtil_GetRingBufferWriteRegions( PaUtilRingBuffer *rbuf, ring_buffer_size_t elementCount, + void **dataPtr1, ring_buffer_size_t *sizePtr1, + void **dataPtr2, ring_buffer_size_t *sizePtr2 ) { - long index; - long available = PaUtil_GetRingBufferWriteAvailable( rbuf ); + ring_buffer_size_t index; + ring_buffer_size_t available = PaUtil_GetRingBufferWriteAvailable( rbuf ); if( elementCount > available ) elementCount = available; /* Check to see if write is not contiguous. */ index = rbuf->writeIndex & rbuf->smallMask; if( (index + elementCount) > rbuf->bufferSize ) { /* Write data in two blocks that wrap the buffer. */ - long firstHalf = rbuf->bufferSize - index; + ring_buffer_size_t firstHalf = rbuf->bufferSize - index; *dataPtr1 = &rbuf->buffer[index*rbuf->elementSizeBytes]; *sizePtr1 = firstHalf; *dataPtr2 = &rbuf->buffer[0]; @@ -134,7 +134,7 @@ long PaUtil_GetRingBufferWriteRegions( PaUtilRingBuffer *rbuf, long elementCount /*************************************************************************** */ -long PaUtil_AdvanceRingBufferWriteIndex( PaUtilRingBuffer *rbuf, long elementCount ) +ring_buffer_size_t PaUtil_AdvanceRingBufferWriteIndex( PaUtilRingBuffer *rbuf, ring_buffer_size_t elementCount ) { /* we need to ensure that previous writes are seen before we update the write index */ PaUtil_WriteMemoryBarrier(); @@ -147,19 +147,19 @@ long PaUtil_AdvanceRingBufferWriteIndex( PaUtilRingBuffer *rbuf, long elementCou ** If non-contiguous, size2 will be the size of second region. ** Returns room available to be written or elementCount, whichever is smaller. */ -long PaUtil_GetRingBufferReadRegions( PaUtilRingBuffer *rbuf, long elementCount, - void **dataPtr1, long *sizePtr1, - void **dataPtr2, long *sizePtr2 ) +ring_buffer_size_t PaUtil_GetRingBufferReadRegions( PaUtilRingBuffer *rbuf, ring_buffer_size_t elementCount, + void **dataPtr1, ring_buffer_size_t *sizePtr1, + void **dataPtr2, ring_buffer_size_t *sizePtr2 ) { - long index; - long available = PaUtil_GetRingBufferReadAvailable( rbuf ); + ring_buffer_size_t index; + ring_buffer_size_t available = PaUtil_GetRingBufferReadAvailable( rbuf ); if( elementCount > available ) elementCount = available; /* Check to see if read is not contiguous. */ index = rbuf->readIndex & rbuf->smallMask; if( (index + elementCount) > rbuf->bufferSize ) { /* Write data in two blocks that wrap the buffer. */ - long firstHalf = rbuf->bufferSize - index; + ring_buffer_size_t firstHalf = rbuf->bufferSize - index; *dataPtr1 = &rbuf->buffer[index*rbuf->elementSizeBytes]; *sizePtr1 = firstHalf; *dataPtr2 = &rbuf->buffer[0]; @@ -176,7 +176,7 @@ long PaUtil_GetRingBufferReadRegions( PaUtilRingBuffer *rbuf, long elementCount, } /*************************************************************************** */ -long PaUtil_AdvanceRingBufferReadIndex( PaUtilRingBuffer *rbuf, long elementCount ) +ring_buffer_size_t PaUtil_AdvanceRingBufferReadIndex( PaUtilRingBuffer *rbuf, ring_buffer_size_t elementCount ) { /* we need to ensure that previous writes are always seen before updating the index. */ PaUtil_WriteMemoryBarrier(); @@ -185,9 +185,9 @@ long PaUtil_AdvanceRingBufferReadIndex( PaUtilRingBuffer *rbuf, long elementCoun /*************************************************************************** ** Return elements written. */ -long PaUtil_WriteRingBuffer( PaUtilRingBuffer *rbuf, const void *data, long elementCount ) +ring_buffer_size_t PaUtil_WriteRingBuffer( PaUtilRingBuffer *rbuf, const void *data, ring_buffer_size_t elementCount ) { - long size1, size2, numWritten; + ring_buffer_size_t size1, size2, numWritten; void *data1, *data2; numWritten = PaUtil_GetRingBufferWriteRegions( rbuf, elementCount, &data1, &size1, &data2, &size2 ); if( size2 > 0 ) @@ -207,9 +207,9 @@ long PaUtil_WriteRingBuffer( PaUtilRingBuffer *rbuf, const void *data, long elem /*************************************************************************** ** Return elements read. */ -long PaUtil_ReadRingBuffer( PaUtilRingBuffer *rbuf, void *data, long elementCount ) +ring_buffer_size_t PaUtil_ReadRingBuffer( PaUtilRingBuffer *rbuf, void *data, ring_buffer_size_t elementCount ) { - long size1, size2, numRead; + ring_buffer_size_t size1, size2, numRead; void *data1, *data2; numRead = PaUtil_GetRingBufferReadRegions( rbuf, elementCount, &data1, &size1, &data2, &size2 ); if( size2 > 0 ) diff --git a/sflphone-common/libs/pjproject/third_party/portaudio/src/common/pa_ringbuffer.h b/sflphone-common/libs/pjproject/third_party/portaudio/src/common/pa_ringbuffer.h index fd92882a6d2b737adb4ff60718fec2218ea213fa..7efd1914d92c45b38929054ae33a7d1260bbaf51 100644 --- a/sflphone-common/libs/pjproject/third_party/portaudio/src/common/pa_ringbuffer.h +++ b/sflphone-common/libs/pjproject/third_party/portaudio/src/common/pa_ringbuffer.h @@ -1,7 +1,7 @@ #ifndef PA_RINGBUFFER_H #define PA_RINGBUFFER_H /* - * $Id: pa_ringbuffer.h 1347 2008-02-21 04:54:36Z rossb $ + * $Id: pa_ringbuffer.h 1421 2009-11-18 16:09:05Z bjornroche $ * Portable Audio I/O Library * Ring Buffer utility. * @@ -67,6 +67,21 @@ the use of the ring buffer. */ +#if defined(__APPLE__) +#include <sys/types.h> +typedef int32_t ring_buffer_size_t; +#elif defined( __GNUC__ ) +typedef long ring_buffer_size_t; +#elif (_MSC_VER >= 1400) +typedef long ring_buffer_size_t; +#elif defined(_MSC_VER) || defined(__BORLANDC__) +typedef long ring_buffer_size_t; +#else +typedef long ring_buffer_size_t; +#endif + + + #ifdef __cplusplus extern "C" { @@ -74,12 +89,12 @@ extern "C" typedef struct PaUtilRingBuffer { - long bufferSize; /**< Number of elements in FIFO. Power of 2. Set by PaUtil_InitRingBuffer. */ - long writeIndex; /**< Index of next writable element. Set by PaUtil_AdvanceRingBufferWriteIndex. */ - long readIndex; /**< Index of next readable element. Set by PaUtil_AdvanceRingBufferReadIndex. */ - long bigMask; /**< Used for wrapping indices with extra bit to distinguish full/empty. */ - long smallMask; /**< Used for fitting indices to buffer. */ - long elementSizeBytes; /**< Number of bytes per element. */ + ring_buffer_size_t bufferSize; /**< Number of elements in FIFO. Power of 2. Set by PaUtil_InitRingBuffer. */ + ring_buffer_size_t writeIndex; /**< Index of next writable element. Set by PaUtil_AdvanceRingBufferWriteIndex. */ + ring_buffer_size_t readIndex; /**< Index of next readable element. Set by PaUtil_AdvanceRingBufferReadIndex. */ + ring_buffer_size_t bigMask; /**< Used for wrapping indices with extra bit to distinguish full/empty. */ + ring_buffer_size_t smallMask; /**< Used for fitting indices to buffer. */ + ring_buffer_size_t elementSizeBytes; /**< Number of bytes per element. */ char *buffer; /**< Pointer to the buffer containing the actual data. */ }PaUtilRingBuffer; @@ -96,7 +111,7 @@ typedef struct PaUtilRingBuffer @return -1 if elementCount is not a power of 2, otherwise 0. */ -long PaUtil_InitializeRingBuffer( PaUtilRingBuffer *rbuf, long elementSizeBytes, long elementCount, void *dataPtr ); +ring_buffer_size_t PaUtil_InitializeRingBuffer( PaUtilRingBuffer *rbuf, ring_buffer_size_t elementSizeBytes, ring_buffer_size_t elementCount, void *dataPtr ); /** Clear buffer. Should only be called when buffer is NOT being read. @@ -110,7 +125,7 @@ void PaUtil_FlushRingBuffer( PaUtilRingBuffer *rbuf ); @return The number of elements available for writing. */ -long PaUtil_GetRingBufferWriteAvailable( PaUtilRingBuffer *rbuf ); +ring_buffer_size_t PaUtil_GetRingBufferWriteAvailable( PaUtilRingBuffer *rbuf ); /** Retrieve the number of elements available in the ring buffer for reading. @@ -118,7 +133,7 @@ long PaUtil_GetRingBufferWriteAvailable( PaUtilRingBuffer *rbuf ); @return The number of elements available for reading. */ -long PaUtil_GetRingBufferReadAvailable( PaUtilRingBuffer *rbuf ); +ring_buffer_size_t PaUtil_GetRingBufferReadAvailable( PaUtilRingBuffer *rbuf ); /** Write data to the ring buffer. @@ -130,7 +145,7 @@ long PaUtil_GetRingBufferReadAvailable( PaUtilRingBuffer *rbuf ); @return The number of elements written. */ -long PaUtil_WriteRingBuffer( PaUtilRingBuffer *rbuf, const void *data, long elementCount ); +ring_buffer_size_t PaUtil_WriteRingBuffer( PaUtilRingBuffer *rbuf, const void *data, ring_buffer_size_t elementCount ); /** Read data from the ring buffer. @@ -142,7 +157,7 @@ long PaUtil_WriteRingBuffer( PaUtilRingBuffer *rbuf, const void *data, long elem @return The number of elements read. */ -long PaUtil_ReadRingBuffer( PaUtilRingBuffer *rbuf, void *data, long elementCount ); +ring_buffer_size_t PaUtil_ReadRingBuffer( PaUtilRingBuffer *rbuf, void *data, ring_buffer_size_t elementCount ); /** Get address of region(s) to which we can write data. @@ -164,9 +179,9 @@ long PaUtil_ReadRingBuffer( PaUtilRingBuffer *rbuf, void *data, long elementCoun @return The room available to be written or elementCount, whichever is smaller. */ -long PaUtil_GetRingBufferWriteRegions( PaUtilRingBuffer *rbuf, long elementCount, - void **dataPtr1, long *sizePtr1, - void **dataPtr2, long *sizePtr2 ); +ring_buffer_size_t PaUtil_GetRingBufferWriteRegions( PaUtilRingBuffer *rbuf, ring_buffer_size_t elementCount, + void **dataPtr1, ring_buffer_size_t *sizePtr1, + void **dataPtr2, ring_buffer_size_t *sizePtr2 ); /** Advance the write index to the next location to be written. @@ -176,7 +191,7 @@ long PaUtil_GetRingBufferWriteRegions( PaUtilRingBuffer *rbuf, long elementCount @return The new position. */ -long PaUtil_AdvanceRingBufferWriteIndex( PaUtilRingBuffer *rbuf, long elementCount ); +ring_buffer_size_t PaUtil_AdvanceRingBufferWriteIndex( PaUtilRingBuffer *rbuf, ring_buffer_size_t elementCount ); /** Get address of region(s) from which we can write data. @@ -198,9 +213,9 @@ long PaUtil_AdvanceRingBufferWriteIndex( PaUtilRingBuffer *rbuf, long elementCou @return The number of elements available for reading. */ -long PaUtil_GetRingBufferReadRegions( PaUtilRingBuffer *rbuf, long elementCount, - void **dataPtr1, long *sizePtr1, - void **dataPtr2, long *sizePtr2 ); +ring_buffer_size_t PaUtil_GetRingBufferReadRegions( PaUtilRingBuffer *rbuf, ring_buffer_size_t elementCount, + void **dataPtr1, ring_buffer_size_t *sizePtr1, + void **dataPtr2, ring_buffer_size_t *sizePtr2 ); /** Advance the read index to the next location to be read. @@ -210,7 +225,7 @@ long PaUtil_GetRingBufferReadRegions( PaUtilRingBuffer *rbuf, long elementCount, @return The new position. */ -long PaUtil_AdvanceRingBufferReadIndex( PaUtilRingBuffer *rbuf, long elementCount ); +ring_buffer_size_t PaUtil_AdvanceRingBufferReadIndex( PaUtilRingBuffer *rbuf, ring_buffer_size_t elementCount ); #ifdef __cplusplus } diff --git a/sflphone-common/libs/pjproject/third_party/portaudio/src/hostapi/alsa/pa_linux_alsa.c b/sflphone-common/libs/pjproject/third_party/portaudio/src/hostapi/alsa/pa_linux_alsa.c index 75b6204680f808b7b7a12f7b0dc3ea86fc66f5b3..224f4ff636aad211a311cbd4154706602116464f 100644 --- a/sflphone-common/libs/pjproject/third_party/portaudio/src/hostapi/alsa/pa_linux_alsa.c +++ b/sflphone-common/libs/pjproject/third_party/portaudio/src/hostapi/alsa/pa_linux_alsa.c @@ -1,11 +1,12 @@ /* - * $Id: pa_linux_alsa.c 1362 2008-02-28 21:43:57Z aknudsen $ + * $Id: pa_linux_alsa.c 1415 2009-06-03 18:57:56Z aknudsen $ * PortAudio Portable Real-Time Audio Library * Latest Version at: http://www.portaudio.com * ALSA implementation by Joshua Haberman and Arve Knudsen * * Copyright (c) 2002 Joshua Haberman <joshua@haberman.com> - * Copyright (c) 2005-2007 Arve Knudsen <aknuds-1@broadpark.no> + * Copyright (c) 2005-2009 Arve Knudsen <arve.knudsen@gmail.com> + * Copyright (c) 2008 Kevin Kofler <kevin.kofler@chello.at> * * Based on the Open Source API proposed by Ross Bencina * Copyright (c) 1999-2002 Ross Bencina, Phil Burk @@ -99,6 +100,7 @@ static int aErr_; /* Used with ENSURE_ */ static int numPeriods_ = 4; +static int busyRetries_ = 100; int PaAlsa_SetNumPeriods( int numPeriods ) { @@ -118,6 +120,8 @@ typedef struct unsigned long framesPerBuffer; int numUserChannels, numHostChannels; int userInterleaved, hostInterleaved; + int canMmap; + void *nonMmapBuffer; PaDeviceIndex device; /* Keep the device index */ snd_pcm_t *pcm; @@ -321,7 +325,7 @@ static void Terminate( struct PaUtilHostApiRepresentation *hostApi ) * and a suitable result returned. The device is closed before returning. */ static PaError GropeDevice( snd_pcm_t* pcm, int isPlug, StreamDirection mode, int openBlocking, - PaAlsaDeviceInfo* devInfo, int* canMmap ) + PaAlsaDeviceInfo* devInfo ) { PaError result = paNoError; snd_pcm_hw_params_t *hwParams; @@ -354,9 +358,6 @@ static PaError GropeDevice( snd_pcm_t* pcm, int isPlug, StreamDirection mode, in snd_pcm_hw_params_alloca( &hwParams ); snd_pcm_hw_params_any( pcm, hwParams ); - *canMmap = snd_pcm_hw_params_test_access( pcm, hwParams, SND_PCM_ACCESS_MMAP_INTERLEAVED ) >= 0 || - snd_pcm_hw_params_test_access( pcm, hwParams, SND_PCM_ACCESS_MMAP_NONINTERLEAVED ) >= 0; - if( defaultSr >= 0 ) { /* Could be that the device opened in one mode supports samplerates that the other mode wont have, @@ -539,7 +540,7 @@ static int IgnorePlugin( const char *pluginId ) **/ static int OpenPcm( snd_pcm_t **pcmp, const char *name, snd_pcm_stream_t stream, int mode, int waitOnBusy ) { - int tries = 0, maxTries = waitOnBusy ? 100 : 0; + int tries = 0, maxTries = waitOnBusy ? busyRetries_ : 0; int ret = snd_pcm_open( pcmp, name, stream, mode ); for( tries = 0; tries < maxTries && -EBUSY == ret; ++tries ) { @@ -566,7 +567,6 @@ static PaError FillInDevInfo( PaAlsaHostApiRepresentation *alsaApi, HwDevInfo* d PaError result = 0; PaDeviceInfo *baseDeviceInfo = &devInfo->baseDeviceInfo; snd_pcm_t *pcm; - int canMmap = -1; PaUtilHostApiRepresentation *baseApi = &alsaApi->baseHostApiRep; /* Zero fields */ @@ -580,8 +580,7 @@ static PaError FillInDevInfo( PaAlsaHostApiRepresentation *alsaApi, HwDevInfo* d OpenPcm( &pcm, deviceName->alsaName, SND_PCM_STREAM_CAPTURE, blocking, 0 ) >= 0 ) { - if( GropeDevice( pcm, deviceName->isPlug, StreamDirection_In, blocking, devInfo, - &canMmap ) != paNoError ) + if( GropeDevice( pcm, deviceName->isPlug, StreamDirection_In, blocking, devInfo ) != paNoError ) { /* Error */ PA_DEBUG(("%s: Failed groping %s for capture\n", __FUNCTION__, deviceName->alsaName)); @@ -594,8 +593,7 @@ static PaError FillInDevInfo( PaAlsaHostApiRepresentation *alsaApi, HwDevInfo* d OpenPcm( &pcm, deviceName->alsaName, SND_PCM_STREAM_PLAYBACK, blocking, 0 ) >= 0 ) { - if( GropeDevice( pcm, deviceName->isPlug, StreamDirection_Out, blocking, devInfo, - &canMmap ) != paNoError ) + if( GropeDevice( pcm, deviceName->isPlug, StreamDirection_Out, blocking, devInfo ) != paNoError ) { /* Error */ PA_DEBUG(("%s: Failed groping %s for playback\n", __FUNCTION__, deviceName->alsaName)); @@ -603,12 +601,6 @@ static PaError FillInDevInfo( PaAlsaHostApiRepresentation *alsaApi, HwDevInfo* d } } - if( 0 == canMmap ) - { - PA_DEBUG(("%s: Device %s doesn't support mmap\n", __FUNCTION__, deviceName->alsaName)); - goto end; - } - baseDeviceInfo->structVersion = 2; baseDeviceInfo->hostApi = alsaApi->hostApiIndex; baseDeviceInfo->name = deviceName->name; @@ -1197,6 +1189,8 @@ static PaError PaAlsaStreamComponent_Initialize( PaAlsaStreamComponent *self, Pa self->hostInterleaved = self->userInterleaved = !(userSampleFormat & paNonInterleaved); self->numUserChannels = params->channelCount; self->streamDir = streamDir; + self->canMmap = 0; + self->nonMmapBuffer = NULL; if( !callbackMode && !self->userInterleaved ) { @@ -1239,6 +1233,7 @@ static PaError PaAlsaStreamComponent_InitialConfigure( PaAlsaStreamComponent *se PaError result = paNoError; snd_pcm_access_t accessMode, alternateAccessMode; + snd_pcm_access_t rwAccessMode, alternateRwAccessMode; int dir = 0; snd_pcm_t *pcm = self->pcm; double sr = *sampleRate; @@ -1258,32 +1253,40 @@ static PaError PaAlsaStreamComponent_InitialConfigure( PaAlsaStreamComponent *se if( self->userInterleaved ) { accessMode = SND_PCM_ACCESS_MMAP_INTERLEAVED; + rwAccessMode = SND_PCM_ACCESS_RW_INTERLEAVED; alternateAccessMode = SND_PCM_ACCESS_MMAP_NONINTERLEAVED; + alternateRwAccessMode = SND_PCM_ACCESS_RW_NONINTERLEAVED; } else { accessMode = SND_PCM_ACCESS_MMAP_NONINTERLEAVED; + rwAccessMode = SND_PCM_ACCESS_RW_NONINTERLEAVED; alternateAccessMode = SND_PCM_ACCESS_MMAP_INTERLEAVED; + alternateRwAccessMode = SND_PCM_ACCESS_RW_INTERLEAVED; } /* If requested access mode fails, try alternate mode */ + self->canMmap = 1; if( snd_pcm_hw_params_set_access( pcm, hwParams, accessMode ) < 0 ) { - int err = 0; - if( (err = snd_pcm_hw_params_set_access( pcm, hwParams, alternateAccessMode )) < 0) + if( snd_pcm_hw_params_set_access( pcm, hwParams, rwAccessMode ) >= 0 ) + self->canMmap = 0; + else { - result = paUnanticipatedHostError; - if( -EINVAL == err ) + if( snd_pcm_hw_params_set_access( pcm, hwParams, alternateAccessMode ) < 0 ) { - PaUtil_SetLastHostErrorInfo( paALSA, err, "PA ALSA requires that a device supports mmap access" ); - } - else - { - PaUtil_SetLastHostErrorInfo( paALSA, err, snd_strerror( err ) ); + int err = 0; + if( (err = snd_pcm_hw_params_set_access( pcm, hwParams, alternateRwAccessMode )) >= 0) + self->canMmap = 0; + else + { + result = paUnanticipatedHostError; + PaUtil_SetLastHostErrorInfo( paALSA, err, snd_strerror( err ) ); + goto error; + } } - goto error; + /* Flip mode */ + self->hostInterleaved = !self->userInterleaved; } - /* Flip mode */ - self->hostInterleaved = !self->userInterleaved; } ENSURE_( snd_pcm_hw_params_set_format( pcm, hwParams, self->nativeFormat ), paUnanticipatedHostError ); @@ -1361,7 +1364,7 @@ static PaError PaAlsaStreamComponent_FinishConfigure( PaAlsaStreamComponent *sel ENSURE_( snd_pcm_sw_params_set_avail_min( self->pcm, swParams, self->framesPerBuffer ), paUnanticipatedHostError ); ENSURE_( snd_pcm_sw_params_set_xfer_align( self->pcm, swParams, 1 ), paUnanticipatedHostError ); - ENSURE_( snd_pcm_sw_params_set_tstamp_mode( self->pcm, swParams, SND_PCM_TSTAMP_MMAP ), paUnanticipatedHostError ); + ENSURE_( snd_pcm_sw_params_set_tstamp_mode( self->pcm, swParams, SND_PCM_TSTAMP_ENABLE ), paUnanticipatedHostError ); /* Set the parameters! */ ENSURE_( snd_pcm_sw_params( self->pcm, swParams ), paUnanticipatedHostError ); @@ -1589,6 +1592,10 @@ static PaError PaAlsaStreamComponent_DetermineFramesPerBuffer( PaAlsaStreamCompo } } + /* non-mmap mode needs a reasonably-sized buffer or it'll stutter */ + if( !self->canMmap && framesPerHostBuffer < 2048 ) + framesPerHostBuffer = 2048; + assert( framesPerHostBuffer > 0 ); { snd_pcm_uframes_t min = 0, max = 0; @@ -1831,12 +1838,13 @@ static PaError PaAlsaStream_DetermineFramesPerBuffer( PaAlsaStream* self, double PA_UNLESS( framesPerHostBuffer != 0, paInternalError ); self->maxFramesPerHostBuffer = framesPerHostBuffer; - if( !accurate ) + if( !self->playback.canMmap || !accurate ) { /* Don't know the exact size per host buffer */ *hostBufferSizeMode = paUtilBoundedHostBufferSize; /* Raise upper bound */ - ++self->maxFramesPerHostBuffer; + if( !accurate ) + ++self->maxFramesPerHostBuffer; } error: @@ -1995,11 +2003,11 @@ static PaError OpenStream( struct PaUtilHostApiRepresentation *hostApi, /* Ok, buffer processor is initialized, now we can deduce it's latency */ if( numInputChannels > 0 ) - stream->streamRepresentation.streamInfo.inputLatency = inputLatency + PaUtil_GetBufferProcessorInputLatency( - &stream->bufferProcessor ); + stream->streamRepresentation.streamInfo.inputLatency = inputLatency + (PaTime)( + PaUtil_GetBufferProcessorInputLatency( &stream->bufferProcessor ) / sampleRate); if( numOutputChannels > 0 ) - stream->streamRepresentation.streamInfo.outputLatency = outputLatency + PaUtil_GetBufferProcessorOutputLatency( - &stream->bufferProcessor ); + stream->streamRepresentation.streamInfo.outputLatency = outputLatency + (PaTime)( + PaUtil_GetBufferProcessorOutputLatency( &stream->bufferProcessor ) / sampleRate); *s = (PaStream*)stream; @@ -2059,9 +2067,11 @@ static PaError AlsaStart( PaAlsaStream *stream, int priming ) { /* Buffer isn't primed, so prepare and silence */ ENSURE_( snd_pcm_prepare( stream->playback.pcm ), paUnanticipatedHostError ); - SilenceBuffer( stream ); + if( stream->playback.canMmap ) + SilenceBuffer( stream ); } - ENSURE_( snd_pcm_start( stream->playback.pcm ), paUnanticipatedHostError ); + if( stream->playback.canMmap ) + ENSURE_( snd_pcm_start( stream->playback.pcm ), paUnanticipatedHostError ); } else ENSURE_( snd_pcm_prepare( stream->playback.pcm ), paUnanticipatedHostError ); @@ -2390,6 +2400,7 @@ static PaError PaAlsaStream_HandleXrun( PaAlsaStream *self ) snd_pcm_status_t *st; PaTime now = PaUtil_GetTime(); snd_timestamp_t t; + int errplayback = 0, errcapture = 0; snd_pcm_status_alloca( &st ); @@ -2400,6 +2411,7 @@ static PaError PaAlsaStream_HandleXrun( PaAlsaStream *self ) { snd_pcm_status_get_trigger_tstamp( st, &t ); self->underrun = now * 1000 - ((PaTime) t.tv_sec * 1000 + (PaTime) t.tv_usec / 1000); + errplayback = snd_pcm_recover( self->playback.pcm, -EPIPE, 0 ); } } if( self->capture.pcm ) @@ -2409,10 +2421,12 @@ static PaError PaAlsaStream_HandleXrun( PaAlsaStream *self ) { snd_pcm_status_get_trigger_tstamp( st, &t ); self->overrun = now * 1000 - ((PaTime) t.tv_sec * 1000 + (PaTime) t.tv_usec / 1000); + errcapture = snd_pcm_recover( self->capture.pcm, -EPIPE, 0 ); } } - PA_ENSURE( AlsaRestart( self ) ); + if( errplayback || errcapture ) + PA_ENSURE( AlsaRestart( self ) ); end: return result; @@ -2563,7 +2577,7 @@ static void CalculateTimeInfo( PaAlsaStream *stream, PaStreamCallbackTimeInfo *t static PaError PaAlsaStreamComponent_EndProcessing( PaAlsaStreamComponent *self, unsigned long numFrames, int *xrun ) { PaError result = paNoError; - int res; + int res = 0; /* @concern FullDuplex It is possible that only one direction is marked ready after polling, and processed * afterwards @@ -2571,7 +2585,34 @@ static PaError PaAlsaStreamComponent_EndProcessing( PaAlsaStreamComponent *self, if( !self->ready ) goto end; - res = snd_pcm_mmap_commit( self->pcm, self->offset, numFrames ); + if( !self->canMmap && StreamDirection_Out == self->streamDir ) + { + /* Play sound */ + if( self->hostInterleaved ) + res = snd_pcm_writei( self->pcm, self->nonMmapBuffer, numFrames ); + else + { + void *bufs[self->numHostChannels]; + int bufsize = snd_pcm_format_size( self->nativeFormat, self->framesPerBuffer + 1 ); + unsigned char *buffer = self->nonMmapBuffer; + int i; + for( i = 0; i < self->numHostChannels; ++i ) + { + bufs[i] = buffer; + buffer += bufsize; + } + res = snd_pcm_writen( self->pcm, bufs, numFrames ); + } + } + + if( self->canMmap ) + res = snd_pcm_mmap_commit( self->pcm, self->offset, numFrames ); + else + { + free( self->nonMmapBuffer ); + self->nonMmapBuffer = NULL; + } + if( res == -EPIPE || res == -ESTRPIPE ) { *xrun = 1; @@ -2611,7 +2652,7 @@ static PaError PaAlsaStreamComponent_DoChannelAdaption( PaAlsaStreamComponent *s if( self->hostInterleaved ) { int swidth = snd_pcm_format_size( self->nativeFormat, 1 ); - unsigned char *buffer = ExtractAddress( self->channelAreas, self->offset ); + unsigned char *buffer = self->canMmap ? ExtractAddress( self->channelAreas, self->offset ) : self->nonMmapBuffer; /* Start after the last user channel */ p = buffer + self->numUserChannels * swidth; @@ -2991,13 +3032,23 @@ static PaError PaAlsaStreamComponent_RegisterChannels( PaAlsaStreamComponent* se goto end; } - ENSURE_( snd_pcm_mmap_begin( self->pcm, &areas, &self->offset, numFrames ), paUnanticipatedHostError ); + if( self->canMmap ) + { + ENSURE_( snd_pcm_mmap_begin( self->pcm, &areas, &self->offset, numFrames ), paUnanticipatedHostError ); + /* @concern ChannelAdaption Buffer address is recorded so we can do some channel adaption later */ + self->channelAreas = (snd_pcm_channel_area_t *)areas; + } + else + { + free( self->nonMmapBuffer ); + self->nonMmapBuffer = calloc( self->numHostChannels, snd_pcm_format_size( self->nativeFormat, self->framesPerBuffer + 1 ) ); + } if( self->hostInterleaved ) { int swidth = snd_pcm_format_size( self->nativeFormat, 1 ); - p = buffer = ExtractAddress( areas, self->offset ); + p = buffer = self->canMmap ? ExtractAddress( areas, self->offset ) : self->nonMmapBuffer; for( i = 0; i < self->numUserChannels; ++i ) { /* We're setting the channels up to userChannels, but the stride will be hostChannels samples */ @@ -3007,16 +3058,52 @@ static PaError PaAlsaStreamComponent_RegisterChannels( PaAlsaStreamComponent* se } else { - for( i = 0; i < self->numUserChannels; ++i ) + if( self->canMmap ) + for( i = 0; i < self->numUserChannels; ++i ) + { + area = areas + i; + buffer = ExtractAddress( area, self->offset ); + setChannel( bp, i, buffer, 1 ); + } + else { - area = areas + i; - buffer = ExtractAddress( area, self->offset ); - setChannel( bp, i, buffer, 1 ); + int bufsize = snd_pcm_format_size( self->nativeFormat, self->framesPerBuffer + 1 ); + buffer = self->nonMmapBuffer; + for( i = 0; i < self->numUserChannels; ++i ) + { + setChannel( bp, i, buffer, 1 ); + buffer += bufsize; + } } } - /* @concern ChannelAdaption Buffer address is recorded so we can do some channel adaption later */ - self->channelAreas = (snd_pcm_channel_area_t *)areas; + if( !self->canMmap && StreamDirection_In == self->streamDir ) + { + /* Read sound */ + int res; + if( self->hostInterleaved ) + res = snd_pcm_readi( self->pcm, self->nonMmapBuffer, *numFrames ); + else + { + void *bufs[self->numHostChannels]; + int bufsize = snd_pcm_format_size( self->nativeFormat, self->framesPerBuffer + 1 ); + unsigned char *buffer = self->nonMmapBuffer; + int i; + for( i = 0; i < self->numHostChannels; ++i ) + { + bufs[i] = buffer; + buffer += bufsize; + } + res = snd_pcm_readn( self->pcm, bufs, *numFrames ); + } + if( res == -EPIPE || res == -ESTRPIPE ) + { + *xrun = 1; + *numFrames = 0; + free( self->nonMmapBuffer ); + self->nonMmapBuffer = NULL; + } + } end: error: @@ -3584,3 +3671,9 @@ PaError PaAlsa_GetStreamOutputCard(PaStream* s, int* card) { error: return result; } + +PaError PaAlsa_SetRetriesBusy( int retries ) +{ + busyRetries_ = retries; + return paNoError; +} diff --git a/sflphone-common/libs/pjproject/third_party/portaudio/src/hostapi/asio/iasiothiscallresolver.cpp b/sflphone-common/libs/pjproject/third_party/portaudio/src/hostapi/asio/iasiothiscallresolver.cpp index 1b4b33781f155d3eb78dbbfe53dba83bee14ac08..8dfefbd67b95ffc0d64194ab75ab7a05e1b1f72f 100644 --- a/sflphone-common/libs/pjproject/third_party/portaudio/src/hostapi/asio/iasiothiscallresolver.cpp +++ b/sflphone-common/libs/pjproject/third_party/portaudio/src/hostapi/asio/iasiothiscallresolver.cpp @@ -71,7 +71,7 @@ (IUnknown functions) 0 virtual HRESULT STDMETHODCALLTYPE (*QueryInterface)(REFIID riid, void **ppv) = 0; 4 virtual ULONG STDMETHODCALLTYPE (*AddRef)() = 0; - 8 virtual ULONG STDMETHODCALLTYPE (*Release)() = 0; + 8 virtual ULONG STDMETHODCALLTYPE (*Release)() = 0; (IASIO functions) 12 virtual ASIOBool (*init)(void *sysHandle) = 0; @@ -128,7 +128,7 @@ with MSVC, and requires that you ship the OpenASIO DLL with your application. - + ACKNOWLEDGEMENTS Ross Bencina: worked out the thiscall details above, wrote the original @@ -186,7 +186,7 @@ extern IASIO* theAsioDriver; // The following macros define the inline assembler for BORLAND first then gcc -#if defined(__BCPLUSPLUS__) || defined(__BORLANDC__) +#if defined(__BCPLUSPLUS__) || defined(__BORLANDC__) #define CALL_THISCALL_0( resultName, thisPtr, funcOffset )\ @@ -277,7 +277,7 @@ extern IASIO* theAsioDriver; :"=a"(resultName) /* Output Operands */ \ :"c"(thisPtr) /* Input Operands */ \ ); \ - + #define CALL_VOID_THISCALL_1( thisPtr, funcOffset, param1 ) \ __asm__ __volatile__ ("pushl %0\n\t" \ @@ -287,7 +287,7 @@ extern IASIO* theAsioDriver; :"r"(param1), /* Input Operands */ \ "c"(thisPtr) \ ); \ - + #define CALL_THISCALL_1( resultName, thisPtr, funcOffset, param1 ) \ __asm__ __volatile__ ("pushl %1\n\t" \ @@ -297,7 +297,7 @@ extern IASIO* theAsioDriver; :"r"(param1), /* Input Operands */ \ "c"(thisPtr) \ ); \ - + #define CALL_THISCALL_1_DOUBLE( resultName, thisPtr, funcOffset, param1 ) \ __asm__ __volatile__ ("pushl 4(%1)\n\t" \ @@ -310,7 +310,7 @@ extern IASIO* theAsioDriver; /* when using GCC 3.3.3, and maybe later versions*/\ "c"(thisPtr) \ ); \ - + #define CALL_THISCALL_2( resultName, thisPtr, funcOffset, param1, param2 ) \ __asm__ __volatile__ ("pushl %1\n\t" \ @@ -322,7 +322,7 @@ extern IASIO* theAsioDriver; "r"(param1), \ "c"(thisPtr) \ ); \ - + #define CALL_THISCALL_4( resultName, thisPtr, funcOffset, param1, param2, param3, param4 )\ __asm__ __volatile__ ("pushl %1\n\t" \ @@ -338,7 +338,7 @@ extern IASIO* theAsioDriver; "r"(param1), \ "c"(thisPtr) \ ); \ - + #endif @@ -354,8 +354,8 @@ IASIOThiscallResolver::IASIOThiscallResolver() } // Constructor called from ASIOInit() below -IASIOThiscallResolver::IASIOThiscallResolver (IASIO* that) - : that_ (that) +IASIOThiscallResolver::IASIOThiscallResolver(IASIO* that) +: that_( that ) { } @@ -363,11 +363,11 @@ IASIOThiscallResolver::IASIOThiscallResolver (IASIO* that) // really a COM object, just a wrapper which will work with the ASIO SDK. // If you wanted to use ASIO without the SDK you might want to implement COM // aggregation in these methods. -HRESULT STDMETHODCALLTYPE IASIOThiscallResolver::QueryInterface (REFIID riid, void **ppv) +HRESULT STDMETHODCALLTYPE IASIOThiscallResolver::QueryInterface(REFIID riid, void **ppv) { - (void) riid; // suppress unused variable warning + (void)riid; // suppress unused variable warning - assert (false); // this function should never be called by the ASIO SDK. + assert( false ); // this function should never be called by the ASIO SDK. *ppv = NULL; return E_NOINTERFACE; @@ -375,176 +375,176 @@ HRESULT STDMETHODCALLTYPE IASIOThiscallResolver::QueryInterface (REFIID riid, vo ULONG STDMETHODCALLTYPE IASIOThiscallResolver::AddRef() { - assert (false); // this function should never be called by the ASIO SDK. + assert( false ); // this function should never be called by the ASIO SDK. return 1; } ULONG STDMETHODCALLTYPE IASIOThiscallResolver::Release() { - assert (false); // this function should never be called by the ASIO SDK. - + assert( false ); // this function should never be called by the ASIO SDK. + return 1; } // Implement the IASIO interface methods by performing the vptr manipulation // described above then delegating to the real implementation. -ASIOBool IASIOThiscallResolver::init (void *sysHandle) +ASIOBool IASIOThiscallResolver::init(void *sysHandle) { ASIOBool result; - CALL_THISCALL_1 (result, that_, 12, sysHandle); + CALL_THISCALL_1( result, that_, 12, sysHandle ); return result; } -void IASIOThiscallResolver::getDriverName (char *name) +void IASIOThiscallResolver::getDriverName(char *name) { - CALL_VOID_THISCALL_1 (that_, 16, name); + CALL_VOID_THISCALL_1( that_, 16, name ); } long IASIOThiscallResolver::getDriverVersion() { ASIOBool result; - CALL_THISCALL_0 (result, that_, 20); + CALL_THISCALL_0( result, that_, 20 ); return result; } -void IASIOThiscallResolver::getErrorMessage (char *string) +void IASIOThiscallResolver::getErrorMessage(char *string) { - CALL_VOID_THISCALL_1 (that_, 24, string); + CALL_VOID_THISCALL_1( that_, 24, string ); } ASIOError IASIOThiscallResolver::start() { ASIOBool result; - CALL_THISCALL_0 (result, that_, 28); + CALL_THISCALL_0( result, that_, 28 ); return result; } ASIOError IASIOThiscallResolver::stop() { ASIOBool result; - CALL_THISCALL_0 (result, that_, 32); + CALL_THISCALL_0( result, that_, 32 ); return result; } -ASIOError IASIOThiscallResolver::getChannels (long *numInputChannels, long *numOutputChannels) +ASIOError IASIOThiscallResolver::getChannels(long *numInputChannels, long *numOutputChannels) { ASIOBool result; - CALL_THISCALL_2 (result, that_, 36, numInputChannels, numOutputChannels); + CALL_THISCALL_2( result, that_, 36, numInputChannels, numOutputChannels ); return result; } -ASIOError IASIOThiscallResolver::getLatencies (long *inputLatency, long *outputLatency) +ASIOError IASIOThiscallResolver::getLatencies(long *inputLatency, long *outputLatency) { ASIOBool result; - CALL_THISCALL_2 (result, that_, 40, inputLatency, outputLatency); + CALL_THISCALL_2( result, that_, 40, inputLatency, outputLatency ); return result; } -ASIOError IASIOThiscallResolver::getBufferSize (long *minSize, long *maxSize, +ASIOError IASIOThiscallResolver::getBufferSize(long *minSize, long *maxSize, long *preferredSize, long *granularity) { ASIOBool result; - CALL_THISCALL_4 (result, that_, 44, minSize, maxSize, preferredSize, granularity); + CALL_THISCALL_4( result, that_, 44, minSize, maxSize, preferredSize, granularity ); return result; } -ASIOError IASIOThiscallResolver::canSampleRate (ASIOSampleRate sampleRate) +ASIOError IASIOThiscallResolver::canSampleRate(ASIOSampleRate sampleRate) { ASIOBool result; - CALL_THISCALL_1_DOUBLE (result, that_, 48, sampleRate); + CALL_THISCALL_1_DOUBLE( result, that_, 48, sampleRate ); return result; } -ASIOError IASIOThiscallResolver::getSampleRate (ASIOSampleRate *sampleRate) +ASIOError IASIOThiscallResolver::getSampleRate(ASIOSampleRate *sampleRate) { ASIOBool result; - CALL_THISCALL_1 (result, that_, 52, sampleRate); + CALL_THISCALL_1( result, that_, 52, sampleRate ); return result; } -ASIOError IASIOThiscallResolver::setSampleRate (ASIOSampleRate sampleRate) -{ +ASIOError IASIOThiscallResolver::setSampleRate(ASIOSampleRate sampleRate) +{ ASIOBool result; - CALL_THISCALL_1_DOUBLE (result, that_, 56, sampleRate); + CALL_THISCALL_1_DOUBLE( result, that_, 56, sampleRate ); return result; } -ASIOError IASIOThiscallResolver::getClockSources (ASIOClockSource *clocks, long *numSources) +ASIOError IASIOThiscallResolver::getClockSources(ASIOClockSource *clocks, long *numSources) { ASIOBool result; - CALL_THISCALL_2 (result, that_, 60, clocks, numSources); + CALL_THISCALL_2( result, that_, 60, clocks, numSources ); return result; } -ASIOError IASIOThiscallResolver::setClockSource (long reference) +ASIOError IASIOThiscallResolver::setClockSource(long reference) { ASIOBool result; - CALL_THISCALL_1 (result, that_, 64, reference); + CALL_THISCALL_1( result, that_, 64, reference ); return result; } -ASIOError IASIOThiscallResolver::getSamplePosition (ASIOSamples *sPos, ASIOTimeStamp *tStamp) +ASIOError IASIOThiscallResolver::getSamplePosition(ASIOSamples *sPos, ASIOTimeStamp *tStamp) { ASIOBool result; - CALL_THISCALL_2 (result, that_, 68, sPos, tStamp); + CALL_THISCALL_2( result, that_, 68, sPos, tStamp ); return result; } -ASIOError IASIOThiscallResolver::getChannelInfo (ASIOChannelInfo *info) +ASIOError IASIOThiscallResolver::getChannelInfo(ASIOChannelInfo *info) { ASIOBool result; - CALL_THISCALL_1 (result, that_, 72, info); + CALL_THISCALL_1( result, that_, 72, info ); return result; } -ASIOError IASIOThiscallResolver::createBuffers (ASIOBufferInfo *bufferInfos, +ASIOError IASIOThiscallResolver::createBuffers(ASIOBufferInfo *bufferInfos, long numChannels, long bufferSize, ASIOCallbacks *callbacks) { ASIOBool result; - CALL_THISCALL_4 (result, that_, 76, bufferInfos, numChannels, bufferSize, callbacks); + CALL_THISCALL_4( result, that_, 76, bufferInfos, numChannels, bufferSize, callbacks ); return result; } ASIOError IASIOThiscallResolver::disposeBuffers() { ASIOBool result; - CALL_THISCALL_0 (result, that_, 80); + CALL_THISCALL_0( result, that_, 80 ); return result; } ASIOError IASIOThiscallResolver::controlPanel() { ASIOBool result; - CALL_THISCALL_0 (result, that_, 84); + CALL_THISCALL_0( result, that_, 84 ); return result; } -ASIOError IASIOThiscallResolver::future (long selector,void *opt) +ASIOError IASIOThiscallResolver::future(long selector,void *opt) { ASIOBool result; - CALL_THISCALL_2 (result, that_, 88, selector, opt); + CALL_THISCALL_2( result, that_, 88, selector, opt ); return result; } ASIOError IASIOThiscallResolver::outputReady() { ASIOBool result; - CALL_THISCALL_0 (result, that_, 92); + CALL_THISCALL_0( result, that_, 92 ); return result; } // Implement our substitute ASIOInit() method -ASIOError IASIOThiscallResolver::ASIOInit (ASIODriverInfo *info) +ASIOError IASIOThiscallResolver::ASIOInit(ASIODriverInfo *info) { // To ensure that our instance's vptr is correctly constructed, even if // ASIOInit is called prior to main(), we explicitly call its constructor // (potentially over the top of an existing instance). Note that this is // pretty ugly, and is only safe because IASIOThiscallResolver has no // destructor and contains no objects with destructors. - new ( (void*) &instance) IASIOThiscallResolver (theAsioDriver); + new((void*)&instance) IASIOThiscallResolver( theAsioDriver ); // Interpose between ASIO client code and the real driver. theAsioDriver = &instance; @@ -553,7 +553,7 @@ ASIOError IASIOThiscallResolver::ASIOInit (ASIODriverInfo *info) // real driver because theAsioDriver is reset to zero in ASIOExit(). // Delegate to the real ASIOInit - return ::ASIOInit (info); + return ::ASIOInit(info); } diff --git a/sflphone-common/libs/pjproject/third_party/portaudio/src/hostapi/asio/pa_asio.cpp b/sflphone-common/libs/pjproject/third_party/portaudio/src/hostapi/asio/pa_asio.cpp index cf54465cfa65c74901ed79159748ab6f2232d66f..84d1c5117946f2d2d9af24c5a1e1aa2e6afd9923 100644 --- a/sflphone-common/libs/pjproject/third_party/portaudio/src/hostapi/asio/pa_asio.cpp +++ b/sflphone-common/libs/pjproject/third_party/portaudio/src/hostapi/asio/pa_asio.cpp @@ -1,5 +1,5 @@ /* - * $Id: pa_asio.cpp 1386 2008-06-28 18:27:34Z philburk $ + * $Id: pa_asio.cpp 1416 2009-06-16 16:12:41Z rossb $ * Portable Audio I/O Library for ASIO Drivers * * Author: Stephane Letz @@ -29,13 +29,13 @@ */ /* - * The text above constitutes the entire PortAudio license; however, + * The text above constitutes the entire PortAudio license; however, * the PortAudio community also makes the following non-binding requests: * * Any person wishing to distribute modifications to the Software is * requested to send the modifications to the original developer so that - * they can be incorporated into the canonical version. It is also - * requested that these non-binding requests be included along with the + * they can be incorporated into the canonical version. It is also + * requested that these non-binding requests be included along with the * license above. */ @@ -83,7 +83,7 @@ @todo review ReadStream, WriteStream, GetStreamReadAvailable, GetStreamWriteAvailable - @todo review Blocking i/o latency computations in OpenStream(), changing ring + @todo review Blocking i/o latency computations in OpenStream(), changing ring buffer to a non-power-of-two structure could reduce blocking i/o latency. @todo implement IsFormatSupported @@ -171,8 +171,8 @@ /* external reference to ASIO SDK's asioDrivers. - This is a bit messy because we want to explicitly manage - allocation/deallocation of this structure, but some layers of the SDK + This is a bit messy because we want to explicitly manage + allocation/deallocation of this structure, but some layers of the SDK which we currently use (eg the implementation in asio.cpp) still use this global version. @@ -190,9 +190,9 @@ extern AsioDrivers* asioDrivers; /* prototypes for functions declared in this file */ -extern "C" PaError PaAsio_Initialize (PaUtilHostApiRepresentation **hostApi, PaHostApiIndex hostApiIndex); -static void Terminate (struct PaUtilHostApiRepresentation *hostApi); -static PaError OpenStream (struct PaUtilHostApiRepresentation *hostApi, +extern "C" PaError PaAsio_Initialize( PaUtilHostApiRepresentation **hostApi, PaHostApiIndex hostApiIndex ); +static void Terminate( struct PaUtilHostApiRepresentation *hostApi ); +static PaError OpenStream( struct PaUtilHostApiRepresentation *hostApi, PaStream** s, const PaStreamParameters *inputParameters, const PaStreamParameters *outputParameters, @@ -200,109 +200,82 @@ static PaError OpenStream (struct PaUtilHostApiRepresentation *hostApi, unsigned long framesPerBuffer, PaStreamFlags streamFlags, PaStreamCallback *streamCallback, - void *userData); -static PaError IsFormatSupported (struct PaUtilHostApiRepresentation *hostApi, + void *userData ); +static PaError IsFormatSupported( struct PaUtilHostApiRepresentation *hostApi, const PaStreamParameters *inputParameters, const PaStreamParameters *outputParameters, - double sampleRate); -static PaError CloseStream (PaStream* stream); -static PaError StartStream (PaStream *stream); -static PaError StopStream (PaStream *stream); -static PaError AbortStream (PaStream *stream); -static PaError IsStreamStopped (PaStream *s); -static PaError IsStreamActive (PaStream *stream); -static PaTime GetStreamTime (PaStream *stream); -static double GetStreamCpuLoad (PaStream* stream); -static PaError ReadStream (PaStream* stream, void *buffer, unsigned long frames); -static PaError WriteStream (PaStream* stream, const void *buffer, unsigned long frames); -static signed long GetStreamReadAvailable (PaStream* stream); -static signed long GetStreamWriteAvailable (PaStream* stream); + double sampleRate ); +static PaError CloseStream( PaStream* stream ); +static PaError StartStream( PaStream *stream ); +static PaError StopStream( PaStream *stream ); +static PaError AbortStream( PaStream *stream ); +static PaError IsStreamStopped( PaStream *s ); +static PaError IsStreamActive( PaStream *stream ); +static PaTime GetStreamTime( PaStream *stream ); +static double GetStreamCpuLoad( PaStream* stream ); +static PaError ReadStream( PaStream* stream, void *buffer, unsigned long frames ); +static PaError WriteStream( PaStream* stream, const void *buffer, unsigned long frames ); +static signed long GetStreamReadAvailable( PaStream* stream ); +static signed long GetStreamWriteAvailable( PaStream* stream ); /* Blocking i/o callback function. */ -static int BlockingIoPaCallback (const void *inputBuffer , - void *outputBuffer , - unsigned long framesPerBuffer, - const PaStreamCallbackTimeInfo *timeInfo , - PaStreamCallbackFlags statusFlags , - void *userData); +static int BlockingIoPaCallback(const void *inputBuffer , + void *outputBuffer , + unsigned long framesPerBuffer, + const PaStreamCallbackTimeInfo *timeInfo , + PaStreamCallbackFlags statusFlags , + void *userData ); /* our ASIO callback functions */ -static void bufferSwitch (long index, ASIOBool processNow); -static ASIOTime *bufferSwitchTimeInfo (ASIOTime *timeInfo, long index, ASIOBool processNow); -static void sampleRateChanged (ASIOSampleRate sRate); -static long asioMessages (long selector, long value, void* message, double* opt); +static void bufferSwitch(long index, ASIOBool processNow); +static ASIOTime *bufferSwitchTimeInfo(ASIOTime *timeInfo, long index, ASIOBool processNow); +static void sampleRateChanged(ASIOSampleRate sRate); +static long asioMessages(long selector, long value, void* message, double* opt); -static ASIOCallbacks asioCallbacks_ = { bufferSwitch, sampleRateChanged, asioMessages, bufferSwitchTimeInfo }; +static ASIOCallbacks asioCallbacks_ = + { bufferSwitch, sampleRateChanged, asioMessages, bufferSwitchTimeInfo }; #define PA_ASIO_SET_LAST_HOST_ERROR( errorCode, errorText ) \ PaUtil_SetLastHostErrorInfo( paASIO, errorCode, errorText ) -static void PaAsio_SetLastSystemError (DWORD errorCode) +static void PaAsio_SetLastSystemError( DWORD errorCode ) { LPVOID lpMsgBuf; - FormatMessage ( + FormatMessage( FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM, NULL, errorCode, - MAKELANGID (LANG_NEUTRAL, SUBLANG_DEFAULT), + MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPTSTR) &lpMsgBuf, 0, NULL ); - PaUtil_SetLastHostErrorInfo (paASIO, errorCode, (const char*) lpMsgBuf); - LocalFree (lpMsgBuf); + PaUtil_SetLastHostErrorInfo( paASIO, errorCode, (const char*)lpMsgBuf ); + LocalFree( lpMsgBuf ); } #define PA_ASIO_SET_LAST_SYSTEM_ERROR( errorCode ) \ PaAsio_SetLastSystemError( errorCode ) -static const char* PaAsio_GetAsioErrorText (ASIOError asioError) +static const char* PaAsio_GetAsioErrorText( ASIOError asioError ) { const char *result; - switch (asioError) { - + switch( asioError ){ case ASE_OK: - - case ASE_SUCCESS: - result = "Success"; - break; - - case ASE_NotPresent: - result = "Hardware input or output is not present or available"; - break; - - case ASE_HWMalfunction: - result = "Hardware is malfunctioning"; - break; - - case ASE_InvalidParameter: - result = "Input parameter invalid"; - break; - - case ASE_InvalidMode: - result = "Hardware is in a bad mode or used in a bad mode"; - break; - - case ASE_SPNotAdvancing: - result = "Hardware is not running when sample position is inquired"; - break; - - case ASE_NoClock: - result = "Sample clock or rate cannot be determined or is not present"; - break; - - case ASE_NoMemory: - result = "Not enough memory for completing the request"; - break; - - default: - result = "Unknown ASIO error"; - break; + case ASE_SUCCESS: result = "Success"; break; + case ASE_NotPresent: result = "Hardware input or output is not present or available"; break; + case ASE_HWMalfunction: result = "Hardware is malfunctioning"; break; + case ASE_InvalidParameter: result = "Input parameter invalid"; break; + case ASE_InvalidMode: result = "Hardware is in a bad mode or used in a bad mode"; break; + case ASE_SPNotAdvancing: result = "Hardware is not running when sample position is inquired"; break; + case ASE_NoClock: result = "Sample clock or rate cannot be determined or is not present"; break; + case ASE_NoMemory: result = "Not enough memory for completing the request"; break; + default: result = "Unknown ASIO error"; break; } return result; @@ -317,45 +290,30 @@ static const char* PaAsio_GetAsioErrorText (ASIOError asioError) // Atomic increment and decrement operations #if MAC -/* need to be implemented on Mac */ -inline long PaAsio_AtomicIncrement (volatile long* v) -{ - return ++ (*const_cast<long*> (v)); -} - -inline long PaAsio_AtomicDecrement (volatile long* v) -{ - return -- (*const_cast<long*> (v)); -} - + /* need to be implemented on Mac */ + inline long PaAsio_AtomicIncrement(volatile long* v) {return ++(*const_cast<long*>(v));} + inline long PaAsio_AtomicDecrement(volatile long* v) {return --(*const_cast<long*>(v));} #elif WINDOWS -inline long PaAsio_AtomicIncrement (volatile long* v) -{ - return InterlockedIncrement (const_cast<long*> (v)); -} - -inline long PaAsio_AtomicDecrement (volatile long* v) -{ - return InterlockedDecrement (const_cast<long*> (v)); -} - + inline long PaAsio_AtomicIncrement(volatile long* v) {return InterlockedIncrement(const_cast<long*>(v));} + inline long PaAsio_AtomicDecrement(volatile long* v) {return InterlockedDecrement(const_cast<long*>(v));} #endif -typedef struct PaAsioDriverInfo { +typedef struct PaAsioDriverInfo +{ ASIODriverInfo asioDriverInfo; long inputChannelCount, outputChannelCount; long bufferMinSize, bufferMaxSize, bufferPreferredSize, bufferGranularity; bool postOutput; } - PaAsioDriverInfo; /* PaAsioHostApiRepresentation - host api datastructure specific to this implementation */ -typedef struct { +typedef struct +{ PaUtilHostApiRepresentation inheritedHostApiRep; PaUtilStreamInterface callbackStreamInterface; PaUtilStreamInterface blockingStreamInterface; @@ -364,7 +322,7 @@ typedef struct { AsioDrivers *asioDrivers; void *systemSpecific; - + /* the ASIO C API only allows one ASIO driver to be open at a time, so we keep track of whether we have the driver open here, and use this information to return errors from OpenStream if the @@ -379,7 +337,6 @@ typedef struct { PaDeviceIndex openAsioDeviceIndex; PaAsioDriverInfo openAsioDriverInfo; } - PaAsioHostApiRepresentation; @@ -387,206 +344,117 @@ PaAsioHostApiRepresentation; Retrieve <driverCount> driver names from ASIO, returned in a char** allocated in <group>. */ -static char **GetAsioDriverNames (PaAsioHostApiRepresentation *asioHostApi, PaUtilAllocationGroup *group, long driverCount) +static char **GetAsioDriverNames( PaAsioHostApiRepresentation *asioHostApi, PaUtilAllocationGroup *group, long driverCount ) { char **result = 0; int i; - result = (char**) PaUtil_GroupAllocateMemory ( - group, sizeof (char*) * driverCount); - - if (!result) + result =(char**)PaUtil_GroupAllocateMemory( + group, sizeof(char*) * driverCount ); + if( !result ) goto error; - result[0] = (char*) PaUtil_GroupAllocateMemory ( - group, 32 * driverCount); - - if (!result[0]) + result[0] = (char*)PaUtil_GroupAllocateMemory( + group, 32 * driverCount ); + if( !result[0] ) goto error; - for (i=0; i<driverCount; ++i) + for( i=0; i<driverCount; ++i ) result[i] = result[0] + (32 * i); - asioHostApi->asioDrivers->getDriverNames (result, driverCount); + asioHostApi->asioDrivers->getDriverNames( result, driverCount ); error: return result; } -static PaSampleFormat AsioSampleTypeToPaNativeSampleFormat (ASIOSampleType type) +static PaSampleFormat AsioSampleTypeToPaNativeSampleFormat(ASIOSampleType type) { switch (type) { - case ASIOSTInt16MSB: - case ASIOSTInt16LSB: - return paInt16; + return paInt16; case ASIOSTFloat32MSB: - case ASIOSTFloat32LSB: - case ASIOSTFloat64MSB: - case ASIOSTFloat64LSB: - return paFloat32; + return paFloat32; case ASIOSTInt32MSB: - case ASIOSTInt32LSB: - case ASIOSTInt32MSB16: - case ASIOSTInt32LSB16: - case ASIOSTInt32MSB18: - case ASIOSTInt32MSB20: - case ASIOSTInt32MSB24: - case ASIOSTInt32LSB18: - case ASIOSTInt32LSB20: - case ASIOSTInt32LSB24: - return paInt32; + return paInt32; case ASIOSTInt24MSB: - case ASIOSTInt24LSB: - return paInt24; + return paInt24; default: - return paCustomFormat; + return paCustomFormat; } } -void AsioSampleTypeLOG (ASIOSampleType type) +void AsioSampleTypeLOG(ASIOSampleType type) { switch (type) { - - case ASIOSTInt16MSB: - PA_DEBUG ( ("ASIOSTInt16MSB\n")); - break; - - case ASIOSTInt16LSB: - PA_DEBUG ( ("ASIOSTInt16LSB\n")); - break; - - case ASIOSTFloat32MSB: - PA_DEBUG ( ("ASIOSTFloat32MSB\n")); - break; - - case ASIOSTFloat32LSB: - PA_DEBUG ( ("ASIOSTFloat32LSB\n")); - break; - - case ASIOSTFloat64MSB: - PA_DEBUG ( ("ASIOSTFloat64MSB\n")); - break; - - case ASIOSTFloat64LSB: - PA_DEBUG ( ("ASIOSTFloat64LSB\n")); - break; - - case ASIOSTInt32MSB: - PA_DEBUG ( ("ASIOSTInt32MSB\n")); - break; - - case ASIOSTInt32LSB: - PA_DEBUG ( ("ASIOSTInt32LSB\n")); - break; - - case ASIOSTInt32MSB16: - PA_DEBUG ( ("ASIOSTInt32MSB16\n")); - break; - - case ASIOSTInt32LSB16: - PA_DEBUG ( ("ASIOSTInt32LSB16\n")); - break; - - case ASIOSTInt32MSB18: - PA_DEBUG ( ("ASIOSTInt32MSB18\n")); - break; - - case ASIOSTInt32MSB20: - PA_DEBUG ( ("ASIOSTInt32MSB20\n")); - break; - - case ASIOSTInt32MSB24: - PA_DEBUG ( ("ASIOSTInt32MSB24\n")); - break; - - case ASIOSTInt32LSB18: - PA_DEBUG ( ("ASIOSTInt32LSB18\n")); - break; - - case ASIOSTInt32LSB20: - PA_DEBUG ( ("ASIOSTInt32LSB20\n")); - break; - - case ASIOSTInt32LSB24: - PA_DEBUG ( ("ASIOSTInt32LSB24\n")); - break; - - case ASIOSTInt24MSB: - PA_DEBUG ( ("ASIOSTInt24MSB\n")); - break; - - case ASIOSTInt24LSB: - PA_DEBUG ( ("ASIOSTInt24LSB\n")); - break; - - default: - PA_DEBUG ( ("Custom Format%d\n",type)); - break; + case ASIOSTInt16MSB: PA_DEBUG(("ASIOSTInt16MSB\n")); break; + case ASIOSTInt16LSB: PA_DEBUG(("ASIOSTInt16LSB\n")); break; + case ASIOSTFloat32MSB:PA_DEBUG(("ASIOSTFloat32MSB\n"));break; + case ASIOSTFloat32LSB:PA_DEBUG(("ASIOSTFloat32LSB\n"));break; + case ASIOSTFloat64MSB:PA_DEBUG(("ASIOSTFloat64MSB\n"));break; + case ASIOSTFloat64LSB:PA_DEBUG(("ASIOSTFloat64LSB\n"));break; + case ASIOSTInt32MSB: PA_DEBUG(("ASIOSTInt32MSB\n")); break; + case ASIOSTInt32LSB: PA_DEBUG(("ASIOSTInt32LSB\n")); break; + case ASIOSTInt32MSB16:PA_DEBUG(("ASIOSTInt32MSB16\n"));break; + case ASIOSTInt32LSB16:PA_DEBUG(("ASIOSTInt32LSB16\n"));break; + case ASIOSTInt32MSB18:PA_DEBUG(("ASIOSTInt32MSB18\n"));break; + case ASIOSTInt32MSB20:PA_DEBUG(("ASIOSTInt32MSB20\n"));break; + case ASIOSTInt32MSB24:PA_DEBUG(("ASIOSTInt32MSB24\n"));break; + case ASIOSTInt32LSB18:PA_DEBUG(("ASIOSTInt32LSB18\n"));break; + case ASIOSTInt32LSB20:PA_DEBUG(("ASIOSTInt32LSB20\n"));break; + case ASIOSTInt32LSB24:PA_DEBUG(("ASIOSTInt32LSB24\n"));break; + case ASIOSTInt24MSB: PA_DEBUG(("ASIOSTInt24MSB\n")); break; + case ASIOSTInt24LSB: PA_DEBUG(("ASIOSTInt24LSB\n")); break; + default: PA_DEBUG(("Custom Format%d\n",type));break; } } -static int BytesPerAsioSample (ASIOSampleType sampleType) +static int BytesPerAsioSample( ASIOSampleType sampleType ) { switch (sampleType) { - case ASIOSTInt16MSB: - case ASIOSTInt16LSB: return 2; case ASIOSTFloat64MSB: - case ASIOSTFloat64LSB: return 8; case ASIOSTFloat32MSB: - case ASIOSTFloat32LSB: - case ASIOSTInt32MSB: - case ASIOSTInt32LSB: - case ASIOSTInt32MSB16: - case ASIOSTInt32LSB16: - case ASIOSTInt32MSB18: - case ASIOSTInt32MSB20: - case ASIOSTInt32MSB24: - case ASIOSTInt32LSB18: - case ASIOSTInt32LSB20: - case ASIOSTInt32LSB24: return 4; case ASIOSTInt24MSB: - case ASIOSTInt24LSB: return 3; @@ -596,86 +464,93 @@ static int BytesPerAsioSample (ASIOSampleType sampleType) } -static void Swap16 (void *buffer, long shift, long count) +static void Swap16( void *buffer, long shift, long count ) { - unsigned short *p = (unsigned short*) buffer; + unsigned short *p = (unsigned short*)buffer; unsigned short temp; (void) shift; /* unused parameter */ - while (count--) { + while( count-- ) + { temp = *p; - *p++ = (unsigned short) ( (temp<<8) | (temp>>8)); + *p++ = (unsigned short)((temp<<8) | (temp>>8)); } } -static void Swap24 (void *buffer, long shift, long count) +static void Swap24( void *buffer, long shift, long count ) { - unsigned char *p = (unsigned char*) buffer; + unsigned char *p = (unsigned char*)buffer; unsigned char temp; (void) shift; /* unused parameter */ - while (count--) { + while( count-- ) + { temp = *p; - *p = * (p+2); - * (p+2) = temp; + *p = *(p+2); + *(p+2) = temp; p += 3; } } #define PA_SWAP32_( x ) ((x>>24) | ((x>>8)&0xFF00) | ((x<<8)&0xFF0000) | (x<<24)); -static void Swap32 (void *buffer, long shift, long count) +static void Swap32( void *buffer, long shift, long count ) { - unsigned long *p = (unsigned long*) buffer; + unsigned long *p = (unsigned long*)buffer; unsigned long temp; (void) shift; /* unused parameter */ - while (count--) { + while( count-- ) + { temp = *p; - *p++ = PA_SWAP32_ (temp); + *p++ = PA_SWAP32_( temp); } } -static void SwapShiftLeft32 (void *buffer, long shift, long count) +static void SwapShiftLeft32( void *buffer, long shift, long count ) { - unsigned long *p = (unsigned long*) buffer; + unsigned long *p = (unsigned long*)buffer; unsigned long temp; - while (count--) { + while( count-- ) + { temp = *p; - temp = PA_SWAP32_ (temp); + temp = PA_SWAP32_( temp); *p++ = temp << shift; } } -static void ShiftRightSwap32 (void *buffer, long shift, long count) +static void ShiftRightSwap32( void *buffer, long shift, long count ) { - unsigned long *p = (unsigned long*) buffer; + unsigned long *p = (unsigned long*)buffer; unsigned long temp; - while (count--) { + while( count-- ) + { temp = *p >> shift; - *p++ = PA_SWAP32_ (temp); + *p++ = PA_SWAP32_( temp); } } -static void ShiftLeft32 (void *buffer, long shift, long count) +static void ShiftLeft32( void *buffer, long shift, long count ) { - unsigned long *p = (unsigned long*) buffer; + unsigned long *p = (unsigned long*)buffer; unsigned long temp; - while (count--) { + while( count-- ) + { temp = *p; *p++ = temp << shift; } } -static void ShiftRight32 (void *buffer, long shift, long count) +static void ShiftRight32( void *buffer, long shift, long count ) { - unsigned long *p = (unsigned long*) buffer; + unsigned long *p = (unsigned long*)buffer; unsigned long temp; - while (count--) { + while( count-- ) + { temp = *p; *p++ = temp >> shift; } @@ -683,63 +558,65 @@ static void ShiftRight32 (void *buffer, long shift, long count) #define PA_SWAP_( x, y ) temp=x; x = y; y = temp; -static void Swap64ConvertFloat64ToFloat32 (void *buffer, long shift, long count) +static void Swap64ConvertFloat64ToFloat32( void *buffer, long shift, long count ) { - double *in = (double*) buffer; - float *out = (float*) buffer; + double *in = (double*)buffer; + float *out = (float*)buffer; unsigned char *p; unsigned char temp; (void) shift; /* unused parameter */ - while (count--) { - p = (unsigned char*) in; - PA_SWAP_ (p[0], p[7]); - PA_SWAP_ (p[1], p[6]); - PA_SWAP_ (p[2], p[5]); - PA_SWAP_ (p[3], p[4]); + while( count-- ) + { + p = (unsigned char*)in; + PA_SWAP_( p[0], p[7] ); + PA_SWAP_( p[1], p[6] ); + PA_SWAP_( p[2], p[5] ); + PA_SWAP_( p[3], p[4] ); *out++ = (float) (*in++); } } -static void ConvertFloat64ToFloat32 (void *buffer, long shift, long count) +static void ConvertFloat64ToFloat32( void *buffer, long shift, long count ) { - double *in = (double*) buffer; - float *out = (float*) buffer; + double *in = (double*)buffer; + float *out = (float*)buffer; (void) shift; /* unused parameter */ - while (count--) + while( count-- ) *out++ = (float) (*in++); } -static void ConvertFloat32ToFloat64Swap64 (void *buffer, long shift, long count) +static void ConvertFloat32ToFloat64Swap64( void *buffer, long shift, long count ) { - float *in = ( (float*) buffer) + (count-1); - double *out = ( (double*) buffer) + (count-1); + float *in = ((float*)buffer) + (count-1); + double *out = ((double*)buffer) + (count-1); unsigned char *p; unsigned char temp; (void) shift; /* unused parameter */ - while (count--) { + while( count-- ) + { *out = *in--; - p = (unsigned char*) out; - PA_SWAP_ (p[0], p[7]); - PA_SWAP_ (p[1], p[6]); - PA_SWAP_ (p[2], p[5]); - PA_SWAP_ (p[3], p[4]); + p = (unsigned char*)out; + PA_SWAP_( p[0], p[7] ); + PA_SWAP_( p[1], p[6] ); + PA_SWAP_( p[2], p[5] ); + PA_SWAP_( p[3], p[4] ); out--; } } -static void ConvertFloat32ToFloat64 (void *buffer, long shift, long count) +static void ConvertFloat32ToFloat64( void *buffer, long shift, long count ) { - float *in = ( (float*) buffer) + (count-1); - double *out = ( (double*) buffer) + (count-1); + float *in = ((float*)buffer) + (count-1); + double *out = ((double*)buffer) + (count-1); (void) shift; /* unused parameter */ - while (count--) + while( count-- ) *out-- = *in--; } @@ -753,337 +630,302 @@ static void ConvertFloat32ToFloat64 (void *buffer, long shift, long count) #define PA_LSB_IS_NATIVE_ #endif -typedef void PaAsioBufferConverter (void *, long, long); +typedef void PaAsioBufferConverter( void *, long, long ); -static void SelectAsioToPaConverter (ASIOSampleType type, PaAsioBufferConverter **converter, long *shift) +static void SelectAsioToPaConverter( ASIOSampleType type, PaAsioBufferConverter **converter, long *shift ) { *shift = 0; *converter = 0; switch (type) { - case ASIOSTInt16MSB: /* dest: paInt16, no conversion necessary, possible byte swap*/ -#ifdef PA_LSB_IS_NATIVE_ - *converter = Swap16; -#endif + #ifdef PA_LSB_IS_NATIVE_ + *converter = Swap16; + #endif break; - case ASIOSTInt16LSB: /* dest: paInt16, no conversion necessary, possible byte swap*/ -#ifdef PA_MSB_IS_NATIVE_ - *converter = Swap16; -#endif + #ifdef PA_MSB_IS_NATIVE_ + *converter = Swap16; + #endif break; - case ASIOSTFloat32MSB: /* dest: paFloat32, no conversion necessary, possible byte swap*/ -#ifdef PA_LSB_IS_NATIVE_ - *converter = Swap32; -#endif + #ifdef PA_LSB_IS_NATIVE_ + *converter = Swap32; + #endif break; - case ASIOSTFloat32LSB: /* dest: paFloat32, no conversion necessary, possible byte swap*/ -#ifdef PA_MSB_IS_NATIVE_ - *converter = Swap32; -#endif + #ifdef PA_MSB_IS_NATIVE_ + *converter = Swap32; + #endif break; - case ASIOSTFloat64MSB: /* dest: paFloat32, in-place conversion to/from float32, possible byte swap*/ -#ifdef PA_LSB_IS_NATIVE_ - *converter = Swap64ConvertFloat64ToFloat32; -#else - *converter = ConvertFloat64ToFloat32; -#endif + #ifdef PA_LSB_IS_NATIVE_ + *converter = Swap64ConvertFloat64ToFloat32; + #else + *converter = ConvertFloat64ToFloat32; + #endif break; - case ASIOSTFloat64LSB: /* dest: paFloat32, in-place conversion to/from float32, possible byte swap*/ -#ifdef PA_MSB_IS_NATIVE_ - *converter = Swap64ConvertFloat64ToFloat32; -#else - *converter = ConvertFloat64ToFloat32; -#endif + #ifdef PA_MSB_IS_NATIVE_ + *converter = Swap64ConvertFloat64ToFloat32; + #else + *converter = ConvertFloat64ToFloat32; + #endif break; - case ASIOSTInt32MSB: /* dest: paInt32, no conversion necessary, possible byte swap */ -#ifdef PA_LSB_IS_NATIVE_ - *converter = Swap32; -#endif + #ifdef PA_LSB_IS_NATIVE_ + *converter = Swap32; + #endif break; - case ASIOSTInt32LSB: /* dest: paInt32, no conversion necessary, possible byte swap */ -#ifdef PA_MSB_IS_NATIVE_ - *converter = Swap32; -#endif + #ifdef PA_MSB_IS_NATIVE_ + *converter = Swap32; + #endif break; - case ASIOSTInt32MSB16: /* dest: paInt32, 16 bit shift, possible byte swap */ -#ifdef PA_LSB_IS_NATIVE_ - *converter = SwapShiftLeft32; -#else - *converter = ShiftLeft32; -#endif + #ifdef PA_LSB_IS_NATIVE_ + *converter = SwapShiftLeft32; + #else + *converter = ShiftLeft32; + #endif *shift = 16; break; - case ASIOSTInt32MSB18: /* dest: paInt32, 14 bit shift, possible byte swap */ -#ifdef PA_LSB_IS_NATIVE_ - *converter = SwapShiftLeft32; -#else - *converter = ShiftLeft32; -#endif + #ifdef PA_LSB_IS_NATIVE_ + *converter = SwapShiftLeft32; + #else + *converter = ShiftLeft32; + #endif *shift = 14; break; - case ASIOSTInt32MSB20: /* dest: paInt32, 12 bit shift, possible byte swap */ -#ifdef PA_LSB_IS_NATIVE_ - *converter = SwapShiftLeft32; -#else - *converter = ShiftLeft32; -#endif + #ifdef PA_LSB_IS_NATIVE_ + *converter = SwapShiftLeft32; + #else + *converter = ShiftLeft32; + #endif *shift = 12; break; - case ASIOSTInt32MSB24: /* dest: paInt32, 8 bit shift, possible byte swap */ -#ifdef PA_LSB_IS_NATIVE_ - *converter = SwapShiftLeft32; -#else - *converter = ShiftLeft32; -#endif + #ifdef PA_LSB_IS_NATIVE_ + *converter = SwapShiftLeft32; + #else + *converter = ShiftLeft32; + #endif *shift = 8; break; - case ASIOSTInt32LSB16: /* dest: paInt32, 16 bit shift, possible byte swap */ -#ifdef PA_MSB_IS_NATIVE_ - *converter = SwapShiftLeft32; -#else - *converter = ShiftLeft32; -#endif + #ifdef PA_MSB_IS_NATIVE_ + *converter = SwapShiftLeft32; + #else + *converter = ShiftLeft32; + #endif *shift = 16; break; - case ASIOSTInt32LSB18: /* dest: paInt32, 14 bit shift, possible byte swap */ -#ifdef PA_MSB_IS_NATIVE_ - *converter = SwapShiftLeft32; -#else - *converter = ShiftLeft32; -#endif + #ifdef PA_MSB_IS_NATIVE_ + *converter = SwapShiftLeft32; + #else + *converter = ShiftLeft32; + #endif *shift = 14; break; - case ASIOSTInt32LSB20: /* dest: paInt32, 12 bit shift, possible byte swap */ -#ifdef PA_MSB_IS_NATIVE_ - *converter = SwapShiftLeft32; -#else - *converter = ShiftLeft32; -#endif + #ifdef PA_MSB_IS_NATIVE_ + *converter = SwapShiftLeft32; + #else + *converter = ShiftLeft32; + #endif *shift = 12; break; - case ASIOSTInt32LSB24: /* dest: paInt32, 8 bit shift, possible byte swap */ -#ifdef PA_MSB_IS_NATIVE_ - *converter = SwapShiftLeft32; -#else - *converter = ShiftLeft32; -#endif + #ifdef PA_MSB_IS_NATIVE_ + *converter = SwapShiftLeft32; + #else + *converter = ShiftLeft32; + #endif *shift = 8; break; - case ASIOSTInt24MSB: /* dest: paInt24, no conversion necessary, possible byte swap */ -#ifdef PA_LSB_IS_NATIVE_ - *converter = Swap24; -#endif + #ifdef PA_LSB_IS_NATIVE_ + *converter = Swap24; + #endif break; - case ASIOSTInt24LSB: /* dest: paInt24, no conversion necessary, possible byte swap */ -#ifdef PA_MSB_IS_NATIVE_ - *converter = Swap24; -#endif + #ifdef PA_MSB_IS_NATIVE_ + *converter = Swap24; + #endif break; } } -static void SelectPaToAsioConverter (ASIOSampleType type, PaAsioBufferConverter **converter, long *shift) +static void SelectPaToAsioConverter( ASIOSampleType type, PaAsioBufferConverter **converter, long *shift ) { *shift = 0; *converter = 0; switch (type) { - case ASIOSTInt16MSB: /* src: paInt16, no conversion necessary, possible byte swap*/ -#ifdef PA_LSB_IS_NATIVE_ - *converter = Swap16; -#endif + #ifdef PA_LSB_IS_NATIVE_ + *converter = Swap16; + #endif break; - case ASIOSTInt16LSB: /* src: paInt16, no conversion necessary, possible byte swap*/ -#ifdef PA_MSB_IS_NATIVE_ - *converter = Swap16; -#endif + #ifdef PA_MSB_IS_NATIVE_ + *converter = Swap16; + #endif break; - case ASIOSTFloat32MSB: /* src: paFloat32, no conversion necessary, possible byte swap*/ -#ifdef PA_LSB_IS_NATIVE_ - *converter = Swap32; -#endif + #ifdef PA_LSB_IS_NATIVE_ + *converter = Swap32; + #endif break; - case ASIOSTFloat32LSB: /* src: paFloat32, no conversion necessary, possible byte swap*/ -#ifdef PA_MSB_IS_NATIVE_ - *converter = Swap32; -#endif + #ifdef PA_MSB_IS_NATIVE_ + *converter = Swap32; + #endif break; - case ASIOSTFloat64MSB: /* src: paFloat32, in-place conversion to/from float32, possible byte swap*/ -#ifdef PA_LSB_IS_NATIVE_ - *converter = ConvertFloat32ToFloat64Swap64; -#else - *converter = ConvertFloat32ToFloat64; -#endif + #ifdef PA_LSB_IS_NATIVE_ + *converter = ConvertFloat32ToFloat64Swap64; + #else + *converter = ConvertFloat32ToFloat64; + #endif break; - case ASIOSTFloat64LSB: /* src: paFloat32, in-place conversion to/from float32, possible byte swap*/ -#ifdef PA_MSB_IS_NATIVE_ - *converter = ConvertFloat32ToFloat64Swap64; -#else - *converter = ConvertFloat32ToFloat64; -#endif + #ifdef PA_MSB_IS_NATIVE_ + *converter = ConvertFloat32ToFloat64Swap64; + #else + *converter = ConvertFloat32ToFloat64; + #endif break; - case ASIOSTInt32MSB: /* src: paInt32, no conversion necessary, possible byte swap */ -#ifdef PA_LSB_IS_NATIVE_ - *converter = Swap32; -#endif + #ifdef PA_LSB_IS_NATIVE_ + *converter = Swap32; + #endif break; - case ASIOSTInt32LSB: /* src: paInt32, no conversion necessary, possible byte swap */ -#ifdef PA_MSB_IS_NATIVE_ - *converter = Swap32; -#endif + #ifdef PA_MSB_IS_NATIVE_ + *converter = Swap32; + #endif break; - case ASIOSTInt32MSB16: /* src: paInt32, 16 bit shift, possible byte swap */ -#ifdef PA_LSB_IS_NATIVE_ - *converter = ShiftRightSwap32; -#else - *converter = ShiftRight32; -#endif + #ifdef PA_LSB_IS_NATIVE_ + *converter = ShiftRightSwap32; + #else + *converter = ShiftRight32; + #endif *shift = 16; break; - case ASIOSTInt32MSB18: /* src: paInt32, 14 bit shift, possible byte swap */ -#ifdef PA_LSB_IS_NATIVE_ - *converter = ShiftRightSwap32; -#else - *converter = ShiftRight32; -#endif + #ifdef PA_LSB_IS_NATIVE_ + *converter = ShiftRightSwap32; + #else + *converter = ShiftRight32; + #endif *shift = 14; break; - case ASIOSTInt32MSB20: /* src: paInt32, 12 bit shift, possible byte swap */ -#ifdef PA_LSB_IS_NATIVE_ - *converter = ShiftRightSwap32; -#else - *converter = ShiftRight32; -#endif + #ifdef PA_LSB_IS_NATIVE_ + *converter = ShiftRightSwap32; + #else + *converter = ShiftRight32; + #endif *shift = 12; break; - case ASIOSTInt32MSB24: /* src: paInt32, 8 bit shift, possible byte swap */ -#ifdef PA_LSB_IS_NATIVE_ - *converter = ShiftRightSwap32; -#else - *converter = ShiftRight32; -#endif + #ifdef PA_LSB_IS_NATIVE_ + *converter = ShiftRightSwap32; + #else + *converter = ShiftRight32; + #endif *shift = 8; break; - case ASIOSTInt32LSB16: /* src: paInt32, 16 bit shift, possible byte swap */ -#ifdef PA_MSB_IS_NATIVE_ - *converter = ShiftRightSwap32; -#else - *converter = ShiftRight32; -#endif + #ifdef PA_MSB_IS_NATIVE_ + *converter = ShiftRightSwap32; + #else + *converter = ShiftRight32; + #endif *shift = 16; break; - case ASIOSTInt32LSB18: /* src: paInt32, 14 bit shift, possible byte swap */ -#ifdef PA_MSB_IS_NATIVE_ - *converter = ShiftRightSwap32; -#else - *converter = ShiftRight32; -#endif + #ifdef PA_MSB_IS_NATIVE_ + *converter = ShiftRightSwap32; + #else + *converter = ShiftRight32; + #endif *shift = 14; break; - case ASIOSTInt32LSB20: /* src: paInt32, 12 bit shift, possible byte swap */ -#ifdef PA_MSB_IS_NATIVE_ - *converter = ShiftRightSwap32; -#else - *converter = ShiftRight32; -#endif + #ifdef PA_MSB_IS_NATIVE_ + *converter = ShiftRightSwap32; + #else + *converter = ShiftRight32; + #endif *shift = 12; break; - case ASIOSTInt32LSB24: /* src: paInt32, 8 bit shift, possible byte swap */ -#ifdef PA_MSB_IS_NATIVE_ - *converter = ShiftRightSwap32; -#else - *converter = ShiftRight32; -#endif + #ifdef PA_MSB_IS_NATIVE_ + *converter = ShiftRightSwap32; + #else + *converter = ShiftRight32; + #endif *shift = 8; break; - case ASIOSTInt24MSB: /* src: paInt24, no conversion necessary, possible byte swap */ -#ifdef PA_LSB_IS_NATIVE_ - *converter = Swap24; -#endif + #ifdef PA_LSB_IS_NATIVE_ + *converter = Swap24; + #endif break; - case ASIOSTInt24LSB: /* src: paInt24, no conversion necessary, possible byte swap */ -#ifdef PA_MSB_IS_NATIVE_ - *converter = Swap24; -#endif + #ifdef PA_MSB_IS_NATIVE_ + *converter = Swap24; + #endif break; } } -typedef struct PaAsioDeviceInfo { +typedef struct PaAsioDeviceInfo +{ PaDeviceInfo commonDeviceInfo; long minBufferSize; long maxBufferSize; @@ -1092,25 +934,26 @@ typedef struct PaAsioDeviceInfo { ASIOChannelInfo *asioChannelInfos; } - PaAsioDeviceInfo; -PaError PaAsio_GetAvailableLatencyValues (PaDeviceIndex device, - long *minLatency, long *maxLatency, long *preferredLatency, long *granularity) +PaError PaAsio_GetAvailableLatencyValues( PaDeviceIndex device, + long *minLatency, long *maxLatency, long *preferredLatency, long *granularity ) { PaError result; PaUtilHostApiRepresentation *hostApi; PaDeviceIndex hostApiDevice; - result = PaUtil_GetHostApiRepresentation (&hostApi, paASIO); + result = PaUtil_GetHostApiRepresentation( &hostApi, paASIO ); - if (result == paNoError) { - result = PaUtil_DeviceIndexToHostApiDeviceIndex (&hostApiDevice, device, hostApi); + if( result == paNoError ) + { + result = PaUtil_DeviceIndexToHostApiDeviceIndex( &hostApiDevice, device, hostApi ); - if (result == paNoError) { + if( result == paNoError ) + { PaAsioDeviceInfo *asioDeviceInfo = - (PaAsioDeviceInfo*) hostApi->deviceInfos[hostApiDevice]; + (PaAsioDeviceInfo*)hostApi->deviceInfos[hostApiDevice]; *minLatency = asioDeviceInfo->minBufferSize; *maxLatency = asioDeviceInfo->maxBufferSize; @@ -1125,10 +968,10 @@ PaError PaAsio_GetAvailableLatencyValues (PaDeviceIndex device, /* Unload whatever we loaded in LoadAsioDriver(). Also balance the call to CoInitialize(0). */ -static void UnloadAsioDriver (void) +static void UnloadAsioDriver( void ) { - ASIOExit(); - CoUninitialize(); + ASIOExit(); + CoUninitialize(); } /* @@ -1137,63 +980,67 @@ static void UnloadAsioDriver (void) and must be closed by the called by calling UnloadAsioDriver() - if an error is returned the driver will already be unloaded. */ -static PaError LoadAsioDriver (PaAsioHostApiRepresentation *asioHostApi, const char *driverName, - PaAsioDriverInfo *driverInfo, void *systemSpecific) +static PaError LoadAsioDriver( PaAsioHostApiRepresentation *asioHostApi, const char *driverName, + PaAsioDriverInfo *driverInfo, void *systemSpecific ) { PaError result = paNoError; ASIOError asioError; int asioIsInitialized = 0; - /* - ASIO uses CoCreateInstance() to load a driver. That requires that - CoInitialize(0) be called for every thread that loads a driver. - It is OK to call CoInitialize(0) multiple times form one thread as long - as it is balanced by a call to CoUninitialize(). See UnloadAsioDriver(). - - The V18 version called CoInitialize() starting on 2/19/02. - That was removed from PA V19 for unknown reasons. - Phil Burk added it back on 6/27/08 so that JSyn would work. + /* + ASIO uses CoCreateInstance() to load a driver. That requires that + CoInitialize(0) be called for every thread that loads a driver. + It is OK to call CoInitialize(0) multiple times form one thread as long + as it is balanced by a call to CoUninitialize(). See UnloadAsioDriver(). + + The V18 version called CoInitialize() starting on 2/19/02. + That was removed from PA V19 for unknown reasons. + Phil Burk added it back on 6/27/08 so that JSyn would work. */ - CoInitialize (0); + CoInitialize( 0 ); - if (!asioHostApi->asioDrivers->loadDriver (const_cast<char*> (driverName))) { - /* If this returns an error then it might be because CoInitialize(0) was removed. - It should be called right before this. - */ + if( !asioHostApi->asioDrivers->loadDriver( const_cast<char*>(driverName) ) ) + { + /* If this returns an error then it might be because CoInitialize(0) was removed. + It should be called right before this. + */ result = paUnanticipatedHostError; - PA_ASIO_SET_LAST_HOST_ERROR (0, "Failed to load ASIO driver"); + PA_ASIO_SET_LAST_HOST_ERROR( 0, "Failed to load ASIO driver" ); goto error; } - memset (&driverInfo->asioDriverInfo, 0, sizeof (ASIODriverInfo)); - + memset( &driverInfo->asioDriverInfo, 0, sizeof(ASIODriverInfo) ); driverInfo->asioDriverInfo.asioVersion = 2; driverInfo->asioDriverInfo.sysRef = systemSpecific; - - if ( (asioError = ASIOInit (&driverInfo->asioDriverInfo)) != ASE_OK) { + if( (asioError = ASIOInit( &driverInfo->asioDriverInfo )) != ASE_OK ) + { result = paUnanticipatedHostError; - PA_ASIO_SET_LAST_ASIO_ERROR (asioError); + PA_ASIO_SET_LAST_ASIO_ERROR( asioError ); goto error; - } else { + } + else + { asioIsInitialized = 1; } - if ( (asioError = ASIOGetChannels (&driverInfo->inputChannelCount, - &driverInfo->outputChannelCount)) != ASE_OK) { + if( (asioError = ASIOGetChannels(&driverInfo->inputChannelCount, + &driverInfo->outputChannelCount)) != ASE_OK ) + { result = paUnanticipatedHostError; - PA_ASIO_SET_LAST_ASIO_ERROR (asioError); + PA_ASIO_SET_LAST_ASIO_ERROR( asioError ); goto error; } - if ( (asioError = ASIOGetBufferSize (&driverInfo->bufferMinSize, - &driverInfo->bufferMaxSize, &driverInfo->bufferPreferredSize, - &driverInfo->bufferGranularity)) != ASE_OK) { + if( (asioError = ASIOGetBufferSize(&driverInfo->bufferMinSize, + &driverInfo->bufferMaxSize, &driverInfo->bufferPreferredSize, + &driverInfo->bufferGranularity)) != ASE_OK ) + { result = paUnanticipatedHostError; - PA_ASIO_SET_LAST_ASIO_ERROR (asioError); + PA_ASIO_SET_LAST_ASIO_ERROR( asioError ); goto error; } - if (ASIOOutputReady() == ASE_OK) + if( ASIOOutputReady() == ASE_OK ) driverInfo->postOutput = true; else driverInfo->postOutput = false; @@ -1201,29 +1048,27 @@ static PaError LoadAsioDriver (PaAsioHostApiRepresentation *asioHostApi, const c return result; error: - if (asioIsInitialized) { - ASIOExit(); - } - - CoUninitialize(); - + if( asioIsInitialized ) + { + ASIOExit(); + } + CoUninitialize(); return result; } #define PA_DEFAULTSAMPLERATESEARCHORDER_COUNT_ 13 /* must be the same number of elements as in the array below */ static ASIOSampleRate defaultSampleRateSearchOrder_[] -= {44100.0, 48000.0, 32000.0, 24000.0, 22050.0, 88200.0, 96000.0, - 192000.0, 16000.0, 12000.0, 11025.0, 9600.0, 8000.0 - }; + = {44100.0, 48000.0, 32000.0, 24000.0, 22050.0, 88200.0, 96000.0, + 192000.0, 16000.0, 12000.0, 11025.0, 9600.0, 8000.0 }; /* we look up IsDebuggerPresent at runtime incase it isn't present (on Win95 for example) */ -typedef BOOL (WINAPI *IsDebuggerPresentPtr) (VOID); +typedef BOOL (WINAPI *IsDebuggerPresentPtr)(VOID); IsDebuggerPresentPtr IsDebuggerPresent_ = 0; //FARPROC IsDebuggerPresent_ = 0; // this is the current way to do it apparently according to davidv -PaError PaAsio_Initialize (PaUtilHostApiRepresentation **hostApi, PaHostApiIndex hostApiIndex) +PaError PaAsio_Initialize( PaUtilHostApiRepresentation **hostApi, PaHostApiIndex hostApiIndex ) { PaError result = paNoError; int i, driverCount; @@ -1232,9 +1077,9 @@ PaError PaAsio_Initialize (PaUtilHostApiRepresentation **hostApi, PaHostApiIndex char **names; PaAsioDriverInfo paAsioDriverInfo; - asioHostApi = (PaAsioHostApiRepresentation*) PaUtil_AllocateMemory (sizeof (PaAsioHostApiRepresentation)); - - if (!asioHostApi) { + asioHostApi = (PaAsioHostApiRepresentation*)PaUtil_AllocateMemory( sizeof(PaAsioHostApiRepresentation) ); + if( !asioHostApi ) + { result = paInsufficientMemory; goto error; } @@ -1242,22 +1087,25 @@ PaError PaAsio_Initialize (PaUtilHostApiRepresentation **hostApi, PaHostApiIndex asioHostApi->asioDrivers = 0; /* avoid surprises in our error handler below */ asioHostApi->allocations = PaUtil_CreateAllocationGroup(); - - if (!asioHostApi->allocations) { + if( !asioHostApi->allocations ) + { result = paInsufficientMemory; goto error; } /* Allocate the AsioDrivers() driver list (class from ASIO SDK) */ - try { + try + { asioHostApi->asioDrivers = new AsioDrivers(); /* calls CoInitialize(0) */ - } catch (std::bad_alloc) { + } + catch (std::bad_alloc) + { asioHostApi->asioDrivers = 0; } - /* some implementations of new (ie MSVC, see http://support.microsoft.com/?kbid=167733) don't throw std::bad_alloc, so we also explicitly test for a null return. */ - if (asioHostApi->asioDrivers == 0) { + if( asioHostApi->asioDrivers == 0 ) + { result = paInsufficientMemory; goto error; } @@ -1274,23 +1122,24 @@ PaError PaAsio_Initialize (PaUtilHostApiRepresentation **hostApi, PaHostApiIndex (*hostApi)->info.name = "ASIO"; (*hostApi)->info.deviceCount = 0; -#ifdef WINDOWS - /* use desktop window as system specific ptr */ - asioHostApi->systemSpecific = GetDesktopWindow(); -#endif + #ifdef WINDOWS + /* use desktop window as system specific ptr */ + asioHostApi->systemSpecific = GetDesktopWindow(); + #endif /* driverCount is the number of installed drivers - not necessarily the number of installed physical devices. */ -#if MAC - driverCount = asioHostApi->asioDrivers->getNumFragments(); -#elif WINDOWS - driverCount = asioHostApi->asioDrivers->asioGetNumDev(); -#endif + #if MAC + driverCount = asioHostApi->asioDrivers->getNumFragments(); + #elif WINDOWS + driverCount = asioHostApi->asioDrivers->asioGetNumDev(); + #endif - if (driverCount > 0) { - names = GetAsioDriverNames (asioHostApi, asioHostApi->allocations, driverCount); - - if (!names) { + if( driverCount > 0 ) + { + names = GetAsioDriverNames( asioHostApi, asioHostApi->allocations, driverCount ); + if( !names ) + { result = paInsufficientMemory; goto error; } @@ -1298,59 +1147,63 @@ PaError PaAsio_Initialize (PaUtilHostApiRepresentation **hostApi, PaHostApiIndex /* allocate enough space for all drivers, even if some aren't installed */ - (*hostApi)->deviceInfos = (PaDeviceInfo**) PaUtil_GroupAllocateMemory ( - asioHostApi->allocations, sizeof (PaDeviceInfo*) * driverCount); - - if (! (*hostApi)->deviceInfos) { + (*hostApi)->deviceInfos = (PaDeviceInfo**)PaUtil_GroupAllocateMemory( + asioHostApi->allocations, sizeof(PaDeviceInfo*) * driverCount ); + if( !(*hostApi)->deviceInfos ) + { result = paInsufficientMemory; goto error; } /* allocate all device info structs in a contiguous block */ - deviceInfoArray = (PaAsioDeviceInfo*) PaUtil_GroupAllocateMemory ( - asioHostApi->allocations, sizeof (PaAsioDeviceInfo) * driverCount); - - if (!deviceInfoArray) { + deviceInfoArray = (PaAsioDeviceInfo*)PaUtil_GroupAllocateMemory( + asioHostApi->allocations, sizeof(PaAsioDeviceInfo) * driverCount ); + if( !deviceInfoArray ) + { result = paInsufficientMemory; goto error; } - IsDebuggerPresent_ = GetProcAddress (LoadLibrary ("Kernel32.dll"), "IsDebuggerPresent"); + IsDebuggerPresent_ = GetProcAddress( LoadLibrary( "Kernel32.dll" ), "IsDebuggerPresent" ); - for (i=0; i < driverCount; ++i) { + for( i=0; i < driverCount; ++i ) + { - PA_DEBUG ( ("ASIO names[%d]:%s\n",i,names[i])); + PA_DEBUG(("ASIO names[%d]:%s\n",i,names[i])); // Since portaudio opens ALL ASIO drivers, and no one else does that, // we face fact that some drivers were not meant for it, drivers which act // like shells on top of REAL drivers, for instance. // so we get duplicate handles, locks and other problems. - // so lets NOT try to load any such wrappers. + // so lets NOT try to load any such wrappers. // The ones i [davidv] know of so far are: - if (strcmp (names[i],"ASIO DirectX Full Duplex Driver") == 0 - || strcmp (names[i],"ASIO Multimedia Driver") == 0 - || strncmp (names[i],"Premiere",8) == 0 //"Premiere Elements Windows Sound 1.0" - || strncmp (names[i],"Adobe",5) == 0 //"Adobe Default Windows Sound 1.5" - || strncmp (names[i],"ReaRoute ASIO",13) == 0 //Reaper www.reaper.fm <- fix your stuff man. - ) { - PA_DEBUG ( ("BLACKLISTED!!!\n")); + if ( strcmp (names[i],"ASIO DirectX Full Duplex Driver") == 0 + || strcmp (names[i],"ASIO Multimedia Driver") == 0 + || strncmp(names[i],"Premiere",8) == 0 //"Premiere Elements Windows Sound 1.0" + || strncmp(names[i],"Adobe",5) == 0 //"Adobe Default Windows Sound 1.5" + ) + { + PA_DEBUG(("BLACKLISTED!!!\n")); continue; } - if (IsDebuggerPresent_ && IsDebuggerPresent_()) { + if( IsDebuggerPresent_ && IsDebuggerPresent_() ) + { /* ASIO Digidesign Driver uses PACE copy protection which quits out if a debugger is running. So we don't load it if a debugger is running. */ - if (strcmp (names[i], "ASIO Digidesign Driver") == 0) { - PA_DEBUG ( ("BLACKLISTED!!! ASIO Digidesign Driver would quit the debugger\n")); - continue; - } - } + if( strcmp(names[i], "ASIO Digidesign Driver") == 0 ) + { + PA_DEBUG(("BLACKLISTED!!! ASIO Digidesign Driver would quit the debugger\n")); + continue; + } + } /* Attempt to load the asio driver... */ - if (LoadAsioDriver (asioHostApi, names[i], &paAsioDriverInfo, asioHostApi->systemSpecific) == paNoError) { + if( LoadAsioDriver( asioHostApi, names[i], &paAsioDriverInfo, asioHostApi->systemSpecific ) == paNoError ) + { PaAsioDeviceInfo *asioDeviceInfo = &deviceInfoArray[ (*hostApi)->info.deviceCount ]; PaDeviceInfo *deviceInfo = &asioDeviceInfo->commonDeviceInfo; @@ -1358,33 +1211,33 @@ PaError PaAsio_Initialize (PaUtilHostApiRepresentation **hostApi, PaHostApiIndex deviceInfo->hostApi = hostApiIndex; deviceInfo->name = names[i]; - PA_DEBUG ( ("PaAsio_Initialize: drv:%d name = %s\n", i,deviceInfo->name)); - PA_DEBUG ( ("PaAsio_Initialize: drv:%d inputChannels = %d\n", i, paAsioDriverInfo.inputChannelCount)); - PA_DEBUG ( ("PaAsio_Initialize: drv:%d outputChannels = %d\n", i, paAsioDriverInfo.outputChannelCount)); - PA_DEBUG ( ("PaAsio_Initialize: drv:%d bufferMinSize = %d\n", i, paAsioDriverInfo.bufferMinSize)); - PA_DEBUG ( ("PaAsio_Initialize: drv:%d bufferMaxSize = %d\n", i, paAsioDriverInfo.bufferMaxSize)); - PA_DEBUG ( ("PaAsio_Initialize: drv:%d bufferPreferredSize = %d\n", i, paAsioDriverInfo.bufferPreferredSize)); - PA_DEBUG ( ("PaAsio_Initialize: drv:%d bufferGranularity = %d\n", i, paAsioDriverInfo.bufferGranularity)); + PA_DEBUG(("PaAsio_Initialize: drv:%d name = %s\n", i,deviceInfo->name)); + PA_DEBUG(("PaAsio_Initialize: drv:%d inputChannels = %d\n", i, paAsioDriverInfo.inputChannelCount)); + PA_DEBUG(("PaAsio_Initialize: drv:%d outputChannels = %d\n", i, paAsioDriverInfo.outputChannelCount)); + PA_DEBUG(("PaAsio_Initialize: drv:%d bufferMinSize = %d\n", i, paAsioDriverInfo.bufferMinSize)); + PA_DEBUG(("PaAsio_Initialize: drv:%d bufferMaxSize = %d\n", i, paAsioDriverInfo.bufferMaxSize)); + PA_DEBUG(("PaAsio_Initialize: drv:%d bufferPreferredSize = %d\n", i, paAsioDriverInfo.bufferPreferredSize)); + PA_DEBUG(("PaAsio_Initialize: drv:%d bufferGranularity = %d\n", i, paAsioDriverInfo.bufferGranularity)); deviceInfo->maxInputChannels = paAsioDriverInfo.inputChannelCount; deviceInfo->maxOutputChannels = paAsioDriverInfo.outputChannelCount; deviceInfo->defaultSampleRate = 0.; bool foundDefaultSampleRate = false; - - for (int j=0; j < PA_DEFAULTSAMPLERATESEARCHORDER_COUNT_; ++j) { - ASIOError asioError = ASIOCanSampleRate (defaultSampleRateSearchOrder_[j]); - - if (asioError != ASE_NoClock && asioError != ASE_NotPresent) { + for( int j=0; j < PA_DEFAULTSAMPLERATESEARCHORDER_COUNT_; ++j ) + { + ASIOError asioError = ASIOCanSampleRate( defaultSampleRateSearchOrder_[j] ); + if( asioError != ASE_NoClock && asioError != ASE_NotPresent ) + { deviceInfo->defaultSampleRate = defaultSampleRateSearchOrder_[j]; foundDefaultSampleRate = true; break; } } - PA_DEBUG ( ("PaAsio_Initialize: drv:%d defaultSampleRate = %f\n", i, deviceInfo->defaultSampleRate)); + PA_DEBUG(("PaAsio_Initialize: drv:%d defaultSampleRate = %f\n", i, deviceInfo->defaultSampleRate)); - if (foundDefaultSampleRate) { + if( foundDefaultSampleRate ){ /* calculate default latency values from bufferPreferredSize for default low latency, and bufferPreferredSize * 3 @@ -1395,28 +1248,27 @@ PaError PaAsio_Initialize (PaUtilHostApiRepresentation **hostApi, PaHostApiIndex */ double defaultLowLatency = - paAsioDriverInfo.bufferPreferredSize / deviceInfo->defaultSampleRate; + paAsioDriverInfo.bufferPreferredSize / deviceInfo->defaultSampleRate; deviceInfo->defaultLowInputLatency = defaultLowLatency; deviceInfo->defaultLowOutputLatency = defaultLowLatency; long defaultHighLatencyBufferSize = - paAsioDriverInfo.bufferPreferredSize * 3; + paAsioDriverInfo.bufferPreferredSize * 3; - if (defaultHighLatencyBufferSize > paAsioDriverInfo.bufferMaxSize) + if( defaultHighLatencyBufferSize > paAsioDriverInfo.bufferMaxSize ) defaultHighLatencyBufferSize = paAsioDriverInfo.bufferMaxSize; double defaultHighLatency = - defaultHighLatencyBufferSize / deviceInfo->defaultSampleRate; - - if (defaultHighLatency < defaultLowLatency) - defaultHighLatency = defaultLowLatency; /* just incase the driver returns something strange */ + defaultHighLatencyBufferSize / deviceInfo->defaultSampleRate; + if( defaultHighLatency < defaultLowLatency ) + defaultHighLatency = defaultLowLatency; /* just incase the driver returns something strange */ + deviceInfo->defaultHighInputLatency = defaultHighLatency; - deviceInfo->defaultHighOutputLatency = defaultHighLatency; - - } else { + + }else{ deviceInfo->defaultLowInputLatency = 0.; deviceInfo->defaultLowOutputLatency = 0.; @@ -1424,11 +1276,10 @@ PaError PaAsio_Initialize (PaUtilHostApiRepresentation **hostApi, PaHostApiIndex deviceInfo->defaultHighOutputLatency = 0.; } - PA_DEBUG ( ("PaAsio_Initialize: drv:%d defaultLowInputLatency = %f\n", i, deviceInfo->defaultLowInputLatency)); - - PA_DEBUG ( ("PaAsio_Initialize: drv:%d defaultLowOutputLatency = %f\n", i, deviceInfo->defaultLowOutputLatency)); - PA_DEBUG ( ("PaAsio_Initialize: drv:%d defaultHighInputLatency = %f\n", i, deviceInfo->defaultHighInputLatency)); - PA_DEBUG ( ("PaAsio_Initialize: drv:%d defaultHighOutputLatency = %f\n", i, deviceInfo->defaultHighOutputLatency)); + PA_DEBUG(("PaAsio_Initialize: drv:%d defaultLowInputLatency = %f\n", i, deviceInfo->defaultLowInputLatency)); + PA_DEBUG(("PaAsio_Initialize: drv:%d defaultLowOutputLatency = %f\n", i, deviceInfo->defaultLowOutputLatency)); + PA_DEBUG(("PaAsio_Initialize: drv:%d defaultHighInputLatency = %f\n", i, deviceInfo->defaultHighInputLatency)); + PA_DEBUG(("PaAsio_Initialize: drv:%d defaultHighOutputLatency = %f\n", i, deviceInfo->defaultHighOutputLatency)); asioDeviceInfo->minBufferSize = paAsioDriverInfo.bufferMinSize; asioDeviceInfo->maxBufferSize = paAsioDriverInfo.bufferMaxSize; @@ -1436,39 +1287,39 @@ PaError PaAsio_Initialize (PaUtilHostApiRepresentation **hostApi, PaHostApiIndex asioDeviceInfo->bufferGranularity = paAsioDriverInfo.bufferGranularity; - asioDeviceInfo->asioChannelInfos = (ASIOChannelInfo*) PaUtil_GroupAllocateMemory ( - asioHostApi->allocations, - sizeof (ASIOChannelInfo) * (deviceInfo->maxInputChannels - + deviceInfo->maxOutputChannels)); - - if (!asioDeviceInfo->asioChannelInfos) { + asioDeviceInfo->asioChannelInfos = (ASIOChannelInfo*)PaUtil_GroupAllocateMemory( + asioHostApi->allocations, + sizeof(ASIOChannelInfo) * (deviceInfo->maxInputChannels + + deviceInfo->maxOutputChannels) ); + if( !asioDeviceInfo->asioChannelInfos ) + { result = paInsufficientMemory; goto error_unload; } int a; - for (a=0; a < deviceInfo->maxInputChannels; ++a) { + for( a=0; a < deviceInfo->maxInputChannels; ++a ){ asioDeviceInfo->asioChannelInfos[a].channel = a; asioDeviceInfo->asioChannelInfos[a].isInput = ASIOTrue; - ASIOError asioError = ASIOGetChannelInfo (&asioDeviceInfo->asioChannelInfos[a]); - - if (asioError != ASE_OK) { + ASIOError asioError = ASIOGetChannelInfo( &asioDeviceInfo->asioChannelInfos[a] ); + if( asioError != ASE_OK ) + { result = paUnanticipatedHostError; - PA_ASIO_SET_LAST_ASIO_ERROR (asioError); + PA_ASIO_SET_LAST_ASIO_ERROR( asioError ); goto error_unload; } } - for (a=0; a < deviceInfo->maxOutputChannels; ++a) { + for( a=0; a < deviceInfo->maxOutputChannels; ++a ){ int b = deviceInfo->maxInputChannels + a; asioDeviceInfo->asioChannelInfos[b].channel = a; asioDeviceInfo->asioChannelInfos[b].isInput = ASIOFalse; - ASIOError asioError = ASIOGetChannelInfo (&asioDeviceInfo->asioChannelInfos[b]); - - if (asioError != ASE_OK) { + ASIOError asioError = ASIOGetChannelInfo( &asioDeviceInfo->asioChannelInfos[b] ); + if( asioError != ASE_OK ) + { result = paUnanticipatedHostError; - PA_ASIO_SET_LAST_ASIO_ERROR (asioError); + PA_ASIO_SET_LAST_ASIO_ERROR( asioError ); goto error_unload; } } @@ -1478,16 +1329,18 @@ PaError PaAsio_Initialize (PaUtilHostApiRepresentation **hostApi, PaHostApiIndex UnloadAsioDriver(); (*hostApi)->deviceInfos[ (*hostApi)->info.deviceCount ] = deviceInfo; - - ++ (*hostApi)->info.deviceCount; + ++(*hostApi)->info.deviceCount; } } } - if ( (*hostApi)->info.deviceCount > 0) { + if( (*hostApi)->info.deviceCount > 0 ) + { (*hostApi)->info.defaultInputDevice = 0; (*hostApi)->info.defaultOutputDevice = 0; - } else { + } + else + { (*hostApi)->info.defaultInputDevice = paNoDevice; (*hostApi)->info.defaultOutputDevice = paNoDevice; } @@ -1497,97 +1350,97 @@ PaError PaAsio_Initialize (PaUtilHostApiRepresentation **hostApi, PaHostApiIndex (*hostApi)->OpenStream = OpenStream; (*hostApi)->IsFormatSupported = IsFormatSupported; - PaUtil_InitializeStreamInterface (&asioHostApi->callbackStreamInterface, CloseStream, StartStream, + PaUtil_InitializeStreamInterface( &asioHostApi->callbackStreamInterface, CloseStream, StartStream, StopStream, AbortStream, IsStreamStopped, IsStreamActive, GetStreamTime, GetStreamCpuLoad, PaUtil_DummyRead, PaUtil_DummyWrite, - PaUtil_DummyGetReadAvailable, PaUtil_DummyGetWriteAvailable); + PaUtil_DummyGetReadAvailable, PaUtil_DummyGetWriteAvailable ); - PaUtil_InitializeStreamInterface (&asioHostApi->blockingStreamInterface, CloseStream, StartStream, + PaUtil_InitializeStreamInterface( &asioHostApi->blockingStreamInterface, CloseStream, StartStream, StopStream, AbortStream, IsStreamStopped, IsStreamActive, GetStreamTime, PaUtil_DummyGetCpuLoad, - ReadStream, WriteStream, GetStreamReadAvailable, GetStreamWriteAvailable); + ReadStream, WriteStream, GetStreamReadAvailable, GetStreamWriteAvailable ); return result; error_unload: - UnloadAsioDriver(); + UnloadAsioDriver(); error: - - if (asioHostApi) { - if (asioHostApi->allocations) { - PaUtil_FreeAllAllocations (asioHostApi->allocations); - PaUtil_DestroyAllocationGroup (asioHostApi->allocations); + if( asioHostApi ) + { + if( asioHostApi->allocations ) + { + PaUtil_FreeAllAllocations( asioHostApi->allocations ); + PaUtil_DestroyAllocationGroup( asioHostApi->allocations ); } delete asioHostApi->asioDrivers; - asioDrivers = 0; /* keep SDK global in sync until we stop depending on it */ - PaUtil_FreeMemory (asioHostApi); + PaUtil_FreeMemory( asioHostApi ); } - return result; } -static void Terminate (struct PaUtilHostApiRepresentation *hostApi) +static void Terminate( struct PaUtilHostApiRepresentation *hostApi ) { - PaAsioHostApiRepresentation *asioHostApi = (PaAsioHostApiRepresentation*) hostApi; + PaAsioHostApiRepresentation *asioHostApi = (PaAsioHostApiRepresentation*)hostApi; /* IMPLEMENT ME: - clean up any resources not handled by the allocation group (need to review if there are any) */ - if (asioHostApi->allocations) { - PaUtil_FreeAllAllocations (asioHostApi->allocations); - PaUtil_DestroyAllocationGroup (asioHostApi->allocations); + if( asioHostApi->allocations ) + { + PaUtil_FreeAllAllocations( asioHostApi->allocations ); + PaUtil_DestroyAllocationGroup( asioHostApi->allocations ); } delete asioHostApi->asioDrivers; /* calls CoUninitialize() */ - asioDrivers = 0; /* keep SDK global in sync until we stop depending on it */ - PaUtil_FreeMemory (asioHostApi); + PaUtil_FreeMemory( asioHostApi ); } -static PaError IsFormatSupported (struct PaUtilHostApiRepresentation *hostApi, +static PaError IsFormatSupported( struct PaUtilHostApiRepresentation *hostApi, const PaStreamParameters *inputParameters, const PaStreamParameters *outputParameters, - double sampleRate) + double sampleRate ) { PaError result = paNoError; - PaAsioHostApiRepresentation *asioHostApi = (PaAsioHostApiRepresentation*) hostApi; + PaAsioHostApiRepresentation *asioHostApi = (PaAsioHostApiRepresentation*)hostApi; PaAsioDriverInfo *driverInfo = &asioHostApi->openAsioDriverInfo; int inputChannelCount, outputChannelCount; PaSampleFormat inputSampleFormat, outputSampleFormat; - PaDeviceIndex asioDeviceIndex; + PaDeviceIndex asioDeviceIndex; ASIOError asioError; - - if (inputParameters && outputParameters) { + + if( inputParameters && outputParameters ) + { /* full duplex ASIO stream must use the same device for input and output */ - if (inputParameters->device != outputParameters->device) + if( inputParameters->device != outputParameters->device ) return paBadIODeviceCombination; } - - if (inputParameters) { + + if( inputParameters ) + { inputChannelCount = inputParameters->channelCount; inputSampleFormat = inputParameters->sampleFormat; /* all standard sample formats are supported by the buffer adapter, this implementation doesn't support any custom sample formats */ - - if (inputSampleFormat & paCustomFormat) + if( inputSampleFormat & paCustomFormat ) return paSampleFormatNotSupported; - + /* unless alternate device specification is supported, reject the use of paUseHostApiSpecificDeviceSpecification */ - if (inputParameters->device == paUseHostApiSpecificDeviceSpecification) + if( inputParameters->device == paUseHostApiSpecificDeviceSpecification ) return paInvalidDevice; asioDeviceIndex = inputParameters->device; @@ -1596,24 +1449,26 @@ static PaError IsFormatSupported (struct PaUtilHostApiRepresentation *hostApi, /** @todo do more validation here */ // if( inputParameters->hostApiSpecificStreamInfo ) // return paIncompatibleHostApiSpecificStreamInfo; /* this implementation doesn't use custom stream info */ - } else { + } + else + { inputChannelCount = 0; } - if (outputParameters) { + if( outputParameters ) + { outputChannelCount = outputParameters->channelCount; outputSampleFormat = outputParameters->sampleFormat; /* all standard sample formats are supported by the buffer adapter, this implementation doesn't support any custom sample formats */ - - if (outputSampleFormat & paCustomFormat) + if( outputSampleFormat & paCustomFormat ) return paSampleFormatNotSupported; - + /* unless alternate device specification is supported, reject the use of paUseHostApiSpecificDeviceSpecification */ - if (outputParameters->device == paUseHostApiSpecificDeviceSpecification) + if( outputParameters->device == paUseHostApiSpecificDeviceSpecification ) return paInvalidDevice; asioDeviceIndex = outputParameters->device; @@ -1622,7 +1477,9 @@ static PaError IsFormatSupported (struct PaUtilHostApiRepresentation *hostApi, /** @todo do more validation here */ // if( outputParameters->hostApiSpecificStreamInfo ) // return paIncompatibleHostApiSpecificStreamInfo; /* this implementation doesn't use custom stream info */ - } else { + } + else + { outputChannelCount = 0; } @@ -1630,8 +1487,9 @@ static PaError IsFormatSupported (struct PaUtilHostApiRepresentation *hostApi, /* if an ASIO device is open we can only get format information for the currently open device */ - if (asioHostApi->openAsioDeviceIndex != paNoDevice - && asioHostApi->openAsioDeviceIndex != asioDeviceIndex) { + if( asioHostApi->openAsioDeviceIndex != paNoDevice + && asioHostApi->openAsioDeviceIndex != asioDeviceIndex ) + { return paDeviceUnavailable; } @@ -1640,47 +1498,50 @@ static PaError IsFormatSupported (struct PaUtilHostApiRepresentation *hostApi, rather than the ones in our device info structure which may be stale */ /* open the device if it's not already open */ - if (asioHostApi->openAsioDeviceIndex == paNoDevice) { - result = LoadAsioDriver (asioHostApi, asioHostApi->inheritedHostApiRep.deviceInfos[ asioDeviceIndex ]->name, - driverInfo, asioHostApi->systemSpecific); - - if (result != paNoError) + if( asioHostApi->openAsioDeviceIndex == paNoDevice ) + { + result = LoadAsioDriver( asioHostApi, asioHostApi->inheritedHostApiRep.deviceInfos[ asioDeviceIndex ]->name, + driverInfo, asioHostApi->systemSpecific ); + if( result != paNoError ) return result; } /* check that input device can support inputChannelCount */ - if (inputChannelCount > 0) { - if (inputChannelCount > driverInfo->inputChannelCount) { + if( inputChannelCount > 0 ) + { + if( inputChannelCount > driverInfo->inputChannelCount ) + { result = paInvalidChannelCount; goto done; } } /* check that output device can support outputChannelCount */ - if (outputChannelCount) { - if (outputChannelCount > driverInfo->outputChannelCount) { + if( outputChannelCount ) + { + if( outputChannelCount > driverInfo->outputChannelCount ) + { result = paInvalidChannelCount; goto done; } } - + /* query for sample rate support */ - asioError = ASIOCanSampleRate (sampleRate); - - if (asioError == ASE_NoClock || asioError == ASE_NotPresent) { + asioError = ASIOCanSampleRate( sampleRate ); + if( asioError == ASE_NoClock || asioError == ASE_NotPresent ) + { result = paInvalidSampleRate; goto done; } done: - /* close the device if it wasn't already open */ - - if (asioHostApi->openAsioDeviceIndex == paNoDevice) { + if( asioHostApi->openAsioDeviceIndex == paNoDevice ) + { UnloadAsioDriver(); /* not sure if we should check for errors here */ } - if (result == paNoError) + if( result == paNoError ) return paFormatIsSupported; else return result; @@ -1689,8 +1550,8 @@ done: /** A data structure specifically for storing blocking i/o related data. */ - -typedef struct PaAsioStreamBlockingState { +typedef struct PaAsioStreamBlockingState +{ int stopFlag; /**< Flag indicating that block processing is to be stopped. */ unsigned long writeBuffersRequested; /**< The number of available output buffers, requested by the #WriteStream() function. */ @@ -1718,14 +1579,14 @@ typedef struct PaAsioStreamBlockingState { int outputUnderflowFlag; /**< Flag to signal an output underflow from within the callback function. */ int inputOverflowFlag; /**< Flag to signal an input overflow from within the callback function. */ } - PaAsioStreamBlockingState; /* PaAsioStream - a stream data structure specifically for this implementation */ -typedef struct PaAsioStream { +typedef struct PaAsioStream +{ PaUtilStreamRepresentation streamRepresentation; PaUtilCpuLoadMeasurer cpuLoadMeasurer; PaUtilBufferProcessor bufferProcessor; @@ -1758,6 +1619,7 @@ typedef struct PaAsioStream { HANDLE completedBuffersPlayedEvent; bool streamFinishedCallbackCalled; + int isStopped; volatile int isActive; volatile bool zeroOutput; /* all future calls to the callback will output silence */ @@ -1768,71 +1630,86 @@ typedef struct PaAsioStream { PaAsioStreamBlockingState *blockingState; /**< Blocking i/o data struct, or NULL when using callback interface. */ } - PaAsioStream; static PaAsioStream *theAsioStream = 0; /* due to ASIO sdk limitations there can be only one stream */ -static void ZeroOutputBuffers (PaAsioStream *stream, long index) +static void ZeroOutputBuffers( PaAsioStream *stream, long index ) { int i; - for (i=0; i < stream->outputChannelCount; ++i) { + for( i=0; i < stream->outputChannelCount; ++i ) + { void *buffer = stream->asioBufferInfos[ i + stream->inputChannelCount ].buffers[index]; - int bytesPerSample = BytesPerAsioSample (stream->asioChannelInfos[ i + stream->inputChannelCount ].type); + int bytesPerSample = BytesPerAsioSample( stream->asioChannelInfos[ i + stream->inputChannelCount ].type ); - memset (buffer, 0, stream->framesPerHostCallback * bytesPerSample); + memset( buffer, 0, stream->framesPerHostCallback * bytesPerSample ); } } -static unsigned long SelectHostBufferSize (unsigned long suggestedLatencyFrames, - PaAsioDriverInfo *driverInfo) +static unsigned long SelectHostBufferSize( unsigned long suggestedLatencyFrames, + PaAsioDriverInfo *driverInfo ) { unsigned long result; - if (suggestedLatencyFrames == 0) { + if( suggestedLatencyFrames == 0 ) + { result = driverInfo->bufferPreferredSize; - } else { - if (suggestedLatencyFrames <= (unsigned long) driverInfo->bufferMinSize) { + } + else{ + if( suggestedLatencyFrames <= (unsigned long)driverInfo->bufferMinSize ) + { result = driverInfo->bufferMinSize; - } else if (suggestedLatencyFrames >= (unsigned long) driverInfo->bufferMaxSize) { + } + else if( suggestedLatencyFrames >= (unsigned long)driverInfo->bufferMaxSize ) + { result = driverInfo->bufferMaxSize; - } else { - if (driverInfo->bufferGranularity == -1) { + } + else + { + if( driverInfo->bufferGranularity == -1 ) + { /* power-of-two */ result = 2; - while (result < suggestedLatencyFrames) + while( result < suggestedLatencyFrames ) result *= 2; - if (result < (unsigned long) driverInfo->bufferMinSize) + if( result < (unsigned long)driverInfo->bufferMinSize ) result = driverInfo->bufferMinSize; - if (result > (unsigned long) driverInfo->bufferMaxSize) + if( result > (unsigned long)driverInfo->bufferMaxSize ) result = driverInfo->bufferMaxSize; - } else if (driverInfo->bufferGranularity == 0) { + } + else if( driverInfo->bufferGranularity == 0 ) + { /* the documentation states that bufferGranularity should be zero when bufferMinSize, bufferMaxSize and bufferPreferredSize are the same. We assume that is the case. */ result = driverInfo->bufferPreferredSize; - } else { + } + else + { /* modulo granularity */ unsigned long remainder = - suggestedLatencyFrames % driverInfo->bufferGranularity; + suggestedLatencyFrames % driverInfo->bufferGranularity; - if (remainder == 0) { + if( remainder == 0 ) + { result = suggestedLatencyFrames; - } else { + } + else + { result = suggestedLatencyFrames - + (driverInfo->bufferGranularity - remainder); + + (driverInfo->bufferGranularity - remainder); - if (result > (unsigned long) driverInfo->bufferMaxSize) + if( result > (unsigned long)driverInfo->bufferMaxSize ) result = driverInfo->bufferMaxSize; } } @@ -1845,29 +1722,31 @@ static unsigned long SelectHostBufferSize (unsigned long suggestedLatencyFrames, /* returns channelSelectors if present */ -static PaError ValidateAsioSpecificStreamInfo ( - const PaStreamParameters *streamParameters, - const PaAsioStreamInfo *streamInfo, - int deviceChannelCount, - int **channelSelectors) +static PaError ValidateAsioSpecificStreamInfo( + const PaStreamParameters *streamParameters, + const PaAsioStreamInfo *streamInfo, + int deviceChannelCount, + int **channelSelectors ) { - if (streamInfo) { - if (streamInfo->size != sizeof (PaAsioStreamInfo) - || streamInfo->version != 1) { + if( streamInfo ) + { + if( streamInfo->size != sizeof( PaAsioStreamInfo ) + || streamInfo->version != 1 ) + { return paIncompatibleHostApiSpecificStreamInfo; } - if (streamInfo->flags & paAsioUseChannelSelectors) + if( streamInfo->flags & paAsioUseChannelSelectors ) *channelSelectors = streamInfo->channelSelectors; - if (! (*channelSelectors)) + if( !(*channelSelectors) ) return paIncompatibleHostApiSpecificStreamInfo; - for (int i=0; i < streamParameters->channelCount; ++i) { - if ( (*channelSelectors) [i] < 0 - || (*channelSelectors) [i] >= deviceChannelCount) { + for( int i=0; i < streamParameters->channelCount; ++i ){ + if( (*channelSelectors)[i] < 0 + || (*channelSelectors)[i] >= deviceChannelCount ){ return paInvalidChannelCount; - } + } } } @@ -1875,9 +1754,101 @@ static PaError ValidateAsioSpecificStreamInfo ( } +static bool IsUsingExternalClockSource() +{ + bool result = false; + ASIOError asioError; + ASIOClockSource clocks[32]; + long numSources=32; + + /* davidv: listing ASIO Clock sources. there is an ongoing investigation by + me about whether or not to call ASIOSetSampleRate if an external Clock is + used. A few drivers expected different things here */ + + asioError = ASIOGetClockSources(clocks, &numSources); + if( asioError != ASE_OK ){ + PA_DEBUG(("ERROR: ASIOGetClockSources: %s\n", PaAsio_GetAsioErrorText(asioError) )); + }else{ + PA_DEBUG(("INFO ASIOGetClockSources listing %d clocks\n", numSources )); + for (int i=0;i<numSources;++i){ + PA_DEBUG(("ASIOClockSource%d %s current:%d\n", i, clocks[i].name, clocks[i].isCurrentSource )); + + if (clocks[i].isCurrentSource) + result = true; + } + } + + return result; +} + + +static PaError ValidateAndSetSampleRate( double sampleRate ) +{ + PaError result = paNoError; + ASIOError asioError; + + // check that the device supports the requested sample rate + + asioError = ASIOCanSampleRate( sampleRate ); + PA_DEBUG(("ASIOCanSampleRate(%f):%d\n", sampleRate, asioError )); + + if( asioError != ASE_OK ) + { + result = paInvalidSampleRate; + PA_DEBUG(("ERROR: ASIOCanSampleRate: %s\n", PaAsio_GetAsioErrorText(asioError) )); + goto error; + } + + // retrieve the current sample rate, we only change to the requested + // sample rate if the device is not already in that rate. + + ASIOSampleRate oldRate; + asioError = ASIOGetSampleRate(&oldRate); + if( asioError != ASE_OK ) + { + result = paInvalidSampleRate; + PA_DEBUG(("ERROR: ASIOGetSampleRate: %s\n", PaAsio_GetAsioErrorText(asioError) )); + goto error; + } + PA_DEBUG(("ASIOGetSampleRate:%f\n",oldRate)); + + if (oldRate != sampleRate){ + /* Set sample rate */ + + PA_DEBUG(("before ASIOSetSampleRate(%f)\n",sampleRate)); + + /* + If you have problems with some drivers when externally clocked, + try switching on the following line and commenting out the one after it. + See IsUsingExternalClockSource() for more info. + */ + //if( IsUsingExternalClockSource() ){ + if( false ){ + asioError = ASIOSetSampleRate( 0 ); + }else{ + asioError = ASIOSetSampleRate( sampleRate ); + } + if( asioError != ASE_OK ) + { + result = paInvalidSampleRate; + PA_DEBUG(("ERROR: ASIOSetSampleRate: %s\n", PaAsio_GetAsioErrorText(asioError) )); + goto error; + } + PA_DEBUG(("after ASIOSetSampleRate(%f)\n",sampleRate)); + } + else + { + PA_DEBUG(("No Need to change SR\n")); + } + +error: + return result; +} + + /* see pa_hostapi.h for a list of validity guarantees made about OpenStream parameters */ -static PaError OpenStream (struct PaUtilHostApiRepresentation *hostApi, +static PaError OpenStream( struct PaUtilHostApiRepresentation *hostApi, PaStream** s, const PaStreamParameters *inputParameters, const PaStreamParameters *outputParameters, @@ -1885,10 +1856,10 @@ static PaError OpenStream (struct PaUtilHostApiRepresentation *hostApi, unsigned long framesPerBuffer, PaStreamFlags streamFlags, PaStreamCallback *streamCallback, - void *userData) + void *userData ) { PaError result = paNoError; - PaAsioHostApiRepresentation *asioHostApi = (PaAsioHostApiRepresentation*) hostApi; + PaAsioHostApiRepresentation *asioHostApi = (PaAsioHostApiRepresentation*)hostApi; PaAsioStream *stream = 0; PaAsioStreamInfo *inputStreamInfo, *outputStreamInfo; unsigned long framesPerHostBuffer; @@ -1906,10 +1877,9 @@ static PaError OpenStream (struct PaUtilHostApiRepresentation *hostApi, PaAsioDriverInfo *driverInfo; int *inputChannelSelectors = 0; int *outputChannelSelectors = 0; - bool isExternal = false; /* Are we using blocking i/o interface? */ - int usingBlockingIo = (!streamCallback) ? TRUE : FALSE; + int usingBlockingIo = ( !streamCallback ) ? TRUE : FALSE; /* Blocking i/o stuff */ long lBlockingBufferSize = 0; /* Desired ring buffer size in samples. */ long lBlockingBufferSizePow2 = 0; /* Power-of-2 rounded ring buffer size. */ @@ -1922,76 +1892,80 @@ static PaError OpenStream (struct PaUtilHostApiRepresentation *hostApi, /* unless we move to using lower level ASIO calls, we can only have one device open at a time */ - - if (asioHostApi->openAsioDeviceIndex != paNoDevice) { - PA_DEBUG ( ("OpenStream paDeviceUnavailable\n")); + if( asioHostApi->openAsioDeviceIndex != paNoDevice ) + { + PA_DEBUG(("OpenStream paDeviceUnavailable\n")); return paDeviceUnavailable; } - if (inputParameters && outputParameters) { + assert( theAsioStream == 0 ); + + if( inputParameters && outputParameters ) + { /* full duplex ASIO stream must use the same device for input and output */ - if (inputParameters->device != outputParameters->device) { - PA_DEBUG ( ("OpenStream paBadIODeviceCombination\n")); + if( inputParameters->device != outputParameters->device ) + { + PA_DEBUG(("OpenStream paBadIODeviceCombination\n")); return paBadIODeviceCombination; } } - if (inputParameters) { + if( inputParameters ) + { inputChannelCount = inputParameters->channelCount; inputSampleFormat = inputParameters->sampleFormat; - suggestedInputLatencyFrames = (unsigned long) ( (inputParameters->suggestedLatency * sampleRate) +0.5f); + suggestedInputLatencyFrames = (unsigned long)((inputParameters->suggestedLatency * sampleRate)+0.5f); /* unless alternate device specification is supported, reject the use of paUseHostApiSpecificDeviceSpecification */ - - if (inputParameters->device == paUseHostApiSpecificDeviceSpecification) + if( inputParameters->device == paUseHostApiSpecificDeviceSpecification ) return paInvalidDevice; asioDeviceIndex = inputParameters->device; - PaAsioDeviceInfo *asioDeviceInfo = (PaAsioDeviceInfo*) hostApi->deviceInfos[asioDeviceIndex]; + PaAsioDeviceInfo *asioDeviceInfo = (PaAsioDeviceInfo*)hostApi->deviceInfos[asioDeviceIndex]; /* validate hostApiSpecificStreamInfo */ - inputStreamInfo = (PaAsioStreamInfo*) inputParameters->hostApiSpecificStreamInfo; - - result = ValidateAsioSpecificStreamInfo (inputParameters, inputStreamInfo, - asioDeviceInfo->commonDeviceInfo.maxInputChannels, - &inputChannelSelectors - ); - - if (result != paNoError) return result; - } else { + inputStreamInfo = (PaAsioStreamInfo*)inputParameters->hostApiSpecificStreamInfo; + result = ValidateAsioSpecificStreamInfo( inputParameters, inputStreamInfo, + asioDeviceInfo->commonDeviceInfo.maxInputChannels, + &inputChannelSelectors + ); + if( result != paNoError ) return result; + } + else + { inputChannelCount = 0; inputSampleFormat = 0; suggestedInputLatencyFrames = 0; } - if (outputParameters) { + if( outputParameters ) + { outputChannelCount = outputParameters->channelCount; outputSampleFormat = outputParameters->sampleFormat; - suggestedOutputLatencyFrames = (unsigned long) ( (outputParameters->suggestedLatency * sampleRate) +0.5f); + suggestedOutputLatencyFrames = (unsigned long)((outputParameters->suggestedLatency * sampleRate)+0.5f); /* unless alternate device specification is supported, reject the use of paUseHostApiSpecificDeviceSpecification */ - - if (outputParameters->device == paUseHostApiSpecificDeviceSpecification) + if( outputParameters->device == paUseHostApiSpecificDeviceSpecification ) return paInvalidDevice; asioDeviceIndex = outputParameters->device; - PaAsioDeviceInfo *asioDeviceInfo = (PaAsioDeviceInfo*) hostApi->deviceInfos[asioDeviceIndex]; + PaAsioDeviceInfo *asioDeviceInfo = (PaAsioDeviceInfo*)hostApi->deviceInfos[asioDeviceIndex]; /* validate hostApiSpecificStreamInfo */ - outputStreamInfo = (PaAsioStreamInfo*) outputParameters->hostApiSpecificStreamInfo; - - result = ValidateAsioSpecificStreamInfo (outputParameters, outputStreamInfo, - asioDeviceInfo->commonDeviceInfo.maxOutputChannels, - &outputChannelSelectors - ); - - if (result != paNoError) return result; - } else { + outputStreamInfo = (PaAsioStreamInfo*)outputParameters->hostApiSpecificStreamInfo; + result = ValidateAsioSpecificStreamInfo( outputParameters, outputStreamInfo, + asioDeviceInfo->commonDeviceInfo.maxOutputChannels, + &outputChannelSelectors + ); + if( result != paNoError ) return result; + } + else + { outputChannelCount = 0; outputSampleFormat = 0; suggestedOutputLatencyFrames = 0; @@ -2002,107 +1976,40 @@ static PaError OpenStream (struct PaUtilHostApiRepresentation *hostApi, /* NOTE: we load the driver and use its current settings rather than the ones in our device info structure which may be stale */ - result = LoadAsioDriver (asioHostApi, asioHostApi->inheritedHostApiRep.deviceInfos[ asioDeviceIndex ]->name, - driverInfo, asioHostApi->systemSpecific); - - if (result == paNoError) + result = LoadAsioDriver( asioHostApi, asioHostApi->inheritedHostApiRep.deviceInfos[ asioDeviceIndex ]->name, + driverInfo, asioHostApi->systemSpecific ); + if( result == paNoError ) asioIsInitialized = 1; - else { - PA_DEBUG ( ("OpenStream ERROR1 - LoadAsioDriver returned %d\n", result)); + else{ + PA_DEBUG(("OpenStream ERROR1 - LoadAsioDriver returned %d\n", result)); goto error; } /* check that input device can support inputChannelCount */ - if (inputChannelCount > 0) { - if (inputChannelCount > driverInfo->inputChannelCount) { + if( inputChannelCount > 0 ) + { + if( inputChannelCount > driverInfo->inputChannelCount ) + { result = paInvalidChannelCount; - PA_DEBUG ( ("OpenStream ERROR2\n")); + PA_DEBUG(("OpenStream ERROR2\n")); goto error; } } /* check that output device can support outputChannelCount */ - if (outputChannelCount) { - if (outputChannelCount > driverInfo->outputChannelCount) { + if( outputChannelCount ) + { + if( outputChannelCount > driverInfo->outputChannelCount ) + { result = paInvalidChannelCount; - PA_DEBUG ( ("OpenStream ERROR3\n")); + PA_DEBUG(("OpenStream ERROR3\n")); goto error; } } - - /* davidv: listing ASIO Clock sources, there is an ongoing investigation by - me about whether or not call ASIOSetSampleRate if an external Clock is - used. A few drivers expected different things here */ - { - ASIOClockSource clocks[32]; - long numSources=32; - asioError = ASIOGetClockSources (clocks, &numSources); - - if (asioError != ASE_OK) { - PA_DEBUG ( ("ERROR: ASIOGetClockSources: %s\n", PaAsio_GetAsioErrorText (asioError))); - } else { - PA_DEBUG ( ("INFO ASIOGetClockSources listing %d clocks\n", numSources)); - - for (int i=0;i<numSources;++i) { - PA_DEBUG ( ("ASIOClockSource%d %s current:%d\n", i,clocks[i].name, clocks[i].isCurrentSource)); - - /* - If you have problems with some drivers when externally clocked, - uncomment the next two lines - */ - //if (clocks[i].isCurrentSource) - // isExternal = true; - } - } - } - - // check that the device supports the requested sample rate - - asioError = ASIOCanSampleRate (sampleRate); - - PA_DEBUG ( ("ASIOCanSampleRate(%f):%d\n",sampleRate, asioError)); - - if (asioError != ASE_OK) { - result = paInvalidSampleRate; - PA_DEBUG ( ("ERROR: ASIOCanSampleRate: %s\n", PaAsio_GetAsioErrorText (asioError))); - goto error; - } - - - // retrieve the current sample rate, we only change to the requested - // sample rate if the device is not already in that rate. - - ASIOSampleRate oldRate; - - asioError = ASIOGetSampleRate (&oldRate); - - if (asioError != ASE_OK) { - result = paInvalidSampleRate; - PA_DEBUG ( ("ERROR: ASIOGetSampleRate: %s\n", PaAsio_GetAsioErrorText (asioError))); + result = ValidateAndSetSampleRate( sampleRate ); + if( result != paNoError ) goto error; - } - - PA_DEBUG ( ("ASIOGetSampleRate:%f\n",oldRate)); - - if (oldRate != sampleRate) { - - PA_DEBUG ( ("before ASIOSetSampleRate(%f)\n",sampleRate)); - - asioError = ASIOSetSampleRate (isExternal?0:sampleRate); - /* Set sample rate */ - - if (asioError != ASE_OK) { - result = paInvalidSampleRate; - PA_DEBUG ( ("ERROR: ASIOSetSampleRate: %s\n", PaAsio_GetAsioErrorText (asioError))); - goto error; - } - - PA_DEBUG ( ("after ASIOSetSampleRate(%f)\n",sampleRate)); - } else { - PA_DEBUG ( ("No Need to change SR\n")); - } - /* IMPLEMENT ME: @@ -2111,32 +2018,30 @@ static PaError OpenStream (struct PaUtilHostApiRepresentation *hostApi, */ /* validate platform specific flags */ - if ( (streamFlags & paPlatformSpecificFlags) != 0) { - PA_DEBUG ( ("OpenStream invalid flags!!\n")); + if( (streamFlags & paPlatformSpecificFlags) != 0 ){ + PA_DEBUG(("OpenStream invalid flags!!\n")); return paInvalidFlag; /* unexpected platform specific flag */ } - stream = (PaAsioStream*) PaUtil_AllocateMemory (sizeof (PaAsioStream)); - - if (!stream) { + stream = (PaAsioStream*)PaUtil_AllocateMemory( sizeof(PaAsioStream) ); + if( !stream ) + { result = paInsufficientMemory; - PA_DEBUG ( ("OpenStream ERROR5\n")); + PA_DEBUG(("OpenStream ERROR5\n")); goto error; } - stream->blockingState = NULL; /* Blocking i/o not initialized, yet. */ - stream->completedBuffersPlayedEvent = CreateEvent (NULL, TRUE, FALSE, NULL); - - if (stream->completedBuffersPlayedEvent == NULL) { + stream->completedBuffersPlayedEvent = CreateEvent( NULL, TRUE, FALSE, NULL ); + if( stream->completedBuffersPlayedEvent == NULL ) + { result = paUnanticipatedHostError; - PA_ASIO_SET_LAST_SYSTEM_ERROR (GetLastError()); - PA_DEBUG ( ("OpenStream ERROR6\n")); + PA_ASIO_SET_LAST_SYSTEM_ERROR( GetLastError() ); + PA_DEBUG(("OpenStream ERROR6\n")); goto error; } - completedBuffersPlayedEventInited = 1; @@ -2145,88 +2050,95 @@ static PaError OpenStream (struct PaUtilHostApiRepresentation *hostApi, stream->bufferPtrs = 0; /* for deallocation in error */ /* Using blocking i/o interface... */ - - if (usingBlockingIo) { + if( usingBlockingIo ) + { /* Blocking i/o is implemented by running callback mode, using a special blocking i/o callback. */ streamCallback = BlockingIoPaCallback; /* Setup PA to use the ASIO blocking i/o callback. */ userData = &theAsioStream; /* The callback user data will be the PA ASIO stream. */ - PaUtil_InitializeStreamRepresentation (&stream->streamRepresentation, - &asioHostApi->blockingStreamInterface, streamCallback, userData); - } else { /* Using callback interface... */ - PaUtil_InitializeStreamRepresentation (&stream->streamRepresentation, - &asioHostApi->callbackStreamInterface, streamCallback, userData); + PaUtil_InitializeStreamRepresentation( &stream->streamRepresentation, + &asioHostApi->blockingStreamInterface, streamCallback, userData ); + } + else /* Using callback interface... */ + { + PaUtil_InitializeStreamRepresentation( &stream->streamRepresentation, + &asioHostApi->callbackStreamInterface, streamCallback, userData ); } - PaUtil_InitializeCpuLoadMeasurer (&stream->cpuLoadMeasurer, sampleRate); - + PaUtil_InitializeCpuLoadMeasurer( &stream->cpuLoadMeasurer, sampleRate ); - stream->asioBufferInfos = (ASIOBufferInfo*) PaUtil_AllocateMemory ( - sizeof (ASIOBufferInfo) * (inputChannelCount + outputChannelCount)); - if (!stream->asioBufferInfos) { + stream->asioBufferInfos = (ASIOBufferInfo*)PaUtil_AllocateMemory( + sizeof(ASIOBufferInfo) * (inputChannelCount + outputChannelCount) ); + if( !stream->asioBufferInfos ) + { result = paInsufficientMemory; - PA_DEBUG ( ("OpenStream ERROR7\n")); + PA_DEBUG(("OpenStream ERROR7\n")); goto error; } - for (i=0; i < inputChannelCount; ++i) { + for( i=0; i < inputChannelCount; ++i ) + { ASIOBufferInfo *info = &stream->asioBufferInfos[i]; info->isInput = ASIOTrue; - if (inputChannelSelectors) { + if( inputChannelSelectors ){ // inputChannelSelectors values have already been validated in // ValidateAsioSpecificStreamInfo() above info->channelNum = inputChannelSelectors[i]; - } else { + }else{ info->channelNum = i; } info->buffers[0] = info->buffers[1] = 0; } - for (i=0; i < outputChannelCount; ++i) { + for( i=0; i < outputChannelCount; ++i ){ ASIOBufferInfo *info = &stream->asioBufferInfos[inputChannelCount+i]; info->isInput = ASIOFalse; - if (outputChannelSelectors) { + if( outputChannelSelectors ){ // outputChannelSelectors values have already been validated in // ValidateAsioSpecificStreamInfo() above info->channelNum = outputChannelSelectors[i]; - } else { + }else{ info->channelNum = i; } - + info->buffers[0] = info->buffers[1] = 0; } /* Using blocking i/o interface... */ - if (usingBlockingIo) { - /** @todo REVIEW selection of host buffer size for blocking i/o */ + if( usingBlockingIo ) + { +/** @todo REVIEW selection of host buffer size for blocking i/o */ /* Use default host latency for blocking i/o. */ - framesPerHostBuffer = SelectHostBufferSize (0, driverInfo); + framesPerHostBuffer = SelectHostBufferSize( 0, driverInfo ); - } else { /* Using callback interface... */ - framesPerHostBuffer = SelectHostBufferSize ( - ( (suggestedInputLatencyFrames > suggestedOutputLatencyFrames) - ? suggestedInputLatencyFrames : suggestedOutputLatencyFrames), - driverInfo); + } + else /* Using callback interface... */ + { + framesPerHostBuffer = SelectHostBufferSize( + (( suggestedInputLatencyFrames > suggestedOutputLatencyFrames ) + ? suggestedInputLatencyFrames : suggestedOutputLatencyFrames), + driverInfo ); } - PA_DEBUG ( ("PaAsioOpenStream: framesPerHostBuffer :%d\n", framesPerHostBuffer)); + PA_DEBUG(("PaAsioOpenStream: framesPerHostBuffer :%d\n", framesPerHostBuffer)); - asioError = ASIOCreateBuffers (stream->asioBufferInfos, - inputChannelCount+outputChannelCount, - framesPerHostBuffer, &asioCallbacks_); + asioError = ASIOCreateBuffers( stream->asioBufferInfos, + inputChannelCount+outputChannelCount, + framesPerHostBuffer, &asioCallbacks_ ); - if (asioError != ASE_OK - && framesPerHostBuffer != (unsigned long) driverInfo->bufferPreferredSize) { - PA_DEBUG ( ("ERROR: ASIOCreateBuffers: %s\n", PaAsio_GetAsioErrorText (asioError))); + if( asioError != ASE_OK + && framesPerHostBuffer != (unsigned long)driverInfo->bufferPreferredSize ) + { + PA_DEBUG(("ERROR: ASIOCreateBuffers: %s\n", PaAsio_GetAsioErrorText(asioError) )); /* Some buggy drivers (like the Hoontech DSP24) give incorrect [min, preferred, max] values They should work with the preferred size @@ -2236,217 +2148,221 @@ static PaError OpenStream (struct PaUtilHostApiRepresentation *hostApi, framesPerHostBuffer = driverInfo->bufferPreferredSize; - PA_DEBUG ( ("PaAsioOpenStream: CORRECTED framesPerHostBuffer :%d\n", framesPerHostBuffer)); - - ASIOError asioError2 = ASIOCreateBuffers (stream->asioBufferInfos, - inputChannelCount+outputChannelCount, - framesPerHostBuffer, &asioCallbacks_); + PA_DEBUG(("PaAsioOpenStream: CORRECTED framesPerHostBuffer :%d\n", framesPerHostBuffer)); - if (asioError2 == ASE_OK) + ASIOError asioError2 = ASIOCreateBuffers( stream->asioBufferInfos, + inputChannelCount+outputChannelCount, + framesPerHostBuffer, &asioCallbacks_ ); + if( asioError2 == ASE_OK ) asioError = ASE_OK; } - if (asioError != ASE_OK) { + if( asioError != ASE_OK ) + { result = paUnanticipatedHostError; - PA_ASIO_SET_LAST_ASIO_ERROR (asioError); - PA_DEBUG ( ("OpenStream ERROR9\n")); + PA_ASIO_SET_LAST_ASIO_ERROR( asioError ); + PA_DEBUG(("OpenStream ERROR9\n")); goto error; } asioBuffersCreated = 1; - stream->asioChannelInfos = (ASIOChannelInfo*) PaUtil_AllocateMemory ( - sizeof (ASIOChannelInfo) * (inputChannelCount + outputChannelCount)); - - if (!stream->asioChannelInfos) { + stream->asioChannelInfos = (ASIOChannelInfo*)PaUtil_AllocateMemory( + sizeof(ASIOChannelInfo) * (inputChannelCount + outputChannelCount) ); + if( !stream->asioChannelInfos ) + { result = paInsufficientMemory; - PA_DEBUG ( ("OpenStream ERROR10\n")); + PA_DEBUG(("OpenStream ERROR10\n")); goto error; } - for (i=0; i < inputChannelCount + outputChannelCount; ++i) { + for( i=0; i < inputChannelCount + outputChannelCount; ++i ) + { stream->asioChannelInfos[i].channel = stream->asioBufferInfos[i].channelNum; stream->asioChannelInfos[i].isInput = stream->asioBufferInfos[i].isInput; - asioError = ASIOGetChannelInfo (&stream->asioChannelInfos[i]); - - if (asioError != ASE_OK) { + asioError = ASIOGetChannelInfo( &stream->asioChannelInfos[i] ); + if( asioError != ASE_OK ) + { result = paUnanticipatedHostError; - PA_ASIO_SET_LAST_ASIO_ERROR (asioError); - PA_DEBUG ( ("OpenStream ERROR11\n")); + PA_ASIO_SET_LAST_ASIO_ERROR( asioError ); + PA_DEBUG(("OpenStream ERROR11\n")); goto error; } } - stream->bufferPtrs = (void**) PaUtil_AllocateMemory ( - - 2 * sizeof (void*) * (inputChannelCount + outputChannelCount)); - - if (!stream->bufferPtrs) { + stream->bufferPtrs = (void**)PaUtil_AllocateMemory( + 2 * sizeof(void*) * (inputChannelCount + outputChannelCount) ); + if( !stream->bufferPtrs ) + { result = paInsufficientMemory; - PA_DEBUG ( ("OpenStream ERROR12\n")); + PA_DEBUG(("OpenStream ERROR12\n")); goto error; } - if (inputChannelCount > 0) { + if( inputChannelCount > 0 ) + { stream->inputBufferPtrs[0] = stream-> bufferPtrs; stream->inputBufferPtrs[1] = &stream->bufferPtrs[inputChannelCount]; - for (i=0; i<inputChannelCount; ++i) { + for( i=0; i<inputChannelCount; ++i ) + { stream->inputBufferPtrs[0][i] = stream->asioBufferInfos[i].buffers[0]; stream->inputBufferPtrs[1][i] = stream->asioBufferInfos[i].buffers[1]; } - } else { + } + else + { stream->inputBufferPtrs[0] = 0; stream->inputBufferPtrs[1] = 0; } - if (outputChannelCount > 0) { + if( outputChannelCount > 0 ) + { stream->outputBufferPtrs[0] = &stream->bufferPtrs[inputChannelCount*2]; stream->outputBufferPtrs[1] = &stream->bufferPtrs[inputChannelCount*2 + outputChannelCount]; - for (i=0; i<outputChannelCount; ++i) { + for( i=0; i<outputChannelCount; ++i ) + { stream->outputBufferPtrs[0][i] = stream->asioBufferInfos[inputChannelCount+i].buffers[0]; stream->outputBufferPtrs[1][i] = stream->asioBufferInfos[inputChannelCount+i].buffers[1]; } - } else { + } + else + { stream->outputBufferPtrs[0] = 0; stream->outputBufferPtrs[1] = 0; } - if (inputChannelCount > 0) { + if( inputChannelCount > 0 ) + { /* FIXME: assume all channels use the same type for now */ ASIOSampleType inputType = stream->asioChannelInfos[0].type; - PA_DEBUG ( ("ASIO Input type:%d",inputType)); - AsioSampleTypeLOG (inputType); - hostInputSampleFormat = AsioSampleTypeToPaNativeSampleFormat (inputType); + PA_DEBUG(("ASIO Input type:%d",inputType)); + AsioSampleTypeLOG(inputType); + hostInputSampleFormat = AsioSampleTypeToPaNativeSampleFormat( inputType ); - SelectAsioToPaConverter (inputType, &stream->inputBufferConverter, &stream->inputShift); - } else { + SelectAsioToPaConverter( inputType, &stream->inputBufferConverter, &stream->inputShift ); + } + else + { hostInputSampleFormat = 0; stream->inputBufferConverter = 0; } - if (outputChannelCount > 0) { + if( outputChannelCount > 0 ) + { /* FIXME: assume all channels use the same type for now */ ASIOSampleType outputType = stream->asioChannelInfos[inputChannelCount].type; - PA_DEBUG ( ("ASIO Output type:%d",outputType)); - AsioSampleTypeLOG (outputType); - hostOutputSampleFormat = AsioSampleTypeToPaNativeSampleFormat (outputType); + PA_DEBUG(("ASIO Output type:%d",outputType)); + AsioSampleTypeLOG(outputType); + hostOutputSampleFormat = AsioSampleTypeToPaNativeSampleFormat( outputType ); - SelectPaToAsioConverter (outputType, &stream->outputBufferConverter, &stream->outputShift); - } else { + SelectPaToAsioConverter( outputType, &stream->outputBufferConverter, &stream->outputShift ); + } + else + { hostOutputSampleFormat = 0; stream->outputBufferConverter = 0; } - ASIOGetLatencies (&stream->inputLatency, &stream->outputLatency); + ASIOGetLatencies( &stream->inputLatency, &stream->outputLatency ); /* Using blocking i/o interface... */ - - if (usingBlockingIo) { + if( usingBlockingIo ) + { /* Allocate the blocking i/o input ring buffer memory. */ - stream->blockingState = (PaAsioStreamBlockingState*) PaUtil_AllocateMemory (sizeof (PaAsioStreamBlockingState)); - - if (!stream->blockingState) { + stream->blockingState = (PaAsioStreamBlockingState*)PaUtil_AllocateMemory( sizeof(PaAsioStreamBlockingState) ); + if( !stream->blockingState ) + { result = paInsufficientMemory; - PA_DEBUG ( ("ERROR! Blocking i/o interface struct allocation failed in OpenStream()\n")); + PA_DEBUG(("ERROR! Blocking i/o interface struct allocation failed in OpenStream()\n")); goto error; } /* Initialize blocking i/o interface struct. */ stream->blockingState->readFramesReadyEvent = NULL; /* Uninitialized, yet. */ - stream->blockingState->writeBuffersReadyEvent = NULL; /* Uninitialized, yet. */ - stream->blockingState->readRingBufferData = NULL; /* Uninitialized, yet. */ - stream->blockingState->writeRingBufferData = NULL; /* Uninitialized, yet. */ - stream->blockingState->readStreamBuffer = NULL; /* Uninitialized, yet. */ - stream->blockingState->writeStreamBuffer = NULL; /* Uninitialized, yet. */ - stream->blockingState->stopFlag = TRUE; /* Not started, yet. */ /* If the user buffer is unspecified */ - if (framesPerBuffer == paFramesPerBufferUnspecified) { + if( framesPerBuffer == paFramesPerBufferUnspecified ) + { /* Make the user buffer the same size as the host buffer. */ framesPerBuffer = framesPerHostBuffer; } /* Initialize callback buffer processor. */ - result = PaUtil_InitializeBufferProcessor (&stream->bufferProcessor , - inputChannelCount , - inputSampleFormat & ~paNonInterleaved , /* Ring buffer. */ - hostInputSampleFormat , /* Host format. */ - outputChannelCount , - outputSampleFormat & ~paNonInterleaved, /* Ring buffer. */ - hostOutputSampleFormat , /* Host format. */ - sampleRate , - streamFlags , - framesPerBuffer , /* Frames per ring buffer block. */ - framesPerHostBuffer , /* Frames per asio buffer. */ - paUtilFixedHostBufferSize , - streamCallback , - userData); - - if (result != paNoError) { - PA_DEBUG ( ("OpenStream ERROR13\n")); + result = PaUtil_InitializeBufferProcessor( &stream->bufferProcessor , + inputChannelCount , + inputSampleFormat & ~paNonInterleaved , /* Ring buffer. */ + hostInputSampleFormat , /* Host format. */ + outputChannelCount , + outputSampleFormat & ~paNonInterleaved, /* Ring buffer. */ + hostOutputSampleFormat , /* Host format. */ + sampleRate , + streamFlags , + framesPerBuffer , /* Frames per ring buffer block. */ + framesPerHostBuffer , /* Frames per asio buffer. */ + paUtilFixedHostBufferSize , + streamCallback , + userData ); + if( result != paNoError ){ + PA_DEBUG(("OpenStream ERROR13\n")); goto error; } - callbackBufferProcessorInited = TRUE; /* Initialize the blocking i/o buffer processor. */ - result = PaUtil_InitializeBufferProcessor (&stream->blockingState->bufferProcessor, - inputChannelCount , - inputSampleFormat , /* User format. */ - inputSampleFormat & ~paNonInterleaved , /* Ring buffer. */ - outputChannelCount , - outputSampleFormat , /* User format. */ - outputSampleFormat & ~paNonInterleaved, /* Ring buffer. */ - sampleRate , - paClipOff | paDitherOff , /* Don't use dither nor clipping. */ - framesPerBuffer , /* Frames per user buffer. */ - framesPerBuffer , /* Frames per ring buffer block. */ - paUtilBoundedHostBufferSize , - NULL, NULL); /* No callback! */ - - if (result != paNoError) { - PA_DEBUG ( ("ERROR! Blocking i/o buffer processor initialization failed in OpenStream()\n")); + result = PaUtil_InitializeBufferProcessor(&stream->blockingState->bufferProcessor, + inputChannelCount , + inputSampleFormat , /* User format. */ + inputSampleFormat & ~paNonInterleaved , /* Ring buffer. */ + outputChannelCount , + outputSampleFormat , /* User format. */ + outputSampleFormat & ~paNonInterleaved, /* Ring buffer. */ + sampleRate , + paClipOff | paDitherOff , /* Don't use dither nor clipping. */ + framesPerBuffer , /* Frames per user buffer. */ + framesPerBuffer , /* Frames per ring buffer block. */ + paUtilBoundedHostBufferSize , + NULL, NULL );/* No callback! */ + if( result != paNoError ){ + PA_DEBUG(("ERROR! Blocking i/o buffer processor initialization failed in OpenStream()\n")); goto error; } - blockingBufferProcessorInited = TRUE; /* If input is requested. */ - - if (inputChannelCount) { + if( inputChannelCount ) + { /* Create the callback sync-event. */ - stream->blockingState->readFramesReadyEvent = CreateEvent (NULL, FALSE, FALSE, NULL); - - if (stream->blockingState->readFramesReadyEvent == NULL) { + stream->blockingState->readFramesReadyEvent = CreateEvent( NULL, FALSE, FALSE, NULL ); + if( stream->blockingState->readFramesReadyEvent == NULL ) + { result = paUnanticipatedHostError; - PA_ASIO_SET_LAST_SYSTEM_ERROR (GetLastError()); - PA_DEBUG ( ("ERROR! Blocking i/o \"read frames ready\" event creation failed in OpenStream()\n")); + PA_ASIO_SET_LAST_SYSTEM_ERROR( GetLastError() ); + PA_DEBUG(("ERROR! Blocking i/o \"read frames ready\" event creation failed in OpenStream()\n")); goto error; } - blockingReadFramesReadyEventInitialized = 1; /* Create pointer buffer to access non-interleaved data in ReadStream() */ - stream->blockingState->readStreamBuffer = (void**) PaUtil_AllocateMemory (sizeof (void*) * inputChannelCount); - - if (!stream->blockingState->readStreamBuffer) { + stream->blockingState->readStreamBuffer = (void**)PaUtil_AllocateMemory( sizeof(void*) * inputChannelCount ); + if( !stream->blockingState->readStreamBuffer ) + { result = paInsufficientMemory; - PA_DEBUG ( ("ERROR! Blocking i/o read stream buffer allocation failed in OpenStream()\n")); + PA_DEBUG(("ERROR! Blocking i/o read stream buffer allocation failed in OpenStream()\n")); goto error; } @@ -2465,79 +2381,74 @@ static PaError OpenStream (struct PaUtilHostApiRepresentation *hostApi, 5) Get the next larger (or equal) power-of-two buffer size. */ lBlockingBufferSize = suggestedInputLatencyFrames - stream->inputLatency; - lBlockingBufferSize = (lBlockingBufferSize > 0) ? lBlockingBufferSize : 1; - lBlockingBufferSize = (lBlockingBufferSize + framesPerBuffer - 1) / framesPerBuffer; - lBlockingBufferSize = (lBlockingBufferSize + 1) * framesPerBuffer; /* Get the next larger or equal power-of-two buffersize. */ lBlockingBufferSizePow2 = 1; - - while (lBlockingBufferSize > (lBlockingBufferSizePow2<<=1)); - + while( lBlockingBufferSize > (lBlockingBufferSizePow2<<=1) ); lBlockingBufferSize = lBlockingBufferSizePow2; /* Compute total intput latency in seconds */ stream->streamRepresentation.streamInfo.inputLatency = - (double) (PaUtil_GetBufferProcessorInputLatency (&stream->bufferProcessor) - + PaUtil_GetBufferProcessorInputLatency (&stream->blockingState->bufferProcessor) - + (lBlockingBufferSize / framesPerBuffer - 1) * framesPerBuffer - + stream->inputLatency) + (double)( PaUtil_GetBufferProcessorInputLatency(&stream->bufferProcessor ) + + PaUtil_GetBufferProcessorInputLatency(&stream->blockingState->bufferProcessor) + + (lBlockingBufferSize / framesPerBuffer - 1) * framesPerBuffer + + stream->inputLatency ) / sampleRate; /* The code below prints the ASIO latency which doesn't include the buffer processor latency nor the blocking i/o latency. It reports the added latency separately. */ - PA_DEBUG ( ("PaAsio : ASIO InputLatency = %ld (%ld ms),\n added buffProc:%ld (%ld ms),\n added blocking:%ld (%ld ms)\n", - stream->inputLatency, - (long) (stream->inputLatency * (1000.0 / sampleRate)), - PaUtil_GetBufferProcessorInputLatency (&stream->bufferProcessor), - (long) (PaUtil_GetBufferProcessorInputLatency (&stream->bufferProcessor) * (1000.0 / sampleRate)), - PaUtil_GetBufferProcessorInputLatency (&stream->blockingState->bufferProcessor) + (lBlockingBufferSize / framesPerBuffer - 1) * framesPerBuffer, - (long) ( (PaUtil_GetBufferProcessorInputLatency (&stream->blockingState->bufferProcessor) + (lBlockingBufferSize / framesPerBuffer - 1) * framesPerBuffer) * (1000.0 / sampleRate)) - )); + PA_DEBUG(("PaAsio : ASIO InputLatency = %ld (%ld ms),\n added buffProc:%ld (%ld ms),\n added blocking:%ld (%ld ms)\n", + stream->inputLatency, + (long)( stream->inputLatency * (1000.0 / sampleRate) ), + PaUtil_GetBufferProcessorInputLatency(&stream->bufferProcessor), + (long)( PaUtil_GetBufferProcessorInputLatency(&stream->bufferProcessor) * (1000.0 / sampleRate) ), + PaUtil_GetBufferProcessorInputLatency(&stream->blockingState->bufferProcessor) + (lBlockingBufferSize / framesPerBuffer - 1) * framesPerBuffer, + (long)( (PaUtil_GetBufferProcessorInputLatency(&stream->blockingState->bufferProcessor) + (lBlockingBufferSize / framesPerBuffer - 1) * framesPerBuffer) * (1000.0 / sampleRate) ) + )); /* Determine the size of ring buffer in bytes. */ - lBytesPerFrame = inputChannelCount * Pa_GetSampleSize (inputSampleFormat); + lBytesPerFrame = inputChannelCount * Pa_GetSampleSize(inputSampleFormat ); /* Allocate the blocking i/o input ring buffer memory. */ - stream->blockingState->readRingBufferData = (void*) PaUtil_AllocateMemory (lBlockingBufferSize * lBytesPerFrame); - - if (!stream->blockingState->readRingBufferData) { + stream->blockingState->readRingBufferData = (void*)PaUtil_AllocateMemory( lBlockingBufferSize * lBytesPerFrame ); + if( !stream->blockingState->readRingBufferData ) + { result = paInsufficientMemory; - PA_DEBUG ( ("ERROR! Blocking i/o input ring buffer allocation failed in OpenStream()\n")); + PA_DEBUG(("ERROR! Blocking i/o input ring buffer allocation failed in OpenStream()\n")); goto error; } /* Initialize the input ring buffer struct. */ - PaUtil_InitializeRingBuffer (&stream->blockingState->readRingBuffer , - lBytesPerFrame , - lBlockingBufferSize , - stream->blockingState->readRingBufferData); + PaUtil_InitializeRingBuffer( &stream->blockingState->readRingBuffer , + lBytesPerFrame , + lBlockingBufferSize , + stream->blockingState->readRingBufferData ); } /* If output is requested. */ - if (outputChannelCount) { - stream->blockingState->writeBuffersReadyEvent = CreateEvent (NULL, FALSE, FALSE, NULL); - - if (stream->blockingState->writeBuffersReadyEvent == NULL) { + if( outputChannelCount ) + { + stream->blockingState->writeBuffersReadyEvent = CreateEvent( NULL, FALSE, FALSE, NULL ); + if( stream->blockingState->writeBuffersReadyEvent == NULL ) + { result = paUnanticipatedHostError; - PA_ASIO_SET_LAST_SYSTEM_ERROR (GetLastError()); - PA_DEBUG ( ("ERROR! Blocking i/o \"write buffers ready\" event creation failed in OpenStream()\n")); + PA_ASIO_SET_LAST_SYSTEM_ERROR( GetLastError() ); + PA_DEBUG(("ERROR! Blocking i/o \"write buffers ready\" event creation failed in OpenStream()\n")); goto error; } - blockingWriteBuffersReadyEventInitialized = 1; /* Create pointer buffer to access non-interleaved data in WriteStream() */ - stream->blockingState->writeStreamBuffer = (const void**) PaUtil_AllocateMemory (sizeof (const void*) * outputChannelCount); - - if (!stream->blockingState->writeStreamBuffer) { + stream->blockingState->writeStreamBuffer = (const void**)PaUtil_AllocateMemory( sizeof(const void*) * outputChannelCount ); + if( !stream->blockingState->writeStreamBuffer ) + { result = paInsufficientMemory; - PA_DEBUG ( ("ERROR! Blocking i/o write stream buffer allocation failed in OpenStream()\n")); + PA_DEBUG(("ERROR! Blocking i/o write stream buffer allocation failed in OpenStream()\n")); goto error; } @@ -2556,11 +2467,8 @@ static PaError OpenStream (struct PaUtilHostApiRepresentation *hostApi, 5) Get the next larger (or equal) power-of-two buffer size. */ lBlockingBufferSize = suggestedOutputLatencyFrames - stream->outputLatency; - lBlockingBufferSize = (lBlockingBufferSize > 0) ? lBlockingBufferSize : 1; - lBlockingBufferSize = (lBlockingBufferSize + framesPerBuffer - 1) / framesPerBuffer; - lBlockingBufferSize = (lBlockingBufferSize + 1) * framesPerBuffer; /* The buffer size (without the additional block) corresponds @@ -2570,163 +2478,159 @@ static PaError OpenStream (struct PaUtilHostApiRepresentation *hostApi, /* Get the next larger or equal power-of-two buffersize. */ lBlockingBufferSizePow2 = 1; - - while (lBlockingBufferSize > (lBlockingBufferSizePow2<<=1)); - + while( lBlockingBufferSize > (lBlockingBufferSizePow2<<=1) ); lBlockingBufferSize = lBlockingBufferSizePow2; /* Compute total output latency in seconds */ stream->streamRepresentation.streamInfo.outputLatency = - (double) (PaUtil_GetBufferProcessorOutputLatency (&stream->bufferProcessor) - + PaUtil_GetBufferProcessorOutputLatency (&stream->blockingState->bufferProcessor) - + (lBlockingBufferSize / framesPerBuffer - 1) * framesPerBuffer - + stream->outputLatency) + (double)( PaUtil_GetBufferProcessorOutputLatency(&stream->bufferProcessor ) + + PaUtil_GetBufferProcessorOutputLatency(&stream->blockingState->bufferProcessor) + + (lBlockingBufferSize / framesPerBuffer - 1) * framesPerBuffer + + stream->outputLatency ) / sampleRate; /* The code below prints the ASIO latency which doesn't include the buffer processor latency nor the blocking i/o latency. It reports the added latency separately. */ - PA_DEBUG ( ("PaAsio : ASIO OutputLatency = %ld (%ld ms),\n added buffProc:%ld (%ld ms),\n added blocking:%ld (%ld ms)\n", - stream->outputLatency, - (long) (stream->inputLatency * (1000.0 / sampleRate)), - PaUtil_GetBufferProcessorOutputLatency (&stream->bufferProcessor), - (long) (PaUtil_GetBufferProcessorOutputLatency (&stream->bufferProcessor) * (1000.0 / sampleRate)), - PaUtil_GetBufferProcessorOutputLatency (&stream->blockingState->bufferProcessor) + (lBlockingBufferSize / framesPerBuffer - 1) * framesPerBuffer, - (long) ( (PaUtil_GetBufferProcessorOutputLatency (&stream->blockingState->bufferProcessor) + (lBlockingBufferSize / framesPerBuffer - 1) * framesPerBuffer) * (1000.0 / sampleRate)) - )); + PA_DEBUG(("PaAsio : ASIO OutputLatency = %ld (%ld ms),\n added buffProc:%ld (%ld ms),\n added blocking:%ld (%ld ms)\n", + stream->outputLatency, + (long)( stream->inputLatency * (1000.0 / sampleRate) ), + PaUtil_GetBufferProcessorOutputLatency(&stream->bufferProcessor), + (long)( PaUtil_GetBufferProcessorOutputLatency(&stream->bufferProcessor) * (1000.0 / sampleRate) ), + PaUtil_GetBufferProcessorOutputLatency(&stream->blockingState->bufferProcessor) + (lBlockingBufferSize / framesPerBuffer - 1) * framesPerBuffer, + (long)( (PaUtil_GetBufferProcessorOutputLatency(&stream->blockingState->bufferProcessor) + (lBlockingBufferSize / framesPerBuffer - 1) * framesPerBuffer) * (1000.0 / sampleRate) ) + )); /* Determine the size of ring buffer in bytes. */ - lBytesPerFrame = outputChannelCount * Pa_GetSampleSize (outputSampleFormat); + lBytesPerFrame = outputChannelCount * Pa_GetSampleSize(outputSampleFormat); /* Allocate the blocking i/o output ring buffer memory. */ - stream->blockingState->writeRingBufferData = (void*) PaUtil_AllocateMemory (lBlockingBufferSize * lBytesPerFrame); - - if (!stream->blockingState->writeRingBufferData) { + stream->blockingState->writeRingBufferData = (void*)PaUtil_AllocateMemory( lBlockingBufferSize * lBytesPerFrame ); + if( !stream->blockingState->writeRingBufferData ) + { result = paInsufficientMemory; - PA_DEBUG ( ("ERROR! Blocking i/o output ring buffer allocation failed in OpenStream()\n")); + PA_DEBUG(("ERROR! Blocking i/o output ring buffer allocation failed in OpenStream()\n")); goto error; } /* Initialize the output ring buffer struct. */ - PaUtil_InitializeRingBuffer (&stream->blockingState->writeRingBuffer , - lBytesPerFrame , - lBlockingBufferSize , - stream->blockingState->writeRingBufferData); + PaUtil_InitializeRingBuffer( &stream->blockingState->writeRingBuffer , + lBytesPerFrame , + lBlockingBufferSize , + stream->blockingState->writeRingBufferData ); } stream->streamRepresentation.streamInfo.sampleRate = sampleRate; - } else { /* Using callback interface... */ - result = PaUtil_InitializeBufferProcessor (&stream->bufferProcessor, - inputChannelCount, inputSampleFormat, hostInputSampleFormat, - outputChannelCount, outputSampleFormat, hostOutputSampleFormat, - sampleRate, streamFlags, framesPerBuffer, - framesPerHostBuffer, paUtilFixedHostBufferSize, - streamCallback, userData); - - if (result != paNoError) { - PA_DEBUG ( ("OpenStream ERROR13\n")); + } + else /* Using callback interface... */ + { + result = PaUtil_InitializeBufferProcessor( &stream->bufferProcessor, + inputChannelCount, inputSampleFormat, hostInputSampleFormat, + outputChannelCount, outputSampleFormat, hostOutputSampleFormat, + sampleRate, streamFlags, framesPerBuffer, + framesPerHostBuffer, paUtilFixedHostBufferSize, + streamCallback, userData ); + if( result != paNoError ){ + PA_DEBUG(("OpenStream ERROR13\n")); goto error; } - callbackBufferProcessorInited = TRUE; stream->streamRepresentation.streamInfo.inputLatency = - (double) (PaUtil_GetBufferProcessorInputLatency (&stream->bufferProcessor) - + stream->inputLatency) / sampleRate; // seconds + (double)( PaUtil_GetBufferProcessorInputLatency(&stream->bufferProcessor) + + stream->inputLatency) / sampleRate; // seconds stream->streamRepresentation.streamInfo.outputLatency = - (double) (PaUtil_GetBufferProcessorOutputLatency (&stream->bufferProcessor) - + stream->outputLatency) / sampleRate; // seconds + (double)( PaUtil_GetBufferProcessorOutputLatency(&stream->bufferProcessor) + + stream->outputLatency) / sampleRate; // seconds stream->streamRepresentation.streamInfo.sampleRate = sampleRate; // the code below prints the ASIO latency which doesn't include the // buffer processor latency. it reports the added latency separately - PA_DEBUG ( ("PaAsio : ASIO InputLatency = %ld (%ld ms), added buffProc:%ld (%ld ms)\n", - stream->inputLatency, - (long) ( (stream->inputLatency*1000) / sampleRate), - PaUtil_GetBufferProcessorInputLatency (&stream->bufferProcessor), - (long) ( (PaUtil_GetBufferProcessorInputLatency (&stream->bufferProcessor) *1000) / sampleRate) - )); - - PA_DEBUG ( ("PaAsio : ASIO OuputLatency = %ld (%ld ms), added buffProc:%ld (%ld ms)\n", - stream->outputLatency, - (long) ( (stream->outputLatency*1000) / sampleRate), - PaUtil_GetBufferProcessorOutputLatency (&stream->bufferProcessor), - (long) ( (PaUtil_GetBufferProcessorOutputLatency (&stream->bufferProcessor) *1000) / sampleRate) - )); + PA_DEBUG(("PaAsio : ASIO InputLatency = %ld (%ld ms), added buffProc:%ld (%ld ms)\n", + stream->inputLatency, + (long)((stream->inputLatency*1000)/ sampleRate), + PaUtil_GetBufferProcessorInputLatency(&stream->bufferProcessor), + (long)((PaUtil_GetBufferProcessorInputLatency(&stream->bufferProcessor)*1000)/ sampleRate) + )); + + PA_DEBUG(("PaAsio : ASIO OuputLatency = %ld (%ld ms), added buffProc:%ld (%ld ms)\n", + stream->outputLatency, + (long)((stream->outputLatency*1000)/ sampleRate), + PaUtil_GetBufferProcessorOutputLatency(&stream->bufferProcessor), + (long)((PaUtil_GetBufferProcessorOutputLatency(&stream->bufferProcessor)*1000)/ sampleRate) + )); } stream->asioHostApi = asioHostApi; - stream->framesPerHostCallback = framesPerHostBuffer; stream->inputChannelCount = inputChannelCount; stream->outputChannelCount = outputChannelCount; stream->postOutput = driverInfo->postOutput; + stream->isStopped = 1; stream->isActive = 0; - + asioHostApi->openAsioDeviceIndex = asioDeviceIndex; - *s = (PaStream*) stream; + theAsioStream = stream; + *s = (PaStream*)stream; return result; error: - PA_DEBUG ( ("goto errored\n")); - - if (stream) { - if (stream->blockingState) { - if (blockingBufferProcessorInited) - PaUtil_TerminateBufferProcessor (&stream->blockingState->bufferProcessor); - - if (stream->blockingState->writeRingBufferData) - PaUtil_FreeMemory (stream->blockingState->writeRingBufferData); - - if (stream->blockingState->writeStreamBuffer) - PaUtil_FreeMemory (stream->blockingState->writeStreamBuffer); - - if (blockingWriteBuffersReadyEventInitialized) - CloseHandle (stream->blockingState->writeBuffersReadyEvent); - - if (stream->blockingState->readRingBufferData) - PaUtil_FreeMemory (stream->blockingState->readRingBufferData); - - if (stream->blockingState->readStreamBuffer) - PaUtil_FreeMemory (stream->blockingState->readStreamBuffer); - - if (blockingReadFramesReadyEventInitialized) - CloseHandle (stream->blockingState->readFramesReadyEvent); - - PaUtil_FreeMemory (stream->blockingState); + PA_DEBUG(("goto errored\n")); + if( stream ) + { + if( stream->blockingState ) + { + if( blockingBufferProcessorInited ) + PaUtil_TerminateBufferProcessor( &stream->blockingState->bufferProcessor ); + + if( stream->blockingState->writeRingBufferData ) + PaUtil_FreeMemory( stream->blockingState->writeRingBufferData ); + if( stream->blockingState->writeStreamBuffer ) + PaUtil_FreeMemory( stream->blockingState->writeStreamBuffer ); + if( blockingWriteBuffersReadyEventInitialized ) + CloseHandle( stream->blockingState->writeBuffersReadyEvent ); + + if( stream->blockingState->readRingBufferData ) + PaUtil_FreeMemory( stream->blockingState->readRingBufferData ); + if( stream->blockingState->readStreamBuffer ) + PaUtil_FreeMemory( stream->blockingState->readStreamBuffer ); + if( blockingReadFramesReadyEventInitialized ) + CloseHandle( stream->blockingState->readFramesReadyEvent ); + + PaUtil_FreeMemory( stream->blockingState ); } - if (callbackBufferProcessorInited) - PaUtil_TerminateBufferProcessor (&stream->bufferProcessor); + if( callbackBufferProcessorInited ) + PaUtil_TerminateBufferProcessor( &stream->bufferProcessor ); - if (completedBuffersPlayedEventInited) - CloseHandle (stream->completedBuffersPlayedEvent); + if( completedBuffersPlayedEventInited ) + CloseHandle( stream->completedBuffersPlayedEvent ); - if (stream->asioBufferInfos) - PaUtil_FreeMemory (stream->asioBufferInfos); + if( stream->asioBufferInfos ) + PaUtil_FreeMemory( stream->asioBufferInfos ); - if (stream->asioChannelInfos) - PaUtil_FreeMemory (stream->asioChannelInfos); + if( stream->asioChannelInfos ) + PaUtil_FreeMemory( stream->asioChannelInfos ); - if (stream->bufferPtrs) - PaUtil_FreeMemory (stream->bufferPtrs); + if( stream->bufferPtrs ) + PaUtil_FreeMemory( stream->bufferPtrs ); - PaUtil_FreeMemory (stream); + PaUtil_FreeMemory( stream ); } - if (asioBuffersCreated) + if( asioBuffersCreated ) ASIODisposeBuffers(); - if (asioIsInitialized) { - UnloadAsioDriver(); - } - + if( asioIsInitialized ) + { + UnloadAsioDriver(); + } return result; } @@ -2735,57 +2639,57 @@ error: When CloseStream() is called, the multi-api layer ensures that the stream has already been stopped or aborted. */ -static PaError CloseStream (PaStream* s) +static PaError CloseStream( PaStream* s ) { PaError result = paNoError; - PaAsioStream *stream = (PaAsioStream*) s; + PaAsioStream *stream = (PaAsioStream*)s; /* IMPLEMENT ME: - additional stream closing + cleanup */ - PaUtil_TerminateBufferProcessor (&stream->bufferProcessor); - PaUtil_TerminateStreamRepresentation (&stream->streamRepresentation); + PaUtil_TerminateBufferProcessor( &stream->bufferProcessor ); + PaUtil_TerminateStreamRepresentation( &stream->streamRepresentation ); stream->asioHostApi->openAsioDeviceIndex = paNoDevice; - CloseHandle (stream->completedBuffersPlayedEvent); + CloseHandle( stream->completedBuffersPlayedEvent ); /* Using blocking i/o interface... */ + if( stream->blockingState ) + { + PaUtil_TerminateBufferProcessor( &stream->blockingState->bufferProcessor ); - if (stream->blockingState) { - PaUtil_TerminateBufferProcessor (&stream->blockingState->bufferProcessor); - - if (stream->inputChannelCount) { - PaUtil_FreeMemory (stream->blockingState->readRingBufferData); - PaUtil_FreeMemory (stream->blockingState->readStreamBuffer); - CloseHandle (stream->blockingState->readFramesReadyEvent); + if( stream->inputChannelCount ) { + PaUtil_FreeMemory( stream->blockingState->readRingBufferData ); + PaUtil_FreeMemory( stream->blockingState->readStreamBuffer ); + CloseHandle( stream->blockingState->readFramesReadyEvent ); } - - if (stream->outputChannelCount) { - PaUtil_FreeMemory (stream->blockingState->writeRingBufferData); - PaUtil_FreeMemory (stream->blockingState->writeStreamBuffer); - CloseHandle (stream->blockingState->writeBuffersReadyEvent); + if( stream->outputChannelCount ) { + PaUtil_FreeMemory( stream->blockingState->writeRingBufferData ); + PaUtil_FreeMemory( stream->blockingState->writeStreamBuffer ); + CloseHandle( stream->blockingState->writeBuffersReadyEvent ); } - PaUtil_FreeMemory (stream->blockingState); + PaUtil_FreeMemory( stream->blockingState ); } - PaUtil_FreeMemory (stream->asioBufferInfos); - - PaUtil_FreeMemory (stream->asioChannelInfos); - PaUtil_FreeMemory (stream->bufferPtrs); - PaUtil_FreeMemory (stream); + PaUtil_FreeMemory( stream->asioBufferInfos ); + PaUtil_FreeMemory( stream->asioChannelInfos ); + PaUtil_FreeMemory( stream->bufferPtrs ); + PaUtil_FreeMemory( stream ); ASIODisposeBuffers(); UnloadAsioDriver(); + theAsioStream = 0; + return result; } -static void bufferSwitch (long index, ASIOBool directProcess) +static void bufferSwitch(long index, ASIOBool directProcess) { //TAKEN FROM THE ASIO SDK @@ -2799,28 +2703,27 @@ static void bufferSwitch (long index, ASIOBool directProcess) // timeInfo.systemTime fields and the according flags ASIOTime timeInfo; - memset (&timeInfo, 0, sizeof (timeInfo)); + memset( &timeInfo, 0, sizeof (timeInfo) ); // get the time stamp of the buffer, not necessary if no // synchronization to other media is required - - if (ASIOGetSamplePosition (&timeInfo.timeInfo.samplePosition, &timeInfo.timeInfo.systemTime) == ASE_OK) - timeInfo.timeInfo.flags = kSystemTimeValid | kSamplePositionValid; + if( ASIOGetSamplePosition(&timeInfo.timeInfo.samplePosition, &timeInfo.timeInfo.systemTime) == ASE_OK) + timeInfo.timeInfo.flags = kSystemTimeValid | kSamplePositionValid; // Call the real callback - bufferSwitchTimeInfo (&timeInfo, index, directProcess); + bufferSwitchTimeInfo( &timeInfo, index, directProcess ); } // conversion from 64 bit ASIOSample/ASIOTimeStamp to double float #if NATIVE_INT64 -#define ASIO64toDouble(a) (a) + #define ASIO64toDouble(a) (a) #else -const double twoRaisedTo32 = 4294967296.; -#define ASIO64toDouble(a) ((a).lo + (a).hi * twoRaisedTo32) + const double twoRaisedTo32 = 4294967296.; + #define ASIO64toDouble(a) ((a).lo + (a).hi * twoRaisedTo32) #endif -static ASIOTime *bufferSwitchTimeInfo (ASIOTime *timeInfo, long index, ASIOBool directProcess) +static ASIOTime *bufferSwitchTimeInfo( ASIOTime *timeInfo, long index, ASIOBool directProcess ) { // the actual processing callback. // Beware that this is normally in a seperate thread, hence be sure that @@ -2849,23 +2752,22 @@ static ASIOTime *bufferSwitchTimeInfo (ASIOTime *timeInfo, long index, ASIOBool // synchronization to other media is required if (timeInfo->timeInfo.flags & kSystemTimeValid) - asioDriverInfo.nanoSeconds = ASIO64toDouble (timeInfo->timeInfo.systemTime); + asioDriverInfo.nanoSeconds = ASIO64toDouble(timeInfo->timeInfo.systemTime); else - asioDriverInfo.nanoSeconds = 0; + asioDriverInfo.nanoSeconds = 0; if (timeInfo->timeInfo.flags & kSamplePositionValid) - asioDriverInfo.samples = ASIO64toDouble (timeInfo->timeInfo.samplePosition); + asioDriverInfo.samples = ASIO64toDouble(timeInfo->timeInfo.samplePosition); else - asioDriverInfo.samples = 0; + asioDriverInfo.samples = 0; if (timeInfo->timeCode.flags & kTcValid) - asioDriverInfo.tcSamples = ASIO64toDouble (timeInfo->timeCode.timeCodeSamples); + asioDriverInfo.tcSamples = ASIO64toDouble(timeInfo->timeCode.timeCodeSamples); else - asioDriverInfo.tcSamples = 0; + asioDriverInfo.tcSamples = 0; // get the system reference time asioDriverInfo.sysRefTime = get_sys_reference_time(); - #endif #if 0 @@ -2873,19 +2775,14 @@ static ASIOTime *bufferSwitchTimeInfo (ASIOTime *timeInfo, long index, ASIOBool // tells you the time when driver got its interrupt and the delay until the app receives // the event notification. static double last_samples = 0; - char tmp[128]; - - sprintf (tmp, "diff: %d / %d ms / %d ms / %d samples \n", asioDriverInfo.sysRefTime - (long) (asioDriverInfo.nanoSeconds / 1000000.0), asioDriverInfo.sysRefTime, (long) (asioDriverInfo.nanoSeconds / 1000000.0), (long) (asioDriverInfo.samples - last_samples)); - + sprintf (tmp, "diff: %d / %d ms / %d ms / %d samples \n", asioDriverInfo.sysRefTime - (long)(asioDriverInfo.nanoSeconds / 1000000.0), asioDriverInfo.sysRefTime, (long)(asioDriverInfo.nanoSeconds / 1000000.0), (long)(asioDriverInfo.samples - last_samples)); OutputDebugString (tmp); - last_samples = asioDriverInfo.samples; - #endif - if (!theAsioStream) + if( !theAsioStream ) return 0L; // Keep sample position @@ -2893,51 +2790,57 @@ static ASIOTime *bufferSwitchTimeInfo (ASIOTime *timeInfo, long index, ASIOBool // protect against reentrancy - if (PaAsio_AtomicIncrement (&theAsioStream->reenterCount)) { + if( PaAsio_AtomicIncrement(&theAsioStream->reenterCount) ) + { theAsioStream->reenterError++; //DBUG(("bufferSwitchTimeInfo : reentrancy detection = %d\n", asioDriverInfo.reenterError)); return 0L; } int buffersDone = 0; - - do { - if (buffersDone > 0) { + + do + { + if( buffersDone > 0 ) + { // this is a reentered buffer, we missed processing it on time // set the input overflow and output underflow flags as appropriate - - if (theAsioStream->inputChannelCount > 0) + + if( theAsioStream->inputChannelCount > 0 ) theAsioStream->callbackFlags |= paInputOverflow; - - if (theAsioStream->outputChannelCount > 0) + + if( theAsioStream->outputChannelCount > 0 ) theAsioStream->callbackFlags |= paOutputUnderflow; - } else { - if (theAsioStream->zeroOutput) { - ZeroOutputBuffers (theAsioStream, index); + } + else + { + if( theAsioStream->zeroOutput ) + { + ZeroOutputBuffers( theAsioStream, index ); // Finally if the driver supports the ASIOOutputReady() optimization, // do it here, all data are in place - - if (theAsioStream->postOutput) + if( theAsioStream->postOutput ) ASIOOutputReady(); - if (theAsioStream->stopProcessing) { - if (theAsioStream->stopPlayoutCount < 2) { + if( theAsioStream->stopProcessing ) + { + if( theAsioStream->stopPlayoutCount < 2 ) + { ++theAsioStream->stopPlayoutCount; - - if (theAsioStream->stopPlayoutCount == 2) { + if( theAsioStream->stopPlayoutCount == 2 ) + { theAsioStream->isActive = 0; - - if (theAsioStream->streamRepresentation.streamFinishedCallback != 0) - theAsioStream->streamRepresentation.streamFinishedCallback (theAsioStream->streamRepresentation.userData); - + if( theAsioStream->streamRepresentation.streamFinishedCallback != 0 ) + theAsioStream->streamRepresentation.streamFinishedCallback( theAsioStream->streamRepresentation.userData ); theAsioStream->streamFinishedCallbackCalled = true; - - SetEvent (theAsioStream->completedBuffersPlayedEvent); + SetEvent( theAsioStream->completedBuffersPlayedEvent ); } } } - } else { + } + else + { #if 0 // test code to try to detect slip conditions... these may work on some systems @@ -2945,168 +2848,165 @@ static ASIOTime *bufferSwitchTimeInfo (ASIOTime *timeInfo, long index, ASIOBool // check that sample delta matches buffer size (otherwise we must have skipped // a buffer. - static double last_samples = -512; - double samples; +static double last_samples = -512; +double samples; //if( timeInfo->timeCode.flags & kTcValid ) // samples = ASIO64toDouble(timeInfo->timeCode.timeCodeSamples); //else - samples = ASIO64toDouble (timeInfo->timeInfo.samplePosition); - int delta = samples - last_samples; + samples = ASIO64toDouble(timeInfo->timeInfo.samplePosition); +int delta = samples - last_samples; //printf( "%d\n", delta); - last_samples = samples; +last_samples = samples; - if (delta > theAsioStream->framesPerHostCallback) { - if (theAsioStream->inputChannelCount > 0) - theAsioStream->callbackFlags |= paInputOverflow; +if( delta > theAsioStream->framesPerHostCallback ) +{ + if( theAsioStream->inputChannelCount > 0 ) + theAsioStream->callbackFlags |= paInputOverflow; - if (theAsioStream->outputChannelCount > 0) - theAsioStream->callbackFlags |= paOutputUnderflow; - } + if( theAsioStream->outputChannelCount > 0 ) + theAsioStream->callbackFlags |= paOutputUnderflow; +} // check that the buffer index is not the previous index (which would indicate // that a buffer was skipped. - static int previousIndex = 1; - - if (index == previousIndex) { - if (theAsioStream->inputChannelCount > 0) - theAsioStream->callbackFlags |= paInputOverflow; - - if (theAsioStream->outputChannelCount > 0) - theAsioStream->callbackFlags |= paOutputUnderflow; - } - - previousIndex = index; +static int previousIndex = 1; +if( index == previousIndex ) +{ + if( theAsioStream->inputChannelCount > 0 ) + theAsioStream->callbackFlags |= paInputOverflow; + if( theAsioStream->outputChannelCount > 0 ) + theAsioStream->callbackFlags |= paOutputUnderflow; +} +previousIndex = index; #endif int i; - PaUtil_BeginCpuLoadMeasurement (&theAsioStream->cpuLoadMeasurer); + PaUtil_BeginCpuLoadMeasurement( &theAsioStream->cpuLoadMeasurer ); PaStreamCallbackTimeInfo paTimeInfo; // asio systemTime is supposed to be measured according to the same // clock as timeGetTime - paTimeInfo.currentTime = (ASIO64toDouble (timeInfo->timeInfo.systemTime) * .000000001); + paTimeInfo.currentTime = (ASIO64toDouble( timeInfo->timeInfo.systemTime ) * .000000001); /* patch from Paul Boege */ paTimeInfo.inputBufferAdcTime = paTimeInfo.currentTime - - ( (double) theAsioStream->inputLatency/theAsioStream->streamRepresentation.streamInfo.sampleRate); + ((double)theAsioStream->inputLatency/theAsioStream->streamRepresentation.streamInfo.sampleRate); paTimeInfo.outputBufferDacTime = paTimeInfo.currentTime + - ( (double) theAsioStream->outputLatency/theAsioStream->streamRepresentation.streamInfo.sampleRate); + ((double)theAsioStream->outputLatency/theAsioStream->streamRepresentation.streamInfo.sampleRate); /* old version is buggy because the buffer processor also adds in its latency to the time parameters paTimeInfo.inputBufferAdcTime = paTimeInfo.currentTime - theAsioStream->streamRepresentation.streamInfo.inputLatency; paTimeInfo.outputBufferDacTime = paTimeInfo.currentTime + theAsioStream->streamRepresentation.streamInfo.outputLatency; */ - /* Disabled! Stopping and re-starting the stream causes an input overflow / output undeflow. S.Fischer */ +/* Disabled! Stopping and re-starting the stream causes an input overflow / output undeflow. S.Fischer */ #if 0 // detect underflows by checking inter-callback time > 2 buffer period - static double previousTime = -1; - - if (previousTime > 0) { - - double delta = paTimeInfo.currentTime - previousTime; +static double previousTime = -1; +if( previousTime > 0 ){ - if (delta >= 2. * (theAsioStream->framesPerHostCallback / theAsioStream->streamRepresentation.streamInfo.sampleRate)) { - if (theAsioStream->inputChannelCount > 0) - theAsioStream->callbackFlags |= paInputOverflow; - - if (theAsioStream->outputChannelCount > 0) - theAsioStream->callbackFlags |= paOutputUnderflow; - } - } + double delta = paTimeInfo.currentTime - previousTime; - previousTime = paTimeInfo.currentTime; + if( delta >= 2. * (theAsioStream->framesPerHostCallback / theAsioStream->streamRepresentation.streamInfo.sampleRate) ){ + if( theAsioStream->inputChannelCount > 0 ) + theAsioStream->callbackFlags |= paInputOverflow; + if( theAsioStream->outputChannelCount > 0 ) + theAsioStream->callbackFlags |= paOutputUnderflow; + } +} +previousTime = paTimeInfo.currentTime; #endif // note that the above input and output times do not need to be // adjusted for the latency of the buffer processor -- the buffer // processor handles that. - if (theAsioStream->inputBufferConverter) { - for (i=0; i<theAsioStream->inputChannelCount; i++) { - theAsioStream->inputBufferConverter (theAsioStream->inputBufferPtrs[index][i], - theAsioStream->inputShift, theAsioStream->framesPerHostCallback); + if( theAsioStream->inputBufferConverter ) + { + for( i=0; i<theAsioStream->inputChannelCount; i++ ) + { + theAsioStream->inputBufferConverter( theAsioStream->inputBufferPtrs[index][i], + theAsioStream->inputShift, theAsioStream->framesPerHostCallback ); } } - PaUtil_BeginBufferProcessing (&theAsioStream->bufferProcessor, &paTimeInfo, theAsioStream->callbackFlags); + PaUtil_BeginBufferProcessing( &theAsioStream->bufferProcessor, &paTimeInfo, theAsioStream->callbackFlags ); /* reset status flags once they've been passed to the callback */ theAsioStream->callbackFlags = 0; - PaUtil_SetInputFrameCount (&theAsioStream->bufferProcessor, 0 /* default to host buffer size */); - - for (i=0; i<theAsioStream->inputChannelCount; ++i) - PaUtil_SetNonInterleavedInputChannel (&theAsioStream->bufferProcessor, i, theAsioStream->inputBufferPtrs[index][i]); + PaUtil_SetInputFrameCount( &theAsioStream->bufferProcessor, 0 /* default to host buffer size */ ); + for( i=0; i<theAsioStream->inputChannelCount; ++i ) + PaUtil_SetNonInterleavedInputChannel( &theAsioStream->bufferProcessor, i, theAsioStream->inputBufferPtrs[index][i] ); - PaUtil_SetOutputFrameCount (&theAsioStream->bufferProcessor, 0 /* default to host buffer size */); - - for (i=0; i<theAsioStream->outputChannelCount; ++i) - PaUtil_SetNonInterleavedOutputChannel (&theAsioStream->bufferProcessor, i, theAsioStream->outputBufferPtrs[index][i]); + PaUtil_SetOutputFrameCount( &theAsioStream->bufferProcessor, 0 /* default to host buffer size */ ); + for( i=0; i<theAsioStream->outputChannelCount; ++i ) + PaUtil_SetNonInterleavedOutputChannel( &theAsioStream->bufferProcessor, i, theAsioStream->outputBufferPtrs[index][i] ); int callbackResult; - - if (theAsioStream->stopProcessing) + if( theAsioStream->stopProcessing ) callbackResult = paComplete; else callbackResult = paContinue; - - unsigned long framesProcessed = PaUtil_EndBufferProcessing (&theAsioStream->bufferProcessor, &callbackResult); - - if (theAsioStream->outputBufferConverter) { - for (i=0; i<theAsioStream->outputChannelCount; i++) { - theAsioStream->outputBufferConverter (theAsioStream->outputBufferPtrs[index][i], - theAsioStream->outputShift, theAsioStream->framesPerHostCallback); + unsigned long framesProcessed = PaUtil_EndBufferProcessing( &theAsioStream->bufferProcessor, &callbackResult ); + + if( theAsioStream->outputBufferConverter ) + { + for( i=0; i<theAsioStream->outputChannelCount; i++ ) + { + theAsioStream->outputBufferConverter( theAsioStream->outputBufferPtrs[index][i], + theAsioStream->outputShift, theAsioStream->framesPerHostCallback ); } } - PaUtil_EndCpuLoadMeasurement (&theAsioStream->cpuLoadMeasurer, framesProcessed); + PaUtil_EndCpuLoadMeasurement( &theAsioStream->cpuLoadMeasurer, framesProcessed ); // Finally if the driver supports the ASIOOutputReady() optimization, // do it here, all data are in place - - if (theAsioStream->postOutput) + if( theAsioStream->postOutput ) ASIOOutputReady(); - if (callbackResult == paContinue) { + if( callbackResult == paContinue ) + { /* nothing special to do */ - } else if (callbackResult == paAbort) { + } + else if( callbackResult == paAbort ) + { /* finish playback immediately */ theAsioStream->isActive = 0; - - if (theAsioStream->streamRepresentation.streamFinishedCallback != 0) - theAsioStream->streamRepresentation.streamFinishedCallback (theAsioStream->streamRepresentation.userData); - + if( theAsioStream->streamRepresentation.streamFinishedCallback != 0 ) + theAsioStream->streamRepresentation.streamFinishedCallback( theAsioStream->streamRepresentation.userData ); theAsioStream->streamFinishedCallbackCalled = true; - - SetEvent (theAsioStream->completedBuffersPlayedEvent); - + SetEvent( theAsioStream->completedBuffersPlayedEvent ); theAsioStream->zeroOutput = true; - } else { /* paComplete or other non-zero value indicating complete */ + } + else /* paComplete or other non-zero value indicating complete */ + { /* Finish playback once currently queued audio has completed. */ theAsioStream->stopProcessing = true; - if (PaUtil_IsBufferProcessorOutputEmpty (&theAsioStream->bufferProcessor)) { + if( PaUtil_IsBufferProcessorOutputEmpty( &theAsioStream->bufferProcessor ) ) + { theAsioStream->zeroOutput = true; theAsioStream->stopPlayoutCount = 0; } } } } - + ++buffersDone; - } while (PaAsio_AtomicDecrement (&theAsioStream->reenterCount) >= 0); + }while( PaAsio_AtomicDecrement(&theAsioStream->reenterCount) >= 0 ); return 0L; } -static void sampleRateChanged (ASIOSampleRate sRate) +static void sampleRateChanged(ASIOSampleRate sRate) { // TAKEN FROM THE ASIO SDK // do whatever you need to do if the sample rate changed @@ -3117,10 +3017,10 @@ static void sampleRateChanged (ASIOSampleRate sRate) // You might have to update time/sample related conversion routines, etc. (void) sRate; /* unused parameter */ - PA_DEBUG ( ("sampleRateChanged : %d \n", sRate)); + PA_DEBUG( ("sampleRateChanged : %d \n", sRate)); } -static long asioMessages (long selector, long value, void* message, double* opt) +static long asioMessages(long selector, long value, void* message, double* opt) { // TAKEN FROM THE ASIO SDK // currently the parameters "value", "message" and "opt" are not used. @@ -3129,22 +3029,20 @@ static long asioMessages (long selector, long value, void* message, double* opt) (void) message; /* unused parameters */ (void) opt; - PA_DEBUG ( ("asioMessages : %d , %d \n", selector, value)); - - switch (selector) { + PA_DEBUG( ("asioMessages : %d , %d \n", selector, value)); + switch(selector) + { case kAsioSelectorSupported: - - if (value == kAsioResetRequest - || value == kAsioEngineVersion - || value == kAsioResyncRequest - || value == kAsioLatenciesChanged - // the following three were added for ASIO 2.0, you don't necessarily have to support them - || value == kAsioSupportsTimeInfo - || value == kAsioSupportsTimeCode - || value == kAsioSupportsInputMonitor) - ret = 1L; - + if(value == kAsioResetRequest + || value == kAsioEngineVersion + || value == kAsioResyncRequest + || value == kAsioLatenciesChanged + // the following three were added for ASIO 2.0, you don't necessarily have to support them + || value == kAsioSupportsTimeInfo + || value == kAsioSupportsTimeCode + || value == kAsioSupportsInputMonitor) + ret = 1L; break; case kAsioBufferSizeChange: @@ -3160,7 +3058,6 @@ static long asioMessages (long selector, long value, void* message, double* opt) /*FIXME: commented the next line out */ //asioDriverInfo.stopped; // In this sample the processing will just stop ret = 1L; - break; case kAsioResyncRequest: @@ -3171,7 +3068,6 @@ static long asioMessages (long selector, long value, void* message, double* opt) // by another thread. // However a driver can issue it in other situations, too. ret = 1L; - break; case kAsioLatenciesChanged: @@ -3179,7 +3075,6 @@ static long asioMessages (long selector, long value, void* message, double* opt) // Beware, it this does not mean that the buffer sizes have changed! // You might need to update internal delay data. ret = 1L; - //printf("kAsioLatenciesChanged \n"); break; @@ -3188,7 +3083,6 @@ static long asioMessages (long selector, long value, void* message, double* opt) // If a host applications does not implement this selector, ASIO 1.0 is assumed // by the driver ret = 2L; - break; case kAsioSupportsTimeInfo: @@ -3197,7 +3091,6 @@ static long asioMessages (long selector, long value, void* message, double* opt) // For compatibility with ASIO 1.0 drivers the host application should always support // the "old" bufferSwitch method, too. ret = 1; - break; case kAsioSupportsTimeCode: @@ -3205,28 +3098,26 @@ static long asioMessages (long selector, long value, void* message, double* opt) // If an application does not need to know about time code, the driver has less work // to do. ret = 0; - break; } - return ret; } -static PaError StartStream (PaStream *s) +static PaError StartStream( PaStream *s ) { PaError result = paNoError; - PaAsioStream *stream = (PaAsioStream*) s; + PaAsioStream *stream = (PaAsioStream*)s; PaAsioStreamBlockingState *blockingState = stream->blockingState; ASIOError asioError; - if (stream->outputChannelCount > 0) { - ZeroOutputBuffers (stream, 0); - ZeroOutputBuffers (stream, 1); + if( stream->outputChannelCount > 0 ) + { + ZeroOutputBuffers( stream, 0 ); + ZeroOutputBuffers( stream, 1 ); } - PaUtil_ResetBufferProcessor (&stream->bufferProcessor); - + PaUtil_ResetBufferProcessor( &stream->bufferProcessor ); stream->stopProcessing = false; stream->zeroOutput = false; @@ -3236,94 +3127,111 @@ static PaError StartStream (PaStream *s) stream->callbackFlags = 0; - if (ResetEvent (stream->completedBuffersPlayedEvent) == 0) { + if( ResetEvent( stream->completedBuffersPlayedEvent ) == 0 ) + { result = paUnanticipatedHostError; - PA_ASIO_SET_LAST_SYSTEM_ERROR (GetLastError()); + PA_ASIO_SET_LAST_SYSTEM_ERROR( GetLastError() ); } /* Using blocking i/o interface... */ - if (blockingState) { + if( blockingState ) + { /* Reset blocking i/o buffer processor. */ - PaUtil_ResetBufferProcessor (&blockingState->bufferProcessor); + PaUtil_ResetBufferProcessor( &blockingState->bufferProcessor ); /* If we're about to process some input data. */ - - if (stream->inputChannelCount) { + if( stream->inputChannelCount ) + { /* Reset callback-ReadStream sync event. */ - if (ResetEvent (blockingState->readFramesReadyEvent) == 0) { + if( ResetEvent( blockingState->readFramesReadyEvent ) == 0 ) + { result = paUnanticipatedHostError; - PA_ASIO_SET_LAST_SYSTEM_ERROR (GetLastError()); + PA_ASIO_SET_LAST_SYSTEM_ERROR( GetLastError() ); } /* Flush blocking i/o ring buffer. */ - PaUtil_FlushRingBuffer (&blockingState->readRingBuffer); - - (*blockingState->bufferProcessor.inputZeroer) (blockingState->readRingBuffer.buffer, 1, blockingState->bufferProcessor.inputChannelCount * blockingState->readRingBuffer.bufferSize); + PaUtil_FlushRingBuffer( &blockingState->readRingBuffer ); + (*blockingState->bufferProcessor.inputZeroer)( blockingState->readRingBuffer.buffer, 1, blockingState->bufferProcessor.inputChannelCount * blockingState->readRingBuffer.bufferSize ); } /* If we're about to process some output data. */ - if (stream->outputChannelCount) { + if( stream->outputChannelCount ) + { /* Reset callback-WriteStream sync event. */ - if (ResetEvent (blockingState->writeBuffersReadyEvent) == 0) { + if( ResetEvent( blockingState->writeBuffersReadyEvent ) == 0 ) + { result = paUnanticipatedHostError; - PA_ASIO_SET_LAST_SYSTEM_ERROR (GetLastError()); + PA_ASIO_SET_LAST_SYSTEM_ERROR( GetLastError() ); } /* Flush blocking i/o ring buffer. */ - PaUtil_FlushRingBuffer (&blockingState->writeRingBuffer); - - (*blockingState->bufferProcessor.outputZeroer) (blockingState->writeRingBuffer.buffer, 1, blockingState->bufferProcessor.outputChannelCount * blockingState->writeRingBuffer.bufferSize); + PaUtil_FlushRingBuffer( &blockingState->writeRingBuffer ); + (*blockingState->bufferProcessor.outputZeroer)( blockingState->writeRingBuffer.buffer, 1, blockingState->bufferProcessor.outputChannelCount * blockingState->writeRingBuffer.bufferSize ); /* Initialize the output ring buffer to "silence". */ - PaUtil_AdvanceRingBufferWriteIndex (&blockingState->writeRingBuffer, blockingState->writeRingBufferInitialFrames); + PaUtil_AdvanceRingBufferWriteIndex( &blockingState->writeRingBuffer, blockingState->writeRingBufferInitialFrames ); } /* Clear requested frames / buffers count. */ blockingState->writeBuffersRequested = 0; - blockingState->readFramesRequested = 0; - blockingState->writeBuffersRequestedFlag = FALSE; - blockingState->readFramesRequestedFlag = FALSE; - blockingState->outputUnderflowFlag = FALSE; - blockingState->inputOverflowFlag = FALSE; - blockingState->stopFlag = FALSE; } - if (result == paNoError) { - theAsioStream = stream; + if( result == paNoError ) + { + assert( theAsioStream == stream ); /* theAsioStream should be set correctly in OpenStream */ + + /* initialize these variables before the callback has a chance to be invoked */ + stream->isStopped = 0; + stream->isActive = 1; + stream->streamFinishedCallbackCalled = false; + asioError = ASIOStart(); + if( asioError != ASE_OK ) + { + stream->isStopped = 1; + stream->isActive = 0; - if (asioError == ASE_OK) { - stream->isActive = 1; - stream->streamFinishedCallbackCalled = false; - } else { - theAsioStream = 0; result = paUnanticipatedHostError; - PA_ASIO_SET_LAST_ASIO_ERROR (asioError); + PA_ASIO_SET_LAST_ASIO_ERROR( asioError ); } } return result; } +static void EnsureCallbackHasCompleted( PaAsioStream *stream ) +{ + // make sure that the callback is not still in-flight after ASIOStop() + // returns. This has been observed to happen on the Hoontech DSP24 for + // example. + int count = 2000; // only wait for 2 seconds, rather than hanging. + while( stream->reenterCount != -1 && count > 0 ) + { + Sleep(1); + --count; + } +} -static PaError StopStream (PaStream *s) +static PaError StopStream( PaStream *s ) { PaError result = paNoError; - PaAsioStream *stream = (PaAsioStream*) s; + PaAsioStream *stream = (PaAsioStream*)s; PaAsioStreamBlockingState *blockingState = stream->blockingState; ASIOError asioError; - if (stream->isActive) { + if( stream->isActive ) + { /* If blocking i/o output is in use */ - if (blockingState && stream->outputChannelCount) { + if( blockingState && stream->outputChannelCount ) + { /* Request the whole output buffer to be available. */ blockingState->writeBuffersRequested = blockingState->writeRingBuffer.bufferSize; /* Signalize that additional buffers are need. */ @@ -3334,18 +3242,20 @@ static PaError StopStream (PaStream *s) /* Wait until requested number of buffers has been freed. Time out after twice the blocking i/o ouput buffer could have been consumed. */ - DWORD timeout = (DWORD) (2 * blockingState->writeRingBuffer.bufferSize * 1000 - / stream->streamRepresentation.streamInfo.sampleRate); - DWORD waitResult = WaitForSingleObject (blockingState->writeBuffersReadyEvent, timeout); + DWORD timeout = (DWORD)( 2 * blockingState->writeRingBuffer.bufferSize * 1000 + / stream->streamRepresentation.streamInfo.sampleRate ); + DWORD waitResult = WaitForSingleObject( blockingState->writeBuffersReadyEvent, timeout ); /* If something seriously went wrong... */ - - if (waitResult == WAIT_FAILED) { - PA_DEBUG ( ("WaitForSingleObject() failed in StopStream()\n")); + if( waitResult == WAIT_FAILED ) + { + PA_DEBUG(("WaitForSingleObject() failed in StopStream()\n")); result = paUnanticipatedHostError; - PA_ASIO_SET_LAST_SYSTEM_ERROR (GetLastError()); - } else if (waitResult == WAIT_TIMEOUT) { - PA_DEBUG ( ("WaitForSingleObject() timed out in StopStream()\n")); + PA_ASIO_SET_LAST_SYSTEM_ERROR( GetLastError() ); + } + else if( waitResult == WAIT_TIMEOUT ) + { + PA_DEBUG(("WaitForSingleObject() timed out in StopStream()\n")); result = paTimedOut; } } @@ -3359,106 +3269,97 @@ static PaError StopStream (PaStream *s) length is longer than the asio buffer size then that should be taken into account. */ - - if (WaitForSingleObject (theAsioStream->completedBuffersPlayedEvent, - (DWORD) (stream->streamRepresentation.streamInfo.outputLatency * 1000. * 4.)) - == WAIT_TIMEOUT) { - PA_DEBUG ( ("WaitForSingleObject() timed out in StopStream()\n")); + if( WaitForSingleObject( stream->completedBuffersPlayedEvent, + (DWORD)(stream->streamRepresentation.streamInfo.outputLatency * 1000. * 4.) ) + == WAIT_TIMEOUT ) + { + PA_DEBUG(("WaitForSingleObject() timed out in StopStream()\n" )); } } asioError = ASIOStop(); - - if (asioError != ASE_OK) { + if( asioError == ASE_OK ) + { + EnsureCallbackHasCompleted( stream ); + } + else + { result = paUnanticipatedHostError; - PA_ASIO_SET_LAST_ASIO_ERROR (asioError); + PA_ASIO_SET_LAST_ASIO_ERROR( asioError ); } - theAsioStream = 0; - + stream->isStopped = 1; stream->isActive = 0; - if (!stream->streamFinishedCallbackCalled) { - if (stream->streamRepresentation.streamFinishedCallback != 0) - stream->streamRepresentation.streamFinishedCallback (stream->streamRepresentation.userData); + if( !stream->streamFinishedCallbackCalled ) + { + if( stream->streamRepresentation.streamFinishedCallback != 0 ) + stream->streamRepresentation.streamFinishedCallback( stream->streamRepresentation.userData ); } return result; } - -static PaError AbortStream (PaStream *s) +static PaError AbortStream( PaStream *s ) { PaError result = paNoError; - PaAsioStream *stream = (PaAsioStream*) s; + PaAsioStream *stream = (PaAsioStream*)s; ASIOError asioError; stream->zeroOutput = true; asioError = ASIOStop(); - - if (asioError != ASE_OK) { + if( asioError == ASE_OK ) + { + EnsureCallbackHasCompleted( stream ); + } + else + { result = paUnanticipatedHostError; - PA_ASIO_SET_LAST_ASIO_ERROR (asioError); - } else { - // make sure that the callback is not still in-flight when ASIOStop() - // returns. This has been observed to happen on the Hoontech DSP24 for - // example. - int count = 2000; // only wait for 2 seconds, rather than hanging. - - while (theAsioStream->reenterCount != -1 && count > 0) { - Sleep (1); - --count; - } + PA_ASIO_SET_LAST_ASIO_ERROR( asioError ); } - /* it is questionable whether we should zero theAsioStream if ASIOStop() - returns an error, because the callback could still be active. We assume - not - this is based on the fact that ASIOStop is unlikely to fail - if the callback is running - it's more likely to fail because the - callback is not running. */ - - theAsioStream = 0; - + stream->isStopped = 1; stream->isActive = 0; - if (!stream->streamFinishedCallbackCalled) { - if (stream->streamRepresentation.streamFinishedCallback != 0) - stream->streamRepresentation.streamFinishedCallback (stream->streamRepresentation.userData); + if( !stream->streamFinishedCallbackCalled ) + { + if( stream->streamRepresentation.streamFinishedCallback != 0 ) + stream->streamRepresentation.streamFinishedCallback( stream->streamRepresentation.userData ); } return result; } -static PaError IsStreamStopped (PaStream *s) +static PaError IsStreamStopped( PaStream *s ) { - //PaAsioStream *stream = (PaAsioStream*)s; - (void) s; /* unused parameter */ - return theAsioStream == 0; + PaAsioStream *stream = (PaAsioStream*)s; + + return stream->isStopped; } -static PaError IsStreamActive (PaStream *s) +static PaError IsStreamActive( PaStream *s ) { - PaAsioStream *stream = (PaAsioStream*) s; + PaAsioStream *stream = (PaAsioStream*)s; return stream->isActive; } -static PaTime GetStreamTime (PaStream *s) +static PaTime GetStreamTime( PaStream *s ) { (void) s; /* unused parameter */ - return (double) timeGetTime() * .001; + return (double)timeGetTime() * .001; } -static double GetStreamCpuLoad (PaStream* s) +static double GetStreamCpuLoad( PaStream* s ) { - PaAsioStream *stream = (PaAsioStream*) s; + PaAsioStream *stream = (PaAsioStream*)s; - return PaUtil_GetCpuLoad (&stream->cpuLoadMeasurer); + return PaUtil_GetCpuLoad( &stream->cpuLoadMeasurer ); } @@ -3468,12 +3369,12 @@ static double GetStreamCpuLoad (PaStream* s) for blocking streams. */ -static PaError ReadStream (PaStream *s , +static PaError ReadStream( PaStream *s , void *buffer, - unsigned long frames) + unsigned long frames ) { PaError result = paNoError; /* Initial return value. */ - PaAsioStream *stream = (PaAsioStream*) s; /* The PA ASIO stream. */ + PaAsioStream *stream = (PaAsioStream*)s; /* The PA ASIO stream. */ /* Pointer to the blocking i/o data struct. */ PaAsioStreamBlockingState *blockingState = stream->blockingState; @@ -3502,44 +3403,45 @@ static PaError ReadStream (PaStream *s , unsigned int i; /* Just a counter. */ /* About the time, needed to process 8 data blocks. */ - DWORD timeout = (DWORD) (8 * lFramesPerBlock * 1000 / stream->streamRepresentation.streamInfo.sampleRate); + DWORD timeout = (DWORD)( 8 * lFramesPerBlock * 1000 / stream->streamRepresentation.streamInfo.sampleRate ); DWORD waitResult = 0; /* Check if the stream is still available ready to gather new data. */ - - if (blockingState->stopFlag || !stream->isActive) { - PA_DEBUG ( ("Warning! Stream no longer available for reading in ReadStream()\n")); + if( blockingState->stopFlag || !stream->isActive ) + { + PA_DEBUG(("Warning! Stream no longer available for reading in ReadStream()\n")); result = paStreamIsStopped; return result; } /* If the stream is a input stream. */ - if (stream->inputChannelCount) { + if( stream->inputChannelCount ) + { /* Prepare buffer access. */ - if (!pBp->userOutputIsInterleaved) { + if( !pBp->userOutputIsInterleaved ) + { userBuffer = blockingState->readStreamBuffer; - - for (i = 0; i<pBp->inputChannelCount; ++i) { - ( (void**) userBuffer) [i] = ( (void**) buffer) [i]; + for( i = 0; i<pBp->inputChannelCount; ++i ) + { + ((void**)userBuffer)[i] = ((void**)buffer)[i]; } } /* Use the unchanged buffer. */ - else { - userBuffer = buffer; - } + else { userBuffer = buffer; } - do { /* Internal block processing for too large user data buffers. */ + do /* Internal block processing for too large user data buffers. */ + { /* Get the size of the current data block to be processed. */ - lFramesPerBlock = (lFramesPerBlock < lFramesRemaining) - ? lFramesPerBlock : lFramesRemaining; + lFramesPerBlock =(lFramesPerBlock < lFramesRemaining) + ? lFramesPerBlock : lFramesRemaining; /* Use predefined block size for as long there are enough buffers available, thereafter reduce the processing block size to match the number of remaining buffers. So the final data block is processed although it may be incomplete. */ /* If the available amount of data frames is insufficient. */ - - if (PaUtil_GetRingBufferReadAvailable (pRb) < (long) lFramesPerBlock) { + if( PaUtil_GetRingBufferReadAvailable(pRb) < (long) lFramesPerBlock ) + { /* Make sure, the event isn't already set! */ /* ResetEvent( blockingState->readFramesReadyEvent ); */ @@ -3550,33 +3452,27 @@ static PaError ReadStream (PaStream *s , blockingState->readFramesRequestedFlag = TRUE; /* Wait until requested number of buffers has been freed. */ - waitResult = WaitForSingleObject (blockingState->readFramesReadyEvent, timeout); + waitResult = WaitForSingleObject( blockingState->readFramesReadyEvent, timeout ); /* If something seriously went wrong... */ - - if (waitResult == WAIT_FAILED) { - PA_DEBUG ( ("WaitForSingleObject() failed in ReadStream()\n")); + if( waitResult == WAIT_FAILED ) + { + PA_DEBUG(("WaitForSingleObject() failed in ReadStream()\n")); result = paUnanticipatedHostError; - PA_ASIO_SET_LAST_SYSTEM_ERROR (GetLastError()); + PA_ASIO_SET_LAST_SYSTEM_ERROR( GetLastError() ); return result; - } else if (waitResult == WAIT_TIMEOUT) { - PA_DEBUG ( ("WaitForSingleObject() timed out in ReadStream()\n")); + } + else if( waitResult == WAIT_TIMEOUT ) + { + PA_DEBUG(("WaitForSingleObject() timed out in ReadStream()\n")); /* If block processing has stopped, abort! */ + if( blockingState->stopFlag ) { return result = paStreamIsStopped; } - if (blockingState->stopFlag) { - return result = paStreamIsStopped; - } - - /* if a timeout is encountered, continue, perhaps we should give up eventually */ - continue; - - /* To give up eventually, we may increase the time out - period and return an error if it fails anyway. */ - /* retrun result = paTimedOut; */ + /* If a timeout is encountered, give up eventually. */ + return result = paTimedOut; } } - /* Now, the ring buffer contains the required amount of data frames. (Therefor we don't need to check the return argument of @@ -3589,48 +3485,47 @@ static PaError ReadStream (PaStream *s , segment is returned. Otherwise, i.e. if the first segment is large enough, the second segment's pointer will be NULL. */ - PaUtil_GetRingBufferReadRegions (pRb , - lFramesPerBlock , - &pRingBufferData1st, - &lRingBufferSize1st, - &pRingBufferData2nd, - &lRingBufferSize2nd); + PaUtil_GetRingBufferReadRegions(pRb , + lFramesPerBlock , + &pRingBufferData1st, + &lRingBufferSize1st, + &pRingBufferData2nd, + &lRingBufferSize2nd); /* Set number of frames to be copied from the ring buffer. */ - PaUtil_SetInputFrameCount (pBp, lRingBufferSize1st); - + PaUtil_SetInputFrameCount( pBp, lRingBufferSize1st ); /* Setup ring buffer access. */ - PaUtil_SetInterleavedInputChannels (pBp , /* Buffer processor. */ - 0 , /* The first channel's index. */ - pRingBufferData1st, /* First ring buffer segment. */ - 0); /* Use all available channels. */ + PaUtil_SetInterleavedInputChannels(pBp , /* Buffer processor. */ + 0 , /* The first channel's index. */ + pRingBufferData1st, /* First ring buffer segment. */ + 0 ); /* Use all available channels. */ /* If a second ring buffer segment is required. */ - if (lRingBufferSize2nd) { + if( lRingBufferSize2nd ) { /* Set number of frames to be copied from the ring buffer. */ - PaUtil_Set2ndInputFrameCount (pBp, lRingBufferSize2nd); + PaUtil_Set2ndInputFrameCount( pBp, lRingBufferSize2nd ); /* Setup ring buffer access. */ - PaUtil_Set2ndInterleavedInputChannels (pBp , /* Buffer processor. */ - 0 , /* The first channel's index. */ - pRingBufferData2nd, /* Second ring buffer segment. */ - 0); /* Use all available channels. */ + PaUtil_Set2ndInterleavedInputChannels(pBp , /* Buffer processor. */ + 0 , /* The first channel's index. */ + pRingBufferData2nd, /* Second ring buffer segment. */ + 0 ); /* Use all available channels. */ } /* Let the buffer processor handle "copy and conversion" and update the ring buffer indices manually. */ - lFramesCopied = PaUtil_CopyInput (pBp, &buffer, lFramesPerBlock); - - PaUtil_AdvanceRingBufferReadIndex (pRb, lFramesCopied); + lFramesCopied = PaUtil_CopyInput( pBp, &buffer, lFramesPerBlock ); + PaUtil_AdvanceRingBufferReadIndex( pRb, lFramesCopied ); /* Decrease number of unprocessed frames. */ lFramesRemaining -= lFramesCopied; } /* Continue with the next data chunk. */ - while (lFramesRemaining); + while( lFramesRemaining ); /* If there has been an input overflow within the callback */ - if (blockingState->inputOverflowFlag) { + if( blockingState->inputOverflowFlag ) + { blockingState->inputOverflowFlag = FALSE; /* Return the corresponding error code. */ @@ -3645,12 +3540,12 @@ static PaError ReadStream (PaStream *s , return result; } -static PaError WriteStream (PaStream *s , +static PaError WriteStream( PaStream *s , const void *buffer, - unsigned long frames) + unsigned long frames ) { PaError result = paNoError; /* Initial return value. */ - PaAsioStream *stream = (PaAsioStream*) s; /* The PA ASIO stream. */ + PaAsioStream *stream = (PaAsioStream*)s; /* The PA ASIO stream. */ /* Pointer to the blocking i/o data struct. */ PaAsioStreamBlockingState *blockingState = stream->blockingState; @@ -3675,7 +3570,7 @@ static PaError WriteStream (PaStream *s , unsigned long lFramesRemaining = frames; /* About the time, needed to process 8 data blocks. */ - DWORD timeout = (DWORD) (8 * lFramesPerBlock * 1000 / stream->streamRepresentation.streamInfo.sampleRate); + DWORD timeout = (DWORD)( 8 * lFramesPerBlock * 1000 / stream->streamRepresentation.streamInfo.sampleRate ); DWORD waitResult = 0; /* Copy the input argument to avoid pointer increment! */ @@ -3684,40 +3579,41 @@ static PaError WriteStream (PaStream *s , /* Check if the stream ist still available ready to recieve new data. */ - - if (blockingState->stopFlag || !stream->isActive) { - PA_DEBUG ( ("Warning! Stream no longer available for writing in WriteStream()\n")); + if( blockingState->stopFlag || !stream->isActive ) + { + PA_DEBUG(("Warning! Stream no longer available for writing in WriteStream()\n")); result = paStreamIsStopped; return result; } /* If the stream is a output stream. */ - if (stream->outputChannelCount) { + if( stream->outputChannelCount ) + { /* Prepare buffer access. */ - if (!pBp->userOutputIsInterleaved) { + if( !pBp->userOutputIsInterleaved ) + { userBuffer = blockingState->writeStreamBuffer; - - for (i = 0; i<pBp->outputChannelCount; ++i) { - ( (const void**) userBuffer) [i] = ( (const void**) buffer) [i]; + for( i = 0; i<pBp->outputChannelCount; ++i ) + { + ((const void**)userBuffer)[i] = ((const void**)buffer)[i]; } } /* Use the unchanged buffer. */ - else { - userBuffer = buffer; - } + else { userBuffer = buffer; } - do { /* Internal block processing for too large user data buffers. */ + do /* Internal block processing for too large user data buffers. */ + { /* Get the size of the current data block to be processed. */ - lFramesPerBlock = (lFramesPerBlock < lFramesRemaining) - ? lFramesPerBlock : lFramesRemaining; + lFramesPerBlock =(lFramesPerBlock < lFramesRemaining) + ? lFramesPerBlock : lFramesRemaining; /* Use predefined block size for as long there are enough frames available, thereafter reduce the processing block size to match the number of remaining frames. So the final data block is processed although it may be incomplete. */ /* If the available amount of buffers is insufficient. */ - - if (PaUtil_GetRingBufferWriteAvailable (pRb) < (long) lFramesPerBlock) { + if( PaUtil_GetRingBufferWriteAvailable(pRb) < (long) lFramesPerBlock ) + { /* Make sure, the event isn't already set! */ /* ResetEvent( blockingState->writeBuffersReadyEvent ); */ @@ -3728,33 +3624,27 @@ static PaError WriteStream (PaStream *s , blockingState->writeBuffersRequestedFlag = TRUE; /* Wait until requested number of buffers has been freed. */ - waitResult = WaitForSingleObject (blockingState->writeBuffersReadyEvent, timeout); + waitResult = WaitForSingleObject( blockingState->writeBuffersReadyEvent, timeout ); /* If something seriously went wrong... */ - - if (waitResult == WAIT_FAILED) { - PA_DEBUG ( ("WaitForSingleObject() failed in WriteStream()\n")); + if( waitResult == WAIT_FAILED ) + { + PA_DEBUG(("WaitForSingleObject() failed in WriteStream()\n")); result = paUnanticipatedHostError; - PA_ASIO_SET_LAST_SYSTEM_ERROR (GetLastError()); + PA_ASIO_SET_LAST_SYSTEM_ERROR( GetLastError() ); return result; - } else if (waitResult == WAIT_TIMEOUT) { - PA_DEBUG ( ("WaitForSingleObject() timed out in WriteStream()\n")); + } + else if( waitResult == WAIT_TIMEOUT ) + { + PA_DEBUG(("WaitForSingleObject() timed out in WriteStream()\n")); /* If block processing has stopped, abort! */ - - if (blockingState->stopFlag) { - return result = paStreamIsStopped; - } - - /* if a timeout is encountered, continue, perhaps we should give up eventually */ - continue; - - /* To give up eventually, we may increase the time out - period and return an error if it fails anyway. */ - /* retrun result = paTimedOut; */ + if( blockingState->stopFlag ) { return result = paStreamIsStopped; } + + /* If a timeout is encountered, give up eventually. */ + return result = paTimedOut; } } - /* Now, the ring buffer contains the required amount of free space to store the provided number of data frames. (Therefor we don't need to check the return argument of @@ -3767,48 +3657,47 @@ static PaError WriteStream (PaStream *s , segment is returned. Otherwise, i.e. if the first segment is large enough, the second segment's pointer will be NULL. */ - PaUtil_GetRingBufferWriteRegions (pRb , - lFramesPerBlock , - &pRingBufferData1st, - &lRingBufferSize1st, - &pRingBufferData2nd, - &lRingBufferSize2nd); + PaUtil_GetRingBufferWriteRegions(pRb , + lFramesPerBlock , + &pRingBufferData1st, + &lRingBufferSize1st, + &pRingBufferData2nd, + &lRingBufferSize2nd); /* Set number of frames to be copied to the ring buffer. */ - PaUtil_SetOutputFrameCount (pBp, lRingBufferSize1st); - + PaUtil_SetOutputFrameCount( pBp, lRingBufferSize1st ); /* Setup ring buffer access. */ - PaUtil_SetInterleavedOutputChannels (pBp , /* Buffer processor. */ - 0 , /* The first channel's index. */ - pRingBufferData1st, /* First ring buffer segment. */ - 0); /* Use all available channels. */ + PaUtil_SetInterleavedOutputChannels(pBp , /* Buffer processor. */ + 0 , /* The first channel's index. */ + pRingBufferData1st, /* First ring buffer segment. */ + 0 ); /* Use all available channels. */ /* If a second ring buffer segment is required. */ - if (lRingBufferSize2nd) { + if( lRingBufferSize2nd ) { /* Set number of frames to be copied to the ring buffer. */ - PaUtil_Set2ndOutputFrameCount (pBp, lRingBufferSize2nd); + PaUtil_Set2ndOutputFrameCount( pBp, lRingBufferSize2nd ); /* Setup ring buffer access. */ - PaUtil_Set2ndInterleavedOutputChannels (pBp , /* Buffer processor. */ - 0 , /* The first channel's index. */ - pRingBufferData2nd, /* Second ring buffer segment. */ - 0); /* Use all available channels. */ + PaUtil_Set2ndInterleavedOutputChannels(pBp , /* Buffer processor. */ + 0 , /* The first channel's index. */ + pRingBufferData2nd, /* Second ring buffer segment. */ + 0 ); /* Use all available channels. */ } /* Let the buffer processor handle "copy and conversion" and update the ring buffer indices manually. */ - lFramesCopied = PaUtil_CopyOutput (pBp, &userBuffer, lFramesPerBlock); - - PaUtil_AdvanceRingBufferWriteIndex (pRb, lFramesCopied); + lFramesCopied = PaUtil_CopyOutput( pBp, &userBuffer, lFramesPerBlock ); + PaUtil_AdvanceRingBufferWriteIndex( pRb, lFramesCopied ); /* Decrease number of unprocessed frames. */ lFramesRemaining -= lFramesCopied; } /* Continue with the next data chunk. */ - while (lFramesRemaining); + while( lFramesRemaining ); /* If there has been an output underflow within the callback */ - if (blockingState->outputUnderflowFlag) { + if( blockingState->outputUnderflowFlag ) + { blockingState->outputUnderflowFlag = FALSE; /* Return the corresponding error code. */ @@ -3816,7 +3705,8 @@ static PaError WriteStream (PaStream *s , } } /* If this is not an output stream. */ - else { + else + { result = paCanNotWriteToAnInputOnlyStream; } @@ -3824,25 +3714,137 @@ static PaError WriteStream (PaStream *s , } -static signed long GetStreamReadAvailable (PaStream* s) +static signed long GetStreamReadAvailable( PaStream* s ) { - PaAsioStream *stream = (PaAsioStream*) s; + PaAsioStream *stream = (PaAsioStream*)s; /* Call buffer utility routine to get the number of available frames. */ - return PaUtil_GetRingBufferReadAvailable (&stream->blockingState->readRingBuffer); + return PaUtil_GetRingBufferReadAvailable( &stream->blockingState->readRingBuffer ); } -static signed long GetStreamWriteAvailable (PaStream* s) +static signed long GetStreamWriteAvailable( PaStream* s ) { - PaAsioStream *stream = (PaAsioStream*) s; + PaAsioStream *stream = (PaAsioStream*)s; /* Call buffer utility routine to get the number of empty buffers. */ - return PaUtil_GetRingBufferWriteAvailable (&stream->blockingState->writeRingBuffer); + return PaUtil_GetRingBufferWriteAvailable( &stream->blockingState->writeRingBuffer ); } -PaError PaAsio_ShowControlPanel (PaDeviceIndex device, void* systemSpecific) +/* This routine will be called by the PortAudio engine when audio is needed. +** It may called at interrupt level on some machines so don't do anything +** that could mess up the system like calling malloc() or free(). +*/ +static int BlockingIoPaCallback(const void *inputBuffer , + void *outputBuffer , + unsigned long framesPerBuffer, + const PaStreamCallbackTimeInfo *timeInfo , + PaStreamCallbackFlags statusFlags , + void *userData ) +{ + PaError result = paNoError; /* Initial return value. */ + PaAsioStream *stream = *(PaAsioStream**)userData; /* The PA ASIO stream. */ + PaAsioStreamBlockingState *blockingState = stream->blockingState; /* Persume blockingState is valid, otherwise the callback wouldn't be running. */ + + /* Get a pointer to the stream's blocking i/o buffer processor. */ + PaUtilBufferProcessor *pBp = &blockingState->bufferProcessor; + PaUtilRingBuffer *pRb = NULL; + + /* If output data has been requested. */ + if( stream->outputChannelCount ) + { + /* If the callback input argument signalizes a output underflow, + make sure the WriteStream() function knows about it, too! */ + if( statusFlags & paOutputUnderflowed ) { + blockingState->outputUnderflowFlag = TRUE; + } + + /* Access the corresponding ring buffer. */ + pRb = &blockingState->writeRingBuffer; + + /* If the blocking i/o buffer contains enough output data, */ + if( PaUtil_GetRingBufferReadAvailable(pRb) >= (long) framesPerBuffer ) + { + /* Extract the requested data from the ring buffer. */ + PaUtil_ReadRingBuffer( pRb, outputBuffer, framesPerBuffer ); + } + else /* If no output data is available :-( */ + { + /* Signalize a write-buffer underflow. */ + blockingState->outputUnderflowFlag = TRUE; + + /* Fill the output buffer with silence. */ + (*pBp->outputZeroer)( outputBuffer, 1, pBp->outputChannelCount * framesPerBuffer ); + + /* If playback is to be stopped */ + if( blockingState->stopFlag && PaUtil_GetRingBufferReadAvailable(pRb) < (long) framesPerBuffer ) + { + /* Extract all the remaining data from the ring buffer, + whether it is a complete data block or not. */ + PaUtil_ReadRingBuffer( pRb, outputBuffer, PaUtil_GetRingBufferReadAvailable(pRb) ); + } + } + + /* Set blocking i/o event? */ + if( blockingState->writeBuffersRequestedFlag && PaUtil_GetRingBufferWriteAvailable(pRb) >= (long) blockingState->writeBuffersRequested ) + { + /* Reset buffer request. */ + blockingState->writeBuffersRequestedFlag = FALSE; + blockingState->writeBuffersRequested = 0; + /* Signalize that requested buffers are ready. */ + SetEvent( blockingState->writeBuffersReadyEvent ); + /* What do we do if SetEvent() returns zero, i.e. the event + could not be set? How to return errors from within the + callback? - S.Fischer */ + } + } + + /* If input data has been supplied. */ + if( stream->inputChannelCount ) + { + /* If the callback input argument signalizes a input overflow, + make sure the ReadStream() function knows about it, too! */ + if( statusFlags & paInputOverflowed ) { + blockingState->inputOverflowFlag = TRUE; + } + + /* Access the corresponding ring buffer. */ + pRb = &blockingState->readRingBuffer; + + /* If the blocking i/o buffer contains not enough input buffers */ + if( PaUtil_GetRingBufferWriteAvailable(pRb) < (long) framesPerBuffer ) + { + /* Signalize a read-buffer overflow. */ + blockingState->inputOverflowFlag = TRUE; + + /* Remove some old data frames from the buffer. */ + PaUtil_AdvanceRingBufferReadIndex( pRb, framesPerBuffer ); + } + + /* Insert the current input data into the ring buffer. */ + PaUtil_WriteRingBuffer( pRb, inputBuffer, framesPerBuffer ); + + /* Set blocking i/o event? */ + if( blockingState->readFramesRequestedFlag && PaUtil_GetRingBufferReadAvailable(pRb) >= (long) blockingState->readFramesRequested ) + { + /* Reset buffer request. */ + blockingState->readFramesRequestedFlag = FALSE; + blockingState->readFramesRequested = 0; + /* Signalize that requested buffers are ready. */ + SetEvent( blockingState->readFramesReadyEvent ); + /* What do we do if SetEvent() returns zero, i.e. the event + could not be set? How to return errors from within the + callback? - S.Fischer */ + /** @todo report an error with PA_DEBUG */ + } + } + + return paContinue; +} + + +PaError PaAsio_ShowControlPanel( PaDeviceIndex device, void* systemSpecific ) { PaError result = paNoError; PaUtilHostApiRepresentation *hostApi; @@ -3854,14 +3856,12 @@ PaError PaAsio_ShowControlPanel (PaDeviceIndex device, void* systemSpecific) PaAsioDeviceInfo *asioDeviceInfo; - result = PaUtil_GetHostApiRepresentation (&hostApi, paASIO); - - if (result != paNoError) + result = PaUtil_GetHostApiRepresentation( &hostApi, paASIO ); + if( result != paNoError ) goto error; - result = PaUtil_DeviceIndexToHostApiDeviceIndex (&hostApiDevice, device, hostApi); - - if (result != paNoError) + result = PaUtil_DeviceIndexToHostApiDeviceIndex( &hostApiDevice, device, hostApi ); + if( result != paNoError ) goto error; /* @@ -3872,87 +3872,84 @@ PaError PaAsio_ShowControlPanel (PaDeviceIndex device, void* systemSpecific) done safely while a stream is open. */ - asioHostApi = (PaAsioHostApiRepresentation*) hostApi; - - if (asioHostApi->openAsioDeviceIndex != paNoDevice) { + asioHostApi = (PaAsioHostApiRepresentation*)hostApi; + if( asioHostApi->openAsioDeviceIndex != paNoDevice ) + { result = paDeviceUnavailable; goto error; } - asioDeviceInfo = (PaAsioDeviceInfo*) hostApi->deviceInfos[hostApiDevice]; + asioDeviceInfo = (PaAsioDeviceInfo*)hostApi->deviceInfos[hostApiDevice]; /* See notes about CoInitialize(0) in LoadAsioDriver(). */ - CoInitialize (0); + CoInitialize(0); - if (!asioHostApi->asioDrivers->loadDriver (const_cast<char*> (asioDeviceInfo->commonDeviceInfo.name))) { + if( !asioHostApi->asioDrivers->loadDriver( const_cast<char*>(asioDeviceInfo->commonDeviceInfo.name) ) ) + { result = paUnanticipatedHostError; goto error; } /* CRUCIAL!!! */ - memset (&asioDriverInfo, 0, sizeof (ASIODriverInfo)); - + memset( &asioDriverInfo, 0, sizeof(ASIODriverInfo) ); asioDriverInfo.asioVersion = 2; - asioDriverInfo.sysRef = systemSpecific; - - asioError = ASIOInit (&asioDriverInfo); - - if (asioError != ASE_OK) { + asioError = ASIOInit( &asioDriverInfo ); + if( asioError != ASE_OK ) + { result = paUnanticipatedHostError; - PA_ASIO_SET_LAST_ASIO_ERROR (asioError); + PA_ASIO_SET_LAST_ASIO_ERROR( asioError ); goto error; - } else { + } + else + { asioIsInitialized = 1; } - PA_DEBUG ( ("PaAsio_ShowControlPanel: ASIOInit(): %s\n", PaAsio_GetAsioErrorText (asioError))); - - PA_DEBUG ( ("asioVersion: ASIOInit(): %ld\n", asioDriverInfo.asioVersion)); - PA_DEBUG ( ("driverVersion: ASIOInit(): %ld\n", asioDriverInfo.driverVersion)); - PA_DEBUG ( ("Name: ASIOInit(): %s\n", asioDriverInfo.name)); - PA_DEBUG ( ("ErrorMessage: ASIOInit(): %s\n", asioDriverInfo.errorMessage)); +PA_DEBUG(("PaAsio_ShowControlPanel: ASIOInit(): %s\n", PaAsio_GetAsioErrorText(asioError) )); +PA_DEBUG(("asioVersion: ASIOInit(): %ld\n", asioDriverInfo.asioVersion )); +PA_DEBUG(("driverVersion: ASIOInit(): %ld\n", asioDriverInfo.driverVersion )); +PA_DEBUG(("Name: ASIOInit(): %s\n", asioDriverInfo.name )); +PA_DEBUG(("ErrorMessage: ASIOInit(): %s\n", asioDriverInfo.errorMessage )); asioError = ASIOControlPanel(); - - if (asioError != ASE_OK) { - PA_DEBUG ( ("PaAsio_ShowControlPanel: ASIOControlPanel(): %s\n", PaAsio_GetAsioErrorText (asioError))); + if( asioError != ASE_OK ) + { + PA_DEBUG(("PaAsio_ShowControlPanel: ASIOControlPanel(): %s\n", PaAsio_GetAsioErrorText(asioError) )); result = paUnanticipatedHostError; - PA_ASIO_SET_LAST_ASIO_ERROR (asioError); + PA_ASIO_SET_LAST_ASIO_ERROR( asioError ); goto error; } - PA_DEBUG ( ("PaAsio_ShowControlPanel: ASIOControlPanel(): %s\n", PaAsio_GetAsioErrorText (asioError))); +PA_DEBUG(("PaAsio_ShowControlPanel: ASIOControlPanel(): %s\n", PaAsio_GetAsioErrorText(asioError) )); asioError = ASIOExit(); - - if (asioError != ASE_OK) { + if( asioError != ASE_OK ) + { result = paUnanticipatedHostError; - PA_ASIO_SET_LAST_ASIO_ERROR (asioError); + PA_ASIO_SET_LAST_ASIO_ERROR( asioError ); asioIsInitialized = 0; goto error; } - CoUninitialize(); - - PA_DEBUG ( ("PaAsio_ShowControlPanel: ASIOExit(): %s\n", PaAsio_GetAsioErrorText (asioError))); + CoUninitialize(); +PA_DEBUG(("PaAsio_ShowControlPanel: ASIOExit(): %s\n", PaAsio_GetAsioErrorText(asioError) )); return result; error: - - if (asioIsInitialized) { - ASIOExit(); - } - - CoUninitialize(); + if( asioIsInitialized ) + { + ASIOExit(); + } + CoUninitialize(); return result; } -PaError PaAsio_GetInputChannelName (PaDeviceIndex device, int channelIndex, - const char** channelName) +PaError PaAsio_GetInputChannelName( PaDeviceIndex device, int channelIndex, + const char** channelName ) { PaError result = paNoError; PaUtilHostApiRepresentation *hostApi; @@ -3960,19 +3957,17 @@ PaError PaAsio_GetInputChannelName (PaDeviceIndex device, int channelIndex, PaAsioDeviceInfo *asioDeviceInfo; - result = PaUtil_GetHostApiRepresentation (&hostApi, paASIO); - - if (result != paNoError) + result = PaUtil_GetHostApiRepresentation( &hostApi, paASIO ); + if( result != paNoError ) goto error; - result = PaUtil_DeviceIndexToHostApiDeviceIndex (&hostApiDevice, device, hostApi); - - if (result != paNoError) + result = PaUtil_DeviceIndexToHostApiDeviceIndex( &hostApiDevice, device, hostApi ); + if( result != paNoError ) goto error; - asioDeviceInfo = (PaAsioDeviceInfo*) hostApi->deviceInfos[hostApiDevice]; + asioDeviceInfo = (PaAsioDeviceInfo*)hostApi->deviceInfos[hostApiDevice]; - if (channelIndex < 0 || channelIndex >= asioDeviceInfo->commonDeviceInfo.maxInputChannels) { + if( channelIndex < 0 || channelIndex >= asioDeviceInfo->commonDeviceInfo.maxInputChannels ){ result = paInvalidChannelCount; goto error; } @@ -3980,14 +3975,14 @@ PaError PaAsio_GetInputChannelName (PaDeviceIndex device, int channelIndex, *channelName = asioDeviceInfo->asioChannelInfos[channelIndex].name; return paNoError; - + error: return result; } -PaError PaAsio_GetOutputChannelName (PaDeviceIndex device, int channelIndex, - const char** channelName) +PaError PaAsio_GetOutputChannelName( PaDeviceIndex device, int channelIndex, + const char** channelName ) { PaError result = paNoError; PaUtilHostApiRepresentation *hostApi; @@ -3995,140 +3990,76 @@ PaError PaAsio_GetOutputChannelName (PaDeviceIndex device, int channelIndex, PaAsioDeviceInfo *asioDeviceInfo; - result = PaUtil_GetHostApiRepresentation (&hostApi, paASIO); - - if (result != paNoError) + result = PaUtil_GetHostApiRepresentation( &hostApi, paASIO ); + if( result != paNoError ) goto error; - result = PaUtil_DeviceIndexToHostApiDeviceIndex (&hostApiDevice, device, hostApi); - - if (result != paNoError) + result = PaUtil_DeviceIndexToHostApiDeviceIndex( &hostApiDevice, device, hostApi ); + if( result != paNoError ) goto error; - asioDeviceInfo = (PaAsioDeviceInfo*) hostApi->deviceInfos[hostApiDevice]; + asioDeviceInfo = (PaAsioDeviceInfo*)hostApi->deviceInfos[hostApiDevice]; - if (channelIndex < 0 || channelIndex >= asioDeviceInfo->commonDeviceInfo.maxOutputChannels) { + if( channelIndex < 0 || channelIndex >= asioDeviceInfo->commonDeviceInfo.maxOutputChannels ){ result = paInvalidChannelCount; goto error; } *channelName = asioDeviceInfo->asioChannelInfos[ - - asioDeviceInfo->commonDeviceInfo.maxInputChannels + channelIndex].name; + asioDeviceInfo->commonDeviceInfo.maxInputChannels + channelIndex].name; return paNoError; - + error: return result; } - - - - - - -/* This routine will be called by the PortAudio engine when audio is needed. -** It may called at interrupt level on some machines so don't do anything -** that could mess up the system like calling malloc() or free(). +/* NOTE: the following functions are ASIO-stream specific, and are called directly + by client code. We need to check for many more error conditions here because + we don't have the benefit of pa_front.c's parameter checking. */ -static int BlockingIoPaCallback (const void *inputBuffer , - void *outputBuffer , - unsigned long framesPerBuffer, - const PaStreamCallbackTimeInfo *timeInfo , - PaStreamCallbackFlags statusFlags , - void *userData) -{ - PaError result = paNoError; /* Initial return value. */ - PaAsioStream *stream = * (PaAsioStream**) userData; /* The PA ASIO stream. */ /* This is a pointer to "theAsioStream", see OpenStream(). */ - PaAsioStreamBlockingState *blockingState = stream->blockingState; /* Persume blockingState is valid, otherwise the callback wouldn't be running. */ - - /* Get a pointer to the stream's blocking i/o buffer processor. */ - PaUtilBufferProcessor *pBp = &blockingState->bufferProcessor; - PaUtilRingBuffer *pRb = NULL; - - /* If output data has been requested. */ - if (stream->outputChannelCount) { - /* If the callback input argument signalizes a output underflow, - make sure the WriteStream() function knows about it, too! */ - if (statusFlags & paOutputUnderflowed) { - blockingState->outputUnderflowFlag = TRUE; - } - - /* Access the corresponding ring buffer. */ - pRb = &blockingState->writeRingBuffer; - - /* If the blocking i/o buffer contains enough output data, */ - if (PaUtil_GetRingBufferReadAvailable (pRb) >= (long) framesPerBuffer) { - /* Extract the requested data from the ring buffer. */ - PaUtil_ReadRingBuffer (pRb, outputBuffer, framesPerBuffer); - } else { /* If no output data is available :-( */ - /* Signalize a write-buffer underflow. */ - blockingState->outputUnderflowFlag = TRUE; - - /* Fill the output buffer with silence. */ - (*pBp->outputZeroer) (outputBuffer, 1, pBp->outputChannelCount * framesPerBuffer); - - /* If playback is to be stopped */ +static PaError GetAsioStreamPointer( PaAsioStream **stream, PaStream *s ) +{ + PaError result; + PaUtilHostApiRepresentation *hostApi; + PaAsioHostApiRepresentation *asioHostApi; + + result = PaUtil_ValidateStreamPointer( s ); + if( result != paNoError ) + return result; - if (blockingState->stopFlag && PaUtil_GetRingBufferReadAvailable (pRb) < (long) framesPerBuffer) { - /* Extract all the remaining data from the ring buffer, - whether it is a complete data block or not. */ - PaUtil_ReadRingBuffer (pRb, outputBuffer, PaUtil_GetRingBufferReadAvailable (pRb)); - } - } + result = PaUtil_GetHostApiRepresentation( &hostApi, paASIO ); + if( result != paNoError ) + return result; - /* Set blocking i/o event? */ - if (blockingState->writeBuffersRequestedFlag && PaUtil_GetRingBufferWriteAvailable (pRb) >= (long) blockingState->writeBuffersRequested) { - /* Reset buffer request. */ - blockingState->writeBuffersRequestedFlag = FALSE; - blockingState->writeBuffersRequested = 0; - /* Signalize that requested buffers are ready. */ - SetEvent (blockingState->writeBuffersReadyEvent); - /* What do we do if SetEvent() returns zero, i.e. the event - could not be set? How to return errors from within the - callback? - S.Fischer */ - } + asioHostApi = (PaAsioHostApiRepresentation*)hostApi; + + if( PA_STREAM_REP( s )->streamInterface == &asioHostApi->callbackStreamInterface + || PA_STREAM_REP( s )->streamInterface == &asioHostApi->blockingStreamInterface ) + { + /* s is an ASIO stream */ + *stream = (PaAsioStream *)s; + return paNoError; } + else + { + return paIncompatibleStreamHostApi; + } +} - /* If input data has been supplied. */ - if (stream->inputChannelCount) { - /* If the callback input argument signalizes a input overflow, - make sure the ReadStream() function knows about it, too! */ - if (statusFlags & paInputOverflowed) { - blockingState->inputOverflowFlag = TRUE; - } - - /* Access the corresponding ring buffer. */ - pRb = &blockingState->readRingBuffer; - - /* If the blocking i/o buffer contains not enough input buffers */ - if (PaUtil_GetRingBufferWriteAvailable (pRb) < (long) framesPerBuffer) { - /* Signalize a read-buffer overflow. */ - blockingState->inputOverflowFlag = TRUE; - - /* Remove some old data frames from the buffer. */ - PaUtil_AdvanceRingBufferReadIndex (pRb, framesPerBuffer); - } - /* Insert the current input data into the ring buffer. */ - PaUtil_WriteRingBuffer (pRb, inputBuffer, framesPerBuffer); +PaError PaAsio_SetStreamSampleRate( PaStream* s, double sampleRate ) +{ + PaAsioStream *stream; + PaError result = GetAsioStreamPointer( &stream, s ); + if( result != paNoError ) + return result; - /* Set blocking i/o event? */ - if (blockingState->readFramesRequestedFlag && PaUtil_GetRingBufferReadAvailable (pRb) >= (long) blockingState->readFramesRequested) { - /* Reset buffer request. */ - blockingState->readFramesRequestedFlag = FALSE; - blockingState->readFramesRequested = 0; - /* Signalize that requested buffers are ready. */ - SetEvent (blockingState->readFramesReadyEvent); - /* What do we do if SetEvent() returns zero, i.e. the event - could not be set? How to return errors from within the - callback? - S.Fischer */ - /** @todo report an error with PA_DEBUG */ - } - } + if( stream != theAsioStream ) + return paBadStreamPtr; - return paContinue; + return ValidateAndSetSampleRate( sampleRate ); } + diff --git a/sflphone-common/libs/pjproject/third_party/portaudio/src/hostapi/coreaudio/pa_mac_core.c b/sflphone-common/libs/pjproject/third_party/portaudio/src/hostapi/coreaudio/pa_mac_core.c index 98cfbb518c2d4aadbb1591c7219de0c3bb471c50..0da5dc5b7d41828e38238b77ab3fe5771d89b2ee 100644 --- a/sflphone-common/libs/pjproject/third_party/portaudio/src/hostapi/coreaudio/pa_mac_core.c +++ b/sflphone-common/libs/pjproject/third_party/portaudio/src/hostapi/coreaudio/pa_mac_core.c @@ -1714,19 +1714,19 @@ static OSStatus ringBufferIOProc( AudioConverterRef inAudioConverter, void*inUserData ) { void *dummyData; - long dummySize; + ring_buffer_size_t dummySize; PaUtilRingBuffer *rb = (PaUtilRingBuffer *) inUserData; VVDBUG(("ringBufferIOProc()\n")); - assert( sizeof( UInt32 ) == sizeof( long ) ); if( PaUtil_GetRingBufferReadAvailable( rb ) == 0 ) { *outData = NULL; *ioDataSize = 0; return RING_BUFFER_EMPTY; } + assert(sizeof(UInt32) == sizeof(ring_buffer_size_t)); PaUtil_GetRingBufferReadRegions( rb, *ioDataSize, - outData, (long *)ioDataSize, + outData, (ring_buffer_size_t *)ioDataSize, &dummyData, &dummySize ); assert( *ioDataSize ); @@ -1938,7 +1938,7 @@ static OSStatus AudioIOProc( void *inRefCon, because we have to do a little buffer processing that the AudioConverter would otherwise handle for us. */ void *data1, *data2; - long size1, size2; + ring_buffer_size_t size1, size2; PaUtil_GetRingBufferReadRegions( &stream->inputRingBuffer, inChan*frames*flsz, &data1, &size1, diff --git a/sflphone-common/libs/pjproject/third_party/portaudio/src/hostapi/coreaudio/pa_mac_core_blocking.c b/sflphone-common/libs/pjproject/third_party/portaudio/src/hostapi/coreaudio/pa_mac_core_blocking.c index d858c6219b81170892afc72c547cdb3134deca23..6d31a713dba7bab4968421c1d71f0b97ccb15565 100644 --- a/sflphone-common/libs/pjproject/third_party/portaudio/src/hostapi/coreaudio/pa_mac_core_blocking.c +++ b/sflphone-common/libs/pjproject/third_party/portaudio/src/hostapi/coreaudio/pa_mac_core_blocking.c @@ -577,7 +577,7 @@ signed long GetStreamReadAvailable( PaStream* stream ) VVDBUG(("GetStreamReadAvailable()\n")); return PaUtil_GetRingBufferReadAvailable( &blio->inputRingBuffer ) - / ( blio->outputSampleSizeActual * blio->outChan ); + / ( blio->inputSampleSizeActual * blio->inChan ); } diff --git a/sflphone-common/libs/pjproject/third_party/portaudio/src/hostapi/coreaudio/pa_mac_core_internal.h b/sflphone-common/libs/pjproject/third_party/portaudio/src/hostapi/coreaudio/pa_mac_core_internal.h index 291304c7e3c6f704edfb2b568a2d603b605e7c94..1797cbafd4375ca316fae2e2a3ba34019f8123fe 100644 --- a/sflphone-common/libs/pjproject/third_party/portaudio/src/hostapi/coreaudio/pa_mac_core_internal.h +++ b/sflphone-common/libs/pjproject/third_party/portaudio/src/hostapi/coreaudio/pa_mac_core_internal.h @@ -61,10 +61,11 @@ #ifndef PA_MAC_CORE_INTERNAL_H__ #define PA_MAC_CORE_INTERNAL_H__ +#include <CoreAudio/CoreAudio.h> +#include <CoreServices/CoreServices.h> #include <AudioUnit/AudioUnit.h> #include <AudioToolbox/AudioToolbox.h> - #include "portaudio.h" #include "pa_util.h" #include "pa_hostapi.h" diff --git a/sflphone-common/libs/pjproject/third_party/portaudio/src/hostapi/coreaudio/pa_mac_core_utilities.c b/sflphone-common/libs/pjproject/third_party/portaudio/src/hostapi/coreaudio/pa_mac_core_utilities.c index 5bc592e86e163c10daa7837daaaba9308bf5868d..b58b82202281f2541a8ce9176eb3964ee2a6af73 100644 --- a/sflphone-common/libs/pjproject/third_party/portaudio/src/hostapi/coreaudio/pa_mac_core_utilities.c +++ b/sflphone-common/libs/pjproject/third_party/portaudio/src/hostapi/coreaudio/pa_mac_core_utilities.c @@ -61,6 +61,7 @@ #include <libkern/OSAtomic.h> #include <strings.h> #include <pthread.h> +#include <sys/time.h> PaError PaMacCore_SetUnixError( int err, int line ) { @@ -305,8 +306,13 @@ long computeRingBufferSize( const PaStreamParameters *inputParameters, /* * Durring testing of core audio, I found that serious crashes could occur * if properties such as sample rate were changed multiple times in rapid - * succession. The function below has some fancy logic to make sure that changes - * are acknowledged before another is requested. That seems to help a lot. + * succession. The function below could be used to with a condition variable. + * to prevent propertychanges from happening until the last property + * change is acknowledged. Instead, I implemented a busy-wait, which is simpler + * to implement b/c in second round of testing (nov '09) property changes occured + * quickly and so there was no real way to test the condition variable implementation. + * therefore, this function is not used, but it is aluded to in commented code below, + * since it represents a theoretically better implementation. */ OSStatus propertyProc( @@ -316,9 +322,7 @@ OSStatus propertyProc( AudioDevicePropertyID inPropertyID, void* inClientData ) { - MutexAndBool *mab = (MutexAndBool *) inClientData; - mab->once = TRUE; - pthread_mutex_unlock( &(mab->mutex) ); + // this is where we would set the condition variable return noErr; } @@ -326,7 +330,11 @@ OSStatus propertyProc( be acknowledged, and returns the final value, which is not guaranteed by this function to be the same as the desired value. Obviously, this function can only be used for data whose input and output are the - same size and format, and their size and format are known in advance.*/ + same size and format, and their size and format are known in advance. + whether or not the call succeeds, if the data is successfully read, + it is returned in outPropertyData. If it is not read successfully, + outPropertyData is zeroed, which may or may not be useful in + determining if the property was read. */ PaError AudioDeviceSetPropertyNowAndWaitForChange( AudioDeviceID inDevice, UInt32 inChannel, @@ -337,83 +345,72 @@ PaError AudioDeviceSetPropertyNowAndWaitForChange( void *outPropertyData ) { OSStatus macErr; - int unixErr; - MutexAndBool mab; UInt32 outPropertyDataSize = inPropertyDataSize; /* First, see if it already has that value. If so, return. */ macErr = AudioDeviceGetProperty( inDevice, inChannel, isInput, inPropertyID, &outPropertyDataSize, outPropertyData ); - if( macErr ) - goto failMac2; + if( macErr ) { + memset( outPropertyData, 0, inPropertyDataSize ); + goto failMac; + } if( inPropertyDataSize!=outPropertyDataSize ) return paInternalError; if( 0==memcmp( outPropertyData, inPropertyData, outPropertyDataSize ) ) return paNoError; - /* setup and lock mutex */ - mab.once = FALSE; - unixErr = pthread_mutex_init( &mab.mutex, NULL ); - if( unixErr ) - goto failUnix2; - unixErr = pthread_mutex_lock( &mab.mutex ); - if( unixErr ) - goto failUnix; + /* Ideally, we'd use a condition variable to determine changes. + we could set that up here. */ - /* add property listener */ + /* If we were using a cond variable, we'd do something useful here, + but for now, this is just to make 10.6 happy. */ macErr = AudioDeviceAddPropertyListener( inDevice, inChannel, isInput, inPropertyID, propertyProc, - &mab ); + NULL ); if( macErr ) + /* we couldn't add a listener. */ goto failMac; + /* set property */ macErr = AudioDeviceSetProperty( inDevice, NULL, inChannel, isInput, inPropertyID, inPropertyDataSize, inPropertyData ); - if( macErr ) { - /* we couldn't set the property, so we'll just unlock the mutex - and move on. */ - pthread_mutex_unlock( &mab.mutex ); - } - - /* wait for property to change */ - unixErr = pthread_mutex_lock( &mab.mutex ); - if( unixErr ) - goto failUnix; - - /* now read the property back out */ - macErr = AudioDeviceGetProperty( inDevice, inChannel, - isInput, inPropertyID, - &outPropertyDataSize, outPropertyData ); if( macErr ) goto failMac; - /* cleanup */ - AudioDeviceRemovePropertyListener( inDevice, inChannel, isInput, - inPropertyID, propertyProc ); - unixErr = pthread_mutex_unlock( &mab.mutex ); - if( unixErr ) - goto failUnix2; - unixErr = pthread_mutex_destroy( &mab.mutex ); - if( unixErr ) - goto failUnix2; + /* busy-wait up to 30 seconds for the property to change */ + /* busy-wait is justified here only because the correct alternative (condition variable) + was hard to test, since most of the waiting ended up being for setting rather than + getting in OS X 10.5. This was not the case in earlier OS versions. */ + struct timeval tv1, tv2; + gettimeofday( &tv1, NULL ); + memcpy( &tv2, &tv1, sizeof( struct timeval ) ); + while( tv2.tv_sec - tv1.tv_sec < 30 ) { + /* now read the property back out */ + macErr = AudioDeviceGetProperty( inDevice, inChannel, + isInput, inPropertyID, + &outPropertyDataSize, outPropertyData ); + if( macErr ) { + memset( outPropertyData, 0, inPropertyDataSize ); + goto failMac; + } + /* and compare... */ + if( 0==memcmp( outPropertyData, inPropertyData, outPropertyDataSize ) ) { + AudioDeviceRemovePropertyListener( inDevice, inChannel, isInput, inPropertyID, propertyProc ); + return paNoError; + } + /* No match yet, so let's sleep and try again. */ + Pa_Sleep( 100 ); + gettimeofday( &tv2, NULL ); + } + DBUG( ("Timeout waiting for device setting.\n" ) ); + + AudioDeviceRemovePropertyListener( inDevice, inChannel, isInput, inPropertyID, propertyProc ); return paNoError; - failUnix: - pthread_mutex_destroy( &mab.mutex ); - AudioDeviceRemovePropertyListener( inDevice, inChannel, isInput, - inPropertyID, propertyProc ); - - failUnix2: - DBUG( ("Error #%d while setting a device property: %s\n", unixErr, strerror( unixErr ) ) ); - return paUnanticipatedHostError; - failMac: - pthread_mutex_destroy( &mab.mutex ); - AudioDeviceRemovePropertyListener( inDevice, inChannel, isInput, - inPropertyID, propertyProc ); - failMac2: + AudioDeviceRemovePropertyListener( inDevice, inChannel, isInput, inPropertyID, propertyProc ); return ERR( macErr ); } @@ -431,10 +428,6 @@ PaError setBestSampleRateForDevice( const AudioDeviceID device, const bool requireExact, const Float64 desiredSrate ) { - /*FIXME: changing the sample rate is disruptive to other programs using the - device, so it might be good to offer a custom flag to not change the - sample rate and just do conversion. (in my casual tests, there is - no disruption unless the sample rate really does need to change) */ const bool isInput = isOutput ? 0 : 1; Float64 srate; UInt32 propsize = sizeof( Float64 ); @@ -446,13 +439,15 @@ PaError setBestSampleRateForDevice( const AudioDeviceID device, VDBUG(("Setting sample rate for device %ld to %g.\n",device,(float)desiredSrate)); /* -- try setting the sample rate -- */ + srate = 0; err = AudioDeviceSetPropertyNowAndWaitForChange( device, 0, isInput, kAudioDevicePropertyNominalSampleRate, propsize, &desiredSrate, &srate ); - if( err ) - return err; + /* -- if the rate agrees, and was changed, we are done -- */ + if( srate != 0 && srate == desiredSrate ) + return paNoError; /* -- if the rate agrees, and we got no errors, we are done -- */ if( !err && srate == desiredSrate ) return paNoError; @@ -505,19 +500,19 @@ PaError setBestSampleRateForDevice( const AudioDeviceID device, /* -- set the sample rate -- */ propsize = sizeof( best ); + srate = 0; err = AudioDeviceSetPropertyNowAndWaitForChange( device, 0, isInput, kAudioDevicePropertyNominalSampleRate, propsize, &best, &srate ); - if( err ) - return err; - if( err ) - return ERR( err ); /* -- if the set rate matches, we are done -- */ - if( srate == best ) + if( srate != 0 && srate == best ) return paNoError; + if( err ) + return ERR( err ); + /* -- otherwise, something wierd happened: we didn't set the rate, and we got no errors. Just bail. */ return paInternalError; } diff --git a/sflphone-common/libs/pjproject/third_party/portaudio/src/hostapi/coreaudio/pa_mac_core_utilities.h b/sflphone-common/libs/pjproject/third_party/portaudio/src/hostapi/coreaudio/pa_mac_core_utilities.h index 899826d596419c0d5355dea7c48b5d52fadbca8b..7c4afe52cacdb6808de37e827807c8144d0b4ebd 100644 --- a/sflphone-common/libs/pjproject/third_party/portaudio/src/hostapi/coreaudio/pa_mac_core_utilities.h +++ b/sflphone-common/libs/pjproject/third_party/portaudio/src/hostapi/coreaudio/pa_mac_core_utilities.h @@ -143,18 +143,6 @@ long computeRingBufferSize( const PaStreamParameters *inputParameters, long outputFramesPerBuffer, double sampleRate ); -/* - * Durring testing of core audio, I found that serious crashes could occur - * if properties such as sample rate were changed multiple times in rapid - * succession. The function below has some fancy logic to make sure that changes - * are acknowledged before another is requested. That seems to help a lot. - */ - -typedef struct { - bool once; /* I didn't end up using this. bdr */ - pthread_mutex_t mutex; -} MutexAndBool ; - OSStatus propertyProc( AudioDeviceID inDevice, UInt32 inChannel, diff --git a/sflphone-common/libs/pjproject/third_party/portaudio/src/hostapi/dsound/pa_win_ds.c b/sflphone-common/libs/pjproject/third_party/portaudio/src/hostapi/dsound/pa_win_ds.c index dc71439f72e7bb8cbceacff25ceeef20485b2074..46c5caee41e4609619b7959593a9eff521e887d6 100644 --- a/sflphone-common/libs/pjproject/third_party/portaudio/src/hostapi/dsound/pa_win_ds.c +++ b/sflphone-common/libs/pjproject/third_party/portaudio/src/hostapi/dsound/pa_win_ds.c @@ -1,5 +1,5 @@ /* - * $Id: pa_win_ds.c 1339 2008-02-15 07:50:33Z rossb $ + * $Id: pa_win_ds.c 1433 2009-12-09 01:42:59Z rossb $ * Portable Audio I/O Library DirectSound implementation * * Authors: Phil Burk, Robert Marsanyi & Ross Bencina @@ -107,7 +107,11 @@ provided in newer platform sdks and x64 */ #ifndef DWORD_PTR -#define DWORD_PTR DWORD + #if defined(_WIN64) + #define DWORD_PTR unsigned __int64 + #else + #define DWORD_PTR unsigned long + #endif #endif #define PRINT(x) PA_DEBUG(x); @@ -1401,12 +1405,14 @@ static HRESULT InitInputBuffer( PaWinDsStream *stream, PaSampleFormat sampleForm // first try WAVEFORMATEXTENSIBLE. if this fails, fall back to WAVEFORMATEX PaWin_InitializeWaveFormatExtensible( &waveFormat, nChannels, - sampleFormat, nFrameRate, channelMask ); + sampleFormat, PaWin_SampleFormatToLinearWaveFormatTag( sampleFormat ), + nFrameRate, channelMask ); if( IDirectSoundCapture_CreateCaptureBuffer( stream->pDirectSoundCapture, &captureDesc, &stream->pDirectSoundInputBuffer, NULL) != DS_OK ) { - PaWin_InitializeWaveFormatEx( &waveFormat, nChannels, sampleFormat, nFrameRate ); + PaWin_InitializeWaveFormatEx( &waveFormat, nChannels, sampleFormat, + PaWin_SampleFormatToLinearWaveFormatTag( sampleFormat ), nFrameRate ); if ((result = IDirectSoundCapture_CreateCaptureBuffer( stream->pDirectSoundCapture, &captureDesc, &stream->pDirectSoundInputBuffer, NULL)) != DS_OK) return result; @@ -1477,11 +1483,13 @@ static HRESULT InitOutputBuffer( PaWinDsStream *stream, PaSampleFormat sampleFor // first try WAVEFORMATEXTENSIBLE. if this fails, fall back to WAVEFORMATEX PaWin_InitializeWaveFormatExtensible( &waveFormat, nChannels, - sampleFormat, nFrameRate, channelMask ); + sampleFormat, PaWin_SampleFormatToLinearWaveFormatTag( sampleFormat ), + nFrameRate, channelMask ); if( IDirectSoundBuffer_SetFormat( pPrimaryBuffer, (WAVEFORMATEX*)&waveFormat) != DS_OK ) { - PaWin_InitializeWaveFormatEx( &waveFormat, nChannels, sampleFormat, nFrameRate ); + PaWin_InitializeWaveFormatEx( &waveFormat, nChannels, sampleFormat, + PaWin_SampleFormatToLinearWaveFormatTag( sampleFormat ), nFrameRate ); if((result = IDirectSoundBuffer_SetFormat( pPrimaryBuffer, (WAVEFORMATEX*)&waveFormat)) != DS_OK) return result; } diff --git a/sflphone-common/libs/pjproject/third_party/portaudio/src/hostapi/wasapi/pa_win_wasapi.cpp b/sflphone-common/libs/pjproject/third_party/portaudio/src/hostapi/wasapi/pa_win_wasapi.cpp index 0653b138b06b8af86dcc82464d605d4e3eac2922..498fc6c442d629146256fb025d6e2b42bada30cc 100644 --- a/sflphone-common/libs/pjproject/third_party/portaudio/src/hostapi/wasapi/pa_win_wasapi.cpp +++ b/sflphone-common/libs/pjproject/third_party/portaudio/src/hostapi/wasapi/pa_win_wasapi.cpp @@ -26,13 +26,13 @@ */ /* - * The text above constitutes the entire PortAudio license; however, + * The text above constitutes the entire PortAudio license; however, * the PortAudio community also makes the following non-binding requests: * * Any person wishing to distribute modifications to the Software is * requested to send the modifications to the original developer so that - * they can be incorporated into the canonical version. It is also - * requested that these non-binding requests be included along with the + * they can be incorporated into the canonical version. It is also + * requested that these non-binding requests be included along with the * license above. */ @@ -56,6 +56,8 @@ #include <functiondiscoverykeys.h> // PKEY_Device_FriendlyName #endif +#include <process.h> + #include "pa_util.h" #include "pa_allocation.h" #include "pa_hostapi.h" @@ -73,7 +75,12 @@ #define PORTAUDIO_SHAREMODE AUDCLNT_SHAREMODE_SHARED //#define PORTAUDIO_SHAREMODE AUDCLNT_SHAREMODE_EXCLUSIVE - +/* use CreateThread for CYGWIN, _beginthreadex for all others */ +#ifndef __CYGWIN__ +#define CREATE_THREAD (HANDLE) _beginthreadex(NULL, 0, (unsigned (_stdcall *)(void *))ProcThread, (LPVOID) stream, 0, (unsigned *)&stream->dwThreadId) +#else +#define CREATE_THREAD CreateThread(NULL, 0, ProcThread, (LPVOID) stream, 0, &stream->dwThreadId) +#endif /* prototypes for functions declared in this file */ @@ -82,22 +89,21 @@ extern "C" { #endif /* __cplusplus */ - PaError PaWinWasapi_Initialize (PaUtilHostApiRepresentation **hostApi, PaHostApiIndex index); +PaError PaWinWasapi_Initialize( PaUtilHostApiRepresentation **hostApi, PaHostApiIndex index ); #ifdef __cplusplus } - #endif /* __cplusplus */ -static void Terminate (struct PaUtilHostApiRepresentation *hostApi); -static PaError IsFormatSupported (struct PaUtilHostApiRepresentation *hostApi, +static void Terminate( struct PaUtilHostApiRepresentation *hostApi ); +static PaError IsFormatSupported( struct PaUtilHostApiRepresentation *hostApi, const PaStreamParameters *inputParameters, const PaStreamParameters *outputParameters, - double sampleRate); -static PaError OpenStream (struct PaUtilHostApiRepresentation *hostApi, + double sampleRate ); +static PaError OpenStream( struct PaUtilHostApiRepresentation *hostApi, PaStream** s, const PaStreamParameters *inputParameters, const PaStreamParameters *outputParameters, @@ -105,19 +111,19 @@ static PaError OpenStream (struct PaUtilHostApiRepresentation *hostApi, unsigned long framesPerBuffer, PaStreamFlags streamFlags, PaStreamCallback *streamCallback, - void *userData); -static PaError CloseStream (PaStream* stream); -static PaError StartStream (PaStream *stream); -static PaError StopStream (PaStream *stream); -static PaError AbortStream (PaStream *stream); -static PaError IsStreamStopped (PaStream *s); -static PaError IsStreamActive (PaStream *stream); -static PaTime GetStreamTime (PaStream *stream); -static double GetStreamCpuLoad (PaStream* stream); -static PaError ReadStream (PaStream* stream, void *buffer, unsigned long frames); -static PaError WriteStream (PaStream* stream, const void *buffer, unsigned long frames); -static signed long GetStreamReadAvailable (PaStream* stream); -static signed long GetStreamWriteAvailable (PaStream* stream); + void *userData ); +static PaError CloseStream( PaStream* stream ); +static PaError StartStream( PaStream *stream ); +static PaError StopStream( PaStream *stream ); +static PaError AbortStream( PaStream *stream ); +static PaError IsStreamStopped( PaStream *s ); +static PaError IsStreamActive( PaStream *stream ); +static PaTime GetStreamTime( PaStream *stream ); +static double GetStreamCpuLoad( PaStream* stream ); +static PaError ReadStream( PaStream* stream, void *buffer, unsigned long frames ); +static PaError WriteStream( PaStream* stream, const void *buffer, unsigned long frames ); +static signed long GetStreamReadAvailable( PaStream* stream ); +static signed long GetStreamWriteAvailable( PaStream* stream ); /* IMPLEMENT ME: a macro like the following one should be used for reporting @@ -133,8 +139,7 @@ static signed long GetStreamWriteAvailable (PaStream* stream); //currently built using RC1 SDK (5600) #if _MSC_VER < 1400 -PaError PaWinWasapi_Initialize (PaUtilHostApiRepresentation **hostApi, PaHostApiIndex hostApiIndex) -{ +PaError PaWinWasapi_Initialize( PaUtilHostApiRepresentation **hostApi, PaHostApiIndex hostApiIndex ){ return paNoError; } @@ -151,8 +156,8 @@ PaError PaWinWasapi_Initialize (PaUtilHostApiRepresentation **hostApi, PaHostApi i assume that neither of these will cause the Driver to "load", but again, who knows how they implement their stuff */ - -typedef struct PaWinWasapiDeviceInfo { +typedef struct PaWinWasapiDeviceInfo +{ //hmm is it wise to keep a reference until Terminate? //TODO Check if that interface requires the driver to be loaded! IMMDevice * device; @@ -176,7 +181,8 @@ typedef struct PaWinWasapiDeviceInfo { } PaWinWasapiDeviceInfo; -typedef struct { +typedef struct +{ PaUtilHostApiRepresentation inheritedHostApiRep; PaUtilStreamInterface callbackStreamInterface; PaUtilStreamInterface blockingStreamInterface; @@ -200,7 +206,7 @@ typedef struct { /* PaWinWasapiStream - a stream data structure specifically for this implementation */ -typedef struct PaWinWasapiSubStream { +typedef struct PaWinWasapiSubStream{ IAudioClient *client; WAVEFORMATEXTENSIBLE wavex; UINT32 bufferSize; @@ -209,7 +215,8 @@ typedef struct PaWinWasapiSubStream { unsigned long framesPerHostCallback; /* just an example */ }PaWinWasapiSubStream; -typedef struct PaWinWasapiStream { /* IMPLEMENT ME: rename this */ +typedef struct PaWinWasapiStream +{ /* IMPLEMENT ME: rename this */ PaUtilStreamRepresentation streamRepresentation; PaUtilCpuLoadMeasurer cpuLoadMeasurer; PaUtilBufferProcessor bufferProcessor; @@ -220,20 +227,20 @@ typedef struct PaWinWasapiStream { /* IMPLEMENT ME: rename this */ //input - PaWinWasapiSubStream in; + PaWinWasapiSubStream in; IAudioCaptureClient *cclient; IAudioEndpointVolume *inVol; - //output - PaWinWasapiSubStream out; + //output + PaWinWasapiSubStream out; IAudioRenderClient *rclient; - IAudioEndpointVolume *outVol; + IAudioEndpointVolume *outVol; bool running; bool closeRequest; DWORD dwThreadId; HANDLE hThread; - HANDLE hNotificationEvent; + HANDLE hNotificationEvent; GUID session; @@ -242,145 +249,62 @@ typedef struct PaWinWasapiStream { /* IMPLEMENT ME: rename this */ #define PRINT(x) PA_DEBUG(x); void -logAUDCLNT_E (HRESULT res) -{ +logAUDCLNT_E(HRESULT res){ char *text = 0; - - switch (res) { - - case S_OK: - return; - break; - - case E_POINTER : - text ="E_POINTER"; - break; - - case E_INVALIDARG : - text ="E_INVALIDARG"; - break; - - case AUDCLNT_E_NOT_INITIALIZED : - text ="AUDCLNT_E_NOT_INITIALIZED"; - break; - - case AUDCLNT_E_ALREADY_INITIALIZED : - text ="AUDCLNT_E_ALREADY_INITIALIZED"; - break; - - case AUDCLNT_E_WRONG_ENDPOINT_TYPE : - text ="AUDCLNT_E_WRONG_ENDPOINT_TYPE"; - break; - - case AUDCLNT_E_DEVICE_INVALIDATED : - text ="AUDCLNT_E_DEVICE_INVALIDATED"; - break; - - case AUDCLNT_E_NOT_STOPPED : - text ="AUDCLNT_E_NOT_STOPPED"; - break; - - case AUDCLNT_E_BUFFER_TOO_LARGE : - text ="AUDCLNT_E_BUFFER_TOO_LARGE"; - break; - - case AUDCLNT_E_OUT_OF_ORDER : - text ="AUDCLNT_E_OUT_OF_ORDER"; - break; - - case AUDCLNT_E_UNSUPPORTED_FORMAT : - text ="AUDCLNT_E_UNSUPPORTED_FORMAT"; - break; - - case AUDCLNT_E_INVALID_SIZE : - text ="AUDCLNT_E_INVALID_SIZE"; - break; - - case AUDCLNT_E_DEVICE_IN_USE : - text ="AUDCLNT_E_DEVICE_IN_USE"; - break; - - case AUDCLNT_E_BUFFER_OPERATION_PENDING : - text ="AUDCLNT_E_BUFFER_OPERATION_PENDING"; - break; - - case AUDCLNT_E_THREAD_NOT_REGISTERED : - text ="AUDCLNT_E_THREAD_NOT_REGISTERED"; - break; - - case AUDCLNT_E_EXCLUSIVE_MODE_NOT_ALLOWED : - text ="AUDCLNT_E_EXCLUSIVE_MODE_NOT_ALLOWED"; - break; - - case AUDCLNT_E_ENDPOINT_CREATE_FAILED : - text ="AUDCLNT_E_ENDPOINT_CREATE_FAILED"; - break; - - case AUDCLNT_E_SERVICE_NOT_RUNNING : - text ="AUDCLNT_E_SERVICE_NOT_RUNNING"; - break; - // case AUDCLNT_E_CPUUSAGE_EXCEEDED :text ="AUDCLNT_E_CPUUSAGE_EXCEEDED"; break; - //Header error? - - case AUDCLNT_E_EVENTHANDLE_NOT_EXPECTED : - text ="AUDCLNT_E_EVENTHANDLE_NOT_EXPECTED"; - break; - - case AUDCLNT_E_EXCLUSIVE_MODE_ONLY : - text ="AUDCLNT_E_EXCLUSIVE_MODE_ONLY"; - break; - - case AUDCLNT_E_BUFDURATION_PERIOD_NOT_EQUAL : - text ="AUDCLNT_E_BUFDURATION_PERIOD_NOT_EQUAL"; - break; - - case AUDCLNT_E_EVENTHANDLE_NOT_SET : - text ="AUDCLNT_E_EVENTHANDLE_NOT_SET"; - break; - - case AUDCLNT_E_INCORRECT_BUFFER_SIZE : - text ="AUDCLNT_E_INCORRECT_BUFFER_SIZE"; - break; - - case AUDCLNT_E_BUFFER_SIZE_ERROR : - text ="AUDCLNT_E_BUFFER_SIZE_ERROR"; - break; - - case AUDCLNT_S_BUFFER_EMPTY : - text ="AUDCLNT_S_BUFFER_EMPTY"; - break; - - case AUDCLNT_S_THREAD_ALREADY_REGISTERED : - text ="AUDCLNT_S_THREAD_ALREADY_REGISTERED"; - break; - + switch(res){ + case S_OK: return; break; + case E_POINTER :text ="E_POINTER"; break; + case E_INVALIDARG :text ="E_INVALIDARG"; break; + + case AUDCLNT_E_NOT_INITIALIZED :text ="AUDCLNT_E_NOT_INITIALIZED"; break; + case AUDCLNT_E_ALREADY_INITIALIZED :text ="AUDCLNT_E_ALREADY_INITIALIZED"; break; + case AUDCLNT_E_WRONG_ENDPOINT_TYPE :text ="AUDCLNT_E_WRONG_ENDPOINT_TYPE"; break; + case AUDCLNT_E_DEVICE_INVALIDATED :text ="AUDCLNT_E_DEVICE_INVALIDATED"; break; + case AUDCLNT_E_NOT_STOPPED :text ="AUDCLNT_E_NOT_STOPPED"; break; + case AUDCLNT_E_BUFFER_TOO_LARGE :text ="AUDCLNT_E_BUFFER_TOO_LARGE"; break; + case AUDCLNT_E_OUT_OF_ORDER :text ="AUDCLNT_E_OUT_OF_ORDER"; break; + case AUDCLNT_E_UNSUPPORTED_FORMAT :text ="AUDCLNT_E_UNSUPPORTED_FORMAT"; break; + case AUDCLNT_E_INVALID_SIZE :text ="AUDCLNT_E_INVALID_SIZE"; break; + case AUDCLNT_E_DEVICE_IN_USE :text ="AUDCLNT_E_DEVICE_IN_USE"; break; + case AUDCLNT_E_BUFFER_OPERATION_PENDING :text ="AUDCLNT_E_BUFFER_OPERATION_PENDING"; break; + case AUDCLNT_E_THREAD_NOT_REGISTERED :text ="AUDCLNT_E_THREAD_NOT_REGISTERED"; break; + case AUDCLNT_E_EXCLUSIVE_MODE_NOT_ALLOWED :text ="AUDCLNT_E_EXCLUSIVE_MODE_NOT_ALLOWED"; break; + case AUDCLNT_E_ENDPOINT_CREATE_FAILED :text ="AUDCLNT_E_ENDPOINT_CREATE_FAILED"; break; + case AUDCLNT_E_SERVICE_NOT_RUNNING :text ="AUDCLNT_E_SERVICE_NOT_RUNNING"; break; + // case AUDCLNT_E_CPUUSAGE_EXCEEDED :text ="AUDCLNT_E_CPUUSAGE_EXCEEDED"; break; + //Header error? + case AUDCLNT_E_EVENTHANDLE_NOT_EXPECTED :text ="AUDCLNT_E_EVENTHANDLE_NOT_EXPECTED"; break; + case AUDCLNT_E_EXCLUSIVE_MODE_ONLY :text ="AUDCLNT_E_EXCLUSIVE_MODE_ONLY"; break; + case AUDCLNT_E_BUFDURATION_PERIOD_NOT_EQUAL :text ="AUDCLNT_E_BUFDURATION_PERIOD_NOT_EQUAL"; break; + case AUDCLNT_E_EVENTHANDLE_NOT_SET :text ="AUDCLNT_E_EVENTHANDLE_NOT_SET"; break; + case AUDCLNT_E_INCORRECT_BUFFER_SIZE :text ="AUDCLNT_E_INCORRECT_BUFFER_SIZE"; break; + case AUDCLNT_E_BUFFER_SIZE_ERROR :text ="AUDCLNT_E_BUFFER_SIZE_ERROR"; break; + case AUDCLNT_S_BUFFER_EMPTY :text ="AUDCLNT_S_BUFFER_EMPTY"; break; + case AUDCLNT_S_THREAD_ALREADY_REGISTERED :text ="AUDCLNT_S_THREAD_ALREADY_REGISTERED"; break; default: text =" dunno!"; return ; - break; + break; } - - PRINT ( ("WASAPI ERROR HRESULT: 0x%X : %s\n",res,text)); + PRINT(("WASAPI ERROR HRESULT: 0x%X : %s\n",res,text)); } inline double -nano100ToMillis (const REFERENCE_TIME &ref) -{ +nano100ToMillis(const REFERENCE_TIME &ref){ // 1 nano = 0.000000001 seconds //100 nano = 0.0000001 seconds //100 nano = 0.0001 milliseconds - return ( (double) ref) *0.0001; + return ((double)ref)*0.0001; } inline double -nano100ToSeconds (const REFERENCE_TIME &ref) -{ +nano100ToSeconds(const REFERENCE_TIME &ref){ // 1 nano = 0.000000001 seconds //100 nano = 0.0000001 seconds //100 nano = 0.0001 milliseconds - return ( (double) ref) *0.0000001; + return ((double)ref)*0.0000001; } #ifndef IF_FAILED_JUMP @@ -391,11 +315,11 @@ nano100ToSeconds (const REFERENCE_TIME &ref) //AVRT is the new "multimedia schedulling stuff" -typedef BOOL (WINAPI *FAvRtCreateThreadOrderingGroup) (PHANDLE,PLARGE_INTEGER,GUID*,PLARGE_INTEGER); -typedef BOOL (WINAPI *FAvRtDeleteThreadOrderingGroup) (HANDLE); -typedef BOOL (WINAPI *FAvRtWaitOnThreadOrderingGroup) (HANDLE); -typedef HANDLE (WINAPI *FAvSetMmThreadCharacteristics) (LPCTSTR,LPDWORD); -typedef BOOL (WINAPI *FAvSetMmThreadPriority) (HANDLE,AVRT_PRIORITY); +typedef BOOL (WINAPI *FAvRtCreateThreadOrderingGroup) (PHANDLE,PLARGE_INTEGER,GUID*,PLARGE_INTEGER); +typedef BOOL (WINAPI *FAvRtDeleteThreadOrderingGroup) (HANDLE); +typedef BOOL (WINAPI *FAvRtWaitOnThreadOrderingGroup) (HANDLE); +typedef HANDLE (WINAPI *FAvSetMmThreadCharacteristics) (LPCTSTR,LPDWORD); +typedef BOOL (WINAPI *FAvSetMmThreadPriority) (HANDLE,AVRT_PRIORITY); HMODULE hDInputDLL = 0; FAvRtCreateThreadOrderingGroup pAvRtCreateThreadOrderingGroup=0; @@ -413,60 +337,51 @@ FAvSetMmThreadPriority pAvSetMmThreadPriority=0; return false; \ } \ } \ - -bool -setupAVRT() -{ - hDInputDLL = LoadLibraryA ("avrt.dll"); +bool +setupAVRT(){ - if (hDInputDLL == NULL) + hDInputDLL = LoadLibraryA("avrt.dll"); + if(hDInputDLL == NULL) return false; - setupPTR (pAvRtCreateThreadOrderingGroup, FAvRtCreateThreadOrderingGroup, "AvRtCreateThreadOrderingGroup"); - - setupPTR (pAvRtDeleteThreadOrderingGroup, FAvRtDeleteThreadOrderingGroup, "AvRtDeleteThreadOrderingGroup"); - - setupPTR (pAvRtWaitOnThreadOrderingGroup, FAvRtWaitOnThreadOrderingGroup, "AvRtWaitOnThreadOrderingGroup"); - - setupPTR (pAvSetMmThreadCharacteristics, FAvSetMmThreadCharacteristics, "AvSetMmThreadCharacteristicsA"); - - setupPTR (pAvSetMmThreadPriority, FAvSetMmThreadPriority, "AvSetMmThreadPriority"); + setupPTR(pAvRtCreateThreadOrderingGroup, FAvRtCreateThreadOrderingGroup, "AvRtCreateThreadOrderingGroup"); + setupPTR(pAvRtDeleteThreadOrderingGroup, FAvRtDeleteThreadOrderingGroup, "AvRtDeleteThreadOrderingGroup"); + setupPTR(pAvRtWaitOnThreadOrderingGroup, FAvRtWaitOnThreadOrderingGroup, "AvRtWaitOnThreadOrderingGroup"); + setupPTR(pAvSetMmThreadCharacteristics, FAvSetMmThreadCharacteristics, "AvSetMmThreadCharacteristicsA"); + setupPTR(pAvSetMmThreadPriority, FAvSetMmThreadPriority, "AvSetMmThreadPriority"); return true; } -PaError PaWinWasapi_Initialize (PaUtilHostApiRepresentation **hostApi, PaHostApiIndex hostApiIndex) +PaError PaWinWasapi_Initialize( PaUtilHostApiRepresentation **hostApi, PaHostApiIndex hostApiIndex ) { - if (!setupAVRT()) { - PRINT ( ("Windows WASAPI : No AVRT! (not VISTA?)")); + if (!setupAVRT()){ + PRINT(("Windows WASAPI : No AVRT! (not VISTA?)")); return paNoError; } - CoInitialize (NULL); + CoInitialize(NULL); PaError result = paNoError; PaWinWasapiHostApiRepresentation *paWasapi; PaDeviceInfo *deviceInfoArray; - paWasapi = (PaWinWasapiHostApiRepresentation*) PaUtil_AllocateMemory (sizeof (PaWinWasapiHostApiRepresentation)); - - if (!paWasapi) { + paWasapi = (PaWinWasapiHostApiRepresentation*)PaUtil_AllocateMemory( sizeof(PaWinWasapiHostApiRepresentation) ); + if( !paWasapi ){ result = paInsufficientMemory; goto error; } paWasapi->allocations = PaUtil_CreateAllocationGroup(); - - if (!paWasapi->allocations) { + if( !paWasapi->allocations ){ result = paInsufficientMemory; goto error; } *hostApi = &paWasapi->inheritedHostApiRep; - (*hostApi)->info.structVersion = 1; (*hostApi)->info.type = paWASAPI; (*hostApi)->info.name = "Windows WASAPI"; @@ -479,181 +394,170 @@ PaError PaWinWasapi_Initialize (PaUtilHostApiRepresentation **hostApi, PaHostApi IMMDeviceCollection* spEndpoints=0; paWasapi->enumerator = 0; - hResult = CoCreateInstance ( - __uuidof (MMDeviceEnumerator), NULL,CLSCTX_INPROC_SERVER, - __uuidof (IMMDeviceEnumerator), - (void**) &paWasapi->enumerator); + hResult = CoCreateInstance( + __uuidof(MMDeviceEnumerator), NULL,CLSCTX_INPROC_SERVER, + __uuidof(IMMDeviceEnumerator), + (void**)&paWasapi->enumerator); - IF_FAILED_JUMP (hResult, error); + IF_FAILED_JUMP(hResult, error); //getting default device ids in the eMultimedia "role" { { IMMDevice* defaultRenderer=0; - hResult = paWasapi->enumerator->GetDefaultAudioEndpoint (eRender, eMultimedia, &defaultRenderer); - IF_FAILED_JUMP (hResult, error); + hResult = paWasapi->enumerator->GetDefaultAudioEndpoint(eRender, eMultimedia, &defaultRenderer); + IF_FAILED_JUMP(hResult, error); WCHAR* pszDeviceId = NULL; - hResult = defaultRenderer->GetId (&pszDeviceId); - IF_FAILED_JUMP (hResult, error); - StringCchCopyW (paWasapi->defaultRenderer, MAX_STR_LEN-1, pszDeviceId); - CoTaskMemFree (pszDeviceId); + hResult = defaultRenderer->GetId(&pszDeviceId); + IF_FAILED_JUMP(hResult, error); + StringCchCopyW(paWasapi->defaultRenderer, MAX_STR_LEN-1, pszDeviceId); + CoTaskMemFree(pszDeviceId); defaultRenderer->Release(); } { IMMDevice* defaultCapturer=0; - hResult = paWasapi->enumerator->GetDefaultAudioEndpoint (eCapture, eMultimedia, &defaultCapturer); - IF_FAILED_JUMP (hResult, error); + hResult = paWasapi->enumerator->GetDefaultAudioEndpoint(eCapture, eMultimedia, &defaultCapturer); + IF_FAILED_JUMP(hResult, error); WCHAR* pszDeviceId = NULL; - hResult = defaultCapturer->GetId (&pszDeviceId); - IF_FAILED_JUMP (hResult, error); - StringCchCopyW (paWasapi->defaultCapturer, MAX_STR_LEN-1, pszDeviceId); - CoTaskMemFree (pszDeviceId); + hResult = defaultCapturer->GetId(&pszDeviceId); + IF_FAILED_JUMP(hResult, error); + StringCchCopyW(paWasapi->defaultCapturer, MAX_STR_LEN-1, pszDeviceId); + CoTaskMemFree(pszDeviceId); defaultCapturer->Release(); } } - hResult = paWasapi->enumerator->EnumAudioEndpoints (eAll, DEVICE_STATE_ACTIVE, &spEndpoints); - IF_FAILED_JUMP (hResult, error); + hResult = paWasapi->enumerator->EnumAudioEndpoints(eAll, DEVICE_STATE_ACTIVE, &spEndpoints); + IF_FAILED_JUMP(hResult, error); - hResult = spEndpoints->GetCount (&paWasapi->deviceCount); - IF_FAILED_JUMP (hResult, error); + hResult = spEndpoints->GetCount(&paWasapi->deviceCount); + IF_FAILED_JUMP(hResult, error); paWasapi->devInfo = new PaWinWasapiDeviceInfo[paWasapi->deviceCount]; { for (size_t step=0;step<paWasapi->deviceCount;++step) - memset (&paWasapi->devInfo[step],0,sizeof (PaWinWasapiDeviceInfo)); + memset(&paWasapi->devInfo[step],0,sizeof(PaWinWasapiDeviceInfo)); } - if (paWasapi->deviceCount > 0) { - (*hostApi)->deviceInfos = (PaDeviceInfo**) PaUtil_GroupAllocateMemory ( - paWasapi->allocations, sizeof (PaDeviceInfo*) * paWasapi->deviceCount); - - if (! (*hostApi)->deviceInfos) { + if( paWasapi->deviceCount > 0 ) + { + (*hostApi)->deviceInfos = (PaDeviceInfo**)PaUtil_GroupAllocateMemory( + paWasapi->allocations, sizeof(PaDeviceInfo*) * paWasapi->deviceCount ); + if( !(*hostApi)->deviceInfos ){ result = paInsufficientMemory; goto error; } /* allocate all device info structs in a contiguous block */ - deviceInfoArray = (PaDeviceInfo*) PaUtil_GroupAllocateMemory ( - paWasapi->allocations, sizeof (PaDeviceInfo) * paWasapi->deviceCount); - - if (!deviceInfoArray) { + deviceInfoArray = (PaDeviceInfo*)PaUtil_GroupAllocateMemory( + paWasapi->allocations, sizeof(PaDeviceInfo) * paWasapi->deviceCount ); + if( !deviceInfoArray ){ result = paInsufficientMemory; goto error; } - for (UINT i=0; i < paWasapi->deviceCount; ++i) { + for( UINT i=0; i < paWasapi->deviceCount; ++i ){ - PA_DEBUG ( ("i:%d\n",i)); + PA_DEBUG(("i:%d\n",i)); PaDeviceInfo *deviceInfo = &deviceInfoArray[i]; deviceInfo->structVersion = 2; deviceInfo->hostApi = hostApiIndex; - hResult = spEndpoints->Item (i, &paWasapi->devInfo[i].device); - IF_FAILED_JUMP (hResult, error); + hResult = spEndpoints->Item(i, &paWasapi->devInfo[i].device); + IF_FAILED_JUMP(hResult, error); //getting ID { WCHAR* pszDeviceId = NULL; - hResult = paWasapi->devInfo[i].device->GetId (&pszDeviceId); - IF_FAILED_JUMP (hResult, error); - StringCchCopyW (paWasapi->devInfo[i].szDeviceID, MAX_STR_LEN-1, pszDeviceId); - CoTaskMemFree (pszDeviceId); + hResult = paWasapi->devInfo[i].device->GetId(&pszDeviceId); + IF_FAILED_JUMP(hResult, error); + StringCchCopyW(paWasapi->devInfo[i].szDeviceID, MAX_STR_LEN-1, pszDeviceId); + CoTaskMemFree(pszDeviceId); - if (lstrcmpW (paWasapi->devInfo[i].szDeviceID, paWasapi->defaultCapturer) ==0) { + if (lstrcmpW(paWasapi->devInfo[i].szDeviceID, paWasapi->defaultCapturer)==0){ //we found the default input! (*hostApi)->info.defaultInputDevice = (*hostApi)->info.deviceCount; } - - if (lstrcmpW (paWasapi->devInfo[i].szDeviceID, paWasapi->defaultRenderer) ==0) { + if (lstrcmpW(paWasapi->devInfo[i].szDeviceID, paWasapi->defaultRenderer)==0){ //we found the default output! (*hostApi)->info.defaultOutputDevice = (*hostApi)->info.deviceCount; } } DWORD state=0; - hResult = paWasapi->devInfo[i].device->GetState (&paWasapi->devInfo[i].state); - IF_FAILED_JUMP (hResult, error); + hResult = paWasapi->devInfo[i].device->GetState(&paWasapi->devInfo[i].state); + IF_FAILED_JUMP(hResult, error); - if (paWasapi->devInfo[i].state != DEVICE_STATE_ACTIVE) { - PRINT ( ("WASAPI device:%d is not currently available (state:%d)\n",i,state)); + if (paWasapi->devInfo[i].state != DEVICE_STATE_ACTIVE){ + PRINT(("WASAPI device:%d is not currently available (state:%d)\n",i,state)); //spDevice->Release(); //continue; } { IPropertyStore* spProperties; - hResult = paWasapi->devInfo[i].device->OpenPropertyStore (STGM_READ, &spProperties); - IF_FAILED_JUMP (hResult, error); + hResult = paWasapi->devInfo[i].device->OpenPropertyStore(STGM_READ, &spProperties); + IF_FAILED_JUMP(hResult, error); //getting "Friendly" Name { PROPVARIANT value; - PropVariantInit (&value); - hResult = spProperties->GetValue (PKEY_Device_FriendlyName, &value); - IF_FAILED_JUMP (hResult, error); + PropVariantInit(&value); + hResult = spProperties->GetValue(PKEY_Device_FriendlyName, &value); + IF_FAILED_JUMP(hResult, error); deviceInfo->name = 0; - char* deviceName = (char*) PaUtil_GroupAllocateMemory (paWasapi->allocations, MAX_STR_LEN + 1); - - if (!deviceName) { + char* deviceName = (char*)PaUtil_GroupAllocateMemory( paWasapi->allocations, MAX_STR_LEN + 1 ); + if( !deviceName ){ result = paInsufficientMemory; goto error; } - - if (value.pwszVal) - wcstombs (deviceName, value.pwszVal,MAX_STR_LEN-1); //todo proper size - else { - sprintf (deviceName,"baddev%d",i); - } + if (value.pwszVal) + wcstombs(deviceName, value.pwszVal,MAX_STR_LEN-1); //todo proper size + else{ + _snprintf_s(deviceName,MAX_STR_LEN-1,MAX_STR_LEN-1,"baddev%d",i); + } deviceInfo->name = deviceName; - - PropVariantClear (&value); + PropVariantClear(&value); } #if 0 DWORD numProps = 0; - hResult = spProperties->GetCount (&numProps); - IF_FAILED_JUMP (hResult, error); + hResult = spProperties->GetCount(&numProps); + IF_FAILED_JUMP(hResult, error); { - for (DWORD i=0;i<numProps;++i) { + for (DWORD i=0;i<numProps;++i){ PROPERTYKEY pkey; - hResult = spProperties->GetAt (i,&pkey); + hResult = spProperties->GetAt(i,&pkey); PROPVARIANT value; - PropVariantInit (&value); - hResult = spProperties->GetValue (pkey, &value); - - switch (value.vt) { + PropVariantInit(&value); + hResult = spProperties->GetValue(pkey, &value); + switch(value.vt){ case 11: - PRINT ( ("property*%u*\n",value.ulVal)); - break; - + PRINT(("property*%u*\n",value.ulVal)); + break; case 19: - PRINT ( ("property*%d*\n",value.boolVal)); - break; - - case 31: { + PRINT(("property*%d*\n",value.boolVal)); + break; + case 31: + { char temp[512]; - wcstombs (temp, value.pwszVal,MAX_STR_LEN-1); - PRINT ( ("property*%s*\n",temp)); + wcstombs(temp, value.pwszVal,MAX_STR_LEN-1); + PRINT(("property*%s*\n",temp)); } - break; - - default: - break; + default:break; } - PropVariantClear (&value); + PropVariantClear(&value); } } - #endif /* These look interresting... but they are undocumented @@ -670,10 +574,9 @@ PaError PaWinWasapi_Initialize (PaUtilHostApiRepresentation **hostApi, PaHostApi //getting the Endpoint data { IMMEndpoint *endpoint=0; - hResult = paWasapi->devInfo[i].device->QueryInterface (__uuidof (IMMEndpoint), (void **) &endpoint); - - if (SUCCEEDED (hResult)) { - hResult = endpoint->GetDataFlow (&paWasapi->devInfo[i].flow); + hResult = paWasapi->devInfo[i].device->QueryInterface(__uuidof(IMMEndpoint),(void **)&endpoint); + if (SUCCEEDED(hResult)){ + hResult = endpoint->GetDataFlow(&paWasapi->devInfo[i].flow); endpoint->Release(); } } @@ -683,60 +586,56 @@ PaError PaWinWasapi_Initialize (PaUtilHostApiRepresentation **hostApi, PaHostApi { IAudioClient *myClient=0; - hResult = paWasapi->devInfo[i].device->Activate (__uuidof (IAudioClient), CLSCTX_INPROC_SERVER, NULL, (void**) &myClient); - IF_FAILED_JUMP (hResult, error); + hResult = paWasapi->devInfo[i].device->Activate(__uuidof(IAudioClient), CLSCTX_INPROC_SERVER, NULL, (void**)&myClient); + IF_FAILED_JUMP(hResult, error); - hResult = myClient->GetDevicePeriod ( - &paWasapi->devInfo[i].DefaultDevicePeriod, - &paWasapi->devInfo[i].MinimumDevicePeriod); - IF_FAILED_JUMP (hResult, error); + hResult = myClient->GetDevicePeriod( + &paWasapi->devInfo[i].DefaultDevicePeriod, + &paWasapi->devInfo[i].MinimumDevicePeriod); + IF_FAILED_JUMP(hResult, error); - hResult = myClient->GetMixFormat (&paWasapi->devInfo[i].MixFormat); + hResult = myClient->GetMixFormat(&paWasapi->devInfo[i].MixFormat); - if (hResult != S_OK) { - /*davidv: this happened with my hardware, previously for that same device in DirectSound: - Digital Output (Realtek AC'97 Audio)'s GUID: {0x38f2cf50,0x7b4c,0x4740,0x86,0xeb,0xd4,0x38,0x66,0xd8,0xc8, 0x9f} - so something must be _really_ wrong with this device, TODO handle this better. We kind of need GetMixFormat*/ - logAUDCLNT_E (hResult); - goto error; - } + if (hResult != S_OK){ + /*davidv: this happened with my hardware, previously for that same device in DirectSound: + Digital Output (Realtek AC'97 Audio)'s GUID: {0x38f2cf50,0x7b4c,0x4740,0x86,0xeb,0xd4,0x38,0x66,0xd8,0xc8, 0x9f} + so something must be _really_ wrong with this device, TODO handle this better. We kind of need GetMixFormat*/ + logAUDCLNT_E(hResult); + goto error; + } myClient->Release(); } //we can now fill in portaudio device data deviceInfo->maxInputChannels = 0; //for now - deviceInfo->maxOutputChannels = 0; //for now - switch (paWasapi->devInfo[i].flow) { - + switch(paWasapi->devInfo[i].flow){ case eRender: //hum not exaclty maximum, more like "default" deviceInfo->maxOutputChannels = paWasapi->devInfo[i].MixFormat->nChannels; - deviceInfo->defaultHighOutputLatency = nano100ToSeconds (paWasapi->devInfo[i].DefaultDevicePeriod); - deviceInfo->defaultLowOutputLatency = nano100ToSeconds (paWasapi->devInfo[i].MinimumDevicePeriod); - break; - + deviceInfo->defaultHighOutputLatency = nano100ToSeconds(paWasapi->devInfo[i].DefaultDevicePeriod); + deviceInfo->defaultLowOutputLatency = nano100ToSeconds(paWasapi->devInfo[i].MinimumDevicePeriod); + break; case eCapture: //hum not exaclty maximum, more like "default" deviceInfo->maxInputChannels = paWasapi->devInfo[i].MixFormat->nChannels; - deviceInfo->defaultHighInputLatency = nano100ToSeconds (paWasapi->devInfo[i].DefaultDevicePeriod); - deviceInfo->defaultLowInputLatency = nano100ToSeconds (paWasapi->devInfo[i].MinimumDevicePeriod); - break; - + deviceInfo->defaultHighInputLatency = nano100ToSeconds(paWasapi->devInfo[i].DefaultDevicePeriod); + deviceInfo->defaultLowInputLatency = nano100ToSeconds(paWasapi->devInfo[i].MinimumDevicePeriod); + break; default: - PRINT ( ("WASAPI device:%d bad Data FLow! \n",i)); + PRINT(("WASAPI device:%d bad Data FLow! \n",i)); goto error; - break; + break; } - deviceInfo->defaultSampleRate = (double) paWasapi->devInfo[i].MixFormat->nSamplesPerSec; + deviceInfo->defaultSampleRate = (double)paWasapi->devInfo[i].MixFormat->nSamplesPerSec; (*hostApi)->deviceInfos[i] = deviceInfo; - ++ (*hostApi)->info.deviceCount; + ++(*hostApi)->info.deviceCount; } } @@ -746,16 +645,16 @@ PaError PaWinWasapi_Initialize (PaUtilHostApiRepresentation **hostApi, PaHostApi (*hostApi)->OpenStream = OpenStream; (*hostApi)->IsFormatSupported = IsFormatSupported; - PaUtil_InitializeStreamInterface (&paWasapi->callbackStreamInterface, CloseStream, StartStream, + PaUtil_InitializeStreamInterface( &paWasapi->callbackStreamInterface, CloseStream, StartStream, StopStream, AbortStream, IsStreamStopped, IsStreamActive, GetStreamTime, GetStreamCpuLoad, PaUtil_DummyRead, PaUtil_DummyWrite, - PaUtil_DummyGetReadAvailable, PaUtil_DummyGetWriteAvailable); + PaUtil_DummyGetReadAvailable, PaUtil_DummyGetWriteAvailable ); - PaUtil_InitializeStreamInterface (&paWasapi->blockingStreamInterface, CloseStream, StartStream, + PaUtil_InitializeStreamInterface( &paWasapi->blockingStreamInterface, CloseStream, StartStream, StopStream, AbortStream, IsStreamStopped, IsStreamActive, GetStreamTime, PaUtil_DummyGetCpuLoad, - ReadStream, WriteStream, GetStreamReadAvailable, GetStreamWriteAvailable); + ReadStream, WriteStream, GetStreamReadAvailable, GetStreamWriteAvailable ); return result; @@ -767,105 +666,92 @@ error: if (paWasapi->enumerator) paWasapi->enumerator->Release(); - if (paWasapi) { - if (paWasapi->allocations) { - PaUtil_FreeAllAllocations (paWasapi->allocations); - PaUtil_DestroyAllocationGroup (paWasapi->allocations); + if( paWasapi ) + { + if( paWasapi->allocations ) + { + PaUtil_FreeAllAllocations( paWasapi->allocations ); + PaUtil_DestroyAllocationGroup( paWasapi->allocations ); } - PaUtil_FreeMemory (paWasapi); + PaUtil_FreeMemory( paWasapi ); } - return result; } -static void Terminate (struct PaUtilHostApiRepresentation *hostApi) +static void Terminate( struct PaUtilHostApiRepresentation *hostApi ) { - PaWinWasapiHostApiRepresentation *paWasapi = (PaWinWasapiHostApiRepresentation*) hostApi; + PaWinWasapiHostApiRepresentation *paWasapi = (PaWinWasapiHostApiRepresentation*)hostApi; paWasapi->enumerator->Release(); - for (UINT i=0;i<paWasapi->deviceCount;++i) { + for (UINT i=0;i<paWasapi->deviceCount;++i){ PaWinWasapiDeviceInfo *info = &paWasapi->devInfo[i]; if (info->device) info->device->Release(); if (info->MixFormat) - CoTaskMemFree (info->MixFormat); + CoTaskMemFree(info->MixFormat); } - delete [] paWasapi->devInfo; CoUninitialize(); - if (paWasapi->allocations) { - PaUtil_FreeAllAllocations (paWasapi->allocations); - PaUtil_DestroyAllocationGroup (paWasapi->allocations); + if( paWasapi->allocations ){ + PaUtil_FreeAllAllocations( paWasapi->allocations ); + PaUtil_DestroyAllocationGroup( paWasapi->allocations ); } - PaUtil_FreeMemory (paWasapi); + PaUtil_FreeMemory( paWasapi ); } static void -LogWAVEFORMATEXTENSIBLE (const WAVEFORMATEXTENSIBLE *in) -{ - - const WAVEFORMATEX *old = (WAVEFORMATEX *) in; - - switch (old->wFormatTag) { - - case WAVE_FORMAT_EXTENSIBLE: { - - PRINT ( ("wFormatTag=WAVE_FORMAT_EXTENSIBLE\n")); - - if (in->SubFormat == KSDATAFORMAT_SUBTYPE_IEEE_FLOAT) { - PRINT ( ("SubFormat=KSDATAFORMAT_SUBTYPE_IEEE_FLOAT\n")); - } else if (in->SubFormat == KSDATAFORMAT_SUBTYPE_PCM) { - PRINT ( ("SubFormat=KSDATAFORMAT_SUBTYPE_PCM\n")); - } else { - PRINT ( ("SubFormat=CUSTOM GUID{%d:%d:%d:%d%d%d%d%d%d%d%d}\n", - in->SubFormat.Data1, - in->SubFormat.Data2, - in->SubFormat.Data3, - (int) in->SubFormat.Data4[0], - (int) in->SubFormat.Data4[1], - (int) in->SubFormat.Data4[2], - (int) in->SubFormat.Data4[3], - (int) in->SubFormat.Data4[4], - (int) in->SubFormat.Data4[5], - (int) in->SubFormat.Data4[6], - (int) in->SubFormat.Data4[7])); - } - - PRINT ( ("Samples.wValidBitsPerSample=%d\n", in->Samples.wValidBitsPerSample)); - - PRINT ( ("dwChannelMask=0x%X\n",in->dwChannelMask)); - } - - break; - - case WAVE_FORMAT_PCM: - PRINT ( ("wFormatTag=WAVE_FORMAT_PCM\n")); - break; - - case WAVE_FORMAT_IEEE_FLOAT: - PRINT ( ("wFormatTag=WAVE_FORMAT_IEEE_FLOAT\n")); - break; - - default : - PRINT ( ("wFormatTag=UNKNOWN(%d)\n",old->wFormatTag)); - break; - } - - PRINT ( ("nChannels =%d\n",old->nChannels)); - - PRINT ( ("nSamplesPerSec =%d\n",old->nSamplesPerSec)); - PRINT ( ("nAvgBytesPerSec=%d\n",old->nAvgBytesPerSec)); - PRINT ( ("nBlockAlign =%d\n",old->nBlockAlign)); - PRINT ( ("wBitsPerSample =%d\n",old->wBitsPerSample)); - PRINT ( ("cbSize =%d\n",old->cbSize)); +LogWAVEFORMATEXTENSIBLE(const WAVEFORMATEXTENSIBLE *in){ + + const WAVEFORMATEX *old = (WAVEFORMATEX *)in; + + switch (old->wFormatTag){ + case WAVE_FORMAT_EXTENSIBLE:{ + + PRINT(("wFormatTag=WAVE_FORMAT_EXTENSIBLE\n")); + + if (in->SubFormat == KSDATAFORMAT_SUBTYPE_IEEE_FLOAT){ + PRINT(("SubFormat=KSDATAFORMAT_SUBTYPE_IEEE_FLOAT\n")); + } + else if (in->SubFormat == KSDATAFORMAT_SUBTYPE_PCM){ + PRINT(("SubFormat=KSDATAFORMAT_SUBTYPE_PCM\n")); + } + else{ + PRINT(("SubFormat=CUSTOM GUID{%d:%d:%d:%d%d%d%d%d%d%d%d}\n", + in->SubFormat.Data1, + in->SubFormat.Data2, + in->SubFormat.Data3, + (int)in->SubFormat.Data4[0], + (int)in->SubFormat.Data4[1], + (int)in->SubFormat.Data4[2], + (int)in->SubFormat.Data4[3], + (int)in->SubFormat.Data4[4], + (int)in->SubFormat.Data4[5], + (int)in->SubFormat.Data4[6], + (int)in->SubFormat.Data4[7])); + } + PRINT(("Samples.wValidBitsPerSample=%d\n", in->Samples.wValidBitsPerSample)); + PRINT(("dwChannelMask=0x%X\n",in->dwChannelMask)); + }break; + + case WAVE_FORMAT_PCM: PRINT(("wFormatTag=WAVE_FORMAT_PCM\n")); break; + case WAVE_FORMAT_IEEE_FLOAT: PRINT(("wFormatTag=WAVE_FORMAT_IEEE_FLOAT\n")); break; + default : PRINT(("wFormatTag=UNKNOWN(%d)\n",old->wFormatTag)); break; + } + + PRINT(("nChannels =%d\n",old->nChannels)); + PRINT(("nSamplesPerSec =%d\n",old->nSamplesPerSec)); + PRINT(("nAvgBytesPerSec=%d\n",old->nAvgBytesPerSec)); + PRINT(("nBlockAlign =%d\n",old->nBlockAlign)); + PRINT(("wBitsPerSample =%d\n",old->wBitsPerSample)); + PRINT(("cbSize =%d\n",old->cbSize)); } @@ -874,82 +760,53 @@ LogWAVEFORMATEXTENSIBLE (const WAVEFORMATEXTENSIBLE *in) WAVEFORMATXXX is always interleaved */ static PaSampleFormat -waveformatToPaFormat (const WAVEFORMATEXTENSIBLE *in) -{ +waveformatToPaFormat(const WAVEFORMATEXTENSIBLE *in){ - const WAVEFORMATEX *old = (WAVEFORMATEX*) in; + const WAVEFORMATEX *old = (WAVEFORMATEX*)in; - switch (old->wFormatTag) { + switch (old->wFormatTag){ - case WAVE_FORMAT_EXTENSIBLE: { - if (in->SubFormat == KSDATAFORMAT_SUBTYPE_IEEE_FLOAT) { + case WAVE_FORMAT_EXTENSIBLE: + { + if (in->SubFormat == KSDATAFORMAT_SUBTYPE_IEEE_FLOAT){ if (in->Samples.wValidBitsPerSample == 32) return paFloat32; else return paCustomFormat; - } else if (in->SubFormat == KSDATAFORMAT_SUBTYPE_PCM) { - switch (old->wBitsPerSample) { - - case 32: - return paInt32; - break; - - case 24: - return paInt24; - break; - - case 8: - return paUInt8; - break; - - case 16: - return paInt16; - break; - - default: - return paCustomFormat; - break; + } + else if (in->SubFormat == KSDATAFORMAT_SUBTYPE_PCM){ + switch (old->wBitsPerSample){ + case 32: return paInt32; break; + case 24: return paInt24;break; + case 8: return paUInt8;break; + case 16: return paInt16;break; + default: return paCustomFormat;break; } - } else + } + else return paCustomFormat; } - break; case WAVE_FORMAT_IEEE_FLOAT: return paFloat32; - break; - - case WAVE_FORMAT_PCM: { - switch (old->wBitsPerSample) { - - case 32: - return paInt32; - break; - - case 24: - return paInt24; - break; - - case 8: - return paUInt8; - break; - - case 16: - return paInt16; - break; + break; - default: - return paCustomFormat; - break; + case WAVE_FORMAT_PCM: + { + switch (old->wBitsPerSample){ + case 32: return paInt32; break; + case 24: return paInt24;break; + case 8: return paUInt8;break; + case 16: return paInt16;break; + default: return paCustomFormat;break; } } - break; default: return paCustomFormat; - break; + break; } return paCustomFormat; @@ -958,96 +815,56 @@ waveformatToPaFormat (const WAVEFORMATEXTENSIBLE *in) static PaError -waveformatFromParams (WAVEFORMATEXTENSIBLE*wavex, - const PaStreamParameters * params, - double sampleRate) -{ +waveformatFromParams(WAVEFORMATEXTENSIBLE*wavex, + const PaStreamParameters * params, + double sampleRate){ size_t bytesPerSample = 0; - - switch (params->sampleFormat & ~paNonInterleaved) { - + switch( params->sampleFormat & ~paNonInterleaved ){ case paFloat32: - - case paInt32: - bytesPerSample=4; - break; - - case paInt16: - bytesPerSample=2; - break; - - case paInt24: - bytesPerSample=3; - break; - + case paInt32: bytesPerSample=4;break; + case paInt16: bytesPerSample=2;break; + case paInt24: bytesPerSample=3;break; case paInt8: - - case paUInt8: - bytesPerSample=1; - break; - + case paUInt8: bytesPerSample=1;break; case paCustomFormat: - - default: - return paSampleFormatNotSupported; - break; + default: return paSampleFormatNotSupported;break; } - memset (wavex,0,sizeof (WAVEFORMATEXTENSIBLE)); + memset(wavex,0,sizeof(WAVEFORMATEXTENSIBLE)); - WAVEFORMATEX *old = (WAVEFORMATEX *) wavex; - old->nChannels = (WORD) params->channelCount; - old->nSamplesPerSec = (DWORD) sampleRate; - old->wBitsPerSample = (WORD) (bytesPerSample*8); - old->nAvgBytesPerSec = (DWORD) (old->nSamplesPerSec * old->nChannels * bytesPerSample); - old->nBlockAlign = (WORD) (old->nChannels * bytesPerSample); + WAVEFORMATEX *old = (WAVEFORMATEX *)wavex; + old->nChannels = (WORD)params->channelCount; + old->nSamplesPerSec = (DWORD)sampleRate; + old->wBitsPerSample = (WORD)(bytesPerSample*8); + old->nAvgBytesPerSec = (DWORD)(old->nSamplesPerSec * old->nChannels * bytesPerSample); + old->nBlockAlign = (WORD)(old->nChannels * bytesPerSample); //WAVEFORMATEX - - if (params->channelCount <=2 && (bytesPerSample == 2 || bytesPerSample == 1)) { + if (params->channelCount <=2 && (bytesPerSample == 2 || bytesPerSample == 1)){ old->cbSize = 0; old->wFormatTag = WAVE_FORMAT_PCM; } - //WAVEFORMATEXTENSIBLE - else { + else{ old->wFormatTag = WAVE_FORMAT_EXTENSIBLE; old->cbSize = sizeof (WAVEFORMATEXTENSIBLE) - sizeof (WAVEFORMATEX); - if ( (params->sampleFormat & ~paNonInterleaved) == paFloat32) + if ((params->sampleFormat & ~paNonInterleaved) == paFloat32) wavex->SubFormat = KSDATAFORMAT_SUBTYPE_IEEE_FLOAT; else wavex->SubFormat = KSDATAFORMAT_SUBTYPE_PCM; wavex->Samples.wValidBitsPerSample = old->wBitsPerSample; //no extra padding! - switch (params->channelCount) { - - case 1: - wavex->dwChannelMask = SPEAKER_FRONT_CENTER; - break; - - case 2: - wavex->dwChannelMask = 0x1 | 0x2; - break; - - case 4: - wavex->dwChannelMask = 0x1 | 0x2 | 0x10 | 0x20; - break; - - case 6: - wavex->dwChannelMask = 0x1 | 0x2 | 0x4 | 0x8 | 0x10 | 0x20; - break; - - case 8: - wavex->dwChannelMask = 0x1 | 0x2 | 0x4 | 0x8 | 0x10 | 0x20 | 0x40 | 0x80; - break; - - default: - wavex->dwChannelMask = 0; - break; + switch(params->channelCount){ + case 1: wavex->dwChannelMask = SPEAKER_FRONT_CENTER; break; + case 2: wavex->dwChannelMask = 0x1 | 0x2; break; + case 4: wavex->dwChannelMask = 0x1 | 0x2 | 0x10 | 0x20; break; + case 6: wavex->dwChannelMask = 0x1 | 0x2 | 0x4 | 0x8 | 0x10 | 0x20; break; + case 8: wavex->dwChannelMask = 0x1 | 0x2 | 0x4 | 0x8 | 0x10 | 0x20 | 0x40 | 0x80; break; + default: wavex->dwChannelMask = 0; break; } } @@ -1066,47 +883,51 @@ waveformatFromParams (WAVEFORMATEXTENSIBLE*wavex, #define paInt16 ((PaSampleFormat) 0x00000008) */ //lifted from pa_wdmks -static void wasapiFillWFEXT (WAVEFORMATEXTENSIBLE* pwfext, PaSampleFormat sampleFormat, double sampleRate, int channelCount) +static void wasapiFillWFEXT( WAVEFORMATEXTENSIBLE* pwfext, PaSampleFormat sampleFormat, double sampleRate, int channelCount) { - PA_DEBUG ( ("sampleFormat = %lx\n" , sampleFormat)); - PA_DEBUG ( ("sampleRate = %f\n" , sampleRate)); - PA_DEBUG ( ("chanelCount = %d\n", channelCount)); + PA_DEBUG(( "sampleFormat = %lx\n" , sampleFormat )); + PA_DEBUG(( "sampleRate = %f\n" , sampleRate )); + PA_DEBUG(( "chanelCount = %d\n", channelCount )); pwfext->Format.wFormatTag = WAVE_FORMAT_EXTENSIBLE; pwfext->Format.nChannels = channelCount; - pwfext->Format.nSamplesPerSec = (int) sampleRate; - - if (channelCount == 1) + pwfext->Format.nSamplesPerSec = (int)sampleRate; + if(channelCount == 1) pwfext->dwChannelMask = KSAUDIO_SPEAKER_DIRECTOUT; else pwfext->dwChannelMask = KSAUDIO_SPEAKER_STEREO; - - if (sampleFormat == paFloat32) { + if(sampleFormat == paFloat32) + { pwfext->Format.nBlockAlign = channelCount * 4; pwfext->Format.wBitsPerSample = 32; - pwfext->Format.cbSize = sizeof (WAVEFORMATEXTENSIBLE)-sizeof (WAVEFORMATEX); + pwfext->Format.cbSize = sizeof(WAVEFORMATEXTENSIBLE)-sizeof(WAVEFORMATEX); pwfext->Samples.wValidBitsPerSample = 32; pwfext->SubFormat = KSDATAFORMAT_SUBTYPE_IEEE_FLOAT; - } else if (sampleFormat == paInt32) { + } + else if(sampleFormat == paInt32) + { pwfext->Format.nBlockAlign = channelCount * 4; pwfext->Format.wBitsPerSample = 32; - pwfext->Format.cbSize = sizeof (WAVEFORMATEXTENSIBLE)-sizeof (WAVEFORMATEX); + pwfext->Format.cbSize = sizeof(WAVEFORMATEXTENSIBLE)-sizeof(WAVEFORMATEX); pwfext->Samples.wValidBitsPerSample = 32; pwfext->SubFormat = KSDATAFORMAT_SUBTYPE_PCM; - } else if (sampleFormat == paInt24) { + } + else if(sampleFormat == paInt24) + { pwfext->Format.nBlockAlign = channelCount * 3; pwfext->Format.wBitsPerSample = 24; - pwfext->Format.cbSize = sizeof (WAVEFORMATEXTENSIBLE)-sizeof (WAVEFORMATEX); + pwfext->Format.cbSize = sizeof(WAVEFORMATEXTENSIBLE)-sizeof(WAVEFORMATEX); pwfext->Samples.wValidBitsPerSample = 24; pwfext->SubFormat = KSDATAFORMAT_SUBTYPE_PCM; - } else if (sampleFormat == paInt16) { + } + else if(sampleFormat == paInt16) + { pwfext->Format.nBlockAlign = channelCount * 2; pwfext->Format.wBitsPerSample = 16; - pwfext->Format.cbSize = sizeof (WAVEFORMATEXTENSIBLE)-sizeof (WAVEFORMATEX); + pwfext->Format.cbSize = sizeof(WAVEFORMATEXTENSIBLE)-sizeof(WAVEFORMATEX); pwfext->Samples.wValidBitsPerSample = 16; pwfext->SubFormat = KSDATAFORMAT_SUBTYPE_PCM; } - pwfext->Format.nAvgBytesPerSec = pwfext->Format.nSamplesPerSec * pwfext->Format.nBlockAlign; } @@ -1122,201 +943,198 @@ const int BestToWorst[FORMATTESTS]={paFloat32,paInt24,paInt16}; static PaError -GetClosestFormat (IAudioClient * myClient, double sampleRate,const PaStreamParameters * params, - AUDCLNT_SHAREMODE *shareMode, WAVEFORMATEXTENSIBLE *outWavex) +GetClosestFormat(IAudioClient * myClient, double sampleRate,const PaStreamParameters * params, + AUDCLNT_SHAREMODE *shareMode, WAVEFORMATEXTENSIBLE *outWavex) { - //TODO we should try exclusive first and shared after - *shareMode = PORTAUDIO_SHAREMODE; - - PaError answer = paInvalidSampleRate; - - waveformatFromParams (outWavex,params,sampleRate); - WAVEFORMATEX *sharedClosestMatch=0; - HRESULT hResult=!S_OK; - - if (*shareMode == AUDCLNT_SHAREMODE_EXCLUSIVE) - hResult = myClient->IsFormatSupported (AUDCLNT_SHAREMODE_EXCLUSIVE, (WAVEFORMATEX*) outWavex,NULL); - else - hResult = myClient->IsFormatSupported (AUDCLNT_SHAREMODE_SHARED, (WAVEFORMATEX*) &outWavex,&sharedClosestMatch); - - if (hResult == S_OK) - answer = paFormatIsSupported; - else if (sharedClosestMatch) { - WAVEFORMATEXTENSIBLE* ext = (WAVEFORMATEXTENSIBLE*) sharedClosestMatch; - - int closestMatchSR = (int) sharedClosestMatch->nSamplesPerSec; - - if (sharedClosestMatch->wFormatTag == WAVE_FORMAT_EXTENSIBLE) - memcpy (outWavex,sharedClosestMatch,sizeof (WAVEFORMATEXTENSIBLE)); - else - memcpy (outWavex,sharedClosestMatch,sizeof (WAVEFORMATEX)); - - CoTaskMemFree (sharedClosestMatch); - - if ( (int) sampleRate == closestMatchSR) - answer = paFormatIsSupported; - else - answer = paInvalidSampleRate; - - } else { - - //it doesnt suggest anything?? ok lets show it the MENU! - - //ok fun time as with pa_win_mme, we know only a refusal of the user-requested - //sampleRate+num Channel is disastrous, as the portaudio buffer processor converts between anything - //so lets only use the number - for (int i=0;i<FORMATTESTS;++i) { - WAVEFORMATEXTENSIBLE ext; - wasapiFillWFEXT (&ext,BestToWorst[i],sampleRate,params->channelCount); - - if (*shareMode == AUDCLNT_SHAREMODE_EXCLUSIVE) - hResult = myClient->IsFormatSupported (AUDCLNT_SHAREMODE_EXCLUSIVE, (WAVEFORMATEX*) &ext,NULL); - else - hResult = myClient->IsFormatSupported (AUDCLNT_SHAREMODE_SHARED, (WAVEFORMATEX*) &ext,&sharedClosestMatch); - - if (hResult == S_OK) { - memcpy (outWavex,&ext,sizeof (WAVEFORMATEXTENSIBLE)); - answer = paFormatIsSupported; - break; - } - } - - if (answer!=paFormatIsSupported) { - //try MIX format? - //why did it HAVE to come to this .... - WAVEFORMATEX pcm16WaveFormat; - memset (&pcm16WaveFormat,0,sizeof (WAVEFORMATEX)); - pcm16WaveFormat.wFormatTag = WAVE_FORMAT_PCM; - pcm16WaveFormat.nChannels = 2; - pcm16WaveFormat.nSamplesPerSec = (DWORD) sampleRate; - pcm16WaveFormat.nBlockAlign = 4; - pcm16WaveFormat.nAvgBytesPerSec = pcm16WaveFormat.nSamplesPerSec*pcm16WaveFormat.nBlockAlign; - pcm16WaveFormat.wBitsPerSample = 16; - pcm16WaveFormat.cbSize = 0; - - if (*shareMode == AUDCLNT_SHAREMODE_EXCLUSIVE) - hResult = myClient->IsFormatSupported (AUDCLNT_SHAREMODE_EXCLUSIVE, (WAVEFORMATEX*) &pcm16WaveFormat,NULL); - else - hResult = myClient->IsFormatSupported (AUDCLNT_SHAREMODE_SHARED, (WAVEFORMATEX*) &pcm16WaveFormat,&sharedClosestMatch); - - if (hResult == S_OK) { - memcpy (outWavex,&pcm16WaveFormat,sizeof (WAVEFORMATEX)); - answer = paFormatIsSupported; - } - } - - logAUDCLNT_E (hResult); - } - - return answer; + //TODO we should try exclusive first and shared after + *shareMode = PORTAUDIO_SHAREMODE; + + PaError answer = paInvalidSampleRate; + + waveformatFromParams(outWavex,params,sampleRate); + WAVEFORMATEX *sharedClosestMatch=0; + HRESULT hResult=!S_OK; + + if (*shareMode == AUDCLNT_SHAREMODE_EXCLUSIVE) + hResult = myClient->IsFormatSupported(AUDCLNT_SHAREMODE_EXCLUSIVE,&outWavex->Format,NULL); + else + hResult = myClient->IsFormatSupported(AUDCLNT_SHAREMODE_SHARED, &outWavex->Format,&sharedClosestMatch); + + if (hResult == S_OK) + answer = paFormatIsSupported; + else if (sharedClosestMatch){ + WAVEFORMATEXTENSIBLE* ext = (WAVEFORMATEXTENSIBLE*)sharedClosestMatch; + + int closestMatchSR = (int)sharedClosestMatch->nSamplesPerSec; + + if (sharedClosestMatch->wFormatTag == WAVE_FORMAT_EXTENSIBLE) + memcpy(outWavex,sharedClosestMatch,sizeof(WAVEFORMATEXTENSIBLE)); + else + memcpy(outWavex,sharedClosestMatch,sizeof(WAVEFORMATEX)); + + CoTaskMemFree(sharedClosestMatch); + + if ((int)sampleRate == closestMatchSR) + answer = paFormatIsSupported; + else + answer = paInvalidSampleRate; + + }else { + + //it doesnt suggest anything?? ok lets show it the MENU! + + //ok fun time as with pa_win_mme, we know only a refusal of the user-requested + //sampleRate+num Channel is disastrous, as the portaudio buffer processor converts between anything + //so lets only use the number + for (int i=0;i<FORMATTESTS;++i){ + WAVEFORMATEXTENSIBLE ext; + wasapiFillWFEXT(&ext,BestToWorst[i],sampleRate,params->channelCount); + if (*shareMode == AUDCLNT_SHAREMODE_EXCLUSIVE) + hResult = myClient->IsFormatSupported(AUDCLNT_SHAREMODE_EXCLUSIVE,&ext.Format,NULL); + else + hResult = myClient->IsFormatSupported(AUDCLNT_SHAREMODE_SHARED, &ext.Format,&sharedClosestMatch); + + if (hResult == S_OK){ + memcpy(outWavex,&ext,sizeof(WAVEFORMATEXTENSIBLE)); + answer = paFormatIsSupported; + break; + } + } + + if (answer!=paFormatIsSupported) { + //try MIX format? + //why did it HAVE to come to this .... + WAVEFORMATEX pcm16WaveFormat; + memset(&pcm16WaveFormat,0,sizeof(WAVEFORMATEX)); + pcm16WaveFormat.wFormatTag = WAVE_FORMAT_PCM; + pcm16WaveFormat.nChannels = 2; + pcm16WaveFormat.nSamplesPerSec = (DWORD)sampleRate; + pcm16WaveFormat.nBlockAlign = 4; + pcm16WaveFormat.nAvgBytesPerSec = pcm16WaveFormat.nSamplesPerSec*pcm16WaveFormat.nBlockAlign; + pcm16WaveFormat.wBitsPerSample = 16; + pcm16WaveFormat.cbSize = 0; + + if (*shareMode == AUDCLNT_SHAREMODE_EXCLUSIVE) + hResult = myClient->IsFormatSupported(AUDCLNT_SHAREMODE_EXCLUSIVE,&pcm16WaveFormat,NULL); + else + hResult = myClient->IsFormatSupported(AUDCLNT_SHAREMODE_SHARED, &pcm16WaveFormat,&sharedClosestMatch); + + if (hResult == S_OK){ + memcpy(outWavex,&pcm16WaveFormat,sizeof(WAVEFORMATEX)); + answer = paFormatIsSupported; + } + } + + logAUDCLNT_E(hResult); + } + + return answer; } -static PaError IsFormatSupported (struct PaUtilHostApiRepresentation *hostApi, +static PaError IsFormatSupported( struct PaUtilHostApiRepresentation *hostApi, const PaStreamParameters *inputParameters, const PaStreamParameters *outputParameters, - double sampleRate) + double sampleRate ) { int inputChannelCount, outputChannelCount; PaSampleFormat inputSampleFormat, outputSampleFormat; - if (inputParameters) { + if( inputParameters ) + { inputChannelCount = inputParameters->channelCount; inputSampleFormat = inputParameters->sampleFormat; /* all standard sample formats are supported by the buffer adapter, this implementation doesn't support any custom sample formats */ - - if (inputSampleFormat & paCustomFormat) + if( inputSampleFormat & paCustomFormat ) return paSampleFormatNotSupported; /* unless alternate device specification is supported, reject the use of paUseHostApiSpecificDeviceSpecification */ - if (inputParameters->device == paUseHostApiSpecificDeviceSpecification) + if( inputParameters->device == paUseHostApiSpecificDeviceSpecification ) return paInvalidDevice; /* check that input device can support inputChannelCount */ - if (inputChannelCount > hostApi->deviceInfos[ inputParameters->device ]->maxInputChannels) + if( inputChannelCount > hostApi->deviceInfos[ inputParameters->device ]->maxInputChannels ) return paInvalidChannelCount; /* validate inputStreamInfo */ - if (inputParameters->hostApiSpecificStreamInfo) + if( inputParameters->hostApiSpecificStreamInfo ) return paIncompatibleHostApiSpecificStreamInfo; /* this implementation doesn't use custom stream info */ - PaWinWasapiHostApiRepresentation *paWasapi = (PaWinWasapiHostApiRepresentation*) hostApi; - - - IAudioClient *myClient=0; + PaWinWasapiHostApiRepresentation *paWasapi = (PaWinWasapiHostApiRepresentation*)hostApi; - HRESULT hResult = paWasapi->devInfo[inputParameters->device].device->Activate ( - __uuidof (IAudioClient), CLSCTX_INPROC_SERVER, NULL, (void**) &myClient); - if (hResult != S_OK) { - logAUDCLNT_E (hResult); - return paInvalidDevice; - } + IAudioClient *myClient=0; + HRESULT hResult = paWasapi->devInfo[inputParameters->device].device->Activate( + __uuidof(IAudioClient), CLSCTX_INPROC_SERVER, NULL, (void**)&myClient); + if (hResult != S_OK){ + logAUDCLNT_E(hResult); + return paInvalidDevice; + } WAVEFORMATEXTENSIBLE wavex; + AUDCLNT_SHAREMODE shareMode; + PaError answer = GetClosestFormat(myClient,sampleRate,inputParameters,&shareMode,&wavex); + myClient->Release(); - AUDCLNT_SHAREMODE shareMode; - PaError answer = GetClosestFormat (myClient,sampleRate,inputParameters,&shareMode,&wavex); - myClient->Release(); - - if (answer !=paFormatIsSupported) - return answer; - } else { + if (answer !=paFormatIsSupported) + return answer; + } + else + { inputChannelCount = 0; } - if (outputParameters) { + if( outputParameters ) + { outputChannelCount = outputParameters->channelCount; outputSampleFormat = outputParameters->sampleFormat; /* all standard sample formats are supported by the buffer adapter, this implementation doesn't support any custom sample formats */ - - if (outputSampleFormat & paCustomFormat) + if( outputSampleFormat & paCustomFormat ) return paSampleFormatNotSupported; /* unless alternate device specification is supported, reject the use of paUseHostApiSpecificDeviceSpecification */ - if (outputParameters->device == paUseHostApiSpecificDeviceSpecification) + if( outputParameters->device == paUseHostApiSpecificDeviceSpecification ) return paInvalidDevice; /* check that output device can support outputChannelCount */ - if (outputChannelCount > hostApi->deviceInfos[ outputParameters->device ]->maxOutputChannels) + if( outputChannelCount > hostApi->deviceInfos[ outputParameters->device ]->maxOutputChannels ) return paInvalidChannelCount; /* validate outputStreamInfo */ - if (outputParameters->hostApiSpecificStreamInfo) + if( outputParameters->hostApiSpecificStreamInfo ) return paIncompatibleHostApiSpecificStreamInfo; /* this implementation doesn't use custom stream info */ - PaWinWasapiHostApiRepresentation *paWasapi = (PaWinWasapiHostApiRepresentation*) hostApi; - - IAudioClient *myClient=0; - - HRESULT hResult = paWasapi->devInfo[outputParameters->device].device->Activate ( - __uuidof (IAudioClient), CLSCTX_INPROC_SERVER, NULL, (void**) &myClient); + PaWinWasapiHostApiRepresentation *paWasapi = (PaWinWasapiHostApiRepresentation*)hostApi; - if (hResult != S_OK) { - logAUDCLNT_E (hResult); - return paInvalidDevice; - } + IAudioClient *myClient=0; + HRESULT hResult = paWasapi->devInfo[outputParameters->device].device->Activate( + __uuidof(IAudioClient), CLSCTX_INPROC_SERVER, NULL, (void**)&myClient); + if (hResult != S_OK){ + logAUDCLNT_E(hResult); + return paInvalidDevice; + } WAVEFORMATEXTENSIBLE wavex; + AUDCLNT_SHAREMODE shareMode; + PaError answer = GetClosestFormat(myClient,sampleRate,outputParameters,&shareMode,&wavex); + myClient->Release(); - AUDCLNT_SHAREMODE shareMode; - PaError answer = GetClosestFormat (myClient,sampleRate,outputParameters,&shareMode,&wavex); - myClient->Release(); - - if (answer !=paFormatIsSupported) - return answer; - } else { + if (answer !=paFormatIsSupported) + return answer; + } + else + { outputChannelCount = 0; } @@ -1328,7 +1146,7 @@ static PaError IsFormatSupported (struct PaUtilHostApiRepresentation *hostApi, /* see pa_hostapi.h for a list of validity guarantees made about OpenStream parameters */ -static PaError OpenStream (struct PaUtilHostApiRepresentation *hostApi, +static PaError OpenStream( struct PaUtilHostApiRepresentation *hostApi, PaStream** s, const PaStreamParameters *inputParameters, const PaStreamParameters *outputParameters, @@ -1336,204 +1154,200 @@ static PaError OpenStream (struct PaUtilHostApiRepresentation *hostApi, unsigned long framesPerBuffer, PaStreamFlags streamFlags, PaStreamCallback *streamCallback, - void *userData) + void *userData ) { PaError result = paNoError; - PaWinWasapiHostApiRepresentation *paWasapi = (PaWinWasapiHostApiRepresentation*) hostApi; + PaWinWasapiHostApiRepresentation *paWasapi = (PaWinWasapiHostApiRepresentation*)hostApi; PaWinWasapiStream *stream = 0; int inputChannelCount, outputChannelCount; PaSampleFormat inputSampleFormat, outputSampleFormat; PaSampleFormat hostInputSampleFormat, hostOutputSampleFormat; - stream = (PaWinWasapiStream*) PaUtil_AllocateMemory (sizeof (PaWinWasapiStream)); - - if (!stream) { + stream = (PaWinWasapiStream*)PaUtil_AllocateMemory( sizeof(PaWinWasapiStream) ); + if( !stream ){ result = paInsufficientMemory; goto error; } - if (inputParameters) { + if( inputParameters ) + { inputChannelCount = inputParameters->channelCount; inputSampleFormat = inputParameters->sampleFormat; /* unless alternate device specification is supported, reject the use of paUseHostApiSpecificDeviceSpecification */ - if (inputParameters->device == paUseHostApiSpecificDeviceSpecification) + if( inputParameters->device == paUseHostApiSpecificDeviceSpecification ) return paInvalidDevice; /* check that input device can support inputChannelCount */ - if (inputChannelCount > hostApi->deviceInfos[ inputParameters->device ]->maxInputChannels) + if( inputChannelCount > hostApi->deviceInfos[ inputParameters->device ]->maxInputChannels ) return paInvalidChannelCount; /* validate inputStreamInfo */ - if (inputParameters->hostApiSpecificStreamInfo) + if( inputParameters->hostApiSpecificStreamInfo ) return paIncompatibleHostApiSpecificStreamInfo; /* this implementation doesn't use custom stream info */ PaWinWasapiDeviceInfo &info = paWasapi->devInfo[inputParameters->device]; - HRESULT hResult = info.device->Activate ( - __uuidof (IAudioClient), CLSCTX_INPROC_SERVER, NULL, - (void**) &stream->in.client); + HRESULT hResult = info.device->Activate( + __uuidof(IAudioClient), CLSCTX_INPROC_SERVER, NULL, + (void**)&stream->in.client); if (hResult != S_OK) return paInvalidDevice; - hResult = info.device->Activate ( - __uuidof (IAudioEndpointVolume), CLSCTX_INPROC_SERVER, NULL, - (void**) &stream->inVol); + hResult = info.device->Activate( + __uuidof(IAudioEndpointVolume), CLSCTX_INPROC_SERVER, NULL, + (void**)&stream->inVol); if (hResult != S_OK) return paInvalidDevice; - - AUDCLNT_SHAREMODE shareMode; - - PaError answer = GetClosestFormat (stream->in.client,sampleRate,inputParameters,&shareMode,&stream->in.wavex); - - if (answer !=paFormatIsSupported) - return answer; + + AUDCLNT_SHAREMODE shareMode; + PaError answer = GetClosestFormat(stream->in.client,sampleRate,inputParameters,&shareMode,&stream->in.wavex); + + if (answer !=paFormatIsSupported) + return answer; //stream->out.period = info.DefaultDevicePeriod; stream->in.period = info.MinimumDevicePeriod; - hResult = stream->in.client->Initialize ( - shareMode, - 0, //no flags - stream->in.period, - 0,//stream->out.period, - (WAVEFORMATEX*) &stream->in.wavex, - &stream->session - ); - - if (hResult != S_OK) { - logAUDCLNT_E (hResult); + hResult = stream->in.client->Initialize( + shareMode, + 0, //no flags + stream->in.period, + 0,//stream->out.period, + (WAVEFORMATEX*)&stream->in.wavex, + &stream->session + ); + + if (hResult != S_OK){ + logAUDCLNT_E(hResult); return paInvalidDevice; } - hResult = stream->in.client->GetBufferSize (&stream->in.bufferSize); - + hResult = stream->in.client->GetBufferSize(&stream->in.bufferSize); if (hResult != S_OK) return paInvalidDevice; - hResult = stream->in.client->GetStreamLatency (&stream->in.latency); - + hResult = stream->in.client->GetStreamLatency(&stream->in.latency); if (hResult != S_OK) return paInvalidDevice; - double periodsPerSecond = 1.0/nano100ToSeconds (stream->in.period); - - double samplesPerPeriod = (double) (stream->in.wavex.Format.nSamplesPerSec) /periodsPerSecond; + double periodsPerSecond = 1.0/nano100ToSeconds(stream->in.period); + double samplesPerPeriod = (double)(stream->in.wavex.Format.nSamplesPerSec)/periodsPerSecond; //this is the number of samples that are required at each period - stream->in.framesPerHostCallback = (unsigned long) samplesPerPeriod;//unrelated to channels + stream->in.framesPerHostCallback = (unsigned long)samplesPerPeriod;//unrelated to channels /* IMPLEMENT ME - establish which host formats are available */ hostInputSampleFormat = - PaUtil_SelectClosestAvailableFormat (waveformatToPaFormat (&stream->in.wavex), inputSampleFormat); - } else { + PaUtil_SelectClosestAvailableFormat( waveformatToPaFormat(&stream->in.wavex), inputSampleFormat ); + } + else + { inputChannelCount = 0; inputSampleFormat = hostInputSampleFormat = paInt16; /* Surpress 'uninitialised var' warnings. */ } - if (outputParameters) { + if( outputParameters ) + { outputChannelCount = outputParameters->channelCount; outputSampleFormat = outputParameters->sampleFormat; /* unless alternate device specification is supported, reject the use of paUseHostApiSpecificDeviceSpecification */ - if (outputParameters->device == paUseHostApiSpecificDeviceSpecification) + if( outputParameters->device == paUseHostApiSpecificDeviceSpecification ) return paInvalidDevice; /* check that output device can support inputChannelCount */ - if (outputChannelCount > hostApi->deviceInfos[ outputParameters->device ]->maxOutputChannels) + if( outputChannelCount > hostApi->deviceInfos[ outputParameters->device ]->maxOutputChannels ) return paInvalidChannelCount; /* validate outputStreamInfo */ - if (outputParameters->hostApiSpecificStreamInfo) + if( outputParameters->hostApiSpecificStreamInfo ) return paIncompatibleHostApiSpecificStreamInfo; /* this implementation doesn't use custom stream info */ PaWinWasapiDeviceInfo &info = paWasapi->devInfo[outputParameters->device]; - HRESULT hResult = info.device->Activate ( - __uuidof (IAudioClient), CLSCTX_INPROC_SERVER, NULL, - (void**) &stream->out.client); + HRESULT hResult = info.device->Activate( + __uuidof(IAudioClient), CLSCTX_INPROC_SERVER, NULL, + (void**)&stream->out.client); if (hResult != S_OK) return paInvalidDevice; - AUDCLNT_SHAREMODE shareMode; - - PaError answer = GetClosestFormat (stream->out.client,sampleRate,outputParameters,&shareMode,&stream->out.wavex); - - if (answer !=paFormatIsSupported) - return answer; - - LogWAVEFORMATEXTENSIBLE (&stream->out.wavex); + AUDCLNT_SHAREMODE shareMode; + PaError answer = GetClosestFormat(stream->out.client,sampleRate,outputParameters,&shareMode,&stream->out.wavex); + + if (answer !=paFormatIsSupported) + return answer; + LogWAVEFORMATEXTENSIBLE(&stream->out.wavex); - // stream->out.period = info.DefaultDevicePeriod; + // stream->out.period = info.DefaultDevicePeriod; stream->out.period = info.MinimumDevicePeriod; - /*For an exclusive-mode stream that uses event-driven buffering, - the caller must specify nonzero values for hnsPeriodicity and hnsBufferDuration, - and the values of these two parameters must be equal */ - if (shareMode == AUDCLNT_SHAREMODE_EXCLUSIVE) { - hResult = stream->out.client->Initialize ( - shareMode, - AUDCLNT_STREAMFLAGS_EVENTCALLBACK, - stream->out.period, - stream->out.period, - (WAVEFORMATEX*) &stream->out.wavex, - &stream->session - ); - } else { - hResult = stream->out.client->Initialize ( - shareMode, - AUDCLNT_STREAMFLAGS_EVENTCALLBACK, - 0, - 0, - (WAVEFORMATEX*) &stream->out.wavex, - &stream->session - ); - } - - - if (hResult != S_OK) { - logAUDCLNT_E (hResult); + /*For an exclusive-mode stream that uses event-driven buffering, + the caller must specify nonzero values for hnsPeriodicity and hnsBufferDuration, + and the values of these two parameters must be equal */ + if (shareMode == AUDCLNT_SHAREMODE_EXCLUSIVE){ + hResult = stream->out.client->Initialize( + shareMode, + AUDCLNT_STREAMFLAGS_EVENTCALLBACK, + stream->out.period, + stream->out.period, + (WAVEFORMATEX*)&stream->out.wavex, + &stream->session + ); + } + else{ + hResult = stream->out.client->Initialize( + shareMode, + AUDCLNT_STREAMFLAGS_EVENTCALLBACK, + 0, + 0, + (WAVEFORMATEX*)&stream->out.wavex, + &stream->session + ); + } + + + if (hResult != S_OK){ + logAUDCLNT_E(hResult); return paInvalidDevice; } - hResult = info.device->Activate ( - - __uuidof (IAudioEndpointVolume), CLSCTX_INPROC_SERVER, NULL, - (void**) &stream->outVol); + hResult = info.device->Activate( + __uuidof(IAudioEndpointVolume), CLSCTX_INPROC_SERVER, NULL, + (void**)&stream->outVol); if (hResult != S_OK) return paInvalidDevice; - hResult = stream->out.client->GetBufferSize (&stream->out.bufferSize); - + hResult = stream->out.client->GetBufferSize(&stream->out.bufferSize); if (hResult != S_OK) return paInvalidDevice; - hResult = stream->out.client->GetStreamLatency (&stream->out.latency); - + hResult = stream->out.client->GetStreamLatency(&stream->out.latency); if (hResult != S_OK) return paInvalidDevice; - - double periodsPerSecond = 1.0/nano100ToSeconds (stream->out.period); - - double samplesPerPeriod = (double) (stream->out.wavex.Format.nSamplesPerSec) /periodsPerSecond; + + double periodsPerSecond = 1.0/nano100ToSeconds(stream->out.period); + double samplesPerPeriod = (double)(stream->out.wavex.Format.nSamplesPerSec)/periodsPerSecond; //this is the number of samples that are required at each period stream->out.framesPerHostCallback = stream->out.bufferSize; //(unsigned long)samplesPerPeriod;//unrelated to channels /* IMPLEMENT ME - establish which host formats are available */ - hostOutputSampleFormat = PaUtil_SelectClosestAvailableFormat (waveformatToPaFormat (&stream->out.wavex), outputSampleFormat); - } else { + hostOutputSampleFormat = PaUtil_SelectClosestAvailableFormat( waveformatToPaFormat(&stream->out.wavex), outputSampleFormat ); + } + else + { outputChannelCount = 0; outputSampleFormat = hostOutputSampleFormat = paInt16; /* Surpress 'uninitialized var' warnings. */ } @@ -1567,55 +1381,56 @@ static PaError OpenStream (struct PaUtilHostApiRepresentation *hostApi, /* validate platform specific flags */ - if ( (streamFlags & paPlatformSpecificFlags) != 0) + if( (streamFlags & paPlatformSpecificFlags) != 0 ) return paInvalidFlag; /* unexpected platform specific flag */ - if (streamCallback) { - PaUtil_InitializeStreamRepresentation (&stream->streamRepresentation, - &paWasapi->callbackStreamInterface, streamCallback, userData); - } else { - PaUtil_InitializeStreamRepresentation (&stream->streamRepresentation, - &paWasapi->blockingStreamInterface, streamCallback, userData); + if( streamCallback ) + { + PaUtil_InitializeStreamRepresentation( &stream->streamRepresentation, + &paWasapi->callbackStreamInterface, streamCallback, userData ); + } + else + { + PaUtil_InitializeStreamRepresentation( &stream->streamRepresentation, + &paWasapi->blockingStreamInterface, streamCallback, userData ); } - PaUtil_InitializeCpuLoadMeasurer (&stream->cpuLoadMeasurer, sampleRate); + PaUtil_InitializeCpuLoadMeasurer( &stream->cpuLoadMeasurer, sampleRate ); - if (outputParameters && inputParameters) { + if (outputParameters && inputParameters){ - //serious problem #1 - if (stream->in.period != stream->out.period) { - PRINT ( ("OpenStream: period discrepancy\n")); - goto error; - } + //serious problem #1 + if (stream->in.period != stream->out.period){ + PRINT(("OpenStream: period discrepancy\n")); + goto error; + } - //serious problem #2 - if (stream->out.framesPerHostCallback != stream->in.framesPerHostCallback) { - PRINT ( ("OpenStream: framesPerHostCallback discrepancy\n")); - goto error; - } - } + //serious problem #2 + if (stream->out.framesPerHostCallback != stream->in.framesPerHostCallback){ + PRINT(("OpenStream: framesPerHostCallback discrepancy\n")); + goto error; + } + } - unsigned long framesPerHostCallback = (outputParameters) ? - - stream->out.framesPerHostCallback: - stream->in.framesPerHostCallback; + unsigned long framesPerHostCallback = (outputParameters)? + stream->out.framesPerHostCallback: + stream->in.framesPerHostCallback; /* we assume a fixed host buffer size in this example, but the buffer processor can also support bounded and unknown host buffer sizes by passing paUtilBoundedHostBufferSize or paUtilUnknownHostBufferSize instead of paUtilFixedHostBufferSize below. */ - result = PaUtil_InitializeBufferProcessor (&stream->bufferProcessor, + result = PaUtil_InitializeBufferProcessor( &stream->bufferProcessor, inputChannelCount, inputSampleFormat, hostInputSampleFormat, outputChannelCount, outputSampleFormat, hostOutputSampleFormat, sampleRate, streamFlags, framesPerBuffer, framesPerHostCallback, paUtilFixedHostBufferSize, - streamCallback, userData); - - if (result != paNoError) + streamCallback, userData ); + if( result != paNoError ) goto error; @@ -1624,24 +1439,24 @@ static PaError OpenStream (struct PaUtilHostApiRepresentation *hostApi, values. */ stream->streamRepresentation.streamInfo.inputLatency = - PaUtil_GetBufferProcessorInputLatency (&stream->bufferProcessor) - + ( (inputParameters) ?nano100ToSeconds (stream->in.latency) :0); + PaUtil_GetBufferProcessorInputLatency(&stream->bufferProcessor) + + ((inputParameters)?nano100ToSeconds(stream->in.latency) :0); stream->streamRepresentation.streamInfo.outputLatency = - PaUtil_GetBufferProcessorOutputLatency (&stream->bufferProcessor) - + ( (outputParameters) ?nano100ToSeconds (stream->out.latency) :0); + PaUtil_GetBufferProcessorOutputLatency(&stream->bufferProcessor) + + ((outputParameters)?nano100ToSeconds(stream->out.latency) :0); stream->streamRepresentation.streamInfo.sampleRate = sampleRate; - *s = (PaStream*) stream; + *s = (PaStream*)stream; return result; error: - if (stream) - PaUtil_FreeMemory (stream); + if( stream ) + PaUtil_FreeMemory( stream ); return result; } @@ -1657,68 +1472,60 @@ error: if ((punk) != NULL) \ { (punk)->Release(); (punk) = NULL; } -static PaError CloseStream (PaStream* s) +static PaError CloseStream( PaStream* s ) { PaError result = paNoError; - PaWinWasapiStream *stream = (PaWinWasapiStream*) s; + PaWinWasapiStream *stream = (PaWinWasapiStream*)s; /* IMPLEMENT ME: - additional stream closing + cleanup */ - SAFE_RELEASE (stream->out.client); - SAFE_RELEASE (stream->in.client); - SAFE_RELEASE (stream->cclient); - SAFE_RELEASE (stream->rclient); - SAFE_RELEASE (stream->inVol); - SAFE_RELEASE (stream->outVol); - CloseHandle (stream->hThread); - CloseHandle (stream->hNotificationEvent); + SAFE_RELEASE(stream->out.client); + SAFE_RELEASE(stream->in.client); + SAFE_RELEASE(stream->cclient); + SAFE_RELEASE(stream->rclient); + SAFE_RELEASE(stream->inVol); + SAFE_RELEASE(stream->outVol); + CloseHandle(stream->hThread); + CloseHandle(stream->hNotificationEvent); - PaUtil_TerminateBufferProcessor (&stream->bufferProcessor); - PaUtil_TerminateStreamRepresentation (&stream->streamRepresentation); - PaUtil_FreeMemory (stream); + PaUtil_TerminateBufferProcessor( &stream->bufferProcessor ); + PaUtil_TerminateStreamRepresentation( &stream->streamRepresentation ); + PaUtil_FreeMemory( stream ); return result; } -DWORD WINAPI ProcThread (void *client); +DWORD WINAPI ProcThread(void *client); -static PaError StartStream (PaStream *s) +static PaError StartStream( PaStream *s ) { PaError result = paNoError; - PaWinWasapiStream *stream = (PaWinWasapiStream*) s; - - PaUtil_ResetBufferProcessor (&stream->bufferProcessor); - - HRESULT hResult=S_OK; - - if (stream->out.client) { - hResult = stream->out.client->GetService (__uuidof (IAudioRenderClient), (void**) &stream->rclient); - logAUDCLNT_E (hResult); - - if (hResult!=S_OK) - return paUnanticipatedHostError; - } - - if (stream->in.client) { - hResult = stream->in.client->GetService (__uuidof (IAudioCaptureClient), (void**) &stream->cclient); - logAUDCLNT_E (hResult); - - if (hResult!=S_OK) - return paUnanticipatedHostError; - } + PaWinWasapiStream *stream = (PaWinWasapiStream*)s; + + PaUtil_ResetBufferProcessor( &stream->bufferProcessor ); + + HRESULT hResult=S_OK; + + if (stream->out.client){ + hResult = stream->out.client->GetService(__uuidof(IAudioRenderClient),(void**)&stream->rclient); + logAUDCLNT_E(hResult); + if (hResult!=S_OK) + return paUnanticipatedHostError; + } + + if (stream->in.client){ + hResult = stream->in.client->GetService(__uuidof(IAudioCaptureClient),(void**)&stream->cclient); + logAUDCLNT_E(hResult); + if (hResult!=S_OK) + return paUnanticipatedHostError; + } // Create a thread for this client. - stream->hThread = CreateThread ( - NULL, // no security attribute - 0, // default stack size - ProcThread, - (LPVOID) stream, // thread parameter - 0, // not suspended - &stream->dwThreadId); // returns thread ID - + stream->hThread = CREATE_THREAD; + if (stream->hThread == NULL) return paUnanticipatedHostError; @@ -1726,17 +1533,16 @@ static PaError StartStream (PaStream *s) } -static PaError StopStream (PaStream *s) +static PaError StopStream( PaStream *s ) { PaError result = paNoError; - PaWinWasapiStream *stream = (PaWinWasapiStream*) s; + PaWinWasapiStream *stream = (PaWinWasapiStream*)s; /* suppress unused variable warnings */ stream->closeRequest = true; //todo something MUCH better than this - - while (stream->closeRequest) - Sleep (100); + while(stream->closeRequest) + Sleep(100); /* IMPLEMENT ME, see portaudio.h for required behavior */ @@ -1746,17 +1552,16 @@ static PaError StopStream (PaStream *s) } -static PaError AbortStream (PaStream *s) +static PaError AbortStream( PaStream *s ) { PaError result = paNoError; - PaWinWasapiStream *stream = (PaWinWasapiStream*) s; + PaWinWasapiStream *stream = (PaWinWasapiStream*)s; /* suppress unused variable warnings */ stream->closeRequest = true; //todo something MUCH better than this - - while (stream->closeRequest) - Sleep (100); + while(stream->closeRequest) + Sleep(100); /* IMPLEMENT ME, see portaudio.h for required behavior */ @@ -1764,42 +1569,42 @@ static PaError AbortStream (PaStream *s) } -static PaError IsStreamStopped (PaStream *s) +static PaError IsStreamStopped( PaStream *s ) { - PaWinWasapiStream *stream = (PaWinWasapiStream*) s; + PaWinWasapiStream *stream = (PaWinWasapiStream*)s; return !stream->running; } -static PaError IsStreamActive (PaStream *s) +static PaError IsStreamActive( PaStream *s ) { - PaWinWasapiStream *stream = (PaWinWasapiStream*) s; + PaWinWasapiStream *stream = (PaWinWasapiStream*)s; return stream->running; } -static PaTime GetStreamTime (PaStream *s) +static PaTime GetStreamTime( PaStream *s ) { - PaWinWasapiStream *stream = (PaWinWasapiStream*) s; + PaWinWasapiStream *stream = (PaWinWasapiStream*)s; /* suppress unused variable warnings */ (void) stream; /* IMPLEMENT ME, see portaudio.h for required behavior*/ - //this is lame ds and mme does the same thing, quite useless method imho - //why dont we fetch the time in the pa callbacks? - //at least its doing to be clocked to something + //this is lame ds and mme does the same thing, quite useless method imho + //why dont we fetch the time in the pa callbacks? + //at least its doing to be clocked to something return PaUtil_GetTime(); } -static double GetStreamCpuLoad (PaStream* s) +static double GetStreamCpuLoad( PaStream* s ) { - PaWinWasapiStream *stream = (PaWinWasapiStream*) s; + PaWinWasapiStream *stream = (PaWinWasapiStream*)s; - return PaUtil_GetCpuLoad (&stream->cpuLoadMeasurer); + return PaUtil_GetCpuLoad( &stream->cpuLoadMeasurer ); } @@ -1809,11 +1614,11 @@ static double GetStreamCpuLoad (PaStream* s) for blocking streams. */ -static PaError ReadStream (PaStream* s, +static PaError ReadStream( PaStream* s, void *buffer, - unsigned long frames) + unsigned long frames ) { - PaWinWasapiStream *stream = (PaWinWasapiStream*) s; + PaWinWasapiStream *stream = (PaWinWasapiStream*)s; /* suppress unused variable warnings */ (void) buffer; @@ -1826,11 +1631,11 @@ static PaError ReadStream (PaStream* s, } -static PaError WriteStream (PaStream* s, +static PaError WriteStream( PaStream* s, const void *buffer, - unsigned long frames) + unsigned long frames ) { - PaWinWasapiStream *stream = (PaWinWasapiStream*) s; + PaWinWasapiStream *stream = (PaWinWasapiStream*)s; /* suppress unused variable warnings */ (void) buffer; @@ -1843,9 +1648,9 @@ static PaError WriteStream (PaStream* s, } -static signed long GetStreamReadAvailable (PaStream* s) +static signed long GetStreamReadAvailable( PaStream* s ) { - PaWinWasapiStream *stream = (PaWinWasapiStream*) s; + PaWinWasapiStream *stream = (PaWinWasapiStream*)s; /* suppress unused variable warnings */ (void) stream; @@ -1856,9 +1661,9 @@ static signed long GetStreamReadAvailable (PaStream* s) } -static signed long GetStreamWriteAvailable (PaStream* s) +static signed long GetStreamWriteAvailable( PaStream* s ) { - PaWinWasapiStream *stream = (PaWinWasapiStream*) s; + PaWinWasapiStream *stream = (PaWinWasapiStream*)s; /* suppress unused variable warnings */ (void) stream; @@ -1875,16 +1680,16 @@ static signed long GetStreamWriteAvailable (PaStream* s) occur in a host implementation. */ -static void WaspiHostProcessingLoop (void *inputBuffer, long inputFrames, +static void WaspiHostProcessingLoop( void *inputBuffer, long inputFrames, void *outputBuffer, long outputFrames, - void *userData) + void *userData ) { - PaWinWasapiStream *stream = (PaWinWasapiStream*) userData; + PaWinWasapiStream *stream = (PaWinWasapiStream*)userData; PaStreamCallbackTimeInfo timeInfo = {0,0,0}; /* IMPLEMENT ME */ int callbackResult; unsigned long framesProcessed; - PaUtil_BeginCpuLoadMeasurement (&stream->cpuLoadMeasurer); + PaUtil_BeginCpuLoadMeasurement( &stream->cpuLoadMeasurer ); /* @@ -1900,7 +1705,7 @@ static void WaspiHostProcessingLoop (void *inputBuffer, long inputFrames, - PaUtil_BeginBufferProcessing (&stream->bufferProcessor, &timeInfo, 0 /* IMPLEMENT ME: pass underflow/overflow flags when necessary */); + PaUtil_BeginBufferProcessing( &stream->bufferProcessor, &timeInfo, 0 /* IMPLEMENT ME: pass underflow/overflow flags when necessary */ ); /* depending on whether the host buffers are interleaved, non-interleaved @@ -1908,20 +1713,22 @@ static void WaspiHostProcessingLoop (void *inputBuffer, long inputFrames, PaUtil_SetNonInterleaved*Channel() or PaUtil_Set*Channel() here. */ - if (stream->bufferProcessor.inputChannelCount > 0) { - PaUtil_SetInputFrameCount (&stream->bufferProcessor, inputFrames); - PaUtil_SetInterleavedInputChannels (&stream->bufferProcessor, - 0, /* first channel of inputBuffer is channel 0 */ - inputBuffer, - 0); /* 0 - use inputChannelCount passed to init buffer processor */ + if( stream->bufferProcessor.inputChannelCount > 0 ) + { + PaUtil_SetInputFrameCount( &stream->bufferProcessor, inputFrames ); + PaUtil_SetInterleavedInputChannels( &stream->bufferProcessor, + 0, /* first channel of inputBuffer is channel 0 */ + inputBuffer, + 0 ); /* 0 - use inputChannelCount passed to init buffer processor */ } - if (stream->bufferProcessor.outputChannelCount > 0) { - PaUtil_SetOutputFrameCount (&stream->bufferProcessor, outputFrames); - PaUtil_SetInterleavedOutputChannels (&stream->bufferProcessor, - 0, /* first channel of outputBuffer is channel 0 */ - outputBuffer, - 0); /* 0 - use outputChannelCount passed to init buffer processor */ + if( stream->bufferProcessor.outputChannelCount > 0 ) + { + PaUtil_SetOutputFrameCount( &stream->bufferProcessor, outputFrames); + PaUtil_SetInterleavedOutputChannels( &stream->bufferProcessor, + 0, /* first channel of outputBuffer is channel 0 */ + outputBuffer, + 0 ); /* 0 - use outputChannelCount passed to init buffer processor */ } /* you must pass a valid value of callback result to PaUtil_EndBufferProcessing() @@ -1931,8 +1738,7 @@ static void WaspiHostProcessingLoop (void *inputBuffer, long inputFrames, using PaUtil_IsBufferProcessorOuputEmpty( bufferProcessor ) */ callbackResult = paContinue; - - framesProcessed = PaUtil_EndBufferProcessing (&stream->bufferProcessor, &callbackResult); + framesProcessed = PaUtil_EndBufferProcessing( &stream->bufferProcessor, &callbackResult ); /* @@ -1940,147 +1746,134 @@ static void WaspiHostProcessingLoop (void *inputBuffer, long inputFrames, host format, do it here. */ - PaUtil_EndCpuLoadMeasurement (&stream->cpuLoadMeasurer, framesProcessed); + PaUtil_EndCpuLoadMeasurement( &stream->cpuLoadMeasurer, framesProcessed ); - if (callbackResult == paContinue) { + if( callbackResult == paContinue ) + { /* nothing special to do */ - } else if (callbackResult == paAbort) { + } + else if( callbackResult == paAbort ) + { /* IMPLEMENT ME - finish playback immediately */ /* once finished, call the finished callback */ - if (stream->streamRepresentation.streamFinishedCallback != 0) - stream->streamRepresentation.streamFinishedCallback (stream->streamRepresentation.userData); - } else { + if( stream->streamRepresentation.streamFinishedCallback != 0 ) + stream->streamRepresentation.streamFinishedCallback( stream->streamRepresentation.userData ); + } + else + { /* User callback has asked us to stop with paComplete or other non-zero value */ /* IMPLEMENT ME - finish playback once currently queued audio has completed */ /* once finished, call the finished callback */ - if (stream->streamRepresentation.streamFinishedCallback != 0) - stream->streamRepresentation.streamFinishedCallback (stream->streamRepresentation.userData); + if( stream->streamRepresentation.streamFinishedCallback != 0 ) + stream->streamRepresentation.streamFinishedCallback( stream->streamRepresentation.userData ); } } -void -MMCSS_activate() -{ +void +MMCSS_activate(){ DWORD stuff=0; - HANDLE thCarac = pAvSetMmThreadCharacteristics ("Pro Audio",&stuff); - - if (!thCarac) { - PRINT ( ("AvSetMmThreadCharacteristics failed!\n")); + HANDLE thCarac = pAvSetMmThreadCharacteristics("Pro Audio",&stuff); + if (!thCarac){ + PRINT(("AvSetMmThreadCharacteristics failed!\n")); } - BOOL prio = pAvSetMmThreadPriority (thCarac,AVRT_PRIORITY_NORMAL); - - if (!prio) { - PRINT ( ("AvSetMmThreadPriority failed!\n")); + BOOL prio = pAvSetMmThreadPriority(thCarac,AVRT_PRIORITY_NORMAL); + if (!prio){ + PRINT(("AvSetMmThreadPriority failed!\n")); } - //debug + //debug { HANDLE hh = GetCurrentThread(); - int currprio = GetThreadPriority (hh); - DWORD currclass = GetPriorityClass (GetCurrentProcess()); - PRINT ( ("currprio 0x%X currclass 0x%X\n",currprio,currclass)); + int currprio = GetThreadPriority(hh); + DWORD currclass = GetPriorityClass(GetCurrentProcess()); + PRINT(("currprio 0x%X currclass 0x%X\n",currprio,currclass)); } } DWORD WINAPI -ProcThread (void* param) -{ - HRESULT hResult; - MMCSS_activate(); - - PaWinWasapiStream *stream = (PaWinWasapiStream*) param; - - stream->hNotificationEvent = CreateEvent (NULL, - FALSE, //bManualReset are we sure?? - FALSE, - "PAWASA"); - hResult = stream->out.client->SetEventHandle (stream->hNotificationEvent); - - if (hResult != S_OK) - logAUDCLNT_E (hResult); - - if (stream->out.client) { - hResult = stream->out.client->Start(); - - if (hResult != S_OK) - logAUDCLNT_E (hResult); - } - - stream->running = true; - - bool bOne = false; - - while (!stream->closeRequest) { - //lets wait but have a 1 second timeout - DWORD dwResult = WaitForSingleObject (stream->hNotificationEvent, 1000); - - switch (dwResult) { - - case WAIT_OBJECT_0: { - - unsigned long usingBS = stream->out.framesPerHostCallback; - - BYTE* indata = 0; - BYTE* outdata = 0; - - hResult = stream->rclient->GetBuffer (usingBS, &outdata); - - if (hResult != S_OK || !outdata) { - //logAUDCLNT_E(hResult); - //most probably shared mode and hResult=AUDCLNT_E_BUFFER_TOO_LARGE - UINT32 padding = 0; - hResult = stream->out.client->GetCurrentPadding (&padding); - - if (padding == 0) - break; - - usingBS = usingBS-padding; - - if (usingBS == 0) - break;//huh? - - hResult = stream->rclient->GetBuffer (usingBS, &outdata); - - if (hResult != S_OK) //what can we do NOW?? - break; - - //logAUDCLNT_E(hResult); - } - - WaspiHostProcessingLoop (indata, usingBS ,outdata, usingBS, stream); - - hResult = stream->rclient->ReleaseBuffer (usingBS, 0); - - if (hResult != S_OK) - logAUDCLNT_E (hResult); - - /* This was suggested, but in my tests it doesnt seem to improve the - locking behaviour some drivers have running in exclusive mode. - if(!ResetEvent(stream->hNotificationEvent)){ - logAUDCLNT_E(hResult); - } - */ - - } - - break; +ProcThread(void* param){ + HRESULT hResult; + MMCSS_activate(); + + PaWinWasapiStream *stream = (PaWinWasapiStream*)param; + + stream->hNotificationEvent = CreateEvent(NULL, + FALSE, //bManualReset are we sure?? + FALSE, + "PAWASA"); + hResult = stream->out.client->SetEventHandle(stream->hNotificationEvent); + if (hResult != S_OK) + logAUDCLNT_E(hResult); + + if (stream->out.client){ + hResult = stream->out.client->Start(); + if (hResult != S_OK) + logAUDCLNT_E(hResult); + } + + stream->running = true; + bool bOne = false; + + while( !stream->closeRequest ) + { + //lets wait but have a 1 second timeout + DWORD dwResult = WaitForSingleObject(stream->hNotificationEvent, 1000); + switch( dwResult ) { + case WAIT_OBJECT_0: { + + unsigned long usingBS = stream->out.framesPerHostCallback; + + BYTE* indata = 0; + BYTE* outdata = 0; + + hResult = stream->rclient->GetBuffer(usingBS, &outdata); + + if (hResult != S_OK || !outdata) { + //logAUDCLNT_E(hResult); + //most probably shared mode and hResult=AUDCLNT_E_BUFFER_TOO_LARGE + UINT32 padding = 0; + hResult = stream->out.client->GetCurrentPadding(&padding); + if (padding == 0) + break; + usingBS = usingBS-padding; + if (usingBS == 0) + break;//huh? + hResult = stream->rclient->GetBuffer(usingBS, &outdata); + if (hResult != S_OK)//what can we do NOW?? + break; + //logAUDCLNT_E(hResult); + } + + WaspiHostProcessingLoop(indata, usingBS ,outdata, usingBS, stream); + + hResult = stream->rclient->ReleaseBuffer(usingBS, 0); + if (hResult != S_OK) + logAUDCLNT_E(hResult); + + /* This was suggested, but in my tests it doesnt seem to improve the + locking behaviour some drivers have running in exclusive mode. + if(!ResetEvent(stream->hNotificationEvent)){ + logAUDCLNT_E(hResult); + } + */ + + } + break; } } - - stream->out.client->Stop(); - + stream->out.client->Stop(); stream->closeRequest = false; - - return 0; + + return 0; } @@ -2092,42 +1885,28 @@ ProcThread (void* param) #if 0 - -if (bFirst) -{ - float masteur; - hResult = stream->outVol->GetMasterVolumeLevelScalar (&masteur); - - if (hResult != S_OK) - logAUDCLNT_E (hResult); - - float chan1, chan2; - - hResult = stream->outVol->GetChannelVolumeLevelScalar (0, &chan1); - - if (hResult != S_OK) - logAUDCLNT_E (hResult); - - hResult = stream->outVol->GetChannelVolumeLevelScalar (1, &chan2); - - if (hResult != S_OK) - logAUDCLNT_E (hResult); - - BOOL bMute; - - hResult = stream->outVol->GetMute (&bMute); - - if (hResult != S_OK) - logAUDCLNT_E (hResult); - - stream->outVol->SetMasterVolumeLevelScalar (0.5, NULL); - - stream->outVol->SetChannelVolumeLevelScalar (0, 0.5, NULL); - - stream->outVol->SetChannelVolumeLevelScalar (1, 0.5, NULL); - - stream->outVol->SetMute (FALSE, NULL); - - bFirst = false; -} + if(bFirst) { + float masteur; + hResult = stream->outVol->GetMasterVolumeLevelScalar(&masteur); + if (hResult != S_OK) + logAUDCLNT_E(hResult); + float chan1, chan2; + hResult = stream->outVol->GetChannelVolumeLevelScalar(0, &chan1); + if (hResult != S_OK) + logAUDCLNT_E(hResult); + hResult = stream->outVol->GetChannelVolumeLevelScalar(1, &chan2); + if (hResult != S_OK) + logAUDCLNT_E(hResult); + + BOOL bMute; + hResult = stream->outVol->GetMute(&bMute); + if (hResult != S_OK) + logAUDCLNT_E(hResult); + + stream->outVol->SetMasterVolumeLevelScalar(0.5, NULL); + stream->outVol->SetChannelVolumeLevelScalar(0, 0.5, NULL); + stream->outVol->SetChannelVolumeLevelScalar(1, 0.5, NULL); + stream->outVol->SetMute(FALSE, NULL); + bFirst = false; + } #endif \ No newline at end of file diff --git a/sflphone-common/libs/pjproject/third_party/portaudio/src/hostapi/wdmks/pa_win_wdmks.c b/sflphone-common/libs/pjproject/third_party/portaudio/src/hostapi/wdmks/pa_win_wdmks.c index 5dff2865cb10de7bec57808e75d2dc51297dde72..caddfd52d6a2fb673b8794007f5ba9bf2bebcbcb 100644 --- a/sflphone-common/libs/pjproject/third_party/portaudio/src/hostapi/wdmks/pa_win_wdmks.c +++ b/sflphone-common/libs/pjproject/third_party/portaudio/src/hostapi/wdmks/pa_win_wdmks.c @@ -1,5 +1,5 @@ /* - * $Id: pa_win_wdmks.c 1339 2008-02-15 07:50:33Z rossb $ + * $Id: pa_win_wdmks.c 1411 2009-05-14 14:37:37Z rossb $ * PortAudio Windows WDM-KS interface * * Author: Andrew Baldwin @@ -77,7 +77,7 @@ #include <windows.h> #include <winioctl.h> - +#include <process.h> #ifdef __GNUC__ #undef PA_LOGE_ @@ -106,25 +106,31 @@ #define DYNAMIC_GUID(data) DYNAMIC_GUID_THUNK(data) #endif +/* use CreateThread for CYGWIN, _beginthreadex for all others */ +#ifndef __CYGWIN__ +#define CREATE_THREAD (HANDLE)_beginthreadex( 0, 0, ProcessingThreadProc, stream, 0, &stream->processingThreadId ) +#else +#define CREATE_THREAD CreateThread( 0, 0, ProcessingThreadProc, stream, 0, &stream->processingThreadId ) +#endif + +/* use ExitThread for CYGWIN, _endthreadex for all others */ +#ifndef __CYGWIN__ +#define EXIT_THREAD _endthreadex(0) +#else +#define EXIT_THREAD ExitThread(0) +#endif + #ifdef _MSC_VER + #define NOMMIDS #define DYNAMIC_GUID(data) {data} - #define _INC_MMREG #define _NTRTL_ /* Turn off default definition of DEFINE_GUIDEX */ #undef DEFINE_GUID #define DEFINE_GUID(n,data) EXTERN_C const GUID n = {data} #define DEFINE_GUID_THUNK(n,data) DEFINE_GUID(n,data) #define DEFINE_GUIDEX(n) DEFINE_GUID_THUNK(n, STATIC_##n) - #if !defined( DEFINE_WAVEFORMATEX_GUID ) - #define DEFINE_WAVEFORMATEX_GUID(x) (USHORT)(x), 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71 - #endif - #define WAVE_FORMAT_ADPCM 0x0002 - #define WAVE_FORMAT_IEEE_FLOAT 0x0003 - #define WAVE_FORMAT_ALAW 0x0006 - #define WAVE_FORMAT_MULAW 0x0007 - #define WAVE_FORMAT_MPEG 0x0050 - #define WAVE_FORMAT_DRM 0x0009 #endif +#include <mmreg.h> #include <ks.h> #include <ksmedia.h> #include <tchar.h> @@ -2910,11 +2916,26 @@ static DWORD WINAPI ProcessingThread(LPVOID pParam) PaUtil_SetInputChannel(&stream->bufferProcessor,i,((unsigned char*)(stream->packets[inbuf].Header.Data))+(i*stream->inputSampleSize),stream->deviceInputChannels); } } - /* Only call the EndBufferProcessing function is the total input frames == total output frames */ - if((stream->bufferProcessor.hostInputFrameCount[0] + stream->bufferProcessor.hostInputFrameCount[1]) == - (stream->bufferProcessor.hostOutputFrameCount[0] + stream->bufferProcessor.hostOutputFrameCount[1]) ) + + if (stream->recordingPin && stream->playbackPin) /* full duplex */ + { + /* Only call the EndBufferProcessing function when the total input frames == total output frames */ + + if((stream->bufferProcessor.hostInputFrameCount[0] + stream->bufferProcessor.hostInputFrameCount[1]) == + (stream->bufferProcessor.hostOutputFrameCount[0] + stream->bufferProcessor.hostOutputFrameCount[1]) ) + { + framesProcessed = PaUtil_EndBufferProcessing(&stream->bufferProcessor,&cbResult); + } + else + { + framesProcessed = 0; + } + } + else + { framesProcessed = PaUtil_EndBufferProcessing(&stream->bufferProcessor,&cbResult); - else framesProcessed = 0; + } + if( doChannelCopy ) { /* Copy the first output channel to the other channels */ @@ -3010,7 +3031,7 @@ static DWORD WINAPI ProcessingThread(LPVOID pParam) } PA_LOGL_; - ExitThread(0); + EXIT_THREAD; return 0; } @@ -3045,7 +3066,7 @@ static PaError StartStream( PaStream *s ) PA_DEBUG(("Class ret = %d;",ret));*/ stream->streamStarted = 1; - stream->streamThread = CreateThread(NULL, 0, ProcessingThread, stream, 0, &dwID); + stream->streamThread = (HANDLE)_beginthreadex(NULL, 0, ProcessingThread, stream, 0, &dwID); if(stream->streamThread == NULL) { stream->streamStarted = 0; diff --git a/sflphone-common/libs/pjproject/third_party/portaudio/src/hostapi/wmme/pa_win_wmme.c b/sflphone-common/libs/pjproject/third_party/portaudio/src/hostapi/wmme/pa_win_wmme.c index bbb8f8b87d733c9849f86c8dd2838f90bf3a1a9d..2436d8de1fa909ea349f66d51e2ba424b352cb34 100644 --- a/sflphone-common/libs/pjproject/third_party/portaudio/src/hostapi/wmme/pa_win_wmme.c +++ b/sflphone-common/libs/pjproject/third_party/portaudio/src/hostapi/wmme/pa_win_wmme.c @@ -1,5 +1,5 @@ /* - * $Id: pa_win_wmme.c 1340 2008-02-15 08:31:42Z rossb $ + * $Id: pa_win_wmme.c 1432 2009-12-09 01:31:44Z rossb $ * pa_win_wmme.c * Implementation of PortAudio for Windows MultiMedia Extensions (WMME) * @@ -151,7 +151,17 @@ Non-critical stuff for the future: #endif #endif /* PAWIN_USE_WDMKS_DEVICE_INFO */ -#if (defined(UNDER_CE)) +/* use CreateThread for CYGWIN, _beginthreadex for all others */ +#if !defined(__CYGWIN__) && !defined(_WIN32_WCE) +#define CREATE_THREAD (HANDLE)_beginthreadex( 0, 0, ProcessingThreadProc, stream, 0, &stream->processingThreadId ) +#define PA_THREAD_FUNC static unsigned WINAPI +#define PA_THREAD_ID unsigned +#else +#define CREATE_THREAD CreateThread( 0, 0, ProcessingThreadProc, stream, 0, &stream->processingThreadId ) +#define PA_THREAD_FUNC static DWORD WINAPI +#define PA_THREAD_ID DWORD +#endif +#if (defined(_WIN32_WCE)) #pragma comment(lib, "Coredll.lib") #elif (defined(WIN32) && (defined(_MSC_VER) && (_MSC_VER >= 1200))) /* MSC version 6 and above */ #pragma comment(lib, "winmm.lib") @@ -161,7 +171,11 @@ Non-critical stuff for the future: provided in newer platform sdks */ #ifndef DWORD_PTR -#define DWORD_PTR DWORD + #if defined(_WIN64) + #define DWORD_PTR unsigned __int64 + #else + #define DWORD_PTR unsigned long + #endif #endif /************************************************* Constants ********/ @@ -198,6 +212,34 @@ Non-critical stuff for the future: static const char constInputMapperSuffix_[] = " - Input"; static const char constOutputMapperSuffix_[] = " - Output"; +/* +copies TCHAR string to explicit char string +*/ +char *StrTCpyToC(char *to, const TCHAR *from) +{ +#if !defined(_UNICODE) && !defined(UNICODE) + return strcpy(to, from); +#else + int count = wcslen(from); + if (count != 0) + if (WideCharToMultiByte(CP_ACP, 0, from, count, to, count, NULL, NULL) == 0) + return NULL; + return to; +#endif +} + +/* +returns length of TCHAR string +*/ +size_t StrTLen(const TCHAR *str) +{ +#if !defined(_UNICODE) && !defined(UNICODE) + return strlen(str); +#else + return wcslen(str); +#endif +} + /********************************************************************/ typedef struct PaWinMmeStream PaWinMmeStream; /* forward declaration */ @@ -464,6 +506,21 @@ static UINT LocalDeviceIndexToWinMmeDeviceId( PaWinMmeHostApiRepresentation *hos } +static int SampleFormatAndWinWmmeSpecificFlagsToLinearWaveFormatTag( PaSampleFormat sampleFormat, unsigned long winMmeSpecificFlags ) +{ + int waveFormatTag = 0; + + if( winMmeSpecificFlags & paWinMmeWaveFormatDolbyAc3Spdif ) + waveFormatTag = PAWIN_WAVE_FORMAT_DOLBY_AC3_SPDIF; + else if( winMmeSpecificFlags & paWinMmeWaveFormatWmaSpdif ) + waveFormatTag = PAWIN_WAVE_FORMAT_WMA_SPDIF; + else + waveFormatTag = PaWin_SampleFormatToLinearWaveFormatTag( sampleFormat ); + + return waveFormatTag; +} + + static PaError QueryInputWaveFormatEx( int deviceId, WAVEFORMATEX *waveFormatEx ) { MMRESULT mmresult; @@ -518,43 +575,55 @@ static PaError QueryOutputWaveFormatEx( int deviceId, WAVEFORMATEX *waveFormatEx static PaError QueryFormatSupported( PaDeviceInfo *deviceInfo, PaError (*waveFormatExQueryFunction)(int, WAVEFORMATEX*), - int winMmeDeviceId, int channels, double sampleRate ) + int winMmeDeviceId, int channels, double sampleRate, unsigned long winMmeSpecificFlags ) { PaWinMmeDeviceInfo *winMmeDeviceInfo = (PaWinMmeDeviceInfo*)deviceInfo; PaWinWaveFormat waveFormat; + PaSampleFormat sampleFormat; + int waveFormatTag; + + /* @todo at the moment we only query with 16 bit sample format and directout speaker config*/ + + sampleFormat = paInt16; + waveFormatTag = SampleFormatAndWinWmmeSpecificFlagsToLinearWaveFormatTag( sampleFormat, winMmeSpecificFlags ); + + if( waveFormatTag == PaWin_SampleFormatToLinearWaveFormatTag( paInt16 ) ){ - if( sampleRate == 11025.0 - && ( (channels == 1 && (winMmeDeviceInfo->dwFormats & WAVE_FORMAT_1M16)) - || (channels == 2 && (winMmeDeviceInfo->dwFormats & WAVE_FORMAT_1S16)) ) ){ + /* attempt bypass querying the device for linear formats */ - return paNoError; - } + if( sampleRate == 11025.0 + && ( (channels == 1 && (winMmeDeviceInfo->dwFormats & WAVE_FORMAT_1M16)) + || (channels == 2 && (winMmeDeviceInfo->dwFormats & WAVE_FORMAT_1S16)) ) ){ - if( sampleRate == 22050.0 - && ( (channels == 1 && (winMmeDeviceInfo->dwFormats & WAVE_FORMAT_2M16)) - || (channels == 2 && (winMmeDeviceInfo->dwFormats & WAVE_FORMAT_2S16)) ) ){ + return paNoError; + } - return paNoError; - } + if( sampleRate == 22050.0 + && ( (channels == 1 && (winMmeDeviceInfo->dwFormats & WAVE_FORMAT_2M16)) + || (channels == 2 && (winMmeDeviceInfo->dwFormats & WAVE_FORMAT_2S16)) ) ){ - if( sampleRate == 44100.0 - && ( (channels == 1 && (winMmeDeviceInfo->dwFormats & WAVE_FORMAT_4M16)) - || (channels == 2 && (winMmeDeviceInfo->dwFormats & WAVE_FORMAT_4S16)) ) ){ + return paNoError; + } - return paNoError; + if( sampleRate == 44100.0 + && ( (channels == 1 && (winMmeDeviceInfo->dwFormats & WAVE_FORMAT_4M16)) + || (channels == 2 && (winMmeDeviceInfo->dwFormats & WAVE_FORMAT_4S16)) ) ){ + + return paNoError; + } } + /* first, attempt to query the device using WAVEFORMATEXTENSIBLE, if this fails we fall back to WAVEFORMATEX */ - /* @todo at the moment we only query with 16 bit sample format and directout speaker config*/ - PaWin_InitializeWaveFormatExtensible( &waveFormat, channels, - paInt16, sampleRate, PAWIN_SPEAKER_DIRECTOUT ); + PaWin_InitializeWaveFormatExtensible( &waveFormat, channels, sampleFormat, waveFormatTag, + sampleRate, PAWIN_SPEAKER_DIRECTOUT ); if( waveFormatExQueryFunction( winMmeDeviceId, (WAVEFORMATEX*)&waveFormat ) == paNoError ) return paNoError; - PaWin_InitializeWaveFormatEx( &waveFormat, channels, paInt16, sampleRate ); + PaWin_InitializeWaveFormatEx( &waveFormat, channels, sampleFormat, waveFormatTag, sampleRate ); return waveFormatExQueryFunction( winMmeDeviceId, (WAVEFORMATEX*)&waveFormat ); } @@ -576,7 +645,7 @@ static void DetectDefaultSampleRate( PaWinMmeDeviceInfo *winMmeDeviceInfo, int w for( i=0; i < PA_DEFAULTSAMPLERATESEARCHORDER_COUNT_; ++i ) { double sampleRate = defaultSampleRateSearchOrder_[ i ]; - PaError paerror = QueryFormatSupported( deviceInfo, waveFormatExQueryFunction, winMmeDeviceId, maxChannels, sampleRate ); + PaError paerror = QueryFormatSupported( deviceInfo, waveFormatExQueryFunction, winMmeDeviceId, maxChannels, sampleRate, 0 ); if( paerror == paNoError ) { deviceInfo->defaultSampleRate = sampleRate; @@ -651,25 +720,25 @@ static PaError InitializeInputDeviceInfo( PaWinMmeHostApiRepresentation *winMmeH { /* Append I/O suffix to WAVE_MAPPER device. */ deviceName = (char *)PaUtil_GroupAllocateMemory( - winMmeHostApi->allocations, strlen( wic.szPname ) + 1 + sizeof(constInputMapperSuffix_) ); + winMmeHostApi->allocations, StrTLen( wic.szPname ) + 1 + sizeof(constInputMapperSuffix_) ); if( !deviceName ) { result = paInsufficientMemory; goto error; } - strcpy( deviceName, wic.szPname ); + StrTCpyToC( deviceName, wic.szPname ); strcat( deviceName, constInputMapperSuffix_ ); } else { deviceName = (char*)PaUtil_GroupAllocateMemory( - winMmeHostApi->allocations, strlen( wic.szPname ) + 1 ); + winMmeHostApi->allocations, StrTLen( wic.szPname ) + 1 ); if( !deviceName ) { result = paInsufficientMemory; goto error; } - strcpy( deviceName, wic.szPname ); + StrTCpyToC( deviceName, wic.szPname ); } deviceInfo->name = deviceName; @@ -751,6 +820,7 @@ static PaError InitializeOutputDeviceInfo( PaWinMmeHostApiRepresentation *winMme MMRESULT mmresult; WAVEOUTCAPS woc; PaDeviceInfo *deviceInfo = &winMmeDeviceInfo->inheritedDeviceInfo; + int wdmksDeviceOutputChannelCountIsKnown; *success = 0; @@ -774,25 +844,25 @@ static PaError InitializeOutputDeviceInfo( PaWinMmeHostApiRepresentation *winMme { /* Append I/O suffix to WAVE_MAPPER device. */ deviceName = (char *)PaUtil_GroupAllocateMemory( - winMmeHostApi->allocations, strlen( woc.szPname ) + 1 + sizeof(constOutputMapperSuffix_) ); + winMmeHostApi->allocations, StrTLen( woc.szPname ) + 1 + sizeof(constOutputMapperSuffix_) ); if( !deviceName ) { result = paInsufficientMemory; goto error; } - strcpy( deviceName, woc.szPname ); + StrTCpyToC( deviceName, woc.szPname ); strcat( deviceName, constOutputMapperSuffix_ ); } else { deviceName = (char*)PaUtil_GroupAllocateMemory( - winMmeHostApi->allocations, strlen( woc.szPname ) + 1 ); + winMmeHostApi->allocations, StrTLen( woc.szPname ) + 1 ); if( !deviceName ) { result = paInsufficientMemory; goto error; } - strcpy( deviceName, woc.szPname ); + StrTCpyToC( deviceName, woc.szPname ); } deviceInfo->name = deviceName; @@ -816,8 +886,10 @@ static PaError InitializeOutputDeviceInfo( PaWinMmeHostApiRepresentation *winMme } #ifdef PAWIN_USE_WDMKS_DEVICE_INFO - winMmeDeviceInfo->deviceOutputChannelCountIsKnown = - QueryWaveOutKSFilterMaxChannels( winMmeOutputDeviceId, &deviceInfo->maxOutputChannels ); + wdmksDeviceOutputChannelCountIsKnown = QueryWaveOutKSFilterMaxChannels( + winMmeOutputDeviceId, &deviceInfo->maxOutputChannels ); + if( wdmksDeviceOutputChannelCountIsKnown && !winMmeDeviceInfo->deviceOutputChannelCountIsKnown ) + winMmeDeviceInfo->deviceOutputChannelCountIsKnown = 1; #endif /* PAWIN_USE_WDMKS_DEVICE_INFO */ winMmeDeviceInfo->dwFormats = woc.dwFormats; @@ -906,11 +978,11 @@ PaError PaWinMme_Initialize( PaUtilHostApiRepresentation **hostApi, PaHostApiInd /* the following calls assume that if wave*Message fails the preferred device parameter won't be modified */ preferredDeviceStatusFlags = 0; waveInPreferredDevice = -1; - waveInMessage( (HWAVEIN)WAVE_MAPPER, DRVM_MAPPER_PREFERRED_GET, (DWORD)&waveInPreferredDevice, (DWORD)&preferredDeviceStatusFlags ); + waveInMessage( (HWAVEIN)WAVE_MAPPER, DRVM_MAPPER_PREFERRED_GET, (DWORD_PTR)&waveInPreferredDevice, (DWORD_PTR)&preferredDeviceStatusFlags ); preferredDeviceStatusFlags = 0; waveOutPreferredDevice = -1; - waveOutMessage( (HWAVEOUT)WAVE_MAPPER, DRVM_MAPPER_PREFERRED_GET, (DWORD)&waveOutPreferredDevice, (DWORD)&preferredDeviceStatusFlags ); + waveOutMessage( (HWAVEOUT)WAVE_MAPPER, DRVM_MAPPER_PREFERRED_GET, (DWORD_PTR)&waveOutPreferredDevice, (DWORD_PTR)&preferredDeviceStatusFlags ); maximumPossibleDeviceCount = 0; @@ -1170,7 +1242,9 @@ static PaError IsFormatSupported( struct PaUtilHostApiRepresentation *hostApi, /* test for valid sample rate, see comment above */ winMmeInputDeviceId = LocalDeviceIndexToWinMmeDeviceId( winMmeHostApi, inputStreamInfo->devices[i].device ); - paerror = QueryFormatSupported( inputDeviceInfo, QueryInputWaveFormatEx, winMmeInputDeviceId, inputStreamInfo->devices[i].channelCount, sampleRate ); + paerror = QueryFormatSupported( inputDeviceInfo, QueryInputWaveFormatEx, + winMmeInputDeviceId, inputStreamInfo->devices[i].channelCount, sampleRate, + ((inputStreamInfo) ? inputStreamInfo->flags : 0) ); if( paerror != paNoError ) return paInvalidSampleRate; } @@ -1192,7 +1266,9 @@ static PaError IsFormatSupported( struct PaUtilHostApiRepresentation *hostApi, /* test for valid sample rate, see comment above */ winMmeInputDeviceId = LocalDeviceIndexToWinMmeDeviceId( winMmeHostApi, inputParameters->device ); - paerror = QueryFormatSupported( inputDeviceInfo, QueryInputWaveFormatEx, winMmeInputDeviceId, inputChannelCount, sampleRate ); + paerror = QueryFormatSupported( inputDeviceInfo, QueryInputWaveFormatEx, + winMmeInputDeviceId, inputChannelCount, sampleRate, + ((inputStreamInfo) ? inputStreamInfo->flags : 0) ); if( paerror != paNoError ) return paInvalidSampleRate; } @@ -1230,7 +1306,9 @@ static PaError IsFormatSupported( struct PaUtilHostApiRepresentation *hostApi, /* test for valid sample rate, see comment above */ winMmeOutputDeviceId = LocalDeviceIndexToWinMmeDeviceId( winMmeHostApi, outputStreamInfo->devices[i].device ); - paerror = QueryFormatSupported( outputDeviceInfo, QueryOutputWaveFormatEx, winMmeOutputDeviceId, outputStreamInfo->devices[i].channelCount, sampleRate ); + paerror = QueryFormatSupported( outputDeviceInfo, QueryOutputWaveFormatEx, + winMmeOutputDeviceId, outputStreamInfo->devices[i].channelCount, sampleRate, + ((outputStreamInfo) ? outputStreamInfo->flags : 0) ); if( paerror != paNoError ) return paInvalidSampleRate; } @@ -1252,7 +1330,9 @@ static PaError IsFormatSupported( struct PaUtilHostApiRepresentation *hostApi, /* test for valid sample rate, see comment above */ winMmeOutputDeviceId = LocalDeviceIndexToWinMmeDeviceId( winMmeHostApi, outputParameters->device ); - paerror = QueryFormatSupported( outputDeviceInfo, QueryOutputWaveFormatEx, winMmeOutputDeviceId, outputChannelCount, sampleRate ); + paerror = QueryFormatSupported( outputDeviceInfo, QueryOutputWaveFormatEx, + winMmeOutputDeviceId, outputChannelCount, sampleRate, + ((outputStreamInfo) ? outputStreamInfo->flags : 0) ); if( paerror != paNoError ) return paInvalidSampleRate; } @@ -1676,6 +1756,7 @@ typedef struct static void InitializeSingleDirectionHandlesAndBuffers( PaWinMmeSingleDirectionHandlesAndBuffers *handlesAndBuffers ); static PaError InitializeWaveHandles( PaWinMmeHostApiRepresentation *winMmeHostApi, PaWinMmeSingleDirectionHandlesAndBuffers *handlesAndBuffers, + unsigned long winMmeSpecificFlags, unsigned long bytesPerHostSample, double sampleRate, PaWinMmeDeviceAndChannelCount *devices, unsigned int deviceCount, PaWinWaveFormatChannelMask channelMask, int isInput ); @@ -1700,6 +1781,7 @@ static void InitializeSingleDirectionHandlesAndBuffers( PaWinMmeSingleDirectionH static PaError InitializeWaveHandles( PaWinMmeHostApiRepresentation *winMmeHostApi, PaWinMmeSingleDirectionHandlesAndBuffers *handlesAndBuffers, + unsigned long winMmeSpecificFlags, unsigned long bytesPerHostSample, double sampleRate, PaWinMmeDeviceAndChannelCount *devices, unsigned int deviceCount, PaWinWaveFormatChannelMask channelMask, int isInput ) @@ -1707,6 +1789,8 @@ static PaError InitializeWaveHandles( PaWinMmeHostApiRepresentation *winMmeHostA PaError result; MMRESULT mmresult; signed int i, j; + PaSampleFormat sampleFormat; + int waveFormatTag; /* for error cleanup we expect that InitializeSingleDirectionHandlesAndBuffers() has already been called to zero some fields */ @@ -1734,6 +1818,10 @@ static PaError InitializeWaveHandles( PaWinMmeHostApiRepresentation *winMmeHostA ((HWAVEOUT*)handlesAndBuffers->waveHandles)[i] = 0; } + /* @todo at the moment we only use 16 bit sample format */ + sampleFormat = paInt16; + waveFormatTag = SampleFormatAndWinWmmeSpecificFlagsToLinearWaveFormatTag( sampleFormat, winMmeSpecificFlags ); + for( i = 0; i < (signed int)deviceCount; ++i ) { PaWinWaveFormat waveFormat; @@ -1749,16 +1837,16 @@ static PaError InitializeWaveHandles( PaWinMmeHostApiRepresentation *winMmeHostA /* first, attempt to open the device using WAVEFORMATEXTENSIBLE, if this fails we fall back to WAVEFORMATEX */ - /* @todo at the moment we only use 16 bit sample format */ PaWin_InitializeWaveFormatExtensible( &waveFormat, devices[i].channelCount, - paInt16, sampleRate, channelMask ); + sampleFormat, waveFormatTag, sampleRate, channelMask ); } else { /* retry with WAVEFORMATEX */ - PaWin_InitializeWaveFormatEx( &waveFormat, devices[i].channelCount, paInt16, sampleRate ); + PaWin_InitializeWaveFormatEx( &waveFormat, devices[i].channelCount, + sampleFormat, waveFormatTag, sampleRate ); } /* REVIEW: consider not firing an event for input when a full duplex @@ -2042,7 +2130,7 @@ struct PaWinMmeStream /* Processing thread management -------------- */ HANDLE abortEvent; HANDLE processingThread; - DWORD processingThreadId; + PA_THREAD_ID processingThreadId; char throttleProcessingThreadOnOverload; /* 0 -> don't throtte, non-0 -> throttle */ int processingThreadPriority; @@ -2063,6 +2151,7 @@ struct PaWinMmeStream static PaError ValidateWinMmeSpecificStreamInfo( const PaStreamParameters *streamParameters, const PaWinMmeStreamInfo *streamInfo, + unsigned long *winMmeSpecificFlags, char *throttleProcessingThreadOnOverload, unsigned long *deviceCount ) { @@ -2074,6 +2163,8 @@ static PaError ValidateWinMmeSpecificStreamInfo( return paIncompatibleHostApiSpecificStreamInfo; } + *winMmeSpecificFlags = streamInfo->flags; + if( streamInfo->flags & paWinMmeDontThrottleOverloadedProcessingThread ) *throttleProcessingThreadOnOverload = 0; @@ -2217,8 +2308,10 @@ static PaError OpenStream( struct PaUtilHostApiRepresentation *hostApi, unsigned long hostOutputBufferCount; unsigned long framesPerBufferProcessorCall; PaWinMmeDeviceAndChannelCount *inputDevices = 0; /* contains all devices and channel counts as local host api ids, even when PaWinMmeUseMultipleDevices is not used */ + unsigned long winMmeSpecificInputFlags = 0; unsigned long inputDeviceCount = 0; PaWinMmeDeviceAndChannelCount *outputDevices = 0; + unsigned long winMmeSpecificOutputFlags = 0; unsigned long outputDeviceCount = 0; /* contains all devices and channel counts as local host api ids, even when PaWinMmeUseMultipleDevices is not used */ char throttleProcessingThreadOnOverload = 1; @@ -2234,6 +2327,7 @@ static PaError OpenStream( struct PaUtilHostApiRepresentation *hostApi, /* validate input hostApiSpecificStreamInfo */ inputStreamInfo = (PaWinMmeStreamInfo*)inputParameters->hostApiSpecificStreamInfo; result = ValidateWinMmeSpecificStreamInfo( inputParameters, inputStreamInfo, + &winMmeSpecificInputFlags, &throttleProcessingThreadOnOverload, &inputDeviceCount ); if( result != paNoError ) return result; @@ -2283,6 +2377,7 @@ static PaError OpenStream( struct PaUtilHostApiRepresentation *hostApi, /* validate output hostApiSpecificStreamInfo */ outputStreamInfo = (PaWinMmeStreamInfo*)outputParameters->hostApiSpecificStreamInfo; result = ValidateWinMmeSpecificStreamInfo( outputParameters, outputStreamInfo, + &winMmeSpecificOutputFlags, &throttleProcessingThreadOnOverload, &outputDeviceCount ); if( result != paNoError ) return result; @@ -2332,6 +2427,14 @@ static PaError OpenStream( struct PaUtilHostApiRepresentation *hostApi, return paInvalidFlag; /* unexpected platform specific flag */ + /* always disable clipping and dithering if we are outputting a raw spdif stream */ + if( (winMmeSpecificOutputFlags & paWinMmeWaveFormatDolbyAc3Spdif) + || (winMmeSpecificOutputFlags & paWinMmeWaveFormatWmaSpdif) ){ + + streamFlags = streamFlags | paClipOff | paDitherOff; + } + + result = CalculateBufferSettings( &framesPerHostInputBuffer, &hostInputBufferCount, &framesPerHostOutputBuffer, &hostOutputBufferCount, inputChannelCount, hostInputSampleFormat, suggestedInputLatency, inputStreamInfo, @@ -2430,6 +2533,7 @@ static PaError OpenStream( struct PaUtilHostApiRepresentation *hostApi, if( inputParameters ) { result = InitializeWaveHandles( winMmeHostApi, &stream->input, + winMmeSpecificInputFlags, stream->bufferProcessor.bytesPerHostInputSample, sampleRate, inputDevices, inputDeviceCount, inputChannelMask, 1 /* isInput */ ); if( result != paNoError ) goto error; @@ -2438,6 +2542,7 @@ static PaError OpenStream( struct PaUtilHostApiRepresentation *hostApi, if( outputParameters ) { result = InitializeWaveHandles( winMmeHostApi, &stream->output, + winMmeSpecificOutputFlags, stream->bufferProcessor.bytesPerHostOutputSample, sampleRate, outputDevices, outputDeviceCount, outputChannelMask, 0 /* isInput */ ); if( result != paNoError ) goto error; @@ -2691,7 +2796,7 @@ static PaError CatchUpOutputBuffers( PaWinMmeStream *stream ) } -static DWORD WINAPI ProcessingThreadProc( void *pArg ) +PA_THREAD_FUNC ProcessingThreadProc( void *pArg ) { PaWinMmeStream *stream = (PaWinMmeStream *)pArg; HANDLE events[3]; @@ -3244,7 +3349,7 @@ static PaError StartStream( PaStream *s ) if( result != paNoError ) goto error; /* Create thread that waits for audio buffers to be ready for processing. */ - stream->processingThread = CreateThread( 0, 0, ProcessingThreadProc, stream, 0, &stream->processingThreadId ); + stream->processingThread = CREATE_THREAD; if( !stream->processingThread ) { result = paUnanticipatedHostError; diff --git a/sflphone-common/libs/pjproject/third_party/portaudio/src/os/unix/pa_unix_hostapis.c b/sflphone-common/libs/pjproject/third_party/portaudio/src/os/unix/pa_unix_hostapis.c index 8407c3ecd9c6c5b36d6ba263337a8b4e49494fae..339e1b148d242456b32a267a5c63e406f6571ae9 100644 --- a/sflphone-common/libs/pjproject/third_party/portaudio/src/os/unix/pa_unix_hostapis.c +++ b/sflphone-common/libs/pjproject/third_party/portaudio/src/os/unix/pa_unix_hostapis.c @@ -1,5 +1,5 @@ /* - * $Id: pa_unix_hostapis.c 1381 2008-03-30 21:02:09Z aknudsen $ + * $Id: pa_unix_hostapis.c 1413 2009-05-24 17:00:36Z aknudsen $ * Portable Audio I/O Library UNIX initialization table * * Based on the Open Source API proposed by Ross Bencina @@ -52,8 +52,7 @@ PaError PaAsiHpi_Initialize( PaUtilHostApiRepresentation **hostApi, PaHostApiInd PaError PaMacCore_Initialize( PaUtilHostApiRepresentation **hostApi, PaHostApiIndex index ); PaError PaSkeleton_Initialize( PaUtilHostApiRepresentation **hostApi, PaHostApiIndex index ); -/** Note that ALSA is placed before OSS so that the latter is preferred over the - * latter on Linux. +/** Note that on Linux, ALSA is placed before OSS so that the former is preferred over the latter. */ PaUtilHostApiInitializer *paHostApiInitializers[] = @@ -68,7 +67,7 @@ PaUtilHostApiInitializer *paHostApiInitializers[] = PaOSS_Initialize, #endif -#else +#else /* __linux__ */ #ifdef PA_USE_OSS PaOSS_Initialize, diff --git a/sflphone-common/libs/pjproject/third_party/portaudio/src/os/unix/pa_unix_util.c b/sflphone-common/libs/pjproject/third_party/portaudio/src/os/unix/pa_unix_util.c index 1cb838752c13d47748eeed869d42244a4e6c1efa..de54e51ddbd9f5c29bd07d2af0926c767ac7beac 100644 --- a/sflphone-common/libs/pjproject/third_party/portaudio/src/os/unix/pa_unix_util.c +++ b/sflphone-common/libs/pjproject/third_party/portaudio/src/os/unix/pa_unix_util.c @@ -1,5 +1,5 @@ /* - * $Id: pa_unix_util.c 1232 2007-06-16 14:49:43Z rossb $ + * $Id: pa_unix_util.c 1419 2009-10-22 17:28:35Z bjornroche $ * Portable Audio I/O Library * UNIX platform-specific support functions * @@ -51,6 +51,13 @@ #include <math.h> #include <errno.h> +#if defined(__APPLE__) && !defined(HAVE_MACH_ABSOLUTE_TIME) +#define HAVE_MACH_ABSOLUTE_TIME +#endif +#ifdef HAVE_MACH_ABSOLUTE_TIME +#include <mach/mach_time.h> +#endif + #include "pa_util.h" #include "pa_unix_util.h" #include "pa_debugprint.h" @@ -118,27 +125,47 @@ void Pa_Sleep( long msec ) #endif } -/* *** NOT USED YET: *** -static int usePerformanceCounter_; -static double microsecondsPerTick_; +#ifdef HAVE_MACH_ABSOLUTE_TIME +/* + Discussion on the CoreAudio mailing list suggests that calling + gettimeofday (or anything else in the BSD layer) is not real-time + safe, so we use mach_absolute_time on OSX. This implementation is + based on these two links: + + Technical Q&A QA1398 - Mach Absolute Time Units + http://developer.apple.com/mac/library/qa/qa2004/qa1398.html + + Tutorial: Performance and Time. + http://www.macresearch.org/tutorial_performance_and_time */ +/* Scaler to convert the result of mach_absolute_time to seconds */ +static double machSecondsConversionScaler_ = 0.0; +#endif + void PaUtil_InitializeClock( void ) { - /* TODO */ +#ifdef HAVE_MACH_ABSOLUTE_TIME + mach_timebase_info_data_t info; + kern_return_t err = mach_timebase_info( &info ); + if( err == 0 ) + machSecondsConversionScaler_ = 1e-9 * (double) info.numer / (double) info.denom; +#endif } PaTime PaUtil_GetTime( void ) { -#ifdef HAVE_CLOCK_GETTIME +#ifdef HAVE_MACH_ABSOLUTE_TIME + return mach_absolute_time() * machSecondsConversionScaler_; +#elif defined(HAVE_CLOCK_GETTIME) struct timespec tp; clock_gettime(CLOCK_REALTIME, &tp); - return (PaTime)(tp.tv_sec + tp.tv_nsec / 1.e9); + return (PaTime)(tp.tv_sec + tp.tv_nsec * 1e-9); #else struct timeval tv; gettimeofday( &tv, NULL ); - return (PaTime) tv.tv_usec / 1000000. + tv.tv_sec; + return (PaTime) tv.tv_usec * 1e-6 + tv.tv_sec; #endif } @@ -190,7 +217,7 @@ PaError PaUtil_CancelThreading( PaUtilThreading *threading, int wait, PaError *e /* paUnixMainThread * We have to be a bit careful with defining this global variable, * as explained below. */ -#ifdef __apple__ +#ifdef __APPLE__ /* apple/gcc has a "problem" with global vars and dynamic libs. Initializing it seems to fix the problem. Described a bit in this thread: diff --git a/sflphone-common/libs/pjproject/third_party/portaudio/src/os/win/pa_win_util.c b/sflphone-common/libs/pjproject/third_party/portaudio/src/os/win/pa_win_util.c index e882886c9f88e58fa6effa1fd540316bd6e489a5..1354b9ab23d8672e8cbd16fd2c7369913b45ee43 100644 --- a/sflphone-common/libs/pjproject/third_party/portaudio/src/os/win/pa_win_util.c +++ b/sflphone-common/libs/pjproject/third_party/portaudio/src/os/win/pa_win_util.c @@ -1,5 +1,5 @@ /* - * $Id: pa_win_util.c 1339 2008-02-15 07:50:33Z rossb $ + * $Id: pa_win_util.c 1410 2009-04-07 10:08:48Z rossb $ * Portable Audio I/O Library * Win32 platform-specific support functions * @@ -51,6 +51,10 @@ #include "pa_util.h" +#if (defined(WIN32) && (defined(_MSC_VER) && (_MSC_VER >= 1200))) /* MSC version 6 and above */ +#pragma comment( lib, "winmm.lib" ) +#endif + /* Track memory allocations to avoid leaks. diff --git a/sflphone-common/libs/pjproject/third_party/portaudio/src/os/win/pa_win_waveformat.c b/sflphone-common/libs/pjproject/third_party/portaudio/src/os/win/pa_win_waveformat.c index 6b91ebd98401c021fbc29b1b9e33db87a12f2018..bbf616c3448315d1ffcd516406f80ba277bb4713 100644 --- a/sflphone-common/libs/pjproject/third_party/portaudio/src/os/win/pa_win_waveformat.c +++ b/sflphone-common/libs/pjproject/third_party/portaudio/src/os/win/pa_win_waveformat.c @@ -47,30 +47,27 @@ #define WAVE_FORMAT_EXTENSIBLE 0xFFFE #endif -#if !defined(WAVE_FORMAT_IEEE_FLOAT) -#define WAVE_FORMAT_IEEE_FLOAT 0x0003 -#endif - -static GUID pawin_ksDataFormatSubtypePcm = +static GUID pawin_ksDataFormatSubtypeGuidBase = { (USHORT)(WAVE_FORMAT_PCM), 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71 }; -static GUID pawin_ksDataFormatSubtypeIeeeFloat = - { (USHORT)(WAVE_FORMAT_IEEE_FLOAT), 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71 }; +int PaWin_SampleFormatToLinearWaveFormatTag( PaSampleFormat sampleFormat ) +{ + if( sampleFormat == paFloat32 ) + return PAWIN_WAVE_FORMAT_IEEE_FLOAT; + + return PAWIN_WAVE_FORMAT_PCM; +} void PaWin_InitializeWaveFormatEx( PaWinWaveFormat *waveFormat, - int numChannels, PaSampleFormat sampleFormat, double sampleRate ) + int numChannels, PaSampleFormat sampleFormat, int waveFormatTag, double sampleRate ) { WAVEFORMATEX *waveFormatEx = (WAVEFORMATEX*)waveFormat; int bytesPerSample = Pa_GetSampleSize(sampleFormat); unsigned long bytesPerFrame = numChannels * bytesPerSample; - - if( sampleFormat == paFloat32 ) - waveFormatEx->wFormatTag = WAVE_FORMAT_IEEE_FLOAT; - else - waveFormatEx->wFormatTag = WAVE_FORMAT_PCM; + waveFormatEx->wFormatTag = waveFormatTag; waveFormatEx->nChannels = (WORD)numChannels; waveFormatEx->nSamplesPerSec = (DWORD)sampleRate; waveFormatEx->nAvgBytesPerSec = waveFormatEx->nSamplesPerSec * bytesPerFrame; @@ -81,12 +78,13 @@ void PaWin_InitializeWaveFormatEx( PaWinWaveFormat *waveFormat, void PaWin_InitializeWaveFormatExtensible( PaWinWaveFormat *waveFormat, - int numChannels, PaSampleFormat sampleFormat, double sampleRate, + int numChannels, PaSampleFormat sampleFormat, int waveFormatTag, double sampleRate, PaWinWaveFormatChannelMask channelMask ) { WAVEFORMATEX *waveFormatEx = (WAVEFORMATEX*)waveFormat; int bytesPerSample = Pa_GetSampleSize(sampleFormat); unsigned long bytesPerFrame = numChannels * bytesPerSample; + GUID guid; waveFormatEx->wFormatTag = WAVE_FORMAT_EXTENSIBLE; waveFormatEx->nChannels = (WORD)numChannels; @@ -100,13 +98,10 @@ void PaWin_InitializeWaveFormatExtensible( PaWinWaveFormat *waveFormat, waveFormatEx->wBitsPerSample; *((DWORD*)&waveFormat->fields[PAWIN_INDEXOF_DWCHANNELMASK]) = channelMask; - - if( sampleFormat == paFloat32 ) - *((GUID*)&waveFormat->fields[PAWIN_INDEXOF_SUBFORMAT]) = - pawin_ksDataFormatSubtypeIeeeFloat; - else - *((GUID*)&waveFormat->fields[PAWIN_INDEXOF_SUBFORMAT]) = - pawin_ksDataFormatSubtypePcm; + + guid = pawin_ksDataFormatSubtypeGuidBase; + guid.Data1 = (USHORT)waveFormatTag; + *((GUID*)&waveFormat->fields[PAWIN_INDEXOF_SUBFORMAT]) = guid; }