[vlc-devel] [PATCH 16/19] vout: fb: set the picture planes once the picture is created

Rémi Denis-Courmont remi at remlab.net
Thu Jul 30 18:26:05 CEST 2020


Le torstaina 30. heinäkuuta 2020, 15.16.57 EEST Steve Lhomme a écrit :
> ---
>  modules/video_output/fb.c | 17 +++++------------
>  1 file changed, 5 insertions(+), 12 deletions(-)
> 
> diff --git a/modules/video_output/fb.c b/modules/video_output/fb.c
> index 60910d6dba1..223d3c1b0bd 100644
> --- a/modules/video_output/fb.c
> +++ b/modules/video_output/fb.c
> @@ -596,22 +596,15 @@ static int OpenDisplay(vout_display_t *vd, bool
> force_resolution) return VLC_EGENERIC;
>      }
> 
> -    picture_resource_t rsc = {
> -       .p = {
> -           [0] = {
> -               .p_pixels = sys->video_ptr,
> -               .i_lines = sys->var_info.yres,
> -               .i_pitch = fix_info.line_length,
> -           },
> -       },
> -    };
> -
> -    sys->picture = picture_NewFromResource(&vd->fmt, NULL, &rsc);
> +    sys->picture = picture_NewFromResource(&vd->fmt, NULL, NULL);
>      if (unlikely(sys->picture == NULL)) {
> -        munmap(rsc.p[0].p_pixels, sys->video_size);
> +        munmap(sys->video_ptr, sys->video_size);
>          ioctl(sys->fd, FBIOPUT_VSCREENINFO, &sys->old_info);
>          return VLC_ENOMEM;
>      }
> +    sys->picture->p[0].p_pixels = sys->video_ptr;
> +    sys->picture->p[0].i_lines = sys->var_info.yres;
> +    sys->picture->p[0].i_pitch = fix_info.line_length;
> 
>      ClearScreen(sys);

This should probably not use picture_t at all.

-- 
雷米‧德尼-库尔蒙
http://www.remlab.net/





More information about the vlc-devel mailing list