You can subscribe to this list here.
2003 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(68) |
Jul
(27) |
Aug
(1) |
Sep
(9) |
Oct
(16) |
Nov
(64) |
Dec
(18) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2004 |
Jan
(11) |
Feb
(5) |
Mar
(20) |
Apr
(9) |
May
(8) |
Jun
(8) |
Jul
(2) |
Aug
|
Sep
(11) |
Oct
(34) |
Nov
(23) |
Dec
(34) |
2005 |
Jan
(41) |
Feb
(25) |
Mar
(25) |
Apr
(32) |
May
(27) |
Jun
(9) |
Jul
(36) |
Aug
(6) |
Sep
(3) |
Oct
(11) |
Nov
(2) |
Dec
(21) |
2006 |
Jan
(14) |
Feb
(8) |
Mar
(18) |
Apr
(6) |
May
|
Jun
(17) |
Jul
(14) |
Aug
(26) |
Sep
(34) |
Oct
(24) |
Nov
(48) |
Dec
(64) |
2007 |
Jan
(72) |
Feb
(21) |
Mar
(50) |
Apr
(41) |
May
(35) |
Jun
(50) |
Jul
(33) |
Aug
(32) |
Sep
(50) |
Oct
(85) |
Nov
(43) |
Dec
(33) |
2008 |
Jan
(10) |
Feb
(29) |
Mar
(15) |
Apr
(45) |
May
(5) |
Jun
(2) |
Jul
(14) |
Aug
(3) |
Sep
|
Oct
|
Nov
(3) |
Dec
|
2009 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
|
2010 |
Jan
(9) |
Feb
(3) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <sb...@us...> - 2007-10-30 18:16:49
|
Revision: 1241 http://iaxclient.svn.sourceforge.net/iaxclient/?rev=1241&view=rev Author: sbalea Date: 2007-10-30 11:16:53 -0700 (Tue, 30 Oct 2007) Log Message: ----------- Fix memory leak in PortAudio destroy. PortMixer stuff needs cleaning too. Patch provided by Teri Schoech and enhanced by me. Modified Paths: -------------- trunk/lib/audio_portaudio.c Modified: trunk/lib/audio_portaudio.c =================================================================== --- trunk/lib/audio_portaudio.c 2007-10-30 17:54:55 UTC (rev 1240) +++ trunk/lib/audio_portaudio.c 2007-10-30 18:16:53 UTC (rev 1241) @@ -958,6 +958,24 @@ static int pa_destroy(struct iaxc_audio_driver *d) { + if( iMixer ) + { + Px_CloseMixer(iMixer); + iMixer = NULL; + } + if ( oMixer ) + { + Px_CloseMixer(oMixer); + oMixer = NULL; + } + if ( d ) + { + if ( d->devices ) + { + free(d->devices); + d->devices= NULL; + } + } return Pa_Terminate(); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sb...@us...> - 2007-10-30 17:54:50
|
Revision: 1240 http://iaxclient.svn.sourceforge.net/iaxclient/?rev=1240&view=rev Author: sbalea Date: 2007-10-30 10:54:55 -0700 (Tue, 30 Oct 2007) Log Message: ----------- Merge from trunk: Fix memory leak in codec_ulaw teardown process. Modified Paths: -------------- branches/2.0/lib/codec_ulaw.c Modified: branches/2.0/lib/codec_ulaw.c =================================================================== --- branches/2.0/lib/codec_ulaw.c 2007-10-30 17:49:26 UTC (rev 1239) +++ branches/2.0/lib/codec_ulaw.c 2007-10-30 17:54:55 UTC (rev 1240) @@ -84,7 +84,9 @@ } static void destroy ( struct iaxc_audio_codec *c) { - free(c); + if ( c->decstate ) + free(c->decstate); + free(c); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sb...@us...> - 2007-10-30 17:49:21
|
Revision: 1239 http://iaxclient.svn.sourceforge.net/iaxclient/?rev=1239&view=rev Author: sbalea Date: 2007-10-30 10:49:26 -0700 (Tue, 30 Oct 2007) Log Message: ----------- Fix memory leak in codec_ulaw teardown. Patch provided by Teri Schoech. Thanks Modified Paths: -------------- trunk/lib/codec_ulaw.c Modified: trunk/lib/codec_ulaw.c =================================================================== --- trunk/lib/codec_ulaw.c 2007-10-30 17:36:30 UTC (rev 1238) +++ trunk/lib/codec_ulaw.c 2007-10-30 17:49:26 UTC (rev 1239) @@ -84,7 +84,9 @@ } static void destroy ( struct iaxc_audio_codec *c) { - free(c); + if ( c->decstate ) + free(c->decstate); + free(c); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sb...@us...> - 2007-10-30 17:36:28
|
Revision: 1238 http://iaxclient.svn.sourceforge.net/iaxclient/?rev=1238&view=rev Author: sbalea Date: 2007-10-30 10:36:30 -0700 (Tue, 30 Oct 2007) Log Message: ----------- Incoming DTMF patch provided by Bertrand. Thanks. Modified Paths: -------------- trunk/lib/iaxclient.h trunk/lib/iaxclient_lib.c Modified: trunk/lib/iaxclient.h =================================================================== --- trunk/lib/iaxclient.h 2007-10-30 03:10:21 UTC (rev 1237) +++ trunk/lib/iaxclient.h 2007-10-30 17:36:30 UTC (rev 1238) @@ -533,6 +533,21 @@ }; /*! + A structure containing information about a DTMF event + */ +struct iaxc_ev_dtmf { + /*! + The call this DTMF event is for. + */ + int callNo; + + /*! + The digit represented by this DTMF tone + */ + char digit; +}; + +/*! A structure describing a single IAXClient event. */ typedef struct iaxc_event_struct { @@ -568,8 +583,10 @@ 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; + /*! Contains registration data if type = IAXC_EVENT_REGISTRATION */ + struct iaxc_ev_registration reg; + /*! Contains DTMF data if type = IAXC_EVENT_DTMF */ + struct iaxc_ev_dtmf dtmf; } ev; } iaxc_event; Modified: trunk/lib/iaxclient_lib.c =================================================================== --- trunk/lib/iaxclient_lib.c 2007-10-30 03:10:21 UTC (rev 1237) +++ trunk/lib/iaxclient_lib.c 2007-10-30 17:36:30 UTC (rev 1238) @@ -369,6 +369,15 @@ iaxci_post_event(e); } +void iaxci_do_dtmf_callback(int callNo, char digit) +{ + iaxc_event e; + e.type = IAXC_EVENT_DTMF; + e.ev.dtmf.callNo = callNo; + e.ev.dtmf.digit = digit; + iaxci_post_event(e); +} + static int iaxc_remove_registration_by_id(int id) { struct iaxc_registration *curr, *prev; @@ -1187,6 +1196,10 @@ iaxci_do_state_callback(callNo); iaxci_usermsg(IAXC_STATUS,"Call %d transfer released", callNo); break; + case IAX_EVENT_DTMF: + iaxci_do_dtmf_callback(callNo,e->subclass); + iaxci_usermsg(IAXC_STATUS, "DTMF digit %c received", e->subclass); + break; default: iaxci_usermsg(IAXC_STATUS, "Unknown event: %d for call %d", e->etype, callNo); break; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <do...@us...> - 2007-10-30 03:10:17
|
Revision: 1237 http://iaxclient.svn.sourceforge.net/iaxclient/?rev=1237&view=rev Author: dohpaz Date: 2007-10-29 20:10:21 -0700 (Mon, 29 Oct 2007) Log Message: ----------- Update patch to work against portaudio v19-devel r1296. Modified Paths: -------------- branches/team/elbunce/iaxclient/portaudio-deviceschanged.patch Modified: branches/team/elbunce/iaxclient/portaudio-deviceschanged.patch =================================================================== --- branches/team/elbunce/iaxclient/portaudio-deviceschanged.patch 2007-10-29 21:07:35 UTC (rev 1236) +++ branches/team/elbunce/iaxclient/portaudio-deviceschanged.patch 2007-10-30 03:10:21 UTC (rev 1237) @@ -316,7 +316,7 @@ Index: Makefile.in =================================================================== ---- Makefile.in (revision 1292) +--- Makefile.in (revision 1296) +++ Makefile.in (working copy) @@ -59,6 +59,7 @@ bin/paqa_devs \ @@ -328,7 +328,7 @@ bin/patest_clip \ Index: include/portaudio.h =================================================================== ---- include/portaudio.h (revision 1292) +--- include/portaudio.h (revision 1296) +++ include/portaudio.h (working copy) @@ -356,10 +356,97 @@ */ @@ -441,7 +441,7 @@ */ Index: src/hostapi/alsa/pa_linux_alsa.c =================================================================== ---- src/hostapi/alsa/pa_linux_alsa.c (revision 1292) +--- src/hostapi/alsa/pa_linux_alsa.c (revision 1296) +++ src/hostapi/alsa/pa_linux_alsa.c (working copy) @@ -254,6 +254,7 @@ (*hostApi)->info.name = "ALSA"; @@ -453,7 +453,7 @@ Index: src/hostapi/oss/pa_unix_oss.c =================================================================== ---- src/hostapi/oss/pa_unix_oss.c (revision 1292) +--- src/hostapi/oss/pa_unix_oss.c (revision 1296) +++ src/hostapi/oss/pa_unix_oss.c (working copy) @@ -250,6 +250,7 @@ (*hostApi)->info.type = paOSS; @@ -465,7 +465,7 @@ Index: src/hostapi/wasapi/pa_win_wasapi.cpp =================================================================== ---- src/hostapi/wasapi/pa_win_wasapi.cpp (revision 1292) +--- src/hostapi/wasapi/pa_win_wasapi.cpp (revision 1296) +++ src/hostapi/wasapi/pa_win_wasapi.cpp (working copy) @@ -635,6 +635,7 @@ spEndpoints->Release(); @@ -484,7 +484,7 @@ +#endif Index: src/hostapi/wdmks/pa_win_wdmks.c =================================================================== ---- src/hostapi/wdmks/pa_win_wdmks.c (revision 1292) +--- src/hostapi/wdmks/pa_win_wdmks.c (revision 1296) +++ src/hostapi/wdmks/pa_win_wdmks.c (working copy) @@ -1876,6 +1876,7 @@ (*hostApi)->info.deviceCount = deviceCount; @@ -503,7 +503,7 @@ +} Index: src/hostapi/wmme/pa_win_wmme.c =================================================================== ---- src/hostapi/wmme/pa_win_wmme.c (revision 1292) +--- src/hostapi/wmme/pa_win_wmme.c (revision 1296) +++ src/hostapi/wmme/pa_win_wmme.c (working copy) @@ -1040,6 +1040,7 @@ InitializeDefaultDeviceIdsFromEnv( winMmeHostApi ); @@ -515,7 +515,7 @@ Index: src/hostapi/jack/pa_jack.c =================================================================== ---- src/hostapi/jack/pa_jack.c (revision 1292) +--- src/hostapi/jack/pa_jack.c (revision 1296) +++ src/hostapi/jack/pa_jack.c (working copy) @@ -746,6 +746,7 @@ /* Register functions */ @@ -527,7 +527,7 @@ Index: src/hostapi/coreaudio/pa_mac_core.c =================================================================== ---- src/hostapi/coreaudio/pa_mac_core.c (revision 1292) +--- src/hostapi/coreaudio/pa_mac_core.c (revision 1296) +++ src/hostapi/coreaudio/pa_mac_core.c (working copy) @@ -70,6 +70,7 @@ #include "pa_mac_core.h" @@ -545,8 +545,8 @@ static PaError IsFormatSupported( struct PaUtilHostApiRepresentation *hostApi, const PaStreamParameters *inputParameters, const PaStreamParameters *outputParameters, -@@ -301,47 +303,13 @@ - return 0; +@@ -324,47 +326,13 @@ + sfc( stream->streamRepresentation.userData ); } - @@ -598,7 +598,7 @@ /* determine the default device. */ /* I am not sure how these calls to AudioHardwareGetProperty() -@@ -362,8 +330,19 @@ +@@ -385,8 +353,19 @@ auhalHostApi->defaultIn = auhalHostApi->devIds[i]; break; } @@ -619,7 +619,7 @@ if( 0 != AudioHardwareGetProperty(kAudioHardwarePropertyDefaultOutputDevice, &size, &auhalHostApi->defaultOut) ) { -@@ -381,13 +360,119 @@ +@@ -404,13 +383,119 @@ } } } @@ -741,7 +741,7 @@ static PaError GetChannelInfo( PaMacAUHAL *auhalHostApi, PaDeviceInfo *deviceInfo, AudioDeviceID macCoreDeviceId, -@@ -603,6 +688,7 @@ +@@ -626,6 +711,7 @@ } (*hostApi)->Terminate = Terminate; @@ -749,7 +749,7 @@ (*hostApi)->OpenStream = OpenStream; (*hostApi)->IsFormatSupported = IsFormatSupported; -@@ -624,6 +710,14 @@ +@@ -647,6 +733,14 @@ GetStreamReadAvailable, GetStreamWriteAvailable ); @@ -764,7 +764,7 @@ return result; error: -@@ -653,6 +747,14 @@ +@@ -676,6 +770,14 @@ TODO: Double check that everything is handled by alloc group */ @@ -779,7 +779,7 @@ if( auhalHostApi->allocations ) { PaUtil_FreeAllAllocations( auhalHostApi->allocations ); -@@ -662,7 +764,89 @@ +@@ -685,7 +787,89 @@ PaUtil_FreeMemory( auhalHostApi ); } @@ -871,7 +871,7 @@ const PaStreamParameters *outputParameters, Index: src/hostapi/asio/pa_asio.cpp =================================================================== ---- src/hostapi/asio/pa_asio.cpp (revision 1292) +--- src/hostapi/asio/pa_asio.cpp (revision 1296) +++ src/hostapi/asio/pa_asio.cpp (working copy) @@ -1286,6 +1286,7 @@ @@ -883,7 +883,7 @@ Index: src/hostapi/dsound/pa_win_ds.c =================================================================== ---- src/hostapi/dsound/pa_win_ds.c (revision 1292) +--- src/hostapi/dsound/pa_win_ds.c (revision 1296) +++ src/hostapi/dsound/pa_win_ds.c (working copy) @@ -1134,6 +1134,7 @@ @@ -895,7 +895,7 @@ Index: src/hostapi/asihpi/pa_linux_asihpi.c =================================================================== ---- src/hostapi/asihpi/pa_linux_asihpi.c (revision 1292) +--- src/hostapi/asihpi/pa_linux_asihpi.c (revision 1296) +++ src/hostapi/asihpi/pa_linux_asihpi.c (working copy) @@ -780,6 +780,7 @@ PA_ENSURE_( PaAsiHpi_BuildDeviceList( hpiHostApi ) ); @@ -907,7 +907,7 @@ Index: src/common/pa_util.h =================================================================== ---- src/common/pa_util.h (revision 1292) +--- src/common/pa_util.h (revision 1296) +++ src/common/pa_util.h (working copy) @@ -151,8 +151,23 @@ @@ -935,7 +935,7 @@ #endif /* __cplusplus */ Index: src/common/pa_skeleton.c =================================================================== ---- src/common/pa_skeleton.c (revision 1292) +--- src/common/pa_skeleton.c (revision 1296) +++ src/common/pa_skeleton.c (working copy) @@ -74,6 +74,7 @@ @@ -1047,7 +1047,7 @@ const PaStreamParameters *outputParameters, Index: src/common/pa_front.c =================================================================== ---- src/common/pa_front.c (revision 1292) +--- src/common/pa_front.c (revision 1296) +++ src/common/pa_front.c (working copy) @@ -89,9 +89,6 @@ #define PA_VERSION_ 1899 @@ -1245,15 +1245,23 @@ PaDeviceIndex result; Index: src/common/pa_hostapi.h =================================================================== ---- src/common/pa_hostapi.h (revision 1292) +--- src/common/pa_hostapi.h (revision 1296) +++ src/common/pa_hostapi.h (working copy) -@@ -109,6 +109,13 @@ +@@ -109,6 +109,21 @@ void (*Terminate)( struct PaUtilHostApiRepresentation *hostApi ); /** -+ (*Terminate)() is guaranteed to be called with a valid <hostApi> ++ (*RescanDevices)() is guaranteed to be called with a valid <hostApi> + parameter, which was previously returned from the same implementation's + initializer. ++ ++ If set to 0 the portaudio implementation will skip rescanning this host ++ api. ++ ++ The host api implementation is allowed to modify the ++ PaHostApiInfo::deviceCount, and the deviceInfos to reflect the new set ++ of devices. If an error occurs during processing, the host api ++ implementation MUST ensure that they are left in a consistant state. + */ + PaError (*RescanDevices)( struct PaUtilHostApiRepresentation *hostApi ); + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
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: <do...@us...> - 2007-10-29 20:26:01
|
Revision: 1235 http://iaxclient.svn.sourceforge.net/iaxclient/?rev=1235&view=rev Author: dohpaz Date: 2007-10-29 13:26:04 -0700 (Mon, 29 Oct 2007) Log Message: ----------- Merge my plug-n-play branch up to trunk as of r1234. Modified Paths: -------------- branches/team/elbunce/iaxclient/configure.ac branches/team/elbunce/iaxclient/contrib/tcl/README.txt branches/team/elbunce/iaxclient/contrib/tcl/configure branches/team/elbunce/iaxclient/contrib/tcl/configure.in branches/team/elbunce/iaxclient/contrib/tcl/iaxclient.c branches/team/elbunce/iaxclient/contrib/win/vs2005/iaxclient.sln branches/team/elbunce/iaxclient/contrib/win/vs2005/libiaxclient.vcproj branches/team/elbunce/iaxclient/lib/Makefile.am branches/team/elbunce/iaxclient/lib/audio_encode.c branches/team/elbunce/iaxclient/lib/audio_encode.h branches/team/elbunce/iaxclient/lib/codec_theora.c branches/team/elbunce/iaxclient/lib/iaxclient.h branches/team/elbunce/iaxclient/lib/iaxclient_lib.c branches/team/elbunce/iaxclient/lib/iaxclient_lib.h branches/team/elbunce/iaxclient/lib/video.c branches/team/elbunce/iaxclient/lib/video.h branches/team/elbunce/iaxclient/simpleclient/stresstest/Makefile.am branches/team/elbunce/iaxclient/simpleclient/vtestcall/vtestcall.c branches/team/elbunce/iaxclient/simpleclient/vtestcall/vtestcall.vcproj Added Paths: ----------- branches/team/elbunce/iaxclient/contrib/tcl/video.c Modified: branches/team/elbunce/iaxclient/configure.ac =================================================================== --- branches/team/elbunce/iaxclient/configure.ac 2007-10-29 04:55:25 UTC (rev 1234) +++ branches/team/elbunce/iaxclient/configure.ac 2007-10-29 20:26:04 UTC (rev 1235) @@ -141,13 +141,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 @@ -245,6 +249,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/elbunce/iaxclient/contrib/tcl/README.txt =================================================================== --- branches/team/elbunce/iaxclient/contrib/tcl/README.txt 2007-10-29 04:55:25 UTC (rev 1234) +++ branches/team/elbunce/iaxclient/contrib/tcl/README.txt 2007-10-29 20:26:04 UTC (rev 1235) @@ -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/elbunce/iaxclient/contrib/tcl/configure =================================================================== --- branches/team/elbunce/iaxclient/contrib/tcl/configure 2007-10-29 04:55:25 UTC (rev 1234) +++ branches/team/elbunce/iaxclient/contrib/tcl/configure 2007-10-29 20:26:04 UTC (rev 1235) @@ -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_st... [truncated message content] |
From: <do...@us...> - 2007-10-29 04:55:20
|
Revision: 1234 http://iaxclient.svn.sourceforge.net/iaxclient/?rev=1234&view=rev Author: dohpaz Date: 2007-10-28 21:55:25 -0700 (Sun, 28 Oct 2007) Log Message: ----------- Add --enable-debug-iax option to enable libiax2 DEBUG_SUPPORT. Make ALL code enabled by DEBUG_SUPPORT in libiax2 pay attention to the current debug setting. Added an iaxclient public API iaxc_debug_iax_set to control the IAX protocol debugging state. Modified Paths: -------------- branches/team/elbunce/iaxclient/configure.ac branches/team/elbunce/iaxclient/lib/Makefile.am branches/team/elbunce/iaxclient/lib/iaxclient.h branches/team/elbunce/iaxclient/lib/iaxclient_lib.c branches/team/elbunce/iaxclient/lib/libiax2/src/iax.c Modified: branches/team/elbunce/iaxclient/configure.ac =================================================================== --- branches/team/elbunce/iaxclient/configure.ac 2007-10-27 06:50:47 UTC (rev 1233) +++ branches/team/elbunce/iaxclient/configure.ac 2007-10-29 04:55:25 UTC (rev 1234) @@ -75,6 +75,12 @@ [Don't use local iax library])],, [enable_local_iax="yes"]) +AC_ARG_ENABLE(debug-iax, + [AS_HELP_STRING([--enable-debug-iax], + [Enable debug support in local iax library])], + enable_debug_iax2=$enableval, + enable_debug_iax2="no") + AC_ARG_ENABLE(speex_preprocess, [AS_HELP_STRING([--disable-speex-preprocess], [Turn off speex preprocessing])],, @@ -358,6 +364,7 @@ AM_CONDITIONAL(USE_CODEC_GSM, test x$has_gsm = xyes && test ! x$with_gsm = xno) AM_CONDITIONAL(USE_LOCAL_GSM, test x$enable_local_gsm = xyes) AM_CONDITIONAL(USE_LOCAL_IAX2, test x$enable_local_iax2 = xyes) +AM_CONDITIONAL(USE_DEBUG_IAX2, test x$enable_debug_iax2 = xyes) AM_CONDITIONAL(USE_LOCAL_ILBC, test x$enable_local_ilbc = xyes) AM_CONDITIONAL(LINUX, test x$OSTYPE = xLINUX) AM_CONDITIONAL(WIN32, test x$OSTYPE = xWIN32) Modified: branches/team/elbunce/iaxclient/lib/Makefile.am =================================================================== --- branches/team/elbunce/iaxclient/lib/Makefile.am 2007-10-27 06:50:47 UTC (rev 1233) +++ branches/team/elbunce/iaxclient/lib/Makefile.am 2007-10-29 04:55:25 UTC (rev 1234) @@ -73,7 +73,9 @@ if USE_LOCAL_IAX2 SRCS += $(SRCS_IAX2) -# AM_CFLAGS += -DDEBUG_SUPPORT +if USE_DEBUG_IAX2 +AM_CFLAGS += -DDEBUG_SUPPORT +endif USE_DEBUG_IAX2 endif USE_LOCAL_IAX2 if USE_LOCAL_ILBC Modified: branches/team/elbunce/iaxclient/lib/iaxclient.h =================================================================== --- branches/team/elbunce/iaxclient/lib/iaxclient.h 2007-10-27 06:50:47 UTC (rev 1233) +++ branches/team/elbunce/iaxclient/lib/iaxclient.h 2007-10-29 04:55:25 UTC (rev 1234) @@ -1334,6 +1334,12 @@ */ EXPORT int iaxc_push_video(void *data, unsigned int size, int fragment); +/*! + Sets the IAX debug set to \a enable. + \param enable If non-zero enable iax protocol debugging +*/ +EXPORT int iaxc_debug_iax_set(int enable); + #ifdef __cplusplus } #endif Modified: branches/team/elbunce/iaxclient/lib/iaxclient_lib.c =================================================================== --- branches/team/elbunce/iaxclient/lib/iaxclient_lib.c 2007-10-27 06:50:47 UTC (rev 1233) +++ branches/team/elbunce/iaxclient/lib/iaxclient_lib.c 2007-10-29 04:55:25 UTC (rev 1234) @@ -1979,3 +1979,13 @@ return 0; } +int iaxc_debug_iax_set(int enable) +{ +#ifdef DEBUG_SUPPORT + if (enable) + iax_enable_debug(); + else + iax_disable_debug(); +#endif +} + Modified: branches/team/elbunce/iaxclient/lib/libiax2/src/iax.c =================================================================== --- branches/team/elbunce/iaxclient/lib/libiax2/src/iax.c 2007-10-27 06:50:47 UTC (rev 1233) +++ branches/team/elbunce/iaxclient/lib/libiax2/src/iax.c 2007-10-29 04:55:25 UTC (rev 1234) @@ -249,22 +249,7 @@ debug = 0; } -void iax_set_private(struct iax_session *s, void *ptr) -{ - s->pvt = ptr; -} -void *iax_get_private(struct iax_session *s) -{ - return s->pvt; -} - -void iax_set_sendto(struct iax_session *s, iax_sendto_t ptr) -{ - s->sendto = ptr; -} - - /* This is a little strange, but to debug you call DEBU(G "Hello World!\n"); */ #if defined(WIN32) || defined(_WIN32_WCE) #define G __FILE__, __LINE__, @@ -274,7 +259,7 @@ #define DEBU __debug #if defined(WIN32) || defined(_WIN32_WCE) -static int __debug(char *file, int lineno, char *fmt, ...) +static int __debug(const char *file, int lineno, const char *fmt, ...) { va_list args; va_start(args, fmt); @@ -286,7 +271,7 @@ return 0; } #else -static int __debug(char *file, int lineno, char *func, char *fmt, ...) +static int __debug(const char *file, int lineno, const char *func, const char *fmt, ...) { va_list args; va_start(args, fmt); @@ -825,13 +810,15 @@ { int res; #ifdef DEBUG_SUPPORT - struct ast_iax2_full_hdr *h = (struct ast_iax2_full_hdr *)(f->data); + if (debug) { + struct ast_iax2_full_hdr *h = (struct ast_iax2_full_hdr *)(f->data); - if (ntohs(h->scallno) & IAX_FLAG_FULL) - iax_showframe(f, NULL, 0, f->transfer ? - &(f->session->transfer) : - &(f->session->peeraddr), - f->datalen - sizeof(struct ast_iax2_full_hdr)); + if (ntohs(h->scallno) & IAX_FLAG_FULL) + iax_showframe(f, NULL, 0, f->transfer ? + &(f->session->transfer) : + &(f->session->peeraddr), + f->datalen - sizeof(struct ast_iax2_full_hdr)); + } #endif /* Send the frame raw */ res = f->session->sendto(netfd, (const char *) f->data, f->datalen, IAX_SOCKOPTS, @@ -2494,7 +2481,8 @@ } #ifdef DEBUG_SUPPORT - iax_showframe(NULL, fh, 1, sin, datalen); + if (debug) + iax_showframe(NULL, fh, 1, sin, datalen); #endif /* Get things going with it, timestamp wise, if we This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ma...@us...> - 2007-10-27 06:50:47
|
Revision: 1233 http://iaxclient.svn.sourceforge.net/iaxclient/?rev=1233&view=rev Author: matben Date: 2007-10-26 23:50:47 -0700 (Fri, 26 Oct 2007) Log Message: ----------- * First skeleton of a video widget. Added Paths: ----------- trunk/contrib/tcl/video.c Added: trunk/contrib/tcl/video.c =================================================================== --- trunk/contrib/tcl/video.c (rev 0) +++ trunk/contrib/tcl/video.c 2007-10-27 06:50:47 UTC (rev 1233) @@ -0,0 +1,574 @@ +/* + * video.c -- + * + * Implements a video widget integrated with iaxclient. + * Skeleton code from tkSquare.c. + * + * Copyright (c) 2007 Mats Bengtsson + * + * $Id$ + */ + +/* + * Mac OS X build: + * + * gcc -Wall -g -DUSE_TCL_STUBS -DUSE_TK_STUBS \ + * -DTARGET_OS_MAC=1 -DTARGET_API_MAC_CARBON=1 -DMAC_OSX_TK \ + * -I/Library/Frameworks/Tcl.framework/Headers/ \ + * -I/Library/Frameworks/Tk.framework/Headers/ \ + * -I/Users/matben/C/cvs/tcl/generic \ + * -I/Users/matben/C/cvs/tk/generic \ + * -I/Users/matben/C/cvs/tk/macosx \ + * -c video.c + * gcc -dynamiclib -o video.dylib video.o \ + * -L/Library/Frameworks/Tcl.framework/ -ltclstub8.4 \ + * -L/Library/Frameworks/Tk.framework/ -ltkstub8.4 + * + * Unix: + * + * gcc -Wall -g -DUSE_TCL_STUBS -DUSE_TK_STUBS -fpic -c video.c + * gcc -shared -o video.so video.o -ltclstub8.4 -ltkstub8.4 + * + */ + +#include "tkPort.h" +#define __NO_OLD_CONFIG +#include "tk.h" +#include "tkInt.h" + +/* + * A data structure of the following type is kept for each square + * widget managed by this file: + */ + +typedef struct { + Tk_Window tkwin; /* Window that embodies the square. NULL + * means window has been deleted but + * widget record hasn't been cleaned up yet. */ + Display *display; /* X's token for the window's display. */ + Tcl_Interp *interp; /* Interpreter associated with widget. */ + Tcl_Command widgetCmd; /* Token for square's widget command. */ + Tk_OptionTable optionTable; /* Token representing the configuration + * specifications. */ + Tcl_Obj *widthObjPtr, *heightObjPtr; /* Width and height. */ + + /* + * Information used when displaying widget: + */ + + Tcl_Obj *bgBorderPtr; + GC gc; /* Graphics context for copying from + * off-screen pixmap onto screen. */ + Tcl_Obj *doubleBufferPtr; /* Non-zero means double-buffer redisplay + * with pixmap; zero means draw straight + * onto the display. */ + int updatePending; /* Non-zero means a call to VideoDisplay + * has already been scheduled. */ +} Video; + +/* + * Information used for argv parsing. + */ + +static Tk_OptionSpec optionSpecs[] = { + {TK_OPTION_BORDER, "-background", "background", "Background", + "#d9d9d9", Tk_Offset(Video, bgBorderPtr), -1, 0, + (ClientData) "white"}, + {TK_OPTION_SYNONYM, "-bg", (char *) NULL, (char *) NULL, + (char *) NULL, 0, -1, 0, (ClientData) "-background"}, + {TK_OPTION_BOOLEAN, "-dbl", "doubleBuffer", "DoubleBuffer", + "0", Tk_Offset(Video, doubleBufferPtr), -1}, + {TK_OPTION_SYNONYM, "-fg", (char *) NULL, (char *) NULL, + (char *) NULL, 0, -1, 0, (ClientData) "-foreground"}, + {TK_OPTION_PIXELS, "-height", "height", "Height", "150", + Tk_Offset(Video, heightObjPtr), -1}, + {TK_OPTION_PIXELS, "-width", "width", "Width", "200", + Tk_Offset(Video, widthObjPtr), -1}, + {TK_OPTION_END} +}; + +/* + * Forward declarations for procedures defined later in this file: + */ + +static int VideoObjCmd(ClientData clientData, + Tcl_Interp *interp, int objc, + Tcl_Obj * CONST objv[]); +static void VideoDeletedProc( + ClientData clientData); +static int VideoConfigure(Tcl_Interp *interp, + Video *videoPtr); +static void VideoDestroy(char *memPtr); +static void VideoDisplay(ClientData clientData); +static void VideoObjEventProc(ClientData clientData, + XEvent *eventPtr); +static int VideoWidgetObjCmd(ClientData clientData, + Tcl_Interp *, int objc, Tcl_Obj * CONST objv[]); + + +int +Video_Init(Tcl_Interp *interp) +{ + Tcl_CreateObjCommand(interp, "iaxclient::video", VideoObjCmd, + (ClientData) NULL, (Tcl_CmdDeleteProc *) NULL); + return TCL_OK; +} + +/* + * VideoSetFrame -- + * + * This is supposed to draw a raw video frame into the widget. + * If sizes don't match then request new size but be sure not to + * draw outside the widget. + */ + +int +VideoSetFrame(Video *videoPtr, + int width, int height) +{ + + /* The SDL sources contain a lot og bit blit functions... */ + + + + + return TCL_OK; +} + +/* + *-------------------------------------------------------------- + * + * VideoObjCmd -- + * + * This procedure is invoked to process the "iaxclient::video" Tcl + * command. It creates a new "iaxclient::video" widget. + * + * Results: + * A standard Tcl result. + * + * Side effects: + * A new widget is created and configured. + * + *-------------------------------------------------------------- + */ + +static int +VideoObjCmd( + ClientData clientData, /* NULL. */ + Tcl_Interp *interp, /* Current interpreter. */ + int objc, /* Number of arguments. */ + Tcl_Obj * CONST objv[]) /* Argument objects. */ +{ + Video *videoPtr; + Tk_Window tkwin; + Tk_OptionTable optionTable; + + if (objc < 2) { + Tcl_WrongNumArgs(interp, 1, objv, "pathName ?options?"); + return TCL_ERROR; + } + + tkwin = Tk_CreateWindowFromPath(interp, Tk_MainWindow(interp), + Tcl_GetStringFromObj(objv[1], NULL), (char *) NULL); + if (tkwin == NULL) { + return TCL_ERROR; + } + Tk_SetClass(tkwin, "IAXCVideo"); + + /* + * Create the option table for this widget class. If it has + * already been created, the refcount will get bumped and just + * the pointer will be returned. The refcount getting bumped + * does not concern us, because Tk will ensure the table is + * deleted when the interpreter is destroyed. + */ + + optionTable = Tk_CreateOptionTable(interp, optionSpecs); + + /* + * Allocate and initialize the widget record. The memset allows + * us to set just the non-NULL/0 items. + */ + + videoPtr = (Video *) ckalloc(sizeof(Video)); + memset((void *) videoPtr, 0, (sizeof(Video))); + + videoPtr->tkwin = tkwin; + videoPtr->display = Tk_Display(tkwin); + videoPtr->interp = interp; + videoPtr->widgetCmd = Tcl_CreateObjCommand(interp, + Tk_PathName(videoPtr->tkwin), VideoWidgetObjCmd, + (ClientData) videoPtr, VideoDeletedProc); + videoPtr->gc = None; + videoPtr->optionTable = optionTable; + + if (Tk_InitOptions(interp, (char *) videoPtr, optionTable, tkwin) + != TCL_OK) { + Tk_DestroyWindow(videoPtr->tkwin); + ckfree((char *) videoPtr); + return TCL_ERROR; + } + + Tk_CreateEventHandler(videoPtr->tkwin, ExposureMask|StructureNotifyMask, + VideoObjEventProc, (ClientData) videoPtr); + if (Tk_SetOptions(interp, (char *) videoPtr, optionTable, objc - 2, + objv + 2, tkwin, NULL, (int *) NULL) != TCL_OK) { + goto error; + } + if (VideoConfigure(interp, videoPtr) != TCL_OK) { + goto error; + } + + Tcl_SetObjResult(interp, + Tcl_NewStringObj(Tk_PathName(videoPtr->tkwin), -1)); + return TCL_OK; + +error: + Tk_DestroyWindow(videoPtr->tkwin); + return TCL_ERROR; +} + +/* + *-------------------------------------------------------------- + * + * VideoWidgetObjCmd -- + * + * This procedure is invoked to process the Tcl command + * that corresponds to a widget managed by this module. + * See the user documentation for details on what it does. + * + * Results: + * A standard Tcl result. + * + * Side effects: + * See the user documentation. + * + *-------------------------------------------------------------- + */ + +static int +VideoWidgetObjCmd( + ClientData clientData, /* Information about square widget. */ + Tcl_Interp *interp, /* Current interpreter. */ + int objc, /* Number of arguments. */ + Tcl_Obj * CONST objv[]) /* Argument objects. */ +{ + Video *videoPtr = (Video *) clientData; + int result = TCL_OK; + static CONST char *videoOptions[] = {"cget", "configure", (char *) NULL}; + enum { + VIDEO_CGET, VIDEO_CONFIGURE + }; + Tcl_Obj *resultObjPtr; + int index; + + if (objc < 2) { + Tcl_WrongNumArgs(interp, 1, objv, "option ?arg arg...?"); + return TCL_ERROR; + } + + if (Tcl_GetIndexFromObj(interp, objv[1], videoOptions, "command", + 0, &index) != TCL_OK) { + return TCL_ERROR; + } + + Tcl_Preserve((ClientData) videoPtr); + + switch (index) { + case VIDEO_CGET: { + if (objc != 3) { + Tcl_WrongNumArgs(interp, 2, objv, "option"); + goto error; + } + resultObjPtr = Tk_GetOptionValue(interp, (char *) videoPtr, + videoPtr->optionTable, objv[2], videoPtr->tkwin); + if (resultObjPtr == NULL) { + result = TCL_ERROR; + } else { + Tcl_SetObjResult(interp, resultObjPtr); + } + break; + } + case VIDEO_CONFIGURE: { + resultObjPtr = NULL; + if (objc == 2) { + resultObjPtr = Tk_GetOptionInfo(interp, (char *) videoPtr, + videoPtr->optionTable, (Tcl_Obj *) NULL, + videoPtr->tkwin); + if (resultObjPtr == NULL) { + result = TCL_ERROR; + } + } else if (objc == 3) { + resultObjPtr = Tk_GetOptionInfo(interp, (char *) videoPtr, + videoPtr->optionTable, objv[2], videoPtr->tkwin); + if (resultObjPtr == NULL) { + result = TCL_ERROR; + } + } else { + result = Tk_SetOptions(interp, (char *) videoPtr, + videoPtr->optionTable, objc - 2, objv + 2, + videoPtr->tkwin, NULL, (int *) NULL); + if (result == TCL_OK) { + result = VideoConfigure(interp, videoPtr); + } + if (!videoPtr->updatePending) { + Tcl_DoWhenIdle(VideoDisplay, (ClientData) videoPtr); + videoPtr->updatePending = 1; + } + } + if (resultObjPtr != NULL) { + Tcl_SetObjResult(interp, resultObjPtr); + } + } + } + Tcl_Release((ClientData) videoPtr); + return result; + + error: + Tcl_Release((ClientData) videoPtr); + return TCL_ERROR; +} + +/* + *---------------------------------------------------------------------- + * + * VideoConfigure -- + * + * This procedure is called to process an argv/argc list in + * conjunction with the Tk option database to configure (or + * reconfigure) a square widget. + * + * Results: + * The return value is a standard Tcl result. If TCL_ERROR is + * returned, then the interp's result contains an error message. + * + * Side effects: + * Configuration information, such as colors, border width, + * etc. get set for videoPtr; old resources get freed, + * if there were any. + * + *---------------------------------------------------------------------- + */ + +static int +VideoConfigure( + Tcl_Interp *interp, /* Used for error reporting. */ + Video *videoPtr) /* Information about widget. */ +{ + Tk_3DBorder bgBorder; + int doubleBuffer; + int width, height; + + /* + * Set the background for the window and create a graphics context + * for use during redisplay. + */ + + bgBorder = Tk_Get3DBorderFromObj(videoPtr->tkwin, + videoPtr->bgBorderPtr); + Tk_SetWindowBackground(videoPtr->tkwin, + Tk_3DBorderColor(bgBorder)->pixel); + Tcl_GetBooleanFromObj(NULL, videoPtr->doubleBufferPtr, &doubleBuffer); + if ((videoPtr->gc == None) && (doubleBuffer)) { + XGCValues gcValues; + gcValues.function = GXcopy; + gcValues.graphics_exposures = False; + videoPtr->gc = Tk_GetGC(videoPtr->tkwin, + GCFunction|GCGraphicsExposures, &gcValues); + } + + /* + * Register the desired geometry for the window. Then arrange for + * the window to be redisplayed. + */ + + Tk_GetPixelsFromObj(NULL, videoPtr->tkwin, videoPtr->widthObjPtr, &width); + Tk_GetPixelsFromObj(NULL, videoPtr->tkwin, videoPtr->heightObjPtr, &height); + Tk_GeometryRequest(videoPtr->tkwin, width, height); + if (!videoPtr->updatePending) { + Tcl_DoWhenIdle(VideoDisplay, (ClientData) videoPtr); + videoPtr->updatePending = 1; + } + return TCL_OK; +} + +/* + *-------------------------------------------------------------- + * + * VideoObjEventProc -- + * + * This procedure is invoked by the Tk dispatcher for various + * events on squares. + * + * Results: + * None. + * + * Side effects: + * When the window gets deleted, internal structures get + * cleaned up. When it gets exposed, it is redisplayed. + * + *-------------------------------------------------------------- + */ + +static void +VideoObjEventProc( + ClientData clientData, /* Information about window. */ + XEvent *eventPtr) /* Information about event. */ +{ + Video *videoPtr = (Video *) clientData; + + if (eventPtr->type == Expose || eventPtr->type == ConfigureNotify) { + if (!videoPtr->updatePending) { + Tcl_DoWhenIdle(VideoDisplay, (ClientData) videoPtr); + videoPtr->updatePending = 1; + } + } else if (eventPtr->type == DestroyNotify) { + if (videoPtr->tkwin != NULL) { + Tk_FreeConfigOptions((char *) videoPtr, videoPtr->optionTable, + videoPtr->tkwin); + if (videoPtr->gc != None) { + Tk_FreeGC(videoPtr->display, videoPtr->gc); + } + videoPtr->tkwin = NULL; + Tcl_DeleteCommandFromToken(videoPtr->interp, + videoPtr->widgetCmd); + } + if (videoPtr->updatePending) { + Tcl_CancelIdleCall(VideoDisplay, (ClientData) videoPtr); + } + Tcl_EventuallyFree((ClientData) videoPtr, VideoDestroy); + } +} + +/* + *---------------------------------------------------------------------- + * + * VideoDeletedProc -- + * + * This procedure is invoked when a widget command is deleted. If + * the widget isn't already in the process of being destroyed, + * this command destroys it. + * + * Results: + * None. + * + * Side effects: + * The widget is destroyed. + * + *---------------------------------------------------------------------- + */ + +static void +VideoDeletedProc( + ClientData clientData) /* Pointer to widget record for widget. */ +{ + Video *videoPtr = (Video *) clientData; + Tk_Window tkwin = videoPtr->tkwin; + + /* + * This procedure could be invoked either because the window was + * destroyed and the command was then deleted (in which case tkwin + * is NULL) or because the command was deleted, and then this procedure + * destroys the widget. + */ + + if (tkwin != NULL) { + Tk_DestroyWindow(tkwin); + } +} + +/* + *-------------------------------------------------------------- + * + * VideoDisplay -- + * + * This procedure redraws the contents of a square window. + * It is invoked as a do-when-idle handler, so it only runs + * when there's nothing else for the application to do. + * + * Results: + * None. + * + * Side effects: + * Information appears on the screen. + * + *-------------------------------------------------------------- + */ + +static void +VideoDisplay( + ClientData clientData) /* Information about window. */ +{ + Video *videoPtr = (Video *) clientData; + Tk_Window tkwin = videoPtr->tkwin; + Pixmap pm = None; + Drawable d; + Tk_3DBorder bgBorder; + int doubleBuffer; + + videoPtr->updatePending = 0; + if (!Tk_IsMapped(tkwin)) { + return; + } + + /* + * Create a pixmap for double-buffering, if necessary. + */ + + Tcl_GetBooleanFromObj(NULL, videoPtr->doubleBufferPtr, &doubleBuffer); + if (doubleBuffer) { + pm = Tk_GetPixmap(Tk_Display(tkwin), Tk_WindowId(tkwin), + Tk_Width(tkwin), Tk_Height(tkwin), + DefaultDepthOfScreen(Tk_Screen(tkwin))); + d = pm; + } else { + d = Tk_WindowId(tkwin); + } + + /* + * Redraw the widget's background and border. + */ + + bgBorder = Tk_Get3DBorderFromObj(videoPtr->tkwin, + videoPtr->bgBorderPtr); + Tk_Fill3DRectangle(tkwin, d, bgBorder, 0, 0, Tk_Width(tkwin), + Tk_Height(tkwin), 0, TK_RELIEF_FLAT); + + /* + * If double-buffered, copy to the screen and release the pixmap. + */ + + if (doubleBuffer) { + XCopyArea(Tk_Display(tkwin), pm, Tk_WindowId(tkwin), videoPtr->gc, + 0, 0, (unsigned) Tk_Width(tkwin), (unsigned) Tk_Height(tkwin), + 0, 0); + Tk_FreePixmap(Tk_Display(tkwin), pm); + } +} + +/* + *---------------------------------------------------------------------- + * + * VideoDestroy -- + * + * This procedure is invoked by Tcl_EventuallyFree or Tcl_Release + * to clean up the internal structure of a square at a safe time + * (when no-one is using it anymore). + * + * Results: + * None. + * + * Side effects: + * Everything associated with the square is freed up. + * + *---------------------------------------------------------------------- + */ + +static void +VideoDestroy( + char *memPtr) /* Info about square widget. */ +{ + Video *videoPtr = (Video *) memPtr; + + ckfree((char *) videoPtr); +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sb...@us...> - 2007-10-25 15:20:13
|
Revision: 1232 http://iaxclient.svn.sourceforge.net/iaxclient/?rev=1232&view=rev Author: sbalea Date: 2007-10-25 08:20:17 -0700 (Thu, 25 Oct 2007) Log Message: ----------- Add synchronization to ec and st setup and teardown Modified Paths: -------------- branches/team/mihai/echocan/lib/audio_encode.c Modified: branches/team/mihai/echocan/lib/audio_encode.c =================================================================== --- branches/team/mihai/echocan/lib/audio_encode.c 2007-10-25 06:37:55 UTC (rev 1231) +++ branches/team/mihai/echocan/lib/audio_encode.c 2007-10-25 15:20:17 UTC (rev 1232) @@ -46,6 +46,8 @@ static int speex_state_rate = 0; int iaxci_filters = IAXC_FILTER_AGC|IAXC_FILTER_DENOISE|IAXC_FILTER_AAGC|IAXC_FILTER_CN; +static MUTEX audio_lock; + #ifdef SPEEX_EC static SpeexEchoState *ec = NULL; static rb_RingBuffer ecOutRing; @@ -149,6 +151,7 @@ float volume; int silent = 0; + MUTEXLOCK(&audio_lock); if ( !st || speex_state_size != len || speex_state_rate != rate ) { if (st) @@ -168,6 +171,7 @@ speex_state_rate = rate; set_speex_filters(); } + MUTEXUNLOCK(&audio_lock); calculate_level((short *)audio, len, &input_level); @@ -444,6 +448,7 @@ /* if ec is off, clear ec state -- this way, we start fresh if/when * it's turned back on. */ + MUTEXLOCK(&audio_lock); if ( !(iaxci_filters & IAXC_FILTER_ECHO) ) { if ( ec ) @@ -465,9 +470,6 @@ rb_InitializeRingBuffer(&ecOutRing, EC_RING_SIZE, &outRingBuf); ec = speex_echo_state_init(SAMPLES_PER_FRAME, ECHO_TAIL); - // st and ec can be created and destroyed from two separate threads - // and thus we have possible race conditions here. - // TODO: verify that this is the case and add synchronization code. if ( st ) { speex_preprocess_ctl(st, SPEEX_PREPROCESS_SET_ECHO_STATE, ec); @@ -477,7 +479,8 @@ speex_preprocess_ctl(st, SPEEX_PREPROCESS_SET_ECHO_SUPPRESS_ACTIVE, &i); } } - + MUTEXUNLOCK(&audio_lock); + // Put our data in the EC ring buffer. // Echo canceller needs SAMPLES_PER_FRAME samples, so if we don't have enough // at this time, we just store what we have and return. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ma...@us...> - 2007-10-25 06:37:51
|
Revision: 1231 http://iaxclient.svn.sourceforge.net/iaxclient/?rev=1231&view=rev Author: matben Date: 2007-10-24 23:37:55 -0700 (Wed, 24 Oct 2007) Log Message: ----------- * Added missing docs for ringtones. Modified Paths: -------------- trunk/contrib/tcl/README.txt Modified: trunk/contrib/tcl/README.txt =================================================================== --- trunk/contrib/tcl/README.txt 2007-10-24 18:56:07 UTC (rev 1230) +++ trunk/contrib/tcl/README.txt 2007-10-25 06:37:55 UTC (rev 1231) @@ -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, This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sb...@us...> - 2007-10-24 18:56:04
|
Revision: 1230 http://iaxclient.svn.sourceforge.net/iaxclient/?rev=1230&view=rev Author: sbalea Date: 2007-10-24 11:56:07 -0700 (Wed, 24 Oct 2007) Log Message: ----------- Make sure that we link the echo canceller to the preprocessor in all situations. Reduce tail to 512 frames. Miscellaneous 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 Modified: branches/team/mihai/echocan/lib/audio_encode.c =================================================================== --- branches/team/mihai/echocan/lib/audio_encode.c 2007-10-24 15:31:46 UTC (rev 1229) +++ branches/team/mihai/echocan/lib/audio_encode.c 2007-10-24 18:56:07 UTC (rev 1230) @@ -154,6 +154,16 @@ if (st) speex_preprocess_state_destroy(st); st = speex_preprocess_state_init(len,rate); + if ( ec ) + { + int i; + + speex_preprocess_ctl(st, SPEEX_PREPROCESS_SET_ECHO_STATE, ec); + i = ECHO_SUPPRESS; + speex_preprocess_ctl(st, SPEEX_PREPROCESS_SET_ECHO_SUPPRESS, &i); + i = ECHO_SUPPRESS_ACTIVE; + speex_preprocess_ctl(st, SPEEX_PREPROCESS_SET_ECHO_SUPPRESS_ACTIVE, &i); + } speex_state_size = len; speex_state_rate = rate; set_speex_filters(); @@ -431,7 +441,7 @@ // 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. */ if ( !(iaxci_filters & IAXC_FILTER_ECHO) ) @@ -441,7 +451,9 @@ speex_echo_state_destroy(ec); ec = NULL; if ( st ) + { speex_preprocess_ctl(st, SPEEX_PREPROCESS_SET_ECHO_STATE, NULL); + } } return 0; @@ -452,6 +464,10 @@ { rb_InitializeRingBuffer(&ecOutRing, EC_RING_SIZE, &outRingBuf); ec = speex_echo_state_init(SAMPLES_PER_FRAME, ECHO_TAIL); + + // st and ec can be created and destroyed from two separate threads + // and thus we have possible race conditions here. + // TODO: verify that this is the case and add synchronization code. if ( st ) { speex_preprocess_ctl(st, SPEEX_PREPROCESS_SET_ECHO_STATE, ec); @@ -471,7 +487,6 @@ rb_ReadRingBuffer(&ecOutRing, delayedBuf, SAMPLES_PER_FRAME * 2); - //fprintf(stderr, "Mihai: doing echo cancellation, samples = %d\n", samples); speex_echo_cancellation(ec, inputBuffer, delayedBuf, cancelledBuffer); for ( i = 0; i < samples; i++ ) Modified: branches/team/mihai/echocan/lib/audio_encode.h =================================================================== --- branches/team/mihai/echocan/lib/audio_encode.h 2007-10-24 15:31:46 UTC (rev 1229) +++ branches/team/mihai/echocan/lib/audio_encode.h 2007-10-24 18:56:07 UTC (rev 1230) @@ -27,7 +27,7 @@ #define MAX_SAMPLES_PER_FRAME (MS_PER_FRAME * MAX_SAMPLE_RATE / 1000) /* echo_tail length, in samples */ -#define ECHO_TAIL 1024 +#define ECHO_TAIL 512 /* Maximum attenuation of residual echo in dB (negative number) */ #define ECHO_SUPPRESS -60 Modified: branches/team/mihai/echocan/lib/audio_portaudio.c =================================================================== --- branches/team/mihai/echocan/lib/audio_portaudio.c 2007-10-24 15:31:46 UTC (rev 1229) +++ branches/team/mihai/echocan/lib/audio_portaudio.c 2007-10-24 18:56:07 UTC (rev 1230) @@ -365,7 +365,6 @@ if ( outputBuffer ) { - //fprintf(stderr, "Mihai: PA output buffer size %d samples\n", samplesPerFrame); int bWritten; /* output underflow might happen here */ if (virtualMonoOut) @@ -408,7 +407,6 @@ { int res; - //fprintf(stderr, "Mihai: PA input buffer size %d samples\n", samplesPerFrame); /* input overflow might happen here */ if ( virtualMonoIn ) { @@ -419,8 +417,6 @@ samplesPerFrame); if ( !res ) rb_WriteRingBuffer(&inRing, virtualInBuffer, totBytes); - //else - // fprintf(stderr, "Mihai: EC does not have enough data\n"); } else { @@ -429,8 +425,6 @@ samplesPerFrame); if ( !res) rb_WriteRingBuffer(&inRing, inputBuffer, totBytes); - //else - // fprintf(stderr, "Mihai: EC does not have enough data\n"); } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sb...@us...> - 2007-10-24 15:31:42
|
Revision: 1229 http://iaxclient.svn.sourceforge.net/iaxclient/?rev=1229&view=rev Author: sbalea Date: 2007-10-24 08:31:46 -0700 (Wed, 24 Oct 2007) Log Message: ----------- Remove a leftover debug fprintf Modified Paths: -------------- branches/team/mihai/echocan/lib/audio_portaudio.c Modified: branches/team/mihai/echocan/lib/audio_portaudio.c =================================================================== --- branches/team/mihai/echocan/lib/audio_portaudio.c 2007-10-24 12:37:49 UTC (rev 1228) +++ branches/team/mihai/echocan/lib/audio_portaudio.c 2007-10-24 15:31:46 UTC (rev 1229) @@ -363,7 +363,6 @@ } #endif - fprintf(stderr, "Mihai: in PA callback\n"); if ( outputBuffer ) { //fprintf(stderr, "Mihai: PA output buffer size %d samples\n", samplesPerFrame); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ma...@us...> - 2007-10-24 12:37:44
|
Revision: 1228 http://iaxclient.svn.sourceforge.net/iaxclient/?rev=1228&view=rev Author: matben Date: 2007-10-24 05:37:49 -0700 (Wed, 24 Oct 2007) Log Message: ----------- * Changed -L path. Modified Paths: -------------- trunk/contrib/tcl/configure trunk/contrib/tcl/configure.in Modified: trunk/contrib/tcl/configure =================================================================== --- trunk/contrib/tcl/configure 2007-10-24 06:20:20 UTC (rev 1227) +++ trunk/contrib/tcl/configure 2007-10-24 12:37:49 UTC (rev 1228) @@ -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 -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 @@ -4725,6 +4421,7 @@ echo "$as_me:$LINENO: checking errno.h presence" >&5 echo $ECHO_N "checking errno.h presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -4742,7 +4439,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 @@ -4762,31 +4458,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: errno.h: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: errno.h: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: errno.h: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: errno.h: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes + { echo "$as_me:$LINENO: WARNING: errno.h: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: errno.h: proceeding with the preprocessor's result" >&2;} + ( + cat <<\_ASBOX +## ------------------------------------ ## +## Report this to bug...@gn.... ## +## ------------------------------------ ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&2 ;; - no:yes:* ) + no:yes ) { echo "$as_me:$... [truncated message content] |
From: <ma...@us...> - 2007-10-24 06:20:18
|
Revision: 1227 http://iaxclient.svn.sourceforge.net/iaxclient/?rev=1227&view=rev Author: matben Date: 2007-10-23 23:20:20 -0700 (Tue, 23 Oct 2007) Log Message: ----------- * Updated to r.o. Modified Paths: -------------- trunk/contrib/tcl/iaxclient.c Modified: trunk/contrib/tcl/iaxclient.c =================================================================== --- trunk/contrib/tcl/iaxclient.c 2007-10-24 06:08:34 UTC (rev 1226) +++ trunk/contrib/tcl/iaxclient.c 2007-10-24 06:20:20 UTC (rev 1227) @@ -321,7 +321,7 @@ // Set Preferred UDP Port: // 0: Use the default port (4569) iaxc_set_preferred_source_udp_port(0); - if (iaxc_initialize(AUDIO_INTERNAL_PA, MAX_LINES)) { + if (iaxc_initialize(MAX_LINES)) { Tcl_SetObjResult( interp, Tcl_NewStringObj( "cannot initialize iaxclient!", -1 )); return TCL_ERROR; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sb...@us...> - 2007-10-23 22:37:58
|
Revision: 1225 http://iaxclient.svn.sourceforge.net/iaxclient/?rev=1225&view=rev Author: sbalea Date: 2007-10-23 15:37:55 -0700 (Tue, 23 Oct 2007) Log Message: ----------- Force PA to spit out standard sized buffers Comment out bias removal code Miscellaneous tweaks => Echo cancellation works pretty well on my mac :) 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 Modified: branches/team/mihai/echocan/lib/audio_encode.c =================================================================== --- branches/team/mihai/echocan/lib/audio_encode.c 2007-10-23 22:20:37 UTC (rev 1224) +++ branches/team/mihai/echocan/lib/audio_encode.c 2007-10-23 22:37:55 UTC (rev 1225) @@ -417,7 +417,7 @@ set_speex_filters(); } -void audio_echo_cancellation(short *inputBuffer, short *outputBuffer, int samples) +int audio_echo_cancellation(short *inputBuffer, short *outputBuffer, int samples) { #ifdef SPEEX_EC int i; @@ -426,11 +426,11 @@ 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); - } +// 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. */ @@ -444,7 +444,7 @@ speex_preprocess_ctl(st, SPEEX_PREPROCESS_SET_ECHO_STATE, NULL); } - return; + return 0; } /* we want echo cancellation */ @@ -462,20 +462,21 @@ } } - /* fill ecOutRing */ + // Put our data in the EC ring buffer. + // Echo canceller needs SAMPLES_PER_FRAME samples, so if we don't have enough + // at this time, we just store what we have and return. rb_WriteRingBuffer(&ecOutRing, outputBuffer, samples * 2); + if ( rb_GetRingBufferReadAvailable(&ecOutRing) < (SAMPLES_PER_FRAME * 2) ) + return -1; - // Make sure we have enough buffer. - // Currently, just one SAMPLES_PER_FRAME's worth. - if ( rb_GetRingBufferReadAvailable(&ecOutRing) < ((samples + SAMPLES_PER_FRAME) * 2) ) - return; + rb_ReadRingBuffer(&ecOutRing, delayedBuf, SAMPLES_PER_FRAME * 2); - rb_ReadRingBuffer(&ecOutRing, delayedBuf, samples * 2); - + //fprintf(stderr, "Mihai: doing echo cancellation, samples = %d\n", samples); speex_echo_cancellation(ec, inputBuffer, delayedBuf, cancelledBuffer); for ( i = 0; i < samples; i++ ) inputBuffer[i] = cancelledBuffer[i]; #endif + return 0; } Modified: branches/team/mihai/echocan/lib/audio_encode.h =================================================================== --- branches/team/mihai/echocan/lib/audio_encode.h 2007-10-23 22:20:37 UTC (rev 1224) +++ branches/team/mihai/echocan/lib/audio_encode.h 2007-10-23 22:37:55 UTC (rev 1225) @@ -51,7 +51,7 @@ int audio_decode_audio(struct iaxc_call * p, void * out, void * data, int len, int iEncodeType, int * samples); -void audio_echo_cancellation(short *inputBuffer, short *outputBuffer, int samples); +int audio_echo_cancellation(short *inputBuffer, short *outputBuffer, int samples); #endif Modified: branches/team/mihai/echocan/lib/audio_portaudio.c =================================================================== --- branches/team/mihai/echocan/lib/audio_portaudio.c 2007-10-23 22:20:37 UTC (rev 1224) +++ branches/team/mihai/echocan/lib/audio_portaudio.c 2007-10-23 22:37:55 UTC (rev 1225) @@ -351,11 +351,10 @@ PaStreamCallbackFlags statusFlags, void *userData) { + short virtualInBuffer[MAX_SAMPLES_PER_FRAME]; + short virtualOutBuffer[MAX_SAMPLES_PER_FRAME]; int totBytes = samplesPerFrame * sizeof(SAMPLE); - short virtualInBuffer[MAX_SAMPLES_PER_FRAME * 2]; - short virtualOutBuffer[MAX_SAMPLES_PER_FRAME * 2]; - #if 0 /* I think this can't happen */ if(virtualMono && samplesPerFrame > SAMPLES_PER_FRAME) { @@ -364,8 +363,10 @@ } #endif + fprintf(stderr, "Mihai: in PA callback\n"); if ( outputBuffer ) { + //fprintf(stderr, "Mihai: PA output buffer size %d samples\n", samplesPerFrame); int bWritten; /* output underflow might happen here */ if (virtualMonoOut) @@ -406,22 +407,31 @@ if ( inputBuffer ) { + int res; + + //fprintf(stderr, "Mihai: PA input buffer size %d samples\n", samplesPerFrame); /* input overflow might happen here */ if ( virtualMonoIn ) { stereo2mono(virtualInBuffer, (SAMPLE *)inputBuffer, samplesPerFrame); - audio_echo_cancellation(virtualInBuffer, - virtualOutBuffer, - samplesPerFrame); - rb_WriteRingBuffer(&inRing, virtualInBuffer, totBytes); + res = audio_echo_cancellation(virtualInBuffer, + virtualOutBuffer, + samplesPerFrame); + if ( !res ) + rb_WriteRingBuffer(&inRing, virtualInBuffer, totBytes); + //else + // fprintf(stderr, "Mihai: EC does not have enough data\n"); } else { - audio_echo_cancellation((short *)inputBuffer, - (short *)outputBuffer, - samplesPerFrame); - rb_WriteRingBuffer(&inRing, inputBuffer, totBytes); + res = audio_echo_cancellation((short *)inputBuffer, + (short *)outputBuffer, + samplesPerFrame); + if ( !res) + rb_WriteRingBuffer(&inRing, inputBuffer, totBytes); + //else + // fprintf(stderr, "Mihai: EC does not have enough data\n"); } } @@ -480,7 +490,8 @@ &in_stream_params, &out_stream_params, iaxci_sample_rate, - paFramesPerBufferUnspecified, //FEEBACK - unsure if appropriate + //paFramesPerBufferUnspecified, //FEEBACK - unsure if appropriate + SAMPLES_PER_FRAME, paNoFlag, (PaStreamCallback *)pa_callback, NULL); @@ -493,7 +504,8 @@ &in_stream_params, &no_device, iaxci_sample_rate, - paFramesPerBufferUnspecified, //FEEBACK - unsure if appropriate + //paFramesPerBufferUnspecified, //FEEBACK - unsure if appropriate + SAMPLES_PER_FRAME, paNoFlag, (PaStreamCallback *)pa_callback, NULL); @@ -503,7 +515,8 @@ &no_device, &out_stream_params, iaxci_sample_rate, - paFramesPerBufferUnspecified, //FEEBACK - unsure if appropriate + //paFramesPerBufferUnspecified, //FEEBACK - unsure if appropriate + SAMPLES_PER_FRAME, paNoFlag, (PaStreamCallback *)pa_callback, NULL); 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:56:05
|
Revision: 1223 http://iaxclient.svn.sourceforge.net/iaxclient/?rev=1223&view=rev Author: sbalea Date: 2007-10-22 09:56:09 -0700 (Mon, 22 Oct 2007) Log Message: ----------- Default frame duration changed to 20 ms Modified Paths: -------------- branches/team/mihai/echocan/lib/audio_encode.h Modified: branches/team/mihai/echocan/lib/audio_encode.h =================================================================== --- branches/team/mihai/echocan/lib/audio_encode.h 2007-10-22 16:51:10 UTC (rev 1222) +++ branches/team/mihai/echocan/lib/audio_encode.h 2007-10-22 16:56:09 UTC (rev 1223) @@ -18,7 +18,7 @@ /* Some audio parameters */ #define MAX_SAMPLE_RATE 48000 #ifndef MS_PER_FRAME -# define MS_PER_FRAME 40 +# define MS_PER_FRAME 20 #endif extern int iaxci_sample_rate; 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: <bc...@us...> - 2007-10-22 16:28:18
|
Revision: 1221 http://iaxclient.svn.sourceforge.net/iaxclient/?rev=1221&view=rev Author: bcholew Date: 2007-10-22 09:28:22 -0700 (Mon, 22 Oct 2007) Log Message: ----------- Oops. Add missing configuration changes for libvidcap integration. Modified Paths: -------------- trunk/configure.ac trunk/lib/Makefile.am trunk/simpleclient/stresstest/Makefile.am Modified: trunk/configure.ac =================================================================== --- trunk/configure.ac 2007-10-22 02:36:41 UTC (rev 1220) +++ trunk/configure.ac 2007-10-22 16:28:22 UTC (rev 1221) @@ -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: trunk/lib/Makefile.am =================================================================== --- trunk/lib/Makefile.am 2007-10-22 02:36:41 UTC (rev 1220) +++ trunk/lib/Makefile.am 2007-10-22 16:28:22 UTC (rev 1221) @@ -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: trunk/simpleclient/stresstest/Makefile.am =================================================================== --- trunk/simpleclient/stresstest/Makefile.am 2007-10-22 02:36:41 UTC (rev 1220) +++ trunk/simpleclient/stresstest/Makefile.am 2007-10-22 16:28:22 UTC (rev 1221) @@ -10,6 +10,7 @@ -framework AudioUnit \ -framework Carbon \ -framework CoreAudio \ + -framework QuartzCore \ -framework QuickTime endif This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bc...@us...> - 2007-10-18 22:07:56
|
Revision: 1217 http://iaxclient.svn.sourceforge.net/iaxclient/?rev=1217&view=rev Author: bcholew Date: 2007-10-18 15:08:00 -0700 (Thu, 18 Oct 2007) Log Message: ----------- Replace videoLib with libvidcap for video capture. Thanks to Pete Grayson for this. Libvidcap can be found at http://sourceforge.net/projects/libvidcap. Modified Paths: -------------- trunk/contrib/win/vs2005/iaxclient.sln trunk/contrib/win/vs2005/libiaxclient.vcproj trunk/lib/audio_encode.c trunk/lib/audio_encode.h trunk/lib/codec_theora.c trunk/lib/iaxclient.h trunk/lib/iaxclient_lib.c trunk/lib/iaxclient_lib.h trunk/lib/video.c trunk/lib/video.h trunk/simpleclient/vtestcall/vtestcall.c trunk/simpleclient/vtestcall/vtestcall.vcproj Removed Paths: ------------- trunk/lib/videoLib/ Modified: trunk/contrib/win/vs2005/iaxclient.sln =================================================================== --- trunk/contrib/win/vs2005/iaxclient.sln 2007-10-18 18:18:07 UTC (rev 1216) +++ trunk/contrib/win/vs2005/iaxclient.sln 2007-10-18 22:08:00 UTC (rev 1217) @@ -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: trunk/contrib/win/vs2005/libiaxclient.vcproj =================================================================== --- trunk/contrib/win/vs2005/libiaxclient.vcproj 2007-10-18 18:18:07 UTC (rev 1216) +++ trunk/contrib/win/vs2005/libiaxclient.vcproj 2007-10-18 22:08:00 UTC (rev 1217) @@ -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: trunk/lib/audio_encode.c =================================================================== --- trunk/lib/audio_encode.c 2007-10-18 18:18:07 UTC (rev 1216) +++ trunk/lib/audio_encode.c 2007-10-18 22:08:00 UTC (rev 1217) @@ -14,6 +14,7 @@ * the GNU Lesser (Library) General Public License. */ +#include "audio_encode.h" #include "iaxclient_lib.h" #include "iax-client.h" #ifdef CODEC_GSM @@ -25,10 +26,10 @@ #include <speex/speex_preprocess.h> #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; @@ -58,9 +59,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() @@ -79,11 +80,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); @@ -95,7 +96,7 @@ int i; float f; - if(!st) + if ( !st ) return; i = 1; /* always make VAD decision */ Modified: trunk/lib/audio_encode.h =================================================================== --- trunk/lib/audio_encode.h 2007-10-18 18:18:07 UTC (rev 1216) +++ trunk/lib/audio_encode.h 2007-10-18 22:08:00 UTC (rev 1217) @@ -15,6 +15,11 @@ #ifndef _AUDIO_ENCODE_H #define _AUDIO_ENCODE_H +/* 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: trunk/lib/codec_theora.c =================================================================== --- trunk/lib/codec_theora.c 2007-10-18 18:18:07 UTC (rev 1216) +++ trunk/lib/codec_theora.c 2007-10-18 22:08:00 UTC (rev 1217) @@ -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: trunk/lib/iaxclient.h =================================================================== --- trunk/lib/iaxclient.h 2007-10-18 18:18:07 UTC (rev 1216) +++ trunk/lib/iaxclient.h 2007-10-18 22:08:00 UTC (rev 1217) @@ -1253,9 +1253,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: Modified: trunk/lib/iaxclient_lib.c =================================================================== --- trunk/lib/iaxclient_lib.c 2007-10-18 18:18:07 UTC (rev 1216) +++ trunk/lib/iaxclient_lib.c 2007-10-18 22:08:00 UTC (rev 1217) @@ -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: trunk/lib/iaxclient_lib.h =================================================================== --- trunk/lib/iaxclient_lib.h 2007-10-18 18:18:07 UTC (rev 1216) +++ trunk/lib/iaxclient_lib.h 2007-10-18 22:08:00 UTC (rev 1217) @@ -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); }; Modified: trunk/lib/video.c =================================================================== --- trunk/lib/video.c 2007-10-18 18:18:07 UTC (rev 1216) +++ trunk/lib/video.c 2007-10-18 22:08:00 UTC (rev 1217) @@ -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 = malloc(vinfo.scaled_buf_size); + fprintf(stderr, "scaling yuy2 images by 1/%d\n", + scale_factor); + } + if ( !vinfo.converted_rgb_buf || !vinfo.converted_i420_buf ) + return -1; + break; + default: + fprintf(stderr, "do not know how to deal with vidcap " + "fourcc '%s'\n", + vidcap_fourcc_string_get(vinfo.fmt_info.fourcc)); + return -1; + } + + if ( vinfo.scale_image && !vinfo.scaled_buf ) + return -1; + + return 0; +} + +EXPORT int iaxc_set_video_prefs(unsigned int prefs) +{ + 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; + + if ( prefs & ~prefs_mask ) + return -1; + + vinfo.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)) ) + { + MUTEXLOCK(&vinfo.camera_lock); + if ( vinfo.capturing ) + { + if ( vidcap_src_capture_stop(vinfo.src) ) + fprintf(stderr, "failed vidcap_src_capture_stop\n"); + vinfo.capturing = 0; + } + MUTEXUNLOCK(&vinfo.camera_lock); + } + else + { + MUTEXLOCK(&vinfo.camera_lock); + if ( !vinfo.capturing ) + { + if ( prepare_for_capture() ) + { + MUTEXUNLOCK(&vinfo.camera_lock); + return -1; + } + + if ( vidcap_src_capture_start(vinfo.src, + capture_callback, 0) ) + { + MUTEXUNLOCK(&vinfo.camera_lock); + fprintf(stderr, "failed to start video capture\n"); + return -1; + } + + vinfo.capturing = 1; + } + MUTEXUNLOCK(&vinfo.camera_lock); + } + + return 0; +} + +EXPORT void iaxc_video_format_set_cap(int preferred, int allowed) +{ + vfinfo.format_preferred = preferred; + vfinfo.format_allowed = allowed; +} + +EXPORT void iaxc_video_format_get_cap(int *preferred, int *allowed) +{ + *preferred = vfinfo.format_preferred; + *allowed = vfinfo.format_allowed; +} + +EXPORT void iaxc_video_format_set(int preferred, int allowed, int framerate, + int bitrate, int width, int height, int fs) +{ + 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; + + vfinfo.framerate = framerate; + vfinfo.bitrate = bitrate; + vfinfo.width = width; + vfinfo.height = height; + vfinfo.fragsize = fs; + + vfinfo.format_allowed = 0; + vfinfo.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\n", 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 + { + vfinfo.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 ) + { + vfinfo.format_allowed = real_allowed; + } + else + { +#ifdef USE_FFMPEG + vfinfo.format_allowed |= IAXC_FORMAT_H263_PLUS + | IAXC_FORMAT_H263 + | IAXC_FORMAT_MPEG4 + | IAXC_FORMAT_H264; +#endif + vfinfo.format_allowed |= IAXC_FORMAT_THEORA; + } + } +} + +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 ) + vfinfo.framerate = framerate; + if ( bitrate > 0 ) + vfinfo.bitrate = bitrate; + if ( width > 0 ) + vfinfo.width = width; + if ( height > 0 ) + vfinfo.height = height; + if ( fs > 0 ) + vfinfo.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; +} + /* process an incoming video frame */ int video_recv_video(struct iaxc_call *call, int sel_call, void *encoded_video, int encoded_video_len, unsigned int ts, int format) { - static char videobuf[VIDEO_BUFSIZ]; - int outsize = VIDEO_BUFSIZ; - int ret_dec; + enum + { + max_pixels = IAXC_VIDEO_MAX_WIDTH * IAXC_VIDEO_MAX_HEIGHT, + max_yuv_buf_size = max_pixels * 3 / 2, + max_rgb_buf_size = max_pixels * 4 + }; + + static char yuv_buf[max_yuv_buf_size]; + static char rgb_buf[max_rgb_buf_size]; + + const int pixels = vfinfo.width * vfinfo.height; + const int yuv_size = pixels * 3 / 2; + const int rgb_size = pixels * 4; + ... [truncated message content] |
From: <jpg...@us...> - 2007-10-18 18:18:05
|
Revision: 1216 http://iaxclient.svn.sourceforge.net/iaxclient/?rev=1216&view=rev Author: jpgrayson Date: 2007-10-18 11:18:07 -0700 (Thu, 18 Oct 2007) Log Message: ----------- Post tag 2.0.1 reset of version to 2.0-svn. Modified Paths: -------------- branches/2.0/configure.ac Modified: branches/2.0/configure.ac =================================================================== --- branches/2.0/configure.ac 2007-10-18 18:17:28 UTC (rev 1215) +++ branches/2.0/configure.ac 2007-10-18 18:18:07 UTC (rev 1216) @@ -3,7 +3,7 @@ AC_PREREQ(2.59) dnl Package version -m4_define(IAXC_VERSION, [2.0.1]) +m4_define(IAXC_VERSION, [2.0-svn]) AC_INIT(iaxclient, IAXC_VERSION, [jpg...@gm...]) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jpg...@us...> - 2007-10-18 18:17:24
|
Revision: 1215 http://iaxclient.svn.sourceforge.net/iaxclient/?rev=1215&view=rev Author: jpgrayson Date: 2007-10-18 11:17:28 -0700 (Thu, 18 Oct 2007) Log Message: ----------- Tag iaxclient-2.0.1. Added Paths: ----------- tags/2.0.1/ Copied: tags/2.0.1 (from rev 1214, branches/2.0) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jpg...@us...> - 2007-10-18 18:16:47
|
Revision: 1214 http://iaxclient.svn.sourceforge.net/iaxclient/?rev=1214&view=rev Author: jpgrayson Date: 2007-10-18 11:16:49 -0700 (Thu, 18 Oct 2007) Log Message: ----------- Prepare version for 2.0.1 release. Modified Paths: -------------- branches/2.0/configure.ac Modified: branches/2.0/configure.ac =================================================================== --- branches/2.0/configure.ac 2007-10-18 16:40:11 UTC (rev 1213) +++ branches/2.0/configure.ac 2007-10-18 18:16:49 UTC (rev 1214) @@ -3,7 +3,7 @@ AC_PREREQ(2.59) dnl Package version -m4_define(IAXC_VERSION, [2.0-svn]) +m4_define(IAXC_VERSION, [2.0.1]) AC_INIT(iaxclient, IAXC_VERSION, [jpg...@gm...]) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sb...@us...> - 2007-10-18 16:40:08
|
Revision: 1213 http://iaxclient.svn.sourceforge.net/iaxclient/?rev=1213&view=rev Author: sbalea Date: 2007-10-18 09:40:11 -0700 (Thu, 18 Oct 2007) Log Message: ----------- Merge bugfix from trunk Fix the registration issue that was reported by Andrea Suisani Modified Paths: -------------- branches/2.0/lib/iaxclient_lib.c Modified: branches/2.0/lib/iaxclient_lib.c =================================================================== --- branches/2.0/lib/iaxclient_lib.c 2007-10-18 16:36:17 UTC (rev 1212) +++ branches/2.0/lib/iaxclient_lib.c 2007-10-18 16:40:11 UTC (rev 1213) @@ -1723,8 +1723,13 @@ #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 ( e->etype == IAX_EVENT_NULL ) { + // Should we do something here? + // Right now we do nothing, just go with the flow + // and let the event be deallocated. + } else if ( callNo >= 0 ) + { iaxc_handle_network_event(e, callNo); } else if ((reg = iaxc_find_registration_by_session(e->session)) != NULL) { @@ -1744,11 +1749,6 @@ iaxci_usermsg(IAXC_STATUS, "Timeout for a non-existant session. Dropping", e->etype); - } else if ( e->etype == IAX_EVENT_NULL ) - { - // Should we do something here? - // Right now we do nothing, just go with the flow - // and let the event be deallocated. } else { iaxci_usermsg(IAXC_STATUS, This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sb...@us...> - 2007-10-18 16:36:18
|
Revision: 1212 http://iaxclient.svn.sourceforge.net/iaxclient/?rev=1212&view=rev Author: sbalea Date: 2007-10-18 09:36:17 -0700 (Thu, 18 Oct 2007) Log Message: ----------- Fix the registration issue that was reported by Andrea Suisani IAX_EVENT_NULL was interpreted as a registration reply and thus the registration session management got confused. Modified Paths: -------------- trunk/lib/iaxclient_lib.c Modified: trunk/lib/iaxclient_lib.c =================================================================== --- trunk/lib/iaxclient_lib.c 2007-10-18 16:33:21 UTC (rev 1211) +++ trunk/lib/iaxclient_lib.c 2007-10-18 16:36:17 UTC (rev 1212) @@ -1770,8 +1770,13 @@ #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 ( e->etype == IAX_EVENT_NULL ) { + // Should we do something here? + // Right now we do nothing, just go with the flow + // and let the event be deallocated. + } else if ( callNo >= 0 ) + { iaxc_handle_network_event(e, callNo); } else if ( (reg = iaxc_find_registration_by_session(e->session)) != NULL ) { @@ -1791,11 +1796,6 @@ iaxci_usermsg(IAXC_STATUS, "Timeout for a non-existant session. Dropping", e->etype); - } else if ( e->etype == IAX_EVENT_NULL ) - { - // Should we do something here? - // Right now we do nothing, just go with the flow - // and let the event be deallocated. } else { iaxci_usermsg(IAXC_STATUS, This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |