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
This commit is contained in:
Matthew Waters 2015-09-15 03:14:37 +10:00
parent c95bb94fc2
commit c6d03bc7d4
5 changed files with 44 additions and 10 deletions

View file

@ -23,7 +23,7 @@
#endif
#include "gstqtsink.h"
#include <QQmlApplicationEngine>
#include <QtQml/QQmlApplicationEngine>
static gboolean
plugin_init (GstPlugin * plugin)

View file

@ -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
{

View file

@ -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);

View file

@ -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;

View file

@ -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;