15 GstElementOrDescription elementOrDesc,
18 Q_ASSERT(!platformCamera);
20 auto maybePlatformCamera = QPlatformMediaIntegration::instance()->createGStreamerVideoSource(
21 source, elementOrDesc);
22 if (!maybePlatformCamera) {
23 qWarning() <<
"Failed to initialize QGStreamerVideoSource" << maybePlatformCamera.error();
27 if (
auto gstBinDesc = std::get_if<QString>(&elementOrDesc))
28 gstBinDescription = std::move(*gstBinDesc);
30 platformCamera = *maybePlatformCamera;
33 platformCamera->setActive(
true);
35 QObject::connect(platformCamera, &QPlatformVideoSource::activeChanged, source,
36 &QGStreamerVideoSource::activeChanged);
39QGStreamerVideoSource::QGStreamerVideoSource(
const QString &gstBinDescription, QObject *parent)
40 : QGStreamerVideoSource(parent)
42 Q_D(QGStreamerVideoSource);
43 d->createPlatformCamera(
this, gstBinDescription);