qmlglsink: Fix build error when don't have QPA installed.

Check header file existance and wrap the header file include
in the necessary #ifdef to avoid build error.

https://bugzilla.gnome.org/show_bug.cgi?id=767553
This commit is contained in:
Haihua Hu 2016-06-27 18:15:08 +08:00 committed by Matthew Waters
parent 756e785f39
commit d60b071474
2 changed files with 6 additions and 3 deletions

View file

@ -2874,7 +2874,10 @@ AG_GST_CHECK_FEATURE(QT, [Qt elements], qt, [
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)
AS_IF([test -f "$QPA_INCLUDE_PATH/qpa/qplatformnativeinterface.h"], [
AC_SUBST(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
PKG_CHECK_MODULES(QT_X11, Qt5X11Extras, [
AC_DEFINE([HAVE_QT_X11], [], [Define if Qt X11 integration is installed])
@ -2883,7 +2886,7 @@ AG_GST_CHECK_FEATURE(QT, [Qt elements], qt, [
HAVE_QT_WINDOWING="yes"
], [AC_MSG_NOTICE([Could not find Qt X11 integration])])
fi
if test "x$GST_GL_HAVE_WINDOW_WAYLAND" = "x1" -a "x$GST_GL_HAVE_PLATFORM_EGL" = "x1"; then
if test "x$GST_GL_HAVE_WINDOW_WAYLAND" = "x1" -a "x$GST_GL_HAVE_PLATFORM_EGL" = "x1" -a "x$HAVE_QT_QPA_HEADER" = "xyes"; then
PKG_CHECK_MODULES(QT_WAYLAND, Qt5WaylandClient, [
AC_DEFINE([HAVE_QT_WAYLAND], [],
[Define if Qt Wayland integration is installed])

View file

@ -32,7 +32,6 @@
#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>
@ -41,6 +40,7 @@
#endif
#if GST_GL_HAVE_WINDOW_WAYLAND && GST_GL_HAVE_PLATFORM_EGL && defined (HAVE_QT_WAYLAND)
#include <qpa/qplatformnativeinterface.h>
#include <gst/gl/wayland/gstgldisplay_wayland.h>
#endif