[FFmpeg-devel] [PATCH 3/7] avutil/frame: add a param change side data type

James Almer jamrial at gmail.com
Wed Jan 22 21:58:31 EET 2025


On 1/22/2025 4:49 PM, Nicolas George wrote:
> James Almer (12025-01-22):
>> New fields can be added this way too. The reason i didn't make it a struct
>> is that i wanted to introduce the least amount of new public
>> defines/symbols, thus reusing the packet side data implementation.
> 
> Let us make the packet side data a struct too. This version is terrible
> design that puts a lot of burden on all sides of the code and wastes the
> ability of the compiler to check the structure, this is terrible
> design¹.

I agree, it's not a good design.

> 
> Since the first field is a flag, we can easily make a compatibility
> layer by adding a AV_SIDE_DATA_PARAM_CHANGE_STRUCT_API flag.

Ok, will implement a new struct.

> 
> And we can dispense with all the _alloc() and _free() API in libavutil and
> let the applications allocate as they want, including on the stack, the
> code just needs to check size before accessing a field.
> 
> Later let us fix the other side data that use this pattern.
> 
> 1: One `git blame` later… yeah, not surprised.
> 
> Regards,
> 

-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_signature.asc
Type: application/pgp-signature
Size: 495 bytes
Desc: OpenPGP digital signature
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20250122/510c74ce/attachment.sig>


More information about the ffmpeg-devel mailing list