[FFmpeg-devel] [PATCH] lavfi: remove unnecessary inclusion of libavcodec/avcodec.h in avfilter.h

Stefano Sabatini stefasab at gmail.com
Fri Jun 22 13:06:58 CEST 2012


libavfilter API was designed in order to be clarly distinguished from the
libavcodec API, including avcodec.h in avfilter.h is not going to help to
stick to this principle.

The inclusion of libavutil/audioconvert.h in many files was required
because avcodec.h includes audioconvert.h.

libavfilter/avcodec.h is where the lavc/lavfi interface should be
entirely placed.
---
 libavfilter/af_aconvert.c      |    1 +
 libavfilter/af_amerge.c        |    1 +
 libavfilter/af_aresample.c     |    1 +
 libavfilter/af_asetnsamples.c  |    1 +
 libavfilter/af_atempo.c        |    1 +
 libavfilter/af_pan.c           |    1 +
 libavfilter/af_silencedetect.c |    1 +
 libavfilter/avfilter.h         |    1 -
 libavfilter/avfiltergraph.c    |    1 +
 libavfilter/buffersrc.h        |    1 +
 libavfilter/graphdump.c        |    1 +
 11 files changed, 10 insertions(+), 1 deletions(-)

diff --git a/libavfilter/af_aconvert.c b/libavfilter/af_aconvert.c
index 3cf593b..f8d5ca2 100644
--- a/libavfilter/af_aconvert.c
+++ b/libavfilter/af_aconvert.c
@@ -26,6 +26,7 @@
  */
 
 #include "libavutil/avstring.h"
+#include "libavutil/audioconvert.h"
 #include "libswresample/swresample.h"
 #include "avfilter.h"
 #include "audio.h"
diff --git a/libavfilter/af_amerge.c b/libavfilter/af_amerge.c
index bd0437d..44e1280 100644
--- a/libavfilter/af_amerge.c
+++ b/libavfilter/af_amerge.c
@@ -23,6 +23,7 @@
  * Audio merging filter
  */
 
+#include "libavutil/audioconvert.h"
 #include "libavutil/bprint.h"
 #include "libavutil/opt.h"
 #include "libswresample/swresample.h" // only for SWR_CH_MAX
diff --git a/libavfilter/af_aresample.c b/libavfilter/af_aresample.c
index 81f326f..a1dea12 100644
--- a/libavfilter/af_aresample.c
+++ b/libavfilter/af_aresample.c
@@ -24,6 +24,7 @@
  * resampling audio filter
  */
 
+#include "libavutil/audioconvert.h"
 #include "libavutil/avstring.h"
 #include "libavutil/opt.h"
 #include "libavutil/samplefmt.h"
diff --git a/libavfilter/af_asetnsamples.c b/libavfilter/af_asetnsamples.c
index 73ed534..575e968 100644
--- a/libavfilter/af_asetnsamples.c
+++ b/libavfilter/af_asetnsamples.c
@@ -25,6 +25,7 @@
  */
 
 #include "libavutil/audio_fifo.h"
+#include "libavutil/audioconvert.h"
 #include "libavutil/avassert.h"
 #include "libavutil/opt.h"
 #include "avfilter.h"
diff --git a/libavfilter/af_atempo.c b/libavfilter/af_atempo.c
index 92390cf..2cfe187 100644
--- a/libavfilter/af_atempo.c
+++ b/libavfilter/af_atempo.c
@@ -42,6 +42,7 @@
 #include "libavcodec/avfft.h"
 #include "libavutil/avassert.h"
 #include "libavutil/avstring.h"
+#include "libavutil/audioconvert.h"
 #include "libavutil/eval.h"
 #include "libavutil/opt.h"
 #include "libavutil/samplefmt.h"
diff --git a/libavfilter/af_pan.c b/libavfilter/af_pan.c
index aed59cd..bbce2c8 100644
--- a/libavfilter/af_pan.c
+++ b/libavfilter/af_pan.c
@@ -28,6 +28,7 @@
  */
 
 #include <stdio.h>
+#include "libavutil/audioconvert.h"
 #include "libavutil/avstring.h"
 #include "libavutil/opt.h"
 #include "libswresample/swresample.h"
diff --git a/libavfilter/af_silencedetect.c b/libavfilter/af_silencedetect.c
index 83aa400..404e1a1 100644
--- a/libavfilter/af_silencedetect.c
+++ b/libavfilter/af_silencedetect.c
@@ -23,6 +23,7 @@
  * Audio silence detector
  */
 
+#include "libavutil/audioconvert.h"
 #include "libavutil/opt.h"
 #include "libavutil/timestamp.h"
 #include "audio.h"
diff --git a/libavfilter/avfilter.h b/libavfilter/avfilter.h
index d439ac8..97fc3d5 100644
--- a/libavfilter/avfilter.h
+++ b/libavfilter/avfilter.h
@@ -27,7 +27,6 @@
 #include "libavutil/samplefmt.h"
 #include "libavutil/pixfmt.h"
 #include "libavutil/rational.h"
-#include "libavcodec/avcodec.h"
 
 #include <stddef.h>
 
diff --git a/libavfilter/avfiltergraph.c b/libavfilter/avfiltergraph.c
index a4ad4da..e6f0af8 100644
--- a/libavfilter/avfiltergraph.c
+++ b/libavfilter/avfiltergraph.c
@@ -26,6 +26,7 @@
 #include "libavutil/audioconvert.h"
 #include "libavutil/avassert.h"
 #include "libavutil/pixdesc.h"
+#include "libavcodec/avcodec.h" // avcodec_find_best_pix_fmt2()
 #include "avfilter.h"
 #include "avfiltergraph.h"
 #include "formats.h"
diff --git a/libavfilter/buffersrc.h b/libavfilter/buffersrc.h
index cd6492e..adfb330 100644
--- a/libavfilter/buffersrc.h
+++ b/libavfilter/buffersrc.h
@@ -25,6 +25,7 @@
  * Memory buffer source API.
  */
 
+#include "libavcodec/avcodec.h"
 #include "avfilter.h"
 
 enum {
diff --git a/libavfilter/graphdump.c b/libavfilter/graphdump.c
index 28be29d..c9d0fb0 100644
--- a/libavfilter/graphdump.c
+++ b/libavfilter/graphdump.c
@@ -21,6 +21,7 @@
 
 #include <string.h>
 
+#include "libavutil/audioconvert.h"
 #include "libavutil/bprint.h"
 #include "libavutil/pixdesc.h"
 #include "avfilter.h"
-- 
1.7.5.4



More information about the ffmpeg-devel mailing list