~ubuntu-branches/ubuntu/wily/sflphone/wily

« back to all changes in this revision

Viewing changes to kde/src/lib/videocodec.cpp

  • Committer: Package Import Robot
  • Author(s): Francois Marier, Francois Marier, Mark Purcell
  • Date: 2014-10-18 15:08:50 UTC
  • mfrom: (1.1.12)
  • mto: This revision was merged to the branch mainline in revision 29.
  • Revision ID: package-import@ubuntu.com-20141018150850-2exfk34ckb15pcwi
Tags: 1.4.1-0.1
[ Francois Marier ]
* Non-maintainer upload
* New upstream release (closes: #759576, #741130)
  - debian/rules +PJPROJECT_VERSION := 2.2.1
  - add upstream patch to fix broken TLS support
  - add patch to fix pjproject regression

[ Mark Purcell ]
* Build-Depends:
  - sflphone-daemon + libavformat-dev, libavcodec-dev, libswscale-dev,
  libavdevice-dev, libavutil-dev
  - sflphone-gnome + libclutter-gtk-1.0-dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/****************************************************************************
2
 
 *   Copyright (C) 2012-2014 by Savoir-Faire Linux                          *
3
 
 *   Author : Emmanuel Lepage Vallee <emmanuel.lepage@savoirfairelinux.com> *
4
 
 *                                                                          *
5
 
 *   This library is free software; you can redistribute it and/or          *
6
 
 *   modify it under the terms of the GNU Lesser General Public             *
7
 
 *   License as published by the Free Software Foundation; either           *
8
 
 *   version 2.1 of the License, or (at your option) any later version.     *
9
 
 *                                                                          *
10
 
 *   This library is distributed in the hope that it will be useful,        *
11
 
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of         *
12
 
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU      *
13
 
 *   Lesser General Public License for more details.                        *
14
 
 *                                                                          *
15
 
 *   You should have received a copy of the GNU General Public License      *
16
 
 *   along with this program.  If not, see <http://www.gnu.org/licenses/>.  *
17
 
 ***************************************************************************/
18
 
#include "videocodec.h"
19
 
 
20
 
#include "account.h"
21
 
 
22
 
QHash<QString,VideoCodec*> VideoCodec::m_slCodecs;
23
 
bool VideoCodec::m_sInit = false;
24
 
 
25
 
///Private constructor
26
 
VideoCodec::VideoCodec(const QString &codecName, uint bitRate, bool enabled) : QObject(),
27
 
m_Name(codecName),m_Bitrate(bitRate),m_Enabled(enabled)
28
 
{
29
 
   setObjectName("VideoCodec"+codecName);
30
 
}
31
 
 
32
 
///Get the current codec name
33
 
QString VideoCodec::name() const
34
 
{
35
 
   return m_Name;
36
 
}
37
 
 
38
 
///Get the current codec id
39
 
uint VideoCodec::bitrate() const
40
 
{
41
 
   return m_Bitrate;
42
 
}
43
 
 
44
 
///Get the current codec id
45
 
bool VideoCodec::enabled() const
46
 
{
47
 
   return m_Enabled;
48
 
}
49
 
 
50
 
///Set the codec bitrate
51
 
void VideoCodec::setBitrate(const uint bitrate)
52
 
{
53
 
   m_Bitrate = bitrate;
54
 
}
55
 
 
56
 
///Set if the codec is enabled
57
 
void VideoCodec::setEnabled(const bool enabled)
58
 
{
59
 
   m_Enabled = enabled;
60
 
}
61
 
 
62
 
///Set codec parameters
63
 
void VideoCodec::setParamaters(const QString& params )
64
 
{
65
 
   m_Parameters = params;
66
 
}
67
 
 
68
 
///Get codec parameters
69
 
QString VideoCodec::parameters() const
70
 
{
71
 
   return m_Parameters;
72
 
}
73
 
 
74
 
///Generate a daemon compatible codec representation
75
 
QMap<QString,QString> VideoCodec::toMap() const
76
 
{
77
 
   QMap<QString,QString> ret;
78
 
   ret[CodecFields::ENABLED    ] = enabled   ()?"true":"false";
79
 
   ret[CodecFields::BITRATE    ] = QString::number(bitrate());
80
 
   ret[CodecFields::NAME       ] = name      ();
81
 
   ret[CodecFields::PARAMETERS ] = parameters();
82
 
   return ret;
83
 
}