Commit 4f3d7e86 authored by Philippe Groarke's avatar Philippe Groarke Committed by Tristan Matthews

logger: fix logger macro collisions

Refs #56437

Change-Id: Ia712b748820c7a829dd143a08177211c46332150
parent 900ba5af
......@@ -290,7 +290,7 @@ isCodecValid(const map<string, string> &codec, const vector<map<string, string>
{
const map<string, string>::const_iterator name(codec.find(Account::VIDEO_CODEC_NAME));
if (name == codec.end()) {
ERROR("Field \"name\" missing in codec specification");
SFL_ERR("Field \"name\" missing in codec specification");
return false;
}
......@@ -302,7 +302,7 @@ isCodecValid(const map<string, string> &codec, const vector<map<string, string>
and isFieldValid(codec, Account::VIDEO_CODEC_ENABLED, isBoolean);
}
}
ERROR("Codec %s not supported", name->second.c_str());
SFL_ERR("Codec %s not supported", name->second.c_str());
return false;
}
......@@ -311,7 +311,7 @@ isCodecListValid(const vector<map<string, string> > &list)
{
const auto defaults(libav_utils::getDefaultCodecs());
if (list.size() != defaults.size()) {
ERROR("New codec list has a different length than the list of supported codecs");
SFL_ERR("New codec list has a different length than the list of supported codecs");
return false;
}
......@@ -445,7 +445,7 @@ Account::getActiveVideoCodecs() const
#define find_iter() \
const auto iter = details.find(key); \
if (iter == details.end()) { \
ERROR("Couldn't find key \"%s\"", key); \
SFL_ERR("Couldn't find key \"%s\"", key); \
return; \
}
......
......@@ -52,16 +52,16 @@ AccountFactory::AccountFactory()
{
auto sipfunc = [](const std::string& id){ return std::make_shared<SIPAccount>(id, true); };
generators_.insert(std::make_pair(SIPAccount::ACCOUNT_TYPE, sipfunc));
DEBUG("registered %s account", SIPAccount::ACCOUNT_TYPE);
SFL_DBG("registered %s account", SIPAccount::ACCOUNT_TYPE);
#if HAVE_IAX
auto iaxfunc = [](const std::string& id){ return std::make_shared<IAXAccount>(id); };
generators_.insert(std::make_pair(IAXAccount::ACCOUNT_TYPE, iaxfunc));
DEBUG("registered %s account", IAXAccount::ACCOUNT_TYPE);
SFL_DBG("registered %s account", IAXAccount::ACCOUNT_TYPE);
#endif
#if HAVE_DHT
auto dhtfunc = [](const std::string& id){ return std::make_shared<DHTAccount>(id, false); };
generators_.insert(std::make_pair(DHTAccount::ACCOUNT_TYPE, dhtfunc));
DEBUG("registered %s account", DHTAccount::ACCOUNT_TYPE);
SFL_DBG("registered %s account", DHTAccount::ACCOUNT_TYPE);
#endif
}
......@@ -70,7 +70,7 @@ AccountFactory::createAccount(const char* const accountType,
const std::string& id)
{
if (hasAccount(id)) {
ERROR("Existing account %s", id.c_str());
SFL_ERR("Existing account %s", id.c_str());
return nullptr;
}
......@@ -102,10 +102,10 @@ AccountFactory::removeAccount(Account& account)
std::lock_guard<std::recursive_mutex> lock(mutex_);
const auto& id = account.getAccountID();
DEBUG("Removing account %s", id.c_str());
SFL_DBG("Removing account %s", id.c_str());
auto& map = accountMaps_.at(account.getAccountType());
map.erase(id);
DEBUG("Remaining %u %s account(s)", map.size(), account_type);
SFL_DBG("Remaining %u %s account(s)", map.size(), account_type);
}
void
......@@ -116,7 +116,7 @@ AccountFactory::removeAccount(const std::string& id)
if (auto account = getAccount(id)) {
removeAccount(*account);
} else
ERROR("No account with ID %s", id.c_str());
SFL_ERR("No account with ID %s", id.c_str());
}
template <> bool
......
......@@ -178,7 +178,7 @@ AlsaLayer::~AlsaLayer()
// Retry approach taken from pa_linux_alsa.c, part of PortAudio
bool AlsaLayer::openDevice(snd_pcm_t **pcm, const std::string &dev, snd_pcm_stream_t stream)
{
DEBUG("Alsa: Opening %s", dev.c_str());
SFL_DBG("Alsa: Opening %s", dev.c_str());
static const int MAX_RETRIES = 100;
int err = snd_pcm_open(pcm, dev.c_str(), stream, 0);
......@@ -191,7 +191,7 @@ bool AlsaLayer::openDevice(snd_pcm_t **pcm, const std::string &dev, snd_pcm_stre
}
if (err < 0) {
ERROR("Alsa: couldn't open device %s : %s", dev.c_str(),
SFL_ERR("Alsa: couldn't open device %s : %s", dev.c_str(),
snd_strerror(err));
return false;
}
......@@ -251,7 +251,7 @@ AlsaLayer::stopStream()
#define ALSA_CALL(call, error) ({ \
int err_code = call; \
if (err_code < 0) \
ERROR(error ": %s", snd_strerror(err_code)); \
SFL_ERR(error ": %s", snd_strerror(err_code)); \
err_code; \
})
......@@ -365,8 +365,8 @@ bool AlsaLayer::alsa_set_params(snd_pcm_t *pcm_handle)
snd_pcm_hw_params_get_buffer_size_max(hwparams, &buffer_size_max);
snd_pcm_hw_params_get_period_size_min(hwparams, &period_size_min, nullptr);
snd_pcm_hw_params_get_period_size_max(hwparams, &period_size_max, nullptr);
DEBUG("Buffer size range from %lu to %lu", buffer_size_min, buffer_size_max);
DEBUG("Period size range from %lu to %lu", period_size_min, period_size_max);
SFL_DBG("Buffer size range from %lu to %lu", buffer_size_min, buffer_size_max);
SFL_DBG("Period size range from %lu to %lu", period_size_min, period_size_max);
buffer_size = buffer_size > buffer_size_max ? buffer_size_max : buffer_size;
buffer_size = buffer_size < buffer_size_min ? buffer_size_min : buffer_size;
period_size = period_size > period_size_max ? period_size_max : period_size;
......@@ -381,17 +381,17 @@ bool AlsaLayer::alsa_set_params(snd_pcm_t *pcm_handle)
snd_pcm_hw_params_get_period_size(hwparams, &period_size, nullptr);
snd_pcm_hw_params_get_rate(hwparams, &audioFormat_.sample_rate, nullptr);
snd_pcm_hw_params_get_channels(hwparams, &audioFormat_.nb_channels);
DEBUG("Was set period_size = %lu", period_size);
DEBUG("Was set buffer_size = %lu", buffer_size);
SFL_DBG("Was set period_size = %lu", period_size);
SFL_DBG("Was set buffer_size = %lu", buffer_size);
if (2 * period_size > buffer_size) {
ERROR("buffer to small, could not use");
SFL_ERR("buffer to small, could not use");
return false;
}
#undef HW
DEBUG("%s using format %s",
SFL_DBG("%s using format %s",
(snd_pcm_stream(pcm_handle) == SND_PCM_STREAM_PLAYBACK) ? "playback" : "capture",
audioFormat_.toString().c_str() );
......@@ -451,12 +451,12 @@ AlsaLayer::write(SFLAudioSample* buffer, int frames, snd_pcm_t * handle)
if (ALSA_CALL(snd_pcm_status(handle, status), "Cannot get playback handle status") >= 0) {
if (snd_pcm_status_get_state(status) == SND_PCM_STATE_SETUP) {
ERROR("Writing in state SND_PCM_STATE_SETUP, should be "
SFL_ERR("Writing in state SND_PCM_STATE_SETUP, should be "
"SND_PCM_STATE_PREPARED or SND_PCM_STATE_RUNNING");
int error = snd_pcm_prepare(handle);
if (error < 0) {
ERROR("Failed to prepare handle: %s", snd_strerror(error));
SFL_ERR("Failed to prepare handle: %s", snd_strerror(error));
stopPlaybackStream();
}
}
......@@ -466,7 +466,7 @@ AlsaLayer::write(SFLAudioSample* buffer, int frames, snd_pcm_t * handle)
}
default:
ERROR("Unknown write error, dropping frames: %s", snd_strerror(err));
SFL_ERR("Unknown write error, dropping frames: %s", snd_strerror(err));
stopPlaybackStream();
break;
}
......@@ -499,12 +499,12 @@ AlsaLayer::read(SFLAudioSample* buffer, int frames)
startCaptureStream();
}
ERROR("XRUN capture ignored (%s)", snd_strerror(err));
SFL_ERR("XRUN capture ignored (%s)", snd_strerror(err));
break;
}
case -EPERM:
ERROR("Can't capture, EPERM (%s)", snd_strerror(err));
SFL_ERR("Can't capture, EPERM (%s)", snd_strerror(err));
prepareCaptureStream();
startCaptureStream();
break;
......@@ -536,7 +536,7 @@ safeUpdate(snd_pcm_t *handle, int &samples)
samples = snd_pcm_recover(handle, samples, 0);
if (samples < 0) {
ERROR("Got unrecoverable error from snd_pcm_avail_update: %s", snd_strerror(samples));
SFL_ERR("Got unrecoverable error from snd_pcm_avail_update: %s", snd_strerror(samples));
return false;
}
}
......@@ -596,11 +596,11 @@ AlsaLayer::getAudioDeviceIndexMap(bool getCapture) const
int err;
if ((err = snd_ctl_pcm_info(handle, pcminfo)) < 0) {
WARN("Cannot get info for %s %s: %s", getCapture ?
SFL_WARN("Cannot get info for %s %s: %s", getCapture ?
"capture device" : "playback device", name.c_str(),
snd_strerror(err));
} else {
DEBUG("card %i : %s [%s]",
SFL_DBG("card %i : %s [%s]",
numCard,
snd_ctl_card_info_get_id(info),
snd_ctl_card_info_get_name(info));
......@@ -671,7 +671,7 @@ AlsaLayer::getAudioDeviceName(int index, DeviceType type) const
return getCaptureDeviceList().at(index);
default:
// Should never happen
ERROR("Unexpected type");
SFL_ERR("Unexpected type");
return "";
}
}
......@@ -683,7 +683,7 @@ void AlsaLayer::capture()
int toGetFrames = snd_pcm_avail_update(captureHandle_);
if (toGetFrames < 0)
ERROR("Audio: Mic error: %s", snd_strerror(toGetFrames));
SFL_ERR("Audio: Mic error: %s", snd_strerror(toGetFrames));
if (toGetFrames <= 0)
return;
......@@ -693,7 +693,7 @@ void AlsaLayer::capture()
captureIBuff_.resize(toGetFrames * audioFormat_.nb_channels);
if (read(captureIBuff_.data(), toGetFrames) != toGetFrames) {
ERROR("ALSA MIC : Couldn't read!");
SFL_ERR("ALSA MIC : Couldn't read!");
return;
}
......@@ -818,7 +818,7 @@ void AlsaLayer::audioCallback()
playbackBuff_.resize(ringtoneAvailFrames);
if (file_tone) {
DEBUG("playback gain %d", playbackGain_);
SFL_DBG("playback gain %d", playbackGain_);
file_tone->getNext(playbackBuff_, playbackGain_);
}
......
......@@ -112,7 +112,7 @@ void AudioBuffer::setChannelNum(unsigned n, bool mix /* = false */)
return;
}
WARN("Unsupported channel mixing: %dch->%dch", c, n);
SFL_WARN("Unsupported channel mixing: %dch->%dch", c, n);
samples_.resize(n, samples_[0]);
}
......@@ -137,7 +137,7 @@ std::vector<SFLAudioSample> * AudioBuffer::getChannel(unsigned chan /* = 0 */)
if (chan < samples_.size())
return &samples_[chan];
ERROR("Audio channel %u out of range", chan);
SFL_ERR("Audio channel %u out of range", chan);
return nullptr;
}
......@@ -147,7 +147,7 @@ void AudioBuffer::applyGain(double gain)
const double g = std::max(std::min(1.0, gain), -1.0);
if (g != gain)
DEBUG("Normalizing %f to [-1.0, 1.0]", gain);
SFL_DBG("Normalizing %f to [-1.0, 1.0]", gain);
for (auto &channel : samples_)
for (auto &sample : channel)
......
......@@ -62,7 +62,7 @@ AudioLayer::~AudioLayer()
void AudioLayer::hardwareFormatAvailable(AudioFormat playback)
{
std::lock_guard<std::mutex> lock(mutex_);
DEBUG("hardwareFormatAvailable : %s", playback.toString().c_str());
SFL_DBG("hardwareFormatAvailable : %s", playback.toString().c_str());
urgentRingBuffer_.setFormat(playback);
resampler_->setFormat(playback);
Manager::instance().hardwareAudioFormatChanged(playback);
......
......@@ -65,7 +65,7 @@ void
AudioLoop::getNext(AudioBuffer& output, double gain)
{
if (!buffer_) {
ERROR("buffer is NULL");
SFL_ERR("buffer is NULL");
return;
}
......@@ -75,10 +75,10 @@ AudioLoop::getNext(AudioBuffer& output, double gain)
size_t output_pos = 0;
if (buf_samples == 0) {
ERROR("Audio loop size is 0");
SFL_ERR("Audio loop size is 0");
return;
} else if (pos >= buf_samples) {
ERROR("Invalid loop position %d", pos);
SFL_ERR("Invalid loop position %d", pos);
return;
}
......
......@@ -96,7 +96,7 @@ AudioRecord::AudioRecord() : fileHandle_(nullptr)
, filename_(createFilename())
, savePath_()
{
WARN("Generate filename for this call %s ", filename_.c_str());
SFL_WARN("Generate filename for this call %s ", filename_.c_str());
}
AudioRecord::~AudioRecord()
......@@ -144,7 +144,7 @@ void AudioRecord::initFilename(const std::string &peerNumber)
fName.append("-" + sanitize(peerNumber) + "-" PACKAGE);
if (filename_.find(".wav") == std::string::npos) {
DEBUG("Concatenate .wav file extension: name : %s", filename_.c_str());
SFL_DBG("Concatenate .wav file extension: name : %s", filename_.c_str());
fName.append(".wav");
}
......@@ -163,19 +163,19 @@ bool AudioRecord::openFile()
const bool doAppend = fileExists();
const int access = doAppend ? SFM_RDWR : SFM_WRITE;
DEBUG("Opening file %s with format %s", savePath_.c_str(), sndFormat_.toString().c_str());
SFL_DBG("Opening file %s with format %s", savePath_.c_str(), sndFormat_.toString().c_str());
fileHandle_ = new SndfileHandle(savePath_.c_str(), access, SF_FORMAT_WAV | SF_FORMAT_PCM_16, sndFormat_.nb_channels, sndFormat_.sample_rate);
// check overloaded boolean operator
if (!*fileHandle_) {
WARN("Could not open WAV file!");
SFL_WARN("Could not open WAV file!");
delete fileHandle_;
fileHandle_ = 0;
return false;
}
if (doAppend and fileHandle_->seek(0, SEEK_END) < 0)
WARN("Couldn't seek to the end of the file ");
SFL_WARN("Couldn't seek to the end of the file ");
return result;
}
......@@ -215,7 +215,7 @@ bool AudioRecord::toggleRecording()
void AudioRecord::stopRecording()
{
DEBUG("Stop recording");
SFL_DBG("Stop recording");
recordingEnabled_ = false;
}
......@@ -225,14 +225,14 @@ void AudioRecord::recData(AudioBuffer& buffer)
return;
if (fileHandle_ == 0) {
DEBUG("Can't record data, a file has not yet been opened!");
SFL_DBG("Can't record data, a file has not yet been opened!");
return;
}
auto interleaved = buffer.interleave();
const int nSamples = interleaved.size();
if (fileHandle_->write(interleaved.data(), nSamples) != nSamples) {
WARN("Could not record data!");
SFL_WARN("Could not record data!");
} else {
fileHandle_->writeSync();
}
......
......@@ -225,7 +225,7 @@ void AudioRtpFactory::setRemoteCryptoInfo(SdesNegotiator& nego)
throw AudioRtpFactoryException(e.what());
}
} else {
ERROR("Should not store remote crypto info for non-SDES sessions");
SFL_ERR("Should not store remote crypto info for non-SDES sessions");
}
}
......
......@@ -105,13 +105,13 @@ void AudioRtpSession::setSessionMedia(const std::vector<AudioCodec*> &audioCodec
}
transportRate_ = rtpStream_.getTransportRate();
DEBUG("Switching to a transport rate of %d ms", transportRate_);
SFL_DBG("Switching to a transport rate of %d ms", transportRate_);
}
void AudioRtpSession::sendDtmfEvent()
{
DTMFEvent &dtmf(dtmfQueue_.front());
DEBUG("Send RTP Dtmf (%d)", dtmf.payload.event);
SFL_DBG("Send RTP Dtmf (%d)", dtmf.payload.event);
const int increment = getIncrementForDTMF();
if (dtmf.newevent)
......@@ -181,7 +181,7 @@ void AudioRtpSession::receiveSpeakerData()
const double jit_mean = std::accumulate(rxJitters_.begin(), rxJitters_.end(), 0.0) / rxJitters_.size();
const double jit_sq_sum = std::inner_product(rxJitters_.begin(), rxJitters_.end(), rxJitters_.begin(), 0.0);
const double jit_stdev = std::sqrt(jit_sq_sum / rxJitters_.size() - jit_mean * jit_mean);
DEBUG("Jitter avg: %fms std dev %fms", jit_mean, jit_stdev);
SFL_DBG("Jitter avg: %fms std dev %fms", jit_mean, jit_stdev);
jitterReportInterval_ = 0;
}
#endif
......@@ -193,13 +193,13 @@ void AudioRtpSession::receiveSpeakerData()
rxLastSeqNum_ += seqNumDiff;
seqNumDiff = 1;
} else if (seqNumDiff < 0) {
DEBUG("Dropping out-of-order packet %d (last %d)", rxLastSeqNum_ + seqNumDiff, rxLastSeqNum_);
SFL_DBG("Dropping out-of-order packet %d (last %d)", rxLastSeqNum_ + seqNumDiff, rxLastSeqNum_);
return;
} else {
rxLastSeqNum_ += seqNumDiff;
}
if (rxLastSeqNum_ && seqNumDiff > 1) {
DEBUG("%d packets lost", seqNumDiff-1);
SFL_DBG("%d packets lost", seqNumDiff-1);
for (unsigned i = 0, n = seqNumDiff - 1; i < n; i++)
rtpStream_.processDataDecode(nullptr, 0, adu->getType());
}
......@@ -241,7 +241,7 @@ void AudioRtpSession::setSessionTimeouts()
{
const unsigned schedulingTimeout = 4000;
const unsigned expireTimeout = 1000000;
DEBUG("Set session scheduling timeout (%d) and expireTimeout (%d)",
SFL_DBG("Set session scheduling timeout (%d) and expireTimeout (%d)",
schedulingTimeout, expireTimeout);
queue_.setSchedulingTimeout(schedulingTimeout);
......@@ -250,7 +250,7 @@ void AudioRtpSession::setSessionTimeouts()
void AudioRtpSession::updateDestinationIpAddress()
{
DEBUG("Update destination ip address");
SFL_DBG("Update destination ip address");
// Destination address are stored in a list in ccrtp
// This method remove the current destination entry
......@@ -258,28 +258,28 @@ void AudioRtpSession::updateDestinationIpAddress()
#if HAVE_IPV6
&& !(remoteIp_.isIpv6() == AF_INET6 && queue_.forgetDestination(static_cast<ost::IPV6Host>(remoteIp_), remoteIp_.getPort()))
#endif
) DEBUG("Did not remove previous destination");
) SFL_DBG("Did not remove previous destination");
IpAddr remote = {call_.getLocalSDP().getRemoteIP()};
remote.setPort(call_.getLocalSDP().getRemoteAudioPort());
if (!remote) {
WARN("Target IP address (%s) is not correct!", call_.getLocalSDP().getRemoteIP().c_str());
SFL_WARN("Target IP address (%s) is not correct!", call_.getLocalSDP().getRemoteIP().c_str());
return;
}
remoteIp_ = remote;
DEBUG("New remote address for session: %s", remote.toString(true).c_str());
SFL_DBG("New remote address for session: %s", remote.toString(true).c_str());
if (!(remoteIp_.isIpv4() && queue_.addDestination(static_cast<ost::IPV4Host>(remoteIp_), remoteIp_.getPort()))
#if HAVE_IPV6
&& !(remoteIp_.isIpv6() && queue_.addDestination(static_cast<ost::IPV6Host>(remoteIp_), remoteIp_.getPort()))
#endif
) WARN("Can't add new destination to session!");
) SFL_WARN("Can't add new destination to session!");
}
void AudioRtpSession::prepareRtpReceiveThread(const std::vector<AudioCodec*> &audioCodecs)
{
DEBUG("Preparing receiving thread");
SFL_DBG("Preparing receiving thread");
isStarted_ = true;
#ifdef RTP_DEBUG
rxLast_ = std::chrono::high_resolution_clock::now();
......@@ -336,13 +336,13 @@ void AudioRtpSession::putDtmfEvent(char digit)
CachedAudioRtpState *
AudioRtpSession::saveState() const
{
ERROR("Not implemented");
SFL_ERR("Not implemented");
return nullptr;
}
void
AudioRtpSession::restoreState(const CachedAudioRtpState &state UNUSED)
{
ERROR("Not implemented");
SFL_ERR("Not implemented");
}
}
......@@ -97,7 +97,7 @@ sfl::AudioCodec *
AudioRtpStream::getCurrentEncoder() const
{
if (audioCodecs_.empty() or currentEncoderIndex_ >= audioCodecs_.size()) {
ERROR("No codec found");
SFL_ERR("No codec found");
return nullptr;
}
......@@ -108,7 +108,7 @@ sfl::AudioCodec *
AudioRtpStream::getCurrentDecoder() const
{
if (audioCodecs_.empty() or currentDecoderIndex_ >= audioCodecs_.size()) {
ERROR("No codec found");
SFL_ERR("No codec found");
return nullptr;
}
......@@ -141,10 +141,10 @@ bool AudioRtpStream::tryToSwitchDecoder(int newPt)
hasDynamicPayloadType_ = codec->hasDynamicPayload();
resetDecoderPLC(codec);
currentDecoderIndex_ = i; // FIXME: this is not reliable
DEBUG("Switched payload type to %d", newPt);
SFL_DBG("Switched payload type to %d", newPt);
return true;
}
ERROR("Could not switch payload types");
SFL_ERR("Could not switch payload types");
return false;
}
......@@ -243,7 +243,7 @@ void AudioRtpStream::setRtpMedia(const std::vector<AudioCodec*> &audioCodecs)
if (audioCodecs.empty()) {
codecEncMutex_.unlock();
codecDecMutex_.unlock();
ERROR("Audio codecs empty");
SFL_ERR("Audio codecs empty");
return;
}
......@@ -317,7 +317,7 @@ size_t AudioRtpStream::processDataEncode()
const size_t samples = Manager::instance().getRingBufferPool().getData(micData_, id_);
if (samples != samplesToGet) {
ERROR("Asked for %d samples from bindings on call '%s', got %d",
SFL_ERR("Asked for %d samples from bindings on call '%s', got %d",
samplesToGet, id_.c_str(), samples);
return 0;
}
......@@ -325,7 +325,7 @@ size_t AudioRtpStream::processDataEncode()
AudioBuffer *out = &micData_;
if (encoder_.format_.sample_rate != mainBuffFormat.sample_rate) {
if (!encoder_.resampler_) {
ERROR("Resampler already destroyed");
SFL_ERR("Resampler already destroyed");
return 0;
}
encoder_.resampledData_.setChannelNum(mainBuffFormat.nb_channels);
......@@ -344,7 +344,7 @@ size_t AudioRtpStream::processDataEncode()
std::lock_guard<std::mutex> lock(codecEncMutex_);
auto codec = getCurrentEncoder();
if (!codec) {
ERROR("Audio codec already destroyed");
SFL_ERR("Audio codec already destroyed");
return 0;
}
......@@ -373,7 +373,7 @@ void AudioRtpStream::processDataDecode(unsigned char *spkrData, size_t size, int
if (not switched) {
if (!warningInterval_) {
warningInterval_ = 250;
WARN("Invalid payload type %d, expected %d", payloadType, decPt);
SFL_WARN("Invalid payload type %d, expected %d", payloadType, decPt);
}
warningInterval_--;
......@@ -387,7 +387,7 @@ void AudioRtpStream::processDataDecode(unsigned char *spkrData, size_t size, int
std::lock_guard<std::mutex> lock(codecDecMutex_);
auto codec = getCurrentDecoder();
if (!codec) {
ERROR("Audio codec already destroyed");
SFL_ERR("Audio codec already destroyed");
return;
}
if (spkrData) { // Packet is available
......@@ -421,7 +421,7 @@ void AudioRtpStream::processDataDecode(unsigned char *spkrData, size_t size, int
AudioFormat mainBuffFormat = Manager::instance().getRingBufferPool().getInternalAudioFormat();
if (decFormat.sample_rate != mainBuffFormat.sample_rate) {
if (!decoder_.resampler_) {
ERROR("Resampler already destroyed");
SFL_ERR("Resampler already destroyed");
return;
}
decoder_.resampledData_.setChannelNum(decFormat.nb_channels);
......
......@@ -73,7 +73,7 @@ decodeBase64(unsigned char *input, int length)
static void
bufferFillMasterKey(std::vector<uint8_t>& dest)
{
DEBUG("Init local master key");
SFL_DBG("Init local master key");
std::uniform_int_distribution<uint8_t> rand_byte(0, 255);
// Fill the key
......@@ -87,7 +87,7 @@ bufferFillMasterKey(std::vector<uint8_t>& dest)
static void
bufferFillMasterSalt(std::vector<uint8_t>& dest)
{
DEBUG("Init local master salt");
SFL_DBG("Init local master salt");
std::uniform_int_distribution<uint8_t> rand_byte(0, 255);
// Fill the key
......@@ -123,7 +123,7 @@ AudioSrtpSession::~AudioSrtpSession()
void AudioSrtpSession::initLocalCryptoInfo()
{
DEBUG("AudioSrtpSession: Set cryptographic info for this rtp session");
SFL_DBG("AudioSrtpSession: Set cryptographic info for this rtp session");
// Initialize local Crypto context
initializeLocalMasterKey();
......@@ -138,7 +138,7 @@ void AudioSrtpSession::initLocalCryptoInfo()
void AudioSrtpSession::initLocalCryptoInfoOnOffhold()
{
DEBUG("AudioSrtpSession: Set cryptographic info for this rtp session");
SFL_DBG("AudioSrtpSession: Set cryptographic info for this rtp session");
// Initialize local Crypto context
initializeLocalCryptoContext();
......@@ -151,7 +151,7 @@ void AudioSrtpSession::initLocalCryptoInfoOnOffhold()
std::vector<std::string> AudioSrtpSession::getLocalCryptoInfo()
{
DEBUG("Get Cryptographic info from this rtp session");
SFL_DBG("Get Cryptographic info from this rtp session");
std::vector<std::string> crypto_vector;
......@@ -173,7 +173,7 @@ std::vector<std::string> AudioSrtpSession::getLocalCryptoInfo()
crypto_attr += crypto_suite.append(" ");
crypto_attr += srtp_keys;
DEBUG("%s", crypto_attr.c_str());
SFL_DBG("%s", crypto_attr.c_str());
crypto_vector.push_back(crypto_attr);
......@@ -219,7 +219,7 @@ void AudioSrtpSession::initializeLocalMasterSalt()
std::string AudioSrtpSession::getBase64ConcatenatedKeys()
{
DEBUG("Get base64 concatenated keys");
SFL_DBG("Get base64 concatenated keys");
// compute concatenated master and salt length
std::vector<uint8> concatKeys;
......@@ -255,7 +255,7 @@ void AudioSrtpSession::unBase64ConcatenatedKeys(std::string base64keys)
void AudioSrtpSession::initializeRemoteCryptoContext()
{
DEBUG("Initialize remote crypto context");
SFL_DBG("Initialize remote crypto context");
const CryptoSuiteDefinition &crypto = sfl::CryptoSuites[remoteCryptoSuite_];
......@@ -279,7 +279,7 @@ void AudioSrtpSession::initializeRemoteCryptoContext()
void AudioSrtpSession::initializeLocalCryptoContext()
{
DEBUG("Initialize local crypto context");
SFL_DBG("Initialize local crypto context");
const CryptoSuiteDefinition &crypto = sfl::CryptoSuites[localCryptoSuite_];
......
......@@ -44,7 +44,7 @@ AudioSymmetricRtpSession::AudioSymmetricRtpSession(SIPCall &call) :
ost::SymmetricRTPSession(static_cast<ost::IPV4Host>(call.getLocalIp()), call.getLocalAudioPort())
, AudioRtpSession(call, *this)
{
DEBUG("Setting new RTP session with destination %s:%d",
SFL_DBG("Setting new RTP session with destination %s:%d",
call_.getLocalIp().toString().c_str(), call_.getLocalAudioPort());
}
......@@ -78,17 +78,17 @@ void AudioSymmetricRtpSession::onGotRR(ost::SyncSource& source, ost::RTCPCompoun
{
ost::SymmetricRTPSession::onGotRR(source, RR, blocks);
#ifdef RTP_DEBUG
DEBUG("onGotRR");
DEBUG("Unpacking %d blocks",blocks);
SFL_DBG("onGotRR");
SFL_DBG("Unpacking %d blocks",blocks);
for (int i = 0; i < blocks; ++i)
{
DEBUG("fractionLost : %hhu", RR.blocks[i].rinfo.fractionLost);
DEBUG("lostMSB : %hhu", RR.blocks[i].rinfo.lostMSB);
DEBUG("lostLSW : %hu", RR.blocks[i].rinfo.lostLSW);
DEBUG("highestSeqNum : %u", RR.blocks[i].rinfo.highestSeqNum);
DEBUG("jitter : %u", RR.blocks[i].rinfo.jitter);
DEBUG("lsr : %u", RR.blocks[i].rinfo.lsr);
DEBUG("dlsr : %u", RR.blocks[i].rinfo.dlsr);
SFL_DBG("fractionLost : %hhu", RR.blocks[i].rinfo.fractionLost);
SFL_DBG("lostMSB : %hhu", RR.blocks[i].rinfo.lostMSB);
SFL_DBG("lostLSW : %hu", RR.blocks[i].rinfo.lostLSW);
SFL_DBG("highestSeqNum : %u", RR.blocks[i].rinfo.highestSeqNum);
SFL_DBG("jitter : %u", RR.blocks[i].rinfo.jitter);
SFL_DBG("lsr : %u", RR.blocks[i].rinfo.lsr);
SFL_DBG("dlsr : %u", RR.blocks[i].rinfo.dlsr);
}
#endif
}
......@@ -97,7 +97,7 @@ void AudioSymmetricRtpSession::onGotRR(ost::SyncSource& source, ost::RTCPCompoun
void AudioSymmetricRtpSession::onGotSR(ost::SyncSource& source, ost::RTCPCompoundHandler::SendReport& SR, uint8 blocks)
{