[FFmpeg-devel] [PATCH 0/3] Finish new iteration APIs

Nicolas George george at nsup.org
Thu Feb 22 17:47:36 EET 2018


Hi.

Not sure where in the thread would be the best place to reply, so I
might as well reply here.

There is one idea I have been toying with for some time that relates to
codec registration. It is significantly different from the direction
this discussion was taking, but I think it offers a lot of advantages.

Let us have "struct AVCodecLibrary" with the lists of codecs, bsfs, etc.
Whenever a function needs to access the lists, have it take an
AVCodecLibrary argument. It can be made automatic most of the time by
adding an AVCodecLibrary field to all AVSomethingContext structs.

Amongst the benefits I see:

If an application deals with trusted and untrusted files, it can use two
instances of AVCodecLibrary, one with only reliable codecs, one with
all. It is more robust and easier than the whitelists.

If an application uses lavc directly but also indirectly through a
library (or indirectly twice through two libraries), the instances are
independent since they use a different instance of AVCodecLibrary.

The same structure could be used to set all mutable global state, like
the log level and callback.

Please comment.

Regards,

-- 
  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/20180222/f3ef3794/attachment.sig>


More information about the ffmpeg-devel mailing list