summaryrefslogtreecommitdiffstats
path: root/src/gsttools
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@qt.io>2020-12-21 19:45:49 +0100
committerLars Knoll <lars.knoll@qt.io>2021-01-21 06:47:26 +0000
commitadb83ac39baa9b7e3faba076d3fd6541e71f6f79 (patch)
tree069195af1417eacb9ce0ca08da84b4964cb77536 /src/gsttools
parent1a16281dc71004479679f025adf58f2c77272c99 (diff)
Cleanup the QMediaPluginLoader
We expect only one plugin per service type, later on this will get reduced to one plugin per platform. Change-Id: I01383427efa7021f4c33299c551108982a8bc67a Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'src/gsttools')
-rw-r--r--src/gsttools/qgstvideorendererplugin_p.h2
-rw-r--r--src/gsttools/qgstvideorenderersink.cpp9
2 files changed, 5 insertions, 6 deletions
diff --git a/src/gsttools/qgstvideorendererplugin_p.h b/src/gsttools/qgstvideorendererplugin_p.h
index df36dbe09..3635fea35 100644
--- a/src/gsttools/qgstvideorendererplugin_p.h
+++ b/src/gsttools/qgstvideorendererplugin_p.h
@@ -63,8 +63,6 @@ QT_BEGIN_NAMESPACE
class QAbstractVideoSurface;
-const QLatin1String QGstVideoRendererPluginKey("gstvideorenderer");
-
class Q_GSTTOOLS_EXPORT QGstVideoRenderer
{
public:
diff --git a/src/gsttools/qgstvideorenderersink.cpp b/src/gsttools/qgstvideorenderersink.cpp
index 5257a1849..f282fd751 100644
--- a/src/gsttools/qgstvideorenderersink.cpp
+++ b/src/gsttools/qgstvideorenderersink.cpp
@@ -45,7 +45,7 @@
#include <QEvent>
#include <QCoreApplication>
-#include <private/qmediapluginloader_p.h>
+#include <private/qfactoryloader_p.h>
#include "qgstvideobuffer_p.h"
#include "qgstvideorenderersink_p.h"
@@ -175,17 +175,18 @@ bool QGstDefaultVideoRenderer::proposeAllocation(GstQuery *)
return true;
}
-Q_GLOBAL_STATIC_WITH_ARGS(QMediaPluginLoader, rendererLoader,
+Q_GLOBAL_STATIC_WITH_ARGS(QFactoryLoader, rendererLoader,
(QGstVideoRendererInterface_iid, QLatin1String("video/gstvideorenderer"), Qt::CaseInsensitive))
QVideoSurfaceGstDelegate::QVideoSurfaceGstDelegate(QAbstractVideoSurface *surface)
: m_surface(surface)
{
- const auto instances = rendererLoader()->instances(QGstVideoRendererPluginKey);
- for (QObject *instance : instances) {
+ int i = 0;
+ while (QObject *instance = rendererLoader->instance(i)) {
auto plugin = qobject_cast<QGstVideoRendererInterface*>(instance);
if (QGstVideoRenderer *renderer = plugin ? plugin->createRenderer() : nullptr)
m_renderers.append(renderer);
+ ++i;
}
m_renderers.append(new QGstDefaultVideoRenderer);