[vlc-devel] [PATCH 5/6] video_output: don't use always NULL OpenGL pool callback

Steve Lhomme robux4 at ycbcr.xyz
Mon Dec 23 14:04:24 CET 2019


Since vout_display_opengl_HasPool() always returns false.
---
 modules/video_output/caopengllayer.m  | 16 ----------------
 modules/video_output/ios.m            | 17 -----------------
 modules/video_output/macosx.m         | 16 ----------------
 modules/video_output/opengl/display.c | 19 -------------------
 modules/video_output/win32/glwin32.c  | 15 ---------------
 5 files changed, 83 deletions(-)

diff --git a/modules/video_output/caopengllayer.m b/modules/video_output/caopengllayer.m
index 57af6a01ff0..afe6d6a3f7b 100644
--- a/modules/video_output/caopengllayer.m
+++ b/modules/video_output/caopengllayer.m
@@ -58,7 +58,6 @@ vlc_module_begin()
     set_callback_display(Open, 0)
 vlc_module_end()
 
-static picture_pool_t *Pool (vout_display_t *vd, unsigned requested_count);
 static void PictureRender   (vout_display_t *vd, picture_t *pic, subpicture_t *subpicture,
                              vlc_tick_t date);
 static void PictureDisplay  (vout_display_t *vd, picture_t *pic);
@@ -85,8 +84,6 @@ static void OpenglSwap         (vlc_gl_t *gl);
 
 struct vout_display_sys_t {
 
-    picture_pool_t *pool;
-
     CALayer <VLCCoreAnimationVideoLayerEmbedding> *container;
     vout_window_t *embed;
     VLCCAOpenGLLayer *cgLayer;
@@ -196,7 +193,6 @@ static int Open (vout_display_t *vd, const vout_display_cfg_t *cfg,
         /* setup vout display */
         vd->info.subpicture_chromas = subpicture_chromas;
 
-        vd->pool    = vout_display_opengl_HasPool(sys->vgl) ? Pool : NULL;
         vd->prepare = PictureRender;
         vd->display = PictureDisplay;
         vd->control = Control;
@@ -262,18 +258,6 @@ static void Close(vout_display_t *vd)
     free(sys);
 }
 
-static picture_pool_t *Pool (vout_display_t *vd, unsigned count)
-{
-    vout_display_sys_t *sys = vd->sys;
-
-    if (!sys->pool && !OpenglLock(sys->gl)) {
-        sys->pool = vout_display_opengl_GetPool(sys->vgl, count);
-        OpenglUnlock(sys->gl);
-        assert(sys->pool);
-    }
-    return sys->pool;
-}
-
 static void PictureRender (vout_display_t *vd, picture_t *pic, subpicture_t *subpicture,
                            vlc_tick_t date)
 {
diff --git a/modules/video_output/ios.m b/modules/video_output/ios.m
index 2816476836f..5ef0a273287 100644
--- a/modules/video_output/ios.m
+++ b/modules/video_output/ios.m
@@ -54,7 +54,6 @@ static int Open(vout_display_t *vd, const vout_display_cfg_t *cfg,
                 video_format_t *fmt, vlc_video_context *context);
 static void Close(vout_display_t *vd);
 
-static picture_pool_t* PicturePool(vout_display_t *, unsigned);
 static void PictureRender(vout_display_t *, picture_t *, subpicture_t *, vlc_tick_t);
 static void PictureDisplay(vout_display_t *, picture_t *);
 static int Control(vout_display_t*, int, va_list);
@@ -121,7 +120,6 @@ struct vout_display_sys_t
 
     vlc_gl_t *gl;
 
-    picture_pool_t *picturePool;
     vout_window_t *embed;
 };
 
@@ -153,7 +151,6 @@ static int Open(vout_display_t *vd, const vout_display_cfg_t *cfg,
         return VLC_ENOMEM;
 
     vd->sys = sys;
-    sys->picturePool = NULL;
     sys->gl = NULL;
 
     var_Create(vlc_object_parent(vd), "ios-eaglcontext", VLC_VAR_ADDRESS);
@@ -207,7 +204,6 @@ static int Open(vout_display_t *vd, const vout_display_cfg_t *cfg,
         /* Setup vout_display_t once everything is fine */
         vd->info.subpicture_chromas = subpicture_chromas;
 
-        vd->pool    = vout_display_opengl_HasPool(vgl) ? PicturePool : NULL;
         vd->prepare = PictureRender;
         vd->display = PictureDisplay;
         vd->control = Control;
@@ -314,19 +310,6 @@ static void PictureRender(vout_display_t *vd, picture_t *pic, subpicture_t *subp
     }
 }
 
-static picture_pool_t *PicturePool(vout_display_t *vd, unsigned requested_count)
-{
-    vout_display_sys_t *sys = vd->sys;
-    struct gl_sys *glsys = sys->gl->sys;
-
-    if (!sys->picturePool && vlc_gl_MakeCurrent(sys->gl) == VLC_SUCCESS)
-    {
-        sys->picturePool = vout_display_opengl_GetPool(glsys->vgl, requested_count);
-        vlc_gl_ReleaseCurrent(sys->gl);
-    }
-    return sys->picturePool;
-}
-
 /*****************************************************************************
  * vout opengl callbacks
  *****************************************************************************/
diff --git a/modules/video_output/macosx.m b/modules/video_output/macosx.m
index edc793b2d59..33a5e26e791 100644
--- a/modules/video_output/macosx.m
+++ b/modules/video_output/macosx.m
@@ -55,7 +55,6 @@ static int Open(vout_display_t *vd, const vout_display_cfg_t *cfg,
                 video_format_t *fmt, vlc_video_context *context);
 static void Close(vout_display_t *vd);
 
-static picture_pool_t *Pool (vout_display_t *vd, unsigned requested_count);
 static void PictureRender (vout_display_t *vd, picture_t *pic, subpicture_t *subpicture,
                            vlc_tick_t date);
 static void PictureDisplay (vout_display_t *vd, picture_t *pic);
@@ -108,7 +107,6 @@ struct vout_display_sys_t
     vlc_gl_t *gl;
     vout_display_opengl_t *vgl;
 
-    picture_pool_t *pool;
     picture_t *current;
     bool has_first_frame;
 
@@ -145,7 +143,6 @@ static int Open (vout_display_t *vd, const vout_display_cfg_t *cfg,
             msg_Err (vd, "no OpenGL hardware acceleration found. this can lead to slow output and unexpected results");
 
         vd->sys = sys;
-        sys->pool = NULL;
         sys->embed = NULL;
         sys->vgl = NULL;
         sys->gl = NULL;
@@ -239,7 +236,6 @@ static int Open (vout_display_t *vd, const vout_display_cfg_t *cfg,
         /* Setup vout_display_t once everything is fine */
         vd->info.subpicture_chromas = subpicture_chromas;
 
-        vd->pool    = vout_display_opengl_HasPool(sys->vgl) ? Pool : NULL;
         vd->prepare = PictureRender;
         vd->display = PictureDisplay;
         vd->control = Control;
@@ -303,18 +299,6 @@ static void Close(vout_display_t *vd)
  * vout display callbacks
  *****************************************************************************/
 
-static picture_pool_t *Pool (vout_display_t *vd, unsigned requested_count)
-{
-    vout_display_sys_t *sys = vd->sys;
-
-    if (!sys->pool && vlc_gl_MakeCurrent(sys->gl) == VLC_SUCCESS)
-    {
-        sys->pool = vout_display_opengl_GetPool (sys->vgl, requested_count);
-        vlc_gl_ReleaseCurrent(sys->gl);
-    }
-    return sys->pool;
-}
-
 static void PictureRender (vout_display_t *vd, picture_t *pic, subpicture_t *subpicture,
                            vlc_tick_t date)
 {
diff --git a/modules/video_output/opengl/display.c b/modules/video_output/opengl/display.c
index cc9989ec056..1afd227bf6d 100644
--- a/modules/video_output/opengl/display.c
+++ b/modules/video_output/opengl/display.c
@@ -72,13 +72,11 @@ struct vout_display_sys_t
 {
     vout_display_opengl_t *vgl;
     vlc_gl_t *gl;
-    picture_pool_t *pool;
     vout_display_place_t place;
     bool place_changed;
 };
 
 /* Display callbacks */
-static picture_pool_t *Pool (vout_display_t *, unsigned);
 static void PictureRender (vout_display_t *, picture_t *, subpicture_t *, vlc_tick_t);
 static void PictureDisplay (vout_display_t *, picture_t *);
 static int Control (vout_display_t *, int, va_list);
@@ -94,7 +92,6 @@ static int Open(vout_display_t *vd, const vout_display_cfg_t *cfg,
         return VLC_ENOMEM;
 
     sys->gl = NULL;
-    sys->pool = NULL;
     sys->place_changed = false;
 
     vout_window_t *surface = cfg->window;
@@ -146,7 +143,6 @@ static int Open(vout_display_t *vd, const vout_display_cfg_t *cfg,
 
     vd->sys = sys;
     vd->info.subpicture_chromas = spu_chromas;
-    vd->pool    = vout_display_opengl_HasPool(sys->vgl) ? Pool : NULL;
     vd->prepare = PictureRender;
     vd->display = PictureDisplay;
     vd->control = Control;
@@ -176,21 +172,6 @@ static void Close(vout_display_t *vd)
     free (sys);
 }
 
-/**
- * Returns picture buffers
- */
-static picture_pool_t *Pool (vout_display_t *vd, unsigned count)
-{
-    vout_display_sys_t *sys = vd->sys;
-
-    if (!sys->pool && vlc_gl_MakeCurrent (sys->gl) == VLC_SUCCESS)
-    {
-        sys->pool = vout_display_opengl_GetPool (sys->vgl, count);
-        vlc_gl_ReleaseCurrent (sys->gl);
-    }
-    return sys->pool;
-}
-
 static void PictureRender (vout_display_t *vd, picture_t *pic, subpicture_t *subpicture,
                            vlc_tick_t date)
 {
diff --git a/modules/video_output/win32/glwin32.c b/modules/video_output/win32/glwin32.c
index 2cc9cadba33..34c922b4a5f 100644
--- a/modules/video_output/win32/glwin32.c
+++ b/modules/video_output/win32/glwin32.c
@@ -64,13 +64,11 @@ struct vout_display_sys_t
 
     vlc_gl_t              *gl;
     vout_display_opengl_t *vgl;
-    picture_pool_t        *pool;
 
     /* Sensors */
     void *p_sensors;
 };
 
-static picture_pool_t *Pool  (vout_display_t *, unsigned);
 static void           Prepare(vout_display_t *, picture_t *, subpicture_t *, vlc_tick_t);
 static void           Display(vout_display_t *, picture_t *);
 
@@ -162,7 +160,6 @@ static int Open(vout_display_t *vd, const vout_display_cfg_t *cfg,
 
     *fmtp    = fmt;
 
-    vd->pool    = vout_display_opengl_HasPool(sys->vgl) ? Pool : NULL;
     vd->prepare = Prepare;
     vd->display = Display;
     vd->control = Control;
@@ -203,18 +200,6 @@ static void Close(vout_display_t *vd)
 }
 
 /* */
-static picture_pool_t *Pool(vout_display_t *vd, unsigned count)
-{
-    vout_display_sys_t *sys = vd->sys;
-
-    if (!sys->pool && vlc_gl_MakeCurrent (sys->gl) == VLC_SUCCESS)
-    {
-        sys->pool = vout_display_opengl_GetPool(sys->vgl, count);
-        vlc_gl_ReleaseCurrent (sys->gl);
-    }
-    return sys->pool;
-}
-
 static void Prepare(vout_display_t *vd, picture_t *picture, subpicture_t *subpicture,
                     vlc_tick_t date)
 {
-- 
2.17.1



More information about the vlc-devel mailing list