[FFmpeg-devel] [PATCH 18/44] avdevice/v4l2*: Improve included headers

Andreas Rheinhardt andreas.rheinhardt at outlook.com
Sat May 7 14:28:04 EEST 2022


Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at outlook.com>
---
 libavdevice/v4l2-common.h | 13 +++----------
 libavdevice/v4l2.c        |  8 ++++++++
 libavdevice/v4l2enc.c     |  4 +++-
 3 files changed, 14 insertions(+), 11 deletions(-)

diff --git a/libavdevice/v4l2-common.h b/libavdevice/v4l2-common.h
index c7bed3e3b4..4fbd15d28c 100644
--- a/libavdevice/v4l2-common.h
+++ b/libavdevice/v4l2-common.h
@@ -21,7 +21,7 @@
 
 #undef __STRICT_ANSI__ //workaround due to broken kernel headers
 #include "config.h"
-#include "libavformat/internal.h"
+#include <stdint.h>
 #include <unistd.h>
 #include <fcntl.h>
 #include <sys/ioctl.h>
@@ -35,15 +35,8 @@
 #endif
 #include <linux/videodev2.h>
 #endif
-#include "libavutil/imgutils.h"
-#include "libavutil/log.h"
-#include "libavutil/opt.h"
-#include "avdevice.h"
-#include "timefilter.h"
-#include "libavutil/parseutils.h"
-#include "libavutil/pixdesc.h"
-#include "libavutil/time.h"
-#include "libavutil/avstring.h"
+#include "libavutil/pixfmt.h"
+#include "libavcodec/codec_id.h"
 
 struct fmt_map {
     enum AVPixelFormat ff_fmt;
diff --git a/libavdevice/v4l2.c b/libavdevice/v4l2.c
index 1f009af4de..5340382d57 100644
--- a/libavdevice/v4l2.c
+++ b/libavdevice/v4l2.c
@@ -34,7 +34,15 @@
 
 #include "libavutil/avassert.h"
 #include "libavutil/avstring.h"
+#include "libavutil/imgutils.h"
+#include "libavutil/parseutils.h"
+#include "libavutil/pixdesc.h"
+#include "libavutil/time.h"
+#include "libavcodec/codec_desc.h"
 #include "libavformat/demux.h"
+#include "libavformat/internal.h"
+#include "avdevice.h"
+#include "timefilter.h"
 #include "v4l2-common.h"
 #include <dirent.h>
 
diff --git a/libavdevice/v4l2enc.c b/libavdevice/v4l2enc.c
index 787fe53547..b1006461b7 100644
--- a/libavdevice/v4l2enc.c
+++ b/libavdevice/v4l2enc.c
@@ -18,8 +18,10 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
+#include "libavutil/imgutils.h"
+#include "libavutil/pixdesc.h"
+#include "libavformat/avformat.h"
 #include "v4l2-common.h"
-#include "avdevice.h"
 
 typedef struct {
     AVClass *class;
-- 
2.32.0



More information about the ffmpeg-devel mailing list