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