]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/url.h
extract_extradata_bsf: make sure all needed parameter set NALUs were found
[ffmpeg] / libavformat / url.h
index a8f292ce9fdf562ebd651e0b91ee23cfb27f5da2..5853ffee7af2dbd1024455fe8ede993170d6cc86 100644 (file)
@@ -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;
@@ -45,6 +49,7 @@ typedef struct URLContext {
     int is_streamed;            /**< true if streamed (no seek possible), default = false */
     int is_connected;
     AVIOInterruptCB interrupt_callback;
+    int64_t rw_timeout;         /**< maximum time to wait for (network) read/write operation completion, in microseconds */
 } URLContext;
 
 typedef struct URLProtocol {
@@ -96,11 +101,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 +134,17 @@ 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.
+ * @param parent An enclosing URLContext, whose generic options should
+ *               be applied to this URLContext as well.
  * @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, URLContext *parent);
 
 /**
  * Read up to size bytes from the resource accessed by h, and store
@@ -219,7 +234,7 @@ int ffurl_get_multi_file_handle(URLContext *h, int **handles, int *numhandles);
 int ffurl_shutdown(URLContext *h, int flags);
 
 /**
- * Check if the user has requested to interrup a blocking function
+ * Check if the user has requested to interrupt a blocking function
  * associated with cb.
  */
 int ff_check_interrupt(AVIOInterruptCB *cb);
@@ -264,6 +279,22 @@ 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[];
+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 */