Prepare for removing it at an upcoming major bump.
Unified · Split
| @@ -83,9 +83,11 @@ const AVClass ffurl_context_class = { · 82 unmodified lines | ||
| 83 | 83 | }; |
| 84 | 84 | /*@}*/ |
| 85 | 85 | |
| 86 | −static int default_interrupt_cb(void); | |
| 87 | 86 | |
| 87 | +#if FF_API_OLD_INTERRUPT_CB | |
| 88 | +static int default_interrupt_cb(void); | |
| 88 | 89 | int (*url_interrupt_cb)(void) = default_interrupt_cb; |
| 90 | +#endif | |
| 89 | 91 | |
| 90 | 92 | #if FF_API_OLD_AVIO |
| 91 | 93 | URLProtocol *av_protocol_next(URLProtocol *p) |
| @@ -441,6 +443,7 @@ int ffurl_get_file_handle(URLContext *h) · 349 unmodified lines | ||
| 441 | 443 | return h->prot->url_get_file_handle(h); |
| 442 | 444 | } |
| 443 | 445 | |
| 446 | +#if FF_API_OLD_INTERRUPT_CB | |
| 444 | 447 | static int default_interrupt_cb(void) |
| 445 | 448 | { |
| 446 | 449 | return 0; |
| @@ -452,13 +455,18 @@ void avio_set_interrupt_cb(int (*interrupt_cb)(void)) · 5 unmodified lines | ||
| 452 | 455 | interrupt_cb = default_interrupt_cb; |
| 453 | 456 | url_interrupt_cb = interrupt_cb; |
| 454 | 457 | } |
| 458 | +#endif | |
| 455 | 459 | |
| 456 | 460 | int ff_check_interrupt(AVIOInterruptCB *cb) |
| 457 | 461 | { |
| 458 | 462 | int ret; |
| 459 | 463 | if (cb && cb->callback && (ret = cb->callback(cb->opaque))) |
| 460 | 464 | return ret; |
| 465 | +#if FF_API_OLD_INTERRUPT_CB | |
| 461 | 466 | return url_interrupt_cb(); |
| 467 | +#else | |
| 468 | + return 0; | |
| 469 | +#endif | |
| 462 | 470 | } |
| 463 | 471 | |
| 464 | 472 | #if FF_API_OLD_AVIO |
| @@ -389,13 +389,17 @@ attribute_deprecated int url_exist(const char *url); · 388 unmodified lines | ||
| 389 | 389 | */ |
| 390 | 390 | int avio_check(const char *url, int flags); |
| 391 | 391 | |
| 392 | +#if FF_API_OLD_INTERRUPT_CB | |
| 392 | 393 | /** |
| 393 | 394 | * The callback is called in blocking functions to test regulary if |
| 394 | 395 | * asynchronous interruption is needed. AVERROR_EXIT is returned |
| 395 | 396 | * in this case by the interrupted function. 'NULL' means no interrupt |
| 396 | 397 | * callback is given. |
| 398 | + * @deprecated Use interrupt_callback in AVFormatContext/avio_open2 | |
| 399 | + * instead. | |
| 397 | 400 | */ |
| 398 | −void avio_set_interrupt_cb(int (*interrupt_cb)(void)); | |
| 401 | +attribute_deprecated void avio_set_interrupt_cb(int (*interrupt_cb)(void)); | |
| 402 | +#endif | |
| 399 | 403 | |
| 400 | 404 | /** |
| 401 | 405 | * Allocate and initialize an AVIOContext for buffered I/O. It must be later |
| @@ -110,5 +110,8 @@ · 109 unmodified lines | ||
| 110 | 110 | #ifndef FF_API_REORDER_PRIVATE |
| 111 | 111 | #define FF_API_REORDER_PRIVATE (LIBAVFORMAT_VERSION_MAJOR < 54) |
| 112 | 112 | #endif |
| 113 | +#ifndef FF_API_OLD_INTERRUPT_CB | |
| 114 | +#define FF_API_OLD_INTERRUPT_CB (LIBAVFORMAT_VERSION_MAJOR < 54) | |
| 115 | +#endif | |
| 113 | 116 | |
| 114 | 117 | #endif /* AVFORMAT_VERSION_H */ |