meson: Support building qml6glsink on win32
authorNirbheek Chauhan <nirbheek@centricular.com>
Thu, 18 May 2023 08:53:49 +0000 (14:23 +0530)
committerNirbheek Chauhan <nirbheek@centricular.com>
Tue, 6 Jun 2023 11:13:13 +0000 (16:43 +0530)
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4762>

subprojects/gst-plugins-good/ext/qt6/gstqt6glutility.cc
subprojects/gst-plugins-good/ext/qt6/meson.build

index 11daec3..6e2105b 100644 (file)
@@ -254,7 +254,6 @@ gst_qml6_get_gl_wrapcontext (GstGLDisplay * display,
     gst_gl_display_filter_gl_api (display, gst_gl_context_get_gl_api (*wrap_glcontext));
     gst_gl_context_activate (*wrap_glcontext, FALSE);
   }
-#if 0
 #if GST_GL_HAVE_WINDOW_WIN32 && GST_GL_HAVE_PLATFORM_WGL && defined (HAVE_QT_WIN32)
   g_return_val_if_fail (context != NULL, FALSE);
 
@@ -289,7 +288,6 @@ gst_qml6_get_gl_wrapcontext (GstGLDisplay * display,
 
   } G_STMT_END;
 #endif
-#endif
   return TRUE;
 }
 #if 0
index 74a405f..cb1f51d 100644 (file)
@@ -105,7 +105,21 @@ endif
 
 # TODO: Android windowing
 
-# TODO: Win32 windowing
+# Win32 windowing
+if host_system == 'windows'
+  qt6_win32 = qt6_option \
+      .require(gst_gl_have_window_win32, error_message: 'win32 windowing support in gstreamer-gl is required') \
+      .require(gst_gl_have_platform_wgl, error_message: 'wgl platform support in gstreamer-gl is required')
+  if qt6_win32.allowed()
+    # for wglMakeCurrent()
+    opengl32_dep = cc.find_library('opengl32', required : qt6_win32)
+    if opengl32_dep.found()
+      qt_defines += ['-DHAVE_QT_WIN32']
+      optional_deps += opengl32_dep
+      have_qt_windowing = true
+    endif
+  endif
+endif
 
 # macOS windowing
 if host_system == 'darwin'