* new elements have been added after this struct in AVFormatContext
* or AVIOContext.
*/
-typedef struct {
+typedef struct AVIOInterruptCB {
int (*callback)(void*);
void *opaque;
} AVIOInterruptCB;
* when implementing custom I/O. Normally these are set to the
* function pointers specified in avio_alloc_context()
*/
-typedef struct {
+typedef struct AVIOContext {
/**
* A class for private options.
*
* warning -- this field can be NULL, be sure to not pass this AVIOContext
* to any av_opt_* functions in that case.
*/
- AVClass *av_class;
+ const AVClass *av_class;
unsigned char *buffer; /**< Start of the buffer. */
int buffer_size; /**< Maximum buffer size */
unsigned char *buf_ptr; /**< Current position in the buffer */
*/
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.
- */
-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
* freed with av_free().
* Close the resource accessed by the AVIOContext s and free it.
* This function can only be used if s was opened by avio_open().
*
+ * The internal buffer is automatically flushed before closing the
+ * resource.
+ *
* @return 0 on success, an AVERROR < 0 on error.
+ * @see avio_closep
*/
int avio_close(AVIOContext *s);
+/**
+ * Close the resource accessed by the AVIOContext *s, free it
+ * and set the pointer pointing to it to NULL.
+ * This function can only be used if s was opened by avio_open().
+ *
+ * The internal buffer is automatically flushed before closing the
+ * resource.
+ *
+ * @return 0 on success, an AVERROR < 0 on error.
+ * @see avio_close
+ */
+int avio_closep(AVIOContext **s);
+
+
/**
* Open a write only memory stream.
*