From 832a202c47a246ed15e3edc6b05dfcfa7d82c4b2 Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Fri, 19 Feb 2016 11:17:22 +0100 Subject: protocols: make the list of protocols static Disallow other code to touch it directly, now it's only accessible through a blacklisting/whitelisting function. --- libavformat/url.h | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'libavformat/url.h') diff --git a/libavformat/url.h b/libavformat/url.h index 3006905446..455021964e 100644 --- a/libavformat/url.h +++ b/libavformat/url.h @@ -266,6 +266,20 @@ void ff_make_absolute_url(char *buf, int size, const char *base, const AVClass *ff_urlcontext_child_class_next(const AVClass *prev); -extern const URLProtocol *ff_url_protocols[]; +/** + * Construct a list of protocols matching a given whitelist and/or blacklist. + * + * @param whitelist a comma-separated list of allowed protocol names or NULL. If + * this is a non-empty string, only protocols in this list will + * be included. + * @param blacklist a comma-separated list of forbidden protocol names or NULL. + * If this is a non-empty string, all protocols in this list + * will be excluded. + * + * @return a NULL-terminated array of matching protocols. The array must be + * freed by the caller. + */ +const URLProtocol **ffurl_get_protocols(const char *whitelist, + const char *blacklist); #endif /* AVFORMAT_URL_H */ -- cgit v1.2.3