[vlc-commits] direct3d9: Disable OpenGL interop if OpenGL is unavailable

Martin Storsjö git at videolan.org
Tue Apr 10 21:55:48 CEST 2018


vlc | branch: master | Martin Storsjö <martin at martin.st> | Tue Apr 10 22:53:16 2018 +0300| [0d0aef05c157c0225a4a0ca1c9b2d91797616f35] | committer: Martin Storsjö

direct3d9: Disable OpenGL interop if OpenGL is unavailable

On Windows on ARM/ARM64, OpenGL isn't available. (For emulation
of i386 binaries, there is an opengl32.dll, but it's only the
fallback software renderer, nothing else. For ARM and ARM64, there
is no opengl32.dll.)

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=0d0aef05c157c0225a4a0ca1c9b2d91797616f35
---

 configure.ac                           | 3 +++
 modules/video_output/win32/direct3d9.c | 4 ++++
 2 files changed, 7 insertions(+)

diff --git a/configure.ac b/configure.ac
index 67a883ea9d..93d1eace42 100644
--- a/configure.ac
+++ b/configure.ac
@@ -3050,6 +3050,9 @@ PKG_CHECK_MODULES([GL], [gl], [
   AC_MSG_RESULT([${have_gl}])
 ])
 AM_CONDITIONAL([HAVE_GL], [test "${have_gl}" = "yes"])
+AS_IF([test "${have_gl}" = "yes"], [
+  AC_DEFINE([HAVE_GL], 1, [Defined if having OpenGL])
+])
 
 dnl OpenGL ES 2: depends on EGL 1.1
 PKG_ENABLE_MODULES_VLC([GLES2], [], [glesv2], [OpenGL ES v2 support], [disabled])
diff --git a/modules/video_output/win32/direct3d9.c b/modules/video_output/win32/direct3d9.c
index 9a89f4f55f..bd66b6b975 100644
--- a/modules/video_output/win32/direct3d9.c
+++ b/modules/video_output/win32/direct3d9.c
@@ -102,10 +102,12 @@ vlc_module_begin ()
     add_shortcut("direct3d9", "direct3d")
     set_callbacks(Open, Close)
 
+#ifdef HAVE_GL
     add_submodule()
     set_description("DX OpenGL surface converter for D3D9")
     set_capability("glconv", 1)
     set_callbacks(GLConvOpen, GLConvClose)
+#endif
 vlc_module_end ()
 
 /*****************************************************************************
@@ -1794,6 +1796,7 @@ static int FindShadersCallback(const char *name, char ***values, char ***descs)
 
 }
 
+#ifdef HAVE_GL
 #include "../opengl/converter.h"
 #include <GL/wglew.h>
 
@@ -2012,3 +2015,4 @@ error:
     GLConvClose(obj);
     return VLC_EGENERIC;
 }
+#endif



More information about the vlc-commits mailing list