diff options
author | Matthew Waters <matthew@centricular.com> | 2015-09-15 03:14:37 +1000 |
---|---|---|
committer | Matthew Waters <matthew@centricular.com> | 2015-10-02 22:29:45 +1000 |
commit | 30194cc3682ad5a304f493cf558dc70a05bbd42a (patch) | |
tree | a75cdd24a0238d457bc34195394a55625263ea3b /ext/qt | |
parent | 30fa95c6e2d2c0f8a7dd1e3ccb7b28cde43c7b58 (diff) | |
download | gstreamer-plugins-bad-30194cc3682ad5a304f493cf558dc70a05bbd42a.tar.gz |
qt: add support for building on osx/ios
Including:
- Necessary configure checks
- Necessary compile time platform checks
- Necessary runtime qt iOS/OSX platform detection
https://bugzilla.gnome.org/show_bug.cgi?id=755100
Diffstat (limited to 'ext/qt')
-rw-r--r-- | ext/qt/gstplugin.cc | 2 | ||||
-rw-r--r-- | ext/qt/gstqsgtexture.h | 4 | ||||
-rw-r--r-- | ext/qt/gstqtsink.cc | 2 | ||||
-rw-r--r-- | ext/qt/qtitem.cc | 40 | ||||
-rw-r--r-- | ext/qt/qtitem.h | 6 |
5 files changed, 44 insertions, 10 deletions
diff --git a/ext/qt/gstplugin.cc b/ext/qt/gstplugin.cc index 70b6310f0..2fa10f5e7 100644 --- a/ext/qt/gstplugin.cc +++ b/ext/qt/gstplugin.cc @@ -23,7 +23,7 @@ #endif #include "gstqtsink.h" -#include <QQmlApplicationEngine> +#include <QtQml/QQmlApplicationEngine> static gboolean plugin_init (GstPlugin * plugin) diff --git a/ext/qt/gstqsgtexture.h b/ext/qt/gstqsgtexture.h index 7b7d1fef6..a5a6f9f8b 100644 --- a/ext/qt/gstqsgtexture.h +++ b/ext/qt/gstqsgtexture.h @@ -26,8 +26,8 @@ #include <gst/gl/gl.h> #include "gstqtgl.h" -#include <QSGTexture> -#include <QOpenGLFunctions> +#include <QtQuick/QSGTexture> +#include <QtGui/QOpenGLFunctions> class GstQSGTexture : public QSGTexture, protected QOpenGLFunctions { diff --git a/ext/qt/gstqtsink.cc b/ext/qt/gstqtsink.cc index 0f32034d1..6a25793af 100644 --- a/ext/qt/gstqtsink.cc +++ b/ext/qt/gstqtsink.cc @@ -28,7 +28,7 @@ #endif #include "gstqtsink.h" -#include <QGuiApplication> +#include <QtGui/QGuiApplication> #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 9e7cdbe63..7c4487f87 100644 --- a/ext/qt/qtitem.cc +++ b/ext/qt/qtitem.cc @@ -28,9 +28,9 @@ #include "qtitem.h" #include "gstqsgtexture.h" -#include <QGuiApplication> -#include <QQuickWindow> -#include <QSGSimpleTextureNode> +#include <QtGui/QGuiApplication> +#include <QtQuick/QQuickWindow> +#include <QtQuick/QSGSimpleTextureNode> #if GST_GL_HAVE_WINDOW_X11 && GST_GL_HAVE_PLATFORM_GLX && defined (HAVE_QT_X11) #include <QX11Info> @@ -47,6 +47,10 @@ #include <gst/gl/egl/gstglcontext_egl.h> #endif +#if GST_GL_HAVE_WINDOW_COCOA && GST_GL_HAVE_PLATFORM_COCOA && defined (HAVE_QT_MAC) +#include <gst/gl/coaoa/gstgldisplay_cocoa.h> +#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 b6260cd16..5a0763455 100644 --- a/ext/qt/qtitem.h +++ b/ext/qt/qtitem.h @@ -25,9 +25,9 @@ #include <gst/gl/gl.h> #include "gstqtgl.h" -#include <QQuickItem> -#include <QOpenGLContext> -#include <QOpenGLFunctions> +#include <QtQuick/QQuickItem> +#include <QtGui/QOpenGLContext> +#include <QtGui/QOpenGLFunctions> typedef struct _QtGLVideoItemPrivate QtGLVideoItemPrivate; |