diff options
author | Marton Balint <cus@passwd.hu> | 2018-02-03 22:03:58 +0100 |
---|---|---|
committer | Marton Balint <cus@passwd.hu> | 2018-02-24 20:17:04 +0100 |
commit | dcb2ef2211fd472b4fa235e9f1c4a48582e44049 (patch) | |
tree | 7d8e7d18b38431d9bdbb887d58c3b701f85c02a3 /libavformat/internal.h | |
parent | 5f36c546ec4ef279027da6e0f0ef1276bea4207a (diff) | |
download | ffmpeg-dcb2ef2211fd472b4fa235e9f1c4a48582e44049.tar.gz |
avformat/aviobuf: add ff_read_line_to_bprint and ff_read_line_to_bprint_overwrite functions
To be able to read lines longer than a static buffer size.
Signed-off-by: Marton Balint <cus@passwd.hu>
Diffstat (limited to 'libavformat/internal.h')
-rw-r--r-- | libavformat/internal.h | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/libavformat/internal.h b/libavformat/internal.h index 0d08576c29..2ac7e2e1a0 100644 --- a/libavformat/internal.h +++ b/libavformat/internal.h @@ -299,6 +299,32 @@ void ff_put_v(AVIOContext *bc, uint64_t val); */ int ff_get_line(AVIOContext *s, char *buf, int maxlen); +/** + * Read a whole line of text from AVIOContext to an AVBPrint buffer. 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. + */ +int64_t ff_read_line_to_bprint(AVIOContext *s, AVBPrint *bp); + +/** + * 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" /** |