From: <sb...@us...> - 2007-09-13 17:52:05
|
Revision: 1134 http://iaxclient.svn.sourceforge.net/iaxclient/?rev=1134&view=rev Author: sbalea Date: 2007-09-13 10:52:06 -0700 (Thu, 13 Sep 2007) Log Message: ----------- Merge latest changes from trunk Modified Paths: -------------- branches/team/mihai/echocan/configure.ac branches/team/mihai/echocan/lib/Makefile.am branches/team/mihai/echocan/lib/iaxclient_lib.c Modified: branches/team/mihai/echocan/configure.ac =================================================================== --- branches/team/mihai/echocan/configure.ac 2007-09-13 13:50:59 UTC (rev 1133) +++ branches/team/mihai/echocan/configure.ac 2007-09-13 17:52:06 UTC (rev 1134) @@ -135,6 +135,13 @@ [Theora support])],, with_theora="auto") +AC_ARG_WITH(ffmpeg, + [AS_HELP_STRING([--with-ffmpeg], + [FFmpeg support])], + FFMPEG="${with_ffmpeg}", + with_ffmpeg="no") + + if test ! "x$enable_clients" = "xauto"; then for client in ${enable_clients}; do case "$client" in @@ -232,6 +239,22 @@ fi AM_CONDITIONAL(THEORA, test x$has_theora = xyes) +has_ffmpeg=no +if test ! x$with_ffmpeg = xno; then +PKG_CHECK_MODULES(FFMPEG, [libavcodec >= 51.40.3],has_ffmpeg=yes) +if test x$has_ffmpeg = xyes; then + AC_DEFINE(USE_FFMPEG, 1, [FFMPEG]) + PKG_REQUIRES="$PKG_REQUIRES ffmpeg" +elif test ! x$with_ffmpeg = xauto ; then + AC_MSG_ERROR([ + FFmpeg is required to build this package! + please see http://ffmpeg.mplayerhq.hu/ for how to + obtain a copy. + ]) +fi +fi +AM_CONDITIONAL(FFMPEG, test x$has_ffmpeg = xyes) + PKG_CHECK_MODULES(SDL, [sdl >= 1.2], has_sdl=yes, has_sdl=no) PKG_CHECK_MODULES(GTK, [gtk+-2.0 >= 2.0], has_gtk2=yes, has_gtk2=no) PKG_CHECK_MODULES(GDK2, [gdk-2.0 >= 2.0.0], has_gdk2=yes, has_gdk2=no) Modified: branches/team/mihai/echocan/lib/Makefile.am =================================================================== --- branches/team/mihai/echocan/lib/Makefile.am 2007-09-13 13:50:59 UTC (rev 1133) +++ branches/team/mihai/echocan/lib/Makefile.am 2007-09-13 17:52:06 UTC (rev 1134) @@ -98,6 +98,12 @@ AM_CFLAGS += $(THEORA_CFLAGS) endif +if FFMPEG +SRCS += codec_ffmpeg.c codec_ffmpeg.h +libiaxclient_la_LIBADD += $(FFMPEG_LIBS) +AM_CFLAGS += $(FFMPEG_CFLAGS) +endif + SRCS_LIBGSM= \ gsm/src/add.c \ gsm/src/code.c \ Modified: branches/team/mihai/echocan/lib/iaxclient_lib.c =================================================================== --- branches/team/mihai/echocan/lib/iaxclient_lib.c 2007-09-13 13:50:59 UTC (rev 1133) +++ branches/team/mihai/echocan/lib/iaxclient_lib.c 2007-09-13 17:52:06 UTC (rev 1134) @@ -1704,21 +1704,14 @@ video_format = iaxc_choose_codec(video_format); } } - } - if ( !video_format ) - { - if ( format ) + /* All video negotiations failed, then warn */ + if ( !video_format ) { iaxci_usermsg(IAXC_NOTICE, - "Notice: could not negotiate common video codec"); + "Notice: could not negotiate common video codec"); iaxci_usermsg(IAXC_NOTICE, - "Notice: switching to audio-only call"); - } else - { - iax_reject(e->session, - "Could not negotiate common audio and video codec"); - return; + "Notice: switching to audio-only call"); } } #endif /* USE_VIDEO */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sb...@us...> - 2007-09-18 19:43:09
|
Revision: 1142 http://iaxclient.svn.sourceforge.net/iaxclient/?rev=1142&view=rev Author: sbalea Date: 2007-09-18 12:43:13 -0700 (Tue, 18 Sep 2007) Log Message: ----------- Force speex preprocessing when we want de-reverb or echo cancelation Remember, the EC and the preprocessor are now linked Modified Paths: -------------- branches/team/mihai/echocan/lib/audio_encode.c branches/team/mihai/echocan/simpleclient/vtestcall/vtestcall.c Modified: branches/team/mihai/echocan/lib/audio_encode.c =================================================================== --- branches/team/mihai/echocan/lib/audio_encode.c 2007-09-18 17:59:43 UTC (rev 1141) +++ branches/team/mihai/echocan/lib/audio_encode.c 2007-09-18 19:43:13 UTC (rev 1142) @@ -161,8 +161,8 @@ calculate_level((short *)audio, len, &input_level); - /* only preprocess if we're interested in VAD, AGC, or DENOISE */ - if ( (iaxci_filters & (IAXC_FILTER_DENOISE | IAXC_FILTER_AGC)) || + /* go through the motions only if we need at least one of the preprocessor filters */ + if ( (iaxci_filters & (IAXC_FILTER_DENOISE | IAXC_FILTER_AGC | IAXC_FILTER_DEREVERB | IAXC_FILTER_ECHO)) || iaxci_silence_threshold > 0.0f ) silent = !speex_preprocess(st, (spx_int16_t *)audio, NULL); Modified: branches/team/mihai/echocan/simpleclient/vtestcall/vtestcall.c =================================================================== --- branches/team/mihai/echocan/simpleclient/vtestcall/vtestcall.c 2007-09-18 17:59:43 UTC (rev 1141) +++ branches/team/mihai/echocan/simpleclient/vtestcall/vtestcall.c 2007-09-18 19:43:13 UTC (rev 1142) @@ -520,7 +520,7 @@ //iaxc_set_formats(IAXC_FORMAT_ALAW,IAXC_FORMAT_ULAW|IAXC_FORMAT_GSM); iaxc_set_silence_threshold(1.0); iaxc_set_audio_output(0); - iaxc_set_filters(/*IAXC_FILTER_AGC|*/IAXC_FILTER_DENOISE|IAXC_FILTER_CN/*|IAXC_FILTER_ECHO*/); + iaxc_set_filters(IAXC_FILTER_AGC | IAXC_FILTER_DENOISE | IAXC_FILTER_CN | IAXC_FILTER_ECHO | IAXC_FILTER_DEREVERB); list_devices(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sb...@us...> - 2007-09-26 19:38:14
|
Revision: 1159 http://iaxclient.svn.sourceforge.net/iaxclient/?rev=1159&view=rev Author: sbalea Date: 2007-09-26 12:38:11 -0700 (Wed, 26 Sep 2007) Log Message: ----------- Merge latest trunk changes into echocan branch. This includes the stresstest functionality Modified Paths: -------------- branches/team/mihai/echocan/AUTHORS branches/team/mihai/echocan/configure.ac branches/team/mihai/echocan/lib/Makefile.am branches/team/mihai/echocan/lib/codec_ffmpeg.c branches/team/mihai/echocan/lib/codec_theora.c branches/team/mihai/echocan/lib/iaxclient.h branches/team/mihai/echocan/lib/iaxclient_lib.c branches/team/mihai/echocan/lib/libiax2/src/iax.c branches/team/mihai/echocan/lib/video.c branches/team/mihai/echocan/lib/video.h branches/team/mihai/echocan/simpleclient/Makefile.am branches/team/mihai/echocan/simpleclient/vtestcall/Makefile.am branches/team/mihai/echocan/simpleclient/vtestcall/vtestcall.c Added Paths: ----------- branches/team/mihai/echocan/Doxyfile branches/team/mihai/echocan/doc/ branches/team/mihai/echocan/doc/src/ branches/team/mihai/echocan/doc/src/license.dox branches/team/mihai/echocan/doc/src/mainpage.dox branches/team/mihai/echocan/lib/slice.c branches/team/mihai/echocan/lib/slice.h branches/team/mihai/echocan/simpleclient/stresstest/ branches/team/mihai/echocan/simpleclient/stresstest/Makefile.am branches/team/mihai/echocan/simpleclient/stresstest/README branches/team/mihai/echocan/simpleclient/stresstest/file.c branches/team/mihai/echocan/simpleclient/stresstest/file.h branches/team/mihai/echocan/simpleclient/stresstest/stresstest.c branches/team/mihai/echocan/simpleclient/stresstest/stresstest.vcproj Removed Paths: ------------- branches/team/mihai/echocan/doc/src/ branches/team/mihai/echocan/doc/src/license.dox branches/team/mihai/echocan/doc/src/mainpage.dox branches/team/mihai/echocan/simpleclient/stresstest/Makefile.am branches/team/mihai/echocan/simpleclient/stresstest/README branches/team/mihai/echocan/simpleclient/stresstest/file.c branches/team/mihai/echocan/simpleclient/stresstest/file.h branches/team/mihai/echocan/simpleclient/stresstest/stresstest.c branches/team/mihai/echocan/simpleclient/stresstest/stresstest.vcproj Modified: branches/team/mihai/echocan/AUTHORS =================================================================== --- branches/team/mihai/echocan/AUTHORS 2007-09-26 19:25:02 UTC (rev 1158) +++ branches/team/mihai/echocan/AUTHORS 2007-09-26 19:38:11 UTC (rev 1159) @@ -9,6 +9,7 @@ Steve Underwood <st...@co...> [PLC implementation from spandsp] Jean-Denis Girard <jd....@sy...> [URL Receive implementation] Panfilov Dmitry <di...@bd...> [Basic ALSA-native audio driver] +Erik Bunce <kd...@bu...> [Assorted fixes/tweaks, Documentation] Mihai Balea <mihai at hates dot ms> Bill Welch <welch1820 at gmail dot com> [Project files for several MS development environments] Peter Grayson <jpg...@gm...> Copied: branches/team/mihai/echocan/Doxyfile (from rev 1157, trunk/Doxyfile) =================================================================== --- branches/team/mihai/echocan/Doxyfile (rev 0) +++ branches/team/mihai/echocan/Doxyfile 2007-09-26 19:38:11 UTC (rev 1159) @@ -0,0 +1,248 @@ +# Doxyfile 1.5.3 + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- +DOXYFILE_ENCODING = UTF-8 +PROJECT_NAME = IAXClient +PROJECT_NUMBER = 2.0 +OUTPUT_DIRECTORY = ./doc +CREATE_SUBDIRS = NO +OUTPUT_LANGUAGE = English +BRIEF_MEMBER_DESC = YES +REPEAT_BRIEF = YES +ABBREVIATE_BRIEF = "The $name class" \ + "The $name widget" \ + "The $name file" \ + is \ + provides \ + specifies \ + contains \ + represents \ + a \ + an \ + the +ALWAYS_DETAILED_SEC = NO +INLINE_INHERITED_MEMB = NO +FULL_PATH_NAMES = NO +STRIP_FROM_PATH = +STRIP_FROM_INC_PATH = +SHORT_NAMES = NO +JAVADOC_AUTOBRIEF = NO +QT_AUTOBRIEF = YES +MULTILINE_CPP_IS_BRIEF = NO +DETAILS_AT_TOP = NO +INHERIT_DOCS = YES +SEPARATE_MEMBER_PAGES = NO +TAB_SIZE = 8 +ALIASES = +OPTIMIZE_OUTPUT_FOR_C = YES +OPTIMIZE_OUTPUT_JAVA = NO +BUILTIN_STL_SUPPORT = NO +CPP_CLI_SUPPORT = NO +DISTRIBUTE_GROUP_DOC = NO +SUBGROUPING = YES +#--------------------------------------------------------------------------- +# Build related configuration options +#--------------------------------------------------------------------------- +EXTRACT_ALL = NO +EXTRACT_PRIVATE = NO +EXTRACT_STATIC = NO +EXTRACT_LOCAL_CLASSES = YES +EXTRACT_LOCAL_METHODS = NO +EXTRACT_ANON_NSPACES = NO +HIDE_UNDOC_MEMBERS = YES +HIDE_UNDOC_CLASSES = YES +HIDE_FRIEND_COMPOUNDS = NO +HIDE_IN_BODY_DOCS = NO +INTERNAL_DOCS = NO +CASE_SENSE_NAMES = NO +HIDE_SCOPE_NAMES = NO +SHOW_INCLUDE_FILES = YES +INLINE_INFO = YES +SORT_MEMBER_DOCS = YES +SORT_BRIEF_DOCS = NO +SORT_BY_SCOPE_NAME = NO +GENERATE_TODOLIST = YES +GENERATE_TESTLIST = YES +GENERATE_BUGLIST = YES +GENERATE_DEPRECATEDLIST= YES +ENABLED_SECTIONS = +MAX_INITIALIZER_LINES = 30 +SHOW_USED_FILES = YES +SHOW_DIRECTORIES = NO +FILE_VERSION_FILTER = +#--------------------------------------------------------------------------- +# configuration options related to warning and progress messages +#--------------------------------------------------------------------------- +QUIET = NO +WARNINGS = YES +WARN_IF_UNDOCUMENTED = YES +WARN_IF_DOC_ERROR = YES +WARN_NO_PARAMDOC = NO +WARN_FORMAT = "$file:$line: $text" +WARN_LOGFILE = +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- +INPUT = doc/src \ + simpleclient/testcall \ + simpleclient/vtestcall \ + lib +INPUT_ENCODING = UTF-8 +FILE_PATTERNS = *.h \ + *.c \ + *.cpp \ + *.dox +RECURSIVE = NO +EXCLUDE = lib/ringbuffer.c +EXCLUDE_SYMLINKS = NO +EXCLUDE_PATTERNS = +EXCLUDE_SYMBOLS = +EXAMPLE_PATH = . ./doc/src +EXAMPLE_PATTERNS = * +EXAMPLE_RECURSIVE = NO +IMAGE_PATH = +INPUT_FILTER = +FILTER_PATTERNS = +FILTER_SOURCE_FILES = NO +#--------------------------------------------------------------------------- +# configuration options related to source browsing +#--------------------------------------------------------------------------- +SOURCE_BROWSER = YES +INLINE_SOURCES = NO +STRIP_CODE_COMMENTS = YES +REFERENCED_BY_RELATION = NO +REFERENCES_RELATION = NO +REFERENCES_LINK_SOURCE = YES +USE_HTAGS = NO +VERBATIM_HEADERS = YES +#--------------------------------------------------------------------------- +# configuration options related to the alphabetical class index +#--------------------------------------------------------------------------- +ALPHABETICAL_INDEX = NO +COLS_IN_ALPHA_INDEX = 5 +IGNORE_PREFIX = +#--------------------------------------------------------------------------- +# configuration options related to the HTML output +#--------------------------------------------------------------------------- +GENERATE_HTML = YES +HTML_OUTPUT = html +HTML_FILE_EXTENSION = .html +HTML_HEADER = +HTML_FOOTER = +HTML_STYLESHEET = +HTML_ALIGN_MEMBERS = YES +GENERATE_HTMLHELP = NO +HTML_DYNAMIC_SECTIONS = YES +CHM_FILE = +HHC_LOCATION = +GENERATE_CHI = NO +BINARY_TOC = NO +TOC_EXPAND = NO +DISABLE_INDEX = NO +ENUM_VALUES_PER_LINE = 4 +GENERATE_TREEVIEW = NO +TREEVIEW_WIDTH = 250 +#--------------------------------------------------------------------------- +# configuration options related to the LaTeX output +#--------------------------------------------------------------------------- +GENERATE_LATEX = NO +LATEX_OUTPUT = latex +LATEX_CMD_NAME = latex +MAKEINDEX_CMD_NAME = makeindex +COMPACT_LATEX = NO +PAPER_TYPE = letter +EXTRA_PACKAGES = +LATEX_HEADER = +PDF_HYPERLINKS = YES +USE_PDFLATEX = YES +LATEX_BATCHMODE = NO +LATEX_HIDE_INDICES = NO +#--------------------------------------------------------------------------- +# configuration options related to the RTF output +#--------------------------------------------------------------------------- +GENERATE_RTF = NO +RTF_OUTPUT = rtf +COMPACT_RTF = NO +RTF_HYPERLINKS = NO +RTF_STYLESHEET_FILE = +RTF_EXTENSIONS_FILE = +#--------------------------------------------------------------------------- +# configuration options related to the man page output +#--------------------------------------------------------------------------- +GENERATE_MAN = YES +MAN_OUTPUT = man +MAN_EXTENSION = .3 +MAN_LINKS = NO +#--------------------------------------------------------------------------- +# configuration options related to the XML output +#--------------------------------------------------------------------------- +GENERATE_XML = NO +XML_OUTPUT = xml +XML_SCHEMA = +XML_DTD = +XML_PROGRAMLISTING = YES +#--------------------------------------------------------------------------- +# configuration options for the AutoGen Definitions output +#--------------------------------------------------------------------------- +GENERATE_AUTOGEN_DEF = NO +#--------------------------------------------------------------------------- +# configuration options related to the Perl module output +#--------------------------------------------------------------------------- +GENERATE_PERLMOD = NO +PERLMOD_LATEX = NO +PERLMOD_PRETTY = YES +PERLMOD_MAKEVAR_PREFIX = +#--------------------------------------------------------------------------- +# Configuration options related to the preprocessor +#--------------------------------------------------------------------------- +ENABLE_PREPROCESSING = YES +MACRO_EXPANSION = YES +EXPAND_ONLY_PREDEF = YES +SEARCH_INCLUDES = YES +INCLUDE_PATH = +INCLUDE_FILE_PATTERNS = +PREDEFINED = DOXYGEN_SHOULD_SKIP_THIS \ + EXPORT="" +EXPAND_AS_DEFINED = +SKIP_FUNCTION_MACROS = YES +#--------------------------------------------------------------------------- +# Configuration::additions related to external references +#--------------------------------------------------------------------------- +TAGFILES = +GENERATE_TAGFILE = +ALLEXTERNALS = NO +EXTERNAL_GROUPS = YES +PERL_PATH = /usr/bin/perl +#--------------------------------------------------------------------------- +# Configuration options related to the dot tool +#--------------------------------------------------------------------------- +CLASS_DIAGRAMS = NO +MSCGEN_PATH = +HIDE_UNDOC_RELATIONS = YES +HAVE_DOT = NO +CLASS_GRAPH = YES +COLLABORATION_GRAPH = YES +GROUP_GRAPHS = YES +UML_LOOK = NO +TEMPLATE_RELATIONS = NO +INCLUDE_GRAPH = YES +INCLUDED_BY_GRAPH = YES +CALL_GRAPH = NO +CALLER_GRAPH = NO +GRAPHICAL_HIERARCHY = YES +DIRECTORY_GRAPH = YES +DOT_IMAGE_FORMAT = png +DOT_PATH = +DOTFILE_DIRS = +DOT_GRAPH_MAX_NODES = 50 +MAX_DOT_GRAPH_DEPTH = 1000 +DOT_TRANSPARENT = NO +DOT_MULTI_TARGETS = NO +GENERATE_LEGEND = YES +DOT_CLEANUP = YES +#--------------------------------------------------------------------------- +# Configuration::additions related to the search engine +#--------------------------------------------------------------------------- +SEARCHENGINE = NO Modified: branches/team/mihai/echocan/configure.ac =================================================================== --- branches/team/mihai/echocan/configure.ac 2007-09-26 19:25:02 UTC (rev 1158) +++ branches/team/mihai/echocan/configure.ac 2007-09-26 19:38:11 UTC (rev 1159) @@ -88,7 +88,7 @@ AC_ARG_ENABLE(clients, [AS_HELP_STRING([--enable-clients], - [Select clients (all iaxcomm iaxphone testcall tkphone vtestcall WinIAX wx) [default=auto]])],, + [Select clients (all iaxcomm iaxphone stresstest testcall tkphone vtestcall WinIAX wx) [default=auto]])],, enable_clients="auto") AC_ARG_WITH(ilbc, @@ -145,10 +145,10 @@ if test ! "x$enable_clients" = "xauto"; then for client in ${enable_clients}; do case "$client" in - iaxcomm | iaxphone | testcall | tkphone | vtestcall | WinIAX | wx) + iaxcomm | iaxphone | stresstest | testcall | tkphone | vtestcall | WinIAX | wx) clients="$clients $client" ;; all | yes) - clients="iaxcomm iaxphone testcall tkphone vtestcall WinIAX wx" + clients="iaxcomm iaxphone stresstest testcall tkphone vtestcall WinIAX wx" break ;; none | no) clients="" @@ -259,6 +259,7 @@ PKG_CHECK_MODULES(GTK, [gtk+-2.0 >= 2.0], has_gtk2=yes, has_gtk2=no) PKG_CHECK_MODULES(GDK2, [gdk-2.0 >= 2.0.0], has_gdk2=yes, has_gdk2=no) PKG_CHECK_MODULES(ALSA, [alsa >= 1.0], has_alsa=yes, has_alsa=no) +PKG_CHECK_MODULES(OGGZ, [oggz >= 0.9.5], has_oggz=yes, has_oggz=no) has_iax2=no if test ! x$enable_local_iax = xyes; then @@ -364,7 +365,7 @@ # Autodetect clients if test "x$enable_clients" = "xauto"; then - clients="$clients testcall" + clients="$clients testcall stresstest" if test ! x$has_wx = xno; then clients="$clients iaxphone" @@ -396,6 +397,9 @@ testcall) CLIENTS="$CLIENTS $client";; + stresstest) + CLIENTS="$CLIENTS $client";; + vtestcall) if test ! x$has_sdl = xyes || test ! x$with_video = xyes ; then AC_MSG_ERROR([vtestcall requires SDL and video]) @@ -445,6 +449,7 @@ simpleclient/Makefile iaxclient.pc simpleclient/testcall/Makefile + simpleclient/stresstest/Makefile simpleclient/vtestcall/Makefile simpleclient/iaxcomm/Makefile simpleclient/iaxphone/Makefile Copied: branches/team/mihai/echocan/doc (from rev 1157, trunk/doc) Copied: branches/team/mihai/echocan/doc/src (from rev 1157, trunk/doc/src) Deleted: branches/team/mihai/echocan/doc/src/license.dox =================================================================== --- trunk/doc/src/license.dox 2007-09-26 19:23:48 UTC (rev 1157) +++ branches/team/mihai/echocan/doc/src/license.dox 2007-09-26 19:38:11 UTC (rev 1159) @@ -1,14 +0,0 @@ -/*! \page License - - The IAXClient is licensed under the GNU Lesser General Public License - - Copyrights: - - Copyright © 2003-2006, Horizon Wimba, Inc. - - Copyright © 2007, Wimba, Inc. - - IAXClient Contributors: - \verbinclude AUTHORS - - License: - \verbinclude COPYING.LIB -*/ Copied: branches/team/mihai/echocan/doc/src/license.dox (from rev 1157, trunk/doc/src/license.dox) =================================================================== --- branches/team/mihai/echocan/doc/src/license.dox (rev 0) +++ branches/team/mihai/echocan/doc/src/license.dox 2007-09-26 19:38:11 UTC (rev 1159) @@ -0,0 +1,14 @@ +/*! \page License + + The IAXClient is licensed under the GNU Lesser General Public License + + Copyrights: + - Copyright © 2003-2006, Horizon Wimba, Inc. + - Copyright © 2007, Wimba, Inc. + + IAXClient Contributors: + \verbinclude AUTHORS + + License: + \verbinclude COPYING.LIB +*/ Deleted: branches/team/mihai/echocan/doc/src/mainpage.dox =================================================================== --- trunk/doc/src/mainpage.dox 2007-09-26 19:23:48 UTC (rev 1157) +++ branches/team/mihai/echocan/doc/src/mainpage.dox 2007-09-26 19:38:11 UTC (rev 1159) @@ -1,25 +0,0 @@ -/*! \mainpage - -<A href="http://iaxclient.sourceforge.net/">IAXClient</A> is an Open Source library to implement the IAX protocol used by -<A href="http://www.asterisk.org/">The Asterisk Software PBX</A>. -It is licensed under the the LGPL \ref License.<BR> - -Although asterisk supports other VOIP protocols (including SIP, and with patches, H.323), IAX's simple, lightweight nature gives it several advantages, particularly in that it can operate easily through NAT and packet firewalls, and it is easily extensible and simple to understand. - -See the <A href="http://iaxclient.sourceforge.net/">IAXClient</A> website for futher -information at <A href="http://iaxclient.sf.net">http://iaxclient.sf.net</A> - -Things you may be interested include: -<UL> -<LI>The IAXClient API, as documented in iaxclient.h</LI> -<LI><a href="http://iaxclient.sourceforge.net/devinfo.html">Some developer information</A></LI> -<LI><a href="http://sourceforge.net/projects/iaxclient/">SourceForge -Development Site</A></LI> -<LI><a href="http://lists.sourceforge.net/lists/listinfo/iaxclient-devel">Subscribe to the mailing list</A> iax...@li...!</LI> -<LI><a href="http://iaxclient.sourceforge.net/IAXClientFAQ.html">FAQ</A></LI> -<LI>You can also catch some of the developers online at the <A href="http://www.freenode.net">freenode</A> IRC channels -<A href="irc://irc.freenode.net/iaxclient">\#iaxclient</A> or <A href="irc://irc.freenode.net/asterisk">\#asterisk</A></LI> -</UL> - -*/ - Copied: branches/team/mihai/echocan/doc/src/mainpage.dox (from rev 1157, trunk/doc/src/mainpage.dox) =================================================================== --- branches/team/mihai/echocan/doc/src/mainpage.dox (rev 0) +++ branches/team/mihai/echocan/doc/src/mainpage.dox 2007-09-26 19:38:11 UTC (rev 1159) @@ -0,0 +1,25 @@ +/*! \mainpage + +<A href="http://iaxclient.sourceforge.net/">IAXClient</A> is an Open Source library to implement the IAX protocol used by +<A href="http://www.asterisk.org/">The Asterisk Software PBX</A>. +It is licensed under the the LGPL \ref License.<BR> + +Although asterisk supports other VOIP protocols (including SIP, and with patches, H.323), IAX's simple, lightweight nature gives it several advantages, particularly in that it can operate easily through NAT and packet firewalls, and it is easily extensible and simple to understand. + +See the <A href="http://iaxclient.sourceforge.net/">IAXClient</A> website for futher +information at <A href="http://iaxclient.sf.net">http://iaxclient.sf.net</A> + +Things you may be interested include: +<UL> +<LI>The IAXClient API, as documented in iaxclient.h</LI> +<LI><a href="http://iaxclient.sourceforge.net/devinfo.html">Some developer information</A></LI> +<LI><a href="http://sourceforge.net/projects/iaxclient/">SourceForge +Development Site</A></LI> +<LI><a href="http://lists.sourceforge.net/lists/listinfo/iaxclient-devel">Subscribe to the mailing list</A> iax...@li...!</LI> +<LI><a href="http://iaxclient.sourceforge.net/IAXClientFAQ.html">FAQ</A></LI> +<LI>You can also catch some of the developers online at the <A href="http://www.freenode.net">freenode</A> IRC channels +<A href="irc://irc.freenode.net/iaxclient">\#iaxclient</A> or <A href="irc://irc.freenode.net/asterisk">\#asterisk</A></LI> +</UL> + +*/ + Modified: branches/team/mihai/echocan/lib/Makefile.am =================================================================== --- branches/team/mihai/echocan/lib/Makefile.am 2007-09-26 19:25:02 UTC (rev 1158) +++ branches/team/mihai/echocan/lib/Makefile.am 2007-09-26 19:38:11 UTC (rev 1159) @@ -146,6 +146,8 @@ ringbuffer.c \ ringbuffer.h \ portmixer/px_common/portmixer.h \ + slice.c \ + slice.h \ spandsp/plc.c \ spandsp/plc.h Modified: branches/team/mihai/echocan/lib/codec_ffmpeg.c =================================================================== --- branches/team/mihai/echocan/lib/codec_ffmpeg.c 2007-09-26 19:25:02 UTC (rev 1158) +++ branches/team/mihai/echocan/lib/codec_ffmpeg.c 2007-09-26 19:38:11 UTC (rev 1159) @@ -13,6 +13,9 @@ * the GNU Lesser (Library) General Public License. * * A video codec using the ffmpeg library. + * + * TODO: this code still uses its own slicing mechanism + * It should be converted to use the API provided in slice.[ch] */ #include <stdlib.h> Modified: branches/team/mihai/echocan/lib/codec_theora.c =================================================================== --- branches/team/mihai/echocan/lib/codec_theora.c 2007-09-26 19:25:02 UTC (rev 1158) +++ branches/team/mihai/echocan/lib/codec_theora.c 2007-09-26 19:38:11 UTC (rev 1159) @@ -32,24 +32,9 @@ * - No support for splitting the frame into multiple slices. Frames can * be relatively large. For a 320x240 video stream, you can see key * frames larger than 9KB, which is the maximum UDP packet size on Mac - * OS X. We split the encoded frame artificially into slices that will - * fit into a typical MTU. We also add six bytes at the beginning of - * each slice. - * - * - version: right now, first bit should be 0, the rest are undefined - * - * - source id: 2 bytes random number used to identify stream changes in - * conference applications this number is transmitted in big endian - * format over the wire - * - * - frame index number - used to detect a new frame when some of the - * slices of the current frame are missing (only the least significant - * 4 bits are used) - * - * - index of slice in the frame, starting at 0 - * - * - total number of slices in the frame - * + * OS X. To work around this limitation, we use the slice API to fragment + * encoded frames to a reasonable size that UDP can safely transport + * * Other miscellaneous comments: * * - For quality reasons, when we detect a video stream switch, we reject all @@ -68,34 +53,29 @@ #include <stdlib.h> #include "iaxclient_lib.h" #include "video.h" +#include "slice.h" #include "codec_theora.h" #include <theora/theora.h> #define MAX_SLICE_SIZE 8000 -#define MAX_ENCODED_FRAME_SIZE 48*1024 struct theora_decoder { - theora_state td; - theora_info ti; - theora_comment tc; - unsigned char frame_index; - unsigned char slice_count; - int frame_size; - unsigned short source_id; - int got_key_frame; - unsigned char buffer[MAX_ENCODED_FRAME_SIZE]; + theora_state td; + theora_info ti; + theora_comment tc; + struct deslicer_context *dsc; + int got_key_frame; }; struct theora_encoder { - theora_state td; - theora_info ti; - theora_comment tc; - int needs_padding; - unsigned char frame_index; - unsigned short source_id; - unsigned char *pad_buffer; + theora_state td; + theora_info ti; + theora_comment tc; + int needs_padding; + struct slicer_context *sc; + unsigned char *pad_buffer; }; static void destroy( struct iaxc_video_codec *c) @@ -111,6 +91,8 @@ e = (struct theora_encoder *)c->encstate; if ( e->pad_buffer ) free(e->pad_buffer); + if ( e->sc ) + free_slicer_context(e->sc); theora_comment_clear(&e->tc); theora_info_clear(&e->ti); theora_clear(&e->td); @@ -119,6 +101,8 @@ if ( c->decstate ) { d = (struct theora_decoder *)c->decstate; + if ( d->dsc ) + free_deslicer_context(d->dsc); theora_comment_clear(&d->tc); theora_info_clear(&d->ti); theora_clear(&d->td); @@ -127,25 +111,34 @@ free(c); } -static void reset_decoder_frame_state(struct theora_decoder * d) +static int decode(struct iaxc_video_codec *c, int inlen, char *in, int *outlen, char *out) { - memset(d->buffer, 0, MAX_ENCODED_FRAME_SIZE); - d->frame_size = 0; - d->slice_count = 0; -} + struct theora_decoder *d; + ogg_packet op; + yuv_buffer picture; + unsigned int line; + int my_out_len; + int w, h, ph; + int flen; + char *frame; -static int pass_frame_to_decoder(struct theora_decoder *d, int *outlen, char *out) -{ - ogg_packet op; - yuv_buffer picture; - unsigned int line; - int my_out_len; - int w, h, ph; + // Sanity checks + if ( !c || !c->decstate || !in || inlen <= 0 || !out || !outlen ) + return -1; + // Assemble slices + d = (struct theora_decoder *)c->decstate; + if ( !d->dsc ) + return -1; + + frame = deslice(in, inlen, &flen, d->dsc); + if ( frame == NULL ) + return 1; + /* decode into an OP structure */ memset(&op, 0, sizeof(op)); - op.bytes = d->frame_size; - op.packet = d->buffer; + op.bytes = flen; + op.packet = (unsigned char *)frame; /* reject all incoming frames until we get a key frame */ if ( !d->got_key_frame ) @@ -190,21 +183,19 @@ { // Y-even memcpy(out + picture.y_width * 2 * line, - picture.y + 2 * line * picture.y_stride, - picture.y_width); + picture.y + 2 * line * picture.y_stride, + picture.y_width); // Y-odd memcpy(out + picture.y_width * (2 * line + 1), - picture.y + (2 * line + 1) * picture.y_stride, - picture.y_width); + picture.y + (2 * line + 1) * picture.y_stride, + picture.y_width); // U + V - memcpy(out + (d->ti.frame_width * d->ti.frame_height) + - line * d->ti.frame_width / 2, - picture.u + line * picture.uv_stride, - picture.uv_width); - memcpy(out + (d->ti.frame_width * d->ti.frame_height * 5 / 4) + - line * d->ti.frame_width / 2, - picture.v + line * picture.uv_stride, - picture.uv_width); + memcpy(out + (d->ti.frame_width * d->ti.frame_height) + line * d->ti.frame_width / 2, + picture.u + line * picture.uv_stride, + picture.uv_width); + memcpy(out + (d->ti.frame_width * d->ti.frame_height * 5 / 4) + line * d->ti.frame_width / 2, + picture.v + line * picture.uv_stride, + picture.uv_width); } *outlen = my_out_len; @@ -212,96 +203,6 @@ return 0; } -static int decode(struct iaxc_video_codec *c, int inlen, char *in, int *outlen, char *out) -{ - struct theora_decoder *d; - unsigned char frame_index, slice_index, num_slices, version; - unsigned short source_id; - - // Sanity checks - if ( !c || !c->decstate || !in || inlen <= 0 || !out || !outlen ) - return -1; - - d = (struct theora_decoder *)c->decstate; - - version = *in++; - source_id = (unsigned short)(*in++) << 8; - source_id |= *in++; - frame_index = *in++ & 0x0f; - slice_index = *in++; - num_slices = *in++; - inlen -= 6; - - if ( version & 0x80 ) - { - fprintf(stderr, "Theora: unknown slice protocol\n"); - return -1; - } - - if ( source_id == d->source_id ) - { - /* We use only the least significant bits to calculate delta - * this helps with conferencing and video muting/unmuting - */ - unsigned char frame_delta = (frame_index - d->frame_index) & 0x0f; - - if ( frame_delta > 8 ) - { - /* Old slice coming in late, ignore. */ - return 1; - } else if ( frame_delta > 0 ) - { - /* Slice belongs to a new frame */ - d->frame_index = frame_index; - - if ( d->slice_count > 0 ) - { - /* Current frame is incomplete, drop it */ - c->video_stats.dropped_frames++; - reset_decoder_frame_state(d); - } - } - } else - { - /* Video stream was switched, the existing frame/slice - * indexes are meaningless. - */ - reset_decoder_frame_state(d); - d->source_id = source_id; - d->frame_index = frame_index; - d->got_key_frame = 0; - } - - // Process current slice - if ( c->fragsize * slice_index + inlen > MAX_ENCODED_FRAME_SIZE ) - { - // Frame would be too large, ignore slice - return -1; - } - - memcpy(d->buffer + c->fragsize * slice_index, in, inlen); - d->slice_count++; - - /* We only know the size of the frame when we get the final slice */ - if ( slice_index == num_slices - 1 ) - d->frame_size = c->fragsize * slice_index + inlen; - - if ( d->slice_count < num_slices ) - { - // we're still waiting for some slices - return 1; - } else - { - // Frame complete, send to decoder - int ret = pass_frame_to_decoder(d, outlen, out); - - // Clean up in preparation for next frame - reset_decoder_frame_state(d); - - return ret; - } -} - // Pads a w by h frame to bring it up to pw by ph size using value static void pad_channel(const char *src, int w, int h, unsigned char *dst, int pw, int ph, unsigned char value) @@ -329,8 +230,6 @@ static int encode(struct iaxc_video_codec *c, int inlen, char *in, struct slice_set_t *slice_set) { - int i, size, ssize; - const unsigned char *p; struct theora_encoder *e; ogg_packet op; yuv_buffer picture; @@ -402,41 +301,21 @@ // Check to see if we have a key frame slice_set->key_frame = theora_packet_iskeyframe(&op) == 1; + + // Slice the frame + slice((char *)op.packet, op.bytes, slice_set, e->sc); - // We need to split the frame into one or more slices - p = op.packet; - size = op.bytes; - - // Figure out how many slices we need - slice_set->num_slices = (size - 1) / c->fragsize + 1; - - // Copy up to fragsize bytes into each slice - for ( i = 0; i < slice_set->num_slices; i++ ) - { - slice_set->data[i][0] = 0; - slice_set->data[i][1] = (unsigned char)(e->source_id >> 8); - slice_set->data[i][2] = (unsigned char)(e->source_id & 0xff); - slice_set->data[i][3] = e->frame_index; - slice_set->data[i][4] = (unsigned char)i; - slice_set->data[i][5] = (unsigned char)slice_set->num_slices; - ssize = (i == slice_set->num_slices - 1) ? - size % c->fragsize : c->fragsize; - memcpy(&slice_set->data[i][6], p, ssize); - slice_set->size[i] = ssize + 6; - p += ssize; - } - e->frame_index++; - return 0; } struct iaxc_video_codec *codec_video_theora_new(int format, int w, int h, int framerate, int bitrate, int fragsize) { - struct iaxc_video_codec *c; - struct theora_encoder *e; - struct theora_decoder *d; - ogg_packet headerp, commentp, tablep; + struct iaxc_video_codec *c; + struct theora_encoder *e; + struct theora_decoder *d; + unsigned short source_id; + ogg_packet headerp, commentp, tablep; /* Basic sanity checks */ if ( w <= 0 || h <= 0 || framerate <= 0 || bitrate <= 0 || fragsize <= 0 ) @@ -470,7 +349,7 @@ if ( !c->encstate ) goto bail; - video_reset_codec_stats(c); + video_reset_codec_stats(c); c->format = format; c->width = w; @@ -486,6 +365,15 @@ e = (struct theora_encoder *)c->encstate; d = (struct theora_decoder *)c->decstate; + // Initialize slicer + // Generate random source id + srand((unsigned int)time(0)); + source_id = rand() & 0xffff; + e->sc = create_slicer_context(source_id, fragsize); + if ( !e->sc ) + goto bail; + + /* set up some parameters in the contexts */ theora_info_init(&e->ti); @@ -578,11 +466,12 @@ if ( theora_decode_init(&d->td, &d->ti) ) goto bail; - // Generate random source id - srand((unsigned int)time(0)); - e->source_id = rand() & 0xffff; - d->got_key_frame = 0; + + // Initialize deslicer context + d->dsc = create_deslicer_context(c->fragsize); + if ( !d->dsc ) + goto bail; strcpy(c->name, "Theora"); return c; @@ -593,11 +482,19 @@ if ( c ) { if ( c->encstate ) + { + e = (struct theora_encoder *)c->encstate; + if ( e->sc ) + free_slicer_context(e->sc); free(c->encstate); - + } if ( c->decstate ) + { + d = (struct theora_decoder *)c->decstate; + if ( d->dsc ) + free_deslicer_context(d->dsc); free(c->decstate); - + } free(c); } Modified: branches/team/mihai/echocan/lib/iaxclient.h =================================================================== --- branches/team/mihai/echocan/lib/iaxclient.h 2007-09-26 19:25:02 UTC (rev 1158) +++ branches/team/mihai/echocan/lib/iaxclient.h 2007-09-26 19:38:11 UTC (rev 1159) @@ -11,6 +11,7 @@ * Mihai Balea <mihai AT hates DOT ms> * Peter Grayson <jpg...@gm...> * Bill Cholewka <bc...@gm...> + * Erik Bunce <kd...@bu...> * * This program is free software, distributed under the terms of * the GNU Lesser (Library) General Public License. @@ -21,12 +22,20 @@ #ifdef __cplusplus extern "C" { #endif + +/*! + \file iaxclient.h + \brief The IAXClient API + + -/* This is the include file which declared all external API functions to - * IAXCLIENT. It should include all functions and declarations needed - * by IAXCLIENT library users, but not include internal structures, or - * require the inclusion of library internals (or sub-libraries) */ + \note This is the include file which declares all external API functions to + IAXClient. It should include all functions and declarations needed + by IAXClient library users, but not include internal structures, or + require the inclusion of library internals (or sub-libraries) +*/ +#ifndef DOXYGEN_SHOULD_SKIP_THIS #ifdef _MSC_VER typedef int socklen_t; #endif @@ -51,6 +60,7 @@ #else # define EXPORT #endif +#endif /* DOXYGEN_SHOULD_SKIP_THIS */ #if defined(WIN32) || defined(_WIN32_WCE) #if defined(_MSC_VER) @@ -65,438 +75,1197 @@ struct sockaddr *, int *); #endif #else + /*! + Defines the portotype for an application provided sendto implementation. + */ typedef int (*iaxc_sendto_t)(int, const void *, size_t, int, const struct sockaddr *, socklen_t); + /*! + Defines the portotype for an application provided recvfrom implementation. + */ typedef int (*iaxc_recvfrom_t)(int, void *, size_t, int, struct sockaddr *, socklen_t *); #endif +/*! + Mask containing all potentially valid audio formats +*/ #define IAXC_AUDIO_FORMAT_MASK ((1<<16)-1) + +/*! + Mask containing all potentially valid video formats +*/ #define IAXC_VIDEO_FORMAT_MASK (((1<<25)-1) & ~IAXC_AUDIO_FORMAT_MASK) /* payload formats : WARNING: must match libiax values!!! */ /* Data formats for capabilities and frames alike */ -#define IAXC_FORMAT_G723_1 (1 << 0) /* G.723.1 compression */ -#define IAXC_FORMAT_GSM (1 << 1) /* GSM compression */ -#define IAXC_FORMAT_ULAW (1 << 2) /* Raw mu-law data (G.711) */ -#define IAXC_FORMAT_ALAW (1 << 3) /* Raw A-law data (G.711) */ -#define IAXC_FORMAT_G726 (1 << 4) /* ADPCM, 32kbps */ -#define IAXC_FORMAT_ADPCM (1 << 5) /* ADPCM IMA */ -#define IAXC_FORMAT_SLINEAR (1 << 6) /* Raw 16-bit Signed Linear (8000 Hz) PCM */ -#define IAXC_FORMAT_LPC10 (1 << 7) /* LPC10, 180 samples/frame */ -#define IAXC_FORMAT_G729A (1 << 8) /* G.729a Audio */ -#define IAXC_FORMAT_SPEEX (1 << 9) /* Speex Audio */ -#define IAXC_FORMAT_ILBC (1 << 10) /* iLBC Audio */ +#define IAXC_FORMAT_G723_1 (1 << 0) /*!< G.723.1 compression */ +#define IAXC_FORMAT_GSM (1 << 1) /*!< GSM compression */ +#define IAXC_FORMAT_ULAW (1 << 2) /*!< Raw mu-law data (G.711) */ +#define IAXC_FORMAT_ALAW (1 << 3) /*!< Raw A-law data (G.711) */ +#define IAXC_FORMAT_G726 (1 << 4) /*!< ADPCM, 32kbps */ +#define IAXC_FORMAT_ADPCM (1 << 5) /*!< ADPCM IMA */ +#define IAXC_FORMAT_SLINEAR (1 << 6) /*!< Raw 16-bit Signed Linear (8000 Hz) PCM */ +#define IAXC_FORMAT_LPC10 (1 << 7) /*!< LPC10, 180 samples/frame */ +#define IAXC_FORMAT_G729A (1 << 8) /*!< G.729a Audio */ +#define IAXC_FORMAT_SPEEX (1 << 9) /*!< Speex Audio */ +#define IAXC_FORMAT_ILBC (1 << 10) /*!< iLBC Audio */ -#define IAXC_FORMAT_MAX_AUDIO (1 << 15) /* Maximum audio format */ -#define IAXC_FORMAT_JPEG (1 << 16) /* JPEG Images */ -#define IAXC_FORMAT_PNG (1 << 17) /* PNG Images */ -#define IAXC_FORMAT_H261 (1 << 18) /* H.261 Video */ -#define IAXC_FORMAT_H263 (1 << 19) /* H.263 Video */ -#define IAXC_FORMAT_H263_PLUS (1 << 20) /* H.263+ Video */ -#define IAXC_FORMAT_H264 (1 << 21) /* H264 Video */ -#define IAXC_FORMAT_MPEG4 (1 << 22) /* MPEG4 Video */ -#define IAXC_FORMAT_THEORA (1 << 24) /* Theora Video */ -#define IAXC_FORMAT_MAX_VIDEO (1 << 24) /* Maximum Video Format */ +#define IAXC_FORMAT_MAX_AUDIO (1 << 15) /*!< Maximum audio format value */ +#define IAXC_FORMAT_JPEG (1 << 16) /*!< JPEG Images */ +#define IAXC_FORMAT_PNG (1 << 17) /*!< PNG Images */ +#define IAXC_FORMAT_H261 (1 << 18) /*!< H.261 Video */ +#define IAXC_FORMAT_H263 (1 << 19) /*!< H.263 Video */ +#define IAXC_FORMAT_H263_PLUS (1 << 20) /*!< H.263+ Video */ +#define IAXC_FORMAT_H264 (1 << 21) /*!< H264 Video */ +#define IAXC_FORMAT_MPEG4 (1 << 22) /*!< MPEG4 Video */ +#define IAXC_FORMAT_THEORA (1 << 24) /*!< Theora Video */ +#define IAXC_FORMAT_MAX_VIDEO (1 << 24) /*!< Maximum Video format value*/ -#define IAXC_EVENT_TEXT 1 -#define IAXC_EVENT_LEVELS 2 -#define IAXC_EVENT_STATE 3 -#define IAXC_EVENT_NETSTAT 4 -#define IAXC_EVENT_URL 5 /* URL push via IAX(2) */ -#define IAXC_EVENT_VIDEO 6 -#define IAXC_EVENT_REGISTRATION 8 -#define IAXC_EVENT_DTMF 9 -#define IAXC_EVENT_AUDIO 10 -#define IAXC_EVENT_VIDEOSTATS 11 +#define IAXC_EVENT_TEXT 1 /*!< Indicates a text event */ +#define IAXC_EVENT_LEVELS 2 /*!< Indicates a level event */ +#define IAXC_EVENT_STATE 3 /*!< Indicates a call state change event */ +#define IAXC_EVENT_NETSTAT 4 /*!< Indicates a network statistics update event */ +#define IAXC_EVENT_URL 5 /*!< Indicates a URL push via IAX(2) */ +#define IAXC_EVENT_VIDEO 6 /*!< Indicates a video event */ +#define IAXC_EVENT_REGISTRATION 8 /*!< Indicates a registration event */ +#define IAXC_EVENT_DTMF 9 /*!< Indicates a DTMF event */ +#define IAXC_EVENT_AUDIO 10 /*!< Indicates an audio event */ +#define IAXC_EVENT_VIDEOSTATS 11 /*!< Indicates a video statistics update event */ -#define IAXC_CALL_STATE_FREE 0 -#define IAXC_CALL_STATE_ACTIVE (1<<1) -#define IAXC_CALL_STATE_OUTGOING (1<<2) -#define IAXC_CALL_STATE_RINGING (1<<3) -#define IAXC_CALL_STATE_COMPLETE (1<<4) -#define IAXC_CALL_STATE_SELECTED (1<<5) -#define IAXC_CALL_STATE_BUSY (1<<6) -#define IAXC_CALL_STATE_TRANSFER (1<<7) +#define IAXC_CALL_STATE_FREE 0 /*!< Indicates a call slot is free */ +#define IAXC_CALL_STATE_ACTIVE (1<<1) /*!< Indicates a call is active */ +#define IAXC_CALL_STATE_OUTGOING (1<<2) /*!< Indicates a call is outgoing */ +#define IAXC_CALL_STATE_RINGING (1<<3) /*!< Indicates a call is ringing */ +#define IAXC_CALL_STATE_COMPLETE (1<<4) /*!< Indicates a completed call */ +#define IAXC_CALL_STATE_SELECTED (1<<5) /*!< Indicates the call is selected */ +#define IAXC_CALL_STATE_BUSY (1<<6) /*!< Indicates a call is busy */ +#define IAXC_CALL_STATE_TRANSFER (1<<7) /*!< Indicates the call transfer has been released */ -#define IAXC_TEXT_TYPE_STATUS 1 -#define IAXC_TEXT_TYPE_NOTICE 2 -#define IAXC_TEXT_TYPE_ERROR 3 -/* FATAL ERROR: User Agent should probably display error, then die. */ -#define IAXC_TEXT_TYPE_FATALERROR 4 -#define IAXC_TEXT_TYPE_IAX 5 +/*! Indicates that text is for an IAXClient status change */ +#define IAXC_TEXT_TYPE_STATUS 1 +/*! Indicates that text is an IAXClient warning message */ +#define IAXC_TEXT_TYPE_NOTICE 2 +/*! Represents that text is for an IAXClient error message */ +#define IAXC_TEXT_TYPE_ERROR 3 +/*! + Represents that text is for an IAXClient fatal error message. + + The User Agent should probably display error message text, then die +*/ +#define IAXC_TEXT_TYPE_FATALERROR 4 +/*! Represents a message sent from the server across the IAX stream*/ +#define IAXC_TEXT_TYPE_IAX 5 /* registration replys, corresponding to IAX_EVENTs*/ -#define IAXC_REGISTRATION_REPLY_ACK 18 /* IAX_EVENT_REGACC */ -#define IAXC_REGISTRATION_REPLY_REJ 30 /* IAX_EVENT_REGREJ */ -#define IAXC_REGISTRATION_REPLY_TIMEOUT 6 /* IAX_EVENT_TIMEOUT */ +#define IAXC_REGISTRATION_REPLY_ACK 18 /*!< Indicates the registration was accepted (See IAX_EVENT_REGACC) */ +#define IAXC_REGISTRATION_REPLY_REJ 30 /*!< Indicates the registration was rejected (See IAX_EVENT_REGREJ) */ +#define IAXC_REGISTRATION_REPLY_TIMEOUT 6 /*!< Indicates the registration timed out (See IAX_EVENT_TIMEOUT) */ -#define IAXC_URL_URL 1 /* URL received */ -#define IAXC_URL_LDCOMPLETE 2 /* URL loading complete */ -#define IAXC_URL_LINKURL 3 /* URL link request */ -#define IAXC_URL_LINKREJECT 4 /* URL link reject */ -#define IAXC_URL_UNLINK 5 /* URL unlink */ +#define IAXC_URL_URL 1 /*!< URL received */ +#define IAXC_URL_LDCOMPLETE 2 /*!< URL loading complete */ +#define IAXC_URL_LINKURL 3 /*!< URL link request */ +#define IAXC_URL_LINKREJECT 4 /*!< URL link reject */ +#define IAXC_URL_UNLINK 5 /*!< URL unlink */ /* The source of the video or audio data triggering the event. */ -#define IAXC_SOURCE_LOCAL 1 -#define IAXC_SOURCE_REMOTE 2 +#define IAXC_SOURCE_LOCAL 1 /*!< Indicates that the event data source is local */ +#define IAXC_SOURCE_REMOTE 2 /*!< Indicates that the event data source is remote */ +/*! + The maximum size of a string contained within an event + */ #define IAXC_EVENT_BUFSIZ 256 + +/*! + A structure containing information about an audio level event. +*/ struct iaxc_ev_levels { + /*! + The input level in dB. + */ float input; + + /*! + The output level in dB. + */ float output; }; +/*! + A structure containing information about a text event. +*/ struct iaxc_ev_text { + /*! + The type of text event. + + Valid values are from the IAXC_TEXT_TYPE_{} family of defines. + \see IAXC_TEXT_TYPE_STATUS, IAXC_TEXT_TYPE_NOTICE, IAXC_TEXT_TYPE_ERROR, + IAXC_TEXT_TYPE_FATALERROR, IAXC_TEXT_TYPE_IAX + */ int type; - int callNo; /* call number for IAX text */ + + /*! + The call the text is associated with or -1 if general text. + */ + int callNo; + + /*! + The UTF8 encoded text of the message. + */ char message[IAXC_EVENT_BUFSIZ]; }; +/*! + A structure containing information about a call state change event. +*/ struct iaxc_ev_call_state { + /*! + The call number whose state this is + */ int callNo; + + /*! + The call state represented using the IAXC_CALL_STATE_{} defines. + + \see IAXC_CALL_STATE_FREE, IAXC_CALL_STATE_ACTIVE, IAXC_CALL_STATE_OUTGOING, + IAXC_CALL_STATE_RINGING, IAXC_CALL_STATE_COMPLETE, IAXC_CALL_STATE_SELECTED, + IAXC_CALL_STATE_BUSY, IAXC_CALL_STATE_TRANSFER + */ int state; + + /*! + The audio format of the call. + + \see IAXC_FORMAT_G723_1, IAXC_FORMAT_GSM, IAXC_FORMAT_ULAW, IAXC_FORMAT_ALAW, + IAXC_FORMAT_G726, IAXC_FORMAT_ADPCM, IAXC_FORMAT_SLINEAR, IAXC_FORMAT_LPC10, + IAXC_FORMAT_G729A, IAXC_FORMAT_SPEEX, IAXC_FORMAT_ILBC, IAXC_FORMAT_MAX_AUDIO + */ int format; + + /*! + The audio format of the call. + + \see IAXC_FORMAT_JPEG, IAXC_FORMAT_PNG, IAXC_FORMAT_H261, IAXC_FORMAT_H263, + IAXC_FORMAT_H263_PLUS, IAXC_FORMAT_H264, IAXC_FORMAT_MPEG4, + IAXC_FORMAT_THEORA, IAXC_FORMAT_MAX_VIDEO + */ int vformat; + + /*! + The remote number. + */ char remote[IAXC_EVENT_BUFSIZ]; + + /*! + The remote name. + */ char remote_name[IAXC_EVENT_BUFSIZ]; + + /*! + The local number. + */ char local[IAXC_EVENT_BUFSIZ]; + + /*! + The local calling context. + */ char local_context[IAXC_EVENT_BUFSIZ]; }; +/*! + A structure containing information about a set of network statistics. +*/ struct iaxc_netstat { + /*! + The amount of observed jitter. + */ int jitter; + + /*! + The lost frame percentage. + */ int losspct; + + /*! + The number of missing frames. + */ int losscnt; + + /*! + The number of frames received. + */ int packets; + + /*! + The observed delay. + */ int delay; + + /*! + The number of frames dropped. + */ int dropped; + + /*! + The number of frames received out of order. + */ int ooo; }; +/*! + A structure containing information about a network statistics event. +*/ struct iaxc_ev_netstats { + /*! + The call whose statistics these are. + */ int callNo; + + /*! + The Round Trip Time + */ int rtt; + + /*! + The locally observed network statistics. + */ struct iaxc_netstat local; + + /*! + The remotely (peer) observed network statistics. + */ struct iaxc_netstat remote; }; -/* - * Video statistics code - */ +/*! + A structure containing video statistics data. +*/ struct iaxc_video_stats { - unsigned long received_slices; /* Number of received slices */ - unsigned long acc_recv_size; /* Accumulated size of inbound slices */ - unsigned long sent_slices; /* Number of sent slices */ - unsigned long acc_sent_size; /* Accumulated size of outbound slices */ + unsigned long received_slices; /*!< Number of received slices. */ + unsigned long acc_recv_size; /*!< Accumulated size of inbound slices. */ + unsigned long sent_slices; /*!< Number of sent slices. */ + unsigned long acc_sent_size; /*!< Accumulated size of outbound slices. */ - unsigned long dropped_frames; /* Number of frames dropped by the codec (incomplete frames */ - unsigned long inbound_frames; /* Number of frames decoded by the codec (complete frames) */ - unsigned long outbound_frames; /* Number of frames sent to the encoder */ + unsigned long dropped_frames; /*!< Number of frames dropped by the codec (incomplete frames). */ + unsigned long inbound_frames; /*!< Number of frames decoded by the codec (complete frames). */ + unsigned long outbound_frames; /*!< Number of frames sent to the encoder. */ - float avg_inbound_fps; /* Average fps of inbound complete frames */ - unsigned long avg_inbound_bps; /* Average inbound bitrate */ - float avg_outbound_fps; /* Average fps of outbound frames */ - unsigned long avg_outbound_bps; /* Average outbound bitrate */ + float avg_inbound_fps; /*!< Average fps of inbound complete frames. */ + unsigned long avg_inbound_bps; /*!< Average inbound bitrate. */ + float avg_outbound_fps; /*!< Average fps of outbound frames. */ + unsigned long avg_outbound_bps; /*!< Average outbound bitrate. */ - struct timeval start_time; /* Timestamp of the moment we started measuring */ + struct timeval start_time; /*!< Timestamp of the moment we started measuring. */ }; +/*! + A structure containing information about a video statistics event. +*/ struct iaxc_ev_video_stats { + /*! + The call whose statistics these are. + */ int callNo; + + /*! + The video statistics for the call. + */ struct iaxc_video_stats stats; }; +/*! + A structure containing information about an URL event. +*/ struct iaxc_ev_url { + /*! + The call this is for. + */ int callNo; + + /*! + The type of URL received. See the IAXC_URL_{} defines. + + \see IAXC_URL_URL, IAXC_URL_LINKURL, IAXC_URL_LDCOMPLETE, IAXC_URL_UNLINK, + IAXC_URL_LINKREJECT + */ int type; + + /*! + The received URL. + */ char url[IAXC_EVENT_BUFSIZ]; }; +/*! + A structure containing data for a video event. +*/ struct iaxc_ev_video { + /*! + The call this video data is for. + + Will be -1 for local video. + */ int callNo; + + /*! + Timestamp of the video + */ unsigned int ts; + + /*! + The format of the video data. + + \see IAXC_FORMAT_JPEG, IAXC_FORMAT_PNG, IAXC_FORMAT_H261, IAXC_FORMAT_H263, + IAXC_FORMAT_H263_PLUS, IAXC_FORMAT_H264, IAXC_FORMAT_MPEG4, + IAXC_FORMAT_THEORA, IAXC_FORMAT_MAX_VIDEO + */ int format; + + /*! + The width of the video. + */ int width; + + /*! + The height of the video. + */ int height; + + /*! + Is the data encoded. + + 1 for encoded data, 0 for raw. + */ int encoded; + + /*! + The source of the data. + + \see IAXC_SOURCE_LOCAL, IAXC_SOURCE_REMOTE + */ int source; + + /*! + The size of the video data in bytes. + */ int size; + + /*! + The buffer containing the video data. + */ char *data; }; +/*! + A structure containing data for an audio event. +*/ struct iaxc_ev_audio { + /*! + The call this audio data is for. + */ int callNo; + + /*! + Timestamp of the video + */ unsigned int ts; + + /*! + The format of the data. + + \see IAXC_FORMAT_G723_1, IAXC_FORMAT_GSM, IAXC_FORMAT_ULAW, IAXC_FORMAT_ALAW, + IAXC_FORMAT_G726, IAXC_FORMAT_ADPCM, IAXC_FORMAT_SLINEAR, IAXC_FORMAT_LPC10, + IAXC_FORMAT_G729A, IAXC_FORMAT_SPEEX, IAXC_FORMAT_ILBC, IAXC_FORMAT_MAX_AUDIO + */ int format; + + /*! + Is the data encoded. + + 1 for encoded data, 0 for raw. + */ int encoded; + + /*! + The source of the data. + + \see IAXC_SOURCE_LOCAL, IAXC_SOURCE_REMOTE + */ int source; + + /*! + The size of the audio data in bytes. + */ int size; + + /*! + The buffer containing the audio data. + */ unsigned char *data; }; +/*! + A structure containing information about a registration event +*/ struct iaxc_ev_registration { + /*! + Indicates the registration id this event corresponds to. + + \see iaxc_register + */ int id; + + /*! + The registration reply. + + The values are from the IAXC_REGISTRATION_REPLY_{} family of macros. + \see IAX_EVENT_REGACC, IAX_EVENT_REGREJ, IAX_EVENT_TIMEOUT + */ int reply; + + /*! + The number of 'voicemail' messages. + */ int msgcount; }; +/*! + A structure describing a single IAXClient event. +*/ typedef struct iaxc_event_struct { + /*! + Points to the next entry in the event queue + \internal + */ struct iaxc_event_struct *next; - int type; + + /*! + The type uses one of the IAXC_EVENT_{} macros to describe which type of + event is being presented + */ + int type; + + /*! + Contains the data specific to the type of event. + */ union { + /*! Contains level data if type = IAXC_EVENT_LEVELS */ struct iaxc_ev_levels levels; - struct iaxc_ev_text text; - struct iaxc_ev_call_state call; - struct iaxc_ev_netstats netstats; - struct iaxc_ev_video_stats videostats; - struct iaxc_ev_url url; - struct iaxc_ev_video video; - struct iaxc_ev_audio audio; - struct iaxc_ev_registration reg; + /*! Contains text data if type = IAXC_EVENT_TEXT */ + struct iaxc_ev_text text; + /*! Contains call state data if type = IAXC_EVENT_STATE */ + struct iaxc_ev_call_state call; + /*! Contains network statistics if type = IAXC_EVENT_NETSTAT */ + struct iaxc_ev_netstats netstats; + /*! Contains video statistics if type = IAXC_EVENT_VIDEOSTATS */ + struct iaxc_ev_video_stats videostats; + /*! Contains url data if type = IAXC_EVENT_URL */ + struct iaxc_ev_url url; + /*! Contains video data if type = IAXC_EVENT_VIDEO */ + struct iaxc_ev_video video; + /*! Contains audio data if type = IAXC_EVENT_AUDIO */ + struct iaxc_ev_audio audio; + /*! Contains registration data if type = AXC_EVENT_REGISTRATION */ + struct iaxc_ev_registration reg; } ev; } iaxc_event; +/*! + Defines the prototype for event callback handlers + \param e The event structure being passed to the callback + + \return The result of processing the event; > 0 if successfully handled the event, 0 if not handled, < 0 to indicate an error occurred processing the event. +*/ typedef int (*iaxc_event_callback_t)(iaxc_event e); + +/*! + Sets the callback to call with IAXClient events + \param func The callback function to call with events +*/ EXPORT void iaxc_set_event_callback(iaxc_event_callback_t func); -/* Sets iaxclient to post a pointer to a copy of event using o/s specific Post method */ +/*! + Sets iaxclient to post a pointer to a copy of event using o/s specific Post method + \param handle + \param id +*/ EXPORT int iaxc_set_event_callpost(void *handle, int id); -/* frees event delivered via o/s specific Post method */ +/*! + frees event delivered via o/s specific Post method + \param e The event to free +*/ EXPORT void iaxc_free_event(iaxc_event *e); /* Event Accessors */ +/*! + Returns the levels data associated with event \a e. + \param e The event to retrieve the levels from. +*/ EXPORT struct iaxc_ev_levels *iaxc_get_event_levels(iaxc_event *e); + +/*! + Returns the text data associated with event \a e. + \param e The event to retrieve text from. +*/ EXPORT struct iaxc_ev_text *iaxc_get_event_text(iaxc_event *e); + +/*! + Returns the event state data associated with event \a e. + \param e The event to retrieve call state from. +*/ EXPORT struct iaxc_ev_call_state *iaxc_get_event_state(iaxc_event *e); -// Set Preferred UDP Port: -// 0: Use the default port (4569) -// <0: Use a dynamically assigned port -// >0: Try to bind to the specified port -// NOTE: must be called before iaxc_initialize() +/*! + Set Preferred UDP Port: + \param sourceUdpPort The source UDP port to prefer + 0 Use the default port (4569), <0 Uses a dynamically assigned port, and + >0 tries to bind to the specified port + + \note must be called before iaxc_initialize() +*/ EXPORT void iaxc_set_preferred_source_udp_port(int sourceUdpPort); +/*! + Returns the UDP port that has been bound to. + + \return The UDP port bound to; -1 if no port or +*/ EXPORT short iaxc_get_bind_port(); + +/*! + Initializes the IAXClient library + \param num_calls The maximum number of simultaneous calls to handle. + + This initializes the IAXClient +*/ EXPORT int iaxc_initialize(int num_calls); + +/*! + Shutsdown the IAXClient library. + + This should be called by applications utilizing iaxclient before they exit. + It dumps all calls, and releases any audio/video drivers being used. + + \note It is unsafe to call most IAXClient API's after calling this! +*/ EXPORT void iaxc_shutdown(); + +/*! + Sets the formats to be used + \param preferred The single preferred audio format + \param allowed A mask containing all audio formats to allow + + \see IAXC_FORMAT_G723_1, IAXC_FORMAT_GSM, IAXC_FORMAT_ULAW, IAXC_FORMAT_ALAW, + IAXC_FORMAT_G726, IAXC_FORMAT_ADPCM, IAXC_FORMAT_SLINEAR, IAXC_FORMAT_LPC10, + IAXC_FORMAT_G729A, IAXC_FORMAT_SPEEX, IAXC_FORMAT_ILBC, IAXC_FORMAT_MAX_AUDIO +*/ EXPORT void iaxc_set_formats(int preferred, int allowed); + +/*! + Sets the minimum outgoing frame size. + \param samples The minimum number of samples to include in an outgoing frame. +*/ EXPORT void iaxc_set_min_outgoing_framesize(int samples); + +/*! + Sets the caller id \a name and \a number. + \param name The caller id name. + \param number The caller id number. +*/ EXPORT void iaxc_set_callerid(const char * name, const char * number); + +/*! + Starts all the internal processing thread(s). + + \note Should be called after iaxc_initialize, but before any call processing + related functions. +*/ EXPORT int iaxc_start_processing_thread(); + +/*! + Stops all the internal processing thread(s). + + \note Should be called before iaxc_shutdown. +*/ EXPORT int iaxc_stop_processing_thread(); + +/*! + Initiates a call to an end point + \param num The entity to call in the format of [user[:password]]@@peer[:portno][/exten[@@context]] + + \return The call number upon sucess; -1 otherwise. + + \note This is the same as calling iaxc_call_ex(num, NULL, NULL, 1). +*/ EXPORT int iaxc_call(const char * num); + +/*! + Initiates a call to an end point + \param num The entity to call in the format of [user[:password]]@@peer[:portno][/exten[@@context]] + \param callerid_name The local caller id name to use + \param callerid_number The local caller id number to use + \param video 0 indicates no-video. Any non-zero value indicates video is requested + + \return The call number upon sucess; -1 otherwise. +*/ EXPORT int iaxc_call_ex(const char* num, const char* callerid_name, const char* callerid_number, int video); + +/*! + Unregisters IAXClient from a server + \param id The registration number returned by iaxc_register. +*/ EXPORT int iaxc_unregister( int id ); + +/*! + Registers the IAXClient instance with an IAX server + \param user The username to register as + \param pass The password to register with + \param host The address of the host/peer to register with + + \return The registration id number upon success; -1 otherwise. +*/ EXPORT int iaxc_register(const char * user, const char * pass, const char * host); + +/*! + Respond to incoming call \a callNo as busy. +*/ EXPORT void iaxc_send_busy_on_incoming_call(int callNo); + +/*! + Answers the incoming call \a callNo. + \param callNo The number of the call to answer. +*/ EXPORT void iaxc_answer_call(int callNo); + +/*! + Initiate a blind call transfer of \a callNo to \a number. + \param callNo The active call to transfer. + \param number The number to transfer the call to. See draft-guy-iax-03 section 8.4.1 for further details. +*/ EXPORT void iaxc_blind_transfer_call(int callNo, const char * number); + +/*! + Setup a transfer of \a sourceCallNo to \a targetCallNo. + \param sourceCallNo The number of the active call session to transfer. + \param targetCallNo The active call session to be transferred to. + + This is used in performing as the final step in an attended call transfer. +*/ EXPORT void iaxc_setup_call_transfer(int sourceCallNo, int targetCallNo); + +/*! + Hangs up and frees all non-free calls. +*/ EXPORT void iaxc_dump_all_calls(void); + +/*! + Hangs up and frees the currently selected call. +*/ EXPORT void iaxc_dump_call(void); + +/*! + Rejects the currently selected call. + + \note This is pretty much a useless API, since the act of selecting a call + will answer it. +*/ EXPORT void iaxc_reject_call(void); + +/*! + Rejects the incoming call \a callNo. + \param callNo The call number to reject. +*/ EXPORT void iaxc_reject_call_number(int callNo); + +/*! + Sends a DTMF digit to the currently selected call. + \param digit The DTMF digit to send (0-9, A-D, *, #). +*/ EXPORT void iaxc_send_dtmf(char digit); + +/*! + Sends text to the currently selected call. +*/ EXPORT void iaxc_send_text(const char * text); + +/*! + Sends a URL across the currently selected call + \param url The URL to send across. + \param link If non-zero the URL is a link +*/ EXPORT void iaxc_send_url(const char *url, int link); /* link == 1 ? AST_HTML_LINKURL : AST_HTML_URL */ + +/*! + Suspends thread execution for an interval measured in milliseconds + \param ms The number of milliseconds to sleep +*/ EXPORT void iaxc_millisleep(long ms); + +/*! + Sets the silence threshold to \a thr. + \param thr The threshold value in dB. A value of 0.0f effectively mutes audio input. +*/ EXPORT void iaxc_set_silence_threshold(float thr); + +/*! + Sets the audio output to \a mode. + \param mode The audio mode 0 indicates remote audio should be played; non-zero prevents remote audio from being played. +*/ EXPORT void iaxc_set_audio_output(int mode); + +/*! + Sets \a callNo as the currently selected call + \param callNo The call to select or < 0 to indicate no selected call. + + \note Will answer an incoming ringing call as a side effect. Personally I + believe this behavior is undesirable and feel it renders iaxc_reject_call + pretty much useless. +*/ EXPORT int iaxc_select_call(int callNo); + +/*! + Returns the first free call number. +*/ EXPORT int iaxc_first_free_call(); + +/*! + Returns the number of the currently selected call. +*/ EXPORT int iaxc_selected_call(); + +/*! + Causes the audio channel for \a callNo to QUELCH (be squelched). + \param callNo The number of the active, accepted call to quelch. + \param MOH If non-zero Music On Hold should be played on the QUELCH'd call. +*/ EXPORT int iaxc_quelch... [truncated message content] |
From: <sb...@us...> - 2007-10-09 16:02:46
|
Revision: 1185 http://iaxclient.svn.sourceforge.net/iaxclient/?rev=1185&view=rev Author: sbalea Date: 2007-10-09 09:02:48 -0700 (Tue, 09 Oct 2007) Log Message: ----------- Synchronize with trunk rev 1184 Revision Links: -------------- http://iaxclient.svn.sourceforge.net/iaxclient/?rev=1184&view=rev Modified Paths: -------------- branches/team/mihai/echocan/contrib/win/vs2005/iaxclient.sln branches/team/mihai/echocan/contrib/win/vs2005/libiaxclient.vcproj branches/team/mihai/echocan/lib/audio_encode.c branches/team/mihai/echocan/lib/audio_portaudio.c branches/team/mihai/echocan/lib/iaxclient.h branches/team/mihai/echocan/lib/iaxclient_lib.c branches/team/mihai/echocan/lib/libiax2/src/iax.c branches/team/mihai/echocan/lib/video.c branches/team/mihai/echocan/simpleclient/stresstest/stresstest.c branches/team/mihai/echocan/simpleclient/testcall/testcall.c Added Paths: ----------- branches/team/mihai/echocan/contrib/win/vs2005/testcall.vcproj Removed Paths: ------------- branches/team/mihai/echocan/simpleclient/testcall/testcall.vcproj Modified: branches/team/mihai/echocan/contrib/win/vs2005/iaxclient.sln =================================================================== --- branches/team/mihai/echocan/contrib/win/vs2005/iaxclient.sln 2007-10-08 23:02:47 UTC (rev 1184) +++ branches/team/mihai/echocan/contrib/win/vs2005/iaxclient.sln 2007-10-09 16:02:48 UTC (rev 1185) @@ -9,14 +9,14 @@ EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libiaxclient", "libiaxclient.vcproj", "{9A9C003E-EAF6-4D0E-896F-E3994503C7E4}" ProjectSection(ProjectDependencies) = postProject + {3B023516-2C69-4CCB-9302-239991B6EC2C} = {3B023516-2C69-4CCB-9302-239991B6EC2C} + {BE15A94D-3766-4693-ABA8-5FBAACBBCC08} = {BE15A94D-3766-4693-ABA8-5FBAACBBCC08} + {82C9BD79-9796-405F-8A28-3F538514AC3A} = {82C9BD79-9796-405F-8A28-3F538514AC3A} + {3A76129B-55AB-4D54-BAA7-08F63ED52569} = {3A76129B-55AB-4D54-BAA7-08F63ED52569} + {5CC054B7-6DAA-46BF-9A08-3B33B83E8D3E} = {5CC054B7-6DAA-46BF-9A08-3B33B83E8D3E} + {2F463562-375D-481E-A6E0-7C7D0DC1ED7A} = {2F463562-375D-481E-A6E0-7C7D0DC1ED7A} + {E972C52F-9E85-4D65-B19C-031E511E9DB4} = {E972C52F-9E85-4D65-B19C-031E511E9DB4} {E2C6AD95-7A61-41FE-8754-A4623C891BF8} = {E2C6AD95-7A61-41FE-8754-A4623C891BF8} - {E972C52F-9E85-4D65-B19C-031E511E9DB4} = {E972C52F-9E85-4D65-B19C-031E511E9DB4} - {2F463562-375D-481E-A6E0-7C7D0DC1ED7A} = {2F463562-375D-481E-A6E0-7C7D0DC1ED7A} - {5CC054B7-6DAA-46BF-9A08-3B33B83E8D3E} = {5CC054B7-6DAA-46BF-9A08-3B33B83E8D3E} - {3A76129B-55AB-4D54-BAA7-08F63ED52569} = {3A76129B-55AB-4D54-BAA7-08F63ED52569} - {82C9BD79-9796-405F-8A28-3F538514AC3A} = {82C9BD79-9796-405F-8A28-3F538514AC3A} - {BE15A94D-3766-4693-ABA8-5FBAACBBCC08} = {BE15A94D-3766-4693-ABA8-5FBAACBBCC08} - {3B023516-2C69-4CCB-9302-239991B6EC2C} = {3B023516-2C69-4CCB-9302-239991B6EC2C} EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libiax2", "libiax2.vcproj", "{5CC054B7-6DAA-46BF-9A08-3B33B83E8D3E}" @@ -29,6 +29,11 @@ EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libtheora", "libtheora.vcproj", "{E2C6AD95-7A61-41FE-8754-A4623C891BF8}" EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testcall", "testcall.vcproj", "{6F5AEE93-BA87-465B-BC75-C41C434FC4E4}" + ProjectSection(ProjectDependencies) = postProject + {9A9C003E-EAF6-4D0E-896F-E3994503C7E4} = {9A9C003E-EAF6-4D0E-896F-E3994503C7E4} + EndProjectSection +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug_dll|Win32 = Debug_dll|Win32 @@ -109,6 +114,14 @@ {E2C6AD95-7A61-41FE-8754-A4623C891BF8}.Release_dll|Win32.Build.0 = Release|Win32 {E2C6AD95-7A61-41FE-8754-A4623C891BF8}.Release|Win32.ActiveCfg = Release|Win32 {E2C6AD95-7A61-41FE-8754-A4623C891BF8}.Release|Win32.Build.0 = Release|Win32 + {6F5AEE93-BA87-465B-BC75-C41C434FC4E4}.Debug_dll|Win32.ActiveCfg = Debug|Win32 + {6F5AEE93-BA87-465B-BC75-C41C434FC4E4}.Debug_dll|Win32.Build.0 = Debug|Win32 + {6F5AEE93-BA87-465B-BC75-C41C434FC4E4}.Debug|Win32.ActiveCfg = Debug|Win32 + {6F5AEE93-BA87-465B-BC75-C41C434FC4E4}.Debug|Win32.Build.0 = Debug|Win32 + {6F5AEE93-BA87-465B-BC75-C41C434FC4E4}.Release_dll|Win32.ActiveCfg = Release|Win32 + {6F5AEE93-BA87-465B-BC75-C41C434FC4E4}.Release_dll|Win32.Build.0 = Release|Win32 + {6F5AEE93-BA87-465B-BC75-C41C434FC4E4}.Release|Win32.ActiveCfg = Release|Win32 + {6F5AEE93-BA87-465B-BC75-C41C434FC4E4}.Release|Win32.Build.0 = Release|Win32 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE Modified: branches/team/mihai/echocan/contrib/win/vs2005/libiaxclient.vcproj =================================================================== --- branches/team/mihai/echocan/contrib/win/vs2005/libiaxclient.vcproj 2007-10-08 23:02:47 UTC (rev 1184) +++ branches/team/mihai/echocan/contrib/win/vs2005/libiaxclient.vcproj 2007-10-09 16:02:48 UTC (rev 1185) @@ -59,7 +59,7 @@ /> <Tool Name="VCLibrarianTool" - AdditionalDependencies="libiax2.lib libvideolib.lib libportmixer.lib libportaudio.lib libgsm.lib libogg.lib libspeex.lib libtheora.lib comsuppw.lib strmiids.lib wininet.lib ws2_32.lib" + AdditionalDependencies="libiax2.lib libvideolib.lib libportmixer.lib libportaudio.lib libgsm.lib libogg.lib libspeex.lib libtheora.lib comsuppw.lib strmiids.lib wininet.lib" AdditionalLibraryDirectories=""$(SolutionDir)$(ConfigurationName)\libiax2";"$(SolutionDir)$(ConfigurationName)\libvideolib";"$(SolutionDir)$(ConfigurationName)\libportaudio";"$(SolutionDir)$(ConfigurationName)\libportmixer";"$(SolutionDir)$(ConfigurationName)\libogg";"$(SolutionDir)$(ConfigurationName)\libtheora";"$(SolutionDir)$(ConfigurationName)\libspeex";"$(SolutionDir)$(ConfigurationName)\libgsm"" /> <Tool @@ -122,7 +122,7 @@ /> <Tool Name="VCLibrarianTool" - AdditionalDependencies="libiax2.lib libvideolib.lib libportmixer.lib libportaudio.lib libgsm.lib libogg.lib libspeex.lib libtheora.lib comsuppw.lib strmiids.lib wininet.lib ws2_32.lib" + AdditionalDependencies="libiax2.lib libvideolib.lib libportmixer.lib libportaudio.lib libgsm.lib libogg.lib libspeex.lib libtheora.lib comsuppw.lib strmiids.lib wininet.lib" AdditionalLibraryDirectories=""$(SolutionDir)$(ConfigurationName)\libiax2";"$(SolutionDir)$(ConfigurationName)\libvideolib";"$(SolutionDir)$(ConfigurationName)\libportaudio";"$(SolutionDir)$(ConfigurationName)\libportmixer";"$(SolutionDir)$(ConfigurationName)\libogg";"$(SolutionDir)$(ConfigurationName)\libtheora";"$(SolutionDir)$(ConfigurationName)\libspeex";"$(SolutionDir)$(ConfigurationName)\libgsm"" /> <Tool @@ -368,6 +368,10 @@ > </File> <File + RelativePath="..\..\..\lib\slice.c" + > + </File> + <File RelativePath="..\..\..\lib\video.c" > </File> @@ -430,6 +434,10 @@ > </File> <File + RelativePath="..\..\..\lib\slice.h" + > + </File> + <File RelativePath="..\..\..\lib\video.h" > </File> Copied: branches/team/mihai/echocan/contrib/win/vs2005/testcall.vcproj (from rev 1184, trunk/contrib/win/vs2005/testcall.vcproj) =================================================================== --- branches/team/mihai/echocan/contrib/win/vs2005/testcall.vcproj (rev 0) +++ branches/team/mihai/echocan/contrib/win/vs2005/testcall.vcproj 2007-10-09 16:02:48 UTC (rev 1185) @@ -0,0 +1,206 @@ +<?xml version="1.0" encoding="Windows-1252"?> +<VisualStudioProject + ProjectType="Visual C++" + Version="8.00" + Name="testcall" + ProjectGUID="{6F5AEE93-BA87-465B-BC75-C41C434FC4E4}" + RootNamespace="testcall" + Keyword="Win32Proj" + > + <Platforms> + <Platform + Name="Win32" + /> + </Platforms> + <ToolFiles> + </ToolFiles> + <Configurations> + <Configuration + Name="Debug|Win32" + OutputDirectory="$(SolutionDir)$(ConfigurationName)\$(ProjectName)" + IntermediateDirectory="$(OutDir)" + ConfigurationType="1" + CharacterSet="2" + > + <Tool + Name="VCPreBuildEventTool" + /> + <Tool + Name="VCCustomBuildTool" + /> + <Tool + Name="VCXMLDataGeneratorTool" + /> + <Tool + Name="VCWebServiceProxyGeneratorTool" + /> + <Tool + Name="VCMIDLTool" + /> + <Tool + Name="VCCLCompilerTool" + Optimization="0" + AdditionalIncludeDirectories="..\..\..\lib" + PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE" + MinimalRebuild="true" + BasicRuntimeChecks="3" + RuntimeLibrary="3" + WarningLevel="3" + Detect64BitPortabilityProblems="true" + DebugInformationFormat="4" + CompileAs="1" + /> + <Tool + Name="VCManagedResourceCompilerTool" + /> + <Tool + Name="VCResourceCompilerTool" + /> + <Tool + Name="VCPreLinkEventTool" + /> + <Tool + Name="VCLinkerTool" + AdditionalDependencies="libiaxclient.lib ws2_32.lib" + LinkIncremental="2" + AdditionalLibraryDirectories="$(SolutionDir)$(ConfigurationName)\libiaxclient" + IgnoreDefaultLibraryNames="libcmtd.lib" + GenerateDebugInformation="true" + SubSystem="1" + TargetMachine="1" + /> + <Tool + Name="VCALinkTool" + /> + <Tool + Name="VCManifestTool" + /> + <Tool + Name="VCXDCMakeTool" + /> + <Tool + Name="VCBscMakeTool" + /> + <Tool + Name="VCFxCopTool" + /> + <Tool + Name="VCAppVerifierTool" + /> + <Tool + Name="VCWebDeploymentTool" + /> + <Tool + Name="VCPostBuildEventTool" + /> + </Configuration> + <Configuration + Name="Release|Win32" + OutputDirectory="$(SolutionDir)$(ConfigurationName)\$(ProjectName)" + IntermediateDirectory="$(OutDir)" + ConfigurationType="1" + CharacterSet="2" + WholeProgramOptimization="1" + > + <Tool + Name="VCPreBuildEventTool" + /> + <Tool + Name="VCCustomBuildTool" + /> + <Tool + Name="VCXMLDataGeneratorTool" + /> + <Tool + Name="VCWebServiceProxyGeneratorTool" + /> + <Tool + Name="VCMIDLTool" + /> + <Tool + Name="VCCLCompilerTool" + AdditionalIncludeDirectories="..\..\..\lib" + PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE" + RuntimeLibrary="2" + WarningLevel="3" + Detect64BitPortabilityProblems="true" + DebugInformationFormat="3" + CompileAs="1" + /> + <Tool + Name="VCManagedResourceCompilerTool" + /> + <Tool + Name="VCResourceCompilerTool" + /> + <Tool + Name="VCPreLinkEventTool" + /> + <Tool + Name="VCLinkerTool" + IgnoreImportLibrary="false" + AdditionalDependencies="libiaxclient.lib ws2_32.lib" + LinkIncremental="1" + AdditionalLibraryDirectories="$(SolutionDir)$(ConfigurationName)\libiaxclient" + IgnoreDefaultLibraryNames="" + GenerateDebugInformation="true" + SubSystem="1" + OptimizeReferences="2" + EnableCOMDATFolding="2" + TargetMachine="1" + /> + <Tool + Name="VCALinkTool" + /> + <Tool + Name="VCManifestTool" + /> + <Tool + Name="VCXDCMakeTool" + /> + <Tool + Name="VCBscMakeTool" + /> + <Tool + Name="VCFxCopTool" + /> + <Tool + Name="VCAppVerifierTool" + /> + <Tool + Name="VCWebDeploymentTool" + /> + <Tool + Name="VCPostBuildEventTool" + /> + </Configuration> + </Configurations> + <References> + </References> + <Files> + <Filter + Name="Source Files" + Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx" + UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}" + > + <File + RelativePath="..\..\..\simpleclient\testcall\testcall.c" + > + </File> + </Filter> + <Filter + Name="Header Files" + Filter="h;hpp;hxx;hm;inl;inc;xsd" + UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}" + > + </Filter> + <Filter + Name="Resource Files" + Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav" + UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}" + > + </Filter> + </Files> + <Globals> + </Globals> +</VisualStudioProject> Modified: branches/team/mihai/echocan/lib/audio_encode.c =================================================================== --- branches/team/mihai/echocan/lib/audio_encode.c 2007-10-08 23:02:47 UTC (rev 1184) +++ branches/team/mihai/echocan/lib/audio_encode.c 2007-10-09 16:02:48 UTC (rev 1185) @@ -71,8 +71,8 @@ { /* avoid calling log10() on zero which yields inf or * negative numbers which yield nan */ - if ( vol <= 0.0 ) - return -99.9; + if ( vol <= 0.0f ) + return -99.9f; else return log10f(vol) * 20; } Modified: branches/team/mihai/echocan/lib/audio_portaudio.c =================================================================== --- branches/team/mihai/echocan/lib/audio_portaudio.c 2007-10-08 23:02:47 UTC (rev 1184) +++ branches/team/mihai/echocan/lib/audio_portaudio.c 2007-10-09 16:02:48 UTC (rev 1185) @@ -106,6 +106,7 @@ static int auxStream; static int virtualMonoIn; static int virtualMonoOut; +static int virtualMonoRing; static int running; @@ -202,12 +203,12 @@ } } -static void mix_slin(short *dst, short *src, int samples) +static void mix_slin(short *dst, short *src, int samples, int virtualMono) { int i=0,val=0; for ( i=0; i < samples; i++ ) { - if ( virtualMonoOut ) + if ( virtualMono ) val = ((short *)dst)[2*i] + ((short *)src)[i]; else val = ((short *)dst)[i] + ((short *)src)[i]; @@ -220,7 +221,7 @@ val = -0x7fff+1; } - if ( virtualMonoOut ) + if ( virtualMono ) { dst[2*i] = val; dst[2*i+1] = val; @@ -232,7 +233,7 @@ } } -static int pa_mix_sounds (void *outputBuffer, unsigned long frames, int channel) +static int pa_mix_sounds (void *outputBuffer, unsigned long frames, int channel, int virtualMono) { struct iaxc_sound *s; struct iaxc_sound **sp; @@ -280,7 +281,7 @@ /* mix in the frames */ mix_slin((short *)outputBuffer + outpos, - s->data+s->pos, n); + s->data+s->pos, n, virtualMono); s->pos += n; outpos += n; @@ -396,10 +397,10 @@ /* zero underflowed space [ silence might be more golden * than garbage? ] */ - pa_mix_sounds(outputBuffer, samplesPerFrame, 0); + pa_mix_sounds(outputBuffer, samplesPerFrame, 0, virtualMonoOut); if(!auxStream) - pa_mix_sounds(outputBuffer, samplesPerFrame, 1); + pa_mix_sounds(outputBuffer, samplesPerFrame, 1, virtualMonoOut); } @@ -433,13 +434,12 @@ PaStreamCallbackFlags statusFlags, void *userData) { - int totBytes = samplesPerFrame * sizeof(SAMPLE); + int totBytes = samplesPerFrame * sizeof(SAMPLE) * (virtualMonoRing + 1); - /* XXX: need to handle virtualMonoOut case!!! */ if ( outputBuffer ) { memset((char *)outputBuffer, 0, totBytes); - pa_mix_sounds(outputBuffer, samplesPerFrame, 1); + pa_mix_sounds(outputBuffer, samplesPerFrame, 1, virtualMonoRing); } return 0; } @@ -578,36 +578,20 @@ { PaError err; - /* FEEDBACK - iaxclient seems to assume that the ring device is a - * mono device. I can't find any mono devices on the Mac and so - * ring device opening will fail. My code assumes the ring device - * is a stereo device - this might break stuff */ - struct PaStreamParameters ring_stream_params, no_device; + struct PaStreamParameters ring_stream_params; - struct PaStreamParameters in_stream_params; - in_stream_params.device = selectedInput; - in_stream_params.channelCount = virtualMonoOut + 1; - in_stream_params.sampleFormat = paInt16; - in_stream_params.suggestedLatency = - Pa_GetDeviceInfo(selectedInput)->defaultLowInputLatency; - in_stream_params.hostApiSpecificStreamInfo = NULL; - + // setup the ring parameters ring_stream_params.device = selectedRing; - ring_stream_params.channelCount = virtualMonoOut+1; ring_stream_params.sampleFormat = paInt16; ring_stream_params.suggestedLatency = Pa_GetDeviceInfo(selectedRing)->defaultLowOutputLatency; ring_stream_params.hostApiSpecificStreamInfo = NULL; - no_device.device = paNoDevice; - no_device.channelCount = 0; - no_device.sampleFormat = paInt16; - no_device.suggestedLatency = - Pa_GetDeviceInfo(selectedInput)->defaultLowInputLatency; //TODOC - no_device.hostApiSpecificStreamInfo = NULL; + // first we'll try mono + ring_stream_params.channelCount = 1; - err = Pa_OpenStream ( &aStream, - &in_stream_params, + err = Pa_OpenStream(&aStream, + NULL, &ring_stream_params, iaxci_sample_rate, paFramesPerBufferUnspecified, //FEEBACK - unsure if appropriate @@ -617,14 +601,15 @@ if ( err != paNoError ) { - /* FEEDBACK, we try one more time, maybe ring device is a mono - * output device */ - err = Pa_OpenStream ( &aStream, - &no_device, + // next we'll try virtual mono (stereo) + ring_stream_params.channelCount = 1; + + err = Pa_OpenStream(&aStream, + NULL, &ring_stream_params, iaxci_sample_rate, paFramesPerBufferUnspecified, //FEEBACK - unsure if appropriate - paNoFlag, /* flags */ + paNoFlag, (PaStreamCallback *)pa_aux_callback, NULL); } @@ -632,13 +617,16 @@ // mmok, failure... if ( err != paNoError ) { - //fprintf(stderr, "Failure opening ring device with params: id: %d, output %d, default output %d\n", - //selectedRing, selectedOutput, Pa_GetDefaultOutputDevice()); + // fprintf(stderr, "Failure opening ring device with params: id: %d, output %d, default output %d\n", + // selectedRing, selectedOutput, Pa_GetDefaultOutputDevice()); handle_paerror(err, "opening separate ring stream"); return -1; } + // Determine whether virtual mono is being used + virtualMonoRing = ring_stream_params.channelCount - 1; + return 0; } @@ -665,7 +653,8 @@ if ( errcnt > 5 ) { iaxci_usermsg(IAXC_TEXT_TYPE_FATALERROR, - "iaxclient audio: Can't open Audio Device. Perhaps you do not have an input or output device?"); + "iaxclient audio: Can't open Audio Device. " + "Perhaps you do not have an input or output device?"); /* OK, we'll give the application the option to abort or * not here, but we will throw a fatal error anyway */ iaxc_millisleep(1000); Modified: branches/team/mihai/echocan/lib/iaxclient.h =================================================================== --- branches/team/mihai/echocan/lib/iaxclient.h 2007-10-08 23:02:47 UTC (rev 1184) +++ branches/team/mihai/echocan/lib/iaxclient.h 2007-10-09 16:02:48 UTC (rev 1185) @@ -22,7 +22,7 @@ #ifdef __cplusplus extern "C" { #endif - + /*! \file iaxclient.h \brief The IAXClient API @@ -635,7 +635,7 @@ \return The UDP port bound to; -1 if no port or */ -EXPORT short iaxc_get_bind_port(); +EXPORT int iaxc_get_bind_port(); /*! Initializes the IAXClient library @@ -764,6 +764,12 @@ EXPORT void iaxc_dump_all_calls(void); /*! + Hangs up and frees call \a callNo + \param callNo The call number to reject. +*/ +EXPORT void iaxc_dump_call_number( int callNo ); + +/*! Hangs up and frees the currently selected call. */ EXPORT void iaxc_dump_call(void); Modified: branches/team/mihai/echocan/lib/iaxclient_lib.c =================================================================== --- branches/team/mihai/echocan/lib/iaxclient_lib.c 2007-10-08 23:02:47 UTC (rev 1184) +++ branches/team/mihai/echocan/lib/iaxclient_lib.c 2007-10-09 16:02:48 UTC (rev 1185) @@ -99,7 +99,7 @@ static MUTEX iaxc_lock; static MUTEX event_queue_lock; -static short iaxci_bound_port = -1; +static int iaxci_bound_port = -1; // default to use port 4569 unless set by iaxc_set_preferred_source_udp_port static int source_udp_port = IAX_DEFAULT_PORTNO; @@ -554,7 +554,7 @@ return iax_video_bypass_jitter(calls[selected_call].session,mode); } -EXPORT short iaxc_get_bind_port() +EXPORT int iaxc_get_bind_port() { return iaxci_bound_port; } @@ -590,7 +590,7 @@ } if ( iaxc_recvfrom == (iaxc_recvfrom_t)recvfrom ) - iaxci_bound_port = (short)port; + iaxci_bound_port = port; else iaxci_bound_port = -1; @@ -655,7 +655,7 @@ #endif IAXC_FORMAT_SPEEX; audio_format_preferred = IAXC_FORMAT_SPEEX; - + return 0; } @@ -665,7 +665,6 @@ get_iaxc_lock(); - audio_driver.destroy(&audio_driver); if ( !test_mode ) { audio_driver.destroy(&audio_driver); @@ -759,7 +758,7 @@ get_iaxc_lock(); service_network(); - if ( !test_mode ) + if ( !test_mode ) service_audio(); // Check registration refresh once a second @@ -789,7 +788,7 @@ while ( !video_proc_thread_flag ) { - if (selected_call >= 0) + if ( selected_call >= 0 ) call = &calls[selected_call]; else call = NULL; @@ -923,7 +922,7 @@ \deprecated Q: Why do we continuously send IAXC_EVENT_LEVELS events when there is no selected call? - + A: So that certain users of iaxclient do not have to reset their vu meters when a call ends -- they can just count on getting level callbacks. This is a bit of a hack @@ -1089,7 +1088,7 @@ #ifdef WIN32 //fd: start: for some reason it loops here. Try to avoid it cycles_max--; - if (cycles_max<0) + if ( cycles_max < 0 ) { iaxc_millisleep(0); } @@ -1111,9 +1110,9 @@ continue; if ( !test_mode ) - audio_driver.output(&audio_driver, fr, + audio_driver.output(&audio_driver, fr, fr_samples - samples - mainbuf_delta); - + } while ( total_consumed < e->datalen ); } @@ -1198,8 +1197,8 @@ break; case IAX_EVENT_VOICE: handle_audio_event(e, callNo); - if ((calls[callNo].state & IAXC_CALL_STATE_OUTGOING) && - (calls[callNo].state & IAXC_CALL_STATE_RINGING) ) + if ( (calls[callNo].state & IAXC_CALL_STATE_OUTGOING) && + (calls[callNo].state & IAXC_CALL_STATE_RINGING) ) { calls[callNo].state &= ~IAXC_CALL_STATE_RINGING; iaxci_do_state_callback(callNo); @@ -1337,13 +1336,13 @@ get_iaxc_lock(); // if no call is selected, get a new appearance - if (selected_call < 0) + if ( selected_call < 0 ) { callNo = iaxc_first_free_call(); } else { // use selected call if not active, otherwise, get a new appearance - if (calls[selected_call].state & IAXC_CALL_STATE_ACTIVE) + if ( calls[selected_call].state & IAXC_CALL_STATE_ACTIVE ) { callNo = iaxc_first_free_call(); } else @@ -1352,14 +1351,14 @@ } } - if (callNo < 0) + if ( callNo < 0 ) { iaxci_usermsg(IAXC_STATUS, "No free call appearances"); goto iaxc_call_bail; } newsession = iax_session_new(); - if (!newsession) + if ( !newsession ) { iaxci_usermsg(IAXC_ERROR, "Can't make new session"); goto iaxc_call_bail; @@ -1369,7 +1368,7 @@ codec_destroy( callNo ); - if (ext) + if ( ext ) { strncpy(calls[callNo].remote_name, num, IAXC_EVENT_BUFSIZ); strncpy(calls[callNo].remote, ++ext, IAXC_EVENT_BUFSIZ); @@ -1379,10 +1378,10 @@ strncpy(calls[callNo].remote, "" , IAXC_EVENT_BUFSIZ); } - if (callerid_number != NULL) + if ( callerid_number != NULL ) strncpy(calls[callNo].callerid_number, callerid_number, IAXC_EVENT_BUFSIZ); - - if (callerid_name != NULL) + + if ( callerid_name != NULL ) strncpy(calls[callNo].callerid_name, callerid_name, IAXC_EVENT_BUFSIZ); strncpy(calls[callNo].local , calls[callNo].callerid_name, IAXC_EVENT_BUFSIZ); @@ -1395,7 +1394,7 @@ calls[callNo].last_ping = calls[callNo].last_activity; #ifdef USE_VIDEO - if (video) + if ( video ) iaxc_video_format_get_cap(&video_format_preferred, &video_format_capability); #endif @@ -1425,7 +1424,8 @@ EXPORT void iaxc_answer_call(int callNo) { - if (callNo < 0) return; + if ( callNo < 0 ) + return; calls[callNo].state |= IAXC_CALL_STATE_COMPLETE; calls[callNo].state &= ~IAXC_CALL_STATE_RINGING; @@ -1435,8 +1435,7 @@ EXPORT void iaxc_blind_transfer_call(int callNo, const char * dest_extension) { - if ((callNo < 0) || - !(calls[callNo].state & IAXC_CALL_STATE_ACTIVE)) + if ( callNo < 0 || !(calls[callNo].state & IAXC_CALL_STATE_ACTIVE) ) return; iax_transfer(calls[callNo].session, dest_extension); @@ -1444,9 +1443,9 @@ EXPORT void iaxc_setup_call_transfer(int sourceCallNo, int targetCallNo) { - if ((sourceCallNo < 0) || (targetCallNo < 0) || - ((calls[sourceCallNo].state & IAXC_CALL_STATE_ACTIVE) == 0) || - ((calls[targetCallNo].state & IAXC_CALL_STATE_ACTIVE) == 0)) + if ( sourceCallNo < 0 || targetCallNo < 0 || + !(calls[sourceCallNo].state & IAXC_CALL_STATE_ACTIVE) || + !(calls[targetCallNo].state & IAXC_CALL_STATE_ACTIVE) ) return; iax_setup_transfer(calls[sourceCallNo].session, calls[targetCallNo].session); @@ -1454,9 +1453,9 @@ static void iaxc_dump_one_call(int callNo) { - if (callNo < 0) + if ( callNo < 0 ) return; - if (calls[callNo].state == IAXC_CALL_STATE_FREE) + if ( calls[callNo].state == IAXC_CALL_STATE_FREE ) return; iax_hangup(calls[callNo].session,"Dumped Call"); @@ -1474,9 +1473,19 @@ } +EXPORT void iaxc_dump_call_number( int callNo ) +{ + if ( ( callNo >= 0 ) && ( callNo < max_calls ) ) + { + get_iaxc_lock(); + iaxc_dump_one_call(callNo); + put_iaxc_lock(); + } +} + EXPORT void iaxc_dump_call(void) { - if (selected_call >= 0) + if ( selected_call >= 0 ) { get_iaxc_lock(); iaxc_dump_one_call(selected_call); @@ -1486,7 +1495,7 @@ EXPORT void iaxc_reject_call(void) { - if (selected_call >= 0) + if ( selected_call >= 0 ) { iaxc_reject_call_number(selected_call); } @@ -1494,7 +1503,7 @@ EXPORT void iaxc_reject_call_number( int callNo ) { - if (callNo >= 0) + if ( ( callNo >= 0 ) && ( callNo < max_calls ) ) { get_iaxc_lock(); iax_reject(calls[callNo].session, "Call rejected manually."); @@ -1505,10 +1514,10 @@ EXPORT void iaxc_send_dtmf(char digit) { - if (selected_call >= 0) + if ( selected_call >= 0 ) { get_iaxc_lock(); - if (calls[selected_call].state & IAXC_CALL_STATE_ACTIVE) + if ( calls[selected_call].state & IAXC_CALL_STATE_ACTIVE ) iax_send_dtmf(calls[selected_call].session,digit); put_iaxc_lock(); } @@ -1516,10 +1525,10 @@ EXPORT void iaxc_send_text(const char * text) { - if (selected_call >= 0) + if ( selected_call >= 0 ) { get_iaxc_lock(); - if (calls[selected_call].state & IAXC_CALL_STATE_ACTIVE) + if ( calls[selected_call].state & IAXC_CALL_STATE_ACTIVE ) iax_send_text(calls[selected_call].session, text); put_iaxc_lock(); } @@ -1527,10 +1536,10 @@ EXPORT void iaxc_send_url(const char * url, int link) { - if (selected_call >= 0) + if ( selected_call >= 0 ) { get_iaxc_lock(); - if (calls[selected_call].state & IAXC_CALL_STATE_ACTIVE) + if ( calls[selected_call].state & IAXC_CALL_STATE_ACTIVE ) iax_send_url(calls[selected_call].session, url, link); put_iaxc_lock(); } @@ -1540,7 +1549,7 @@ { int i; for ( i = 0; i < max_calls; i++ ) - if (calls[i].session == session) + if ( calls[i].session == session ) return i; return -1; } @@ -1550,7 +1559,8 @@ { struct iaxc_registration *reg; for (reg = registrations; reg != NULL; reg = reg->next) - if (reg->session == session) break; + if ( reg->session == session ) + break; return reg; } @@ -1564,7 +1574,7 @@ iax_destroy(reg->session); reg->session = NULL; - if (e->etype == IAX_EVENT_REGREJ) + if ( e->etype == IAX_EVENT_REGREJ ) { // we were rejected, so end the registration iaxc_remove_registration_by_id(reg->id); @@ -1663,7 +1673,7 @@ /* first, see if they even want video */ video_format = (e->ies.format & IAXC_VIDEO_FORMAT_MASK); - if (video_format) + if ( video_format ) { /* next, try _their_ preferred format */ video_format &= video_format_capability; @@ -1680,7 +1690,7 @@ /* finally, see if we have one in common */ video_format = video_format_capability & (e->ies.capability & IAXC_VIDEO_FORMAT_MASK); - + /* now choose amongst these, if we got one */ if ( video_format ) { @@ -1759,23 +1769,23 @@ #endif // first, see if this is an event for one of our calls. callNo = iaxc_find_call_by_session(e->session); - if (callNo >= 0) + if ( callNo >= 0 ) { iaxc_handle_network_event(e, callNo); - } else if ((reg = iaxc_find_registration_by_session(e->session)) != NULL) + } else if ( (reg = iaxc_find_registration_by_session(e->session)) != NULL ) { iaxc_handle_regreply(e,reg); - } else if ((e->etype == IAX_EVENT_REGACK) || (e->etype == IAX_EVENT_REGREJ)) + } else if ( e->etype == IAX_EVENT_REGACK || e->etype == IAX_EVENT_REGREJ ) { iaxci_usermsg(IAXC_ERROR, "Unexpected registration reply"); - } else if (e->etype == IAX_EVENT_REGREQ) + } else if ( e->etype == IAX_EVENT_REGREQ ) { iaxci_usermsg(IAXC_ERROR, "Registration requested by someone, but we don't understand!"); - } else if (e->etype == IAX_EVENT_CONNECT) + } else if ( e->etype == IAX_EVENT_CONNECT ) { iaxc_handle_connect(e); - } else if (e->etype == IAX_EVENT_TIMEOUT) + } else if ( e->etype == IAX_EVENT_TIMEOUT ) { iaxci_usermsg(IAXC_STATUS, "Timeout for a non-existant session. Dropping", @@ -1809,10 +1819,11 @@ EXPORT int iaxc_audio_devices_set(int input, int output, int ring) { + int ret; + if ( test_mode ) return 0; - int ret = 0; get_iaxc_lock(); ret = audio_driver.select_devices(&audio_driver, input, output, ring); put_iaxc_lock(); @@ -1853,10 +1864,11 @@ EXPORT int iaxc_play_sound(struct iaxc_sound *s, int ring) { + int ret; + if ( test_mode ) return 0; - - int ret = 0; + get_iaxc_lock(); ret = audio_driver.play_sound(s,ring); put_iaxc_lock(); @@ -1865,10 +1877,11 @@ EXPORT int iaxc_stop_sound(int id) { + int ret; + if ( test_mode ) return 0; - - int ret = 0; + get_iaxc_lock(); ret = audio_driver.stop_sound(id); put_iaxc_lock(); @@ -1878,7 +1891,7 @@ EXPORT int iaxc_quelch(int callNo, int MOH) { struct iax_session *session = calls[callNo].session; - if (!session) + if ( !session ) return -1; return iax_quelch_moh(session, MOH); @@ -1900,13 +1913,11 @@ } #ifdef LIBVER - EXPORT char* iaxc_version(char * ver) { strncpy(ver, LIBVER, IAXC_EVENT_BUFSIZ); return ver; } - #endif EXPORT unsigned int iaxc_get_audio_prefs(void) @@ -1938,17 +1949,17 @@ EXPORT int iaxc_push_audio(void *data, unsigned int size, unsigned int samples) { struct iaxc_call *call; - - if (selected_call < 0) + + if ( selected_call < 0 ) return -1; - + call = &calls[selected_call]; if ( audio_prefs & IAXC_AUDIO_PREF_SEND_DISABLE ) return 0; - + //fprintf(stderr, "iaxc_push_audio: sending audio size %d\n", size); - + if ( iax_send_voice(call->session, call->format, data, size, samples) == -1 ) { fprintf(stderr, "iaxc_push_audio: failed to send audio frame of size %d on call %d\n", size, selected_call); Modified: branches/team/mihai/echocan/lib/libiax2/src/iax.c =================================================================== --- branches/team/mihai/echocan/lib/libiax2/src/iax.c 2007-10-08 23:02:47 UTC (rev 1184) +++ branches/team/mihai/echocan/lib/libiax2/src/iax.c 2007-10-09 16:02:48 UTC (rev 1185) @@ -992,9 +992,8 @@ DEBU(G "Started on port %d\n", portno); } - //srand((unsigned int)time(0)); - //callnums = rand() % 32767 + 1; - callnums = 1; + srand((unsigned int)time(0)); + callnums = rand() % 32767 + 1; transfer_id = rand() % 32767 + 1; return portno; Modified: branches/team/mihai/echocan/lib/video.c =================================================================== --- branches/team/mihai/echocan/lib/video.c 2007-10-08 23:02:47 UTC (rev 1184) +++ branches/team/mihai/echocan/lib/video.c 2007-10-09 16:02:48 UTC (rev 1185) @@ -15,6 +15,7 @@ */ #include <assert.h> +#include <stdlib.h> #include "video.h" #include "slice.h" @@ -893,8 +894,9 @@ { int i; - if ( sc == NULL ) - sc = create_slicer_context(random(), iaxc_video_fragsize); + if ( !sc ) + sc = create_slicer_context((unsigned short)rand(), + iaxc_video_fragsize); slice(data, size, &slice_set, sc); for ( i = 0 ; i < slice_set.num_slices ; i++ ) Modified: branches/team/mihai/echocan/simpleclient/stresstest/stresstest.c =================================================================== --- branches/team/mihai/echocan/simpleclient/stresstest/stresstest.c 2007-10-08 23:02:47 UTC (rev 1184) +++ branches/team/mihai/echocan/simpleclient/stresstest/stresstest.c 2007-10-09 16:02:48 UTC (rev 1185) @@ -32,6 +32,11 @@ #define MAX_CALLS 1 +#define TEST_OK 0 +#define TEST_NO_CONNECTION -1 +#define TEST_NO_MEDIA -2 +#define TEST_UNKNOWN_ERROR -99 + //int format = IAXC_FORMAT_THEORA | IAXC_FORMAT_SPEEX; int format = IAXC_FORMAT_H263 | IAXC_FORMAT_H263_PLUS | IAXC_FORMAT_H264 | IAXC_FORMAT_MPEG4 | IAXC_FORMAT_THEORA; int formatp = IAXC_FORMAT_H264; //IAXC_FORMAT_THEORA; @@ -42,6 +47,7 @@ int fragsize = 1400; int call_established = 0; +int running = 0; // Forward declaration void process_text_message(char *message); @@ -51,34 +57,42 @@ int send_video = 1; int send_audio = 1; int print_netstats = 0; +int timeout = 0; +int video_frames_count = 0; +int audio_frames_count = 0; +struct timeval start_time; + // Audio-cosmetic... struct iaxc_sound sound_ringOUT, sound_ringIN; -/* routine called at exit to shutdown audio I/O and close nicely. -NOTE: If all this isnt done, the system doesnt not handle this -cleanly and has to be rebooted. What a pile of doo doo!! */ -void killem(void) +/* routine used to shutdown and close nicely.*/ +void hangup_and_exit(int code) { + fprintf(stderr,"Dump call\n"); + iaxc_dump_call(); + fprintf(stderr,"Sleep for 500 msec\n"); + iaxc_millisleep(500); + fprintf(stderr,"Stop processing thread\n"); + iaxc_stop_processing_thread(); fprintf(stderr,"Calling iaxc_shutdown..."); iaxc_shutdown(); - fprintf(stderr,"Done\nProgram terminated correctly.\n"); - exit(0); + fprintf(stderr,"Exiting with code %d\n", code); + exit(code); } void signal_handler(int signum) { if ( signum == SIGTERM || signum == SIGINT ) { - killem(); - exit(0); + running = 0; } } -void fatal_error(char *err) { - killem(); +void fatal_error(char *err) +{ fprintf(stderr, "FATAL ERROR: %s\n", err); - exit(1); + exit(TEST_UNKNOWN_ERROR); } int levels_callback(float input, float output) { @@ -123,17 +137,6 @@ return 0; } -void hangup_and_exit(void) -{ - iaxc_dump_call(); - fprintf(stderr,"Dumped call\n"); - iaxc_millisleep(1000); - fprintf(stderr,"Sleeped for 1000 msec\n"); - iaxc_stop_processing_thread(); - fprintf(stderr,"Stopped processing thread\n"); - killem(); -} - void process_text_message(char *message) { unsigned int prefs; @@ -170,6 +173,7 @@ "-a stop sending audio\n" "-l run file in a loop\n" "-n dump periodic netstats to stderr\n" + "-t <timeout> terminate after timeout seconds and report status via return code\n" "\n" ); exit(1); @@ -184,22 +188,10 @@ fprintf(stderr, "Call answered\n"); call_established = 1; } - // Finished the phase of handshaking for the call in entry - if (s.state == (IAXC_CALL_STATE_ACTIVE|IAXC_CALL_STATE_RINGING)) - { - fprintf(stderr,"Auto-Answering to caller %s on line %d...\n",s.remote,s.callNo); - //iaxc_unquelch(s.callNo); - iaxc_millisleep(1000); - iaxc_answer_call(s.callNo); - iaxc_select_call(s.callNo); - call_established = 1; - //iaxc_millisleep(1000); - return 0; - } if (s.state == IAXC_CALL_STATE_FREE) { - fprintf(stderr,"Disconnect from other end\n"); - hangup_and_exit(); + fprintf(stderr,"Call terminated\n"); + running = 0; } return 0; @@ -219,7 +211,11 @@ case IAXC_EVENT_STATE: return test_mode_state_callback(e.ev.call); case IAXC_EVENT_VIDEO: + video_frames_count++; + break; case IAXC_EVENT_AUDIO: + audio_frames_count++; + break; default: break; } @@ -236,6 +232,7 @@ int video_frame_index; static struct slice_set_t slice_set; unsigned short source_id; + struct timeval now; /* install signal handler to catch CRTL-Cs */ signal(SIGINT, signal_handler); @@ -275,6 +272,11 @@ case 'n': print_netstats = 1; break; + case 't': + if ( i+1 >= argc ) + usage(); + timeout = 1000 * atoi(argv[++i]); + break; default: usage(); } @@ -297,7 +299,10 @@ // Load ogg file load_ogg_file(ogg_file); } - + + // Get start time for timeouts + gettimeofday(&start_time, NULL); + // Initialize iaxclient iaxc_video_format_set(formatp, format, framerate, bitrate, width, height, fragsize); iaxc_set_test_mode(1); @@ -306,8 +311,8 @@ iaxc_set_formats(IAXC_FORMAT_SPEEX, IAXC_FORMAT_SPEEX); iaxc_video_bypass_jitter(0); - iaxc_set_audio_prefs(0); - iaxc_set_video_prefs(0); + iaxc_set_audio_prefs(IAXC_AUDIO_PREF_RECV_REMOTE_ENCODED); + iaxc_set_video_prefs(IAXC_VIDEO_PREF_RECV_REMOTE_ENCODED); iaxc_set_event_callback(test_mode_callback); // Crank the engine @@ -322,9 +327,15 @@ // Wait for the call to be established; while ( !call_established ) + { + gettimeofday(&now, NULL); + if ( timeout > 0 && iaxci_msecdiff(&now, &start_time) > timeout ) + hangup_and_exit(TEST_NO_CONNECTION); iaxc_millisleep(5); + } - while ( 42 ) + running = 1; + while ( running ) { // We only need this if we actually want to send something if ( ogg_file && ( send_audio || send_video ) ) @@ -346,8 +357,17 @@ // Tight spinloops are bad, mmmkay? iaxc_millisleep(5); + + // Exit after a positive timeout + gettimeofday(&now, NULL); + if ( timeout > 0 && iaxci_msecdiff(&now, &start_time) > timeout ) + running = 0; } - hangup_and_exit(); + fprintf(stderr, "Received %d audio frames and %d video frames\n", audio_frames_count, video_frames_count); + if ( audio_frames_count == 0 && video_frames_count == 0 ) + hangup_and_exit(TEST_NO_MEDIA); + else + hangup_and_exit(TEST_OK); return 0; } Modified: branches/team/mihai/echocan/simpleclient/testcall/testcall.c =================================================================== --- branches/team/mihai/echocan/simpleclient/testcall/testcall.c 2007-10-08 23:02:47 UTC (rev 1184) +++ branches/team/mihai/echocan/simpleclient/testcall/testcall.c 2007-10-09 16:02:48 UTC (rev 1185) @@ -27,7 +27,7 @@ #include "iaxclient.h" -#define LEVEL_INCREMENT 0.10 +#define LEVEL_INCREMENT 0.10f /* static int answered_call; */ static char *output_filename = NULL; @@ -163,8 +163,8 @@ char c; int i; char *dest = NULL; - double silence_threshold = -99; - double level; + float silence_threshold = -99.0f; + float level; f = stdout; @@ -185,7 +185,7 @@ break; case 's': if(i+1 >= argc) usage(); - silence_threshold = atof(argv[++i]); + silence_threshold = (float)atof(argv[++i]); break; case 'u': if(i+1 >= argc) usage(); Deleted: branches/team/mihai/echocan/simpleclient/testcall/testcall.vcproj =================================================================== --- branches/team/mihai/echocan/simpleclient/testcall/testcall.vcproj 2007-10-08 23:02:47 UTC (rev 1184) +++ branches/team/mihai/echocan/simpleclient/testcall/testcall.vcproj 2007-10-09 16:02:48 UTC (rev 1185) @@ -1,207 +0,0 @@ -<?xml version="1.0" encoding="Windows-1252"?> -<VisualStudioProject - ProjectType="Visual C++" - Version="8.00" - Name="testcall" - ProjectGUID="{6F5AEE93-BA87-465B-BC75-C41C434FC4E4}" - RootNamespace="testcall" - Keyword="Win32Proj" - > - <Platforms> - <Platform - Name="Win32" - /> - </Platforms> - <ToolFiles> - </ToolFiles> - <Configurations> - <Configuration - Name="Debug|Win32" - OutputDirectory="$(SolutionDir)$(ConfigurationName)" - IntermediateDirectory="$(ConfigurationName)" - ConfigurationType="1" - CharacterSet="1" - > - <Tool - Name="VCPreBuildEventTool" - /> - <Tool - Name="VCCustomBuildTool" - /> - <Tool - Name="VCXMLDataGeneratorTool" - /> - <Tool - Name="VCWebServiceProxyGeneratorTool" - /> - <Tool - Name="VCMIDLTool" - /> - <Tool - Name="VCCLCompilerTool" - Optimization="0" - AdditionalIncludeDirectories="..\..\lib\portaudio\pa_common;..\..\lib\speex\libspeex;".. \..\lib\portaudio\pablio";..\..\lib;..\..\lib\SDL\include;"$(SDL_DIR)\include"" - PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;_CONSOLE;WITH_THREAD;_USE_MATH_DEFINES;IAXC_IAX2;LIBIAX;SPEEX_PREPROCESS=1;PORTAUDIO_DIRECTX;USE_WIN_AUDIO=1;HIRES_TIME;NEWJB;PA_USE_TIMER_CALLBACK=1" - MinimalRebuild="true" - BasicRuntimeChecks="3" - RuntimeLibrary="3" - UsePrecompiledHeader="0" - WarningLevel="3" - Detect64BitPortabilityProblems="true" - DebugInformationFormat="4" - /> - <Tool - Name="VCManagedResourceCompilerTool" - /> - <Tool - Name="VCResourceCompilerTool" - /> - <Tool - Name="VCPreLinkEventTool" - /> - <Tool - Name="VCLinkerTool" - AdditionalDependencies="dsound.lib iaxclient.lib libtheora.lib libogg.lib SDL.lib wsock32.lib winmm.lib videolib.lib libiax2.lib gsm.lib portaudio.lib libspeex.lib strmiids.lib portmixerd.lib" - OutputFile="$(OutDir)\..\..\simpleclient\testcall\Debug\$(ProjectName).exe" - LinkIncremental="2" - AdditionalLibraryDirectories=""$(DXSDK_DIR)\lib\x86";..\..\lib\Debug;"$(SDL_DIR)\lib";"$(PSDK_DIR)\lib";..\..\lib\portmixer\winproj" - IgnoreDefaultLibraryNames="libcmtd.lib" - GenerateDebugInformation="true" - SubSystem="1" - TargetMachine="1" - /> - <Tool - Name="VCALinkTool" - /> - <Tool - Name="VCManifestTool" - /> - <Tool - Name="VCXDCMakeTool" - /> - <Tool - Name="VCBscMakeTool" - /> - <Tool - Name="VCFxCopTool" - /> - <Tool - Name="VCAppVerifierTool" - /> - <Tool - Name="VCWebDeploymentTool" - /> - <Tool - Name="VCPostBuildEventTool" - /> - </Configuration> - <Configuration - Name="Release|Win32" - OutputDirectory="$(SolutionDir)$(ConfigurationName)" - IntermediateDirectory="$(ConfigurationName)" - ConfigurationType="1" - CharacterSet="1" - WholeProgramOptimization="1" - > - <Tool - Name="VCPreBuildEventTool" - /> - <Tool - Name="VCCustomBuildTool" - /> - <Tool - Name="VCXMLDataGeneratorTool" - /> - <Tool - Name="VCWebServiceProxyGeneratorTool" - /> - <Tool - Name="VCMIDLTool" - /> - <Tool - Name="VCCLCompilerTool" - AdditionalIncludeDirectories="..\..\lib\portaudio\pa_common;..\..\lib\speex\libspeex;".. \..\lib\portaudio\pablio";..\..\lib;..\..\lib\SDL\include;"$(SDL_DIR)\include"" - PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;_CONSOLE;WITH_THREAD;_USE_MATH_DEFINES;IAXC_IAX2;LIBIAX;SPEEX_PREPROCESS=1;PORTAUDIO_DIRECTX;USE_WIN_AUDIO=1;HIRES_TIME;NEWJB;PA_USE_TIMER_CALLBACK=1" - RuntimeLibrary="2" - UsePrecompiledHeader="0" - WarningLevel="3" - Detect64BitPortabilityProblems="true" - DebugInformationFormat="3" - /> - <Tool - Name="VCManagedResourceCompilerTool" - /> - <Tool - Name="VCResourceCompilerTool" - /> - <Tool - Name="VCPreLinkEventTool" - /> - <Tool - Name="VCLinkerTool" - IgnoreImportLibrary="false" - AdditionalDependencies="dsound.lib iaxclient.lib libtheora.lib libogg.lib SDL.lib wsock32.lib winmm.lib videolib.lib libiax2.lib gsm.lib portaudio.lib libspeex.lib strmiids.lib portmixer.lib" - LinkIncremental="1" - AdditionalLibraryDirectories=""$(DXSDK_DIR)\lib\x86";..\..\lib\Release;"$(SDL_DIR)\lib";"$(PSDK_DIR)\lib";..\..\lib\portmixer\winproj" - IgnoreDefaultLibraryNames="msvcrtd.lib;msvcrt.lib;libcmtd.lib" - GenerateDebugInformation="true" - SubSystem="1" - OptimizeReferences="2" - EnableCOMDATFolding="2" - TargetMachine="1" - /> - <Tool - Name="VCALinkTool" - /> - <Tool - Name="VCManifestTool" - /> - <Tool - Name="VCXDCMakeTool" - /> - <Tool - Name="VCBscMakeTool" - /> - <Tool - Name="VCFxCopTool" - /> - <Tool - Name="VCAppVerifierTool" - /> - <Tool - Name="VCWebDeploymentTool" - /> - <Tool - Name="VCPostBuildEventTool" - /> - </Configuration> - </Configurations> - <References> - </References> - <Files> - <Filter - Name="Source Files" - Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx" - UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}" - > - <File - RelativePath="..\..\simpleclient\testcall\testcall.c" - > - </File> - </Filter> - <Filter - Name="Header Files" - Filter="h;hpp;hxx;hm;inl;inc;xsd" - UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}" - > - </Filter> - <Filter - Name="Resource Files" - Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav" - UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}" - > - </Filter> - </Files> - <Globals> - </Globals> -</VisualStudioProject> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sb...@us...> - 2007-10-11 17:42:32
|
Revision: 1192 http://iaxclient.svn.sourceforge.net/iaxclient/?rev=1192&view=rev Author: sbalea Date: 2007-10-11 10:42:33 -0700 (Thu, 11 Oct 2007) Log Message: ----------- Synchronize with trunk rev 1191 Revision Links: -------------- http://iaxclient.svn.sourceforge.net/iaxclient/?rev=1191&view=rev Modified Paths: -------------- branches/team/mihai/echocan/lib/iaxclient_lib.c branches/team/mihai/echocan/simpleclient/stresstest/Makefile.am Modified: branches/team/mihai/echocan/lib/iaxclient_lib.c =================================================================== --- branches/team/mihai/echocan/lib/iaxclient_lib.c 2007-10-10 18:42:43 UTC (rev 1191) +++ branches/team/mihai/echocan/lib/iaxclient_lib.c 2007-10-11 17:42:33 UTC (rev 1192) @@ -1702,9 +1702,9 @@ if ( !video_format ) { iaxci_usermsg(IAXC_NOTICE, - "Notice: could not negotiate common video codec"); + "Notice: could not negotiate common video codec"); iaxci_usermsg(IAXC_NOTICE, - "Notice: switching to audio-only call"); + "Notice: switching to audio-only call"); } } #endif /* USE_VIDEO */ Modified: branches/team/mihai/echocan/simpleclient/stresstest/Makefile.am =================================================================== --- branches/team/mihai/echocan/simpleclient/stresstest/Makefile.am 2007-10-10 18:42:43 UTC (rev 1191) +++ branches/team/mihai/echocan/simpleclient/stresstest/Makefile.am 2007-10-11 17:42:33 UTC (rev 1192) @@ -4,4 +4,13 @@ AM_CPPFLAGS=-I$(top_srcdir)/lib $(SDL_CFLAGS) $(OGGZ_CFLAGS) $(THEORA_CFLAGS) stresstest_LDADD=$(top_builddir)/lib/libiaxclient.la $(OGGZ_LIBS) $(THEORA_LIBS) +if MACOSX +stresstest_LDFLAGS = \ + -framework AudioToolbox \ + -framework AudioUnit \ + -framework Carbon \ + -framework CoreAudio \ + -framework Quicktime +endif + EXTRA_DIST = stresstest.vcproj This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sb...@us...> - 2007-10-15 14:10:45
|
Revision: 1196 http://iaxclient.svn.sourceforge.net/iaxclient/?rev=1196&view=rev Author: sbalea Date: 2007-10-15 07:10:41 -0700 (Mon, 15 Oct 2007) Log Message: ----------- Synchronize with trunk rev 1195 Revision Links: -------------- http://iaxclient.svn.sourceforge.net/iaxclient/?rev=1195&view=rev Modified Paths: -------------- branches/team/mihai/echocan/lib/Makefile.am branches/team/mihai/echocan/lib/iaxclient_lib.c branches/team/mihai/echocan/lib/ringbuffer.c branches/team/mihai/echocan/simpleclient/stresstest/Makefile.am Modified: branches/team/mihai/echocan/lib/Makefile.am =================================================================== --- branches/team/mihai/echocan/lib/Makefile.am 2007-10-12 16:56:38 UTC (rev 1195) +++ branches/team/mihai/echocan/lib/Makefile.am 2007-10-15 14:10:41 UTC (rev 1196) @@ -57,7 +57,7 @@ if MACOSX SRCS += $(SRCS_MACOSX) -AM_LDFLAGS += -framework Quicktime +AM_LDFLAGS += -framework QuickTime if VIDEO SRCS += $(SRCS_MACOSX_VIDEO) endif Modified: branches/team/mihai/echocan/lib/iaxclient_lib.c =================================================================== --- branches/team/mihai/echocan/lib/iaxclient_lib.c 2007-10-12 16:56:38 UTC (rev 1195) +++ branches/team/mihai/echocan/lib/iaxclient_lib.c 2007-10-15 14:10:41 UTC (rev 1196) @@ -1201,6 +1201,7 @@ (calls[callNo].state & IAXC_CALL_STATE_RINGING) ) { calls[callNo].state &= ~IAXC_CALL_STATE_RINGING; + calls[callNo].state |= IAXC_CALL_STATE_COMPLETE; iaxci_do_state_callback(callNo); iaxci_usermsg(IAXC_STATUS,"Call %d progress", callNo); Modified: branches/team/mihai/echocan/lib/ringbuffer.c =================================================================== --- branches/team/mihai/echocan/lib/ringbuffer.c 2007-10-12 16:56:38 UTC (rev 1195) +++ branches/team/mihai/echocan/lib/ringbuffer.c 2007-10-15 14:10:41 UTC (rev 1196) @@ -104,10 +104,15 @@ # define rb_FullMemoryBarrier() asm volatile("sync":::"memory") # define rb_ReadMemoryBarrier() asm volatile("sync":::"memory") # define rb_WriteMemoryBarrier() asm volatile("sync":::"memory") -# elif defined( __i386__ ) || defined( __i486__ ) || defined( __i586__ ) || defined( __i686__ ) +# elif defined( __SSE2__ ) # define rb_FullMemoryBarrier() asm volatile("mfence":::"memory") # define rb_ReadMemoryBarrier() asm volatile("lfence":::"memory") # define rb_WriteMemoryBarrier() asm volatile("sfence":::"memory") +# elif defined( __i386__ ) || defined( __i486__ ) || defined( __i586__ ) || defined( __i686__ ) +# define DO_X86_RUNTIME_CPU_DETECTION +# define rb_FullMemoryBarrier() if ( have_sse2 ) asm volatile("mfence":::"memory") +# define rb_ReadMemoryBarrier() if ( have_sse2 ) asm volatile("lfence":::"memory") +# define rb_WriteMemoryBarrier() if ( have_sse2 ) asm volatile("sfence":::"memory") # else # ifdef ALLOW_SMP_DANGERS # warning Memory barriers not defined on this system or system unknown @@ -144,12 +149,32 @@ # endif #endif +#ifdef DO_X86_RUNTIME_CPU_DETECTION +#define cpuid(func, ax, bx, cx, dx) \ + __asm__ __volatile__ ("xchgl\t%%ebx, %1\n\t" \ + "cpuid\n\t" \ + "xchgl\t%%ebx, %1\n\t" \ + : "=a" (ax), "=r" (bx), "=c" (cx), "=d" (dx) \ + : "0" (func)) + +static int have_sse2 = 0; +#endif + /*************************************************************************** * Initialize FIFO. * numBytes must be power of 2, returns -1 if not. */ long rb_InitializeRingBuffer( rb_RingBuffer *rbuf, long numBytes, void *dataPtr ) { +#ifdef DO_X86_RUNTIME_CPU_DETECTION + /* See http://softpixel.com/~cwright/programming/simd/cpuid.php + * for a good description of how all this works. + */ + int a, b, c, d; + cpuid(1, a, b, c, d); + have_sse2 = d & (1 << 26); +#endif + if( ((numBytes-1) & numBytes) != 0) return -1; /* Not Power of two. */ rbuf->bufferSize = numBytes; rbuf->buffer = (char *)dataPtr; Modified: branches/team/mihai/echocan/simpleclient/stresstest/Makefile.am =================================================================== --- branches/team/mihai/echocan/simpleclient/stresstest/Makefile.am 2007-10-12 16:56:38 UTC (rev 1195) +++ branches/team/mihai/echocan/simpleclient/stresstest/Makefile.am 2007-10-15 14:10:41 UTC (rev 1196) @@ -10,7 +10,7 @@ -framework AudioUnit \ -framework Carbon \ -framework CoreAudio \ - -framework Quicktime + -framework QuickTime endif EXTRA_DIST = stresstest.vcproj This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sb...@us...> - 2007-10-22 16:51:11
|
Revision: 1222 http://iaxclient.svn.sourceforge.net/iaxclient/?rev=1222&view=rev Author: sbalea Date: 2007-10-22 09:51:10 -0700 (Mon, 22 Oct 2007) Log Message: ----------- Synchronize with trunk rev 1221. This includes changes to replace videoLib with vidlibcap Revision Links: -------------- http://iaxclient.svn.sourceforge.net/iaxclient/?rev=1221&view=rev Modified Paths: -------------- branches/team/mihai/echocan/configure.ac branches/team/mihai/echocan/contrib/win/vs2005/iaxclient.sln branches/team/mihai/echocan/contrib/win/vs2005/libiaxclient.vcproj branches/team/mihai/echocan/lib/Makefile.am branches/team/mihai/echocan/lib/audio_encode.c branches/team/mihai/echocan/lib/audio_encode.h branches/team/mihai/echocan/lib/codec_theora.c branches/team/mihai/echocan/lib/iaxclient.h branches/team/mihai/echocan/lib/iaxclient_lib.c branches/team/mihai/echocan/lib/iaxclient_lib.h branches/team/mihai/echocan/lib/video.c branches/team/mihai/echocan/lib/video.h branches/team/mihai/echocan/simpleclient/stresstest/Makefile.am branches/team/mihai/echocan/simpleclient/stresstest/file.c branches/team/mihai/echocan/simpleclient/stresstest/stresstest.c branches/team/mihai/echocan/simpleclient/testcall/Makefile.am branches/team/mihai/echocan/simpleclient/vtestcall/vtestcall.c branches/team/mihai/echocan/simpleclient/vtestcall/vtestcall.vcproj Removed Paths: ------------- branches/team/mihai/echocan/lib/libiax2/.cvsignore branches/team/mihai/echocan/lib/libiax2/src/.cvsignore branches/team/mihai/echocan/lib/videoLib/ branches/team/mihai/echocan/simpleclient/testcall/.cvsignore Modified: branches/team/mihai/echocan/configure.ac =================================================================== --- branches/team/mihai/echocan/configure.ac 2007-10-22 16:28:22 UTC (rev 1221) +++ branches/team/mihai/echocan/configure.ac 2007-10-22 16:51:10 UTC (rev 1222) @@ -135,13 +135,17 @@ [Theora support])],, with_theora="auto") +AC_ARG_WITH(vidcap, + [AS_HELP_STRING([--without-vidcap], + [libvidcap support])],, + with_vidcap="auto") + AC_ARG_WITH(ffmpeg, [AS_HELP_STRING([--with-ffmpeg], [FFmpeg support])], FFMPEG="${with_ffmpeg}", with_ffmpeg="no") - if test ! "x$enable_clients" = "xauto"; then for client in ${enable_clients}; do case "$client" in @@ -239,6 +243,22 @@ fi AM_CONDITIONAL(THEORA, test x$has_theora = xyes) +has_vidcap=no +if test ! x$with_vidcap = xno; then + PKG_CHECK_MODULES(VIDCAP, [vidcap >= 0.1],has_vidcap=yes) + if test x$has_vidcap = xyes; then + AC_DEFINE(USE_VIDCAP, 1, [VIDCAP]) + PKG_REQUIRES="$PKG_REQUIRES vidcap" + elif test ! x$with_vidcap = xauto ; then + AC_MSG_ERROR([ + libvidcap is required to build this package! + please see http://libvidcap.sourceforge.net/ for how to + obtain a copy. + ]) + fi +fi +AM_CONDITIONAL(VIDCAP, test x$has_vidcap = xyes) + has_ffmpeg=no if test ! x$with_ffmpeg = xno; then PKG_CHECK_MODULES(FFMPEG, [libavcodec >= 51.40.3],has_ffmpeg=yes) Modified: branches/team/mihai/echocan/contrib/win/vs2005/iaxclient.sln =================================================================== --- branches/team/mihai/echocan/contrib/win/vs2005/iaxclient.sln 2007-10-22 16:28:22 UTC (rev 1221) +++ branches/team/mihai/echocan/contrib/win/vs2005/iaxclient.sln 2007-10-22 16:51:10 UTC (rev 1222) @@ -1,8 +1,6 @@ Microsoft Visual Studio Solution File, Format Version 9.00 # Visual Studio 2005 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libvideolib", "libvideolib.vcproj", "{BE15A94D-3766-4693-ABA8-5FBAACBBCC08}" -EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libportmixer", "libportmixer.vcproj", "{3A76129B-55AB-4D54-BAA7-08F63ED52569}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libportaudio", "libportaudio.vcproj", "{3B023516-2C69-4CCB-9302-239991B6EC2C}" @@ -10,13 +8,13 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libiaxclient", "libiaxclient.vcproj", "{9A9C003E-EAF6-4D0E-896F-E3994503C7E4}" ProjectSection(ProjectDependencies) = postProject {3B023516-2C69-4CCB-9302-239991B6EC2C} = {3B023516-2C69-4CCB-9302-239991B6EC2C} - {BE15A94D-3766-4693-ABA8-5FBAACBBCC08} = {BE15A94D-3766-4693-ABA8-5FBAACBBCC08} + {F5166D99-32BB-40D5-BE95-6F97F72C44CE} = {F5166D99-32BB-40D5-BE95-6F97F72C44CE} + {E2C6AD95-7A61-41FE-8754-A4623C891BF8} = {E2C6AD95-7A61-41FE-8754-A4623C891BF8} + {E972C52F-9E85-4D65-B19C-031E511E9DB4} = {E972C52F-9E85-4D65-B19C-031E511E9DB4} + {2F463562-375D-481E-A6E0-7C7D0DC1ED7A} = {2F463562-375D-481E-A6E0-7C7D0DC1ED7A} + {5CC054B7-6DAA-46BF-9A08-3B33B83E8D3E} = {5CC054B7-6DAA-46BF-9A08-3B33B83E8D3E} + {3A76129B-55AB-4D54-BAA7-08F63ED52569} = {3A76129B-55AB-4D54-BAA7-08F63ED52569} {82C9BD79-9796-405F-8A28-3F538514AC3A} = {82C9BD79-9796-405F-8A28-3F538514AC3A} - {3A76129B-55AB-4D54-BAA7-08F63ED52569} = {3A76129B-55AB-4D54-BAA7-08F63ED52569} - {5CC054B7-6DAA-46BF-9A08-3B33B83E8D3E} = {5CC054B7-6DAA-46BF-9A08-3B33B83E8D3E} - {2F463562-375D-481E-A6E0-7C7D0DC1ED7A} = {2F463562-375D-481E-A6E0-7C7D0DC1ED7A} - {E972C52F-9E85-4D65-B19C-031E511E9DB4} = {E972C52F-9E85-4D65-B19C-031E511E9DB4} - {E2C6AD95-7A61-41FE-8754-A4623C891BF8} = {E2C6AD95-7A61-41FE-8754-A4623C891BF8} EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libiax2", "libiax2.vcproj", "{5CC054B7-6DAA-46BF-9A08-3B33B83E8D3E}" @@ -34,6 +32,8 @@ {9A9C003E-EAF6-4D0E-896F-E3994503C7E4} = {9A9C003E-EAF6-4D0E-896F-E3994503C7E4} EndProjectSection EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libvidcap", "..\..\..\..\libvidcap\contrib\win\vs2005\libvidcap.vcproj", "{F5166D99-32BB-40D5-BE95-6F97F72C44CE}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug_dll|Win32 = Debug_dll|Win32 @@ -42,14 +42,6 @@ Release|Win32 = Release|Win32 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution - {BE15A94D-3766-4693-ABA8-5FBAACBBCC08}.Debug_dll|Win32.ActiveCfg = Debug|Win32 - {BE15A94D-3766-4693-ABA8-5FBAACBBCC08}.Debug_dll|Win32.Build.0 = Debug|Win32 - {BE15A94D-3766-4693-ABA8-5FBAACBBCC08}.Debug|Win32.ActiveCfg = Debug|Win32 - {BE15A94D-3766-4693-ABA8-5FBAACBBCC08}.Debug|Win32.Build.0 = Debug|Win32 - {BE15A94D-3766-4693-ABA8-5FBAACBBCC08}.Release_dll|Win32.ActiveCfg = Release|Win32 - {BE15A94D-3766-4693-ABA8-5FBAACBBCC08}.Release_dll|Win32.Build.0 = Release|Win32 - {BE15A94D-3766-4693-ABA8-5FBAACBBCC08}.Release|Win32.ActiveCfg = Release|Win32 - {BE15A94D-3766-4693-ABA8-5FBAACBBCC08}.Release|Win32.Build.0 = Release|Win32 {3A76129B-55AB-4D54-BAA7-08F63ED52569}.Debug_dll|Win32.ActiveCfg = Debug|Win32 {3A76129B-55AB-4D54-BAA7-08F63ED52569}.Debug_dll|Win32.Build.0 = Debug|Win32 {3A76129B-55AB-4D54-BAA7-08F63ED52569}.Debug|Win32.ActiveCfg = Debug|Win32 @@ -122,6 +114,14 @@ {6F5AEE93-BA87-465B-BC75-C41C434FC4E4}.Release_dll|Win32.Build.0 = Release|Win32 {6F5AEE93-BA87-465B-BC75-C41C434FC4E4}.Release|Win32.ActiveCfg = Release|Win32 {6F5AEE93-BA87-465B-BC75-C41C434FC4E4}.Release|Win32.Build.0 = Release|Win32 + {F5166D99-32BB-40D5-BE95-6F97F72C44CE}.Debug_dll|Win32.ActiveCfg = Debug|Win32 + {F5166D99-32BB-40D5-BE95-6F97F72C44CE}.Debug_dll|Win32.Build.0 = Debug|Win32 + {F5166D99-32BB-40D5-BE95-6F97F72C44CE}.Debug|Win32.ActiveCfg = Debug|Win32 + {F5166D99-32BB-40D5-BE95-6F97F72C44CE}.Debug|Win32.Build.0 = Debug|Win32 + {F5166D99-32BB-40D5-BE95-6F97F72C44CE}.Release_dll|Win32.ActiveCfg = Release|Win32 + {F5166D99-32BB-40D5-BE95-6F97F72C44CE}.Release_dll|Win32.Build.0 = Release|Win32 + {F5166D99-32BB-40D5-BE95-6F97F72C44CE}.Release|Win32.ActiveCfg = Release|Win32 + {F5166D99-32BB-40D5-BE95-6F97F72C44CE}.Release|Win32.Build.0 = Release|Win32 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE Modified: branches/team/mihai/echocan/contrib/win/vs2005/libiaxclient.vcproj =================================================================== --- branches/team/mihai/echocan/contrib/win/vs2005/libiaxclient.vcproj 2007-10-22 16:28:22 UTC (rev 1221) +++ branches/team/mihai/echocan/contrib/win/vs2005/libiaxclient.vcproj 2007-10-22 16:51:10 UTC (rev 1222) @@ -39,8 +39,8 @@ <Tool Name="VCCLCompilerTool" Optimization="0" - AdditionalIncludeDirectories="..\..\..\lib\libiax2\src;..\..\..\..\portaudio\include;..\..\..\lib\spandsp;..\..\..\lib\gsm\inc;..\..\..\..\speex\include;..\..\..\..\libogg\include;..\..\..\..\libtheora\include;..\..\..\lib\portmixer\px_common" - PreprocessorDefinitions="WIN32;_DEBUG;_LIB;PA_NO_DS;PA_NO_ASIO;BUILDING_DLL;LIBIAX;SPEEX_EC=1;_CRT_SECURE_NO_DEPRECATE;strncasecmp=strnicmp;__inline__=_inline;NTDDI_VERSION=NTDDI_WIN2KSP4;_WIN32_WINNT=0x0500;WINVER=0x0500;USE_VIDEO;USE_THEORA" + AdditionalIncludeDirectories="..\..\..\lib\libiax2\src;..\..\..\..\portaudio\include;..\..\..\lib\spandsp;..\..\..\lib\gsm\inc;..\..\..\..\speex\include;..\..\..\..\libogg\include;..\..\..\..\libtheora\include;..\..\..\lib\portmixer\px_common;..\..\..\..\libvidcap\include" + PreprocessorDefinitions="WIN32;_DEBUG;_LIB;PA_NO_DS;PA_NO_ASIO;BUILDING_DLL;LIBIAX;_CRT_SECURE_NO_DEPRECATE;strncasecmp=strnicmp;__inline__=_inline;SPEEX_EC=1;NTDDI_VERSION=NTDDI_WIN2KSP4;_WIN32_WINNT=0x0500;WINVER=0x0500;USE_VIDEO;USE_THEORA" BasicRuntimeChecks="3" RuntimeLibrary="3" WarningLevel="3" @@ -59,8 +59,8 @@ /> <Tool Name="VCLibrarianTool" - AdditionalDependencies="libiax2.lib libvideolib.lib libportmixer.lib libportaudio.lib libgsm.lib libogg.lib libspeex.lib libtheora.lib comsuppw.lib strmiids.lib wininet.lib" - AdditionalLibraryDirectories=""$(SolutionDir)$(ConfigurationName)\libiax2";"$(SolutionDir)$(ConfigurationName)\libvideolib";"$(SolutionDir)$(ConfigurationName)\libportaudio";"$(SolutionDir)$(ConfigurationName)\libportmixer";"$(SolutionDir)$(ConfigurationName)\libogg";"$(SolutionDir)$(ConfigurationName)\libtheora";"$(SolutionDir)$(ConfigurationName)\libspeex";"$(SolutionDir)$(ConfigurationName)\libgsm"" + AdditionalDependencies="libiax2.lib libvidcap.lib libportmixer.lib libportaudio.lib libgsm.lib libogg.lib libspeex.lib libtheora.lib comsuppw.lib strmiids.lib wininet.lib" + AdditionalLibraryDirectories=""$(SolutionDir)$(ConfigurationName)\libiax2";"$(SolutionDir)$(ConfigurationName)\libvidcap";"$(SolutionDir)$(ConfigurationName)\libportaudio";"$(SolutionDir)$(ConfigurationName)\libportmixer";"$(SolutionDir)$(ConfigurationName)\libogg";"$(SolutionDir)$(ConfigurationName)\libtheora";"$(SolutionDir)$(ConfigurationName)\libspeex";"$(SolutionDir)$(ConfigurationName)\libgsm"" /> <Tool Name="VCALinkTool" @@ -103,8 +103,8 @@ /> <Tool Name="VCCLCompilerTool" - AdditionalIncludeDirectories="..\..\..\lib\libiax2\src;..\..\..\..\portaudio\include;..\..\..\lib\spandsp;..\..\..\lib\gsm\inc;..\..\..\..\speex\include;..\..\..\..\libogg\include;..\..\..\..\libtheora\include;..\..\..\lib\portmixer\px_common" - PreprocessorDefinitions="WIN32;NDEBUG;_LIB;PA_NO_DS;PA_NO_ASIO;BUILDING_DLL;LIBIAX;SPEEX_EC=1;_CRT_SECURE_NO_DEPRECATE;strncasecmp=strnicmp;__inline__=_inline;NTDDI_VERSION=NTDDI_WIN2KSP4;_WIN32_WINNT=0x0500;WINVER=0x0500;USE_VIDEO;USE_THEORA" + AdditionalIncludeDirectories="..\..\..\lib\libiax2\src;..\..\..\..\portaudio\include;..\..\..\lib\spandsp;..\..\..\lib\gsm\inc;..\..\..\..\speex\include;..\..\..\..\libogg\include;..\..\..\..\libtheora\include;..\..\..\lib\portmixer\px_common;..\..\..\..\libvidcap\include" + PreprocessorDefinitions="WIN32;NDEBUG;_LIB;PA_NO_DS;PA_NO_ASIO;BUILDING_DLL;LIBIAX;_CRT_SECURE_NO_DEPRECATE;strncasecmp=strnicmp;__inline__=_inline;SPEEX_EC=1;NTDDI_VERSION=NTDDI_WIN2KSP4;_WIN32_WINNT=0x0500;WINVER=0x0500;USE_VIDEO;USE_THEORA" RuntimeLibrary="2" WarningLevel="3" Detect64BitPortabilityProblems="true" @@ -122,8 +122,8 @@ /> <Tool Name="VCLibrarianTool" - AdditionalDependencies="libiax2.lib libvideolib.lib libportmixer.lib libportaudio.lib libgsm.lib libogg.lib libspeex.lib libtheora.lib comsuppw.lib strmiids.lib wininet.lib" - AdditionalLibraryDirectories=""$(SolutionDir)$(ConfigurationName)\libiax2";"$(SolutionDir)$(ConfigurationName)\libvideolib";"$(SolutionDir)$(ConfigurationName)\libportaudio";"$(SolutionDir)$(ConfigurationName)\libportmixer";"$(SolutionDir)$(ConfigurationName)\libogg";"$(SolutionDir)$(ConfigurationName)\libtheora";"$(SolutionDir)$(ConfigurationName)\libspeex";"$(SolutionDir)$(ConfigurationName)\libgsm"" + AdditionalDependencies="libiax2.lib libvidcap.lib libportmixer.lib libportaudio.lib libgsm.lib libogg.lib libspeex.lib libtheora.lib comsuppw.lib strmiids.lib wininet.lib" + AdditionalLibraryDirectories=""$(SolutionDir)$(ConfigurationName)\libiax2";"$(SolutionDir)$(ConfigurationName)\libvidcap";"$(SolutionDir)$(ConfigurationName)\libportaudio";"$(SolutionDir)$(ConfigurationName)\libportmixer";"$(SolutionDir)$(ConfigurationName)\libogg";"$(SolutionDir)$(ConfigurationName)\libtheora";"$(SolutionDir)$(ConfigurationName)\libspeex";"$(SolutionDir)$(ConfigurationName)\libgsm"" /> <Tool Name="VCALinkTool" @@ -166,8 +166,8 @@ /> <Tool Name="VCCLCompilerTool" - AdditionalIncludeDirectories="..\..\..\lib\libiax2\src;..\..\..\..\portaudio\include;..\..\..\lib\spandsp;..\..\..\lib\gsm\inc;..\..\..\..\speex\include;..\..\..\..\libogg\include;..\..\..\..\libtheora\include;..\..\..\lib\portmixer\px_common" - PreprocessorDefinitions="WIN32;NDEBUG;_LIB;PA_NO_DS;PA_NO_ASIO;BUILDING_DLL;LIBIAX;SPEEX_EC=1;_CRT_SECURE_NO_DEPRECATE;strncasecmp=strnicmp;__inline__=_inline;NTDDI_VERSION=NTDDI_WIN2KSP4;_WIN32_WINNT=0x0500;WINVER=0x0500" + AdditionalIncludeDirectories="..\..\..\lib\libiax2\src;..\..\..\..\portaudio\include;..\..\..\lib\spandsp;..\..\..\lib\gsm\inc;..\..\..\..\speex\include;..\..\..\..\libogg\include;..\..\..\..\libtheora\include;..\..\..\lib\portmixer\px_common;..\..\..\..\libvidcap\include" + PreprocessorDefinitions="WIN32;NDEBUG;_LIB;PA_NO_DS;PA_NO_ASIO;BUILDING_DLL;LIBIAX;_CRT_SECURE_NO_DEPRECATE;strncasecmp=strnicmp;__inline__=_inline;SPEEX_EC=1;NTDDI_VERSION=NTDDI_WIN2KSP4;_WIN32_WINNT=0x0500;WINVER=0x0500" RuntimeLibrary="2" WarningLevel="3" Detect64BitPortabilityProblems="true" @@ -185,8 +185,8 @@ /> <Tool Name="VCLinkerTool" - AdditionalDependencies="libiax2.lib libvideolib.lib libportmixer.lib libportaudio.lib libgsm.lib libogg.lib libspeex.lib libtheora.lib comsuppw.lib strmiids.lib wininet.lib ws2_32.lib" - AdditionalLibraryDirectories=""$(SolutionDir)Release\libiax2";"$(SolutionDir)Release\libvideolib";"$(SolutionDir)Release\libportaudio";"$(SolutionDir)Release\libportmixer";"$(SolutionDir)Release\libogg";"$(SolutionDir)Release\libtheora";"$(SolutionDir)Release\libspeex";"$(SolutionDir)Release\libgsm"" + AdditionalDependencies="libiax2.lib libvidcap.lib libportmixer.lib libportaudio.lib libgsm.lib libogg.lib libspeex.lib libtheora.lib comsuppw.lib strmiids.lib wininet.lib ws2_32.lib" + AdditionalLibraryDirectories=""$(SolutionDir)Release\libiax2";"$(SolutionDir)Release\libvidcap";"$(SolutionDir)Release\libportaudio";"$(SolutionDir)Release\libportmixer";"$(SolutionDir)Release\libogg";"$(SolutionDir)Release\libtheora";"$(SolutionDir)Release\libspeex";"$(SolutionDir)Release\libgsm"" /> <Tool Name="VCALinkTool" @@ -238,8 +238,8 @@ <Tool Name="VCCLCompilerTool" Optimization="0" - AdditionalIncludeDirectories="..\..\..\lib\libiax2\src;..\..\..\..\portaudio\include;..\..\..\lib\spandsp;..\..\..\lib\gsm\inc;..\..\..\..\speex\include;..\..\..\..\libogg\include;..\..\..\..\libtheora\include;..\..\..\lib\portmixer\px_common" - PreprocessorDefinitions="WIN32;_DEBUG;_LIB;PA_NO_DS;PA_NO_ASIO;BUILDING_DLL;LIBIAX;SPEEX_EC=1;_CRT_SECURE_NO_DEPRECATE;strncasecmp=strnicmp;__inline__=_inline;NTDDI_VERSION=NTDDI_WIN2KSP4;_WIN32_WINNT=0x0500;WINVER=0x0500" + AdditionalIncludeDirectories="..\..\..\lib\libiax2\src;..\..\..\..\portaudio\include;..\..\..\lib\spandsp;..\..\..\lib\gsm\inc;..\..\..\..\speex\include;..\..\..\..\libogg\include;..\..\..\..\libtheora\include;..\..\..\lib\portmixer\px_common;..\..\..\..\libvidcap\include" + PreprocessorDefinitions="WIN32;_DEBUG;_LIB;PA_NO_DS;PA_NO_ASIO;BUILDING_DLL;LIBIAX;_CRT_SECURE_NO_DEPRECATE;strncasecmp=strnicmp;__inline__=_inline;SPEEX_EC=1;NTDDI_VERSION=NTDDI_WIN2KSP4;_WIN32_WINNT=0x0500;WINVER=0x0500" BasicRuntimeChecks="3" RuntimeLibrary="3" WarningLevel="3" @@ -258,8 +258,8 @@ /> <Tool Name="VCLinkerTool" - AdditionalDependencies="libiax2.lib libvideolib.lib libportmixer.lib libportaudio.lib libgsm.lib libogg.lib libspeex.lib libtheora.lib comsuppw.lib strmiids.lib wininet.lib ws2_32.lib" - AdditionalLibraryDirectories=""$(SolutionDir)Debug\libiax2";"$(SolutionDir)Debug\libvideolib";"$(SolutionDir)Debug\libportaudio";"$(SolutionDir)Debug\libportmixer";"$(SolutionDir)Debug\libogg";"$(SolutionDir)Debug\libtheora";"$(SolutionDir)Debug\libspeex";"$(SolutionDir)Debug\libgsm"" + AdditionalDependencies="libiax2.lib libvidcap.lib libportmixer.lib libportaudio.lib libgsm.lib libogg.lib libspeex.lib libtheora.lib comsuppw.lib strmiids.lib wininet.lib ws2_32.lib" + AdditionalLibraryDirectories=""$(SolutionDir)Debug\libiax2";"$(SolutionDir)Debug\libvidcap";"$(SolutionDir)Debug\libportaudio";"$(SolutionDir)Debug\libportmixer";"$(SolutionDir)Debug\libogg";"$(SolutionDir)Debug\libtheora";"$(SolutionDir)Debug\libspeex";"$(SolutionDir)Debug\libgsm"" /> <Tool Name="VCALinkTool" @@ -390,6 +390,10 @@ > </File> <File + RelativePath="..\..\..\lib\audio_encode.h" + > + </File> + <File RelativePath="..\..\..\lib\audio_portaudio.h" > </File> Modified: branches/team/mihai/echocan/lib/Makefile.am =================================================================== --- branches/team/mihai/echocan/lib/Makefile.am 2007-10-22 16:28:22 UTC (rev 1221) +++ branches/team/mihai/echocan/lib/Makefile.am 2007-10-22 16:51:10 UTC (rev 1222) @@ -40,32 +40,24 @@ if WIN32 SRCS += $(SRCS_WIN32) libiaxclient_la_LIBADD += -lwinmm -lwsock32 +endif -if VIDEO -SRCS += $(SRCS_WIN32_VIDEO) -AM_CPPFLAGS += -I$(srcdir)/videoLib -endif VIDEO -endif WIN32 - if LINUX SRCS += $(SRCS_LINUX) - -if VIDEO -SRCS += $(SRCS_LINUX_VIDEO) endif -endif LINUX if MACOSX SRCS += $(SRCS_MACOSX) AM_LDFLAGS += -framework QuickTime -if VIDEO -SRCS += $(SRCS_MACOSX_VIDEO) endif -endif MACOSX if VIDEO SRCS += $(SRCS_VIDEO) +if VIDCAP +libiaxclient_la_LIBADD += $(VIDCAP_LIBS) +AM_CFLAGS += $(VIDCAP_CFLAGS) endif +endif if USE_LOCAL_GSM SRCS += $(SRCS_LIBGSM) @@ -153,9 +145,7 @@ SRCS_VIDEO= \ video.c \ - video.h \ - videoLib/video_grab.c \ - videoLib/video_grab.h + video.h SRCS_ILBC= \ iLBC/anaFilter.c \ @@ -186,30 +176,14 @@ winfuncs.c \ portmixer/px_win_wmme/px_win_wmme.c -SRCS_WIN32_VIDEO= \ - videoLib/win32/wingrab.cpp - SRCS_LINUX= \ portmixer/px_unix_oss/px_unix_oss.c \ unixfuncs.c -SRCS_LINUX_VIDEO= \ - videoLib/linux/libfg/capture.c \ - videoLib/linux/libfg/capture.h \ - videoLib/linux/libfg/frame.c \ - videoLib/linux/libfg/frame.h \ - videoLib/linux/libfg/libfg.h \ - videoLib/linux/linuxgrab.c - SRCS_MACOSX= \ portmixer/px_mac_core/px_mac_core.c \ unixfuncs.c -SRCS_MACOSX_VIDEO= \ - videoLib/macosx/macgrab.c \ - videoLib/macosx/vdigGrab.c \ - videoLib/macosx/vdigGrab.h - SRCS_IAX2= \ libiax2/src/md5.c \ libiax2/src/iax.c \ Modified: branches/team/mihai/echocan/lib/audio_encode.c =================================================================== --- branches/team/mihai/echocan/lib/audio_encode.c 2007-10-22 16:28:22 UTC (rev 1221) +++ branches/team/mihai/echocan/lib/audio_encode.c 2007-10-22 16:51:10 UTC (rev 1222) @@ -31,10 +31,10 @@ #endif #ifdef CODEC_ILBC - #include "codec_ilbc.h" +#include "codec_ilbc.h" #endif -float iaxci_silence_threshold = -99.0f; +float iaxci_silence_threshold = AUDIO_ENCODE_SILENCE_DB; static float input_level = 0.0f; static float output_level = 0.0f; @@ -72,9 +72,9 @@ /* avoid calling log10() on zero which yields inf or * negative numbers which yield nan */ if ( vol <= 0.0f ) - return -99.9f; + return AUDIO_ENCODE_SILENCE_DB; else - return log10f(vol) * 20; + return log10f(vol) * 20.0f; } static int do_level_callback() @@ -93,11 +93,11 @@ /* if input has not been processed in the last second, set to silent */ input_db = iaxci_usecdiff(&now, &timeLastInput) < 1000000 ? - vol_to_db(input_level) : -99.9f; + vol_to_db(input_level) : AUDIO_ENCODE_SILENCE_DB; /* if output has not been processed in the last second, set to silent */ output_db = iaxci_usecdiff(&now, &timeLastOutput) < 1000000 ? - vol_to_db(output_level) : -99.9f; + vol_to_db(output_level) : AUDIO_ENCODE_SILENCE_DB; iaxci_do_levels_callback(input_db, output_db); @@ -109,7 +109,7 @@ int i; //float f; - if(!st) + if ( !st ) return; i = 1; /* always make VAD decision */ Modified: branches/team/mihai/echocan/lib/audio_encode.h =================================================================== --- branches/team/mihai/echocan/lib/audio_encode.h 2007-10-22 16:28:22 UTC (rev 1221) +++ branches/team/mihai/echocan/lib/audio_encode.h 2007-10-22 16:51:10 UTC (rev 1222) @@ -37,6 +37,11 @@ /* Size of ring buffer used for echo can */ #define EC_RING_SIZE 8192 /* must be pow(2) */ +/* Minimum dB possible in the iaxclient world. This level + * is intended to represent silence. + */ +#define AUDIO_ENCODE_SILENCE_DB -99.0f + struct iaxc_call; struct iax_event; Modified: branches/team/mihai/echocan/lib/codec_theora.c =================================================================== --- branches/team/mihai/echocan/lib/codec_theora.c 2007-10-22 16:28:22 UTC (rev 1221) +++ branches/team/mihai/echocan/lib/codec_theora.c 2007-10-22 16:51:10 UTC (rev 1222) @@ -227,8 +227,8 @@ memset(dst + pw * h, value, (ph - h) * pw); } -static int encode(struct iaxc_video_codec *c, int inlen, char *in, - struct slice_set_t *slice_set) +static int encode(struct iaxc_video_codec * c, int inlen, const char * in, + struct slice_set_t * slice_set) { struct theora_encoder *e; ogg_packet op; Modified: branches/team/mihai/echocan/lib/iaxclient.h =================================================================== --- branches/team/mihai/echocan/lib/iaxclient.h 2007-10-22 16:28:22 UTC (rev 1221) +++ branches/team/mihai/echocan/lib/iaxclient.h 2007-10-22 16:51:10 UTC (rev 1222) @@ -1254,9 +1254,8 @@ Converts the image based on the forumulas found at http://en.wikipedia.org/wiki/YUV */ -EXPORT void iaxc_YUV420_to_RGB32(int width, int height, char *src, char *dest); +EXPORT void iaxc_YUV420_to_RGB32(int width, int height, const char *src, char *dest); - /* * Test mode functionality * In test mode, iaxclient will do the following: @@ -1270,8 +1269,29 @@ * iaxc_set_test_mode() should be called before iaxc_initialize() */ EXPORT void iaxc_set_test_mode(int); + +/*! + \brief Sends compressed audio data to the currently selected call. + \param data compressed audio data + \param size Size of the compressed audio data in bytes + \param samples The number of (uncompressed) samples represented by the compressed audio data. We normally use 20ms packets at a sampling rate of 8000Hz, so this would be 160. + + \note Data must be in the audio format that was negotiated for the current call + otherwise bad magic may occur on the recieving side. +*/ EXPORT int iaxc_push_audio(void *data, unsigned int size, unsigned int samples); + +/*! + \brief Sends compressed video data to the currently selected call. + \param data compressed video data + \param size Size of the compressed video data in bytes + \param fragment If true, split video frames larger than the current fragsize into multiple fragments, otherwise send the data as jumbo frames. + + \note Data must be in the video format that was negotiated for the current call + otherwise bad magic may occur on the recieving side. +*/ EXPORT int iaxc_push_video(void *data, unsigned int size, int fragment); + #ifdef __cplusplus } #endif Modified: branches/team/mihai/echocan/lib/iaxclient_lib.c =================================================================== --- branches/team/mihai/echocan/lib/iaxclient_lib.c 2007-10-22 16:28:22 UTC (rev 1221) +++ branches/team/mihai/echocan/lib/iaxclient_lib.c 2007-10-22 16:51:10 UTC (rev 1222) @@ -119,21 +119,12 @@ static THREAD main_proc_thread; -#ifdef USE_VIDEO -static THREAD video_proc_thread; -#endif #if defined(WIN32) || defined(_WIN32_WCE) static THREADID main_proc_thread_id; -#ifdef USE_VIDEO -static THREADID video_proc_thread_id; #endif -#endif /* 0 running, 1 should quit, -1 not running */ static int main_proc_thread_flag = -1; -#ifdef USE_VIDEO -static int video_proc_thread_flag = -1; -#endif static iaxc_event_callback_t iaxc_event_callback = NULL; @@ -640,10 +631,8 @@ } #ifdef USE_VIDEO if ( video_initialize() ) - { iaxci_usermsg(IAXC_ERROR, "iaxc_initialize: cannot initialize video!\n"); - } #endif /* Default audio format capabilities */ @@ -781,32 +770,6 @@ return ret; } -#ifdef USE_VIDEO -static THREADFUNCDECL(video_proc_thread_func) -{ - struct iaxc_call *call; - - while ( !video_proc_thread_flag ) - { - if ( selected_call >= 0 ) - call = &calls[selected_call]; - else - call = NULL; - - if ( !test_mode ) - video_send_video(call, selected_call); - video_send_stats(call); - - // Tight spinloops are bad, mmmkay? - iaxc_millisleep(LOOP_SLEEP); - } - - video_proc_thread_flag = -1; - - return 0; -} -#endif - EXPORT int iaxc_start_processing_thread() { main_proc_thread_flag = 0; @@ -815,14 +778,6 @@ main_proc_thread_id) == THREADCREATE_ERROR) return -1; -#ifdef USE_VIDEO - video_proc_thread_flag = 0; - - if ( THREADCREATE(video_proc_thread_func, NULL, video_proc_thread, - video_proc_thread_id) == THREADCREATE_ERROR) - return -1; -#endif - return 0; } @@ -834,14 +789,6 @@ THREADJOIN(main_proc_thread); } -#ifdef USE_VIDEO - if ( video_proc_thread_flag >= 0 ) - { - video_proc_thread_flag = 1; - THREADJOIN(video_proc_thread); - } -#endif - return 0; } @@ -930,7 +877,8 @@ be changed. */ if ( i++ % 50 == 0 ) - iaxci_do_levels_callback(-99,-99); + iaxci_do_levels_callback(AUDIO_ENCODE_SILENCE_DB, + AUDIO_ENCODE_SILENCE_DB); } return 0; @@ -1209,11 +1157,7 @@ break; #ifdef USE_VIDEO case IAX_EVENT_VIDEO: - // Mihai: why do we need to lower priority here? - // TODO: investigate - //iaxci_prioboostend(); handle_video_event(e, callNo); - //iaxci_prioboostbegin(); break; #endif case IAX_EVENT_TEXT: Modified: branches/team/mihai/echocan/lib/iaxclient_lib.h =================================================================== --- branches/team/mihai/echocan/lib/iaxclient_lib.h 2007-10-22 16:28:22 UTC (rev 1221) +++ branches/team/mihai/echocan/lib/iaxclient_lib.h 2007-10-22 16:51:10 UTC (rev 1222) @@ -191,9 +191,11 @@ void *encstate; void *decstate; struct iaxc_video_stats video_stats; - int (*encode) ( struct iaxc_video_codec *codec, int inlen, char *in, struct slice_set_t *out ); - int (*decode) ( struct iaxc_video_codec *codec, int inlen, char *in, int *outlen, char *out ); - void (*destroy) ( struct iaxc_video_codec *codec); + int (*encode)(struct iaxc_video_codec * codec, int inlen, + const char * in, struct slice_set_t * out); + int (*decode)(struct iaxc_video_codec * codec, int inlen, + const char * in, int * outlen, char * out); + void (*destroy)(struct iaxc_video_codec * codec); }; Deleted: branches/team/mihai/echocan/lib/libiax2/.cvsignore =================================================================== --- branches/team/mihai/echocan/lib/libiax2/.cvsignore 2007-10-22 16:28:22 UTC (rev 1221) +++ branches/team/mihai/echocan/lib/libiax2/.cvsignore 2007-10-22 16:51:10 UTC (rev 1222) @@ -1,21 +0,0 @@ -libtool -config.status -config.guess -config.sub -ltconfig -ltmain.sh -install-sh -mkinstalldirs -missing -aclocal.m4 -configure -config.h.in -stamp-h.in -Makefile.in -config.log -config.cache -Makefile -stamp-h -libtool -iax.spec -iax-config Deleted: branches/team/mihai/echocan/lib/libiax2/src/.cvsignore =================================================================== --- branches/team/mihai/echocan/lib/libiax2/src/.cvsignore 2007-10-22 16:28:22 UTC (rev 1221) +++ branches/team/mihai/echocan/lib/libiax2/src/.cvsignore 2007-10-22 16:51:10 UTC (rev 1222) @@ -1,8 +0,0 @@ -Makefile.in -Makefile -.deps -.libs -iax.lo -md5.lo -libiax.la - Modified: branches/team/mihai/echocan/lib/video.c =================================================================== --- branches/team/mihai/echocan/lib/video.c 2007-10-22 16:28:22 UTC (rev 1221) +++ branches/team/mihai/echocan/lib/video.c 2007-10-22 16:51:10 UTC (rev 1222) @@ -17,10 +17,12 @@ #include <assert.h> #include <stdlib.h> +#include <vidcap/vidcap.h> +#include <vidcap/converters.h> + #include "video.h" #include "slice.h" #include "iaxclient_lib.h" -#include "videoLib/video_grab.h" #include "iax-client.h" #ifdef USE_FFMPEG #include "codec_ffmpeg.h" @@ -29,269 +31,91 @@ #include "codec_theora.h" #endif -#define VIDEO_BUFSIZ (1<<19) +struct video_info +{ + vidcap_state * vc; + vidcap_sapi * sapi; + vidcap_src * src; + struct vidcap_sapi_info sapi_info; + struct vidcap_src_info src_info; + struct vidcap_fmt_info fmt_info; -extern int selected_call; -extern int test_mode; -extern struct iaxc_call * calls; + /* these are the requested (post-scaling) dimensions */ + int width; + int height; -static int iaxc_video_width = 320; -static int iaxc_video_height = 240; -static int iaxc_video_framerate = 10; //15; -static int iaxc_video_bitrate = 150000; -static int iaxc_video_fragsize = 1500; -static int iaxc_video_format_preferred = 0; -static int iaxc_video_format_allowed = 0; -static struct iaxc_video_driver video_driver; + MUTEX camera_lock; + int capturing; -static struct slice_set_t slice_set; + char * converted_i420_buf; + int converted_i420_buf_size; + int (*convert_to_i420)(int, int, const char *, char *); -/* Set the default so that the local and remote raw video is - * sent to the client application and encoded video is sent out. - */ -static int iaxc_video_prefs = IAXC_VIDEO_PREF_RECV_LOCAL_RAW | - IAXC_VIDEO_PREF_RECV_REMOTE_RAW; + char * converted_rgb_buf; + int converted_rgb_buf_size; + int (*convert_to_rgb32)(int, int, const char *, char *); -#if 0 -/* debug: check a yuv420p buffer to ensure it's within the CCIR range */ -static int check_ccir_yuv(char *data) { - int i; - unsigned char pix; - int err = 0; + char * scaled_buf; + int scaled_buf_size; + void (*scale_image)(const unsigned char *, int, int, + unsigned char *, int, int); - for(i=0;i<iaxc_video_width * iaxc_video_height; i++) { - pix = *data++; - if( (pix < 16) || pix > 235) { - fprintf(stderr, "check_ccir_yuv: Y pixel[%d] out of range: %d\n", i, pix); - err++; - } - } - for(i=0;i< iaxc_video_width * iaxc_video_height / 2; i++) { - pix = *data++; - if( (pix < 16) || pix > 239) { - fprintf(stderr, "check_ccir_yuv: U/V pixel[%d] out of range: %d\n", i, pix); - err++; - } - } - return err; -} -#endif + int prefs; -EXPORT unsigned int iaxc_get_video_prefs(void) -{ - return iaxc_video_prefs; -} + struct slicer_context * sc; +}; -EXPORT int iaxc_set_video_prefs(unsigned int prefs) +struct video_format_info { - const unsigned int prefs_mask = - IAXC_VIDEO_PREF_RECV_LOCAL_RAW | - IAXC_VIDEO_PREF_RECV_LOCAL_ENCODED | - IAXC_VIDEO_PREF_RECV_REMOTE_RAW | - IAXC_VIDEO_PREF_RECV_REMOTE_ENCODED | - IAXC_VIDEO_PREF_SEND_DISABLE | - IAXC_VIDEO_PREF_RECV_RGB32 | - IAXC_VIDEO_PREF_CAPTURE_DISABLE; + int width; + int height; + int framerate; + int bitrate; + int fragsize; - if ( prefs & ~prefs_mask ) - return -1; + /* Note that here format really means codec (thoera, h264, etc) */ + int format_preferred; + int format_allowed; +}; - iaxc_video_prefs = prefs; - - if ( test_mode ) - return 0; - - /* Not sending any video and not needing any form of - * local video implies that we do not need to capture - * video. - */ - if ( prefs & IAXC_VIDEO_PREF_CAPTURE_DISABLE || - ((prefs & IAXC_VIDEO_PREF_SEND_DISABLE) && - !(prefs & IAXC_VIDEO_PREF_RECV_LOCAL_RAW) && - !(prefs & IAXC_VIDEO_PREF_RECV_LOCAL_ENCODED)) ) - { - /* Note that in both the start and stop cases, we - * rely on the start/stop function to be idempotent. - */ - if (video_driver.stop) - video_driver.stop(&video_driver); - } - else - { - if ( video_driver.start ) - { - video_driver.start(&video_driver); +static struct video_info vinfo; - // Driver may fail to start - if ( !video_driver.is_camera_working(&video_driver) ) - return -1; - } - } - - return 0; -} - -EXPORT void iaxc_video_format_set_cap(int preferred, int allowed) +/* TODO: This vfinfo instance is ... funny. The current semantic of + * iaxc_video_format_set() requires it to be called _prior_ to + * iaxc_initialize() which of course is where video initialize is called. + * This means that no code in this video.c module is called prior to + * iaxc_video_format_set(). This is silly, wrong, and bad. + * + * What would be better would be if iaxc_video_format_set() was called + * by clients _after_ iaxc_initialize(). The TODO here is to do the + * analysis and restructure things so that iaxc_video_format_set() and + * probably several other iaxc_*() calls do not happen until after + * iaxc_initialize(). + * + * Once that happens, these members of video_format_info can be rolled + * back into video_info and we can initialize the members in + * video_initialize(). + */ +static struct video_format_info vfinfo = { - iaxc_video_format_preferred = preferred; - iaxc_video_format_allowed = allowed; -} + 320, /* width */ + 240, /* height */ + 15, /* fps */ + 150000, /* bitrate */ + 1500, /* fragsize */ + 0, /* format preferred */ + 0, /* format allowed */ +}; -EXPORT void iaxc_video_format_get_cap(int *preferred, int *allowed) -{ - *preferred = iaxc_video_format_preferred; - *allowed = iaxc_video_format_allowed; -} +extern int selected_call; +extern int test_mode; +extern struct iaxc_call * calls; -EXPORT void iaxc_video_format_set(int preferred, int allowed, int framerate, - int bitrate, int width, int height, int fs) +EXPORT unsigned int iaxc_get_video_prefs(void) { - int real_pref = 0; - int real_allowed = 0; -#ifdef USE_FFMPEG - int tmp_allowed; - int i; -#endif - - // Make sure resolution is in range - if ( width < IAXC_VIDEO_MIN_WIDTH ) - width = IAXC_VIDEO_MIN_WIDTH; - else if ( width > IAXC_VIDEO_MAX_WIDTH ) - width = IAXC_VIDEO_MAX_WIDTH; - - if ( height < IAXC_VIDEO_MIN_HEIGHT ) - height = IAXC_VIDEO_MIN_HEIGHT; - else if ( height > IAXC_VIDEO_MAX_HEIGHT ) - height = IAXC_VIDEO_MAX_HEIGHT; - - iaxc_video_framerate = framerate; - iaxc_video_bitrate = bitrate; - iaxc_video_width = width; - iaxc_video_height = height; - iaxc_video_fragsize = fs; - - iaxc_video_format_allowed = 0; - iaxc_video_format_preferred = 0; - - if ( preferred && (preferred & ~IAXC_VIDEO_FORMAT_MASK) ) - { - fprintf(stderr, "ERROR: Preferred video format invalid.\n"); - preferred = 0; - } - - /* This check: - * 1. Check if preferred is a supported and compiled in codec. If - * not, switch to the default preferred format. - * 2. Check if allowed contains a list of all supported and compiled - * in codec. If there are some unavailable codec, remove it from - * this list. - */ - - if ( preferred & IAXC_FORMAT_THEORA ) - real_pref = IAXC_FORMAT_THEORA; - -#ifdef USE_FFMPEG - if ( codec_video_ffmpeg_check_codec(preferred) ) - real_pref = preferred; -#endif - - if ( !real_pref ) - { - // If preferred codec is not available switch to the - // supported default codec. - fprintf(stderr, "Preferred codec (0x%08x) is not available. Switching to default", preferred); - real_pref = IAXC_FORMAT_THEORA; - } - - /* Check on allowed codecs availability */ - - if ( allowed & IAXC_FORMAT_THEORA ) - real_allowed |= IAXC_FORMAT_THEORA; - -#ifdef USE_FFMPEG - /* TODO: This codec_video_ffmpeg_check_codec stuff is bogus. We - * need a standard interface in our codec wrappers that allows us to - * (1) test if a selected codec is valid and/or (2) return the set of - * available valid codecs. With that, we should be able to come up - * with a more elegant algorithm here for determining the video codec. - */ - for ( i = 0; i <= 24; i++) - { - tmp_allowed = 1 << i; - if ( (allowed & tmp_allowed) && - codec_video_ffmpeg_check_codec(tmp_allowed) ) - real_allowed |= tmp_allowed; - } -#endif - - if ( !real_pref ) - { - fprintf(stderr, "Audio-only client!\n"); - } else - { - iaxc_video_format_preferred = real_pref; - - /* - * When a client use a 'preferred' format, it can force to - * use allowed formats using a non-zero value for 'allowed' - * parameter. If it is left 0, the client will use all - * capabilities set by default in this code. - */ - if ( real_allowed ) - { - iaxc_video_format_allowed = real_allowed; - } else - { -#ifdef USE_FFMPEG - iaxc_video_format_allowed |= IAXC_FORMAT_H263_PLUS - | IAXC_FORMAT_H263 - | IAXC_FORMAT_MPEG4 - | IAXC_FORMAT_H264; -#endif - iaxc_video_format_allowed |= IAXC_FORMAT_THEORA; - } - } + return vinfo.prefs; } -void iaxc_video_params_change(int framerate, int bitrate, int width, - int height, int fs) -{ - struct iaxc_call *call; - - /* set default video params */ - if ( framerate > 0 ) - iaxc_video_framerate = framerate; - if ( bitrate > 0 ) - iaxc_video_bitrate = bitrate; - if ( width > 0 ) - iaxc_video_width = width; - if ( height > 0 ) - iaxc_video_height = height; - if ( fs > 0 ) - iaxc_video_fragsize = fs; - - if ( selected_call < 0 ) - return; - - call = &calls[selected_call]; - - if ( !call || !call->vencoder ) - return; - - call->vencoder->params_changed = 1; - - if ( framerate > 0 ) - call->vencoder->framerate = framerate; - if ( bitrate > 0 ) - call->vencoder->bitrate = bitrate; - if ( width > 0 ) - call->vencoder->width = width; - if ( height > 0 ) - call->vencoder->height = height; - if ( fs > 0 ) - call->vencoder->fragsize = fs; -} - static void reset_codec_stats(struct iaxc_video_codec *vcodec) { if ( !vcodec ) @@ -301,7 +125,7 @@ gettimeofday(&vcodec->video_stats.start_time, 0); } -static void reset_video_stats(struct iaxc_call *call) +static void reset_video_stats(struct iaxc_call * call) { if ( !call ) return; @@ -348,6 +172,34 @@ return 0; } +static int maybe_send_stats(struct iaxc_call * call) +{ + const long video_stats_interval = 1000; /* milliseconds */ + static struct timeval video_stats_start = {0, 0}; + iaxc_event e; + struct timeval now; + + if ( !call ) + return -1; + + if ( video_stats_start.tv_sec == 0 && video_stats_start.tv_usec == 0 ) + gettimeofday(&video_stats_start, 0); + + gettimeofday(&now, 0); + + if ( iaxci_msecdiff(&now, &video_stats_start) > video_stats_interval ) + { + get_stats(call, &e.ev.videostats.stats, 1); + e.type = IAXC_EVENT_VIDEOSTATS; + e.ev.videostats.callNo = selected_call; + iaxci_post_event(e); + + video_stats_start = now; + } + + return 0; +} + /* TODO: The encode parameter to this function is unused within this * function. However, clients of this function still use this parameter. * What ends up happening is we instantiate the codec encoder/decoder @@ -381,22 +233,22 @@ case IAXC_FORMAT_H264: #ifdef USE_FFMPEG vcodec = codec_video_ffmpeg_new(format, - iaxc_video_width, - iaxc_video_height, - iaxc_video_framerate, - iaxc_video_bitrate, - iaxc_video_fragsize); + vfinfo.width, + vfinfo.height, + vfinfo.framerate, + vfinfo.bitrate, + vfinfo.fragsize); #endif break; case IAXC_FORMAT_THEORA: #ifdef USE_THEORA vcodec = codec_video_theora_new(format, - iaxc_video_width, - iaxc_video_height, - iaxc_video_framerate, - iaxc_video_bitrate, - iaxc_video_fragsize); + vfinfo.width, + vfinfo.height, + vfinfo.framerate, + vfinfo.bitrate, + vfinfo.fragsize); #endif break; } @@ -407,208 +259,874 @@ } /* - * show_video_frame - returns video data to the main application - * using the callback mechanism - * This function creates a dynamic copy of the video data. The memory is freed + * Returns video data to the main application using the callback mechanism. + * This function creates a dynamic copy of the video data. The memory is freed * in iaxci_post_event. This is because the event we post may be queued and the * frame data must live until after it is dequeued. - * Parameters: - videobuf: buffer containing raw or encoded video data - * - size - size of video data block - * - cn - call number - * - source - either IAXC_SOURCE_LOCAL or IAXC_SOURCE_REMOTE - * - encoded - true if data is encoded - * - rgb32 - if true, convert data to RGB32 before showing + \todo For encoded data, set the event format to the calls video format. + For raw data, set the format to 0. + \todo For encoded data, set the event format to the calls video format. For raw data, set the format to 0. */ -void show_video_frame(char *videobuf, int size, int cn, int source, int encoded, - unsigned int ts, int rgb32) +int show_video_frame(const char * in_buf, int in_buf_size, + int call_number, int source, int encoded, + unsigned int timestamp_ms) { iaxc_event e; - char * buffer; + char * buf = malloc(in_buf_size); + assert(buf); + assert(source == IAXC_SOURCE_REMOTE || source == IAXC_SOURCE_LOCAL); + + memcpy(buf, in_buf, in_buf_size); + e.type = IAXC_EVENT_VIDEO; - e.ev.video.ts = ts; + e.ev.video.ts = timestamp_ms; + e.ev.video.data = buf; + e.ev.video.size = in_buf_size; + e.ev.video.format = vfinfo.format_preferred; + e.ev.video.width = vinfo.width; + e.ev.video.height = vinfo.height; + e.ev.video.callNo = call_number; + e.ev.video.encoded = encoded; + e.ev.video.source = source; - if ( size <= 0 ) - fprintf(stderr, "WARNING: size %d in show_video_frame\n", size); + iaxci_post_event(e); - if ( !encoded && rgb32 ) + return 0; +} + +// Resize the buffer to 25% (half resolution on both w and h ) +// No checks are made to ensure that the source dimensions are even numbers +static void quarter_rgb32(const unsigned char *src, int src_w, int src_h, + unsigned char *dst) +{ + int i; + const unsigned char * src_even = src; + const unsigned char * src_odd = src + src_w * 4; + + for ( i = 0 ; i < src_h / 2 ; i++ ) { - e.ev.video.size = iaxc_video_height * iaxc_video_width * 4; - buffer = (char *)malloc(e.ev.video.size); - assert(buffer); - e.ev.video.data = buffer; - iaxc_YUV420_to_RGB32(iaxc_video_width, iaxc_video_height, - videobuf, buffer); - } else + int j; + for ( j = 0 ; j < src_w / 2 ; j++ ) + { + short r, g, b; + b = *src_even++; + g = *src_even++; + r = *src_even++; + ++src_even; + + b += *src_even++; + g += *src_even++; + r += *src_even++; + ++src_even; + + b += *src_odd++; + g += *src_odd++; + r += *src_odd++; + ++src_odd; + + b += *src_odd++; + g += *src_odd++; + r += *src_odd++; + ++src_odd; + + *dst++ = (unsigned char)(b >> 2); + *dst++ = (unsigned char)(g >> 2); + *dst++ = (unsigned char)(r >> 2); + *dst++ = (unsigned char)0xff; + } + src_even = src_odd; + src_odd += src_w * 4; + } +} + +// Resize the buffer to 25% (half resolution on both w and h ) +// No checks are made to ensure that the source dimensions are even numbers +static void quarter_yuy2(const unsigned char *src, int src_w, int src_h, + unsigned char *dst) +{ + int i; + const unsigned char * src_even = src; + const unsigned char * src_odd = src + src_w * 2; + + for ( i = 0 ; i < src_h / 2 ; i++ ) { - buffer = (char *)malloc(size); - assert(buffer); - memcpy(buffer, videobuf, size); - e.ev.video.data = buffer; - e.ev.video.size = size; + int j; + for ( j = 0 ; j < src_w / 4 ; j++ ) + { + short y1, u, y2, v; + y1 = *src_even++; + u = *src_even++; + y1 += *src_even++; + v = *src_even++; + + y1 += *src_odd++; + u += *src_odd++; + y1 += *src_odd++; + v += *src_odd++; + + y2 = *src_even++; + u += *src_even++; + y2 += *src_even++; + v += *src_even++; + + y2 += *src_odd++; + u += *src_odd++; + y2 += *src_odd++; + v += *src_odd++; + + *dst++ = (unsigned char)(y1 >> 2); + *dst++ = (unsigned char)(u >> 2); + *dst++ = (unsigned char)(y2 >> 2); + *dst++ = (unsigned char)(v >> 2); + } + src_even = src_odd; + src_odd += src_w * 2; } +} - e.ev.video.format = iaxc_video_format_preferred; - e.ev.video.width = iaxc_video_width; - e.ev.video.height = iaxc_video_height; - e.ev.video.callNo = cn; - e.ev.video.encoded = encoded; - assert(source == IAXC_SOURCE_REMOTE || source == IAXC_SOURCE_LOCAL); - e.ev.video.source = source; +// Resize the channel to 25% (half resolution on both w and h ) +// No checks are made to ensure that the source dimensions are even numbers +static void quarter_channel(const unsigned char *src, int src_w, int src_h, + unsigned char *dst) +{ + int i; + const unsigned char * evenl = src; + const unsigned char * oddl = src + src_w; - iaxci_post_event(e); + for ( i = 0 ; i < src_h / 2 ; i++ ) + { + int j; + for ( j = 0 ; j < src_w / 2 ; j++ ) + { + int s = *(evenl++); + s += *(evenl++); + s += *(oddl++); + s += *(oddl++); + *(dst++) = (unsigned char)(s >> 2); + } + evenl = oddl; + oddl += src_w; + } } -/* try to get the next frame, encode and send */ -int video_send_video(struct iaxc_call *call, int sel_call) +// Resize an I420 image by resizing each of the three channels. +// Destination buffer must be sufficiently large to accommodate +// the resulting image +static void resize_i420(const unsigned char *src, int src_w, int src_h, + unsigned char *dst, int dst_w, int dst_h) { - int format; - int i = 0; - const int inlen = iaxc_video_width * iaxc_video_height * 6 / 4; - char * videobuf; + const unsigned char *src_u = src + src_w * src_h; + const unsigned char *src_v = src_u + src_w * src_h / 4; + unsigned char *dst_u = dst + dst_w * dst_h; + unsigned char *dst_v = dst_u + dst_w * dst_h / 4; + + // Resize each channel separately + if ( dst_w * 2 == src_w && dst_h * 2 == src_h ) + { + quarter_channel(src, src_w, src_h, dst); + quarter_channel(src_u, src_w / 2, src_h / 2, dst_u); + quarter_channel(src_v, src_w / 2, src_h / 2, dst_v); + } +/* + else if ( dst_w * 4 == src_w && dst_h * 4 == src_h ) + { + double_quarter_channel(src, src_w, src_h, dst); + double_quarter_channel(src_u, src_w / 2, src_h / 2, dst_u); + double_quarter_channel(src_v, src_w / 2, src_h / 2, dst_v); + } + else + { + resize_channel(src, src_w, src_h, dst, dst_w, dst_h); + resize_channel(src_u, src_w / 2, src_h / 2, + dst_u, dst_w / 2, dst_h / 2); + resize_channel(src_v, src_w / 2, src_h / 2, + dst_v, dst_w / 2, dst_h / 2); + } +*/ +} + +// Resize an rgb32 image +// Destination buffer must be sufficiently large to accommodate +// the resulting image +static void resize_rgb32(const unsigned char *src, int src_w, int src_h, + unsigned char *dst, int dst_w, int dst_h) +{ + if ( dst_w * 2 == src_w && dst_h * 2 == src_h ) + { + quarter_rgb32(src, src_w, src_h, dst); + } +/* + else if ( dst_w * 4 == src_w && dst_h * 4 == src_h ) + { + double_quarter_rgb32(src, src_w, src_h, dst); + } + else + { + resize_rgb32_buffer(src, src_w, src_h, dst, dst_w, dst_h); + } +*/ +} + +// Resize a yuy2 image. +// Destination buffer must be sufficiently large to accommodate +// the resulting image +static void resize_yuy2(const unsigned char *src, int src_w, int src_h, + unsigned char *dst, int dst_w, int dst_h) +{ + if ( dst_w * 2 == src_w && dst_h * 2 == src_h ) + { + quarter_yuy2(src, src_w, src_h, dst); + } +/* + else if ( dst_w * 4 == src_w && dst_h * 4 == src_h ) + { + double_quarter_yuy2(src, src_w, src_h, dst); + } + else + { + resize_yuy2_buffer(src, src_w, src_h, dst, dst_w, dst_h); + } +*/ +} + +static int capture_callback(vidcap_src * src, void * user_data, + struct vidcap_capture_info * cap_info) +{ + static struct slice_set_t slice_set; + + /* The prefs may change inbetween capture callbacks, so we cannot + * precompute any of this prior to starting capture. + */ + const int send_encoded = !(vinfo.prefs & IAXC_VIDEO_PREF_SEND_DISABLE); + const int recv_local_enc = vinfo.prefs & IAXC_VIDEO_PREF_RECV_LOCAL_ENCODED; + const int recv_local_raw = vinfo.prefs & IAXC_VIDEO_PREF_RECV_LOCAL_RAW; + const int need_encode = send_encoded || recv_local_enc; + const int local_rgb = vinfo.prefs & IAXC_VIDEO_PREF_RECV_RGB32; + + struct iaxc_call * call; struct timeval now; - long time; + long time_delta; - video_driver.input(&video_driver, &videobuf); + const char * rgb_buf = 0; + int rgb_buf_size = 0; + const char * i420_buf = 0; + int i420_buf_size = 0; + const char * source_buf = 0; + int source_buf_size = 0; - /* It is okay if we do not get any video; video capture may be - * disabled. - */ - if ( !videobuf || (iaxc_video_prefs & IAXC_VIDEO_PREF_CAPTURE_DISABLE) ) + int i; + + if ( cap_info->error_status ) + { + fprintf(stderr, "vidcap capture error %d\n", + cap_info->error_status); + vinfo.capturing = 0; + return -1; + } + + if ( vinfo.prefs & IAXC_VIDEO_PREF_CAPTURE_DISABLE ) return 0; - // Send the raw frame to the main app, if necessary - if ( iaxc_video_prefs & IAXC_VIDEO_PREF_RECV_LOCAL_RAW ) + if ( vinfo.width != vinfo.fmt_info.width ) { - show_video_frame(videobuf, inlen, -1, IAXC_SOURCE_LOCAL, 0, 0, - iaxc_video_prefs & IAXC_VIDEO_PREF_RECV_RGB32); + vinfo.scale_image((const unsigned char *)cap_info->video_data, + vinfo.fmt_info.width, + vinfo.fmt_info.height, + (unsigned char *)vinfo.scaled_buf, + vinfo.width, + vinfo.height); + + source_buf = vinfo.scaled_buf; + source_buf_size = vinfo.scaled_buf_size; } + else + { + source_buf = cap_info->video_data; + source_buf_size = cap_info->video_data_size; + } - if ( sel_call < 0 || !call || - !(call->state & (IAXC_CALL_STATE_COMPLETE | - IAXC_CALL_STATE_OUTGOING)) ) + if ( vinfo.convert_to_rgb32 && recv_local_raw && local_rgb ) { - return -1; + vinfo.convert_to_rgb32( + vinfo.width, + vinfo.height, + source_buf, + vinfo.converted_rgb_buf); + + rgb_buf = vinfo.converted_rgb_buf; + rgb_buf_size = vinfo.converted_rgb_buf_size; } + else + { + rgb_buf = source_buf; + rgb_buf_size = source_buf_size; + } - // use the calls format, not random preference - format = call->vformat; + if ( vinfo.convert_to_i420 && (need_encode || + (recv_local_raw && !local_rgb)) ) + { + vinfo.convert_to_i420( + vinfo.width, + vinfo.height, + source_buf, + vinfo.converted_i420_buf); - if ( format == 0 ) + i420_buf = vinfo.converted_i420_buf; + i420_buf_size = vinfo.converted_i420_buf_size; + } + else { -// fprintf(stderr, "video_send_video: Format is zero (should't happen)!\n"); + i420_buf = source_buf; + i420_buf_size = source_buf_size; + } + + if ( recv_local_raw ) + { + show_video_frame(local_rgb ? rgb_buf : i420_buf, + local_rgb ? rgb_buf_size : i420_buf_size, + -1, /* local call number */ + IAXC_SOURCE_LOCAL, + 0, /* not encoded */ + 0); /* timestamp (ms) */ + } + + if ( selected_call < 0 ) + return 0; + + call = &calls[selected_call]; + + if ( !call || !(call->state & (IAXC_CALL_STATE_COMPLETE | + IAXC_CALL_STATE_OUTGOING)) ) + { + return 0; + } + + if ( call->vformat == 0 ) + { + fprintf(stderr, "video format not set for call %d\n", + selected_call); return -1; } - // If we don't need to send encoded video to the network or back - // to the main application, just return here. - if ( ( !(iaxc_video_prefs & IAXC_VIDEO_PREF_RECV_LOCAL_ENCODED) && - (iaxc_video_prefs & IAXC_VIDEO_PREF_SEND_DISABLE) ) || - (format == 0) ) + if ( !need_encode ) { + /* Since we are neither sending out encoded video on the + * network nor to the application, we no longer need the + * codec instance. + */ if ( call->vencoder ) { - // We don't need to encode video so just destroy the encoder - fprintf(stderr, "Destroying codec %s\n", call->vencoder->name); + fprintf(stderr, "destroying codec %s\n", + call->vencoder->name); call->vencoder->destroy(call->vencoder); - call->vencoder = NULL; + call->vencoder = 0; } + return 0; - }else + } + else { - /* destroy vencoder if it is incorrect type */ if ( call->vencoder && - (call->vencoder->format != format || call->vencoder->params_changed) - ) + (call->vencoder->format != call->vformat || + call->vencoder->params_changed) ) { call->vencoder->destroy(call->vencoder); - call->vencoder = NULL; + call->vencoder = 0; } - /* create encoder if necessary */ if ( !call->vencoder ) { - call->vencoder = create_codec(format, 1); - fprintf(stderr,"**** Created encoder codec %s\n",call->vencoder->name); - } + if ( !(call->vencoder = create_codec(call->vformat, 1)) ) + { + fprintf(stderr, "ERROR: failed to create codec " + "for format 0x%08x\n", + call->vformat); + return -1; + } - if ( !call->vencoder ) - { - fprintf(stderr, - "ERROR: Video codec could not be created: 0x%08x\n", - format); - return -1; + fprintf(stderr, "created encoder codec %s\n", + call->vencoder->name); } - // encode the frame - if ( call->vencoder->encode(call->vencoder, inlen, videobuf, + if ( call->vencoder->encode(call->vencoder, + i420_buf_size, i420_buf, &slice_set) ) { - fprintf(stderr, "video_send_video: encode failed\n"); + fprintf(stderr, "failed to encode captured video\n"); return -1; } } - // Statistics + /* Gather statistics */ + call->vencoder->video_stats.outbound_frames++; + gettimeofday(&now, 0); - call->vencoder->video_stats.outbound_frames++; - time = iaxci_msecdiff(&now, &call->vencoder->video_stats.start_time); - if ( time > 0 ) + time_delta = + iaxci_msecdiff(&now, &call->vencoder->video_stats.start_time); + + if ( time_delta > 0 ) call->vencoder->video_stats.avg_outbound_fps = (float)call->vencoder->video_stats.outbound_frames * - 1000 / time; + 1000.0f / (float)time_delta; - // send the frame! - if ( !call->session ) + { + fprintf(stderr, "not sending video to sessionless call\n"); return -1; + } - for ( i = 0; i < slice_set.num_slices; i++ ) + for ( i = 0; i < slice_set.num_slices; ++i ) { //Pass the encoded frame to the main app // \todo Fix the call number - if ( iaxc_video_prefs & IAXC_VIDEO_PREF_RECV_LOCAL_ENCODED ) + if ( vinfo.prefs & IAXC_VIDEO_PREF_RECV_LOCAL_ENCODED ) { - show_video_frame(slice_set.data[i], slice_set.size[i], - -1, IAXC_SOURCE_LOCAL, 1, 0, 0); + show_video_frame(slice_set.data[i], + slice_set.size[i], + -1, /* local call number */ + IAXC_SOURCE_LOCAL, + 1, /* encoded */ + 0); /* timestamp */ } - if ( !(iaxc_video_prefs & IAXC_VIDEO_PREF_SEND_DISABLE) ) + if ( !(vinfo.prefs & IAXC_VIDEO_PREF_SEND_DISABLE) ) { - if ( iax_send_video_trunk(call->session, format, + if ( iax_send_video_trunk(call->session, call->vformat, slice_set.data[i], slice_set.size[i], - 0, i) == -1 ) + 0, /* not fullframe */ + i) == -1) { - fprintf(stderr, "Failed to send a slice, call %d, size %d\n", - sel_call, slice_set.size[i]); + fprintf(stderr, "failed sending slice call %d " + "size %d\n", selected_call, + slice_set.size[i]); return -1; } - // Statistics + /* More statistics */ call->vencoder->video_stats.sent_slices++; call->vencoder->video_stats.acc_sent_size += slice_set.size[i]; - if ( time > 0 ) + if ( time_delta > 0 ) call->vencoder->video_stats.avg_outbound_bps = call->vencoder->video_stats.acc_sent_size * - 8000 / time; + 8000 / time_delta; } } + maybe_send_stats(call); + return 0; } +static int prepare_for_capture() +{ + static const int fourcc_list[] = + { + VIDCAP_FOURCC_I420, + VIDCAP_FOURCC_YUY2, + VIDCAP_FOURCC_RGB32 + }; + + static const int fourcc_list_len = sizeof(fourcc_list) / sizeof(int); + int i; + static const int max_factor = 2; + int scale_factor; + + if ( !vinfo.src ) + { + /* Acquire the default source */ + if ( !(vinfo.src = vidcap_src_acquire(vinfo.sapi, 0)) ) + { + fprintf(stderr, "failed to acquire video source\n"); + return -1; + } + + if ( vidcap_src_info_get(vinfo.src, &vinfo.src_info) ) + { + fprintf(stderr, "failed to get video source info\n"); + return -1; + } + + fprintf(stderr, "acquired vidcap source %s (%s)\n", + vinfo.src_info.description, + vinfo.src_info.identifier); + } + + vinfo.width = vfinfo.width; + vinfo.height = vfinfo.height; + vinfo.fmt_info.fps_numerator = vfinfo.framerate; + vinfo.fmt_info.fps_denominator = 1; + + for ( scale_factor = 1; scale_factor <= max_factor; scale_factor *= 2 ) + { + vinfo.fmt_info.width = vfinfo.width * scale_factor; + vinfo.fmt_info.height = vfinfo.height * scale_factor; + + for ( i = 0; i < fourcc_list_len; ++i ) + { + vinfo.fmt_info.fourcc = fourcc_list[i]; + + if ( !vidcap_format_bind(vinfo.src, &vinfo.fmt_info) ) + break; + } + + if ( i != fourcc_list_len ) + break; + } + + if ( i == fourcc_list_len ) + { + fprintf(stderr, "failed to bind format %dx%d %f fps\n", + vinfo.fmt_info.width, + vinfo.fmt_info.height, + (float)vinfo.fmt_info.fps_numerator / + (float)vinfo.fmt_info.fps_denominator); + return -1; + } + + /* Prepare various conversion buffers */ + + if ( vinfo.converted_i420_buf ) + { + free(vinfo.converted_i420_buf); + vinfo.converted_i420_buf = 0; + } + + if ( vinfo.converted_rgb_buf ) + { + free(vinfo.converted_rgb_buf); + vinfo.converted_rgb_buf = 0; + } + + vinfo.converted_i420_buf_size = + vinfo.width * vinfo.height * 3 / 2; + + vinfo.converted_rgb_buf_size = + vinfo.width * vinfo.height * 4; + + if ( vinfo.fmt_info.fourcc != VIDCAP_FOURCC_RGB32 ) + vinfo.converted_rgb_buf = malloc(vinfo.converted_rgb_buf_size); + + if ( vinfo.fmt_info.fourcc != VIDCAP_FOURCC_I420 ) + vinfo.converted_i420_buf = malloc(vinfo.converted_i420_buf_size); + + switch ( vinfo.fmt_info.fourcc ) + { + case VIDCAP_FOURCC_RGB32: + vinfo.convert_to_i420 = vidcap_rgb32_to_i420; + vinfo.convert_to_rgb32 = 0; + vinfo.scale_image = 0; + vinfo.scaled_buf = 0; + if ( vinfo.width != vinfo.fmt_info.width ) + { + vinfo.scale_image = resize_rgb32; + vinfo.scaled_buf_size = vinfo.converted_rgb_buf_size; + vinfo.scaled_buf = malloc(vinfo.scaled_buf_size); + fprintf(stderr, "scaling rgb32 images by 1/%d\n", + scale_factor); + } + if ( !vinfo.converted_i420_buf ) + return -1; + break; + case VIDCAP_FOURCC_I420: + vinfo.convert_to_i420 = 0; + vinfo.convert_to_rgb32 = vidcap_i420_to_rgb32; + vinfo.scale_image = 0; + vinfo.scaled_buf = 0; + if ( vinfo.width != vinfo.fmt_info.width ) + { + vinfo.scale_image = resize_i420; + vinfo.scaled_buf_size = vinfo.converted_i420_buf_size; + vinfo.scaled_buf = malloc(vinfo.scaled_buf_size); + fprintf(stderr, "scaling i420 images by 1/%d\n", + scale_factor); + } + if ( !vinfo.converted_rgb_buf ) + return -1; + break; + case VIDCAP_FOURCC_YUY2: + vinfo.convert_to_i420 = vidcap_yuy2_to_i420; + vinfo.convert_to_rgb32 = vidcap_yuy2_to_rgb32; + vinfo.scale_image = 0; + vinfo.scaled_buf = 0; + if ( vinfo.width != vinfo.fmt_info.width ) + { + vinfo.scale_image = resize_yuy2; + vinfo.scaled_buf_size = vinfo.width * + vinfo.height * 2; + vinfo.scaled_buf... [truncated message content] |
From: <sb...@us...> - 2007-10-29 21:07:37
|
Revision: 1236 http://iaxclient.svn.sourceforge.net/iaxclient/?rev=1236&view=rev Author: sbalea Date: 2007-10-29 14:07:35 -0700 (Mon, 29 Oct 2007) Log Message: ----------- Redo the speex AGC patch to increase the chances of adoption in upstream speex - calculate loudness correctly - return it as a 32 bit int - change the preprocess ctl command name Refactor the AAGC code to play nice with the new speex interface Minor code cleanups Modified Paths: -------------- branches/team/mihai/echocan/lib/audio_encode.c branches/team/mihai/echocan/lib/audio_encode.h branches/team/mihai/echocan/lib/audio_portaudio.c branches/team/mihai/echocan/speex-1.2beta2.patch Modified: branches/team/mihai/echocan/lib/audio_encode.c =================================================================== --- branches/team/mihai/echocan/lib/audio_encode.c 2007-10-29 20:26:04 UTC (rev 1235) +++ branches/team/mihai/echocan/lib/audio_encode.c 2007-10-29 21:07:35 UTC (rev 1236) @@ -194,26 +194,26 @@ if ( (i & 0x3f) == 0 ) { - float loudness; - speex_preprocess_ctl(st, SPEEX_PREPROCESS_GET_LOUDNESS, &loudness); - if ( loudness > 8000.0f || loudness < 4000.0f ) + int loudness; + speex_preprocess_ctl(st, SPEEX_PREPROCESS_GET_AGC_LOUDNESS, &loudness); + if ( loudness > AAGC_HOT || loudness < AAGC_COLD ) { const float level = iaxc_input_level_get(); - if ( loudness > 16000.0f && level > 0.5f ) + if ( loudness > AAGC_VERY_HOT && level > 0.5f ) { /* lower quickly if we're really too hot */ - iaxc_input_level_set(level - 0.2f); + iaxc_input_level_set(level - AAGC_DROP_FAST); } - else if ( loudness > 8000.0f && level >= 0.15f ) + else if ( loudness > AAGC_HOT && level >= 0.15f ) { /* lower less quickly if we're a bit too hot */ - iaxc_input_level_set(level - 0.1f); + iaxc_input_level_set(level - AAGC_DROP_SLOW); } - else if ( loudness < 4000.0f && level <= 0.9f ) + else if ( loudness < AAGC_COLD && level <= 0.9f ) { /* raise slowly if we're cold */ - iaxc_input_level_set(level + 0.1f); + iaxc_input_level_set(level + AAGC_RISE_SLOW); } } } @@ -366,8 +366,8 @@ /* decode encoded audio; return the number of bytes decoded * negative indicates error */ -int audio_decode_audio(struct iaxc_call * call, void * out, void * data, int len, - int format, int * samples) +int audio_decode_audio(struct iaxc_call * call, void * out, void * data, + int len, int format, int * samples) { int insize = len; int outsize = *samples; @@ -376,7 +376,8 @@ if ( format == 0 ) { - fprintf(stderr, "audio_decode_audio: Format is zero (should't happen)!\n"); + fprintf(stderr, "audio_decode_audio: Format is zero " + "(should not happen)!\n"); return -1; } @@ -435,17 +436,9 @@ { #ifdef SPEEX_EC int i; - static long bias = 0; - short delayedBuf[1024]; + short delayedBuf[1024]; short cancelledBuffer[1024]; - /* remove bias -- whether ec is on or not. */ -// for ( i = 0; i < samples; i++ ) -// { -// bias += ((((long int) inputBuffer[i]) << 15) - bias) >> 14; -// inputBuffer[i] -= (short int) (bias >> 15); -// } - /* if ec is off, clear ec state -- this way, we start fresh if/when * it's turned back on. */ MUTEXLOCK(&audio_lock); Modified: branches/team/mihai/echocan/lib/audio_encode.h =================================================================== --- branches/team/mihai/echocan/lib/audio_encode.h 2007-10-29 20:26:04 UTC (rev 1235) +++ branches/team/mihai/echocan/lib/audio_encode.h 2007-10-29 21:07:35 UTC (rev 1236) @@ -35,13 +35,23 @@ #define ECHO_SUPPRESS_ACTIVE -60 /* Size of ring buffer used for echo can */ -#define EC_RING_SIZE 8192 /* must be pow(2) */ +#define EC_RING_SIZE 512 /* must be pow(2) */ /* Minimum dB possible in the iaxclient world. This level * is intended to represent silence. */ #define AUDIO_ENCODE_SILENCE_DB -99.0f +/* AAGC threshold */ +#define AAGC_VERY_HOT 16 +#define AAGC_HOT 8 +#define AAGC_COLD 4 + +/* AAGC increments */ +#define AAGC_RISE_SLOW 0.1f +#define AAGC_DROP_SLOW 0.15f +#define AAGC_DROP_FAST 0.2f + struct iaxc_call; struct iax_event; Modified: branches/team/mihai/echocan/lib/audio_portaudio.c =================================================================== --- branches/team/mihai/echocan/lib/audio_portaudio.c 2007-10-29 20:26:04 UTC (rev 1235) +++ branches/team/mihai/echocan/lib/audio_portaudio.c 2007-10-29 21:07:35 UTC (rev 1236) @@ -37,13 +37,6 @@ #include "ringbuffer.h" #include "portmixer.h" -#ifdef SPEEX_EC -#define restrict __restrict -#include "speex/speex_echo.h" -static SpeexEchoState *ec; -#endif - - typedef short SAMPLE; static PaStream *iStream, *oStream, *aStream; Modified: branches/team/mihai/echocan/speex-1.2beta2.patch =================================================================== --- branches/team/mihai/echocan/speex-1.2beta2.patch 2007-10-29 20:26:04 UTC (rev 1235) +++ branches/team/mihai/echocan/speex-1.2beta2.patch 2007-10-29 21:07:35 UTC (rev 1236) @@ -1,25 +1,25 @@ diff -urN speex-1.2beta2.orig/include/speex/speex_preprocess.h speex-1.2beta2/include/speex/speex_preprocess.h --- speex-1.2beta2.orig/include/speex/speex_preprocess.h 2007-01-23 06:59:04.000000000 -0500 -+++ speex-1.2beta2/include/speex/speex_preprocess.h 2007-09-13 14:08:05.000000000 -0400 ++++ speex-1.2beta2/include/speex/speex_preprocess.h 2007-10-29 12:06:48.000000000 -0400 @@ -178,6 +178,9 @@ /** Get maximal gain in dB (int32) */ #define SPEEX_PREPROCESS_GET_AGC_MAX_GAIN 31 +/** Get loudness */ -+#define SPEEX_PREPROCESS_GET_LOUDNESS 32 ++#define SPEEX_PREPROCESS_GET_AGC_LOUDNESS 32 + #ifdef __cplusplus } #endif diff -urN speex-1.2beta2.orig/libspeex/preprocess.c speex-1.2beta2/libspeex/preprocess.c --- speex-1.2beta2.orig/libspeex/preprocess.c 2007-05-03 05:22:04.000000000 -0400 -+++ speex-1.2beta2/libspeex/preprocess.c 2007-09-13 14:08:35.000000000 -0400 ++++ speex-1.2beta2/libspeex/preprocess.c 2007-10-29 13:35:53.000000000 -0400 @@ -1163,6 +1163,9 @@ case SPEEX_PREPROCESS_GET_ECHO_STATE: ptr = (void*)st->echo_state; break; -+ case SPEEX_PREPROCESS_GET_LOUDNESS: -+ (*(float*)ptr) = st->loudness; ++ case SPEEX_PREPROCESS_GET_AGC_LOUDNESS: ++ (*(spx_int32_t*)ptr) = pow(st->loudness, 1.0/LOUDNESS_EXP); + break; default: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sb...@us...> - 2007-10-30 19:31:55
|
Revision: 1245 http://iaxclient.svn.sourceforge.net/iaxclient/?rev=1245&view=rev Author: sbalea Date: 2007-10-30 12:32:00 -0700 (Tue, 30 Oct 2007) Log Message: ----------- Synchronize with trunk rev 1244 Revision Links: -------------- http://iaxclient.svn.sourceforge.net/iaxclient/?rev=1244&view=rev Modified Paths: -------------- branches/team/mihai/echocan/contrib/tcl/README.txt branches/team/mihai/echocan/contrib/tcl/configure branches/team/mihai/echocan/contrib/tcl/configure.in branches/team/mihai/echocan/contrib/tcl/iaxclient.c branches/team/mihai/echocan/lib/audio_portaudio.c branches/team/mihai/echocan/lib/codec_ulaw.c branches/team/mihai/echocan/lib/iaxclient.h branches/team/mihai/echocan/lib/iaxclient_lib.c branches/team/mihai/echocan/lib/portmixer/px_win_wmme/px_win_wmme.c Added Paths: ----------- branches/team/mihai/echocan/contrib/tcl/video.c Modified: branches/team/mihai/echocan/contrib/tcl/README.txt =================================================================== --- branches/team/mihai/echocan/contrib/tcl/README.txt 2007-10-30 18:33:01 UTC (rev 1244) +++ branches/team/mihai/echocan/contrib/tcl/README.txt 2007-10-30 19:32:00 UTC (rev 1245) @@ -105,7 +105,23 @@ iaxclient::unregister sessionID + There are some utilities to play ring tones. First you must initialize + and set a ring tone using: + iaxclient::toneinit F1 F2 Duration Length Repeat + where F1 and F2 are the two tone frequencies in Hertz, Duration + in milliseconds of the tone, Length in milliseconds of tone plus + silence, Repeat the number of times to play the tone. + A typical call can be: + iaxclient::toneinit 880 960 16000 48000 10 + + iaxclient::ringstart 0 + start ringing on ring device 0 + + iaxclient::ringstop + stop ringing + + A tone is any single character from the set 123A456B789C*0#D A state is a list with any of: free, active, outgoing, ringing, complete, Modified: branches/team/mihai/echocan/contrib/tcl/configure =================================================================== --- branches/team/mihai/echocan/contrib/tcl/configure 2007-10-30 18:33:01 UTC (rev 1244) +++ branches/team/mihai/echocan/contrib/tcl/configure 2007-10-30 19:32:00 UTC (rev 1245) @@ -1,8 +1,9 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.59 for iaxclient 0.2. +# Generated by GNU Autoconf 2.57 for iaxclient 0.2. # -# Copyright (C) 2003 Free Software Foundation, Inc. +# Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002 +# Free Software Foundation, Inc. # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## --------------------- ## @@ -19,10 +20,9 @@ elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then set -o posix fi -DUALCASE=1; export DUALCASE # for MKS sh # Support unset when possible. -if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then +if (FOO=FOO; unset FOO) >/dev/null 2>&1; then as_unset=unset else as_unset=false @@ -41,7 +41,7 @@ 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 + if (set +x; test -n "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else $as_unset $as_var @@ -218,17 +218,16 @@ if mkdir -p . 2>/dev/null; then as_mkdir_p=: else - test -d ./-p && rmdir ./-p as_mkdir_p=false fi as_executable_p="test -f" # Sed expression to map a string onto a valid CPP name. -as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" +as_tr_cpp="sed y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g" # Sed expression to map a string onto a valid variable name. -as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" +as_tr_sh="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g" # IFS @@ -667,7 +666,7 @@ # Be sure to have absolute paths. for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \ - localstatedir libdir includedir oldincludedir infodir mandir + localstatedir libdir includedir oldincludedir infodir mandir do eval ac_val=$`echo $ac_var` case $ac_val in @@ -707,10 +706,10 @@ # Try the directory containing this script, then its parent. ac_confdir=`(dirname "$0") 2>/dev/null || $as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$0" : 'X\(//\)[^/]' \| \ - X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || + X"$0" : 'X\(//\)[^/]' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || echo X"$0" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } @@ -802,9 +801,9 @@ cat <<_ACEOF 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 @@ -903,46 +902,13 @@ ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_builddir$srcdir ;; esac +# Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be +# absolute. +ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd` +ac_abs_top_builddir=`cd "$ac_dir" && cd ${ac_top_builddir}. && pwd` +ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd` +ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd` -# Do not use `cd foo && pwd` to compute absolute paths, because -# the directories may not exist. -case `pwd` in -.) ac_abs_builddir="$ac_dir";; -*) - case "$ac_dir" in - .) ac_abs_builddir=`pwd`;; - [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; - *) ac_abs_builddir=`pwd`/"$ac_dir";; - esac;; -esac -case $ac_abs_builddir in -.) ac_abs_top_builddir=${ac_top_builddir}.;; -*) - case ${ac_top_builddir}. in - .) ac_abs_top_builddir=$ac_abs_builddir;; - [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; - *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; - esac;; -esac -case $ac_abs_builddir in -.) ac_abs_srcdir=$ac_srcdir;; -*) - case $ac_srcdir in - .) ac_abs_srcdir=$ac_abs_builddir;; - [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; - *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; - esac;; -esac -case $ac_abs_builddir in -.) ac_abs_top_srcdir=$ac_top_srcdir;; -*) - case $ac_top_srcdir in - .) ac_abs_top_srcdir=$ac_abs_builddir;; - [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; - *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; - esac;; -esac - cd $ac_dir # Check for guested configure; otherwise get Cygnus style configure. if test -f $ac_srcdir/configure.gnu; then @@ -952,7 +918,7 @@ echo $SHELL $ac_srcdir/configure --help=recursive elif test -f $ac_srcdir/configure.ac || - test -f $ac_srcdir/configure.in; then + test -f $ac_srcdir/configure.in; then echo $ac_configure --help else @@ -966,9 +932,10 @@ if $ac_init_version; then cat <<\_ACEOF iaxclient configure 0.2 -generated by GNU Autoconf 2.59 +generated by GNU Autoconf 2.57 -Copyright (C) 2003 Free Software Foundation, Inc. +Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002 +Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF @@ -980,7 +947,7 @@ running configure, to aid debugging if configure makes a mistake. It was created by iaxclient $as_me 0.2, which was -generated by GNU Autoconf 2.59. Invocation command line was +generated by GNU Autoconf 2.57. Invocation command line was $ $0 $@ @@ -1057,19 +1024,19 @@ 2) 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. + ac_must_keep_next=false # Got value, back to normal. else - case $ac_arg in - *=* | --config-cache | -C | -disable-* | --disable-* \ - | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ - | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ - | -with-* | --with-* | -without-* | --without-* | --x) - case "$ac_configure_args0 " in - "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; - esac - ;; - -* ) ac_must_keep_next=true ;; - esac + case $ac_arg in + *=* | --config-cache | -C | -disable-* | --disable-* \ + | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ + | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ + | -with-* | --with-* | -without-* | --without-* | --x) + case "$ac_configure_args0 " in + "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; + esac + ;; + -* ) ac_must_keep_next=true ;; + esac fi ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'" # Get rid of the leading space. @@ -1103,12 +1070,12 @@ case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in *ac_space=\ *) sed -n \ - "s/'"'"'/'"'"'\\\\'"'"''"'"'/g; - s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p" + "s/'"'"'/'"'"'\\\\'"'"''"'"'/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p" ;; *) sed -n \ - "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" + "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" ;; esac; } @@ -1137,7 +1104,7 @@ for ac_var in $ac_subst_files do eval ac_val=$`echo $ac_var` - echo "$ac_var='"'"'$ac_val'"'"'" + echo "$ac_var='"'"'$ac_val'"'"'" done | sort echo fi @@ -1156,7 +1123,7 @@ echo "$as_me: caught signal $ac_signal" echo "$as_me: exit $exit_status" } >&5 - rm -f core *.core && + rm -f core core.* *.core && rm -rf conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status ' 0 @@ -1236,7 +1203,7 @@ # value. ac_cache_corrupted=false for ac_var in `(set) 2>&1 | - sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do + sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val="\$ac_cv_env_${ac_var}_value" @@ -1253,13 +1220,13 @@ ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then - { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 + { 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:$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:$LINENO: current value: $ac_new_val" >&5 echo "$as_me: current value: $ac_new_val" >&2;} - ac_cache_corrupted=: + ac_cache_corrupted=: fi;; esac # Pass precious variables to config.status. @@ -2060,6 +2027,7 @@ (exit $ac_status); } cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -2079,8 +2047,8 @@ # 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. -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 +echo "$as_me:$LINENO: checking for C compiler default output" >&5 +echo $ECHO_N "checking for C compiler default output... $ECHO_C" >&6 ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` if { (eval echo "$as_me:$LINENO: \"$ac_link_default\"") >&5 (eval $ac_link_default) 2>&5 @@ -2100,23 +2068,23 @@ test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) - ;; + ;; conftest.$ac_ext ) - # This is the source file. - ;; + # This is the source file. + ;; [ab].out ) - # We found the default executable, but exeext='' is most - # certainly right. - break;; + # We found the default executable, but exeext='' is most + # certainly right. + break;; *.* ) - ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` - # FIXME: I believe we export ac_cv_exeext for Libtool, - # but it would be cool to find out if it's true. Does anybody - # maintain Libtool? --akim. - export ac_cv_exeext - break;; + ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + # FIXME: I believe we export ac_cv_exeext for Libtool, + # but it would be cool to find out if it's true. Does anybody + # maintain Libtool? --akim. + export ac_cv_exeext + break;; * ) - break;; + break;; esac done else @@ -2190,8 +2158,8 @@ case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` - export ac_cv_exeext - break;; + export ac_cv_exeext + break;; * ) break;; esac done @@ -2216,6 +2184,7 @@ echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -2266,6 +2235,7 @@ echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -2285,25 +2255,15 @@ _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 + (eval $ac_compile) 2>&5 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); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_compiler_gnu=yes else @@ -2312,7 +2272,7 @@ ac_compiler_gnu=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi @@ -2328,6 +2288,7 @@ echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -2344,25 +2305,15 @@ _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 + (eval $ac_compile) 2>&5 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); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_prog_cc_g=yes else @@ -2371,7 +2322,7 @@ ac_cv_prog_cc_g=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 echo "${ECHO_T}$ac_cv_prog_cc_g" >&6 @@ -2398,6 +2349,7 @@ ac_cv_prog_cc_stdc=no ac_save_CC=$CC cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -2425,16 +2377,6 @@ va_end (v); return s; } - -/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has - function prototypes and stuff, but not '\xHH' hex character constants. - These don't provoke an error unfortunately, instead are silently treated - as 'x'. The following induces an error, until -std1 is added to get - proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an - array size at least. It's necessary to write '\x00'==0 to get something - that's true only with -std1. */ -int osf4_cc_array ['\x00' == 0 ? 1 : -1]; - int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; @@ -2461,25 +2403,15 @@ CC="$ac_save_CC $ac_arg" rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 + (eval $ac_compile) 2>&5 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); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_prog_cc_stdc=$ac_arg break @@ -2488,7 +2420,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 fi -rm -f conftest.err conftest.$ac_objext +rm -f conftest.$ac_objext done rm -f conftest.$ac_ext conftest.$ac_objext CC=$ac_save_CC @@ -2516,28 +2448,19 @@ _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 + (eval $ac_compile) 2>&5 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); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then for ac_declaration in \ - '' \ + ''\ + '#include <stdlib.h>' \ 'extern "C" void std::exit (int) throw (); using std::exit;' \ 'extern "C" void std::exit (int); using std::exit;' \ 'extern "C" void exit (int) throw ();' \ @@ -2545,13 +2468,14 @@ 'void exit (int);' do cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -$ac_declaration #include <stdlib.h> +$ac_declaration int main () { @@ -2562,25 +2486,15 @@ _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 + (eval $ac_compile) 2>&5 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); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else @@ -2589,8 +2503,9 @@ continue fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f conftest.$ac_objext conftest.$ac_ext cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -2607,25 +2522,15 @@ _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 + (eval $ac_compile) 2>&5 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); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then break else @@ -2633,7 +2538,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f conftest.$ac_objext conftest.$ac_ext done rm -f conftest* if test -n "$ac_declaration"; then @@ -2647,7 +2552,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f conftest.$ac_objext conftest.$ac_ext ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -2682,6 +2587,7 @@ # 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 >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -2692,7 +2598,7 @@ #else # include <assert.h> #endif - Syntax error + Syntax error _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 @@ -2704,7 +2610,6 @@ (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi @@ -2725,6 +2630,7 @@ # OK, works on sane cases. Now check whether non-existent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -2742,7 +2648,6 @@ (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi @@ -2789,6 +2694,7 @@ # 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 >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -2799,7 +2705,7 @@ #else # include <assert.h> #endif - Syntax error + Syntax error _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 @@ -2811,7 +2717,6 @@ (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi @@ -2832,6 +2737,7 @@ # OK, works on sane cases. Now check whether non-existent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -2849,7 +2755,6 @@ (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi @@ -2900,7 +2805,6 @@ # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" -# OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6 @@ -2917,7 +2821,6 @@ case $as_dir/ in ./ | .// | /cC/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ - ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \ /usr/ucb/* ) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. @@ -2925,20 +2828,20 @@ # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then - if test $ac_prog = install && - grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then - # AIX install. It has an incompatible calling convention. - : - elif test $ac_prog = install && - grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then - # program-specific install script used by HP pwplus--don't use. - : - else - ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" - break 3 - fi - fi + if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then + if test $ac_prog = install && + grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + elif test $ac_prog = install && + grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # program-specific install script used by HP pwplus--don't use. + : + else + ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" + break 3 + fi + fi done done ;; @@ -2975,7 +2878,7 @@ echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5 echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6 -set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,:./+-,___p_,'` +set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,./+-,__p_,'` if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -3118,6 +3021,7 @@ echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -3138,25 +3042,15 @@ _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 + (eval $ac_compile) 2>&5 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); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_header_stdc=yes else @@ -3165,11 +3059,12 @@ ac_cv_header_stdc=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f 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 >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -3191,6 +3086,7 @@ if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -3215,6 +3111,7 @@ : else cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -3226,9 +3123,9 @@ # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #else # define ISLOWER(c) \ - (('a' <= (c) && (c) <= 'i') \ - || ('j' <= (c) && (c) <= 'r') \ - || ('s' <= (c) && (c) <= 'z')) + (('a' <= (c) && (c) <= 'i') \ + || ('j' <= (c) && (c) <= 'r') \ + || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif @@ -3239,7 +3136,7 @@ int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) - || toupper (i) != TOUPPER (i)) + || toupper (i) != TOUPPER (i)) exit(2); exit (0); } @@ -3264,7 +3161,7 @@ ( exit $ac_status ) ac_cv_header_stdc=no fi -rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi fi @@ -3289,7 +3186,7 @@ for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ - inttypes.h stdint.h unistd.h + inttypes.h stdint.h unistd.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` echo "$as_me:$LINENO: checking for $ac_header" >&5 @@ -3298,6 +3195,7 @@ echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -3309,25 +3207,15 @@ _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 + (eval $ac_compile) 2>&5 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); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_Header=yes" else @@ -3336,7 +3224,7 @@ eval "$as_ac_Header=no" fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 @@ -3365,6 +3253,7 @@ OLDCC="$CC" CC="$CC -pipe" cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -3381,25 +3270,15 @@ _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 + (eval $ac_compile) 2>&5 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); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 @@ -3411,7 +3290,7 @@ echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f conftest.$ac_objext conftest.$ac_ext fi #-------------------------------------------------------------------- @@ -3425,6 +3304,7 @@ else # See if sys/param.h defines the BYTE_ORDER macro. cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -3446,28 +3326,19 @@ _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 + (eval $ac_compile) 2>&5 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); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then # It does; now see whether it defined to BIG_ENDIAN or not. cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -3489,25 +3360,15 @@ _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 + (eval $ac_compile) 2>&5 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); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_c_bigendian=yes else @@ -3516,7 +3377,7 @@ ac_cv_c_bigendian=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f conftest.$ac_objext conftest.$ac_ext else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 @@ -3526,6 +3387,7 @@ # try to guess the endianness by grepping values into an object file ac_cv_c_bigendian=unknown cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -3547,25 +3409,15 @@ _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 + (eval $ac_compile) 2>&5 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); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then if grep BIGenDianSyS conftest.$ac_objext >/dev/null ; then ac_cv_c_bigendian=yes @@ -3583,9 +3435,10 @@ sed 's/^/| /' conftest.$ac_ext >&5 fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f conftest.$ac_objext conftest.$ac_ext else cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -3624,10 +3477,10 @@ ( exit $ac_status ) ac_cv_c_bigendian=yes fi -rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f 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 @@ -3663,28 +3516,21 @@ echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Define sin to an innocuous variant, in case <limits.h> declares sin. - For example, HP-UX 11i <limits.h> declares gettimeofday. */ -#define sin innocuous_sin - /* System header to define __stub macros and hopefully few prototypes, which can conflict with char sin (); below. Prefer <limits.h> to <assert.h> if __STDC__ is defined, since <limits.h> exists even on freestanding compilers. */ - #ifdef __STDC__ # include <limits.h> #else # include <assert.h> #endif - -#undef sin - /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" @@ -3715,25 +3561,15 @@ _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 + (eval $ac_link) 2>&5 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); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_sin=yes else @@ -3742,8 +3578,7 @@ ac_cv_func_sin=no fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_func_sin" >&5 echo "${ECHO_T}$ac_cv_func_sin" >&6 @@ -3761,6 +3596,7 @@ ac_check_lib_save_LIBS=$LIBS LIBS="-lieee $LIBS" cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -3778,25 +3614,15 @@ _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 + (eval $ac_link) 2>&5 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); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_ieee_main=yes else @@ -3805,8 +3631,7 @@ ac_cv_lib_ieee_main=no fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_ieee_main" >&5 @@ -3829,6 +3654,7 @@ ac_check_lib_save_LIBS=$LIBS LIBS="-linet $LIBS" cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -3846,25 +3672,15 @@ _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 + (eval $ac_link) 2>&5 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); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_inet_main=yes else @@ -3873,8 +3689,7 @@ ac_cv_lib_inet_main=no fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_inet_main" >&5 @@ -3896,6 +3711,7 @@ echo "$as_me:$LINENO: checking net/errno.h usability" >&5 echo $ECHO_N "checking net/errno.h usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -3906,25 +3722,15 @@ _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 + (eval $ac_compile) 2>&5 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); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else @@ -3933,7 +3739,7 @@ ac_header_compiler=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 @@ -3941,6 +3747,7 @@ echo "$as_me:$LINENO: checking net/errno.h presence" >&5 echo $ECHO_N "checking net/errno.h presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -3958,7 +3765,6 @@ (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi @@ -3978,31 +3784,32 @@ 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: ) +case $ac_header_compiler:$ac_header_preproc in + yes:no ) { echo "$as_me:$LINENO: WARNING: net/errno.h: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: net/errno.h: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: net/errno.h: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: net/errno.h: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes + { echo "$as_me:$LINENO: WARNING: net/errno.h: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: net/errno.h: proceeding with the preprocessor's result" >&2;} + ( + cat <<\_ASBOX +## ------------------------------------ ## +## Report this to bug...@gn.... ## +## ------------------------------------ ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&2 ;; - no:yes:* ) + no:yes ) { echo "$as_me:$LINENO: WARNING: net/errno.h: present but cannot be compiled" >&5 echo "$as_me: WARNING: net/errno.h: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: net/errno.h: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: net/errno.h: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: net/errno.h: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: net/errno.h: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: net/errno.h: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: net/errno.h: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: net/errno.h: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: net/errno.h: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: net/errno.h: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: net/errno.h: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: net/errno.h: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: net/errno.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------------ ## -## Report this to the iaxclient lists. ## +## Report this to bug...@gn.... ## ## ------------------------------------ ## _ASBOX ) | @@ -4056,28 +3863,21 @@ echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Define connect to an innocuous variant, in case <limits.h> declares connect. - For example, HP-UX 11i <limits.h> declares gettimeofday. */ -#define connect innocuous_connect - /* System header to define __stub macros and hopefully few prototypes, which can conflict with char connect (); below. Prefer <limits.h> to <assert.h> if __STDC__ is defined, since <limits.h> exists even on freestanding compilers. */ - #ifdef __STDC__ # include <limits.h> #else # include <assert.h> #endif - -#undef connect - /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" @@ -4108,25 +3908,15 @@ _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 + (eval $ac_link) 2>&5 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); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_connect=yes else @@ -4135,8 +3925,7 @@ ac_cv_func_connect=no fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_func_connect" >&5 echo "${ECHO_T}$ac_cv_func_connect" >&6 @@ -4153,28 +3942,21 @@ echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Define setsockopt to an innocuous variant, in case <limits.h> declares setsockopt. - For example, HP-UX 11i <limits.h> declares gettimeofday. */ -#define setsockopt innocuous_setsockopt - /* System header to define __stub macros and hopefully few prototypes, which can conflict with char setsockopt (); below. Prefer <limits.h> to <assert.h> if __STDC__ is defined, since <limits.h> exists even on freestanding compilers. */ - #ifdef __STDC__ # include <limits.h> #else # include <assert.h> #endif - -#undef setsockopt - /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" @@ -4205,25 +3987,15 @@ _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 + (eval $ac_link) 2>&5 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); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_setsockopt=yes else @@ -4232,8 +4004,7 @@ ac_cv_func_setsockopt=no fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_func_setsockopt" >&5 echo "${ECHO_T}$ac_cv_func_setsockopt" >&6 @@ -4248,6 +4019,7 @@ ac_check_lib_save_LIBS=$LIBS LIBS="-lsocket $LIBS" cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -4271,25 +4043,15 @@ _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 + (eval $ac_link) 2>&5 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); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_socket_setsockopt=yes else @@ -4298,8 +4060,7 @@ ac_cv_lib_socket_setsockopt=no fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_socket_setsockopt" >&5 @@ -4322,28 +4083,21 @@ echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Define accept to an innocuous variant, in case <limits.h> declares accept. - For example, HP-UX 11i <limits.h> declares gettimeofday. */ -#define accept innocuous_accept - /* System header to define __stub macros and hopefully few prototypes, which can conflict with char accept (); below. Prefer <limits.h> to <assert.h> if __STDC__ is defined, since <limits.h> exists even on freestanding compilers. */ - #ifdef __STDC__ # include <limits.h> #else # include <assert.h> #endif - -#undef accept - /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" @@ -4374,25 +4128,15 @@ _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 + (eval $ac_link) 2>&5 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); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_accept=yes else @@ -4401,8 +4145,7 @@ ac_cv_func_accept=no fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_func_accept" >&5 echo "${ECHO_T}$ac_cv_func_accept" >&6 @@ -4419,28 +4162,21 @@ echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Define gethostbyname to an innocuous variant, in case <limits.h> declares gethostbyname. - For example, HP-UX 11i <limits.h> declares gettimeofday. */ -#define gethostbyname innocuous_gethostbyname - /* System header to define __stub macros and hopefully few prototypes, which can conflict with char gethostbyname (); below. Prefer <limits.h> to <assert.h> if __STDC__ is defined, since <limits.h> exists even on freestanding compilers. */ - #ifdef __STDC__ # include <limits.h> #else # include <assert.h> #endif - -#undef gethostbyname - /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" @@ -4471,25 +4207,15 @@ _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 + (eval $ac_link) 2>&5 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); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_gethostbyname=yes else @@ -4498,8 +4224,7 @@ ac_cv_func_gethostbyname=no fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_func_gethostbyname" >&5 echo "${ECHO_T}$ac_cv_func_gethostbyname" >&6 @@ -4514,6 +4239,7 @@ ac_check_lib_save_LIBS=$LIBS LIBS="-lnsl $LIBS" cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -4537,25 +4263,15 @@ _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 + (eval $ac_link) 2>&5 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); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_nsl_gethostbyname=yes else @@ -4564,8 +4280,7 @@ ac_cv_lib_nsl_gethostbyname=no fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_nsl_gethostbyname" >&5 @@ -4591,6 +4306,7 @@ echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -4626,25 +4342,15 @@ _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 + (eval $ac_link) 2>&5 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); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then tcl_cv_dirent_h=yes else @@ -4653,8 +4359,7 @@ tcl_cv_dirent_h=no fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $tcl_cv_dirent_h" >&5 echo "${ECHO_T}$tcl_cv_dirent_h" >&6 @@ -4680,6 +4385,7 @@ echo "$as_me:$LINENO: checking errno.h usability" >&5 echo $ECHO_N "checking errno.h usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -4690,25 +4396,15 @@ _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 + (eval $ac_compile) 2>&5 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); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else @@ -4717,7 +4413,7 @@ ac_header_compiler=no fi -rm... [truncated message content] |
From: <sb...@us...> - 2007-10-31 19:01:28
|
Revision: 1251 http://iaxclient.svn.sourceforge.net/iaxclient/?rev=1251&view=rev Author: sbalea Date: 2007-10-31 12:01:27 -0700 (Wed, 31 Oct 2007) Log Message: ----------- Synchronize with trunk rev 1250 Revision Links: -------------- http://iaxclient.svn.sourceforge.net/iaxclient/?rev=1250&view=rev Modified Paths: -------------- branches/team/mihai/echocan/README.VisualStudio branches/team/mihai/echocan/contrib/tcl/iaxclient.c branches/team/mihai/echocan/contrib/win/vs2005/iaxclient.sln branches/team/mihai/echocan/lib/codec_theora.c branches/team/mihai/echocan/lib/iaxclient.h branches/team/mihai/echocan/lib/slice.c branches/team/mihai/echocan/lib/slice.h branches/team/mihai/echocan/lib/video.c branches/team/mihai/echocan/simpleclient/stresstest/stresstest.c branches/team/mihai/echocan/simpleclient/vtestcall/vtestcall.c Added Paths: ----------- branches/team/mihai/echocan/contrib/win/vs2005/libvidcap.vcproj Modified: branches/team/mihai/echocan/README.VisualStudio =================================================================== --- branches/team/mihai/echocan/README.VisualStudio 2007-10-31 17:31:21 UTC (rev 1250) +++ branches/team/mihai/echocan/README.VisualStudio 2007-10-31 19:01:27 UTC (rev 1251) @@ -28,18 +28,19 @@ http://www.microsoft.com/downloads/details.aspx?FamilyID=c2b1e300-f358-4523-b479-f53d234cdccf 2) Obtain dependencies. At the time of this writing, portaudio-v19, - libogg 1.1.3, speex 1.2beta1, and libtheora 1.0alpha7 are required. + libogg 1.1.3, speex 1.2beta1, libtheora 1.0alpha7, and libvidcap are required. Source for these dependencies are available here: http://portaudio.com/archives/pa_snapshot_v19.tar.gz http://downloads.xiph.org/releases/ogg/libogg-1.1.3.tar.gz http://downloads.xiph.org/releases/speex/speex-1.2beta1.tar.gz http://downloads.xiph.org/releases/theora/libtheora-1.0alpha7.tar.gz + http://downloads.sourceforge.net/libvidcap/libvidcap-0.1.tar.gz In order to build with the vcproj files provided by iaxclient, these dependent libraries must be moved to be peer directories to the iaxclient source directory. They also must have the following - names: libogg, speex, and libtheora. So the final directory + names: libogg, speex, libtheora and libvidcap. So the final directory layout would be as follows: C:\...\whereever\iaxclient @@ -47,6 +48,7 @@ C:\...\whereever\libogg C:\...\whereever\speex C:\...\whereever\libtheora + C:\...\whereever\libvidcap 2) Open the solution file: contrib/win/vs2005/iaxclient.sln Modified: branches/team/mihai/echocan/contrib/tcl/iaxclient.c =================================================================== --- branches/team/mihai/echocan/contrib/tcl/iaxclient.c 2007-10-31 17:31:21 UTC (rev 1250) +++ branches/team/mihai/echocan/contrib/tcl/iaxclient.c 2007-10-31 19:01:27 UTC (rev 1251) @@ -600,7 +600,9 @@ } if (objc == 2) { - line = iaxc_selected_call(); + // Problems reported coming from this line. + // If including it again you must be very sure of exactly what you do! + //line = iaxc_selected_call(); } if (objc == 3) { @@ -614,7 +616,9 @@ if (result == TCL_OK) { iaxc_call(num); - iaxc_select_call(line); + // Problems reported coming from this line. + // If including it again you must be very sure of exactly what you do! + //iaxc_select_call(line); } return result; } Modified: branches/team/mihai/echocan/contrib/win/vs2005/iaxclient.sln =================================================================== --- branches/team/mihai/echocan/contrib/win/vs2005/iaxclient.sln 2007-10-31 17:31:21 UTC (rev 1250) +++ branches/team/mihai/echocan/contrib/win/vs2005/iaxclient.sln 2007-10-31 19:01:27 UTC (rev 1251) @@ -7,14 +7,14 @@ EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libiaxclient", "libiaxclient.vcproj", "{9A9C003E-EAF6-4D0E-896F-E3994503C7E4}" ProjectSection(ProjectDependencies) = postProject + {82C9BD79-9796-405F-8A28-3F538514AC3A} = {82C9BD79-9796-405F-8A28-3F538514AC3A} + {3A76129B-55AB-4D54-BAA7-08F63ED52569} = {3A76129B-55AB-4D54-BAA7-08F63ED52569} + {5CC054B7-6DAA-46BF-9A08-3B33B83E8D3E} = {5CC054B7-6DAA-46BF-9A08-3B33B83E8D3E} + {2F463562-375D-481E-A6E0-7C7D0DC1ED7A} = {2F463562-375D-481E-A6E0-7C7D0DC1ED7A} + {E972C52F-9E85-4D65-B19C-031E511E9DB4} = {E972C52F-9E85-4D65-B19C-031E511E9DB4} + {E2C6AD95-7A61-41FE-8754-A4623C891BF8} = {E2C6AD95-7A61-41FE-8754-A4623C891BF8} + {F5166D99-32BB-40D5-BE95-6F97F72C44CE} = {F5166D99-32BB-40D5-BE95-6F97F72C44CE} {3B023516-2C69-4CCB-9302-239991B6EC2C} = {3B023516-2C69-4CCB-9302-239991B6EC2C} - {F5166D99-32BB-40D5-BE95-6F97F72C44CE} = {F5166D99-32BB-40D5-BE95-6F97F72C44CE} - {E2C6AD95-7A61-41FE-8754-A4623C891BF8} = {E2C6AD95-7A61-41FE-8754-A4623C891BF8} - {E972C52F-9E85-4D65-B19C-031E511E9DB4} = {E972C52F-9E85-4D65-B19C-031E511E9DB4} - {2F463562-375D-481E-A6E0-7C7D0DC1ED7A} = {2F463562-375D-481E-A6E0-7C7D0DC1ED7A} - {5CC054B7-6DAA-46BF-9A08-3B33B83E8D3E} = {5CC054B7-6DAA-46BF-9A08-3B33B83E8D3E} - {3A76129B-55AB-4D54-BAA7-08F63ED52569} = {3A76129B-55AB-4D54-BAA7-08F63ED52569} - {82C9BD79-9796-405F-8A28-3F538514AC3A} = {82C9BD79-9796-405F-8A28-3F538514AC3A} EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libiax2", "libiax2.vcproj", "{5CC054B7-6DAA-46BF-9A08-3B33B83E8D3E}" @@ -34,6 +34,11 @@ EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libvidcap", "..\..\..\..\libvidcap\contrib\win\vs2005\libvidcap.vcproj", "{F5166D99-32BB-40D5-BE95-6F97F72C44CE}" EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "vtestcall", "..\..\..\simpleclient\vtestcall\vtestcall.vcproj", "{B5F8E725-85A8-4CB1-8824-B82127BB2B1E}" + ProjectSection(ProjectDependencies) = postProject + {9A9C003E-EAF6-4D0E-896F-E3994503C7E4} = {9A9C003E-EAF6-4D0E-896F-E3994503C7E4} + EndProjectSection +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug_dll|Win32 = Debug_dll|Win32 @@ -122,6 +127,14 @@ {F5166D99-32BB-40D5-BE95-6F97F72C44CE}.Release_dll|Win32.Build.0 = Release|Win32 {F5166D99-32BB-40D5-BE95-6F97F72C44CE}.Release|Win32.ActiveCfg = Release|Win32 {F5166D99-32BB-40D5-BE95-6F97F72C44CE}.Release|Win32.Build.0 = Release|Win32 + {B5F8E725-85A8-4CB1-8824-B82127BB2B1E}.Debug_dll|Win32.ActiveCfg = Debug|Win32 + {B5F8E725-85A8-4CB1-8824-B82127BB2B1E}.Debug_dll|Win32.Build.0 = Debug|Win32 + {B5F8E725-85A8-4CB1-8824-B82127BB2B1E}.Debug|Win32.ActiveCfg = Debug|Win32 + {B5F8E725-85A8-4CB1-8824-B82127BB2B1E}.Debug|Win32.Build.0 = Debug|Win32 + {B5F8E725-85A8-4CB1-8824-B82127BB2B1E}.Release_dll|Win32.ActiveCfg = Release|Win32 + {B5F8E725-85A8-4CB1-8824-B82127BB2B1E}.Release_dll|Win32.Build.0 = Release|Win32 + {B5F8E725-85A8-4CB1-8824-B82127BB2B1E}.Release|Win32.ActiveCfg = Release|Win32 + {B5F8E725-85A8-4CB1-8824-B82127BB2B1E}.Release|Win32.Build.0 = Release|Win32 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE Copied: branches/team/mihai/echocan/contrib/win/vs2005/libvidcap.vcproj (from rev 1250, trunk/contrib/win/vs2005/libvidcap.vcproj) =================================================================== --- branches/team/mihai/echocan/contrib/win/vs2005/libvidcap.vcproj (rev 0) +++ branches/team/mihai/echocan/contrib/win/vs2005/libvidcap.vcproj 2007-10-31 19:01:27 UTC (rev 1251) @@ -0,0 +1,361 @@ +<?xml version="1.0" encoding="Windows-1252"?> +<VisualStudioProject + ProjectType="Visual C++" + Version="8.00" + Name="libvidcap" + ProjectGUID="{F5166D99-32BB-40D5-BE95-6F97F72C44CE}" + RootNamespace="libvidcap" + Keyword="Win32Proj" + > + <Platforms> + <Platform + Name="Win32" + /> + </Platforms> + <ToolFiles> + </ToolFiles> + <Configurations> + <Configuration + Name="Debug|Win32" + OutputDirectory="$(SolutionDir)\$(ConfigurationName)\$(ProjectName)" + IntermediateDirectory="$(OutDir)" + ConfigurationType="4" + CharacterSet="1" + > + <Tool + Name="VCPreBuildEventTool" + /> + <Tool + Name="VCCustomBuildTool" + /> + <Tool + Name="VCXMLDataGeneratorTool" + /> + <Tool + Name="VCWebServiceProxyGeneratorTool" + /> + <Tool + Name="VCMIDLTool" + /> + <Tool + Name="VCCLCompilerTool" + Optimization="0" + AdditionalIncludeDirectories="..\..\..\..\libvidcap\src;..\..\..\..\libvidcap\src\directshow;..\..\..\..\libvidcap\include;"$(DXSDK_DIR)\Include"" + PreprocessorDefinitions="WIN32;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;HAVE_DIRECTSHOW;HAVE_SLEEP" + MinimalRebuild="true" + BasicRuntimeChecks="3" + RuntimeLibrary="3" + UsePrecompiledHeader="0" + WarningLevel="3" + Detect64BitPortabilityProblems="true" + DebugInformationFormat="4" + CompileAs="1" + /> + <Tool + Name="VCManagedResourceCompilerTool" + /> + <Tool + Name="VCResourceCompilerTool" + /> + <Tool + Name="VCPreLinkEventTool" + /> + <Tool + Name="VCLibrarianTool" + /> + <Tool + Name="VCALinkTool" + /> + <Tool + Name="VCXDCMakeTool" + /> + <Tool + Name="VCBscMakeTool" + /> + <Tool + Name="VCFxCopTool" + /> + <Tool + Name="VCPostBuildEventTool" + /> + </Configuration> + <Configuration + Name="Release|Win32" + OutputDirectory="$(SolutionDir)\$(ConfigurationName)\$(ProjectName)" + IntermediateDirectory="$(OutDir)" + ConfigurationType="4" + CharacterSet="1" + WholeProgramOptimization="1" + > + <Tool + Name="VCPreBuildEventTool" + /> + <Tool + Name="VCCustomBuildTool" + /> + <Tool + Name="VCXMLDataGeneratorTool" + /> + <Tool + Name="VCWebServiceProxyGeneratorTool" + /> + <Tool + Name="VCMIDLTool" + /> + <Tool + Name="VCCLCompilerTool" + AdditionalIncludeDirectories="..\..\..\..\libvidcap\src;..\..\..\..\libvidcap\src\directshow;..\..\..\..\libvidcap\include;"$(DXSDK_DIR)\Include"" + PreprocessorDefinitions="WIN32;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;HAVE_DIRECTSHOW;HAVE_SLEEP" + RuntimeLibrary="2" + UsePrecompiledHeader="0" + WarningLevel="3" + Detect64BitPortabilityProblems="true" + DebugInformationFormat="3" + CompileAs="1" + /> + <Tool + Name="VCManagedResourceCompilerTool" + /> + <Tool + Name="VCResourceCompilerTool" + /> + <Tool + Name="VCPreLinkEventTool" + /> + <Tool + Name="VCLibrarianTool" + /> + <Tool + Name="VCALinkTool" + /> + <Tool + Name="VCXDCMakeTool" + /> + <Tool + Name="VCBscMakeTool" + /> + <Tool + Name="VCFxCopTool" + /> + <Tool + Name="VCPostBuildEventTool" + /> + </Configuration> + </Configurations> + <References> + </References> + <Files> + <Filter + Name="Source Files" + Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx" + UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}" + > + <File + RelativePath="..\..\..\..\libvidcap\src\conv.c" + > + </File> + <File + RelativePath="..\..\..\..\libvidcap\src\conv_to_i420.c" + > + </File> + <File + RelativePath="..\..\..\..\libvidcap\src\conv_to_rgb.c" + > + </File> + <File + RelativePath="..\..\..\..\libvidcap\src\conv_to_yuy2.c" + > + </File> + <File + RelativePath="..\..\..\..\libvidcap\src\directshow\DevMonitor.cpp" + > + <FileConfiguration + Name="Debug|Win32" + > + <Tool + Name="VCCLCompilerTool" + CompileAs="2" + /> + </FileConfiguration> + <FileConfiguration + Name="Release|Win32" + > + <Tool + Name="VCCLCompilerTool" + CompileAs="2" + /> + </FileConfiguration> + </File> + <File + RelativePath="..\..\..\..\libvidcap\src\directshow\DirectShowSource.cpp" + > + <FileConfiguration + Name="Debug|Win32" + > + <Tool + Name="VCCLCompilerTool" + CompileAs="2" + /> + </FileConfiguration> + <FileConfiguration + Name="Release|Win32" + > + <Tool + Name="VCCLCompilerTool" + CompileAs="2" + /> + </FileConfiguration> + </File> + <File + RelativePath="..\..\..\..\libvidcap\src\directshow\DShowSrcManager.cpp" + > + <FileConfiguration + Name="Debug|Win32" + > + <Tool + Name="VCCLCompilerTool" + CompileAs="2" + /> + </FileConfiguration> + <FileConfiguration + Name="Release|Win32" + > + <Tool + Name="VCCLCompilerTool" + CompileAs="2" + /> + </FileConfiguration> + </File> + <File + RelativePath="..\..\..\..\libvidcap\src\directshow\GraphMonitor.cpp" + > + <FileConfiguration + Name="Debug|Win32" + > + <Tool + Name="VCCLCompilerTool" + CompileAs="2" + /> + </FileConfiguration> + <FileConfiguration + Name="Release|Win32" + > + <Tool + Name="VCCLCompilerTool" + CompileAs="2" + /> + </FileConfiguration> + </File> + <File + RelativePath="..\..\..\..\libvidcap\src\hotlist.c" + > + </File> + <File + RelativePath="..\..\..\..\libvidcap\src\logging.c" + > + </File> + <File + RelativePath="..\..\..\..\libvidcap\src\sapi.c" + > + </File> + <File + RelativePath="..\..\..\..\libvidcap\src\sapi_dshow.cpp" + > + <FileConfiguration + Name="Debug|Win32" + > + <Tool + Name="VCCLCompilerTool" + CompileAs="2" + /> + </FileConfiguration> + <FileConfiguration + Name="Release|Win32" + > + <Tool + Name="VCCLCompilerTool" + CompileAs="2" + /> + </FileConfiguration> + </File> + <File + RelativePath="..\..\..\..\libvidcap\src\sliding_window.c" + > + </File> + <File + RelativePath="..\..\..\..\libvidcap\src\vidcap.c" + > + </File> + </Filter> + <Filter + Name="Header Files" + Filter="h;hpp;hxx;hm;inl;inc;xsd" + UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}" + > + <File + RelativePath="..\..\..\..\libvidcap\src\conv.h" + > + </File> + <File + RelativePath="..\..\..\..\libvidcap\include\vidcap\converters.h" + > + </File> + <File + RelativePath="..\..\..\..\libvidcap\src\directshow\DevMonitor.h" + > + </File> + <File + RelativePath="..\..\..\..\libvidcap\src\directshow\DirectShowSource.h" + > + </File> + <File + RelativePath="..\..\..\..\libvidcap\src\directshow\DShowSrcManager.h" + > + </File> + <File + RelativePath="..\..\..\..\libvidcap\src\directshow\GraphMonitor.h" + > + </File> + <File + RelativePath="..\..\..\..\libvidcap\src\hotlist.h" + > + </File> + <File + RelativePath="..\..\..\..\libvidcap\src\directshow\LocklessQueue.h" + > + </File> + <File + RelativePath="..\..\..\..\libvidcap\src\logging.h" + > + </File> + <File + RelativePath="..\..\..\..\libvidcap\src\logging.h" + > + </File> + <File + RelativePath="..\..\..\..\libvidcap\src\sapi.h" + > + </File> + <File + RelativePath="..\..\..\..\libvidcap\src\sapi_context.h" + > + </File> + <File + RelativePath="..\..\..\..\libvidcap\src\sliding_window.h" + > + </File> + <File + RelativePath="..\..\..\..\libvidcap\include\vidcap\vidcap.h" + > + </File> + </Filter> + <Filter + Name="Resource Files" + Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav" + UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}" + > + </Filter> + </Files> + <Globals> + </Globals> +</VisualStudioProject> Modified: branches/team/mihai/echocan/lib/codec_theora.c =================================================================== --- branches/team/mihai/echocan/lib/codec_theora.c 2007-10-31 17:31:21 UTC (rev 1250) +++ branches/team/mihai/echocan/lib/codec_theora.c 2007-10-31 19:01:27 UTC (rev 1251) @@ -111,7 +111,8 @@ free(c); } -static int decode(struct iaxc_video_codec *c, int inlen, char *in, int *outlen, char *out) +static int decode(struct iaxc_video_codec *c, int inlen, const char *in, + int *outlen, char *out) { struct theora_decoder *d; ogg_packet op; Modified: branches/team/mihai/echocan/lib/iaxclient.h =================================================================== --- branches/team/mihai/echocan/lib/iaxclient.h 2007-10-31 17:31:21 UTC (rev 1250) +++ branches/team/mihai/echocan/lib/iaxclient.h 2007-10-31 19:01:27 UTC (rev 1251) @@ -132,6 +132,8 @@ #define IAXC_EVENT_DTMF 9 /*!< Indicates a DTMF event */ #define IAXC_EVENT_AUDIO 10 /*!< Indicates an audio event */ #define IAXC_EVENT_VIDEOSTATS 11 /*!< Indicates a video statistics update event */ +#define IAXC_EVENT_VIDCAP_ERROR 12 /*!< Indicates a video capture error occurred */ +#define IAXC_EVENT_VIDCAP_DEVICE 13 /*!< Indicates a possible video capture device insertion/removal */ #define IAXC_CALL_STATE_FREE 0 /*!< Indicates a call slot is free */ #define IAXC_CALL_STATE_ACTIVE (1<<1) /*!< Indicates a call is active */ @@ -920,6 +922,26 @@ */ EXPORT int iaxc_get_netstats(int call, int *rtt, struct iaxc_netstat *local, struct iaxc_netstat *remote); +/*! + A structure containing information about a video capture device. +*/ +struct iaxc_video_device { + /*! + The "human readable" name of the device + */ + const char *name; + + /*! + unique id of the device + */ + const char *id_string; + + /*! + iaxclient id of the device + */ + int id; +}; + #define IAXC_AD_INPUT (1<<0) /*!< Device is usable for input*/ #define IAXC_AD_OUTPUT (1<<1) /*!< Device is usable for output */ #define IAXC_AD_RING (1<<2) /*!< Device is usable for ring */ @@ -1112,6 +1134,23 @@ */ EXPORT int iaxc_set_audio_prefs(unsigned int prefs); +/*! + Get video capture device information: + \param devs Returns an array of iaxc_video_device structures. + The array will will be valid as long as iaxc is initialized. + \param nDevs Returns the number of devices in the devs array + \param devId Returns the id of the currently selected video capture device + + \return -1 on error, 0 if no change to the device list, 1 if it's been updated + */ +EXPORT int iaxc_video_devices_get(struct iaxc_video_device **devs, int *nDevs, int *devId); + +/*! + Sets the current video capture device + \param devId The id of the device to use for video capture + */ +EXPORT int iaxc_video_device_set(int devId); + /* * Acceptable range for video rezolution */ Modified: branches/team/mihai/echocan/lib/slice.c =================================================================== --- branches/team/mihai/echocan/lib/slice.c 2007-10-31 17:31:21 UTC (rev 1250) +++ branches/team/mihai/echocan/lib/slice.c 2007-10-31 19:01:27 UTC (rev 1251) @@ -32,7 +32,7 @@ return 0; } -int slice(char *data, +int slice(const char *data, unsigned int size, struct slice_set_t *slice_set, struct slicer_context *sc @@ -93,7 +93,8 @@ dsc->frame_complete = 0; } -char * deslice(char *in, int inlen, int *outlen, struct deslicer_context *dsc) +char * +deslice(const char *in, int inlen, int *outlen, struct deslicer_context *dsc) { unsigned char frame_index, slice_index, num_slices, version; unsigned short source_id; Modified: branches/team/mihai/echocan/lib/slice.h =================================================================== --- branches/team/mihai/echocan/lib/slice.h 2007-10-31 17:31:21 UTC (rev 1250) +++ branches/team/mihai/echocan/lib/slice.h 2007-10-31 19:01:27 UTC (rev 1251) @@ -77,7 +77,7 @@ * sc - holds stream information such as source id and frame index * Returns 0 if completed successfully or a negative value if failure. */ -int slice(char *data, +int slice(const char *data, unsigned int size, struct slice_set_t *slice_set, struct slicer_context *sc @@ -103,6 +103,7 @@ * Returns a pointer to a buffer containing the completed frame and updates * outlen with the frame size if successful */ -char * deslice(char *in, int inlen, int *outlen, struct deslicer_context *dsc); +char * +deslice(const char *in, int inlen, int *outlen, struct deslicer_context *dsc); -#endif // __SLICE_H__ +#endif Modified: branches/team/mihai/echocan/lib/video.c =================================================================== --- branches/team/mihai/echocan/lib/video.c 2007-10-31 17:31:21 UTC (rev 1250) +++ branches/team/mihai/echocan/lib/video.c 2007-10-31 19:01:27 UTC (rev 1251) @@ -31,13 +31,16 @@ #include "codec_theora.h" #endif +#if defined(WIN32) +#define strdup _strdup +#endif + struct video_info { vidcap_state * vc; vidcap_sapi * sapi; vidcap_src * src; struct vidcap_sapi_info sapi_info; - struct vidcap_src_info src_info; struct vidcap_fmt_info fmt_info; /* these are the requested (post-scaling) dimensions */ @@ -63,6 +66,15 @@ int prefs; struct slicer_context * sc; + + /* these two struct arrays are correlated by index */ + struct vidcap_src_info * vc_src_info; + struct iaxc_video_device * devices; + MUTEX dev_list_lock; + + int device_count; + int selected_device_id; + int next_id; }; struct video_format_info @@ -492,6 +504,24 @@ */ } +static int video_device_notification_callback(vidcap_sapi *sapi, + void * user_context) +{ + iaxc_event evt; + + if ( sapi != vinfo.sapi ) + { + fprintf(stderr, "ERROR: wrong sapi in device notification\n"); + return -1; + } + + /* notify application that device list has been updated */ + evt.type = IAXC_EVENT_VIDCAP_DEVICE; + iaxci_post_event(evt); + + return 0; +} + static int capture_callback(vidcap_src * src, void * user_data, struct vidcap_capture_info * cap_info) { @@ -517,6 +547,8 @@ const char * source_buf = 0; int source_buf_size = 0; + iaxc_event evt; + int i; if ( cap_info->error_status ) @@ -524,6 +556,9 @@ fprintf(stderr, "vidcap capture error %d\n", cap_info->error_status); vinfo.capturing = 0; + + evt.type = IAXC_EVENT_VIDCAP_ERROR; + iaxci_post_event(evt); return -1; } @@ -732,30 +767,10 @@ }; static const int fourcc_list_len = sizeof(fourcc_list) / sizeof(int); - int i; static const int max_factor = 2; int scale_factor; + int i; - if ( !vinfo.src ) - { - /* Acquire the default source */ - if ( !(vinfo.src = vidcap_src_acquire(vinfo.sapi, 0)) ) - { - fprintf(stderr, "failed to acquire video source\n"); - return -1; - } - - if ( vidcap_src_info_get(vinfo.src, &vinfo.src_info) ) - { - fprintf(stderr, "failed to get video source info\n"); - return -1; - } - - fprintf(stderr, "acquired vidcap source %s (%s)\n", - vinfo.src_info.description, - vinfo.src_info.identifier); - } - vinfo.width = vfinfo.width; vinfo.height = vfinfo.height; vinfo.fmt_info.fps_numerator = vfinfo.framerate; @@ -878,6 +893,46 @@ return 0; } +static int ensure_acquired(int dev_id) +{ + int dev_num; + + if ( !vinfo.src ) + { + MUTEXLOCK(&vinfo.dev_list_lock); + + for ( dev_num = 0; dev_num < vinfo.device_count; dev_num++ ) + { + if ( vinfo.devices[dev_num].id == dev_id ) + break; + } + + if ( dev_num == vinfo.device_count ) + { + MUTEXUNLOCK(&vinfo.dev_list_lock); + fprintf(stderr, "invalid vidcap dev id: %d\n", dev_id); + return -1; + } + + if ( !(vinfo.src = vidcap_src_acquire(vinfo.sapi, + &vinfo.vc_src_info[dev_num])) ) + { + vinfo.src = 0; + MUTEXUNLOCK(&vinfo.dev_list_lock); + fprintf(stderr, "failed to acquire video source\n"); + return -1; + } + + fprintf(stderr, "acquired vidcap source %s (%s)\n", + vinfo.vc_src_info[dev_num].description, + vinfo.vc_src_info[dev_num].identifier); + + MUTEXUNLOCK(&vinfo.dev_list_lock); + } + + return 0; +} + EXPORT int iaxc_set_video_prefs(unsigned int prefs) { const unsigned int prefs_mask = @@ -888,9 +943,14 @@ IAXC_VIDEO_PREF_SEND_DISABLE | IAXC_VIDEO_PREF_RECV_RGB32 | IAXC_VIDEO_PREF_CAPTURE_DISABLE; + int ret; if ( prefs & ~prefs_mask ) + { + fprintf(stderr, "ERROR: unexpected video preference: 0x%0x\n", + prefs); return -1; + } vinfo.prefs = prefs; @@ -911,7 +971,15 @@ { if ( vidcap_src_capture_stop(vinfo.src) ) fprintf(stderr, "failed vidcap_src_capture_stop\n"); + vinfo.capturing = 0; + + if ( vinfo.src && vidcap_src_release(vinfo.src) ) + { + fprintf(stderr, "failed to release a video source\n"); + } + + vinfo.src = 0; } MUTEXUNLOCK(&vinfo.camera_lock); } @@ -920,17 +988,30 @@ MUTEXLOCK(&vinfo.camera_lock); if ( !vinfo.capturing ) { + if ( vinfo.selected_device_id < 0 ) + { + MUTEXUNLOCK(&vinfo.camera_lock); + return -1; + } + + if ( ensure_acquired(vinfo.selected_device_id) ) + { + MUTEXUNLOCK(&vinfo.camera_lock); + return -1; + } + if ( prepare_for_capture() ) { MUTEXUNLOCK(&vinfo.camera_lock); return -1; } - if ( vidcap_src_capture_start(vinfo.src, - capture_callback, 0) ) + if ( (ret = vidcap_src_capture_start(vinfo.src, + capture_callback, 0)) ) { MUTEXUNLOCK(&vinfo.camera_lock); - fprintf(stderr, "failed to start video capture\n"); + fprintf(stderr, "failed to start video capture: %d\n", + ret); return -1; } @@ -1231,10 +1312,230 @@ return 0; } +EXPORT int iaxc_video_devices_get(struct iaxc_video_device **devs, + int *num_devs, int *id_selected) +{ + int new_device_count; + int old_device_count; + struct vidcap_src_info *new_src_list; + struct vidcap_src_info *old_src_list; + struct iaxc_video_device *new_iaxc_dev_list; + struct iaxc_video_device *old_iaxc_dev_list; + int found_selected_device = 0; + int list_changed = 0; + int i, n; + + /* update libvidcap's device list */ + new_device_count = vidcap_src_list_update(vinfo.sapi); + if ( new_device_count != vinfo.device_count ) + list_changed = 1; + + if ( new_device_count < 0 ) + { + fprintf(stderr, "ERROR: failed getting updated vidcap device list: %d\n", + new_device_count); + return -1; + } + + new_src_list = (struct vidcap_src_info *)malloc(new_device_count * + sizeof(struct vidcap_src_info)); + if ( !new_src_list ) + { + fprintf(stderr, "ERROR: failed updated source allocation\n"); + return -1; + } + + new_iaxc_dev_list = (struct iaxc_video_device *)malloc( + new_device_count * sizeof(struct iaxc_video_device)); + if ( !new_iaxc_dev_list ) + { + free(new_src_list); + fprintf(stderr, "ERROR: failed source allocation update\n"); + return -1; + } + + /* get an updated libvidcap device list */ + if ( vidcap_src_list_get(vinfo.sapi, new_device_count, new_src_list) ) + { + fprintf(stderr, "ERROR: failed vidcap_srcList_get()\n"); + + free(new_src_list); + free(new_iaxc_dev_list); + return -1; + } + + /* build a new iaxclient video source list */ + found_selected_device = 0; + for ( n = 0; n < new_device_count; n++ ) + { + new_iaxc_dev_list[n].name = strdup(new_src_list[n].description); + new_iaxc_dev_list[n].id_string = strdup(new_src_list[n].identifier); + + /* this device may have been here all along + * Check if it has, and re-assign that device id + * else assign a new id + */ + for ( i = 0; i < vinfo.device_count; i++ ) + { + if ( !strcmp(new_iaxc_dev_list[n].name, vinfo.devices[i].name) ) + { + /*fprintf(stderr, "EXISTING DEVICE: %s - (id=%d) '%s'\n", + new_iaxc_dev_list[n].name, + vinfo.devices[i].id, + new_iaxc_dev_list[n].id_string); + */ + new_iaxc_dev_list[n].id = vinfo.devices[i].id; + + if ( vinfo.selected_device_id == new_iaxc_dev_list[n].id ) + found_selected_device = 1; + break; + } + } + if ( i == vinfo.device_count ) + { + new_iaxc_dev_list[n].id = vinfo.next_id++; + fprintf(stderr, "NEW DEVICE: %s - (id=%d) '%s'\n", + new_iaxc_dev_list[n].name, + new_iaxc_dev_list[n].id, + new_iaxc_dev_list[n].id_string); + + list_changed = 1; + } + } + + if ( !list_changed ) + { + /* Free new lists. Nothing's really changed */ + free(new_src_list); + for ( i = 0; i < new_device_count; i++ ) + { + free((void *)new_iaxc_dev_list[i].name); + free((void *)new_iaxc_dev_list[i].id_string); + } + free(new_iaxc_dev_list); + } + else + { + old_device_count = vinfo.device_count; + old_src_list = vinfo.vc_src_info; + old_iaxc_dev_list = vinfo.devices; + + /* Update iaxclient's device list info */ + /* Lock since other iaxclient funcs use these fields */ + MUTEXLOCK(&vinfo.dev_list_lock); + + vinfo.device_count = new_device_count; + vinfo.vc_src_info = new_src_list; + vinfo.devices = new_iaxc_dev_list; + + MUTEXUNLOCK(&vinfo.dev_list_lock); + + /* free old lists */ + free(old_src_list); + for ( i = 0; i < old_device_count; i++ ) + { + free((void *)old_iaxc_dev_list[i].name); + free((void *)old_iaxc_dev_list[i].id_string); + } + free(old_iaxc_dev_list); + } + + *devs = vinfo.devices; + *num_devs = vinfo.device_count; + *id_selected = found_selected_device ? vinfo.selected_device_id : -1; + + return list_changed; +} + +EXPORT int iaxc_video_device_set(int capture_dev_id) +{ + int ret = 0; + int dev_num = 0; + + MUTEXLOCK(&vinfo.camera_lock); + + if ( capture_dev_id == vinfo.selected_device_id ) + { + MUTEXUNLOCK(&vinfo.camera_lock); + return 0; + } + + if ( capture_dev_id < 0 ) + { + MUTEXUNLOCK(&vinfo.camera_lock); + fprintf(stderr, "invalid video device id ( < 0 )\n"); + return -1; + } + + MUTEXLOCK(&vinfo.dev_list_lock); + + for ( dev_num = 0; dev_num < vinfo.device_count; dev_num++ ) + { + if ( vinfo.devices[dev_num].id == capture_dev_id ) + break; + } + + if ( dev_num == vinfo.device_count ) + { + MUTEXUNLOCK(&vinfo.dev_list_lock); + MUTEXUNLOCK(&vinfo.camera_lock); + fprintf(stderr, "invalid video device id: %d\n", + capture_dev_id); + return -1; + } + + vinfo.selected_device_id = capture_dev_id; + + if ( vinfo.src && vidcap_src_release(vinfo.src) ) + { + fprintf(stderr, "failed to release video source\n"); + } + + vinfo.src = 0; + + MUTEXUNLOCK(&vinfo.dev_list_lock); + + if ( vinfo.capturing ) + { + if ( ensure_acquired(capture_dev_id) ) + { + MUTEXUNLOCK(&vinfo.camera_lock); + return -1; + } + + if ( prepare_for_capture() ) + { + MUTEXUNLOCK(&vinfo.camera_lock); + return -1; + } + + if ( (ret = vidcap_src_capture_start(vinfo.src, + capture_callback, 0)) ) + { + MUTEXUNLOCK(&vinfo.camera_lock); + fprintf(stderr, "failed to restart video capture: %d\n", ret); + return -1; + } + } + + MUTEXUNLOCK(&vinfo.camera_lock); + + return 0; +} + int video_initialize(void) { + int i; + const int starting_id = 50; + memset(&vinfo, 0, sizeof(vinfo)); + MUTEXINIT(&vinfo.camera_lock); + MUTEXINIT(&vinfo.dev_list_lock); + + vinfo.width = vfinfo.width; + vinfo.height = vfinfo.height; + if ( !(vinfo.vc = vidcap_initialize()) ) { fprintf(stderr, "ERROR: failed vidcap_initialize\n"); @@ -1257,23 +1558,89 @@ vinfo.sapi_info.description, vinfo.sapi_info.identifier); - /* TODO: Maybe we should reevaluate these defaults. Once could - * make an argument that reasonable users of iaxclient might - * not want video to be delivered as soon as they iaxc_initialize(). + vinfo.selected_device_id = -1; + + vinfo.device_count = vidcap_src_list_update(vinfo.sapi); + if ( vinfo.device_count < 0 ) + { + fprintf(stderr, + "ERROR: failed updating video capture devices list\n"); + goto bail; + } + + vinfo.vc_src_info = (struct vidcap_src_info *)malloc(vinfo.device_count * + sizeof(struct vidcap_src_info)); + if ( !vinfo.vc_src_info ) + { + fprintf(stderr, "ERROR: failed vinfo field allocations\n"); + goto bail; + } + + vinfo.devices = (struct iaxc_video_device *)malloc(vinfo.device_count * + sizeof(struct iaxc_video_device)); + if ( !vinfo.devices ) + { + fprintf(stderr, "ERROR: failed vinfo field allocation\n"); + free(vinfo.vc_src_info); + goto bail; + } + + if ( vidcap_src_list_get(vinfo.sapi, vinfo.device_count, + vinfo.vc_src_info) ) + { + fprintf(stderr, "ERROR: failed vidcap_src_list_get()\n"); + free(vinfo.vc_src_info); + free(vinfo.devices); + goto bail; + } + + /* build initial iaxclient video source list */ + for ( i = 0; i < vinfo.device_count; i++ ) + { + vinfo.devices[i].name = strdup(vinfo.vc_src_info[i].description); + vinfo.devices[i].id_string = strdup(vinfo.vc_src_info[i].identifier); + /* Let's be clear that the device id is not some + * base-zero index. Once plug-n-play is implemented, + * these ids may diverge as devices are added + * and removed. + */ + vinfo.devices[i].id = i + starting_id; + } + vinfo.next_id = vinfo.devices[vinfo.device_count - 1].id + 1; + + /* set default source - the first device */ + if ( vinfo.device_count ) + { + iaxc_video_device_set(vinfo.devices[0].id); + } + + /* setup device notification callback + * for device insertion and removal */ + if ( vidcap_srcs_notify(vinfo.sapi, &video_device_notification_callback, 0) ) + { + fprintf(stderr, "ERROR: failed vidcap_srcs_notify()\n"); + goto late_bail; + } + vinfo.prefs = IAXC_VIDEO_PREF_RECV_LOCAL_RAW | - IAXC_VIDEO_PREF_RECV_REMOTE_RAW; + IAXC_VIDEO_PREF_RECV_REMOTE_RAW | + IAXC_VIDEO_PREF_CAPTURE_DISABLE; - MUTEXINIT(&vinfo.camera_lock); + return 0; - /* We reset the existing video preferences to yield the side-effect - * of potentially starting or stopping the video capture. - */ - iaxc_set_video_prefs(vinfo.prefs); +late_bail: + free(vinfo.vc_src_info); - return 0; + for ( i = 0; i < vinfo.device_count; i++ ) + { + free((void *)vinfo.devices[i].name); + free((void *)vinfo.devices[i].id_string); + } + free(vinfo.devices); + bail: vidcap_destroy(vinfo.vc); vinfo.vc = 0; @@ -1289,6 +1656,7 @@ vinfo.vc = 0; MUTEXDESTROY(&vinfo.camera_lock); + MUTEXDESTROY(&vinfo.dev_list_lock); if ( vinfo.converted_i420_buf ) { @@ -1324,7 +1692,7 @@ * we are saying that the "camera is working" if there exists * more than zero cameras. */ - return vidcap_src_list_update(vinfo.sapi); + return vidcap_src_list_update(vinfo.sapi) > 0; } int video_send_stats(struct iaxc_call * call) Modified: branches/team/mihai/echocan/simpleclient/stresstest/stresstest.c =================================================================== --- branches/team/mihai/echocan/simpleclient/stresstest/stresstest.c 2007-10-31 17:31:21 UTC (rev 1250) +++ branches/team/mihai/echocan/simpleclient/stresstest/stresstest.c 2007-10-31 19:01:27 UTC (rev 1251) @@ -23,7 +23,6 @@ #include <signal.h> #include "iaxclient.h" -#include "slice.h" #include "file.h" #ifdef WIN32 @@ -57,7 +56,8 @@ static int send_video = 1; static int send_audio = 1; static int print_netstats = 0; -static int timeout = 0; +static int call_timeout_ms = 0; +static int connect_timeout_ms = 5000; static int video_frames_count = 0; static int audio_frames_count = 0; @@ -193,7 +193,8 @@ " -a stop sending audio\n" " -l run file in a loop\n" " -n dump periodic netstats to log file\n" - " -t <timeout> terminate after timeout seconds and report status via return code\n" + " -t <TIMEOUT> terminate call after TIMEOUT seconds\n" + " -c <TIMEOUT> try connecting for TIMEOUT seconds (default 5)\n" " -L <FILE> log to FILE\n" "\n" ); @@ -269,14 +270,14 @@ switch ( argv[i][1] ) { case 'F': /* set video params */ - { - formatp = 1 << atoi(argv[++i]); - framerate = atoi(argv[++i]); - bitrate = atoi(argv[++i]); - width = atoi(argv[++i]); - height = atoi(argv[++i]); - fragsize = atoi(argv[++i]); - } + if ( i+6 >= argc ) + usage(); + formatp = 1 << atoi(argv[++i]); + framerate = atoi(argv[++i]); + bitrate = atoi(argv[++i]); + width = atoi(argv[++i]); + height = atoi(argv[++i]); + fragsize = atoi(argv[++i]); break; case 'o': if ( i+1 >= argc ) @@ -298,8 +299,13 @@ case 't': if ( i+1 >= argc ) usage(); - timeout = 1000 * atoi(argv[++i]); + call_timeout_ms = 1000 * atoi(argv[++i]); break; + case 'c': + if ( i+1 >= argc ) + usage(); + connect_timeout_ms = 1000 * atoi(argv[++i]); + break; case 'L': if ( i+1 >= argc ) usage(); @@ -314,7 +320,7 @@ usage(); } } else - dest=argv[i]; + dest = argv[i]; } if ( dest == NULL ) @@ -355,11 +361,12 @@ mylog("Failed to make call to '%s'", dest); // Wait for the call to be established; - while ( !call_established ) + while ( !call_established && running ) { struct timeval now; gettimeofday(&now, NULL); - if ( timeout > 0 && msecdiff(&start_time, &now) > timeout ) + if ( connect_timeout_ms > 0 && + msecdiff(&start_time, &now) > connect_timeout_ms ) hangup_and_exit(TEST_NO_CONNECTION); iaxc_millisleep(5); } @@ -394,7 +401,8 @@ // Exit after a positive timeout gettimeofday(&now, NULL); - if ( timeout > 0 && msecdiff(&start_time, &now) > timeout ) + if ( call_timeout_ms > 0 && + msecdiff(&start_time, &now) > call_timeout_ms ) running = 0; } Modified: branches/team/mihai/echocan/simpleclient/vtestcall/vtestcall.c =================================================================== --- branches/team/mihai/echocan/simpleclient/vtestcall/vtestcall.c 2007-10-31 17:31:21 UTC (rev 1250) +++ branches/team/mihai/echocan/simpleclient/vtestcall/vtestcall.c 2007-10-31 19:01:27 UTC (rev 1251) @@ -238,6 +238,9 @@ e.ev.audio.source == IAXC_SOURCE_REMOTE ? "remote" : "local", e.ev.audio.encoded ? "encoded" : "raw"); break; + case IAXC_EVENT_VIDCAP_ERROR: + fprintf(stderr, "\nVIDEO CAPTURE DEVICE ERROR\n"); + break; default: break; } @@ -275,12 +278,28 @@ int nDevs, input, output,ring; int i; + int vinput; + int nVdevs; + struct iaxc_video_device *vDevs; + iaxc_audio_devices_get(&devs,&nDevs, &input, &output, &ring); + printf("\nThere are %d audio devices:\n", nDevs); for(i=0;i<nDevs;i++) { - fprintf(stderr, "DEVICE ID=%d NAME=%s CAPS=%lx\n", devs[i].devID, devs[i].name, devs[i].capabilities); + fprintf(stderr, "AUDIO DEVICE ID = %d NAME = %s CAPS=%lx\n", + devs[i].devID, devs[i].name, devs[i].capabilities); iaxc_audio_devices_set(input,output,ring); } + + iaxc_video_devices_get(&vDevs, &nVdevs, &vinput); + printf("\nThere are %d video capture devices:\n", nVdevs); + for ( i = 0; i < nVdevs; i++ ) + { + printf("VIDEO DEVICE ID = %d NAME = %s\n", + vDevs[i].id, vDevs[i].name); + } + printf("Currently selected VIDEO device id: %d\n", vinput); + } void usage() @@ -363,7 +382,11 @@ exit(-1); } - if ( v.size <= 0 ) fprintf(stderr, "WARNING: size %d in callback\n", v.size); + if ( v.size <= 0 ) + { + fprintf(stderr, "WARNING: size %d in callback\n", v.size); + return 0; + } if ( !remote ) { @@ -532,12 +555,18 @@ //iaxc_set_audio_prefs(IAXC_AUDIO_PREF_RECV_LOCAL_RAW | IAXC_AUDIO_PREF_RECV_REMOTE_RAW); fprintf(f, "\n\ - TestCall accept some keyboard input while it's running.\n\ + vtestcall accepts keyboard input while it's running.\n\ You must hit 'enter' for your keypresses to be recognized,\n\ - although you can type more than one key on a line\n\ + although you can type more than one key on a line:\n\ \n\ - q: drop the call and hangup.\n\ - 0-9 * or #: dial those DTMF digits.\n"); + s: switch video capture devices \n\ + b: bypass video jitter stuff\n\ + r: reject incoming call\n\ + d: dial\n\ + c: set caller id info\n\ + w: video window toggle\n\ + 0-9 * or #: dial those DTMF digits\n\ + q: drop the call and hangup\n"); printf("Starting processing thread...\n"); iaxc_start_processing_thread(); @@ -619,6 +648,39 @@ iaxc_set_callerid(myCIDname,myCIDnumber); } break; + case SDLK_s: + { + int input; + int ndevs; + struct iaxc_video_device *vDevs; + int newVideoDevId; + + iaxc_video_devices_get(&vDevs, &ndevs, &input); + + printf("There are %d video capture devices:\n", ndevs); + for ( i = 0; i < ndevs; i++ ) + { + printf("VIDEO DEVICE ID = %d NAME = %s\n", vDevs[i].id, vDevs[i].name); + } + printf("Currently selected device id: %d\n", input); + + printf("Select video capture device: "); + fflush(stdin); + fscanf(stdin,"%d", &newVideoDevId); + + if ( iaxc_video_device_set(newVideoDevId) ) + { + printf("Error selecting device id %d\n", + newVideoDevId); + break; + } + + /* explicitly set the prefs again in case + * previous capture device has failed + */ + iaxc_set_video_prefs( iaxc_get_video_prefs() ); + } + break; case SDLK_t: /* transmit-only */ printf("transmit mode active\n"); break; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sb...@us...> - 2007-11-01 14:22:14
|
Revision: 1253 http://iaxclient.svn.sourceforge.net/iaxclient/?rev=1253&view=rev Author: sbalea Date: 2007-11-01 07:22:18 -0700 (Thu, 01 Nov 2007) Log Message: ----------- Add information about the required speex version Modified Paths: -------------- branches/team/mihai/echocan/README Added Paths: ----------- branches/team/mihai/echocan/README.speex Modified: branches/team/mihai/echocan/README =================================================================== --- branches/team/mihai/echocan/README 2007-11-01 13:49:42 UTC (rev 1252) +++ branches/team/mihai/echocan/README 2007-11-01 14:22:18 UTC (rev 1253) @@ -1,3 +1,5 @@ +IMPORTANT: please read README.speex before attempting to build. + Iaxclient has changed a lot in the past months making this file inaccurate. For reference purposes we are still including it with the distribution, but be aware that a large percentage of the information in here is outdated and Added: branches/team/mihai/echocan/README.speex =================================================================== --- branches/team/mihai/echocan/README.speex (rev 0) +++ branches/team/mihai/echocan/README.speex 2007-11-01 14:22:18 UTC (rev 1253) @@ -0,0 +1,4 @@ +Echo cancellation features depend on the very latest version of the speex codec. +To build this version of iaxclient you need one of the following: +- a patched version of speex-1.2beta2. The patch is included as speex-1.2beta2.patch. +- the latest development code, available via git from http://git.xiph.org/speex.git This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sb...@us...> - 2007-11-05 19:42:15
|
Revision: 1268 http://iaxclient.svn.sourceforge.net/iaxclient/?rev=1268&view=rev Author: sbalea Date: 2007-11-05 11:42:15 -0800 (Mon, 05 Nov 2007) Log Message: ----------- Update speex patches and associated README. Modified Paths: -------------- branches/team/mihai/echocan/README.speex Added Paths: ----------- branches/team/mihai/echocan/speex-1.2beta2-loudness.patch branches/team/mihai/echocan/speex-1.2beta2-vad-probs.patch Removed Paths: ------------- branches/team/mihai/echocan/speex-1.2beta2.patch Modified: branches/team/mihai/echocan/README.speex =================================================================== --- branches/team/mihai/echocan/README.speex 2007-11-05 18:46:22 UTC (rev 1267) +++ branches/team/mihai/echocan/README.speex 2007-11-05 19:42:15 UTC (rev 1268) @@ -1,4 +1,8 @@ Echo cancellation features depend on the very latest version of the speex codec. To build this version of iaxclient you need one of the following: -- a patched version of speex-1.2beta2. The patch is included as speex-1.2beta2.patch. +- a patched version of speex-1.2beta2. There are two patches included with +iaxclient that need to be applied (in any order). - the latest development code, available via git from http://git.xiph.org/speex.git +Currently, speex-1.2beta2-vad-probs.patch needs to be applied to this code. +speex-1.2beta2-loudness.patch does not need to be applied since it was already +merged in. Copied: branches/team/mihai/echocan/speex-1.2beta2-loudness.patch (from rev 1267, branches/team/mihai/echocan/speex-1.2beta2.patch) =================================================================== --- branches/team/mihai/echocan/speex-1.2beta2-loudness.patch (rev 0) +++ branches/team/mihai/echocan/speex-1.2beta2-loudness.patch 2007-11-05 19:42:15 UTC (rev 1268) @@ -0,0 +1,26 @@ +diff -urN speex-1.2beta2.orig/include/speex/speex_preprocess.h speex-1.2beta2/include/speex/speex_preprocess.h +--- speex-1.2beta2.orig/include/speex/speex_preprocess.h 2007-01-23 06:59:04.000000000 -0500 ++++ speex-1.2beta2/include/speex/speex_preprocess.h 2007-10-29 12:06:48.000000000 -0400 +@@ -178,6 +178,9 @@ + /** Get maximal gain in dB (int32) */ + #define SPEEX_PREPROCESS_GET_AGC_MAX_GAIN 31 + ++/** Get loudness */ ++#define SPEEX_PREPROCESS_GET_AGC_LOUDNESS 32 ++ + #ifdef __cplusplus + } + #endif +diff -urN speex-1.2beta2.orig/libspeex/preprocess.c speex-1.2beta2/libspeex/preprocess.c +--- speex-1.2beta2.orig/libspeex/preprocess.c 2007-05-03 05:22:04.000000000 -0400 ++++ speex-1.2beta2/libspeex/preprocess.c 2007-10-29 13:35:53.000000000 -0400 +@@ -1163,6 +1163,9 @@ + case SPEEX_PREPROCESS_GET_ECHO_STATE: + ptr = (void*)st->echo_state; + break; ++ case SPEEX_PREPROCESS_GET_AGC_LOUDNESS: ++ (*(spx_int32_t*)ptr) = pow(st->loudness, 1.0/LOUDNESS_EXP); ++ break; + + default: + speex_warning_int("Unknown speex_preprocess_ctl request: ", request); Added: branches/team/mihai/echocan/speex-1.2beta2-vad-probs.patch =================================================================== --- branches/team/mihai/echocan/speex-1.2beta2-vad-probs.patch (rev 0) +++ branches/team/mihai/echocan/speex-1.2beta2-vad-probs.patch 2007-11-05 19:42:15 UTC (rev 1268) @@ -0,0 +1,24 @@ +diff -urN speex-1.2beta2.orig/libspeex/preprocess.c speex-1.2beta2/libspeex/preprocess.c +--- speex-1.2beta2.orig/libspeex/preprocess.c 2007-05-03 05:22:04.000000000 -0400 ++++ speex-1.2beta2/libspeex/preprocess.c 2007-11-05 14:34:37.000000000 -0500 +@@ -1124,16 +1124,16 @@ + break; + + case SPEEX_PREPROCESS_SET_PROB_START: +- *(spx_int32_t*)ptr = MIN32(Q15_ONE,MAX32(0, *(spx_int32_t*)ptr)); +- st->speech_prob_start = DIV32_16(MULT16_16(32767,*(spx_int32_t*)ptr), 100); ++ *(spx_int32_t*)ptr = MIN32(100,MAX32(0, *(spx_int32_t*)ptr)); ++ st->speech_prob_start = DIV32_16(MULT16_16(Q15ONE,*(spx_int32_t*)ptr), 100); + break; + case SPEEX_PREPROCESS_GET_PROB_START: + (*(spx_int32_t*)ptr) = MULT16_16_Q15(st->speech_prob_start, 100); + break; + + case SPEEX_PREPROCESS_SET_PROB_CONTINUE: +- *(spx_int32_t*)ptr = MIN32(Q15_ONE,MAX32(0, *(spx_int32_t*)ptr)); +- st->speech_prob_continue = DIV32_16(MULT16_16(32767,*(spx_int32_t*)ptr), 100); ++ *(spx_int32_t*)ptr = MIN32(100,MAX32(0, *(spx_int32_t*)ptr)); ++ st->speech_prob_continue = DIV32_16(MULT16_16(Q15ONE,*(spx_int32_t*)ptr), 100); + break; + case SPEEX_PREPROCESS_GET_PROB_CONTINUE: + (*(spx_int32_t*)ptr) = MULT16_16_Q15(st->speech_prob_continue, 100); Deleted: branches/team/mihai/echocan/speex-1.2beta2.patch =================================================================== --- branches/team/mihai/echocan/speex-1.2beta2.patch 2007-11-05 18:46:22 UTC (rev 1267) +++ branches/team/mihai/echocan/speex-1.2beta2.patch 2007-11-05 19:42:15 UTC (rev 1268) @@ -1,26 +0,0 @@ -diff -urN speex-1.2beta2.orig/include/speex/speex_preprocess.h speex-1.2beta2/include/speex/speex_preprocess.h ---- speex-1.2beta2.orig/include/speex/speex_preprocess.h 2007-01-23 06:59:04.000000000 -0500 -+++ speex-1.2beta2/include/speex/speex_preprocess.h 2007-10-29 12:06:48.000000000 -0400 -@@ -178,6 +178,9 @@ - /** Get maximal gain in dB (int32) */ - #define SPEEX_PREPROCESS_GET_AGC_MAX_GAIN 31 - -+/** Get loudness */ -+#define SPEEX_PREPROCESS_GET_AGC_LOUDNESS 32 -+ - #ifdef __cplusplus - } - #endif -diff -urN speex-1.2beta2.orig/libspeex/preprocess.c speex-1.2beta2/libspeex/preprocess.c ---- speex-1.2beta2.orig/libspeex/preprocess.c 2007-05-03 05:22:04.000000000 -0400 -+++ speex-1.2beta2/libspeex/preprocess.c 2007-10-29 13:35:53.000000000 -0400 -@@ -1163,6 +1163,9 @@ - case SPEEX_PREPROCESS_GET_ECHO_STATE: - ptr = (void*)st->echo_state; - break; -+ case SPEEX_PREPROCESS_GET_AGC_LOUDNESS: -+ (*(spx_int32_t*)ptr) = pow(st->loudness, 1.0/LOUDNESS_EXP); -+ break; - - default: - speex_warning_int("Unknown speex_preprocess_ctl request: ", request); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sb...@us...> - 2008-02-07 16:51:02
|
Revision: 1344 http://iaxclient.svn.sourceforge.net/iaxclient/?rev=1344&view=rev Author: sbalea Date: 2008-02-07 08:50:56 -0800 (Thu, 07 Feb 2008) Log Message: ----------- Merge speex-1.2beta3 changes from trunk. Modified Paths: -------------- branches/team/mihai/echocan/configure.ac branches/team/mihai/echocan/lib/Makefile.am branches/team/mihai/echocan/lib/audio_encode.c branches/team/mihai/echocan/m4/speex.m4 Modified: branches/team/mihai/echocan/configure.ac =================================================================== --- branches/team/mihai/echocan/configure.ac 2008-02-06 00:09:00 UTC (rev 1343) +++ branches/team/mihai/echocan/configure.ac 2008-02-07 16:50:56 UTC (rev 1344) @@ -227,6 +227,12 @@ obtain a copy. ])) +PKG_CHECK_MODULES(SPEEXDSP, [speexdsp >= 1.2],,AC_MSG_ERROR([ + speexdsp is required to build this package! + please see http://www.xiph.org/ for how to + obtain a copy. +])) + has_theora=no if test ! x$with_theora = xno; then PKG_CHECK_MODULES(THEORA, [theora >= 1.0alpha7],has_theora=yes) Modified: branches/team/mihai/echocan/lib/Makefile.am =================================================================== --- branches/team/mihai/echocan/lib/Makefile.am 2008-02-06 00:09:00 UTC (rev 1343) +++ branches/team/mihai/echocan/lib/Makefile.am 2008-02-07 16:50:56 UTC (rev 1344) @@ -12,6 +12,7 @@ AM_CFLAGS = \ $(PTHREAD_CFLAGS) \ $(SPEEX_CFLAGS) \ + $(SPEEXDSP_CFLAGS) \ $(IAX2_CFLAGS) \ $(PORTAUDIO_CFLAGS) @@ -25,7 +26,8 @@ $(PTHREAD_LIBS) \ $(IAX2_LIBS) \ $(PORTAUDIO_LIBS) \ - $(SPEEX_LIBS) + $(SPEEX_LIBS) \ + $(SPEEXDSP_LIBS) AM_LDFLAGS = \ -no-undefined \ Modified: branches/team/mihai/echocan/lib/audio_encode.c =================================================================== --- branches/team/mihai/echocan/lib/audio_encode.c 2008-02-06 00:09:00 UTC (rev 1343) +++ branches/team/mihai/echocan/lib/audio_encode.c 2008-02-07 16:50:56 UTC (rev 1344) @@ -197,9 +197,9 @@ if ( (i & 0x3f) == 0 ) { - int loudness; + float loudness; speex_preprocess_ctl(st, SPEEX_PREPROCESS_GET_AGC_LOUDNESS, &loudness); - if ( loudness > AAGC_HOT || loudness < AAGC_COLD ) + if ( loudness > 8000.0f || loudness < 4000.0f ) { const float level = iaxc_input_level_get(); Modified: branches/team/mihai/echocan/m4/speex.m4 =================================================================== --- branches/team/mihai/echocan/m4/speex.m4 2008-02-06 00:09:00 UTC (rev 1343) +++ branches/team/mihai/echocan/m4/speex.m4 2008-02-07 16:50:56 UTC (rev 1344) @@ -41,7 +41,7 @@ SPEEX_LIBS="-L$prefix/lib" fi - SPEEX_LIBS="$SPEEX_LIBS -lspeex" + SPEEX_LIBS="$SPEEX_LIBS -lspeex -lspeexdsp" if test "x$speex_includes" != "x" ; then SPEEX_CFLAGS="-I$speex_includes" @@ -60,7 +60,7 @@ LIBS="$LIBS $SPEEX_LIBS" dnl Check for a working version of speex that is of the right version. -min_speex_version=ifelse([$1], ,1.0.0,$1) +min_speex_version=ifelse([$1], ,1.2.0,$1) AC_MSG_CHECKING(for speex headers version >= $min_speex_version) #no_speex="" speex_min_major_version=`echo $min_speex_version | \ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sb...@us...> - 2008-02-07 16:51:50
|
Revision: 1345 http://iaxclient.svn.sourceforge.net/iaxclient/?rev=1345&view=rev Author: sbalea Date: 2008-02-07 08:51:50 -0800 (Thu, 07 Feb 2008) Log Message: ----------- Remove speex-1.2beta2 patches; they're no longer needed since we require speex-1.2beta3 anyways Removed Paths: ------------- branches/team/mihai/echocan/speex-1.2beta2-loudness.patch branches/team/mihai/echocan/speex-1.2beta2-vad-probs.patch Deleted: branches/team/mihai/echocan/speex-1.2beta2-loudness.patch =================================================================== --- branches/team/mihai/echocan/speex-1.2beta2-loudness.patch 2008-02-07 16:50:56 UTC (rev 1344) +++ branches/team/mihai/echocan/speex-1.2beta2-loudness.patch 2008-02-07 16:51:50 UTC (rev 1345) @@ -1,26 +0,0 @@ -diff -urN speex-1.2beta2.orig/include/speex/speex_preprocess.h speex-1.2beta2/include/speex/speex_preprocess.h ---- speex-1.2beta2.orig/include/speex/speex_preprocess.h 2007-01-23 06:59:04.000000000 -0500 -+++ speex-1.2beta2/include/speex/speex_preprocess.h 2007-10-29 12:06:48.000000000 -0400 -@@ -178,6 +178,9 @@ - /** Get maximal gain in dB (int32) */ - #define SPEEX_PREPROCESS_GET_AGC_MAX_GAIN 31 - -+/** Get loudness */ -+#define SPEEX_PREPROCESS_GET_AGC_LOUDNESS 32 -+ - #ifdef __cplusplus - } - #endif -diff -urN speex-1.2beta2.orig/libspeex/preprocess.c speex-1.2beta2/libspeex/preprocess.c ---- speex-1.2beta2.orig/libspeex/preprocess.c 2007-05-03 05:22:04.000000000 -0400 -+++ speex-1.2beta2/libspeex/preprocess.c 2007-10-29 13:35:53.000000000 -0400 -@@ -1163,6 +1163,9 @@ - case SPEEX_PREPROCESS_GET_ECHO_STATE: - ptr = (void*)st->echo_state; - break; -+ case SPEEX_PREPROCESS_GET_AGC_LOUDNESS: -+ (*(spx_int32_t*)ptr) = pow(st->loudness, 1.0/LOUDNESS_EXP); -+ break; - - default: - speex_warning_int("Unknown speex_preprocess_ctl request: ", request); Deleted: branches/team/mihai/echocan/speex-1.2beta2-vad-probs.patch =================================================================== --- branches/team/mihai/echocan/speex-1.2beta2-vad-probs.patch 2008-02-07 16:50:56 UTC (rev 1344) +++ branches/team/mihai/echocan/speex-1.2beta2-vad-probs.patch 2008-02-07 16:51:50 UTC (rev 1345) @@ -1,24 +0,0 @@ -diff -urN speex-1.2beta2.orig/libspeex/preprocess.c speex-1.2beta2/libspeex/preprocess.c ---- speex-1.2beta2.orig/libspeex/preprocess.c 2007-05-03 05:22:04.000000000 -0400 -+++ speex-1.2beta2/libspeex/preprocess.c 2007-11-05 14:34:37.000000000 -0500 -@@ -1124,16 +1124,16 @@ - break; - - case SPEEX_PREPROCESS_SET_PROB_START: -- *(spx_int32_t*)ptr = MIN32(Q15_ONE,MAX32(0, *(spx_int32_t*)ptr)); -- st->speech_prob_start = DIV32_16(MULT16_16(32767,*(spx_int32_t*)ptr), 100); -+ *(spx_int32_t*)ptr = MIN32(100,MAX32(0, *(spx_int32_t*)ptr)); -+ st->speech_prob_start = DIV32_16(MULT16_16(Q15ONE,*(spx_int32_t*)ptr), 100); - break; - case SPEEX_PREPROCESS_GET_PROB_START: - (*(spx_int32_t*)ptr) = MULT16_16_Q15(st->speech_prob_start, 100); - break; - - case SPEEX_PREPROCESS_SET_PROB_CONTINUE: -- *(spx_int32_t*)ptr = MIN32(Q15_ONE,MAX32(0, *(spx_int32_t*)ptr)); -- st->speech_prob_continue = DIV32_16(MULT16_16(32767,*(spx_int32_t*)ptr), 100); -+ *(spx_int32_t*)ptr = MIN32(100,MAX32(0, *(spx_int32_t*)ptr)); -+ st->speech_prob_continue = DIV32_16(MULT16_16(Q15ONE,*(spx_int32_t*)ptr), 100); - break; - case SPEEX_PREPROCESS_GET_PROB_CONTINUE: - (*(spx_int32_t*)ptr) = MULT16_16_Q15(st->speech_prob_continue, 100); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |