[FFmpeg-devel] [PATCH 01/17] avcodec/avcodec: add side data to AVCodecContext

James Almer jamrial at gmail.com
Tue Sep 5 14:26:22 EEST 2023


On 9/5/2023 8:07 AM, Anton Khirnov wrote:
> Quoting James Almer (2023-09-05 00:08:48)
>> This will allow the propagation of global side data within the AVCodecContext
>> instead of having to do it inside packets, and thus be available during init().
>> Global and frame specific side data will therefore be distinct.
> 
> This commit message is misleading - there is already
> AVCodecContext.coded_side_data for exactly this purpose. And after the
> changes from the last iteration I see even less of a reason to replace
> it with a new field.

I insist the new field in the form of a set is better, for the sake of 
unified helpers that can be used in avctx, codecpar, avstream, and 
potentially others in the future. It will also be the packet counterpart 
of Jan's frame side data set field.
coded_side_data is currently used only to export CPB props, so the 
amount of users is probably very small (Maybe only lavf, even). I think 
the benefits in the long run outweigh the cons from the breakage that 
would mean replacing coded_side_data.

Also, my interpretation of coded is still that it refers to a coded 
stream, much like we make a distinction between coded and raw for 
bits_per_sample, and in decoding scenarios, side data entries would have 
information that refer to the decoded raw stream (hdr, etc).

That said, I don't want to keep delaying this set much longer, so if 
you're really against that change I'll try to remove it from the set and 
keep the rest.


More information about the ffmpeg-devel mailing list