[vlc-commits] opengl: rename vtable fields to snake_case

Alexandre Janniaux git at videolan.org
Wed Jul 22 15:28:09 CEST 2020


vlc | branch: master | Alexandre Janniaux <ajanni at videolabs.io> | Thu Jun 25 12:06:17 2020 +0200| [8550ee8cd4bae58038f8c8851616f98cd4c9019c] | committer: Alexandre Janniaux

opengl: rename vtable fields to snake_case

Uniformize the virtual table function name with other VLC opengl API
exposed to the plugin users.

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

 include/vlc_opengl.h                 | 12 ++++++------
 modules/video_output/caopengllayer.m |  6 +++---
 modules/video_output/glx.c           |  6 +++---
 modules/video_output/ios.m           |  6 +++---
 modules/video_output/macosx.m        |  6 +++---
 modules/video_output/opengl/egl.c    |  6 +++---
 modules/video_output/vgl.c           |  6 +++---
 modules/video_output/win32/wgl.c     |  6 +++---
 src/video_output/opengl.c            |  4 ++--
 9 files changed, 29 insertions(+), 29 deletions(-)

diff --git a/include/vlc_opengl.h b/include/vlc_opengl.h
index 4e436c939b..79e165e72b 100644
--- a/include/vlc_opengl.h
+++ b/include/vlc_opengl.h
@@ -46,11 +46,11 @@ struct vlc_gl_t
     module_t *module;
     void *sys;
 
-    int  (*makeCurrent)(vlc_gl_t *);
-    void (*releaseCurrent)(vlc_gl_t *);
+    int  (*make_current)(vlc_gl_t *);
+    void (*release_current)(vlc_gl_t *);
     void (*resize)(vlc_gl_t *, unsigned, unsigned);
     void (*swap)(vlc_gl_t *);
-    void*(*getProcAddress)(vlc_gl_t *, const char *);
+    void*(*get_proc_address)(vlc_gl_t *, const char *);
     void (*destroy)(vlc_gl_t *);
 
     enum {
@@ -101,12 +101,12 @@ VLC_API void vlc_gl_Hold(vlc_gl_t *);
 
 static inline int vlc_gl_MakeCurrent(vlc_gl_t *gl)
 {
-    return gl->makeCurrent(gl);
+    return gl->make_current(gl);
 }
 
 static inline void vlc_gl_ReleaseCurrent(vlc_gl_t *gl)
 {
-    gl->releaseCurrent(gl);
+    gl->release_current(gl);
 }
 
 static inline void vlc_gl_Resize(vlc_gl_t *gl, unsigned w, unsigned h)
@@ -122,7 +122,7 @@ static inline void vlc_gl_Swap(vlc_gl_t *gl)
 
 static inline void *vlc_gl_GetProcAddress(vlc_gl_t *gl, const char *name)
 {
-    return gl->getProcAddress(gl, name);
+    return gl->get_proc_address(gl, name);
 }
 
 VLC_API vlc_gl_t *vlc_gl_surface_Create(vlc_object_t *,
diff --git a/modules/video_output/caopengllayer.m b/modules/video_output/caopengllayer.m
index 10fccdf90d..08e88f42aa 100644
--- a/modules/video_output/caopengllayer.m
+++ b/modules/video_output/caopengllayer.m
@@ -167,10 +167,10 @@ static int Open (vout_display_t *vd, const vout_display_cfg_t *cfg,
         sys->gl = vlc_object_create(vd, sizeof(*sys->gl));
         if (unlikely(!sys->gl))
             goto bailout;
-        sys->gl->makeCurrent = OpenglLock;
-        sys->gl->releaseCurrent = OpenglUnlock;
+        sys->gl->make_current = OpenglLock;
+        sys->gl->release_current = OpenglUnlock;
         sys->gl->swap = OpenglSwap;
-        sys->gl->getProcAddress = OurGetProcAddress;
+        sys->gl->get_proc_address = OurGetProcAddress;
 
         struct gl_sys *glsys = sys->gl->sys = malloc(sizeof(*glsys));
         if (!sys->gl->sys)
diff --git a/modules/video_output/glx.c b/modules/video_output/glx.c
index 6ec5a2bb31..897660910f 100644
--- a/modules/video_output/glx.c
+++ b/modules/video_output/glx.c
@@ -214,11 +214,11 @@ static int Open(vlc_gl_t *gl, unsigned width, unsigned height)
 
     /* Initialize OpenGL callbacks */
     gl->sys = sys;
-    gl->makeCurrent = MakeCurrent;
-    gl->releaseCurrent = ReleaseCurrent;
+    gl->make_current = MakeCurrent;
+    gl->release_current = ReleaseCurrent;
     gl->resize = NULL;
     gl->swap = SwapBuffers;
-    gl->getProcAddress = GetSymbol;
+    gl->get_proc_address = GetSymbol;
     gl->destroy = Close;
 
     bool is_swap_interval_set = false;
diff --git a/modules/video_output/ios.m b/modules/video_output/ios.m
index 3bcf084d5c..6fbeaa49af 100644
--- a/modules/video_output/ios.m
+++ b/modules/video_output/ios.m
@@ -185,10 +185,10 @@ static int Open(vout_display_t *vd, const vout_display_cfg_t *cfg,
         glsys->renderBuffer = glsys->frameBuffer = 0;
 
         /* Initialize common OpenGL video display */
-        sys->gl->makeCurrent = GLESMakeCurrent;
-        sys->gl->releaseCurrent = GLESReleaseCurrent;
+        sys->gl->make_current = GLESMakeCurrent;
+        sys->gl->release_current = GLESReleaseCurrent;
         sys->gl->swap = GLESSwap;
-        sys->gl->getProcAddress = OurGetProcAddress;
+        sys->gl->get_proc_address = OurGetProcAddress;
 
         if (vlc_gl_MakeCurrent(sys->gl) != VLC_SUCCESS)
             goto bailout;
diff --git a/modules/video_output/macosx.m b/modules/video_output/macosx.m
index 5e0a10af6f..a1bee8fb12 100644
--- a/modules/video_output/macosx.m
+++ b/modules/video_output/macosx.m
@@ -210,10 +210,10 @@ static int Open (vout_display_t *vd, const vout_display_cfg_t *cfg,
         }
         glsys->locked_ctx = NULL;
         glsys->glView = sys->glView;
-        sys->gl->makeCurrent = OpenglLock;
-        sys->gl->releaseCurrent = OpenglUnlock;
+        sys->gl->make_current = OpenglLock;
+        sys->gl->release_current = OpenglUnlock;
         sys->gl->swap = OpenglSwap;
-        sys->gl->getProcAddress = OurGetProcAddress;
+        sys->gl->get_proc_address = OurGetProcAddress;
 
         var_SetAddress(vlc_object_parent(vd), "macosx-glcontext",
                        [[sys->glView openGLContext] CGLContextObj]);
diff --git a/modules/video_output/opengl/egl.c b/modules/video_output/opengl/egl.c
index c1c19462c9..ba589cbae7 100644
--- a/modules/video_output/opengl/egl.c
+++ b/modules/video_output/opengl/egl.c
@@ -377,11 +377,11 @@ static int Open(vlc_gl_t *gl, const struct gl_api *api,
 
     /* Initialize OpenGL callbacks */
     gl->ext = VLC_GL_EXT_EGL;
-    gl->makeCurrent = MakeCurrent;
-    gl->releaseCurrent = ReleaseCurrent;
+    gl->make_current = MakeCurrent;
+    gl->release_current = ReleaseCurrent;
     gl->resize = Resize;
     gl->swap = SwapBuffers;
-    gl->getProcAddress = GetSymbol;
+    gl->get_proc_address = GetSymbol;
     gl->destroy = Close;
     gl->egl.queryString = QueryString;
 
diff --git a/modules/video_output/vgl.c b/modules/video_output/vgl.c
index 40487ea247..5302e3186f 100644
--- a/modules/video_output/vgl.c
+++ b/modules/video_output/vgl.c
@@ -141,11 +141,11 @@ static int Open(vlc_gl_t *gl, unsigned width, unsigned height)
     SET_CALLBACK_ADDR(sys->makeCurrentCb, "vout-cb-make-current");
     SET_CALLBACK_ADDR(sys->getProcAddressCb, "vout-cb-get-proc-address");
 
-    gl->makeCurrent = MakeCurrent;
-    gl->releaseCurrent = ReleaseCurrent;
+    gl->make_current = MakeCurrent;
+    gl->release_current = ReleaseCurrent;
     gl->resize = Resize;
     gl->swap = VglSwapBuffers;
-    gl->getProcAddress = OurGetProcAddress;
+    gl->get_proc_address = OurGetProcAddress;
     gl->destroy = Close;
 
     if( sys->setupCb )
diff --git a/modules/video_output/win32/wgl.c b/modules/video_output/win32/wgl.c
index 2764699623..ec02c2dc6e 100644
--- a/modules/video_output/win32/wgl.c
+++ b/modules/video_output/win32/wgl.c
@@ -230,11 +230,11 @@ static int Open(vlc_gl_t *gl, unsigned width, unsigned height)
     wglMakeCurrent(sys->hGLDC, NULL);
 
     gl->ext = VLC_GL_EXT_WGL;
-    gl->makeCurrent = MakeCurrent;
-    gl->releaseCurrent = ReleaseCurrent;
+    gl->make_current = MakeCurrent;
+    gl->release_current = ReleaseCurrent;
     gl->resize = NULL;
     gl->swap = Swap;
-    gl->getProcAddress = OurGetProcAddress;
+    gl->get_proc_address = OurGetProcAddress;
     gl->destroy = Close;
 
     if (sys->exts.GetExtensionsStringEXT || sys->exts.GetExtensionsStringARB)
diff --git a/src/video_output/opengl.c b/src/video_output/opengl.c
index 99ba7b29e7..e5aa450888 100644
--- a/src/video_output/opengl.c
+++ b/src/video_output/opengl.c
@@ -84,8 +84,8 @@ vlc_gl_t *vlc_gl_Create(const struct vout_display_cfg *restrict cfg,
         vlc_object_delete(gl);
         return NULL;
     }
-    assert(gl->makeCurrent && gl->releaseCurrent && gl->swap
-        && gl->getProcAddress);
+    assert(gl->make_current && gl->release_current && gl->swap
+        && gl->get_proc_address);
     vlc_atomic_rc_init(&glpriv->rc);
 
     return &glpriv->gl;



More information about the vlc-commits mailing list