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

Nicolas George george at nsup.org
Wed Jan 22 21:49:42 EET 2025


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¹.

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.

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,

-- 
  Nicolas George


More information about the ffmpeg-devel mailing list