From: <bc...@us...> - 2008-01-14 19:04:00
|
Revision: 1331 http://iaxclient.svn.sourceforge.net/iaxclient/?rev=1331&view=rev Author: bcholew Date: 2008-01-14 11:04:03 -0800 (Mon, 14 Jan 2008) Log Message: ----------- Drop unnecessary extern of iax_now() in iax.c. Rename iax_now() to iax_tvnow() for symmetry with asterisk. Remove most references to libiax2's unused winpoop.h. Add config-time check for gettimeofday() in libiax2's configure.in - for the future. Modified Paths: -------------- trunk/contrib/win/vc6/libiax2.dsp trunk/contrib/win/vs2005/libiax2.vcproj trunk/lib/audio_encode.c trunk/lib/iaxclient_lib.c trunk/lib/libiax2/configure.in trunk/lib/libiax2/src/iax-client.h trunk/lib/libiax2/src/iax.c trunk/lib/video.c Removed Paths: ------------- trunk/lib/libiax2/src/winpoop.h Modified: trunk/contrib/win/vc6/libiax2.dsp =================================================================== --- trunk/contrib/win/vc6/libiax2.dsp 2008-01-14 18:03:00 UTC (rev 1330) +++ trunk/contrib/win/vc6/libiax2.dsp 2008-01-14 19:04:03 UTC (rev 1331) @@ -159,10 +159,6 @@ SOURCE=..\..\..\lib\libiax2\src\ringtone.h # End Source File -# Begin Source File - -SOURCE=..\..\..\lib\libiax2\src\winpoop.h -# End Source File # End Group # End Target # End Project Modified: trunk/contrib/win/vs2005/libiax2.vcproj =================================================================== --- trunk/contrib/win/vs2005/libiax2.vcproj 2008-01-14 18:03:00 UTC (rev 1330) +++ trunk/contrib/win/vs2005/libiax2.vcproj 2008-01-14 19:04:03 UTC (rev 1331) @@ -222,10 +222,6 @@ RelativePath="..\..\..\lib\libiax2\src\ringtone.h" > </File> - <File - RelativePath="..\..\..\lib\libiax2\src\winpoop.h" - > - </File> </Filter> <Filter Name="Resource Files" Modified: trunk/lib/audio_encode.c =================================================================== --- trunk/lib/audio_encode.c 2008-01-14 18:03:00 UTC (rev 1330) +++ trunk/lib/audio_encode.c 2008-01-14 19:04:03 UTC (rev 1331) @@ -71,7 +71,7 @@ float input_db; float output_db; - now = iax_now(); + now = iax_tvnow(); if ( last.tv_sec != 0 && iaxci_usecdiff(&now, &last) < 100000 ) return 0; @@ -261,7 +261,7 @@ int insize = samples; /* update last input timestamp */ - timeLastInput = iax_now(); + timeLastInput = iax_tvnow(); silent = input_postprocess(data, insize, 8000); @@ -342,7 +342,7 @@ int insize = len; int outsize = *samples; - timeLastOutput = iax_now(); + timeLastOutput = iax_tvnow(); if ( format == 0 ) { Modified: trunk/lib/iaxclient_lib.c =================================================================== --- trunk/lib/iaxclient_lib.c 2008-01-14 18:03:00 UTC (rev 1330) +++ trunk/lib/iaxclient_lib.c 2008-01-14 19:04:03 UTC (rev 1331) @@ -733,7 +733,7 @@ { if ( callNo < 0 ) return; - calls[callNo].last_activity = iax_now(); + calls[callNo].last_activity = iax_tvnow(); } static void iaxc_refresh_registrations() @@ -741,7 +741,7 @@ struct iaxc_registration *cur; struct timeval now; - now = iax_now(); + now = iax_tvnow(); for ( cur = registrations; cur != NULL; cur = cur->next ) { @@ -1264,7 +1264,7 @@ return -1; } - newreg->last = iax_now(); + newreg->last = iax_tvnow(); newreg->refresh = refresh; strncpy(newreg->host, host, 256); Modified: trunk/lib/libiax2/configure.in =================================================================== --- trunk/lib/libiax2/configure.in 2008-01-14 18:03:00 UTC (rev 1330) +++ trunk/lib/libiax2/configure.in 2008-01-14 19:04:03 UTC (rev 1331) @@ -15,6 +15,8 @@ dnl Check header files AC_HEADER_STDC +AC_CHECK_FUNCS(gettimeofday) + AC_SUBST(LIBS) AC_ARG_ENABLE(snomhack, [ --enable-snomhack Use slower memset for SNOM phoneem ],,enable_snomhack=no) Modified: trunk/lib/libiax2/src/iax-client.h =================================================================== --- trunk/lib/libiax2/src/iax-client.h 2008-01-14 18:03:00 UTC (rev 1330) +++ trunk/lib/libiax2/src/iax-client.h 2008-01-14 19:04:03 UTC (rev 1331) @@ -200,7 +200,7 @@ extern void iax_enable_debug(void); extern void iax_disable_debug(void); -extern struct timeval iax_now(void); +extern struct timeval iax_tvnow(void); /* For attended transfer, application create a new session, * make a call on the new session. Modified: trunk/lib/libiax2/src/iax.c =================================================================== --- trunk/lib/libiax2/src/iax.c 2008-01-14 18:03:00 UTC (rev 1330) +++ trunk/lib/libiax2/src/iax.c 2008-01-14 19:04:03 UTC (rev 1331) @@ -47,14 +47,6 @@ #endif #endif -#ifdef __cplusplus -extern "C" { -#endif -struct timeval iax_now(void); -#ifdef __cplusplus -} -#endif - #else #include <netdb.h> @@ -396,7 +388,7 @@ sched = (struct iax_sched*)malloc(sizeof(struct iax_sched)); if (sched) { memset(sched, 0, sizeof(struct iax_sched)); - sched->when = iax_now(); + sched->when = iax_tvnow(); sched->when.tv_sec += (ms / 1000); ms = ms % 1000; sched->when.tv_usec += (ms * 1000); @@ -463,7 +455,7 @@ /* If there are no pending events, we don't need to timeout */ if (!cur) return -1; - tv = iax_now(); + tv = iax_tvnow(); while(cur) { ms = (cur->when.tv_sec - tv.tv_sec) * 1000 + (cur->when.tv_usec - tv.tv_usec) / 1000; @@ -598,7 +590,7 @@ /* If this is the first packet we're sending, get our offset now. */ if (!session->offset.tv_sec && !session->offset.tv_usec) - session->offset = iax_now(); + session->offset = iax_tvnow(); /* If the timestamp is specified, just use their specified timestamp no matter what. Usually this is done for @@ -611,7 +603,7 @@ } /* Otherwise calculate the timestamp from the current time */ - tv = iax_now(); + tv = iax_tvnow(); /* Calculate the number of milliseconds since we sent the first packet */ ms = (tv.tv_sec - session->offset.tv_sec) * 1000 + @@ -2230,9 +2222,9 @@ int ms; if (!session->rxcore.tv_sec && !session->rxcore.tv_usec) { - session->rxcore = iax_now(); + session->rxcore = iax_tvnow(); } - tv = iax_now(); + tv = iax_tvnow(); ms = (tv.tv_sec - session->rxcore.tv_sec) * 1000 + (tv.tv_usec - session->rxcore.tv_usec) / 1000; @@ -3263,7 +3255,7 @@ struct iax_sched *cur; struct iax_session *session; - tv = iax_now(); + tv = iax_tvnow(); while((cur = iax_get_sched(tv))) { @@ -3490,7 +3482,7 @@ return send_command(session, AST_FRAME_IAX, IAX_COMMAND_QUELCH, 0, ied.buf, ied.pos, -1); } -struct timeval iax_now(void) +struct timeval iax_tvnow(void) { struct timeval tv; Deleted: trunk/lib/libiax2/src/winpoop.h =================================================================== --- trunk/lib/libiax2/src/winpoop.h 2008-01-14 18:03:00 UTC (rev 1330) +++ trunk/lib/libiax2/src/winpoop.h 2008-01-14 19:04:03 UTC (rev 1331) @@ -1,41 +0,0 @@ -/* - * Functions Windows doesn't have... but should - * Copyright(C) 2001, Linux Support Services, Inc. - * - * Distributed under GNU LGPL. - * - * These are NOT fully compliant with BSD 4.3 and are not - * threadsafe. - * - */ - -#ifndef _winpoop_h -#define _winpoop_h - -#if defined(_MSC_VER) -#define INLINE __inline -#else -#define INLINE inline -#endif - -#include <winsock.h> - -void gettimeofday(struct timeval *tv, void /*struct timezone*/ *tz); - -static INLINE int inet_aton(char *cp, struct in_addr *inp) -{ - int a1, a2, a3, a4; - unsigned int saddr; - - if (sscanf(cp, "%d.%d.%d.%d", &a1, &a2, &a3, &a4) != 4) - return 0; - a1 &= 0xff; - a2 &= 0xff; - a3 &= 0xff; - a4 &= 0xff; - saddr = (a1 << 24) | (a2 << 16) | (a3 << 8) | a4; - inp->s_addr = htonl(saddr); - return 1; -} - -#endif Modified: trunk/lib/video.c =================================================================== --- trunk/lib/video.c 2008-01-14 18:03:00 UTC (rev 1330) +++ trunk/lib/video.c 2008-01-14 19:04:03 UTC (rev 1331) @@ -139,7 +139,7 @@ return; memset(&vcodec->video_stats, 0, sizeof(struct iaxc_video_stats)); - vcodec->video_stats.start_time = iax_now(); + vcodec->video_stats.start_time = iax_tvnow(); } static void reset_video_stats(struct iaxc_call * call) @@ -200,9 +200,9 @@ return -1; if ( video_stats_start.tv_sec == 0 && video_stats_start.tv_usec == 0 ) - video_stats_start = iax_now(); + video_stats_start = iax_tvnow(); - now = iax_now(); + now = iax_tvnow(); if ( iaxci_msecdiff(&now, &video_stats_start) > video_stats_interval ) { @@ -732,7 +732,7 @@ /* Gather statistics */ call->vencoder->video_stats.outbound_frames++; - now = iax_now(); + now = iax_tvnow(); time_delta = iaxci_msecdiff(&now, &call->vencoder->video_stats.start_time); @@ -1296,7 +1296,7 @@ } /* Statistics */ - now = iax_now(); + now = iax_tvnow(); time = iaxci_msecdiff(&now, &call->vdecoder->video_stats.start_time); call->vdecoder->video_stats.received_slices++; call->vdecoder->video_stats.acc_recv_size += encoded_video_len; @@ -1776,9 +1776,9 @@ return -1; if ( video_stats_start.tv_sec == 0 && video_stats_start.tv_usec == 0 ) - video_stats_start = iax_now(); + video_stats_start = iax_tvnow(); - now = iax_now(); + now = iax_tvnow(); if ( iaxci_msecdiff(&now, &video_stats_start) > video_stats_interval ) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |