diff --git a/configure.ac b/configure.ac index d982ba2842..bbf5131f67 100644 --- a/configure.ac +++ b/configure.ac @@ -2753,7 +2753,7 @@ AM_CONDITIONAL(USE_GTK3_GL, test "x$HAVE_GTK3_GL" = "xyes") dnl *** Qt *** translit(dnm, m, l) AM_CONDITIONAL(USE_QT, true) AG_GST_CHECK_FEATURE(QT, [Qt elements], qt, [ - PKG_CHECK_MODULES(QT, Qt5Core Qt5Gui Qt5Quick >= 5.4.0, [ + PKG_CHECK_MODULES(QT, Qt5Core Qt5Gui Qt5Qml Qt5Quick >= 5.4.0, [ QT_PATH=`$PKG_CONFIG --variable=exec_prefix Qt5Core` QT_HOST_PATH=`$PKG_CONFIG --variable=host_bins Qt5Core` AC_PATH_PROGS(MOC, [moc-qt5 moc], moc, ["${QT_HOST_PATH}" "${QT_PATH}/bin"]) @@ -2801,6 +2801,25 @@ AG_GST_CHECK_FEATURE(QT, [Qt elements], qt, [ HAVE_QT_WINDOWING="yes" ], [AC_MSG_NOTICE([Could not find Qt Android integration])]) fi + if test "x$GST_GL_HAVE_WINDOW_COCOA" = "x1" -a "x$GST_GL_HAVE_PLATFORM_CGL" = "x1"; then + PKG_CHECK_MODULES(QT_MAC, Qt5MacExtras, [ + AC_DEFINE([HAVE_QT_MAC], [], + [Define if Qt Mac integration is installed]) + QT_LIBDIR=`$PKG_CONFIG --variable=libdir Qt5Core` + QT_CFLAGS="$QT_CFLAGS $QT_MAC_CFLAGS -F$QT_LIBDIR -framework QtCore -framework QtGui -framework QtQuick -framework QtQml -framework QtMacExtras" + QT_LIBS="$QT_LIBS $QT_MAC_LIBS" + HAVE_QT_WINDOWING="yes" + ], [AC_MSG_NOTICE([Could not find Qt Mac integration])]) + fi + if test "x$GST_GL_HAVE_WINDOW_EAGL" = "x1" -a "x$GST_GL_HAVE_PLATFORM_EAGL" = "x1"; then + if test "x$HAVE_IOS" = "xyes"; then + # iOS doesn't have its own extras package so if we have the core + # modules we are good to go + AC_DEFINE([HAVE_QT_IOS], [], + [Define if Qt iOS integration is installed]) + HAVE_QT_WINDOWING="yes" + fi + fi if test "x$HAVE_QT_WINDOWING" = "xno"; then AC_MSG_WARN([Could not find any Qt Windowing integration]) HAVE_QT="no" diff --git a/ext/qt/gstplugin.cc b/ext/qt/gstplugin.cc index 70b6310f01..2fa10f5e78 100644 --- a/ext/qt/gstplugin.cc +++ b/ext/qt/gstplugin.cc @@ -23,7 +23,7 @@ #endif #include "gstqtsink.h" -#include +#include static gboolean plugin_init (GstPlugin * plugin) diff --git a/ext/qt/gstqsgtexture.h b/ext/qt/gstqsgtexture.h index 7b7d1fef64..a5a6f9f8be 100644 --- a/ext/qt/gstqsgtexture.h +++ b/ext/qt/gstqsgtexture.h @@ -26,8 +26,8 @@ #include #include "gstqtgl.h" -#include -#include +#include +#include class GstQSGTexture : public QSGTexture, protected QOpenGLFunctions { diff --git a/ext/qt/gstqtsink.cc b/ext/qt/gstqtsink.cc index 0f32034d15..6a25793af1 100644 --- a/ext/qt/gstqtsink.cc +++ b/ext/qt/gstqtsink.cc @@ -28,7 +28,7 @@ #endif #include "gstqtsink.h" -#include +#include #define GST_CAT_DEFAULT gst_debug_qt_gl_sink GST_DEBUG_CATEGORY (GST_CAT_DEFAULT); diff --git a/ext/qt/qtitem.cc b/ext/qt/qtitem.cc index 9e7cdbe634..7c4487f87d 100644 --- a/ext/qt/qtitem.cc +++ b/ext/qt/qtitem.cc @@ -28,9 +28,9 @@ #include "qtitem.h" #include "gstqsgtexture.h" -#include -#include -#include +#include +#include +#include #if GST_GL_HAVE_WINDOW_X11 && GST_GL_HAVE_PLATFORM_GLX && defined (HAVE_QT_X11) #include @@ -47,6 +47,10 @@ #include #endif +#if GST_GL_HAVE_WINDOW_COCOA && GST_GL_HAVE_PLATFORM_COCOA && defined (HAVE_QT_MAC) +#include +#endif + /** * SECTION:gtkgstglwidget * @short_description: a #GtkGLArea that renders GStreamer video #GstBuffers @@ -126,6 +130,14 @@ QtGLVideoItem::QtGLVideoItem() if (QString::fromUtf8 ("android") == app->platformName()) this->priv->display = (GstGLDisplay *) gst_gl_display_egl_new (); #endif +#if GST_GL_HAVE_WINDOW_COCOA && GST_GL_HAVE_PLATFORM_COCOA && defined (HAVE_QT_MAC) + if (QString::fromUtf8 ("cocoa") == app->platformName()) + this->priv->display = (GstGLDisplay *) gst_gl_display_cocoa_new (); +#endif +#if GST_GL_HAVE_WINDOW_EAGL && GST_GL_HAVE_PLATFORM_EAGL && defined (HAVE_QT_IOS) + if (QString::fromUtf8 ("ios") == app->platformName()) + this->priv->display = gst_gl_display_new (); +#endif if (!this->priv->display) this->priv->display = gst_gl_display_new (); @@ -303,6 +315,28 @@ QtGLVideoItem::onSceneGraphInitialized () platform, gl_api); } #endif +#if GST_GL_HAVE_WINDOW_COCOA && GST_GL_HAVE_PLATFORM_COCOA && defined (HAVE_QT_MAC) + if (this->priv->display) { + platform = GST_GL_PLATFORM_CGL; + gl_api = gst_gl_context_get_current_gl_api (platform, NULL, NULL); + gl_handle = gst_gl_context_get_current_gl_context (platform); + if (gl_handle) + this->priv->other_context = + gst_gl_context_new_wrapped (this->priv->display, gl_handle, + platform, gl_api); + } +#endif +#if GST_GL_HAVE_WINDOW_EAGL && GST_GL_HAVE_PLATFORM_EAGL && defined (HAVE_QT_IOS) + if (this->priv->display) { + platform = GST_GL_PLATFORM_EAGL; + gl_api = gst_gl_context_get_current_gl_api (platform, NULL, NULL); + gl_handle = gst_gl_context_get_current_gl_context (platform); + if (gl_handle) + this->priv->other_context = + gst_gl_context_new_wrapped (this->priv->display, gl_handle, + platform, gl_api); + } +#endif (void) platform; (void) gl_api; diff --git a/ext/qt/qtitem.h b/ext/qt/qtitem.h index b6260cd16e..5a07634551 100644 --- a/ext/qt/qtitem.h +++ b/ext/qt/qtitem.h @@ -25,9 +25,9 @@ #include #include "gstqtgl.h" -#include -#include -#include +#include +#include +#include typedef struct _QtGLVideoItemPrivate QtGLVideoItemPrivate;