1// qcamera.sip generated by MetaSIP
2//
3// This file is part of the QtMultimedia Python extension module.
4//
5// Copyright (c) 2021 Riverbank Computing Limited <info@riverbankcomputing.com>
6//
7// This file is part of PyQt5.
8//
9// This file may be used under the terms of the GNU General Public License
10// version 3.0 as published by the Free Software Foundation and appearing in
11// the file LICENSE included in the packaging of this file.  Please review the
12// following information to ensure the GNU General Public License version 3.0
13// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
14//
15// If you do not wish to use this file under the terms of the GPL version 3.0
16// then you may purchase a commercial license.  For more information contact
17// info@riverbankcomputing.com.
18//
19// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
20// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
21
22
23class QCamera : QMediaObject
24{
25%TypeHeaderCode
26#include <qcamera.h>
27%End
28
29public:
30    enum Status
31    {
32        UnavailableStatus,
33        UnloadedStatus,
34        LoadingStatus,
35        UnloadingStatus,
36        LoadedStatus,
37        StandbyStatus,
38        StartingStatus,
39        StoppingStatus,
40        ActiveStatus,
41    };
42
43    enum State
44    {
45        UnloadedState,
46        LoadedState,
47        ActiveState,
48    };
49
50    enum CaptureMode
51    {
52        CaptureViewfinder,
53        CaptureStillImage,
54        CaptureVideo,
55    };
56
57    typedef QFlags<QCamera::CaptureMode> CaptureModes;
58
59    enum Error
60    {
61        NoError,
62        CameraError,
63        InvalidRequestError,
64        ServiceMissingError,
65        NotSupportedFeatureError,
66    };
67
68    enum LockStatus
69    {
70        Unlocked,
71        Searching,
72        Locked,
73    };
74
75    enum LockChangeReason
76    {
77        UserRequest,
78        LockAcquired,
79        LockFailed,
80        LockLost,
81        LockTemporaryLost,
82    };
83
84    enum LockType
85    {
86        NoLock,
87        LockExposure,
88        LockWhiteBalance,
89        LockFocus,
90    };
91
92    typedef QFlags<QCamera::LockType> LockTypes;
93%If (Qt_5_3_0 -)
94
95    enum Position
96    {
97        UnspecifiedPosition,
98        BackFace,
99        FrontFace,
100    };
101
102%End
103%If (Qt_5_6_1 -)
104    explicit QCamera(QObject *parent /TransferThis/ = 0);
105%End
106%If (- Qt_5_6_1)
107    QCamera(QObject *parent /TransferThis/ = 0);
108%End
109    QCamera(const QByteArray &device, QObject *parent /TransferThis/ = 0);
110%If (Qt_5_3_0 -)
111    QCamera(const QCameraInfo &cameraInfo, QObject *parent /TransferThis/ = 0);
112%End
113%If (Qt_5_3_0 -)
114    QCamera(QCamera::Position position, QObject *parent /TransferThis/ = 0);
115%End
116    virtual ~QCamera();
117    static QList<QByteArray> availableDevices();
118    static QString deviceDescription(const QByteArray &device);
119    virtual QMultimedia::AvailabilityStatus availability() const;
120    QCamera::State state() const;
121    QCamera::Status status() const;
122    QCamera::CaptureModes captureMode() const;
123    bool isCaptureModeSupported(QCamera::CaptureModes mode) const;
124    QCameraExposure *exposure() const;
125    QCameraFocus *focus() const;
126    QCameraImageProcessing *imageProcessing() const;
127    void setViewfinder(QVideoWidget *viewfinder);
128    void setViewfinder(QGraphicsVideoItem *viewfinder);
129    void setViewfinder(QAbstractVideoSurface *surface);
130    QCamera::Error error() const;
131    QString errorString() const;
132    QCamera::LockTypes supportedLocks() const;
133    QCamera::LockTypes requestedLocks() const;
134    QCamera::LockStatus lockStatus() const;
135    QCamera::LockStatus lockStatus(QCamera::LockType lock) const;
136
137public slots:
138    void setCaptureMode(QCamera::CaptureModes mode);
139    void load();
140    void unload();
141    void start();
142    void stop();
143    void searchAndLock();
144    void unlock();
145    void searchAndLock(QCamera::LockTypes locks);
146    void unlock(QCamera::LockTypes locks);
147
148signals:
149    void stateChanged(QCamera::State);
150    void captureModeChanged(QCamera::CaptureModes);
151    void statusChanged(QCamera::Status);
152    void locked();
153    void lockFailed();
154    void lockStatusChanged(QCamera::LockStatus, QCamera::LockChangeReason);
155    void lockStatusChanged(QCamera::LockType, QCamera::LockStatus, QCamera::LockChangeReason);
156    void error(QCamera::Error);
157%If (Qt_5_15_0 -)
158    void errorOccurred(QCamera::Error);
159%End
160
161public:
162%If (Qt_5_5_0 -)
163
164    struct FrameRateRange
165    {
166%TypeHeaderCode
167#include <qcamera.h>
168%End
169
170        FrameRateRange(qreal minimum, qreal maximum);
171        FrameRateRange();
172        qreal minimumFrameRate;
173        qreal maximumFrameRate;
174    };
175
176%End
177%If (Qt_5_5_0 -)
178    QCameraViewfinderSettings viewfinderSettings() const;
179%End
180%If (Qt_5_5_0 -)
181    void setViewfinderSettings(const QCameraViewfinderSettings &settings);
182%End
183%If (Qt_5_5_0 -)
184    QList<QCameraViewfinderSettings> supportedViewfinderSettings(const QCameraViewfinderSettings &settings = QCameraViewfinderSettings()) const;
185%End
186%If (Qt_5_5_0 -)
187    QList<QSize> supportedViewfinderResolutions(const QCameraViewfinderSettings &settings = QCameraViewfinderSettings()) const;
188%End
189%If (Qt_5_5_0 -)
190    QList<QCamera::FrameRateRange> supportedViewfinderFrameRateRanges(const QCameraViewfinderSettings &settings = QCameraViewfinderSettings()) const;
191%End
192%If (Qt_5_5_0 -)
193    QList<QVideoFrame::PixelFormat> supportedViewfinderPixelFormats(const QCameraViewfinderSettings &settings = QCameraViewfinderSettings()) const;
194%End
195};
196
197QFlags<QCamera::LockType> operator|(QCamera::LockType f1, QFlags<QCamera::LockType> f2);
198%If (Qt_5_5_0 -)
199bool operator==(const QCamera::FrameRateRange &r1, const QCamera::FrameRateRange &r2);
200%End
201%If (Qt_5_5_0 -)
202bool operator!=(const QCamera::FrameRateRange &r1, const QCamera::FrameRateRange &r2);
203%End
204