From b369746ae7b1b1148c863fb8a20fb229e277b7c4 Mon Sep 17 00:00:00 2001 From: Maurice Kalinowski Date: Mon, 17 Nov 2014 13:51:17 +0100 Subject: [PATCH 1/2] WinRT: Fix compilation after ANGLE update Header inclusion is not needed, hence remove it for WinRT. Change-Id: I8117439849143975cad3dc14e36118b8da4621de Reviewed-by: Oliver Wolff --- src/multimedia/qmediaopenglhelper_p.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/multimedia/qmediaopenglhelper_p.h b/src/multimedia/qmediaopenglhelper_p.h index 0dbd79d4..bb445b69 100644 --- a/src/multimedia/qmediaopenglhelper_p.h +++ b/src/multimedia/qmediaopenglhelper_p.h @@ -47,7 +47,7 @@ #include -#if defined(Q_OS_WIN) && (defined(QT_OPENGL_ES_2) || defined(QT_OPENGL_DYNAMIC)) +#if defined(Q_OS_WIN) && !defined(Q_OS_WINRT) && (defined(QT_OPENGL_ES_2) || defined(QT_OPENGL_DYNAMIC)) #include #endif From 96407d8d8980f5dee7a0848366c20584dbd8c321 Mon Sep 17 00:00:00 2001 From: Laszlo Agocs Date: Tue, 18 Nov 2014 14:07:34 +0100 Subject: [PATCH 2/2] Fix bogus videonode plugin handling Each plugin must provide its own unique key. Otherwise we will only ever see one single plugin. Right now running on i.MX6 is often broken because the imx6 videonode plugin is not picked up since only the egl one is seen by the system. With the fix both plugins provide their own unique key so both become visible. Additionally, introduce a QT_VIDEONODE environment variable. This is useful to specify which plugin to use. This is necessary in case multiple custom videonode plugins support the same formats. Change-Id: Iaa1988f8436dcb938cb9a95e2e0d68a4e92e113c Reviewed-by: Yoann Lopes --- .../qsgvideonode_p.h | 2 -- .../android/videonode/android_videonode.json | 2 +- src/plugins/videonode/egl/egl.json | 2 +- src/plugins/videonode/imx6/imx6.json | 2 +- .../qdeclarativevideooutput_render.cpp | 23 +++++++++++++++---- 5 files changed, 22 insertions(+), 9 deletions(-) diff --git a/src/multimedia/qtmultimediaquicktools_headers/qsgvideonode_p.h b/src/multimedia/qtmultimediaquicktools_headers/qsgvideonode_p.h index c064f8ed..8be77ff0 100644 --- a/src/multimedia/qtmultimediaquicktools_headers/qsgvideonode_p.h +++ b/src/multimedia/qtmultimediaquicktools_headers/qsgvideonode_p.h @@ -43,8 +43,6 @@ QT_BEGIN_NAMESPACE -const QLatin1String QSGVideoNodeFactoryPluginKey("sgvideonodes"); - class Q_MULTIMEDIAQUICK_EXPORT QSGVideoNode : public QSGGeometryNode { public: diff --git a/src/plugins/android/videonode/android_videonode.json b/src/plugins/android/videonode/android_videonode.json index 08bb12c3..9b359eba 100644 --- a/src/plugins/android/videonode/android_videonode.json +++ b/src/plugins/android/videonode/android_videonode.json @@ -1,3 +1,3 @@ { - "Keys": ["sgvideonodes"] + "Keys": ["android"] } diff --git a/src/plugins/videonode/egl/egl.json b/src/plugins/videonode/egl/egl.json index 08bb12c3..54a0519f 100644 --- a/src/plugins/videonode/egl/egl.json +++ b/src/plugins/videonode/egl/egl.json @@ -1,3 +1,3 @@ { - "Keys": ["sgvideonodes"] + "Keys": ["egl"] } diff --git a/src/plugins/videonode/imx6/imx6.json b/src/plugins/videonode/imx6/imx6.json index 08bb12c3..2a7fc50c 100644 --- a/src/plugins/videonode/imx6/imx6.json +++ b/src/plugins/videonode/imx6/imx6.json @@ -1,3 +1,3 @@ { - "Keys": ["sgvideonodes"] + "Keys": ["imx6"] } diff --git a/src/qtmultimediaquicktools/qdeclarativevideooutput_render.cpp b/src/qtmultimediaquicktools/qdeclarativevideooutput_render.cpp index 3b07e28c..608aae5d 100644 --- a/src/qtmultimediaquicktools/qdeclarativevideooutput_render.cpp +++ b/src/qtmultimediaquicktools/qdeclarativevideooutput_render.cpp @@ -55,10 +55,21 @@ QDeclarativeVideoRendererBackend::QDeclarativeVideoRendererBackend(QDeclarativeV QObject::connect(m_surface, SIGNAL(surfaceFormatChanged(QVideoSurfaceFormat)), q, SLOT(_q_updateNativeSize()), Qt::QueuedConnection); - foreach (QObject *instance, videoNodeFactoryLoader()->instances(QSGVideoNodeFactoryPluginKey)) { + // Prioritize the plugin requested by the environment + QString requestedVideoNode = QString::fromLatin1(qgetenv("QT_VIDEONODE")); + + foreach (const QString &key, videoNodeFactoryLoader()->keys()) { + QObject *instance = videoNodeFactoryLoader()->instance(key); QSGVideoNodeFactoryInterface* plugin = qobject_cast(instance); - if (plugin) - m_videoNodeFactories.append(plugin); + if (plugin) { + if (key == requestedVideoNode) + m_videoNodeFactories.prepend(plugin); + else + m_videoNodeFactories.append(plugin); +#ifdef DEBUG_VIDEOITEM + qDebug() << "found videonode plugin" << key << plugin; +#endif + } } // Append existing node factories as fallback if we have no plugins @@ -224,8 +235,12 @@ QSGNode *QDeclarativeVideoRendererBackend::updatePaintNode(QSGNode *oldNode, if (!videoNode) { foreach (QSGVideoNodeFactoryInterface* factory, m_videoNodeFactories) { videoNode = factory->createNode(m_surface->surfaceFormat()); - if (videoNode) + if (videoNode) { +#ifdef DEBUG_VIDEOITEM + qDebug() << "using video node from factory" << factory; +#endif break; + } } } }