1
/****************************************************************************
2
* Copyright (C) 2012-2014 by Savoir-Faire Linux *
3
* Author : Emmanuel Lepage Vallee <emmanuel.lepage@savoirfairelinux.com> *
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. *
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. *
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"
22
QHash<QString,VideoCodec*> VideoCodec::m_slCodecs;
23
bool VideoCodec::m_sInit = false;
25
///Private constructor
26
VideoCodec::VideoCodec(const QString &codecName, uint bitRate, bool enabled) : QObject(),
27
m_Name(codecName),m_Bitrate(bitRate),m_Enabled(enabled)
29
setObjectName("VideoCodec"+codecName);
32
///Get the current codec name
33
QString VideoCodec::name() const
38
///Get the current codec id
39
uint VideoCodec::bitrate() const
44
///Get the current codec id
45
bool VideoCodec::enabled() const
50
///Set the codec bitrate
51
void VideoCodec::setBitrate(const uint bitrate)
56
///Set if the codec is enabled
57
void VideoCodec::setEnabled(const bool enabled)
62
///Set codec parameters
63
void VideoCodec::setParamaters(const QString& params )
65
m_Parameters = params;
68
///Get codec parameters
69
QString VideoCodec::parameters() const
74
///Generate a daemon compatible codec representation
75
QMap<QString,QString> VideoCodec::toMap() const
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();