82QWindowCapture::QWindowCapture(QObject *parent) : QObject(*
new QWindowCapturePrivate, parent)
86 qRegisterMetaType<QCapturableWindow>();
88 auto platformCapture = QPlatformMediaIntegration::instance()->createWindowCapture(
this);
90 if (platformCapture) {
91 connect(platformCapture, &QPlatformSurfaceCapture::activeChanged,
this,
92 &QWindowCapture::activeChanged);
93 connect(platformCapture, &QPlatformSurfaceCapture::errorChanged,
this,
94 &QWindowCapture::errorChanged);
95 connect(platformCapture, &QPlatformSurfaceCapture::errorOccurred,
this,
96 [
this](QPlatformSurfaceCapture::Error error,
const QString &errorString) {
97 emit errorOccurred(toWindowCaptureError(error), errorString);
99 connect(platformCapture,
100 qOverload<QCapturableWindow>(&QPlatformSurfaceCapture::sourceChanged),
this,
101 &QWindowCapture::windowChanged);
103 connect(platformCapture, &QPlatformSurfaceCapture::frameRateChanged,
this,
104 &QWindowCapture::maximumFrameRateChanged);
106 d->platformWindowCapture.reset(platformCapture);