diff mbox series

[FFmpeg-devel] lavc/cbs: avoid avcodec.h dependency

Message ID 20210531100345.27379-1-anton@khirnov.net
State Accepted
Commit e91901adf66371bdb2d4c389b6736a8f95d50fdf
Headers show
Series [FFmpeg-devel] lavc/cbs: avoid avcodec.h dependency | expand

Checks

Context Check Description
andriy/x86_make success Make finished
andriy/x86_make_fate success Make fate finished
andriy/PPC64_make success Make finished
andriy/PPC64_make_fate success Make fate finished

Commit Message

Anton Khirnov May 31, 2021, 10:03 a.m. UTC
Include only the headers that are actually needed.
---
 libavcodec/cbs.c | 1 +
 libavcodec/cbs.h | 7 +++++--
 2 files changed, 6 insertions(+), 2 deletions(-)

Comments

James Almer May 31, 2021, 11:59 a.m. UTC | #1
On 5/31/2021 7:03 AM, Anton Khirnov wrote:
> Include only the headers that are actually needed.
> ---
>   libavcodec/cbs.c | 1 +
>   libavcodec/cbs.h | 7 +++++--
>   2 files changed, 6 insertions(+), 2 deletions(-)
> 
> diff --git a/libavcodec/cbs.c b/libavcodec/cbs.c
> index bbfafb6530..8d50ea1432 100644
> --- a/libavcodec/cbs.c
> +++ b/libavcodec/cbs.c
> @@ -25,6 +25,7 @@
>   #include "libavutil/common.h"
>   #include "libavutil/opt.h"
>   
> +#include "avcodec.h"
>   #include "cbs.h"
>   #include "cbs_internal.h"
>   
> diff --git a/libavcodec/cbs.h b/libavcodec/cbs.h
> index f022282b75..b7acf98347 100644
> --- a/libavcodec/cbs.h
> +++ b/libavcodec/cbs.h
> @@ -24,7 +24,9 @@
>   
>   #include "libavutil/buffer.h"
>   
> -#include "avcodec.h"
> +#include "codec_id.h"
> +#include "codec_par.h"
> +#include "packet.h"
>   
>   
>   /*
> @@ -40,6 +42,7 @@
>    * bitstream.
>    */
>   
> +struct AVCodecContext;
>   struct CodedBitstreamType;
>   
>   /**
> @@ -271,7 +274,7 @@ int ff_cbs_read_extradata(CodedBitstreamContext *ctx,
>    */
>   int ff_cbs_read_extradata_from_codec(CodedBitstreamContext *ctx,
>                                        CodedBitstreamFragment *frag,
> -                                     const AVCodecContext *avctx);
> +                                     const struct AVCodecContext *avctx);
>   
>   /**
>    * Read the data bitstream from a packet into a fragment, then

LGTM now, thanks.
diff mbox series

Patch

diff --git a/libavcodec/cbs.c b/libavcodec/cbs.c
index bbfafb6530..8d50ea1432 100644
--- a/libavcodec/cbs.c
+++ b/libavcodec/cbs.c
@@ -25,6 +25,7 @@ 
 #include "libavutil/common.h"
 #include "libavutil/opt.h"
 
+#include "avcodec.h"
 #include "cbs.h"
 #include "cbs_internal.h"
 
diff --git a/libavcodec/cbs.h b/libavcodec/cbs.h
index f022282b75..b7acf98347 100644
--- a/libavcodec/cbs.h
+++ b/libavcodec/cbs.h
@@ -24,7 +24,9 @@ 
 
 #include "libavutil/buffer.h"
 
-#include "avcodec.h"
+#include "codec_id.h"
+#include "codec_par.h"
+#include "packet.h"
 
 
 /*
@@ -40,6 +42,7 @@ 
  * bitstream.
  */
 
+struct AVCodecContext;
 struct CodedBitstreamType;
 
 /**
@@ -271,7 +274,7 @@  int ff_cbs_read_extradata(CodedBitstreamContext *ctx,
  */
 int ff_cbs_read_extradata_from_codec(CodedBitstreamContext *ctx,
                                      CodedBitstreamFragment *frag,
-                                     const AVCodecContext *avctx);
+                                     const struct AVCodecContext *avctx);
 
 /**
  * Read the data bitstream from a packet into a fragment, then