[vlc-devel] [PATCH v2 14/14] picture: always copy context when cloning

Steve Lhomme robux4 at ycbcr.xyz
Mon Aug 17 09:12:00 CEST 2020


On 2020-08-14 17:48, Rémi Denis-Courmont wrote:
> Le perjantaina 14. elokuuta 2020, 15.01.49 EEST Steve Lhomme a écrit :
>> From: Alexandre Janniaux <ajanni at videolabs.io>
>>
> 
> p...
> 
>> icture_Clone was copying the original picture context into the new
>> clone while picture_pool_Clone wasn't. As it is possible to create a
>> pool from existing pictures, it's quite handy to be able to associate
>> the graphical resources needed for each picture to their context so
>> that it can be retrieved after a call to picture_pool_Wait/Get.
>>
>> The rationale is that because resources like pixels are shared between
>> the original picture and the clone, we should probably do the same with
>> picture_context and have a unified way for picture producer to
>> reference such resources.
> 
> Not sure this will work. Originally, picture context was specifically meant to
> work-around the pool and not do that.

Yes, but thing have changed. Now the picture_context_t holds the 
(reference counted) vlc_video_context. It is used to get some extra 
information that are not contained in the video_format_t.

> What is the practical use case, and why can't it use picture_t.sys?

I think picture_t.sys + gc and picture_context_t (with a gc, vctx and 
some extra private data that can be accessed with container_of) there's 
one too many. I think the later should be kept. It has shown some good 
flexibility.


More information about the vlc-devel mailing list