21 Q_PROPERTY(
bool active READ isActive WRITE setActive NOTIFY activeChanged)
22 Q_PROPERTY(QCapturableWindow window READ window WRITE setWindow NOTIFY windowChanged)
23 Q_PROPERTY(Error error READ error NOTIFY errorChanged)
24 Q_PROPERTY(QString errorString READ errorString NOTIFY errorChanged)
25 Q_PROPERTY(std::optional<qreal> maximumFrameRate READ maximumFrameRate WRITE setMaximumFrameRate
26 RESET resetMaximumFrameRate NOTIFY maximumFrameRateChanged REVISION(6, 12))
32 CapturingNotSupported = 2,
38 explicit QWindowCapture(QObject *parent =
nullptr);
39 ~QWindowCapture() override;
41 Q_INVOKABLE
static QList<QCapturableWindow> capturableWindows();
43 QMediaCaptureSession *captureSession()
const;
45 void setWindow(QCapturableWindow window);
47 QCapturableWindow window()
const;
49 bool isActive()
const;
52 QString errorString()
const;
54 void setMaximumFrameRate(std::optional<qreal> frameRate);
55 std::optional<qreal> maximumFrameRate()
const;
56 void resetMaximumFrameRate();
59 void setActive(
bool active);
60 void start() { setActive(
true); }
61 void stop() { setActive(
false); }
64 void activeChanged(
bool);
65 void windowChanged(QCapturableWindow window);
67 void errorOccurred(QWindowCapture::Error error,
const QString &errorString);
68 Q_REVISION(6, 12)
void maximumFrameRateChanged();
71 void setCaptureSession(QMediaCaptureSession *captureSession);
72 QPlatformSurfaceCapture *platformWindowCapture()
const;
74 friend class QMediaCaptureSession;
75 Q_DISABLE_COPY(QWindowCapture)
76 Q_DECLARE_PRIVATE(QWindowCapture)