[FFmpeg-devel] [PATCH 2/5] postproc: Create version.h header
Stefano Sabatini
stefasab at gmail.com
Thu Sep 27 10:28:11 CEST 2012
On date Thursday 2012-09-27 04:35:30 -0300, jamal encoded:
> ---
> configure | 2 +-
> libpostproc/Makefile | 3 +-
> libpostproc/postprocess.h | 18 +----------------
> libpostproc/version.h | 47 +++++++++++++++++++++++++++++++++++++++++++++
> 4 files changed, 51 insertions(+), 19 deletions(-)
> create mode 100644 libpostproc/version.h
>
> diff --git a/configure b/configure
> index d2d3a66..1737532 100755
> --- a/configure
> +++ b/configure
> @@ -4233,7 +4233,7 @@ fi
> eval echo "${lcname}_VERSION_MAJOR=\$${name}_VERSION_MAJOR" >> config.mak
> }
>
> -get_version_old LIBPOSTPROC libpostproc/postprocess.h
> +get_version_old LIBPOSTPROC libpostproc/version.h
> get_version_old LIBSWRESAMPLE libswresample/swresample.h
>
> get_version libavcodec
> diff --git a/libpostproc/Makefile b/libpostproc/Makefile
> index 6242157..3fb5a70 100644
> --- a/libpostproc/Makefile
> +++ b/libpostproc/Makefile
> @@ -3,6 +3,7 @@ include $(SUBDIR)../config.mak
> NAME = postproc
> FFLIBS = avutil
>
> -HEADERS = postprocess.h
> +HEADERS = postprocess.h \
> + version.h \
>
> OBJS = postprocess.o
> diff --git a/libpostproc/postprocess.h b/libpostproc/postprocess.h
> index c2c5c73..623b3b5 100644
> --- a/libpostproc/postprocess.h
> +++ b/libpostproc/postprocess.h
> @@ -27,23 +27,7 @@
> * external postprocessing API
> */
>
> -#include "libavutil/avutil.h"
> -
> -#ifndef LIBPOSTPROC_VERSION_MAJOR
> -#define LIBPOSTPROC_VERSION_MAJOR 52
> -#define LIBPOSTPROC_VERSION_MINOR 0
> -#define LIBPOSTPROC_VERSION_MICRO 100
> -#endif
> -
> -#define LIBPOSTPROC_VERSION_INT AV_VERSION_INT(LIBPOSTPROC_VERSION_MAJOR, \
> - LIBPOSTPROC_VERSION_MINOR, \
> - LIBPOSTPROC_VERSION_MICRO)
> -#define LIBPOSTPROC_VERSION AV_VERSION(LIBPOSTPROC_VERSION_MAJOR, \
> - LIBPOSTPROC_VERSION_MINOR, \
> - LIBPOSTPROC_VERSION_MICRO)
> -#define LIBPOSTPROC_BUILD LIBPOSTPROC_VERSION_INT
> -
> -#define LIBPOSTPROC_IDENT "postproc" AV_STRINGIFY(LIBPOSTPROC_VERSION)
> +#include "libpostproc/version.h"
>
> /**
> * Return the LIBPOSTPROC_VERSION_INT constant.
> diff --git a/libpostproc/version.h b/libpostproc/version.h
> new file mode 100644
> index 0000000..17443ea
> --- /dev/null
> +++ b/libpostproc/version.h
> @@ -0,0 +1,47 @@
> +/*
> + * Version macros.
> + *
> + * This file is part of FFmpeg.
> + *
> + * FFmpeg 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.
> + *
> + * FFmpeg 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 FFmpeg; if not, write to the Free Software
> + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
> + */
> +
> +#ifndef POSTPROC_POSTPROCESS_VERSION_H
> +#define POSTPROC_POSTPROCESS_VERSION_H
> +
> +/**
> + * @file
> + * Libpostproc version macros
> + */
> +
> +#include "libavutil/avutil.h"
> +
> +#ifndef LIBPOSTPROC_VERSION_MAJOR
> +#define LIBPOSTPROC_VERSION_MAJOR 52
> +#define LIBPOSTPROC_VERSION_MINOR 0
> +#define LIBPOSTPROC_VERSION_MICRO 100
> +#endif
> +
> +#define LIBPOSTPROC_VERSION_INT AV_VERSION_INT(LIBPOSTPROC_VERSION_MAJOR, \
> + LIBPOSTPROC_VERSION_MINOR, \
> + LIBPOSTPROC_VERSION_MICRO)
> +#define LIBPOSTPROC_VERSION AV_VERSION(LIBPOSTPROC_VERSION_MAJOR, \
> + LIBPOSTPROC_VERSION_MINOR, \
> + LIBPOSTPROC_VERSION_MICRO)
> +#define LIBPOSTPROC_BUILD LIBPOSTPROC_VERSION_INT
> +
> +#define LIBPOSTPROC_IDENT "postproc" AV_STRINGIFY(LIBPOSTPROC_VERSION)
> +
> +#endif /* POSTPROC_POSTPROCESS_VERSION_H */
LGTM.
I believe the purpose of this and other similar patches is to create a
minimal version.h file which can be easily included in another file.
--
FFmpeg = Fancy Forgiving Multimedia Programmable Elected Geek
More information about the ffmpeg-devel
mailing list