[FFmpeg-devel] [PATCH 1/2] avcodec, avformat: deprecate anything related to side data merging

wm4 nfxjfg at googlemail.com
Thu Mar 16 18:26:18 EET 2017


On Thu, 16 Mar 2017 11:07:44 -0300
James Almer <jamrial at gmail.com> wrote:

> On 3/16/2017 1:20 AM, wm4 wrote:
> > This patch deprecates anything that has to do with merging/splitting
> > side data. Automatic side data merging (and splitting), as well as all
> > API symbols involved in it, are removed completely.
> > 
> > Two FF_API_ defines are dedicated to deprecating API symbols related to
> > this: FF_API_MERGE_SD_API removes av_packet_split/merge_side_data in
> > libavcodec, and FF_API_LAVF_KEEPSIDE_FLAG deprecates
> > AVFMT_FLAG_KEEP_SIDE_DATA in libavformat.
> > 
> > Since it was claimed that changing the default from merging side data to
> > not doing it is an ABI change, there are two additional FF_API_ defines,
> > which stop using the side data merging/splitting by default (and remove
> > any code in avformat/avcodec doing this): FF_API_MERGE_SD in libavcodec,
> > and FF_API_LAVF_MERGE_SD in libavformat.
> > 
> > It is very much intended that FF_API_MERGE_SD and FF_API_LAVF_MERGE_SD
> > are quickly defined to 0 in the next ABI bump, while the API symbols are
> > retained for a longer time for the sake of compatibility.
> > AVFMT_FLAG_KEEP_SIDE_DATA will (very much intentionally) do nothing for
> > most of the time it will still be defined. Keep in mind that no code
> > exists that actually tries to unset this flag for any reason, nor does
> > such code need to exist. Code setting this flag explicitly will work as
> > before. Thus it's ok for AVFMT_FLAG_KEEP_SIDE_DATA to do nothing once
> > side data merging has been removed from libavformat.
> > 
> > In order to avoid that anyone in the future does this incorrectly, here
> > is a small guide how to update the internal code on bumps:
> > 
> > - next ABI bump (probably soon):
> >   - define FF_API_LAVF_MERGE_SD to 0, and remove all code covered by it
> >   - define FF_API_MERGE_SD to 0, and remove all code covered by it
> > - next API bump (typically two years in the future or so):
> >   - define FF_API_LAVF_MERGE_SD to 0, and remove all code covered by it
> >   - define FF_API_MERGE_SD_API to 0, and remove all code covered by it  
> 
> I assume you meant to write FF_API_LAVF_KEEPSIDE_FLAG in the API bump part.

Yes.

> 
> You should do
> 
> #if FF_API_MERGE_SD
> FF_DISABLE_DEPRECATION_WARNINGS
>         int did_split = av_packet_split_side_data(&tmp);
> FF_ENABLE_DEPRECATION_WARNINGS
> #endif
> 
> To remove the "deprecated" warning spam during compilation. Same with every
> other call to any of the deprecated functions.
> 
> What about the ffmpeg.c calls to av_packet_split_side_data()? You should
> also wrap them with one of these new FF_API defines.

The deprecated API uses go soon (next ABI bump), so I'm not sure it's
worth the trouble.

> > +#ifndef FF_API_LAVF_MERGE_SD
> > +#define FF_API_LAVF_MERGE_SD            (LIBAVFORMAT_VERSION_MAJOR < 58)
> > +#endif
> > +#ifndef FF_API_LAVF_KEEPSIDE_FLAG
> > +#define FF_API_LAVF_KEEPSIDE_FLAG       (LIBAVFORMAT_VERSION_MAJOR < 58)  
> 
> This one should probably be set as "< 59", much like FF_API_MERGE_SD_API.

Well, what we normally do is delaying the bump for certain FF_API
symbols when bumping, so this is not all clear.


More information about the ffmpeg-devel mailing list