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
139
Issues
139
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
c135b1c2
Commit
c135b1c2
authored
Aug 04, 2010
by
Julien Bonjean
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[#2402] Code indent
parent
92ebaec0
Changes
78
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
78 changed files
with
8536 additions
and
7640 deletions
+8536
-7640
sflphone-common/src/account.h
sflphone-common/src/account.h
+170
-117
sflphone-common/src/accountcreator.h
sflphone-common/src/accountcreator.h
+21
-20
sflphone-common/src/audio/algorithm.h
sflphone-common/src/audio/algorithm.h
+31
-30
sflphone-common/src/audio/alsa/alsalayer.h
sflphone-common/src/audio/alsa/alsalayer.h
+304
-263
sflphone-common/src/audio/audiodevice.h
sflphone-common/src/audio/audiodevice.h
+62
-53
sflphone-common/src/audio/audiolayer.h
sflphone-common/src/audio/audiolayer.h
+158
-131
sflphone-common/src/audio/audioloop.h
sflphone-common/src/audio/audioloop.h
+61
-56
sflphone-common/src/audio/audioprocessing.h
sflphone-common/src/audio/audioprocessing.h
+41
-38
sflphone-common/src/audio/audiorecord.h
sflphone-common/src/audio/audiorecord.h
+190
-190
sflphone-common/src/audio/audiorecorder.h
sflphone-common/src/audio/audiorecorder.h
+21
-16
sflphone-common/src/audio/audiortp/AudioRtpFactory.h
sflphone-common/src/audio/audiortp/AudioRtpFactory.h
+149
-132
sflphone-common/src/audio/audiortp/AudioRtpSession.h
sflphone-common/src/audio/audiortp/AudioRtpSession.h
+671
-665
sflphone-common/src/audio/audiortp/AudioSrtpSession.h
sflphone-common/src/audio/audiortp/AudioSrtpSession.h
+45
-45
sflphone-common/src/audio/audiortp/AudioSymmetricRtpSession.h
...hone-common/src/audio/audiortp/AudioSymmetricRtpSession.h
+12
-12
sflphone-common/src/audio/audiortp/AudioZrtpSession.h
sflphone-common/src/audio/audiortp/AudioZrtpSession.h
+19
-19
sflphone-common/src/audio/audiortp/ZrtpSessionCallback.h
sflphone-common/src/audio/audiortp/ZrtpSessionCallback.h
+21
-20
sflphone-common/src/audio/codecs/audiocodec.h
sflphone-common/src/audio/codecs/audiocodec.h
+104
-85
sflphone-common/src/audio/codecs/codecDescriptor.h
sflphone-common/src/audio/codecs/codecDescriptor.h
+192
-187
sflphone-common/src/audio/codecs/g722.h
sflphone-common/src/audio/codecs/g722.h
+14
-19
sflphone-common/src/audio/common.h
sflphone-common/src/audio/common.h
+3
-3
sflphone-common/src/audio/dcblocker.h
sflphone-common/src/audio/dcblocker.h
+33
-32
sflphone-common/src/audio/delaydetection.h
sflphone-common/src/audio/delaydetection.h
+91
-89
sflphone-common/src/audio/echocancel.h
sflphone-common/src/audio/echocancel.h
+324
-315
sflphone-common/src/audio/jitterbuf.h
sflphone-common/src/audio/jitterbuf.h
+138
-138
sflphone-common/src/audio/mainbuffer.h
sflphone-common/src/audio/mainbuffer.h
+60
-57
sflphone-common/src/audio/pulseaudio/audiostream.h
sflphone-common/src/audio/pulseaudio/audiostream.h
+154
-143
sflphone-common/src/audio/pulseaudio/pulselayer.h
sflphone-common/src/audio/pulseaudio/pulselayer.h
+257
-232
sflphone-common/src/audio/recordable.h
sflphone-common/src/audio/recordable.h
+38
-33
sflphone-common/src/audio/ringbuffer.h
sflphone-common/src/audio/ringbuffer.h
+143
-138
sflphone-common/src/audio/samplerateconverter.h
sflphone-common/src/audio/samplerateconverter.h
+76
-71
sflphone-common/src/audio/sound/audiofile.h
sflphone-common/src/audio/sound/audiofile.h
+61
-55
sflphone-common/src/audio/sound/dtmf.h
sflphone-common/src/audio/sound/dtmf.h
+29
-28
sflphone-common/src/audio/sound/dtmfgenerator.h
sflphone-common/src/audio/sound/dtmfgenerator.h
+103
-103
sflphone-common/src/audio/sound/tone.h
sflphone-common/src/audio/sound/tone.h
+62
-61
sflphone-common/src/audio/sound/tonelist.h
sflphone-common/src/audio/sound/tonelist.h
+93
-89
sflphone-common/src/audio/speexechocancel.h
sflphone-common/src/audio/speexechocancel.h
+40
-39
sflphone-common/src/call.h
sflphone-common/src/call.h
+106
-70
sflphone-common/src/conference.h
sflphone-common/src/conference.h
+22
-15
sflphone-common/src/config/engine.h
sflphone-common/src/config/engine.h
+7
-6
sflphone-common/src/config/serializable.h
sflphone-common/src/config/serializable.h
+6
-5
sflphone-common/src/config/yamlemitter.h
sflphone-common/src/config/yamlemitter.h
+67
-65
sflphone-common/src/config/yamlengine.h
sflphone-common/src/config/yamlengine.h
+21
-18
sflphone-common/src/config/yamlnode.h
sflphone-common/src/config/yamlnode.h
+82
-60
sflphone-common/src/config/yamlparser.h
sflphone-common/src/config/yamlparser.h
+85
-69
sflphone-common/src/dbus/callmanager.h
sflphone-common/src/dbus/callmanager.h
+55
-55
sflphone-common/src/dbus/configurationmanager.h
sflphone-common/src/dbus/configurationmanager.h
+100
-100
sflphone-common/src/dbus/contactmanager.h
sflphone-common/src/dbus/contactmanager.h
+16
-16
sflphone-common/src/dbus/dbusmanager.h
sflphone-common/src/dbus/dbusmanager.h
+3
-3
sflphone-common/src/dbus/dbusmanagerimpl.h
sflphone-common/src/dbus/dbusmanagerimpl.h
+13
-8
sflphone-common/src/dbus/instance.h
sflphone-common/src/dbus/instance.h
+19
-19
sflphone-common/src/dbus/networkmanager.h
sflphone-common/src/dbus/networkmanager.h
+16
-17
sflphone-common/src/dbus/networkmanager_proxy.h
sflphone-common/src/dbus/networkmanager_proxy.h
+60
-61
sflphone-common/src/eventthread.h
sflphone-common/src/eventthread.h
+17
-15
sflphone-common/src/global.h
sflphone-common/src/global.h
+31
-31
sflphone-common/src/history/historyitem.h
sflphone-common/src/history/historyitem.h
+6
-5
sflphone-common/src/history/historymanager.h
sflphone-common/src/history/historymanager.h
+10
-10
sflphone-common/src/hooks/urlhook.h
sflphone-common/src/hooks/urlhook.h
+2
-1
sflphone-common/src/iax/iaxaccount.h
sflphone-common/src/iax/iaxaccount.h
+11
-11
sflphone-common/src/iax/iaxcall.h
sflphone-common/src/iax/iaxcall.h
+110
-100
sflphone-common/src/iax/iaxvoiplink.h
sflphone-common/src/iax/iaxvoiplink.h
+268
-262
sflphone-common/src/logger.h
sflphone-common/src/logger.h
+3
-3
sflphone-common/src/manager.h
sflphone-common/src/manager.h
+5
-5
sflphone-common/src/managerimpl.h
sflphone-common/src/managerimpl.h
+1284
-1264
sflphone-common/src/numbercleaner.h
sflphone-common/src/numbercleaner.h
+10
-5
sflphone-common/src/observer.h
sflphone-common/src/observer.h
+16
-13
sflphone-common/src/plug-in/librarymanager.h
sflphone-common/src/plug-in/librarymanager.h
+9
-5
sflphone-common/src/plug-in/plugin.h
sflphone-common/src/plug-in/plugin.h
+10
-7
sflphone-common/src/plug-in/pluginmanager.h
sflphone-common/src/plug-in/pluginmanager.h
+9
-8
sflphone-common/src/preferences.h
sflphone-common/src/preferences.h
+493
-299
sflphone-common/src/sip/Pattern.h
sflphone-common/src/sip/Pattern.h
+312
-308
sflphone-common/src/sip/SdesNegotiator.h
sflphone-common/src/sip/SdesNegotiator.h
+205
-176
sflphone-common/src/sip/sdp.h
sflphone-common/src/sip/sdp.h
+122
-95
sflphone-common/src/sip/sdpmedia.h
sflphone-common/src/sip/sdpmedia.h
+29
-15
sflphone-common/src/sip/sipaccount.h
sflphone-common/src/sip/sipaccount.h
+536
-360
sflphone-common/src/sip/sipcall.h
sflphone-common/src/sip/sipcall.h
+119
-92
sflphone-common/src/sip/sipvoiplink.h
sflphone-common/src/sip/sipvoiplink.h
+198
-196
sflphone-common/src/user_cfg.h
sflphone-common/src/user_cfg.h
+3
-3
sflphone-common/src/voiplink.h
sflphone-common/src/voiplink.h
+49
-40
No files found.
sflphone-common/src/account.h
View file @
c135b1c2
...
...
@@ -2,17 +2,17 @@
* Copyright (C) 2004, 2005, 2006, 2009, 2008, 2009, 2010 Savoir-Faire Linux Inc.
* Author: Emmanuel Milou <emmanuel.milou@savoirfairelinux.com>
* Author: Yan Morin <yan.morin@savoirfairelinux.com>
*
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
...
...
@@ -52,25 +52,25 @@ typedef std::string AccountID;
/** Contains all the state an Voip can be in */
typedef
enum
RegistrationState
{
Unregistered
,
Trying
,
Registered
,
Error
,
ErrorAuth
,
ErrorNetwork
,
ErrorHost
,
ErrorExistStun
,
ErrorConfStun
,
NumberOfState
Unregistered
,
Trying
,
Registered
,
Error
,
ErrorAuth
,
ErrorNetwork
,
ErrorHost
,
ErrorExistStun
,
ErrorConfStun
,
NumberOfState
}
RegistrationState
;
#define AccountNULL ""
// Account identifier
// Account identifier
#define ACCOUNT_ID "Account.id"
// Common account parameters
#define CONFIG_ACCOUNT_TYPE "Account.type"
#define CONFIG_ACCOUNT_TYPE "Account.type"
#define CONFIG_ACCOUNT_ALIAS "Account.alias"
#define CONFIG_ACCOUNT_MAILBOX "Account.mailbox"
#define CONFIG_ACCOUNT_ENABLE "Account.enable"
...
...
@@ -125,51 +125,52 @@ typedef enum RegistrationState {
#define TLS_SERVER_NAME "TLS.serverName"
#define TLS_VERIFY_SERVER "TLS.verifyServer"
#define TLS_VERIFY_CLIENT "TLS.verifyClient"
#define TLS_REQUIRE_CLIENT_CERTIFICATE "TLS.requireClientCertificate"
#define TLS_REQUIRE_CLIENT_CERTIFICATE "TLS.requireClientCertificate"
#define TLS_NEGOTIATION_TIMEOUT_SEC "TLS.negotiationTimeoutSec"
#define TLS_NEGOTIATION_TIMEOUT_MSEC "TLS.negotiationTimemoutMsec"
#define REGISTRATION_STATUS "Status"
#define REGISTRATION_STATE_CODE "Registration.code"
#define REGISTRATION_STATE_CODE "Registration.code"
#define REGISTRATION_STATE_DESCRIPTION "Registration.description"
// General configuration keys for accounts
const
Conf
::
Key
aliasKey
(
"alias"
);
const
Conf
::
Key
typeKey
(
"type"
);
const
Conf
::
Key
idKey
(
"id"
);
const
Conf
::
Key
usernameKey
(
"username"
);
const
Conf
::
Key
passwordKey
(
"password"
);
const
Conf
::
Key
hostnameKey
(
"hostname"
);
const
Conf
::
Key
accountEnableKey
(
"enable"
);
const
Conf
::
Key
mailboxKey
(
"mailbox"
);
const
Conf
::
Key
codecsKey
(
"codecs"
);
// 0/9/110/111/112/
const
Conf
::
Key
ringtonePathKey
(
"ringtonePath"
);
const
Conf
::
Key
ringtoneEnabledKey
(
"ringtoneEnabled"
);
const
Conf
::
Key
displayNameKey
(
"displayName"
);
const
Conf
::
Key
aliasKey
(
"alias"
);
const
Conf
::
Key
typeKey
(
"type"
);
const
Conf
::
Key
idKey
(
"id"
);
const
Conf
::
Key
usernameKey
(
"username"
);
const
Conf
::
Key
passwordKey
(
"password"
);
const
Conf
::
Key
hostnameKey
(
"hostname"
);
const
Conf
::
Key
accountEnableKey
(
"enable"
);
const
Conf
::
Key
mailboxKey
(
"mailbox"
);
const
Conf
::
Key
codecsKey
(
"codecs"
);
// 0/9/110/111/112/
const
Conf
::
Key
ringtonePathKey
(
"ringtonePath"
);
const
Conf
::
Key
ringtoneEnabledKey
(
"ringtoneEnabled"
);
const
Conf
::
Key
displayNameKey
(
"displayName"
);
#define find_in_map(X, Y) if((iter = map_cpy.find(X)) != map_cpy.end()) { Y = iter->second; }
class
Account
:
public
Serializable
{
class
Account
:
public
Serializable
{
public:
Account
(
const
AccountID
&
accountID
,
std
::
string
type
);
Account
(
const
AccountID
&
accountID
,
std
::
string
type
);
/**
* Virtual destructor
*/
virtual
~
Account
();
virtual
void
serialize
(
Conf
::
YamlEmitter
*
emitter
)
=
0
;
virtual
void
serialize
(
Conf
::
YamlEmitter
*
emitter
)
=
0
;
virtual
void
unserialize
(
Conf
::
MappingNode
*
map
)
=
0
;
virtual
void
unserialize
(
Conf
::
MappingNode
*
map
)
=
0
;
virtual
void
setAccountDetails
(
const
std
::
map
<
std
::
string
,
std
::
string
>&
details
)
=
0
;
virtual
void
setAccountDetails
(
const
std
::
map
<
std
::
string
,
std
::
string
>&
details
)
=
0
;
virtual
std
::
map
<
std
::
string
,
std
::
string
>
getAccountDetails
()
=
0
;
virtual
std
::
map
<
std
::
string
,
std
::
string
>
getAccountDetails
()
=
0
;
/**
* Load the settings for this account.
...
...
@@ -180,13 +181,17 @@ class Account : public Serializable{
* Get the account ID
* @return constant account id
*/
inline
const
AccountID
&
getAccountID
()
{
return
_accountID
;
}
inline
const
AccountID
&
getAccountID
()
{
return
_accountID
;
}
/**
* Get the voiplink pointer
* @return VoIPLink* the pointer or 0
*/
inline
VoIPLink
*
getVoIPLink
()
{
return
_link
;
}
inline
VoIPLink
*
getVoIPLink
()
{
return
_link
;
}
virtual
void
setVoIPLink
()
=
0
;
...
...
@@ -203,89 +208,137 @@ class Account : public Serializable{
virtual
int
unregisterVoIPLink
()
=
0
;
/**
* Tell if the account is enable or not.
* Tell if the account is enable or not.
* @return true if enabled
* false otherwise
*/
bool
isEnabled
()
{
return
_enabled
;
}
bool
isEnabled
()
{
return
_enabled
;
}
void
setEnabled
(
bool
enabl
)
{
_enabled
=
enabl
;
}
void
setEnabled
(
bool
enabl
)
{
_enabled
=
enabl
;
}
/**
* Get the registration state of the specified link
* @return RegistrationState The registration state of underlying VoIPLink
*/
inline
RegistrationState
getRegistrationState
()
{
return
_registrationState
;
}
inline
RegistrationState
getRegistrationState
()
{
return
_registrationState
;
}
/**
* Set the registration state of the specified link
* @param state The registration state of underlying VoIPLink
*/
void
setRegistrationState
(
RegistrationState
state
);
void
setRegistrationState
(
RegistrationState
state
);
/**
* Set the latest up-to-date state code
* for that account. These codes are
* for that account. These codes are
* those used in SIP and IAX (eg. 200, 500 ...)
* @param state The Code:Description state
* @return void
*/
void
setRegistrationStateDetailed
(
std
::
pair
<
int
,
std
::
string
>
state
)
{
_registrationStateDetailed
=
state
;
}
void
setRegistrationStateDetailed
(
std
::
pair
<
int
,
std
::
string
>
state
)
{
_registrationStateDetailed
=
state
;
}
/**
* Get the latest up-to-date state code
* for that account. These codes are
* for that account. These codes are
* those used in SIP and IAX (eg. 200, 500 ...)
* @param void
* @return std::pair<int, std::string> A Code:Description state
*/
std
::
pair
<
int
,
std
::
string
>
getRegistrationStateDetailed
(
void
)
{
return
_registrationStateDetailed
;
}
std
::
pair
<
int
,
std
::
string
>
getRegistrationStateDetailed
(
void
)
{
return
_registrationStateDetailed
;
}
/* inline functions */
/* They should be treated like macro definitions by the C++ compiler */
inline
std
::
string
getUsername
(
void
)
{
return
_username
;
}
inline
void
setUsername
(
std
::
string
username
)
{
_username
=
username
;
}
inline
std
::
string
getHostname
(
void
)
{
return
_hostname
;
}
inline
void
setHostname
(
std
::
string
hostname
)
{
_hostname
=
hostname
;
}
inline
std
::
string
getPassword
(
void
)
{
return
_password
;
}
inline
void
setPassword
(
std
::
string
password
)
{
_password
=
password
;
}
inline
std
::
string
getUsername
(
void
)
{
return
_username
;
}
inline
void
setUsername
(
std
::
string
username
)
{
_username
=
username
;
}
inline
std
::
string
getHostname
(
void
)
{
return
_hostname
;
}
inline
void
setHostname
(
std
::
string
hostname
)
{
_hostname
=
hostname
;
}
inline
std
::
string
getPassword
(
void
)
{
return
_password
;
}
inline
void
setPassword
(
std
::
string
password
)
{
_password
=
password
;
}
inline
std
::
string
getAlias
(
void
)
{
return
_alias
;
}
inline
void
setAlias
(
std
::
string
alias
)
{
_alias
=
alias
;
}
inline
std
::
string
getType
(
void
)
{
return
_type
;
}
inline
void
setType
(
std
::
string
type
)
{
_type
=
type
;
}
inline
std
::
string
getAlias
(
void
)
{
return
_alias
;
}
inline
void
setAlias
(
std
::
string
alias
)
{
_alias
=
alias
;
}
inline
std
::
string
getType
(
void
)
{
return
_type
;
}
inline
void
setType
(
std
::
string
type
)
{
_type
=
type
;
}
/**
* Accessor to data structures
* @return CodecOrder& The list that reflects the user's choice
*/
inline
CodecOrder
&
getActiveCodecs
(
void
)
{
return
_codecOrder
;
}
void
setActiveCodecs
(
const
std
::
vector
<
std
::
string
>&
list
);
inline
std
::
string
getRingtonePath
(
void
)
{
return
_ringtonePath
;
}
inline
void
setRingtonePath
(
std
::
string
path
)
{
_ringtonePath
=
path
;
}
inline
bool
getRingtoneEnabled
(
void
)
{
return
_ringtoneEnabled
;
}
inline
void
setRingtoneEnabled
(
bool
enabl
)
{
_ringtoneEnabled
=
enabl
;
}
inline
std
::
string
getDisplayName
(
void
)
{
return
_displayName
;
}
inline
void
setDisplayName
(
std
::
string
name
)
{
_displayName
=
name
;
}
std
::
string
getUseragent
(
void
)
{
return
_useragent
;
}
void
setUseragent
(
std
::
string
ua
)
{
_useragent
=
ua
;
}
/**
* Accessor to data structures
* @return CodecOrder& The list that reflects the user's choice
*/
inline
CodecOrder
&
getActiveCodecs
(
void
)
{
return
_codecOrder
;
}
void
setActiveCodecs
(
const
std
::
vector
<
std
::
string
>&
list
);
inline
std
::
string
getRingtonePath
(
void
)
{
return
_ringtonePath
;
}
inline
void
setRingtonePath
(
std
::
string
path
)
{
_ringtonePath
=
path
;
}
inline
bool
getRingtoneEnabled
(
void
)
{
return
_ringtoneEnabled
;
}
inline
void
setRingtoneEnabled
(
bool
enabl
)
{
_ringtoneEnabled
=
enabl
;
}
inline
std
::
string
getDisplayName
(
void
)
{
return
_displayName
;
}
inline
void
setDisplayName
(
std
::
string
name
)
{
_displayName
=
name
;
}
std
::
string
getUseragent
(
void
)
{
return
_useragent
;
}
void
setUseragent
(
std
::
string
ua
)
{
_useragent
=
ua
;
}
private:
// copy constructor
Account
(
const
Account
&
rh
);
Account
(
const
Account
&
rh
);
// assignment operator
Account
&
operator
=
(
const
Account
&
rh
);
Account
&
operator
=
(
const
Account
&
rh
);
void
loadAudioCodecs
(
void
);
void
loadAudioCodecs
(
void
);
protected:
/**
...
...
@@ -332,47 +385,47 @@ class Account : public Serializable{
std
::
string
_type
;
/*
* The general, protocol neutral registration
* The general, protocol neutral registration
* state of the account
*/
RegistrationState
_registrationState
;
/*
* Details about the registration state.
* This is a protocol Code:Description pair.
* This is a protocol Code:Description pair.
*/
std
::
pair
<
int
,
std
::
string
>
_registrationStateDetailed
;
/**
* Vector containing the order of the codecs
*/
CodecOrder
_codecOrder
;
/**
* List of codec obtained when parsing configuration and used
* to generate codec order list
*/
std
::
string
_codecStr
;
/**
* Ringtone .au file used for this account
*/
std
::
string
_ringtonePath
;
/**
* Play ringtone when receiving a call
*/
bool
_ringtoneEnabled
;
/**
* Display name when calling
*/
/**
* Vector containing the order of the codecs
*/
CodecOrder
_codecOrder
;
/**
* List of codec obtained when parsing configuration and used
* to generate codec order list
*/
std
::
string
_codecStr
;
/**
* Ringtone .au file used for this account
*/
std
::
string
_ringtonePath
;
/**
* Play ringtone when receiving a call
*/
bool
_ringtoneEnabled
;
/**
* Display name when calling
*/
std
::
string
_displayName
;
/**
* Useragent used for registration
*/
std
::
string
_useragent
;
/**
* Useragent used for registration
*/
std
::
string
_useragent
;
};
...
...
sflphone-common/src/accountcreator.h
View file @
c135b1c2
...
...
@@ -2,17 +2,17 @@
* Copyright (C) 2004, 2005, 2006, 2009, 2008, 2009, 2010 Savoir-Faire Linux Inc.
* Author: Alexandre Bourget <alexandre.bourget@savoirfairelinux.com>
* Author: Yan Morin <yan.morin@savoirfairelinux.com>
*
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
...
...
@@ -39,24 +39,25 @@ class Account;
* @file accountcreator.h
* @brief Create protocol-specific account
*/
class
AccountCreator
{
public:
~
AccountCreator
();
/**
* Public account type
*/
enum
AccountType
{
SIP_ACCOUNT
,
SIP_DIRECT_IP_ACCOUNT
,
IAX_ACCOUNT
};
/**
* Create a new account or null
* @param type type of the account
* @param accountID accountID (must be unique for each account)
*/
static
Account
*
createAccount
(
AccountType
type
,
AccountID
accountID
);
class
AccountCreator
{
public:
~
AccountCreator
();
/**
* Public account type
*/
enum
AccountType
{
SIP_ACCOUNT
,
SIP_DIRECT_IP_ACCOUNT
,
IAX_ACCOUNT
};
/**
* Create a new account or null
* @param type type of the account
* @param accountID accountID (must be unique for each account)
*/
static
Account
*
createAccount
(
AccountType
type
,
AccountID
accountID
);
private:
/** Hidden constructor */
AccountCreator
();
private:
/** Hidden constructor */
AccountCreator
();
};
#endif
sflphone-common/src/audio/algorithm.h
View file @
c135b1c2
...
...
@@ -35,45 +35,46 @@
/**
* \class Algorithm
*
*
* Abstract interface used to implement audio processing algorithm
*/
class
Algorithm
{
class
Algorithm
{
public:
public:
virtual
void
reset
(
void
)
=
0
;
virtual
void
reset
(
void
)
=
0
;
/**
* Put data to be processed
*/
virtual
void
putData
(
SFLDataFormat
*
inputData
,
int
nbBytes
)
=
0
;
/**
* Put data to be processed
*/
virtual
void
putData
(
SFLDataFormat
*
inputData
,
int
nbBytes
)
=
0
;
/**
*
*/
virtual
int
getData
(
SFLDataFormat
*
outputData
)
=
0
;
/**
*
*/
virtual
int
getData
(
SFLDataFormat
*
outputData
)
=
0
;
/**
* Class implementing this interface must define this function
* for audio processing that require synchronization between spkrdata and
*/
virtual
void
process
(
SFLDataFormat
*
inputData
,
int
nbBytes
)
=
0
;
/**
* Class implementing this interface must define this function
* for audio processing that require synchronization between spkrdata and
*/
virtual
void
process
(
SFLDataFormat
*
inputData
,
int
nbBytes
)
=
0
;
/**
* Class implementing this interface must define this function
* for audio processing that require synchronization between spkrdata and
*/
virtual
int
process
(
SFLDataFormat
*
inputData
,
SFLDataFormat
*
outputData
,
int
nbBytes
)
=
0
;
/**
* Class implementing this interface must define this function
* for audio processing that require synchronization between spkrdata and
*/
virtual
int
process
(
SFLDataFormat
*
inputData
,
SFLDataFormat
*
outputData
,
int
nbBytes
)
=
0
;
/**
* Class implementing this interface must define this function
* for audio processing that require synchronization between spkr and mic
* \param micData
* \param spkrData
* \param outputData
*/
virtual
void
process
(
SFLDataFormat
*
micData
,
SFLDataFormat
*
spkrData
,
SFLDataFormat
*
outputData
,
int
nbBytes
)
=
0
;
/**
* Class implementing this interface must define this function
* for audio processing that require synchronization between spkr and mic
* \param micData
* \param spkrData
* \param outputData
*/
virtual
void
process
(
SFLDataFormat
*
micData
,
SFLDataFormat
*
spkrData
,
SFLDataFormat
*
outputData
,
int
nbBytes
)
=
0
;
};
...
...
sflphone-common/src/audio/alsa/alsalayer.h
View file @
c135b1c2
...
...
@@ -7,12 +7,12 @@
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
...
...
@@ -45,269 +45,310 @@ typedef std::pair<int , std::string> HwIDPair;
/**
* @file AlsaLayer.h
* @brief Main sound class. Manages the data transfers between the application and the hardware.
* @brief Main sound class. Manages the data transfers between the application and the hardware.
*/
class
AlsaLayer
:
public
AudioLayer
{
public:
/**
* Constructor
* @param manager An instance of managerimpl
*/
AlsaLayer
(
ManagerImpl
*
manager
);
/**
* Destructor
*/
~
AlsaLayer
(
void
);
bool
closeLayer
(
void
);
/**
* Check if no devices are opened, otherwise close them.
* Then open the specified devices by calling the private functions open_device
* @param indexIn The number of the card chosen for capture
* @param indexOut The number of the card chosen for playback
* @param sampleRate The sample rate
* @param frameSize The frame size
* @param stream To indicate which kind of stream you want to open
* SFL_PCM_CAPTURE
* SFL_PCM_PLAYBACK
* SFL_PCM_BOTH
* @param plugin The alsa plugin ( dmix , default , front , surround , ...)
*/
bool
openDevice
(
int
indexIn
,
int
indexOut
,
int
indexRing
,
int
sampleRate
,
int
frameSize
,
int
stream
,
std
::
string
plugin
);