[FFmpeg-devel] [FFmpeg-cvslog] lavc: add new API for iterating codecs and codec parsers

Nicolas George george at nsup.org
Fri Feb 9 13:12:06 EET 2018

Muhammad Faiz (2018-02-08):
> I actually prefer _next() without introducing new API. Yeah, it is
> slower because it must initialize next pointer

I am not sure what you mean here. The problem with initing the next
pointer was never speed.

The problem with the next pointer is that it requires a run-time write
in the codec structure, that requires it to be in the data section
instead of the rodata section.

The static init of this pointer, as you proposed, fixes that specific

But that is still a linked list. Linked lists are very good when you
need to insert and remove in the list frequently, but for something that
is built once and then static, it has very limited usefulness.

If the drawback of memory management for solution C (returning the whole
list at once) is considered too bad, then I think solution B is
preferable: more versatile, easier to understand.

And by the way, until we decide between solutions A, B, C or anything
else proposed, starting coding would be useless. Just as starting to
pack your bags before deciding whether you go to the sea or mountain.


  Nicolas George
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20180209/e95ca8bd/attachment.sig>

More information about the ffmpeg-devel mailing list