Skip to content
Snippets Groups Projects
Commit 1e07ba05 authored by Vittorio Giovara's avatar Vittorio Giovara Committed by Tristan Matthews
Browse files

allow compiling when dbus is disabled

The stub files are going to fill the missing implementations until
platform-dependent ones are provided.

Refs: #46447

Change-Id: Ie7a990c9a1124d1ddf971cd19190936d5117708f
parent a2214614
No related branches found
No related tags found
No related merge requests found
...@@ -224,9 +224,12 @@ AC_ARG_WITH([dbus], ...@@ -224,9 +224,12 @@ AC_ARG_WITH([dbus],
[with_dbus=yes]) [with_dbus=yes])
AS_IF([test "x$with_dbus" = "xyes"], [ AS_IF([test "x$with_dbus" = "xyes"], [
PKG_CHECK_MODULES(DBUSCPP, dbus-c++-1,, AC_MSG_WARN([Missing dbus development files])) PKG_CHECK_MODULES(DBUSCPP, dbus-c++-1,, AC_MSG_WARN([Missing dbus development files]))
AC_CONFIG_FILES([src/client/dbus/Makefile \
doc/dbus-api/Makefile])
]); ]);
AC_DEFINE_UNQUOTED([HAVE_DBUS], `if test "x$with_dbus" = "xyes"; then echo 1; else echo 0; fi`, [Define if you have dbus support]) AC_DEFINE_UNQUOTED([HAVE_DBUS], `if test "x$with_dbus" = "xyes"; then echo 1; else echo 0; fi`, [Define if you have dbus support])
AM_CONDITIONAL(USE_DBUS, test "x$with_dbus" = "xyes" )
# Instant Messaging # Instant Messaging
# required dependency(ies): libxpat # required dependency(ies): libxpat
...@@ -416,7 +419,6 @@ AC_CONFIG_FILES([Makefile \ ...@@ -416,7 +419,6 @@ AC_CONFIG_FILES([Makefile \
src/audio/codecs/Makefile \ src/audio/codecs/Makefile \
src/config/Makefile \ src/config/Makefile \
src/client/Makefile \ src/client/Makefile \
src/client/dbus/Makefile \
src/hooks/Makefile \ src/hooks/Makefile \
src/history/Makefile \ src/history/Makefile \
src/video/Makefile \ src/video/Makefile \
...@@ -425,7 +427,6 @@ AC_CONFIG_FILES([Makefile \ ...@@ -425,7 +427,6 @@ AC_CONFIG_FILES([Makefile \
ringtones/Makefile \ ringtones/Makefile \
man/Makefile \ man/Makefile \
doc/Makefile \ doc/Makefile \
doc/dbus-api/Makefile \
doc/doxygen/Makefile]) doc/doxygen/Makefile])
# Go! # Go!
......
...@@ -8,20 +8,31 @@ noinst_HEADERS = callmanager.h \ ...@@ -8,20 +8,31 @@ noinst_HEADERS = callmanager.h \
if SFL_PRESENCE if SFL_PRESENCE
PRESENCE_SRC = presencemanager.cpp PRESENCE_SRC = presencemanager.cpp
PRESENCE_STUB = presencemanager_stub.cpp
noinst_HEADERS += presencemanager.h noinst_HEADERS += presencemanager.h
endif endif
if SFL_VIDEO if SFL_VIDEO
VIDEO_STUB = videocontrols_stub.cpp
noinst_HEADERS += video_controls.h noinst_HEADERS += video_controls.h
endif endif
if USE_DBUS
SUBDIRS=dbus SUBDIRS=dbus
libclient_la_LIBADD = dbus/libclient_dbus.la libclient_la_LIBADD = dbus/libclient_dbus.la
else
STUB_SRC = client.cpp \
callmanager_stub.cpp \
configurationmanager_stub.cpp \
$(PRESENCE_STUB) \
$(VIDEO_STUB)
endif
libclient_la_SOURCES = callmanager.cpp \ libclient_la_SOURCES = callmanager.cpp \
configurationmanager.cpp \ configurationmanager.cpp \
$(PRESENCE_SRC) $(PRESENCE_SRC) \
$(STUB_SRC)
libclient_la_CXXFLAGS = -I./ \ libclient_la_CXXFLAGS = -I./ \
-DPREFIX=\"$(prefix)\" \ -DPREFIX=\"$(prefix)\" \
......
...@@ -150,8 +150,9 @@ class CallManager ...@@ -150,8 +150,9 @@ class CallManager
void sendTextMessage(const std::string& callID, const std::string& message); void sendTextMessage(const std::string& callID, const std::string& message);
void sendTextMessage(const std::string& callID, const std::string& message, const std::string& from); void sendTextMessage(const std::string& callID, const std::string& message, const std::string& from);
#ifdef __ANDROID__ /* the following signals must be implemented manually for any
// signals must be implemented manually for Android * platform or configuration that does not supply dbus */
#if !HAVE_DBUS
void callStateChanged(const std::string& callID, const std::string& state); void callStateChanged(const std::string& callID, const std::string& state);
void transferFailed(); void transferFailed();
...@@ -187,7 +188,8 @@ class CallManager ...@@ -187,7 +188,8 @@ class CallManager
void zrtpNegotiationFailed(const std::string& callID, const std::string& arg2, const std::string& arg3); void zrtpNegotiationFailed(const std::string& callID, const std::string& arg2, const std::string& arg3);
void onRtcpReportReceived(const std::string& callID, const std::map<std::string, int>& stats); void onRtcpReportReceived(const std::string& callID, const std::map<std::string, int>& stats);
#endif // __ANDROID__ #endif // !HAVE_DBUS
private: private:
#if HAVE_ZRTP #if HAVE_ZRTP
......
...@@ -169,10 +169,11 @@ class ConfigurationManager ...@@ -169,10 +169,11 @@ class ConfigurationManager
bool checkCertificateValidity(const std::string& pemPath); bool checkCertificateValidity(const std::string& pemPath);
bool checkHostnameCertificate(const std::string& certificatePath, const std::string& host, const std::string& port); bool checkHostnameCertificate(const std::string& certificatePath, const std::string& host, const std::string& port);
#ifdef __ANDROID__ /* the following signals must be implemented manually for any
* platform or configuration that does not supply dbus */
#if !HAVE_DBUS
void volumeChanged(const std::string& device, const int& value); void volumeChanged(const std::string& device, const int& value);
// signals must be implemented manually for Android
void accountsChanged(); void accountsChanged();
void historyChanged(); void historyChanged();
...@@ -184,7 +185,7 @@ class ConfigurationManager ...@@ -184,7 +185,7 @@ class ConfigurationManager
void errorAlert(const int& alert); void errorAlert(const int& alert);
std::vector< int32_t > getHardwareAudioFormat(); std::vector< int32_t > getHardwareAudioFormat();
#endif // __ANDROID__ #endif // !HAVE_DBUS
}; };
#endif //CONFIGURATIONMANAGER_H #endif //CONFIGURATIONMANAGER_H
...@@ -76,14 +76,16 @@ class PresenceManager ...@@ -76,14 +76,16 @@ class PresenceManager
PresenceManager(); PresenceManager();
#endif #endif
#ifdef __ANDROID__ /* the following signals must be implemented manually for any
* platform or configuration that does not supply dbus */
#if !HAVE_DBUS
void newServerSubscriptionRequest(const std::string& remote); void newServerSubscriptionRequest(const std::string& remote);
void serverError(const std::string& accountID, const std::string& error, const std::string& msg); void serverError(const std::string& accountID, const std::string& error, const std::string& msg);
void newBuddyNotification(const std::string& accountID, const std::string& buddyUri, void newBuddyNotification(const std::string& accountID, const std::string& buddyUri,
const bool& status, const std::string& lineStatus); const bool& status, const std::string& lineStatus);
void subscriptionStateChanged(const std::string& accountID, const std::string& buddyUri, void subscriptionStateChanged(const std::string& accountID, const std::string& buddyUri,
const bool& state); const bool& state);
#endif //__ANDROID__ #endif // !HAVE_DBUS
/* Presence subscription/Notification. */ /* Presence subscription/Notification. */
void publish(const std::string& accountID, const bool& status, const std::string& note); void publish(const std::string& accountID, const bool& status, const std::string& note);
......
...@@ -60,9 +60,13 @@ ...@@ -60,9 +60,13 @@
#include "video/video_base.h" #include "video/video_base.h"
#include "video/video_input_selector.h" #include "video/video_input_selector.h"
class VideoControls : public org::sflphone::SFLphone::VideoControls_adaptor, class VideoControls
#if HAVE_DBUS
: public org::sflphone::SFLphone::VideoControls_adaptor,
public DBus::IntrospectableAdaptor, public DBus::IntrospectableAdaptor,
public DBus::ObjectAdaptor { public DBus::ObjectAdaptor
#endif
{
private: private:
std::shared_ptr<sfl_video::VideoInputSelector> videoInputSelector_; std::shared_ptr<sfl_video::VideoInputSelector> videoInputSelector_;
VideoPreference videoPreference_; VideoPreference videoPreference_;
...@@ -70,8 +74,11 @@ class VideoControls : public org::sflphone::SFLphone::VideoControls_adaptor, ...@@ -70,8 +74,11 @@ class VideoControls : public org::sflphone::SFLphone::VideoControls_adaptor,
int inputClients_; // XXX necessary with the videoInputSelector_? int inputClients_; // XXX necessary with the videoInputSelector_?
public: public:
#if HAVE_DBUS
VideoControls(DBus::Connection& connection); VideoControls(DBus::Connection& connection);
#else
VideoControls();
#endif
VideoPreference &getVideoPreferences(); VideoPreference &getVideoPreferences();
std::vector<std::map<std::string, std::string> > std::vector<std::map<std::string, std::string> >
...@@ -131,6 +138,14 @@ class VideoControls : public org::sflphone::SFLphone::VideoControls_adaptor, ...@@ -131,6 +138,14 @@ class VideoControls : public org::sflphone::SFLphone::VideoControls_adaptor,
bool switchInput(const std::string& resource); bool switchInput(const std::string& resource);
bool hasCameraStarted(); bool hasCameraStarted();
std::weak_ptr<sfl_video::VideoFrameActiveWriter> getVideoCamera(); std::weak_ptr<sfl_video::VideoFrameActiveWriter> getVideoCamera();
/* the following signals must be implemented manually for any
* platform or configuration that does not supply dbus */
#if !HAVE_DBUS
void deviceEvent();
void startedDecoding(const std::string &id, const std::string, int w, int h);
void stoppedDecoding(const std::string &id, const std::string);
#endif // !HAVE_DBUS
}; };
#endif // VIDEO_CONTROLS_H_ #endif // VIDEO_CONTROLS_H_
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment