diff options
author | Fabrice Bellard <fabrice@bellard.org> | 2003-07-17 10:25:36 +0000 |
---|---|---|
committer | Fabrice Bellard <fabrice@bellard.org> | 2003-07-17 10:25:36 +0000 |
commit | 019ac05ace07ce3e911b90acaee64758028e7375 (patch) | |
tree | 51cab1d95c3946105ceaa6715963faa7c9583729 /libavformat/avio.h | |
parent | d5809b0aa2852957bc34aaaa69f159c136d97359 (diff) | |
download | ffmpeg-019ac05ace07ce3e911b90acaee64758028e7375.tar.gz |
added primitive aborting system
Originally committed as revision 2058 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/avio.h')
-rw-r--r-- | libavformat/avio.h | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/libavformat/avio.h b/libavformat/avio.h index 29e9489d60..b31689ab25 100644 --- a/libavformat/avio.h +++ b/libavformat/avio.h @@ -28,6 +28,8 @@ typedef struct URLPollEntry { #define URL_WRONLY 1 #define URL_RDWR 2 +typedef int URLInterruptCB(void); + int url_open(URLContext **h, const char *filename, int flags); int url_read(URLContext *h, unsigned char *buf, int size); int url_write(URLContext *h, unsigned char *buf, int size); @@ -38,6 +40,12 @@ offset_t url_filesize(URLContext *h); int url_get_max_packet_size(URLContext *h); void url_get_filename(URLContext *h, char *buf, int buf_size); +/* the callback is called in blocking functions to test regulary if + asynchronous interruption is needed. -EINTR is returned in this + case by the interrupted function. 'NULL' means no interrupt + callback is given. */ +void url_set_interrupt_cb(URLInterruptCB *interrupt_cb); + /* not implemented */ int url_poll(URLPollEntry *poll_table, int n, int timeout); @@ -52,6 +60,7 @@ typedef struct URLProtocol { } URLProtocol; extern URLProtocol *first_protocol; +extern URLInterruptCB *url_interrupt_cb; int register_protocol(URLProtocol *protocol); @@ -100,7 +109,7 @@ int url_feof(ByteIOContext *s); #define URL_EOF (-1) int url_fgetc(ByteIOContext *s); -int url_fprintf(ByteIOContext *s, const char *fmt, ...); +int url_fprintf(ByteIOContext *s, const char *fmt, ...) __attribute__ ((format (printf, 2, 3))); char *url_fgets(ByteIOContext *s, char *buf, int buf_size); void put_flush_packet(ByteIOContext *s); |