diff options
author | Anton Khirnov <anton@khirnov.net> | 2016-02-19 10:39:29 +0100 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2016-02-22 11:30:58 +0100 |
commit | 2758cdedfb7ac61f8b5e4861f99218b6fd43491d (patch) | |
tree | 7280b43fe38dff1db077ffd8ebfeabbb850718d4 /libavformat/url.h | |
parent | 225e84e74544062706c0159ec0737b0e1d40915f (diff) | |
download | ffmpeg-2758cdedfb7ac61f8b5e4861f99218b6fd43491d.tar.gz |
lavf: reorganize URLProtocols
Instead of a linked list constructed at av_register_all(), store them
in a constant array of pointers.
Since no registration is necessary now, this removes some global state
from lavf. This will also allow the urlprotocol layer caller to limit
the available protocols in a simple and flexible way in the following
commits.
Diffstat (limited to 'libavformat/url.h')
-rw-r--r-- | libavformat/url.h | 16 |
1 files changed, 2 insertions, 14 deletions
diff --git a/libavformat/url.h b/libavformat/url.h index 4f153ce2aa..a8f292ce9f 100644 --- a/libavformat/url.h +++ b/libavformat/url.h @@ -37,7 +37,7 @@ extern const AVClass ffurl_context_class; typedef struct URLContext { const AVClass *av_class; /**< information for av_log(). Set by url_open(). */ - struct URLProtocol *prot; + const struct URLProtocol *prot; void *priv_data; char *filename; /**< specified URL */ int flags; @@ -73,7 +73,6 @@ typedef struct URLProtocol { int (*url_write)(URLContext *h, const unsigned char *buf, int size); int64_t (*url_seek)( URLContext *h, int64_t pos, int whence); int (*url_close)(URLContext *h); - struct URLProtocol *next; int (*url_read_pause)(URLContext *h, int pause); int64_t (*url_read_seek)(URLContext *h, int stream_index, int64_t timestamp, int flags); @@ -220,23 +219,11 @@ int ffurl_get_multi_file_handle(URLContext *h, int **handles, int *numhandles); int ffurl_shutdown(URLContext *h, int flags); /** - * Register the URLProtocol protocol. - */ -int ffurl_register_protocol(URLProtocol *protocol); - -/** * Check if the user has requested to interrup a blocking function * associated with cb. */ int ff_check_interrupt(AVIOInterruptCB *cb); -/** - * Iterate over all available protocols. - * - * @param prev result of the previous call to this functions or NULL. - */ -URLProtocol *ffurl_protocol_next(const URLProtocol *prev); - /* udp.c */ int ff_udp_set_remote_url(URLContext *h, const char *uri); int ff_udp_get_local_port(URLContext *h); @@ -277,5 +264,6 @@ int ff_url_join(char *str, int size, const char *proto, void ff_make_absolute_url(char *buf, int size, const char *base, const char *rel); +extern const URLProtocol *ff_url_protocols[]; #endif /* AVFORMAT_URL_H */ |