avcodec/avcodec: Avoid codec_desc.h, codec_par.h inclusions

Instead, use forward declarations; and in order not to affect
any user include these headers for them, but not internally.
This has the advantage of removing implicit inclusions of these
headers from almost all files providing codecs.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
pull/390/head
Andreas Rheinhardt 1 year ago
parent ea14e8bc30
commit f58038d498
  1. 1
      libavcodec/avcodec.c
  2. 14
      libavcodec/avcodec.h
  3. 1
      libavcodec/decode.c
  4. 1
      libavcodec/encode.c
  5. 1
      libavcodec/nvenc.c
  6. 2
      libavcodec/tests/codec_desc.c
  7. 2
      libavcodec/utils.c
  8. 1
      libavcodec/vaapi_decode.c
  9. 1
      libavfilter/vf_subtitles.c

@ -37,6 +37,7 @@
#include "avcodec.h" #include "avcodec.h"
#include "avcodec_internal.h" #include "avcodec_internal.h"
#include "bsf.h" #include "bsf.h"
#include "codec_desc.h"
#include "codec_internal.h" #include "codec_internal.h"
#include "decode.h" #include "decode.h"
#include "encode.h" #include "encode.h"

@ -31,6 +31,7 @@
#include "libavutil/attributes.h" #include "libavutil/attributes.h"
#include "libavutil/avutil.h" #include "libavutil/avutil.h"
#include "libavutil/buffer.h" #include "libavutil/buffer.h"
#include "libavutil/channel_layout.h"
#include "libavutil/dict.h" #include "libavutil/dict.h"
#include "libavutil/frame.h" #include "libavutil/frame.h"
#include "libavutil/log.h" #include "libavutil/log.h"
@ -38,8 +39,6 @@
#include "libavutil/rational.h" #include "libavutil/rational.h"
#include "codec.h" #include "codec.h"
#include "codec_desc.h"
#include "codec_par.h"
#include "codec_id.h" #include "codec_id.h"
#include "defs.h" #include "defs.h"
#include "packet.h" #include "packet.h"
@ -49,8 +48,13 @@
* to avoid unnecessary rebuilds. When included externally, keep including * to avoid unnecessary rebuilds. When included externally, keep including
* the full version information. */ * the full version information. */
#include "version.h" #include "version.h"
#include "codec_desc.h"
#include "codec_par.h"
#endif #endif
struct AVCodecParameters;
/** /**
* @defgroup libavc libavcodec * @defgroup libavc libavcodec
* Encoding/Decoding Library * Encoding/Decoding Library
@ -1815,7 +1819,7 @@ typedef struct AVCodecContext {
* - encoding: unused. * - encoding: unused.
* - decoding: set by libavcodec. * - decoding: set by libavcodec.
*/ */
const AVCodecDescriptor *codec_descriptor; const struct AVCodecDescriptor *codec_descriptor;
/** /**
* Current statistics for PTS correction. * Current statistics for PTS correction.
@ -2328,7 +2332,7 @@ const AVClass *avcodec_get_subtitle_rect_class(void);
* *
* @return >= 0 on success, a negative AVERROR code on failure * @return >= 0 on success, a negative AVERROR code on failure
*/ */
int avcodec_parameters_from_context(AVCodecParameters *par, int avcodec_parameters_from_context(struct AVCodecParameters *par,
const AVCodecContext *codec); const AVCodecContext *codec);
/** /**
@ -2340,7 +2344,7 @@ int avcodec_parameters_from_context(AVCodecParameters *par,
* @return >= 0 on success, a negative AVERROR code on failure. * @return >= 0 on success, a negative AVERROR code on failure.
*/ */
int avcodec_parameters_to_context(AVCodecContext *codec, int avcodec_parameters_to_context(AVCodecContext *codec,
const AVCodecParameters *par); const struct AVCodecParameters *par);
/** /**
* Initialize the AVCodecContext to use the given AVCodec. Prior to using this * Initialize the AVCodecContext to use the given AVCodec. Prior to using this

@ -45,6 +45,7 @@
#include "avcodec_internal.h" #include "avcodec_internal.h"
#include "bytestream.h" #include "bytestream.h"
#include "bsf.h" #include "bsf.h"
#include "codec_desc.h"
#include "codec_internal.h" #include "codec_internal.h"
#include "decode.h" #include "decode.h"
#include "hwaccel_internal.h" #include "hwaccel_internal.h"

@ -30,6 +30,7 @@
#include "avcodec.h" #include "avcodec.h"
#include "avcodec_internal.h" #include "avcodec_internal.h"
#include "codec_desc.h"
#include "codec_internal.h" #include "codec_internal.h"
#include "encode.h" #include "encode.h"
#include "frame_thread_encoder.h" #include "frame_thread_encoder.h"

@ -36,6 +36,7 @@
#include "libavutil/pixdesc.h" #include "libavutil/pixdesc.h"
#include "libavutil/mathematics.h" #include "libavutil/mathematics.h"
#include "atsc_a53.h" #include "atsc_a53.h"
#include "codec_desc.h"
#include "encode.h" #include "encode.h"
#include "internal.h" #include "internal.h"
#include "packet_internal.h" #include "packet_internal.h"

@ -16,7 +16,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/ */
#include "libavcodec/avcodec.h" #include "libavcodec/codec_desc.h"
int main(int argc, char **argv) int main(int argc, char **argv)
{ {

@ -35,7 +35,9 @@
#include "libavutil/pixfmt.h" #include "libavutil/pixfmt.h"
#include "avcodec.h" #include "avcodec.h"
#include "codec.h" #include "codec.h"
#include "codec_desc.h"
#include "codec_internal.h" #include "codec_internal.h"
#include "codec_par.h"
#include "decode.h" #include "decode.h"
#include "hwconfig.h" #include "hwconfig.h"
#include "thread.h" #include "thread.h"

@ -23,6 +23,7 @@
#include "libavutil/pixdesc.h" #include "libavutil/pixdesc.h"
#include "avcodec.h" #include "avcodec.h"
#include "codec_desc.h"
#include "decode.h" #include "decode.h"
#include "internal.h" #include "internal.h"
#include "vaapi_decode.h" #include "vaapi_decode.h"

@ -33,6 +33,7 @@
#include "config_components.h" #include "config_components.h"
#if CONFIG_SUBTITLES_FILTER #if CONFIG_SUBTITLES_FILTER
# include "libavcodec/avcodec.h" # include "libavcodec/avcodec.h"
# include "libavcodec/codec_desc.h"
# include "libavformat/avformat.h" # include "libavformat/avformat.h"
#endif #endif
#include "libavutil/avstring.h" #include "libavutil/avstring.h"

Loading…
Cancel
Save