Diego Biurrun <[email protected]> writes:
> ---
> 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"
What do these changes have to do with the patch description?
> @@ -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"
Unrelated.
> +#include "version.h"
> #include "avdevice.h"
>
> unsigned avdevice_version(void)
[...]
> 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)
These macros absolutely belong in this header. The version.h headers
are _exclusively_ for defining the version of the library to which they
belong, never for defining general utility macros.
[...]
> 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"
Somewhat unrelated.
> 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)
As stated already, these macros are not specific to the version of
libavutil, thus they belong in avutil.h.
Incorrect changes resulting from the above-mentioned mistakes are
explicitly indicated in this review.
--
Måns Rullgård
[email protected]
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel