qml: Add support for Vivante EGL FS windowing system

https://bugzilla.gnome.org/show_bug.cgi?id=778825
This commit is contained in:
Sebastian Dröge 2017-02-17 14:37:08 +02:00
parent e9327d4928
commit 2132ba9a94
2 changed files with 37 additions and 3 deletions

View file

@ -2915,10 +2915,10 @@ AG_GST_CHECK_FEATURE(QT, [Qt elements], qt, [
else
HAVE_QT="yes"
HAVE_QT_WINDOWING="no"
QT_VERSION="`$PKG_CONFIG --modversion Qt5Core`"
QT_VERSION="`$PKG_CONFIG --define-prefix --modversion Qt5Core`"
QPA_INCLUDE_PATH=`$PKG_CONFIG --variable=includedir Qt5Core`/QtGui/${QT_VERSION}/QtGui
AS_IF([test -f "$PKG_CONFIG_SYSROOT_DIR/$QPA_INCLUDE_PATH/qpa/qplatformnativeinterface.h"], [
QT_CFLAGS="$QT_CFLAGS -I$QPA_INCLUDE_PATH"
QT_CFLAGS="$QT_CFLAGS -I$PKG_CONFIG_SYSROOT_DIR/$QPA_INCLUDE_PATH"
HAVE_QT_QPA_HEADER="yes"
], [AC_MSG_NOTICE([Cannot find QPA])])
if test "x$GST_GL_HAVE_WINDOW_X11" = "x1" -a "x$GST_GL_HAVE_PLATFORM_GLX" = "x1"; then

View file

@ -37,7 +37,12 @@
#endif
#if GST_GL_HAVE_PLATFORM_EGL && defined (HAVE_QT_EGLFS)
#if GST_GL_HAVE_WINDOW_VIV_FB
#include <qpa/qplatformnativeinterface.h>
#include <gst/gl/viv-fb/gstgldisplay_viv_fb.h>
#else
#include <gst/gl/egl/gstgldisplay_egl.h>
#endif
#include <gst/gl/egl/gstglcontext_egl.h>
#endif
@ -85,9 +90,34 @@ gst_qt_get_gl_display ()
if (QString::fromUtf8 ("android") == app->platformName())
display = (GstGLDisplay *) gst_gl_display_egl_new_with_egl_display (eglGetDisplay(EGL_DEFAULT_DISPLAY));
#elif GST_GL_HAVE_PLATFORM_EGL && defined (HAVE_QT_EGLFS)
if (QString::fromUtf8("eglfs") == app->platformName())
if (QString::fromUtf8("eglfs") == app->platformName()) {
#if GST_GL_HAVE_WINDOW_VIV_FB
/* FIXME: Could get the display directly from Qt like this
QPlatformNativeInterface *native =
QGuiApplication::platformNativeInterface();
EGLDisplay egl_display = (EGLDisplay)
native->nativeResourceForWindow("egldisplay", NULL);
However we seem to have no way for getting the EGLNativeDisplayType, aka
native_display, via public API. As such we have to assume that display 0
is always used. Only way around that is parsing the index the same way as
Qt does in QEGLDeviceIntegration::fbDeviceName(), so let's do that.
*/
const gchar *fb_dev;
gint disp_idx = 0;
fb_dev = g_getenv ("QT_QPA_EGLFS_FB");
if (fb_dev) {
if (sscanf (fb_dev, "/dev/fb%d", &disp_idx) != 1)
disp_idx = 0;
}
display = (GstGLDisplay *) gst_gl_display_viv_fb_new (disp_idx);
#else
display = (GstGLDisplay *) gst_gl_display_egl_new_with_egl_display (eglGetDisplay(EGL_DEFAULT_DISPLAY));
#endif
}
#endif
#if GST_GL_HAVE_WINDOW_COCOA && GST_GL_HAVE_PLATFORM_COCOA && defined (HAVE_QT_MAC)
if (QString::fromUtf8 ("cocoa") == app->platformName())
@ -130,7 +160,11 @@ gst_qt_get_gl_wrapcontext (GstGLDisplay * display,
}
#endif
#if GST_GL_HAVE_PLATFORM_EGL && defined (HAVE_QT_EGLFS)
#if GST_GL_HAVE_WINDOW_VIV_FB
if (GST_IS_GL_DISPLAY_VIV_FB (display)) {
#else
if (GST_IS_GL_DISPLAY_EGL (display)) {
#endif
platform = GST_GL_PLATFORM_EGL;
}
#endif