Commit 9af1770d authored by Tristan Matthews's avatar Tristan Matthews

* #8357: create a DBus handler for video only.

Doesn't build yet
parent 295097b8
......@@ -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]))
......
# Global variables
#CXXFLAGS=-Wall -Werror -Wextra
src=$(abs_top_srcdir)
sfllibdir=$(DESTDIR)$(libdir)/sflphone
sflcodecdir=$(sfllibdir)/codecs
......
......@@ -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@ \
......
......@@ -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
......@@ -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>
......@@ -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;
......
......@@ -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);
......
......@@ -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>
......@@ -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();
}
}
......@@ -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
......@@ -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();
}
......@@ -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
......
/*
* 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);
}