1/****************************************************************************
2**
3** Copyright (C) 2016 The Qt Company Ltd.
4** Contact: https://www.qt.io/licensing/
5**
6** This file is part of the test suite of the Qt Toolkit.
7**
8** $QT_BEGIN_LICENSE:GPL-EXCEPT$
9** Commercial License Usage
10** Licensees holding valid commercial Qt licenses may use this file in
11** accordance with the commercial license agreement provided with the
12** Software or, alternatively, in accordance with the terms contained in
13** a written agreement between you and The Qt Company. For licensing terms
14** and conditions see https://www.qt.io/terms-conditions. For further
15** information use the contact form at https://www.qt.io/contact-us.
16**
17** GNU General Public License Usage
18** Alternatively, this file may be used under the terms of the GNU
19** General Public License version 3 as published by the Free Software
20** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
21** included in the packaging of this file. Please review the following
22** information to ensure the GNU General Public License requirements will
23** be met: https://www.gnu.org/licenses/gpl-3.0.html.
24**
25** $QT_END_LICENSE$
26**
27****************************************************************************/
28
29#ifndef MOCKVIDEOENCODERCONTROL_H
30#define MOCKVIDEOENCODERCONTROL_H
31
32#include "qvideoencodersettingscontrol.h"
33
34class MockVideoEncoderControl : public QVideoEncoderSettingsControl
35{
36 Q_OBJECT
37public:
38 MockVideoEncoderControl(QObject *parent):
39 QVideoEncoderSettingsControl(parent)
40 {
41 m_videoCodecs << "video/3gpp" << "video/H264";
42 m_sizes << QSize(320,240) << QSize(640,480);
43 m_framerates << 30 << 15 << 1;
44 }
45 ~MockVideoEncoderControl() {}
46
47 QVideoEncoderSettings videoSettings() const { return m_videoSettings; }
48 void setVideoSettings(const QVideoEncoderSettings &settings) { m_videoSettings = settings; };
49
50 QList<QSize> supportedResolutions(const QVideoEncoderSettings & = QVideoEncoderSettings(),
51 bool *continuous = 0) const
52 {
53 if (continuous)
54 *continuous = true;
55
56 return m_sizes;
57 }
58
59 QList<qreal> supportedFrameRates(const QVideoEncoderSettings & = QVideoEncoderSettings(),
60 bool *continuous = 0) const
61 {
62 if (continuous)
63 *continuous = false;
64
65 return m_framerates;
66 }
67
68 QStringList supportedVideoCodecs() const { return m_videoCodecs; }
69 QString videoCodecDescription(const QString &codecName) const { return codecName; }
70
71private:
72 QVideoEncoderSettings m_videoSettings;
73
74 QStringList m_videoCodecs;
75 QList<QSize> m_sizes;
76 QList<qreal> m_framerates;
77};
78
79#endif // MOCKVIDEOENCODERCONTROL_H
80

source code of qtmultimedia/tests/auto/unit/qmultimedia_common/mockvideoencodercontrol.h