Commit 6dc6f347 authored by Tristan Matthews's avatar Tristan Matthews
Browse files

Merge branch 'master' into video_preview

Resolved Conflicts:
	daemon/src/Makefile.am
	daemon/src/account.cpp
	daemon/src/account.h
	daemon/src/audio/audiortp/audio_rtp_session.h
	daemon/src/audio/codecs/audiocodec.cpp
	daemon/src/audio/codecs/audiocodecfactory.cpp
	daemon/src/audio/pulseaudio/pulselayer.cpp
	daemon/src/audio/pulseaudio/pulselayer.h
	daemon/src/call.cpp
	daemon/src/call.h
	daemon/src/config/yamlemitter.cpp
	daemon/src/config/yamlemitter.h
	daemon/src/config/yamlparser.cpp
	daemon/src/config/yamlparser.h
	daemon/src/dbus/callmanager.h
	daemon/src/dbus/configurationmanager.cpp
	daemon/src/dbus/configurationmanager.h
	daemon/src/main.cpp
	daemon/src/managerimpl.cpp
	daemon/src/preferences.cpp
	daemon/src/preferences.h
	daemon/src/sip/sdp.cpp
	daemon/src/sip/sdp.h
	daemon/src/sip/sipaccount.cpp
	daemon/src/sip/sipcall.cpp
	daemon/src/sip/sipcall.h
	daemon/src/sip/sipvoiplink.cpp
	daemon/test/sdptest.cpp
	gnome/src/actions.c
	gnome/src/callable_obj.c
	gnome/src/codeclist.c
	gnome/src/config/accountconfigdialog.c
	gnome/src/config/accountlistconfigdialog.c
	gnome/src/config/audioconf.c
	gnome/src/config/preferencesdialog.c
	gnome/src/config/shortcuts-config.c
	gnome/src/config/tlsadvanceddialog.c
	gnome/src/contacts/calltree.c
	gnome/src/contacts/searchbar.c
	gnome/src/dbus/dbus.c
	gnome/src/eel-gconf-extensions.c
	gnome/src/icons/icon_factory.c
	gnome/src/imwindow.c
	gnome/src/main.c
	gnome/src/mainwindow.c
	gnome/src/sflnotify.c
	gnome/src/shortcuts.c
	gnome/src/sliders.c
	gnome/src/statusicon.c
	gnome/src/uimanager.c
	gnome/src/widget/gtkscrollbook.c
parents b1034a99 1083b59a
......@@ -5,12 +5,14 @@
# Savoir-faire Linux Inc
# http://www.sflphone.org
style=k&r # Kernighan & Ritchie style formatting/indenting uses linux bracket
indent=spaces=4 # Use spaces instead of tabs for indentation
indent-classes # Indent 'class' and 'struct' blocks so that the blocks 'public:', 'protected:' and 'private:' are indented
indent-switches # Indent 'switch' blocks so that the 'case X:' statements are indented in the switch block
break-blocks # Pad empty lines around header blocks (e.g. 'if', 'while'...).
style=stroustrup # stroustrup style http://astyle.sourceforge.net/astyle.html#_style=stroustrup
indent=spaces=4 # Use spaces instead of tabs for indentation
indent-classes # Indent 'class' and 'struct' blocks so that the blocks 'public:', 'protected:' and 'private:' are indented
indent-switches # Indent 'switch' blocks so that the 'case X:' statements are indented in the switch block
break-blocks # Pad empty lines around header blocks (e.g. 'if', 'while'...).
brackets=linux
unpad=paren
formatted
-d
unpad-paren # Remove unwanted space around parentheses
pad-header # Insert space padding after paren headers only (e.g. 'if', 'for', 'while'...)
formatted # only display files that have changed
recursive # recursively enter subdirs
suffix=none # don't create backup files (that's what version control is for)
......@@ -52,8 +52,6 @@ AC_CONFIG_FILES([src/Makefile \
src/video/test/Makefile \
src/config/Makefile \
src/dbus/Makefile \
src/plug-in/Makefile \
src/plug-in/test/Makefile \
src/hooks/Makefile \
src/history/Makefile])
......
......@@ -3,8 +3,8 @@ SUBDIRS = singleton
noinst_LTLIBRARIES = libutilspp.la
libutilspp_la_SOURCES = \
NullType.hpp \
Singleton.hpp \
ThreadingSingle.hpp ThreadingSingle.inl
null_type.hpp \
singleton.hpp \
threading_single.hpp threading_single.inl
libutilspp_la_LIBADD = ./singleton/libsingleton.la
#include "ThreadingSingle.hpp"
#include "singleton/SingletonHolder.hpp"
#include "threading_single.hpp"
#include "singleton/singleton_holder.hpp"
noinst_LTLIBRARIES = libsingleton.la
libsingleton_la_SOURCES = \
CreationUsingNew.hpp CreationUsingNew.inl \
LifetimeDefault.hpp LifetimeDefault.inl \
SingletonHolder.hpp SingletonHolder.inl
#pkginclude_HEADERS = \
# CreationStatic.hpp CreationStatic.inl \
# CreationUsingNew.hpp CreationUsingNew.inl \
# LifetimeDefault.hpp LifetimeDefault.inl \
# LifetimeLibrary.hpp LifetimeLibrary.inl \
# LifetimeWithLongevity.hpp LifetimeWithLongevity.inl \
# PrivateMembers.hpp PrivateMembers.inl \
# SingletonHolder.hpp SingletonHolder.inl
#pkgincludedir=$(includedir)/utilspp/singleton
creation_using_new.hpp creation_using_new.inl \
lifetime_default.hpp lifetime_default.inl \
singleton_holder.hpp singleton_holder.inl
......@@ -21,8 +21,8 @@
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#ifndef CREATION_USING_NEW_HPP
#define CREATION_USING_NEW_HPP
#ifndef __CREATION_USING_NEW_HPP__
#define __CREATION_USING_NEW_HPP__
/**
* This class is a creation policy for the utilspp::singleton_holder. The
......@@ -38,6 +38,5 @@ namespace utilspp
};
}
#include "CreationUsingNew.inl"
#endif
#include "creation_using_new.inl"
#endif // __CREATION_USING_NEW_HPP__
......@@ -24,9 +24,6 @@
#ifndef LIFETIME_DEFAULT_HPP
#define LIFETIME_DEFAULT_HPP
#include <stdexcept>
#include <cstdlib>
namespace utilspp
{
template< typename T >
......@@ -38,6 +35,6 @@ namespace utilspp
};
}
#include "LifetimeDefault.inl"
#include "lifetime_default.inl"
#endif
......@@ -21,8 +21,11 @@
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#ifndef LIFETIME_DEFAULT_INL
#define LIFETIME_DEFAULT_INL
#ifndef __LIFETIME_DEFAULT_INL__
#define __LIFETIME_DEFAULT_INL__
#include <cstdlib>
#include <stdexcept>
template< typename T >
void
......@@ -35,8 +38,7 @@ template< typename T >
void
utilspp::LifetimeDefault< T >::onDeadReference()
{
throw std::logic_error( "Dead reference detected" );
throw std::logic_error("Dead reference detected");
}
#endif
#endif // __LIFETIME_DEFAULT_INL__
......@@ -21,14 +21,12 @@
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#ifndef SINGLETON_HOLDER_HPP
#define SINGLETON_HOLDER_HPP
#ifndef __SINGLETON_HOLDER_HPP__
#define __SINGLETON_HOLDER_HPP__
#include <cassert>
#include "CreationUsingNew.hpp"
#include "LifetimeDefault.hpp"
#include "../ThreadingSingle.hpp"
#include "creation_using_new.hpp"
#include "lifetime_default.hpp"
#include "../threading_single.hpp"
namespace utilspp
{
......@@ -60,6 +58,6 @@ namespace utilspp
}
#include "SingletonHolder.inl"
#include "singleton_holder.inl"
#endif
......@@ -21,9 +21,10 @@
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#ifndef SINGLETON_HOLDER_INL
#define SINGLETON_HOLDER_INL
#ifndef __SINGLETON_HOLDER_INL__
#define __SINGLETON_HOLDER_INL__
#include <cassert>
template
<
class T,
......@@ -123,4 +124,4 @@ template < class > class M
>
bool utilspp::SingletonHolder< T, C, L, M >::mDestroyed;
#endif
#endif // __SINGLETON_HOLDER_INL__
......@@ -21,10 +21,10 @@
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#ifndef SINGLE_THREADED_HPP
#define SINGLE_THREADED_HPP
#ifndef __THREADING_SINGLE_HPP__
#define __THREADING_SINGLE_HPP__
#include "NullType.hpp"
#include "null_type.hpp"
namespace utilspp
{
......@@ -47,6 +47,6 @@ namespace utilspp
};
}
#include "ThreadingSingle.inl"
#include "threading_single.inl"
#endif
#endif // __THREADING_SINGLE_HPP__
......@@ -21,8 +21,8 @@
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#ifndef SINGLE_THREADED_INL
#define SINGLE_THREADED_INL
#ifndef __THREADING_SINGLE_INL__
#define __THREADING_SINGLE_INL__
template< typename T >
inline
......@@ -47,4 +47,4 @@ void
utilspp::ThreadingSingle< T >::mutex::unlock()
{}
#endif
#endif // __THREADING_SINGLE_INL__
......@@ -5,7 +5,7 @@ libexec_PROGRAMS = sflphoned
# all: indent
SUBDIRS = dbus audio config plug-in hooks history sip iax im video
SUBDIRS = dbus audio config hooks history sip iax im video
sflphoned_SOURCES = main.cpp
......@@ -35,7 +35,7 @@ noinst_LTLIBRARIES = libsflphone.la
noinst_HEADERS = \
global.h \
Codec.h \
codec.h \
conference.h \
voiplink.h \
preferences.h \
......@@ -59,7 +59,6 @@ libsflphone_la_LIBADD = \
./video/libvideo.la \
./dbus/libdbus.la \
./config/libconfig.la \
./plug-in/libplugin.la \
./hooks/libhooks.la \
./history/libhistory.la
......
......@@ -35,18 +35,18 @@
#include "video/video_endpoint.h"
Account::Account (const std::string& accountID, const std::string &type) :
accountID_ (accountID)
, link_ (NULL)
, enabled_ (true)
, type_ (type)
, registrationState_ (Unregistered)
, codecOrder_ ()
, videoCodecOrder_ ()
, codecStr_ ("")
, ringtonePath_ ("/usr/share/sflphone/ringtones/konga.ul")
, ringtoneEnabled_ (true)
, displayName_ ("")
, userAgent_ ("SFLphone")
accountID_(accountID)
, link_(NULL)
, enabled_(true)
, type_(type)
, registrationState_(Unregistered)
, codecOrder_()
, videoCodecOrder_()
, codecStr_("")
, ringtonePath_("/usr/share/sflphone/ringtones/konga.ul")
, ringtoneEnabled_(true)
, displayName_("")
, userAgent_("SFLphone")
{
// Initialize the codec order, used when creating a new account
loadDefaultCodecs();
......@@ -56,7 +56,7 @@ Account::~Account()
{
}
void Account::setRegistrationState (const RegistrationState &state)
void Account::setRegistrationState(const RegistrationState &state)
{
if (state != registrationState_) {
registrationState_ = state;
......@@ -68,21 +68,17 @@ void Account::setRegistrationState (const RegistrationState &state)
void Account::loadDefaultCodecs()
{
// TODO
// CodecMap codecMap = Manager::instance ().getCodecDescriptorMap ().getCodecsMap();
// Initialize codec
std::vector <std::string> codecList;
codecList.push_back ("0");
codecList.push_back ("3");
codecList.push_back ("8");
codecList.push_back ("9");
codecList.push_back ("110");
codecList.push_back ("111");
codecList.push_back ("112");
setActiveCodecs (codecList);
codecList.push_back("0");
codecList.push_back("3");
codecList.push_back("8");
codecList.push_back("9");
codecList.push_back("110");
codecList.push_back("111");
codecList.push_back("112");
setActiveCodecs(codecList);
setActiveVideoCodecs(sfl_video::getVideoCodecList());
}
......@@ -91,7 +87,7 @@ void Account::setActiveVideoCodecs (const std::vector <std::string> &list)
videoCodecOrder_ = !list.empty() ? list : sfl_video::getVideoCodecList();
}
void Account::setActiveCodecs (const std::vector <std::string> &list)
void Account::setActiveCodecs(const std::vector <std::string> &list)
{
// first clear the previously stored codecs
codecOrder_.clear();
......@@ -100,12 +96,12 @@ void Account::setActiveCodecs (const std::vector <std::string> &list)
// we used the CodecOrder vector to save the order.
for (std::vector<std::string>::const_iterator iter = list.begin(); iter != list.end();
++iter) {
int payload = std::atoi (iter->c_str());
codecOrder_.push_back ( (int) payload);
int payload = std::atoi(iter->c_str());
codecOrder_.push_back((int) payload);
}
// update the codec string according to new codec selection
codecStr_ = ManagerImpl::serialize (list);
codecStr_ = ManagerImpl::serialize(list);
}
std::string Account::mapStateNumberToString(RegistrationState state)
......
......@@ -144,12 +144,11 @@ static const char * const ringtonePathKey = "ringtonePath";
static const char * const ringtoneEnabledKey = "ringtoneEnabled";
static const char * const displayNameKey = "displayName";
class Account : public Serializable
{
class Account : public Serializable {
public:
Account (const std::string& accountID, const std::string &type);
Account(const std::string& accountID, const std::string &type);
/**
* Virtual destructor
......@@ -160,15 +159,15 @@ class Account : public Serializable
* Method called by the configuration engine to serialize instance's information
* into configuration file.
*/
virtual void serialize (Conf::YamlEmitter *emitter) = 0;
virtual void serialize(Conf::YamlEmitter *emitter) = 0;
/**
* Method called by the configuration engine to restore instance internal state
* from configuration file.
*/
virtual void unserialize (Conf::MappingNode *map) = 0;
virtual void unserialize(Conf::MappingNode *map) = 0;
virtual void setAccountDetails (std::map<std::string, std::string> details) = 0;
virtual void setAccountDetails(std::map<std::string, std::string> details) = 0;
virtual std::map<std::string, std::string> getAccountDetails() const = 0;
......@@ -189,7 +188,7 @@ class Account : public Serializable
* Get the voiplink pointer
* @return VoIPLink* the pointer or 0
*/
VoIPLink* getVoIPLink() const {
VoIPLink* getVoIPLink() {
return link_;
}
......@@ -214,7 +213,7 @@ class Account : public Serializable
return enabled_;
}
void setEnabled (bool enable) {
void setEnabled(bool enable) {
enabled_ = enable;
}
......@@ -222,31 +221,31 @@ class Account : public Serializable
* Set the registration state of the specified link
* @param state The registration state of underlying VoIPLink
*/
void setRegistrationState (const RegistrationState &state);
void setRegistrationState(const RegistrationState &state);
/* They should be treated like macro definitions by the C++ compiler */
std::string getUsername (void) const {
std::string getUsername() const {
return username_;
}
std::string getHostname (void) const {
std::string getHostname() const {
return hostname_;
}
void setHostname (const std::string &hostname) {
void setHostname(const std::string &hostname) {
hostname_ = hostname;
}
std::string getAlias (void) const {
std::string getAlias() const {
return alias_;
}
void setAlias (const std::string &alias) {
void setAlias(const std::string &alias) {
alias_ = alias;
}
std::string getType (void) const {
std::string getType() const {
return type_;
}
void setType (const std::string &type) {
void setType(const std::string &type) {
type_ = type;
}
......@@ -262,7 +261,7 @@ class Account : public Serializable
* Accessor to data structures
* @return CodecOrder& The list that reflects the user's choice
*/
const CodecOrder& getActiveCodecs (void) const {
const CodecOrder& getActiveCodecs() const {
return codecOrder_;
}
......@@ -270,41 +269,41 @@ class Account : public Serializable
* Update both the codec order structure and the codec string used for
* SDP offer and configuration respectively
*/
void setActiveCodecs (const std::vector <std::string>& list);
void setActiveVideoCodecs (const std::vector <std::string>& list);
void setActiveCodecs(const std::vector<std::string>& list);
void setActiveVideoCodecs(const std::vector<std::string>& list);
std::string getRingtonePath (void) const {
std::string getRingtonePath() const {
return ringtonePath_;
}
void setRingtonePath (const std::string &path) {
void setRingtonePath(const std::string &path) {
ringtonePath_ = path;
}
bool getRingtoneEnabled (void) const {
bool getRingtoneEnabled() const {
return ringtoneEnabled_;
}
void setRingtoneEnabled (bool enable) {
void setRingtoneEnabled(bool enable) {
ringtoneEnabled_ = enable;
}
std::string getDisplayName (void) const {
std::string getDisplayName() const {
return displayName_;
}
void setDisplayName (const std::string &name) {
void setDisplayName(const std::string &name) {
displayName_ = name;
}
std::string getMailBox (void) const {
std::string getMailBox() const {
return mailBox_;
}
void setMailBox (const std::string &mb) {
void setMailBox(const std::string &mb) {
mailBox_ = mb;
}
private:
// copy constructor
Account (const Account& rh);
Account(const Account& rh);
// assignment operator
Account& operator= (const Account& rh);
......@@ -313,10 +312,10 @@ class Account : public Serializable
* Helper function used to load the default codec order from the codec factory
* setActiveCodecs is called to sync both codecOrder_ and codecStr_
*/
void loadDefaultCodecs (void);
void loadDefaultCodecs();
protected:
static std::string mapStateNumberToString (RegistrationState state);
static std::string mapStateNumberToString(RegistrationState state);
/**
* Account ID are assign in constructor and shall not changed
......
This diff is collapsed.
......@@ -47,32 +47,31 @@ class AlsaThread;
/** Associate a sound card index to its string description */
typedef std::pair<int , std::string> HwIDPair;
class AlsaLayer : public AudioLayer
{
class AlsaLayer : public AudioLayer {
public:
/**
* Constructor
*/
AlsaLayer ();
AlsaLayer();
/**
* Destructor
*/
~AlsaLayer (void);
~AlsaLayer();
/**
* Start the capture stream and prepare the playback stream.
* The playback starts accordingly to its threshold
* ALSA Library API
*/
void startStream (void);
void startStream();
/**
* Stop the playback and capture streams.
* Drops the pending frames and put the capture and playback handles to PREPARED state
* ALSA Library API
*/
void stopStream (void);
void stopStream();
/**
* Concatenate two strings. Used to build a valid pcm device name.
......@@ -80,7 +79,7 @@ class AlsaLayer : public AudioLayer
* @param card the sound card number
* @return std::string the concatenated string
*/
std::string buildDeviceTopo (const std::string &plugin, int card);
std::string buildDeviceTopo(const std::string &plugin, int card);
/**
* Scan the sound card available on the system
......@@ -90,7 +89,7 @@ class AlsaLayer : public AudioLayer
* SFL_PCM_BOTH
* @return std::vector<std::string> The vector containing the string description of the card
*/
std::vector<std::string> getSoundCardsInfo (int stream);
std::vector<std::string> getSoundCardsInfo(int stream);
/**
* Check if the given index corresponds to an existing sound card and supports the specified streaming mode
......@@ -109,12 +108,12 @@ class AlsaLayer : public AudioLayer
* @param description The string description
* @return int Its index
*/
int soundCardGetIndex (const std::string &description);
int soundCardGetIndex(const std::string &description);
void playback(int maxSamples);
void capture(void);
void capture();
void audioCallback (void);
void audioCallback();
/**
* Get the index of the audio card for capture
......@@ -135,10 +134,10 @@ class AlsaLayer : public AudioLayer
}
/**
* Get the index of the audio card for ringtone (could be differnet from playback)
* @return int The index of the card used for ringtone
* 0 for the first available card on the system, 1 ...
*/
* Get the index of the audio card for ringtone (could be differnet from playback)
* @return int The index of the card used for ringtone
* 0 for the first available card on the system, 1 ...
*/
int getIndexRing() const {
return indexRing_;
}
......@@ -170,7 +169,7 @@ class AlsaLayer : public AudioLayer
// Copy Constructor
AlsaLayer (const AlsaLayer& rh);
AlsaLayer(const AlsaLayer& rh);
// Assignment Operator
AlsaLayer& operator= (const AlsaLayer& rh);
......@@ -179,17 +178,17 @@ class AlsaLayer : public AudioLayer
* Drop the pending frames and close the capture device
* ALSA Library API
*/
void closeCaptureStream (void);
void stopCaptureStream (void);
void startCaptureStream (void);
void prepareCaptureStream (void);
void closeCaptureStream();
void stopCaptureStream();