[vlc-devel] [PATCH 2/2] kms: don't use a pool with a single picture
Steve Lhomme
robux4 at ycbcr.xyz
Tue Feb 26 09:24:30 CET 2019
Use a regular software pool and copy in the mapped surface during Prepare().
---
modules/video_output/kms.c | 31 ++++++++++---------------------
1 file changed, 10 insertions(+), 21 deletions(-)
diff --git a/modules/video_output/kms.c b/modules/video_output/kms.c
index 6a5e9dbb19..d51d5e1871 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;
@@ -632,20 +631,6 @@ static void CustomDestroyPicture(picture_t *p_picture)
}
-static picture_pool_t *Pool(vout_display_t *vd, unsigned count)
-{
- VLC_UNUSED(count);
- vout_display_sys_t *sys = vd->sys;
- picture_sys_t *psys;
- int i;
-
- if (!sys->pool)
- sys->pool = picture_pool_New(1, &sys->picture);
-
- return sys->pool;
-}
-
-
static void Display(vout_display_t *vd, picture_t *picture)
{
VLC_UNUSED(picture);
@@ -669,6 +654,14 @@ static void Display(vout_display_t *vd, picture_t *picture)
}
}
+static void Prepare(vout_display_t *vd, picture_t *picture, subpicture_t *subpic,
+ vlc_tick_t date)
+{
+ VLC_UNUSED(subpic);
+ VLC_UNUSED(date);
+ vout_display_sys_t *sys = vd->sys;
+ picture_CopyPixels(sys->picture, picture);
+}
/**
* Terminate an output method created by Open
@@ -677,10 +670,7 @@ static void Close(vout_display_t *vd)
{
vout_display_sys_t *sys = vd->sys;
- if (sys->pool)
- picture_pool_Release(sys->pool);
- else
- picture_Release(sys->picture);
+ picture_Release(sys->picture);
if (sys->drm_fd)
drmDropMaster(sys->drm_fd);
@@ -756,8 +746,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;
--
2.17.1
More information about the vlc-devel
mailing list