Commit 23d4ab66 authored by jpbl's avatar jpbl

The merge is done

parent 154c986b
Jerome Oufella (jerome dot oufella at savoirfairelinux dot com)
- Many portions of code and bug fixes
Laurielle LEA (laurielle dot lea at savoirfairelinux dot com)
_ Implementation of SFLphone
Jean-Philippe Barrette-LaPierre
(jean-philippe dot barrette-lapierre at savoirfairelinux dot com)
- Autotools support
SFLphone (0.3.1) / 2005-06-01
SFLphone (0.4) / 2005-07-06
* Add autotools support
* Test on iMac with Ubuntu: Ok
* Handle CANCEL method
* PortAudio replace OSS and ALSA devices choice
* Add PortAudioCpp to make easy use of RingBuffer object for audio callback
* Add PortAudio library to make easy sound portability
* Fix a few memory leak
* Reorganisation of SFLphone architecture
* Handle error messages on screen
* Handle refused call
* Handle "refused call"
* Notification of remote RINGING event added
* Call management updated
......
Jean-Philippe Barrette-LaPierre (9 June 2005) version 0.3.1
- Added the autotools support.
\ No newline at end of file
Laurielle LEA (8 July 2005) version 0.4
- Stop program when error opening skin file
- Divide toggle() of qtguimainwindow.cpp in small functions
Laurielle LEA (7 July 2005) version 0.4
- Cleanup audiortp.cpp
- Replace #define by global variable in codecDescriptor.cpp
- Set mutex of ringbuffer in the functions of RingBuffer object
- Divide run() of audiortp.cpp in 3 small functions
- Changed device static function in Manager for configurationpanel.ui.h
- Updated README
Jean-Philippe Barrette-LaPierre (6 July 2005) version 0.4
- Fixed all autotools problems.
- Updated all autotools scripts to use PortAudioCpp
Jean-Philippe Barrette-LaPierre (9 June 2005) version 0.4
- Added the autotools support.
This is SFLPhone-0.3.1 release.
This is SFLPhone-0.4 release.
You need ccrtp-1.3.0 which needs commoncpp2>=1.3.0
libeXosip-0.9.0 needs libosip2-2.2.0
You also need PortAudio_v19
See http://www.sflphone.org/#downloads to download required libraries.
Dependencies build instructions:
......@@ -27,16 +28,17 @@ Dependencies build instructions:
make
make install
5/ For PortAudio_v19
./configure [option]
make
make install
How to compile SFLphone ?
-------------------------
If you want to activate alsa option in the setup configuration interface,
add -alsa:
./configure [-alsa]
./configure [option]
make
make install
make install (as root)
( Be sure you have the correct permissions).
......@@ -67,9 +69,13 @@ Why does it not compile ?
Fedora Core 2 Linux. Someone reported it works on gcc 3.4.
- If error occured while loading shared libraries,
you have to export LD_LIBRARY_PATH with your lib directory
you have to export LD_LIBRARY_PATH with your lib directory.
( example: export LD_LIBRARY_PATH=/opt/lib:${LD_LIBRARY_PATH} )
- If you don't install dependencies in classic install directories,
you have to export CXXFLAGS.
( example: export CXXFLAGS="-I/opt/include" )
Of course we love patches. And contribution. See http://www.sflphone.org/ .
The project infrastructure (CVS, bugtraqer, MLs) is maintained on :
http://forge.novell.com/modules/xfmod/project/?sflphone
......@@ -79,4 +85,5 @@ forge.novell mailing-list.
Laurielle Lea (laurielle.lea@savoirfairelinux.com)
Jerome Oufella (jerome.oufella@savoirfairelinux.com)
Starting from CVS there are a few things that need to be done before
the normal build procedure. These require autoconf and automake to
be installed.
Then run the following;
make -f Makefile.cvs
After this the normal build procedure in the README file can be
followed.
\ No newline at end of file
- We need to remove the KDE check
- We need to clean the optimization flags handling.
- We need to cleanup the compilation libs.
- We need to get rid of the pa_converters.h and pa_dither.h
- We need to cleanup the -O* handling
\ No newline at end of file
ForGUI:
-------
Add Clear button for GUI to clear screen (like Ctrl+L)
Add screen shell to display debug
For project core:
----------------
Management Config like about:config in Mozilla
Improvement of STUN
Add ZeroConf
Management of account (add, remove, ...)
Management of exceptions
Remove all warnings in compilation
Add unregister method when application is closed
For project dependencies:
------------------------
Improve the autotools scripts of PortAudioCpp
\ No newline at end of file
/* config.h.in. Generated from configure.ac by autoheader. */
/* Define to 1 if you have the <alsa/asoundlib.h> header file. */
#undef HAVE_ALSA_ASOUNDLIB_H
/* Define to 1 if you have the <Carbon/Carbon.h> header file. */
#undef HAVE_CARBON_CARBON_H
......@@ -54,9 +51,6 @@
/* Define if you have the res_init prototype */
#undef HAVE_RES_INIT_PROTO
/* Define if you have a STL implementation by SGI */
#undef HAVE_SGI_STL
/* Define to 1 if you have the `snprintf' function. */
#undef HAVE_SNPRINTF
......@@ -144,9 +138,6 @@
/* Version number of package */
#undef VERSION
/* Defined if compiling without arts */
#undef WITHOUT_ARTS
/*
* jpeg.h needs HAVE_BOOLEAN, when the system uses boolean in system
* headers and I'm too lazy to write a configure test as long as only
......
......@@ -3,19 +3,14 @@ AC_INIT(acinclude.m4)
AM_CONFIG_HEADER(config.h)
dnl figure out the sflphone version
VERSION=`sed -ne 's/^#define SFLPHONE_VERSION "\(.*\)"/\1/p' ${srcdir}/src/global.h`
VERSION=`sed -ne 's/^#define VERSION "\(.*\)"/\1/p' src/global.h`
AC_SUBST(VERSION)
dnl get rid of release number
RPM_VERSION=`echo $VERSION | sed -ne 's/-//p' `
AC_SUBST(RPM_VERSION)
LIBS="$LIBS -lstdc++"
dnl
dnl we extract the numerical version
VERSIONNUM=`sed -ne 's/^#define SFLPHONE_VERSION_NUM 0x\(\\d\)/\1/p' ${srcdir}/src/global.h`
AC_SUBST(VERSIONNUM)
dnl
dnl Solaris pkgadd support definitions
......@@ -31,9 +26,16 @@ AC_LANG_CPLUSPLUS
AC_PROG_CXX
AC_PROG_CC
KDE_USE_QT(3.3)
KDE_DO_IT_ALL(sflphone, $VERSION)
AC_PATH_QT
dnl KDE_USE_QT(3.3)
AC_CANONICAL_SYSTEM
AC_ARG_PROGRAM
AM_INIT_AUTOMAKE(sflphone, $VERSION)
AM_DISABLE_LIBRARIES
AC_PROG_LIBTOOL
AC_CHECK_COMPILERS
CXXFLAGS="$CXXFLAGS $USE_EXCEPTIONS "
SFLPHONE_CXXFLAGS=""
......@@ -53,10 +55,13 @@ AC_HEADER_STDC
AC_CHECK_HEADERS( \
ostream \
eXosip/eXosip.h \
alsa/asoundlib.h \
portaudio.h \
)
LIBCCGNU2_MIN_VERSION=1.3.1
PKG_CHECK_MODULES(libccgnu2, libccgnu2 >= ${LIBCCGNU2_MIN_VERSION})
SFLPHONE_CXXFLAGS="$SFLPHONE_CXXFLAGS $libccgnu2_CFLAGS"
SFLPHONE_LIBS="$SFLPHONE_LIBS $libccgnu2_LIBS"
LIBCCEXT2_MIN_VERSION=1.3.1
PKG_CHECK_MODULES(libccext2, libccext2 >= ${LIBCCEXT2_MIN_VERSION})
......@@ -83,47 +88,6 @@ dnl AC_MSG_ERROR([*** missing gsm.h. You need a working GSM 06.10 lossy speec
dnl fi
dnl SFLPHONE_LIBS="$SFLPHONE_LIBS -lgsm"
if test $ac_cv_header_alsa_asoundlib_h = no; then
AC_MSG_ERROR([*** missing alsa/asoundlib.h. You need a working alsa-lib installation. See http://www.alsa-project.org/])
fi
SFLPHONE_LIBS="$SFLPHONE_LIBS -lasound"
AC_MSG_CHECKING([warning make an error on compilation])
AC_ARG_ENABLE(ewarning,
[ --enable-ewarning Enable error on compilation warning [default=yes]],
[
AC_MSG_RESULT(no)
],
[
AC_MSG_RESULT(yes)
CXXFLAGS="$CXXFLAGS -Werror"
]
)
AC_MSG_CHECKING([whether to disable -O* optimization flags])
AC_ARG_ENABLE(oflags,
[ --disable-oflags Disable -O* optimization flags [default=no]],
[
AC_MSG_RESULT(yes)
NEWFLAGS=""
for flag in $CXXFLAGS; do
case "$flag" in
-O*)
dnl echo "cut off $flag"
;;
*)
NEWFLAGS="$NEWFLAGS $flag"
;;
esac
done
CXXFLAGS=$NEWFLAGS
],
[
AC_MSG_RESULT(no)
]
)
AC_MSG_CHECKING([whether to enable the maintener code])
AC_ARG_ENABLE(maintener,
[ --enable-maintener Enable maintener code [default=no]],
......@@ -158,10 +122,16 @@ LIBS="$LIBS $SFLPHONE_LIBS $LIBQT"
dnl AC_CONFIG_FILES(
AC_OUTPUT(
sflphone.spec \
Makefile \
src/Makefile \
src/audio/Makefile \
src/audio/gsm/Makefile \
src/audio/pacpp/Makefile \
src/audio/pacpp/include/Makefile \
src/audio/pacpp/include/portaudiocpp/Makefile \
src/audio/pacpp/source/Makefile \
src/audio/pacpp/source/portaudiocpp/Makefile \
src/gui/Makefile \
src/gui/qt/Makefile \
stund/Makefile \
......
......@@ -15,7 +15,6 @@ sflphone_SOURCES = \
voIPLink.cpp \
sipcall.cpp \
skin.cpp \
trayicon_x11.cpp \
manager.h \
global.h \
configitem.h \
......@@ -36,13 +35,12 @@ sflphone_SOURCES = \
sflphone_CXXFLAGS = -DPREFIX=\"$(prefix)\" -DPROGSHAREDIR=\"${datadir}/sflphone\"
sflphone_LDFLAGS = $(KDE_RPATH) $(all_libraries)
sflphone_LDFLAGS = $(QT_LDFLAGS) $(X_LDFLAGS)
sflphone_LDADD = gui/libguiframework.la audio/libaudio.la ../stund/libstun.la -lpthread
KDE_CXXFLAGS = $(USE_EXCEPTIONS)
AM_CPPFLAGS = -I$(qt_includes) $(all_includes)
AM_CPPFLAGS = $(QT_INCLUDES) $(X_INCLUDES) -Iaudio/pacpp/include
......
SUBDIRS = gsm
SUBDIRS = gsm pacpp
noinst_LTLIBRARIES = libaudio.la
libaudio_la_SOURCES = \
alaw.cpp alaw.h \
audiobuffer.cpp audiobuffer.h \
audiocodec.cpp audiocodec.h \
audiodrivers.cpp audiodrivers.h \
audiodriversalsa.cpp audiodriversalsa.h \
audiodriversoss.cpp audiodriversoss.h \
audiodriversportaudio.cpp audiodriversportaudio.h \
audiolayer.cpp audiolayer.h \
audiortp.cpp audiortp.h \
codecDescriptor.cpp codecDescriptor.h \
common.h \
......@@ -18,9 +14,10 @@ libaudio_la_SOURCES = \
dtmfgenerator.cpp dtmfgenerator.h \
g711.cpp g711.h \
gsmcodec.cpp gsmcodec.h \
pa_converters.h pa_dither.h \
ringbuffer.cpp ringbuffer.h \
tonegenerator.cpp tonegenerator.h \
ulaw.cpp ulaw.h
libaudio_la_LIBADD = gsm/libgsm.la
AM_CXXFLAGS = -Ipacpp/include/
libaudio_la_LIBADD = gsm/libgsm.la pacpp/source/portaudiocpp/libportaudiocpp.la
/**
* Copyright (C) 2004-2005 Savoir-Faire Linux inc.
* Author: Laurielle Lea <laurielle.lea@savoirfairelinux.com>
*
* Portions Copyright (c) 2000 Billy Biggs <bbiggs@div8.net>
* Portions Copyright (c) 2004 Wirlab <kphone@wirlab.net>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include "audiobuffer.h"
#include "../global.h"
#include <string.h>
AudioBuffer::AudioBuffer (void) {
data = new short[SIZEBUF];
bzero(data, SIZEBUF);
size = SIZEBUF;
realsize = size;
}
AudioBuffer::~AudioBuffer (void)
{
delete[] static_cast<short *>(data);
}
void AudioBuffer::resize (size_t newsize)
{
if (newsize > realsize) {
delete[] static_cast<short *>(data);
data = new short[newsize];
size = newsize;
realsize = newsize;
} else {
size = newsize;
}
}
void
AudioBuffer::setData (short *buf, int vol) {
short *databuf = (short*)data;
for (int i = 0; i < (int)size; i++) {
databuf[i] = buf[i]*vol/100;
}
}
/**
* Copyright (C) 2004-2005 Savoir-Faire Linux inc.
* Author: Laurielle Lea <laurielle.lea@savoirfairelinux.com>
*
* Portions Copyright (c) 2000 Billy Biggs <bbiggs@div8.net>
* Portions Copyright (c) 2004 Wirlab <kphone@wirlab.net>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#ifndef __AUDIOBUFFER_H__
#define __AUDIOBUFFER_H__
#include <stddef.h>
#include <stdlib.h>
#include <stdio.h>
/**
* Small class for passing around buffers of audio data.
*/
class AudioBuffer {
public:
/**
* Creates an audio buffer of @param length bytes.
*/
AudioBuffer (void);
/**
* Deletes the audio buffer, freeing the data.
*/
~AudioBuffer (void);
/**
* Returns a pointer to the audio data.
*/
void *getData (void) {
return data;
}
/**
* Returns the size of the buffer.
*/
size_t getSize (void) {
return size;
}
/**
* Resizes the buffer to size newlength. Will only allocate new memory
* if the size is larger than what has been previously allocated.
*/
void resize (size_t newsize);
void setData (short *buf, int);
void *data;
private:
size_t realsize;
size_t size;
};
#endif // __AUDIOBUFFER_H__
......@@ -26,10 +26,8 @@
#include <string.h>
#include <iostream>
#include <string>
#include <portaudio.h>
#include "pa_converters.h"
#include "pa_dither.h"
#include "portaudio.h"
#include "../global.h"
......@@ -59,29 +57,4 @@ AudioCodec::getCodecName (void)
return _codecName;
}
void
AudioCodec::float32ToInt16 (float32* src, int16* dst, int size) {
PaUtilConverter* myconverter;
struct PaUtilTriangularDitherGenerator tdg;
PaUtil_InitializeTriangularDitherState (&tdg);
myconverter = PaUtil_SelectConverter (paFloat32, paInt16, paNoFlag);
if (myconverter != NULL) {
myconverter(dst, 1, src, 1, size, &tdg);
} else {
_debug("Format conversion is not supported\n");
}
}
void
AudioCodec::int16ToFloat32 (int16* src, float32* dst, int size) {
PaUtilConverter* myconverter;
myconverter = PaUtil_SelectConverter (paInt16, paFloat32, paNoFlag);
if (myconverter != NULL) {
myconverter(dst, 1, src, 1, size, NULL);
} else {
_debug("Format conversion is not supported\n");
}
}
......@@ -38,8 +38,6 @@ public:
void setCodecName (const string& codec);
string getCodecName (void);
void float32ToInt16 (float32* src, int16* dst, int size);
void int16ToFloat32 (int16* src, float32* dst, int size);
private:
string _codecName;
......
/**
* Copyright (C) 2004-2005 Savoir-Faire Linux inc.
* Author: Laurielle Lea <laurielle.lea@savoirfairelinux.com>
*
* Portions Copyright (c) 2000 Billy Biggs <bbiggs@div8.net>
* Portions Copyright (c) 2004 Wirlab <kphone@wirlab.net>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include "audiodrivers.h"
AudioDrivers::AudioDrivers (void) {
this->devstate = AudioDrivers::DeviceClosed;
}
AudioDrivers::~AudioDrivers (void) {
}
// EOF
/**
* Copyright (C) 2004-2005 Savoir-Faire Linux inc.
* Author : Laurielle Lea <laurielle.lea@savoirfairelinux.com>
*
* Portions Copyright (c) 2000 Billy Biggs <bbiggs@div8.net>
* Portions Copyright (c) 2004 Wirlab <kphone@wirlab.net>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#ifndef __AUDIO_DRIVERS_H__
#define __AUDIO_DRIVERS_H__
#include "audiobuffer.h"
class AudioDrivers {
public:
AudioDrivers (void);
virtual ~AudioDrivers (void);
AudioBuffer audio_buf; // Buffer that the application fills
enum DeviceState {
DeviceOpened,
DeviceClosed };
enum DeviceMode {
ReadOnly,
WriteOnly,
ReadWrite };
virtual int initDevice (DeviceMode) = 0;
virtual int resetDevice (void) = 0;
virtual int writeBuffer (void) = 0;
virtual int readBuffer (void *, int) = 0;
virtual unsigned int readableBytes (void) = 0;
protected:
DeviceState devstate; // Current state
DeviceMode devmode; // Current mode
};
#endif// __AUDIO_DRIVERS_H__
/**
* Copyright (C) 2004-2005 Savoir-Faire Linux inc.
* Author: Jerome Oufella <jerome.oufella@savoirfairelinux.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
//#if defined(AUDIO_ALSA)
#include <sys/ioctl.h>
#include <sys/stat.h>
#include <sys/time.h>
#include <sys/types.h>
#include <sys/soundcard.h>
#include <fcntl.h>
#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#include "audiodriversalsa.h"
#include "../global.h"
#define ALSA_DEVICE "plughw:0,0"
AudioDriversALSA::AudioDriversALSA(DeviceMode mode, Error *error) :
AudioDrivers () {
this->error = error;
audio_hdl = (snd_pcm_t *) NULL;
initDevice(mode);
}
AudioDriversALSA::~AudioDriversALSA (void) {
/* Close the audio handle */
this->closeDevice();
}
void
AudioDriversALSA::closeDevice (void) {
if (audio_hdl != NULL) {
snd_pcm_close (audio_hdl);
audio_hdl = (snd_pcm_t *) NULL;
}
}
int
AudioDriversALSA::initDevice (DeviceMode mode) {
int err;
if (devstate == DeviceOpened) {
error->errorName(DEVICE_ALREADY_OPEN, NULL);
return -1;
}
// Open the audio device
switch (mode) {
case ReadOnly:
/* Only read sound from the device */
err = snd_pcm_open (&audio_hdl, ALSA_DEVICE,SND_PCM_STREAM_CAPTURE,
SND_PCM_NONBLOCK);
break;
case WriteOnly:
/* Only write sound to the device */
err = snd_pcm_open (&audio_hdl, ALSA_DEVICE,SND_PCM_STREAM_PLAYBACK,
SND_PCM_NONBLOCK);
break;
default:
break;
}
if (err < 0) {
_debug ("ERROR: ALSA/snd_pcm_open: Cannot open audio device (%s)\n",
snd_strerror (err));
error->errorName(OPEN_FAILED_DEVICE, NULL);
return -1;