mirror of
https://github.com/Rafostar/clapper.git
synced 2025-08-30 16:02:00 +02:00
Merge pull request #256 from Rafostar/gl-win
plugin: Add GL support for Windows OS
This commit is contained in:
@@ -38,10 +38,14 @@
|
|||||||
#if GST_CLAPPER_GL_BASE_IMPORTER_HAVE_X11_GLX
|
#if GST_CLAPPER_GL_BASE_IMPORTER_HAVE_X11_GLX
|
||||||
#include <gst/gl/x11/gstgldisplay_x11.h>
|
#include <gst/gl/x11/gstgldisplay_x11.h>
|
||||||
#endif
|
#endif
|
||||||
#if GST_CLAPPER_GL_BASE_IMPORTER_HAVE_X11_EGL
|
#if GST_CLAPPER_GL_BASE_IMPORTER_HAVE_X11_EGL || GST_CLAPPER_GL_BASE_IMPORTER_HAVE_WIN32_EGL
|
||||||
#include <gst/gl/egl/gstgldisplay_egl.h>
|
#include <gst/gl/egl/gstgldisplay_egl.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if GST_CLAPPER_GL_BASE_IMPORTER_HAVE_WIN32
|
||||||
|
#include <gdk/win32/gdkwin32.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#if GST_CLAPPER_GL_BASE_IMPORTER_HAVE_MACOS
|
#if GST_CLAPPER_GL_BASE_IMPORTER_HAVE_MACOS
|
||||||
#include <gdk/macos/gdkmacos.h>
|
#include <gdk/macos/gdkmacos.h>
|
||||||
#endif
|
#endif
|
||||||
@@ -155,6 +159,24 @@ retrieve_gl_context_on_main (GstClapperGLBaseImporter *self)
|
|||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if GST_CLAPPER_GL_BASE_IMPORTER_HAVE_WIN32
|
||||||
|
if (GDK_IS_WIN32_DISPLAY (gdk_display)) {
|
||||||
|
#if GST_CLAPPER_GL_BASE_IMPORTER_HAVE_WIN32_EGL
|
||||||
|
gpointer display_ptr = gdk_win32_display_get_egl_display (gdk_display);
|
||||||
|
if (display_ptr) {
|
||||||
|
self->gst_display = (GstGLDisplay *)
|
||||||
|
gst_gl_display_egl_new_with_egl_display (display_ptr);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
#if GST_CLAPPER_GL_BASE_IMPORTER_HAVE_WIN32_WGL
|
||||||
|
if (!self->gst_display) {
|
||||||
|
self->gst_display =
|
||||||
|
gst_gl_display_new_with_type (GST_GL_DISPLAY_TYPE_WIN32);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
#if GST_CLAPPER_GL_BASE_IMPORTER_HAVE_MACOS
|
#if GST_CLAPPER_GL_BASE_IMPORTER_HAVE_MACOS
|
||||||
if (GDK_IS_MACOS_DISPLAY (gdk_display)) {
|
if (GDK_IS_MACOS_DISPLAY (gdk_display)) {
|
||||||
self->gst_display =
|
self->gst_display =
|
||||||
@@ -176,7 +198,8 @@ retrieve_gl_context_on_main (GstClapperGLBaseImporter *self)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
#if GST_CLAPPER_GL_BASE_IMPORTER_HAVE_X11_EGL
|
#if GST_CLAPPER_GL_BASE_IMPORTER_HAVE_X11_EGL
|
||||||
if (GST_IS_GL_DISPLAY_EGL (self->gst_display)) {
|
if (GST_IS_GL_DISPLAY_EGL (self->gst_display)
|
||||||
|
&& GDK_IS_X11_DISPLAY (gdk_display)) {
|
||||||
platform = GST_GL_PLATFORM_EGL;
|
platform = GST_GL_PLATFORM_EGL;
|
||||||
GST_INFO_OBJECT (self, "Using EGL on x11");
|
GST_INFO_OBJECT (self, "Using EGL on x11");
|
||||||
goto have_display;
|
goto have_display;
|
||||||
@@ -189,6 +212,21 @@ retrieve_gl_context_on_main (GstClapperGLBaseImporter *self)
|
|||||||
goto have_display;
|
goto have_display;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
#if GST_CLAPPER_GL_BASE_IMPORTER_HAVE_WIN32_EGL
|
||||||
|
if (GST_IS_GL_DISPLAY_EGL (self->gst_display)
|
||||||
|
&& GDK_IS_WIN32_DISPLAY (gdk_display)) {
|
||||||
|
platform = GST_GL_PLATFORM_EGL;
|
||||||
|
GST_INFO_OBJECT (self, "Using EGL on Win32");
|
||||||
|
goto have_display;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
#if GST_CLAPPER_GL_BASE_IMPORTER_HAVE_WIN32_WGL
|
||||||
|
if (gst_gl_display_get_handle_type (self->gst_display) == GST_GL_DISPLAY_TYPE_WIN32) {
|
||||||
|
platform = GST_GL_PLATFORM_WGL;
|
||||||
|
GST_INFO_OBJECT (self, "Using WGL on Win32");
|
||||||
|
goto have_display;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
#if GST_CLAPPER_GL_BASE_IMPORTER_HAVE_MACOS
|
#if GST_CLAPPER_GL_BASE_IMPORTER_HAVE_MACOS
|
||||||
if (gst_gl_display_get_handle_type (self->gst_display) == GST_GL_DISPLAY_TYPE_COCOA) {
|
if (gst_gl_display_get_handle_type (self->gst_display) == GST_GL_DISPLAY_TYPE_COCOA) {
|
||||||
platform = GST_GL_PLATFORM_CGL;
|
platform = GST_GL_PLATFORM_CGL;
|
||||||
|
@@ -41,6 +41,9 @@ G_BEGIN_DECLS
|
|||||||
#define GST_CLAPPER_GL_BASE_IMPORTER_HAVE_X11 (GST_GL_HAVE_WINDOW_X11 && defined (GDK_WINDOWING_X11))
|
#define GST_CLAPPER_GL_BASE_IMPORTER_HAVE_X11 (GST_GL_HAVE_WINDOW_X11 && defined (GDK_WINDOWING_X11))
|
||||||
#define GST_CLAPPER_GL_BASE_IMPORTER_HAVE_X11_GLX (GST_CLAPPER_GL_BASE_IMPORTER_HAVE_X11 && GST_GL_HAVE_PLATFORM_GLX)
|
#define GST_CLAPPER_GL_BASE_IMPORTER_HAVE_X11_GLX (GST_CLAPPER_GL_BASE_IMPORTER_HAVE_X11 && GST_GL_HAVE_PLATFORM_GLX)
|
||||||
#define GST_CLAPPER_GL_BASE_IMPORTER_HAVE_X11_EGL (GST_CLAPPER_GL_BASE_IMPORTER_HAVE_X11 && GST_GL_HAVE_PLATFORM_EGL)
|
#define GST_CLAPPER_GL_BASE_IMPORTER_HAVE_X11_EGL (GST_CLAPPER_GL_BASE_IMPORTER_HAVE_X11 && GST_GL_HAVE_PLATFORM_EGL)
|
||||||
|
#define GST_CLAPPER_GL_BASE_IMPORTER_HAVE_WIN32 (GST_GL_HAVE_WINDOW_WIN32 && defined (GDK_WINDOWING_WIN32))
|
||||||
|
#define GST_CLAPPER_GL_BASE_IMPORTER_HAVE_WIN32_WGL (GST_CLAPPER_GL_BASE_IMPORTER_HAVE_WIN32 && GST_GL_HAVE_PLATFORM_WGL)
|
||||||
|
#define GST_CLAPPER_GL_BASE_IMPORTER_HAVE_WIN32_EGL (GST_CLAPPER_GL_BASE_IMPORTER_HAVE_WIN32 && GST_GL_HAVE_PLATFORM_EGL)
|
||||||
#define GST_CLAPPER_GL_BASE_IMPORTER_HAVE_MACOS (GST_GL_HAVE_WINDOW_COCOA && defined (GDK_WINDOWING_MACOS) && GST_GL_HAVE_PLATFORM_CGL)
|
#define GST_CLAPPER_GL_BASE_IMPORTER_HAVE_MACOS (GST_GL_HAVE_WINDOW_COCOA && defined (GDK_WINDOWING_MACOS) && GST_GL_HAVE_PLATFORM_CGL)
|
||||||
|
|
||||||
typedef struct _GstClapperGLBaseImporter GstClapperGLBaseImporter;
|
typedef struct _GstClapperGLBaseImporter GstClapperGLBaseImporter;
|
||||||
|
8
lib/gst/plugin/importers/meson.build
vendored
8
lib/gst/plugin/importers/meson.build
vendored
@@ -46,6 +46,14 @@ if gst_gl_have_window_wayland and gst_gl_have_platform_egl
|
|||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
if gst_gl_have_window_win32 and (gst_gl_have_platform_egl or gst_gl_have_platform_wgl)
|
||||||
|
gtk_win32_dep = dependency('gtk4-win32', required: false)
|
||||||
|
if gtk_win32_dep.found()
|
||||||
|
gst_plugin_gl_base_deps += gtk_win32_dep
|
||||||
|
have_gtk_gl_windowing = true
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
if gst_gl_have_window_cocoa and gst_gl_have_platform_cgl
|
if gst_gl_have_window_cocoa and gst_gl_have_platform_cgl
|
||||||
gtk_macos_dep = dependency('gtk4-macos', required: false)
|
gtk_macos_dep = dependency('gtk4-macos', required: false)
|
||||||
if gtk_macos_dep.found()
|
if gtk_macos_dep.found()
|
||||||
|
Reference in New Issue
Block a user