Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
J
jami-daemon
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
140
Issues
140
List
Boards
Labels
Service Desk
Milestones
Iterations
Requirements
Requirements
List
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Incidents
Analytics
Analytics
Insights
Issue
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
savoirfairelinux
jami-daemon
Commits
e976366c
Commit
e976366c
authored
Nov 15, 2011
by
Tristan Matthews
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* #7842: fixed Weffc++ warnings/uninitialized variables
parent
ce437dc3
Changes
81
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
81 changed files
with
578 additions
and
679 deletions
+578
-679
daemon/configure.ac
daemon/configure.ac
+1
-1
daemon/src/account.cpp
daemon/src/account.cpp
+5
-1
daemon/src/audio/audiolayer.cpp
daemon/src/audio/audiolayer.cpp
+1
-0
daemon/src/audio/audiolayer.h
daemon/src/audio/audiolayer.h
+0
-3
daemon/src/audio/audiorecord.cpp
daemon/src/audio/audiorecord.cpp
+2
-0
daemon/src/audio/audiorecord.h
daemon/src/audio/audiorecord.h
+4
-1
daemon/src/audio/audiorecorder.cpp
daemon/src/audio/audiorecorder.cpp
+2
-1
daemon/src/audio/audiortp/audio_rtp_factory.cpp
daemon/src/audio/audiortp/audio_rtp_factory.cpp
+4
-1
daemon/src/audio/audiortp/audio_rtp_factory.h
daemon/src/audio/audiortp/audio_rtp_factory.h
+2
-0
daemon/src/audio/audiortp/audio_rtp_record_handler.cpp
daemon/src/audio/audiortp/audio_rtp_record_handler.cpp
+2
-0
daemon/src/audio/audiortp/audio_rtp_record_handler.h
daemon/src/audio/audiortp/audio_rtp_record_handler.h
+0
-4
daemon/src/audio/audiortp/audio_rtp_session.cpp
daemon/src/audio/audiortp/audio_rtp_session.cpp
+2
-0
daemon/src/audio/audiortp/audio_rtp_session.h
daemon/src/audio/audiortp/audio_rtp_session.h
+2
-0
daemon/src/audio/audiortp/audio_srtp_session.h
daemon/src/audio/audiortp/audio_srtp_session.h
+2
-0
daemon/src/audio/audiortp/audio_symmetric_rtp_session.cpp
daemon/src/audio/audiortp/audio_symmetric_rtp_session.cpp
+1
-0
daemon/src/audio/audiortp/audio_symmetric_rtp_session.h
daemon/src/audio/audiortp/audio_symmetric_rtp_session.h
+2
-0
daemon/src/audio/audiortp/zrtp_session_callback.cpp
daemon/src/audio/audiortp/zrtp_session_callback.cpp
+0
-1
daemon/src/audio/audiortp/zrtp_session_callback.h
daemon/src/audio/audiortp/zrtp_session_callback.h
+2
-0
daemon/src/audio/codecs/audiocodec.h
daemon/src/audio/codecs/audiocodec.h
+1
-1
daemon/src/audio/codecs/audiocodecfactory.cpp
daemon/src/audio/codecs/audiocodecfactory.cpp
+2
-1
daemon/src/audio/codecs/celtcodec.cpp
daemon/src/audio/codecs/celtcodec.cpp
+1
-5
daemon/src/audio/codecs/g722.cpp
daemon/src/audio/codecs/g722.cpp
+13
-22
daemon/src/audio/codecs/speexcodec.h
daemon/src/audio/codecs/speexcodec.h
+24
-21
daemon/src/audio/delaydetection.cpp
daemon/src/audio/delaydetection.cpp
+8
-4
daemon/src/audio/delaydetection.h
daemon/src/audio/delaydetection.h
+0
-7
daemon/src/audio/echosuppress.cpp
daemon/src/audio/echosuppress.cpp
+5
-5
daemon/src/audio/echosuppress.h
daemon/src/audio/echosuppress.h
+3
-1
daemon/src/audio/mainbuffer.cpp
daemon/src/audio/mainbuffer.cpp
+1
-1
daemon/src/audio/pulseaudio/audiostream.cpp
daemon/src/audio/pulseaudio/audiostream.cpp
+1
-1
daemon/src/audio/pulseaudio/pulselayer.cpp
daemon/src/audio/pulseaudio/pulselayer.cpp
+3
-0
daemon/src/audio/recordable.cpp
daemon/src/audio/recordable.cpp
+1
-1
daemon/src/audio/recordable.h
daemon/src/audio/recordable.h
+0
-2
daemon/src/audio/ringbuffer.cpp
daemon/src/audio/ringbuffer.cpp
+3
-0
daemon/src/audio/samplerateconverter.cpp
daemon/src/audio/samplerateconverter.cpp
+2
-1
daemon/src/audio/sound/audiofile.h
daemon/src/audio/sound/audiofile.h
+1
-0
daemon/src/audio/speexechocancel.cpp
daemon/src/audio/speexechocancel.cpp
+16
-21
daemon/src/audio/speexechocancel.h
daemon/src/audio/speexechocancel.h
+5
-4
daemon/src/call.cpp
daemon/src/call.cpp
+4
-6
daemon/src/conference.cpp
daemon/src/conference.cpp
+1
-0
daemon/src/conference.h
daemon/src/conference.h
+0
-2
daemon/src/config/config.h
daemon/src/config/config.h
+1
-1
daemon/src/config/yamlemitter.cpp
daemon/src/config/yamlemitter.cpp
+106
-175
daemon/src/config/yamlemitter.h
daemon/src/config/yamlemitter.h
+19
-25
daemon/src/config/yamlnode.h
daemon/src/config/yamlnode.h
+5
-3
daemon/src/config/yamlparser.cpp
daemon/src/config/yamlparser.cpp
+174
-236
daemon/src/config/yamlparser.h
daemon/src/config/yamlparser.h
+24
-29
daemon/src/dbus/configurationmanager.cpp
daemon/src/dbus/configurationmanager.cpp
+1
-7
daemon/src/dbus/configurationmanager.h
daemon/src/dbus/configurationmanager.h
+6
-6
daemon/src/dbus/dbus_cpp.h
daemon/src/dbus/dbus_cpp.h
+2
-0
daemon/src/dbus/dbusmanager.cpp
daemon/src/dbus/dbusmanager.cpp
+7
-1
daemon/src/dbus/instance.cpp
daemon/src/dbus/instance.cpp
+6
-7
daemon/src/history/historyitem.cpp
daemon/src/history/historyitem.cpp
+3
-1
daemon/src/history/historymanager.cpp
daemon/src/history/historymanager.cpp
+2
-1
daemon/src/iax/iaxaccount.cpp
daemon/src/iax/iaxaccount.cpp
+1
-1
daemon/src/iax/iaxcall.cpp
daemon/src/iax/iaxcall.cpp
+2
-1
daemon/src/iax/iaxcall.h
daemon/src/iax/iaxcall.h
+3
-0
daemon/src/iax/iaxvoiplink.cpp
daemon/src/iax/iaxvoiplink.cpp
+1
-0
daemon/src/iax/iaxvoiplink.h
daemon/src/iax/iaxvoiplink.h
+2
-0
daemon/src/managerimpl.cpp
daemon/src/managerimpl.cpp
+8
-4
daemon/src/managerimpl.h
daemon/src/managerimpl.h
+0
-2
daemon/src/preferences.cpp
daemon/src/preferences.cpp
+3
-0
daemon/src/preferences.h
daemon/src/preferences.h
+2
-1
daemon/src/sip/pattern.cpp
daemon/src/sip/pattern.cpp
+3
-4
daemon/src/sip/pattern.h
daemon/src/sip/pattern.h
+2
-0
daemon/src/sip/sdes_negotiator.cpp
daemon/src/sip/sdes_negotiator.cpp
+8
-1
daemon/src/sip/sdp.cpp
daemon/src/sip/sdp.cpp
+6
-5
daemon/src/sip/sdp.h
daemon/src/sip/sdp.h
+2
-2
daemon/src/sip/sipaccount.cpp
daemon/src/sip/sipaccount.cpp
+12
-10
daemon/src/sip/sipvoiplink.cpp
daemon/src/sip/sipvoiplink.cpp
+1
-1
daemon/src/voiplink.cpp
daemon/src/voiplink.cpp
+2
-0
daemon/src/voiplink.h
daemon/src/voiplink.h
+1
-4
daemon/test/Makefile.am
daemon/test/Makefile.am
+0
-3
daemon/test/audiolayertest.cpp
daemon/test/audiolayertest.cpp
+3
-0
daemon/test/audiolayertest.h
daemon/test/audiolayertest.h
+4
-4
daemon/test/echocanceltest.cpp
daemon/test/echocanceltest.cpp
+4
-6
daemon/test/echocanceltest.h
daemon/test/echocanceltest.h
+4
-7
daemon/test/historytest.h
daemon/test/historytest.h
+4
-2
daemon/test/instantmessagingtest.h
daemon/test/instantmessagingtest.h
+4
-2
daemon/test/sdesnegotiatortest.cpp
daemon/test/sdesnegotiatortest.cpp
+3
-1
daemon/test/sdesnegotiatortest.h
daemon/test/sdesnegotiatortest.h
+4
-3
daemon/test/sdptest.h
daemon/test/sdptest.h
+4
-4
No files found.
daemon/configure.ac
View file @
e976366c
...
...
@@ -178,7 +178,7 @@ DBUS_CPP_REQUIRED_VERSION=0.6.0-pre1
PKG_CHECK_MODULES(DBUSCPP, dbus-c++-1,,
AC_MSG_ERROR([You need the DBus-c++ libraries (version $DBUS_CPP_REQUIRED_VERSION or better)]))
CXXFLAGS="${CXXFLAGS} -g -Wno-return-type -Wall -Wextra -Wnon-virtual-dtor -Wfatal-errors"
CXXFLAGS="${CXXFLAGS} -g -Wno-return-type -Wall -Wextra -Wnon-virtual-dtor -W
effc++ -W
fatal-errors"
AC_CHECK_LIB([expat], XML_ParserCreate_MM,
[AC_CHECK_HEADERS(expat.h, have_expat=true, have_expat=false)],
...
...
daemon/src/account.cpp
View file @
e976366c
...
...
@@ -35,16 +35,20 @@
Account
::
Account
(
const
std
::
string
&
accountID
,
const
std
::
string
&
type
)
:
accountID_
(
accountID
)
,
username_
()
,
hostname_
()
,
alias_
()
,
link_
(
NULL
)
,
enabled_
(
true
)
,
type_
(
type
)
,
registrationState_
(
Unregistered
)
,
codecOrder_
()
,
codecStr_
(
""
)
,
codecStr_
()
,
ringtonePath_
(
"/usr/share/sflphone/ringtones/konga.ul"
)
,
ringtoneEnabled_
(
true
)
,
displayName_
(
""
)
,
userAgent_
(
"SFLphone"
)
,
mailBox_
()
{
// Initialize the codec order, used when creating a new account
loadDefaultCodecs
();
...
...
daemon/src/audio/audiolayer.cpp
View file @
e976366c
...
...
@@ -39,6 +39,7 @@ AudioLayer::AudioLayer()
,
urgentRingBuffer_
(
SIZEBUF
,
Call
::
DEFAULT_ID
)
,
audioSampleRate_
(
Manager
::
instance
().
getMainBuffer
()
->
getInternalSamplingRate
())
,
mutex_
()
,
dcblocker_
()
,
audioPref
(
Manager
::
instance
().
audioPreference
)
,
converter_
(
new
SamplerateConverter
(
audioSampleRate_
))
,
lastNotificationTime_
(
0
)
...
...
daemon/src/audio/audiolayer.h
View file @
e976366c
...
...
@@ -133,11 +133,8 @@ class AudioLayer {
* Lock for the entire audio layer
*/
ost
::
Mutex
mutex_
;
DcBlocker
dcblocker_
;
AudioPreference
&
audioPref
;
SamplerateConverter
*
converter_
;
private:
...
...
daemon/src/audio/audiorecord.cpp
View file @
e976366c
...
...
@@ -52,6 +52,7 @@ struct wavhdr {
AudioRecord
::
AudioRecord
()
:
fileHandle_
(
NULL
)
,
fileType_
(
FILE_INVALID
)
,
channels_
(
1
)
,
byteCounter_
(
0
)
,
sndSmplRate_
(
8000
)
...
...
@@ -62,6 +63,7 @@ AudioRecord::AudioRecord() : fileHandle_(NULL)
,
mixBuffer_
(
new
SFLDataFormat
[
nbSamplesMax_
])
,
micBuffer_
(
new
SFLDataFormat
[
nbSamplesMax_
])
,
spkBuffer_
(
new
SFLDataFormat
[
nbSamplesMax_
])
,
savePath_
()
{
createFilename
();
}
...
...
daemon/src/audio/audiorecord.h
View file @
e976366c
...
...
@@ -35,11 +35,12 @@
#include <cstdlib>
#include "global.h"
#include "noncopyable.h"
class
AudioRecord
{
public:
enum
FILE_TYPE
{
FILE_RAW
,
FILE_WAV
};
enum
FILE_TYPE
{
FILE_RAW
,
FILE_WAV
,
FILE_INVALID
};
AudioRecord
();
...
...
@@ -237,6 +238,8 @@ class AudioRecord {
*/
std
::
string
savePath_
;
private:
NON_COPYABLE
(
AudioRecord
);
};
#endif // _AUDIO_RECORD_H
daemon/src/audio/audiorecorder.cpp
View file @
e976366c
...
...
@@ -34,7 +34,8 @@
int
AudioRecorder
::
count_
=
0
;
AudioRecorder
::
AudioRecorder
(
AudioRecord
*
arec
,
MainBuffer
*
mb
)
:
Thread
(),
mbuffer_
(
mb
),
arecord_
(
arec
)
AudioRecorder
::
AudioRecorder
(
AudioRecord
*
arec
,
MainBuffer
*
mb
)
:
Thread
(),
recorderId_
(),
mbuffer_
(
mb
),
arecord_
(
arec
)
{
assert
(
mb
);
setCancel
(
cancelDeferred
);
...
...
daemon/src/audio/audiortp/audio_rtp_factory.cpp
View file @
e976366c
...
...
@@ -42,7 +42,10 @@
namespace
sfl
{
AudioRtpFactory
::
AudioRtpFactory
(
SIPCall
*
ca
)
:
rtpSession_
(
NULL
),
remoteContext_
(
NULL
),
localContext_
(
NULL
),
ca_
(
ca
)
AudioRtpFactory
::
AudioRtpFactory
(
SIPCall
*
ca
)
:
rtpSession_
(
NULL
),
audioRtpThreadMutex_
(),
srtpEnabled_
(
false
),
keyExchangeProtocol_
(
Symmetric
),
helloHashEnabled_
(
false
),
remoteContext_
(
NULL
),
localContext_
(
NULL
),
ca_
(
ca
)
{}
AudioRtpFactory
::~
AudioRtpFactory
()
...
...
daemon/src/audio/audiortp/audio_rtp_factory.h
View file @
e976366c
...
...
@@ -35,6 +35,7 @@
#include <cc++/thread.h>
#include <ccrtp/CryptoContext.h>
#include "audio_rtp_session.h"
#include "noncopyable.h"
#include "sip/sdes_negotiator.h"
...
...
@@ -138,6 +139,7 @@ class AudioRtpFactory {
void
sendDtmfDigit
(
int
digit
);
private:
NON_COPYABLE
(
AudioRtpFactory
);
AudioRtpSession
*
rtpSession_
;
ost
::
Mutex
audioRtpThreadMutex_
;
...
...
daemon/src/audio/audiortp/audio_rtp_record_handler.cpp
View file @
e976366c
...
...
@@ -47,8 +47,10 @@ AudioRtpRecord::AudioRtpRecord() :
,
codecSampleRate_
(
0
)
,
codecFrameSize_
(
0
)
,
converterSamplingRate_
(
0
)
,
dtmfQueue_
()
,
micAmplFactor_
(
initFadeinFactor
)
,
noiseSuppress_
(
0
)
,
audioProcessMutex_
()
,
callId_
(
""
)
,
dtmfPayloadType_
(
101
)
// same as Asterisk
{
...
...
daemon/src/audio/audiortp/audio_rtp_record_handler.h
View file @
e976366c
...
...
@@ -169,18 +169,14 @@ class AudioRtpRecordHandler {
void
putDtmfEvent
(
int
digit
);
protected:
AudioRtpRecord
audioRtpRecord_
;
private:
const
std
::
string
id_
;
EchoSuppress
echoCanceller
;
GainControl
gainController
;
};
}
#endif // AUDIO_RTP_RECORD_HANDLER_H__
daemon/src/audio/audiortp/audio_rtp_session.cpp
View file @
e976366c
...
...
@@ -47,6 +47,8 @@ AudioRtpSession::AudioRtpSession(SIPCall * sipcall, RtpMethod type, ost::RTPData
AudioRtpRecordHandler
(
sipcall
)
,
ca_
(
sipcall
)
,
type_
(
type
)
,
remote_ip_
()
,
remote_port_
(
0
)
,
timestamp_
(
0
)
,
timestampIncrement_
(
0
)
,
timestampCount_
(
0
)
...
...
daemon/src/audio/audiortp/audio_rtp_session.h
View file @
e976366c
...
...
@@ -38,6 +38,7 @@
#include <audio/codecs/audiocodec.h>
#include <ccrtp/rtp.h>
#include <ccrtp/formats.h>
#include "noncopyable.h"
class
SIPCall
;
...
...
@@ -96,6 +97,7 @@ class AudioRtpSession : public AudioRtpRecordHandler {
RtpMethod
type_
;
private:
NON_COPYABLE
(
AudioRtpSession
);
/**
* Set the audio codec for this RTP session
...
...
daemon/src/audio/audiortp/audio_srtp_session.h
View file @
e976366c
...
...
@@ -33,6 +33,7 @@
#include "audio_rtp_session.h"
#include "audio_symmetric_rtp_session.h"
#include "sip/sdes_negotiator.h"
#include "noncopyable.h"
#include <ccrtp/CryptoContext.h>
#include <vector>
...
...
@@ -109,6 +110,7 @@ class AudioSrtpSession : public AudioSymmetricRtpSession {
ost
::
CryptoContext
*
localCryptoCtx_
;
private:
NON_COPYABLE
(
AudioSrtpSession
);
/**
* Init local master key according to current crypto context
...
...
daemon/src/audio/audiortp/audio_symmetric_rtp_session.cpp
View file @
e976366c
...
...
@@ -44,6 +44,7 @@ namespace sfl {
AudioSymmetricRtpSession
::
AudioSymmetricRtpSession
(
SIPCall
*
sipcall
)
:
ost
::
SymmetricRTPSession
(
ost
::
InetHostAddress
(
sipcall
->
getLocalIp
().
c_str
()),
sipcall
->
getLocalAudioPort
())
,
AudioRtpSession
(
sipcall
,
Symmetric
,
this
,
this
)
,
echoCanceller
()
,
rtpThread_
(
new
AudioRtpThread
(
this
))
{
INFO
(
"AudioSymmetricRtpSession: Setting new RTP session with destination %s:%d"
,
ca_
->
getLocalIp
().
c_str
(),
ca_
->
getLocalAudioPort
());
...
...
daemon/src/audio/audiortp/audio_symmetric_rtp_session.h
View file @
e976366c
...
...
@@ -42,6 +42,7 @@
#include "noncopyable.h"
using
std
::
ptrdiff_t
;
#include <ccrtp/rtp.h>
#include <ccrtp/iqueue.h>
#include <cc++/numbers.h> // ost::Time
...
...
@@ -70,6 +71,7 @@ class AudioSymmetricRtpSession : public ost::TimerPort, public ost::SymmetricRTP
}
private:
NON_COPYABLE
(
AudioSymmetricRtpSession
);
class
AudioRtpThread
:
public
ost
::
Thread
,
public
ost
::
TimerPort
{
public:
...
...
daemon/src/audio/audiortp/zrtp_session_callback.cpp
View file @
e976366c
...
...
@@ -28,7 +28,6 @@
* as that of the covered work.
*/
#include "zrtp_session_callback.h"
#include "global.h"
#include "sip/sipcall.h"
#include "dbus/dbusmanager.h"
...
...
daemon/src/audio/audiortp/zrtp_session_callback.h
View file @
e976366c
...
...
@@ -39,6 +39,7 @@ using std::ptrdiff_t;
#include <libzrtpcpp/ZrtpUserCallback.h>
#include <exception>
#include <map>
#include "noncopyable.h"
class
SIPCall
;
...
...
@@ -57,6 +58,7 @@ class ZrtpSessionCallback: public ZrtpUserCallback {
void
confirmGoClear
();
private:
NON_COPYABLE
(
ZrtpSessionCallback
);
SIPCall
*
sipcall_
;
static
std
::
map
<
int32
,
std
::
string
>
infoMap_
;
static
std
::
map
<
int32
,
std
::
string
>
warningMap_
;
...
...
daemon/src/audio/codecs/audiocodec.h
View file @
e976366c
...
...
@@ -33,7 +33,6 @@
#define __AUDIO_CODEC_H__
#include <string>
#include <iostream>
#include <dlfcn.h>
#include "codec.h"
...
...
@@ -161,6 +160,7 @@ class AudioCodec : public Codec {
bool
hasDynamicPayload_
;
private:
AudioCodec
&
operator
=
(
const
AudioCodec
&
);
uint8
payload_
;
ost
::
DynamicPayloadFormat
*
payloadFormat_
;
...
...
daemon/src/audio/codecs/audiocodecfactory.cpp
View file @
e976366c
...
...
@@ -37,7 +37,8 @@
#include <algorithm> // for std::find
#include "fileutils.h"
AudioCodecFactory
::
AudioCodecFactory
()
:
codecsMap_
()
AudioCodecFactory
::
AudioCodecFactory
()
:
codecsMap_
(),
defaultCodecOrder_
(),
libCache_
(),
codecInMemory_
()
{
typedef
std
::
vector
<
sfl
::
Codec
*>
CodecVector
;
CodecVector
codecDynamicList
(
scanCodecDirectory
());
...
...
daemon/src/audio/codecs/celtcodec.cpp
View file @
e976366c
...
...
@@ -37,7 +37,7 @@
class
Celt
:
public
sfl
::
AudioCodec
{
public:
Celt
(
int
payload
=
115
)
:
sfl
::
AudioCodec
(
payload
,
"celt"
)
{
Celt
(
int
payload
=
115
)
:
sfl
::
AudioCodec
(
payload
,
"celt"
)
,
mode_
(
0
),
enc_
(
0
),
dec_
(
0
)
{
clockRate_
=
32000
;
frameSize_
=
320
;
// fixed frameSize, TODO: support variable size from 64 to 512
channel_
=
1
;
...
...
@@ -119,14 +119,10 @@ class Celt : public sfl::AudioCodec {
}
private:
CELTMode
*
mode_
;
CELTEncoder
*
enc_
;
CELTDecoder
*
dec_
;
celt_int32
celt_frame_size_
;
celt_int32
skip_
;
};
// the class factories
...
...
daemon/src/audio/codecs/g722.cpp
View file @
e976366c
...
...
@@ -36,34 +36,26 @@
#include "../common.h"
#include "audiocodec.h"
#include "g722.h"
#include "noncopyable.h"
#include <stdlib.h>
#include <string.h>
#include <cassert>
#define TRUE 1
#define FALSE 0
class
G722
:
public
sfl
::
AudioCodec
{
public:
G722
(
int
payload
=
9
)
:
sfl
::
AudioCodec
(
payload
,
"G722"
)
{
G722
(
int
payload
=
9
)
:
sfl
::
AudioCodec
(
payload
,
"G722"
),
decode_s
(
new
g722_decode_state_t
),
encode_s
(
new
g722_encode_state_t
)
{
clockRate_
=
16000
;
frameSize_
=
320
;
// samples, 20 ms at 16kHz
channel_
=
1
;
bitrate_
=
64
;
hasDynamicPayload_
=
false
;
decode_s
=
new
g722_decode_state_t
;
encode_s
=
new
g722_encode_state_t
;
g722_decode_init
();
g722_encode_init
();
}
~
G722
()
{
...
...
@@ -84,17 +76,16 @@ class G722 : public sfl::AudioCodec {
void
g722_encode_init
()
{
encode_s
->
itu_test_mode
=
FALSE
;
encode_s
->
itu_test_mode
=
false
;
// 8 => 64 kbps; 7 => 56 kbps; 6 => 48 kbps
encode_s
->
bits_per_sample
=
8
;
// Enable 8khz mode, encode using lower subband only
encode_s
->
eight_k
=
FALSE
;
encode_s
->
eight_k
=
false
;
// Never set packed TRUE when using 64 kbps
encode_s
->
packed
=
FALSE
;
// Never set packed true when using 64 kbps
encode_s
->
packed
=
false
;
memset
(
encode_s
->
band
,
0
,
sizeof
(
decode_s
->
band
));
encode_s
->
band
[
0
].
det
=
32
;
...
...
@@ -110,16 +101,16 @@ class G722 : public sfl::AudioCodec {
void
g722_decode_init
()
{
decode_s
->
itu_test_mode
=
FALSE
;
decode_s
->
itu_test_mode
=
false
;
// 8 => 64 kbps; 7 => 56 kbps; 6 => 48 kbps
decode_s
->
bits_per_sample
=
8
;
// Enable 8khz mode, encode using lower subband only
decode_s
->
eight_k
=
FALSE
;
decode_s
->
eight_k
=
false
;
// Never set packed
TRUE
when using 64 kbps
decode_s
->
packed
=
FALSE
;
// Never set packed
true
when using 64 kbps
decode_s
->
packed
=
false
;
memset
(
decode_s
->
band
,
0
,
sizeof
(
decode_s
->
band
));
decode_s
->
band
[
0
].
det
=
32
;
...
...
@@ -811,6 +802,7 @@ class G722 : public sfl::AudioCodec {
}
private:
NON_COPYABLE
(
G722
);
g722_decode_state_t
*
decode_s
;
g722_encode_state_t
*
encode_s
;
...
...
@@ -828,4 +820,3 @@ extern "C" void destroy(sfl::Codec* a)
delete
a
;
}
daemon/src/audio/codecs/speexcodec.h
View file @
e976366c
...
...
@@ -65,29 +65,32 @@ const SpeexMode* speexMode[3] = {
class
Speex
:
public
sfl
::
AudioCodec
{
public:
Speex
(
int
payload
)
:
sfl
::
AudioCodec
(
payload
,
"speex"
)
{
assert
(
payload
>=
110
&&
payload
<=
112
);
assert
(
110
==
PAYLOAD_CODEC_SPEEX_8000
&&
111
==
PAYLOAD_CODEC_SPEEX_16000
&&
112
==
PAYLOAD_CODEC_SPEEX_32000
);
int
type
=
payload
-
110
;
Speex
(
int
payload
)
:
sfl
::
AudioCodec
(
payload
,
"speex"
),
speex_dec_bits_
(),
speex_enc_bits_
(),
speex_dec_state_
(
0
),
speex_enc_state_
(
0
),
speex_frame_size_
(
0
)
{
assert
(
payload
>=
110
&&
payload
<=
112
);
assert
(
110
==
PAYLOAD_CODEC_SPEEX_8000
&&
111
==
PAYLOAD_CODEC_SPEEX_16000
&&
112
==
PAYLOAD_CODEC_SPEEX_32000
);
int
type
=
payload
-
110
;
clockRate_
=
clockRate
[
type
];
frameSize_
=
frameSize
[
type
];
channel_
=
1
;
bitrate_
=
bitRate
[
type
];
hasDynamicPayload_
=
dynamicPayload
[
type
];
clockRate_
=
clockRate
[
type
];
frameSize_
=
frameSize
[
type
];
channel_
=
1
;
bitrate_
=
bitRate
[
type
];
hasDynamicPayload_
=
dynamicPayload
[
type
];
// Init the decoder struct
speex_bits_init
(
&
speex_dec_bits_
);
speex_dec_state_
=
speex_decoder_init
(
speexMode
[
type
]);
// Init the decoder struct
speex_bits_init
(
&
speex_dec_bits_
);
speex_dec_state_
=
speex_decoder_init
(
speexMode
[
type
]);
// Init the encoder struct
speex_bits_init
(
&
speex_enc_bits_
);
speex_enc_state_
=
speex_encoder_init
(
speexMode
[
type
]);
// Init the encoder struct
speex_bits_init
(
&
speex_enc_bits_
);
speex_enc_state_
=
speex_encoder_init
(
speexMode
[
type
]);
speex_encoder_ctl
(
speex_enc_state_
,
SPEEX_SET_SAMPLING_RATE
,
&
clockRate_
);
speex_decoder_ctl
(
speex_dec_state_
,
SPEEX_GET_FRAME_SIZE
,
&
speex_frame_size_
);
speex_encoder_ctl
(
speex_enc_state_
,
SPEEX_SET_SAMPLING_RATE
,
&
clockRate_
);
speex_decoder_ctl
(
speex_dec_state_
,
SPEEX_GET_FRAME_SIZE
,
&
speex_frame_size_
);
}
NON_COPYABLE
(
Speex
);
...
...
@@ -117,8 +120,8 @@ class Speex : public sfl::AudioCodec {
}
private:
SpeexBits
speex_dec_bits_
;
SpeexBits
speex_enc_bits_
;
SpeexBits
speex_dec_bits_
;
SpeexBits
speex_enc_bits_
;
void
*
speex_dec_state_
;
void
*
speex_enc_state_
;
int
speex_frame_size_
;
...
...
daemon/src/audio/delaydetection.cpp
View file @
e976366c
...
...
@@ -97,11 +97,15 @@ void FirFilter::reset()
}
DelayDetection
::
DelayDetection
()
:
internalState_
(
WaitForSpeaker
),
decimationFilter_
(
ird
),
bandpassFilter_
(
irb
),
segmentSize_
(
DELAY_BUFF_SIZE
),
downsamplingFactor_
(
8
)
DelayDetection
::
DelayDetection
()
:
internalState_
(
WaitForSpeaker
),
decimationFilter_
(
ird
),
bandpassFilter_
(
irb
),
segmentSize_
(
DELAY_BUFF_SIZE
),
downsamplingFactor_
(
8
),
spkrDownSize_
(
DELAY_BUFF_SIZE
/
downsamplingFactor_
),
micDownSize_
(
WINDOW_SIZE
/
downsamplingFactor_
),
nbMicSampleStored_
(
0
),
nbSpkrSampleStored_
(
0
)
{
micDownSize_
=
WINDOW_SIZE
/
downsamplingFactor_
;
spkrDownSize_
=
DELAY_BUFF_SIZE
/
downsamplingFactor_
;
memset
(
spkrReference_
,
0
,
sizeof
(
float
)
*
WINDOW_SIZE
*
2
);
memset
(
capturedData_
,
0
,
sizeof
(
float
)
*
DELAY_BUFF_SIZE
*
2
);
memset
(
spkrReferenceDown_
,
0
,
sizeof
(
float
)
*
WINDOW_SIZE
*
2
);
...
...
daemon/src/audio/delaydetection.h
View file @
e976366c
...
...
@@ -128,11 +128,6 @@ class DelayDetection {
int
downsamplingFactor_
;
/**
* Resulting correlation size (s + w -1)
*/
short
correlationSize_
;
float
spkrReference_
[
WINDOW_SIZE
*
2
];
float
capturedData_
[
DELAY_BUFF_SIZE
*
2
];
...
...
@@ -147,8 +142,6 @@ class DelayDetection {
float
correlationResult_
[
DELAY_BUFF_SIZE
*
2
];
int
remainingIndex_
;
int
spkrDownSize_
;
int
micDownSize_
;
...
...
daemon/src/audio/echosuppress.cpp
View file @
e976366c
...
...
@@ -14,15 +14,15 @@
#define SAMPLES_PER_FRAME 160
EchoSuppress
::
EchoSuppress
(
pj_pool_t
*
pool
)
EchoSuppress
::
EchoSuppress
(
pj_pool_t
*
pool
)
:
echoState_
(
0
)
{
if
(
pjmedia_echo_create
(
pool
,
8000
,
SAMPLES_PER_FRAME
,
250
,
0
,
PJMEDIA_ECHO_SIMPLE
|
PJMEDIA_ECHO_NO_LOCK
,
&
echoState
)
!=
PJ_SUCCESS
)
if
(
pjmedia_echo_create
(
pool
,
8000
,
SAMPLES_PER_FRAME
,
250
,
0
,
PJMEDIA_ECHO_SIMPLE
|
PJMEDIA_ECHO_NO_LOCK
,
&
echoState
_
)
!=
PJ_SUCCESS
)
throw
std
::
runtime_error
(
"EchoCancel: Could not create echo canceller"
);
}
EchoSuppress
::~
EchoSuppress
()
{
pjmedia_echo_destroy
(
echoState
);
pjmedia_echo_destroy
(
echoState
_
);
}
void
EchoSuppress
::
putData
(
SFLDataFormat
*
inputData
,
int
samples
)
...
...
@@ -30,7 +30,7 @@ void EchoSuppress::putData(SFLDataFormat *inputData, int samples)
assert
(
samples
==
SAMPLES_PER_FRAME
);
assert
(
sizeof
(
SFLDataFormat
)
==
sizeof
(
pj_int16_t
));
if
(
pjmedia_echo_playback
(
echoState
,
reinterpret_cast
<
pj_int16_t
*>
(
inputData
))
!=
PJ_SUCCESS
)
if
(
pjmedia_echo_playback
(
echoState
_
,
reinterpret_cast
<
pj_int16_t
*>
(
inputData
))
!=
PJ_SUCCESS
)
WARN
(
"EchoCancel: Problem while putting input data"
);
}
...
...
@@ -38,6 +38,6 @@ void EchoSuppress::getData(SFLDataFormat *outputData)
{
assert
(
sizeof
(
SFLDataFormat
)
==
sizeof
(
pj_int16_t
));
if
(
pjmedia_echo_capture
(
echoState
,
reinterpret_cast
<
pj_int16_t
*>
(
outputData
),
0
)
!=
PJ_SUCCESS
)
if
(
pjmedia_echo_capture
(
echoState
_
,
reinterpret_cast
<
pj_int16_t
*>
(
outputData
),
0
)
!=
PJ_SUCCESS
)
WARN
(
"EchoCancel: Problem while getting output data"
);
}
daemon/src/audio/echosuppress.h
View file @
e976366c
...
...
@@ -10,6 +10,7 @@
#include "pjmedia/echo.h"
#include "global.h"
#include "noncopyable.h"
class
EchoSuppress
{
public:
...
...
@@ -26,11 +27,12 @@ class EchoSuppress {
void
getData
(
SFLDataFormat
*
);
private:
NON_COPYABLE
(
EchoSuppress
);
/**
* The internal state of the echo canceller
*/
pjmedia_echo_state
*
echoState
;
pjmedia_echo_state
*
echoState
_
;
};
#endif
/* ECHOSUPPRESS_H_ */
daemon/src/audio/mainbuffer.cpp
View file @
e976366c
...
...
@@ -33,7 +33,7 @@
#include <utility> // for std::pair
#include "manager.h"
MainBuffer
::
MainBuffer
()
:
internalSamplingRate_
(
8000
)
MainBuffer
::
MainBuffer
()
:
ringBufferMap_
(),
callIDMap_
(),
mutex_
(),
internalSamplingRate_
(
8000
)
{}
MainBuffer
::~
MainBuffer
()
...
...
daemon/src/audio/pulseaudio/audiostream.cpp
View file @
e976366c
...
...
@@ -32,7 +32,7 @@
#include "pulselayer.h"
AudioStream
::
AudioStream
(
pa_context
*
c
,
pa_threaded_mainloop
*
m
,
const
char
*
desc
,
int
type
,
int
smplrate
,
std
::
string
*
deviceName
)
:
mainloop_
(
m
)
:
audiostream_
(
0
),
mainloop_
(
m
)
{
static
const
pa_channel_map
channel_map
=
{
1
,
...
...
daemon/src/audio/pulseaudio/pulselayer.cpp
View file @
e976366c
...
...
@@ -70,8 +70,11 @@ PulseLayer::PulseLayer()
:
playback_
(
0
)
,
record_
(
0
)
,
ringtone_
(
0
)
,
sinkList_
()
,
sourceList_
()
,
mic_buffer_
(
0
)
,
mic_buf_size_
(
0
)
,
context_
(
0
)
,
mainloop_
(
pa_threaded_mainloop_new
())
{
setenv
(
"PULSE_PROP_media.role"
,
"phone"
,
1
);
...
...
daemon/src/audio/recordable.cpp
View file @
e976366c
...
...
@@ -30,7 +30,7 @@
#include "recordable.h"
#include "manager.h"
Recordable
::
Recordable
()
:
recorder
(
&
recAudio
,
Manager
::
instance
().
getMainBuffer
())
Recordable
::
Recordable
()
:
rec
Audio
(),
rec
order
(
&
recAudio
,
Manager
::
instance
().
getMainBuffer
())
{
recAudio
.
setRecordingOption
(
AudioRecord
::
FILE_WAV
,
8000
,
Manager
::
instance
().
audioPreference
.
getRecordpath
());
}
...
...
daemon/src/audio/recordable.h