[vlc-commits] kms: copy the planes during the Prepare

Steve Lhomme git at videolan.org
Mon Dec 9 09:01:34 CET 2019


vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Mon Nov 18 12:08:55 2019 +0100| [d4b93b397b4ca66e9142a44bc19dc5270ef4702b] | committer: Steve Lhomme

kms: copy the planes during the Prepare

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.

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

 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 56ece3bb1b..34ef0b0df5 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;



More information about the vlc-commits mailing list