[vlc-commits] opengl: return an error code from the resize callback

Steve Lhomme git at videolan.org
Wed Jan 16 11:06:52 CET 2019


vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Wed Jan 16 10:57:02 2019 +0100| [a82615d70021f36d5a6dd01b1c2041b26a0cded6] | committer: Steve Lhomme

opengl: return an error code from the resize callback

It may not always work.

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

 include/vlc_opengl.h              | 2 +-
 modules/video_output/opengl/egl.c | 1 +
 modules/video_output/vgl.c        | 8 +++++---
 3 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/include/vlc_opengl.h b/include/vlc_opengl.h
index 57a1e71c3b..25e28934fa 100644
--- a/include/vlc_opengl.h
+++ b/include/vlc_opengl.h
@@ -47,7 +47,7 @@ struct vlc_gl_t
 
     int  (*makeCurrent)(vlc_gl_t *);
     void (*releaseCurrent)(vlc_gl_t *);
-    void (*resize)(vlc_gl_t *, unsigned, unsigned);
+    int (*resize)(vlc_gl_t *, unsigned, unsigned);
     void (*swap)(vlc_gl_t *);
     void*(*getProcAddress)(vlc_gl_t *, const char *);
 
diff --git a/modules/video_output/opengl/egl.c b/modules/video_output/opengl/egl.c
index dec85f86ac..801e4d9c0f 100644
--- a/modules/video_output/opengl/egl.c
+++ b/modules/video_output/opengl/egl.c
@@ -82,6 +82,7 @@ static void Resize (vlc_gl_t *gl, unsigned width, unsigned height)
     vlc_gl_sys_t *sys = gl->sys;
 
     wl_egl_window_resize(sys->window, width, height, 0, 0);
+    return VLC_SUCCESS;
 }
 #else
 # define Resize (NULL)
diff --git a/modules/video_output/vgl.c b/modules/video_output/vgl.c
index e08ffa2916..ee7eb95fbb 100644
--- a/modules/video_output/vgl.c
+++ b/modules/video_output/vgl.c
@@ -69,14 +69,14 @@ static void VglSwapBuffers(vlc_gl_t *gl)
     sys->swapCb(sys->opaque);
 }
 
-static void Resize(vlc_gl_t * gl, unsigned w, unsigned h)
+static int Resize(vlc_gl_t * gl, unsigned w, unsigned h)
 {
     vout_display_sys_t *sys = gl->sys;
     if( sys->width == w && sys->height == h )
-        return;
+        return VLC_SUCCESS;
 
     if( !sys->resizeCb )
-        return;
+        return VLC_SUCCESS;
 
     MakeCurrent(gl);
     bool success = sys->resizeCb(sys->opaque, w, h);
@@ -85,7 +85,9 @@ static void Resize(vlc_gl_t * gl, unsigned w, unsigned h)
     {
         sys->width = w;
         sys->height = h;
+        return VLC_SUCCESS;
     }
+    return VLC_EGENERIC;
 }
 
 static void Close(vlc_object_t *object)



More information about the vlc-commits mailing list