summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHaihua Hu <jared.hu@nxp.com>2016-06-12 15:35:28 +0800
committerJan Schmidt <jan@centricular.com>2016-08-16 02:31:48 +1000
commitd808fc5a4274c1b4fb0d2fa5a5414bd952242094 (patch)
treeebd8d43245df87596c767acbd1662b389ec5d3db
parent33ff3ec860297d87b88d318a62954a86541fd828 (diff)
downloadgstreamer-plugins-bad-d808fc5a4274c1b4fb0d2fa5a5414bd952242094.tar.gz
qmlglsink: Add Wayland support
Don't use gstgldisplay to get wayland display. Should use QPA on wayland to get wayland display for QT. https://bugzilla.gnome.org/show_bug.cgi?id=767553
-rw-r--r--configure.ac3
-rw-r--r--ext/qt/Makefile.am1
-rw-r--r--ext/qt/qtitem.cc12
3 files changed, 16 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index 62971839d..a7ddae1d2 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2842,6 +2842,9 @@ AG_GST_CHECK_FEATURE(QT, [Qt elements], qt, [
else
HAVE_QT="yes"
HAVE_QT_WINDOWING="no"
+ QT_VERSION="`$PKG_CONFIG --modversion Qt5Core`"
+ QPA_INCLUDE_PATH=`$PKG_CONFIG --variable=includedir Qt5Core`/QtGui/${QT_VERSION}/QtGui
+ AC_SUBST(QPA_INCLUDE_PATH)
if test "x$GST_GL_HAVE_WINDOW_X11" = "x1" -a "x$GST_GL_HAVE_PLATFORM_GLX" = "x1"; then
PKG_CHECK_MODULES(QT_X11, Qt5X11Extras, [
AC_DEFINE([HAVE_QT_X11], [], [Define if Qt X11 integration is installed])
diff --git a/ext/qt/Makefile.am b/ext/qt/Makefile.am
index 5fdd90a05..eab3e97ec 100644
--- a/ext/qt/Makefile.am
+++ b/ext/qt/Makefile.am
@@ -26,6 +26,7 @@ libgstqtsink_la_SOURCES = \
libgstqtsink_la_CXXFLAGS = \
-I$(top_srcdir)/gst-libs \
-I$(top_builddir)/gst-libs \
+ -I$(QPA_INCLUDE_PATH) \
$(GST_CXXFLAGS) \
$(GST_BASE_CFLAGS) \
$(GST_PLUGINS_BASE_CFLAGS) \
diff --git a/ext/qt/qtitem.cc b/ext/qt/qtitem.cc
index e1f91e76f..2df087e7d 100644
--- a/ext/qt/qtitem.cc
+++ b/ext/qt/qtitem.cc
@@ -32,6 +32,7 @@
#include <QtGui/QGuiApplication>
#include <QtQuick/QQuickWindow>
#include <QtQuick/QSGSimpleTextureNode>
+#include <qpa/qplatformnativeinterface.h>
#if GST_GL_HAVE_WINDOW_X11 && GST_GL_HAVE_PLATFORM_GLX && defined (HAVE_QT_X11)
#include <QX11Info>
@@ -147,6 +148,17 @@ QtGLVideoItem::QtGLVideoItem()
this->priv->display = (GstGLDisplay *)
gst_gl_display_x11_new_with_display (QX11Info::display ());
#endif
+#if GST_GL_HAVE_WINDOW_WAYLAND && GST_GL_HAVE_PLATFORM_EGL && defined (HAVE_QT_WAYLAND)
+ if (QString::fromUtf8 ("wayland") == app->platformName()){
+ struct wl_display * wayland_display;
+ QPlatformNativeInterface *native =
+ QGuiApplication::platformNativeInterface();
+ wayland_display = (struct wl_display *)
+ native->nativeResourceForWindow("display", NULL);
+ this->priv->display = (GstGLDisplay *)
+ gst_gl_display_wayland_new_with_display (wayland_display);
+ }
+#endif
#if GST_GL_HAVE_WINDOW_ANDROID && GST_GL_HAVE_PLATFORM_EGL && defined (HAVE_QT_ANDROID)
if (QString::fromUtf8 ("android") == app->platformName())
this->priv->display = (GstGLDisplay *) gst_gl_display_egl_new ();