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

Steve Lhomme robux4 at ycbcr.xyz
Fri Jul 31 06:31:49 CEST 2020


On 2020-07-30 18:26, Rémi Denis-Courmont wrote:
> 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.

The idea is to use picture_Copy() which uses picture_CopyPixels() which 
calls plane_CopyPixels(). I guess we could bypass the in-between calls 
and only use plane_CopyPixels(). And not use a picture anymore.

But I'd rather concentrate on cleaning the picture API before modifying 
the internals of (many) models which requires a bit more testing than 
just moving the code around.


More information about the vlc-devel mailing list