| 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 MOCKCAMERAVIEWFINDERSETTINGSCONTROL_H |
| 30 | #define MOCKCAMERAVIEWFINDERSETTINGSCONTROL_H |
| 31 | |
| 32 | #include "qcameraviewfindersettingscontrol.h" |
| 33 | |
| 34 | class MockCameraViewfinderSettingsControl : public QCameraViewfinderSettingsControl2 |
| 35 | { |
| 36 | Q_OBJECT |
| 37 | public: |
| 38 | MockCameraViewfinderSettingsControl(QObject *parent = 0): |
| 39 | QCameraViewfinderSettingsControl2(parent) |
| 40 | { |
| 41 | QCameraViewfinderSettings s; |
| 42 | s.setResolution(width: 640, height: 480); |
| 43 | s.setMinimumFrameRate(30); |
| 44 | s.setMaximumFrameRate(30); |
| 45 | s.setPixelFormat(QVideoFrame::Format_NV12); |
| 46 | s.setPixelAspectRatio(horizontal: 1, vertical: 1); |
| 47 | supportedSettings.append(t: s); |
| 48 | |
| 49 | s.setResolution(width: 1280, height: 720); |
| 50 | s.setMinimumFrameRate(10); |
| 51 | s.setMaximumFrameRate(10); |
| 52 | s.setPixelFormat(QVideoFrame::Format_NV12); |
| 53 | s.setPixelAspectRatio(horizontal: 1, vertical: 1); |
| 54 | supportedSettings.append(t: s); |
| 55 | |
| 56 | s.setResolution(width: 1920, height: 1080); |
| 57 | s.setMinimumFrameRate(5); |
| 58 | s.setMaximumFrameRate(10); |
| 59 | s.setPixelFormat(QVideoFrame::Format_BGR32); |
| 60 | s.setPixelAspectRatio(horizontal: 2, vertical: 1); |
| 61 | supportedSettings.append(t: s); |
| 62 | |
| 63 | s.setResolution(width: 1280, height: 720); |
| 64 | s.setMinimumFrameRate(10); |
| 65 | s.setMaximumFrameRate(10); |
| 66 | s.setPixelFormat(QVideoFrame::Format_YV12); |
| 67 | s.setPixelAspectRatio(horizontal: 1, vertical: 1); |
| 68 | supportedSettings.append(t: s); |
| 69 | |
| 70 | s.setResolution(width: 1280, height: 720); |
| 71 | s.setMinimumFrameRate(30); |
| 72 | s.setMaximumFrameRate(30); |
| 73 | s.setPixelFormat(QVideoFrame::Format_YV12); |
| 74 | s.setPixelAspectRatio(horizontal: 1, vertical: 1); |
| 75 | supportedSettings.append(t: s); |
| 76 | |
| 77 | s.setResolution(width: 320, height: 240); |
| 78 | s.setMinimumFrameRate(30); |
| 79 | s.setMaximumFrameRate(30); |
| 80 | s.setPixelFormat(QVideoFrame::Format_NV12); |
| 81 | s.setPixelAspectRatio(horizontal: 1, vertical: 1); |
| 82 | supportedSettings.append(t: s); |
| 83 | } |
| 84 | |
| 85 | ~MockCameraViewfinderSettingsControl() {} |
| 86 | |
| 87 | QCameraViewfinderSettings viewfinderSettings() const |
| 88 | { |
| 89 | return settings; |
| 90 | } |
| 91 | |
| 92 | void setViewfinderSettings(const QCameraViewfinderSettings &s) |
| 93 | { |
| 94 | settings = s; |
| 95 | } |
| 96 | |
| 97 | QList<QCameraViewfinderSettings> supportedViewfinderSettings() const |
| 98 | { |
| 99 | return supportedSettings; |
| 100 | } |
| 101 | |
| 102 | QCameraViewfinderSettings settings; |
| 103 | QList<QCameraViewfinderSettings> supportedSettings; |
| 104 | }; |
| 105 | |
| 106 | #endif // MOCKCAMERAVIEWFINDERSETTINGSCONTROL_H |
| 107 | |