Commit 1e07ba05 authored by Vittorio Giovara's avatar Vittorio Giovara Committed by Tristan Matthews

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
......@@ -224,9 +224,12 @@ AC_ARG_WITH([dbus],
[with_dbus=yes])
AS_IF([test "x$with_dbus" = "xyes"], [
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])
AM_CONDITIONAL(USE_DBUS, test "x$with_dbus" = "xyes" )
# Instant Messaging
# required dependency(ies): libxpat
......@@ -416,7 +419,6 @@ AC_CONFIG_FILES([Makefile \
src/audio/codecs/Makefile \
src/config/Makefile \
src/client/Makefile \
src/client/dbus/Makefile \
src/hooks/Makefile \
src/history/Makefile \
src/video/Makefile \
......@@ -425,7 +427,6 @@ AC_CONFIG_FILES([Makefile \
ringtones/Makefile \
man/Makefile \
doc/Makefile \
doc/dbus-api/Makefile \
doc/doxygen/Makefile])
# Go!
......
......@@ -8,20 +8,31 @@ noinst_HEADERS = callmanager.h \
if SFL_PRESENCE
PRESENCE_SRC = presencemanager.cpp
PRESENCE_STUB = presencemanager_stub.cpp
noinst_HEADERS += presencemanager.h
endif
if SFL_VIDEO
VIDEO_STUB = videocontrols_stub.cpp
noinst_HEADERS += video_controls.h
endif
if USE_DBUS
SUBDIRS=dbus
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 \
configurationmanager.cpp \
$(PRESENCE_SRC)
$(PRESENCE_SRC) \
$(STUB_SRC)
libclient_la_CXXFLAGS = -I./ \
-DPREFIX=\"$(prefix)\" \
......
......@@ -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, const std::string& from);
#ifdef __ANDROID__
// signals must be implemented manually for Android
/* the following signals must be implemented manually for any
* platform or configuration that does not supply dbus */
#if !HAVE_DBUS
void callStateChanged(const std::string& callID, const std::string& state);
void transferFailed();
......@@ -187,7 +188,8 @@ class CallManager
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);
#endif // __ANDROID__
#endif // !HAVE_DBUS
private:
#if HAVE_ZRTP
......
......@@ -169,10 +169,11 @@ class ConfigurationManager
bool checkCertificateValidity(const std::string& pemPath);
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);
// signals must be implemented manually for Android
void accountsChanged();
void historyChanged();
......@@ -184,7 +185,7 @@ class ConfigurationManager
void errorAlert(const int& alert);
std::vector< int32_t > getHardwareAudioFormat();
#endif // __ANDROID__
#endif // !HAVE_DBUS
};
#endif //CONFIGURATIONMANAGER_H
......@@ -76,14 +76,16 @@ class PresenceManager
PresenceManager();
#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 serverError(const std::string& accountID, const std::string& error, const std::string& msg);
void newBuddyNotification(const std::string& accountID, const std::string& buddyUri,
const bool& status, const std::string& lineStatus);
void subscriptionStateChanged(const std::string& accountID, const std::string& buddyUri,
const bool& state);
#endif //__ANDROID__
#endif // !HAVE_DBUS
/* Presence subscription/Notification. */
void publish(const std::string& accountID, const bool& status, const std::string& note);
......
......@@ -60,9 +60,13 @@
#include "video/video_base.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::ObjectAdaptor {
public DBus::ObjectAdaptor
#endif
{
private:
std::shared_ptr<sfl_video::VideoInputSelector> videoInputSelector_;
VideoPreference videoPreference_;
......@@ -70,8 +74,11 @@ class VideoControls : public org::sflphone::SFLphone::VideoControls_adaptor,
int inputClients_; // XXX necessary with the videoInputSelector_?
public:
#if HAVE_DBUS
VideoControls(DBus::Connection& connection);
#else
VideoControls();
#endif
VideoPreference &getVideoPreferences();
std::vector<std::map<std::string, std::string> >
......@@ -131,6 +138,14 @@ class VideoControls : public org::sflphone::SFLphone::VideoControls_adaptor,
bool switchInput(const std::string& resource);
bool hasCameraStarted();
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_
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment