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 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;
58 void setActive(
bool active);
59 void start() { setActive(
true); }
60 void stop() { setActive(
false); }
63 void activeChanged(
bool);
64 void windowChanged(QCapturableWindow window);
66 void errorOccurred(QWindowCapture::Error error,
const QString &errorString);
67 Q_REVISION(6, 12)
void maximumFrameRateChanged(std::optional<qreal>);
70 void setCaptureSession(QMediaCaptureSession *captureSession);
71 QPlatformSurfaceCapture *platformWindowCapture()
const;
73 friend class QMediaCaptureSession;
74 Q_DISABLE_COPY(QWindowCapture)
75 Q_DECLARE_PRIVATE(QWindowCapture)