diff --git a/daemon/configure.ac b/daemon/configure.ac index e96903d0087c977449c0131d2452edcf9c12960e..5cad174a72788787589ef1780c31252c5add8690 100644 --- a/daemon/configure.ac +++ b/daemon/configure.ac @@ -139,22 +139,31 @@ dnl Check for the samplerate development package - name: libsamplerate0-dev LIBSAMPLERATE_MIN_VERSION=0.1.2 PKG_CHECK_MODULES(SAMPLERATE, samplerate >= ${LIBSAMPLERATE_MIN_VERSION},, AC_MSG_ERROR([Missing libsamplerate development package: libsamplerate0-dev])) -dnl The libav versions correspond to the last libav release: 0.7 -dnl Check for libavcodec development package - name: libavcodec-dev -PKG_CHECK_MODULES(LIBAVCODEC, libavcodec >= 53.5.0,, AC_MSG_ERROR([Missing libavcodec package: libavcodec-dev])) -LIBAVCODEC_CFLAGS="${LIBAVCODEC_CFLAGS} -D__STDC_CONSTANT_MACROS" +dnl Video is default-enabled +AC_ARG_ENABLE([video], AS_HELP_STRING([--disable-video], [Disable video])) -dnl Check for libavformat development package - name: libavformat-dev -PKG_CHECK_MODULES(LIBAVFORMAT, libavformat >= 53.2.0,, AC_MSG_ERROR([Missing libavformat package: libavformat-dev])) +AS_IF([test "x$enable_video" != "xno"], [ + echo "VIDEO ENABLED"; + AC_DEFINE(SFL_VIDEO, [], [Video support enabled]) -dnl Check for libswscale development package - name: libswcale-dev -PKG_CHECK_MODULES(LIBSWSCALE, libswscale >= 1.1.0,, AC_MSG_ERROR([Missing libswscale package: libswscale-dev])) + dnl The libav versions correspond to the last libav release: 0.7 + dnl Check for libavcodec development package - name: libavcodec-dev + PKG_CHECK_MODULES(LIBAVCODEC, libavcodec >= 53.5.0,, AC_MSG_ERROR([Missing libavcodec package: libavcodec-dev])) + LIBAVCODEC_CFLAGS="${LIBAVCODEC_CFLAGS} -D__STDC_CONSTANT_MACROS" -dnl Check for libavdevice development package - name: libavdevice-dev -PKG_CHECK_MODULES(LIBAVDEVICE, libavdevice >= 53.0.0,, AC_MSG_ERROR([Missing libavdevice package: libavdevice-dev])) + dnl Check for libavformat development package - name: libavformat-dev + PKG_CHECK_MODULES(LIBAVFORMAT, libavformat >= 53.2.0,, AC_MSG_ERROR([Missing libavformat package: libavformat-dev])) -dnl Check for libavutil development package - name: libavutil-dev -PKG_CHECK_MODULES(LIBAVUTIL, libavutil >= 51.7.0,, AC_MSG_ERROR([Missing libavutil package: libavutil-dev])) + dnl Check for libswscale development package - name: libswcale-dev + PKG_CHECK_MODULES(LIBSWSCALE, libswscale >= 1.1.0,, AC_MSG_ERROR([Missing libswscale package: libswscale-dev])) + + dnl Check for libavdevice development package - name: libavdevice-dev + PKG_CHECK_MODULES(LIBAVDEVICE, libavdevice >= 53.0.0,, AC_MSG_ERROR([Missing libavdevice package: libavdevice-dev])) + + dnl Check for libavutil development package - name: libavutil-dev + PKG_CHECK_MODULES(LIBAVUTIL, libavutil >= 51.7.0,, AC_MSG_ERROR([Missing libavutil package: libavutil-dev])) + ]); +AM_CONDITIONAL(SFL_VIDEO, test x"$enable_video" = xyes) LIBCCGNU2_MIN_VERSION=1.3.1 PKG_CHECK_MODULES(CCGNU2, libccgnu2 >= ${LIBCCGNU2_MIN_VERSION},, AC_MSG_ERROR([Missing common cpp development package: libcommoncpp2-dev])) diff --git a/daemon/globals.mak b/daemon/globals.mak index 9b16e56d3d68d4ad6e28a675600bd5a02380a2d4..5397dd6ad731f04d5a5337937ac91f1a4229a24a 100644 --- a/daemon/globals.mak +++ b/daemon/globals.mak @@ -1,7 +1,5 @@ # Global variables -#CXXFLAGS=-Wall -Werror -Wextra - src=$(abs_top_srcdir) sfllibdir=$(DESTDIR)$(libdir)/sflphone sflcodecdir=$(sfllibdir)/codecs diff --git a/daemon/src/Makefile.am b/daemon/src/Makefile.am index 3aebbe46b3a126e7046e6c3ad84757d81dc43f69..619618f3fb0cd2dfc7e6cc2b2def1c299da81c4c 100644 --- a/daemon/src/Makefile.am +++ b/daemon/src/Makefile.am @@ -5,7 +5,10 @@ libexec_PROGRAMS = sflphoned # all: indent -SUBDIRS = dbus audio config hooks history sip iax im video +SUBDIRS = dbus audio config hooks history sip iax im +if SFL_VIDEO +SUBDIRS += video +endif sflphoned_SOURCES = main.cpp @@ -57,11 +60,13 @@ libsflphone_la_LIBADD = \ ./im/libim.la \ ./sip/libsiplink.la \ ./audio/libaudio.la \ - ./video/libvideo.la \ ./dbus/libdbus.la \ ./config/libconfig.la \ ./hooks/libhooks.la \ ./history/libhistory.la +if SFL_VIDEO +libsflphone_la_LIBADD += ./video/libvideo.la +endif libsflphone_la_LDFLAGS = \ @CCGNU2_LIBS@ \ diff --git a/daemon/src/dbus/Makefile.am b/daemon/src/dbus/Makefile.am index f3af972f04edfa38bef84b8ef016173478b63378..5a539257db8f4ada74b44de6ea62e3b1efb83010 100644 --- a/daemon/src/dbus/Makefile.am +++ b/daemon/src/dbus/Makefile.am @@ -7,6 +7,10 @@ BUILT_SOURCES= \ configurationmanager-glue.h \ instance-glue.h +if SFL_VIDEO +BUILT_SOURCES+=video_controls-glue.h +endif + # Rule to generate the binding headers %-glue.h: %-introspec.xml Makefile.am dbusxx-xml2cpp $< --adaptor=$@ @@ -17,6 +21,10 @@ libdbus_la_SOURCES = \ instance.cpp \ dbusmanager.cpp +if SFL_VIDEO +libdbus_la_SOURCES+=video_controls.cpp +endif + if USE_NETWORKMANAGER libdbus_la_SOURCES += networkmanager.cpp NETWORKMANAGER=-DUSE_NETWORKMANAGER @@ -38,6 +46,10 @@ noinst_HEADERS = \ networkmanager.h \ $(BUILT_SOURCES) +if SFL_VIDEO +noinst_HEADERS+=video_controls.h +endif + # Dbus service file servicedir = $(datadir)/dbus-1/services service_in_files = org.sflphone.SFLphone.service.in @@ -53,6 +65,10 @@ EXTRA_DIST = README $(service_in_files) \ instance-introspec.xml \ org.freedesktop.NetworkManager.xml +if SFL_VIDEO +EXTRA_DIST += video_controls-introspec.xml +endif + CLEANFILES= \ $(BUILT_SOURCES) \ org.sflphone.SFLphone.service diff --git a/daemon/src/dbus/callmanager-introspec.xml b/daemon/src/dbus/callmanager-introspec.xml index 4e3e7b970e01e091823eb1b76c35fa899a76ddaf..facefdef5bca701218f1040252ddff7b7198298e 100644 --- a/daemon/src/dbus/callmanager-introspec.xml +++ b/daemon/src/dbus/callmanager-introspec.xml @@ -392,11 +392,6 @@ </arg> </method> - <method name="getCurrentVideoCodecName" tp:name-for-bindings="getCurrentVideoCodecName"> - <arg type="s" name="callID" direction="in"/> - <arg type="s" name="codecName" direction="out"/> - </method> - <method name="getCurrentAudioCodecName" tp:name-for-bindings="getCurrentAudioCodecName"> <arg type="s" name="callID" direction="in"/> <arg type="s" name="codecName" direction="out"/> @@ -786,25 +781,5 @@ <arg type="s" name="callID" direction="in"/> <arg type="b" name="yesNo" direction="in"/> </method> - - <signal name="receivingVideoEvent" tp:name-for-bindings="receivingVideoEvent"> - <arg type="i" name="shmKey"> - </arg> - <arg type="i" name="semKey"> - </arg> - <arg type="i" name="videoBufferSize"> - </arg> - <arg type="i" name="destWidth"> - </arg> - <arg type="i" name="destHeight"> - </arg> - </signal> - - <signal name="stoppedReceivingVideoEvent" tp:name-for-bindings="stoppedReceivingVideoEvent"> - <arg type="i" name="shmKey"> - </arg> - <arg type="i" name="semKey"> - </arg> - </signal> </interface> </node> diff --git a/daemon/src/dbus/callmanager.cpp b/daemon/src/dbus/callmanager.cpp index 51678478061fc8982971e6e1c2e5657bdd3be94a..6015888a66cc1fa35b6d9c688b4b1c9fdfa4261e 100644 --- a/daemon/src/dbus/callmanager.cpp +++ b/daemon/src/dbus/callmanager.cpp @@ -242,13 +242,6 @@ std::string CallManager::getCurrentAudioCodecName(const std::string& callID) return Manager::instance().getCurrentCodecName(callID).c_str(); } -std::string -CallManager::getCurrentVideoCodecName (const std::string& callID) -{ - return Manager::instance().getCurrentVideoCodecName (callID).c_str(); -} - - std::map<std::string, std::string> CallManager::getCallDetails(const std::string& callID) { @@ -336,12 +329,10 @@ CallManager::setConfirmGoClear(const std::string& callID) sfl::AudioZrtpSession * zSession; zSession = getAudioZrtpSession(callID); zSession->goClearOk(); - } catch (...) { - } + } catch (...) {} } -void -CallManager::requestGoClear(const std::string& callID) +void CallManager::requestGoClear(const std::string& callID) { try { sfl::AudioZrtpSession * zSession; diff --git a/daemon/src/dbus/callmanager.h b/daemon/src/dbus/callmanager.h index 03c99489fe294c34cea1871d9145912361a6de7d..e5f11d6512e02aed7015a36443ca6f6359a938e8 100644 --- a/daemon/src/dbus/callmanager.h +++ b/daemon/src/dbus/callmanager.h @@ -111,7 +111,6 @@ class CallManager void setRecording(const std::string& callID); bool getIsRecording(const std::string& callID); std::string getCurrentAudioCodecName(const std::string& callID); - std::string getCurrentVideoCodecName(const std::string& callID); void playDTMF(const std::string& key); void startTone(const int32_t& start, const int32_t& type); diff --git a/daemon/src/dbus/configurationmanager-introspec.xml b/daemon/src/dbus/configurationmanager-introspec.xml index 2b677a1babc524ce792d694480fd837aac1e1fe0..ef389605fdc00d59d93b21e370fb6aa60437a4f0 100644 --- a/daemon/src/dbus/configurationmanager-introspec.xml +++ b/daemon/src/dbus/configurationmanager-introspec.xml @@ -271,87 +271,6 @@ </arg> </method> - - <!-- Video devices methods --> - - <method name="getVideoInputDeviceList" tp:name-for-bindings="getVideoInputDeviceList"> - <annotation name="com.trolltech.QtDBus.QtTypeName.Out0" value="VectorString"/> - <arg type="as" name="list" direction="out"> - </arg> - </method> - - <method name="getVideoInputDeviceChannelList" tp:name-for-bindings="getVideoInputDeviceChannelList"> - <annotation name="com.trolltech.QtDBus.QtTypeName.Out0" value="VectorString"/> - <arg type="s" name="device" direction="in"> - </arg> - <arg type="as" name="list" direction="out"> - </arg> - </method> - - <method name="getVideoInputDeviceSizeList" tp:name-for-bindings="getVideoInputDeviceSizeList"> - <annotation name="com.trolltech.QtDBus.QtTypeName.Out0" value="VectorString"/> - <arg type="s" name="device" direction="in"> - </arg> - <arg type="s" name="channel" direction="in"> - </arg> - <arg type="as" name="list" direction="out"> - </arg> - </method> - - <method name="getVideoInputDeviceRateList" tp:name-for-bindings="getVideoInputDeviceRateList"> - <annotation name="com.trolltech.QtDBus.QtTypeName.Out0" value="VectorString"/> - <arg type="s" name="device" direction="in"> - </arg> - <arg type="s" name="channel" direction="in"> - </arg> - <arg type="s" name="size" direction="in"> - </arg> - <arg type="as" name="list" direction="out"> - </arg> - </method> - - <method name="getVideoInputDevice" tp:name-for-bindings="getVideoInputDevice"> - <arg type="s" name="device" direction="out"> - </arg> - </method> - - <method name="getVideoInputDeviceChannel" tp:name-for-bindings="getVideoInputDeviceChannel"> - <arg type="s" name="channel" direction="out"> - </arg> - </method> - - <method name="getVideoInputDeviceSize" tp:name-for-bindings="getVideoInputDeviceSize"> - <arg type="s" name="size" direction="out"> - </arg> - </method> - - <method name="getVideoInputDeviceRate" tp:name-for-bindings="getVideoInputDeviceRate"> - <arg type="s" name="rate" direction="out"> - </arg> - </method> - - <method name="setVideoInputDevice" tp:name-for-bindings="setVideoInputDevice"> - <arg type="s" name="device" direction="in"> - </arg> - </method> - - <method name="setVideoInputDeviceChannel" tp:name-for-bindings="setVideoInputDeviceChannel"> - <arg type="s" name="channel" direction="in"> - </arg> - </method> - - <method name="setVideoInputDeviceSize" tp:name-for-bindings="setVideoInputDeviceSize"> - <arg type="s" name="size" direction="in"> - </arg> - </method> - - <method name="setVideoInputDeviceRate" tp:name-for-bindings="setVideoInputDeviceRate"> - <arg type="s" name="rate" direction="in"> - </arg> - </method> - - <!-- /////////////////////// --> - <!-- Audio devices methods --> <method name="getAudioPluginList" tp:name-for-bindings="getAudioPluginList"> @@ -441,45 +360,8 @@ </arg> </method> - - <!-- /////////////////////// --> - - <!-- Video Codecs-related methods --> - - <method name="getVideoCodecList" tp:name-for-bindings="getVideoCodecList"> - <annotation name="com.trolltech.QtDBus.QtTypeName.Out0" value="VectorString"/> - <arg type="as" name="list" direction="out"> - </arg> - </method> - - <method name="getVideoCodecDetails" tp:name-for-bindings="getVideoCodecDetails"> - <arg type="s" name="codec" direction="in"> - </arg> - <annotation name="com.trolltech.QtDBus.QtTypeName.Out0" value="VectorString"/> - <arg type="as" name="details" direction="out"> - </arg> - </method> - - <method name="getActiveVideoCodecList" tp:name-for-bindings="getActiveVideoCodecList"> - <annotation name="com.trolltech.QtDBus.QtTypeName.Out0" value="VectorString"/> - <arg type="s" name="accountID" direction="in"> - </arg> - <arg type="as" name="list" direction="out"> - </arg> - </method> - - <method name="setActiveVideoCodecList" tp:name-for-bindings="setActiveVideoCodecList"> - <annotation name="com.trolltech.QtDBus.QtTypeName.In0" value="VectorString"/> - <arg type="as" name="list" direction="in"> - </arg> - <arg type="s" name="accountID" direction="in"> - </arg> - </method> - - <!-- General Settings Panel --> - <method name="getNoiseSuppressState" tp:name-for-bindings="getEchoCancelState"> <arg type="s" name="state" direction="out"> </arg> @@ -627,25 +509,5 @@ <arg type="a{ss}" name="shortcutsMap" direction="in"> </arg> </method> - - <method name="startVideoPreview" tp:name-for-bindings="startVideoPreview"> - <arg type="i" name="width" direction="out"> - </arg> - <arg type="i" name="height" direction="out"> - </arg> - <arg type="i" name="shmKey" direction="out"> - </arg> - <arg type="i" name="semKey" direction="out"> - </arg> - <arg type="i" name="videoBufferSize" direction="out"> - </arg> - </method> - - <method name="stopVideoPreview" tp:name-for-bindings="stopVideoPreview"> - </method> - - <signal name="videoDeviceEvent" tp:name-for-bindings="videoDeviceEvent"> - </signal> - </interface> </node> diff --git a/daemon/src/dbus/configurationmanager.cpp b/daemon/src/dbus/configurationmanager.cpp index 010933993cd1b4ee23a45f29c10b0e86d1fc9bc8..a749e01eeab9515b8a1340deebd20e8418faca60 100644 --- a/daemon/src/dbus/configurationmanager.cpp +++ b/daemon/src/dbus/configurationmanager.cpp @@ -39,14 +39,12 @@ #include "sip/sipvoiplink.h" #include "account.h" #include "sip/sipaccount.h" -#include "video/video_endpoint.h" -#include "video/video_preview.h" const char* ConfigurationManager::SERVER_PATH = "/org/sflphone/SFLphone/ConfigurationManager"; ConfigurationManager::ConfigurationManager(DBus::Connection& connection) : - DBus::ObjectAdaptor(connection, SERVER_PATH), preview_() + DBus::ObjectAdaptor(connection, SERVER_PATH) {} std::map<std::string, std::string> ConfigurationManager::getIp2IpDetails() @@ -167,15 +165,6 @@ std::vector<int32_t> ConfigurationManager::getAudioCodecList() return list; } -/** - * Send the list of all codecs loaded to the client through DBus. - * Can stay global, as only the active codecs will be set per accounts - */ -std::vector<std::string> ConfigurationManager::getVideoCodecList() -{ - return sfl_video::getVideoCodecList(); -} - std::vector<std::string> ConfigurationManager::getSupportedTlsMethod() { std::vector<std::string> method; @@ -196,11 +185,6 @@ std::vector<std::string> ConfigurationManager::getAudioCodecDetails(const int32_ return result; } -std::vector<std::string> ConfigurationManager::getVideoCodecDetails(const std::string& codec) -{ - return sfl_video::getCodecSpecifications(codec); -} - std::vector<int32_t> ConfigurationManager::getActiveAudioCodecList(const std::string& accountID) { std::vector<int32_t> v; @@ -223,33 +207,6 @@ void ConfigurationManager::setActiveAudioCodecList(const std::vector<std::string } } -std::vector<std::string> ConfigurationManager::getActiveVideoCodecList ( - const std::string& accountID) -{ - std::vector<std::string> v; - Account *acc = Manager::instance().getAccount (accountID); - - if (acc != NULL) { - v = acc->getActiveVideoCodecs(); - } - - return v; - -} - -void ConfigurationManager::setActiveVideoCodecList ( - const std::vector<std::string>& list, const std::string& accountID) -{ - Account *acc = Manager::instance().getAccount (accountID); - - if (acc != NULL) { - acc->setActiveVideoCodecs (list); - } - - Manager::instance().saveConfig(); -} - - std::vector<std::string> ConfigurationManager::getAudioPluginList() { std::vector<std::string> v; @@ -260,7 +217,6 @@ std::vector<std::string> ConfigurationManager::getAudioPluginList() return v; } - void ConfigurationManager::setAudioPlugin(const std::string& audioPlugin) { return Manager::instance().setAudioPlugin(audioPlugin); @@ -348,66 +304,6 @@ void ConfigurationManager::setEchoCancelDelay(const int32_t& delay) Manager::instance().setEchoCancelDelay(delay); } -std::vector<std::string> ConfigurationManager::getVideoInputDeviceList() -{ - return Manager::instance().getVideoInputDeviceList(); -} - -std::vector<std::string> ConfigurationManager::getVideoInputDeviceChannelList(const std::string &dev) -{ - return Manager::instance().getVideoInputDeviceChannelList(dev); -} - -std::vector<std::string> ConfigurationManager::getVideoInputDeviceSizeList(const std::string &dev, const std::string &channel) -{ - return Manager::instance().getVideoInputDeviceSizeList(dev, channel); -} - -std::vector<std::string> ConfigurationManager::getVideoInputDeviceRateList(const std::string &dev, const std::string &channel, const std::string &size) -{ - return Manager::instance().getVideoInputDeviceRateList(dev, channel, size); -} - -std::string ConfigurationManager::getVideoInputDevice() -{ - return Manager::instance().getVideoInputDevice(); -} - -std::string ConfigurationManager::getVideoInputDeviceChannel() -{ - return Manager::instance().getVideoInputDeviceChannel(); -} - -std::string ConfigurationManager::getVideoInputDeviceSize() -{ - return Manager::instance().getVideoInputDeviceSize(); -} - -std::string ConfigurationManager::getVideoInputDeviceRate() -{ - return Manager::instance().getVideoInputDeviceRate(); -} - -void ConfigurationManager::setVideoInputDevice(const std::string& api) -{ - Manager::instance().setVideoInputDevice(api); -} - -void ConfigurationManager::setVideoInputDeviceChannel(const std::string& api) -{ - Manager::instance().setVideoInputDeviceChannel(api); -} - -void ConfigurationManager::setVideoInputDeviceSize(const std::string& api) -{ - Manager::instance().setVideoInputDeviceSize(api); -} - -void ConfigurationManager::setVideoInputDeviceRate(const std::string& api) -{ - Manager::instance().setVideoInputDeviceRate(api); -} - int32_t ConfigurationManager::isIax2Enabled() { return HAVE_IAX; @@ -560,36 +456,3 @@ void ConfigurationManager::setCredentials(const std::string& accountID, sipaccount->setCredentials(details); } } - -void ConfigurationManager::startVideoPreview(int32_t &width, int32_t &height, int32_t &shmKey, int32_t &semKey, int32_t &videoBufferSize) -{ - if (preview_.get()) { - ERROR("Video preview was already started!"); - shmKey = -1; - semKey = -1; - videoBufferSize = -1; - return; - } - - using std::map; - using std::string; - - map<string, string> args(Manager::instance().videoPreference.getVideoSettings()); - preview_.reset(new sfl_video::VideoPreview(args)); - preview_->start(); - - width = atoi(args["width"].c_str()); - height = atoi(args["height"].c_str()); - shmKey = preview_->getShmKey(); - semKey = preview_->getSemKey(); - videoBufferSize = preview_->getVideoBufferSize(); -} - -void ConfigurationManager::stopVideoPreview() -{ - if (preview_.get()) { - DEBUG("Stopping video preview"); - preview_->stop(); - preview_.reset(); - } -} diff --git a/daemon/src/dbus/configurationmanager.h b/daemon/src/dbus/configurationmanager.h index c15694ba8f5230f4d81798f364b13a093a166cd5..520117150b605c1cb8810b45c8b16e443e793b4c 100644 --- a/daemon/src/dbus/configurationmanager.h +++ b/daemon/src/dbus/configurationmanager.h @@ -52,20 +52,10 @@ #include "dbus_cpp.h" -#include <tr1/memory> // for shared_ptr - -namespace sfl_video { - class VideoPreview; -} - class ConfigurationManager : public org::sflphone::SFLphone::ConfigurationManager_adaptor, public DBus::IntrospectableAdaptor, public DBus::ObjectAdaptor { - private: - // FIXME: this probably shouldn't live here - std::tr1::shared_ptr<sfl_video::VideoPreview> preview_; - public: ConfigurationManager(DBus::Connection& connection); @@ -82,15 +72,11 @@ class ConfigurationManager std::map< std::string, std::string > getTlsSettingsDefault(); std::vector< int32_t > getAudioCodecList(); - std::vector< std::string > getVideoCodecList(); std::vector< std::string > getSupportedTlsMethod(); std::vector< std::string > getAudioCodecDetails(const int32_t& payload); - std::vector< std::string > getVideoCodecDetails(const std::string& payload); std::vector< int32_t > getActiveAudioCodecList(const std::string& accountID); void setActiveAudioCodecList(const std::vector< std::string >& list, const std::string& accountID); - std::vector<std::string> getActiveVideoCodecList(const std::string& accountID); - void setActiveVideoCodecList (const std::vector<std::string>& list, const std::string& accountID); std::vector< std::string > getAudioPluginList(); void setAudioPlugin(const std::string& audioPlugin); @@ -111,19 +97,6 @@ class ConfigurationManager void setEchoCancelDelay(const int32_t& length); int getEchoCancelDelay(); - std::vector<std::string> getVideoInputDeviceList(); - std::vector<std::string> getVideoInputDeviceChannelList(const std::string &dev); - std::vector<std::string> getVideoInputDeviceSizeList(const std::string &dev, const std::string &channel); - std::vector<std::string> getVideoInputDeviceRateList(const std::string &dev, const std::string &channel, const std::string &size); - void setVideoInputDevice(const std::string& api); - void setVideoInputDeviceChannel(const std::string& api); - void setVideoInputDeviceSize(const std::string& api); - void setVideoInputDeviceRate(const std::string& api); - std::string getVideoInputDevice(); - std::string getVideoInputDeviceChannel(); - std::string getVideoInputDeviceSize(); - std::string getVideoInputDeviceRate(); - std::string getAudioManager(); void setAudioManager(const std::string& api); @@ -167,10 +140,7 @@ class ConfigurationManager std::map<std::string, std::string> getShortcuts(); void setShortcuts(const std::map<std::string, std::string> &shortcutsMap); - - void startVideoPreview(int32_t &width, int32_t &height, int32_t &shmKey, int32_t &semKey, int32_t &videoBufferSize); - void stopVideoPreview(); }; -#endif//CONFIGURATIONMANAGER_H +#endif //CONFIGURATIONMANAGER_H diff --git a/daemon/src/dbus/dbusmanager.cpp b/daemon/src/dbus/dbusmanager.cpp index 5d273fab9064575af63c625cedee100725088c09..35ae0384d9d65a64f1f23670564992c1cc003892 100644 --- a/daemon/src/dbus/dbusmanager.cpp +++ b/daemon/src/dbus/dbusmanager.cpp @@ -42,7 +42,10 @@ DBusManager::DBusManager() : callManager_(0) , configurationManager_(0) , instanceManager_(0) , dispatcher_() -#if USE_NETWORKMANAGER +#ifdef SFL_VIDEO + , videoControls_(0) +#endif +#ifdef USE_NETWORKMANAGER , networkManager_(0) #endif { @@ -57,6 +60,10 @@ DBusManager::DBusManager() : callManager_(0) configurationManager_ = new ConfigurationManager(sessionConnection); instanceManager_ = new Instance(sessionConnection); +#ifdef SFL_VIDEO + videoControls_ = new VideoControls(sessionConnection); +#endif + #ifdef USE_NETWORKMANAGER DBus::Connection systemConnection = DBus::Connection::SystemBus(); networkManager_ = new NetworkManager(systemConnection, "/org/freedesktop/NetworkManager", ""); @@ -72,6 +79,9 @@ DBusManager::~DBusManager() { #ifdef USE_NETWORKMANAGER delete networkManager_; +#endif +#ifdef SFL_VIDEO + delete videoControls_; #endif delete instanceManager_; delete configurationManager_; @@ -83,8 +93,7 @@ void DBusManager::exec() dispatcher_.enter(); } -void -DBusManager::exit() +void DBusManager::exit() { dispatcher_.leave(); } diff --git a/daemon/src/dbus/dbusmanager.h b/daemon/src/dbus/dbusmanager.h index f471f3b0fb0eff174a8844cbb23f2f46dcc2b8d8..3351027edc7c5d72ebf02f2fa02c78b209650958 100644 --- a/daemon/src/dbus/dbusmanager.h +++ b/daemon/src/dbus/dbusmanager.h @@ -60,6 +60,9 @@ class DBusManager { ConfigurationManager* configurationManager_; Instance* instanceManager_; DBus::BusDispatcher dispatcher_; +#ifdef SFL_VIDEO + VideoControls *videoControls_; +#endif #if USE_NETWORKMANAGER NetworkManager* networkManager_; #endif diff --git a/daemon/src/dbus/video_controls.cpp b/daemon/src/dbus/video_controls.cpp new file mode 100644 index 0000000000000000000000000000000000000000..2fc3385966a5685b141c6ee13e3c2fb1f5a7c4ea --- /dev/null +++ b/daemon/src/dbus/video_controls.cpp @@ -0,0 +1,177 @@ +/* + * Copyright (C) 2004, 2005, 2006, 2008, 2009, 2010, 2011 Savoir-Faire Linux Inc. + * Author: Pierre-Luc Beaudoin <pierre-luc.beaudoin@savoirfairelinux.com> + * Author: Emmanuel Milou <emmanuel.milou@savoirfairelinux.com> + * Author: Guillaume Carmel-Archambault <guillaume.carmel-archambault@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. + * + * Additional permission under GNU GPL version 3 section 7: + * + * If you modify this program, or any covered work, by linking or + * combining it with the OpenSSL project's OpenSSL library (or a + * modified version of that library), containing parts covered by the + * terms of the OpenSSL or SSLeay licenses, Savoir-Faire Linux Inc. + * grants you additional permission to convey the resulting work. + * Corresponding Source for a non-source form of such a combination + * shall include the source code for the parts of OpenSSL used as well + * as that of the covered work. + */ + +#include "video_controls.h" +#include "video/libav_utils.h" +#include "video/video_endpoint.h" +#include "video/video_preview.h" + +const char* VideoControls::SERVER_PATH = "/org/sflphone/SFLphone/VideoControls"; + +VideoControls::VideoControls(DBus::Connection& connection) : + DBus::ObjectAdaptor(connection, SERVER_PATH), preview_() +{ + // initialize libav libraries + libav_utils::sfl_avcodec_init(); +} + +/** + * Send the list of all codecs loaded to the client through DBus. + * Can stay global, as only the active codecs will be set per accounts + */ +std::vector<std::string> VideoControls::getCodecList() +{ + return sfl_video::getCodecList(); +} + +std::vector<std::string> VideoControls::getCodecDetails(const std::string& codec) +{ + return sfl_video::getCodecSpecifications(codec); +} + +std::vector<std::string> +VideoControls::getActiveCodecList(const std::string& accountID) +{ + std::vector<std::string> v; + Account *acc = Manager::instance().getAccount(accountID); + + if (acc != NULL) + v = acc->getActiveCodecs(); + + return v; + +} + +void +VideoControls::setActiveCodecList(const std::vector<std::string>& list, const std::string& accountID) +{ + Account *acc = Manager::instance().getAccount(accountID); + + if (acc != NULL) + acc->setActiveCodecs(list); + + Manager::instance().saveConfig(); +} + +std::vector<std::string> VideoControls::getInputDeviceList() +{ + return videoPreference_.getDeviceList(); +} + +std::vector<std::string> VideoControls::getInputDeviceChannelList(const std::string &dev) +{ + return videoPreference_.getChannelList(dev); +} + +std::vector<std::string> VideoControls::getInputDeviceSizeList(const std::string &dev, const std::string &channel) +{ + return videoPreference_.getSizeList(dev, channel); +} + +std::vector<std::string> +VideoControls::getInputDeviceRateList(const std::string &dev, const std::string &channel, const std::string &size) +{ + return videoPreference_.getRateList(dev, channel, size); +} + +std::string VideoControls::getInputDevice() +{ + return videoPreference_.getDevice(); +} + +std::string VideoControls::getInputDeviceChannel() +{ + return videoPreference_.getChannel(); +} + +std::string VideoControls::getInputDeviceSize() +{ + return videoPreference_.getSize(); +} + +std::string VideoControls::getInputDeviceRate() +{ + return videoPreference_.getRate(); +} + +void VideoControls::setVideoInputDevice(const std::string& api) +{ + videoPreference_.setDevice(api); +} + +void VideoControls::setVideoInputDeviceChannel(const std::string& api) +{ + videoPreference_.setChannel(api); +} + +void VideoControls::setVideoInputDeviceSize(const std::string& api) +{ + videoPreference_.setSize(api); +} + +void VideoControls::setVideoInputDeviceRate(const std::string& api) +{ + videoPreference_.setRate(api); +} + +void VideoControls::startVideoPreview(int32_t &width, int32_t &height, int32_t &shmKey, int32_t &semKey, int32_t &videoBufferSize) +{ + if (preview_.get()) { + ERROR("Video preview was already started!"); + shmKey = -1; + semKey = -1; + videoBufferSize = -1; + return; + } + + using std::map; + using std::string; + + map<string, string> args(Manager::instance().videoPreference.getVideoSettings()); + preview_.reset(new sfl_video::VideoPreview(args)); + preview_->start(); + + width = atoi(args["width"].c_str()); + height = atoi(args["height"].c_str()); + shmKey = preview_->getShmKey(); + semKey = preview_->getSemKey(); + videoBufferSize = preview_->getVideoBufferSize(); +} + +void VideoControls::stopVideoPreview() +{ + if (preview_.get()) { + DEBUG("Stopping video preview"); + preview_->stop(); + preview_.reset(); + } +} diff --git a/daemon/src/dbus/video_controls.h b/daemon/src/dbus/video_controls.h new file mode 100644 index 0000000000000000000000000000000000000000..c5bb7793720d66c6172a398cf1a47dd3d04cad53 --- /dev/null +++ b/daemon/src/dbus/video_controls.h @@ -0,0 +1,78 @@ +/* + * Copyright (C) 2012 Savoir-Faire Linux Inc. + * + * 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. + * + * Additional permission under GNU GPL version 3 section 7: + * + * If you modify this program, or any covered work, by linking or + * combining it with the OpenSSL project's OpenSSL library (or a + * modified version of that library), containing parts covered by the + * terms of the OpenSSL or SSLeay licenses, Savoir-Faire Linux Inc. + * grants you additional permission to convey the resulting work. + * Corresponding Source for a non-source form of such a combination + * shall include the source code for the parts of OpenSSL used as well + * as that of the covered work. + */ + +#ifndef VIDEO_CONTROLS_H_ +#define VIDEO_CONTROLS_H_ + +#include "dbus_cpp.h" + +#include <tr1/memory> // for shared_ptr + +namespace sfl_video { + class VideoPreview; +} + +class VideoControls + : public org::sflphone::SFLphone::ConfigurationManager_adaptor, + public DBus::IntrospectableAdaptor, + public DBus::ObjectAdaptor { + private: + std::tr1::shared_ptr<sfl_video::VideoPreview> preview_; + VideoPreference videoPreference; + + public: + + VideoControls(DBus::Connection& connection); + static const char* SERVER_PATH; + + std::vector< std::string > getVideoCodecList(); + std::vector< std::string > getVideoCodecDetails(const std::string& payload); + std::vector<std::string> getActiveVideoCodecList(const std::string& accountID); + void setActiveVideoCodecList(const std::vector<std::string>& list, const std::string& accountID); + + std::vector<std::string> getVideoInputDeviceList(); + std::vector<std::string> getVideoInputDeviceChannelList(const std::string &dev); + std::vector<std::string> getVideoInputDeviceSizeList(const std::string &dev, const std::string &channel); + std::vector<std::string> getVideoInputDeviceRateList(const std::string &dev, const std::string &channel, const std::string &size); + void setVideoInputDevice(const std::string& api); + void setVideoInputDeviceChannel(const std::string& api); + void setVideoInputDeviceSize(const std::string& api); + void setVideoInputDeviceRate(const std::string& api); + std::string getVideoInputDevice(); + std::string getVideoInputDeviceChannel(); + std::string getVideoInputDeviceSize(); + std::string getVideoInputDeviceRate(); + + void startVideoPreview(int32_t &width, int32_t &height, int32_t &shmKey, int32_t &semKey, int32_t &videoBufferSize); + void stopVideoPreview(); + std::string getCurrentVideoCodecName(const std::string& callID); +}; + +#endif // VIDEO_CONTROLS_H_ + diff --git a/daemon/src/dbus/video_controls.xml b/daemon/src/dbus/video_controls.xml new file mode 100644 index 0000000000000000000000000000000000000000..7fcd2cf60f3fcfb6ac65d00c0aa23e50e5cae6cf --- /dev/null +++ b/daemon/src/dbus/video_controls.xml @@ -0,0 +1,158 @@ +<?xml version="1.0" ?> +<node name="/video_controls-introspec" xmlns:tp="http://telepathy.freedesktop.org/wiki/DbusSpec#extensions-v0"> + <interface name="org.sflphone.SFLphone.VideoControls"> + <!-- Video device methods --> + + <method name="getVideoInputDeviceList" tp:name-for-bindings="getVideoInputDeviceList"> + <annotation name="com.trolltech.QtDBus.QtTypeName.Out0" value="VectorString"/> + <arg type="as" name="list" direction="out"> + </arg> + </method> + + <method name="getVideoInputDeviceChannelList" tp:name-for-bindings="getVideoInputDeviceChannelList"> + <annotation name="com.trolltech.QtDBus.QtTypeName.Out0" value="VectorString"/> + <arg type="s" name="device" direction="in"> + </arg> + <arg type="as" name="list" direction="out"> + </arg> + </method> + + <method name="getVideoInputDeviceSizeList" tp:name-for-bindings="getVideoInputDeviceSizeList"> + <annotation name="com.trolltech.QtDBus.QtTypeName.Out0" value="VectorString"/> + <arg type="s" name="device" direction="in"> + </arg> + <arg type="s" name="channel" direction="in"> + </arg> + <arg type="as" name="list" direction="out"> + </arg> + </method> + + <method name="getVideoInputDeviceRateList" tp:name-for-bindings="getVideoInputDeviceRateList"> + <annotation name="com.trolltech.QtDBus.QtTypeName.Out0" value="VectorString"/> + <arg type="s" name="device" direction="in"> + </arg> + <arg type="s" name="channel" direction="in"> + </arg> + <arg type="s" name="size" direction="in"> + </arg> + <arg type="as" name="list" direction="out"> + </arg> + </method> + + <method name="getVideoInputDevice" tp:name-for-bindings="getVideoInputDevice"> + <arg type="s" name="device" direction="out"> + </arg> + </method> + + <method name="getVideoInputDeviceChannel" tp:name-for-bindings="getVideoInputDeviceChannel"> + <arg type="s" name="channel" direction="out"> + </arg> + </method> + + <method name="getVideoInputDeviceSize" tp:name-for-bindings="getVideoInputDeviceSize"> + <arg type="s" name="size" direction="out"> + </arg> + </method> + + <method name="getVideoInputDeviceRate" tp:name-for-bindings="getVideoInputDeviceRate"> + <arg type="s" name="rate" direction="out"> + </arg> + </method> + + <method name="setVideoInputDevice" tp:name-for-bindings="setVideoInputDevice"> + <arg type="s" name="device" direction="in"> + </arg> + </method> + + <method name="setVideoInputDeviceChannel" tp:name-for-bindings="setVideoInputDeviceChannel"> + <arg type="s" name="channel" direction="in"> + </arg> + </method> + + <method name="setVideoInputDeviceSize" tp:name-for-bindings="setVideoInputDeviceSize"> + <arg type="s" name="size" direction="in"> + </arg> + </method> + + <method name="setVideoInputDeviceRate" tp:name-for-bindings="setVideoInputDeviceRate"> + <arg type="s" name="rate" direction="in"> + </arg> + </method> + + <!-- Video Codec related methods --> + + <method name="getVideoCodecList" tp:name-for-bindings="getVideoCodecList"> + <annotation name="com.trolltech.QtDBus.QtTypeName.Out0" value="VectorString"/> + <arg type="as" name="list" direction="out"> + </arg> + </method> + + <method name="getVideoCodecDetails" tp:name-for-bindings="getVideoCodecDetails"> + <arg type="s" name="codec" direction="in"> + </arg> + <annotation name="com.trolltech.QtDBus.QtTypeName.Out0" value="VectorString"/> + <arg type="as" name="details" direction="out"> + </arg> + </method> + + <method name="getActiveVideoCodecList" tp:name-for-bindings="getActiveVideoCodecList"> + <annotation name="com.trolltech.QtDBus.QtTypeName.Out0" value="VectorString"/> + <arg type="s" name="accountID" direction="in"> + </arg> + <arg type="as" name="list" direction="out"> + </arg> + </method> + + <method name="setActiveVideoCodecList" tp:name-for-bindings="setActiveVideoCodecList"> + <annotation name="com.trolltech.QtDBus.QtTypeName.In0" value="VectorString"/> + <arg type="as" name="list" direction="in"> + </arg> + <arg type="s" name="accountID" direction="in"> + </arg> + </method> + + <method name="startVideoPreview" tp:name-for-bindings="startVideoPreview"> + <arg type="i" name="width" direction="out"> + </arg> + <arg type="i" name="height" direction="out"> + </arg> + <arg type="i" name="shmKey" direction="out"> + </arg> + <arg type="i" name="semKey" direction="out"> + </arg> + <arg type="i" name="videoBufferSize" direction="out"> + </arg> + </method> + + <method name="stopVideoPreview" tp:name-for-bindings="stopVideoPreview"> + </method> + + <signal name="videoDeviceEvent" tp:name-for-bindings="videoDeviceEvent"> + </signal> + + <method name="getCurrentVideoCodecName" tp:name-for-bindings="getCurrentVideoCodecName"> + <arg type="s" name="callID" direction="in"/> + <arg type="s" name="codecName" direction="out"/> + </method> + + <signal name="receivingVideoEvent" tp:name-for-bindings="receivingVideoEvent"> + <arg type="i" name="shmKey"> + </arg> + <arg type="i" name="semKey"> + </arg> + <arg type="i" name="videoBufferSize"> + </arg> + <arg type="i" name="destWidth"> + </arg> + <arg type="i" name="destHeight"> + </arg> + </signal> + + <signal name="stoppedReceivingVideoEvent" tp:name-for-bindings="stoppedReceivingVideoEvent"> + <arg type="i" name="shmKey"> + </arg> + <arg type="i" name="semKey"> + </arg> + </signal> + </interface> +</node> diff --git a/daemon/src/managerimpl.cpp b/daemon/src/managerimpl.cpp index 24876415800a486e516d454d7d9a1e9b7c498783..a6040f111d648dbadd6ede0ab21433cfd13b2d9e 100644 --- a/daemon/src/managerimpl.cpp +++ b/daemon/src/managerimpl.cpp @@ -58,8 +58,6 @@ #include "conference.h" -#include "video/libav_utils.h" - #include <cerrno> #include <ctime> #include <cstdlib> @@ -72,7 +70,7 @@ ManagerImpl::ManagerImpl() : preferences(), voipPreferences(), addressbookPreference(), - hookPreference(), audioPreference(), videoPreference(), shortcutPreferences(), + hookPreference(), audioPreference(), shortcutPreferences(), hasTriedToRegister_(false), audioCodecFactory(), dbus_(), config_(), currentCallId_(), currentCallMutex_(), audiodriver_(0), dtmfKey_(0), toneMutex_(), telephoneTone_(0), audiofile_(0), speakerVolume_(0), micVolume_(0), @@ -84,9 +82,6 @@ ManagerImpl::ManagerImpl() : { // initialize random generator for call id srand(time(NULL)); - - // initialize libav libraries - libav_utils::sfl_avcodec_init(); } // never call if we use only the singleton... @@ -1875,22 +1870,6 @@ std::string ManagerImpl::serialize(const std::vector<std::string> &v) return os.str(); } -std::string ManagerImpl::getCurrentVideoCodecName(const std::string& id) -{ - std::string accountid(getAccountFromCall(id)); - VoIPLink* link = getAccountLink (accountid); - Call* call = link->getCall (id); - std::string codecName; - - if (call) { - Call::CallState state = call->getState(); - if (state == Call::ACTIVE or state == Call::CONFERENCING) - codecName = link->getCurrentVideoCodecName(id); - } - - return codecName; -} - std::string ManagerImpl::getCurrentCodecName(const std::string& id) { std::string accountid = getAccountFromCall(id); @@ -2031,66 +2010,6 @@ std::vector<std::string> ManagerImpl::getCurrentAudioDevicesIndex() return v; } -std::vector<std::string> ManagerImpl::getVideoInputDeviceList() -{ - return videoPreference.getDeviceList(); -} - -std::vector<std::string> ManagerImpl::getVideoInputDeviceChannelList(const std::string &dev) -{ - return videoPreference.getChannelList(dev); -} - -std::vector<std::string> ManagerImpl::getVideoInputDeviceSizeList(const std::string &dev, const std::string &channel) -{ - return videoPreference.getSizeList(dev, channel); -} - -std::vector<std::string> ManagerImpl::getVideoInputDeviceRateList(const std::string &dev, const std::string &channel, const std::string &size) -{ - return videoPreference.getRateList(dev, channel, size); -} - -std::string ManagerImpl::getVideoInputDevice() -{ - return videoPreference.getDevice(); -} - -std::string ManagerImpl::getVideoInputDeviceChannel() -{ - return videoPreference.getChannel(); -} - -std::string ManagerImpl::getVideoInputDeviceSize() -{ - return videoPreference.getSize(); -} - -std::string ManagerImpl::getVideoInputDeviceRate() -{ - return videoPreference.getRate(); -} - -void ManagerImpl::setVideoInputDevice(const std::string& api) -{ - videoPreference.setDevice(api); -} - -void ManagerImpl::setVideoInputDeviceChannel(const std::string& api) -{ - videoPreference.setChannel(api); -} - -void ManagerImpl::setVideoInputDeviceSize(const std::string& api) -{ - videoPreference.setSize(api); -} - -void ManagerImpl::setVideoInputDeviceRate(const std::string& api) -{ - videoPreference.setRate(api); -} - int ManagerImpl::isRingtoneEnabled(const std::string& id) { Account *account = getAccount(id); @@ -2755,7 +2674,6 @@ void ManagerImpl::loadAccountMap(Conf::YamlParser *parser) addressbookPreference.unserialize(parser->getAddressbookNode()); hookPreference.unserialize(parser->getHookNode()); audioPreference.unserialize(parser->getAudioNode()); - videoPreference.unserialize(parser->getVideoNode()); shortcutPreferences.unserialize(parser->getShortcutNode()); Conf::Sequence *seq = parser->getAccountSequence()->getSequence(); @@ -3027,11 +2945,6 @@ std::vector<std::string> ManagerImpl::getParticipantList(const std::string& conf return v; } -void ManagerImpl::notifyVideoDeviceEvent() -{ - dbus_.getConfigurationManager()->videoDeviceEvent(); -} - void ManagerImpl::saveHistory() { if (!history_->save()) diff --git a/daemon/src/managerimpl.h b/daemon/src/managerimpl.h index d6f511bdc2f4a95cb224f3c5bdecf8970e0ea870..5d93b26765d448c6a361c65203b13f0864a1f2ac 100644 --- a/daemon/src/managerimpl.h +++ b/daemon/src/managerimpl.h @@ -122,11 +122,6 @@ class ManagerImpl { */ AudioPreference audioPreference; - /** - * Video preferences - */ - VideoPreference videoPreference; - /** * Shortcut preferences */ @@ -495,13 +490,6 @@ class ManagerImpl { */ void removeAccount(const std::string& accountID); - /** - * Get current video codec name - * @param call id - * @return std::string The video codec name - */ - std::string getCurrentVideoCodecName (const std::string& id); - /** * Get current codec name * @param call id @@ -584,74 +572,6 @@ class ManagerImpl { void setEchoCancelDelay(int); - /** - * Get the list of available V4L2 devices - * @return std::vector<std::string> A list of the V4L2 capture devices - */ - std::vector<std::string> getVideoInputDeviceList(); - - /** - * Get the list of available inputs for the current V4L2 device - * @return std::vector<std::string> A list of the V4L2 inputs - */ - std::vector<std::string> getVideoInputDeviceChannelList(const std::string &dev); - - /** - * Get the list of available resolutions for the current V4L2 device/input pair - * @return std::vector<std::string> A list of frame sizes - */ - std::vector<std::string> getVideoInputDeviceSizeList(const std::string &dev, const std::string &channel); - - /** - * Get the list of available frame rates for the current V4L2 device/input/resolution - * @return std::vector<std::string> A list of the possible frame rates - */ - std::vector<std::string> getVideoInputDeviceRateList(const std::string &dev, const std::string &channel, const std::string &size); - - /** - * Get video input device index - */ - std::string getVideoInputDevice(); - - /** - * Get video input device input index - */ - std::string getVideoInputDeviceChannel(); - - /** - * Get video input device size index - */ - std::string getVideoInputDeviceSize(); - - /** - * Get video input device rate index - */ - std::string getVideoInputDeviceRate(); - - /** - * Set video input device - * @param index The index of the V4L2 device - */ - void setVideoInputDevice(const std::string& api); - - /** - * Set v4l2 input - * @param index The index of the V4L2 input - */ - void setVideoInputDeviceChannel(const std::string& api); - - /** - * Set video input resolution - * @param index The index of the resolution in the list of supported sizes - */ - void setVideoInputDeviceSize(const std::string& api); - - /** - * Set video input frame rate - * @param index The index of the frame rate in the list of supported rates - */ - void setVideoInputDeviceRate(const std::string& api); - /** * Convert a list of payload in a special format, readable by the server. * Required format: payloads separated with one slash. @@ -1258,7 +1178,6 @@ class ManagerImpl { // Map containing conference pointers ConferenceMap conferenceMap_; - void notifyVideoDeviceEvent(); /** * Send registration to all enabled accounts */ diff --git a/daemon/src/video/Makefile.am b/daemon/src/video/Makefile.am index 5b63885f0109188feddcf17fcb6615621266791b..df98408bb1cc75e4e8d054d227ef1276741c6a71 100644 --- a/daemon/src/video/Makefile.am +++ b/daemon/src/video/Makefile.am @@ -1,3 +1,4 @@ +if SFL_VIDEO include $(top_srcdir)/globals.mak SUBDIRS=test @@ -16,3 +17,5 @@ libvideo_la_LIBADD = @LIBAVCODEC_LIBS@ @LIBAVFORMAT_LIBS@ @LIBAVDEVICE_LIBS@ @LI AM_CXXFLAGS=@LIBAVCODEC_CFLAGS@ @LIBAVFORMAT_CFLAGS@ @LIBAVDEVICE_CFLAGS@ @LIBSWSCALE_CFLAGS@ @CCRTP_CFLAGS@ @UDEV_CFLAGS@ AM_CFLAGS=@LIBAVCODEC_CFLAGS@ @LIBAVFORMAT_CFLAGS@ @LIBAVDEVICE_CFLAGS@ @LIBSWSCALE_CFLAGS@ + +endif diff --git a/daemon/src/video/video_send_thread.cpp b/daemon/src/video/video_send_thread.cpp index c0d2f898591162f6f9719360e9410aca91aedd7e..795edfad1b035d04c8465e070e120bef8f1889d3 100644 --- a/daemon/src/video/video_send_thread.cpp +++ b/daemon/src/video/video_send_thread.cpp @@ -94,6 +94,7 @@ void VideoSendThread::prepareEncoderContext(AVCodec *encoder) { #if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(53, 12, 0) encoderCtx_ = avcodec_alloc_context(); + (void) encoder; /* unused */ #else encoderCtx_ = avcodec_alloc_context3(encoder); #endif