diff --git a/configure.ac b/configure.ac index 800b356150..3503ed9f2a 100644 --- a/configure.ac +++ b/configure.ac @@ -892,6 +892,7 @@ AG_GST_CHECK_FEATURE(QT, [Qt elements], qt, [ AS_IF([test -f "$PKG_CONFIG_SYSROOT_DIR/$QPA_INCLUDE_PATH/qpa/qplatformnativeinterface.h"], [ QT_CFLAGS="$QT_CFLAGS -I$PKG_CONFIG_SYSROOT_DIR/$QPA_INCLUDE_PATH" HAVE_QT_QPA_HEADER="yes" + AC_DEFINE([HAVE_QT_QPA_HEADER], [], [Define if the Qt QPA header is installed]) ], [AC_MSG_NOTICE([Cannot find QPA])]) if test "x$GST_GL_HAVE_WINDOW_X11" = "x1" -a "x$GST_GL_HAVE_PLATFORM_GLX" = "x1" || test "x$GST_GL_HAVE_WINDOW_X11" = "x1" -a "x$GST_GL_HAVE_PLATFORM_EGL" = "x1"; then PKG_CHECK_MODULES(QT_X11, Qt5X11Extras, [ diff --git a/ext/qt/gstqtglutility.cc b/ext/qt/gstqtglutility.cc index ee9d04b8ff..cc84c8340c 100644 --- a/ext/qt/gstqtglutility.cc +++ b/ext/qt/gstqtglutility.cc @@ -42,6 +42,9 @@ #else #include #include +#ifdef HAVE_QT_QPA_HEADER +#include +#endif #endif #endif @@ -110,6 +113,13 @@ gst_qt_get_gl_display () } display = (GstGLDisplay *) gst_gl_display_viv_fb_new (disp_idx); +#elif defined(HAVE_QT_QPA_HEADER) + QPlatformNativeInterface *native = + QGuiApplication::platformNativeInterface(); + EGLDisplay egl_display = (EGLDisplay) + native->nativeResourceForWindow("egldisplay", NULL); + if (egl_display != EGL_NO_DISPLAY) + display = (GstGLDisplay *) gst_gl_display_egl_new_with_egl_display (egl_display); #else EGLDisplay egl_display = (EGLDisplay) gst_gl_display_egl_get_from_native (GST_GL_DISPLAY_TYPE_ANY, 0); display = (GstGLDisplay *) gst_gl_display_egl_new_with_egl_display (egl_display);