History

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.

Andreas Rheinhardt committed 5 years ago

Commit fd101c91 parent 642b20217 files · +30 −15Browse files

Unified · Split

17 files
  1. libavdevice/v4l2.c +1 −0
  2. libavformat/aadec.c +1 −0
  3. libavformat/argo_asf.c +1 −0
  4. libavformat/argo_cvg.c +1 −0
  5. libavformat/au.c +1 −0
  6. libavformat/avio_internal.h +14 −0
  7. libavformat/concatdec.c +1 −0
  8. libavformat/dashdec.c +1 −0
  9. libavformat/dashenc.c +1 −0
  10. libavformat/flacenc.c +1 −0
  11. libavformat/framecrcenc.c +1 −0
  12. libavformat/hlsenc.c +1 −0
  13. libavformat/internal.h +1 −15
  14. libavformat/librist.c +1 −0
  15. libavformat/mxfdec.c +1 −0
  16. libavformat/ttmlenc.c +1 −0
  17. libavformat/utils.c +1 −0
libavdevice/v4l2.c+1−0
@@ -33,6 +33,7 @@ · 32 unmodified lines
3333 #include <stdatomic.h>
3434
3535 #include "libavutil/avassert.h"
36+#include "libavutil/avstring.h"
3637 #include "v4l2-common.h"
3738 #include <dirent.h>
3839
libavformat/aadec.c+1−0
@@ -25,6 +25,7 @@ · 24 unmodified lines
2525
2626 #include "avformat.h"
2727 #include "internal.h"
28+#include "libavutil/avstring.h"
2829 #include "libavutil/dict.h"
2930 #include "libavutil/intreadwrite.h"
3031 #include "libavutil/tea.h"
libavformat/argo_asf.c+1−0
@@ -19,6 +19,7 @@ · 18 unmodified lines
1919 * License along with FFmpeg; if not, write to the Free Software
2020 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
2121 */
22+#include "libavutil/avstring.h"
2223 #include "avformat.h"
2324 #include "internal.h"
2425 #include "libavutil/channel_layout.h"
libavformat/argo_cvg.c+1−0
@@ -20,6 +20,7 @@ · 19 unmodified lines
2020 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
2121 */
2222
23+#include "libavutil/avstring.h"
2324 #include "libavutil/channel_layout.h"
2425 #include "avformat.h"
2526 #include "internal.h"
libavformat/au.c+1−0
@@ -27,6 +27,7 @@ · 26 unmodified lines
2727 * http://www.goice.co.jp/member/mo/formats/au.html
2828 */
2929
30+#include "libavutil/bprint.h"
3031 #include "avformat.h"
3132 #include "internal.h"
3233 #include "avio_internal.h"
libavformat/avio_internal.h+14−0
@@ -187,4 +187,18 @@ void ffio_reset_dyn_buf(AVIOContext *s); · 186 unmodified lines
187187 */
188188 void ffio_free_dyn_buf(AVIOContext **s);
189189
190+struct AVBPrint;
191+/**
192+ * Read a whole line of text from AVIOContext to an AVBPrint buffer overwriting
193+ * its contents. Stop reading after reaching a \\r, a \\n, a \\r\\n, a \\0 or
194+ * EOF. The line ending characters are NOT included in the buffer, but they
195+ * are skipped on the input.
196+ *
197+ * @param s the read-only AVIOContext
198+ * @param bp the AVBPrint buffer
199+ * @return the length of the read line not including the line endings,
200+ * negative on error, or if the buffer becomes truncated.
201+ */
202+int64_t ff_read_line_to_bprint_overwrite(AVIOContext *s, struct AVBPrint *bp);
203+
190204 #endif /* AVFORMAT_AVIO_INTERNAL_H */
libavformat/concatdec.c+1−0
@@ -26,6 +26,7 @@ · 25 unmodified lines
2626 #include "libavutil/timestamp.h"
2727 #include "libavcodec/bsf.h"
2828 #include "avformat.h"
29+#include "avio_internal.h"
2930 #include "internal.h"
3031 #include "url.h"
3132
libavformat/dashdec.c+1−0
@@ -20,6 +20,7 @@ · 19 unmodified lines
2020 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
2121 */
2222 #include <libxml/parser.h>
23+#include "libavutil/bprint.h"
2324 #include "libavutil/intreadwrite.h"
2425 #include "libavutil/opt.h"
2526 #include "libavutil/time.h"
libavformat/dashenc.c+1−0
@@ -28,6 +28,7 @@ · 27 unmodified lines
2828 #include "libavutil/avassert.h"
2929 #include "libavutil/avutil.h"
3030 #include "libavutil/avstring.h"
31+#include "libavutil/bprint.h"
3132 #include "libavutil/intreadwrite.h"
3233 #include "libavutil/mathematics.h"
3334 #include "libavutil/opt.h"
libavformat/flacenc.c+1−0
@@ -19,6 +19,7 @@ · 18 unmodified lines
1919 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
2020 */
2121
22+#include "libavutil/avstring.h"
2223 #include "libavutil/channel_layout.h"
2324 #include "libavutil/opt.h"
2425 #include "libavutil/pixdesc.h"
libavformat/framecrcenc.c+1−0
@@ -22,6 +22,7 @@ · 21 unmodified lines
2222 #include <inttypes.h>
2323
2424 #include "libavutil/adler32.h"
25+#include "libavutil/avstring.h"
2526
2627 #include "libavcodec/codec_id.h"
2728 #include "libavcodec/codec_par.h"
libavformat/hlsenc.c+1−0
@@ -37,6 +37,7 @@ · 36 unmodified lines
3737 #include "libavutil/mathematics.h"
3838 #include "libavutil/parseutils.h"
3939 #include "libavutil/avstring.h"
40+#include "libavutil/bprint.h"
4041 #include "libavutil/intreadwrite.h"
4142 #include "libavutil/random_seed.h"
4243 #include "libavutil/opt.h"
libavformat/internal.h+1−15
@@ -23,8 +23,6 @@ · 22 unmodified lines
2323
2424 #include <stdint.h>
2525
26−#include "libavutil/bprint.h"
27−
2826 #include "libavcodec/avcodec.h"
2927 #include "libavcodec/bsf.h"
3028
@@ -539,19 +537,6 @@ int ff_get_line(AVIOContext *s, char *buf, int maxlen); · 508 unmodified lines
539537 */
540538 int ff_get_chomp_line(AVIOContext *s, char *buf, int maxlen);
541539
542−/**
543− * Read a whole line of text from AVIOContext to an AVBPrint buffer overwriting
544− * its contents. Stop reading after reaching a \\r, a \\n, a \\r\\n, a \\0 or
545− * EOF. The line ending characters are NOT included in the buffer, but they
546− * are skipped on the input.
547− *
548− * @param s the read-only AVIOContext
549− * @param bp the AVBPrint buffer
550− * @return the length of the read line not including the line endings,
551− * negative on error, or if the buffer becomes truncated.
552− */
553−int64_t ff_read_line_to_bprint_overwrite(AVIOContext *s, AVBPrint *bp);
554−
555540 #define SPACE_CHARS " \t\r\n"
556541
557542 /**
@@ -931,6 +916,7 @@ int ff_reshuffle_raw_rgb(AVFormatContext *s, AVPacket **ppkt, AVCodecParameters · 373 unmodified lines
931916 */
932917 int ff_get_packet_palette(AVFormatContext *s, AVPacket *pkt, int ret, uint32_t *palette);
933918
919+struct AVBPrint;
934920 /**
935921 * Finalize buf into extradata and set its size appropriately.
936922 */
libavformat/librist.c+1−0
@@ -22,6 +22,7 @@ · 21 unmodified lines
2222 */
2323
2424 #include "libavutil/avassert.h"
25+#include "libavutil/avstring.h"
2526 #include "libavutil/opt.h"
2627 #include "libavutil/parseutils.h"
2728 #include "libavutil/time.h"
libavformat/mxfdec.c+1−0
@@ -47,6 +47,7 @@ · 46 unmodified lines
4747 #include <inttypes.h>
4848
4949 #include "libavutil/aes.h"
50+#include "libavutil/avstring.h"
5051 #include "libavutil/mastering_display_metadata.h"
5152 #include "libavutil/mathematics.h"
5253 #include "libavcodec/bytestream.h"
libavformat/ttmlenc.c+1−0
@@ -27,6 +27,7 @@ · 26 unmodified lines
2727 * @see https://www.w3.org/TR/ttml-imsc/rec
2828 */
2929
30+#include "libavutil/avstring.h"
3031 #include "avformat.h"
3132 #include "internal.h"
3233 #include "libavcodec/ttmlenc.h"
libavformat/utils.c+1−0
@@ -25,6 +25,7 @@ · 24 unmodified lines
2525
2626 #include "libavutil/avassert.h"
2727 #include "libavutil/avstring.h"
28+#include "libavutil/bprint.h"
2829 #include "libavutil/dict.h"
2930 #include "libavutil/internal.h"
3031 #include "libavutil/mathematics.h"

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t