Commit 9dbf1575 authored by Alexandre Savard's avatar Alexandre Savard

#9572: make sflphone compile with libccrtp 2

parent 54c9e6e0
......@@ -119,13 +119,13 @@ LIBSAMPLERATE_MIN_VERSION=0.1.2
PKG_CHECK_MODULES(SAMPLERATE, samplerate >= ${LIBSAMPLERATE_MIN_VERSION},, AC_MSG_ERROR([Missing libsamplerate development package: libsamplerate0-dev]))
LIBCCGNU2_MIN_VERSION=1.3.1
PKG_CHECK_MODULES(CCGNU2, libccgnu2 >= ${LIBCCGNU2_MIN_VERSION},, AC_MSG_ERROR([Missing common cpp development package: libcommoncpp2-dev]))
PKG_CHECK_MODULES(CCGNU2, commoncpp >= ${LIBCCGNU2_MIN_VERSION},, AC_MSG_ERROR([Missing common cpp development package: libcommoncpp2-dev]))
LIBCCEXT2_MIN_VERSION=1.3.1
PKG_CHECK_MODULES(CCEXT2, libccext2 >= ${LIBCCEXT2_MIN_VERSION})
LIBCCRT_MIN_VERSION=1.3.0
PKG_CHECK_MODULES(CCRTP, libccrtp1 >= ${LIBCCRT_MIN_VERSION},, AC_MSG_ERROR([Missing ccrtp development package: libccrtp-dev]))
PKG_CHECK_MODULES(CCRTP, libccrtp >= ${LIBCCRT_MIN_VERSION},, AC_MSG_ERROR([Missing ccrtp development package: libccrtp-dev]))
dnl Check for OpenSSL to link against pjsip and provide SIPS TLS support
PKG_CHECK_MODULES([libssl], libssl,, AC_MSG_ERROR([Missing ssl development package: libssl-dev]))
......
......@@ -55,7 +55,6 @@ class AlsaThread : public ost::Thread {
AlsaThread::AlsaThread(AlsaLayer *alsa)
: Thread(), alsa_(alsa)
{
setCancel(cancelDeferred);
}
/**
......@@ -63,7 +62,7 @@ AlsaThread::AlsaThread(AlsaLayer *alsa)
*/
void AlsaThread::run()
{
while (!testCancel()) {
while (1) {
alsa_->audioCallback();
Thread::sleep(20);
}
......
......@@ -34,7 +34,7 @@
#ifndef __AUDIO_LAYER_H__
#define __AUDIO_LAYER_H__
#include <cc++/thread.h> // for ost::Mutex
#include <commoncpp/thread.h> // for ost::Mutex
#include <sys/time.h>
#include "manager.h"
......
......@@ -38,7 +38,6 @@ AudioRecorder::AudioRecorder(AudioRecord *arec, MainBuffer *mb) : Thread(),
recorderId_(), mbuffer_(mb), arecord_(arec)
{
assert(mb);
setCancel(cancelDeferred);
++count_;
......
......@@ -32,7 +32,7 @@
#define __AUDIORECORDER_H_
#include <string>
#include <cc++/thread.h>
#include <commoncpp/thread.h>
#include "audiorecord.h"
#include "noncopyable.h"
......
......@@ -32,7 +32,7 @@
#define __AUDIO_RTP_FACTORY_H__
#include <stdexcept>
#include <cc++/thread.h>
#include <commoncpp/thread.h>
#include <ccrtp/CryptoContext.h>
#include "audio_rtp_session.h"
#include "noncopyable.h"
......
......@@ -247,8 +247,9 @@ int AudioRtpSession::startRtpThread(AudioCodec* audiocodec)
initNoiseSuppress();
queue_->enableStack();
int ret = thread_->start();
thread_->start();
int ret = 0;
if (type_ == Zrtp)
return ret;
......
......@@ -79,6 +79,7 @@ void AudioSymmetricRtpSession::AudioRtpThread::run()
Thread::sleep(TimerPort::getTimer());
TimerPort::incTimer(threadSleep);
DEBUG("Main Loop Running");
}
DEBUG("AudioRtpThread: Leaving audio rtp thread loop");
......
......@@ -47,7 +47,6 @@ using std::ptrdiff_t;
#pragma GCC diagnostic ignored "-Weffc++"
#include <ccrtp/rtp.h>
#include <ccrtp/iqueue.h>
#include <cc++/numbers.h> // ost::Time
class SIPCall;
......@@ -69,7 +68,8 @@ class AudioSymmetricRtpSession : public ost::TimerPort, public ost::SymmetricRTP
int startSymmetricRtpThread() {
assert(rtpThread_);
return rtpThread_->start();
rtpThread_->start();
return 0;
}
private:
......
......@@ -61,7 +61,6 @@ AudioZrtpSession::AudioZrtpSession(SIPCall * sipcall, const std::string& zidFile
DEBUG("AudioZrtpSession initialized");
initializeZid();
setCancel(cancelDefault);
DEBUG("AudioZrtpSession: Setting new RTP session with destination %s:%d", ca_->getLocalIp().c_str(), ca_->getLocalAudioPort());
}
......@@ -135,10 +134,8 @@ void AudioZrtpSession::run()
else
sendMicData();
setCancel(cancelDeferred);
controlReceptionService();
controlTransmissionService();
setCancel(cancelImmediate);
uint32 maxWait = timeval2microtimeout(getRTCPCheckInterval());
// make sure the scheduling timeout is
// <= the check interval for RTCP
......@@ -146,18 +143,12 @@ void AudioZrtpSession::run()
timeout = (timeout > maxWait) ? maxWait : timeout;
if (timeout < 1000) { // !(timeout/1000)
setCancel(cancelDeferred);
// dispatchDataPacket();
setCancel(cancelImmediate);
timerTick();
} else {
if (isPendingData(timeout/1000)) {
setCancel(cancelDeferred);
if (isActive())
takeInDataPacket();
setCancel(cancelImmediate);
}
timeout = 0;
}
......
......@@ -40,7 +40,7 @@ using std::ptrdiff_t;
#include <libzrtpcpp/ZrtpUserCallback.h>
#include "audio_rtp_session.h"
#include <cc++/numbers.h> // OST::Time
// #include <commoncpp/numbers.h> // OST::Time
class SIPCall;
......
......@@ -34,7 +34,7 @@
#include <map>
#include <set>
#include <cc++/thread.h> // for ost::Mutex
#include <commoncpp/thread.h> // for ost::Mutex
#include <string>
#include "global.h"
......
......@@ -32,7 +32,7 @@
#ifndef CALL_H
#define CALL_H
#include <cc++/thread.h> // for mutex
#include <commoncpp/thread.h> // for mutex
#include <sstream>
#include "audio/recordable.h"
......
......@@ -30,7 +30,7 @@
#ifndef __SFL_CODEC_H__
#define __SFL_CODEC_H__
#include <cc++/config.h> // for types
#include <commoncpp/config.h> // for types
/**
* Interface for both audio codecs as well as video codecs.
......
......@@ -33,7 +33,6 @@
EventThread::EventThread(VoIPLink *link) : Thread(), link_(link)
{
setCancel(cancelDeferred);
}
EventThread::~EventThread() {
......@@ -42,7 +41,7 @@ EventThread::~EventThread() {
void EventThread::run()
{
while (!testCancel())
while (1)
link_->getEvent();
}
......@@ -31,7 +31,7 @@
#ifndef EVENT_THREAD_H_
#define EVENT_THREAD_H_
#include <cc++/thread.h>
#include <commoncpp/thread.h>
#include "noncopyable.h"
class VoIPLink;
......
......@@ -37,12 +37,12 @@
#include <iostream>
#include <memory> // for auto_ptr
#include <string>
#include <cc++/common.h>
// #include <commoncpp/common.h>
#include "fileutils.h"
#include "dbus/dbusmanager.h"
#include "manager.h"
/*
ost::CommandOptionNoArg console(
"console", "c", "Log in console (instead of syslog)"
);
......@@ -54,18 +54,18 @@ ost::CommandOptionNoArg debug(
ost::CommandOptionNoArg help(
"help", "h", "Print help"
);
*/
int main(int argc, char **argv)
{
fileutils::set_program_dir(argv[0]);
// makeCommandOptionParse allocates the object with operator new, so
// auto_ptr is fine in this context.
// TODO: This should eventually be replaced with std::unique_ptr for C++0x
std::auto_ptr<ost::CommandOptionParse> args(ost::makeCommandOptionParse(argc, argv, ""));
// std::auto_ptr<ost::CommandOptionParse> args(ost::makeCommandOptionParse(argc, argv, ""));
printf("SFLphone Daemon " VERSION ", by Savoir-Faire Linux 2004-2012\n" \
"http://www.sflphone.org/\n");
/*
if (help.numSet) {
std::cerr << args->printUsage();
return 0;
......@@ -74,9 +74,11 @@ int main(int argc, char **argv)
std::cerr << args->printUsage();
return 1;
}
Logger::setConsoleLog(console.numSet);
Logger::setDebugMode(debug.numSet);
*/
// Logger::setConsoleLog(console.numSet);
// Logger::setDebugMode(debug.numSet);
Logger::setConsoleLog(1);
Logger::setDebugMode(1);
if (!fileutils::create_pidfile())
return 1;
......
......@@ -39,7 +39,7 @@
#include <vector>
#include <set>
#include <map>
#include <cc++/thread.h>
#include <commoncpp/thread.h>
#include <memory>
#include "dbus/dbusmanager.h"
......
......@@ -43,7 +43,8 @@
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/ioctl.h>
#include <linux/if.h>
// #include <linux/if.h>
#include <arpa/inet.h>
#include "siptransport.h"
#include "manager.h"
......
......@@ -65,10 +65,6 @@
#include <istream>
#include <utility> // for std::pair
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/ioctl.h>
#include <linux/if.h>
#include <map>
......
......@@ -36,7 +36,7 @@
#include <stdexcept>
#include <map>
#include <cc++/thread.h> // for ost::Mutex
#include <commoncpp/thread.h> // for ost::Mutex
class Call;
class Account;
......
Markdown is supported
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