2
* Copyright (C) 2012-2013 Savoir-Faire Linux Inc.
4
* This program is free software; you can redistribute it and/or modify
5
* it under the terms of the GNU General Public License as published by
6
* the Free Software Foundation; either version 3 of the License, or
7
* (at your option) any later version.
9
* This program is distributed in the hope that it will be useful,
10
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
* GNU General Public License for more details.
14
* You should have received a copy of the GNU General Public License
15
* along with this program; if not, write to the Free Software
16
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18
* Additional permission under GNU GPL version 3 section 7:
20
* If you modify this program, or any covered work, by linking or
21
* combining it with the OpenSSL project's OpenSSL library (or a
22
* modified version of that library), containing parts covered by the
23
* terms of the OpenSSL or SSLeay licenses, Savoir-Faire Linux Inc.
24
* grants you additional permission to convey the resulting work.
25
* Corresponding Source for a non-source form of such a combination
26
* shall include the source code for the parts of OpenSSL used as well
27
* as that of the covered work.
30
#ifndef VIDEO_CONTROLS_H_
31
#define VIDEO_CONTROLS_H_
38
#include "dbus/dbus_cpp.h"
40
#if __GNUC__ >= 4 && __GNUC_MINOR__ >= 6
41
/* This warning option only exists for gcc 4.6.0 and greater. */
42
#pragma GCC diagnostic ignored "-Wunused-but-set-variable"
45
#pragma GCC diagnostic ignored "-Wignored-qualifiers"
46
#pragma GCC diagnostic ignored "-Wunused-parameter"
47
#include "dbus/video_controls-glue.h"
48
#pragma GCC diagnostic warning "-Wignored-qualifiers"
49
#pragma GCC diagnostic warning "-Wunused-parameter"
51
#if __GNUC__ >= 4 && __GNUC_MINOR__ >= 6
52
/* This warning option only exists for gcc 4.6.0 and greater. */
53
#pragma GCC diagnostic warning "-Wunused-but-set-variable"
58
#include <memory> // for shared_ptr
59
#include "video/video_preferences.h"
60
#include "video/video_base.h"
62
class VideoControls : public org::sflphone::SFLphone::VideoControls_adaptor,
63
public DBus::IntrospectableAdaptor,
64
public DBus::ObjectAdaptor {
66
std::shared_ptr<sfl_video::VideoFrameActiveWriter> videoCamera_;
67
VideoPreference videoPreference_;
68
// Only modified from main thread
73
VideoControls(DBus::Connection& connection);
74
VideoPreference &getVideoPreferences();
76
std::vector<std::map<std::string, std::string> >
77
getCodecs(const std::string& accountID);
80
setCodecs(const std::string& accountID,
81
const std::vector<std::map<std::string, std::string> > &details);
83
std::vector<std::string>
86
std::vector<std::string>
87
getDeviceChannelList(const std::string &dev);
89
std::vector<std::string>
90
getDeviceSizeList(const std::string &dev, const std::string &channel);
92
std::vector<std::string>
93
getDeviceRateList(const std::string &dev, const std::string &channel, const std::string &size);
95
std::map<std::string, std::string>
99
setActiveDevice(const std::string &dev);
102
setActiveDeviceChannel(const std::string &channel);
105
setActiveDeviceSize(const std::string &size);
108
setActiveDeviceRate(const std::string &rate);
114
getActiveDeviceChannel();
117
getActiveDeviceSize();
120
getActiveDeviceRate();
123
getCurrentCodecName(const std::string &callID);
127
bool hasCameraStarted();
128
std::weak_ptr<sfl_video::VideoFrameActiveWriter> getVideoCamera();
131
#endif // VIDEO_CONTROLS_H_