diff mbox series

[FFmpeg-devel,12/15] avformat/internal: Use forward declaration for AVCodecDescriptor

Message ID GV1P250MB073797FC93B5370E48E955468F0BA@GV1P250MB0737.EURP250.PROD.OUTLOOK.COM
State Accepted
Commit 76f244b84e6ce559546a6ab46773266ace2cfb3b
Headers show
Series [FFmpeg-devel,1/5] avcodec/nvdec_(mjpeg|vp8): Constify AVHWAccels | expand

Checks

Context Check Description
yinshiyou/make_loongarch64 success Make finished
yinshiyou/make_fate_loongarch64 success Make fate finished
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished

Commit Message

Andreas Rheinhardt Aug. 2, 2023, 10:58 a.m. UTC
This avoids including lavc/codec_desc.h everywhere and thereby
forces users to include it directly instead of lazily and potentially
unknowingly relying on indirect inclusions.

Also add the proper inclusion to libavformat/demux.c, one of the
two files that actually use the new field.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
 libavformat/demux.c    | 1 +
 libavformat/internal.h | 3 +--
 2 files changed, 2 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/libavformat/demux.c b/libavformat/demux.c
index 1ef297d5e7..b218f64574 100644
--- a/libavformat/demux.c
+++ b/libavformat/demux.c
@@ -36,6 +36,7 @@ 
 
 #include "libavcodec/avcodec.h"
 #include "libavcodec/bsf.h"
+#include "libavcodec/codec_desc.h"
 #include "libavcodec/internal.h"
 #include "libavcodec/packet_internal.h"
 #include "libavcodec/raw.h"
diff --git a/libavformat/internal.h b/libavformat/internal.h
index 9fc980601f..594afd731d 100644
--- a/libavformat/internal.h
+++ b/libavformat/internal.h
@@ -23,7 +23,6 @@ 
 
 #include <stdint.h>
 
-#include "libavcodec/codec_desc.h"
 #include "libavcodec/packet_internal.h"
 
 #include "avformat.h"
@@ -410,7 +409,7 @@  typedef struct FFStream {
     int64_t first_dts;
     int64_t cur_dts;
 
-    const AVCodecDescriptor *codec_desc;
+    const struct AVCodecDescriptor *codec_desc;
 } FFStream;
 
 static av_always_inline FFStream *ffstream(AVStream *st)