@@ -29,7 +29,6 @@
#include "libavutil/fifo.h"
#include "libavutil/opt.h"
#include "libavutil/time.h"
-#include "libavcodec/avcodec.h"
#include "libavformat/avformat.h"
#include "libavformat/internal.h"
#include "timefilter.h"
@@ -38,6 +38,7 @@
#include "libavutil/parseutils.h"
#include "libavutil/pixdesc.h"
#include "libavutil/time.h"
+#include "libavcodec/avcodec.h"
#include "libavcodec/codec_desc.h"
#include "libavformat/demux.h"
#include "libavformat/internal.h"
@@ -25,6 +25,7 @@
#include "libavutil/dict.h"
#include "libavutil/mathematics.h"
#include "libavutil/opt.h"
+#include "libavcodec/codec_desc.h"
#include "avformat.h"
#include "avlanguage.h"
#include "avio_internal.h"
@@ -19,11 +19,11 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#include "config.h"
#include "config_components.h"
#include "libavutil/common.h"
#include "libavutil/opt.h"
+#include "libavcodec/avcodec.h"
#include "libavcodec/av1_parse.h"
#include "libavcodec/bsf.h"
#include "avformat.h"
@@ -25,6 +25,7 @@
#include "libavutil/opt.h"
#include "libavutil/parseutils.h"
#include "libavutil/timestamp.h"
+#include "libavcodec/codec_desc.h"
#include "libavcodec/bsf.h"
#include "avformat.h"
#include "avio_internal.h"
@@ -38,6 +38,8 @@
#include "libavutil/time.h"
#include "libavutil/time_internal.h"
+#include "libavcodec/avcodec.h"
+
#include "av1.h"
#include "avc.h"
#include "avformat.h"
@@ -34,6 +34,7 @@
#include "libavutil/time.h"
#include "libavutil/timestamp.h"
+#include "libavcodec/avcodec.h"
#include "libavcodec/bsf.h"
#include "libavcodec/internal.h"
#include "libavcodec/packet_internal.h"
@@ -30,12 +30,13 @@
#include "libavutil/dovi_meta.h"
#include "libavutil/mathematics.h"
#include "libavutil/opt.h"
-#include "libavutil/avstring.h"
#include "libavutil/replaygain.h"
#include "libavutil/spherical.h"
#include "libavutil/stereo3d.h"
#include "libavutil/timecode.h"
+#include "libavcodec/avcodec.h"
+
#include "avformat.h"
#include "internal.h"
@@ -20,6 +20,7 @@
*/
#include "libavutil/channel_layout.h"
+#include "libavcodec/avcodec.h"
#include "libavcodec/bytestream.h"
#include "libavcodec/flac.h"
#include "avformat.h"
@@ -24,6 +24,7 @@
#include "libavutil/intfloat.h"
#include "libavutil/avassert.h"
#include "libavutil/mathematics.h"
+#include "libavcodec/codec_desc.h"
#include "libavcodec/mpeg4audio.h"
#include "avio.h"
#include "avc.h"
@@ -43,6 +43,8 @@
#include "libavutil/time.h"
#include "libavutil/time_internal.h"
+#include "libavcodec/avcodec.h"
+
#include "avformat.h"
#include "avio_internal.h"
#include "avc.h"
@@ -23,7 +23,6 @@
#include <stdint.h>
-#include "libavcodec/avcodec.h"
#include "libavcodec/packet_internal.h"
#include "avformat.h"
@@ -221,7 +220,7 @@ typedef struct FFStream {
/**
* The codec context used by avformat_find_stream_info, the parser, etc.
*/
- AVCodecContext *avctx;
+ struct AVCodecContext *avctx;
/**
* 1 if avctx has been initialized with the values from the codec parameters
*/
@@ -58,6 +58,7 @@
#include "libavutil/stereo3d.h"
#include "libavcodec/av1.h"
+#include "libavcodec/codec_desc.h"
#include "libavcodec/xiph.h"
#include "libavcodec/mpeg4audio.h"
@@ -32,6 +32,7 @@
#include "libavutil/opt.h"
#include "libavutil/avassert.h"
#include "libavutil/dovi_meta.h"
+#include "libavcodec/avcodec.h"
#include "libavcodec/bytestream.h"
#include "libavcodec/get_bits.h"
#include "libavcodec/opus.h"
@@ -28,6 +28,7 @@
#include "libavutil/opt.h"
#include "libavcodec/ac3_parser_internal.h"
+#include "libavcodec/avcodec.h"
#include "libavcodec/startcode.h"
#include "avformat.h"
@@ -47,6 +47,7 @@
#include "libavutil/mastering_display_metadata.h"
#include "libavutil/pixdesc.h"
#include "libavutil/time_internal.h"
+#include "libavcodec/avcodec.h"
#include "libavcodec/golomb.h"
#include "libavcodec/h264.h"
#include "libavcodec/packet_internal.h"
@@ -19,6 +19,7 @@
*/
#include <stdlib.h>
+#include "libavcodec/avcodec.h"
#include "libavcodec/get_bits.h"
#include "libavcodec/flac.h"
#include "avformat.h"
@@ -24,12 +24,10 @@
#include "avformat.h"
#include "internal.h"
-#include "avio_internal.h"
#include "rawdec.h"
#include "libavutil/opt.h"
-#include "libavutil/parseutils.h"
-#include "libavutil/pixdesc.h"
-#include "libavutil/intreadwrite.h"
+
+#include "libavcodec/avcodec.h"
#define RAW_PACKET_SIZE 1024
@@ -23,7 +23,6 @@
#include "libavutil/dict.h"
#include "libavutil/log.h"
#include "libavutil/mathematics.h"
-#include "libavcodec/avcodec.h"
#include "libavcodec/bytestream.h"
#include "avformat.h"
#include "avio_internal.h"
@@ -32,6 +32,7 @@
#include "libavutil/dict.h"
#include "libavutil/opt.h"
#include "libavutil/time.h"
+#include "libavcodec/codec_desc.h"
#include "avformat.h"
#include "avio_internal.h"
@@ -25,6 +25,8 @@
#include "libavutil/mathematics.h"
#include "libavutil/timestamp.h"
+#include "libavcodec/avcodec.h"
+
#include "avformat.h"
#include "avio_internal.h"
#include "demux.h"
The general demuxing API uses parsers and decoders. Therefore FFStream contains pointers to AVCodecContexts and AVCodecParserContext and lavf/internal.h includes lavc/avcodec.h. Yet actually only a few files files really use these; and it is best when this number stays small. Therefore this commit uses opaque structs in lavf/internal.h for these contexts and stops including avcodec.h. This also avoids including lavc/codec_desc.h implicitly. All other headers are implicitly included as now (mostly through codec.h). Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> --- libavdevice/jack.c | 1 - libavdevice/v4l2.c | 1 + libavformat/asfenc.c | 1 + libavformat/av1dec.c | 2 +- libavformat/concatdec.c | 1 + libavformat/dashenc.c | 2 ++ libavformat/demux.c | 1 + libavformat/dump.c | 3 ++- libavformat/flacdec.c | 1 + libavformat/flvenc.c | 1 + libavformat/hlsenc.c | 2 ++ libavformat/internal.h | 3 +-- libavformat/matroskaenc.c | 1 + libavformat/mpegts.c | 1 + libavformat/mpegtsenc.c | 1 + libavformat/mxfenc.c | 1 + libavformat/oggparseflac.c | 1 + libavformat/rawdec.c | 6 ++---- libavformat/riffenc.c | 1 - libavformat/rtsp.c | 1 + libavformat/seek.c | 2 ++ 21 files changed, 24 insertions(+), 10 deletions(-)