Commit 6d85161e authored by yanmorin's avatar yanmorin
Browse files

Adding samplerate for linux

parent 3a3b996c
......@@ -102,16 +102,16 @@ for another architecture.
Installation Names
==================
By default, `make install' installs the package's commands under
`/usr/local/bin', include files under `/usr/local/include', etc. You
can specify an installation prefix other than `/usr/local' by giving
`configure' the option `--prefix=PREFIX'.
By default, `make install' will install the package's files in
`/usr/local/bin', `/usr/local/man', etc. You can specify an
installation prefix other than `/usr/local' by giving `configure' the
option `--prefix=PREFIX'.
You can specify separate installation prefixes for
architecture-specific files and architecture-independent files. If you
pass the option `--exec-prefix=PREFIX' to `configure', the package uses
PREFIX as the prefix for installing programs and libraries.
Documentation and other data files still use the regular prefix.
give `configure' the option `--exec-prefix=PREFIX', the package will
use PREFIX as the prefix for installing programs and libraries.
Documentation and other data files will still use the regular prefix.
In addition, if you use an unusual directory layout you can give
options like `--bindir=DIR' to specify different values for particular
......@@ -159,7 +159,7 @@ where SYSTEM can have one of these forms:
need to know the machine type.
If you are _building_ compiler tools for cross-compiling, you should
use the option `--target=TYPE' to select the type of system they will
use the `--target=TYPE' option to select the type of system they will
produce code for.
If you want to _use_ a cross compiler, that generates code for a
......
......@@ -17,3 +17,5 @@ From FIXME:
- sflphoned don't return a 206 on getcallstatus when one call is ringing.
- unhold should not return an error if it's not holded
- Check if the device as the same name (usb), not only the number
- Combo box for the device
......@@ -128,16 +128,11 @@ dnl Check for exosip2
LP_CHECK_EXOSIP2
SFLPHONE_LIBS="$SFLPHONE_LIBS $EXOSIP_LIBS"
dnl Check for samplerate on darwin
with_samplerate=no
case $host in
*darwin*)
AC_CHECK_HEADER([libsamplerate.h], [
AC_CHECK_LIB(samplerate, src_simple, [with_samplerate=yes], [with_samplerate=no])
], [ with_samplerate=no ]
)
;;
esac
dnl Check for samplerate
AC_CHECK_HEADER([samplerate.h], [
AC_CHECK_LIB(samplerate, src_simple, [with_samplerate=yes], [with_samplerate=no])
], [ with_samplerate=no ]
)
AM_CONDITIONAL(USE_SAMPLERATE, test x$with_samplerate = xyes)
dnl Check for GNU ccRTP
......
main.cpp: main()
-> app = new SFLPhoneApp
-> new SessionIO, 3999
-> new session
-> new SessionId
-> new SessionIO (create)
-> Requester::registerSession()
-> envoie session a ConfigurationManager
-> envoie session a PhoneLineManager(initialize)
-> new Session(session)
-> new Account <-- supprimé
-> configure le nombre de ligne de PhoneLineManager::setNbLines
-> new PhoneLine
-> new Request Object (commande)
-> new NumericKeypad
-> new and show splash
-> sfl = new SFLPhoneWindow
-> positionne fenêtre
-> new ConfigurationPanel
-> connection updates au panel
-> connection bouton panel a la fenetre
-> peinture apres 50 milli-seconde
-> initialisation graphique
-> initConnections(sfl)
-> associe les PhoneLineButton au PhoneLine
-> associe needRegister
-> associe soundDriverChanged
-> connecte les boutons de la fenetre au phonelinemanager
-> associe phonelinemanager au lcd (messages texet)
-> associe evenement daemon
-> associe lauching (daemon)
-> associe status - phone line
-> associe evenement update, setup
-> launch
-> Launcher->start()
-> PhoneLineManager::connect et attend "connected"
-> loadSkin
-> exec
Evenement:
-Lorsque le PhoneLineManager est connectée (connected)
le splash disparait splash.hide()
-Lorsque le PhoneLineManager gère le getEvents
app.handleArg()
TCPSessionIOCreator::create
-> TCPSessionIO::connected|
PhoneLineManagerImpl::connected|
-> PhoneLineManagerImpl::readyToSendStatus|
-> PhoneLineManagerImpl::startSession()
-> mSession::getCallStatus()
-> SFLPhoneWindow::show
-> splash::hide
CallStatusRequest
-> onSuccess -> PhoneLineManager::selectLine()
-> PhoneLineManager::handleEvents()
-> onEntry -> CallStatus::execute() -> PhoneLineManager::addCall()
-> onError -> PhoneLineManager::errorOnCallStatus()
......@@ -32,11 +32,8 @@ AudioLayer::AudioLayer()
, _stream(NULL)
, _errorMessage("")
{
#ifdef USE_SAMPLERATE
_sampleRate = 44100;
#else
_sampleRate = 8000;
#endif
_inChannel = 1;
_outChannel = 1;
portaudio::System::initialize();
......@@ -71,7 +68,7 @@ AudioLayer::hasStream(void) {
void
AudioLayer::openDevice (int indexIn, int indexOut)
AudioLayer::openDevice (int indexIn, int indexOut, int sampleRate)
{
closeStream();
......@@ -89,6 +86,12 @@ AudioLayer::openDevice (int indexIn, int indexOut)
portaudio::System::instance().deviceByIndex(indexIn).defaultLowInputLatency(),
NULL);
#ifdef USE_SAMPLERATE
_sampleRate = sampleRate;
#else
_sampleRate = 8000;
#endif
// we could put paFramesPerBufferUnspecified instead of FRAME_PER_BUFFER to be variable
portaudio::StreamParameters const params(inParams, outParams,
_sampleRate, FRAME_PER_BUFFER /*paFramesPerBufferUnspecified*/, paNoFlag /*paPrimeOutputBuffersUsingStreamCallback | paNeverDropInput*/);
......
......@@ -36,8 +36,13 @@ class AudioLayer {
public:
AudioLayer();
~AudioLayer(void);
void openDevice(int, int);
/*
* @param indexIn
* @param indexOut
* @param sampleRate
*/
void openDevice(int, int, int);
void startStream(void);
void stopStream(void);
void sleep(int);
......
......@@ -1022,6 +1022,7 @@ ManagerImpl::initConfigFile (void)
fill_config_int(DRIVER_NAME, DFT_DRIVER_STR);
fill_config_int(DRIVER_NAME_IN, DFT_DRIVER_STR);
fill_config_int(DRIVER_NAME_OUT, DFT_DRIVER_STR);
fill_config_int(DRIVER_SAMPLE_RATE, DRIVER_SAMPLE_RATE_DEFAULT);
fill_config_str(CODEC1, DFT_CODEC);
fill_config_str(CODEC2, DFT_CODEC);
fill_config_str(CODEC3, DFT_CODEC);
......@@ -1081,6 +1082,14 @@ ManagerImpl::selectAudioDriver (void)
int noDevice = getConfigInt(AUDIO, DRIVER_NAME);
int noDeviceIn = getConfigInt(AUDIO, DRIVER_NAME_IN);
int noDeviceOut = getConfigInt(AUDIO, DRIVER_NAME_OUT);
int sampleRate = getConfigInt(AUDIO, DRIVER_SAMPLE_RATE);
#ifdef USE_SAMPLERATE
sampleRate = 8000;
#else
if (sampleRate <=0 ) {
sampleRate = 8000;
}
#endif
// this is when no audio device in/out are set
// or the audio device in/out are set to 0
......@@ -1106,7 +1115,7 @@ ManagerImpl::selectAudioDriver (void)
}
_debug(" Setting audiolayer to device in=%d and out=%d\n", noDeviceIn, noDeviceOut);
_debugInit(" AudioLayer Opening Device");
_audiodriverPA->openDevice(noDeviceIn, noDeviceOut);
_audiodriverPA->openDevice(noDeviceIn, noDeviceOut,sampleRate);
} catch(...) {
throw;
}
......
......@@ -61,6 +61,8 @@
#define DRIVER_NAME "Drivers.driverName"
#define DRIVER_NAME_IN "Drivers.driverNameIn"
#define DRIVER_NAME_OUT "Drivers.driverNameOut"
#define DRIVER_SAMPLE_RATE "Drivers.sampleRate"
#define DRIVER_SAMPLE_RATE_DEFAULT "8000"
#define NB_CODEC "Codecs.nbCodec"
#define CODEC1 "Codecs.codec1"
#define CODEC2 "Codecs.codec2"
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment