76QWindowCapture::QWindowCapture(QObject *parent) : QObject(*
new QWindowCapturePrivate, parent)
80 qRegisterMetaType<QCapturableWindow>();
82 auto platformCapture = QPlatformMediaIntegration::instance()->createWindowCapture(
this);
84 if (platformCapture) {
85 connect(platformCapture, &QPlatformSurfaceCapture::activeChanged,
this,
86 &QWindowCapture::activeChanged);
87 connect(platformCapture, &QPlatformSurfaceCapture::errorChanged,
this,
88 &QWindowCapture::errorChanged);
89 connect(platformCapture, &QPlatformSurfaceCapture::errorOccurred,
this,
90 [
this](QPlatformSurfaceCapture::Error error, QString errorString) {
91 emit errorOccurred(toWindowCaptureError(error), errorString);
93 connect(platformCapture,
94 qOverload<QCapturableWindow>(&QPlatformSurfaceCapture::sourceChanged),
this,
95 &QWindowCapture::windowChanged);
97 d->platformWindowCapture.reset(platformCapture);