[vlc-devel] [PATCH 01/22] picture: add helpers for picture chaining

Steve Lhomme robux4 at ycbcr.xyz
Fri Sep 18 07:26:12 CEST 2020


On 2020-09-18 7:16, Steve Lhomme wrote:
> On 2020-09-17 19:16, Rémi Denis-Courmont wrote:
>> Le torstaina 17. syyskuuta 2020, 18.33.23 EEST Steve Lhomme a écrit :
>>> Picture chains are used either to keep a list of picture (in FIFO 
>>> order) or
>>> to attach a picture to another (filters).
>>
>> TBH, singly-listed are so trivial in C that I tend to be happy just hand-
>> coding them. Not that I really care either way.
> 
> If you look at the patches you'll see that in many cases the code was 
> hard to decypher. In some cases because double pointers were used (and 
> the same pattern used in various places). The mnemonics are also 
> inconsistent, the order to do things also inconsistent.
> 
> I don't doubt that the code worked, that doesn't make it easy to read or 
> maintain.
> 
> Also my original goal was to try to use vlc_list instead of p_next. But 
> to do that properly it's better to start of clear basis. In the end I 
> don't know if it's worth the transition but I got clearer/cleaner code 
> for free.

Another important part of this is also to be able to identify who does 
what with p_next. It's well know that this is a dangerous field as when 
you use it, you have to make sure it's not used by another layer already 
(impossible). Now it's clearer who uses the field as a local FIFO 
(picture_chain_append_empty) and who uses the field as a way to chain 2 
or more pictures.

The latter case should go away and use proper push mechanism. It is only 
used by deinterlacers that want to output 2 frames from a single input 
source and also fps which outputs a whole chain of pictures.


More information about the vlc-devel mailing list