~ubuntu-branches/ubuntu/trusty/sflphone/trusty

« back to all changes in this revision

Viewing changes to daemon/src/client/video_controls.h

  • Committer: Package Import Robot
  • Author(s): Mark Purcell
  • Date: 2014-01-28 18:23:36 UTC
  • mfrom: (4.3.4 sid)
  • Revision ID: package-import@ubuntu.com-20140128182336-jrsv0k9u6cawc068
Tags: 1.3.0-1
* New upstream release 
  - Fixes "New Upstream Release" (Closes: #735846)
  - Fixes "Ringtone does not stop" (Closes: #727164)
  - Fixes "[sflphone-kde] crash on startup" (Closes: #718178)
  - Fixes "sflphone GUI crashes when call is hung up" (Closes: #736583)
* Build-Depends: ensure GnuTLS 2.6
  - libucommon-dev (>= 6.0.7-1.1), libccrtp-dev (>= 2.0.6-3)
  - Fixes "FTBFS Build-Depends libgnutls{26,28}-dev" (Closes: #722040)
* Fix "boost 1.49 is going away" unversioned Build-Depends: (Closes: #736746)
* Add Build-Depends: libsndfile-dev, nepomuk-core-dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 *  Copyright (C) 2012-2013 Savoir-Faire Linux Inc.
 
3
 *
 
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.
 
8
 *
 
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.
 
13
 *
 
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.
 
17
 *
 
18
 *  Additional permission under GNU GPL version 3 section 7:
 
19
 *
 
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.
 
28
 */
 
29
 
 
30
#ifndef VIDEO_CONTROLS_H_
 
31
#define VIDEO_CONTROLS_H_
 
32
 
 
33
#ifdef HAVE_CONFIG_H
 
34
#include "config.h"
 
35
#endif
 
36
 
 
37
#if HAVE_DBUS
 
38
#include "dbus/dbus_cpp.h"
 
39
 
 
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"
 
43
#endif
 
44
 
 
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"
 
50
 
 
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"
 
54
#endif
 
55
 
 
56
#endif // HAVE_DBUS
 
57
 
 
58
#include <memory> // for shared_ptr
 
59
#include "video/video_preferences.h"
 
60
#include "video/video_base.h"
 
61
 
 
62
class VideoControls : public org::sflphone::SFLphone::VideoControls_adaptor,
 
63
    public DBus::IntrospectableAdaptor,
 
64
    public DBus::ObjectAdaptor {
 
65
    private:
 
66
        std::shared_ptr<sfl_video::VideoFrameActiveWriter> videoCamera_;
 
67
        VideoPreference videoPreference_;
 
68
        // Only modified from main thread
 
69
        int cameraClients_;
 
70
 
 
71
    public:
 
72
 
 
73
        VideoControls(DBus::Connection& connection);
 
74
        VideoPreference &getVideoPreferences();
 
75
 
 
76
        std::vector<std::map<std::string, std::string> >
 
77
        getCodecs(const std::string& accountID);
 
78
 
 
79
        void
 
80
        setCodecs(const std::string& accountID,
 
81
                  const std::vector<std::map<std::string, std::string> > &details);
 
82
 
 
83
        std::vector<std::string>
 
84
        getDeviceList();
 
85
 
 
86
        std::vector<std::string>
 
87
        getDeviceChannelList(const std::string &dev);
 
88
 
 
89
        std::vector<std::string>
 
90
        getDeviceSizeList(const std::string &dev, const std::string &channel);
 
91
 
 
92
        std::vector<std::string>
 
93
        getDeviceRateList(const std::string &dev, const std::string &channel, const std::string &size);
 
94
 
 
95
        std::map<std::string, std::string>
 
96
        getSettings();
 
97
 
 
98
        void
 
99
        setActiveDevice(const std::string &dev);
 
100
 
 
101
        void
 
102
        setActiveDeviceChannel(const std::string &channel);
 
103
 
 
104
        void
 
105
        setActiveDeviceSize(const std::string &size);
 
106
 
 
107
        void
 
108
        setActiveDeviceRate(const std::string &rate);
 
109
 
 
110
        std::string
 
111
        getActiveDevice();
 
112
 
 
113
        std::string
 
114
        getActiveDeviceChannel();
 
115
 
 
116
        std::string
 
117
        getActiveDeviceSize();
 
118
 
 
119
        std::string
 
120
        getActiveDeviceRate();
 
121
 
 
122
        std::string
 
123
        getCurrentCodecName(const std::string &callID);
 
124
 
 
125
        void startCamera();
 
126
        void stopCamera();
 
127
        bool hasCameraStarted();
 
128
        std::weak_ptr<sfl_video::VideoFrameActiveWriter> getVideoCamera();
 
129
};
 
130
 
 
131
#endif // VIDEO_CONTROLS_H_