[FFmpeg-devel] [PATCH] avcodec: remove av_codec_init_static()

wm4 nfxjfg at googlemail.com
Wed Feb 14 07:09:55 EET 2018


On Wed, 14 Feb 2018 07:07:09 +0700
Muhammad Faiz <mfcc64 at gmail.com> wrote:

> On Tue, Feb 13, 2018 at 3:57 AM, wm4 <nfxjfg at googlemail.com> wrote:
> > On Mon, 12 Feb 2018 12:42:10 +0700
> > Muhammad Faiz <mfcc64 at gmail.com> wrote:
> >  
> >> Modify the behavior of init_static_data().
> >>
> >> Signed-off-by: Muhammad Faiz <mfcc64 at gmail.com>
> >> ---  
> >
> > Seems OK, but I'm also not sure about the benefit. The fundamental
> > problem that these codecs need to mutate AVCodec before the users sees
> > it won't go away.  
> 
> Actually, I'm too. Any idea how to remove init_static_data()?

The only way is to change the API somehow and deprecate
AVCodec.pix_fmts. Or we could define that entries in pix_fmts are not
always available at runtime, but this would still be an API break and
require deprecation and a replacement mechanism. Honestly I'm not
really sure how to do this - maybe the simplest possible replacement
would be fine, like avcodec_get_pix_fmts(AVCodec)?

For now it actually seems less trouble to just leave those maybe 3 or 4
AVCodecs mutable. At least there are no race anymore thanks to
init_once.


More information about the ffmpeg-devel mailing list