[vlc-commits] [Git][videolan/vlc][master] 2 commits: opengl: egl_display: enable on emscripten
Jean-Baptiste Kempf (@jbk)
gitlab at videolan.org
Wed May 10 12:00:16 UTC 2023
Jean-Baptiste Kempf pushed to branch master at VideoLAN / VLC
Commits:
00f269c8 by Mehdi Sabwat at 2023-05-10T11:30:05+00:00
opengl: egl_display: enable on emscripten
Emscripten does not implement EGL extensions[^1] and doesn't need an
extension to provide the correct display.
[^1]: https://emscripten.org/docs/porting/multimedia_and_graphics/EGL-Support-in-Emscripten.html#egl-extensions
Co-authored-by: Alexandre Janniaux <ajanni at videolabs.io>
- - - - -
7cc1c33b by Alexandre Janniaux at 2023-05-10T11:30:05+00:00
opengl: mock: enable module on emscripten platform
Allow testing the OpenGL features through --filters=gl{filters=mock}.
- - - - -
2 changed files:
- modules/video_output/opengl/Makefile.am
- modules/video_output/opengl/egl_display_generic.c
Changes:
=====================================
modules/video_output/opengl/Makefile.am
=====================================
@@ -136,6 +136,12 @@ libglfilter_mock_plugin_la_LIBADD += libvlc_opengl.la $(GL_LIBS)
noinst_LTLIBRARIES += libglfilter_mock_plugin.la
endif
+if HAVE_EMSCRIPTEN
+libglfilter_mock_plugin_la_LIBADD += libvlc_opengles.la $(GL_LIBS)
+libglfilter_mock_plugin_la_CFLAGS = -DUSE_OPENGL_ES2=1
+noinst_LTLIBRARIES += libglfilter_mock_plugin.la
+endif
+
if HAVE_IOS
libglfilter_mock_plugin_la_LIBADD += libvlc_opengles.la $(GLES2_LIBS)
libglfilter_mock_plugin_la_CFLAGS = -DUSE_OPENGL_ES2=1
=====================================
modules/video_output/opengl/egl_display_generic.c
=====================================
@@ -31,7 +31,7 @@
#include "egl_display.h"
-#ifndef __ANDROID__
+#if !defined(__ANDROID__) && !defined(__EMSCRIPTEN__)
static EGLenum GetPlatform(const char *extensions)
{
#ifdef EGL_KHR_platform_x11
@@ -52,8 +52,8 @@ static vlc_egl_display_open_fn Open;
static int
Open(struct vlc_egl_display *display)
{
-#ifdef __ANDROID__
- /* The default display is refcounted on Android */
+#if defined(__ANDROID__) || defined(__EMSCRIPTEN__)
+ /* The default display is refcounted on Android and Emscripten */
display->display = eglGetDisplay(EGL_DEFAULT_DISPLAY);
#elif defined(EGL_KHR_display_reference)
const char *extensions = eglQueryString(EGL_NO_DISPLAY, EGL_EXTENSIONS);
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/a538bdbf7e7d4d740a935557d7b399caa3716562...7cc1c33b703fc0ea12babac6e264245e83556902
--
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/a538bdbf7e7d4d740a935557d7b399caa3716562...7cc1c33b703fc0ea12babac6e264245e83556902
You're receiving this email because of your account on code.videolan.org.
VideoLAN code repository instance
More information about the vlc-commits
mailing list