19 Q_PROPERTY(
bool active READ isActive WRITE setActive NOTIFY activeChanged)
20 Q_PROPERTY(QCapturableWindow window READ window WRITE setWindow NOTIFY windowChanged)
21 Q_PROPERTY(Error error READ error NOTIFY errorChanged)
22 Q_PROPERTY(QString errorString READ errorString NOTIFY errorChanged)
23 Q_PROPERTY(std::optional<qreal> frameRate READ frameRate WRITE setFrameRate RESET resetFrameRate NOTIFY frameRateChanged)
29 CapturingNotSupported = 2,
35 explicit QWindowCapture(QObject *parent =
nullptr);
36 ~QWindowCapture() override;
38 Q_INVOKABLE
static QList<QCapturableWindow> capturableWindows();
40 QMediaCaptureSession *captureSession()
const;
42 void setWindow(QCapturableWindow window);
44 QCapturableWindow window()
const;
46 bool isActive()
const;
49 QString errorString()
const;
51 void setFrameRate(std::optional<qreal> frameRate);
52 std::optional<qreal> frameRate()
const;
53 void resetFrameRate();
56 void setActive(
bool active);
57 void start() { setActive(
true); }
58 void stop() { setActive(
false); }
61 void activeChanged(
bool);
62 void windowChanged(QCapturableWindow window);
64 void errorOccurred(QWindowCapture::Error error,
const QString &errorString);
65 void frameRateChanged();
68 void setCaptureSession(QMediaCaptureSession *captureSession);
69 QPlatformSurfaceCapture *platformWindowCapture()
const;
71 friend class QMediaCaptureSession;
72 Q_DISABLE_COPY(QWindowCapture)
73 Q_DECLARE_PRIVATE(QWindowCapture)