X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavformat%2Favio_internal.h;h=fe87f2a28874550691868ea6e58c4b0d42907ec9;hb=3a370868dc33061a20d1fd99274e65167d7a78ac;hp=04c1ad5157bf188c7c9c92219d649c168daf4f5d;hpb=34a0a9746b2f441db7c45983838a88aa87a33834;p=ffmpeg diff --git a/libavformat/avio_internal.h b/libavformat/avio_internal.h index 04c1ad5157b..fe87f2a2887 100644 --- a/libavformat/avio_internal.h +++ b/libavformat/avio_internal.h @@ -86,12 +86,23 @@ int ffio_read_size(AVIOContext *s, unsigned char *buf, int size); /** @warning must be called before any I/O */ int ffio_set_buf_size(AVIOContext *s, int buf_size); +/** + * Reallocate a given buffer for AVIOContext. + * + * @param s the AVIOContext to realloc. + * @param buf_size required new buffer size. + * @return 0 on success, a negative AVERROR on failure. + */ +int ffio_realloc_buf(AVIOContext *s, int buf_size); + /** * Ensures that the requested seekback buffer size will be available * * Will ensure that when reading sequentially up to buf_size, seeking * within the current pos and pos+buf_size is possible. - * Once the stream position moves outside this window this guarantee is lost. + * Once the stream position moves outside this window or another + * ffio_ensure_seekback call requests a buffer outside this window this + * guarantee is lost. */ int ffio_ensure_seekback(AVIOContext *s, int64_t buf_size); @@ -162,6 +173,13 @@ int ffio_open_whitelist(AVIOContext **s, const char *url, int flags, */ int ffio_close_null_buf(AVIOContext *s); +/** + * Reset a dynamic buffer. + * + * Resets everything, but keeps the allocated buffer for later use. + */ +void ffio_reset_dyn_buf(AVIOContext *s); + /** * Free a dynamic buffer. *