[vlc-devel] [PATCH 01/34] picture: add a video context to the picture

Steve Lhomme robux4 at ycbcr.xyz
Tue Nov 12 08:24:18 CET 2019

On 2019-11-09 3:40, Rémi Denis-Courmont wrote:
> Le vendredi 8 novembre 2019, 16:40:05 EET Steve Lhomme a écrit :
>> The video context is only held if the picture is created successfully. It is
>> released after the picture is destroyed.
> Seems redundant with existing picture context, which typically refers to the
> video context in a way or other - unless the goal is to remove the picture
> context - which seems unrealistic to me.
> Maybe we should actually "standardize" the reference from the picture context
> to the video context, but I don't see the need for yet another member in
> crowded picture_t.

Adding the video context to the picture is exactly what was decided with 
push. The fact it's also used the first time the vout is initialized is 
a necessary mean to get there. In some of the proposed patches the video 
context from the picture is already used as such instead of getting it 
from the decoder/filter.

I agree there's probably one too many between the picture_sys_t, the 
picture_context_t and the video_context. At least the video context 
exists on its own without a picture (as already used in current master). 
Adding the destroy/clone callbacks from the picture_context_t would make 
no sense when used without a picture.

The picture_sys is probably a better candidate to remove from the 
picture. In D3D the picture_context_t already has a picture_sys_t 
because they may exist in some cases and not others (depending if they 
came from the decoder or the display). All this will be gradually 
removed and ultimately there won't be any picture_sys_t there. I think 
it can be the same for other formats.

This cleaning should happen at the end though. We can only guarantee the 
picture_sys_t is not needed anymore once eveything is safely moved there 
and the picture_sys_t are never used anymore. For now I'm concentrating 
on architectural changes.

More information about the vlc-devel mailing list