[FFmpeg-devel] [PATCH 2/3] avcodec.h: split codec IDs into their own header

James Almer jamrial at gmail.com
Wed Apr 8 16:27:40 EEST 2020


On 4/8/2020 4:42 AM, Anton Khirnov wrote:
> ---
>  doc/APIchanges        |   3 +-
>  libavcodec/Makefile   |   1 +
>  libavcodec/avcodec.h  | 529 +--------------------------------------
>  libavcodec/codec_id.h | 560 ++++++++++++++++++++++++++++++++++++++++++
>  4 files changed, 564 insertions(+), 529 deletions(-)
>  create mode 100644 libavcodec/codec_id.h
> 
> diff --git a/doc/APIchanges b/doc/APIchanges
> index 1b301bc20b..74b18755e1 100644
> --- a/doc/APIchanges
> +++ b/doc/APIchanges
> @@ -15,7 +15,8 @@ libavutil:     2017-10-21
>  
>  API changes, most recent first:
>  
> -2020-xx-xx - xxxxxxxxxx - lavc 58.78.100 - avcodec.h packet.h
> +2020-xx-xx - xxxxxxxxxx - lavc 58.78.100 - avcodec.h codec_id.h packet.h
> +  Move AVCodecID enum to new header codec_id.h.
>    Move AVPacket-related public API to new header packet.h.
>  
>  2020-03-29 - xxxxxxxxxx - lavf 58.42.100 - avformat.h
> diff --git a/libavcodec/Makefile b/libavcodec/Makefile
> index 24a0436ca5..1c8056baf0 100644
> --- a/libavcodec/Makefile
> +++ b/libavcodec/Makefile
> @@ -6,6 +6,7 @@ HEADERS = ac3_parser.h                                                  \
>            avcodec.h                                                     \
>            avdct.h                                                       \
>            avfft.h                                                       \
> +          codec_id.h                                                    \
>            d3d11va.h                                                     \
>            dirac.h                                                       \
>            dv_profile.h                                                  \

[...]

> diff --git a/libavcodec/codec_id.h b/libavcodec/codec_id.h
> new file mode 100644
> index 0000000000..35553da8bd
> --- /dev/null
> +++ b/libavcodec/codec_id.h
> @@ -0,0 +1,560 @@
> +/*
> + * Codec IDs
> + *
> + * 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 AVCODEC_CODEC_ID_H
> +#define AVCODEC_CODEC_ID_H
> +
> +/**
> + * @addtogroup libavc
> + * @{

The stuff below used to inside the lavc_core doxy group (Which is a
subgroup of libavc). Can you either keep it that way, or maybe some
alternative that reflects this change?

> + */
> +
> +/**
> + * Identify the syntax and semantics of the bitstream.
> + * The principle is roughly:
> + * Two decoders with the same ID can decode the same streams.
> + * Two encoders with the same ID can encode compatible streams.
> + * There may be slight deviations from the principle due to implementation
> + * details.
> + *
> + * If you add a codec ID to this list, add it so that
> + * 1. no value of an existing codec ID changes (that would break ABI),
> + * 2. it is as close as possible to similar codecs
> + *
> + * After adding new codec IDs, do not forget to add an entry to the codec
> + * descriptor list and bump libavcodec minor version.
> + */

LGTM otherwise.


More information about the ffmpeg-devel mailing list