--- libavformat/allformats.c | 3 ++- libavformat/avio.c | 10 +++++++--- libavformat/avio.h | 4 +++- libavformat/url.h | 7 +++++++ 4 files changed, 19 insertions(+), 5 deletions(-)
diff --git a/libavformat/allformats.c b/libavformat/allformats.c index e80d4b0..9398d34 100644 --- a/libavformat/allformats.c +++ b/libavformat/allformats.c @@ -21,6 +21,7 @@ #include "avformat.h" #include "rtp.h" #include "rdt.h" +#include "url.h" #define REGISTER_MUXER(X,x) { \ extern AVOutputFormat ff_##x##_muxer; \ @@ -34,7 +35,7 @@ #define REGISTER_PROTOCOL(X,x) { \ extern URLProtocol ff_##x##_protocol; \ - if(CONFIG_##X##_PROTOCOL) av_register_protocol2(&ff_##x##_protocol, sizeof(ff_##x##_protocol)); } + if(CONFIG_##X##_PROTOCOL) ffurl_register_protocol(&ff_##x##_protocol, sizeof(ff_##x##_protocol)); } void av_register_all(void) { diff --git a/libavformat/avio.c b/libavformat/avio.c index c15ccdc..972ad10 100644 --- a/libavformat/avio.c +++ b/libavformat/avio.c @@ -66,7 +66,7 @@ const char *avio_enum_protocols(void **opaque) return *p ? (*p)->name : NULL; } -int av_register_protocol2(URLProtocol *protocol, int size) +int ffurl_register_protocol(URLProtocol *protocol, int size) { URLProtocol **p; if (size < sizeof(URLProtocol)) { @@ -95,12 +95,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 @@ -229,6 +229,10 @@ 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 \ diff --git a/libavformat/avio.h b/libavformat/avio.h index c01ed63..335c7bb 100644 --- a/libavformat/avio.h +++ b/libavformat/avio.h @@ -186,12 +186,14 @@ attribute_deprecated int register_protocol(URLProtocol *protocol); attribute_deprecated int av_register_protocol(URLProtocol *protocol); #endif +#if FF_API_OLD_AVIO /** * Register the URLProtocol protocol. * * @param size the size of the URLProtocol struct referenced */ -int av_register_protocol2(URLProtocol *protocol, int size); +attribute_deprecated int av_register_protocol2(URLProtocol *protocol, int size); +#endif #define AVIO_SEEKABLE_NORMAL 0x0001 /**< Seeking works like for a local file */ diff --git a/libavformat/url.h b/libavformat/url.h index 72c19b6..2e1a3f3 100644 --- a/libavformat/url.h +++ b/libavformat/url.h @@ -131,4 +131,11 @@ int64_t ffurl_size(URLContext *h); */ int ffurl_get_file_handle(URLContext *h); +/** + * Register the URLProtocol protocol. + * + * @param size the size of the URLProtocol struct referenced + */ +int ffurl_register_protocol(URLProtocol *protocol, int size); + #endif //AVFORMAT_URL_H -- 1.7.4.1 _______________________________________________ libav-devel mailing list libav-devel@libav.org https://lists.libav.org/mailman/listinfo/libav-devel