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;