1// qabstractvideosurface.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 QAbstractVideoSurface : QObject
24{
25%TypeHeaderCode
26#include <qabstractvideosurface.h>
27%End
28
29%ConvertToSubClassCode
30    static struct class_graph {
31        const char *name;
32        sipTypeDef **type;
33        int yes, no;
34    } graph[] = {
35    #if QT_VERSION >= 0x050500
36        {sipName_QAbstractVideoFilter, &sipType_QAbstractVideoFilter, -1, 1},
37    #else
38        {0, 0, -1, 1},
39    #endif
40        {sipName_QAbstractVideoSurface, &sipType_QAbstractVideoSurface, -1, 2},
41        {sipName_QMediaObject, &sipType_QMediaObject, 18, 3},
42        {sipName_QMediaControl, &sipType_QMediaControl, 22, 4},
43        {sipName_QAudioInput, &sipType_QAudioInput, -1, 5},
44        {sipName_QAudioOutput, &sipType_QAudioOutput, -1, 6},
45        {sipName_QAudioProbe, &sipType_QAudioProbe, -1, 7},
46        {sipName_QMediaRecorder, &sipType_QMediaRecorder, 60, 8},
47        {sipName_QCameraExposure, &sipType_QCameraExposure, -1, 9},
48        {sipName_QCameraFocus, &sipType_QCameraFocus, -1, 10},
49        {sipName_QCameraImageCapture, &sipType_QCameraImageCapture, -1, 11},
50        {sipName_QCameraImageProcessing, &sipType_QCameraImageProcessing, -1, 12},
51        {sipName_QMediaPlaylist, &sipType_QMediaPlaylist, -1, 13},
52        {sipName_QMediaService, &sipType_QMediaService, -1, 14},
53        {sipName_QRadioData, &sipType_QRadioData, -1, 15},
54        {sipName_QSound, &sipType_QSound, -1, 16},
55        {sipName_QSoundEffect, &sipType_QSoundEffect, -1, 17},
56        {sipName_QVideoProbe, &sipType_QVideoProbe, -1, -1},
57        {sipName_QAudioDecoder, &sipType_QAudioDecoder, -1, 19},
58        {sipName_QCamera, &sipType_QCamera, -1, 20},
59        {sipName_QMediaPlayer, &sipType_QMediaPlayer, -1, 21},
60        {sipName_QRadioTuner, &sipType_QRadioTuner, -1, -1},
61        {sipName_QAudioDecoderControl, &sipType_QAudioDecoderControl, -1, 23},
62        {sipName_QAudioEncoderSettingsControl, &sipType_QAudioEncoderSettingsControl, -1, 24},
63        {sipName_QAudioInputSelectorControl, &sipType_QAudioInputSelectorControl, -1, 25},
64        {sipName_QAudioOutputSelectorControl, &sipType_QAudioOutputSelectorControl, -1, 26},
65    #if QT_VERSION >= 0x050600
66        {sipName_QAudioRoleControl, &sipType_QAudioRoleControl, -1, 27},
67    #else
68        {0, 0, -1, 27},
69    #endif
70        {sipName_QCameraCaptureBufferFormatControl, &sipType_QCameraCaptureBufferFormatControl, -1, 28},
71        {sipName_QCameraCaptureDestinationControl, &sipType_QCameraCaptureDestinationControl, -1, 29},
72        {sipName_QCameraControl, &sipType_QCameraControl, -1, 30},
73        {sipName_QCameraExposureControl, &sipType_QCameraExposureControl, -1, 31},
74        {sipName_QCameraFeedbackControl, &sipType_QCameraFeedbackControl, -1, 32},
75        {sipName_QCameraFlashControl, &sipType_QCameraFlashControl, -1, 33},
76        {sipName_QCameraFocusControl, &sipType_QCameraFocusControl, -1, 34},
77        {sipName_QCameraImageCaptureControl, &sipType_QCameraImageCaptureControl, -1, 35},
78        {sipName_QCameraImageProcessingControl, &sipType_QCameraImageProcessingControl, -1, 36},
79        {sipName_QCameraInfoControl, &sipType_QCameraInfoControl, -1, 37},
80        {sipName_QCameraLocksControl, &sipType_QCameraLocksControl, -1, 38},
81        {sipName_QCameraViewfinderSettingsControl, &sipType_QCameraViewfinderSettingsControl, -1, 39},
82        {sipName_QCameraViewfinderSettingsControl2, &sipType_QCameraViewfinderSettingsControl2, -1, 40},
83        {sipName_QCameraZoomControl, &sipType_QCameraZoomControl, -1, 41},
84    #if QT_VERSION >= 0x050b00
85        {sipName_QCustomAudioRoleControl, &sipType_QCustomAudioRoleControl, -1, 42},
86    #else
87        {0, 0, -1, 42},
88    #endif
89        {sipName_QImageEncoderControl, &sipType_QImageEncoderControl, -1, 43},
90        {sipName_QMediaAudioProbeControl, &sipType_QMediaAudioProbeControl, -1, 44},
91        {sipName_QMediaAvailabilityControl, &sipType_QMediaAvailabilityControl, -1, 45},
92        {sipName_QMediaContainerControl, &sipType_QMediaContainerControl, -1, 46},
93        {sipName_QMediaGaplessPlaybackControl, &sipType_QMediaGaplessPlaybackControl, -1, 47},
94        {sipName_QMediaNetworkAccessControl, &sipType_QMediaNetworkAccessControl, -1, 48},
95        {sipName_QMediaPlayerControl, &sipType_QMediaPlayerControl, -1, 49},
96        {sipName_QMediaRecorderControl, &sipType_QMediaRecorderControl, -1, 50},
97        {sipName_QMediaStreamsControl, &sipType_QMediaStreamsControl, -1, 51},
98        {sipName_QMediaVideoProbeControl, &sipType_QMediaVideoProbeControl, -1, 52},
99        {sipName_QMetaDataReaderControl, &sipType_QMetaDataReaderControl, -1, 53},
100        {sipName_QMetaDataWriterControl, &sipType_QMetaDataWriterControl, -1, 54},
101        {sipName_QRadioDataControl, &sipType_QRadioDataControl, -1, 55},
102        {sipName_QRadioTunerControl, &sipType_QRadioTunerControl, -1, 56},
103        {sipName_QVideoDeviceSelectorControl, &sipType_QVideoDeviceSelectorControl, -1, 57},
104        {sipName_QVideoEncoderSettingsControl, &sipType_QVideoEncoderSettingsControl, -1, 58},
105        {sipName_QVideoRendererControl, &sipType_QVideoRendererControl, -1, 59},
106        {sipName_QVideoWindowControl, &sipType_QVideoWindowControl, -1, -1},
107        {sipName_QAudioRecorder, &sipType_QAudioRecorder, -1, -1},
108    };
109
110    int i = 0;
111
112    sipType = NULL;
113
114    do
115    {
116        struct class_graph *cg = &graph[i];
117
118        if (cg->name != NULL && sipCpp->inherits(cg->name))
119        {
120            sipType = *cg->type;
121            i = cg->yes;
122        }
123        else
124            i = cg->no;
125    }
126    while (i >= 0);
127%End
128
129public:
130    enum Error
131    {
132        NoError,
133        UnsupportedFormatError,
134        IncorrectFormatError,
135        StoppedError,
136        ResourceError,
137    };
138
139    explicit QAbstractVideoSurface(QObject *parent /TransferThis/ = 0);
140    virtual ~QAbstractVideoSurface();
141    virtual QList<QVideoFrame::PixelFormat> supportedPixelFormats(QAbstractVideoBuffer::HandleType type = QAbstractVideoBuffer::NoHandle) const = 0;
142    virtual bool isFormatSupported(const QVideoSurfaceFormat &format) const;
143    virtual QVideoSurfaceFormat nearestFormat(const QVideoSurfaceFormat &format) const;
144    QVideoSurfaceFormat surfaceFormat() const;
145    virtual bool start(const QVideoSurfaceFormat &format);
146    virtual void stop();
147    bool isActive() const;
148    virtual bool present(const QVideoFrame &frame) = 0;
149    QAbstractVideoSurface::Error error() const;
150
151signals:
152    void activeChanged(bool active);
153    void surfaceFormatChanged(const QVideoSurfaceFormat &format);
154    void supportedFormatsChanged();
155
156protected:
157    void setError(QAbstractVideoSurface::Error error);
158
159public:
160    QSize nativeResolution() const;
161
162protected:
163    void setNativeResolution(const QSize &resolution);
164
165signals:
166    void nativeResolutionChanged(const QSize &);
167};
168