Commit 9963c8ff authored by Tristan Matthews's avatar Tristan Matthews

* #11269: merged master into video

parent 1cbb4291
...@@ -2,6 +2,8 @@ ...@@ -2,6 +2,8 @@
# SFLphone # SFLphone
################################################ ################################################
* 2012-05-17: 1.1.0 has been released
* 2011-11-18: 1.0.1 has been released * 2011-11-18: 1.0.1 has been released
* 2011-09-30: 1.0.0 has been released * 2011-09-30: 1.0.0 has been released
......
...@@ -21,8 +21,7 @@ endif ...@@ -21,8 +21,7 @@ endif
ACLOCAL_AMFLAGS = -I m4 ACLOCAL_AMFLAGS = -I m4
SUBDIRS = libs src ringtones man $(TESTS_DIR) doc SUBDIRS = libs src ringtones man $(TESTS_DIR) doc
EXTRA_DIST = README.gentoo \ EXTRA_DIST = m4/libtool.m4 \
m4/libtool.m4 \
m4/lt~obsolete.m4 \ m4/lt~obsolete.m4 \
m4/ltoptions.m4 \ m4/ltoptions.m4 \
m4/ltsugar.m4 \ m4/ltsugar.m4 \
......
...@@ -2,7 +2,7 @@ dnl SFLPhone - configure.ac for automake 1.9 and autoconf 2.59 ...@@ -2,7 +2,7 @@ dnl SFLPhone - configure.ac for automake 1.9 and autoconf 2.59
dnl Process this file with autoconf to produce a configure script. dnl Process this file with autoconf to produce a configure script.
AC_PREREQ([2.65]) AC_PREREQ([2.65])
AC_INIT([sflphone],[1.0.2],[sflphoneteam@savoirfairelinux.com],[sflphone]) AC_INIT([sflphone],[1.1.0],[sflphoneteam@savoirfairelinux.com],[sflphone])
AC_COPYRIGHT([[Copyright (c) Savoir-Faire Linux 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012]]) AC_COPYRIGHT([[Copyright (c) Savoir-Faire Linux 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012]])
AC_REVISION([$Revision$]) AC_REVISION([$Revision$])
......
...@@ -56,7 +56,7 @@ Account::Account(const std::string &accountID, const std::string &type) : ...@@ -56,7 +56,7 @@ Account::Account(const std::string &accountID, const std::string &type) :
, userAgent_("SFLphone") , userAgent_("SFLphone")
, mailBox_() , mailBox_()
{ {
// Initialize the codec list, used when creating a new account // Initialize the codec order, used when creating a new account
loadDefaultCodecs(); loadDefaultCodecs();
} }
...@@ -77,25 +77,25 @@ void Account::setRegistrationState(const RegistrationState &state) ...@@ -77,25 +77,25 @@ void Account::setRegistrationState(const RegistrationState &state)
void Account::loadDefaultCodecs() void Account::loadDefaultCodecs()
{ {
// Initialize codec // Initialize codec
std::vector<std::string> codecList; std::vector<std::string> result;
codecList.push_back("0"); result.push_back("0");
codecList.push_back("3"); result.push_back("3");
codecList.push_back("8"); result.push_back("8");
codecList.push_back("9"); result.push_back("9");
codecList.push_back("110"); result.push_back("110");
codecList.push_back("111"); result.push_back("111");
codecList.push_back("112"); result.push_back("112");
setActiveCodecs(codecList); setActiveCodecs(result);
#ifdef SFL_VIDEO #ifdef SFL_VIDEO
setActiveVideoCodecs(sfl_video::getCodecList()); setActiveVideoCodecs(sfl_video::getCodecList());
#endif #endif
} }
#ifdef SFL_VIDEO #ifdef SFL_VIDEO
void Account::setActiveVideoCodecs (const std::vector <std::string> &list) void Account::setActiveVideoCodecs(const std::vector<std::string> &list)
{ {
videoCodecList_ = !list.empty() ? list : sfl_video::getCodecList(); videoCodecList_ = !list.empty() ? list : sfl_video::getCodecList();
} }
#endif #endif
...@@ -105,14 +105,15 @@ void Account::setActiveCodecs(const std::vector <std::string> &list) ...@@ -105,14 +105,15 @@ void Account::setActiveCodecs(const std::vector <std::string> &list)
codecList_.clear(); codecList_.clear();
// list contains the ordered payload of active codecs picked by the user for this account // list contains the ordered payload of active codecs picked by the user for this account
// we used the CodecList vector to save the order. // we used the CodecOrder vector to save the order.
for (std::vector<std::string>::const_iterator i = list.begin(); i != list.end(); ++i) { for (std::vector<std::string>::const_iterator iter = list.begin(); iter != list.end();
int payload = std::atoi(i->c_str()); ++iter) {
int payload = std::atoi(iter->c_str());
codecList_.push_back(static_cast<int>(payload)); codecList_.push_back(static_cast<int>(payload));
} }
// update the codec string according to new codec selection // update the codec string according to new codec selection
codecStr_ = ManagerImpl::serialize(list); codecStr_ = ManagerImpl::join_string(list);
} }
std::string Account::mapStateNumberToString(RegistrationState state) std::string Account::mapStateNumberToString(RegistrationState state)
......
...@@ -76,10 +76,14 @@ static const char *const CONFIG_ACCOUNT_ALIAS = "Account.alias"; ...@@ -76,10 +76,14 @@ static const char *const CONFIG_ACCOUNT_ALIAS = "Account.alias";
static const char *const CONFIG_ACCOUNT_MAILBOX = "Account.mailbox"; static const char *const CONFIG_ACCOUNT_MAILBOX = "Account.mailbox";
static const char *const CONFIG_ACCOUNT_ENABLE = "Account.enable"; static const char *const CONFIG_ACCOUNT_ENABLE = "Account.enable";
static const char *const CONFIG_ACCOUNT_REGISTRATION_EXPIRE = "Account.registrationExpire"; static const char *const CONFIG_ACCOUNT_REGISTRATION_EXPIRE = "Account.registrationExpire";
static const char *const CONFIG_ACCOUNT_REGISTRATION_STATUS = "Account.registrationStatus";
static const char *const CONFIG_ACCOUNT_REGISTRATION_STATE_CODE = "Account.registrationCode";
static const char *const CONFIG_ACCOUNT_REGISTRATION_STATE_DESC = "Account.registrationDescription";
static const char *const CONFIG_CREDENTIAL_NUMBER = "Credential.count"; static const char *const CONFIG_CREDENTIAL_NUMBER = "Credential.count";
static const char *const CONFIG_ACCOUNT_DTMF_TYPE = "Account.dtmfType"; static const char *const CONFIG_ACCOUNT_DTMF_TYPE = "Account.dtmfType";
static const char *const CONFIG_RINGTONE_PATH = "Account.ringtonePath"; static const char *const CONFIG_RINGTONE_PATH = "Account.ringtonePath";
static const char *const CONFIG_RINGTONE_ENABLED = "Account.ringtoneEnabled"; static const char *const CONFIG_RINGTONE_ENABLED = "Account.ringtoneEnabled";
static const char *const CONFIG_KEEP_ALIVE_ENABLED = "Account.keepAliveEnabled";
static const char *const CONFIG_ACCOUNT_HOSTNAME = "Account.hostname"; static const char *const CONFIG_ACCOUNT_HOSTNAME = "Account.hostname";
static const char *const CONFIG_ACCOUNT_USERNAME = "Account.username"; static const char *const CONFIG_ACCOUNT_USERNAME = "Account.username";
...@@ -128,10 +132,6 @@ static const char *const CONFIG_TLS_REQUIRE_CLIENT_CERTIFICATE = "TLS.requireCli ...@@ -128,10 +132,6 @@ static const char *const CONFIG_TLS_REQUIRE_CLIENT_CERTIFICATE = "TLS.requireCli
static const char *const CONFIG_TLS_NEGOTIATION_TIMEOUT_SEC = "TLS.negotiationTimeoutSec"; static const char *const CONFIG_TLS_NEGOTIATION_TIMEOUT_SEC = "TLS.negotiationTimeoutSec";
static const char *const CONFIG_TLS_NEGOTIATION_TIMEOUT_MSEC = "TLS.negotiationTimemoutMsec"; static const char *const CONFIG_TLS_NEGOTIATION_TIMEOUT_MSEC = "TLS.negotiationTimemoutMsec";
static const char *const CONFIG_REGISTRATION_STATUS = "Registration.Status";
static const char *const CONFIG_REGISTRATION_STATE_CODE = "Registration.code";
static const char *const CONFIG_REGISTRATION_STATE_DESCRIPTION = "Registration.description";
// General configuration keys for accounts // General configuration keys for accounts
static const char * const ALIAS_KEY = "alias"; static const char * const ALIAS_KEY = "alias";
static const char * const TYPE_KEY = "type"; static const char * const TYPE_KEY = "type";
...@@ -295,7 +295,7 @@ class Account : public Serializable { ...@@ -295,7 +295,7 @@ class Account : public Serializable {
/** /**
* Helper function used to load the default codec order from the codec factory * Helper function used to load the default codec order from the codec factory
* setActiveCodecs is called to sync both codecOrder_ and codecStr_ * setActiveCodecs is called to sync both codecList_ and codecStr_
*/ */
void loadDefaultCodecs(); void loadDefaultCodecs();
......
...@@ -219,7 +219,7 @@ AlsaLayer::stopStream() ...@@ -219,7 +219,7 @@ AlsaLayer::stopStream()
#define ALSA_CALL(call, error) ({ \ #define ALSA_CALL(call, error) ({ \
int err_code = call; \ int err_code = call; \
if (err_code < 0) \ if (err_code < 0) \
ERROR("ALSA: "error": %s", snd_strerror(err_code)); \ ERROR(error ": %s", snd_strerror(err_code)); \
err_code; \ err_code; \
}) })
...@@ -314,16 +314,16 @@ bool AlsaLayer::alsa_set_params(snd_pcm_t *pcm_handle) ...@@ -314,16 +314,16 @@ bool AlsaLayer::alsa_set_params(snd_pcm_t *pcm_handle)
TRY(snd_pcm_hw_params_any(HW), "hwparams init"); TRY(snd_pcm_hw_params_any(HW), "hwparams init");
TRY(snd_pcm_hw_params_set_access(HW, SND_PCM_ACCESS_RW_INTERLEAVED), "access type"); TRY(snd_pcm_hw_params_set_access(HW, SND_PCM_ACCESS_RW_INTERLEAVED), "access type");
TRY(snd_pcm_hw_params_set_format(HW, SND_PCM_FORMAT_S16_LE), "sample format"); TRY(snd_pcm_hw_params_set_format(HW, SND_PCM_FORMAT_S16_LE), "sample format");
TRY(snd_pcm_hw_params_set_rate_near(HW, &audioSampleRate_, NULL), "sample rate"); TRY(snd_pcm_hw_params_set_rate_near(HW, &sampleRate_, NULL), "sample rate");
TRY(snd_pcm_hw_params_set_channels(HW, 1), "channel count"); TRY(snd_pcm_hw_params_set_channels(HW, 1), "channel count");
TRY(snd_pcm_hw_params_set_period_size_near(HW, &periodSize, NULL), "period time"); TRY(snd_pcm_hw_params_set_period_size_near(HW, &periodSize, NULL), "period time");
TRY(snd_pcm_hw_params_set_periods_near(HW, &periods, NULL), "periods number"); TRY(snd_pcm_hw_params_set_periods_near(HW, &periods, NULL), "periods number");
TRY(snd_pcm_hw_params(HW), "hwparams"); TRY(snd_pcm_hw_params(HW), "hwparams");
#undef HW #undef HW
DEBUG("ALSA: %s using sampling rate %dHz", DEBUG("%s using sampling rate %dHz",
(snd_pcm_stream(pcm_handle) == SND_PCM_STREAM_PLAYBACK) ? "playback" : "capture", (snd_pcm_stream(pcm_handle) == SND_PCM_STREAM_PLAYBACK) ? "playback" : "capture",
audioSampleRate_); sampleRate_);
snd_pcm_sw_params_t *swparams = NULL; snd_pcm_sw_params_t *swparams = NULL;
snd_pcm_sw_params_alloca(&swparams); snd_pcm_sw_params_alloca(&swparams);
...@@ -370,7 +370,7 @@ AlsaLayer::write(void* buffer, int length, snd_pcm_t * handle) ...@@ -370,7 +370,7 @@ AlsaLayer::write(void* buffer, int length, snd_pcm_t * handle)
} }
default: default:
ERROR("ALSA: unknown write error, dropping frames: %s", snd_strerror(err)); ERROR("Unknown write error, dropping frames: %s", snd_strerror(err));
stopPlaybackStream(); stopPlaybackStream();
break; break;
} }
...@@ -405,12 +405,12 @@ AlsaLayer::read(void* buffer, int toCopy) ...@@ -405,12 +405,12 @@ AlsaLayer::read(void* buffer, int toCopy)
startCaptureStream(); startCaptureStream();
} }
ERROR("ALSA: XRUN capture ignored (%s)", snd_strerror(err)); ERROR("XRUN capture ignored (%s)", snd_strerror(err));
break; break;
} }
case EPERM: case EPERM:
ERROR("ALSA: Can't capture, EPERM (%s)", snd_strerror(err)); ERROR("Can't capture, EPERM (%s)", snd_strerror(err));
prepareCaptureStream(); prepareCaptureStream();
startCaptureStream(); startCaptureStream();
break; break;
...@@ -456,7 +456,7 @@ AlsaLayer::getAudioDeviceIndexMap(AudioStreamDirection dir) const ...@@ -456,7 +456,7 @@ AlsaLayer::getAudioDeviceIndexMap(AudioStreamDirection dir) const
snd_ctl_card_info_alloca(&info); snd_ctl_card_info_alloca(&info);
snd_pcm_info_alloca(&pcminfo); snd_pcm_info_alloca(&pcminfo);
int numCard = -1 ; int numCard = -1;
std::vector<HwIDPair> audioDevice; std::vector<HwIDPair> audioDevice;
...@@ -541,7 +541,7 @@ AlsaLayer::getAudioDeviceIndex(const std::string &description) const ...@@ -541,7 +541,7 @@ AlsaLayer::getAudioDeviceIndex(const std::string &description) const
void AlsaLayer::capture() void AlsaLayer::capture()
{ {
unsigned int mainBufferSampleRate = Manager::instance().getMainBuffer()->getInternalSamplingRate(); unsigned int mainBufferSampleRate = Manager::instance().getMainBuffer()->getInternalSamplingRate();
bool resample = audioSampleRate_ != mainBufferSampleRate; bool resample = sampleRate_ != mainBufferSampleRate;
int toGetSamples = snd_pcm_avail_update(captureHandle_); int toGetSamples = snd_pcm_avail_update(captureHandle_);
...@@ -567,10 +567,11 @@ void AlsaLayer::capture() ...@@ -567,10 +567,11 @@ void AlsaLayer::capture()
AudioLayer::applyGain(&(*in.begin()), toGetSamples, getCaptureGain()); AudioLayer::applyGain(&(*in.begin()), toGetSamples, getCaptureGain());
if (resample) { if (resample) {
int outSamples = toGetSamples * ((double) audioSampleRate_ / mainBufferSampleRate); int outSamples = toGetSamples * ((double) sampleRate_ / mainBufferSampleRate);
std::vector<SFLDataFormat> rsmpl_out(outSamples); std::vector<SFLDataFormat> rsmpl_out(outSamples);
converter_->resample(&(*in.begin()), &(*rsmpl_out.begin()), converter_.resample(&(*in.begin()), &(*rsmpl_out.begin()),
mainBufferSampleRate, audioSampleRate_, toGetSamples); rsmpl_out.size(), mainBufferSampleRate, sampleRate_,
toGetSamples);
dcblocker_.process(&(*rsmpl_out.begin()), &(*rsmpl_out.begin()), outSamples); dcblocker_.process(&(*rsmpl_out.begin()), &(*rsmpl_out.begin()), outSamples);
Manager::instance().getMainBuffer()->putData(&(*rsmpl_out.begin()), Manager::instance().getMainBuffer()->putData(&(*rsmpl_out.begin()),
rsmpl_out.size() * sizeof(rsmpl_out[0]), MainBuffer::DEFAULT_ID); rsmpl_out.size() * sizeof(rsmpl_out[0]), MainBuffer::DEFAULT_ID);
...@@ -585,7 +586,7 @@ void AlsaLayer::playback(int maxSamples) ...@@ -585,7 +586,7 @@ void AlsaLayer::playback(int maxSamples)
{ {
unsigned int mainBufferSampleRate = Manager::instance().getMainBuffer()->getInternalSamplingRate(); unsigned int mainBufferSampleRate = Manager::instance().getMainBuffer()->getInternalSamplingRate();
bool resample = audioSampleRate_ != mainBufferSampleRate; bool resample = sampleRate_ != mainBufferSampleRate;
int toGet = Manager::instance().getMainBuffer()->availForGet(MainBuffer::DEFAULT_ID); int toGet = Manager::instance().getMainBuffer()->availForGet(MainBuffer::DEFAULT_ID);
int toPut = maxSamples * sizeof(SFLDataFormat); int toPut = maxSamples * sizeof(SFLDataFormat);
...@@ -617,7 +618,7 @@ void AlsaLayer::playback(int maxSamples) ...@@ -617,7 +618,7 @@ void AlsaLayer::playback(int maxSamples)
double resampleFactor = 1.0; double resampleFactor = 1.0;
if (resample) { if (resample) {
resampleFactor = (double) audioSampleRate_ / mainBufferSampleRate; resampleFactor = (double) sampleRate_ / mainBufferSampleRate;
maxNbBytesToGet = (double) toGet / resampleFactor; maxNbBytesToGet = (double) toGet / resampleFactor;
} }
...@@ -631,10 +632,10 @@ void AlsaLayer::playback(int maxSamples) ...@@ -631,10 +632,10 @@ void AlsaLayer::playback(int maxSamples)
if (resample) { if (resample) {
int inSamples = toGet / sizeof(SFLDataFormat); int inSamples = toGet / sizeof(SFLDataFormat);
int outSamples = inSamples * resampleFactor; int outSamples = inSamples * resampleFactor;
SFLDataFormat *rsmpl_out = (SFLDataFormat*) malloc(outSamples * sizeof(SFLDataFormat)); std::vector<SFLDataFormat> rsmpl_out(outSamples);
converter_->resample(out, rsmpl_out, mainBufferSampleRate, audioSampleRate_, inSamples); converter_.resample(out, &(*rsmpl_out.begin()), rsmpl_out.size(),
write(rsmpl_out, outSamples * sizeof(SFLDataFormat), playbackHandle_); mainBufferSampleRate, sampleRate_, inSamples);
free(rsmpl_out); write(&(*rsmpl_out.begin()), outSamples * sizeof(SFLDataFormat), playbackHandle_);
} else { } else {
write(out, toGet, playbackHandle_); write(out, toGet, playbackHandle_);
} }
......
...@@ -40,25 +40,16 @@ unsigned int AudioLayer::playbackGain_ = 100; ...@@ -40,25 +40,16 @@ unsigned int AudioLayer::playbackGain_ = 100;
AudioLayer::AudioLayer() AudioLayer::AudioLayer()
: isStarted_(false) : isStarted_(false)
, urgentRingBuffer_(SIZEBUF, MainBuffer::DEFAULT_ID) , urgentRingBuffer_(SIZEBUF, MainBuffer::DEFAULT_ID)
, audioSampleRate_(Manager::instance().getMainBuffer()->getInternalSamplingRate()) , sampleRate_(Manager::instance().getMainBuffer()->getInternalSamplingRate())
, mutex_() , mutex_()
, dcblocker_() , dcblocker_()
, audioPref(Manager::instance().audioPreference) , audioPref(Manager::instance().audioPreference)
, converter_(new SamplerateConverter(audioSampleRate_)) , converter_(sampleRate_)
, lastNotificationTime_(0) , lastNotificationTime_(0)
{ {
urgentRingBuffer_.createReadPointer(MainBuffer::DEFAULT_ID); urgentRingBuffer_.createReadPointer(MainBuffer::DEFAULT_ID);
} }
AudioLayer::~AudioLayer()
{
if(converter_) {
delete converter_;
converter_ = NULL;
}
}
void AudioLayer::flushMain() void AudioLayer::flushMain()
{ {
ost::MutexLock guard(mutex_); ost::MutexLock guard(mutex_);
......
...@@ -62,7 +62,7 @@ class AudioLayer { ...@@ -62,7 +62,7 @@ class AudioLayer {
public: public:
AudioLayer(); AudioLayer();
virtual ~AudioLayer(); virtual ~AudioLayer() {}
virtual std::vector<std::string> getAudioDeviceList(AudioStreamDirection dir) const = 0; virtual std::vector<std::string> getAudioDeviceList(AudioStreamDirection dir) const = 0;
...@@ -158,7 +158,7 @@ class AudioLayer { ...@@ -158,7 +158,7 @@ class AudioLayer {
* default: 44100 HZ * default: 44100 HZ
*/ */
unsigned int getSampleRate() const { unsigned int getSampleRate() const {
return audioSampleRate_; return sampleRate_;
} }
/** /**
...@@ -199,7 +199,7 @@ class AudioLayer { ...@@ -199,7 +199,7 @@ class AudioLayer {
* Sample Rate SFLphone should send sound data to the sound card * Sample Rate SFLphone should send sound data to the sound card
* The value can be set in the user config file- now: 44100HZ * The value can be set in the user config file- now: 44100HZ
*/ */
unsigned int audioSampleRate_; unsigned int sampleRate_;
/** /**
* Lock for the entire audio layer * Lock for the entire audio layer
...@@ -219,7 +219,7 @@ class AudioLayer { ...@@ -219,7 +219,7 @@ class AudioLayer {
/** /**
* Manage sampling rate conversion * Manage sampling rate conversion
*/ */
SamplerateConverter *converter_; SamplerateConverter converter_;
private: private:
/** /**
......
...@@ -53,10 +53,10 @@ AudioLoop::getNext(SFLDataFormat* output, size_t total_samples, short volume) ...@@ -53,10 +53,10 @@ AudioLoop::getNext(SFLDataFormat* output, size_t total_samples, short volume)
size_t pos = pos_; size_t pos = pos_;
if (size_ == 0) { if (size_ == 0) {
ERROR("AudioLoop: Error: Audio loop size is 0"); ERROR("Audio loop size is 0");
return; return;
} else if (pos >= size_) { } else if (pos >= size_) {
ERROR("AudioLoop: Error: Invalid loop position %d", pos); ERROR("Invalid loop position %d", pos);
return; return;
} }
......
...@@ -28,6 +28,10 @@ ...@@ -28,6 +28,10 @@
* as that of the covered work. * as that of the covered work.
*/ */
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "audiorecord.h" #include "audiorecord.h"
#include <unistd.h> #include <unistd.h>
#include <sstream> // for stringstream #include <sstream> // for stringstream
...@@ -98,16 +102,16 @@ void AudioRecord::setRecordingOption(FILE_TYPE type, int sndSmplRate, const std: ...@@ -98,16 +102,16 @@ void AudioRecord::setRecordingOption(FILE_TYPE type, int sndSmplRate, const std:
void AudioRecord::initFilename(const std::string &peerNumber) void AudioRecord::initFilename(const std::string &peerNumber)
{ {
std::string fName(filename_); std::string fName(filename_);
fName.append("-" + peerNumber); fName.append("-" + peerNumber + "-" PACKAGE);
if (fileType_ == FILE_RAW) { if (fileType_ == FILE_RAW) {
if (filename_.find(".raw") == std::string::npos) { if (filename_.find(".raw") == std::string::npos) {
DEBUG("AudioRecord: concatenate .raw file extension: name : %s", filename_.c_str()); DEBUG("Concatenate .raw file extension: name : %s", filename_.c_str());
fName.append(".raw"); fName.append(".raw");
} }
} else if (fileType_ == FILE_WAV) { } else if (fileType_ == FILE_WAV) {
if (filename_.find(".wav") == std::string::npos) { if (filename_.find(".wav") == std::string::npos) {
DEBUG("AudioRecord: concatenate .wav file extension: name : %s", filename_.c_str()); DEBUG("Concatenate .wav file extension: name : %s", filename_.c_str());
fName.append(".wav"); fName.append(".wav");
} }
} }
...@@ -125,7 +129,7 @@ bool AudioRecord::openFile() ...@@ -125,7 +129,7 @@ bool AudioRecord::openFile()
bool result = false; bool result = false;
if (not fileExists()) { if (not fileExists()) {
DEBUG("AudioRecord: Filename does not exist, creating one"); DEBUG("Filename does not exist, creating one");
byteCounter_ = 0; byteCounter_ = 0;
if (fileType_ == FILE_RAW) if (fileType_ == FILE_RAW)
...@@ -133,7 +137,7 @@ bool AudioRecord::openFile() ...@@ -133,7 +137,7 @@ bool AudioRecord::openFile()
else if (fileType_ == FILE_WAV) else if (fileType_ == FILE_WAV)
result = setWavFile(); result = setWavFile();
} else { } else {
DEBUG("AudioRecord: Filename already exists, opening it"); DEBUG("Filename already exists, opening it");
if (fileType_ == FILE_RAW) if (fileType_ == FILE_RAW)
result = openExistingRawFile(); result = openExistingRawFile();
else if (fileType_ == FILE_WAV) else if (fileType_ == FILE_WAV)
...@@ -180,7 +184,7 @@ void AudioRecord::setRecording() ...@@ -180,7 +184,7 @@ void AudioRecord::setRecording()
void AudioRecord::stopRecording() void AudioRecord::stopRecording()
{ {
DEBUG("AudioRecording: Stop recording"); DEBUG("Stop recording");
recordingEnabled_ = false; recordingEnabled_ = false;
} }
...@@ -227,7 +231,7 @@ void AudioRecord::createFilename() ...@@ -227,7 +231,7 @@ void AudioRecord::createFilename()
out << timeinfo->tm_sec; out << timeinfo->tm_sec;
filename_ = out.str(); filename_ = out.str();
DEBUG("AudioRecord: Generate filename for this call %s ", filename_.c_str()); DEBUG("Generate filename for this call %s ", filename_.c_str());
} }
bool AudioRecord::setRawFile() bool AudioRecord::setRawFile()
...@@ -235,11 +239,11 @@ bool AudioRecord::setRawFile() ...@@ -235,11 +239,11 @@ bool AudioRecord::setRawFile()
fileHandle_ = fopen(savePath_.c_str(), "wb"); fileHandle_ = fopen(savePath_.c_str(), "wb");
if (!fileHandle_) { if (!fileHandle_) {
WARN("AudioRecord: Could not create RAW file!"); WARN("Could not create RAW file!");
return false; return false;
} }
DEBUG("AudioRecord:setRawFile() : created RAW file."); DEBUG("created RAW file.");
return true; return true;
} }
...@@ -267,12 +271,12 @@ namespace { ...@@ -267,12 +271,12 @@ namespace {
bool AudioRecord::setWavFile() bool AudioRecord::setWavFile()
{ {
DEBUG("AudioRecord: Create new wave file %s, sampling rate: %d", savePath_.c_str(), sndSmplRate_); DEBUG("Create new wave file %s, sampling rate: %d", savePath_.c_str(), sndSmplRate_);
fileHandle_ = fopen(savePath_.c_str(), "wb"); fileHandle_ = fopen(savePath_.c_str(), "wb");