90QWindowCapture::QWindowCapture(QObject *parent) : QObject(*
new QWindowCapturePrivate, parent)
94 qRegisterMetaType<QCapturableWindow>();
96 auto platformCapture = QPlatformMediaIntegration::instance()->createWindowCapture(
this);
98 if (platformCapture) {
99 connect(platformCapture, &QPlatformSurfaceCapture::activeChanged,
this,
100 &QWindowCapture::activeChanged);
101 connect(platformCapture, &QPlatformSurfaceCapture::errorChanged,
this,
102 &QWindowCapture::errorChanged);
103 connect(platformCapture, &QPlatformSurfaceCapture::errorOccurred,
this,
104 [
this](QPlatformSurfaceCapture::Error error,
const QString &errorString) {
105 emit errorOccurred(toWindowCaptureError(error), errorString);
107 connect(platformCapture,
108 qOverload<QCapturableWindow>(&QPlatformSurfaceCapture::sourceChanged),
this,
109 &QWindowCapture::windowChanged);
111 connect(platformCapture, &QPlatformSurfaceCapture::frameRateChanged,
this,
112 &QWindowCapture::maximumFrameRateChanged);
114 d->platformWindowCapture.reset(platformCapture);