diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2011-04-08 02:50:13 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2011-04-08 02:50:13 +0200 |
commit | c88caa522c41cd4108d39d8dd98805e867606ae3 (patch) | |
tree | 90eacfa0065bb907cd6543f5b2865d31d3d0a677 /libavformat/avio.c | |
parent | db95e559f2b1c392295b09e8457d6f161eb5acdb (diff) | |
parent | a2031251c7eedd0d82cb9e08717990fa2ae6299f (diff) | |
download | ffmpeg-c88caa522c41cd4108d39d8dd98805e867606ae3.tar.gz |
Merge remote branch 'qatar/master'
* qatar/master:
proto: include os_support.h in network.h
matroskaenc: don't write an empty Cues element.
lavc: add a FF_API_REQUEST_CHANNELS deprecation macro
avio: move extern url_interrupt_cb declaration from avio.h to url.h
avio: make av_register_protocol2 internal.
avio: avio_ prefix for url_set_interrupt_cb.
avio: AVIO_ prefixes for URL_ open flags.
proto: introduce listen option in tcp
doc: clarify configure features
proto: factor ff_network_wait_fd and use it on udp
Conflicts:
ffmpeg.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/avio.c')
-rw-r--r-- | libavformat/avio.c | 28 |
1 files changed, 18 insertions, 10 deletions
diff --git a/libavformat/avio.c b/libavformat/avio.c index ddaafc84ea..7b066e3c08 100644 --- a/libavformat/avio.c +++ b/libavformat/avio.c @@ -57,7 +57,7 @@ URLProtocol *av_protocol_next(URLProtocol *p) else return first_protocol; } -int av_register_protocol2(URLProtocol *protocol, int size) +int ffurl_register_protocol(URLProtocol *protocol, int size) { URLProtocol **p; if (size < sizeof(URLProtocol)) { @@ -86,12 +86,12 @@ struct URLProtocol_compat { int av_register_protocol(URLProtocol *protocol) { - return av_register_protocol2(protocol, sizeof(struct URLProtocol_compat)); + return ffurl_register_protocol(protocol, sizeof(struct URLProtocol_compat)); } int register_protocol(URLProtocol *protocol) { - return av_register_protocol2(protocol, sizeof(struct URLProtocol_compat)); + return ffurl_register_protocol(protocol, sizeof(struct URLProtocol_compat)); } #endif @@ -144,7 +144,7 @@ int ffurl_connect(URLContext* uc) return err; uc->is_connected = 1; //We must be careful here as ffurl_seek() could be slow, for example for http - if( (uc->flags & (URL_WRONLY | URL_RDWR)) + if( (uc->flags & (AVIO_WRONLY | AVIO_RDWR)) || !strcmp(uc->prot->name, "file")) if(!uc->is_streamed && ffurl_seek(uc, 0, SEEK_SET) < 0) uc->is_streamed= 1; @@ -216,6 +216,14 @@ void url_get_filename(URLContext *h, char *buf, int buf_size) { av_strlcpy(buf, h->filename, buf_size); } +void url_set_interrupt_cb(URLInterruptCB *interrupt_cb) +{ + avio_set_interrupt_cb(interrupt_cb); +} +int av_register_protocol2(URLProtocol *protocol, int size) +{ + return ffurl_register_protocol(protocol, size); +} #endif #define URL_SCHEME_CHARS \ @@ -275,7 +283,7 @@ static inline int retry_transfer_wrapper(URLContext *h, unsigned char *buf, int ret = transfer_func(h, buf+len, size-len); if (ret == AVERROR(EINTR)) continue; - if (h->flags & URL_FLAG_NONBLOCK) + if (h->flags & AVIO_FLAG_NONBLOCK) return ret; if (ret == AVERROR(EAGAIN)) { ret = 0; @@ -296,21 +304,21 @@ static inline int retry_transfer_wrapper(URLContext *h, unsigned char *buf, int int ffurl_read(URLContext *h, unsigned char *buf, int size) { - if (h->flags & URL_WRONLY) + if (h->flags & AVIO_WRONLY) return AVERROR(EIO); return retry_transfer_wrapper(h, buf, size, 1, h->prot->url_read); } int ffurl_read_complete(URLContext *h, unsigned char *buf, int size) { - if (h->flags & URL_WRONLY) + if (h->flags & AVIO_WRONLY) return AVERROR(EIO); return retry_transfer_wrapper(h, buf, size, size, h->prot->url_read); } int ffurl_write(URLContext *h, const unsigned char *buf, int size) { - if (!(h->flags & (URL_WRONLY | URL_RDWR))) + if (!(h->flags & (AVIO_WRONLY | AVIO_RDWR))) return AVERROR(EIO); /* avoid sending too big packets */ if (h->max_packet_size && size > h->max_packet_size) @@ -348,7 +356,7 @@ int ffurl_close(URLContext *h) int url_exist(const char *filename) { URLContext *h; - if (ffurl_open(&h, filename, URL_RDONLY) < 0) + if (ffurl_open(&h, filename, AVIO_RDONLY) < 0) return 0; ffurl_close(h); return 1; @@ -381,7 +389,7 @@ static int default_interrupt_cb(void) return 0; } -void url_set_interrupt_cb(URLInterruptCB *interrupt_cb) +void avio_set_interrupt_cb(URLInterruptCB *interrupt_cb) { if (!interrupt_cb) interrupt_cb = default_interrupt_cb; |