---
cmdutils.c | 11 ++++-
libavdevice/Makefile | 3 +-
libavdevice/avdevice.c | 2 +
libavdevice/avdevice.h | 12 -----
libavdevice/version.h | 42 ++++++++++++++++++
libavutil/Makefile | 1 +
libavutil/avutil.h | 86 ------------------------------------
libavutil/eval.c | 1 +
libavutil/fifo.h | 4 +-
libavutil/file.c | 2 +
libavutil/imgutils.c | 1 +
libavutil/opt.h | 1 +
libavutil/samplefmt.h | 1 +
libavutil/utils.c | 1 +
libavutil/version.h | 113 ++++++++++++++++++++++++++++++++++++++++++++++++
libswscale/Makefile | 3 +-
libswscale/swscale.h | 26 +-----------
libswscale/utils.c | 1 +
libswscale/version.h | 54 +++++++++++++++++++++++
19 files changed, 237 insertions(+), 128 deletions(-)
create mode 100644 libavdevice/version.h
create mode 100644 libavutil/version.h
create mode 100644 libswscale/version.h
diff --git a/cmdutils.c b/cmdutils.c
index 71f9f10..201ff9e 100644
--- a/cmdutils.c
+++ b/cmdutils.c
@@ -29,10 +29,16 @@
references to libraries that are not being built. */
#include "config.h"
-#include "libavformat/avformat.h"
-#include "libavfilter/avfilter.h"
+#include "libavcodec/avcodec.h"
+#include "libavcodec/version.h"
#include "libavdevice/avdevice.h"
+#include "libavdevice/version.h"
+#include "libavfilter/avfilter.h"
+#include "libavfilter/version.h"
+#include "libavformat/avformat.h"
+#include "libavformat/version.h"
#include "libavresample/avresample.h"
+#include "libavresample/version.h"
#include "libswscale/swscale.h"
#include "libavutil/avassert.h"
#include "libavutil/avstring.h"
@@ -43,6 +49,7 @@
#include "libavutil/eval.h"
#include "libavutil/dict.h"
#include "libavutil/opt.h"
+#include "libavutil/version.h"
#include "avversion.h"
#include "cmdutils.h"
#if CONFIG_NETWORK
diff --git a/libavdevice/Makefile b/libavdevice/Makefile
index 8d76483..0dbcf27 100644
--- a/libavdevice/Makefile
+++ b/libavdevice/Makefile
@@ -1,7 +1,8 @@
NAME = avdevice
FFLIBS = avformat avcodec avutil
-HEADERS = avdevice.h
+HEADERS = avdevice.h \
+ version.h \
OBJS = alldevices.o \
avdevice.o \
diff --git a/libavdevice/avdevice.c b/libavdevice/avdevice.c
index 4813a3d..84cdd7e 100644
--- a/libavdevice/avdevice.c
+++ b/libavdevice/avdevice.c
@@ -16,6 +16,8 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#include "config.h"
+#include "version.h"
#include "avdevice.h"
unsigned avdevice_version(void)
diff --git a/libavdevice/avdevice.h b/libavdevice/avdevice.h
index c010af2..946e441 100644
--- a/libavdevice/avdevice.h
+++ b/libavdevice/avdevice.h
@@ -43,18 +43,6 @@
#include "libavutil/avutil.h"
-#define LIBAVDEVICE_VERSION_MAJOR 53
-#define LIBAVDEVICE_VERSION_MINOR 2
-#define LIBAVDEVICE_VERSION_MICRO 0
-
-#define LIBAVDEVICE_VERSION_INT AV_VERSION_INT(LIBAVDEVICE_VERSION_MAJOR, \
- LIBAVDEVICE_VERSION_MINOR, \
- LIBAVDEVICE_VERSION_MICRO)
-#define LIBAVDEVICE_VERSION AV_VERSION(LIBAVDEVICE_VERSION_MAJOR, \
- LIBAVDEVICE_VERSION_MINOR, \
- LIBAVDEVICE_VERSION_MICRO)
-#define LIBAVDEVICE_BUILD LIBAVDEVICE_VERSION_INT
-
/**
* Return the LIBAVDEVICE_VERSION_INT constant.
*/
diff --git a/libavdevice/version.h b/libavdevice/version.h
new file mode 100644
index 0000000..ea733a9
--- /dev/null
+++ b/libavdevice/version.h
@@ -0,0 +1,42 @@
+/*
+ * This file is part of Libav.
+ *
+ * Libav is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * Libav is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with Libav; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef AVDEVICE_VERSION_H
+#define AVDEVICE_VERSION_H
+
+/**
+ * @file
+ * @ingroup lavd
+ * Libavdevice version macros
+ */
+
+#include "libavutil/version.h"
+
+#define LIBAVDEVICE_VERSION_MAJOR 53
+#define LIBAVDEVICE_VERSION_MINOR 2
+#define LIBAVDEVICE_VERSION_MICRO 0
+
+#define LIBAVDEVICE_VERSION_INT AV_VERSION_INT(LIBAVDEVICE_VERSION_MAJOR, \
+ LIBAVDEVICE_VERSION_MINOR, \
+ LIBAVDEVICE_VERSION_MICRO)
+#define LIBAVDEVICE_VERSION AV_VERSION(LIBAVDEVICE_VERSION_MAJOR, \
+ LIBAVDEVICE_VERSION_MINOR, \
+ LIBAVDEVICE_VERSION_MICRO)
+#define LIBAVDEVICE_BUILD LIBAVDEVICE_VERSION_INT
+
+#endif /* AVDEVICE_VERSION_H */
diff --git a/libavutil/Makefile b/libavutil/Makefile
index 6fe174b..5cef073 100644
--- a/libavutil/Makefile
+++ b/libavutil/Makefile
@@ -37,6 +37,7 @@ HEADERS = adler32.h
\
samplefmt.h \
sha.h \
time.h \
+ version.h \
ARCH_HEADERS = bswap.h \
intmath.h \
diff --git a/libavutil/avutil.h b/libavutil/avutil.h
index 391f695..72889ff 100644
--- a/libavutil/avutil.h
+++ b/libavutil/avutil.h
@@ -106,92 +106,6 @@
* @}
*/
-
-/**
- * @defgroup preproc_misc Preprocessor String Macros
- *
- * String manipulation macros
- *
- * @{
- */
-
-#define AV_STRINGIFY(s) AV_TOSTRING(s)
-#define AV_TOSTRING(s) #s
-
-#define AV_GLUE(a, b) a ## b
-#define AV_JOIN(a, b) AV_GLUE(a, b)
-
-/**
- * @}
- */
-
-/**
- * @defgroup version_utils Library Version Macros
- *
- * Useful to check and match library version in order to maintain
- * backward compatibility.
- *
- * @{
- */
-
-#define AV_VERSION_INT(a, b, c) (a<<16 | b<<8 | c)
-#define AV_VERSION_DOT(a, b, c) a ##.## b ##.## c
-#define AV_VERSION(a, b, c) AV_VERSION_DOT(a, b, c)
-
-/**
- * @}
- *
- * @defgroup lavu_ver Version and Build diagnostics
- *
- * Macros and function useful to check at compiletime and at runtime
- * which version of libavutil is in use.
- *
- * @{
- */
-
-#define LIBAVUTIL_VERSION_MAJOR 51
-#define LIBAVUTIL_VERSION_MINOR 34
-#define LIBAVUTIL_VERSION_MICRO 0
-
-#define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \
- LIBAVUTIL_VERSION_MINOR, \
- LIBAVUTIL_VERSION_MICRO)
-#define LIBAVUTIL_VERSION AV_VERSION(LIBAVUTIL_VERSION_MAJOR, \
- LIBAVUTIL_VERSION_MINOR, \
- LIBAVUTIL_VERSION_MICRO)
-#define LIBAVUTIL_BUILD LIBAVUTIL_VERSION_INT
-
-#define LIBAVUTIL_IDENT "Lavu" AV_STRINGIFY(LIBAVUTIL_VERSION)
-
-/**
- * @}
- *
- * @defgroup depr_guards Deprecation guards
- * Those FF_API_* defines are not part of public API.
- * They may change, break or disappear at any time.
- *
- * They are used mostly internally to mark code that will be removed
- * on the next major version.
- *
- * @{
- */
-#ifndef FF_API_GET_BITS_PER_SAMPLE_FMT
-#define FF_API_GET_BITS_PER_SAMPLE_FMT (LIBAVUTIL_VERSION_MAJOR < 52)
-#endif
-#ifndef FF_API_FIND_OPT
-#define FF_API_FIND_OPT (LIBAVUTIL_VERSION_MAJOR < 52)
-#endif
-#ifndef FF_API_AV_FIFO_PEEK
-#define FF_API_AV_FIFO_PEEK (LIBAVUTIL_VERSION_MAJOR < 52)
-#endif
-#ifndef FF_API_OLD_AVOPTIONS
-#define FF_API_OLD_AVOPTIONS (LIBAVUTIL_VERSION_MAJOR < 52)
-#endif
-
-/**
- * @}
- */
-
/**
* @addtogroup lavu_ver
* @{
diff --git a/libavutil/eval.c b/libavutil/eval.c
index 36b5ce5..0ebce2f 100644
--- a/libavutil/eval.c
+++ b/libavutil/eval.c
@@ -30,6 +30,7 @@
#include "eval.h"
#include "log.h"
#include "mathematics.h"
+#include "version.h"
typedef struct Parser {
const AVClass *class;
diff --git a/libavutil/fifo.h b/libavutil/fifo.h
index f106239..e1506bd 100644
--- a/libavutil/fifo.h
+++ b/libavutil/fifo.h
@@ -25,7 +25,9 @@
#define AVUTIL_FIFO_H
#include <stdint.h>
-#include "avutil.h"
+
+#include "attributes.h"
+#include "version.h"
typedef struct AVFifoBuffer {
uint8_t *buffer;
diff --git a/libavutil/file.c b/libavutil/file.c
index e1d0831..cbb5706 100644
--- a/libavutil/file.c
+++ b/libavutil/file.c
@@ -18,6 +18,8 @@
#include "file.h"
#include "log.h"
+#include "version.h"
+
#include <fcntl.h>
#include <sys/stat.h>
#if HAVE_UNISTD_H
diff --git a/libavutil/imgutils.c b/libavutil/imgutils.c
index 3d28e56..e4b42de 100644
--- a/libavutil/imgutils.c
+++ b/libavutil/imgutils.c
@@ -25,6 +25,7 @@
#include "internal.h"
#include "log.h"
#include "pixdesc.h"
+#include "version.h"
void av_image_fill_max_pixsteps(int max_pixsteps[4], int max_pixstep_comps[4],
const AVPixFmtDescriptor *pixdesc)
diff --git a/libavutil/opt.h b/libavutil/opt.h
index 8f800fc..0870f93 100644
--- a/libavutil/opt.h
+++ b/libavutil/opt.h
@@ -31,6 +31,7 @@
#include "avutil.h"
#include "dict.h"
#include "log.h"
+#include "version.h"
/**
* @defgroup avoptions AVOptions
diff --git a/libavutil/samplefmt.h b/libavutil/samplefmt.h
index e3aa6a9..f6e6f9c 100644
--- a/libavutil/samplefmt.h
+++ b/libavutil/samplefmt.h
@@ -20,6 +20,7 @@
#define AVUTIL_SAMPLEFMT_H
#include "avutil.h"
+#include "version.h"
/**
* Audio Sample Formats
diff --git a/libavutil/utils.c b/libavutil/utils.c
index 9b18c97..1762e50 100644
--- a/libavutil/utils.c
+++ b/libavutil/utils.c
@@ -17,6 +17,7 @@
*/
#include "config.h"
+#include "version.h"
#include "avutil.h"
/**
diff --git a/libavutil/version.h b/libavutil/version.h
new file mode 100644
index 0000000..3a70a92
--- /dev/null
+++ b/libavutil/version.h
@@ -0,0 +1,113 @@
+/*
+ * This file is part of Libav.
+ *
+ * Libav is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * Libav is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with Libav; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef AVUTIL_VERSION_H
+#define AVUTIL_VERSION_H
+
+/**
+ * @file
+ * @ingroup lavu
+ * Libavutil version macros
+ */
+
+/**
+ * @defgroup preproc_misc Preprocessor String Macros
+ *
+ * String manipulation macros
+ *
+ * @{
+ */
+
+#define AV_STRINGIFY(s) AV_TOSTRING(s)
+#define AV_TOSTRING(s) #s
+
+#define AV_GLUE(a, b) a ## b
+#define AV_JOIN(a, b) AV_GLUE(a, b)
+
+/**
+ * @}
+ */
+
+/**
+ * @defgroup version_utils Library Version Macros
+ *
+ * Useful to check and match library version in order to maintain
+ * backward compatibility.
+ *
+ * @{
+ */
+
+#define AV_VERSION_INT(a, b, c) (a<<16 | b<<8 | c)
+#define AV_VERSION_DOT(a, b, c) a ##.## b ##.## c
+#define AV_VERSION(a, b, c) AV_VERSION_DOT(a, b, c)
+
+/**
+ * @}
+ *
+ * @defgroup lavu_ver Version and Build diagnostics
+ *
+ * Macros and function useful to check at compiletime and at runtime
+ * which version of libavutil is in use.
+ *
+ * @{
+ */
+
+#define LIBAVUTIL_VERSION_MAJOR 51
+#define LIBAVUTIL_VERSION_MINOR 34
+#define LIBAVUTIL_VERSION_MICRO 0
+
+#define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \
+ LIBAVUTIL_VERSION_MINOR, \
+ LIBAVUTIL_VERSION_MICRO)
+#define LIBAVUTIL_VERSION AV_VERSION(LIBAVUTIL_VERSION_MAJOR, \
+ LIBAVUTIL_VERSION_MINOR, \
+ LIBAVUTIL_VERSION_MICRO)
+#define LIBAVUTIL_BUILD LIBAVUTIL_VERSION_INT
+
+#define LIBAVUTIL_IDENT "Lavu" AV_STRINGIFY(LIBAVUTIL_VERSION)
+
+/**
+ * @}
+ *
+ * @defgroup depr_guards Deprecation guards
+ * These FF_API_* defines are not part of the public API.
+ * They may change, break or disappear at any time.
+ *
+ * They are used mostly internally to mark code that will be removed
+ * on the next major version.
+ *
+ * @{
+ */
+#ifndef FF_API_GET_BITS_PER_SAMPLE_FMT
+#define FF_API_GET_BITS_PER_SAMPLE_FMT (LIBAVUTIL_VERSION_MAJOR < 52)
+#endif
+#ifndef FF_API_FIND_OPT
+#define FF_API_FIND_OPT (LIBAVUTIL_VERSION_MAJOR < 52)
+#endif
+#ifndef FF_API_AV_FIFO_PEEK
+#define FF_API_AV_FIFO_PEEK (LIBAVUTIL_VERSION_MAJOR < 52)
+#endif
+#ifndef FF_API_OLD_AVOPTIONS
+#define FF_API_OLD_AVOPTIONS (LIBAVUTIL_VERSION_MAJOR < 52)
+#endif
+
+/**
+ * @}
+ */
+
+#endif /* AVUTIL_VERSION_H */
diff --git a/libswscale/Makefile b/libswscale/Makefile
index 4ebe19c..b4b7aa9 100644
--- a/libswscale/Makefile
+++ b/libswscale/Makefile
@@ -1,7 +1,8 @@
NAME = swscale
FFLIBS = avutil
-HEADERS = swscale.h
+HEADERS = swscale.h \
+ version.h \
OBJS = input.o \
options.o \
diff --git a/libswscale/swscale.h b/libswscale/swscale.h
index b5a6a57..30c87be 100644
--- a/libswscale/swscale.h
+++ b/libswscale/swscale.h
@@ -30,31 +30,7 @@
#include "libavutil/avutil.h"
#include "libavutil/log.h"
#include "libavutil/pixfmt.h"
-
-#define LIBSWSCALE_VERSION_MAJOR 2
-#define LIBSWSCALE_VERSION_MINOR 1
-#define LIBSWSCALE_VERSION_MICRO 0
-
-#define LIBSWSCALE_VERSION_INT AV_VERSION_INT(LIBSWSCALE_VERSION_MAJOR, \
- LIBSWSCALE_VERSION_MINOR, \
- LIBSWSCALE_VERSION_MICRO)
-#define LIBSWSCALE_VERSION AV_VERSION(LIBSWSCALE_VERSION_MAJOR, \
- LIBSWSCALE_VERSION_MINOR, \
- LIBSWSCALE_VERSION_MICRO)
-#define LIBSWSCALE_BUILD LIBSWSCALE_VERSION_INT
-
-#define LIBSWSCALE_IDENT "SwS" AV_STRINGIFY(LIBSWSCALE_VERSION)
-
-/**
- * Those FF_API_* defines are not part of public API.
- * They may change, break or disappear at any time.
- */
-#ifndef FF_API_SWS_GETCONTEXT
-#define FF_API_SWS_GETCONTEXT (LIBSWSCALE_VERSION_MAJOR < 3)
-#endif
-#ifndef FF_API_SWS_CPU_CAPS
-#define FF_API_SWS_CPU_CAPS (LIBSWSCALE_VERSION_MAJOR < 3)
-#endif
+#include "version.h"
/**
* Return the LIBSWSCALE_VERSION_INT constant.
diff --git a/libswscale/utils.c b/libswscale/utils.c
index d8fee58..b137df9 100644
--- a/libswscale/utils.c
+++ b/libswscale/utils.c
@@ -48,6 +48,7 @@
#include "rgb2rgb.h"
#include "swscale.h"
#include "swscale_internal.h"
+#include "version.h"
unsigned swscale_version(void)
{
diff --git a/libswscale/version.h b/libswscale/version.h
new file mode 100644
index 0000000..d4684de
--- /dev/null
+++ b/libswscale/version.h
@@ -0,0 +1,54 @@
+/*
+ * This file is part of Libav.
+ *
+ * Libav is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * Libav is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with Libav; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef SWSCALE_VERSION_H
+#define SWSCALE_VERSION_H
+
+/**
+ * @file
+ * swscale version macros
+ */
+
+#include "libavutil/version.h"
+
+#define LIBSWSCALE_VERSION_MAJOR 2
+#define LIBSWSCALE_VERSION_MINOR 1
+#define LIBSWSCALE_VERSION_MICRO 0
+
+#define LIBSWSCALE_VERSION_INT AV_VERSION_INT(LIBSWSCALE_VERSION_MAJOR, \
+ LIBSWSCALE_VERSION_MINOR, \
+ LIBSWSCALE_VERSION_MICRO)
+#define LIBSWSCALE_VERSION AV_VERSION(LIBSWSCALE_VERSION_MAJOR, \
+ LIBSWSCALE_VERSION_MINOR, \
+ LIBSWSCALE_VERSION_MICRO)
+#define LIBSWSCALE_BUILD LIBSWSCALE_VERSION_INT
+
+#define LIBSWSCALE_IDENT "SwS" AV_STRINGIFY(LIBSWSCALE_VERSION)
+
+/**
+ * Those FF_API_* defines are not part of public API.
+ * They may change, break or disappear at any time.
+ */
+#ifndef FF_API_SWS_GETCONTEXT
+#define FF_API_SWS_GETCONTEXT (LIBSWSCALE_VERSION_MAJOR < 3)
+#endif
+#ifndef FF_API_SWS_CPU_CAPS
+#define FF_API_SWS_CPU_CAPS (LIBSWSCALE_VERSION_MAJOR < 3)
+#endif
+
+#endif /* SWSCALE_VERSION_H */
--
1.7.1
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel