[vlc-devel] [PATCH 1/3] video_output: don't use the private pool for the blend picture

Steve Lhomme robux4 at ycbcr.xyz
Fri Aug 14 10:59:43 CEST 2020


I don't think the allocation is expensive in this case as a buffer with 
the same size was allocated just before that.

A better design would be to let picture_BlendSubpicture() handle the 
output picture which will actually be done by the vlc_blender_t filter. 
That way it works the same as other filters and they can each handle the 
allocation better. In fact a GPU blender could do much better 
picture_NewFromResource.

This patch is only temporary because we need to handle the GPU blending 
case anyway.

On 2020-08-14 10:51, Thomas Guillem wrote:
> What about the cost of allocating a picture each time?
> 
> On Thu, Aug 13, 2020, at 14:13, Steve Lhomme wrote:
>> Create one on the fly each time. We don't need to preallocate some
>> pictures if we're never going to use them. Also we don't to know the target
>> format in advance.
>>
>> It may cause issues if the format is opaque. But this is currently not handled
>> either.
>> ---
>>   src/video_output/video_output.c | 5 ++---
>>   1 file changed, 2 insertions(+), 3 deletions(-)
>>
>> diff --git a/src/video_output/video_output.c
>> b/src/video_output/video_output.c
>> index dacb6a669a7..6097b9df7f9 100644
>> --- a/src/video_output/video_output.c
>> +++ b/src/video_output/video_output.c
>> @@ -1312,12 +1312,11 @@ static int
>> ThreadDisplayRenderPicture(vout_thread_sys_t *vout, bool is_forced)
>>       picture_t *snap_pic = todisplay;
>>       if (do_early_spu && subpic) {
>>           if (sys->spu_blend) {
>> -            picture_t *blent =
>> picture_pool_Get(sys->private.private_pool);
>> +            picture_t *blent =
>> picture_NewFromFormat(&filtered->format);
>>               if (blent) {
>> -                video_format_CopyCropAr(&blent->format,
>> &filtered->format);
>>                   picture_Copy(blent, filtered);
>>                   if (picture_BlendSubpicture(blent, sys->spu_blend,
>> subpic)) {
>> -                    picture_Release(todisplay);
>> +                    picture_Release(filtered);
>>                       snap_pic = todisplay = blent;
>>                   } else
>>                   {
>> -- 
>> 2.26.2
>>
>> _______________________________________________
>> vlc-devel mailing list
>> To unsubscribe or modify your subscription options:
>> https://mailman.videolan.org/listinfo/vlc-devel
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> https://mailman.videolan.org/listinfo/vlc-devel
> 


More information about the vlc-devel mailing list