Selaa lähdekoodia

avformat/internal: Move ff_read_line_to_bprint_overwrite to avio_internal.h

It only uses an AVIOContext and an AVBPrint.

When doing so, it turned out that several non-users of
ff_read_line_to_bprint_overwrite() and ff_bprint_to_codecpar_extradata()
relied on libavformat/internal.h to include bprint.h or avstring.h
for them. In order to avoid a repeat of this and in order to reduce
unnecessary dependencies, a forward declaration of struct AVBPrint is
used instead of including bprint.h.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Andreas Rheinhardt 4 vuotta sitten
vanhempi
sitoutus
fd101c9c3b

+ 1 - 0
libavdevice/v4l2.c

@@ -33,6 +33,7 @@
 #include <stdatomic.h>
 
 #include "libavutil/avassert.h"
+#include "libavutil/avstring.h"
 #include "v4l2-common.h"
 #include <dirent.h>
 

+ 1 - 0
libavformat/aadec.c

@@ -25,6 +25,7 @@
 
 #include "avformat.h"
 #include "internal.h"
+#include "libavutil/avstring.h"
 #include "libavutil/dict.h"
 #include "libavutil/intreadwrite.h"
 #include "libavutil/tea.h"

+ 1 - 0
libavformat/argo_asf.c

@@ -19,6 +19,7 @@
  * License along with FFmpeg; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
+#include "libavutil/avstring.h"
 #include "avformat.h"
 #include "internal.h"
 #include "libavutil/channel_layout.h"

+ 1 - 0
libavformat/argo_cvg.c

@@ -20,6 +20,7 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
+#include "libavutil/avstring.h"
 #include "libavutil/channel_layout.h"
 #include "avformat.h"
 #include "internal.h"

+ 1 - 0
libavformat/au.c

@@ -27,6 +27,7 @@
  * http://www.goice.co.jp/member/mo/formats/au.html
  */
 
+#include "libavutil/bprint.h"
 #include "avformat.h"
 #include "internal.h"
 #include "avio_internal.h"

+ 14 - 0
libavformat/avio_internal.h

@@ -187,4 +187,18 @@ void ffio_reset_dyn_buf(AVIOContext *s);
  */
 void ffio_free_dyn_buf(AVIOContext **s);
 
+struct AVBPrint;
+/**
+ * Read a whole line of text from AVIOContext to an AVBPrint buffer overwriting
+ * its contents. Stop reading after reaching a \\r, a \\n, a \\r\\n, a \\0 or
+ * EOF. The line ending characters are NOT included in the buffer, but they
+ * are skipped on the input.
+ *
+ * @param s the read-only AVIOContext
+ * @param bp the AVBPrint buffer
+ * @return the length of the read line not including the line endings,
+ *         negative on error, or if the buffer becomes truncated.
+ */
+int64_t ff_read_line_to_bprint_overwrite(AVIOContext *s, struct AVBPrint *bp);
+
 #endif /* AVFORMAT_AVIO_INTERNAL_H */

+ 1 - 0
libavformat/concatdec.c

@@ -26,6 +26,7 @@
 #include "libavutil/timestamp.h"
 #include "libavcodec/bsf.h"
 #include "avformat.h"
+#include "avio_internal.h"
 #include "internal.h"
 #include "url.h"
 

+ 1 - 0
libavformat/dashdec.c

@@ -20,6 +20,7 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 #include <libxml/parser.h>
+#include "libavutil/bprint.h"
 #include "libavutil/intreadwrite.h"
 #include "libavutil/opt.h"
 #include "libavutil/time.h"

+ 1 - 0
libavformat/dashenc.c

@@ -28,6 +28,7 @@
 #include "libavutil/avassert.h"
 #include "libavutil/avutil.h"
 #include "libavutil/avstring.h"
+#include "libavutil/bprint.h"
 #include "libavutil/intreadwrite.h"
 #include "libavutil/mathematics.h"
 #include "libavutil/opt.h"

+ 1 - 0
libavformat/flacenc.c

@@ -19,6 +19,7 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
+#include "libavutil/avstring.h"
 #include "libavutil/channel_layout.h"
 #include "libavutil/opt.h"
 #include "libavutil/pixdesc.h"

+ 1 - 0
libavformat/framecrcenc.c

@@ -22,6 +22,7 @@
 #include <inttypes.h>
 
 #include "libavutil/adler32.h"
+#include "libavutil/avstring.h"
 
 #include "libavcodec/codec_id.h"
 #include "libavcodec/codec_par.h"

+ 1 - 0
libavformat/hlsenc.c

@@ -37,6 +37,7 @@
 #include "libavutil/mathematics.h"
 #include "libavutil/parseutils.h"
 #include "libavutil/avstring.h"
+#include "libavutil/bprint.h"
 #include "libavutil/intreadwrite.h"
 #include "libavutil/random_seed.h"
 #include "libavutil/opt.h"

+ 1 - 15
libavformat/internal.h

@@ -23,8 +23,6 @@
 
 #include <stdint.h>
 
-#include "libavutil/bprint.h"
-
 #include "libavcodec/avcodec.h"
 #include "libavcodec/bsf.h"
 
@@ -539,19 +537,6 @@ int ff_get_line(AVIOContext *s, char *buf, int maxlen);
  */
 int ff_get_chomp_line(AVIOContext *s, char *buf, int maxlen);
 
-/**
- * Read a whole line of text from AVIOContext to an AVBPrint buffer overwriting
- * its contents. Stop reading after reaching a \\r, a \\n, a \\r\\n, a \\0 or
- * EOF. The line ending characters are NOT included in the buffer, but they
- * are skipped on the input.
- *
- * @param s the read-only AVIOContext
- * @param bp the AVBPrint buffer
- * @return the length of the read line not including the line endings,
- *         negative on error, or if the buffer becomes truncated.
- */
-int64_t ff_read_line_to_bprint_overwrite(AVIOContext *s, AVBPrint *bp);
-
 #define SPACE_CHARS " \t\r\n"
 
 /**
@@ -931,6 +916,7 @@ int ff_reshuffle_raw_rgb(AVFormatContext *s, AVPacket **ppkt, AVCodecParameters
  */
 int ff_get_packet_palette(AVFormatContext *s, AVPacket *pkt, int ret, uint32_t *palette);
 
+struct AVBPrint;
 /**
  * Finalize buf into extradata and set its size appropriately.
  */

+ 1 - 0
libavformat/librist.c

@@ -22,6 +22,7 @@
  */
 
 #include "libavutil/avassert.h"
+#include "libavutil/avstring.h"
 #include "libavutil/opt.h"
 #include "libavutil/parseutils.h"
 #include "libavutil/time.h"

+ 1 - 0
libavformat/mxfdec.c

@@ -47,6 +47,7 @@
 #include <inttypes.h>
 
 #include "libavutil/aes.h"
+#include "libavutil/avstring.h"
 #include "libavutil/mastering_display_metadata.h"
 #include "libavutil/mathematics.h"
 #include "libavcodec/bytestream.h"

+ 1 - 0
libavformat/ttmlenc.c

@@ -27,6 +27,7 @@
  * @see https://www.w3.org/TR/ttml-imsc/rec
  */
 
+#include "libavutil/avstring.h"
 #include "avformat.h"
 #include "internal.h"
 #include "libavcodec/ttmlenc.h"

+ 1 - 0
libavformat/utils.c

@@ -25,6 +25,7 @@
 
 #include "libavutil/avassert.h"
 #include "libavutil/avstring.h"
+#include "libavutil/bprint.h"
 #include "libavutil/dict.h"
 #include "libavutil/internal.h"
 #include "libavutil/mathematics.h"