History

avio: Mark the old interrupt callback mechanism as deprecated

Prepare for removing it at an upcoming major bump.

Martin Storsjö committed 15 years ago

Commit 45f511e1 parent 40972f73 files · +17 −2Browse files

Unified · Split

3 files
  1. libavformat/avio.c +9 −1
  2. libavformat/avio.h +5 −1
  3. libavformat/version.h +3 −0
libavformat/avio.c+9−1
@@ -83,9 +83,11 @@ const AVClass ffurl_context_class = { · 82 unmodified lines
8383 };
8484 /*@}*/
8585
86−static int default_interrupt_cb(void);
8786
87+#if FF_API_OLD_INTERRUPT_CB
88+static int default_interrupt_cb(void);
8889 int (*url_interrupt_cb)(void) = default_interrupt_cb;
90+#endif
8991
9092 #if FF_API_OLD_AVIO
9193 URLProtocol *av_protocol_next(URLProtocol *p)
@@ -441,6 +443,7 @@ int ffurl_get_file_handle(URLContext *h) · 349 unmodified lines
441443 return h->prot->url_get_file_handle(h);
442444 }
443445
446+#if FF_API_OLD_INTERRUPT_CB
444447 static int default_interrupt_cb(void)
445448 {
446449 return 0;
@@ -452,13 +455,18 @@ void avio_set_interrupt_cb(int (*interrupt_cb)(void)) · 5 unmodified lines
452455 interrupt_cb = default_interrupt_cb;
453456 url_interrupt_cb = interrupt_cb;
454457 }
458+#endif
455459
456460 int ff_check_interrupt(AVIOInterruptCB *cb)
457461 {
458462 int ret;
459463 if (cb && cb->callback && (ret = cb->callback(cb->opaque)))
460464 return ret;
465+#if FF_API_OLD_INTERRUPT_CB
461466 return url_interrupt_cb();
467+#else
468+ return 0;
469+#endif
462470 }
463471
464472 #if FF_API_OLD_AVIO
libavformat/avio.h+5−1
@@ -389,13 +389,17 @@ attribute_deprecated int url_exist(const char *url); · 388 unmodified lines
389389 */
390390 int avio_check(const char *url, int flags);
391391
392+#if FF_API_OLD_INTERRUPT_CB
392393 /**
393394 * The callback is called in blocking functions to test regulary if
394395 * asynchronous interruption is needed. AVERROR_EXIT is returned
395396 * in this case by the interrupted function. 'NULL' means no interrupt
396397 * callback is given.
398+ * @deprecated Use interrupt_callback in AVFormatContext/avio_open2
399+ * instead.
397400 */
398−void avio_set_interrupt_cb(int (*interrupt_cb)(void));
401+attribute_deprecated void avio_set_interrupt_cb(int (*interrupt_cb)(void));
402+#endif
399403
400404 /**
401405 * Allocate and initialize an AVIOContext for buffered I/O. It must be later
libavformat/version.h+3−0
@@ -110,5 +110,8 @@ · 109 unmodified lines
110110 #ifndef FF_API_REORDER_PRIVATE
111111 #define FF_API_REORDER_PRIVATE (LIBAVFORMAT_VERSION_MAJOR < 54)
112112 #endif
113+#ifndef FF_API_OLD_INTERRUPT_CB
114+#define FF_API_OLD_INTERRUPT_CB (LIBAVFORMAT_VERSION_MAJOR < 54)
115+#endif
113116
114117 #endif /* AVFORMAT_VERSION_H */

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t