version.h 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  1. /*
  2. * copyright (c) 2003 Fabrice Bellard
  3. *
  4. * This file is part of FFmpeg.
  5. *
  6. * FFmpeg is free software; you can redistribute it and/or
  7. * modify it under the terms of the GNU Lesser General Public
  8. * License as published by the Free Software Foundation; either
  9. * version 2.1 of the License, or (at your option) any later version.
  10. *
  11. * FFmpeg is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  14. * Lesser General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU Lesser General Public
  17. * License along with FFmpeg; if not, write to the Free Software
  18. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  19. */
  20. /**
  21. * @file
  22. * @ingroup lavu
  23. * Libavutil version macros
  24. */
  25. #ifndef AVUTIL_VERSION_H
  26. #define AVUTIL_VERSION_H
  27. #include "macros.h"
  28. /**
  29. * @addtogroup version_utils
  30. *
  31. * Useful to check and match library version in order to maintain
  32. * backward compatibility.
  33. *
  34. * The FFmpeg libraries follow a versioning sheme very similar to
  35. * Semantic Versioning (http://semver.org/)
  36. * The difference is that the component called PATCH is called MICRO in FFmpeg
  37. * and its value is reset to 100 instead of 0 to keep it above or equal to 100.
  38. * Also we do not increase MICRO for every bugfix or change in git master.
  39. *
  40. * Prior to FFmpeg 3.2 point releases did not change any lib version number to
  41. * avoid aliassing different git master checkouts.
  42. * Starting with FFmpeg 3.2, the released library versions will occupy
  43. * a separate MAJOR.MINOR that is not used on the master development branch.
  44. * That is if we branch a release of master 55.10.123 we will bump to 55.11.100
  45. * for the release and master will continue at 55.12.100 after it. Each new
  46. * point release will then bump the MICRO improving the usefulness of the lib
  47. * versions.
  48. *
  49. * @{
  50. */
  51. #define AV_VERSION_INT(a, b, c) ((a)<<16 | (b)<<8 | (c))
  52. #define AV_VERSION_DOT(a, b, c) a ##.## b ##.## c
  53. #define AV_VERSION(a, b, c) AV_VERSION_DOT(a, b, c)
  54. /**
  55. * Extract version components from the full ::AV_VERSION_INT int as returned
  56. * by functions like ::avformat_version() and ::avcodec_version()
  57. */
  58. #define AV_VERSION_MAJOR(a) ((a) >> 16)
  59. #define AV_VERSION_MINOR(a) (((a) & 0x00FF00) >> 8)
  60. #define AV_VERSION_MICRO(a) ((a) & 0xFF)
  61. /**
  62. * @}
  63. */
  64. /**
  65. * @defgroup lavu_ver Version and Build diagnostics
  66. *
  67. * Macros and function useful to check at compiletime and at runtime
  68. * which version of libavutil is in use.
  69. *
  70. * @{
  71. */
  72. #define LIBAVUTIL_VERSION_MAJOR 56
  73. #define LIBAVUTIL_VERSION_MINOR 14
  74. #define LIBAVUTIL_VERSION_MICRO 100
  75. #define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \
  76. LIBAVUTIL_VERSION_MINOR, \
  77. LIBAVUTIL_VERSION_MICRO)
  78. #define LIBAVUTIL_VERSION AV_VERSION(LIBAVUTIL_VERSION_MAJOR, \
  79. LIBAVUTIL_VERSION_MINOR, \
  80. LIBAVUTIL_VERSION_MICRO)
  81. #define LIBAVUTIL_BUILD LIBAVUTIL_VERSION_INT
  82. #define LIBAVUTIL_IDENT "Lavu" AV_STRINGIFY(LIBAVUTIL_VERSION)
  83. /**
  84. * @defgroup lavu_depr_guards Deprecation Guards
  85. * FF_API_* defines may be placed below to indicate public API that will be
  86. * dropped at a future version bump. The defines themselves are not part of
  87. * the public API and may change, break or disappear at any time.
  88. *
  89. * @note, when bumping the major version it is recommended to manually
  90. * disable each FF_API_* in its own commit instead of disabling them all
  91. * at once through the bump. This improves the git bisect-ability of the change.
  92. *
  93. * @{
  94. */
  95. #ifndef FF_API_VAAPI
  96. #define FF_API_VAAPI (LIBAVUTIL_VERSION_MAJOR < 57)
  97. #endif
  98. #ifndef FF_API_FRAME_QP
  99. #define FF_API_FRAME_QP (LIBAVUTIL_VERSION_MAJOR < 57)
  100. #endif
  101. #ifndef FF_API_PLUS1_MINUS1
  102. #define FF_API_PLUS1_MINUS1 (LIBAVUTIL_VERSION_MAJOR < 57)
  103. #endif
  104. #ifndef FF_API_ERROR_FRAME
  105. #define FF_API_ERROR_FRAME (LIBAVUTIL_VERSION_MAJOR < 57)
  106. #endif
  107. #ifndef FF_API_PKT_PTS
  108. #define FF_API_PKT_PTS (LIBAVUTIL_VERSION_MAJOR < 57)
  109. #endif
  110. #ifndef FF_API_CRYPTO_SIZE_T
  111. #define FF_API_CRYPTO_SIZE_T (LIBAVUTIL_VERSION_MAJOR < 57)
  112. #endif
  113. #ifndef FF_API_FRAME_GET_SET
  114. #define FF_API_FRAME_GET_SET (LIBAVUTIL_VERSION_MAJOR < 57)
  115. #endif
  116. #ifndef FF_API_PSEUDOPAL
  117. #define FF_API_PSEUDOPAL (LIBAVUTIL_VERSION_MAJOR < 57)
  118. #endif
  119. /**
  120. * @}
  121. * @}
  122. */
  123. #endif /* AVUTIL_VERSION_H */