[FFmpeg-devel] [PATCH 2/7] lavfi/buffersink: add a flag for retrieving stream parameters

Marton Balint cus at passwd.hu
Wed Sep 25 22:27:30 EEST 2024



On Wed, 25 Sep 2024, Nicolas George wrote:

> Anton Khirnov (12024-09-25):
>> Because AVFilterLink is internal state of the filtergraph and should not
>> be exposed at all.
>
> Anyway, if you cannot come up with an API that does not require dynamic
> allocations and all the boilerplate code it requires just to retrieve a
> few integers, then drop the series altogether.

I kind of agree. It is suboptimal that the buffersink stores all its 
parameters already in a public struct, but you can only access them if you 
get yourself an owned copy with all the overhead of copying / 
referencing, plus now you have to do extra allocation for the results and 
error checking as well.

Also I don't like that you are misusing an AVFrame struct to pass 
parameters. How the user should know which parameters are set in AVFrame 
and which are not? A dedicated struct would be better, or just use 
AVFilterLink.

Regards,
Marton



More information about the ffmpeg-devel mailing list