<!DOCTYPE html>
<html>
<head>
<title></title>
<style type="text/css">p.MsoNormal,p.MsoNoSpacing{margin:0}</style>
</head>
<body><div><br></div>
<div>On Wed, May 23, 2018, at 12:23, Rémi Denis-Courmont wrote:<br></div>
<blockquote type="cite"><div>Do you really want to design the API according to the legacy? And what will the definition of "core" be even then? It depends on the API & version AFAIU, so it seems pretty insane to expect the GL user to know.<br></div>
</blockquote><div><br></div>
<div>If it depends on the version... yes, this new API can be tricky.<br></div>
<div><br></div>
<div>One other way to solve the egl gles2 link issue is to dlsym if only eglGetProcAddr() fails.<br></div>
<div><br></div>
<blockquote type="cite"><div><br></div>
<div defang_data-gmailquote="yes"><div>Le 23 mai 2018 10:19:27 GMT+03:00, Thomas Guillem <thomas@gllm.fr> a écrit :<br></div>
<blockquote defang_data-gmailquote="yes" style="margin-top:0pt;margin-right:0pt;margin-bottom:0pt;margin-left:0.8ex;border-left-color:rgb(204, 204, 204);border-left-style:solid;border-left-width:1px;padding-left:1ex;"><pre><div>- Same implementation than vlc_gl_GetProcAddress for GLX, ios, macos.<br></div>
<div>- NULL for WGL<br></div>
<div>- Depending on EGL_KHR_get_all_proc_addresses for egl<br></div>
<div>---<br></div>
<div> include/vlc_opengl.h                 | 6 ++++++<br></div>
<div> modules/video_output/caopengllayer.m | 2 +-<br></div>
<div> modules/video_output/glx.c           | 2 +-<br></div>
<div> modules/video_output/ios.m           | 2 +-<br></div>
<div> modules/video_output/macosx.m        | 2 +-<br></div>
<div> modules/video_output/opengl/egl.c    | 4 ++++<br></div>
<div> 6 files changed, 14 insertions(+), 4 deletions(-)<br></div>
<div><br></div>
<div>diff --git a/include/vlc_opengl.h b/include/vlc_opengl.h<br></div>
<div>index 178d1587da..83324e25aa 100644<br></div>
<div>--- a/include/vlc_opengl.h<br></div>
<div>+++ b/include/vlc_opengl.h<br></div>
<div>@@ -50,6 +50,7 @@ struct vlc_gl_t<br></div>
<div>     void (*resize)(vlc_gl_t *, unsigned, unsigned);<br></div>
<div>     void (*swap)(vlc_gl_t *);<br></div>
<div>     void*(*getProcAddress)(vlc_gl_t *, const char *);<br></div>
<div>+    void*(*getCoreProcAddress)(vlc_gl_t *, const char *);<br></div>
<div> <br></div>
<div>     enum {<br></div>
<div>         VLC_GL_EXT_DEFAULT,<br></div>
<div>@@ -112,6 +113,11 @@ static inline void *vlc_gl_GetProcAddress(vlc_gl_t *gl, const char *name)<br></div>
<div>     return gl->getProcAddress(gl, name);<br></div>
<div> }<br></div>
<div> <br></div>
<div>+static inline void *vlc_gl_GetCoreProcAddress(vlc_gl_t *gl, const char *name)<br></div>
<div>+{<br></div>
<div>+    return gl->getCoreProcAddress ? gl->getCoreProcAddress(gl, name) : NULL;<br></div>
<div>+}<br></div>
<div>+<br></div>
<div> VLC_API vlc_gl_t *vlc_gl_surface_Create(vlc_object_t *,<br></div>
<div>                                         const struct vout_window_cfg_t *,<br></div>
<div>                                         struct vout_window_t **) VLC_USED;<br></div>
<div>diff --git a/modules/video_output/caopengllayer.m b/modules/video_output/caopengllayer.m<br></div>
<div>index b690ce0f21..57a89ae4f1 100644<br></div>
<div>--- a/modules/video_output/caopengllayer.m<br></div>
<div>+++ b/modules/video_output/caopengllayer.m<br></div>
<div>@@ -173,7 +173,7 @@ static int Open (vlc_object_t *p_this)<br></div>
<div>         sys->gl->makeCurrent = OpenglLock;<br></div>
<div>         sys->gl->releaseCurrent = OpenglUnlock;<br></div>
<div>         sys->gl->swap = OpenglSwap;<br></div>
<div>-        sys->gl->getProcAddress = OurGetProcAddress;<br></div>
<div>+        sys->gl->getProcAddress = sys->gl->getCoreProcAddress = OurGetProcAddress;<br></div>
<div> <br></div>
<div>         struct gl_sys *glsys = sys->gl->sys = malloc(sizeof(*glsys));<br></div>
<div>         if (!sys->gl->sys)<br></div>
<div>diff --git a/modules/video_output/glx.c b/modules/video_output/glx.c<br></div>
<div>index 17188f24b2..38b97db096 100644<br></div>
<div>--- a/modules/video_output/glx.c<br></div>
<div>+++ b/modules/video_output/glx.c<br></div>
<div>@@ -207,7 +207,7 @@ static int Open (vlc_object_t *obj)<br></div>
<div>     gl->releaseCurrent = ReleaseCurrent;<br></div>
<div>     gl->resize = NULL;<br></div>
<div>     gl->swap = SwapBuffers;<br></div>
<div>-    gl->getProcAddress = GetSymbol;<br></div>
<div>+    gl->getProcAddress = gl->getCoreProcAddress = GetSymbol;<br></div>
<div> <br></div>
<div>     bool is_swap_interval_set = false;<br></div>
<div> <br></div>
<div>diff --git a/modules/video_output/ios.m b/modules/video_output/ios.m<br></div>
<div>index 36075488b7..7daa0b2aa5 100644<br></div>
<div>--- a/modules/video_output/ios.m<br></div>
<div>+++ b/modules/video_output/ios.m<br></div>
<div>@@ -192,7 +192,7 @@ static int Open(vlc_object_t *this)<br></div>
<div>         sys->gl->makeCurrent = GLESMakeCurrent;<br></div>
<div>         sys->gl->releaseCurrent = GLESReleaseCurrent;<br></div>
<div>         sys->gl->swap = GLESSwap;<br></div>
<div>-        sys->gl->getProcAddress = OurGetProcAddress;<br></div>
<div>+        sys->gl->getProcAddress = sys->gl->getCoreProcAddress = OurGetProcAddress;<br></div>
<div> <br></div>
<div>         if (vlc_gl_MakeCurrent(sys->gl) != VLC_SUCCESS)<br></div>
<div>             goto bailout;<br></div>
<div>diff --git a/modules/video_output/macosx.m b/modules/video_output/macosx.m<br></div>
<div>index 406281db0d..967e8648ae 100644<br></div>
<div>--- a/modules/video_output/macosx.m<br></div>
<div>+++ b/modules/video_output/macosx.m<br></div>
<div>@@ -214,7 +214,7 @@ static int Open (vlc_object_t *this)<br></div>
<div>         sys->gl->makeCurrent = OpenglLock;<br></div>
<div>         sys->gl->releaseCurrent = OpenglUnlock;<br></div>
<div>         sys->gl->swap = OpenglSwap;<br></div>
<div>-        sys->gl->getProcAddress = OurGetProcAddress;<br></div>
<div>+        sys->gl->getProcAddress = sys->gl->getCoreProcAddress = OurGetProcAddress;<br></div>
<div> <br></div>
<div>         var_SetAddress(vd->obj.parent, "macosx-glcontext",<br></div>
<div>                        [[sys->glView openGLContext] CGLContextObj]);<br></div>
<div>diff --git a/modules/video_output/opengl/egl.c b/modules/video_output/opengl/egl.c<br></div>
<div>index 4543f2d66a..a300d37408 100644<br></div>
<div>--- a/modules/video_output/opengl/egl.c<br></div>
<div>+++ b/modules/video_output/opengl/egl.c<br></div>
<div>@@ -394,6 +394,10 @@ static int Open (vlc_object_t *obj, const struct gl_api *api)<br></div>
<div>     gl->resize = Resize;<br></div>
<div>     gl->swap = SwapBuffers;<br></div>
<div>     gl->getProcAddress = GetSymbol;<br></div>
<div>+    if (ext && vlc_gl_HasExtension(ext, "EGL_KHR_get_all_proc_addresses"))<br></div>
<div>+        gl->getCoreProcAddress = GetSymbol;<br></div>
<div>+    else<br></div>
<div>+        gl->getCoreProcAddress = NULL;<br></div>
<div>     gl->egl.queryString = QueryString;<br></div>
<div> <br></div>
<div>     sys->eglCreateImageKHR = (void *)eglGetProcAddress("eglCreateImageKHR");<br></div>
</pre></blockquote></div>
<div><br></div>
<div>--<br></div>
<div> Envoyé de mon appareil Android avec Courriel K-9 Mail. Veuillez excuser ma brièveté. <br></div>
<div><u>_______________________________________________</u><br></div>
<div>vlc-devel mailing list<br></div>
<div>To unsubscribe or modify your subscription options:<br></div>
<div><a href="https://mailman.videolan.org/listinfo/vlc-devel">https://mailman.videolan.org/listinfo/vlc-devel</a><br></div>
</blockquote><div><br></div>
</body>
</html>