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: <st...@us...> - 2003-07-07 19:18:22
|
Update of /cvsroot/iaxclient/iaxclient/simpleclient/wx In directory sc8-pr-cvs1:/tmp/cvs-serv22603 Modified Files: wx.cc Log Message: Patches from Michael Van Donselaar <mv...@va...> Index: wx.cc =================================================================== RCS file: /cvsroot/iaxclient/iaxclient/simpleclient/wx/wx.cc,v retrieving revision 1.39 retrieving revision 1.40 diff -u -d -r1.39 -r1.40 --- wx.cc 3 Jul 2003 21:32:50 -0000 1.39 +++ wx.cc 7 Jul 2003 19:18:19 -0000 1.40 @@ -9,6 +9,8 @@ #include "wx/listctrl.h" #include "wx/combobox.h" #include "wx/tokenzr.h" +#include "wx/stattext.h" +#include "wx/string.h" #include "iaxclient.h" @@ -174,7 +176,12 @@ // first columns are auto-sized for(int i=0;i<=1;i++) { +#if defined(__WXMSW__) + // wxLIST_AUTOSIZE makes it too small for headings + SetColumnWidth(i,35+i*15); +#else SetColumnWidth(i,wxLIST_AUTOSIZE); +#endif width+=GetColumnWidth(i); } @@ -292,6 +299,9 @@ wxGauge *input; wxGauge *output; IAXTimer *timer; + wxStaticText *iaxServLabel; + wxComboBox *iaxServ; + wxStaticText *iaxDestLabel; wxComboBox *iaxDest; wxStaticText *muteState; @@ -411,15 +421,24 @@ topsizer->SetItemMinSize(calls, -1, calls->GetTotalHeight()+5); } + /* Server */ + topsizer->Add(iaxServLabel = new wxStaticText(aPanel, -1, _T("Server:"))); + topsizer->Add(iaxServ = new wxComboBox(aPanel, -1, _T("gu...@mi..."), + wxDefaultPosition, wxDefaultSize),0,wxEXPAND); + + iaxServ->Append("gu...@mi..."); + iaxServ->Append("guest@ast1"); + iaxServ->Append("guest@asterisk"); /* Destination */ - topsizer->Add(iaxDest = new wxComboBox(aPanel, -1, _T("gu...@mi.../s@default"), + topsizer->Add(iaxDestLabel = new wxStaticText(aPanel, -1, _T("Number:"))); + topsizer->Add(iaxDest = new wxComboBox(aPanel, -1, _T("s@default"), wxDefaultPosition, wxDefaultSize),0,wxEXPAND); - iaxDest->Append("gu...@mi.../s@default"); - iaxDest->Append("guest@ast1/8068"); - iaxDest->Append("guest@asterisk/208"); - iaxDest->Append("guest@asterisk/600"); + iaxDest->Append("s@default"); + iaxDest->Append("8068"); + iaxDest->Append("208"); + iaxDest->Append("600"); /* main control buttons */ row3sizer->Add(dialButton = new wxButton(aPanel, ID_DIAL, _T("Dial"), @@ -511,7 +530,13 @@ void IAXFrame::OnDial(wxEvent &evt) { - iaxc_call((char *)(theFrame->iaxDest->GetValue().c_str())); + wxChar Destination[128]; + + wxStrcpy(Destination, theFrame->iaxServ->GetValue()); + wxStrcat(Destination, _T("/")); + wxStrcat(Destination, theFrame->iaxDest->GetValue()); + + iaxc_call(Destination); } void IAXFrame::OnHangup(wxEvent &evt) @@ -536,6 +561,9 @@ strncpy( user , tok.GetNextToken().c_str(), 256); strncpy( pass , tok.GetNextToken().c_str(), 256); strncpy( host , tok.GetNextToken().c_str(), 256); + + theFrame->iaxServ->Append(value); + theFrame->iaxServ->SetValue(value); //fprintf(stderr, "Registering user %s pass %s host %s\n", user, pass, host); iaxc_register(user, pass, host); |
From: <st...@us...> - 2003-07-03 21:33:48
|
Update of /cvsroot/iaxclient/iaxclient In directory sc8-pr-cvs1:/tmp/cvs-serv4160 Modified Files: README Log Message: Add Michael Van Donselaar <mv...@va...> to contributors. Index: README =================================================================== RCS file: /cvsroot/iaxclient/iaxclient/README,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- README 3 Jul 2003 18:17:14 -0000 1.3 +++ README 3 Jul 2003 21:33:45 -0000 1.4 @@ -85,6 +85,8 @@ Shawn Lawrence <sha...@te...> Faizan "Tili" Naqvi <fa...@ti...> [Win32 VC++ build/client] Scott Lambert <la...@la...> [FreeBSD build changes] +Michael Van Donselaar <mv...@va...> [Win32/MinGW build directions, UI changes ] + In addition to including libiax, IAXCLIENT is also based in part on code included in test clients within libiax itself. |
From: <st...@us...> - 2003-07-03 21:32:53
|
Update of /cvsroot/iaxclient/iaxclient/simpleclient/wx In directory sc8-pr-cvs1:/tmp/cvs-serv3660 Modified Files: wx.cc Log Message: Add some features, based on a patch from Michael Van Donselaar <mv...@va...> - new Registration command-line method (and "memory" for dialog -- though it's not really useful unless the original registration fails, I guess?) - combobox for destination string entry. Index: wx.cc =================================================================== RCS file: /cvsroot/iaxclient/iaxclient/simpleclient/wx/wx.cc,v retrieving revision 1.38 retrieving revision 1.39 diff -u -d -r1.38 -r1.39 --- wx.cc 19 Jun 2003 23:50:44 -0000 1.38 +++ wx.cc 3 Jul 2003 21:32:50 -0000 1.39 @@ -7,6 +7,7 @@ #include "wx/cmdline.h" #include "wx/listctrl.h" +#include "wx/combobox.h" #include "wx/tokenzr.h" #include "iaxclient.h" @@ -35,6 +36,7 @@ bool optNoDialPad; wxString optDestination; long optNumCalls; + wxString optRegistration; }; DECLARE_APP(IAXClient) @@ -274,6 +276,9 @@ void IAXFrame::OnNotify(void); void IAXFrame::OnRegisterMenu(wxCommandEvent &evt); + // utility method + void IAXFrame::RegisterFromString(wxString value); + // Handlers for library-initiated events void IAXFrame::HandleEvent(wxCommandEvent &evt); int IAXFrame::HandleIAXEvent(iaxc_event *e); @@ -287,7 +292,7 @@ wxGauge *input; wxGauge *output; IAXTimer *timer; - wxTextCtrl *iaxDest; + wxComboBox *iaxDest; wxStaticText *muteState; IAXCalls *calls; @@ -408,9 +413,14 @@ /* Destination */ - topsizer->Add(iaxDest = new wxTextCtrl(aPanel, -1, _T("guest@ast1/8068"), + topsizer->Add(iaxDest = new wxComboBox(aPanel, -1, _T("gu...@mi.../s@default"), wxDefaultPosition, wxDefaultSize),0,wxEXPAND); + iaxDest->Append("gu...@mi.../s@default"); + iaxDest->Append("guest@ast1/8068"); + iaxDest->Append("guest@asterisk/208"); + iaxDest->Append("guest@asterisk/600"); + /* main control buttons */ row3sizer->Add(dialButton = new wxButton(aPanel, ID_DIAL, _T("Dial"), wxDefaultPosition, wxDefaultSize, wxBU_EXACTFIT),1, wxEXPAND|wxALL, 3); @@ -514,32 +524,33 @@ Close(TRUE); } -void IAXFrame::OnRegisterMenu(wxCommandEvent &evt) { +void IAXFrame::RegisterFromString(wxString value) { + wxStringTokenizer tok(value, _T(":@")); + char user[256], pass[256], host[256]; + + if(tok.CountTokens() != 3) { + theFrame->SetStatusText("error in registration format"); + return; + } + + strncpy( user , tok.GetNextToken().c_str(), 256); + strncpy( pass , tok.GetNextToken().c_str(), 256); + strncpy( host , tok.GetNextToken().c_str(), 256); + + //fprintf(stderr, "Registering user %s pass %s host %s\n", user, pass, host); + iaxc_register(user, pass, host); +} + +void IAXFrame::OnRegisterMenu(wxCommandEvent &evt) { wxTextEntryDialog dialog(this, _T("Register with a remote asterisk server"), _T("Format is user:password@hostname"), - _T("iaxuser:iaxpass@ast1"), + _T(wxGetApp().optRegistration), wxOK | wxCANCEL); if(dialog.ShowModal() == wxID_OK) - { - wxString value = dialog.GetValue(); - wxStringTokenizer tok(value, _T(":@")); - char user[256], pass[256], host[256]; - - if(tok.CountTokens() != 3) { - theFrame->SetStatusText("error in registration format"); - return; - } - - strncpy( user , tok.GetNextToken().c_str(), 256); - strncpy( pass , tok.GetNextToken().c_str(), 256); - strncpy( host , tok.GetNextToken().c_str(), 256); - - //fprintf(stderr, "Registering user %s pass %s host %s\n", user, pass, host); - iaxc_register(user, pass, host); - } + RegisterFromString(dialog.GetValue()); } void IAXFrame::OnPTTChange(wxCommandEvent &evt) @@ -686,6 +697,8 @@ p.AddSwitch(_T("d"),_T("disable-dialpad"),_T("Disable Dial Pad")); p.AddOption(_T("n"),_T("calls"),_T("number of call appearances"), wxCMD_LINE_VAL_NUMBER,wxCMD_LINE_PARAM_OPTIONAL); + p.AddOption(_T("r"),_T("registration"),_T("Registration"), + wxCMD_LINE_VAL_STRING,wxCMD_LINE_PARAM_OPTIONAL); p.AddParam(_T("destination"),wxCMD_LINE_VAL_STRING,wxCMD_LINE_PARAM_OPTIONAL); } @@ -699,6 +712,9 @@ if(p.Found(_T("n"), &optNumCalls)) { //fprintf(stderr, "got nCalls (%d)", optNumCalls); } + if(p.Found(_T("r"), &optRegistration)) { + //fprintf(stderr, "got Registration (%s)", optRegistration.c_str()); + } if(p.GetParamCount() >= 1) { optDestination=p.GetParam(0); //fprintf(stderr, "dest is %s\n", optDestination.c_str()); @@ -729,6 +745,10 @@ iaxc_start_processing_thread(); + if(!optRegistration.IsEmpty()) { + theFrame->RegisterFromString(optRegistration); + } + if(!optDestination.IsEmpty()) iaxc_call((char *)optDestination.c_str()); |
From: <st...@us...> - 2003-07-03 18:17:18
|
Update of /cvsroot/iaxclient/iaxclient/simpleclient/testcall In directory sc8-pr-cvs1:/tmp/cvs-serv20738/simpleclient/testcall Modified Files: Makefile Log Message: FreeBSD build changes from Scott Lambert <la...@la...> Index: Makefile =================================================================== RCS file: /cvsroot/iaxclient/iaxclient/simpleclient/testcall/Makefile,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- Makefile 5 Jun 2003 14:59:22 -0000 1.5 +++ Makefile 3 Jul 2003 18:17:15 -0000 1.6 @@ -25,13 +25,23 @@ ifneq (,$(findstring MINGW,$(shell uname))) OSTYPE=WIN32 else +ifneq (,$(findstring FreeBSD,$(shell uname))) +OSTYPEREAL=FREEBSD +else $(warning OSTYPE cannot be detected, assuming Linux) +endif OSTYPE=LINUX endif endif endif endif +ifeq ($(OSTYPEREAL),FREEBSD) +MAKE=gmake +else +MAKE=make +endif + ifeq ($(OSTYPE),WIN32) EXEEXT=.exe SYSLIBS=-lwinmm -lwsock32 @@ -39,8 +49,12 @@ ifeq ($(OSTYPE),LINUX) CFLAGS:= $(CFLAGS) -DPOSIXSLEEP +ifeq ($(OSTYPEREAL),FREEBSD) +SYSLIBS=-lc_r -lm +else SYSLIBS=-lpthread -lm endif +endif ifeq ($(OSTYPE),MACOSX) CFLAGS:= $(CFLAGS) -DPOSIXSLEEP @@ -55,10 +69,10 @@ rm -f $(OBJS) $(PROGS) makelib: - (cd ../../lib; make libiaxclient.a) + (cd ../../lib; $(MAKE) libiaxclient.a) ../../lib/libiaxclient.a: - (cd ../../lib; make libiaxclient.a) + (cd ../../lib; $(MAKE) libiaxclient.a) testcall$(EXEEXT): $(OBJS) $(LIBS) gcc $(OBJS) $(LIBS) $(SYSLIBS) -o testcall$(EXEEXT) |
From: <st...@us...> - 2003-07-03 18:17:18
|
Update of /cvsroot/iaxclient/iaxclient/lib/portaudio/pa_unix_oss In directory sc8-pr-cvs1:/tmp/cvs-serv20738/lib/portaudio/pa_unix_oss Modified Files: pa_unix_oss.c Log Message: FreeBSD build changes from Scott Lambert <la...@la...> Index: pa_unix_oss.c =================================================================== RCS file: /cvsroot/iaxclient/iaxclient/lib/portaudio/pa_unix_oss/pa_unix_oss.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- pa_unix_oss.c 14 Apr 2003 23:47:16 -0000 1.1 +++ pa_unix_oss.c 3 Jul 2003 18:17:15 -0000 1.2 @@ -43,7 +43,11 @@ #ifdef __linux__ #include <linux/soundcard.h> #else +#ifdef __FreeBSD__ +#include <sys/soundcard.h> +#else #include <machine/soundcard.h> /* JH20010905 */ +#endif #endif |
From: <st...@us...> - 2003-07-03 18:17:17
|
Update of /cvsroot/iaxclient/iaxclient/lib/libiax/src In directory sc8-pr-cvs1:/tmp/cvs-serv20738/lib/libiax/src Modified Files: iax.c md5.c Log Message: FreeBSD build changes from Scott Lambert <la...@la...> Index: iax.c =================================================================== RCS file: /cvsroot/iaxclient/iaxclient/lib/libiax/src/iax.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- iax.c 30 May 2003 19:27:05 -0000 1.4 +++ iax.c 3 Jul 2003 18:17:14 -0000 1.5 @@ -49,10 +49,14 @@ #include <arpa/inet.h> #include <time.h> #ifdef LINUX +#ifdef __FreeBSD__ +#include <err.h> +#else #include <malloc.h> #include <error.h> #endif #endif +#endif #include "frame.h" #include "iax-client.h" @@ -211,7 +215,11 @@ #else /* Linux, and others */ +#if __FreeBSD__ +#define SENDSOCKOPTS MSG_DONTWAIT | SO_NOSIGPIPE +#else #define SENDSOCKOPTS MSG_DONTWAIT | MSG_NOSIGNAL +#endif #endif #endif Index: md5.c =================================================================== RCS file: /cvsroot/iaxclient/iaxclient/lib/libiax/src/md5.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -d -r1.1.1.1 -r1.2 --- md5.c 14 Mar 2003 15:34:52 -0000 1.1.1.1 +++ md5.c 3 Jul 2003 18:17:14 -0000 1.2 @@ -1,7 +1,7 @@ /* MD5 checksum routines used for authentication. Not covered by GPL, but in the public domain as per the copyright below */ -#ifdef FREEBSD +#ifdef __FreeBSD__ # include <machine/endian.h> #elif defined(LINUX) # include <endian.h> |
From: <st...@us...> - 2003-07-03 18:17:17
|
Update of /cvsroot/iaxclient/iaxclient/lib In directory sc8-pr-cvs1:/tmp/cvs-serv20738/lib Modified Files: iaxclient_lib.h Log Message: FreeBSD build changes from Scott Lambert <la...@la...> Index: iaxclient_lib.h =================================================================== RCS file: /cvsroot/iaxclient/iaxclient/lib/iaxclient_lib.h,v retrieving revision 1.17 retrieving revision 1.18 diff -u -d -r1.17 -r1.18 --- iaxclient_lib.h 17 Jun 2003 22:53:28 -0000 1.17 +++ iaxclient_lib.h 3 Jul 2003 18:17:14 -0000 1.18 @@ -18,6 +18,7 @@ #include <sys/socket.h> #include <netinet/in.h> #include <sys/time.h> +#include <pthread.h> #endif #include <stdio.h> |
From: <st...@us...> - 2003-07-03 18:17:17
|
Update of /cvsroot/iaxclient/iaxclient In directory sc8-pr-cvs1:/tmp/cvs-serv20738 Modified Files: README Log Message: FreeBSD build changes from Scott Lambert <la...@la...> Index: README =================================================================== RCS file: /cvsroot/iaxclient/iaxclient/README,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- README 13 Jun 2003 22:48:23 -0000 1.2 +++ README 3 Jul 2003 18:17:14 -0000 1.3 @@ -83,7 +83,8 @@ Steve Kann <st...@st...> Shawn Lawrence <sha...@te...> -Faizan "Tili" Naqvi <fa...@ti...> +Faizan "Tili" Naqvi <fa...@ti...> [Win32 VC++ build/client] +Scott Lambert <la...@la...> [FreeBSD build changes] In addition to including libiax, IAXCLIENT is also based in part on code included in test clients within libiax itself. @@ -98,6 +99,7 @@ BUILDING THE LIBRARY: Linux: type "make" using standard gnu make/gcc +FreeBSD: type "gmake" using standard gnu make/gcc MacOSX: type "make" using Apple Dev Tools (gnu make/gcc) Win32: type "make" using Cygwin/MinGW (see below) |
From: <st...@us...> - 2003-07-02 18:41:06
|
Update of /cvsroot/iaxclient/iaxclient/simpleclient/wx In directory sc8-pr-cvs1:/tmp/cvs-serv9055 Modified Files: README Log Message: wx/Win32 build directions from Michael Van Donselaar <mv...@va...> Index: README =================================================================== RCS file: /cvsroot/iaxclient/iaxclient/simpleclient/wx/README,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- README 13 Jun 2003 16:12:44 -0000 1.1 +++ README 2 Jul 2003 18:41:03 -0000 1.2 @@ -40,4 +40,61 @@ ============================================================= +Building WXWindows on Win32, with MinGW/Cygwin: + +These were the steps taken by +Michael Van Donselaar <mv...@va...> to build wx on +his box, and are similar to what were taken for the initial development: + +(Thanks to Michael for contributing these directions) +After tearing out what little hair I have left, I've finally gotten this +figured out. + +The two things that bit me were a borken make in minGW and using +./configure to configure wxWindows. + +The docs in wxWindows say there's two ways to compile: directly with +the makefiles, or using configure. ./configure is your friend right? +Wrong. Use the makefiles directly. + +I have verified the following for WinXP and for Win2000. Steve, feel +free to include these in your README. + +1) Download and run setup.exe from www.cygwin.com. + Install the base plus Devel/make. + *** You need to use the make from cygwin *** + The make in MinGW extras is borken. + +2) Download MinGW-2.0.0-3.exe from www.mingw.org. + Install, accepting defaults + +3) Download wxMSW-2.4.1-setup.zip from wxwindows.org + Install to the default directory, c:\wxWindows-2.4.1 + +4) Configure the WXWIN environment variable and add cygwin/minGW paths: + Right click "My Computer". Click Properties. Click "Advanced" tab + Click "Environment Variables" + Prepend "C:\mingw\bin;c:\cygwin\bin;" to the path + Create a WXWIN env variable with value "c:/wxwin-2.4.1" (Note the + forward slash, rather than back slash.) + +5) Compile the wxWindows library. The docs outline two methods. + *** DO NOT ./confgure -- USE THE MAKEFILES DIRECTLY *** + Start a cygwin session. + cd c:/wxwindows-2.4.1/src/msw + make -f makefile.g95 + +6) Test the wxWindows library: + cd c:/wxwindows-2.4.1/samples/minimal + make -f makefile.g95 minimal + ./minimal.exe + +7) Install the iaxclient sources in /usr/src/iaxclient + cd /usr/src/iaxclient/simpleclient/wx + make + strip wx + ./wx.exe +========================================================= + + |
From: <st...@us...> - 2003-06-23 19:29:06
|
Update of /cvsroot/iaxclient/iaxclient/lib In directory sc8-pr-cvs1:/tmp/cvs-serv20354/lib Modified Files: iaxclient_lib.c Log Message: change "select" behavior a bit. Now, one call is always selected (no more -1 sentinel), and stuff just checks if it's active. Index: iaxclient_lib.c =================================================================== RCS file: /cvsroot/iaxclient/iaxclient/lib/iaxclient_lib.c,v retrieving revision 1.28 retrieving revision 1.29 diff -u -d -r1.28 -r1.29 --- iaxclient_lib.c 23 Jun 2003 13:32:18 -0000 1.28 +++ iaxclient_lib.c 23 Jun 2003 19:29:03 -0000 1.29 @@ -143,10 +143,10 @@ iaxc_post_event(e); } -static int iaxc_next_free_call() { +static int iaxc_first_free_call() { int i; for(i=0;i<nCalls;i++) - if(calls[i].session==NULL) + if(calls[i].state == IAXC_CALL_STATE_FREE) return i; return -1; @@ -154,47 +154,41 @@ static int iaxc_clear_call(int toDump) { - if(selected_call == toDump) iaxc_select_call(-1); - // XXX libiax should handle cleanup, I think.. - calls[toDump].session = NULL; calls[toDump].state = IAXC_CALL_STATE_FREE; + calls[toDump].session = NULL; iaxc_do_state_callback(toDump); } -/* select a call. -1 == no call */ +/* select a call. */ /* XXX Locking?? Start/stop audio?? */ int iaxc_select_call(int callNo) { - if(callNo < -1 || callNo >= nCalls) { - iaxc_usermsg(IAXC_ERROR, "Error: tried to select out_of_range call %d", callNo); - return -1; - } - if(!calls[callNo].session) { - iaxc_usermsg(IAXC_ERROR, "Error: tried to select inactive call", callNo); + // continue if already selected? + //if(callNo == selected_call) return; + + if(callNo < 0 || callNo >= nCalls) { + iaxc_usermsg(IAXC_ERROR, "Error: tried to select out_of_range call %d", callNo); return -1; } - - if(selected_call >= 0) { + + // de-select old call if not also the new call + if(callNo != selected_call) { calls[selected_call].state &= ~IAXC_CALL_STATE_SELECTED; + selected_call = callNo; iaxc_do_state_callback(selected_call); - } - selected_call = callNo; - - if(callNo >= 0) { calls[callNo].state |= IAXC_CALL_STATE_SELECTED; + } - // if it's an incoming call, and ringing, answer it. - if( !(calls[selected_call].state & IAXC_CALL_STATE_OUTGOING) && - (calls[selected_call].state & IAXC_CALL_STATE_RINGING)) { - iaxc_answer_call(selected_call); - } else { - // otherwise just update state (answer does this for us) - iaxc_do_state_callback(selected_call); - } - // should do callback to say all are unselected... + // if it's an incoming call, and ringing, answer it. + if( !(calls[selected_call].state & IAXC_CALL_STATE_OUTGOING) && + (calls[selected_call].state & IAXC_CALL_STATE_RINGING)) { + iaxc_answer_call(selected_call); + } else { + // otherwise just update state (answer does this for us) + iaxc_do_state_callback(selected_call); } } @@ -232,7 +226,7 @@ return -1; } iAudioType = audType; - selected_call = -1; + selected_call = 0; gettimeofday(&lastouttm,NULL); switch (iAudioType) { @@ -351,9 +345,10 @@ int service_audio() { - /* do audio input stuff for buffers that have received data from audio in device already. Must - do them in serial number order (the order in which they were originally queued). */ - if(selected_call >= 0) /* send audio only if call answered */ + /* send audio only if incoming call answered, or outgoing call + * selected. */ + if( (calls[selected_call].state & IAXC_CALL_STATE_OUTGOING) + || (calls[selected_call].state & IAXC_CALL_STATE_COMPLETE)) { switch (iAudioType) { case AUDIO_INTERNAL: @@ -515,16 +510,25 @@ int callNo; struct iax_session *newsession; - callNo = iaxc_next_free_call(); + MUTEXLOCK(&iaxc_lock); + + // use selected call if not active, otherwise, get a new + // appearance + if(calls[selected_call].state & IAXC_CALL_STATE_ACTIVE) { + callNo = iaxc_first_free_call(); + } else { + callNo = selected_call; + } + if(callNo < 0) { iaxc_usermsg(IAXC_STATUS, "No free call appearances"); - return; + goto iaxc_call_bail; } newsession = iax_session_new(); if(!newsession) { iaxc_usermsg(IAXC_ERROR, "Can't make new session"); - return; + goto iaxc_call_bail; } calls[callNo].session = newsession; @@ -543,8 +547,11 @@ iax_call(calls[callNo].session, "7001234567", num, NULL, 10); #endif - // does state stuff + // does state stuff also iaxc_select_call(callNo); + +iaxc_call_bail: + MUTEXUNLOCK(&iaxc_lock); } void iaxc_answer_call(int callNo) @@ -577,14 +584,8 @@ void iaxc_dump_call(void) { - int toDump; MUTEXLOCK(&iaxc_lock); - toDump = selected_call; - if(toDump < 0) { - iaxc_usermsg(IAXC_ERROR, "Error: tried to dump but no call selected"); - } else { - iaxc_dump_one_call(selected_call); - } + iaxc_dump_one_call(selected_call); MUTEXUNLOCK(&iaxc_lock); } @@ -600,7 +601,7 @@ void iaxc_send_dtmf(char digit) { MUTEXLOCK(&iaxc_lock); - if(selected_call >= 0) + if(calls[selected_call].state & IAXC_CALL_STATE_ACTIVE) iax_send_dtmf(calls[selected_call].session,digit); MUTEXUNLOCK(&iaxc_lock); } @@ -705,7 +706,7 @@ iaxc_usermsg(IAXC_ERROR, "Registration requested by someone, but we don't understand!"); } else if(e->etype == IAX_EVENT_CONNECT) { - callNo = iaxc_next_free_call(); + callNo = iaxc_first_free_call(); if(callNo < 0) { iaxc_usermsg(IAXC_STATUS, "Incoming Call, but no appearances"); |
From: <st...@us...> - 2003-06-23 13:32:22
|
Update of /cvsroot/iaxclient/iaxclient/lib In directory sc8-pr-cvs1:/tmp/cvs-serv24772/lib Modified Files: audio_portaudio.c audio_portaudio.h iaxclient_lib.c Log Message: late commit. Proper cast/types, plus fix tiny race. Index: audio_portaudio.c =================================================================== RCS file: /cvsroot/iaxclient/iaxclient/lib/audio_portaudio.c,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- audio_portaudio.c 20 Jun 2003 23:38:25 -0000 1.11 +++ audio_portaudio.c 23 Jun 2003 13:32:18 -0000 1.12 @@ -195,7 +195,7 @@ mono2stereo(stereobuf, (SAMPLE *)fr, FRAMES_PER_BLOCK); buf = stereobuf; } else { - buf = (short *)fr; + buf = (SAMPLE *)fr; } // Play the audio as decoded Index: audio_portaudio.h =================================================================== RCS file: /cvsroot/iaxclient/iaxclient/lib/audio_portaudio.h,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- audio_portaudio.h 16 Jun 2003 23:01:29 -0000 1.7 +++ audio_portaudio.h 23 Jun 2003 13:32:18 -0000 1.8 @@ -19,7 +19,7 @@ #define FRAMES_PER_BLOCK (160) /* Select whether we will use floats or shorts. */ -#if 1 +#if 0 #define SAMPLE_TYPE paFloat32 typedef float SAMPLE; #else Index: iaxclient_lib.c =================================================================== RCS file: /cvsroot/iaxclient/iaxclient/lib/iaxclient_lib.c,v retrieving revision 1.27 retrieving revision 1.28 diff -u -d -r1.27 -r1.28 --- iaxclient_lib.c 20 Jun 2003 23:17:22 -0000 1.27 +++ iaxclient_lib.c 23 Jun 2003 13:32:18 -0000 1.28 @@ -577,8 +577,9 @@ void iaxc_dump_call(void) { - int toDump = selected_call; + int toDump; MUTEXLOCK(&iaxc_lock); + toDump = selected_call; if(toDump < 0) { iaxc_usermsg(IAXC_ERROR, "Error: tried to dump but no call selected"); } else { |
From: <st...@us...> - 2003-06-20 23:38:28
|
Update of /cvsroot/iaxclient/iaxclient/lib In directory sc8-pr-cvs1:/tmp/cvs-serv23843 Modified Files: audio_portaudio.c Log Message: take 2. notes inside. Oh the pains of unix/oss :( Index: audio_portaudio.c =================================================================== RCS file: /cvsroot/iaxclient/iaxclient/lib/audio_portaudio.c,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- audio_portaudio.c 20 Jun 2003 23:09:04 -0000 1.10 +++ audio_portaudio.c 20 Jun 2003 23:38:25 -0000 1.11 @@ -74,13 +74,32 @@ } } + +/* some commentaty here: + * 1: MacOSX: MacOSX needs "virtual mono" and a single stream. That's + * really the only choice there, and it should always work (Famous last + * words). + * + * 2: Unix/OSS: most cards are OK with real mono, and a single stream. + * Except some. For those, a single open with real mono will succeed, + * but execution will fail. Maybe others will open OK with a single + * stream, and real mono, but fail later? + * + * The failure mode I saw with a volunteer was that reads/writes would + * return -enodev (down in the portaudio code). Bummer. + * + * Win32 works fine, in all cases, with a single stream and real mono, + * so far. + * */ + int pa_initialize_audio() { PaError err; -//#if 0 -#ifndef MACOSX /* Open simplified blocking I/O layer on top of PortAudio. */ + +#ifndef MACOSX /* first, try opening one stream for in/out, Mono */ + /* except for MacOSX, which needs virtual stereo */ err = OpenAudioStream( &iStream, SAMPLE_RATE, paInt16, (PABLIO_READ | PABLIO_WRITE | PABLIO_MONO) ); @@ -93,8 +112,9 @@ } #endif - /* Open simplified blocking I/O layer on top of PortAudio. */ - /* first, try opening one stream for in/out, Mono */ +#ifndef LINUX + /* then, we try a single stream, virtual stereo. Except on linux, + * see note above */ err = OpenAudioStream( &iStream, SAMPLE_RATE, paInt16, (PABLIO_READ | PABLIO_WRITE | PABLIO_STEREO) ); @@ -105,22 +125,25 @@ virtualMono = 1; return 0; } +#endif -#if TRY_TWO_OPENS + /* finally, we go to the worst case. Two opens, virtual mono */ oneStream = 0; + virtualMono = 1; err = OpenAudioStream( &iStream, SAMPLE_RATE, paInt16, - (PABLIO_READ | PABLIO_MONO) ); + (PABLIO_READ | PABLIO_STEREO) ); + if( err != paNoError ) { handle_paerror(err, "opening separate input stream"); return -1; } err = OpenAudioStream( &oStream, SAMPLE_RATE, paInt16, - (PABLIO_READ | PABLIO_MONO) ); + (PABLIO_WRITE | PABLIO_STEREO) ); + if( err != paNoError ) { handle_paerror(err, "opening separate output stream"); return -1; } -#endif return 0; } |
From: <st...@us...> - 2003-06-20 23:17:25
|
Update of /cvsroot/iaxclient/iaxclient/lib In directory sc8-pr-cvs1:/tmp/cvs-serv21572 Modified Files: iaxclient_lib.c Log Message: should not hangup in response to hangup. Index: iaxclient_lib.c =================================================================== RCS file: /cvsroot/iaxclient/iaxclient/lib/iaxclient_lib.c,v retrieving revision 1.26 retrieving revision 1.27 diff -u -d -r1.26 -r1.27 --- iaxclient_lib.c 19 Jun 2003 23:50:44 -0000 1.26 +++ iaxclient_lib.c 20 Jun 2003 23:17:22 -0000 1.27 @@ -441,10 +441,6 @@ switch(e->etype) { case IAX_EVENT_HANGUP: -#ifndef IAXC_IAX2 /* IAX2 barfs from this. Should we do this or not? */ - - iax_hangup(calls[callNo].session, "Byeee!"); -#endif iaxc_usermsg(IAXC_STATUS, "Call disconnected by remote"); // XXX does the session go away now? iaxc_clear_call(callNo); |
From: <st...@us...> - 2003-06-20 23:09:07
|
Update of /cvsroot/iaxclient/iaxclient/lib In directory sc8-pr-cvs1:/tmp/cvs-serv20515 Modified Files: audio_portaudio.c Log Message: virtual mono mode. forced on MACOSX, used when mono fails to open on others (like OSS). Index: audio_portaudio.c =================================================================== RCS file: /cvsroot/iaxclient/iaxclient/lib/audio_portaudio.c,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- audio_portaudio.c 20 Jun 2003 13:23:05 -0000 1.9 +++ audio_portaudio.c 20 Jun 2003 23:09:04 -0000 1.10 @@ -25,6 +25,7 @@ static PABLIO_Stream *iStream; static PABLIO_Stream *oStream; static int oneStream; +static int virtualMono; static const PaDeviceInfo **inputDevices; static const PaDeviceInfo **outputDevices; static int nInputDevices; @@ -76,8 +77,10 @@ int pa_initialize_audio() { PaError err; +//#if 0 +#ifndef MACOSX /* Open simplified blocking I/O layer on top of PortAudio. */ - /* first, try opening one stream for in/out */ + /* first, try opening one stream for in/out, Mono */ err = OpenAudioStream( &iStream, SAMPLE_RATE, paInt16, (PABLIO_READ | PABLIO_WRITE | PABLIO_MONO) ); @@ -85,9 +88,25 @@ /* if this works, set iStream, oStream to this stream */ oStream = iStream; oneStream = 1; + virtualMono = 0; return 0; } +#endif + /* Open simplified blocking I/O layer on top of PortAudio. */ + /* first, try opening one stream for in/out, Mono */ + err = OpenAudioStream( &iStream, SAMPLE_RATE, paInt16, + (PABLIO_READ | PABLIO_WRITE | PABLIO_STEREO) ); + + if( err == paNoError ) { + /* if this works, set iStream, oStream to this stream */ + oStream = iStream; + oneStream = 1; + virtualMono = 1; + return 0; + } + +#if TRY_TWO_OPENS oneStream = 0; err = OpenAudioStream( &iStream, SAMPLE_RATE, paInt16, (PABLIO_READ | PABLIO_MONO) ); @@ -101,6 +120,7 @@ handle_paerror(err, "opening separate output stream"); return -1; } +#endif return 0; } @@ -118,25 +138,63 @@ } + +void mono2stereo(SAMPLE *out, SAMPLE *in, int nSamples) { + int i; + //fprintf(stderr, "mono2stereo: %d samples\n", nSamples); + for(i=0;i<nSamples;i++) { + *(out++) = *in; + *(out++) = *(in++); + } +} + +void stereo2mono(SAMPLE *out, SAMPLE *in, int nSamples) { + int i; + //fprintf(stderr, "stereo2mono: %d samples\n", nSamples); + for(i=0;i<nSamples;i++) { + *(out) = *(in++); + out++; in++; + //*(out++) += *(in++); + } +} + void pa_play_recv_audio(void *fr, int fr_size) { - if(GetAudioStreamWriteable(oStream) < SAMPLES_PER_FRAME * FRAMES_PER_BLOCK) + + SAMPLE stereobuf[FRAMES_PER_BLOCK * 2]; + SAMPLE *buf; + if(GetAudioStreamWriteable(oStream) < FRAMES_PER_BLOCK) { //fprintf(stderr, "audio_portaudio: audio output overflow\n"); return; } + if(virtualMono) { + mono2stereo(stereobuf, (SAMPLE *)fr, FRAMES_PER_BLOCK); + buf = stereobuf; + } else { + buf = (short *)fr; + } + // Play the audio as decoded - WriteAudioStream(oStream, fr, SAMPLES_PER_FRAME * FRAMES_PER_BLOCK); + WriteAudioStream(oStream, buf, FRAMES_PER_BLOCK); } void pa_send_audio(struct timeval *lastouttm, struct iaxc_call *most_recent_answer, int iEncodeType) { - SAMPLE samples[SAMPLES_PER_FRAME * FRAMES_PER_BLOCK]; + SAMPLE samples[FRAMES_PER_BLOCK * 2]; // could be stereo + SAMPLE monobuf[FRAMES_PER_BLOCK]; + SAMPLE *buf; /* send all available complete frames */ - while(GetAudioStreamReadable(iStream) >= FRAMES_PER_BLOCK) + while(GetAudioStreamReadable(iStream) >= (FRAMES_PER_BLOCK)) { ReadAudioStream(iStream, samples, FRAMES_PER_BLOCK); - send_encoded_audio(most_recent_answer, samples, iEncodeType); + if(virtualMono) { + stereo2mono(monobuf, samples, FRAMES_PER_BLOCK); + buf = monobuf; + } else { + buf = samples; + } + send_encoded_audio(most_recent_answer, buf, iEncodeType); } } |
From: <st...@us...> - 2003-06-20 13:23:09
|
Update of /cvsroot/iaxclient/iaxclient/lib In directory sc8-pr-cvs1:/tmp/cvs-serv18308 Modified Files: audio_portaudio.c Log Message: try opening separate streams, if opening a single stream fails. Index: audio_portaudio.c =================================================================== RCS file: /cvsroot/iaxclient/iaxclient/lib/audio_portaudio.c,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- audio_portaudio.c 16 Jun 2003 23:01:29 -0000 1.8 +++ audio_portaudio.c 20 Jun 2003 13:23:05 -0000 1.9 @@ -22,7 +22,9 @@ #include "iaxclient_lib.h" -static PABLIO_Stream *stream; +static PABLIO_Stream *iStream; +static PABLIO_Stream *oStream; +static int oneStream; static const PaDeviceInfo **inputDevices; static const PaDeviceInfo **outputDevices; static int nInputDevices; @@ -75,17 +77,37 @@ PaError err; /* Open simplified blocking I/O layer on top of PortAudio. */ - err = OpenAudioStream( &stream, SAMPLE_RATE, paInt16, + /* first, try opening one stream for in/out */ + err = OpenAudioStream( &iStream, SAMPLE_RATE, paInt16, (PABLIO_READ | PABLIO_WRITE | PABLIO_MONO) ); - if( err != paNoError ) { - handle_paerror(err, "opening stream"); - return -1; + + if( err == paNoError ) { + /* if this works, set iStream, oStream to this stream */ + oStream = iStream; + oneStream = 1; + return 0; + } + + oneStream = 0; + err = OpenAudioStream( &iStream, SAMPLE_RATE, paInt16, + (PABLIO_READ | PABLIO_MONO) ); + { + handle_paerror(err, "opening separate input stream"); + return -1; } + err = OpenAudioStream( &oStream, SAMPLE_RATE, paInt16, + (PABLIO_READ | PABLIO_MONO) ); + { + handle_paerror(err, "opening separate output stream"); + return -1; + } + return 0; } void pa_shutdown_audio() { - CloseAudioStream( stream ); + CloseAudioStream( iStream ); + if(!oneStream) CloseAudioStream( oStream ); } void handle_paerror(PaError err, char * where) { @@ -97,23 +119,23 @@ } void pa_play_recv_audio(void *fr, int fr_size) { - if(GetAudioStreamWriteable(stream) < SAMPLES_PER_FRAME * FRAMES_PER_BLOCK) + if(GetAudioStreamWriteable(oStream) < SAMPLES_PER_FRAME * FRAMES_PER_BLOCK) { - fprintf(stderr, "audio_portaudio: audio output overflow\n"); + //fprintf(stderr, "audio_portaudio: audio output overflow\n"); return; } // Play the audio as decoded - WriteAudioStream(stream, fr, SAMPLES_PER_FRAME * FRAMES_PER_BLOCK); + WriteAudioStream(oStream, fr, SAMPLES_PER_FRAME * FRAMES_PER_BLOCK); } void pa_send_audio(struct timeval *lastouttm, struct iaxc_call *most_recent_answer, int iEncodeType) { SAMPLE samples[SAMPLES_PER_FRAME * FRAMES_PER_BLOCK]; /* send all available complete frames */ - while(GetAudioStreamReadable(stream) >= FRAMES_PER_BLOCK) + while(GetAudioStreamReadable(iStream) >= FRAMES_PER_BLOCK) { - ReadAudioStream(stream, samples, FRAMES_PER_BLOCK); + ReadAudioStream(iStream, samples, FRAMES_PER_BLOCK); send_encoded_audio(most_recent_answer, samples, iEncodeType); } } |
From: <st...@us...> - 2003-06-19 23:50:49
|
Update of /cvsroot/iaxclient/iaxclient/lib In directory sc8-pr-cvs1:/tmp/cvs-serv18383/lib Modified Files: iaxclient_lib.c Log Message: lib: remove one debug fprintf wx: add some colors to calls. Index: iaxclient_lib.c =================================================================== RCS file: /cvsroot/iaxclient/iaxclient/lib/iaxclient_lib.c,v retrieving revision 1.25 retrieving revision 1.26 diff -u -d -r1.25 -r1.26 --- iaxclient_lib.c 19 Jun 2003 19:09:52 -0000 1.25 +++ iaxclient_lib.c 19 Jun 2003 23:50:44 -0000 1.26 @@ -553,7 +553,7 @@ void iaxc_answer_call(int callNo) { - fprintf(stderr, "iaxc answering call %d\n", callNo); + //fprintf(stderr, "iaxc answering call %d\n", callNo); calls[callNo].state |= IAXC_CALL_STATE_COMPLETE; calls[callNo].state &= ~IAXC_CALL_STATE_RINGING; iax_answer(calls[callNo].session); |
From: <st...@us...> - 2003-06-19 23:50:49
|
Update of /cvsroot/iaxclient/iaxclient/simpleclient/wx In directory sc8-pr-cvs1:/tmp/cvs-serv18383/simpleclient/wx Modified Files: wx.cc Log Message: lib: remove one debug fprintf wx: add some colors to calls. Index: wx.cc =================================================================== RCS file: /cvsroot/iaxclient/iaxclient/simpleclient/wx/wx.cc,v retrieving revision 1.37 retrieving revision 1.38 diff -u -d -r1.37 -r1.38 --- wx.cc 19 Jun 2003 19:09:07 -0000 1.37 +++ wx.cc 19 Jun 2003 23:50:44 -0000 1.38 @@ -127,6 +127,8 @@ item.m_mask = wxLIST_MASK_TEXT | wxLIST_MASK_IMAGE; item.m_image = -1; item.m_text = _T("Call"); + item.SetTextColour(*wxLIGHT_GREY); + item.SetBackgroundColour(*wxWHITE); InsertColumn(0, item); item.m_text = _T("State"); InsertColumn(1, item); @@ -136,9 +138,14 @@ Hide(); for(i=0;i<nCalls;i++) { InsertItem(i,wxString::Format("%ld", i+1), 0); - // XXX ??? SetItemData(tmp,i); SetItem(i, 2, _T("No call")); + item.m_itemId=i; + item.m_mask = 0; + item.SetTextColour(*wxLIGHT_GREY); + item.SetBackgroundColour(*wxWHITE); + SetItem(item); } + Refresh(); Show(); AutoSize(); } @@ -184,20 +191,34 @@ int IAXCalls::HandleStateEvent(struct iaxc_ev_call_state c) { + wxListItem stateItem; // for all the state color + + stateItem.m_itemId = c.callNo; // first, handle inactive calls if(!(c.state & IAXC_CALL_STATE_ACTIVE)) { //fprintf(stderr, "state for item %d is free\n", c.callNo); SetItem(c.callNo, 2, _T("No call") ); SetItem(c.callNo, 1, _T("") ); + stateItem.SetTextColour(*wxLIGHT_GREY); + stateItem.SetBackgroundColour(*wxWHITE); } else { // set remote SetItem(c.callNo, 2, c.remote ); + bool outgoing = c.state & IAXC_CALL_STATE_OUTGOING; bool ringing = c.state & IAXC_CALL_STATE_RINGING; bool complete = c.state & IAXC_CALL_STATE_COMPLETE; + if( ringing && !outgoing ) { + stateItem.SetTextColour(*wxBLACK); + stateItem.SetBackgroundColour(*wxRED); + } else { + stateItem.SetTextColour(*wxBLUE); + stateItem.SetBackgroundColour(*wxWHITE); + } + if(outgoing) { if(ringing) SetItem(c.callNo, 1, _T("r") ); @@ -215,7 +236,8 @@ } // XXX do something more noticable if it's incoming, ringing! } - + + SetItem( stateItem ); // select if necessary if((c.state & IAXC_CALL_STATE_SELECTED) && @@ -225,6 +247,7 @@ SetItemState(c.callNo,wxLIST_STATE_SELECTED,wxLIST_STATE_SELECTED); } AutoSize(); + Refresh(); return 0; } |
From: <st...@us...> - 2003-06-19 19:09:55
|
Update of /cvsroot/iaxclient/iaxclient/lib In directory sc8-pr-cvs1:/tmp/cvs-serv958 Modified Files: iaxclient.h iaxclient_lib.c Log Message: add iaxc_dump_all_calls API, for cleanup. Index: iaxclient.h =================================================================== RCS file: /cvsroot/iaxclient/iaxclient/lib/iaxclient.h,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- iaxclient.h 17 Jun 2003 22:53:27 -0000 1.13 +++ iaxclient.h 19 Jun 2003 19:09:52 -0000 1.14 @@ -100,6 +100,7 @@ void iaxc_call(char *num); void iaxc_register(char *user, char *pass, char *host); void iaxc_answer_call(int callNo); +void iaxc_dump_all_calls(void); void iaxc_dump_call(void); void iaxc_reject_call(void); void iaxc_send_dtmf(char digit); Index: iaxclient_lib.c =================================================================== RCS file: /cvsroot/iaxclient/iaxclient/lib/iaxclient_lib.c,v retrieving revision 1.24 retrieving revision 1.25 diff -u -d -r1.24 -r1.25 --- iaxclient_lib.c 18 Jun 2003 16:39:18 -0000 1.24 +++ iaxclient_lib.c 19 Jun 2003 19:09:52 -0000 1.25 @@ -252,6 +252,7 @@ void iaxc_shutdown() { MUTEXLOCK(&iaxc_lock); + iaxc_dump_all_calls(); switch (iAudioType) { case AUDIO_INTERNAL: #ifdef USE_WIN_AUDIO @@ -559,6 +560,25 @@ iaxc_do_state_callback(callNo); } +static void iaxc_dump_one_call(int callNo) +{ + if(calls[callNo].state == IAXC_CALL_STATE_FREE) return; + + iax_hangup(calls[callNo].session,"Dumped Call"); + iaxc_usermsg(IAXC_STATUS, "Hanging up call %d", callNo); + iaxc_clear_call(callNo); +} + +void iaxc_dump_all_calls(void) +{ + int callNo; + MUTEXLOCK(&iaxc_lock); + for(callNo=0; callNo<nCalls; callNo++) + iaxc_dump_one_call(callNo); + MUTEXUNLOCK(&iaxc_lock); +} + + void iaxc_dump_call(void) { int toDump = selected_call; @@ -566,9 +586,7 @@ if(toDump < 0) { iaxc_usermsg(IAXC_ERROR, "Error: tried to dump but no call selected"); } else { - iax_hangup(calls[selected_call].session,"Dumped Call"); - iaxc_usermsg(IAXC_STATUS, "Hanging up call %d", toDump); - iaxc_clear_call(toDump); + iaxc_dump_one_call(selected_call); } MUTEXUNLOCK(&iaxc_lock); } |
From: <st...@us...> - 2003-06-19 19:09:10
|
Update of /cvsroot/iaxclient/iaxclient/simpleclient/wx In directory sc8-pr-cvs1:/tmp/cvs-serv805 Modified Files: wx.cc Log Message: put all cleanup in main frame destructor, and have onQuit handler just close the frame. Index: wx.cc =================================================================== RCS file: /cvsroot/iaxclient/iaxclient/simpleclient/wx/wx.cc,v retrieving revision 1.36 retrieving revision 1.37 diff -u -d -r1.36 -r1.37 --- wx.cc 18 Jun 2003 21:18:11 -0000 1.36 +++ wx.cc 19 Jun 2003 19:09:07 -0000 1.37 @@ -488,12 +488,7 @@ void IAXFrame::OnQuit(wxEvent &evt) { - iaxc_dump_call(); - for(int i=0;i<10;i++) { - iaxc_millisleep(100); - } - iaxc_stop_processing_thread(); - exit(0); + Close(TRUE); } void IAXFrame::OnRegisterMenu(wxCommandEvent &evt) { @@ -652,13 +647,12 @@ IAXFrame::~IAXFrame() { -#ifdef __WXGTK__ -#if 0 - // apparently, I'm not supposed to destroy this, cause it's a "root" window - gdk_window_destroy(keyStateWindow); -#endif -#endif + iaxc_dump_all_calls(); + for(int i=0;i<10;i++) { + iaxc_millisleep(100); + } iaxc_stop_processing_thread(); + exit(0); iaxc_shutdown(); } |
Update of /cvsroot/iaxclient/iaxclient/lib/gsm/src In directory sc8-pr-cvs1:/tmp/cvs-serv14925/src Modified Files: add.c code.c debug.c decode.c gsm_create.c gsm_decode.c gsm_destroy.c gsm_encode.c gsm_explode.c gsm_implode.c gsm_option.c gsm_print.c k6opt.h long_term.c lpc.c preprocess.c rpe.c short_term.c table.c Log Message: change things back to LF only line termination. (broke some compiles with CRLF). Index: add.c =================================================================== RCS file: /cvsroot/iaxclient/iaxclient/lib/gsm/src/add.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -d -r1.1.1.1 -r1.2 --- add.c 14 Mar 2003 15:34:52 -0000 1.1.1.1 +++ add.c 19 Jun 2003 14:03:25 -0000 1.2 @@ -1,235 +1,235 @@ -/* - * Copyright 1992 by Jutta Degener and Carsten Bormann, Technische - * Universitaet Berlin. See the accompanying file "COPYRIGHT" for - * details. THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. - */ - -/* $Header$ */ - -/* - * See private.h for the more commonly used macro versions. - */ - -#include <stdio.h> -#include <assert.h> - -#include "private.h" -#include "gsm.h" -#include "proto.h" - -#define saturate(x) \ - ((x) < MIN_WORD ? MIN_WORD : (x) > MAX_WORD ? MAX_WORD: (x)) - -word gsm_add P2((a,b), word a, word b) -{ - longword sum = (longword)a + (longword)b; - return saturate(sum); -} - -word gsm_sub P2((a,b), word a, word b) -{ - longword diff = (longword)a - (longword)b; - return saturate(diff); -} - -word gsm_mult P2((a,b), word a, word b) -{ - if (a == MIN_WORD && b == MIN_WORD) return MAX_WORD; - else return SASR( (longword)a * (longword)b, 15 ); -} - -word gsm_mult_r P2((a,b), word a, word b) -{ - if (b == MIN_WORD && a == MIN_WORD) return MAX_WORD; - else { - longword prod = (longword)a * (longword)b + 16384; - prod >>= 15; - return prod & 0xFFFF; - } -} - -word gsm_abs P1((a), word a) -{ - return a < 0 ? (a == MIN_WORD ? MAX_WORD : -a) : a; -} - -longword gsm_L_mult P2((a,b),word a, word b) -{ - assert( a != MIN_WORD || b != MIN_WORD ); - return ((longword)a * (longword)b) << 1; -} - -longword gsm_L_add P2((a,b), longword a, longword b) -{ - if (a < 0) { - if (b >= 0) return a + b; - else { - ulongword A = (ulongword)-(a + 1) + (ulongword)-(b + 1); - return A >= MAX_LONGWORD ? MIN_LONGWORD :-(longword)A-2; - } - } - else if (b <= 0) return a + b; - else { - ulongword A = (ulongword)a + (ulongword)b; - return A > MAX_LONGWORD ? MAX_LONGWORD : A; - } -} - -longword gsm_L_sub P2((a,b), longword a, longword b) -{ - if (a >= 0) { - if (b >= 0) return a - b; - else { - /* a>=0, b<0 */ - - ulongword A = (ulongword)a + -(b + 1); - return A >= MAX_LONGWORD ? MAX_LONGWORD : (A + 1); - } - } - else if (b <= 0) return a - b; - else { - /* a<0, b>0 */ - - ulongword A = (ulongword)-(a + 1) + b; - return A >= MAX_LONGWORD ? MIN_LONGWORD : -(longword)A - 1; - } -} - -static unsigned char const bitoff[ 256 ] = { - 8, 7, 6, 6, 5, 5, 5, 5, 4, 4, 4, 4, 4, 4, 4, 4, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 -}; - -word gsm_norm P1((a), longword a ) -/* - * the number of left shifts needed to normalize the 32 bit - * variable L_var1 for positive values on the interval - * - * with minimum of - * minimum of 1073741824 (01000000000000000000000000000000) and - * maximum of 2147483647 (01111111111111111111111111111111) - * - * - * and for negative values on the interval with - * minimum of -2147483648 (-10000000000000000000000000000000) and - * maximum of -1073741824 ( -1000000000000000000000000000000). - * - * in order to normalize the result, the following - * operation must be done: L_norm_var1 = L_var1 << norm( L_var1 ); - * - * (That's 'ffs', only from the left, not the right..) - */ -{ - assert(a != 0); - - if (a < 0) { - if (a <= -1073741824) return 0; - a = ~a; - } - - return a & 0xffff0000 - ? ( a & 0xff000000 - ? -1 + bitoff[ 0xFF & (a >> 24) ] - : 7 + bitoff[ 0xFF & (a >> 16) ] ) - : ( a & 0xff00 - ? 15 + bitoff[ 0xFF & (a >> 8) ] - : 23 + bitoff[ 0xFF & a ] ); -} - -longword gsm_L_asl P2((a,n), longword a, int n) -{ - if (n >= 32) return 0; - if (n <= -32) return -(a < 0); - if (n < 0) return gsm_L_asr(a, -n); - return a << n; -} - -word gsm_asl P2((a,n), word a, int n) -{ - if (n >= 16) return 0; - if (n <= -16) return -(a < 0); - if (n < 0) return gsm_asr(a, -n); - return a << n; -} - -longword gsm_L_asr P2((a,n), longword a, int n) -{ - if (n >= 32) return -(a < 0); - if (n <= -32) return 0; - if (n < 0) return a << -n; - -# ifdef SASR - return a >> n; -# else - if (a >= 0) return a >> n; - else return -(longword)( -(ulongword)a >> n ); -# endif -} - -word gsm_asr P2((a,n), word a, int n) -{ - if (n >= 16) return -(a < 0); - if (n <= -16) return 0; - if (n < 0) return a << -n; - -# ifdef SASR - return a >> n; -# else - if (a >= 0) return a >> n; - else return -(word)( -(uword)a >> n ); -# endif -} - -/* - * (From p. 46, end of section 4.2.5) - * - * NOTE: The following lines gives [sic] one correct implementation - * of the div(num, denum) arithmetic operation. Compute div - * which is the integer division of num by denum: with denum - * >= num > 0 - */ - -word gsm_div P2((num,denum), word num, word denum) -{ - longword L_num = num; - longword L_denum = denum; - word div = 0; - int k = 15; - - /* The parameter num sometimes becomes zero. - * Although this is explicitly guarded against in 4.2.5, - * we assume that the result should then be zero as well. - */ - - /* assert(num != 0); */ - - assert(num >= 0 && denum >= num); - if (num == 0) - return 0; - - while (k--) { - div <<= 1; - L_num <<= 1; - - if (L_num >= L_denum) { - L_num -= L_denum; - div++; - } - } - - return div; -} +/* + * Copyright 1992 by Jutta Degener and Carsten Bormann, Technische + * Universitaet Berlin. See the accompanying file "COPYRIGHT" for + * details. THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. + */ + +/* $Header$ */ + +/* + * See private.h for the more commonly used macro versions. + */ + +#include <stdio.h> +#include <assert.h> + +#include "private.h" +#include "gsm.h" +#include "proto.h" + +#define saturate(x) \ + ((x) < MIN_WORD ? MIN_WORD : (x) > MAX_WORD ? MAX_WORD: (x)) + +word gsm_add P2((a,b), word a, word b) +{ + longword sum = (longword)a + (longword)b; + return saturate(sum); +} + +word gsm_sub P2((a,b), word a, word b) +{ + longword diff = (longword)a - (longword)b; + return saturate(diff); +} + +word gsm_mult P2((a,b), word a, word b) +{ + if (a == MIN_WORD && b == MIN_WORD) return MAX_WORD; + else return SASR( (longword)a * (longword)b, 15 ); +} + +word gsm_mult_r P2((a,b), word a, word b) +{ + if (b == MIN_WORD && a == MIN_WORD) return MAX_WORD; + else { + longword prod = (longword)a * (longword)b + 16384; + prod >>= 15; + return prod & 0xFFFF; + } +} + +word gsm_abs P1((a), word a) +{ + return a < 0 ? (a == MIN_WORD ? MAX_WORD : -a) : a; +} + +longword gsm_L_mult P2((a,b),word a, word b) +{ + assert( a != MIN_WORD || b != MIN_WORD ); + return ((longword)a * (longword)b) << 1; +} + +longword gsm_L_add P2((a,b), longword a, longword b) +{ + if (a < 0) { + if (b >= 0) return a + b; + else { + ulongword A = (ulongword)-(a + 1) + (ulongword)-(b + 1); + return A >= MAX_LONGWORD ? MIN_LONGWORD :-(longword)A-2; + } + } + else if (b <= 0) return a + b; + else { + ulongword A = (ulongword)a + (ulongword)b; + return A > MAX_LONGWORD ? MAX_LONGWORD : A; + } +} + +longword gsm_L_sub P2((a,b), longword a, longword b) +{ + if (a >= 0) { + if (b >= 0) return a - b; + else { + /* a>=0, b<0 */ + + ulongword A = (ulongword)a + -(b + 1); + return A >= MAX_LONGWORD ? MAX_LONGWORD : (A + 1); + } + } + else if (b <= 0) return a - b; + else { + /* a<0, b>0 */ + + ulongword A = (ulongword)-(a + 1) + b; + return A >= MAX_LONGWORD ? MIN_LONGWORD : -(longword)A - 1; + } +} + +static unsigned char const bitoff[ 256 ] = { + 8, 7, 6, 6, 5, 5, 5, 5, 4, 4, 4, 4, 4, 4, 4, 4, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 +}; + +word gsm_norm P1((a), longword a ) +/* + * the number of left shifts needed to normalize the 32 bit + * variable L_var1 for positive values on the interval + * + * with minimum of + * minimum of 1073741824 (01000000000000000000000000000000) and + * maximum of 2147483647 (01111111111111111111111111111111) + * + * + * and for negative values on the interval with + * minimum of -2147483648 (-10000000000000000000000000000000) and + * maximum of -1073741824 ( -1000000000000000000000000000000). + * + * in order to normalize the result, the following + * operation must be done: L_norm_var1 = L_var1 << norm( L_var1 ); + * + * (That's 'ffs', only from the left, not the right..) + */ +{ + assert(a != 0); + + if (a < 0) { + if (a <= -1073741824) return 0; + a = ~a; + } + + return a & 0xffff0000 + ? ( a & 0xff000000 + ? -1 + bitoff[ 0xFF & (a >> 24) ] + : 7 + bitoff[ 0xFF & (a >> 16) ] ) + : ( a & 0xff00 + ? 15 + bitoff[ 0xFF & (a >> 8) ] + : 23 + bitoff[ 0xFF & a ] ); +} + +longword gsm_L_asl P2((a,n), longword a, int n) +{ + if (n >= 32) return 0; + if (n <= -32) return -(a < 0); + if (n < 0) return gsm_L_asr(a, -n); + return a << n; +} + +word gsm_asl P2((a,n), word a, int n) +{ + if (n >= 16) return 0; + if (n <= -16) return -(a < 0); + if (n < 0) return gsm_asr(a, -n); + return a << n; +} + +longword gsm_L_asr P2((a,n), longword a, int n) +{ + if (n >= 32) return -(a < 0); + if (n <= -32) return 0; + if (n < 0) return a << -n; + +# ifdef SASR + return a >> n; +# else + if (a >= 0) return a >> n; + else return -(longword)( -(ulongword)a >> n ); +# endif +} + +word gsm_asr P2((a,n), word a, int n) +{ + if (n >= 16) return -(a < 0); + if (n <= -16) return 0; + if (n < 0) return a << -n; + +# ifdef SASR + return a >> n; +# else + if (a >= 0) return a >> n; + else return -(word)( -(uword)a >> n ); +# endif +} + +/* + * (From p. 46, end of section 4.2.5) + * + * NOTE: The following lines gives [sic] one correct implementation + * of the div(num, denum) arithmetic operation. Compute div + * which is the integer division of num by denum: with denum + * >= num > 0 + */ + +word gsm_div P2((num,denum), word num, word denum) +{ + longword L_num = num; + longword L_denum = denum; + word div = 0; + int k = 15; + + /* The parameter num sometimes becomes zero. + * Although this is explicitly guarded against in 4.2.5, + * we assume that the result should then be zero as well. + */ + + /* assert(num != 0); */ + + assert(num >= 0 && denum >= num); + if (num == 0) + return 0; + + while (k--) { + div <<= 1; + L_num <<= 1; + + if (L_num >= L_denum) { + L_num -= L_denum; + div++; + } + } + + return div; +} Index: code.c =================================================================== RCS file: /cvsroot/iaxclient/iaxclient/lib/gsm/src/code.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -d -r1.1.1.1 -r1.2 --- code.c 14 Mar 2003 15:34:52 -0000 1.1.1.1 +++ code.c 19 Jun 2003 14:03:25 -0000 1.2 @@ -1,99 +1,99 @@ -/* - * Copyright 1992 by Jutta Degener and Carsten Bormann, Technische - * Universitaet Berlin. See the accompanying file "COPYRIGHT" for - * details. THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. - */ - -/* $Header$ */ - -#include "config.h" - - -//#ifdef HAS_STDLIB_H -#include <stdlib.h> -//#else -# include "proto.h" - extern char * memcpy P((char *, char *, int)); -//#endif - -#include "private.h" -#include "gsm.h" -#include "proto.h" - -/* - * 4.2 FIXED POINT IMPLEMENTATION OF THE RPE-LTP CODER - */ - -void Gsm_Coder P8((S,s,LARc,Nc,bc,Mc,xmaxc,xMc), - - struct gsm_state * S, - - word * s, /* [0..159] samples IN */ - -/* - * The RPE-LTD coder works on a frame by frame basis. The length of - * the frame is equal to 160 samples. Some computations are done - * once per frame to produce at the output of the coder the - * LARc[1..8] parameters which are the coded LAR coefficients and - * also to realize the inverse filtering operation for the entire - * frame (160 samples of signal d[0..159]). These parts produce at - * the output of the coder: - */ - - word * LARc, /* [0..7] LAR coefficients OUT */ - -/* - * Procedure 4.2.11 to 4.2.18 are to be executed four times per - * frame. That means once for each sub-segment RPE-LTP analysis of - * 40 samples. These parts produce at the output of the coder: - */ - - word * Nc, /* [0..3] LTP lag OUT */ - word * bc, /* [0..3] coded LTP gain OUT */ - word * Mc, /* [0..3] RPE grid selection OUT */ - word * xmaxc,/* [0..3] Coded maximum amplitude OUT */ - word * xMc /* [13*4] normalized RPE samples OUT */ -) -{ - int k; - word * dp = S->dp0 + 120; /* [ -120...-1 ] */ - word * dpp = dp; /* [ 0...39 ] */ - - static word e[50]; - - word so[160]; - - Gsm_Preprocess (S, s, so); - Gsm_LPC_Analysis (S, so, LARc); - Gsm_Short_Term_Analysis_Filter (S, LARc, so); - - for (k = 0; k <= 3; k++, xMc += 13) { - - Gsm_Long_Term_Predictor ( S, - so+k*40, /* d [0..39] IN */ - dp, /* dp [-120..-1] IN */ - e + 5, /* e [0..39] OUT */ - dpp, /* dpp [0..39] OUT */ - Nc++, - bc++); - - Gsm_RPE_Encoding ( S, - e + 5, /* e ][0..39][ IN/OUT */ - xmaxc++, Mc++, xMc ); - /* - * Gsm_Update_of_reconstructed_short_time_residual_signal - * ( dpp, e + 5, dp ); - */ - - { register int i; - register longword ltmp; - for (i = 0; i <= 39; i++) - dp[ i ] = GSM_ADD( e[5 + i], dpp[i] ); - } - dp += 40; - dpp += 40; - - } - (void)memcpy( (char *)S->dp0, (char *)(S->dp0 + 160), - 120 * sizeof(*S->dp0) ); -} +/* + * Copyright 1992 by Jutta Degener and Carsten Bormann, Technische + * Universitaet Berlin. See the accompanying file "COPYRIGHT" for + * details. THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. + */ + +/* $Header$ */ + +#include "config.h" + + +//#ifdef HAS_STDLIB_H +#include <stdlib.h> +//#else +# include "proto.h" + extern char * memcpy P((char *, char *, int)); +//#endif + +#include "private.h" +#include "gsm.h" +#include "proto.h" + +/* + * 4.2 FIXED POINT IMPLEMENTATION OF THE RPE-LTP CODER + */ + +void Gsm_Coder P8((S,s,LARc,Nc,bc,Mc,xmaxc,xMc), + + struct gsm_state * S, + + word * s, /* [0..159] samples IN */ + +/* + * The RPE-LTD coder works on a frame by frame basis. The length of + * the frame is equal to 160 samples. Some computations are done + * once per frame to produce at the output of the coder the + * LARc[1..8] parameters which are the coded LAR coefficients and + * also to realize the inverse filtering operation for the entire + * frame (160 samples of signal d[0..159]). These parts produce at + * the output of the coder: + */ + + word * LARc, /* [0..7] LAR coefficients OUT */ + +/* + * Procedure 4.2.11 to 4.2.18 are to be executed four times per + * frame. That means once for each sub-segment RPE-LTP analysis of + * 40 samples. These parts produce at the output of the coder: + */ + + word * Nc, /* [0..3] LTP lag OUT */ + word * bc, /* [0..3] coded LTP gain OUT */ + word * Mc, /* [0..3] RPE grid selection OUT */ + word * xmaxc,/* [0..3] Coded maximum amplitude OUT */ + word * xMc /* [13*4] normalized RPE samples OUT */ +) +{ + int k; + word * dp = S->dp0 + 120; /* [ -120...-1 ] */ + word * dpp = dp; /* [ 0...39 ] */ + + static word e[50]; + + word so[160]; + + Gsm_Preprocess (S, s, so); + Gsm_LPC_Analysis (S, so, LARc); + Gsm_Short_Term_Analysis_Filter (S, LARc, so); + + for (k = 0; k <= 3; k++, xMc += 13) { + + Gsm_Long_Term_Predictor ( S, + so+k*40, /* d [0..39] IN */ + dp, /* dp [-120..-1] IN */ + e + 5, /* e [0..39] OUT */ + dpp, /* dpp [0..39] OUT */ + Nc++, + bc++); + + Gsm_RPE_Encoding ( S, + e + 5, /* e ][0..39][ IN/OUT */ + xmaxc++, Mc++, xMc ); + /* + * Gsm_Update_of_reconstructed_short_time_residual_signal + * ( dpp, e + 5, dp ); + */ + + { register int i; + register longword ltmp; + for (i = 0; i <= 39; i++) + dp[ i ] = GSM_ADD( e[5 + i], dpp[i] ); + } + dp += 40; + dpp += 40; + + } + (void)memcpy( (char *)S->dp0, (char *)(S->dp0 + 160), + 120 * sizeof(*S->dp0) ); +} Index: debug.c =================================================================== RCS file: /cvsroot/iaxclient/iaxclient/lib/gsm/src/debug.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -d -r1.1.1.1 -r1.2 --- debug.c 14 Mar 2003 15:34:52 -0000 1.1.1.1 +++ debug.c 19 Jun 2003 14:03:25 -0000 1.2 @@ -1,76 +1,76 @@ -/* - * Copyright 1992 by Jutta Degener and Carsten Bormann, Technische - * Universitaet Berlin. See the accompanying file "COPYRIGHT" for - * details. THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. - */ - -/* $Header$ */ - -#include "private.h" - -#ifndef NDEBUG - -/* If NDEBUG _is_ defined and no debugging should be performed, - * calls to functions in this module are #defined to nothing - * in private.h. - */ - -#include <stdio.h> -#include "proto.h" - -void gsm_debug_words P4( (name, from, to, ptr), - char * name, - int from, - int to, - word * ptr) -{ - int nprinted = 0; - - fprintf( stderr, "%s [%d .. %d]: ", name, from, to ); - while (from <= to) { - fprintf(stderr, "%d ", ptr[ from ] ); - from++; - if (nprinted++ >= 7) { - nprinted = 0; - if (from < to) putc('\n', stderr); - } - } - putc('\n', stderr); -} - -void gsm_debug_longwords P4( (name, from, to, ptr), - char * name, - int from, - int to, - longword * ptr) -{ - int nprinted = 0; - - fprintf( stderr, "%s [%d .. %d]: ", name, from, to ); - while (from <= to) { - - fprintf(stderr, "%d ", ptr[ from ] ); - from++; - if (nprinted++ >= 7) { - nprinted = 0; - if (from < to) putc('\n', stderr); - } - } - putc('\n', stderr); -} - -void gsm_debug_longword P2( (name, value), - char * name, - longword value ) -{ - fprintf(stderr, "%s: %d\n", name, (long)value ); -} - -void gsm_debug_word P2( (name, value), - char * name, - word value ) -{ - fprintf(stderr, "%s: %d\n", name, (long)value); -} - -#endif +/* + * Copyright 1992 by Jutta Degener and Carsten Bormann, Technische + * Universitaet Berlin. See the accompanying file "COPYRIGHT" for + * details. THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. + */ + +/* $Header$ */ + +#include "private.h" + +#ifndef NDEBUG + +/* If NDEBUG _is_ defined and no debugging should be performed, + * calls to functions in this module are #defined to nothing + * in private.h. + */ + +#include <stdio.h> +#include "proto.h" + +void gsm_debug_words P4( (name, from, to, ptr), + char * name, + int from, + int to, + word * ptr) +{ + int nprinted = 0; + + fprintf( stderr, "%s [%d .. %d]: ", name, from, to ); + while (from <= to) { + fprintf(stderr, "%d ", ptr[ from ] ); + from++; + if (nprinted++ >= 7) { + nprinted = 0; + if (from < to) putc('\n', stderr); + } + } + putc('\n', stderr); +} + +void gsm_debug_longwords P4( (name, from, to, ptr), + char * name, + int from, + int to, + longword * ptr) +{ + int nprinted = 0; + + fprintf( stderr, "%s [%d .. %d]: ", name, from, to ); + while (from <= to) { + + fprintf(stderr, "%d ", ptr[ from ] ); + from++; + if (nprinted++ >= 7) { + nprinted = 0; + if (from < to) putc('\n', stderr); + } + } + putc('\n', stderr); +} + +void gsm_debug_longword P2( (name, value), + char * name, + longword value ) +{ + fprintf(stderr, "%s: %d\n", name, (long)value ); +} + +void gsm_debug_word P2( (name, value), + char * name, + word value ) +{ + fprintf(stderr, "%s: %d\n", name, (long)value); +} + +#endif Index: decode.c =================================================================== RCS file: /cvsroot/iaxclient/iaxclient/lib/gsm/src/decode.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -d -r1.1.1.1 -r1.2 --- decode.c 14 Mar 2003 15:34:52 -0000 1.1.1.1 +++ decode.c 19 Jun 2003 14:03:25 -0000 1.2 @@ -1,63 +1,63 @@ -/* - * Copyright 1992 by Jutta Degener and Carsten Bormann, Technische - * Universitaet Berlin. See the accompanying file "COPYRIGHT" for - * details. THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. - */ - -/* $Header$ */ - -#include <stdio.h> - -#include "private.h" -#include "gsm.h" -#include "proto.h" - -/* - * 4.3 FIXED POINT IMPLEMENTATION OF THE RPE-LTP DECODER - */ - -static void Postprocessing P2((S,s), - struct gsm_state * S, - register word * s) -{ - register int k; - register word msr = S->msr; - register longword ltmp; /* for GSM_ADD */ - register word tmp; - - for (k = 160; k--; s++) { - tmp = GSM_MULT_R( msr, 28180 ); - msr = GSM_ADD(*s, tmp); /* Deemphasis */ - *s = GSM_ADD(msr, msr) & 0xFFF8; /* Truncation & Upscaling */ - } - S->msr = msr; -} - -void Gsm_Decoder P8((S,LARcr, Ncr,bcr,Mcr,xmaxcr,xMcr,s), - struct gsm_state * S, - - word * LARcr, /* [0..7] IN */ - - word * Ncr, /* [0..3] IN */ - word * bcr, /* [0..3] IN */ - word * Mcr, /* [0..3] IN */ - word * xmaxcr, /* [0..3] IN */ - word * xMcr, /* [0..13*4] IN */ - - word * s) /* [0..159] OUT */ -{ - int j, k; - word erp[40], wt[160]; - word * drp = S->dp0 + 120; - - for (j=0; j <= 3; j++, xmaxcr++, bcr++, Ncr++, Mcr++, xMcr += 13) { - - Gsm_RPE_Decoding( S, *xmaxcr, *Mcr, xMcr, erp ); - Gsm_Long_Term_Synthesis_Filtering( S, *Ncr, *bcr, erp, drp ); - - for (k = 0; k <= 39; k++) wt[ j * 40 + k ] = drp[ k ]; - } - - Gsm_Short_Term_Synthesis_Filter( S, LARcr, wt, s ); - Postprocessing(S, s); -} +/* + * Copyright 1992 by Jutta Degener and Carsten Bormann, Technische + * Universitaet Berlin. See the accompanying file "COPYRIGHT" for + * details. THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. + */ + +/* $Header$ */ + +#include <stdio.h> + +#include "private.h" +#include "gsm.h" +#include "proto.h" + +/* + * 4.3 FIXED POINT IMPLEMENTATION OF THE RPE-LTP DECODER + */ + +static void Postprocessing P2((S,s), + struct gsm_state * S, + register word * s) +{ + register int k; + register word msr = S->msr; + register longword ltmp; /* for GSM_ADD */ + register word tmp; + + for (k = 160; k--; s++) { + tmp = GSM_MULT_R( msr, 28180 ); + msr = GSM_ADD(*s, tmp); /* Deemphasis */ + *s = GSM_ADD(msr, msr) & 0xFFF8; /* Truncation & Upscaling */ + } + S->msr = msr; +} + +void Gsm_Decoder P8((S,LARcr, Ncr,bcr,Mcr,xmaxcr,xMcr,s), + struct gsm_state * S, + + word * LARcr, /* [0..7] IN */ + + word * Ncr, /* [0..3] IN */ + word * bcr, /* [0..3] IN */ + word * Mcr, /* [0..3] IN */ + word * xmaxcr, /* [0..3] IN */ + word * xMcr, /* [0..13*4] IN */ + + word * s) /* [0..159] OUT */ +{ + int j, k; + word erp[40], wt[160]; + word * drp = S->dp0 + 120; + + for (j=0; j <= 3; j++, xmaxcr++, bcr++, Ncr++, Mcr++, xMcr += 13) { + + Gsm_RPE_Decoding( S, *xmaxcr, *Mcr, xMcr, erp ); + Gsm_Long_Term_Synthesis_Filtering( S, *Ncr, *bcr, erp, drp ); + + for (k = 0; k <= 39; k++) wt[ j * 40 + k ] = drp[ k ]; + } + + Gsm_Short_Term_Synthesis_Filter( S, LARcr, wt, s ); + Postprocessing(S, s); +} Index: gsm_create.c =================================================================== RCS file: /cvsroot/iaxclient/iaxclient/lib/gsm/src/gsm_create.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -d -r1.1.1.1 -r1.2 --- gsm_create.c 14 Mar 2003 15:34:52 -0000 1.1.1.1 +++ gsm_create.c 19 Jun 2003 14:03:25 -0000 1.2 @@ -1,45 +1,45 @@ -/* - * Copyright 1992 by Jutta Degener and Carsten Bormann, Technische - * Universitaet Berlin. See the accompanying file "COPYRIGHT" for - * details. THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. - */ - -static char const ident[] = "$Header$"; - -#include "config.h" - -#ifdef HAS_STRING_H -#include <string.h> -#else -# include "proto.h" - extern char * memset P((char *, int, int)); -#endif - -#ifdef HAS_STDLIB_H -# include <stdlib.h> -#else -# ifdef HAS_MALLOC_H -# include <malloc.h> -# else - extern char * malloc(); -# endif -#endif - -#include <stdio.h> - -#include "gsm.h" -#include "private.h" -#include "proto.h" - -gsm gsm_create P0() -{ - gsm r; - - r = (gsm)malloc(sizeof(struct gsm_state)); - if (!r) return r; - - memset((char *)r, 0, sizeof(*r)); - r->nrp = 40; - - return r; -} +/* + * Copyright 1992 by Jutta Degener and Carsten Bormann, Technische + * Universitaet Berlin. See the accompanying file "COPYRIGHT" for + * details. THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. + */ + +static char const ident[] = "$Header$"; + +#include "config.h" + +#ifdef HAS_STRING_H +#include <string.h> +#else +# include "proto.h" + extern char * memset P((char *, int, int)); +#endif + +#ifdef HAS_STDLIB_H +# include <stdlib.h> +#else +# ifdef HAS_MALLOC_H +# include <malloc.h> +# else + extern char * malloc(); +# endif +#endif + +#include <stdio.h> + +#include "gsm.h" +#include "private.h" +#include "proto.h" + +gsm gsm_create P0() +{ + gsm r; + + r = (gsm)malloc(sizeof(struct gsm_state)); + if (!r) return r; + + memset((char *)r, 0, sizeof(*r)); + r->nrp = 40; + + return r; +} Index: gsm_decode.c =================================================================== RCS file: /cvsroot/iaxclient/iaxclient/lib/gsm/src/gsm_decode.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -d -r1.1.1.1 -r1.2 --- gsm_decode.c 14 Mar 2003 15:34:52 -0000 1.1.1.1 +++ gsm_decode.c 19 Jun 2003 14:03:25 -0000 1.2 @@ -1,361 +1,361 @@ -/* - * Copyright 1992 by Jutta Degener and Carsten Bormann, Technische - * Universitaet Berlin. See the accompanying file "COPYRIGHT" for - * details. THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. - */ - -/* $Header$ */ - -#include "private.h" - -#include "gsm.h" -#include "proto.h" - -int gsm_decode P3((s, c, target), gsm s, gsm_byte * c, gsm_signal * target) -{ - word LARc[8], Nc[4], Mc[4], bc[4], xmaxc[4], xmc[13*4]; - -#ifdef WAV49 - if (s->wav_fmt) { - - uword sr = 0; - - s->frame_index = !s->frame_index; - if (s->frame_index) { - - sr = *c++; - LARc[0] = sr & 0x3f; sr >>= 6; - sr |= (uword)*c++ << 2; - LARc[1] = sr & 0x3f; sr >>= 6; - sr |= (uword)*c++ << 4; - LARc[2] = sr & 0x1f; sr >>= 5; - LARc[3] = sr & 0x1f; sr >>= 5; - sr |= (uword)*c++ << 2; - LARc[4] = sr & 0xf; sr >>= 4; - LARc[5] = sr & 0xf; sr >>= 4; - sr |= (uword)*c++ << 2; /* 5 */ - LARc[6] = sr & 0x7; sr >>= 3; - LARc[7] = sr & 0x7; sr >>= 3; - sr |= (uword)*c++ << 4; - Nc[0] = sr & 0x7f; sr >>= 7; - bc[0] = sr & 0x3; sr >>= 2; - Mc[0] = sr & 0x3; sr >>= 2; - sr |= (uword)*c++ << 1; - xmaxc[0] = sr & 0x3f; sr >>= 6; - xmc[0] = sr & 0x7; sr >>= 3; - sr = *c++; - xmc[1] = sr & 0x7; sr >>= 3; - xmc[2] = sr & 0x7; sr >>= 3; - sr |= (uword)*c++ << 2; - xmc[3] = sr & 0x7; sr >>= 3; - xmc[4] = sr & 0x7; sr >>= 3; - xmc[5] = sr & 0x7; sr >>= 3; - sr |= (uword)*c++ << 1; /* 10 */ - xmc[6] = sr & 0x7; sr >>= 3; - xmc[7] = sr & 0x7; sr >>= 3; - xmc[8] = sr & 0x7; sr >>= 3; - sr = *c++; - xmc[9] = sr & 0x7; sr >>= 3; - xmc[10] = sr & 0x7; sr >>= 3; - sr |= (uword)*c++ << 2; - xmc[11] = sr & 0x7; sr >>= 3; - xmc[12] = sr & 0x7; sr >>= 3; - sr |= (uword)*c++ << 4; - Nc[1] = sr & 0x7f; sr >>= 7; - bc[1] = sr & 0x3; sr >>= 2; - Mc[1] = sr & 0x3; sr >>= 2; - sr |= (uword)*c++ << 1; - xmaxc[1] = sr & 0x3f; sr >>= 6; - xmc[13] = sr & 0x7; sr >>= 3; - sr = *c++; /* 15 */ - xmc[14] = sr & 0x7; sr >>= 3; - xmc[15] = sr & 0x7; sr >>= 3; - sr |= (uword)*c++ << 2; - xmc[16] = sr & 0x7; sr >>= 3; - xmc[17] = sr & 0x7; sr >>= 3; - xmc[18] = sr & 0x7; sr >>= 3; - sr |= (uword)*c++ << 1; - xmc[19] = sr & 0x7; sr >>= 3; - xmc[20] = sr & 0x7; sr >>= 3; - xmc[21] = sr & 0x7; sr >>= 3; - sr = *c++; - xmc[22] = sr & 0x7; sr >>= 3; - xmc[23] = sr & 0x7; sr >>= 3; - sr |= (uword)*c++ << 2; - xmc[24] = sr & 0x7; sr >>= 3; - xmc[25] = sr & 0x7; sr >>= 3; - sr |= (uword)*c++ << 4; /* 20 */ - Nc[2] = sr & 0x7f; sr >>= 7; - bc[2] = sr & 0x3; sr >>= 2; - Mc[2] = sr & 0x3; sr >>= 2; - sr |= (uword)*c++ << 1; - xmaxc[2] = sr & 0x3f; sr >>= 6; - xmc[26] = sr & 0x7; sr >>= 3; - sr = *c++; - xmc[27] = sr & 0x7; sr >>= 3; - xmc[28] = sr & 0x7; sr >>= 3; - sr |= (uword)*c++ << 2; - xmc[29] = sr & 0x7; sr >>= 3; - xmc[30] = sr & 0x7; sr >>= 3; - xmc[31] = sr & 0x7; sr >>= 3; - sr |= (uword)*c++ << 1; - xmc[32] = sr & 0x7; sr >>= 3; - xmc[33] = sr & 0x7; sr >>= 3; - xmc[34] = sr & 0x7; sr >>= 3; - sr = *c++; /* 25 */ - xmc[35] = sr & 0x7; sr >>= 3; - xmc[36] = sr & 0x7; sr >>= 3; - sr |= (uword)*c++ << 2; - xmc[37] = sr & 0x7; sr >>= 3; - xmc[38] = sr & 0x7; sr >>= 3; - sr |= (uword)*c++ << 4; - Nc[3] = sr & 0x7f; sr >>= 7; - bc[3] = sr & 0x3; sr >>= 2; - Mc[3] = sr & 0x3; sr >>= 2; - sr |= (uword)*c++ << 1; - xmaxc[3] = sr & 0x3f; sr >>= 6; - xmc[39] = sr & 0x7; sr >>= 3; - sr = *c++; - xmc[40] = sr & 0x7; sr >>= 3; - xmc[41] = sr & 0x7; sr >>= 3; - sr |= (uword)*c++ << 2; /* 30 */ - xmc[42] = sr & 0x7; sr >>= 3; - xmc[43] = sr & 0x7; sr >>= 3; - xmc[44] = sr & 0x7; sr >>= 3; - sr |= (uword)*c++ << 1; - xmc[45] = sr & 0x7; sr >>= 3; - xmc[46] = sr & 0x7; sr >>= 3; - xmc[47] = sr & 0x7; sr >>= 3; - sr = *c++; - xmc[48] = sr & 0x7; sr >>= 3; - xmc[49] = sr & 0x7; sr >>= 3; - sr |= (uword)*c++ << 2; - xmc[50] = sr & 0x7; sr >>= 3; - xmc[51] = sr & 0x7; sr >>= 3; - - s->frame_chain = sr & 0xf; - } - else { - sr = s->frame_chain; - sr |= (uword)*c++ << 4; /* 1 */ - LARc[0] = sr & 0x3f; sr >>= 6; - LARc[1] = sr & 0x3f; sr >>= 6; - sr = *c++; - LARc[2] = sr & 0x1f; sr >>= 5; - sr |= (uword)*c++ << 3; - LARc[3] = sr & 0x1f; sr >>= 5; - LARc[4] = sr & 0xf; sr >>= 4; - sr |= (uword)*c++ << 2; - LARc[5] = sr & 0xf; sr >>= 4; - LARc[6] = sr & 0x7; sr >>= 3; - LARc[7] = sr & 0x7; sr >>= 3; - sr = *c++; /* 5 */ - Nc[0] = sr & 0x7f; sr >>= 7; - sr |= (uword)*c++ << 1; - bc[0] = sr & 0x3; sr >>= 2; - Mc[0] = sr & 0x3; sr >>= 2; - sr |= (uword)*c++ << 5; - xmaxc[0] = sr & 0x3f; sr >>= 6; - xmc[0] = sr & 0x7; sr >>= 3; - xmc[1] = sr & 0x7; sr >>= 3; - sr |= (uword)*c++ << 1; - xmc[2] = sr & 0x7; sr >>= 3; - xmc[3] = sr & 0x7; sr >>= 3; - xmc[4] = sr & 0x7; sr >>= 3; - sr = *c++; - xmc[5] = sr & 0x7; sr >>= 3; - xmc[6] = sr & 0x7; sr >>= 3; - sr |= (uword)*c++ << 2; /* 10 */ - xmc[7] = sr & 0x7; sr >>= 3; - xmc[8] = sr & 0x7; sr >>= 3; - xmc[9] = sr & 0x7; sr >>= 3; - sr |= (uword)*c++ << 1; - xmc[10] = sr & 0x7; sr >>= 3; - xmc[11] = sr & 0x7; sr >>= 3; - xmc[12] = sr & 0x7; sr >>= 3; - sr = *c++; - Nc[1] = sr & 0x7f; sr >>= 7; - sr |= (uword)*c++ << 1; - bc[1] = sr & 0x3; sr >>= 2; - Mc[1] = sr & 0x3; sr >>= 2; - sr |= (uword)*c++ << 5; - xmaxc[1] = sr & 0x3f; sr >>= 6; - xmc[13] = sr & 0x7; sr >>= 3; - xmc[14] = sr & 0x7; sr >>= 3; - sr |= (uword)*c++ << 1; /* 15 */ - xmc[15] = sr & 0x7; sr >>= 3; - xmc[16] = sr & 0x7; sr >>= 3; - xmc[17] = sr & 0x7; sr >>= 3; - sr = *c++; - xmc[18] = sr & 0x7; sr >>= 3; - xmc[19] = sr & 0x7; sr >>= 3; - sr |= (uword)*c++ << 2; - xmc[20] = sr & 0x7; sr >>= 3; - xmc[21] = sr & 0x7; sr >>= 3; - xmc[22] = sr & 0x7; sr >>= 3; - sr |= (uword)*c++ << 1; - xmc[23] = sr & 0x7; sr >>= 3; - xmc[24] = sr & 0x7; sr >>= 3; - xmc[25] = sr & 0x7; sr >>= 3; - sr = *c++; - Nc[2] = sr & 0x7f; sr >>= 7; - sr |= (uword)*c++ << 1; /* 20 */ - bc[2] = sr & 0x3; sr >>= 2; - Mc[2] = sr & 0x3; sr >>= 2; - sr |= (uword)*c++ << 5; - xmaxc[2] = sr & 0x3f; sr >>= 6; - xmc[26] = sr & 0x7; sr >>= 3; - xmc[27] = sr & 0x7; sr >>= 3; - sr |= (uword)*c++ << 1; - xmc[28] = sr & 0x7; sr >>= 3; - xmc[29] = sr & 0x7; sr >>= 3; - xmc[30] = sr & 0x7; sr >>= 3; - sr = *c++; - xmc[31] = sr & 0x7; sr >>= 3; - xmc[32] = sr & 0x7; sr >>= 3; - sr |= (uword)*c++ << 2; - xmc[33] = sr & 0x7; sr >>= 3; - xmc[34] = sr & 0x7; sr >>= 3; - xmc[35] = sr & 0x7; sr >>= 3; - sr |= (uword)*c++ << 1; /* 25 */ - xmc[36] = sr & 0x7; sr >>= 3; - xmc[37] = sr & 0x7; sr >>= 3; - xmc[38] = sr & 0x7; sr >>= 3; - sr = *c++; - Nc[3] = sr & 0x7f; sr >>= 7; - sr |= (uword)*c++ << 1; - bc[3] = sr & 0x3; sr >>= 2; - Mc[3] = sr & 0x3; sr >>= 2; - sr |= (uword)*c++ << 5; - xmaxc[3] = sr & 0x3f; sr >>= 6; - xmc[39] = sr & 0x7; sr >>= 3; - xmc[40] = sr & 0x7; sr >>= 3; - sr |= (uword)*c++ << 1; - xmc[41] = sr & 0x7; sr >>= 3; - xmc[42] = sr & 0x7; sr >>= 3; - xmc[43] = sr & 0x7; sr >>= 3; - sr = *c++; /* 30 */ - xmc[44] = sr & 0x7; sr >>= 3; - xmc[45] = sr & 0x7; sr >>= 3; - sr |= (uword)*c++ << 2; - xmc[46] = sr & 0x7; sr >>= 3; - xmc[47] = sr & 0x7; sr >>= 3; - xmc[48] = sr & 0x7; sr >>= 3; - sr |= (uword)*c++ << 1; - xmc[49] = sr & 0x7; sr >>= 3; - xmc[50] = sr & 0x7; sr >>= 3; - xmc[51] = sr & 0x7; sr >>= 3; - } - } - else -#endif - { - /* GSM_MAGIC = (*c >> 4) & 0xF; */ - - if (((*c >> 4) & 0x0F) != GSM_MAGIC) return -1; - - LARc[0] = (*c++ & 0xF) << 2; /* 1 */ - LARc[0] |= (*c >> 6) & 0x3; - LARc[1] = *c++ & 0x3F; - LARc[2] = (*c >> 3) & 0x1F; - LARc[3] = (*c++ & 0x7) << 2; - LARc[3] |= (*c >> 6) & 0x3; - LARc[4] = (*c >> 2) & 0xF; - LARc[5] = (*c++ & 0x3) << 2; - LARc[5] |= (*c >> 6) & 0x3; - LARc[6] = (*c >> 3) & 0x7; - LARc[7] = *c++ & 0x7; - Nc[0] = (*c >> 1) & 0x7F; - bc[0] = (*c++ & 0x1) << 1; - bc[0] |= (*c >> 7) & 0x1; - Mc[0] = (*c >> 5) & 0x3; - xmaxc[0] = (*c++ & 0x1F) << 1; - xmaxc[0] |= (*c >> 7) & 0x1; - xmc[0] = (*c >> 4) & 0x7; - xmc[1] = (*c >> 1) & 0x7; - xmc[2] = (*c++ & 0x1) << 2; - xmc[2] |= (*c >> 6) & 0x3; - xmc[3] = (*c >> 3) & 0x7; - xmc[4] = *c++ & 0x7; - xmc[5] = (*c >> 5) & 0x7; - xmc[6] = (*c >> 2) & 0x7; - xmc[7] = (*c++ & 0x3) << 1; /* 10 */ - xmc[7] |= (*c >> 7) & 0x1; - xmc[8] = (*c >> 4) & 0x7; - xmc[9] = (*c >> 1) & 0x7; - xmc[10] = (*c++ & 0x1) << 2; - xmc[10] |= (*c >> 6) & 0x3; - xmc[11] = (*c >> 3) & 0x7; - xmc[12] = *c++ & 0x7; - Nc[1] = (*c >> 1) & 0x7F; - bc[1] = (*c++ & 0x1) << 1; - bc[1] |= (*c >> 7) & 0x1; - Mc[1] = (*c >> 5) & 0x3; - xmaxc[1] = (*c++ & 0x1F) << 1; - xmaxc[1] |= (*c >> 7) & 0x1; - xmc[13] = (*c >> 4) & 0x7; - xmc[14] = (*c >> 1) & 0x7; - xmc[15] = (*c++ & 0x1) << 2; - xmc[15] |= (*c >> 6) & 0x3; - xmc[16] = (*c >> 3) & 0x7; - xmc[17] = *c++ & 0x7; - xmc[18] = (*c >> 5) & 0x7; - xmc[19] = (*c >> 2) & 0x7; - xmc[20] = (*c++ & 0x3) << 1; - xmc[20] |= (*c >> 7) & 0x1; - xmc[21] = (*c >> 4) & 0x7; - xmc[22] = (*c >> 1) & 0x7; - xmc[23] = (*c++ & 0x1) << 2; - xmc[23] |= (*c >> 6) & 0x3; - xmc[24] = (*c >> 3) & 0x7; - xmc[25] = *c++ & 0x7; - Nc[2] = (*c >> 1) & 0x7F; - bc[2] = (*c++ & 0x1) << 1; /* 20 */ - bc[2] |= (*c >> 7) & 0x1; - Mc[2] = (*c >> 5) & 0x3; - xmaxc[2] = (*c++ & 0x1F) << 1; - xmaxc[2] |= (*c >> 7) & 0x1; - xmc[26] = (*c >> 4) & 0x7; - xmc[27] = (*c >> 1) & 0x7; - xmc[28] = (*c++ & 0x1) << 2; - xmc[28] |= (*c >> 6) & 0x3; - xmc[29] = (*c >> 3) & 0x7; - xmc[30] = *c++ & 0x7; - xmc[31] = (*c >> 5) & 0x7; - xmc[32] = (*c >> 2) & 0x7; - xmc[33] = (*c++ & 0x3) << 1; - xmc[33] |= (*c >> 7) & 0x1; - xmc[34] = (*c >> 4) & 0x7; - xmc[35] = (*c >> 1) & 0x7; - xmc[36] = (*c++ & 0x1) << 2; - xmc[36] |= (*c >> 6) & 0x3; - xmc[37] = (*c >> 3) & 0x7; - xmc[38] = *c++ & 0x7; - Nc[3] = (*c >> 1) & 0x7F; - bc[3] = (*c++ & 0x1) << 1; - bc[3] |= (*c >> 7) & 0x1; - Mc[3] = (*c >> 5) & 0x3; - xmaxc[3] = (*c++ & 0x1F) << 1; - xmaxc[3] |= (*c >> 7) & 0x1; - xmc[39] = (*c >> 4) & 0x7; - xmc[40] = (*c >> 1) & 0x7; - xmc[41] = (*c++ & 0x1) << 2; - xmc[41] |= (*c >> 6) & 0x3; - xmc[42] = (*c >> 3) & 0x7; - xmc[43] = *c++ & 0x7; /* 30 */ - xmc[44] = (*c >> 5) & 0x7; - xmc[45] = (*c >> 2) & 0x7; - xmc[46] = (*c++ & 0x3) << 1; - xmc[46] |= (*c >> 7) & 0x1; - xmc[47] = (*c >> 4) & 0x7; - xmc[48] = (*c >> 1) & 0x7; - xmc[49] = (*c++ & 0x1) << 2; - xmc[49] |= (*c >> 6) & 0x3; - xmc[50] = (*c >> 3) & 0x7; - xmc[51] = *c & 0x7; /* 33 */ - } - - Gsm_Decoder(s, LARc, Nc, bc, Mc, xmaxc, xmc, target); - - return 0; -} +/* + * Copyright 1992 by Jutta Degener and Carsten Bormann, Technische + * Universitaet Berlin. See the accompanying file "COPYRIGHT" for + * details. THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. + */ + +/* $Header$ */ + +#include "private.h" + +#include "gsm.h" +#include "proto.h" + +int gsm_decode P3((s, c, target), gsm s, gsm_byte * c, gsm_signal * target) +{ + word LARc[8], Nc[4], Mc[4], bc[4], xmaxc[4], xmc[13*4]; + +#ifdef WAV49 + if (s->wav_fmt) { + + uword sr = 0; + + s->frame_index = !s->frame_index; + if (s->frame_index) { + + sr = *c++; + LARc[0] = sr & 0x3f; sr >>= 6; + sr |= (uword)*c++ << 2; + LARc[1] = sr & 0x3f; sr >>= 6; + sr |= (uword)*c++ << 4; + LARc[2] = sr & 0x1f; sr >>= 5; + LARc[3] = sr & 0x1f; sr >>= 5; + sr |= (uword)*c++ << 2; + LARc[4] = sr & 0xf; sr >>= 4; + LARc[5] = sr & 0xf; sr >>= 4; + sr |= (uword)*c++ << 2; /* 5 */ + LARc[6] = sr & 0x7; sr >>= 3; + LARc[7] = sr & 0x7; sr >>= 3; + sr |= (uword)*c++ << 4; + Nc[0] = sr & 0x7f; sr >>= 7; + bc[0] = sr & 0x3; sr >>= 2; + Mc[0] = sr & 0x3; sr >>= 2; + sr |= (uword)*c++ << 1; + xmaxc[0] = sr & 0x3f; sr >>= 6; + xmc[0] = sr & 0x7; sr >>= 3; + sr = *c++; + xmc[1] = sr & 0x7; sr >>= 3; + xmc[2] = sr & 0x7; sr >>= 3; + sr |= (uword)*c++ << 2; + xmc[3] = sr & 0x7; sr >>= 3; + xmc[4] = sr & 0x7; sr >>= 3; + xmc[5] = sr & 0x7; sr >>= 3; + sr |= (uword)*c++ << 1; /* 10 */ + xmc[6] = sr & 0x7; sr >>= 3; + xmc[7] = sr & 0x7; sr >>= 3; + xmc[8] = sr & 0x7; sr >>= 3; + sr = *c++; + xmc[9] = sr & 0x7; sr >>= 3; + xmc[10] = sr & 0x7; sr >>= 3; + sr |= (uword)*c++ << 2; + xmc[11] = sr & 0x7; sr >>= 3; + xmc[12] = sr & 0x7; sr >>= 3; + sr |= (uword)*c++ << 4; + Nc[1] = sr & 0x7f; sr >>= 7; + bc[1] = sr & 0x3; sr >>= 2; + Mc[1] = sr & 0x3; sr >>= 2; + sr |= (uword)*c++ << 1; + xmaxc[1] = sr & 0x3f; sr >>= 6; + xmc[13] = sr & 0x7; sr >>= 3; + sr = *c++; /* 15 */ + xmc[14] = sr & 0x7; sr >>= 3; + xmc[15] = sr & 0x7; sr >>= 3; + sr |= (uword)*c++ << 2; + xmc[16] = sr & 0x7; sr >>= 3; + xmc[17] = sr & 0x7; sr >>= 3; + xmc[18] = sr & 0x7; sr >>= 3; + sr |= (uword)*c++ << 1; + xmc[19] = sr & 0x7; sr >>= 3; + xmc[20] = sr & 0x7; sr >>= 3; + xmc[21] = sr & 0x7; sr >>= 3; + sr = *c++; + xmc[22] = sr & 0x7; sr >>= 3; + xmc[23] = sr & 0x7; sr >>= 3; + sr |= (uword)*c++ << 2; + xmc[24] = sr & 0x7; sr >>= 3; + xmc[25] = sr & 0x7; sr >>= 3; + sr |= (uword)*c++ << 4; /* 20 */ + Nc[2] = sr & 0x7f; sr >>= 7; + bc[2] = sr & 0x3; sr >>= 2; + Mc[2] = sr & 0x3; sr >>= 2; + sr |= (uword)*c++ << 1; + xmaxc[2] = sr & 0x3f; sr >>= 6; + xmc[26] = sr & 0x7; sr >>= 3; + sr = *c++; + xmc[27] = sr & 0x7; sr >>= 3; + xmc[28] = sr & 0x7; sr >>= 3; + sr |= (uword)*c++ << 2; + xmc[29] = sr & 0x7; sr >>= 3; + xmc[30] = sr & 0x7; sr >>= 3; + xmc[31] = sr & 0x7; sr >>= 3; + sr |= (uword)*c++ << 1; + xmc[32] = sr & 0x7; sr >>= 3; + xmc[33] = sr & 0x7; sr >>= 3; + xmc[34] = sr & 0x7; sr >>= 3; + sr = *c++; /* 25 */ + xmc[35] = sr & 0x7; sr >>= 3; + xmc[36] = sr & 0x7; sr >>= 3; + sr |= (uword)*c++ << 2; + xmc[37] = sr & 0x7; sr >>= 3; + xmc[38] = sr & 0x7; sr >>= 3; + sr |= (uword)*c++ << 4; + Nc[3] = sr & 0x7f; sr >>= 7; + bc[3] = sr & 0x3; sr >>= 2; + Mc[3] = sr & 0x3; sr >>= 2; + sr |= (uword)*c++ << 1; + xmaxc[3] = sr & 0x3f; sr >>= 6; + xmc[39] = sr & 0x7; sr >>= 3; + sr = *c++; + xmc[40] = sr & 0x7; sr >>= 3; + xmc[41] = sr & 0x7; sr >>= 3; + sr |= (uword)*c++ << 2; /* 30 */ + xmc[42] = sr & 0x7; sr >>= 3; + xmc[43] = sr & 0x7; sr >>= 3; + xmc[44] = sr & 0x7; sr >>= 3; + sr |= (uword)*c++ << 1; + xmc[45] = sr & 0x7; sr >>= 3; + xmc[46] = sr & 0x7; sr >>= 3; + xmc[47] = sr & 0x7; sr >>= 3; + sr = *c++; + xmc[48] = sr & 0x7; sr >>= 3; + xmc[49] = sr & 0x7; sr >>= 3; + sr |= (uword)*c++ << 2; + xmc[50] = sr & 0x7; sr >>= 3; + xmc[51] = sr & 0x7; sr >>= 3; + + s->frame_chain = sr & 0xf; + } + else { + sr = s->frame_chain; + sr |= (uword)*c++ << 4; /* 1 */ + LARc[0] = sr & 0x3f; sr >>= 6; + LARc[1] = sr & 0x3f; sr >>= 6; + sr = *c++; + LARc[2] = sr & 0x1f; sr >>= 5; + sr |= (uword)*c++ << 3; + LARc[3] = sr & 0x1f; sr >>= 5; + LARc[4] = sr & 0xf; sr >>= 4; + sr |= (uword)*c++ << 2; + LARc[5] = sr & 0xf; sr >>= 4; + LARc[6] = sr & 0x7; sr >>= 3; + LARc[7] = sr & 0x7; sr >>= 3; + sr = *c++; /* 5 */ + Nc[0] = sr & 0x7f; sr >>= 7; + sr |= (uword)*c++ << 1; + bc[0] = sr & 0x3; sr >>= 2; + Mc[0] = sr & 0x3; sr >>= 2; + sr |= (uword)*c++ << 5; + xmaxc[0] = sr & 0x3f; sr >>= 6; + xmc[0] = sr & 0x7; sr >>= 3; + xmc[1] = sr & 0x7; sr >>= 3; + sr |= (uword)*c++ << 1; + xmc[2] = sr & 0x7; sr >>= 3; + xmc[3] = sr & 0x7; sr >>= 3; + xmc[4] = sr & 0x7; sr >>= 3; + sr = *c++; + xmc[5] = sr & 0x7; sr >>= 3; + xmc[6] = sr & 0x7; sr >>= 3; + sr |= (uword)*c++ << 2; /* 10 */ + xmc[7] = sr & 0x7; sr >>= 3; + xmc[8] = sr & 0x7; sr >>= 3; + xmc[9] = sr & 0x7; sr >>= 3; + sr |= (uword)*c++ << 1; + xmc[10] = sr & 0x7; sr >>= 3; + xmc[11] = sr & 0x7; sr >>= 3; + xmc[12] = sr & 0x7; sr >>= 3; + sr = *c++; + Nc[1] = sr & 0x7f; sr >>= 7; + sr |= (uword)*c++ << 1; + bc[1] = sr & 0x3; sr >>= 2; + Mc[1] = sr & 0x3; sr >>= 2; + sr |= (uword)*c++ << 5; + xmaxc[1] = sr & 0x3f; sr >>= 6; + xmc[13] = sr & 0x7; sr >>= 3; + xmc[14] = sr & 0x7; sr >>= 3; + sr |= (uword)*c++ << 1; /* 15 */ + xmc[15] = sr & 0x7; sr >>= 3; + xmc[16] = sr & 0x7; sr >>= 3; + xmc[17] = sr & 0x7; sr >>= 3; + sr = *c++; + xmc[18] = sr & 0x7; sr >>= 3; + xmc[19] = sr & 0x7; sr >>= 3; + sr |= (uword)*c++ << 2; + xmc[20] = sr & 0x7; sr >>= 3; + xmc[21] = sr & 0x7; sr >>= 3; + xmc[22] = sr & 0x7; sr >>= 3; + sr |= (uword)*c++ << 1; + xmc[23] = sr & 0x7; sr >>= 3; + xmc[24] = sr & 0x7; sr >>= 3; + xmc[25] = sr & 0x7; sr >>= 3; + sr = *c++; + Nc[2] = sr & 0x7f; sr >>= 7; + sr |= (uword)*c++ << 1; /* 20 */ + bc[2] = sr & 0x3; sr >>= 2; + Mc[2] = sr & 0x3; sr >>= 2; + sr |= (uword)*c++ << 5; + xmaxc[2] = sr & 0x3f; sr >>= 6; + xmc[26] = sr & 0x7; sr >>= 3; + xmc[27] = sr & 0x7; sr >>= 3; + sr |= (uword)*c++ << 1; + xmc[28] = sr & 0x7; sr >>= 3; + xmc[29] = sr & 0x7; sr >>= 3; + xmc[30] = sr & 0x7; sr >>= 3; + sr = *c++; + xmc[31] = sr & 0x7; sr >>= 3; + xmc[32] = sr & 0x7; sr >>= 3; + sr |= (uword)*c++ << 2; + xmc[33] = sr & 0x7; sr >>= 3; + xmc[34] = sr & 0x7; sr >>= 3; + xmc[35] = sr & 0x7; sr >>= 3; + sr |= (uword)*c++ << 1; /* 25 */ + xmc[36] = sr & 0x7; sr >>= 3; + xmc[37] = sr & 0x7; sr >>= 3; + xmc[38] = sr & 0x7; sr >>= 3; + sr = *c++; + Nc[3] = sr & 0x7f; sr >>= 7; + sr |= (uword)*c++ << 1; + bc[3] = sr & 0x3; sr >>= 2; + Mc[3] = sr & 0x3; sr >>= 2; + sr |= (uword)*c++ << 5; + xmaxc[3] = sr & 0x3f; sr >>= 6; + xmc[39] = sr & 0x7; sr >>= 3; + xmc[40] = sr & 0x7; sr >>= 3; + sr |= (uword)*c++ << 1; + xmc[41] = sr & 0x7; sr >>= 3; + xmc[42] = sr & 0x7; sr >>= 3; + xmc[43] = sr & 0x7; sr >>= 3; + sr = *c++; /* 30 */ + xmc[44] = sr & 0x7; sr >>= 3; + xmc[45] = sr & 0x7; sr >>= 3; + sr |= (uword)*c++ << 2; + xmc[46] = sr & 0x7; sr >>= 3; + xmc[47] = sr & 0x7; sr >>= 3; + xmc[48] = sr & 0x7; sr >>= 3; + sr |= (uword)*c++ << 1; + xmc[49] = sr & 0x7; sr >>= 3; + xmc[50] = sr & 0x7; sr >>= 3; + xmc[51] = sr & 0x7; sr >>= 3; + } + } + else +#endif + { + /* GSM_MAGIC = (*c >> 4) & 0xF; */ + + if (((*c >> 4) & 0x0F) != GSM_MAGIC) return -1; + + LARc[0] = (*c++ & 0xF) << 2; /* 1 */ + LARc[0] |= (*c >> 6) & 0x3; + LARc[1] = *c++ & 0x3F; + LARc[2] = (*c >> 3) & 0x1F; + LARc[3] = (*c++ & 0x7) << 2; + LARc[3] |= (*c >> 6) & 0x3; + LARc[4] = (*c >> 2) & 0xF; + LARc[5] = (*c++ & 0x3) << 2; + LARc[5] |= (*c >> 6) & 0x3; + LARc[6] = (*c >> 3) & 0x7; + LARc[7] = *c++ & 0x7; + Nc[0] = (*c >> 1) & 0x7F; + bc[0] = (*c++ & 0x1) << 1; + bc[0] |= (*c >> 7) & 0x1; + Mc[0] = (*c >> 5) & 0x3; + xmaxc[0] = (*c++ & 0x1F) << 1; + xmaxc[0] |= (*c >> 7) & 0x1; + xmc[0] = (*c >> 4) & 0x7; + xmc[1] = (*c >> 1) & 0x7; + xmc[2] = (*c++ & 0x1) << 2; + xmc[2] |= (*c >> 6) & 0x3; + xmc[3] = (*c >> 3) & 0x7; + xmc[4] = *c++ & 0x7; + xmc[5] = (*c >> 5) & 0x7; + xmc[6] = (*c >> 2) & 0x7; + xmc[7] = (*c++ & 0x3) << 1; /* 10 */ + xmc[7] |= (*c >> 7) & 0x1; + xmc[8] = (*c >> 4) & 0x7; + xmc[9] = (*c >> 1) & 0x7; + xmc[10] = (*c++ & 0x1) << 2; + xmc[10] |= (*c >> 6) & 0x3; + xmc[11] = (*c >> 3) & 0x7; + xmc[12] = *c++ & 0x7; + Nc[1] = (*c >> 1) & 0x7F; + bc[1] = (*c++ & 0x1) << 1; + bc[1] |= (*c >> 7) & 0x1; + Mc[1] = (*c >> 5) & 0x3; + xmaxc[1] = (*c++ & 0x1F) << 1; + xmaxc[1] |= (*c >> 7) & 0x1; + xmc[13] = (*c >> 4) & 0x7; + xmc[14] = (*c >> 1) & 0x7; + xmc[15] = (*c++ & 0x1) << 2; + xmc[15] |= (*c >> 6) & 0x3; + xmc[16] = (*c >> 3) & 0x7; + xmc[17] = *c++ & 0x7; + xmc[18] = (*c >> 5) & 0x7; + xmc[19] = (*c >> 2) & 0x7; + xmc[20] = (*c++ & 0x3) << 1; + xmc[20] |= (*c >> 7) & 0x1; + xmc[21] = (*c >> 4) & 0x7; + xmc[22] = (*c >> 1) & 0x7; + xmc[23] = (*c++ & 0x1) << 2; + xmc[23] |= (*c >> 6) & 0x3; + xmc[24] = (*c >> 3) & 0x7; + xmc[25] = *c++ & 0x7; + Nc[2] = (*c >> 1) & 0x7F; + bc[2] = (*c++ & 0x1) << 1; /* 20 */ + bc[2] |= (*c >> 7) & 0x1; + Mc[2] = (*c >> 5) & 0x3; + xmaxc[2] = (*c++ & 0x1F) << 1; + xmaxc[2] |= (*c >> 7) & 0x1; + xmc[26] = (*c >> 4) & 0x7; + xmc[27] = (*c >> 1) & 0x7; + xmc[28] = (*c++ & 0x1) << 2; + xmc[28] |= (*c >> 6) & 0x3; + xmc[29] = (*c >> 3) & 0x7; + xmc[30] = *c++ & 0x7; + xmc[31] = (*c >> 5) & 0x7; + xmc[32] = (*c >> 2) & 0x7; + xmc[33] = (*c++ & 0x3) << 1; + xmc[33] |= (*c >> 7) & 0x1; + xmc[34] = (*c >> 4) & 0x7; + xmc[35] = (*c >> 1) & 0x7; + xmc[36] = (*c++ & 0x1) << 2; + xmc[36] |= (*c >> 6) & 0x3; + xmc[37] = (*c >> 3) & 0x7; + xmc[38] = *c++ & 0x7; + Nc[3] = (*c >> 1) & 0x7F; + bc[3] = (*c++ & 0x1) << 1; + bc[3] |= (*c >> 7) & 0x1; + Mc[3] = (*c >> 5) & 0x3; + xmaxc[3] = (*c++ & 0x1F) << 1; + xmaxc[3] |= (*c >> 7) & 0x1; + xmc[39] = (*c >> 4) & 0x7; + xmc[40] = (*c >> 1) & 0x7; + xmc[41] = (*c++ & 0x1) << 2; + xmc[41] |= (*c >> 6) & 0x3; + xmc[42] = (*c >> 3) & 0x7; + xmc[43] = *c++ & 0x7; /* 30 */ + xmc[44] = (*c >> 5) & 0x7; + xmc[45] = (*c >> 2) & 0x7; + xmc[46] = (*c++ & 0x3) << 1; + xmc[46] |= (*c >> 7) & 0x1; + xmc[47] = (*c >> 4) & 0x7; + xmc[48] = (*c >> 1) & 0x7; + xmc[49] = (*c++ & 0x1) << 2; + xmc[49] |= (*c >> 6) & 0x3; + xmc[50] = (*c >> 3) & 0x7; + xmc[51] = *c & 0x7; /* 33 */ + } + + Gsm_Decoder(s, LARc, Nc, bc, Mc, xmaxc, xmc, target); + + return 0; +} Index: gsm_destroy.c =================================================================== RCS file: /cvsroot/iaxclient/iaxclient/lib/gsm/src/gsm_destroy.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -d -r1.1.1.1 -r1.2 --- gsm_destroy.c 14 Mar 2003 15:34:52 -0000 1.1.1.1 +++ gsm_destroy.c 19 Jun 2003 14:03:25 -0000 1.2 @@ -1,26 +1,26 @@ -/* - * Copyright 1992 by Jutta Degener and Carsten Bormann, Technische - * Universitaet Berlin. See the accompanying file "COPYRIGHT" for - * details. THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. - */ - -/* $Header$ */ - -#include "gsm.h" -#include "config.h" -#include "proto.h" - -#ifdef HAS_STDLIB_H -# include <stdlib.h> -#else -# ifdef HAS_MALLOC_H -# include <malloc.h> -# else - extern void free(); -# endif -#endif - -void gsm_destroy P1((S), gsm S) -{ - if (S) free((char *)S); -} +/* + * Copyright 1992 by Jutta Degener and Carsten Bormann, Technische + * Universitaet Berlin. See the accompanying file "COPYRIGHT" for + * details. THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. + */ + +/* $Header$ */ + +#include "gsm.h" +#include "config.h" +#include "proto.h" + +#ifdef HAS_STDLIB_H +# include <stdlib.h> +#else +# ifdef HAS_MALLOC_H +# include <malloc.h> +# else + extern void free(); +# endif +#endif + +void gsm_destroy P1((S), gsm S) +{ + if (S) free((char *)S); +} Index: gsm_encode.c =================================================================== RCS file: /cvsroot/iaxclient/iaxclient/lib/gsm/src/gsm_encode.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -d -r1.1.1.1 -r1.2 --- gsm_encode.c 14 Mar 2003 15:34:52 -0000 1.1.1.1 +++ gsm_encode.c 19 Jun 2003 14:03:25 -0000 1.2 @@ -1,451 +1,451 @@ -/* - * Copyright 1992 by Jutta Degener and Carsten Bormann, Technische - * Universitaet Berlin. See the accompanying file "COPYRIGHT" for - * details. THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. - */ - -/* $Header$ */ - -#include "private.h" -#include "gsm.h" -#include "proto.h" - -void gsm_encode P3((s, source, c), gsm s, gsm_signal * source, gsm_byte * c) -{ - word LARc[8], Nc[4], Mc[4], bc[4], xmaxc[4], xmc[13*4]; - - Gsm_Coder(s, source, LARc, Nc, bc, Mc, xmaxc, xmc); - - - /* variable size - - GSM_MAGIC 4 - - LARc[0] 6 - LARc[1] 6 - LARc[2] 5 - LARc[3] 5 - LARc[4] 4 - LARc[5] 4 - LARc[6] 3 - LARc[7] 3 - - Nc[0] 7 - bc[0] 2 - Mc[0] 2 - xmaxc[0] 6 - xmc[0] 3 - xmc[1] 3 - xmc[2] 3 - xmc[3] 3 - xmc[4] 3 - xmc[5] 3 - xmc[6] 3 - xmc[7] 3 - xmc[8] 3 - xmc[9] 3 - xmc[10] 3 - xmc[11] 3 - xmc[12] 3 - - Nc[1] 7 - bc[1] 2 - Mc[1] 2 - xmaxc[1] 6 - xmc[13] 3 - xmc[14] 3 - xmc[15] 3 - xmc[16] 3 - xmc[17] 3 - xmc[18] 3 - xmc[19] 3 - xmc[20] 3 - xmc[21] 3 - xmc[22] 3 - xmc[23] 3 - xmc[24] 3 - xmc[25] 3 - - Nc[2] 7 - bc[2] 2 - Mc[2] 2 - xmaxc[2] 6 - xmc[26] 3 - xmc[27] 3 - xmc[28] 3 - xmc[29] 3 - xmc[30] 3 - xmc[31] 3 - xmc[32] 3 - xmc[33] 3 - xmc[34] 3 - xmc[35] 3 - xmc[36] 3 - xmc[37] 3 - xmc[38] 3 - - Nc[3] 7 - bc[3] 2 - Mc[3] 2 - xmaxc[3] 6 - xmc[39] 3 - xmc[40] 3 - xmc[41] 3 - xmc[42] 3 - xmc[43] 3 - xmc[44] 3 - xmc[45] 3 - xmc[46] 3 - xmc[47] 3 - xmc[48] 3 - xmc[49] 3 - xmc[50] 3 - xmc[51] 3 - */ - -#ifdef WAV49 - - if (s->wav_fmt) { - s->frame_index = !s->frame_index; - if (s->frame_index) { - - uword sr; - - sr = 0; - sr = sr >> 6 | LARc[0] << 10; - sr = sr >> 6 | LARc[1] << 10; - *c++ = sr >> 4; - sr = sr >> 5 | LARc[2] << 11; - *c++ = sr >> 7; - sr = sr >> 5 | LARc[3] << 11; - sr = sr >> 4 | LARc[4] << 12; - *c++ = sr >> 6; - sr = sr >> 4 | LARc[5] << 12; - sr = sr >> 3 | LARc[6] << 13; - *c++ = sr >> 7; - sr = sr >> 3 | LARc[7] << 13; - sr = sr >> 7 | Nc[0] << 9; - *c++ = sr >> 5; - sr = sr >> 2 | bc[0] << 14; - sr = sr >> 2 | Mc[0] << 14; - sr = sr >> 6 | xmaxc[0] << 10; - *c++ = sr >> 3; - sr = sr >> 3 | xmc[0] << 13; - *c++ = sr >> 8; - sr = sr >> 3 | xmc[1] << 13; - sr = sr >> 3 | xmc[2] << 13; - sr = sr >> 3 | xmc[3] << 13; - *c++ = sr >> 7; - sr = sr >> 3 | xmc[4] << 13; - sr = sr >> 3 | xmc[5] << 13; - sr = sr >> 3 | xmc[6] << 13; - *c++ = sr >> 6; - sr = sr >> 3 | xmc[7] << 13; - sr = sr >> 3 | xmc[8] << 13; - *c++ = sr >> 8; - sr = sr >> 3 | xmc[9] << 13; - sr = sr >> 3 | xmc[10] << 13; - sr = sr >> 3 | xmc[11] << 13; - *c++ = sr >> 7; - sr = sr >> 3 | xmc[12] << 13; - sr = sr >> 7 | Nc[1] << 9; - *c++ = sr >> 5; - sr = sr >> 2 | bc[1] << 14; - sr = sr >> 2 | Mc[1] << 14; - sr = sr >> 6 | xmaxc[1] << 10; - *c++ = sr >> 3; - sr = sr >> 3 | xmc[13] << 13; - *c++ = sr >> 8; - sr = sr >> 3 | xmc[14] << 13; - sr = sr >> 3 | xmc[15] << 13; - sr = sr >> 3 | xmc[16] << 13; - *c++ = sr >> 7; - sr = sr >> 3 | xmc[17] << 13; - sr = sr >> 3 | xmc[18] << 13; - sr = sr >> 3 | xmc[19] << 13; - *c++ = sr >> 6; - sr = sr >> 3 | xmc[20] << 13; - sr = sr >> 3 | xmc[21] << 13; - *c++ = sr >> 8; - sr = sr >> 3 | xmc[22] << 13; - sr = sr >> 3 | xmc[23] << 13; - sr = sr >> 3 | xmc[24] << 13; - *c++ = sr >> 7; - sr = sr >> 3 | xmc[25] << 13; - sr = sr >> 7 | Nc[2] << 9; - *c++ = sr >> 5; - sr = sr >> 2 | bc[2] << 14; - sr = sr >> 2 | Mc[2] << 14; - sr = sr >> 6 | xmaxc[2] << 10; - *c++ = sr >> 3; - sr = sr >> 3 | xmc[26] << 13; - *c++ = sr >> 8; - sr = sr >> 3 | xmc[27] << 13; - sr = sr >> 3 | xmc[28] << 13; - sr = sr >> 3 | xmc[29] << 13; - *c++ = sr >> 7; - sr = sr >> 3 | xmc[30] << 13; - sr = sr >> 3 | xmc[31] << 13; - sr = sr >> 3 | xmc[32] << 13; - *c++ = sr >> 6; - sr = sr >> 3 | xmc[33] << 13; - sr = sr >> 3 | xmc[34] << 13; - *c++ = sr >> 8; - sr = sr >> 3 | xmc[35] << 13; - sr = sr >> 3 | xmc[36] << 13; - sr = sr >> 3 | xmc[37] << 13; - *c++ = sr >> 7; - sr = sr >> 3 | xmc[38] << 13; - sr = sr >> 7 | Nc[3] << 9; - *c++ = sr >> 5; - sr = sr >> 2 | bc[3] << 14; - sr = sr >> 2 | Mc[3] << 14; - sr = sr >> 6 | xmaxc[3] << 10; - *c++ = sr >> 3; - sr = sr >> 3 | xmc[39] << 13; - *c++ = sr >> 8; - sr = sr >> 3 | xmc[40] << 13; - sr = sr >> 3 | xmc[41] << 13; - sr = sr >> 3 | xmc[42] << 13; - *c++ = sr >> 7; - sr = sr >> 3 | xmc[43] << 13; - sr = sr >> 3 | xmc[44] << 13; - sr = sr >> 3 | xmc[45] << 13; - *c++ = sr >> 6; - sr = sr >> 3 | xmc[46] << 13; - sr = sr >> 3 | xmc[47] << 13; - *c++ = sr >> 8; - sr = sr >> 3 | xmc[48] << 13; - sr = sr >> 3 | xmc[49] << 13; - sr = sr >> 3 | xmc[50] << 13; - *c++ = sr >> 7; - sr = sr >> 3 | xmc[51] << 13; - sr = sr >> 4; - *c = sr >> 8; - s->frame_chain = *c; - } - else { - uword sr; - - sr = 0; - sr = sr >> 4 | s->frame_chain << 12; - sr = sr >> 6 | LARc[0] << 10; - *c++ = sr >> 6; - sr = sr >> 6 | LARc[1] << 10; - *c++ = sr >> 8; - sr = sr >> 5 | LARc[2] << 11; - sr = sr >> 5 | LARc[3] << 11; - *c++ = sr >> 6; - sr = sr >> 4 | LARc[4] << 12; - sr = sr >> 4 | LARc[5] << 12; - *c++ = sr >> 6; - sr = sr >> 3 | LARc[6] << 13; - sr = sr >> 3 | LARc[7] << 13; - *c++ = sr >> 8; - sr = sr >> 7 | Nc[0] << 9; - sr = sr >> 2 | bc[0] << 14; - *c++ = sr >> 7; - sr = sr >> 2 | Mc[0] << 14; - sr = sr >> 6 | xmaxc[0] << 10; - *c++ = sr >> 7; - sr = sr >> 3 | xmc[0] << 13; - sr = sr >> 3 | xmc[1] << 13; - sr = sr >> 3 | xmc[2] << 13; - *c++ = sr >> 6; - sr = sr >> 3 | xmc[3] << 13; - sr = sr >> 3 | xmc[4] << 13; - *c++ = sr >> 8; - sr = sr >> 3 | xmc[5] << 13; - sr = sr >> 3 | xmc[6] << 13; - sr = sr >> 3 | xmc[7] << 13; - *c++ = sr >> 7; - sr = sr >> 3 | xmc[8] << 13; - sr = sr >> 3 | xmc[9] << 13; - sr = sr >> 3 | xmc[10] << 13; - *c++ = sr >> 6; - sr = sr >> 3 | xmc[11] << 13; - sr = sr >> 3 | xmc[12] << 13; - *c++ = sr >> 8; - sr = sr >> 7 | Nc[1] << 9; - sr = sr >> 2 | bc[1] << 14; - *c++ = sr >> 7; - sr = sr >> 2 | Mc[1] << 14; - sr = sr >> 6 | xmaxc[1] << 10; - *c++ = sr >> 7; - sr = sr >> 3 | xmc[13] << 13; - sr = sr >> 3 | xmc[14] << 13; - sr = sr >> 3 | xmc[15] << 13; - *c++ = sr >> 6; - sr = sr >> 3 | xmc[16] << 13; - sr = sr >> 3 | xmc[17] << 13; - *c++ = sr >> 8; - sr = sr >> 3 | xmc[18] << 13; - sr = sr >> 3 | xmc[19] << 13; - sr = sr >> 3 | xmc[20] << 13; - *c++ = sr >> 7; - sr = sr >> 3 | xmc[21] << 13; - sr = sr >> 3 | xmc[22] << 13; - sr = sr >> 3 | xmc[23] << 13; - *c++ = sr >> 6; - sr = sr >> 3 | xmc[24] << 13; - sr = sr >> 3 | xmc[25] << 13; - *c++ = sr >> 8; - sr = sr >> 7 | Nc[2] << 9; - sr = sr >> 2 | bc[2] << 14; - *c++ = sr >> 7; - sr = sr >> 2 | Mc[2] << 14; - sr = sr >> 6 | xmaxc[2] << 10; - *c++ = sr >> 7; - sr = sr >> 3 | xmc[26] << 13; - sr = sr >> 3 | xmc[27] << 13; - sr = sr >> 3 | xmc[28] << 13; - *c++ = sr >> 6; - sr = sr >> 3 | xmc[29] << 13; - sr = sr >> 3 | xmc[30] << 13; - *c++ = sr >> 8; - sr = sr >> 3 | xmc[31] << 13; - sr = sr >> 3 | xmc[32] << 13; - sr = sr >> 3 | xmc[33] << 13; - *c++ = sr >> 7; - sr = sr >> 3 | xmc[34] << 13; - sr = sr >> 3 | xmc[35] << 13; - sr = sr >> 3 | xmc[36] << 13; - *c++ = sr >> 6; - sr = sr >> 3 | xmc[37] << 13; - sr = sr >> 3 | xmc[38] << 13; - *c++ = sr >> 8; - sr = sr >> 7 | Nc[3] << 9; - sr = sr >> 2 | bc[3] << 14; - *c++ = sr >> 7; - sr = sr >> 2 | Mc[3] << 14; - sr = sr >> 6 | xmaxc[3] << 10; - *c++ = sr >> 7; - sr = sr >> 3 | xmc[39] << 13; - sr = sr >> 3 | xmc[40] << 13; - sr = sr >> 3 | xmc[41] << 13; - *c++ = sr >> 6; - sr = sr >> 3 | xmc[42] << 13; - sr = sr >> 3 | xmc[43] << 13; - *c++ = sr >> 8; - sr = sr >> 3 | xmc[44] << 13; - sr = sr >> 3 | xmc[45] << 13; - sr = sr >> 3 | xmc[46] << 13; - *c++ = sr >> 7; - sr = sr >> 3 | xmc[47] << 13; - sr = sr >> 3 | xmc[48] << 13; - sr = sr >> 3 | xmc[49] << 13; - *c++ = sr >> 6; - sr = sr >> 3 | xmc[50] << 13; - sr = sr >> 3 | xmc[51] << 13; - *c++ = sr >> 8; - } - } - - else - -#endif /* WAV49 */ - { - - *c++ = ((GSM_MAGIC & 0xF) << 4) /* 1 */ - | ((LARc[0] >> 2) & 0xF); - *c++ = ((LARc[0] & 0x3) << 6) - | (LARc[1] & 0x3F); - *c++ = ((LARc[2] & 0x1F) << 3) - | ((LARc[3] >> 2) & 0x7); - *c++ = ((LARc[3] & 0x3) << 6) - | ((LARc[4] & 0xF) << 2) - | ((LARc[5] >> 2) & 0x3); - *c++ = ((LARc[5] & 0x3) << 6) - | ((LARc[6] & 0x7) << 3) - | (LARc[7] & 0x7); - *c++ = ((Nc[0] & 0x7F) << 1) - | ((bc[0] >> 1) & 0x1); - *c++ = ((bc[0] & 0x1) << 7) - | ((Mc[0] & 0x3) << 5) - | ((xmaxc[0] >> 1) & 0x1F); - *c++ = ((xmaxc[0] & 0x1) << 7) - | ((xmc[0] & 0x7) << 4) - | ((xmc[1] & 0x7) << 1) - | ((xmc[2] >> 2) & 0x1); - *c++ = ((xmc[2] & 0x3) << 6) - | ((xmc[3] & 0x7) << 3) - | (xmc[4] & 0x7); - *c++ = ((xmc[5] & 0x7) << 5) /* 10 */ - | ((xmc[6] & 0x7) << 2) - | ((xmc[7] >> 1) & 0x3); - *c++ = ((xmc[7] & 0x1) << 7) - | ((xmc[8] & 0x7) << 4) - | ((xmc[9] & 0x7) << 1) - | ((xmc[10] >> 2) & 0x1); - *c++ = ((xmc[10] & 0x3) << 6) - | ((xmc[11] & 0x7) << 3) - | (xmc[12] & 0x7); - *c++ = ((Nc[1] & 0x7F) << 1) - | ((bc[1] >> 1) & 0x1); - *c++ = ((bc[1] & 0x1) << 7) - | ((Mc[1] & 0x3) << 5) - | ((xmaxc[1] >> 1) & 0x1F); - *c++ = ((xmaxc[1] & 0x1) << 7) - | ((xmc[13] & 0x7) << 4) - | ((xmc[14] & 0x7) << 1) - | ((xmc[15] >> 2) & 0x1); - *c++ = ((xmc[15] & 0x3) << 6) - | ((xmc[16] & 0x7) << 3) - | (xmc[17] & 0x7); - *c++ = ((xmc[18] & 0x7) << 5) - | ((xmc[19] & 0x7) << 2) - | ((xmc[20] >> 1) & 0x3); - *c++ = ((xmc[20] & 0x1) << 7) - | ((xmc[21] & 0x7) << 4) - | ((xmc[22] & 0x7) << 1) - | ((xmc[23] >> 2) & 0x1); - *c++ = ((xmc[23] & 0x3) << 6) - | ((xmc[24] & 0x7) << 3) - | (xmc[25] & 0x7); - *c++ = ((Nc[2] & 0x7F) << 1) /* 20 */ - | ((bc[2] >> 1) & 0x1); - *c++ = ((bc[2] & 0x1) << 7) - | ((Mc[2] & 0x3... [truncated message content] |
From: <st...@us...> - 2003-06-19 14:03:28
|
Update of /cvsroot/iaxclient/iaxclient/lib/gsm/inc In directory sc8-pr-cvs1:/tmp/cvs-serv14925/inc Modified Files: config.h gsm.h private.h proto.h unproto.h Log Message: change things back to LF only line termination. (broke some compiles with CRLF). Index: config.h =================================================================== RCS file: /cvsroot/iaxclient/iaxclient/lib/gsm/inc/config.h,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -d -r1.1.1.1 -r1.2 --- config.h 14 Mar 2003 15:34:52 -0000 1.1.1.1 +++ config.h 19 Jun 2003 14:03:24 -0000 1.2 @@ -1,37 +1,37 @@ -/* - * Copyright 1992 by Jutta Degener and Carsten Bormann, Technische - * Universitaet Berlin. See the accompanying file "COPYRIGHT" for - * details. THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. - */ - -/*$Header$*/ - -#ifndef CONFIG_H -#define CONFIG_H - -/*efine SIGHANDLER_T int /* signal handlers are void */ -/*efine HAS_SYSV_SIGNAL 1 /* sigs not blocked/reset? */ - -#define HAS_STDLIB_H 1 /* /usr/include/stdlib.h */ -/*efine HAS_LIMITS_H 1 /* /usr/include/limits.h */ -#define HAS_FCNTL_H 1 /* /usr/include/fcntl.h */ -/*efine HAS_ERRNO_DECL 1 /* errno.h declares errno */ - -#define HAS_FSTAT 1 /* fstat syscall */ -#define HAS_FCHMOD 1 /* fchmod syscall */ -#define HAS_CHMOD 1 /* chmod syscall */ -#define HAS_FCHOWN 1 /* fchown syscall */ -#define HAS_CHOWN 1 /* chown syscall */ -/*efine HAS__FSETMODE 1 /* _fsetmode -- set file mode */ - -#define HAS_STRING_H 1 /* /usr/include/string.h */ -/*efine HAS_STRINGS_H 1 /* /usr/include/strings.h */ - -#define HAS_UNISTD_H 1 /* /usr/include/unistd.h */ -#define HAS_UTIME 1 /* POSIX utime(path, times) */ -/*efine HAS_UTIMES 1 /* use utimes() syscall instead */ -#define HAS_UTIME_H 1 /* UTIME header file */ -/*efine HAS_UTIMBUF 1 /* struct utimbuf */ -/*efine HAS_UTIMEUSEC 1 /* microseconds in utimbuf? */ - -#endif /* CONFIG_H */ +/* + * Copyright 1992 by Jutta Degener and Carsten Bormann, Technische + * Universitaet Berlin. See the accompanying file "COPYRIGHT" for + * details. THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. + */ + +/*$Header$*/ + +#ifndef CONFIG_H +#define CONFIG_H + +/*efine SIGHANDLER_T int /* signal handlers are void */ +/*efine HAS_SYSV_SIGNAL 1 /* sigs not blocked/reset? */ + +#define HAS_STDLIB_H 1 /* /usr/include/stdlib.h */ +/*efine HAS_LIMITS_H 1 /* /usr/include/limits.h */ +#define HAS_FCNTL_H 1 /* /usr/include/fcntl.h */ +/*efine HAS_ERRNO_DECL 1 /* errno.h declares errno */ + +#define HAS_FSTAT 1 /* fstat syscall */ +#define HAS_FCHMOD 1 /* fchmod syscall */ +#define HAS_CHMOD 1 /* chmod syscall */ +#define HAS_FCHOWN 1 /* fchown syscall */ +#define HAS_CHOWN 1 /* chown syscall */ +/*efine HAS__FSETMODE 1 /* _fsetmode -- set file mode */ + +#define HAS_STRING_H 1 /* /usr/include/string.h */ +/*efine HAS_STRINGS_H 1 /* /usr/include/strings.h */ + +#define HAS_UNISTD_H 1 /* /usr/include/unistd.h */ +#define HAS_UTIME 1 /* POSIX utime(path, times) */ +/*efine HAS_UTIMES 1 /* use utimes() syscall instead */ +#define HAS_UTIME_H 1 /* UTIME header file */ +/*efine HAS_UTIMBUF 1 /* struct utimbuf */ +/*efine HAS_UTIMEUSEC 1 /* microseconds in utimbuf? */ + +#endif /* CONFIG_H */ Index: gsm.h =================================================================== RCS file: /cvsroot/iaxclient/iaxclient/lib/gsm/inc/gsm.h,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -d -r1.1.1.1 -r1.2 --- gsm.h 14 Mar 2003 15:34:52 -0000 1.1.1.1 +++ gsm.h 19 Jun 2003 14:03:24 -0000 1.2 @@ -1,71 +1,71 @@ -/* - * Copyright 1992 by Jutta Degener and Carsten Bormann, Technische - * Universitaet Berlin. See the accompanying file "COPYRIGHT" for - * details. THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. - */ - -/*$Header$*/ - -#ifndef GSM_H -#define GSM_H - -#ifdef __cplusplus -# define NeedFunctionPrototypes 1 -#endif - -#if __STDC__ -# define NeedFunctionPrototypes 1 -#endif - -#ifdef _NO_PROTO -# undef NeedFunctionPrototypes -#endif - -#ifdef NeedFunctionPrototypes -# include <stdio.h> /* for FILE * */ -#endif - -#undef GSM_P -#if NeedFunctionPrototypes -# define GSM_P( protos ) protos -#else -# define GSM_P( protos ) ( /* protos */ ) -#endif - -/* - * Interface - */ - -typedef struct gsm_state * gsm; -typedef short gsm_signal; /* signed 16 bit */ -typedef unsigned char gsm_byte; -typedef gsm_byte gsm_frame[33]; /* 33 * 8 bits */ - -#define GSM_MAGIC 0xD /* 13 kbit/s RPE-LTP */ - -#define GSM_PATCHLEVEL 10 -#define GSM_MINOR 0 -#define GSM_MAJOR 1 - -#define GSM_OPT_VERBOSE 1 -#define GSM_OPT_FAST 2 -#define GSM_OPT_LTP_CUT 3 -#define GSM_OPT_WAV49 4 -#define GSM_OPT_FRAME_INDEX 5 -#define GSM_OPT_FRAME_CHAIN 6 - -extern gsm gsm_create GSM_P((void)); -extern void gsm_destroy GSM_P((gsm)); - -extern int gsm_print GSM_P((FILE *, gsm, gsm_byte *)); -extern int gsm_option GSM_P((gsm, int, int *)); - -extern void gsm_encode GSM_P((gsm, gsm_signal *, gsm_byte *)); -extern int gsm_decode GSM_P((gsm, gsm_byte *, gsm_signal *)); - -extern int gsm_explode GSM_P((gsm, gsm_byte *, gsm_signal *)); -extern void gsm_implode GSM_P((gsm, gsm_signal *, gsm_byte *)); - -#undef GSM_P - -#endif /* GSM_H */ +/* + * Copyright 1992 by Jutta Degener and Carsten Bormann, Technische + * Universitaet Berlin. See the accompanying file "COPYRIGHT" for + * details. THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. + */ + +/*$Header$*/ + +#ifndef GSM_H +#define GSM_H + +#ifdef __cplusplus +# define NeedFunctionPrototypes 1 +#endif + +#if __STDC__ +# define NeedFunctionPrototypes 1 +#endif + +#ifdef _NO_PROTO +# undef NeedFunctionPrototypes +#endif + +#ifdef NeedFunctionPrototypes +# include <stdio.h> /* for FILE * */ +#endif + +#undef GSM_P +#if NeedFunctionPrototypes +# define GSM_P( protos ) protos +#else +# define GSM_P( protos ) ( /* protos */ ) +#endif + +/* + * Interface + */ + +typedef struct gsm_state * gsm; +typedef short gsm_signal; /* signed 16 bit */ +typedef unsigned char gsm_byte; +typedef gsm_byte gsm_frame[33]; /* 33 * 8 bits */ + +#define GSM_MAGIC 0xD /* 13 kbit/s RPE-LTP */ + +#define GSM_PATCHLEVEL 10 +#define GSM_MINOR 0 +#define GSM_MAJOR 1 + +#define GSM_OPT_VERBOSE 1 +#define GSM_OPT_FAST 2 +#define GSM_OPT_LTP_CUT 3 +#define GSM_OPT_WAV49 4 +#define GSM_OPT_FRAME_INDEX 5 +#define GSM_OPT_FRAME_CHAIN 6 + +extern gsm gsm_create GSM_P((void)); +extern void gsm_destroy GSM_P((gsm)); + +extern int gsm_print GSM_P((FILE *, gsm, gsm_byte *)); +extern int gsm_option GSM_P((gsm, int, int *)); + +extern void gsm_encode GSM_P((gsm, gsm_signal *, gsm_byte *)); +extern int gsm_decode GSM_P((gsm, gsm_byte *, gsm_signal *)); + +extern int gsm_explode GSM_P((gsm, gsm_byte *, gsm_signal *)); +extern void gsm_implode GSM_P((gsm, gsm_signal *, gsm_byte *)); + +#undef GSM_P + +#endif /* GSM_H */ Index: private.h =================================================================== RCS file: /cvsroot/iaxclient/iaxclient/lib/gsm/inc/private.h,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -d -r1.1.1.1 -r1.2 --- private.h 14 Mar 2003 15:34:52 -0000 1.1.1.1 +++ private.h 19 Jun 2003 14:03:24 -0000 1.2 @@ -1,308 +1,308 @@ -/* - * Copyright 1992 by Jutta Degener and Carsten Bormann, Technische - * Universitaet Berlin. See the accompanying file "COPYRIGHT" for - * details. THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. - */ - -/*$Header$*/ - -#ifndef PRIVATE_H -#define PRIVATE_H - -typedef short word; /* 16 bit signed int */ -typedef long longword; /* 32 bit signed int */ - -typedef unsigned short uword; /* unsigned word */ -typedef unsigned long ulongword; /* unsigned longword */ - -struct gsm_state { - - word dp0[ 280 ]; - - word z1; /* preprocessing.c, Offset_com. */ - longword L_z2; /* Offset_com. */ - int mp; /* Preemphasis */ - - word u[8]; /* short_term_aly_filter.c */ - word LARpp[2][8]; /* */ - word j; /* */ - - word ltp_cut; /* long_term.c, LTP crosscorr. */ - word nrp; /* 40 */ /* long_term.c, synthesis */ - word v[9]; /* short_term.c, synthesis */ - word msr; /* decoder.c, Postprocessing */ - - char verbose; /* only used if !NDEBUG */ - char fast; /* only used if FAST */ - - char wav_fmt; /* only used if WAV49 defined */ - unsigned char frame_index; /* odd/even chaining */ - unsigned char frame_chain; /* half-byte to carry forward */ -}; - - -#define MIN_WORD (-32767 - 1) -#define MAX_WORD 32767 - -#define MIN_LONGWORD (-2147483647 - 1) -#define MAX_LONGWORD 2147483647 - -#ifdef SASR /* flag: >> is a signed arithmetic shift right */ -#undef SASR -#define SASR(x, by) ((x) >> (by)) -#else -#define SASR(x, by) ((x) >= 0 ? (x) >> (by) : (~(-((x) + 1) >> (by)))) -#endif /* SASR */ - -#include "proto.h" - -/* - * Prototypes from add.c - */ -extern word gsm_mult P((word a, word b)); -extern longword gsm_L_mult P((word a, word b)); -extern word gsm_mult_r P((word a, word b)); - -extern word gsm_div P((word num, word denum)); - -extern word gsm_add P(( word a, word b )); -extern longword gsm_L_add P(( longword a, longword b )); - -extern word gsm_sub P((word a, word b)); -extern longword gsm_L_sub P((longword a, longword b)); - -extern word gsm_abs P((word a)); - -extern word gsm_norm P(( longword a )); - -extern longword gsm_L_asl P((longword a, int n)); -extern word gsm_asl P((word a, int n)); - -extern longword gsm_L_asr P((longword a, int n)); -extern word gsm_asr P((word a, int n)); - -/* - * Inlined functions from add.h - */ - -/* - * #define GSM_MULT_R(a, b) (* word a, word b, !(a == b == MIN_WORD) *) \ - * (0x0FFFF & SASR(((longword)(a) * (longword)(b) + 16384), 15)) - */ -#define GSM_MULT_R(a, b) /* word a, word b, !(a == b == MIN_WORD) */ \ - (SASR( ((longword)(a) * (longword)(b) + 16384), 15 )) - -# define GSM_MULT(a,b) /* word a, word b, !(a == b == MIN_WORD) */ \ - (SASR( ((longword)(a) * (longword)(b)), 15 )) - -# define GSM_L_MULT(a, b) /* word a, word b */ \ - (((longword)(a) * (longword)(b)) << 1) - -#if defined(__GNUC__) && defined(__i386__) - -static __inline__ int GSM_L_ADD(int a, int b) -{ - __asm__ __volatile__( - - "addl %2,%0; jno 0f; movl $0x7fffffff,%0; adcl $0,%0; 0:" - : "=r" (a) - : "0" (a), "ir" (b) - : "cc" - ); - return(a); -} - -static __inline__ short GSM_ADD(short a, short b) -{ - __asm__ __volatile__( - "addw %2,%0; jno 0f; movw $0x7fff,%0; adcw $0,%0; 0:" - : "=r" (a) - : "0" (a), "ir" (b) - : "cc" - ); - return(a); -} - -static __inline__ short GSM_SUB(short a, short b) -{ - __asm__ __volatile__( - "subw %2,%0; jno 0f; movw $0x7fff,%0; adcw $0,%0; 0:" - : "=r" (a) - : "0" (a), "ir" (b) - : "cc" - ); - return(a); -} - -#else - -# define GSM_L_ADD(a, b) \ - ( (a) < 0 ? ( (b) >= 0 ? (a) + (b) \ - : (utmp = (ulongword)-((a) + 1) + (ulongword)-((b) + 1)) \ - >= MAX_LONGWORD ? MIN_LONGWORD : -(longword)utmp-2 ) \ - : ((b) <= 0 ? (a) + (b) \ - : (utmp = (ulongword)(a) + (ulongword)(b)) >= MAX_LONGWORD \ - ? MAX_LONGWORD : utmp)) - -/* - * # define GSM_ADD(a, b) \ - * ((ltmp = (longword)(a) + (longword)(b)) >= MAX_WORD \ - * ? MAX_WORD : ltmp <= MIN_WORD ? MIN_WORD : ltmp) - */ -/* Nonportable, but faster: */ - -#define GSM_ADD(a, b) \ - ((ulongword)((ltmp = (longword)(a) + (longword)(b)) - MIN_WORD) > \ - MAX_WORD - MIN_WORD ? (ltmp > 0 ? MAX_WORD : MIN_WORD) : ltmp) - -# define GSM_SUB(a, b) \ - ((ltmp = (longword)(a) - (longword)(b)) >= MAX_WORD \ - ? MAX_WORD : ltmp <= MIN_WORD ? MIN_WORD : ltmp) - -#endif - -# define GSM_ABS(a) ((a) < 0 ? ((a) == MIN_WORD ? MAX_WORD : -(a)) : (a)) - -/* Use these if necessary: - -# define GSM_MULT_R(a, b) gsm_mult_r(a, b) -# define GSM_MULT(a, b) gsm_mult(a, b) -# define GSM_L_MULT(a, b) gsm_L_mult(a, b) - -# define GSM_L_ADD(a, b) gsm_L_add(a, b) -# define GSM_ADD(a, b) gsm_add(a, b) -# define GSM_SUB(a, b) gsm_sub(a, b) - -# define GSM_ABS(a) gsm_abs(a) - -*/ - -/* - * More prototypes from implementations.. - */ -extern void Gsm_Coder P(( - struct gsm_state * S, - word * s, /* [0..159] samples IN */ - word * LARc, /* [0..7] LAR coefficients OUT */ - word * Nc, /* [0..3] LTP lag OUT */ - word * bc, /* [0..3] coded LTP gain OUT */ - word * Mc, /* [0..3] RPE grid selection OUT */ - word * xmaxc,/* [0..3] Coded maximum amplitude OUT */ - word * xMc /* [13*4] normalized RPE samples OUT */)); - -extern void Gsm_Long_Term_Predictor P(( /* 4x for 160 samples */ - struct gsm_state * S, - word * d, /* [0..39] residual signal IN */ - word * dp, /* [-120..-1] d' IN */ - word * e, /* [0..40] OUT */ - word * dpp, /* [0..40] OUT */ - word * Nc, /* correlation lag OUT */ - word * bc /* gain factor OUT */)); - -extern void Gsm_LPC_Analysis P(( - struct gsm_state * S, - word * s, /* 0..159 signals IN/OUT */ - word * LARc)); /* 0..7 LARc's OUT */ - -extern void Gsm_Preprocess P(( - struct gsm_state * S, - word * s, word * so)); - -extern void Gsm_Encoding P(( - struct gsm_state * S, - word * e, - word * ep, - word * xmaxc, - word * Mc, - word * xMc)); - -extern void Gsm_Short_Term_Analysis_Filter P(( - struct gsm_state * S, - word * LARc, /* coded log area ratio [0..7] IN */ - word * d /* st res. signal [0..159] IN/OUT */)); - -extern void Gsm_Decoder P(( - struct gsm_state * S, - word * LARcr, /* [0..7] IN */ - word * Ncr, /* [0..3] IN */ - word * bcr, /* [0..3] IN */ - word * Mcr, /* [0..3] IN */ - word * xmaxcr, /* [0..3] IN */ - word * xMcr, /* [0..13*4] IN */ - word * s)); /* [0..159] OUT */ - -extern void Gsm_Decoding P(( - struct gsm_state * S, - word xmaxcr, - word Mcr, - word * xMcr, /* [0..12] IN */ - word * erp)); /* [0..39] OUT */ - -extern void Gsm_Long_Term_Synthesis_Filtering P(( - struct gsm_state* S, - word Ncr, - word bcr, - word * erp, /* [0..39] IN */ - word * drp)); /* [-120..-1] IN, [0..40] OUT */ - -void Gsm_RPE_Decoding P(( - struct gsm_state *S, - word xmaxcr, - word Mcr, - word * xMcr, /* [0..12], 3 bits IN */ - word * erp)); /* [0..39] OUT */ - -void Gsm_RPE_Encoding P(( - struct gsm_state * S, - word * e, /* -5..-1][0..39][40..44 IN/OUT */ - word * xmaxc, /* OUT */ - word * Mc, /* OUT */ - word * xMc)); /* [0..12] OUT */ - -extern void Gsm_Short_Term_Synthesis_Filter P(( - struct gsm_state * S, - word * LARcr, /* log area ratios [0..7] IN */ - word * drp, /* received d [0...39] IN */ - word * s)); /* signal s [0..159] OUT */ - -extern void Gsm_Update_of_reconstructed_short_time_residual_signal P(( - word * dpp, /* [0...39] IN */ - word * ep, /* [0...39] IN */ - word * dp)); /* [-120...-1] IN/OUT */ - -/* - * Tables from table.c - */ -#ifndef GSM_TABLE_C - -extern word gsm_A[8], gsm_B[8], gsm_MIC[8], gsm_MAC[8]; -extern word gsm_INVA[8]; -extern word gsm_DLB[4], gsm_QLB[4]; -extern word gsm_H[11]; -extern word gsm_NRFAC[8]; -extern word gsm_FAC[8]; - -#endif /* GSM_TABLE_C */ - -/* - * Debugging - */ -#ifdef NDEBUG - -# define gsm_debug_words(a, b, c, d) /* nil */ -# define gsm_debug_longwords(a, b, c, d) /* nil */ -# define gsm_debug_word(a, b) /* nil */ -# define gsm_debug_longword(a, b) /* nil */ - -#else /* !NDEBUG => DEBUG */ - - extern void gsm_debug_words P((char * name, int, int, word *)); - extern void gsm_debug_longwords P((char * name, int, int, longword *)); - extern void gsm_debug_longword P((char * name, longword)); - extern void gsm_debug_word P((char * name, word)); - -#endif /* !NDEBUG */ - -#include "unproto.h" - -#endif /* PRIVATE_H */ +/* + * Copyright 1992 by Jutta Degener and Carsten Bormann, Technische + * Universitaet Berlin. See the accompanying file "COPYRIGHT" for + * details. THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. + */ + +/*$Header$*/ + +#ifndef PRIVATE_H +#define PRIVATE_H + +typedef short word; /* 16 bit signed int */ +typedef long longword; /* 32 bit signed int */ + +typedef unsigned short uword; /* unsigned word */ +typedef unsigned long ulongword; /* unsigned longword */ + +struct gsm_state { + + word dp0[ 280 ]; + + word z1; /* preprocessing.c, Offset_com. */ + longword L_z2; /* Offset_com. */ + int mp; /* Preemphasis */ + + word u[8]; /* short_term_aly_filter.c */ + word LARpp[2][8]; /* */ + word j; /* */ + + word ltp_cut; /* long_term.c, LTP crosscorr. */ + word nrp; /* 40 */ /* long_term.c, synthesis */ + word v[9]; /* short_term.c, synthesis */ + word msr; /* decoder.c, Postprocessing */ + + char verbose; /* only used if !NDEBUG */ + char fast; /* only used if FAST */ + + char wav_fmt; /* only used if WAV49 defined */ + unsigned char frame_index; /* odd/even chaining */ + unsigned char frame_chain; /* half-byte to carry forward */ +}; + + +#define MIN_WORD (-32767 - 1) +#define MAX_WORD 32767 + +#define MIN_LONGWORD (-2147483647 - 1) +#define MAX_LONGWORD 2147483647 + +#ifdef SASR /* flag: >> is a signed arithmetic shift right */ +#undef SASR +#define SASR(x, by) ((x) >> (by)) +#else +#define SASR(x, by) ((x) >= 0 ? (x) >> (by) : (~(-((x) + 1) >> (by)))) +#endif /* SASR */ + +#include "proto.h" + +/* + * Prototypes from add.c + */ +extern word gsm_mult P((word a, word b)); +extern longword gsm_L_mult P((word a, word b)); +extern word gsm_mult_r P((word a, word b)); + +extern word gsm_div P((word num, word denum)); + +extern word gsm_add P(( word a, word b )); +extern longword gsm_L_add P(( longword a, longword b )); + +extern word gsm_sub P((word a, word b)); +extern longword gsm_L_sub P((longword a, longword b)); + +extern word gsm_abs P((word a)); + +extern word gsm_norm P(( longword a )); + +extern longword gsm_L_asl P((longword a, int n)); +extern word gsm_asl P((word a, int n)); + +extern longword gsm_L_asr P((longword a, int n)); +extern word gsm_asr P((word a, int n)); + +/* + * Inlined functions from add.h + */ + +/* + * #define GSM_MULT_R(a, b) (* word a, word b, !(a == b == MIN_WORD) *) \ + * (0x0FFFF & SASR(((longword)(a) * (longword)(b) + 16384), 15)) + */ +#define GSM_MULT_R(a, b) /* word a, word b, !(a == b == MIN_WORD) */ \ + (SASR( ((longword)(a) * (longword)(b) + 16384), 15 )) + +# define GSM_MULT(a,b) /* word a, word b, !(a == b == MIN_WORD) */ \ + (SASR( ((longword)(a) * (longword)(b)), 15 )) + +# define GSM_L_MULT(a, b) /* word a, word b */ \ + (((longword)(a) * (longword)(b)) << 1) + +#if defined(__GNUC__) && defined(__i386__) + +static __inline__ int GSM_L_ADD(int a, int b) +{ + __asm__ __volatile__( + + "addl %2,%0; jno 0f; movl $0x7fffffff,%0; adcl $0,%0; 0:" + : "=r" (a) + : "0" (a), "ir" (b) + : "cc" + ); + return(a); +} + +static __inline__ short GSM_ADD(short a, short b) +{ + __asm__ __volatile__( + "addw %2,%0; jno 0f; movw $0x7fff,%0; adcw $0,%0; 0:" + : "=r" (a) + : "0" (a), "ir" (b) + : "cc" + ); + return(a); +} + +static __inline__ short GSM_SUB(short a, short b) +{ + __asm__ __volatile__( + "subw %2,%0; jno 0f; movw $0x7fff,%0; adcw $0,%0; 0:" + : "=r" (a) + : "0" (a), "ir" (b) + : "cc" + ); + return(a); +} + +#else + +# define GSM_L_ADD(a, b) \ + ( (a) < 0 ? ( (b) >= 0 ? (a) + (b) \ + : (utmp = (ulongword)-((a) + 1) + (ulongword)-((b) + 1)) \ + >= MAX_LONGWORD ? MIN_LONGWORD : -(longword)utmp-2 ) \ + : ((b) <= 0 ? (a) + (b) \ + : (utmp = (ulongword)(a) + (ulongword)(b)) >= MAX_LONGWORD \ + ? MAX_LONGWORD : utmp)) + +/* + * # define GSM_ADD(a, b) \ + * ((ltmp = (longword)(a) + (longword)(b)) >= MAX_WORD \ + * ? MAX_WORD : ltmp <= MIN_WORD ? MIN_WORD : ltmp) + */ +/* Nonportable, but faster: */ + +#define GSM_ADD(a, b) \ + ((ulongword)((ltmp = (longword)(a) + (longword)(b)) - MIN_WORD) > \ + MAX_WORD - MIN_WORD ? (ltmp > 0 ? MAX_WORD : MIN_WORD) : ltmp) + +# define GSM_SUB(a, b) \ + ((ltmp = (longword)(a) - (longword)(b)) >= MAX_WORD \ + ? MAX_WORD : ltmp <= MIN_WORD ? MIN_WORD : ltmp) + +#endif + +# define GSM_ABS(a) ((a) < 0 ? ((a) == MIN_WORD ? MAX_WORD : -(a)) : (a)) + +/* Use these if necessary: + +# define GSM_MULT_R(a, b) gsm_mult_r(a, b) +# define GSM_MULT(a, b) gsm_mult(a, b) +# define GSM_L_MULT(a, b) gsm_L_mult(a, b) + +# define GSM_L_ADD(a, b) gsm_L_add(a, b) +# define GSM_ADD(a, b) gsm_add(a, b) +# define GSM_SUB(a, b) gsm_sub(a, b) + +# define GSM_ABS(a) gsm_abs(a) + +*/ + +/* + * More prototypes from implementations.. + */ +extern void Gsm_Coder P(( + struct gsm_state * S, + word * s, /* [0..159] samples IN */ + word * LARc, /* [0..7] LAR coefficients OUT */ + word * Nc, /* [0..3] LTP lag OUT */ + word * bc, /* [0..3] coded LTP gain OUT */ + word * Mc, /* [0..3] RPE grid selection OUT */ + word * xmaxc,/* [0..3] Coded maximum amplitude OUT */ + word * xMc /* [13*4] normalized RPE samples OUT */)); + +extern void Gsm_Long_Term_Predictor P(( /* 4x for 160 samples */ + struct gsm_state * S, + word * d, /* [0..39] residual signal IN */ + word * dp, /* [-120..-1] d' IN */ + word * e, /* [0..40] OUT */ + word * dpp, /* [0..40] OUT */ + word * Nc, /* correlation lag OUT */ + word * bc /* gain factor OUT */)); + +extern void Gsm_LPC_Analysis P(( + struct gsm_state * S, + word * s, /* 0..159 signals IN/OUT */ + word * LARc)); /* 0..7 LARc's OUT */ + +extern void Gsm_Preprocess P(( + struct gsm_state * S, + word * s, word * so)); + +extern void Gsm_Encoding P(( + struct gsm_state * S, + word * e, + word * ep, + word * xmaxc, + word * Mc, + word * xMc)); + +extern void Gsm_Short_Term_Analysis_Filter P(( + struct gsm_state * S, + word * LARc, /* coded log area ratio [0..7] IN */ + word * d /* st res. signal [0..159] IN/OUT */)); + +extern void Gsm_Decoder P(( + struct gsm_state * S, + word * LARcr, /* [0..7] IN */ + word * Ncr, /* [0..3] IN */ + word * bcr, /* [0..3] IN */ + word * Mcr, /* [0..3] IN */ + word * xmaxcr, /* [0..3] IN */ + word * xMcr, /* [0..13*4] IN */ + word * s)); /* [0..159] OUT */ + +extern void Gsm_Decoding P(( + struct gsm_state * S, + word xmaxcr, + word Mcr, + word * xMcr, /* [0..12] IN */ + word * erp)); /* [0..39] OUT */ + +extern void Gsm_Long_Term_Synthesis_Filtering P(( + struct gsm_state* S, + word Ncr, + word bcr, + word * erp, /* [0..39] IN */ + word * drp)); /* [-120..-1] IN, [0..40] OUT */ + +void Gsm_RPE_Decoding P(( + struct gsm_state *S, + word xmaxcr, + word Mcr, + word * xMcr, /* [0..12], 3 bits IN */ + word * erp)); /* [0..39] OUT */ + +void Gsm_RPE_Encoding P(( + struct gsm_state * S, + word * e, /* -5..-1][0..39][40..44 IN/OUT */ + word * xmaxc, /* OUT */ + word * Mc, /* OUT */ + word * xMc)); /* [0..12] OUT */ + +extern void Gsm_Short_Term_Synthesis_Filter P(( + struct gsm_state * S, + word * LARcr, /* log area ratios [0..7] IN */ + word * drp, /* received d [0...39] IN */ + word * s)); /* signal s [0..159] OUT */ + +extern void Gsm_Update_of_reconstructed_short_time_residual_signal P(( + word * dpp, /* [0...39] IN */ + word * ep, /* [0...39] IN */ + word * dp)); /* [-120...-1] IN/OUT */ + +/* + * Tables from table.c + */ +#ifndef GSM_TABLE_C + +extern word gsm_A[8], gsm_B[8], gsm_MIC[8], gsm_MAC[8]; +extern word gsm_INVA[8]; +extern word gsm_DLB[4], gsm_QLB[4]; +extern word gsm_H[11]; +extern word gsm_NRFAC[8]; +extern word gsm_FAC[8]; + +#endif /* GSM_TABLE_C */ + +/* + * Debugging + */ +#ifdef NDEBUG + +# define gsm_debug_words(a, b, c, d) /* nil */ +# define gsm_debug_longwords(a, b, c, d) /* nil */ +# define gsm_debug_word(a, b) /* nil */ +# define gsm_debug_longword(a, b) /* nil */ + +#else /* !NDEBUG => DEBUG */ + + extern void gsm_debug_words P((char * name, int, int, word *)); + extern void gsm_debug_longwords P((char * name, int, int, longword *)); + extern void gsm_debug_longword P((char * name, longword)); + extern void gsm_debug_word P((char * name, word)); + +#endif /* !NDEBUG */ + +#include "unproto.h" + +#endif /* PRIVATE_H */ Index: proto.h =================================================================== RCS file: /cvsroot/iaxclient/iaxclient/lib/gsm/inc/proto.h,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -d -r1.1.1.1 -r1.2 --- proto.h 14 Mar 2003 15:34:52 -0000 1.1.1.1 +++ proto.h 19 Jun 2003 14:03:24 -0000 1.2 @@ -1,65 +1,65 @@ -/* - * Copyright 1992 by Jutta Degener and Carsten Bormann, Technische - * Universitaet Berlin. See the accompanying file "COPYRIGHT" for - * details. THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. - */ - -/*$Header$*/ - -#ifndef PROTO_H -#define PROTO_H - -#if __cplusplus -# define NeedFunctionPrototypes 1 -#endif - -#if __STDC__ -# define NeedFunctionPrototypes 1 -#endif - -#ifdef _NO_PROTO -# undef NeedFunctionPrototypes -#endif - -#undef P /* gnu stdio.h actually defines this... */ -#undef P0 -#undef P1 -#undef P2 -#undef P3 -#undef P4 -#undef P5 -#undef P6 -#undef P7 -#undef P8 - -#if NeedFunctionPrototypes - -# define P( protos ) protos - -# define P0() (void) -# define P1(x, a) (a) -# define P2(x, a, b) (a, b) -# define P3(x, a, b, c) (a, b, c) -# define P4(x, a, b, c, d) (a, b, c, d) -# define P5(x, a, b, c, d, e) (a, b, c, d, e) -# define P6(x, a, b, c, d, e, f) (a, b, c, d, e, f) -# define P7(x, a, b, c, d, e, f, g) (a, b, c, d, e, f, g) -# define P8(x, a, b, c, d, e, f, g, h) (a, b, c, d, e, f, g, h) - -#else /* !NeedFunctionPrototypes */ - -# define P( protos ) ( /* protos */ ) - -# define P0() () -# define P1(x, a) x a; -# define P2(x, a, b) x a; b; -# define P3(x, a, b, c) x a; b; c; -# define P4(x, a, b, c, d) x a; b; c; d; -# define P5(x, a, b, c, d, e) x a; b; c; d; e; -# define P6(x, a, b, c, d, e, f) x a; b; c; d; e; f; -# define P7(x, a, b, c, d, e, f, g) x a; b; c; d; e; f; g; -# define P8(x, a, b, c, d, e, f, g, h) x a; b; c; d; e; f; g; h; - -#endif /* !NeedFunctionPrototypes */ - -#endif /* PROTO_H */ +/* + * Copyright 1992 by Jutta Degener and Carsten Bormann, Technische + * Universitaet Berlin. See the accompanying file "COPYRIGHT" for + * details. THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. + */ + +/*$Header$*/ + +#ifndef PROTO_H +#define PROTO_H + +#if __cplusplus +# define NeedFunctionPrototypes 1 +#endif + +#if __STDC__ +# define NeedFunctionPrototypes 1 +#endif + +#ifdef _NO_PROTO +# undef NeedFunctionPrototypes +#endif + +#undef P /* gnu stdio.h actually defines this... */ +#undef P0 +#undef P1 +#undef P2 +#undef P3 +#undef P4 +#undef P5 +#undef P6 +#undef P7 +#undef P8 + +#if NeedFunctionPrototypes + +# define P( protos ) protos + +# define P0() (void) +# define P1(x, a) (a) +# define P2(x, a, b) (a, b) +# define P3(x, a, b, c) (a, b, c) +# define P4(x, a, b, c, d) (a, b, c, d) +# define P5(x, a, b, c, d, e) (a, b, c, d, e) +# define P6(x, a, b, c, d, e, f) (a, b, c, d, e, f) +# define P7(x, a, b, c, d, e, f, g) (a, b, c, d, e, f, g) +# define P8(x, a, b, c, d, e, f, g, h) (a, b, c, d, e, f, g, h) + +#else /* !NeedFunctionPrototypes */ + +# define P( protos ) ( /* protos */ ) + +# define P0() () +# define P1(x, a) x a; +# define P2(x, a, b) x a; b; +# define P3(x, a, b, c) x a; b; c; +# define P4(x, a, b, c, d) x a; b; c; d; +# define P5(x, a, b, c, d, e) x a; b; c; d; e; +# define P6(x, a, b, c, d, e, f) x a; b; c; d; e; f; +# define P7(x, a, b, c, d, e, f, g) x a; b; c; d; e; f; g; +# define P8(x, a, b, c, d, e, f, g, h) x a; b; c; d; e; f; g; h; + +#endif /* !NeedFunctionPrototypes */ + +#endif /* PROTO_H */ Index: unproto.h =================================================================== RCS file: /cvsroot/iaxclient/iaxclient/lib/gsm/inc/unproto.h,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -d -r1.1.1.1 -r1.2 --- unproto.h 14 Mar 2003 15:34:52 -0000 1.1.1.1 +++ unproto.h 19 Jun 2003 14:03:24 -0000 1.2 @@ -1,23 +1,23 @@ -/* - * Copyright 1992 by Jutta Degener and Carsten Bormann, Technische - * Universitaet Berlin. See the accompanying file "COPYRIGHT" for - * details. THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. - */ - -/*$Header$*/ - -#ifdef PROTO_H /* sic */ -#undef PROTO_H - -#undef P -#undef P0 -#undef P1 -#undef P2 -#undef P3 -#undef P4 -#undef P5 -#undef P6 -#undef P7 -#undef P8 - -#endif /* PROTO_H */ +/* + * Copyright 1992 by Jutta Degener and Carsten Bormann, Technische + * Universitaet Berlin. See the accompanying file "COPYRIGHT" for + * details. THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. + */ + +/*$Header$*/ + +#ifdef PROTO_H /* sic */ +#undef PROTO_H + +#undef P +#undef P0 +#undef P1 +#undef P2 +#undef P3 +#undef P4 +#undef P5 +#undef P6 +#undef P7 +#undef P8 + +#endif /* PROTO_H */ |
From: <st...@us...> - 2003-06-19 14:02:32
|
Update of /cvsroot/iaxclient/iaxclient/lib/libiax2/src In directory sc8-pr-cvs1:/tmp/cvs-serv14855 Modified Files: iax.c Log Message: different fixes for same bugs (merge with Mark). Index: iax.c =================================================================== RCS file: /cvsroot/iaxclient/iaxclient/lib/libiax2/src/iax.c,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- iax.c 12 Jun 2003 19:03:31 -0000 1.6 +++ iax.c 19 Jun 2003 14:02:29 -0000 1.7 @@ -613,7 +613,10 @@ or delayed, with retransmission */ struct ast_iax2_full_hdr *fh; struct ast_iax2_mini_hdr *mh; - double buffer[4096]; /* Buffer -- we use this for a frame later, double might ensure proper alignment? */ + struct { + struct iax_frame fr2; + unsigned char buffer[4096]; /* Buffer -- must preceed fr2 */ + } buf; struct iax_frame *fr; int res; int sendmini=0; @@ -621,7 +624,7 @@ unsigned int fts; /* Shut up GCC */ - buffer[0] = 0; + buf.buffer[0] = 0; if (!pvt) { IAXERROR "No private structure for packet?\n"); @@ -645,7 +648,7 @@ } /* Allocate an iax_frame */ if (now) { - fr = (struct iax_frame *)&buffer; + fr = &buf.fr2; } else fr = iax_frame_new(DIRECTION_OUTGRESS, f->datalen); if (!fr) { @@ -1656,7 +1659,7 @@ return cur; cur = cur->next; } - if (makenew && (dcallno == -1)) { + if (makenew && !dcallno) { cur = iax_session_new(); cur->peercallno = callno; cur->peeraddr.sin_addr.s_addr = sin->sin_addr.s_addr; @@ -2280,7 +2283,6 @@ struct ast_iax2_mini_hdr *mh = (struct ast_iax2_mini_hdr *)buf; struct iax_session *session; - /* THIS IS BAD: buf[len - 1] = '\0'; */ if (ntohs(fh->scallno) & IAX_FLAG_FULL) { /* Full size header */ if (len < sizeof(struct ast_iax2_full_hdr)) { |
From: <ka...@us...> - 2003-06-19 11:21:34
|
Update of /cvsroot/iaxclient/iaxclient/conf/app_conference In directory sc8-pr-cvs1:/tmp/cvs-serv21469/app_conference Log Message: Directory /cvsroot/iaxclient/iaxclient/conf/app_conference added to the repository |
From: <st...@us...> - 2003-06-18 21:18:14
|
Update of /cvsroot/iaxclient/iaxclient/simpleclient/wx In directory sc8-pr-cvs1:/tmp/cvs-serv2545 Modified Files: wx.cc Log Message: change OnSize method to work with MSW ListCtrl, which doesn't have OnSize method. Index: wx.cc =================================================================== RCS file: /cvsroot/iaxclient/iaxclient/simpleclient/wx/wx.cc,v retrieving revision 1.35 retrieving revision 1.36 diff -u -d -r1.35 -r1.36 --- wx.cc 18 Jun 2003 21:13:13 -0000 1.35 +++ wx.cc 18 Jun 2003 21:18:11 -0000 1.36 @@ -178,8 +178,8 @@ } void IAXCalls::OnSize(wxSizeEvent& evt) { + evt.Skip(); AutoSize(); - wxListCtrl::OnSize(evt); } int IAXCalls::HandleStateEvent(struct iaxc_ev_call_state c) |
From: <st...@us...> - 2003-06-18 21:13:16
|
Update of /cvsroot/iaxclient/iaxclient/simpleclient/wx In directory sc8-pr-cvs1:/tmp/cvs-serv1960 Modified Files: wx.cc Log Message: typo when commenting out debug. Index: wx.cc =================================================================== RCS file: /cvsroot/iaxclient/iaxclient/simpleclient/wx/wx.cc,v retrieving revision 1.34 retrieving revision 1.35 diff -u -d -r1.34 -r1.35 --- wx.cc 18 Jun 2003 21:00:28 -0000 1.34 +++ wx.cc 18 Jun 2003 21:13:13 -0000 1.35 @@ -519,8 +519,7 @@ strncpy( pass , tok.GetNextToken().c_str(), 256); strncpy( host , tok.GetNextToken().c_str(), 256); - //fprintf(stderr, "Registering user %s pass %s host %s\n", - user, pass, host); + //fprintf(stderr, "Registering user %s pass %s host %s\n", user, pass, host); iaxc_register(user, pass, host); } } |