[vlc-devel] [PATCH 3/3] kms: copy the planes during the Prepare

Steve Lhomme robux4 at ycbcr.xyz
Mon Dec 2 15:30:18 CET 2019


In most cases the pool with just one picture could not work with decoders
directly. It only worked because there was most likely a converter used that
would end up writing in this picture, since it doesn't handle I420.
---
 modules/video_output/kms.c | 22 +++++++---------------
 1 file changed, 7 insertions(+), 15 deletions(-)

diff --git a/modules/video_output/kms.c b/modules/video_output/kms.c
index 56ece3bb1be..34ef0b0df54 100644
--- a/modules/video_output/kms.c
+++ b/modules/video_output/kms.c
@@ -82,7 +82,6 @@ struct vout_display_sys_t {
 
     uint32_t        fb[MAXHWBUF];
     picture_t       *picture;
-    picture_pool_t  *pool;
 
     unsigned int    front_buf;
 
@@ -613,13 +612,6 @@ static int OpenDisplay(vout_display_t *vd)
         goto err_out;
     }
 
-    sys->pool = picture_pool_New(1, &sys->picture);
-    if (!sys->pool) {
-        picture_Release(sys->picture);
-        free(psys);
-        goto error;
-    }
-
     return VLC_SUCCESS;
 err_out:
     drmDropMaster(sys->drm_fd);
@@ -645,11 +637,12 @@ static int Control(vout_display_t *vd, int query, va_list args)
 }
 
 
-static picture_pool_t *Pool(vout_display_t *vd, unsigned count)
+static void Prepare(vout_display_t *vd, picture_t *pic, subpicture_t *subpic,
+                    vlc_tick_t date)
 {
-    VLC_UNUSED(count);
+    VLC_UNUSED(subpic); VLC_UNUSED(date);
     vout_display_sys_t *sys = vd->sys;
-    return sys->pool;
+    picture_Copy( sys->picture, pic );
 }
 
 
@@ -684,8 +677,8 @@ static void Close(vout_display_t *vd)
 {
     vout_display_sys_t *sys = vd->sys;
 
-    if (sys->pool)
-        picture_pool_Release(sys->pool);
+    if (sys->picture)
+        picture_Release(sys->picture);
 
     if (sys->drm_fd)
         drmDropMaster(sys->drm_fd);
@@ -761,8 +754,7 @@ static int Open(vout_display_t *vd, const vout_display_cfg_t *cfg,
     fmt.i_chroma = sys->vlc_fourcc;
     *fmtp = fmt;
 
-    vd->pool    = Pool;
-    vd->prepare = NULL;
+    vd->prepare = Prepare;
     vd->display = Display;
     vd->control = Control;
     vd->close = Close;
-- 
2.17.1



More information about the vlc-devel mailing list