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>
pull/360/head
Andreas Rheinhardt 4 years ago
parent 642b202567
commit fd101c9c3b
  1. 1
      libavdevice/v4l2.c
  2. 1
      libavformat/aadec.c
  3. 1
      libavformat/argo_asf.c
  4. 1
      libavformat/argo_cvg.c
  5. 1
      libavformat/au.c
  6. 14
      libavformat/avio_internal.h
  7. 1
      libavformat/concatdec.c
  8. 1
      libavformat/dashdec.c
  9. 1
      libavformat/dashenc.c
  10. 1
      libavformat/flacenc.c
  11. 1
      libavformat/framecrcenc.c
  12. 1
      libavformat/hlsenc.c
  13. 16
      libavformat/internal.h
  14. 1
      libavformat/librist.c
  15. 1
      libavformat/mxfdec.c
  16. 1
      libavformat/ttmlenc.c
  17. 1
      libavformat/utils.c

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

@ -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"

@ -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"

@ -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"

@ -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"

@ -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 */

@ -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"

@ -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"

@ -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"

@ -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"

@ -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"

@ -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"

@ -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.
*/

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

@ -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"

@ -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"

@ -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"

Loading…
Cancel
Save