Commit a07a9b0b authored by Haihua Hu's avatar Haihua Hu Committed by Matthew Waters

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
parent acb1b44e
......@@ -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) \
......
......@@ -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 ();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment