[vlc-devel] [PATCH 17/19] vout: kms: set the picture planes once the picture is created
Rémi Denis-Courmont
remi at remlab.net
Thu Jul 30 18:26:57 CEST 2020
Le torstaina 30. heinäkuuta 2020, 15.16.58 EEST Steve Lhomme a écrit :
> ---
> modules/video_output/kms.c | 16 +++++++---------
> 1 file changed, 7 insertions(+), 9 deletions(-)
>
> diff --git a/modules/video_output/kms.c b/modules/video_output/kms.c
> index a9d24f8a7b1..33ca309562b 100644
> --- a/modules/video_output/kms.c
> +++ b/modules/video_output/kms.c
> @@ -576,19 +576,17 @@ static int OpenDisplay(vout_display_t *vd)
> if (!found_connector)
> goto err_out;
>
> - picture_resource_t rsc = {};
> -
> - for (size_t i = 0; i < PICTURE_PLANE_MAX; i++) {
> - rsc.p[i].p_pixels = sys->map[0] + sys->offsets[i];
> - rsc.p[i].i_lines = sys->height;
> - rsc.p[i].i_pitch = sys->stride;
> - }
> -
> - sys->picture = picture_NewFromResource(&vd->fmt, NULL, &rsc);
> + sys->picture = picture_NewFromResource(&vd->fmt, NULL, NULL);
>
> if (!sys->picture)
> goto err_out;
>
> + for (size_t i = 0; i < sys->picture->i_planes; i++) {
> + sys->picture->p[i].p_pixels = sys->map[0] + sys->offsets[i];
> + sys->picture->p[i].i_lines = sys->height;
> + sys->picture->p[i].i_pitch = sys->stride;
> + }
> +
> return VLC_SUCCESS;
> err_out:
> drmDropMaster(sys->drm_fd);
Like FrameBuffer, I don't really get why a video output would still need to
allocate picture_t objects. There's nothing to trade it with any longer.
--
Rémi Denis-Courmont
http://www.remlab.net/
More information about the vlc-devel
mailing list