]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/avio.h
mxfdec: Make sure x < index_table->nb_ptses
[ffmpeg] / libavformat / avio.h
index b665bb3b3b7085b97fdb8cd3b1650e879dcef52a..920526f028158a7c5e0d8874f2dde88d1bd32c29 100644 (file)
@@ -1,20 +1,20 @@
 /*
  * copyright (c) 2001 Fabrice Bellard
  *
- * 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
  */
 #ifndef AVFORMAT_AVIO_H
@@ -22,6 +22,7 @@
 
 /**
  * @file
+ * @ingroup lavf_io
  * Buffered I/O operations
  */
 
@@ -119,6 +120,12 @@ typedef struct {
      * A combination of AVIO_SEEKABLE_ flags or 0 when the stream is not seekable.
      */
     int seekable;
+
+    /**
+     * max filesize, used to limit allocations
+     * This field is internal to libavformat and access from outside is not allowed.
+     */
+     int64_t maxsize;
 } AVIOContext;
 
 /* unbuffered I/O */
@@ -211,6 +218,7 @@ extern URLInterruptCB *url_interrupt_cb;
  * @defgroup old_url_funcs Old url_* functions
  * The following functions are deprecated. Use the buffered API based on #AVIOContext instead.
  * @{
+ * @ingroup lavf_io
  */
 attribute_deprecated int url_open_protocol (URLContext **puc, struct URLProtocol *up,
                                             const char *url, int flags);
@@ -230,12 +238,13 @@ attribute_deprecated int av_url_read_pause(URLContext *h, int pause);
 attribute_deprecated int64_t av_url_read_seek(URLContext *h, int stream_index,
                                               int64_t timestamp, int flags);
 attribute_deprecated void url_set_interrupt_cb(int (*interrupt_cb)(void));
+
 /**
- * If protocol is NULL, returns the first registered protocol,
- * if protocol is non-NULL, returns the next registered protocol after protocol,
- * or NULL if protocol is the last one.
+ * returns the next registered protocol after the given protocol (the first if
+ * NULL is given), or NULL if protocol is the last one.
  */
-attribute_deprecated URLProtocol *av_protocol_next(URLProtocol *p);
+URLProtocol *av_protocol_next(URLProtocol *p);
+
 /**
  * Register the URLProtocol protocol.
  *
@@ -270,6 +279,7 @@ attribute_deprecated AVIOContext *av_alloc_put_byte(
  * @defgroup old_avio_funcs Old put_/get_*() functions
  * The following functions are deprecated. Use the "avio_"-prefixed functions instead.
  * @{
+ * @ingroup lavf_io
  */
 attribute_deprecated int          get_buffer(AVIOContext *s, unsigned char *buf, int size);
 attribute_deprecated int          get_partial_buffer(AVIOContext *s, unsigned char *buf, int size);
@@ -307,6 +317,7 @@ attribute_deprecated int64_t av_url_read_fseek (AVIOContext *h,    int stream_in
  * @defgroup old_url_f_funcs Old url_f* functions
  * The following functions are deprecated, use the "avio_"-prefixed functions instead.
  * @{
+ * @ingroup lavf_io
  */
 attribute_deprecated int url_fopen( AVIOContext **s, const char *url, int flags);
 attribute_deprecated int url_fclose(AVIOContext *s);
@@ -327,10 +338,6 @@ attribute_deprecated int url_fdopen(AVIOContext **s, URLContext *h);
  * @}
  */
 
-/**
- * @deprecated use AVIOContext.eof_reached
- */
-attribute_deprecated int url_feof(AVIOContext *s);
 attribute_deprecated int url_ferror(AVIOContext *s);
 
 attribute_deprecated int udp_set_remote_url(URLContext *h, const char *uri);
@@ -389,13 +396,17 @@ attribute_deprecated int url_exist(const char *url);
  */
 int avio_check(const char *url, int flags);
 
+#if FF_API_OLD_INTERRUPT_CB
 /**
  * The callback is called in blocking functions to test regulary if
  * asynchronous interruption is needed. AVERROR_EXIT is returned
  * in this case by the interrupted function. 'NULL' means no interrupt
  * callback is given.
+ * @deprecated Use interrupt_callback in AVFormatContext/avio_open2
+ *             instead.
  */
-void avio_set_interrupt_cb(int (*interrupt_cb)(void));
+attribute_deprecated void avio_set_interrupt_cb(int (*interrupt_cb)(void));
+#endif
 
 /**
  * Allocate and initialize an AVIOContext for buffered I/O. It must be later
@@ -471,10 +482,7 @@ int64_t avio_seek(AVIOContext *s, int64_t offset, int whence);
  * Skip given number of bytes forward
  * @return new position or AVERROR.
  */
-static av_always_inline int64_t avio_skip(AVIOContext *s, int64_t offset)
-{
-    return avio_seek(s, offset, SEEK_CUR);
-}
+int64_t avio_skip(AVIOContext *s, int64_t offset);
 
 /**
  * ftell() equivalent for AVIOContext.
@@ -491,6 +499,12 @@ static av_always_inline int64_t avio_tell(AVIOContext *s)
  */
 int64_t avio_size(AVIOContext *s);
 
+/**
+ * feof() equivalent for AVIOContext.
+ * @return non zero if and only if end of file
+ */
+int url_feof(AVIOContext *s);
+
 /** @warning currently size is limited */
 int avio_printf(AVIOContext *s, const char *fmt, ...) av_printf_format(2, 3);
 
@@ -638,6 +652,7 @@ int avio_close_dyn_buf(AVIOContext *s, uint8_t **pbuffer);
 
 /**
  * Iterate through names of available protocols.
+ * @note it is recommanded to use av_protocol_next() instead of this
  *
  * @param opaque A private pointer representing current protocol.
  *        It must be a pointer to NULL on first iteration and will