[FFmpeg-devel] Compatibility of different library versions (was: avformat: Add internal flags for AV(In|Out)putFormat)

Nicolas George george at nsup.org
Sun Aug 29 20:20:31 EEST 2021


Diederick C. Niehorster (12021-08-25):
> Several core developers stated to be in favor of locking lavd<->lavf
> together at the minor version, for instance since it solves a lot of
> the problems the intimate linking between the two libraries creates.
> Should this be turned into a patch somehow (i'm not sure how to do
> such linking)? If so, could someone send this patch or guide me
> through it, so that the discussion can be finished?

If I had to do it, this is how, but it may require some experimenting:

- In version.h of all libraries, add a macro
  avLIBRARY_version_same_minor() that expands to
  avLIBRARY_version_MINOR_MAJOR().

- In all libraries, implement avLIBRARY_version_same_minor() the same
  way as avLIBRARY_version(). By the magic of macros, it will define the
  avLIBRARY_version_MINOR_MAJOR symbol.

- In libavdevice, add this to avdevice_version_same_minor():

  if ((avformat_version_same_minor()) & ~0xFF != (LIBAVFORMAT_VERSION & ~0xFF))
      abort();

It does not matter if the application does not call
avformat_version_same_minor(), it will mark the symbol as required, and
the dynamic linker will check.

But it should not be done only for libavdevice, it should be done for
all libraries that use avpriv symbols too.

Regards,

-- 
  Nicolas George
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20210829/55d190eb/attachment.sig>


More information about the ffmpeg-devel mailing list