summaryrefslogtreecommitdiff
path: root/libavformat/url.h
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2016-02-19 18:02:45 +0100
committerAnton Khirnov <anton@khirnov.net>2016-02-22 11:45:31 +0100
commit8c0ceafb0f25da077ff23e394667119f031574fd (patch)
treec495ca2679de2d9c0bc436652cfb5764cee47905 /libavformat/url.h
parentcae448cfbf31d492cba782bc64fc4eed556ed83d (diff)
urlprotocol: receive a list of protocols from the caller
This way, the decisions about which protocols are available for use in any given situations can be delegated to the caller.
Diffstat (limited to 'libavformat/url.h')
-rw-r--r--libavformat/url.h16
1 files changed, 14 insertions, 2 deletions
diff --git a/libavformat/url.h b/libavformat/url.h
index 455021964e..482658b7fe 100644
--- a/libavformat/url.h
+++ b/libavformat/url.h
@@ -38,6 +38,10 @@ extern const AVClass ffurl_context_class;
typedef struct URLContext {
const AVClass *av_class; /**< information for av_log(). Set by url_open(). */
const struct URLProtocol *prot;
+ /**
+ * A NULL-terminated list of protocols usable by the child contexts.
+ */
+ const struct URLProtocol **protocols;
void *priv_data;
char *filename; /**< specified URL */
int flags;
@@ -96,11 +100,15 @@ typedef struct URLProtocol {
* is to be opened
* @param int_cb interrupt callback to use for the URLContext, may be
* NULL
+ * @param protocols a NULL-terminate list of protocols available for use by
+ * this context and its children. The caller must ensure this
+ * list remains valid until the context is closed.
* @return 0 in case of success, a negative value corresponding to an
* AVERROR code in case of failure
*/
int ffurl_alloc(URLContext **puc, const char *filename, int flags,
- const AVIOInterruptCB *int_cb);
+ const AVIOInterruptCB *int_cb,
+ const URLProtocol **protocols);
/**
* Connect an URLContext that has been allocated by ffurl_alloc
@@ -125,11 +133,15 @@ int ffurl_connect(URLContext *uc, AVDictionary **options);
* @param options A dictionary filled with protocol-private options. On return
* this parameter will be destroyed and replaced with a dict containing options
* that were not found. May be NULL.
+ * @param protocols a NULL-terminate list of protocols available for use by
+ * this context and its children. The caller must ensure this
+ * list remains valid until the context is closed.
* @return 0 in case of success, a negative value corresponding to an
* AVERROR code in case of failure
*/
int ffurl_open(URLContext **puc, const char *filename, int flags,
- const AVIOInterruptCB *int_cb, AVDictionary **options);
+ const AVIOInterruptCB *int_cb, AVDictionary **options,
+ const URLProtocol **protocols);
/**
* Read up to size bytes from the resource accessed by h, and store