Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
From: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
To: ffmpeg-devel@ffmpeg.org
Cc: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Subject: [FFmpeg-devel] [PATCH 5/5] avcodec/mpeg12: Move ff_mpeg1_clean_buffers decl to a new header
Date: Fri, 30 Sep 2022 04:18:54 +0200
Message-ID: <GV1P250MB07371CB129611312C49F40518F569@GV1P250MB0737.EURP250.PROD.OUTLOOK.COM> (raw)
In-Reply-To: <GV1P250MB073772618F63A1D0EF71233E8F569@GV1P250MB0737.EURP250.PROD.OUTLOOK.COM>

It allows to avoid including mpegvideo.h when including mpeg12.h.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
 libavcodec/mpeg12.c                |  1 +
 libavcodec/mpeg12.h                | 10 +++++++---
 libavcodec/mpeg12codecs.h          | 29 +++++++++++++++++++++++++++++
 libavcodec/mpeg12dec.c             |  1 +
 libavcodec/mpegvideo_enc.c         |  2 +-
 libavcodec/tests/mpeg12framerate.c |  3 +++
 6 files changed, 42 insertions(+), 4 deletions(-)
 create mode 100644 libavcodec/mpeg12codecs.h

diff --git a/libavcodec/mpeg12.c b/libavcodec/mpeg12.c
index 7f2aaea7c0..df6aba9d74 100644
--- a/libavcodec/mpeg12.c
+++ b/libavcodec/mpeg12.c
@@ -34,6 +34,7 @@
 #include "avcodec.h"
 #include "mpegvideo.h"
 #include "mpeg12.h"
+#include "mpeg12codecs.h"
 #include "mpeg12data.h"
 #include "mpeg12dec.h"
 #include "startcode.h"
diff --git a/libavcodec/mpeg12.h b/libavcodec/mpeg12.h
index b323728a33..4e2e67eae1 100644
--- a/libavcodec/mpeg12.h
+++ b/libavcodec/mpeg12.h
@@ -22,7 +22,7 @@
 #ifndef AVCODEC_MPEG12_H
 #define AVCODEC_MPEG12_H
 
-#include "mpegvideo.h"
+#include "libavutil/rational.h"
 
 /* Start codes. */
 #define SEQ_END_CODE            0x000001b7
@@ -34,9 +34,13 @@
 #define EXT_START_CODE          0x000001b5
 #define USER_START_CODE         0x000001b2
 
-void ff_mpeg1_clean_buffers(MpegEncContext *s);
+#include "version_major.h"
 #if FF_API_FLAG_TRUNCATED
-int ff_mpeg1_find_frame_end(ParseContext *pc, const uint8_t *buf, int buf_size, AVCodecParserContext *s);
+#include <stdint.h>
+
+struct ParseContext;
+struct AVCodecParserContext;
+int ff_mpeg1_find_frame_end(struct ParseContext *pc, const uint8_t *buf, int buf_size, struct AVCodecParserContext *s);
 #endif
 
 void ff_mpeg12_find_best_frame_rate(AVRational frame_rate,
diff --git a/libavcodec/mpeg12codecs.h b/libavcodec/mpeg12codecs.h
new file mode 100644
index 0000000000..f8cf5503e2
--- /dev/null
+++ b/libavcodec/mpeg12codecs.h
@@ -0,0 +1,29 @@
+/*
+ * MPEG-1/2 codecs common code
+ * Copyright (c) 2007 Aurelien Jacobs <aurel@gnuage.org>
+ *
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * FFmpeg is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef AVCODEC_MPEG12CODECS_H
+#define AVCODEC_MPEG12CODECS_H
+
+#include "mpegvideo.h"
+
+void ff_mpeg1_clean_buffers(MpegEncContext *s);
+
+#endif /* AVCODEC_MPEG12CODECS_H */
diff --git a/libavcodec/mpeg12dec.c b/libavcodec/mpeg12dec.c
index dad1970f6c..df76a90c6c 100644
--- a/libavcodec/mpeg12dec.c
+++ b/libavcodec/mpeg12dec.c
@@ -47,6 +47,7 @@
 #include "internal.h"
 #include "mpeg_er.h"
 #include "mpeg12.h"
+#include "mpeg12codecs.h"
 #include "mpeg12data.h"
 #include "mpeg12dec.h"
 #include "mpegutils.h"
diff --git a/libavcodec/mpegvideo_enc.c b/libavcodec/mpegvideo_enc.c
index 0b398c56ab..06c3ff4cbe 100644
--- a/libavcodec/mpegvideo_enc.c
+++ b/libavcodec/mpegvideo_enc.c
@@ -46,7 +46,7 @@
 #include "dct.h"
 #include "encode.h"
 #include "idctdsp.h"
-#include "mpeg12.h"
+#include "mpeg12codecs.h"
 #include "mpeg12data.h"
 #include "mpeg12enc.h"
 #include "mpegvideo.h"
diff --git a/libavcodec/tests/mpeg12framerate.c b/libavcodec/tests/mpeg12framerate.c
index 595bdb278a..f2d3e2472c 100644
--- a/libavcodec/tests/mpeg12framerate.c
+++ b/libavcodec/tests/mpeg12framerate.c
@@ -16,6 +16,9 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
+#include <stddef.h>
+
+#include "libavutil/log.h"
 #include "libavcodec/mpeg12.h"
 #include "libavcodec/mpeg12data.h"
 
-- 
2.34.1

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

  parent reply	other threads:[~2022-09-30  2:19 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-30  2:17 [FFmpeg-devel] [PATCH 1/5] avcodec/mpeg12vlc: Move MPEG-1/2 RL VLCs to it Andreas Rheinhardt
2022-09-30  2:18 ` [FFmpeg-devel] [PATCH 2/5] avcodec/mpeg12dec: Don't call ff_mpeg12_common_init() Andreas Rheinhardt
2022-09-30  2:18 ` [FFmpeg-devel] [PATCH 3/5] avcodec/mpeg12: Inline ff_mpeg12_common_init() into mpeg12enc.c Andreas Rheinhardt
2022-09-30  2:18 ` [FFmpeg-devel] [PATCH 4/5] configure, avcodec/Makefile: Remove obsolete mpegvideo dependencies Andreas Rheinhardt
2022-09-30  2:18 ` Andreas Rheinhardt [this message]
2022-10-02 23:08 ` [FFmpeg-devel] [PATCH 1/5] avcodec/mpeg12vlc: Move MPEG-1/2 RL VLCs to it Andreas Rheinhardt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=GV1P250MB07371CB129611312C49F40518F569@GV1P250MB0737.EURP250.PROD.OUTLOOK.COM \
    --to=andreas.rheinhardt@outlook.com \
    --cc=ffmpeg-devel@ffmpeg.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
		ffmpegdev@gitmailbox.com
	public-inbox-index ffmpegdev

Example config snippet for mirrors.


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git