]> git.sesse.net Git - ffmpeg/commitdiff
avio: Mark the old interrupt callback mechanism as deprecated
authorMartin Storsjö <martin@martin.st>
Mon, 7 Nov 2011 10:17:50 +0000 (12:17 +0200)
committerAnton Khirnov <anton@khirnov.net>
Fri, 18 Nov 2011 10:01:16 +0000 (11:01 +0100)
Prepare for removing it at an upcoming major bump.

libavformat/avio.c
libavformat/avio.h
libavformat/version.h

index 9de435e0731b8769f4289a14b3cf4ad1da16de4d..4750a9d54441146a406f2545df7b09d083e6c0ef 100644 (file)
@@ -83,9 +83,11 @@ const AVClass ffurl_context_class = {
 };
 /*@}*/
 
-static int default_interrupt_cb(void);
 
+#if FF_API_OLD_INTERRUPT_CB
+static int default_interrupt_cb(void);
 int (*url_interrupt_cb)(void) = default_interrupt_cb;
+#endif
 
 #if FF_API_OLD_AVIO
 URLProtocol *av_protocol_next(URLProtocol *p)
@@ -441,6 +443,7 @@ int ffurl_get_file_handle(URLContext *h)
     return h->prot->url_get_file_handle(h);
 }
 
+#if FF_API_OLD_INTERRUPT_CB
 static int default_interrupt_cb(void)
 {
     return 0;
@@ -452,13 +455,18 @@ void avio_set_interrupt_cb(int (*interrupt_cb)(void))
         interrupt_cb = default_interrupt_cb;
     url_interrupt_cb = interrupt_cb;
 }
+#endif
 
 int ff_check_interrupt(AVIOInterruptCB *cb)
 {
     int ret;
     if (cb && cb->callback && (ret = cb->callback(cb->opaque)))
         return ret;
+#if FF_API_OLD_INTERRUPT_CB
     return url_interrupt_cb();
+#else
+    return 0;
+#endif
 }
 
 #if FF_API_OLD_AVIO
index b665bb3b3b7085b97fdb8cd3b1650e879dcef52a..d7977022bfb187fab1b8646418267101287b5047 100644 (file)
@@ -389,13 +389,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
index 6c1db42d2118b06be8d3d548bce43e8837778970..d56bdb7c87e4a01ec80cef20e822d2ca8e714ba6 100644 (file)
 #ifndef FF_API_REORDER_PRIVATE
 #define FF_API_REORDER_PRIVATE         (LIBAVFORMAT_VERSION_MAJOR < 54)
 #endif
+#ifndef FF_API_OLD_INTERRUPT_CB
+#define FF_API_OLD_INTERRUPT_CB        (LIBAVFORMAT_VERSION_MAJOR < 54)
+#endif
 
 #endif /* AVFORMAT_VERSION_H */