/*
- *
* This file is part of FFmpeg.
*
* FFmpeg is free software; you can redistribute it and/or
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;
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);
*/
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);
*/
AVIODirEntry *ff_alloc_dir_entry(void);
+const AVClass *ff_urlcontext_child_class_next(const AVClass *prev);
+
+/**
+ * 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 */