]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/url.h
avcodec: Add utils test
[ffmpeg] / libavformat / url.h
index 0b4f2ee376fe7dc21b70fa240b03075e3636bcff..95acd27b467d168c5eed2193103ff2a73e8dc9ef 100644 (file)
@@ -1,5 +1,4 @@
 /*
- *
  * This file is part of FFmpeg.
  *
  * FFmpeg is free software; you can redistribute it and/or
@@ -38,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;
@@ -78,7 +77,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);
@@ -258,24 +256,12 @@ 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);
@@ -323,5 +309,22 @@ void ff_make_absolute_url(char *buf, int size, const char *base,
  */
 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 */