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 module ffmpeg.libavutil.avutil_version; 22 23 import std.stdio; 24 import std.stdint; 25 import std.format; 26 import std.array; 27 import core.vararg; 28 29 /** 30 * @defgroup version_utils Library Version Macros 31 * 32 * Useful to check and match library version in order to maintain 33 * backward compatibility. 34 * 35 * @{ 36 */ 37 38 template AV_VERSION_INT(int a, int b, int c) { 39 const int AV_VERSION_INT = (a<<16 | b<<8 | c); 40 } 41 42 string AV_VERSION_DOT(int a, int b, int c) { 43 auto writer = appender!string(); 44 formattedWrite(writer, "%2d.%2d.%2d", a, b, c); 45 return writer.data; 46 } 47 48 template AV_VERSION(int a, int b, int c) { 49 const string AV_VERSION = AV_VERSION_DOT(a, b, c); 50 } 51 52 /** 53 * Extract version components from the full ::AV_VERSION_INT int as returned 54 * by functions like ::avformat_version() and ::avcodec_version() 55 */ 56 int AV_VERSION_MAJOR(int a){ 57 return a >> 16; 58 } 59 60 int AV_VERSION_MINOR(int a){ 61 return (a & 0x00FF00) >> 8; 62 } 63 64 int AV_VERSION_MICRO(int a){ 65 return a & 0xFF; 66 } 67 68 /** 69 * @} 70 * 71 * @defgroup lavu_ver Version and Build diagnostics 72 * 73 * Macros and function useful to check at compiletime and at runtime 74 * which version of libavutil is in use. 75 * 76 * @{ 77 */ 78 79 enum LIBAVUTIL_VERSION_MAJOR = 55; 80 enum LIBAVUTIL_VERSION_MINOR = 17; 81 enum LIBAVUTIL_VERSION_MICRO = 103; 82 83 enum LIBAVUTIL_VERSION_INT = AV_VERSION_INT!(LIBAVUTIL_VERSION_MAJOR, LIBAVUTIL_VERSION_MINOR, LIBAVUTIL_VERSION_MICRO); 84 enum LIBAVUTIL_VERSION = AV_VERSION!(LIBAVUTIL_VERSION_MAJOR, LIBAVUTIL_VERSION_MINOR, LIBAVUTIL_VERSION_MICRO); 85 enum LIBAVUTIL_BUILD = LIBAVUTIL_VERSION_INT; 86 87 auto LIBAVUTIL_IDENT = "Lavu" ~ LIBAVUTIL_VERSION; 88 89 /** 90 * @} 91 * 92 * @defgroup depr_guards Deprecation guards 93 * FF_API_* defines may be placed below to indicate public API that will be 94 * dropped at a future version bump. The defines themselves are not part of 95 * the public API and may change, break or disappear at any time. 96 * 97 * @{ 98 */ 99 100 enum FF_API_VDPAU = (LIBAVUTIL_VERSION_MAJOR < 56); 101 enum FF_API_XVMC = (LIBAVUTIL_VERSION_MAJOR < 56); 102 enum FF_API_OPT_TYPE_METADATA = (LIBAVUTIL_VERSION_MAJOR < 56); 103 enum FF_API_DLOG = (LIBAVUTIL_VERSION_MAJOR < 56); 104 enum FF_API_VAAPI = (LIBAVUTIL_VERSION_MAJOR < 56); 105 enum FF_API_FRAME_QP = (LIBAVUTIL_VERSION_MAJOR < 56); 106 enum FF_API_PLUS1_MINUS1 = (LIBAVUTIL_VERSION_MAJOR < 56); 107 enum FF_API_ERROR_FRAME = (LIBAVUTIL_VERSION_MAJOR < 56); 108 enum FF_API_CRC_BIG_TABLE = (LIBAVUTIL_VERSION_MAJOR < 56); 109 110 /** 111 * @} 112 */ 113 114 /** 115 * Build time configuration from avconfig.h. 116 * Replace this with the correct build settings from avconfig.h for ffmepg 117 * version 2.4.8 118 */ 119 /* Generated by ffconf */ 120 //#ifndef AVUTIL_AVCONFIG_H 121 //#define AVUTIL_AVCONFIG_H 122 enum AV_HAVE_BIGENDIAN = 0; 123 enum AV_HAVE_FAST_UNALIGNED = 1; 124 enum AV_HAVE_INCOMPATIBLE_LIBAV_ABI = 0; 125 //#endif /* AVUTIL_AVCONFIG_H */ 126