Skip to content
Snippets Groups Projects
Commit eaac8a6a authored by asavard's avatar asavard
Browse files

[#4367] Fix compilation problem

parent 8b770d0f
No related branches found
No related tags found
No related merge requests found
...@@ -400,6 +400,8 @@ void AudioRtpRecordHandler::putDtmfEvent(int digit) ...@@ -400,6 +400,8 @@ void AudioRtpRecordHandler::putDtmfEvent(int digit)
int AudioRtpRecordHandler::processDataEncode(void) int AudioRtpRecordHandler::processDataEncode(void)
{ {
_debug("AudioProcessEncode");
AudioCodec *audioCodec = getAudioCodec(); AudioCodec *audioCodec = getAudioCodec();
AudioLayer *audioLayer = Manager::instance().getAudioDriver(); AudioLayer *audioLayer = Manager::instance().getAudioDriver();
...@@ -457,6 +459,9 @@ int AudioRtpRecordHandler::processDataEncode(void) ...@@ -457,6 +459,9 @@ int AudioRtpRecordHandler::processDataEncode(void)
void AudioRtpRecordHandler::processDataDecode(unsigned char *spkrData, unsigned int size) void AudioRtpRecordHandler::processDataDecode(unsigned char *spkrData, unsigned int size)
{ {
_debug("AudioProcessDecode");
AudioCodec *audioCodec = getAudioCodec(); AudioCodec *audioCodec = getAudioCodec();
AudioLayer *audioLayer = Manager::instance().getAudioDriver(); AudioLayer *audioLayer = Manager::instance().getAudioDriver();
......
...@@ -43,12 +43,12 @@ namespace sfl ...@@ -43,12 +43,12 @@ namespace sfl
AudioRtpSession::AudioRtpSession (ManagerImpl * manager, SIPCall * sipcall) : AudioRtpSession::AudioRtpSession (ManagerImpl * manager, SIPCall * sipcall) :
// ost::SymmetricRTPSession (ost::InetHostAddress (sipcall->getLocalIp().c_str()), sipcall->getLocalAudioPort()), // ost::SymmetricRTPSession (ost::InetHostAddress (sipcall->getLocalIp().c_str()), sipcall->getLocalAudioPort()),
TRTPSessionBase<ost::DualRTPUDPIPv4Channel,ost::DualRTPUDPIPv4Channel,ost::AVPQueue>(ost::InetHostAddress (sipcall->getLocalIp().c_str()), AudioRtpRecordHandler(manager, sipcall),
ost::TRTPSessionBase<ost::DualRTPUDPIPv4Channel,ost::DualRTPUDPIPv4Channel,ost::AVPQueue>(ost::InetHostAddress (sipcall->getLocalIp().c_str()),
sipcall->getLocalAudioPort(), sipcall->getLocalAudioPort(),
0, 0,
ost::MembershipBookkeeping::defaultMembersHashSize, ost::MembershipBookkeeping::defaultMembersHashSize,
ost::defaultApplication()), ost::defaultApplication())
AudioRtpRecordHandler(manager, sipcall)
, _time (new ost::Time()) , _time (new ost::Time())
, _mainloopSemaphore (0) , _mainloopSemaphore (0)
, _manager (manager) , _manager (manager)
...@@ -58,20 +58,19 @@ AudioRtpSession::AudioRtpSession (ManagerImpl * manager, SIPCall * sipcall) : ...@@ -58,20 +58,19 @@ AudioRtpSession::AudioRtpSession (ManagerImpl * manager, SIPCall * sipcall) :
, _countNotificationTime (0) , _countNotificationTime (0)
, _ca (sipcall) , _ca (sipcall)
{ {
static_cast<ost::Thread *>(this)->setCancel (cancelDefault); setCancel (cancelDefault);
assert (_ca); assert (_ca);
_info ("AudioRtpSession: Local audio port %i will be used", _ca->getLocalAudioPort()); _info ("AudioRtpSession: Setting new RTP session with destination %s:%d", _ca->getLocalIp().c_str(), _ca->getLocalAudioPort());
} }
AudioRtpSession::~AudioRtpSession() AudioRtpSession::~AudioRtpSession()
{ {
_debug ("AudioRtpSession: Delete AudioRtpSession instance"); _info ("AudioRtpSession: Delete AudioRtpSession instance");
try { try {
static_cast<ost::Thread *>(this)->terminate(); terminate();
} catch (...) { } catch (...) {
_debugException ("AudioRtpSession: Thread destructor didn't terminate correctly"); _debugException ("AudioRtpSession: Thread destructor didn't terminate correctly");
throw; throw;
...@@ -87,12 +86,16 @@ AudioRtpSession::~AudioRtpSession() ...@@ -87,12 +86,16 @@ AudioRtpSession::~AudioRtpSession()
void AudioRtpSession::setSessionTimeouts (void) void AudioRtpSession::setSessionTimeouts (void)
{ {
_debug("AudioRtpSession: Set session scheduling timeout (%d) and expireTimeout (%d)", sfl::schedulingTimeout, sfl::expireTimeout);
setSchedulingTimeout (sfl::schedulingTimeout); setSchedulingTimeout (sfl::schedulingTimeout);
setExpireTimeout (sfl::expireTimeout); setExpireTimeout (sfl::expireTimeout);
} }
void AudioRtpSession::setSessionMedia (AudioCodec* audioCodec) void AudioRtpSession::setSessionMedia (AudioCodec* audioCodec)
{ {
_debug("AudioRtpSession: Set session media");
// set internal codec info for this session // set internal codec info for this session
setRtpMedia(audioCodec); setRtpMedia(audioCodec);
...@@ -108,6 +111,7 @@ void AudioRtpSession::setSessionMedia (AudioCodec* audioCodec) ...@@ -108,6 +111,7 @@ void AudioRtpSession::setSessionMedia (AudioCodec* audioCodec)
else else
_timestampIncrement = frameSize; _timestampIncrement = frameSize;
_debug ("AudioRptSession: Codec payload: %d", payloadType);
_debug ("AudioRtpSession: Codec sampling rate: %d", smplRate); _debug ("AudioRtpSession: Codec sampling rate: %d", smplRate);
_debug ("AudioRtpSession: Codec frame size: %d", frameSize); _debug ("AudioRtpSession: Codec frame size: %d", frameSize);
_debug ("AudioRtpSession: RTP timestamp increment: %d", _timestampIncrement); _debug ("AudioRtpSession: RTP timestamp increment: %d", _timestampIncrement);
...@@ -158,6 +162,8 @@ void AudioRtpSession::setDestinationIpAddress (void) ...@@ -158,6 +162,8 @@ void AudioRtpSession::setDestinationIpAddress (void)
void AudioRtpSession::updateDestinationIpAddress (void) void AudioRtpSession::updateDestinationIpAddress (void)
{ {
_debug("AudioRtpSession: Update destination ip address");
// Destination address are stored in a list in ccrtp // Destination address are stored in a list in ccrtp
// This method remove the current destination entry // This method remove the current destination entry
...@@ -222,6 +228,8 @@ bool onRTPPacketRecv (ost::IncomingRTPPkt&) ...@@ -222,6 +228,8 @@ bool onRTPPacketRecv (ost::IncomingRTPPkt&)
void AudioRtpSession::sendMicData() void AudioRtpSession::sendMicData()
{ {
_debug("sendMicData");
// Increment timestamp for outgoing packet // Increment timestamp for outgoing packet
_timestamp += _timestampIncrement; _timestamp += _timestampIncrement;
...@@ -234,6 +242,8 @@ void AudioRtpSession::sendMicData() ...@@ -234,6 +242,8 @@ void AudioRtpSession::sendMicData()
void AudioRtpSession::receiveSpeakerData () void AudioRtpSession::receiveSpeakerData ()
{ {
_debug("receiveSpkrData");
const ost::AppDataUnit* adu = NULL; const ost::AppDataUnit* adu = NULL;
int packetTimestamp = getFirstTimestamp(); int packetTimestamp = getFirstTimestamp();
...@@ -267,12 +277,12 @@ void AudioRtpSession::receiveSpeakerData () ...@@ -267,12 +277,12 @@ void AudioRtpSession::receiveSpeakerData ()
int AudioRtpSession::startRtpThread (AudioCodec* audiocodec) int AudioRtpSession::startRtpThread (AudioCodec* audiocodec)
{ {
_debug ("RTP: Starting main thread"); _debug ("AudioRtpSession: Starting main thread");
initNoiseSuppress();
setSessionTimeouts(); setSessionTimeouts();
setSessionMedia (audiocodec); setSessionMedia (audiocodec);
initBuffers(); initBuffers();
int ret = static_cast<ost::Thread *>(this)->start (_mainloopSemaphore); int ret = start (_mainloopSemaphore);
this->startRunning();
return ret; return ret;
} }
...@@ -291,8 +301,6 @@ void AudioRtpSession::run () ...@@ -291,8 +301,6 @@ void AudioRtpSession::run ()
threadSleep = getAudioLayerFrameSize(); threadSleep = getAudioLayerFrameSize();
} }
initNoiseSuppress();
TimerPort::setTimer (threadSleep); TimerPort::setTimer (threadSleep);
// Set recording sampling rate // Set recording sampling rate
...@@ -304,7 +312,10 @@ void AudioRtpSession::run () ...@@ -304,7 +312,10 @@ void AudioRtpSession::run ()
_debug ("AudioRtpSession: Entering mainloop for call %s",_ca->getCallId().c_str()); _debug ("AudioRtpSession: Entering mainloop for call %s",_ca->getCallId().c_str());
while (!static_cast<ost::Thread *>(this)->testCancel()) { // while (!static_cast<ost::Thread *>(this)->testCancel()) {
while (!testCancel()) {
_debug("audio");
// Reset timestamp to make sure the timing information are up to date // Reset timestamp to make sure the timing information are up to date
if (_timestampCount > RTP_TIMESTAMP_RESET_FREQ) { if (_timestampCount > RTP_TIMESTAMP_RESET_FREQ) {
......
...@@ -49,6 +49,7 @@ ...@@ -49,6 +49,7 @@
#include "managerimpl.h" #include "managerimpl.h"
#include <ccrtp/rtp.h> #include <ccrtp/rtp.h>
#include <ccrtp/iqueue.h>
#include <cc++/numbers.h> // ost::Time #include <cc++/numbers.h> // ost::Time
#include <fstream> #include <fstream>
...@@ -58,7 +59,7 @@ namespace sfl ...@@ -58,7 +59,7 @@ namespace sfl
// class AudioRtpSession : public ost::Thread, public ost::TimerPort, public AudioRtpRecordHandler, public ost::SymmetricRTPSession // class AudioRtpSession : public ost::Thread, public ost::TimerPort, public AudioRtpRecordHandler, public ost::SymmetricRTPSession
// class AudioRtpSession : public ost::Thread, public ost::TimerPort, public ost::SymmetricRTPSession, public AudioRtpRecordHandler // class AudioRtpSession : public ost::Thread, public ost::TimerPort, public ost::SymmetricRTPSession, public AudioRtpRecordHandler
class AudioRtpSession : public ost::Thread, public ost::TimerPort, public AudioRtpRecordHandler, public ost::TRTPSessionBase<ost::DualRTPUDPIPv4Channel,ost::DualRTPUDPIPv4Channel,ost::AVPQueue> class AudioRtpSession : protected ost::Thread, public ost::TimerPort, public AudioRtpRecordHandler, public ost::TRTPSessionBase<ost::DualRTPUDPIPv4Channel,ost::DualRTPUDPIPv4Channel,ost::AVPQueue>
{ {
public: public:
/** /**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment