diff options
Diffstat (limited to 'libavformat/avio_internal.h')
-rw-r--r-- | libavformat/avio_internal.h | 39 |
1 files changed, 24 insertions, 15 deletions
diff --git a/libavformat/avio_internal.h b/libavformat/avio_internal.h index 8616499..c01835d 100644 --- a/libavformat/avio_internal.h +++ b/libavformat/avio_internal.h @@ -1,18 +1,18 @@ /* - * This file is part of Libav. + * This file is part of FFmpeg. * - * Libav is free software; you can redistribute it and/or + * FFmpeg is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * - * Libav is distributed in the hope that it will be useful, + * FFmpeg is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with Libav; if not, write to the Free Software + * License along with FFmpeg; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ @@ -53,14 +53,6 @@ int ffio_init_context(AVIOContext *s, */ int ffio_read_indirect(AVIOContext *s, unsigned char *buf, int size, const unsigned char **data); -/** - * Read size bytes from AVIOContext into buf. - * This reads at most 1 packet. If that is not enough fewer bytes will be - * returned. - * @return number of bytes read or AVERROR - */ -int ffio_read_partial(AVIOContext *s, unsigned char *buf, int size); - void ffio_fill(AVIOContext *s, int b, int count); static av_always_inline void ffio_wfourcc(AVIOContext *pb, const uint8_t *s) @@ -77,10 +69,10 @@ static av_always_inline void ffio_wfourcc(AVIOContext *pb, const uint8_t *s) * @param s The read-only AVIOContext to rewind * @param buf The probe buffer containing the first buf_size bytes of the file * @param buf_size The size of buf - * @return 0 in case of success, a negative value corresponding to an + * @return >= 0 in case of success, a negative value corresponding to an * AVERROR code in case of failure */ -int ffio_rewind_with_probe_data(AVIOContext *s, unsigned char *buf, int buf_size); +int ffio_rewind_with_probe_data(AVIOContext *s, unsigned char **buf, int buf_size); uint64_t ffio_read_varlen(AVIOContext *bc); @@ -94,12 +86,25 @@ 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); +/** + * 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. + */ +int ffio_ensure_seekback(AVIOContext *s, int64_t buf_size); + +int ffio_limit(AVIOContext *s, int size); + void ffio_init_checksum(AVIOContext *s, unsigned long (*update_checksum)(unsigned long c, const uint8_t *p, unsigned int len), unsigned long checksum); unsigned long ffio_get_checksum(AVIOContext *s); unsigned long ff_crc04C11DB7_update(unsigned long checksum, const uint8_t *buf, unsigned int len); +unsigned long ff_crcEDB88320_update(unsigned long checksum, const uint8_t *buf, + unsigned int len); unsigned long ff_crcA001_update(unsigned long checksum, const uint8_t *buf, unsigned int len); @@ -122,7 +127,7 @@ int ffio_open_dyn_packet_buf(AVIOContext **s, int max_packet_size); * * @param s Used to return the pointer to the created AVIOContext. * In case of failure the pointed to value is set to NULL. - * @return 0 in case of success, a negative value corresponding to an + * @return >= 0 in case of success, a negative value corresponding to an * AVERROR code in case of failure */ int ffio_fdopen(AVIOContext **s, URLContext *h); @@ -137,6 +142,10 @@ int ffio_fdopen(AVIOContext **s, URLContext *h); */ int ffio_open_null_buf(AVIOContext **s); +int ffio_open_whitelist(AVIOContext **s, const char *url, int flags, + const AVIOInterruptCB *int_cb, AVDictionary **options, + const char *whitelist, const char *blacklist); + /** * Close a null buffer. * |